diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/alpha/config.in linux.20pre5-ac2/arch/alpha/config.in --- linux.20pre5/arch/alpha/config.in 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/alpha/config.in 2002-08-13 14:00:30.000000000 +0100 @@ -385,6 +385,7 @@ # fi # fi source drivers/video/Config.in + source drivers/char/speakup/Config.in if [ "$CONFIG_FB" = "y" ]; then define_bool CONFIG_PCI_CONSOLE y fi diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/alpha/kernel/process.c linux.20pre5-ac2/arch/alpha/kernel/process.c --- linux.20pre5/arch/alpha/kernel/process.c 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/alpha/kernel/process.c 2002-08-06 15:42:19.000000000 +0100 @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -74,9 +75,6 @@ cpu_idle(void) { /* An endless idle loop with no priority at all. */ - current->nice = 20; - current->counter = -100; - while (1) { /* FIXME -- EV6 and LCA45 know how to power down the CPU. */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/alpha/kernel/smp.c linux.20pre5-ac2/arch/alpha/kernel/smp.c --- linux.20pre5/arch/alpha/kernel/smp.c 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/alpha/kernel/smp.c 2002-08-06 15:42:19.000000000 +0100 @@ -82,6 +82,7 @@ int smp_num_cpus = 1; /* Number that came online. */ int smp_threads_ready; /* True once the per process idle is forked. */ cycles_t cacheflush_time; +unsigned long cache_decay_ticks; int __cpu_number_map[NR_CPUS]; int __cpu_logical_map[NR_CPUS]; @@ -156,11 +157,6 @@ { int cpuid = hard_smp_processor_id(); - if (current != init_tasks[cpu_number_map(cpuid)]) { - printk("BUG: smp_calling: cpu %d current %p init_tasks[cpu_number_map(cpuid)] %p\n", - cpuid, current, init_tasks[cpu_number_map(cpuid)]); - } - DBGS(("CALLIN %d state 0x%lx\n", cpuid, current->state)); /* Turn on machine checks. */ @@ -215,9 +211,6 @@ DBGS(("smp_callin: commencing CPU %d current %p\n", cpuid, current)); - /* Setup the scheduler for this processor. */ - init_idle(); - /* ??? This should be in init_idle. */ atomic_inc(&init_mm.mm_count); current->active_mm = &init_mm; @@ -236,8 +229,9 @@ smp_tune_scheduling (int cpuid) { struct percpu_struct *cpu; - unsigned long on_chip_cache; - unsigned long freq; + unsigned long on_chip_cache; /* kB */ + unsigned long freq; /* Hz */ + unsigned long bandwidth = 350; /* MB/s */ cpu = (struct percpu_struct*)((char*)hwrpb + hwrpb->processor_offset + cpuid * hwrpb->processor_size); @@ -258,29 +252,21 @@ case EV6_CPU: case EV67_CPU: - on_chip_cache = 64 + 64; - break; - default: - on_chip_cache = 8 + 8; + on_chip_cache = 64 + 64; break; } freq = hwrpb->cycle_freq ? : est_cycle_freq; -#if 0 - /* Magic estimation stolen from x86 port. */ - cacheflush_time = freq / 1024L * on_chip_cache / 5000L; - - printk("Using heuristic of %d cycles.\n", - cacheflush_time); -#else - /* Magic value to force potential preemption of other CPUs. */ - cacheflush_time = INT_MAX; + cacheflush_time = (freq / 1000000) * (on_chip_cache << 10) / bandwidth; + cache_decay_ticks = cacheflush_time / (freq / 1000) * HZ / 1000; - printk("Using heuristic of %d cycles.\n", - cacheflush_time); -#endif + printk("per-CPU timeslice cutoff: %ld.%02ld usecs.\n", + cacheflush_time/(freq/1000000), + (cacheflush_time*100/(freq/1000000)) % 100); + printk("task migration cache decay timeout: %ld msecs.\n", + (cache_decay_ticks + 1) * 1000 / HZ); } /* @@ -505,14 +491,11 @@ if (idle == &init_task) panic("idle process is init_task for CPU %d", cpuid); - idle->processor = cpuid; - idle->cpus_runnable = 1 << cpuid; /* we schedule the first task manually */ + init_idle(idle, cpuid); + unhash_process(idle); + __cpu_logical_map[cpunum] = cpuid; __cpu_number_map[cpuid] = cpunum; - - del_from_runqueue(idle); - unhash_process(idle); - init_tasks[cpunum] = idle; DBGS(("smp_boot_one_cpu: CPU %d state 0x%lx flags 0x%lx\n", cpuid, idle->state, idle->flags)); @@ -619,14 +602,11 @@ __cpu_number_map[boot_cpuid] = 0; __cpu_logical_map[0] = boot_cpuid; - current->processor = boot_cpuid; smp_store_cpu_info(boot_cpuid); smp_tune_scheduling(boot_cpuid); smp_setup_percpu_timer(boot_cpuid); - init_idle(); - /* ??? This should be in init_idle. */ atomic_inc(&init_mm.mm_count); current->active_mm = &init_mm; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/alpha/mm/fault.c linux.20pre5-ac2/arch/alpha/mm/fault.c --- linux.20pre5/arch/alpha/mm/fault.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/alpha/mm/fault.c 2002-08-29 19:00:49.000000000 +0100 @@ -122,8 +122,6 @@ goto bad_area; if (vma->vm_start <= address) goto good_area; - if (!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; if (expand_stack(vma, address)) goto bad_area; /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/arm/config.in linux.20pre5-ac2/arch/arm/config.in --- linux.20pre5/arch/arm/config.in 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/arm/config.in 2002-08-13 14:01:01.000000000 +0100 @@ -606,6 +606,7 @@ bool 'VGA text console' CONFIG_VGA_CONSOLE fi source drivers/video/Config.in + source drivers/char/speakup/Config.in endmenu fi @@ -646,6 +647,7 @@ bool 'Kernel debugging' CONFIG_DEBUG_KERNEL dep_bool ' Debug memory allocations' CONFIG_DEBUG_SLAB $CONFIG_DEBUG_KERNEL dep_bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ $CONFIG_DEBUG_KERNEL +dep_bool ' Morse code panics' CONFIG_PANIC_MORSE $CONFIG_DEBUG_KERNEL $CONFIG_PC_KEYB dep_bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK $CONFIG_DEBUG_KERNEL dep_bool ' Wait queue debugging' CONFIG_DEBUG_WAITQ $CONFIG_DEBUG_KERNEL dep_bool ' Verbose BUG() reporting (adds 70K)' CONFIG_DEBUG_BUGVERBOSE $CONFIG_DEBUG_KERNEL diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/arm/mm/fault-common.c linux.20pre5-ac2/arch/arm/mm/fault-common.c --- linux.20pre5/arch/arm/mm/fault-common.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/arm/mm/fault-common.c 2002-08-06 15:42:21.000000000 +0100 @@ -229,7 +229,7 @@ goto survive; check_stack: - if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr)) + if (!expand_stack(vma, addr)) goto good_area; out: return fault; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/cris/drivers/ide.c linux.20pre5-ac2/arch/cris/drivers/ide.c --- linux.20pre5/arch/cris/drivers/ide.c 2002-08-29 18:39:51.000000000 +0100 +++ linux.20pre5-ac2/arch/cris/drivers/ide.c 2002-08-06 15:42:22.000000000 +0100 @@ -816,13 +816,13 @@ rq = HWGROUP(drive)->rq; for (i = rq->nr_sectors; i > 0;) { i -= rq->current_nr_sectors; - ide_end_request(1, HWGROUP(drive)); + DRIVER(drive)->end_request(drive, 1); } return ide_stopped; } printk("%s: bad DMA status\n", drive->name); } - return ide_error(drive, "dma_intr", stat); + return DRIVER(drive)->error(drive, "dma_intr", stat); } /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/config.in linux.20pre5-ac2/arch/i386/config.in --- linux.20pre5/arch/i386/config.in 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/config.in 2002-09-01 13:27:38.000000000 +0100 @@ -82,7 +82,7 @@ define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_USE_STRING_486 y define_bool CONFIG_X86_ALIGNMENT_16 y - define_bool CONFIG_X86_HAS_TSC y + define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_PPRO_FENCE y define_bool CONFIG_X86_F00F_WORKS_OK n fi @@ -90,23 +90,23 @@ define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_USE_STRING_486 y define_bool CONFIG_X86_ALIGNMENT_16 y - define_bool CONFIG_X86_HAS_TSC y + define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_GOOD_APIC y define_bool CONFIG_X86_PPRO_FENCE y define_bool CONFIG_X86_F00F_WORKS_OK n fi if [ "$CONFIG_M686" = "y" ]; then define_int CONFIG_X86_L1_CACHE_SHIFT 5 - define_bool CONFIG_X86_HAS_TSC y + define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_GOOD_APIC y - define_bool CONFIG_X86_PGE y + bool 'PGE extensions (not for Cyrix/Transmeta)' CONFIG_X86_PGE define_bool CONFIG_X86_USE_PPRO_CHECKSUM y define_bool CONFIG_X86_PPRO_FENCE y define_bool CONFIG_X86_F00F_WORKS_OK y fi if [ "$CONFIG_MPENTIUMIII" = "y" ]; then define_int CONFIG_X86_L1_CACHE_SHIFT 5 - define_bool CONFIG_X86_HAS_TSC y + define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_GOOD_APIC y define_bool CONFIG_X86_PGE y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y @@ -114,7 +114,7 @@ fi if [ "$CONFIG_MPENTIUM4" = "y" ]; then define_int CONFIG_X86_L1_CACHE_SHIFT 7 - define_bool CONFIG_X86_HAS_TSC y + define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_GOOD_APIC y define_bool CONFIG_X86_PGE y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y @@ -123,12 +123,12 @@ if [ "$CONFIG_MK6" = "y" ]; then define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_ALIGNMENT_16 y - define_bool CONFIG_X86_HAS_TSC y + define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y fi if [ "$CONFIG_MK7" = "y" ]; then define_int CONFIG_X86_L1_CACHE_SHIFT 6 - define_bool CONFIG_X86_HAS_TSC y + define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_GOOD_APIC y define_bool CONFIG_X86_USE_3DNOW y define_bool CONFIG_X86_PGE y @@ -143,14 +143,14 @@ fi if [ "$CONFIG_MCYRIXIII" = "y" ]; then define_int CONFIG_X86_L1_CACHE_SHIFT 5 - define_bool CONFIG_X86_HAS_TSC y + define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_ALIGNMENT_16 y define_bool CONFIG_X86_USE_3DNOW y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y fi if [ "$CONFIG_MCRUSOE" = "y" ]; then define_int CONFIG_X86_L1_CACHE_SHIFT 5 - define_bool CONFIG_X86_HAS_TSC y + define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_F00F_WORKS_OK y fi if [ "$CONFIG_MWINCHIPC6" = "y" ]; then @@ -163,7 +163,7 @@ if [ "$CONFIG_MWINCHIP2" = "y" ]; then define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_ALIGNMENT_16 y - define_bool CONFIG_X86_HAS_TSC y + define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y define_bool CONFIG_X86_OOSTORE y define_bool CONFIG_X86_F00F_WORKS_OK y @@ -171,7 +171,7 @@ if [ "$CONFIG_MWINCHIP3D" = "y" ]; then define_int CONFIG_X86_L1_CACHE_SHIFT 5 define_bool CONFIG_X86_ALIGNMENT_16 y - define_bool CONFIG_X86_HAS_TSC y + define_bool CONFIG_X86_TSC y define_bool CONFIG_X86_USE_PPRO_CHECKSUM y define_bool CONFIG_X86_OOSTORE y define_bool CONFIG_X86_F00F_WORKS_OK y @@ -179,6 +179,20 @@ bool 'Machine Check Exception' CONFIG_X86_MCE +dep_bool 'CPU Frequency scaling (EXPERIMENTAL)' CONFIG_CPU_FREQ $CONFIG_EXPERIMENTAL +if [ "$CONFIG_CPU_FREQ" != "n" ]; then + tristate ' AMD K6-2/K6-3 PowerNow!' CONFIG_X86_POWERNOW_K6 + tristate ' VIA C3/C5/Cyrix III Longhaul' CONFIG_X86_LONGHAUL + if [ "$CONFIG_X86_LONGHAUL" != "n" ]; then + bool ' Scale voltage according to speed' CONFIG_X86_LONGHAUL_SCALE_VOLTAGE + fi + tristate ' Intel Speedstep' CONFIG_X86_SPEEDSTEP + tristate ' Intel Pentium 4 throttling' CONFIG_X86_P4_CLOCKMOD + if [ "$CONFIG_MELAN" != "n" ]; then + tristate ' AMD Elan' CONFIG_ELAN_CPUFREQ + fi +fi + tristate 'Toshiba Laptop support' CONFIG_TOSHIBA tristate 'Dell laptop support' CONFIG_I8K @@ -217,11 +231,7 @@ fi else bool 'Multiquad NUMA system' CONFIG_MULTIQUAD -fi - -bool 'Unsynced TSC support' CONFIG_X86_TSC_DISABLE -if [ "$CONFIG_X86_TSC_DISABLE" != "y" -a "$CONFIG_X86_HAS_TSC" = "y" ]; then - define_bool CONFIG_X86_TSC y + dep_bool 'Summit Architecture support' CONFIG_SUMMIT $CONFIG_MULTIQUAD fi if [ "$CONFIG_SMP" = "y" -a "$CONFIG_X86_CMPXCHG" = "y" ]; then @@ -295,6 +305,8 @@ tristate 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF tristate 'Kernel support for MISC binaries' CONFIG_BINFMT_MISC +bool 'Kernel .config support' CONFIG_IKCONFIG + bool 'Power Management support' CONFIG_PM if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then @@ -423,6 +435,7 @@ tristate 'MDA text console (dual-headed) (EXPERIMENTAL)' CONFIG_MDA_CONSOLE source drivers/video/Config.in fi + source drivers/char/speakup/Config.in endmenu fi @@ -445,12 +458,13 @@ bool 'Kernel debugging' CONFIG_DEBUG_KERNEL if [ "$CONFIG_DEBUG_KERNEL" != "n" ]; then bool ' Check for stack overflows' CONFIG_DEBUG_STACKOVERFLOW + bool ' Compile the kernel with frame pointers' CONFIG_FRAME_POINTER bool ' Debug high memory support' CONFIG_DEBUG_HIGHMEM bool ' Debug memory allocations' CONFIG_DEBUG_SLAB bool ' Memory mapped I/O debugging' CONFIG_DEBUG_IOVIRT bool ' Magic SysRq key' CONFIG_MAGIC_SYSRQ + bool ' Morse code panics' CONFIG_PANIC_MORSE bool ' Spinlock debugging' CONFIG_DEBUG_SPINLOCK - bool ' Compile the kernel with frame pointers' CONFIG_FRAME_POINTER fi endmenu diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/defconfig linux.20pre5-ac2/arch/i386/defconfig --- linux.20pre5/arch/i386/defconfig 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/defconfig 2002-08-26 14:19:24.000000000 +0100 @@ -2,7 +2,6 @@ # Automatically generated make config: don't edit # CONFIG_X86=y -CONFIG_ISA=y # CONFIG_SBUS is not set CONFIG_UID16=y @@ -50,7 +49,9 @@ CONFIG_X86_GOOD_APIC=y CONFIG_X86_PGE=y CONFIG_X86_USE_PPRO_CHECKSUM=y +CONFIG_X86_F00F_WORKS_OK=y CONFIG_X86_MCE=y +# CONFIG_CPU_FREQ is not set # CONFIG_TOSHIBA is not set # CONFIG_I8K is not set # CONFIG_MICROCODE is not set @@ -59,10 +60,12 @@ CONFIG_NOHIGHMEM=y # CONFIG_HIGHMEM4G is not set # CONFIG_HIGHMEM64G is not set +# CONFIG_HIGHMEM is not set # CONFIG_MATH_EMULATION is not set # CONFIG_MTRR is not set CONFIG_SMP=y # CONFIG_MULTIQUAD is not set +# CONFIG_SUMMIT is not set CONFIG_HAVE_DEC_LOCK=y # @@ -77,6 +80,7 @@ CONFIG_PCI_GOANY=y CONFIG_PCI_BIOS=y CONFIG_PCI_DIRECT=y +CONFIG_ISA=y CONFIG_PCI_NAMES=y # CONFIG_EISA is not set # CONFIG_MCA is not set @@ -95,10 +99,11 @@ # PCI Hotplug Support # # CONFIG_HOTPLUG_PCI is not set +# CONFIG_HOTPLUG_PCI_ACPI is not set # CONFIG_HOTPLUG_PCI_COMPAQ is not set # CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM is not set # CONFIG_HOTPLUG_PCI_IBM is not set -# CONFIG_HOTPLUG_PCI_ACPI is not set +# CONFIG_HOTPLUG_PCI_H2999 is not set CONFIG_SYSVIPC=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y @@ -107,6 +112,7 @@ CONFIG_BINFMT_AOUT=y CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=y +# CONFIG_IKCONFIG is not set CONFIG_PM=y # CONFIG_APM is not set @@ -141,6 +147,7 @@ # CONFIG_BLK_DEV_NBD is not set # CONFIG_BLK_DEV_RAM is not set # CONFIG_BLK_DEV_INITRD is not set +# CONFIG_BLK_STATS is not set # # Multi-device support (RAID and LVM) @@ -233,10 +240,12 @@ # CONFIG_BLK_DEV_TIVO is not set # CONFIG_BLK_DEV_IDECS is not set CONFIG_BLK_DEV_IDECD=y +# CONFIG_BLK_DEV_IDECD_BAILOUT is not set # CONFIG_BLK_DEV_IDETAPE is not set # CONFIG_BLK_DEV_IDEFLOPPY is not set # CONFIG_BLK_DEV_IDESCSI is not set # CONFIG_IDE_TASK_IOCTL is not set +# CONFIG_IDE_TASKFILE_IO is not set # # IDE chipset support/bugfixes @@ -244,8 +253,8 @@ CONFIG_BLK_DEV_CMD640=y # CONFIG_BLK_DEV_CMD640_ENHANCED is not set # CONFIG_BLK_DEV_ISAPNP is not set -CONFIG_BLK_DEV_RZ1000=y CONFIG_BLK_DEV_IDEPCI=y +# CONFIG_BLK_DEV_GENERIC is not set CONFIG_IDEPCI_SHARE_IRQ=y CONFIG_BLK_DEV_IDEDMA_PCI=y # CONFIG_BLK_DEV_OFFBOARD is not set @@ -254,30 +263,30 @@ # CONFIG_IDEDMA_ONLYDISK is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_PCI_WIP is not set -# CONFIG_BLK_DEV_IDEDMA_TIMEOUT is not set # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set CONFIG_BLK_DEV_ADMA=y # CONFIG_BLK_DEV_AEC62XX is not set -# CONFIG_AEC62XX_TUNING is not set # CONFIG_BLK_DEV_ALI15X3 is not set # CONFIG_WDC_ALI15X3 is not set # CONFIG_BLK_DEV_AMD74XX is not set # CONFIG_AMD74XX_OVERRIDE is not set # CONFIG_BLK_DEV_CMD64X is not set -# CONFIG_BLK_DEV_CMD680 is not set # CONFIG_BLK_DEV_CY82C693 is not set # CONFIG_BLK_DEV_CS5530 is not set # CONFIG_BLK_DEV_HPT34X is not set # CONFIG_HPT34X_AUTODMA is not set # CONFIG_BLK_DEV_HPT366 is not set CONFIG_BLK_DEV_PIIX=y -CONFIG_PIIX_TUNING=y +# CONFIG_BLK_DEV_NFORCE is not set # CONFIG_BLK_DEV_NS87415 is not set # CONFIG_BLK_DEV_OPTI621 is not set -# CONFIG_BLK_DEV_PDC202XX is not set +# CONFIG_BLK_DEV_PDC202XX_OLD is not set # CONFIG_PDC202XX_BURST is not set +# CONFIG_BLK_DEV_PDC202XX_NEW is not set # CONFIG_PDC202XX_FORCE is not set +CONFIG_BLK_DEV_RZ1000=y # CONFIG_BLK_DEV_SVWKS is not set +# CONFIG_BLK_DEV_SIIMAGE is not set # CONFIG_BLK_DEV_SIS5513 is not set # CONFIG_BLK_DEV_SLC90E66 is not set # CONFIG_BLK_DEV_TRM290 is not set @@ -433,11 +442,11 @@ # CONFIG_APRICOT is not set # CONFIG_CS89x0 is not set # CONFIG_TULIP is not set -# CONFIG_TC35815 is not set # CONFIG_DE4X5 is not set # CONFIG_DGRS is not set # CONFIG_DM9102 is not set CONFIG_EEPRO100=y +# CONFIG_E100 is not set # CONFIG_LNE390 is not set # CONFIG_FEALNX is not set # CONFIG_NATSEMI is not set @@ -449,11 +458,12 @@ # CONFIG_8139TOO_PIO is not set # CONFIG_8139TOO_TUNE_TWISTER is not set # CONFIG_8139TOO_8129 is not set -# CONFIG_8139_NEW_RX_RESET is not set +# CONFIG_8139_OLD_RX_RESET is not set # CONFIG_SIS900 is not set # CONFIG_EPIC100 is not set # CONFIG_SUNDANCE is not set # CONFIG_TLAN is not set +# CONFIG_TC35815 is not set # CONFIG_VIA_RHINE is not set # CONFIG_VIA_RHINE_MMIO is not set # CONFIG_WINBOND_840 is not set @@ -464,6 +474,7 @@ # # CONFIG_ACENIC is not set # CONFIG_DL2K is not set +# CONFIG_E1000 is not set # CONFIG_MYRI_SBUS is not set # CONFIG_NS83820 is not set # CONFIG_HAMACHI is not set @@ -589,6 +600,7 @@ # CONFIG_WATCHDOG is not set # CONFIG_AMD_RNG is not set # CONFIG_INTEL_RNG is not set +# CONFIG_AMD_PM768 is not set # CONFIG_NVRAM is not set # CONFIG_RTC is not set # CONFIG_DTLK is not set @@ -618,6 +630,7 @@ # CONFIG_DRM_R128 is not set CONFIG_DRM_RADEON=y # CONFIG_DRM_I810 is not set +# CONFIG_DRM_I830 is not set # CONFIG_DRM_MGA is not set # CONFIG_DRM_SIS is not set @@ -625,6 +638,7 @@ # PCMCIA character devices # # CONFIG_PCMCIA_SERIAL_CS is not set +# CONFIG_SYNCLINK_CS is not set # CONFIG_MWAVE is not set # @@ -636,6 +650,9 @@ # File systems # # CONFIG_QUOTA is not set +# CONFIG_QFMT_V1 is not set +# CONFIG_QFMT_V2 is not set +# CONFIG_QIFACE_COMPAT is not set # CONFIG_AUTOFS_FS is not set CONFIG_AUTOFS4_FS=y # CONFIG_REISERFS_FS is not set @@ -645,6 +662,8 @@ # CONFIG_ADFS_FS_RW is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set +# CONFIG_BEFS_FS is not set +# CONFIG_BEFS_DEBUG is not set # CONFIG_BFS_FS is not set # CONFIG_EXT3_FS is not set # CONFIG_JBD is not set @@ -662,6 +681,9 @@ CONFIG_ISO9660_FS=y # CONFIG_JOLIET is not set # CONFIG_ZISOFS is not set +# CONFIG_JFS_FS is not set +# CONFIG_JFS_DEBUG is not set +# CONFIG_JFS_STATISTICS is not set # CONFIG_MINIX_FS is not set # CONFIG_VXFS_FS is not set # CONFIG_NTFS_FS is not set @@ -692,6 +714,7 @@ # CONFIG_ROOT_NFS is not set CONFIG_NFSD=y # CONFIG_NFSD_V3 is not set +# CONFIG_NFSD_TCP is not set CONFIG_SUNRPC=y CONFIG_LOCKD=y # CONFIG_SMB_FS is not set @@ -705,7 +728,6 @@ # CONFIG_NCPFS_NLS is not set # CONFIG_NCPFS_EXTRAS is not set # CONFIG_ZISOFS_FS is not set -# CONFIG_ZLIB_FS_INFLATE is not set # # Partition Types @@ -720,11 +742,13 @@ # CONFIG_VGA_CONSOLE=y # CONFIG_VIDEO_SELECT is not set +# CONFIG_SPEAKUP is not set # # Sound # CONFIG_SOUND=y +# CONFIG_SOUND_ALI5455 is not set # CONFIG_SOUND_BT878 is not set # CONFIG_SOUND_CMPCI is not set # CONFIG_SOUND_EMU10K1 is not set @@ -736,6 +760,7 @@ # CONFIG_SOUND_ESSSOLO1 is not set # CONFIG_SOUND_MAESTRO is not set # CONFIG_SOUND_MAESTRO3 is not set +# CONFIG_SOUND_FORTE is not set # CONFIG_SOUND_ICH is not set # CONFIG_SOUND_RME96XX is not set # CONFIG_SOUND_SONICVIBES is not set @@ -773,6 +798,7 @@ # CONFIG_USB_AUDIO is not set # CONFIG_USB_EMI26 is not set # CONFIG_USB_BLUETOOTH is not set +# CONFIG_USB_MIDI is not set CONFIG_USB_STORAGE=y # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_DATAFAB is not set @@ -781,6 +807,7 @@ # CONFIG_USB_STORAGE_DPCM is not set # CONFIG_USB_STORAGE_HP8200e is not set # CONFIG_USB_STORAGE_SDDR09 is not set +# CONFIG_USB_STORAGE_SDDR55 is not set # CONFIG_USB_STORAGE_JUMPSHOT is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set @@ -797,6 +824,7 @@ # CONFIG_USB_HIDDEV is not set # CONFIG_USB_KBD is not set # CONFIG_USB_MOUSE is not set +# CONFIG_USB_AIPTEK is not set # CONFIG_USB_WACOM is not set # @@ -835,38 +863,13 @@ # USB Serial Converter support # # CONFIG_USB_SERIAL is not set -# CONFIG_USB_SERIAL_GENERIC is not set -# CONFIG_USB_SERIAL_BELKIN is not set -# CONFIG_USB_SERIAL_WHITEHEAT is not set -# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set -# CONFIG_USB_SERIAL_EMPEG is not set -# CONFIG_USB_SERIAL_FTDI_SIO is not set -# CONFIG_USB_SERIAL_VISOR is not set -# CONFIG_USB_SERIAL_IPAQ is not set -# CONFIG_USB_SERIAL_IR is not set -# CONFIG_USB_SERIAL_EDGEPORT is not set -# CONFIG_USB_SERIAL_KEYSPAN_PDA is not set -# CONFIG_USB_SERIAL_KEYSPAN is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28X is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28XA is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA28XB is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19 is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA18X is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA19W is not set -# CONFIG_USB_SERIAL_KEYSPAN_USA49W is not set -# CONFIG_USB_SERIAL_MCT_U232 is not set -# CONFIG_USB_SERIAL_KLSI is not set -# CONFIG_USB_SERIAL_PL2303 is not set -# CONFIG_USB_SERIAL_CYBERJACK is not set -# CONFIG_USB_SERIAL_XIRCOM is not set -# CONFIG_USB_SERIAL_OMNINET is not set # # USB Miscellaneous drivers # # CONFIG_USB_RIO500 is not set # CONFIG_USB_AUERSWALD is not set +# CONFIG_USB_TIGL is not set # CONFIG_USB_BRLVGER is not set # @@ -878,3 +881,9 @@ # Kernel hacking # # CONFIG_DEBUG_KERNEL is not set + +# +# Library routines +# +# CONFIG_ZLIB_INFLATE is not set +# CONFIG_ZLIB_DEFLATE is not set diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/apic.c linux.20pre5-ac2/arch/i386/kernel/apic.c --- linux.20pre5/arch/i386/kernel/apic.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/apic.c 2002-08-13 14:02:53.000000000 +0100 @@ -29,6 +29,7 @@ #include #include #include +#include /* Using APIC to generate smp_local_timer_interrupt? */ int using_apic_timer = 0; @@ -260,6 +261,16 @@ apic_write_around(APIC_LVT1, value); } +static unsigned long apic_ldr_value(unsigned long value) +{ + if (clustered_apic_logical) + return (value); + if (clustered_apic_physical) + return (((value) & ~APIC_LDR_MASK) | + SET_APIC_LOGICAL_ID(physical_to_logical_apicid(hard_smp_processor_id()))); + return (((value) & ~APIC_LDR_MASK) | SET_APIC_LOGICAL_ID(1UL << smp_processor_id())); +} + void __init setup_local_APIC (void) { unsigned long value, ver, maxlvt; @@ -292,21 +303,23 @@ * document number 292116). So here it goes... */ - if (!clustered_apic_mode) { + if (!clustered_apic_logical) { /* - * In clustered apic mode, the firmware does this for us - * Put the APIC into flat delivery mode. - * Must be "all ones" explicitly for 82489DX. + * For NUMA-Q (clustered apic logical), the firmware does this + * for us. Otherwise put the APIC into clustered or flat + * delivery mode. Must be "all ones" explicitly for 82489DX. */ - apic_write_around(APIC_DFR, 0xffffffff); + + if(clustered_apic_mode) + apic_write_around(APIC_DFR, APIC_DFR_CLUSTER); + else + apic_write_around(APIC_DFR, APIC_DFR_FLAT); /* * Set up the logical destination ID. */ value = apic_read(APIC_LDR); - value &= ~APIC_LDR_MASK; - value |= (1<<(smp_processor_id()+24)); - apic_write_around(APIC_LDR, value); + apic_write_around(APIC_LDR, apic_ldr_value(value)); } /* @@ -1050,12 +1063,11 @@ /* * Local APIC timer interrupt. This is the most natural way for doing * local interrupts, but local timer interrupts can be emulated by - * broadcast interrupts too. [in case the hw doesn't support APIC timers] + * broadcast interrupts too. [in case the hw doesnt support APIC timers] * * [ if a single-CPU system runs an SMP kernel then we call the local * interrupt as well. Thus we cannot inline the local irq ... ] */ -unsigned int apic_timer_irqs [NR_CPUS]; void smp_apic_timer_interrupt(struct pt_regs * regs) { @@ -1064,7 +1076,7 @@ /* * the NMI deadlock-detector uses this. */ - apic_timer_irqs[cpu]++; + irq_stat[cpu].apic_timer_irqs++; /* * NOTE! We'd better ACK the irq immediately, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/apm.c linux.20pre5-ac2/arch/i386/kernel/apm.c --- linux.20pre5/arch/i386/kernel/apm.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/apm.c 2002-08-26 14:19:32.000000000 +0100 @@ -247,6 +247,7 @@ * powering off * [no-]debug log some debugging messages * [no-]power[-_]off power off on shutdown + * [no-]smp Use apm even on an SMP box * bounce[-_]interval= number of ticks to ignore suspend * bounces * idle[-_]threshold= System idle percentage above which to @@ -393,6 +394,7 @@ static int got_clock_diff; #endif static int debug; +static int smp = 0; static int apm_disabled = -1; #ifdef CONFIG_SMP static int power_off; @@ -494,6 +496,40 @@ } /* + * Lock APM functionality to physical CPU 0 + */ + +#ifdef CONFIG_SMP + +static unsigned long apm_save_cpus(void) +{ + unsigned long x = current->cpus_allowed; + /* Some bioses don't like being called from CPU != 0 */ + if (cpu_number_map(smp_processor_id()) != 0) { + set_cpus_allowed(current, 1 << cpu_logical_map(0)); + if (unlikely(cpu_number_map(smp_processor_id()) != 0)) + BUG(); + } + return x; +} + +static inline void apm_restore_cpus(unsigned long mask) +{ + set_cpus_allowed(current, mask); +} + +#else + +/* + * No CPU lockdown needed on a uniprocessor + */ + +#define apm_save_cpus() 0 +#define apm_restore_cpus(x) (void)(x) + +#endif + +/* * These are the actual BIOS calls. Depending on APM_ZERO_SEGS and * apm_info.allow_ints, we are being really paranoid here! Not only * are interrupts disabled, but all the segment registers (except SS) @@ -566,7 +602,8 @@ { APM_DECL_SEGS unsigned long flags; - + unsigned long cpus = apm_save_cpus(); + __save_flags(flags); APM_DO_CLI; APM_DO_SAVE_SEGS; @@ -588,6 +625,9 @@ : "memory", "cc"); APM_DO_RESTORE_SEGS; __restore_flags(flags); + + apm_restore_cpus(cpus); + return *eax & 0xff; } @@ -611,6 +651,8 @@ APM_DECL_SEGS unsigned long flags; + unsigned long cpus = apm_save_cpus(); + __save_flags(flags); APM_DO_CLI; APM_DO_SAVE_SEGS; @@ -636,6 +678,9 @@ } APM_DO_RESTORE_SEGS; __restore_flags(flags); + + apm_restore_cpus(cpus); + return error; } @@ -751,10 +796,12 @@ if (apm_bios_call_simple(APM_FUNC_IDLE, 0, 0, &eax)) { static unsigned long t; - if (time_after(jiffies, t + 10 * HZ)) { + /* This always fails on some SMP boards running UP kernels. + * Only report the failure the first 5 times. + */ + if (++t < 5) { printk(KERN_DEBUG "apm_do_idle failed (%d)\n", (eax >> 8) & 0xff); - t = jiffies; } return -1; } @@ -888,17 +935,12 @@ /* * This may be called on an SMP machine. */ -#ifdef CONFIG_SMP - /* Some bioses don't like being called from CPU != 0 */ - if (cpu_number_map(smp_processor_id()) != 0) { - current->cpus_allowed = 1; - schedule(); - if (unlikely(cpu_number_map(smp_processor_id()) != 0)) - BUG(); - } -#endif if (apm_info.realmode_power_off) + { + (void)apm_save_cpus(); machine_real_restart(po_bios_call, sizeof(po_bios_call)); + /* Never returns */ + } else (void) set_system_power_state(APM_STATE_OFF); } @@ -1074,6 +1116,19 @@ } if ((error == APM_SUCCESS) || (error == APM_NO_ERROR)) return 1; + if (error == APM_NOT_ENGAGED) { + static int tried; + int eng_error; + if (tried++ == 0) { + eng_error = apm_engage_power_management(APM_DEVICE_ALL, 1); + if (eng_error) { + apm_error("set display", error); + apm_error("engage interface", eng_error); + return 0; + } else + return apm_console_blank(blank); + } + } apm_error("set display", error); return 0; } @@ -1397,7 +1452,7 @@ as = fp->private_data; if (check_apm_user(as, "read")) return -EIO; - if (count < sizeof(apm_event_t)) + if ((int)count < sizeof(apm_event_t)) return -EINVAL; if ((queue_empty(as)) && (fp->f_flags & O_NONBLOCK)) return -EAGAIN; @@ -1571,7 +1626,7 @@ p = buf; - if ((smp_num_cpus == 1) && + if ((smp_num_cpus == 1 || smp) && !(error = apm_get_power_status(&bx, &cx, &dx))) { ac_line_status = (bx >> 8) & 0xff; battery_status = bx & 0xff; @@ -1716,7 +1771,7 @@ } } - if (debug) { + if (debug && (smp_num_cpus == 1 || smp )) { error = apm_get_power_status(&bx, &cx, &dx); if (error) printk(KERN_INFO "apm: power status not available\n"); @@ -1760,7 +1815,7 @@ pm_power_off = apm_power_off; register_sysrq_key('o', &sysrq_poweroff_op); - if (smp_num_cpus == 1) { + if (smp_num_cpus == 1 || smp) { #if defined(CONFIG_APM_DISPLAY_BLANK) && defined(CONFIG_VT) console_blank_hook = apm_console_blank; #endif @@ -1799,6 +1854,11 @@ str += 3; if (strncmp(str, "debug", 5) == 0) debug = !invert; + if (strncmp(str, "smp", 3) == 0) + { + smp = !invert; + idle_threshold = 100; + } if ((strncmp(str, "power-off", 9) == 0) || (strncmp(str, "power_off", 9) == 0)) power_off = !invert; @@ -1903,7 +1963,7 @@ printk(KERN_NOTICE "apm: disabled on user request.\n"); return -ENODEV; } - if ((smp_num_cpus > 1) && !power_off) { + if ((smp_num_cpus > 1) && !power_off && !smp) { printk(KERN_NOTICE "apm: disabled - APM is not SMP safe.\n"); return -ENODEV; } @@ -1957,7 +2017,7 @@ kernel_thread(apm, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND | SIGCHLD); - if (smp_num_cpus > 1) { + if (smp_num_cpus > 1 && !smp) { printk(KERN_NOTICE "apm: disabled - APM is not SMP safe (power off active).\n"); return 0; @@ -2025,5 +2085,8 @@ MODULE_PARM(idle_period, "i"); MODULE_PARM_DESC(idle_period, "Period (in sec/100) over which to caculate the idle percentage"); +MODULE_PARM(smp, "i"); +MODULE_PARM_DESC(smp, + "Set this to enable APM use on an SMP platform. Use with caution on older systems"); EXPORT_NO_SYMBOLS; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/dmi_scan.c linux.20pre5-ac2/arch/i386/kernel/dmi_scan.c --- linux.20pre5/arch/i386/kernel/dmi_scan.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/dmi_scan.c 2002-08-23 01:01:36.000000000 +0100 @@ -475,6 +475,22 @@ return 0; } +/* + * Work around broken HP Pavilion Notebooks which assign USB to + * IRQ 9 even though it is actually wired to IRQ 11 + */ +static __init int fix_broken_hp_bios_irq9(struct dmi_blacklist *d) +{ +#ifdef CONFIG_PCI + extern int broken_hp_bios_irq9; + if (broken_hp_bios_irq9 == 0) + { + broken_hp_bios_irq9 = 1; + printk(KERN_INFO "%s detected - fixing broken IRQ routing\n", d->ident); + } +#endif + return 0; +} /* * Simple "print if true" callback @@ -648,8 +664,8 @@ { swab_apm_power_in_minutes, "Sony VAIO", { /* Handle problems with APM on Sony Vaio PCG-Z505LS (with updated BIOS) */ MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies LTD"), - MATCH(DMI_BIOS_VERSION, "R0209Z3"), - MATCH(DMI_BIOS_DATE, "05/12/01"), NO_MATCH + MATCH(DMI_BIOS_VERSION, "WXP01Z3"), + MATCH(DMI_BIOS_DATE, "10/26/01"), NO_MATCH } }, { swab_apm_power_in_minutes, "Sony VAIO", { /* Handle problems with APM on Sony Vaio PCG-F104K */ @@ -755,7 +771,14 @@ NO_MATCH, NO_MATCH } }, - + { fix_broken_hp_bios_irq9, "HP Pavilion N5400 Series Laptop", { + MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), + MATCH(DMI_BIOS_VERSION, "GE.M1.03"), + MATCH(DMI_PRODUCT_VERSION, "HP Pavilion Notebook Model GE"), + MATCH(DMI_BOARD_VERSION, "OmniBook N32N-736") + } }, + + /* * Generic per vendor APM settings */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/elanfreq.c linux.20pre5-ac2/arch/i386/kernel/elanfreq.c --- linux.20pre5/arch/i386/kernel/elanfreq.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/elanfreq.c 2002-09-01 13:27:38.000000000 +0100 @@ -0,0 +1,257 @@ +/* + * elanfreq: cpufreq driver for the AMD ELAN family + * + * (c) Copyright 2002 Robert Schwebel + * + * Parts of this code are (c) Sven Geggus + * + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * 2002-02-13: - initial revision for 2.4.18-pre9 by Robert Schwebel + * + */ + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#define REG_CSCIR 0x22 /* Chip Setup and Control Index Register */ +#define REG_CSCDR 0x23 /* Chip Setup and Control Data Register */ + +#define SAFE_FREQ 33000 /* every Elan CPU can run at 33 MHz */ + +static int currentspeed; /* current frequency in kHz */ +static struct cpufreq_driver *elanfreq_driver; + +MODULE_LICENSE("GPL"); + +MODULE_AUTHOR( + "Robert Schwebel , Sven Geggus " +); +MODULE_DESCRIPTION("cpufreq driver for AMD's Elan CPUs"); + +struct s_elan_multiplier { + int clock; /* frequency in kHz */ + int val40h; /* PMU Force Mode register */ + int val80h; /* CPU Clock Speed Register */ +}; + +/* + * It is important that the frequencies + * are listed in ascending order here! + */ +struct s_elan_multiplier elan_multiplier[] = { + {1000, 0x02, 0x18}, + {2000, 0x02, 0x10}, + {4000, 0x02, 0x08}, + {8000, 0x00, 0x00}, + {16000, 0x00, 0x02}, + {33000, 0x00, 0x04}, + {66000, 0x01, 0x04}, + {99000, 0x01, 0x05} +}; + + +/** + * elanfreq_get_cpu_frequency: determine current cpu speed + * + * Finds out at which frequency the CPU of the Elan SOC runs + * at the moment. Frequencies from 1 to 33 MHz are generated + * the normal way, 66 and 99 MHz are called "Hyperspeed Mode" + * and have the rest of the chip running with 33 MHz. + */ + +static unsigned int elanfreq_get_cpu_frequency(void) +{ + u8 clockspeed_reg; /* Clock Speed Register */ + + cli(); + outb_p(0x80,REG_CSCIR); + clockspeed_reg = inb_p(REG_CSCDR); + sti(); + + if ((clockspeed_reg & 0xE0) == 0xE0) { return 0; } + + /* Are we in CPU clock multiplied mode (66/99 MHz)? */ + if ((clockspeed_reg & 0xE0) == 0xC0) { + if ((clockspeed_reg & 0x01) == 0) { + return 66000; + } else { + return 99000; + } + } + + /* 33 MHz is not 32 MHz... */ + if ((clockspeed_reg & 0xE0)==0xA0) + return 33000; + + return ((1<<((clockspeed_reg & 0xE0) >> 5)) * 1000); +} + + +/** + * elanfreq_set_cpu_frequency: Change the CPU core frequency + * @cpu: cpu number + * @freq: frequency in kHz + * + * This function takes a frequency value and changes the CPU frequency + * according to this. Note that the frequency has to be checked by + * elanfreq_validatespeed() for correctness! + * + * There is no return value. + */ + +static void elanfreq_set_cpu_frequency (unsigned int cpu, unsigned int freq) { + + int i; + + if (cpu && (cpu != CPUFREQ_ALL_CPUS)) + return; + + printk(KERN_INFO "elanfreq: attempting to set frequency to %i kHz\n",freq); + + /* search table entry for given Mhz value */ + for (i=0; i<(sizeof(elan_multiplier)/sizeof(struct s_elan_multiplier)); i++) + { + if (elan_multiplier[i].clock==freq) break; + } + + /* XXX Shouldn't we have a sanity check here or can we rely on + the frequency having been checked before ??? */ + + /* + * Access to the Elan's internal registers is indexed via + * 0x22: Chip Setup & Control Register Index Register (CSCI) + * 0x23: Chip Setup & Control Register Data Register (CSCD) + * + */ + + /* + * 0x40 is the Power Management Unit's Force Mode Register. + * Bit 6 enables Hyperspeed Mode (66/100 MHz core frequency) + */ + + cli(); + outb_p(0x40,REG_CSCIR); /* Disable hyperspeed mode */ + outb_p(0x00,REG_CSCDR); + sti(); /* wait till internal pipelines and */ + udelay(1000); /* buffers have cleaned up */ + + cli(); + + /* now, set the CPU clock speed register (0x80) */ + outb_p(0x80,REG_CSCIR); + outb_p(elan_multiplier[i].val80h,REG_CSCDR); + + /* now, the hyperspeed bit in PMU Force Mode Register (0x40) */ + outb_p(0x40,REG_CSCIR); + outb_p(elan_multiplier[i].val40h,REG_CSCDR); + udelay(10000); + sti(); + + currentspeed=freq; + +}; + + +/** + * elanfreq_validatespeed: test if frequency is valid + * @cpu: cpu number + * @freq: frequency in kHz + * + * This function checks if a given frequency in kHz is valid for the + * hardware supported by the driver. It returns a "best fit" frequency + * which might be different from the given one. + */ + +static unsigned int elanfreq_validatespeed (unsigned int cpu, unsigned int freq) +{ + unsigned int best = 0; + int i; + + if (cpu && (cpu != CPUFREQ_ALL_CPUS)) + return 0; + + for (i=(sizeof(elan_multiplier)/sizeof(struct s_elan_multiplier) - 1); i>=0; i++) + { + if (freq < elan_multiplier[i].clock) + { + best = elan_multiplier[i].clock; + + } + } + + return best; +} + + + +/* + * Module init and exit code + */ + +static int __init elanfreq_init(void) +{ + struct cpuinfo_x86 *c = cpu_data; + struct cpufreq_driver *driver; + int ret; + + /* Test if we have the right hardware */ + if ((c->x86_vendor != X86_VENDOR_AMD) || + (c->x86 != 4) || (c->x86_model!=10)) + { + printk(KERN_INFO "elanfreq: error: no Elan processor found!\n"); + return -ENODEV; + } + + driver = kmalloc(sizeof(struct cpufreq_driver) + + sizeof(struct cpufreq_freqs), GFP_KERNEL); + if (!driver) + return -ENOMEM; + + driver->freq = (struct cpufreq_freqs*) (driver + sizeof(struct cpufreq_driver)); + + driver->sync = CPUFREQ_SYNC; + driver->freq->cpu = CPUFREQ_ALL_CPUS; + driver->freq->cur = elanfreq_get_cpu_frequency(); + driver->validate = &elanfreq_validatespeed; + driver->setspeed = &elanfreq_set_cpu_frequency; + + ret = cpufreq_register(driver); + if (ret) { + kfree(driver); + return ret; + } + + elanfreq_driver = driver; + + return 0; +} + + +static void __exit elanfreq_exit(void) +{ + if (elanfreq_driver) { + cpufreq_unregister(); + kfree(elanfreq_driver); + } +} + +module_init(elanfreq_init); +module_exit(elanfreq_exit); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/entry.S linux.20pre5-ac2/arch/i386/kernel/entry.S --- linux.20pre5/arch/i386/kernel/entry.S 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/entry.S 2002-08-06 15:42:19.000000000 +0100 @@ -77,7 +77,7 @@ exec_domain = 16 need_resched = 20 tsk_ptrace = 24 -processor = 52 +cpu = 32 ENOSYS = 38 @@ -176,9 +176,11 @@ ENTRY(ret_from_fork) +#if CONFIG_SMP pushl %ebx call SYMBOL_NAME(schedule_tail) addl $4, %esp +#endif GET_CURRENT(%ebx) testb $0x02,tsk_ptrace(%ebx) # PT_TRACESYS jne tracesys_exit @@ -637,8 +639,8 @@ .long SYMBOL_NAME(sys_tkill) .long SYMBOL_NAME(sys_ni_syscall) /* reserved for sendfile64 */ .long SYMBOL_NAME(sys_ni_syscall) /* 240 reserved for futex */ - .long SYMBOL_NAME(sys_ni_syscall) /* reserved for sched_setaffinity */ - .long SYMBOL_NAME(sys_ni_syscall) /* reserved for sched_getaffinity */ + .long SYMBOL_NAME(sys_sched_setaffinity) + .long SYMBOL_NAME(sys_sched_getaffinity) .rept NR_syscalls-(.-sys_call_table)/4 .long SYMBOL_NAME(sys_ni_syscall) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/head.S linux.20pre5-ac2/arch/i386/kernel/head.S --- linux.20pre5/arch/i386/kernel/head.S 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/head.S 2002-08-06 15:42:19.000000000 +0100 @@ -445,4 +445,15 @@ .quad 0x00409a0000000000 /* 0x48 APM CS code */ .quad 0x00009a0000000000 /* 0x50 APM CS 16 code (16 bit) */ .quad 0x0040920000000000 /* 0x58 APM DS data */ + /* Segments used for calling PnP BIOS */ + .quad 0x00c09a0000000000 /* 0x60 32-bit code */ + .quad 0x00809a0000000000 /* 0x68 16-bit code */ + .quad 0x0080920000000000 /* 0x70 16-bit data */ + .quad 0x0080920000000000 /* 0x78 16-bit data */ + .quad 0x0080920000000000 /* 0x80 16-bit data */ + .quad 0x0000000000000000 /* 0x88 not used */ + .quad 0x0000000000000000 /* 0x90 not used */ + .quad 0x0000000000000000 /* 0x98 not used */ + /* Per CPU segments */ .fill NR_CPUS*4,8,0 /* space for TSS's and LDT's */ + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/i386_ksyms.c linux.20pre5-ac2/arch/i386/kernel/i386_ksyms.c --- linux.20pre5/arch/i386/kernel/i386_ksyms.c 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/i386_ksyms.c 2002-08-06 15:42:19.000000000 +0100 @@ -49,6 +49,7 @@ EXPORT_SYMBOL(drive_info); #endif +extern unsigned long cpu_khz; extern unsigned long get_cmos_time(void); /* platform dependent support */ @@ -57,6 +58,9 @@ EXPORT_SYMBOL(EISA_bus); #endif EXPORT_SYMBOL(MCA_bus); +#ifdef CONFIG_MULTIQUAD +EXPORT_SYMBOL(xquad_portio); +#endif EXPORT_SYMBOL(__verify_write); EXPORT_SYMBOL(dump_thread); EXPORT_SYMBOL(dump_fpu); @@ -71,6 +75,7 @@ EXPORT_SYMBOL(pm_idle); EXPORT_SYMBOL(pm_power_off); EXPORT_SYMBOL(get_cmos_time); +EXPORT_SYMBOL(cpu_khz); EXPORT_SYMBOL(apm_info); EXPORT_SYMBOL(gdt); EXPORT_SYMBOL(empty_zero_page); @@ -175,7 +180,3 @@ extern int is_sony_vaio_laptop; EXPORT_SYMBOL(is_sony_vaio_laptop); - -#ifdef CONFIG_MULTIQUAD -EXPORT_SYMBOL(xquad_portio); -#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/io_apic.c linux.20pre5-ac2/arch/i386/kernel/io_apic.c --- linux.20pre5/arch/i386/kernel/io_apic.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/io_apic.c 2002-08-13 14:05:00.000000000 +0100 @@ -28,10 +28,12 @@ #include #include #include +#include #include #include #include +#include #undef APIC_LOCKUP_DEBUG @@ -183,6 +185,86 @@ clear_IO_APIC_pin(apic, pin); } +static void set_ioapic_affinity (unsigned int irq, unsigned long mask) +{ + unsigned long flags; + + /* + * Only the first 8 bits are valid. + */ + mask = mask << 24; + spin_lock_irqsave(&ioapic_lock, flags); + __DO_ACTION(1, = mask, ) + spin_unlock_irqrestore(&ioapic_lock, flags); +} + +#if CONFIG_SMP + +typedef struct { + unsigned int cpu; + unsigned long timestamp; +} ____cacheline_aligned irq_balance_t; + +static irq_balance_t irq_balance[NR_IRQS] __cacheline_aligned + = { [ 0 ... NR_IRQS-1 ] = { 0, 0 } }; + +extern unsigned long irq_affinity [NR_IRQS]; + +#endif + +#define IDLE_ENOUGH(cpu,now) \ + (idle_cpu(cpu) && ((now) - irq_stat[(cpu)].idle_timestamp > 1)) + +#define IRQ_ALLOWED(cpu,allowed_mask) \ + ((1 << cpu) & (allowed_mask)) + +static unsigned long move(int curr_cpu, unsigned long allowed_mask, unsigned long now, int direction) +{ + int search_idle = 1; + int cpu = curr_cpu; + + goto inside; + + do { + if (unlikely(cpu == curr_cpu)) + search_idle = 0; +inside: + if (direction == 1) { + cpu++; + if (cpu >= smp_num_cpus) + cpu = 0; + } else { + cpu--; + if (cpu == -1) + cpu = smp_num_cpus-1; + } + } while (!IRQ_ALLOWED(cpu,allowed_mask) || + (search_idle && !IDLE_ENOUGH(cpu,now))); + + return cpu; +} + +static inline void balance_irq(int irq) +{ +#if CONFIG_SMP + irq_balance_t *entry = irq_balance + irq; + unsigned long now = jiffies; + + if (unlikely(entry->timestamp != now)) { + unsigned long allowed_mask; + int random_number; + + rdtscl(random_number); + random_number &= 1; + + allowed_mask = cpu_online_map & irq_affinity[irq]; + entry->timestamp = now; + entry->cpu = move(entry->cpu, allowed_mask, now, random_number); + set_ioapic_affinity(irq, cpu_present_to_apicid(entry->cpu)); + } +#endif +} + /* * support for broken MP BIOSs, enables hand-redirection of PIRQ0-7 to * specific CPU-side IRQs. @@ -287,7 +369,7 @@ Dprintk("querying PCI -> IRQ mapping bus:%d, slot:%d, pin:%d.\n", bus, slot, pin); - if (mp_bus_id_to_pci_bus[bus] == -1) { + if ((mp_bus_id_to_pci_bus==NULL) || (mp_bus_id_to_pci_bus[bus] == -1)) { printk(KERN_WARNING "PCI BIOS passed nonexistent PCI bus %d!\n", bus); return -1; } @@ -605,6 +687,40 @@ return current_vector; } +#ifdef CONFIG_MULTIQUAD + +/* + * round_robin_cpu_apic_id -- Since Linux doesn't use either the APIC TPRs or + * XTPRs to set task/interrupt priority, xAPICs and SAPICs tend to hit one CPU + * with all interrupts for each quad. Distribute the interrupts using a simple + * round robin scheme. + */ +static inline int round_robin_cpu_apic_id(void) +{ + int val; + static unsigned next_cpu = 0; + + for (;; ++next_cpu) { + if (next_cpu >= smp_num_cpus) + next_cpu = 0; + if (!(logical_cpu_present_map & (1UL << next_cpu))) + continue; + val = cpu_present_to_apicid(next_cpu); + ++next_cpu; + return (val); + } +} + +static inline int __target_cpus(void) +{ + if (clustered_apic_logical) + return APIC_BROADCAST_ID_APIC; /* broadcast to local quad */ + if (clustered_apic_physical) + return round_robin_cpu_apic_id(); + return cpu_online_map; +} +#endif + extern void (*interrupt[NR_IRQS])(void); static struct hw_interrupt_type ioapic_level_irq_type; static struct hw_interrupt_type ioapic_edge_irq_type; @@ -625,8 +741,8 @@ */ memset(&entry,0,sizeof(entry)); - entry.delivery_mode = dest_LowestPrio; - entry.dest_mode = INT_DELIVERY_MODE; + entry.delivery_mode = INT_DELIVERY_MODE; + entry.dest_mode = (INT_DEST_ADDR_MODE != 0); entry.mask = 0; /* enable IRQ */ entry.dest.logical.logical_dest = TARGET_CPUS; @@ -646,7 +762,6 @@ if (irq_trigger(idx)) { entry.trigger = 1; entry.mask = 1; - entry.dest.logical.logical_dest = TARGET_CPUS; } irq = pin_2_irq(idx, apic, pin); @@ -654,7 +769,7 @@ * skip adding the timer int on secondary nodes, which causes * a small but painful rift in the time-space continuum */ - if (clustered_apic_mode && (apic != 0) && (irq == 0)) + if (clustered_apic_logical && (apic != 0) && (irq == 0)) continue; else add_pin_to_irq(irq, apic, pin); @@ -688,8 +803,7 @@ } /* - * Set up the 8259A-master output pin as broadcast to all - * CPUs. + * Set up the 8259A-master output pin: */ void __init setup_ExtINT_IRQ0_pin(unsigned int pin, int vector) { @@ -707,10 +821,10 @@ * We use logical delivery to get the timer IRQ * to the first CPU. */ - entry.dest_mode = INT_DELIVERY_MODE; + entry.dest_mode = (INT_DEST_ADDR_MODE != 0); entry.mask = 0; /* unmask IRQ now */ entry.dest.logical.logical_dest = TARGET_CPUS; - entry.delivery_mode = dest_LowestPrio; + entry.delivery_mode = INT_DELIVERY_MODE; entry.polarity = 0; entry.trigger = 0; entry.vector = vector; @@ -734,8 +848,9 @@ void __init UNEXPECTED_IO_APIC(void) { - printk(KERN_WARNING " WARNING: unexpected IO-APIC, please mail\n"); - printk(KERN_WARNING " to linux-smp@vger.kernel.org\n"); + printk(KERN_WARNING + "An unexpected IO-APIC was found. If this kernel release is less than\n" + "three months old please report this to linux-smp@vger.kernel.org\n"); } void __init print_IO_APIC(void) @@ -788,6 +903,7 @@ printk(KERN_DEBUG "....... : PRQ implemented: %X\n", reg_01.PRQ); printk(KERN_DEBUG "....... : IO APIC version: %04X\n", reg_01.version); if ( (reg_01.version != 0x01) && /* 82489DX IO-APICs */ + (reg_01.version != 0x02) && /* VIA */ (reg_01.version != 0x10) && /* oldest IO-APICs */ (reg_01.version != 0x11) && /* Pentium/Pro IO-APICs */ (reg_01.version != 0x13) && /* Xeon IO-APICs */ @@ -1062,7 +1178,7 @@ old_id = mp_ioapics[apic].mpc_apicid; - if (mp_ioapics[apic].mpc_apicid >= 0xf) { + if (mp_ioapics[apic].mpc_apicid >= apic_broadcast_id) { printk(KERN_ERR "BIOS bug, IO-APIC#%d ID is %d in the MPC table!...\n", apic, mp_ioapics[apic].mpc_apicid); printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", @@ -1074,14 +1190,16 @@ * Sanity check, is the ID really free? Every APIC in a * system must have a unique ID or we get lots of nice * 'stuck on smp_invalidate_needed IPI wait' messages. + * I/O APIC IDs no longer have any meaning for xAPICs and SAPICs. */ - if (phys_id_present_map & (1 << mp_ioapics[apic].mpc_apicid)) { + if (!clustered_apic_physical && + (phys_id_present_map & (1 << mp_ioapics[apic].mpc_apicid))) { printk(KERN_ERR "BIOS bug, IO-APIC#%d ID %d is already used!...\n", apic, mp_ioapics[apic].mpc_apicid); for (i = 0; i < 0xf; i++) if (!(phys_id_present_map & (1 << i))) break; - if (i >= 0xf) + if (i >= apic_broadcast_id) panic("Max APIC ID exceeded!\n"); printk(KERN_ERR "... fixing up to %d. (tell your hw vendor)\n", i); @@ -1209,6 +1327,7 @@ */ static void ack_edge_ioapic_irq(unsigned int irq) { + balance_irq(irq); if ((irq_desc[irq].status & (IRQ_PENDING | IRQ_DISABLED)) == (IRQ_PENDING | IRQ_DISABLED)) mask_IO_APIC_irq(irq); @@ -1248,6 +1367,7 @@ unsigned long v; int i; + balance_irq(irq); /* * It appears there is an erratum which affects at least version 0x11 * of I/O APIC (that's the 82093AA and cores integrated into various @@ -1304,19 +1424,6 @@ static void mask_and_ack_level_ioapic_irq (unsigned int irq) { /* nothing */ } -static void set_ioapic_affinity (unsigned int irq, unsigned long mask) -{ - unsigned long flags; - /* - * Only the first 8 bits are valid. - */ - mask = mask << 24; - - spin_lock_irqsave(&ioapic_lock, flags); - __DO_ACTION(1, = mask, ) - spin_unlock_irqrestore(&ioapic_lock, flags); -} - /* * Level and edge triggered IO-APIC interrupts need different handling, * so we use two separate IRQ descriptors. Edge triggered IRQs can be diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/irq.c linux.20pre5-ac2/arch/i386/kernel/irq.c --- linux.20pre5/arch/i386/kernel/irq.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/irq.c 2002-08-13 14:05:06.000000000 +0100 @@ -170,7 +170,7 @@ p += sprintf(p, "LOC: "); for (j = 0; j < smp_num_cpus; j++) p += sprintf(p, "%10u ", - apic_timer_irqs[cpu_logical_map(j)]); + irq_stat[cpu_logical_map(j)].apic_timer_irqs); p += sprintf(p, "\n"); #endif p += sprintf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); @@ -1090,7 +1090,7 @@ static struct proc_dir_entry * smp_affinity_entry [NR_IRQS]; -static unsigned long irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL }; +unsigned long irq_affinity [NR_IRQS] = { [0 ... NR_IRQS-1] = ~0UL }; static int irq_affinity_read_proc (char *page, char **start, off_t off, int count, int *eof, void *data) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/ldt.c linux.20pre5-ac2/arch/i386/kernel/ldt.c --- linux.20pre5/arch/i386/kernel/ldt.c 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/ldt.c 2002-08-26 14:24:47.000000000 +0100 @@ -12,37 +12,139 @@ #include #include #include +#include #include #include #include #include +#ifdef CONFIG_SMP /* avoids "defined but not used" warnig */ +static void flush_ldt(void *mm) +{ + if (current->active_mm) + load_LDT(¤t->active_mm->context); +} +#endif + +static int alloc_ldt(mm_context_t *pc, int mincount, int reload) +{ + void *oldldt; + void *newldt; + int oldsize; + + if (mincount <= pc->size) + return 0; + oldsize = pc->size; + mincount = (mincount+511)&(~511); + if (mincount*LDT_ENTRY_SIZE > PAGE_SIZE) + newldt = vmalloc(mincount*LDT_ENTRY_SIZE); + else + newldt = kmalloc(mincount*LDT_ENTRY_SIZE, GFP_KERNEL); + + if (!newldt) + return -ENOMEM; + + if (oldsize) + memcpy(newldt, pc->ldt, oldsize*LDT_ENTRY_SIZE); + + oldldt = pc->ldt; + memset(newldt+oldsize*LDT_ENTRY_SIZE, 0, (mincount-oldsize)*LDT_ENTRY_SIZE); + wmb(); + pc->ldt = newldt; + pc->size = mincount; + if (reload) { + load_LDT(pc); +#ifdef CONFIG_SMP + if (current->mm->cpu_vm_mask != (1< PAGE_SIZE) + vfree(oldldt); + else + kfree(oldldt); + } + return 0; +} + +static inline int copy_ldt(mm_context_t *new, mm_context_t *old) +{ + int err = alloc_ldt(new, old->size, 0); + if (err < 0) { + printk(KERN_WARNING "ldt allocation failed\n"); + new->size = 0; + return err; + } + memcpy(new->ldt, old->ldt, old->size*LDT_ENTRY_SIZE); + return 0; +} + +/* + * we do not have to muck with descriptors here, that is + * done in switch_mm() as needed. + */ +int init_new_context(struct task_struct *tsk, struct mm_struct *mm) +{ + struct mm_struct * old_mm; + int retval = 0; + + init_MUTEX(&mm->context.sem); + mm->context.size = 0; + old_mm = current->mm; + if (old_mm && old_mm->context.size > 0) { + down(&old_mm->context.sem); + retval = copy_ldt(&mm->context, &old_mm->context); + up(&old_mm->context.sem); + } + return retval; +} + /* - * read_ldt() is not really atomic - this is not a problem since - * synchronization of reads and writes done to the LDT has to be - * assured by user-space anyway. Writes are atomic, to protect - * the security checks done on new descriptors. + * No need to lock the MM as we are the last user + * Do not touch the ldt register, we are already + * in the next thread. */ +void destroy_context(struct mm_struct *mm) +{ + if (mm->context.size) { + if (mm->context.size*LDT_ENTRY_SIZE > PAGE_SIZE) + vfree(mm->context.ldt); + else + kfree(mm->context.ldt); + mm->context.size = 0; + } +} + static int read_ldt(void * ptr, unsigned long bytecount) { int err; unsigned long size; struct mm_struct * mm = current->mm; - err = 0; - if (!mm->context.segments) - goto out; + if (!mm->context.size) + return 0; + if (bytecount > LDT_ENTRY_SIZE*LDT_ENTRIES) + bytecount = LDT_ENTRY_SIZE*LDT_ENTRIES; - size = LDT_ENTRIES*LDT_ENTRY_SIZE; + down(&mm->context.sem); + size = mm->context.size*LDT_ENTRY_SIZE; if (size > bytecount) size = bytecount; - err = size; - if (copy_to_user(ptr, mm->context.segments, size)) + err = 0; + if (copy_to_user(ptr, mm->context.ldt, size)) err = -EFAULT; -out: - return err; + up(&mm->context.sem); + if (err < 0) + return err; + if (size != bytecount) { + /* zero-fill the rest */ + clear_user(ptr+size, bytecount-size); + } + return bytecount; } static int read_default_ldt(void * ptr, unsigned long bytecount) @@ -53,7 +155,7 @@ err = 0; address = &default_ldt[0]; - size = sizeof(struct desc_struct); + size = 5*sizeof(struct desc_struct); if (size > bytecount) size = bytecount; @@ -88,24 +190,14 @@ goto out; } - /* - * the GDT index of the LDT is allocated dynamically, and is - * limited by MAX_LDT_DESCRIPTORS. - */ - down_write(&mm->mmap_sem); - if (!mm->context.segments) { - void * segments = vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE); - error = -ENOMEM; - if (!segments) + down(&mm->context.sem); + if (ldt_info.entry_number >= mm->context.size) { + error = alloc_ldt(¤t->mm->context, ldt_info.entry_number+1, 1); + if (error < 0) goto out_unlock; - memset(segments, 0, LDT_ENTRIES*LDT_ENTRY_SIZE); - wmb(); - mm->context.segments = segments; - mm->context.cpuvalid = 1UL << smp_processor_id(); - load_LDT(mm); } - lp = (__u32 *) ((ldt_info.entry_number << 3) + (char *) mm->context.segments); + lp = (__u32 *) ((ldt_info.entry_number << 3) + (char *) mm->context.ldt); /* Allow LDTs to be cleared by the user. */ if (ldt_info.base_addr == 0 && ldt_info.limit == 0) { @@ -143,7 +235,7 @@ error = 0; out_unlock: - up_write(&mm->mmap_sem); + up(&mm->context.sem); out: return error; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/longhaul.c linux.20pre5-ac2/arch/i386/kernel/longhaul.c --- linux.20pre5/arch/i386/kernel/longhaul.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/longhaul.c 2002-09-01 13:27:38.000000000 +0100 @@ -0,0 +1,700 @@ +/* + * $Id: longhaul.c,v 1.66 2002/08/28 10:59:46 db Exp $ + * + * (C) 2001 Dave Jones. + * (C) 2002 Padraig Brady. + * + * Licensed under the terms of the GNU GPL License version 2. + * Based upon datasheets & sample CPUs kindly provided by VIA. + * + * VIA have currently 3 different versions of Longhaul. + * + * +---------------------+----------+---------------------------------+ + * | Marketing name | Codename | longhaul version / features. | + * +---------------------+----------+---------------------------------+ + * | Samuel/CyrixIII | C5A | v1 : multipliers only | + * | Samuel2/C3 | C3E/C5B | v1 : multiplier only | + * | Ezra | C5C | v2 : multipliers & voltage | + * | Ezra-T | C5M/C5N | v3 : multipliers, voltage & FSB | + * +---------------------+----------+---------------------------------+ + * + * BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#define DEBUG + +#ifdef DEBUG +#define dprintk(msg...) printk(msg) +#else +#define dprintk(msg...) do { } while(0); +#endif + +static int numscales=16, numvscales; +static int minvid, maxvid; +static int can_scale_voltage; +static int can_scale_fsb; +static int vrmrev; + + +/* Module parameters */ +static int dont_scale_voltage; +static int dont_scale_fsb; +static int current_fsb; +static int favour_fast_fsb; + +#define __hlt() __asm__ __volatile__("hlt": : :"memory") + +/* + * Clock ratio tables. + * The eblcr ones specify the ratio read from the CPU. + * The clock_ratio ones specify what to write to the CPU. + */ + +/* VIA C3 Samuel 1 & Samuel 2 (stepping 0)*/ +static int __initdata longhaul1_clock_ratio[16] = { + -1, /* 0000 -> RESERVED */ + 30, /* 0001 -> 3.0x */ + 40, /* 0010 -> 4.0x */ + -1, /* 0011 -> RESERVED */ + -1, /* 0100 -> RESERVED */ + 35, /* 0101 -> 3.5x */ + 45, /* 0110 -> 4.5x */ + 55, /* 0111 -> 5.5x */ + 60, /* 1000 -> 6.0x */ + 70, /* 1001 -> 7.0x */ + 80, /* 1010 -> 8.0x */ + 50, /* 1011 -> 5.0x */ + 65, /* 1100 -> 6.5x */ + 75, /* 1101 -> 7.5x */ + -1, /* 1110 -> RESERVED */ + -1, /* 1111 -> RESERVED */ +}; + +static int __initdata samuel1_eblcr[16] = { + 50, /* 0000 -> RESERVED */ + 30, /* 0001 -> 3.0x */ + 40, /* 0010 -> 4.0x */ + -1, /* 0011 -> RESERVED */ + 55, /* 0100 -> 5.5x */ + 35, /* 0101 -> 3.5x */ + 45, /* 0110 -> 4.5x */ + -1, /* 0111 -> RESERVED */ + -1, /* 1000 -> RESERVED */ + 70, /* 1001 -> 7.0x */ + 80, /* 1010 -> 8.0x */ + 60, /* 1011 -> 6.0x */ + -1, /* 1100 -> RESERVED */ + 75, /* 1101 -> 7.5x */ + -1, /* 1110 -> RESERVED */ + 65, /* 1111 -> 6.5x */ +}; + +/* VIA C3 Samuel2 Stepping 1->15 & VIA C3 Ezra */ +static int __initdata longhaul2_clock_ratio[16] = { + 100, /* 0000 -> 10.0x */ + 30, /* 0001 -> 3.0x */ + 40, /* 0010 -> 4.0x */ + 90, /* 0011 -> 9.0x */ + 95, /* 0100 -> 9.5x */ + 35, /* 0101 -> 3.5x */ + 45, /* 0110 -> 4.5x */ + 55, /* 0111 -> 5.5x */ + 60, /* 1000 -> 6.0x */ + 70, /* 1001 -> 7.0x */ + 80, /* 1010 -> 8.0x */ + 50, /* 1011 -> 5.0x */ + 65, /* 1100 -> 6.5x */ + 75, /* 1101 -> 7.5x */ + 85, /* 1110 -> 8.5x */ + 120, /* 1111 -> 12.0x */ +}; + +static int __initdata samuel2_eblcr[16] = { + 50, /* 0000 -> 5.0x */ + 30, /* 0001 -> 3.0x */ + 40, /* 0010 -> 4.0x */ + 100, /* 0011 -> 10.0x */ + 55, /* 0100 -> 5.5x */ + 35, /* 0101 -> 3.5x */ + 45, /* 0110 -> 4.5x */ + 110, /* 0111 -> 11.0x */ + 90, /* 1000 -> 9.0x */ + 70, /* 1001 -> 7.0x */ + 80, /* 1010 -> 8.0x */ + 60, /* 1011 -> 6.0x */ + 120, /* 1100 -> 12.0x */ + 75, /* 1101 -> 7.5x */ + 130, /* 1110 -> 13.0x */ + 65, /* 1111 -> 6.5x */ +}; + +static int __initdata ezra_eblcr[16] = { + 50, /* 0000 -> 5.0x */ + 30, /* 0001 -> 3.0x */ + 40, /* 0010 -> 4.0x */ + 100, /* 0011 -> 10.0x */ + 55, /* 0100 -> 5.5x */ + 35, /* 0101 -> 3.5x */ + 45, /* 0110 -> 4.5x */ + 95, /* 0111 -> 9.5x */ + 90, /* 1000 -> 9.0x */ + 70, /* 1001 -> 7.0x */ + 80, /* 1010 -> 8.0x */ + 60, /* 1011 -> 6.0x */ + 120, /* 1100 -> 12.0x */ + 75, /* 1101 -> 7.5x */ + 85, /* 1110 -> 8.5x */ + 65, /* 1111 -> 6.5x */ +}; + +/* VIA C5M. */ +static int __initdata longhaul3_clock_ratio[32] = { + 100, /* 0000 -> 10.0x */ + 30, /* 0001 -> 3.0x */ + 40, /* 0010 -> 4.0x */ + 90, /* 0011 -> 9.0x */ + 95, /* 0100 -> 9.5x */ + 35, /* 0101 -> 3.5x */ + 45, /* 0110 -> 4.5x */ + 55, /* 0111 -> 5.5x */ + 60, /* 1000 -> 6.0x */ + 70, /* 1001 -> 7.0x */ + 80, /* 1010 -> 8.0x */ + 50, /* 1011 -> 5.0x */ + 65, /* 1100 -> 6.5x */ + 75, /* 1101 -> 7.5x */ + 85, /* 1110 -> 8.5x */ + 120, /* 1111 -> 12.0x */ + + -1, /* 0000 -> RESERVED (10.0x) */ + 110, /* 0001 -> 11.0x */ + 120, /* 0010 -> 12.0x */ + -1, /* 0011 -> RESERVED (9.0x)*/ + 105, /* 0100 -> 10.5x */ + 115, /* 0101 -> 11.5x */ + 125, /* 0110 -> 12.5x */ + 135, /* 0111 -> 13.5x */ + 140, /* 1000 -> 14.0x */ + 150, /* 1001 -> 15.0x */ + 160, /* 1010 -> 16.0x */ + 130, /* 1011 -> 13.0x */ + 145, /* 1100 -> 14.5x */ + 155, /* 1101 -> 15.5x */ + -1, /* 1110 -> RESERVED (13.0x) */ + -1, /* 1111 -> RESERVED (12.0x) */ +}; + +static int __initdata c5m_eblcr[32] = { + 50, /* 0000 -> 5.0x */ + 30, /* 0001 -> 3.0x */ + 40, /* 0010 -> 4.0x */ + 100, /* 0011 -> 10.0x */ + 55, /* 0100 -> 5.5x */ + 35, /* 0101 -> 3.5x */ + 45, /* 0110 -> 4.5x */ + 95, /* 0111 -> 9.5x */ + 90, /* 1000 -> 9.0x */ + 70, /* 1001 -> 7.0x */ + 80, /* 1010 -> 8.0x */ + 60, /* 1011 -> 6.0x */ + 120, /* 1100 -> 12.0x */ + 75, /* 1101 -> 7.5x */ + 85, /* 1110 -> 8.5x */ + 65, /* 1111 -> 6.5x */ + + -1, /* 0000 -> RESERVED (9.0x) */ + 110, /* 0001 -> 11.0x */ + 120, /* 0010 -> 12.0x */ + -1, /* 0011 -> RESERVED (10.0x)*/ + 135, /* 0100 -> 13.5x */ + 115, /* 0101 -> 11.5x */ + 125, /* 0110 -> 12.5x */ + 105, /* 0111 -> 10.5x */ + 130, /* 1000 -> 13.0x */ + 150, /* 1001 -> 15.0x */ + 160, /* 1010 -> 16.0x */ + 140, /* 1011 -> 14.0x */ + -1, /* 1100 -> RESERVED (12.0x) */ + 155, /* 1101 -> 15.5x */ + -1, /* 1110 -> RESERVED (13.0x) */ + 145, /* 1111 -> 14.5x */ +}; + +/* fsb values as defined in CPU */ +static unsigned int eblcr_fsb_table[] = { 66, 133, 100, -1 }; +/* fsb values to favour low fsb speed (lower power) */ +static unsigned int power_fsb_table[] = { 66, 100, 133, -1 }; +/* fsb values to favour high fsb speed (for e.g. if lowering CPU + freq because of heat, but want to maintain highest performance possible) */ +static unsigned int perf_fsb_table[] = { 133, 100, 66, -1 }; +static unsigned int *fsb_search_table; + +/* Voltage scales. Div by 1000 to get actual voltage. */ +static int __initdata vrm85scales[32] = { + 1250, 1200, 1150, 1100, 1050, 1800, 1750, 1700, + 1650, 1600, 1550, 1500, 1450, 1400, 1350, 1300, + 1275, 1225, 1175, 1125, 1075, 1825, 1775, 1725, + 1675, 1625, 1575, 1525, 1475, 1425, 1375, 1325, +}; + +static int __initdata mobilevrmscales[32] = { + 2000, 1950, 1900, 1850, 1800, 1750, 1700, 1650, + 1600, 1550, 1500, 1450, 1500, 1350, 1300, -1, + 1275, 1250, 1225, 1200, 1175, 1150, 1125, 1100, + 1075, 1050, 1025, 1000, 975, 950, 925, -1, +}; + +/* Clock ratios multiplied by 10 */ +static int clock_ratio[32]; +static int eblcr_table[32]; +static int voltage_table[32]; +static int highest_speed, lowest_speed; /* kHz */ +static int longhaul; /* version. */ +static struct cpufreq_driver *longhaul_driver; + +static unsigned int longhaul_validatespeed_fsb(unsigned int freq, unsigned fsb, unsigned int oldbest) +{ + int i; + unsigned int newclock; + unsigned int best=0; + + best = oldbest; + + /* Find closest MHz match. */ + for (i=0; i= freq)) + if ((newclock>=lowest_speed) && (newclock<=highest_speed)) + best = newclock; + } + return best; +} + +/* Determine nearest speed possible for the desired fsb speed */ +static unsigned int longhaul_validatespeed (unsigned int cpu, unsigned int freq) +{ + unsigned int best=-1; + + if (cpu && (cpu != CPUFREQ_ALL_CPUS)) + return 0; + + if (freqhighest_speed) + freq=highest_speed; + + if (can_scale_fsb==1) { + int fsb_index; + for (fsb_index=0; fsb_search_table[fsb_index]!=-1; fsb_index++) + best = longhaul_validatespeed_fsb (freq, fsb_search_table[fsb_index], best); + } else { + /* Can only scale multiplier. */ + best = longhaul_validatespeed_fsb (freq, current_fsb, best); + } + + return best; +} + +/** + * longhaul_set_cpu_frequency() + * @cpu: CPU number + * @freq: new processor frequency in kHz that has been + * validated with longhaul_validatespeed(). + * + * Note this function is only called if a new frequency has been selected. + */ + +static void longhaul_set_cpu_frequency (unsigned int cpu, unsigned int freq) +{ + int index; + unsigned int bestfsb=-1; + unsigned long lo, hi; + int bits=-1; + int revkey; + int vidindex, i; + + if (cpu && (cpu != CPUFREQ_ALL_CPUS)) + return; + + /* Find out which mult bit-pattern & FSB we want */ + for (index=0; index>18; + return eblcr_fsb_table[invalue]; + } else { + return current_fsb; + } +} + + +static int __init longhaul_get_cpu_mult (void) +{ + unsigned long invalue=0,lo, hi; + + rdmsr (MSR_IA32_EBL_CR_POWERON, lo, hi); + invalue = (lo & (1<<22|1<<23|1<<24|1<<25)) >>22; + if (longhaul==3) { + if (lo & (1<<27)) + invalue+=16; + } + return eblcr_table[invalue]; +} + + +static void __init longhaul_get_ranges (void) +{ + unsigned long lo, hi, invalue; + unsigned int minmult=0, maxmult=0, minfsb=0, maxfsb=0; + unsigned int multipliers[32]= { + 50,30,40,100,55,35,45,95,90,70,80,60,120,75,85,65, + -1,110,120,-1,135,115,125,105,130,150,160,140,-1,155,-1,145 }; + unsigned int fsb_table[4] = { 133, 100, -1, 66 }; + + switch (longhaul) { + case 1: + /* Ugh, Longhaul v1 didn't have the min/max MSRs. + Assume max = whatever we booted at. */ + maxmult = longhaul_get_cpu_mult(); + break; + + case 2 ... 3: + rdmsr (MSR_VIA_LONGHAUL, lo, hi); + + invalue = (hi & (1<<0|1<<1|1<<2|1<<3)); + if (hi & (1<<11)) + invalue += 16; + maxmult=multipliers[invalue]; + +#if 0 /* This is MaxMhz @ Min Voltage. Ignore for now */ + invalue = (hi & (1<<16|1<<17|1<<18|1<<19)) >> 16; + if (hi & (1<<27)) + invalue += 16; + minmult = multipliers[invalue]; +#else + minmult = 30; /* as per spec */ +#endif + + if (can_scale_fsb==1) { + invalue = (hi & (1<<9|1<<10)) >> 9; + maxfsb = fsb_table[invalue]; + + invalue = (hi & (1<<25|1<<26)) >> 25; + minfsb = fsb_table[invalue]; + + dprintk (KERN_INFO "longhaul: Min FSB=%d Max FSB=%d\n", + minfsb, maxfsb); + } else { + minfsb = maxfsb = current_fsb; + } + break; + } + + highest_speed = maxmult * maxfsb * 100; + lowest_speed = minmult * minfsb * 100; + + dprintk (KERN_INFO "longhaul: MinMult(x10)=%d MaxMult(x10)=%d\n", + minmult, maxmult); + dprintk (KERN_INFO "longhaul: Lowestspeed=%d Highestspeed=%d\n", + lowest_speed, highest_speed); +} + + +static void __init longhaul_setup_voltagescaling (unsigned long lo, unsigned long hi) +{ + int revkey; + + can_scale_voltage = 1; + + minvid = (hi & (1<<20|1<<21|1<<22|1<<23|1<<24)) >> 20; /* 56:52 */ + maxvid = (hi & (1<<4|1<<5|1<<6|1<<7|1<<8)) >> 4; /* 40:36 */ + vrmrev = (lo & (1<<15))>>15; + + if (vrmrev==0) { + dprintk (KERN_INFO "longhaul: VRM 8.5 : "); + memcpy (voltage_table, vrm85scales, sizeof(voltage_table)); + numvscales = (voltage_table[maxvid]-voltage_table[minvid])/25; + } else { + dprintk (KERN_INFO "longhaul: Mobile VRM : "); + memcpy (voltage_table, mobilevrmscales, sizeof(voltage_table)); + numvscales = (voltage_table[maxvid]-voltage_table[minvid])/5; + } + + /* Current voltage isn't readable at first, so we need to + set it to a known value. The spec says to use maxvid */ + revkey = (lo & 0xf)<<4; /* Rev key. */ + lo &= 0xfe0fff0f; /* Mask unneeded bits */ + lo |= (1<<9); /* EnableSoftVID */ + lo |= revkey; /* Reinsert key */ + lo |= maxvid << 20; + wrmsr (MSR_VIA_LONGHAUL, lo, hi); + minvid = voltage_table[minvid]; + maxvid = voltage_table[maxvid]; + dprintk ("Min VID=%d.%03d Max VID=%d.%03d, %d possible voltage scales\n", + maxvid/1000, maxvid%1000, minvid/1000, minvid%1000, numvscales); +} + + +static int __init longhaul_init (void) +{ + struct cpuinfo_x86 *c = cpu_data; + unsigned int currentspeed; + static int currentmult; + unsigned long lo, hi; + int ret; + struct cpufreq_driver *driver; + + if ((c->x86_vendor != X86_VENDOR_CENTAUR) || (c->x86 !=6) ) + return -ENODEV; + + switch (c->x86_model) { + case 6: /* VIA C3 Samuel C5A */ + longhaul=1; + memcpy (clock_ratio, longhaul1_clock_ratio, sizeof(longhaul1_clock_ratio)); + memcpy (eblcr_table, samuel1_eblcr, sizeof(samuel1_eblcr)); + break; + + case 7: /* C5B / C5C */ + switch (c->x86_mask) { + case 0: + longhaul=1; + memcpy (clock_ratio, longhaul1_clock_ratio, sizeof(longhaul1_clock_ratio)); + memcpy (eblcr_table, samuel2_eblcr, sizeof(samuel2_eblcr)); + break; + case 1 ... 15: + longhaul=2; + memcpy (clock_ratio, longhaul2_clock_ratio, sizeof(longhaul2_clock_ratio)); + memcpy (eblcr_table, ezra_eblcr, sizeof(ezra_eblcr)); + break; + } + break; + + case 8: /* C5M/C5N */ + return -ENODEV; // Waiting on updated docs from VIA before this is usable + longhaul=3; + numscales=32; + memcpy (clock_ratio, longhaul3_clock_ratio, sizeof(longhaul3_clock_ratio)); + memcpy (eblcr_table, c5m_eblcr, sizeof(c5m_eblcr)); + break; + + default: + printk (KERN_INFO "longhaul: Unknown VIA CPU. Contact davej@suse.de\n"); + return -ENODEV; + } + + printk (KERN_INFO "longhaul: VIA CPU detected. Longhaul version %d supported\n", longhaul); + + if (favour_fast_fsb==1) + fsb_search_table = perf_fsb_table; + else + fsb_search_table = power_fsb_table; + + current_fsb = longhaul_get_cpu_fsb(); + currentmult = longhaul_get_cpu_mult(); + currentspeed = currentmult * current_fsb * 100; + + dprintk (KERN_INFO "longhaul: CPU currently at %dMHz (%d x %d.%d)\n", + (currentspeed/1000), current_fsb, currentmult/10, currentmult%10); + + if (longhaul==2 || longhaul==3) { + rdmsr (MSR_VIA_LONGHAUL, lo, hi); + if ((lo & (1<<0)) && (dont_scale_voltage==0)) + longhaul_setup_voltagescaling (lo, hi); + + if ((lo & (1<<1)) && (dont_scale_fsb==0) && (current_fsb==0)) + can_scale_fsb = 1; + } + + longhaul_get_ranges(); + + driver = kmalloc(sizeof(struct cpufreq_driver) + + sizeof(struct cpufreq_freqs), GFP_KERNEL); + if (!driver) + return -ENOMEM; + + driver->freq = (struct cpufreq_freqs*) (driver + sizeof(struct cpufreq_driver)); + driver->sync = CPUFREQ_SYNC; + driver->freq->cpu = CPUFREQ_ALL_CPUS; + driver->freq->min = (unsigned int) lowest_speed; + driver->freq->max = (unsigned int) highest_speed; + driver->freq->cur = currentspeed; + driver->validate = &longhaul_validatespeed; + driver->setspeed = &longhaul_set_cpu_frequency; + + ret = cpufreq_register(driver); + + if (ret) { + kfree(driver); + return ret; + } + + longhaul_driver = driver; + return 0; +} + + +static void __exit longhaul_exit (void) +{ + if (longhaul_driver) { + cpufreq_unregister(); + kfree(longhaul_driver); + } +} + +MODULE_PARM (dont_scale_fsb, "i"); +MODULE_PARM (dont_scale_voltage, "i"); +MODULE_PARM (current_fsb, "i"); +MODULE_PARM (favour_fast_fsb, "i"); + +MODULE_AUTHOR ("Dave Jones "); +MODULE_DESCRIPTION ("Longhaul driver for VIA Cyrix processors."); +MODULE_LICENSE ("GPL"); + +module_init(longhaul_init); +module_exit(longhaul_exit); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/Makefile linux.20pre5-ac2/arch/i386/kernel/Makefile --- linux.20pre5/arch/i386/kernel/Makefile 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/Makefile 2002-08-12 15:11:54.000000000 +0100 @@ -40,5 +40,11 @@ obj-$(CONFIG_X86_LOCAL_APIC) += mpparse.o apic.o nmi.o obj-$(CONFIG_X86_IO_APIC) += io_apic.o acpitable.o obj-$(CONFIG_X86_VISWS_APIC) += visws_apic.o +obj-$(CONFIG_X86_POWERNOW_K6) += powernow-k6.o +obj-$(CONFIG_X86_LONGHAUL) += longhaul.o +obj-$(CONFIG_X86_SPEEDSTEP) += speedstep.o +obj-$(CONFIG_X86_P4_CLOCKMOD) += p4-clockmod.o +obj-$(CONFIG_ELAN_CPUFREQ) += elanfreq.o + include $(TOPDIR)/Rules.make diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/mpparse.c linux.20pre5-ac2/arch/i386/kernel/mpparse.c --- linux.20pre5/arch/i386/kernel/mpparse.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/mpparse.c 2002-08-26 14:19:19.000000000 +0100 @@ -12,6 +12,7 @@ * Maciej W. Rozycki : Bits for default MP configurations */ +#include #include #include #include @@ -26,6 +27,7 @@ #include #include #include +#include /* Have we found an MP table */ int smp_found_config; @@ -35,18 +37,20 @@ * MP-table. */ int apic_version [MAX_APICS]; -int mp_bus_id_to_type [MAX_MP_BUSSES]; -int mp_bus_id_to_node [MAX_MP_BUSSES]; -int mp_bus_id_to_local [MAX_MP_BUSSES]; int quad_local_to_mp_bus_id [NR_CPUS/4][4]; -int mp_bus_id_to_pci_bus [MAX_MP_BUSSES] = { [0 ... MAX_MP_BUSSES-1] = -1 }; int mp_current_pci_id; +int *mp_bus_id_to_type; +int *mp_bus_id_to_node; +int *mp_bus_id_to_local; +int *mp_bus_id_to_pci_bus; +int max_mp_busses; +int max_irq_sources; /* I/O APIC entries */ struct mpc_config_ioapic mp_ioapics[MAX_IO_APICS]; /* # of MP IRQ source entries */ -struct mpc_config_intsrc mp_irqs[MAX_IRQ_SOURCES]; +struct mpc_config_intsrc *mp_irqs; /* MP IRQ source entries */ int mp_irq_entries; @@ -64,6 +68,16 @@ /* Bitmask of physically existing CPUs */ unsigned long phys_cpu_present_map; +unsigned long logical_cpu_present_map; + +unsigned int apic_broadcast_id = APIC_BROADCAST_ID_APIC; +unsigned int int_dest_addr_mode = APIC_DEST_LOGICAL; +unsigned char int_delivery_mode = dest_LowestPrio; +unsigned char clustered_apic_mode = 0; +unsigned char esr_disable = 0; + +unsigned char raw_phys_apicid[NR_CPUS] = { 0 }; + /* * Intel MP BIOS table parsing routines: @@ -146,8 +160,8 @@ if (!(m->mpc_cpuflag & CPU_ENABLED)) return; - logical_apicid = m->mpc_apicid; - if (clustered_apic_mode) { + logical_apicid = 0x01; + if (clustered_apic_logical) { quad = translation_table[mpc_record]->trans_quad; logical_apicid = (quad << 4) + (m->mpc_apicid ? m->mpc_apicid << 1 : 1); @@ -223,15 +237,14 @@ if (m->mpc_apicid > MAX_APICS) { printk("Processor #%d INVALID. (Max ID: %d).\n", m->mpc_apicid, MAX_APICS); + --num_processors; return; } ver = m->mpc_apicver; - if (clustered_apic_mode) { - phys_cpu_present_map |= (logical_apicid&0xf) << (4*quad); - } else { - phys_cpu_present_map |= 1 << m->mpc_apicid; - } + logical_cpu_present_map |= 1 << (num_processors-1); + phys_cpu_present_map |= apicid_to_phys_cpu_present(m->mpc_apicid); + /* * Validate version */ @@ -240,6 +253,7 @@ ver = 0x10; } apic_version[m->mpc_apicid] = ver; + raw_phys_apicid[num_processors - 1] = m->mpc_apicid; } static void __init MP_bus_info (struct mpc_config_bus *m) @@ -250,7 +264,7 @@ memcpy(str, m->mpc_bustype, 6); str[6] = 0; - if (clustered_apic_mode) { + if (clustered_apic_logical) { quad = translation_table[mpc_record]->trans_quad; mp_bus_id_to_node[m->mpc_busid] = quad; mp_bus_id_to_local[m->mpc_busid] = translation_table[mpc_record]->trans_local; @@ -304,7 +318,7 @@ m->mpc_irqtype, m->mpc_irqflag & 3, (m->mpc_irqflag >> 2) & 3, m->mpc_srcbus, m->mpc_srcbusirq, m->mpc_dstapic, m->mpc_dstirq); - if (++mp_irq_entries == MAX_IRQ_SOURCES) + if (++mp_irq_entries == max_irq_sources) panic("Max # of irq sources exceeded!!\n"); } @@ -394,9 +408,17 @@ static int __init smp_read_mpc(struct mp_config_table *mpc) { - char str[16]; + char oem[16], prod[14]; int count=sizeof(*mpc); unsigned char *mpt=((unsigned char *)mpc)+count; + int num_bus = 0; + int num_irq = 0; + unsigned char *bus_data; + int xapic = 0; + int numaq = 0; + static const char *mode_names[] = { + "Flat", "Clustered Logical", "Clustered Physical", "???" + }; if (memcmp(mpc->mpc_signature,MPC_SIGNATURE,4)) { panic("SMP mptable: bad signature [%c%c%c%c]!\n", @@ -419,13 +441,21 @@ printk(KERN_ERR "SMP mptable: null local APIC address!\n"); return 0; } - memcpy(str,mpc->mpc_oem,8); - str[8]=0; - printk("OEM ID: %s ",str); - - memcpy(str,mpc->mpc_productid,12); - str[12]=0; - printk("Product ID: %s ",str); + memcpy(oem,mpc->mpc_oem,8); + oem[8]=0; + printk("OEM ID: %s ",oem); + + memcpy(prod,mpc->mpc_productid,12); + prod[12]=0; + printk("Product ID: %s ",prod); + + /* + * Can't recognize Summit xAPICs at present, so use the OEM ID. + */ + if (!strncmp(oem, "IBM ENSW", 8) && (!strncmp(prod, "NF 6000R", 8) || !strncmp(prod, "VIGIL SMP", 9))) + xapic = 2; + else if (!strncmp(oem, "IBM NUMA", 8)) + numaq = 1; printk("APIC at: 0x%lX\n",mpc->mpc_lapic); @@ -435,16 +465,77 @@ if (!have_acpi_tables) mp_lapic_addr = mpc->mpc_lapic; - if (clustered_apic_mode && mpc->mpc_oemptr) { + if (clustered_apic_logical && mpc->mpc_oemptr) { /* We need to process the oem mpc tables to tell us which quad things are in ... */ mpc_record = 0; smp_read_mpc_oem((struct mp_config_oemtable *) mpc->mpc_oemptr, mpc->mpc_oemsize); mpc_record = 0; } + /* Pre-scan to determine the number of bus and + * interrupts records we have + */ + while (count < mpc->mpc_length) { + switch (*mpt) { + case MP_PROCESSOR: + mpt += sizeof(struct mpc_config_processor); + count += sizeof(struct mpc_config_processor); + break; + case MP_BUS: + ++num_bus; + mpt += sizeof(struct mpc_config_bus); + count += sizeof(struct mpc_config_bus); + break; + case MP_INTSRC: + ++num_irq; + mpt += sizeof(struct mpc_config_intsrc); + count += sizeof(struct mpc_config_intsrc); + break; + case MP_IOAPIC: + mpt += sizeof(struct mpc_config_ioapic); + count += sizeof(struct mpc_config_ioapic); + break; + case MP_LINTSRC: + mpt += sizeof(struct mpc_config_lintsrc); + count += sizeof(struct mpc_config_lintsrc); + break; + default: + count = mpc->mpc_length; + break; + } + } + /* + * Paranoia: Allocate one extra of both the number of busses and number + * of irqs, and make sure that we have at least 4 interrupts per PCI + * slot. But some machines do not report very many busses, so we need + * to fall back on the older defaults. + */ + ++num_bus; + max_mp_busses = max(num_bus, MAX_MP_BUSSES); + if (num_irq < (4 * max_mp_busses)) + num_irq = 4 * num_bus; /* 4 intr/PCI slot */ + ++num_irq; + max_irq_sources = max(num_irq, MAX_IRQ_SOURCES); + + count = (max_mp_busses * sizeof(int)) * 4; + count += (max_irq_sources * sizeof(struct mpc_config_intsrc)); + bus_data = alloc_bootmem(count); + if (!bus_data) { + printk(KERN_ERR "SMP mptable: out of memory!\n"); + return 0; + } + mp_bus_id_to_type = (int *)&bus_data[0]; + mp_bus_id_to_node = (int *)&bus_data[(max_mp_busses * sizeof(int))]; + mp_bus_id_to_local = (int *)&bus_data[(max_mp_busses * sizeof(int)) * 2]; + mp_bus_id_to_pci_bus = (int *)&bus_data[(max_mp_busses * sizeof(int)) * 3]; + mp_irqs = (struct mpc_config_intsrc *)&bus_data[(max_mp_busses * sizeof(int)) * 4]; + memset(mp_bus_id_to_pci_bus, -1, max_mp_busses); + /* * Now process the configuration blocks. */ + count = sizeof(*mpc); + mpt = ((unsigned char *)mpc)+count; while (count < mpc->mpc_length) { switch(*mpt) { case MP_PROCESSOR: @@ -504,6 +595,20 @@ } ++mpc_record; } + if (xapic || numaq) { + if (numaq) + xapic = 0; /* NUMA-Q boxes never had xAPICs */ + clustered_apic_mode = (u8)(xapic | numaq); + esr_disable = 1; + apic_broadcast_id = (xapic ? APIC_BROADCAST_ID_XAPIC : APIC_BROADCAST_ID_APIC); + int_dest_addr_mode = (xapic ? APIC_DEST_PHYSICAL : APIC_DEST_LOGICAL); + int_delivery_mode = (xapic ? dest_Fixed : dest_LowestPrio); + phys_cpu_present_map = logical_cpu_present_map; + /* There isnt a single clock source on these boxen */ + disable_tsc(); + } + printk("Enabling APIC mode: %s. Using %d I/O APICs\n", + mode_names[clustered_apic_mode], nr_ioapics); if (!num_processors) printk(KERN_ERR "SMP mptable: no processors registered!\n"); return num_processors; @@ -799,18 +904,16 @@ * there is a real-mode segmented pointer pointing to the * 4K EBDA area at 0x40E, calculate and scan it here. * - * NOTE! There are Linux loaders that will corrupt the EBDA + * NOTE! There were Linux loaders that will corrupt the EBDA * area, and as such this kind of SMP config may be less * trustworthy, simply because the SMP table may have been - * stomped on during early boot. These loaders are buggy and - * should be fixed. + * stomped on during early boot. Thankfully the bootloaders + * now honour the EBDA. */ address = *(unsigned short *)phys_to_virt(0x40E); address <<= 4; smp_scan_config(address, 0x1000); - if (smp_found_config) - printk(KERN_WARNING "WARNING: MP table in the EBDA can be UNSAFE, contact linux-smp@vger.kernel.org if you experience SMP problems!\n"); } #else diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/nmi.c linux.20pre5-ac2/arch/i386/kernel/nmi.c --- linux.20pre5/arch/i386/kernel/nmi.c 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/nmi.c 2002-08-06 15:42:19.000000000 +0100 @@ -343,7 +343,7 @@ */ int sum, cpu = smp_processor_id(); - sum = apic_timer_irqs[cpu]; + sum = irq_stat[cpu].apic_timer_irqs; if (last_irq_sums[cpu] == sum) { /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/p4-clockmod.c linux.20pre5-ac2/arch/i386/kernel/p4-clockmod.c --- linux.20pre5/arch/i386/kernel/p4-clockmod.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/p4-clockmod.c 2002-09-01 13:27:38.000000000 +0100 @@ -0,0 +1,222 @@ +/* + * Pentium 4/Xeon CPU on demand clock modulation/speed scaling + * (C) 2002 Zwane Mwaikambo + * (C) 2002 Arjan van de Ven + * (C) 2002 Tora T. Engstad + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * The author(s) of this software shall not be held liable for damages + * of any nature resulting due to the use of this software. This + * software is provided AS-IS with no warranties. + * + * Date Errata Description + * 20020525 N44, O17 12.5% or 25% DC causes lockup + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define PFX "cpufreq: " + +#ifndef MSR_IA32_THERM_CONTROL +#define MSR_IA32_THERM_CONTROL 0x19a +#endif +#ifndef MSR_IA32_THERM_STATUS +#define MSR_IA32_THERM_STATUS 0x19c +#endif + +/* + * Duty Cycle (3bits), note DC_DISABLE is not specified in + * intel docs i just use it to mean disable + */ +enum { + DC_RESV, DC_DFLT, DC_25PT, DC_38PT, DC_50PT, + DC_64PT, DC_75PT, DC_88PT, DC_DISABLE +}; + +#define DC_ENTRIES 8 +static int cycle_table[DC_ENTRIES][2] = { + {13, DC_DFLT }, + {25, DC_25PT }, + {38, DC_38PT }, + {50, DC_50PT }, + {64, DC_64PT }, + {75, DC_75PT }, + {88, DC_88PT }, + {100, DC_DISABLE} }; + +static int has_N44_O17_errata; +static int stock_freq; +MODULE_PARM(stock_freq, "i"); + +static struct cpufreq_driver *cpufreq_p4_driver; + +static int cpufreq_p4_validatedc(unsigned int cpu, unsigned int percent, unsigned int *pct) +{ + u32 l, h; + int dc = DC_DISABLE; + + /* + * ... if we want to set the percentage LOWER than the thermal throttle + * we should allow that so that it takes effect once the thermal throttle situation + * ends -- Arjan + */ + + rdmsr(MSR_IA32_THERM_STATUS, l, h); + if (l & 0x01) + printk(KERN_DEBUG PFX "CPU#%d currently thermal throttled\n", cpu); + + /* look up the closest (but lower) duty cycle in the table */ + for (i=0; ix86_vendor != X86_VENDOR_INTEL) + return -ENODEV; + + if (!test_bit(X86_FEATURE_ACPI, c->x86_capability) || + !test_bit(X86_FEATURE_ACC, c->x86_capability)) + return -ENODEV; + + /* Errata workarounds */ + cpuid = (c->x86 << 8) | (c->x86_model << 4) | c->x86_mask; + switch (cpuid) { + case 0x0f07: + case 0x0f0a: + case 0x0f11: + case 0x0f12: + has_N44_O17_errata = 1; + default: + break; + } + + printk(KERN_INFO PFX "CPU#%d P4/Xeon(TM) CPU On-Demand Clock Modulation available\n", cpu); + driver = kmalloc(sizeof(struct cpufreq_driver) + + sizeof(struct cpufreq_freqs), GFP_KERNEL); + if (!driver) + return -ENOMEM; + driver->freq = (struct cpufreq_freqs*) (driver + sizeof(struct cpufreq_driver)); + driver->sync = CPUFREQ_SYNC; /* wrong */ + driver->freq->cpu=CPUFREQ_ALL_CPUS; + driver->freq->cur=0; + driver->freq->min=0; + driver->freq->max=stock_freq; + driver->validate=&cpufreq_p4_validate_speed; + driver->setspeed=&cpufreq_p4_set_cpuspeed; + + ret = cpufreq_register(driver); + if (ret) { + kfree(driver); + return ret; + } + + cpufreq_p4_driver = driver; + stock_freq = cpufreq_get(0); /* ugg :( */ + + return 0; +} + + +void __exit cpufreq_p4_exit(void) +{ + u32 l, h; + + if (cpufreq_p4_driver) { + cpufreq_unregister(); + /* return back to a non modulated state */ + rdmsr(MSR_IA32_THERM_CONTROL, l, h); + wrmsr(MSR_IA32_THERM_CONTROL, l & ~(1<<4), h); + kfree(cpufreq_p4_driver); + } +} + +MODULE_AUTHOR ("Zwane Mwaikambo "); +MODULE_DESCRIPTION ("cpufreq driver for Pentium(TM) 4/Xeon(TM)"); +MODULE_LICENSE ("GPL"); + +module_init(cpufreq_p4_init); +module_exit(cpufreq_p4_exit); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/pci-dma.c linux.20pre5-ac2/arch/i386/kernel/pci-dma.c --- linux.20pre5/arch/i386/kernel/pci-dma.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/pci-dma.c 2002-08-15 13:16:11.000000000 +0100 @@ -19,7 +19,7 @@ void *ret; int gfp = GFP_ATOMIC; - if (hwdev == NULL || ((u32)hwdev->dma_mask != 0xffffffff)) + if (hwdev == NULL || hwdev->dma_mask < 0xffffffff) gfp |= GFP_DMA; ret = (void *)__get_free_pages(gfp, get_order(size)); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/pci-irq.c linux.20pre5-ac2/arch/i386/kernel/pci-irq.c --- linux.20pre5/arch/i386/kernel/pci-irq.c 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/pci-irq.c 2002-08-06 15:42:19.000000000 +0100 @@ -22,6 +22,8 @@ #define PIRQ_SIGNATURE (('$' << 0) + ('P' << 8) + ('I' << 16) + ('R' << 24)) #define PIRQ_VERSION 0x0100 +int broken_hp_bios_irq9; + static struct irq_routing_table *pirq_table; /* @@ -596,6 +598,15 @@ DBG(" -> PIRQ %02x, mask %04x, excl %04x", pirq, mask, pirq_table->exclusive_irqs); mask &= pcibios_irq_mask; + /* Work around broken HP Pavilion Notebooks which assign USB to + IRQ 9 even though it is actually wired to IRQ 11 */ + + if (broken_hp_bios_irq9 && pirq == 0x59 && dev->irq == 9) { + dev->irq = 11; + pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11); + r->set(pirq_router_dev, dev, pirq, 11); + } + /* * Find the best IRQ to assign: use the one * reported by the device if possible. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/powernow-k6.c linux.20pre5-ac2/arch/i386/kernel/powernow-k6.c --- linux.20pre5/arch/i386/kernel/powernow-k6.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/powernow-k6.c 2002-09-01 13:27:38.000000000 +0100 @@ -0,0 +1,236 @@ +/* + * $Id: powernow-k6.c,v 1.26 2002/08/19 15:00:57 davej Exp $ + * This file was part of Powertweak Linux (http://powertweak.sf.net) + * and is shared with the Linux Kernel module. + * + * (C) 2000-2002 Dave Jones, Arjan van de Ven, Janne Pänkälä. + * + * Licensed under the terms of the GNU GPL License version 2. + * + * BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define POWERNOW_IOPORT 0xfff0 /* it doesn't matter where, as long + as it is unused */ + +static struct cpufreq_driver *powernow_driver; +static unsigned int busfreq; /* FSB, in 10 kHz */ +static unsigned int max_multiplier; + + +/* Clock ratio multiplied by 10 - see table 27 in AMD#23446 */ +static int clock_ratio[8] = { + 45, /* 000 -> 4.5x */ + 50, /* 001 -> 5.0x */ + 40, /* 010 -> 4.0x */ + 55, /* 011 -> 5.5x */ + 20, /* 100 -> 2.0x */ + 30, /* 101 -> 3.0x */ + 60, /* 110 -> 6.0x */ + 35 /* 111 -> 3.5x */ +}; + + +/** + * powernow_k6_set_frequency - set the PowerNow! multiplier + * @cpu: CPU number + * @freq: new processor frequency in kHz + * + * Tries to change the PowerNow! multiplier + */ +void powernow_k6_set_frequency (unsigned int cpu, unsigned int freq) +{ + unsigned int i; + unsigned int best_i = 4; + unsigned int tmpfreq; + unsigned int newfreq = busfreq * 65; + unsigned long outvalue=0, invalue=0; + unsigned long msrval; + unsigned long cpus_allowed; + + if (!powernow_driver || !freq || (freq > busfreq * max_multiplier)) { + printk(KERN_ERR "cpufreq: initialization problem or invalid target frequency\n"); + return; + } + + + /* Find out which bit-pattern we want */ + for (i=0; i<8; i++) { + tmpfreq = busfreq * clock_ratio[i]; + if ((tmpfreq < newfreq) && (newfreq >= freq)) { + newfreq = tmpfreq; + best_i = i; + } + } + + /* "best_i" now contains the bitpattern of the new multiplier. + we now need to transform it to the BVC format, see AMD#23446 */ + + outvalue = (1<<12) | (1<<10) | (1<<9) | (best_i<<5); + + /* + * Save this threads cpus_allowed mask, and bind to the + * specified CPU. When this call returns, we should be + * running on the right CPU. + */ + cpus_allowed = current->cpus_allowed; + set_cpus_allowed(current, 1 << cpu); + BUG_ON(cpu != smp_processor_id()); + + msrval = POWERNOW_IOPORT + 0x1; + wrmsr(MSR_K6_EPMR, msrval, 0); /* enable the PowerNow port */ + invalue=inl(POWERNOW_IOPORT + 0x8); + invalue = invalue & 0xf; + outvalue = outvalue | invalue; + outl(outvalue ,(POWERNOW_IOPORT + 0x8)); + msrval = POWERNOW_IOPORT + 0x0; + wrmsr(MSR_K6_EPMR, msrval, 0); /* disable it again */ + + /* + * Restore the CPUs allowed mask. + */ + set_cpus_allowed(current, cpus_allowed); + + return; +} + + +/** + * powernow_k6_get_cpu_multiplier - returns the current FSB multiplier + * + * Returns the current setting of the frequency multiplier. Core clock + * speed is frequency of the Front-Side Bus multiplied with this value. + */ +static int powernow_k6_get_cpu_multiplier(void) +{ + u64 invalue = 0; + u32 msrval; + + msrval = POWERNOW_IOPORT + 0x1; + wrmsr(MSR_K6_EPMR, msrval, 0); /* enable the PowerNow port */ + invalue=inl(POWERNOW_IOPORT + 0x8); + msrval = POWERNOW_IOPORT + 0x0; + wrmsr(MSR_K6_EPMR, msrval, 0); /* disable it again */ + + return clock_ratio[(invalue >> 5)&7]; +} + + +/** + * powernow_k6_validate_frequency - validates the CPU frequency to be set + * @cpu: CPU number + * @kHz: suggested new CPU frequency + * + * Makes sure the CPU frequency to be set is valid. + */ +unsigned int powernow_k6_validate_frequency(unsigned int cpu, unsigned int kHz) +{ + int i; + unsigned int tmpfreq; + unsigned int newfreq = busfreq * 65; + + if (kHz >= busfreq * max_multiplier) + return (busfreq * max_multiplier); + + for (i=0; i<8; i++) { + tmpfreq = busfreq * clock_ratio[i]; + if ((tmpfreq < newfreq) && (newfreq >= kHz)) + newfreq = tmpfreq; + } + + return tmpfreq; +} + + +/** + * powernow_k6_init - initializes the k6 PowerNow! CPUFreq driver + * + * Initializes the K6 PowerNow! support. Returns -ENODEV on unsupported + * devices, -EINVAL or -ENOMEM on problems during initiatization, and zero + * on success. + */ +static int __init powernow_k6_init(void) +{ + struct cpuinfo_x86 *c = cpu_data; + struct cpufreq_driver *driver; + unsigned int result; + unsigned int i; + + if ((c->x86_vendor != X86_VENDOR_AMD) || (c->x86 != 5) || + ((c->x86_model != 12) && (c->x86_model != 13))) + return -ENODEV; + + /* it is assumed that all CPUs run at the same, highest frequency */ + max_multiplier = powernow_k6_get_cpu_multiplier(); + busfreq = cpu_khz / max_multiplier; + + if (!request_region(POWERNOW_IOPORT, 16, "PowerNow!")) { + printk("cpufreq: PowerNow IOPORT region already used.\n"); + return -EIO; + } + + /* initialization of main "cpufreq" code*/ + driver = kmalloc(sizeof(struct cpufreq_driver) + + NR_CPUS * sizeof(struct cpufreq_freqs), GFP_KERNEL); + if (!driver) { + release_region (POWERNOW_IOPORT, 16); + return -ENOMEM; + } + + driver->freq = (struct cpufreq_freqs*) (driver + sizeof(struct cpufreq_driver)); + driver->sync = CPUFREQ_ASYNC; + + for (i=0; ifreq[i].cpu = i; + driver->freq[i].min = busfreq * 2.0; + driver->freq[i].max = busfreq * max_multiplier; + driver->freq[i].cur = busfreq * max_multiplier; + } + + driver->validate = &powernow_k6_validate_frequency; + driver->setspeed = &powernow_k6_set_frequency; + + result = cpufreq_register(driver); + if (result) { + release_region (POWERNOW_IOPORT, 16); + kfree(driver); + return result; + } + powernow_driver = driver; + + return 0; +} + + +/** + * powernow_k6_exit - unregisters AMD K6-2+/3+ PowerNow! support + * + * Unregisters AMD K6-2+ / K6-3+ PowerNow! support. + */ +static void __exit powernow_k6_exit(void) +{ + if (powernow_driver) { + cpufreq_unregister(); + kfree(powernow_driver); + } +} + + +MODULE_AUTHOR ("Arjan van de Ven , Dave Jones , Dominik Brodowski "); +MODULE_DESCRIPTION ("PowerNow! driver for AMD K6-2+ / K6-3+ processors."); +MODULE_LICENSE ("GPL"); +module_init(powernow_k6_init); +module_exit(powernow_k6_exit); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/process.c linux.20pre5-ac2/arch/i386/kernel/process.c --- linux.20pre5/arch/i386/kernel/process.c 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/process.c 2002-08-26 14:24:47.000000000 +0100 @@ -124,15 +124,12 @@ void cpu_idle (void) { /* endless idle loop with no priority at all */ - init_idle(); - current->nice = 20; - current->counter = -100; while (1) { void (*idle)(void) = pm_idle; if (!idle) idle = default_idle; - while (!current->need_resched) + if (!current->need_resched) idle(); schedule(); check_pgt_cache(); @@ -187,7 +184,7 @@ } /* we will leave sorting out the final value when we are ready to reboot, since we might not - have set up boot_cpu_id or smp_num_cpu */ + have set up boot_cpu_physical_apicid or smp_num_cpu */ break; #endif } @@ -253,7 +250,7 @@ 0x66, 0x0f, 0x20, 0xc3, /* movl %cr0,%ebx */ 0x66, 0x81, 0xe3, 0x00, 0x00, 0x00, 0x60, /* andl $0x60000000,%ebx */ 0x74, 0x02, /* jz f */ - 0x0f, 0x08, /* invd */ + 0x0f, 0x09, /* wbinvd */ 0x24, 0x10, /* f: andb $0x10,al */ 0x66, 0x0f, 0x22, 0xc0 /* movl %eax,%cr0 */ }; @@ -466,23 +463,6 @@ } /* - * No need to lock the MM as we are the last user - */ -void release_segments(struct mm_struct *mm) -{ - void * ldt = mm->context.segments; - - /* - * free the LDT - */ - if (ldt) { - mm->context.segments = NULL; - clear_LDT(); - vfree(ldt); - } -} - -/* * Create a kernel thread */ int kernel_thread(int (*fn)(void *), void * arg, unsigned long flags) @@ -534,45 +514,19 @@ void release_thread(struct task_struct *dead_task) { if (dead_task->mm) { - void * ldt = dead_task->mm->context.segments; - // temporary debugging check - if (ldt) { - printk("WARNING: dead process %8s still has LDT? <%p>\n", - dead_task->comm, ldt); + if (dead_task->mm->context.size) { + printk("WARNING: dead process %8s still has LDT? <%p/%d>\n", + dead_task->comm, + dead_task->mm->context.ldt, + dead_task->mm->context.size); BUG(); } } - release_x86_irqs(dead_task); } /* - * we do not have to muck with descriptors here, that is - * done in switch_mm() as needed. - */ -void copy_segments(struct task_struct *p, struct mm_struct *new_mm) -{ - struct mm_struct * old_mm; - void *old_ldt, *ldt; - - ldt = NULL; - old_mm = current->mm; - if (old_mm && (old_ldt = old_mm->context.segments) != NULL) { - /* - * Completely new LDT, we initialize it from the parent: - */ - ldt = vmalloc(LDT_ENTRIES*LDT_ENTRY_SIZE); - if (!ldt) - printk(KERN_WARNING "ldt allocation failed\n"); - else - memcpy(ldt, old_ldt, LDT_ENTRIES*LDT_ENTRY_SIZE); - } - new_mm->context.segments = ldt; - new_mm->context.cpuvalid = ~0UL; /* valid on all CPU's - they can't have stale data */ -} - -/* * Save a segment. */ #define savesegment(seg,value) \ @@ -697,15 +651,17 @@ asm volatile("movl %%gs,%0":"=m" (*(int *)&prev->gs)); /* - * Restore %fs and %gs. + * Restore %fs and %gs if needed. */ - loadsegment(fs, next->fs); - loadsegment(gs, next->gs); + if (unlikely(prev->fs | prev->gs | next->fs | next->gs)) { + loadsegment(fs, next->fs); + loadsegment(gs, next->gs); + } /* * Now maybe reload the debug registers */ - if (next->debugreg[7]){ + if (unlikely(next->debugreg[7])) { loaddebug(next, 0); loaddebug(next, 1); loaddebug(next, 2); @@ -715,7 +671,7 @@ loaddebug(next, 7); } - if (prev->ioperm || next->ioperm) { + if (unlikely(prev->ioperm || next->ioperm)) { if (next->ioperm) { /* * 4 cachelines copy ... not good, but not that diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/setup.c linux.20pre5-ac2/arch/i386/kernel/setup.c --- linux.20pre5/arch/i386/kernel/setup.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/setup.c 2002-08-26 14:19:19.000000000 +0100 @@ -1172,23 +1172,49 @@ } __setup("cachesize=", cachesize_setup); - #ifndef CONFIG_X86_TSC + static int tsc_disable __initdata = 0; +void disable_tsc(void) +{ + if(tsc_disable == 0) + { + printk(KERN_INFO "Disabling use of TSC for time counting.\n"); + tsc_disable = 1; + } +} + +/* Disable TSC on processor and also for get time of day */ + static int __init notsc_setup(char *str) { + tsc_disable = 2; + return 1; +} + +__setup("notsc", notsc_setup); + +/* Allow TSC use but don't use it for gettimeofday */ + +static int __init badtsc_setup(char *str) +{ tsc_disable = 1; return 1; } + +__setup("badtsc", badtsc_setup); + #else -static int __init notsc_setup(char *str) + +#define tsc_disable 0 + +void disable_tsc(void) { - printk("notsc: Kernel compiled with CONFIG_X86_TSC, cannot disable TSC.\n"); - return 1; + panic("Time stamp counter required by this kernel, but not supported by the hardware.\n"); } + #endif -__setup("notsc", notsc_setup); static int __init highio_setup(char *str) { @@ -1475,11 +1501,9 @@ } /* - * Cx86_dir0_msb is a HACK needed by check_cx686_cpuid/slop in bugs.h in - * order to identify the Cyrix CPU model after we're out of setup.c - * - * Actually since bugs.h doesn't even reference this perhaps someone should - * fix the documentation ??? + * Cx86_dir0_msb is a HACK needed by check_cx686_cpuid/slop in + * order to identify the Cyrix CPU model after we're out of the + * initial setup. */ static unsigned char Cx86_dir0_msb __initdata = 0; @@ -2283,6 +2307,20 @@ } } } + + /* Intel PIII Tualatin. This comes in two flavours. + * One has 256kb of cache, the other 512. We have no way + * to determine which, so we use a boottime override + * for the 512kb model, and assume 256 otherwise. + */ + if ((c->x86_vendor == X86_VENDOR_INTEL) && (c->x86 == 6) && + (c->x86_model == 11) && (l2 == 0)) + l2 = 256; + + /* Allow user to override all this if necessary. */ + if (cachesize_override != -1) + l2 = cachesize_override; + if ( l1i || l1d ) printk(KERN_INFO "CPU: L1 I cache: %dK, L1 D cache: %dK\n", l1i, l1d); @@ -2777,10 +2815,8 @@ */ /* TSC disabled? */ -#ifndef CONFIG_X86_TSC - if ( tsc_disable ) + if ( tsc_disable > 1 ) clear_bit(X86_FEATURE_TSC, &c->x86_capability); -#endif /* HT disabled? */ if (disable_x86_ht) @@ -2836,17 +2872,31 @@ boot_cpu_data.x86_capability[2], boot_cpu_data.x86_capability[3]); } + + /* * Perform early boot up checks for a valid TSC. See arch/i386/kernel/time.c */ -void __init dodgy_tsc(void) +int __init select_tsc(void) { get_cpu_vendor(&boot_cpu_data); if ( boot_cpu_data.x86_vendor == X86_VENDOR_CYRIX || boot_cpu_data.x86_vendor == X86_VENDOR_NSC ) init_cyrix(&boot_cpu_data); + + /* Cyclone needs to be added */ + + /* Is it disabled ? */ + if(tsc_disable) + return TSC_NONE; + + /* Does it exist ? */ + if(!cpu_has_tsc) + return TSC_NONE; + + return TSC_CPU; } @@ -2893,6 +2943,7 @@ * applications want to get the raw CPUID data, they should access * /dev/cpu//cpuid instead. */ + extern int phys_proc_id[NR_CPUS]; static char *x86_cap_flags[] = { /* Intel-defined */ "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", @@ -2950,6 +3001,11 @@ /* Cache size */ if (c->x86_cache_size >= 0) seq_printf(m, "cache size\t: %d KB\n", c->x86_cache_size); + +#ifdef CONFIG_SMP + seq_printf(m, "physical id\t: %d\n",phys_proc_id[n]); + seq_printf(m, "siblings\t: %d\n",smp_num_siblings); +#endif /* We use exception 16 if we have hardware math and we've either seen it or the CPU claims it is internal */ fpu_exception = c->hard_math && (ignore_irq13 || cpu_has_fpu); @@ -3022,14 +3078,12 @@ if (cpu_has_vme || cpu_has_tsc || cpu_has_de) clear_in_cr4(X86_CR4_VME|X86_CR4_PVI|X86_CR4_TSD|X86_CR4_DE); -#ifndef CONFIG_X86_TSC - if (tsc_disable && cpu_has_tsc) { + if (tsc_disable > 1 && cpu_has_tsc) { printk(KERN_NOTICE "Disabling TSC...\n"); /**** FIX-HPA: DOES THIS REALLY BELONG HERE? ****/ clear_bit(X86_FEATURE_TSC, boot_cpu_data.x86_capability); set_in_cr4(X86_CR4_TSD); } -#endif __asm__ __volatile__("lgdt %0": "=m" (gdt_descr)); __asm__ __volatile__("lidt %0": "=m" (idt_descr)); @@ -3054,9 +3108,10 @@ load_TR(nr); load_LDT(&init_mm); - /* - * Clear all 6 debug registers: - */ + /* Clear %fs and %gs. */ + asm volatile ("xorl %eax, %eax; movl %eax, %fs; movl %eax, %gs"); + + /* Clear all 6 debug registers: */ #define CD(register) __asm__("movl %0,%%db" #register ::"r"(0) ); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/smpboot.c linux.20pre5-ac2/arch/i386/kernel/smpboot.c --- linux.20pre5/arch/i386/kernel/smpboot.c 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/smpboot.c 2002-08-18 11:11:18.000000000 +0100 @@ -58,7 +58,7 @@ /* Number of siblings per CPU package */ int smp_num_siblings = 1; -int __initdata phys_proc_id[NR_CPUS]; /* Package ID of each logical CPU */ +int phys_proc_id[NR_CPUS]; /* Package ID of each logical CPU */ /* Bitmask of currently online CPUs */ unsigned long cpu_online_map; @@ -365,7 +365,7 @@ * (This works even if the APIC is not enabled.) */ phys_id = GET_APIC_ID(apic_read(APIC_ID)); - cpuid = current->processor; + cpuid = cpu(); if (test_and_set_bit(cpuid, &cpu_online_map)) { printk("huh, phys CPU#%d, CPU#%d already present??\n", phys_id, cpuid); @@ -435,6 +435,7 @@ */ smp_store_cpu_info(cpuid); + disable_APIC_timer(); /* * Allow the master to continue. */ @@ -443,7 +444,7 @@ /* * Synchronize the TSC with the BP */ - if (cpu_has_tsc) + if (cpu_has_tsc > 1) synchronize_tsc_ap(); } @@ -465,6 +466,7 @@ smp_callin(); while (!atomic_read(&smp_commenced)) rep_nop(); + enable_APIC_timer(); /* * low-memory mappings have been cleared, flush them from * the local TLBs too. @@ -509,59 +511,28 @@ return do_fork(CLONE_VM|CLONE_PID, 0, ®s, 0); } -/* which physical APIC ID maps to which logical CPU number */ -volatile int physical_apicid_2_cpu[MAX_APICID]; /* which logical CPU number maps to which physical APIC ID */ -volatile int cpu_2_physical_apicid[NR_CPUS]; +volatile u8 cpu_2_physical_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; -/* which logical APIC ID maps to which logical CPU number */ -volatile int logical_apicid_2_cpu[MAX_APICID]; /* which logical CPU number maps to which logical APIC ID */ -volatile int cpu_2_logical_apicid[NR_CPUS]; +volatile u8 cpu_2_logical_apicid[NR_CPUS] = { [0 ... NR_CPUS-1] = BAD_APICID }; -static inline void init_cpu_to_apicid(void) -/* Initialize all maps between cpu number and apicids */ -{ - int apicid, cpu; - - for (apicid = 0; apicid < MAX_APICID; apicid++) { - physical_apicid_2_cpu[apicid] = -1; - logical_apicid_2_cpu[apicid] = -1; - } - for (cpu = 0; cpu < NR_CPUS; cpu++) { - cpu_2_physical_apicid[cpu] = -1; - cpu_2_logical_apicid[cpu] = -1; - } -} - -static inline void map_cpu_to_boot_apicid(int cpu, int apicid) +static inline void map_cpu_to_boot_apicid(int cpu, int phys_apicid, int log_apicid) /* - * set up a mapping between cpu and apicid. Uses logical apicids for multiquad, - * else physical apic ids + * set up a mapping between cpu and apicids. */ { - if (clustered_apic_mode) { - logical_apicid_2_cpu[apicid] = cpu; - cpu_2_logical_apicid[cpu] = apicid; - } else { - physical_apicid_2_cpu[apicid] = cpu; - cpu_2_physical_apicid[cpu] = apicid; - } + cpu_2_logical_apicid[cpu] = (u8) log_apicid; + cpu_2_physical_apicid[cpu] = (u8) phys_apicid; } -static inline void unmap_cpu_to_boot_apicid(int cpu, int apicid) +static inline void unmap_cpu_to_boot_apicid(int cpu) /* - * undo a mapping between cpu and apicid. Uses logical apicids for multiquad, - * else physical apic ids + * undo a mapping between cpu and apicids. */ { - if (clustered_apic_mode) { - logical_apicid_2_cpu[apicid] = -1; - cpu_2_logical_apicid[cpu] = -1; - } else { - physical_apicid_2_cpu[apicid] = -1; - cpu_2_physical_apicid[cpu] = -1; - } + cpu_2_logical_apicid[cpu] = BAD_APICID; + cpu_2_physical_apicid[cpu] = BAD_APICID; } #if APIC_DEBUG @@ -775,17 +746,13 @@ extern unsigned long cpu_initialized; -static void __init do_boot_cpu (int apicid) -/* - * NOTE - on most systems this is a PHYSICAL apic ID, but on multiquad - * (ie clustered apic addressing mode), this is a LOGICAL apic ID. - */ +static void __init do_boot_cpu (int phys_apicid, int log_apicid) { struct task_struct *idle; unsigned long boot_error = 0; int timeout, cpu; unsigned long start_eip; - unsigned short nmi_high, nmi_low; + unsigned short nmi_high = 0, nmi_low = 0; cpu = ++cpucount; /* @@ -803,22 +770,19 @@ if (!idle) panic("No idle process for CPU %d", cpu); - idle->processor = cpu; - idle->cpus_runnable = 1 << cpu; /* we schedule the first task manually */ + init_idle(idle, cpu); - map_cpu_to_boot_apicid(cpu, apicid); + map_cpu_to_boot_apicid(cpu, phys_apicid, log_apicid); idle->thread.eip = (unsigned long) start_secondary; - del_from_runqueue(idle); unhash_process(idle); - init_tasks[cpu] = idle; /* start_eip had better be page-aligned! */ start_eip = setup_trampoline(); /* So we see what's up */ - printk("Booting processor %d/%d eip %lx\n", cpu, apicid, start_eip); + printk("Booting processor %d/%d eip %lx\n", cpu, log_apicid, start_eip); stack_start.esp = (void *) (1024 + PAGE_SIZE + (char *)idle); /* @@ -830,7 +794,7 @@ Dprintk("Setting warm reset code and vector.\n"); - if (clustered_apic_mode) { + if (clustered_apic_logical) { /* stash the current NMI vector, so we can put things back */ nmi_high = *((volatile unsigned short *) TRAMPOLINE_HIGH); nmi_low = *((volatile unsigned short *) TRAMPOLINE_LOW); @@ -847,7 +811,7 @@ /* * Be paranoid about clearing APIC errors. */ - if (!clustered_apic_mode && APIC_INTEGRATED(apic_version[apicid])) { + if (!clustered_apic_mode && APIC_INTEGRATED(apic_version[phys_apicid])) { apic_read_around(APIC_SPIV); apic_write(APIC_ESR, 0); apic_read(APIC_ESR); @@ -862,10 +826,10 @@ * Starting actual IPI sequence... */ - if (clustered_apic_mode) - boot_error = wakeup_secondary_via_NMI(apicid); + if (clustered_apic_logical) + boot_error = wakeup_secondary_via_NMI(log_apicid); else - boot_error = wakeup_secondary_via_INIT(apicid, start_eip); + boot_error = wakeup_secondary_via_INIT(phys_apicid, start_eip); if (!boot_error) { /* @@ -901,13 +865,13 @@ printk("Not responding.\n"); #if APIC_DEBUG if (!clustered_apic_mode) - inquire_remote_apic(apicid); + inquire_remote_apic(phys_apicid); #endif } } if (boot_error) { /* Try to put things back the way they were before ... */ - unmap_cpu_to_boot_apicid(cpu, apicid); + unmap_cpu_to_boot_apicid(cpu); clear_bit(cpu, &cpu_callout_map); /* was set here (do_boot_cpu()) */ clear_bit(cpu, &cpu_initialized); /* was set by cpu_init() */ clear_bit(cpu, &cpu_online_map); /* was set in smp_callin() */ @@ -917,7 +881,7 @@ /* mark "stuck" area as not stuck */ *((volatile unsigned long *)phys_to_virt(8192)) = 0; - if(clustered_apic_mode) { + if (clustered_apic_logical) { printk("Restoring NMI vector\n"); *((volatile unsigned short *) TRAMPOLINE_HIGH) = nmi_high; *((volatile unsigned short *) TRAMPOLINE_LOW) = nmi_low; @@ -925,6 +889,7 @@ } cycles_t cacheflush_time; +unsigned long cache_decay_ticks; static void smp_tune_scheduling (void) { @@ -958,9 +923,13 @@ cacheflush_time = (cpu_khz>>10) * (cachesize<<10) / bandwidth; } + cache_decay_ticks = (long)cacheflush_time/cpu_khz * HZ / 1000; + printk("per-CPU timeslice cutoff: %ld.%02ld usecs.\n", (long)cacheflush_time/(cpu_khz/1000), ((long)cacheflush_time*100/(cpu_khz/1000)) % 100); + printk("task migration cache decay timeout: %ld msecs.\n", + (cache_decay_ticks + 1) * 1000 / HZ); } /* @@ -971,17 +940,19 @@ extern int prof_old_multiplier[NR_CPUS]; extern int prof_counter[NR_CPUS]; -static int boot_cpu_logical_apicid; +#ifdef CONFIG_MULTIQUAD /* Where the IO area was mapped on multiquad, always 0 otherwise */ void *xquad_portio; +#endif int cpu_sibling_map[NR_CPUS] __cacheline_aligned; void __init smp_boot_cpus(void) { - int apicid, cpu, bit; + int phys_apicid, log_apicid, cpu, bit; - if (clustered_apic_mode && (numnodes > 1)) { +#ifdef CONFIG_MULTIQUAD + if (clustered_apic_logical && (numnodes > 1)) { printk("Remapping cross-quad port I/O for %d quads\n", numnodes); printk("xquad_portio vaddr 0x%08lx, len %08lx\n", @@ -990,6 +961,7 @@ xquad_portio = ioremap (XQUAD_PORTIO_BASE, numnodes * XQUAD_PORTIO_LEN); } +#endif #ifdef CONFIG_MTRR /* Must be done before other processors booted */ @@ -1006,8 +978,6 @@ prof_multiplier[cpu] = 1; } - init_cpu_to_apicid(); - /* * Setup boot CPU information */ @@ -1019,12 +989,16 @@ * We have the boot CPU online for sure. */ set_bit(0, &cpu_online_map); - boot_cpu_logical_apicid = logical_smp_processor_id(); - map_cpu_to_boot_apicid(0, boot_cpu_apicid); + if (clustered_apic_physical) + boot_cpu_logical_apicid = physical_to_logical_apicid(boot_cpu_physical_apicid); + else if (clustered_apic_logical) + boot_cpu_logical_apicid = logical_smp_processor_id(); + else + boot_cpu_logical_apicid = 0x01; + map_cpu_to_boot_apicid(0, boot_cpu_physical_apicid, boot_cpu_logical_apicid); global_irq_holder = 0; - current->processor = 0; - init_idle(); + current->cpu = 0; smp_tune_scheduling(); /* @@ -1103,28 +1077,36 @@ */ Dprintk("CPU present map: %lx\n", phys_cpu_present_map); + cpu = 1; for (bit = 0; bit < NR_CPUS; bit++) { - apicid = cpu_present_to_apicid(bit); + if (!(phys_cpu_present_map & (1UL << bit))) + continue; + if ((max_cpus >= 0) && (max_cpus <= cpucount+1)) + continue; + phys_apicid = raw_phys_apicid[bit]; /* * Don't even attempt to start the boot CPU! */ - if (apicid == boot_cpu_apicid) - continue; - - if (!(phys_cpu_present_map & (1 << bit))) - continue; - if ((max_cpus >= 0) && (max_cpus <= cpucount+1)) + if (phys_apicid == boot_cpu_physical_apicid) continue; + if (clustered_apic_physical) + log_apicid = physical_to_logical_apicid(phys_apicid); + else if (clustered_apic_logical) + log_apicid = ((bit >> 2) << 4) | (1 << (bit & 0x3)); + else + log_apicid = 1u << cpu; - do_boot_cpu(apicid); + do_boot_cpu(phys_apicid, log_apicid); /* * Make sure we unmap all failed CPUs */ - if ((boot_apicid_to_cpu(apicid) == -1) && - (phys_cpu_present_map & (1 << bit))) + if ((cpu_to_physical_apicid(bit) == BAD_APICID) && + (phys_cpu_present_map & (1ul << bit))) printk("CPU #%d not responding - cannot use it.\n", - apicid); + bit); + else + ++cpu; } /* @@ -1216,7 +1198,7 @@ /* * Synchronize the TSC with the AP */ - if (cpu_has_tsc && cpucount) + if (cpu_has_tsc > 1 && cpucount) synchronize_tsc_bp(); smp_done: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/smp.c linux.20pre5-ac2/arch/i386/kernel/smp.c --- linux.20pre5/arch/i386/kernel/smp.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/smp.c 2002-08-13 14:05:23.000000000 +0100 @@ -115,7 +115,7 @@ static inline int __prepare_ICR (unsigned int shortcut, int vector) { - return APIC_DM_FIXED | shortcut | vector | APIC_DEST_LOGICAL; + return APIC_DM_FIXED | shortcut | vector | INT_DEST_ADDR_MODE; } static inline int __prepare_ICR2 (unsigned int mask) @@ -214,7 +214,9 @@ /* * prepare target chip field */ - cfg = __prepare_ICR2(cpu_to_logical_apicid(query_cpu)); + cfg = __prepare_ICR2(clustered_apic_physical ? + cpu_to_physical_apicid(query_cpu) : + cpu_to_logical_apicid(query_cpu)); apic_write_around(APIC_ICR2, cfg); /* @@ -493,13 +495,23 @@ * it goes straight through and wastes no time serializing * anything. Worst case is that we lose a reschedule ... */ - void smp_send_reschedule(int cpu) { send_IPI_mask(1 << cpu, RESCHEDULE_VECTOR); } /* + * this function sends a reschedule IPI to all (other) CPUs. + * This should only be used if some 'global' task became runnable, + * such as a RT task, that must be handled now. The first CPU + * that manages to grab the task will run it. + */ +void smp_send_reschedule_all(void) +{ + send_IPI_allbutself(RESCHEDULE_VECTOR); +} + +/* * Structure and data for smp_call_function(). This is designed to minimise * static memory requirements. It also looks cleaner. */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/speedstep.c linux.20pre5-ac2/arch/i386/kernel/speedstep.c --- linux.20pre5/arch/i386/kernel/speedstep.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/speedstep.c 2002-09-01 13:29:40.000000000 +0100 @@ -0,0 +1,655 @@ +/* + * $Id: speedstep.c,v 1.44 2002/08/17 17:28:25 db Exp $ + * + * (C) 2001 Dave Jones, Arjan van de ven. + * (C) 2002 Dominik Brodowski + * + * Licensed under the terms of the GNU GPL License version 2. + * Based upon reverse engineered information, and on Intel documentation + * for chipsets ICH2-M and ICH3-M. + * + * Many thanks to Ducrot Bruno for finding and fixing the last + * "missing link" for ICH2-M/ICH3-M support, and to Thomas Winkler + * for extensive testing. + * + * BIG FAT DISCLAIMER: Work in progress code. Possibly *dangerous* + */ + + +/********************************************************************* + * SPEEDSTEP - DEFINITIONS * + *********************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +static struct cpufreq_driver *speedstep_driver; + +/* speedstep_chipset: + * It is necessary to know which chipset is used. As accesses to + * this device occur at various places in this module, we need a + * static struct pci_dev * pointing to that device. + */ +static unsigned int speedstep_chipset; +static struct pci_dev *speedstep_chipset_dev; + +#define SPEEDSTEP_CHIPSET_ICH2M 0x00000002 +#define SPEEDSTEP_CHIPSET_ICH3M 0x00000003 + + +/* speedstep_processor + */ +static unsigned int speedstep_processor; + +#define SPEEDSTEP_PROCESSOR_PIII_C 0x00000001 /* Coppermine core */ +#define SPEEDSTEP_PROCESSOR_PIII_T 0x00000002 /* Tualatin core */ +#define SPEEDSTEP_PROCESSOR_P4M 0x00000003 /* P4-M with 100 MHz FSB */ + + +/* speedstep_[low,high]_freq + * There are only two frequency states for each processor. Values + * are in kHz for the time being. + */ +static unsigned int speedstep_low_freq; +static unsigned int speedstep_high_freq; + + +/* DEBUG + * Define it if you want verbose debug output, e.g. for bug reporting + */ +//#define SPEEDSTEP_DEBUG + +#ifdef SPEEDSTEP_DEBUG +#define dprintk(msg...) printk(msg) +#else +#define dprintk(msg...) do { } while(0); +#endif + + + +/********************************************************************* + * LOW LEVEL CHIPSET INTERFACE * + *********************************************************************/ + +/** + * speedstep_get_frequency - read the current SpeedStep state + * @freq: current processor frequency in kHz + * + * Tries to read the SpeedStep state. Returns -EIO when there has been + * trouble to read the status or write to the control register, -EINVAL + * on an unsupported chipset, and zero on success. + */ +static int speedstep_get_frequency (unsigned int *freq) +{ + u32 pmbase; + u8 value; + + if (!speedstep_chipset_dev || !freq) + return -EINVAL; + + switch (speedstep_chipset) { + case SPEEDSTEP_CHIPSET_ICH2M: + case SPEEDSTEP_CHIPSET_ICH3M: + /* get PMBASE */ + pci_read_config_dword(speedstep_chipset_dev, 0x40, &pmbase); + if (!(pmbase & 0x01)) + return -EIO; + + pmbase &= 0xFFFFFFFE; + if (!pmbase) + return -EIO; + + /* read state */ + local_irq_disable(); + value = inb(pmbase + 0x50); + local_irq_enable(); + + dprintk(KERN_DEBUG "cpufreq: read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value); + + *freq = (value & 0x01) ? speedstep_low_freq : \ + speedstep_high_freq; + return 0; + + } + + printk (KERN_ERR "cpufreq: setting CPU frequency on this chipset unsupported.\n"); + return -EINVAL; +} + + +/** + * speedstep_set_frequency - set the SpeedStep state + * @cpu: CPU number + * @freq: new processor frequency in kHz + * + * Tries to change the SpeedStep state. + */ +void speedstep_set_frequency (unsigned int cpu, unsigned int freq) +{ + u32 pmbase; + u8 pm2_blk; + u8 value; + unsigned long flags; + + if (cpu && (cpu != CPUFREQ_ALL_CPUS)) + return; + + if (!speedstep_chipset_dev || !freq) { + printk(KERN_ERR "cpufreq: unknown chipset or state\n"); + return; + } + + switch (speedstep_chipset) { + case SPEEDSTEP_CHIPSET_ICH2M: + case SPEEDSTEP_CHIPSET_ICH3M: + /* get PMBASE */ + pci_read_config_dword(speedstep_chipset_dev, 0x40, &pmbase); + if (!(pmbase & 0x01)) + return; + + pmbase &= 0xFFFFFFFE; + if (!pmbase) + return; + + /* read state */ + local_irq_disable(); + value = inb(pmbase + 0x50); + local_irq_enable(); + + dprintk(KERN_DEBUG "cpufreq: read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value); + + /* write new state, but only if indeed a transition + * is necessary */ + if (freq == ((value & 0x01) ? speedstep_low_freq : \ + speedstep_high_freq)) + return; + + value = (freq == speedstep_high_freq) ? 0x00 : 0x01; + + dprintk(KERN_DEBUG "cpufreq: writing 0x%x to pmbase 0x%x + 0x50\n", value, pmbase); + + /* Disable IRQs */ + local_irq_save(flags); + local_irq_disable(); + + /* Disable bus master arbitration */ + pm2_blk = inb(pmbase + 0x20); + pm2_blk |= 0x01; + outb(pm2_blk, (pmbase + 0x20)); + + /* Actual transition */ + outb(value, (pmbase + 0x50)); + + /* Restore bus master arbitration */ + pm2_blk &= 0xfe; + outb(pm2_blk, (pmbase + 0x20)); + + /* Enable IRQs */ + local_irq_enable(); + local_irq_restore(flags); + + /* check if transition was sucessful */ + local_irq_disable(); + value = inb(pmbase + 0x50); + local_irq_enable(); + + dprintk(KERN_DEBUG "cpufreq: read at pmbase 0x%x + 0x50 returned 0x%x\n", pmbase, value); + + if (freq == ((value & 0x01) ? speedstep_low_freq : \ + speedstep_high_freq)) { + dprintk (KERN_INFO "cpufreq: change to %u MHz succeded\n", (freq / 1000)); + return; + } + + printk (KERN_ERR "cpufreq: change failed - I/O error\n"); + return; + } + + printk (KERN_ERR "cpufreq: setting CPU frequency on this chipset unsupported.\n"); + return; +} + + +/** + * speedstep_activate - activate SpeedStep control in the chipset + * + * Tries to activate the SpeedStep status and control registers. + * Returns -EINVAL on an unsupported chipset, and zero on success. + */ +static int speedstep_activate (void) +{ + if (!speedstep_chipset_dev) + return -EINVAL; + + switch (speedstep_chipset) { + case SPEEDSTEP_CHIPSET_ICH2M: + case SPEEDSTEP_CHIPSET_ICH3M: + { + u16 value = 0; + + pci_read_config_word(speedstep_chipset_dev, + 0x00A0, &value); + if (!(value & 0x08)) { + value |= 0x08; + dprintk(KERN_DEBUG "cpufreq: activating SpeedStep (TM) registers\n"); + pci_write_config_word(speedstep_chipset_dev, + 0x00A0, value); + } + + return 0; + } + } + + printk (KERN_ERR "cpufreq: SpeedStep (TM) on this chipset unsupported.\n"); + return -EINVAL; +} + + +/** + * speedstep_detect_chipset - detect the Southbridge which contains SpeedStep logic + * + * Detects PIIX4, ICH2-M and ICH3-M so far. The pci_dev points to + * the LPC bridge / PM module which contains all power-management + * functions. Returns the SPEEDSTEP_CHIPSET_-number for the detected + * chipset, or zero on failure. + */ +static unsigned int speedstep_detect_chipset (void) +{ + speedstep_chipset_dev = pci_find_subsys(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82801CA_12, + PCI_ANY_ID, + PCI_ANY_ID, + NULL); + if (speedstep_chipset_dev) + return SPEEDSTEP_CHIPSET_ICH3M; + + + speedstep_chipset_dev = pci_find_subsys(PCI_VENDOR_ID_INTEL, + PCI_DEVICE_ID_INTEL_82801BA_10, + PCI_ANY_ID, + PCI_ANY_ID, + NULL); + if (speedstep_chipset_dev) + return SPEEDSTEP_CHIPSET_ICH2M; + + + return 0; +} + + + +/********************************************************************* + * LOW LEVEL PROCESSOR INTERFACE * + *********************************************************************/ + + +/** + * pentium3_get_frequency - get the core frequencies for PIIIs + * + * Returns the core frequency of a Pentium III processor (in kHz) + */ +static unsigned int pentium3_get_frequency (void) +{ + /* See table 14 of p3_ds.pdf and table 22 of 29834003.pdf */ + struct { + unsigned int ratio; /* Frequency Multiplier (x10) */ + u8 bitmap; /* power on configuration bits + [27, 25:22] (in MSR 0x2a) */ + } msr_decode_mult [] = { + { 30, 0x01 }, + { 35, 0x05 }, + { 40, 0x02 }, + { 45, 0x06 }, + { 50, 0x00 }, + { 55, 0x04 }, + { 60, 0x0b }, + { 65, 0x0f }, + { 70, 0x09 }, + { 75, 0x0d }, + { 80, 0x0a }, + { 85, 0x26 }, + { 90, 0x20 }, + { 100, 0x2b }, + { 0, 0xff } /* error or unknown value */ + }; + /* PIII(-M) FSB settings: see table b1-b of 24547206.pdf */ + struct { + unsigned int value; /* Front Side Bus speed in MHz */ + u8 bitmap; /* power on configuration bits [18: 19] + (in MSR 0x2a) */ + } msr_decode_fsb [] = { + { 66, 0x0 }, + { 100, 0x2 }, + { 133, 0x1 }, + { 0, 0xff} + }; + u32 msr_lo, msr_tmp; + int i = 0, j = 0; + struct cpuinfo_x86 *c = cpu_data; + + /* read MSR 0x2a - we only need the low 32 bits */ + rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_tmp); + dprintk(KERN_DEBUG "cpufreq: P3 - MSR_IA32_EBL_CR_POWERON: 0x%x 0x%x\n", msr_lo, msr_tmp); + msr_tmp = msr_lo; + + /* decode the FSB */ + msr_tmp &= 0x00c0000; + msr_tmp >>= 18; + while (msr_tmp != msr_decode_fsb[i].bitmap) { + if (msr_decode_fsb[i].bitmap == 0xff) + return -EINVAL; + i++; + } + + /* decode the multiplier */ + if ((c->x86_model == 0x08) && (c->x86_mask == 0x01)) + /* different on early Coppermine PIII */ + msr_lo &= 0x03c00000; + else + msr_lo &= 0x0bc00000; + msr_lo >>= 22; + while (msr_lo != msr_decode_mult[j].bitmap) { + if (msr_decode_mult[j].bitmap == 0xff) + return -EINVAL; + j++; + } + + return (msr_decode_mult[j].ratio * msr_decode_fsb[i].value * 100); +} + + +/** + * pentium4_get_frequency - get the core frequency for P4-Ms + * + * Should return the core frequency (in kHz) for P4-Ms. + */ +static unsigned int pentium4_get_frequency(void) +{ + u32 msr_lo, msr_hi; + + rdmsr(0x2c, msr_lo, msr_hi); + + dprintk(KERN_DEBUG "cpufreq: P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi); + + /* First 12 bits seem to change a lot (0x511, 0x410 and 0x30f seen + * yet). Next 12 bits always seem to be 0x300. If this is not true + * on this CPU, complain. Last 8 bits are frequency (in 100MHz). + */ + if (msr_hi || ((msr_lo & 0x00FFF000) != 0x300000)) { + printk(KERN_DEBUG "cpufreq: P4 - MSR_EBC_FREQUENCY_ID: 0x%x 0x%x\n", msr_lo, msr_hi); + printk(KERN_INFO "cpufreq: problem in initialization. Please contact Dominik Brodowski\n"); + printk(KERN_INFO "cpufreq: and attach this dmesg. Thanks in advance\n"); + return 0; + } + + msr_lo >>= 24; + return (msr_lo * 100000); +} + + +/** + * speedstep_detect_processor - detect Intel SpeedStep-capable processors. + * + * Returns the SPEEDSTEP_PROCESSOR_-number for the detected chipset, + * or zero on failure. + */ +static unsigned int speedstep_detect_processor (void) +{ + struct cpuinfo_x86 *c = cpu_data; + u32 ebx; + + if ((c->x86_vendor != X86_VENDOR_INTEL) || + ((c->x86 != 6) && (c->x86 != 0xF))) + return 0; + + if (c->x86 == 0xF) { + /* Intel Pentium 4 Mobile P4-M */ + if (c->x86_model != 2) + return 0; + + if (c->x86_mask != 4) + return 0; + + ebx = cpuid_ebx(0x00000001); + ebx &= 0x000000FF; + if ((ebx != 0x0e) && (ebx != 0x0f)) + return 0; + + return SPEEDSTEP_PROCESSOR_P4M; + } + + switch (c->x86_model) { + case 0x0B: /* Intel PIII [Tualatin] */ + /* cpuid_ebx(1) is 0x04 for desktop PIII, + 0x06 for mobile PIII-M */ + ebx = cpuid_ebx(0x00000001); + + ebx &= 0x000000FF; + if (ebx != 0x06) + return 0; + + /* So far all PIII-M processors support SpeedStep. See + * Intel's 24540633.pdf of August 2002 + */ + + return SPEEDSTEP_PROCESSOR_PIII_T; + + case 0x08: /* Intel PIII [Coppermine] */ + /* based on reverse-engineering information and + * some guessing. HANDLE WITH CARE! */ + { + u32 msr_lo, msr_hi; + + /* all mobile PIII Coppermines have FSB 100 MHz + * ==> sort out a few desktop PIIIs. */ + rdmsr(MSR_IA32_EBL_CR_POWERON, msr_lo, msr_hi); + dprintk(KERN_DEBUG "cpufreq: Coppermine: MSR_IA32_EBL_Cr_POWERON is 0x%x, 0x%x\n", msr_lo, msr_hi); + msr_lo &= 0x00c0000; + if (msr_lo != 0x0080000) + return 0; + + /* platform ID seems to be 0x00140000 */ + rdmsr(MSR_IA32_PLATFORM_ID, msr_lo, msr_hi); + dprintk(KERN_DEBUG "cpufreq: Coppermine: MSR_IA32_PLATFORM ID is 0x%x, 0x%x\n", msr_lo, msr_hi); + msr_hi = msr_lo & 0x001c0000; + if (msr_hi != 0x00140000) + return 0; + + /* and these bits seem to be either 00_b, 01_b or + * 10_b but never 11_b */ + msr_lo &= 0x00030000; + if (msr_lo == 0x0030000) + return 0; + + /* let's hope this is correct... */ + return SPEEDSTEP_PROCESSOR_PIII_C; + } + default: + return 0; + } +} + + + +/********************************************************************* + * HIGH LEVEL FUNCTIONS * + *********************************************************************/ + + +/** + * speedstep_detect_speeds - detects low and high CPU frequencies. + * + * Detects the low and high CPU frequencies in kHz. Returns 0 on + * success or -EINVAL / -EIO on problems. + */ +static int speedstep_detect_speeds (void) +{ + unsigned int state; + int i, result; + + for (i=0; i<2; i++) { + /* read the current state */ + result = speedstep_get_frequency(&state); + if (result) + return result; + + /* save the correct value, and switch to other */ + if (state == speedstep_low_freq) { + switch (speedstep_processor) { + case SPEEDSTEP_PROCESSOR_PIII_C: + case SPEEDSTEP_PROCESSOR_PIII_T: + speedstep_low_freq = pentium3_get_frequency(); + break; + case SPEEDSTEP_PROCESSOR_P4M: + speedstep_low_freq = pentium4_get_frequency(); + } + speedstep_set_frequency(0, speedstep_high_freq); + } else { + switch (speedstep_processor) { + case SPEEDSTEP_PROCESSOR_PIII_C: + case SPEEDSTEP_PROCESSOR_PIII_T: + speedstep_high_freq = pentium3_get_frequency(); + break; + case SPEEDSTEP_PROCESSOR_P4M: + speedstep_high_freq = pentium4_get_frequency(); + } + speedstep_set_frequency(0, speedstep_low_freq); + } + + if (!speedstep_low_freq || !speedstep_high_freq || (speedstep_low_freq == speedstep_high_freq)) + return -EIO; + } + + return 0; +} + + +/** + * speedstep_validate_frequency - validates the CPU frequency to be set + * @cpu: CPU number + * @kHz: suggested new CPU frequency + * + * Makes sure the CPU frequency to be set is valid. + */ +unsigned int speedstep_validate_frequency(unsigned int cpu, unsigned int kHz) +{ + if (cpu && (cpu != CPUFREQ_ALL_CPUS)) + return 0; + + if (kHz <= speedstep_low_freq) + return speedstep_low_freq; + else + return speedstep_high_freq; +} + + +/** + * speedstep_init - initializes the SpeedStep CPUFreq driver + * + * Initializes the SpeedStep support. Returns -ENODEV on unsupported + * devices, -EINVAL on problems during initiatization, and zero on + * success. + */ +static int __init speedstep_init(void) +{ + int result; + unsigned int speed; + struct cpufreq_driver *driver; + + + /* detect chipset */ + speedstep_chipset = speedstep_detect_chipset(); + + /* detect chipset */ + if (speedstep_chipset) + speedstep_processor = speedstep_detect_processor(); + + if ((!speedstep_chipset) || (!speedstep_processor)) { + dprintk(KERN_INFO "cpufreq: Intel(R) SpeedStep(TM) for this %s not (yet) available.\n", speedstep_processor ? "chipset" : "processor"); + return -ENODEV; + } + + /* startup values, correct ones will be detected later */ + speedstep_low_freq = 1; + speedstep_high_freq = 2; + + dprintk(KERN_INFO "cpufreq: Intel(R) SpeedStep(TM) support $Revision: 1.44 $\n"); + dprintk(KERN_DEBUG "cpufreq: chipset 0x%x - processor 0x%x\n", + speedstep_chipset, speedstep_processor); + + /* activate speedstep support */ + result = speedstep_activate(); + if (result) + return result; + + /* detect low and high frequency */ + result = speedstep_detect_speeds(); + if (result) + return result; + + /* get current speed setting */ + result = speedstep_get_frequency(&speed); + if (result) + return result; + + dprintk(KERN_INFO "cpufreq: currently at %s speed setting - %i MHz\n", + (speed == speedstep_low_freq) ? "low" : "high", + (speed / 1000)); + + /* initialization of main "cpufreq" code*/ + driver = kmalloc(sizeof(struct cpufreq_driver) + + sizeof(struct cpufreq_freqs), GFP_KERNEL); + if (!driver) + return -ENOMEM; + + driver->freq = (struct cpufreq_freqs*) (driver + sizeof(struct cpufreq_driver)); + driver->sync = CPUFREQ_SYNC; + driver->freq->cpu = CPUFREQ_ALL_CPUS; + driver->freq->min = speedstep_low_freq; + driver->freq->max = speedstep_high_freq; + driver->freq->cur = speed; + driver->validate = &speedstep_validate_frequency; + driver->setspeed = &speedstep_set_frequency; + + result = cpufreq_register(driver); + if (result) { + kfree(driver); + return result; + } + speedstep_driver = driver; + + return 0; +} + + +/** + * speedstep_exit - unregisters SpeedStep support + * + * Unregisters SpeedStep support. + */ +static void __exit speedstep_exit(void) +{ + if (speedstep_driver) { + cpufreq_unregister(); + kfree(speedstep_driver); + } +} + + +MODULE_AUTHOR ("Dave Jones , Dominik Brodowski "); +MODULE_DESCRIPTION ("Speedstep driver for Intel mobile processors."); +MODULE_LICENSE ("GPL"); +module_init(speedstep_init); +module_exit(speedstep_exit); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/time.c linux.20pre5-ac2/arch/i386/kernel/time.c --- linux.20pre5/arch/i386/kernel/time.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/time.c 2002-09-01 13:27:38.000000000 +0100 @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -637,6 +638,49 @@ return 0; } +#ifdef CONFIG_CPU_FREQ + +static int +time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, + void *data) +{ + struct cpufreq_freqs *freq = data; + unsigned int i; + + if (!cpu_has_tsc) + return 0; + + switch (val) { + case CPUFREQ_PRECHANGE: + if (freq->cur < freq->new) { + cpu_khz = cpufreq_scale(cpu_khz, freq->cur, freq->new); + fast_gettimeoffset_quotient = cpufreq_scale(cpu_khz, freq->new, freq->cur); + } + for (i=0; icpu == CPUFREQ_ALL_CPUS) || (freq->cpu == i)) + cpu_data[i].loops_per_jiffy = cpufreq_scale(loops_per_jiffy, freq->cur, freq->new); + break; + + case CPUFREQ_POSTCHANGE: + if (freq->new < freq->cur) { + cpu_khz = cpufreq_scale(cpu_khz, freq->cur, freq->new); + fast_gettimeoffset_quotient = cpufreq_scale(cpu_khz, freq->new, freq->cur); + } + for (i=0; icpu == CPUFREQ_ALL_CPUS) || (freq->cpu == i)) + cpu_data[i].loops_per_jiffy = cpufreq_scale(loops_per_jiffy, freq->cur, freq->new); + break; + } + + return 0; +} + +static struct notifier_block time_cpufreq_notifier_block = { + notifier_call: time_cpufreq_notifier +}; +#endif + + void __init time_init(void) { extern int x86_udelay_tsc; @@ -669,51 +713,64 @@ * moaned if you have the only one in the world - you fix it! */ - dodgy_tsc(); - - if (cpu_has_tsc) { - unsigned long tsc_quotient = calibrate_tsc(); - if (tsc_quotient) { - fast_gettimeoffset_quotient = tsc_quotient; - use_tsc = 1; - /* - * We could be more selective here I suspect - * and just enable this for the next intel chips ? - */ - x86_udelay_tsc = 1; + switch (select_tsc()) + { + case TSC_NONE: + setup_irq(0, &irq0); + break; + case TSC_CPU: + { + unsigned long tsc_quotient = calibrate_tsc(); + if (tsc_quotient) { + fast_gettimeoffset_quotient = tsc_quotient; + use_tsc = 1; + /* + * We could be more selective here I suspect + * and just enable this for the next intel chips ? + */ + x86_udelay_tsc = 1; #ifndef do_gettimeoffset - do_gettimeoffset = do_fast_gettimeoffset; + do_gettimeoffset = do_fast_gettimeoffset; #endif - /* report CPU clock rate in Hz. - * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) = - * clock/second. Our precision is about 100 ppm. - */ - { unsigned long eax=0, edx=1000; - __asm__("divl %2" - :"=a" (cpu_khz), "=d" (edx) - :"r" (tsc_quotient), - "0" (eax), "1" (edx)); - printk("Detected %lu.%03lu MHz processor.\n", cpu_khz / 1000, cpu_khz % 1000); + /* report CPU clock rate in Hz. + * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) = + * clock/second. Our precision is about 100 ppm. + */ + { unsigned long eax=0, edx=1000; + __asm__("divl %2" + :"=a" (cpu_khz), "=d" (edx) + :"r" (tsc_quotient), + "0" (eax), "1" (edx)); + printk("Detected %lu.%03lu MHz processor.\n", cpu_khz / 1000, cpu_khz % 1000); + } +#ifdef CONFIG_CPU_FREQ + cpufreq_register_notifier(&time_cpufreq_notifier_block); +#endif } + setup_irq(0, &irq0); + break; } - } - + case TSC_CYCLONE: + /* To be added */ + setup_irq(0, &irq0); + break; #ifdef CONFIG_VISWS - printk("Starting Cobalt Timer system clock\n"); + case TSC_VISWS: + printk("Starting Cobalt Timer system clock\n"); - /* Set the countdown value */ - co_cpu_write(CO_CPU_TIMEVAL, CO_TIME_HZ/HZ); + /* Set the countdown value */ + co_cpu_write(CO_CPU_TIMEVAL, CO_TIME_HZ/HZ); - /* Start the timer */ - co_cpu_write(CO_CPU_CTRL, co_cpu_read(CO_CPU_CTRL) | CO_CTRL_TIMERUN); + /* Start the timer */ + co_cpu_write(CO_CPU_CTRL, co_cpu_read(CO_CPU_CTRL) | CO_CTRL_TIMERUN); - /* Enable (unmask) the timer interrupt */ - co_cpu_write(CO_CPU_CTRL, co_cpu_read(CO_CPU_CTRL) & ~CO_CTRL_TIMEMASK); + /* Enable (unmask) the timer interrupt */ + co_cpu_write(CO_CPU_CTRL, co_cpu_read(CO_CPU_CTRL) & ~CO_CTRL_TIMEMASK); - /* Wire cpu IDT entry to s/w handler (and Cobalt APIC to IDT) */ - setup_irq(CO_IRQ_TIMER, &irq0); -#else - setup_irq(0, &irq0); + /* Wire cpu IDT entry to s/w handler (and Cobalt APIC to IDT) */ + setup_irq(CO_IRQ_TIMER, &irq0); + break; #endif + } } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/kernel/traps.c linux.20pre5-ac2/arch/i386/kernel/traps.c --- linux.20pre5/arch/i386/kernel/traps.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/kernel/traps.c 2002-08-13 14:05:33.000000000 +0100 @@ -284,6 +284,20 @@ void die(const char * str, struct pt_regs * regs, long err) { +#ifdef CONFIG_PNPBIOS + if (regs->xcs == 0x60 || regs->xcs == 0x68) + { + extern u32 pnp_bios_fault_eip, pnp_bios_fault_esp; + extern u32 pnp_bios_is_utter_crap; + pnp_bios_is_utter_crap = 1; + printk(KERN_CRIT "PNPBIOS fault.. attempting recovery.\n"); + __asm__ volatile( + "movl %0, %%esp\n\t" + "jmp %1\n\t" + : "=a" (pnp_bios_fault_esp), "=b" (pnp_bios_fault_eip)); + panic("do_trap: can't hit this"); + } +#endif console_verbose(); spin_lock_irq(&die_lock); bust_spinlocks(1); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/math-emu/fpu_system.h linux.20pre5-ac2/arch/i386/math-emu/fpu_system.h --- linux.20pre5/arch/i386/math-emu/fpu_system.h 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/math-emu/fpu_system.h 2002-09-02 14:57:05.000000000 +0100 @@ -20,7 +20,7 @@ of the stack frame of math_emulate() */ #define SETUP_DATA_AREA(arg) FPU_info = (struct info *) &arg -#define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->context.segments)[(s) >> 3]) +#define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->context.ldt)[(s) >> 3]) #define SEG_D_SIZE(x) ((x).b & (3 << 21)) #define SEG_G_BIT(x) ((x).b & (1 << 23)) #define SEG_GRANULARITY(x) (((x).b & (1 << 23)) ? 4096 : 1) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/i386/mm/fault.c linux.20pre5-ac2/arch/i386/mm/fault.c --- linux.20pre5/arch/i386/mm/fault.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/i386/mm/fault.c 2002-08-29 19:00:49.000000000 +0100 @@ -76,9 +76,7 @@ return 1; check_stack: - if (!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; - if (expand_stack(vma, start) == 0) + if (!expand_stack(vma, start)) goto good_area; bad_area: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ia64/defconfig linux.20pre5-ac2/arch/ia64/defconfig --- linux.20pre5/arch/ia64/defconfig 2002-08-29 18:39:50.000000000 +0100 +++ linux.20pre5-ac2/arch/ia64/defconfig 2002-08-06 15:42:21.000000000 +0100 @@ -672,7 +672,6 @@ # CONFIG_SOLARIS_X86_PARTITION is not set # CONFIG_UNIXWARE_DISKLABEL is not set CONFIG_EFI_PARTITION=y -# CONFIG_DEVFS_GUID is not set # CONFIG_LDM_PARTITION is not set # CONFIG_SGI_PARTITION is not set # CONFIG_ULTRIX_PARTITION is not set diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ia64/ia32/sys_ia32.c linux.20pre5-ac2/arch/ia64/ia32/sys_ia32.c --- linux.20pre5/arch/ia64/ia32/sys_ia32.c 2002-08-29 18:39:50.000000000 +0100 +++ linux.20pre5-ac2/arch/ia64/ia32/sys_ia32.c 2002-08-06 15:42:21.000000000 +0100 @@ -3693,7 +3693,11 @@ return result; } -struct dqblk32 { +extern asmlinkage long sys_quotactl(int cmd, const char *special, int id, caddr_t addr); + +#ifdef CONFIG_QIFACE_COMPAT +#ifdef CONFIG_QIFACE_V1 +struct user_dqblk32 { __u32 dqb_bhardlimit; __u32 dqb_bsoftlimit; __u32 dqb_curblocks; @@ -3703,49 +3707,82 @@ __kernel_time_t32 dqb_btime; __kernel_time_t32 dqb_itime; }; +typedef struct v1c_mem_dqblk comp_dqblk_t; -asmlinkage long -sys32_quotactl (int cmd, unsigned int special, int id, struct dqblk32 *addr) +#define Q_COMP_GETQUOTA Q_V1_GETQUOTA +#define Q_COMP_SETQUOTA Q_V1_SETQUOTA +#define Q_COMP_SETQLIM Q_V1_SETQLIM +#define Q_COMP_SETUSE Q_V1_SETUSE +#else +struct user_dqblk32 { + __u32 dqb_ihardlimit; + __u32 dqb_isoftlimit; + __u32 dqb_curinodes; + __u32 dqb_bhardlimit; + __u32 dqb_bsoftlimit; + __u64 dqb_curspace; + __kernel_time_t32 dqb_btime; + __kernel_time_t32 dqb_itime; +}; +typedef struct v2c_mem_dqblk comp_dqblk_t; + +#define Q_COMP_GETQUOTA Q_V2_GETQUOTA +#define Q_COMP_SETQUOTA Q_V2_SETQUOTA +#define Q_COMP_SETQLIM Q_V2_SETQLIM +#define Q_COMP_SETUSE Q_V2_SETUSE +#endif + +asmlinkage long sys32_quotactl(int cmd, const char *special, int id, caddr_t addr) { - extern asmlinkage long sys_quotactl (int, const char *, int, caddr_t); int cmds = cmd >> SUBCMDSHIFT; + long err; + comp_dqblk_t d; mm_segment_t old_fs; - struct dqblk d; char *spec; - long err; - + switch (cmds) { - case Q_GETQUOTA: - break; - case Q_SETQUOTA: - case Q_SETUSE: - case Q_SETQLIM: - if (copy_from_user (&d, addr, sizeof(struct dqblk32))) - return -EFAULT; - d.dqb_itime = ((struct dqblk32 *)&d)->dqb_itime; - d.dqb_btime = ((struct dqblk32 *)&d)->dqb_btime; - break; - default: - return sys_quotactl(cmd, (void *) A(special), id, (caddr_t) addr); + case Q_COMP_GETQUOTA: + break; + case Q_COMP_SETQUOTA: + case Q_COMP_SETUSE: + case Q_COMP_SETQLIM: + if (copy_from_user(&d, (struct user_dqblk32 *)addr, + sizeof (struct user_dqblk32))) + return -EFAULT; + d.dqb_itime = ((struct user_dqblk32 *)&d)->dqb_itime; + d.dqb_btime = ((struct user_dqblk32 *)&d)->dqb_btime; + break; + default: + return sys_quotactl(cmd, special, id, (__kernel_caddr_t)addr); } - spec = getname32((void *) A(special)); + spec = getname (special); err = PTR_ERR(spec); - if (IS_ERR(spec)) + if (IS_ERR(spec)) return err; + old_fs = get_fs(); + set_fs (KERNEL_DS); + err = sys_quotactl(cmd, (const char *)spec, id, (__kernel_caddr_t)&d); + set_fs (old_fs); + putname (spec); + if (err) return err; - old_fs = get_fs (); - set_fs(KERNEL_DS); - err = sys_quotactl(cmd, (const char *)spec, id, (caddr_t)&d); - set_fs(old_fs); - putname(spec); - if (cmds == Q_GETQUOTA) { + if (cmds == Q_COMP_GETQUOTA) { __kernel_time_t b = d.dqb_btime, i = d.dqb_itime; - ((struct dqblk32 *)&d)->dqb_itime = i; - ((struct dqblk32 *)&d)->dqb_btime = b; - if (copy_to_user(addr, &d, sizeof(struct dqblk32))) + ((struct user_dqblk32 *)&d)->dqb_itime = i; + ((struct user_dqblk32 *)&d)->dqb_btime = b; + if (copy_to_user ((struct user_dqblk32 *)addr, &d, + sizeof (struct user_dqblk32))) return -EFAULT; } - return err; + return 0; +} + +#else +/* No conversion needed for new interface */ +asmlinkage long sys32_quotactl(int cmd, const char *special, int id, caddr_t addr) +{ + return sys_quotactl(cmd, special, id, addr); } +#endif asmlinkage long sys32_sched_rr_get_interval (pid_t pid, struct timespec32 *interval) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ia64/kernel/efivars.c linux.20pre5-ac2/arch/ia64/kernel/efivars.c --- linux.20pre5/arch/ia64/kernel/efivars.c 2002-08-29 18:39:50.000000000 +0100 +++ linux.20pre5-ac2/arch/ia64/kernel/efivars.c 2002-08-06 15:42:21.000000000 +0100 @@ -29,6 +29,9 @@ * * Changelog: * + * 25 Mar 2002 - Matt Domsch + * move uuid_unparse() to include/asm-ia64/efi.h:efi_guid_unparse() + * * 12 Feb 2002 - Matt Domsch * use list_for_each_safe when deleting vars. * remove ifdef CONFIG_SMP around include @@ -70,7 +73,7 @@ MODULE_DESCRIPTION("/proc interface to EFI Variables"); MODULE_LICENSE("GPL"); -#define EFIVARS_VERSION "0.04 2002-Feb-12" +#define EFIVARS_VERSION "0.05 2002-Mar-26" static int efivar_read(char *page, char **start, off_t off, @@ -141,20 +144,6 @@ return len; } - -static void -uuid_unparse(efi_guid_t *guid, char *out) -{ - sprintf(out, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x", - guid->data1, guid->data2, guid->data3, - guid->data4[0], guid->data4[1], guid->data4[2], guid->data4[3], - guid->data4[4], guid->data4[5], guid->data4[6], guid->data4[7]); -} - - - - - /* * efivar_create_proc_entry() * Requires: @@ -197,7 +186,7 @@ private variables from another's. */ *(short_name + strlen(short_name)) = '-'; - uuid_unparse(vendor_guid, short_name + strlen(short_name)); + efi_guid_unparse(vendor_guid, short_name + strlen(short_name)); /* Create the entry in proc */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ia64/kernel/irq.c linux.20pre5-ac2/arch/ia64/kernel/irq.c --- linux.20pre5/arch/ia64/kernel/irq.c 2002-08-29 18:39:50.000000000 +0100 +++ linux.20pre5-ac2/arch/ia64/kernel/irq.c 2002-08-06 15:42:21.000000000 +0100 @@ -172,7 +172,7 @@ p += sprintf(p, "LOC: "); for (j = 0; j < smp_num_cpus; j++) p += sprintf(p, "%10u ", - apic_timer_irqs[cpu_logical_map(j)]); + irq_stat[cpu_logical_map(j)].apic_timer_irqs); p += sprintf(p, "\n"); #endif p += sprintf(p, "ERR: %10u\n", atomic_read(&irq_err_count)); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ia64/kernel/mca.c linux.20pre5-ac2/arch/ia64/kernel/mca.c --- linux.20pre5/arch/ia64/kernel/mca.c 2002-08-29 18:39:50.000000000 +0100 +++ linux.20pre5-ac2/arch/ia64/kernel/mca.c 2002-08-06 15:42:21.000000000 +0100 @@ -3,6 +3,9 @@ * Purpose: Generic MCA handling layer * * Updated for latest kernel + * Copyright (C) 2002 Dell Computer Corporation + * Copyright (C) Matt Domsch (Matt_Domsch@dell.com) + * * Copyright (C) 2002 Intel * Copyright (C) Jenna Hall (jenna.s.hall@intel.com) * @@ -15,6 +18,8 @@ * Copyright (C) 1999 Silicon Graphics, Inc. * Copyright (C) Vijay Chander(vijay@engr.sgi.com) * + * 02/03/25 M. Domsch GUID cleanups + * * 02/01/04 J. Hall Aligned MCA stack to 16 bytes, added platform vs. CPU * error flag, set SAL default return values, changed * error record structure to linked list, added init call @@ -348,17 +353,13 @@ verify_guid (efi_guid_t *test, efi_guid_t *target) { int rc; + char out[40]; - if ((rc = memcmp((void *)test, (void *)target, sizeof(efi_guid_t)))) { - IA64_MCA_DEBUG("ia64_mca_print: invalid guid = " - "{ %08x, %04x, %04x, { %#02x, %#02x, %#02x, %#02x, " - "%#02x, %#02x, %#02x, %#02x, } } \n ", - test->data1, test->data2, test->data3, test->data4[0], - test->data4[1], test->data4[2], test->data4[3], - test->data4[4], test->data4[5], test->data4[6], - test->data4[7]); + if ((rc = efi_guidcmp(*test, *target))) { + IA64_MCA_DEBUG(KERN_DEBUG + "verify_guid: invalid GUID = %s\n", + efi_guid_unparse(test, out)); } - return rc; } @@ -856,11 +857,8 @@ void ia64_log_prt_guid (efi_guid_t *p_guid, prfunc_t prfunc) { - printk("GUID = { %08x, %04x, %04x, { %#02x, %#02x, %#02x, %#02x, " - "%#02x, %#02x, %#02x, %#02x, } } \n ", p_guid->data1, - p_guid->data2, p_guid->data3, p_guid->data4[0], p_guid->data4[1], - p_guid->data4[2], p_guid->data4[3], p_guid->data4[4], - p_guid->data4[5], p_guid->data4[6], p_guid->data4[7]); + char out[40]; + printk(KERN_DEBUG "GUID = %s\n", efi_guid_unparse(p_guid, out)); } static void @@ -1754,7 +1752,7 @@ ia64_log_prt_section_header(slsh, prfunc); #endif // MCA_PRT_XTRA_DATA for test only @FVL - if (verify_guid((void *)&slsh->guid, (void *)&(SAL_PROC_DEV_ERR_SECT_GUID))) { + if (verify_guid(&slsh->guid, &(SAL_PROC_DEV_ERR_SECT_GUID))) { IA64_MCA_DEBUG("ia64_mca_log_print: unsupported record section\n"); continue; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ia64/kernel/perfmon.c linux.20pre5-ac2/arch/ia64/kernel/perfmon.c --- linux.20pre5/arch/ia64/kernel/perfmon.c 2002-08-29 18:39:50.000000000 +0100 +++ linux.20pre5-ac2/arch/ia64/kernel/perfmon.c 2002-08-06 15:42:21.000000000 +0100 @@ -387,34 +387,8 @@ return ia64_get_itc(); } -/* Given PGD from the address space's page table, return the kernel - * virtual mapping of the physical memory mapped at ADR. - */ -static inline unsigned long -uvirt_to_kva(pgd_t *pgd, unsigned long adr) -{ - unsigned long ret = 0UL; - pmd_t *pmd; - pte_t *ptep, pte; - - if (!pgd_none(*pgd)) { - pmd = pmd_offset(pgd, adr); - if (!pmd_none(*pmd)) { - ptep = pte_offset(pmd, adr); - pte = *ptep; - if (pte_present(pte)) { - ret = (unsigned long) page_address(pte_page(pte)); - ret |= (adr & (PAGE_SIZE - 1)); - } - } - } - DBprintk(("[%d] uv2kva(%lx-->%lx)\n", current->pid, adr, ret)); - return ret; -} - /* Here we want the physical address of the memory. - * This is used when initializing the contents of the - * area and marking the pages as reserved. + * This is used when initializing the contents of the area. */ static inline unsigned long pfm_kvirt_to_pa(unsigned long adr) @@ -424,21 +398,19 @@ return pa; } - static void * pfm_rvmalloc(unsigned long size) { void *mem; - unsigned long adr, page; + unsigned long adr; + size=PAGE_ALIGN(size); mem=vmalloc(size); if (mem) { - //printk("perfmon: CPU%d pfm_rvmalloc(%ld)=%p\n", smp_processor_id(), size, mem); memset(mem, 0, size); /* Clear the ram out, no junk to the user */ adr=(unsigned long) mem; while (size > 0) { - page = pfm_kvirt_to_pa(adr); - mem_map_reserve(virt_to_page(__va(page))); + mem_map_reserve(vmalloc_to_page((void *)adr)); adr += PAGE_SIZE; size -= PAGE_SIZE; } @@ -449,13 +421,12 @@ static void pfm_rvfree(void *mem, unsigned long size) { - unsigned long adr, page = 0; + unsigned long adr; if (mem) { adr=(unsigned long) mem; - while (size > 0) { - page = pfm_kvirt_to_pa(adr); - mem_map_unreserve(virt_to_page(__va(page))); + while ((long) size > 0) { + mem_map_unreserve(vmalloc_to_page((void *)adr)); adr+=PAGE_SIZE; size-=PAGE_SIZE; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ia64/mm/fault.c linux.20pre5-ac2/arch/ia64/mm/fault.c --- linux.20pre5/arch/ia64/mm/fault.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/ia64/mm/fault.c 2002-08-29 19:00:49.000000000 +0100 @@ -119,8 +119,6 @@ check_expansion: if (!(prev_vma && (prev_vma->vm_flags & VM_GROWSUP) && (address == prev_vma->vm_end))) { - if (!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; if (rgn_index(address) != rgn_index(vma->vm_start) || rgn_offset(address) >= RGN_MAP_LIMIT) goto bad_area; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/mips/config.in linux.20pre5-ac2/arch/mips/config.in --- linux.20pre5/arch/mips/config.in 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/mips/config.in 2002-08-06 15:42:19.000000000 +0100 @@ -631,6 +631,7 @@ if [ "$CONFIG_SMP" != "y" ]; then bool 'Run uncached' CONFIG_MIPS_UNCACHED fi +dep_bool 'Morse code panics' CONFIG_PANIC_MORSE $CONFIG_DEBUG $CONFIG_PC_KEYB endmenu source lib/Config.in diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/mips/mm/fault.c linux.20pre5-ac2/arch/mips/mm/fault.c --- linux.20pre5/arch/mips/mm/fault.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/mips/mm/fault.c 2002-08-29 19:00:49.000000000 +0100 @@ -111,8 +111,6 @@ goto bad_area; if (vma->vm_start <= address) goto good_area; - if (!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; if (expand_stack(vma, address)) goto bad_area; /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/mips64/mm/fault.c linux.20pre5-ac2/arch/mips64/mm/fault.c --- linux.20pre5/arch/mips64/mm/fault.c 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/mips64/mm/fault.c 2002-08-29 19:00:49.000000000 +0100 @@ -135,8 +135,6 @@ goto bad_area; if (vma->vm_start <= address) goto good_area; - if (!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; if (expand_stack(vma, address)) goto bad_area; /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/parisc/kernel/lasimap.map linux.20pre5-ac2/arch/parisc/kernel/lasimap.map --- linux.20pre5/arch/parisc/kernel/lasimap.map 2002-08-29 18:39:51.000000000 +0100 +++ linux.20pre5-ac2/arch/parisc/kernel/lasimap.map 1970-01-01 01:00:00.000000000 +0100 @@ -1,322 +0,0 @@ -# HP 712 kernel keymap. This uses 7 modifier combinations. - -keymaps 0-2,4-5,8,12 -# ie, plain, Shift, AltGr, Control, Control+Shift, Alt and Control+Alt - - -# Change the above line into -# keymaps 0-2,4-6,8,12 -# in case you want the entries -# altgr control keycode 83 = Boot -# altgr control keycode 111 = Boot -# below. -# -# In fact AltGr is used very little, and one more keymap can -# be saved by mapping AltGr to Alt (and adapting a few entries): -# keycode 100 = Alt -# -keycode 1 = F9 F19 Console_21 - control keycode 1 = F9 - alt keycode 1 = Console_9 - control alt keycode 1 = Console_9 -keycode 2 = -keycode 3 = F5 F15 Console_17 - control keycode 3 = F5 - alt keycode 3 = Console_5 - control alt keycode 3 = Console_5 -keycode 4 = F3 F13 Console_15 - control keycode 4 = F3 - alt keycode 4 = Console_3 - control alt keycode 4 = Console_3 -keycode 5 = F1 F11 Console_13 - control keycode 5 = F1 - alt keycode 5 = Console_1 - control alt keycode 5 = Console_1 -keycode 6 = F2 F12 Console_14 - control keycode 6 = F2 - alt keycode 6 = Console_2 - control alt keycode 6 = Console_2 -keycode 7 = F12 F12 Console_24 - control keycode 7 = F12 - alt keycode 7 = Console_12 - control alt keycode 7 = Console_12 -keycode 8 = -keycode 9 = F10 F20 Console_22 - control keycode 9 = F10 - alt keycode 9 = Console_10 - control alt keycode 9 = Console_10 -keycode 10 = F8 F18 Console_20 - control keycode 10 = F8 - alt keycode 10 = Console_8 - control alt keycode 10 = Console_8 -keycode 11 = F6 F16 Console_18 - control keycode 11 = F6 - alt keycode 11 = Console_6 - control alt keycode 11 = Console_6 -keycode 12 = F4 F14 Console_16 - control keycode 12 = F4 - alt keycode 12 = Console_4 - control alt keycode 12 = Console_4 -keycode 13 = Tab Tab - alt keycode 13 = Meta_Tab -keycode 14 = grave asciitilde - control keycode 14 = nul - alt keycode 14 = Meta_grave -keycode 15 = -keycode 16 = -keycode 17 = Alt -keycode 18 = Shift -keycode 19 = -keycode 20 = Control -keycode 21 = q -keycode 22 = one exclam exclam -keycode 23 = -keycode 24 = -keycode 25 = -keycode 26 = z -keycode 27 = s -keycode 28 = a - altgr keycode 28 = Hex_A -keycode 29 = w -keycode 30 = two at at -keycode 31 = -keycode 32 = -keycode 33 = c - altgr keycode 46 = Hex_C -keycode 34 = x -keycode 35 = d - altgr keycode 35 = Hex_D -keycode 36 = e - altgr keycode 36 = Hex_E -keycode 37 = four dollar -keycode 38 = three numbersign -keycode 39 = -keycode 40 = -keycode 41 = -keycode 42 = v -keycode 43 = f - altgr keycode 43 = Hex_F -keycode 44 = t -keycode 45 = r -keycode 46 = five percent -keycode 47 = -keycode 48 = -keycode 49 = n -keycode 50 = b - altgr keycode 50 = Hex_B -keycode 51 = h -keycode 52 = g -keycode 53 = y -keycode 54 = six asciicircum -keycode 55 = -keycode 56 = -keycode 57 = -keycode 58 = m -keycode 59 = j -keycode 60 = u -keycode 61 = seven ampersand -keycode 62 = eight asterisk asterisk -keycode 63 = -keycode 64 = -keycode 65 = comma less - alt keycode 65 = Meta_comma -keycode 66 = k -keycode 67 = i -keycode 68 = o -keycode 69 = zero parenright bracketright -keycode 70 = nine parenleft bracketleft -keycode 71 = -keycode 72 = -keycode 73 = period greater - control keycode 73 = Compose - alt keycode 73 = Meta_period -keycode 74 = slash question - control keycode 74 = Delete - alt keycode 53 = Meta_slash -keycode 75 = l -keycode 76 = semicolon colon - alt keycode 39 = Meta_semicolon -keycode 77 = p -keycode 78 = minus underscore -keycode 79 = -keycode 80 = -keycode 81 = -keycode 82 = apostrophe quotedbl - control keycode 82 = Control_g - alt keycode 40 = Meta_apostrophe -keycode 83 = -keycode 84 = bracketleft braceleft - control keycode 84 = Escape - alt keycode 26 = Meta_bracketleft -keycode 85 = equal plus -keycode 86 = -keycode 87 = -keycode 88 = Caps_Lock -keycode 88 = -keycode 89 = -keycode 89 = -keycode 89 = -keycode 90 = Return - alt keycode 90 = Meta_Control_m -keycode 91 = bracketright braceright asciitilde - control keycode 91 = Control_bracketright - alt keycode 91 = Meta_bracketright -keycode 92 = -keycode 93 = backslash bar - control keycode 43 = Control_backslash - alt keycode 43 = Meta_backslash -keycode 94 = -keycode 95 = -keycode 96 = -keycode 97 = -keycode 98 = -keycode 99 = -keycode 100 = -keycode 101 = -keycode 102 = BackSpace -keycode 103 = -keycode 104 = -keycode 105 = KP_1 - alt keycode 105 = Ascii_1 - altgr keycode 105 = Hex_1 -keycode 106 = -keycode 107 = KP_4 - alt keycode 107 = Ascii_4 - altgr keycode 107 = Hex_4 -keycode 108 = KP_7 - alt keycode 108 = Ascii_7 - altgr keycode 108 = Hex_7 -keycode 109 = -keycode 110 = -keycode 111 = -keycode 112 = KP_0 - alt keycode 82 = Ascii_0 - altgr keycode 82 = Hex_0 -keycode 113 = KP_Period -keycode 114 = KP_2 - alt keycode 114 = Ascii_2 - altgr keycode 114 = Hex_2 -keycode 115 = KP_5 - alt keycode 115 = Ascii_5 - altgr keycode 115 = Hex_5 -keycode 116 = KP_6 - alt keycode 116 = Ascii_6 - altgr keycode 116 = Hex_6 -keycode 117 = KP_8 - alt keycode 117 = Ascii_8 - altgr keycode 117 = Hex_8 -keycode 118 = Escape -keycode 119 = -keycode 120 = F11 -keycode 121 = KP_Add -keycode 122 = KP_3 - alt keycode 122 = Ascii_3 - altgr keycode 122 = Hex_3 -keycode 123 = KP_Subtract -keycode 124 = KP_Multiply -keycode 125 = KP_9 - alt keycode 125 = Ascii_9 - altgr keycode 125 = Hex_9 -keycode 126 = -# 131!! -keycode 127 = F7 F17 Console_19 - control keycode 127 = F7 - alt keycode 127 = Console_7 - control alt keycode 127 = Console_7 - -string F1 = "\033[[A" -string F2 = "\033[[B" -string F3 = "\033[[C" -string F4 = "\033[[D" -string F5 = "\033[[E" -string F6 = "\033[17~" -string F7 = "\033[18~" -string F8 = "\033[19~" -string F9 = "\033[20~" -string F10 = "\033[21~" -string F11 = "\033[23~" -string F12 = "\033[24~" -string F13 = "\033[25~" -string F14 = "\033[26~" -string F15 = "\033[28~" -string F16 = "\033[29~" -string F17 = "\033[31~" -string F18 = "\033[32~" -string F19 = "\033[33~" -string F20 = "\033[34~" -string Find = "\033[1~" -string Insert = "\033[2~" -string Remove = "\033[3~" -string Select = "\033[4~" -string Prior = "\033[5~" -string Next = "\033[6~" -string Macro = "\033[M" -string Pause = "\033[P" -compose '`' 'A' to 'À' -compose '`' 'a' to 'à' -compose '\'' 'A' to 'Á' -compose '\'' 'a' to 'á' -compose '^' 'A' to 'Â' -compose '^' 'a' to 'â' -compose '~' 'A' to 'Ã' -compose '~' 'a' to 'ã' -compose '"' 'A' to 'Ä' -compose '"' 'a' to 'ä' -compose 'O' 'A' to 'Å' -compose 'o' 'a' to 'å' -compose '0' 'A' to 'Å' -compose '0' 'a' to 'å' -compose 'A' 'A' to 'Å' -compose 'a' 'a' to 'å' -compose 'A' 'E' to 'Æ' -compose 'a' 'e' to 'æ' -compose ',' 'C' to 'Ç' -compose ',' 'c' to 'ç' -compose '`' 'E' to 'È' -compose '`' 'e' to 'è' -compose '\'' 'E' to 'É' -compose '\'' 'e' to 'é' -compose '^' 'E' to 'Ê' -compose '^' 'e' to 'ê' -compose '"' 'E' to 'Ë' -compose '"' 'e' to 'ë' -compose '`' 'I' to 'Ì' -compose '`' 'i' to 'ì' -compose '\'' 'I' to 'Í' -compose '\'' 'i' to 'í' -compose '^' 'I' to 'Î' -compose '^' 'i' to 'î' -compose '"' 'I' to 'Ï' -compose '"' 'i' to 'ï' -compose '-' 'D' to 'Ð' -compose '-' 'd' to 'ð' -compose '~' 'N' to 'Ñ' -compose '~' 'n' to 'ñ' -compose '`' 'O' to 'Ò' -compose '`' 'o' to 'ò' -compose '\'' 'O' to 'Ó' -compose '\'' 'o' to 'ó' -compose '^' 'O' to 'Ô' -compose '^' 'o' to 'ô' -compose '~' 'O' to 'Õ' -compose '~' 'o' to 'õ' -compose '"' 'O' to 'Ö' -compose '"' 'o' to 'ö' -compose '/' 'O' to 'Ø' -compose '/' 'o' to 'ø' -compose '`' 'U' to 'Ù' -compose '`' 'u' to 'ù' -compose '\'' 'U' to 'Ú' -compose '\'' 'u' to 'ú' -compose '^' 'U' to 'Û' -compose '^' 'u' to 'û' -compose '"' 'U' to 'Ü' -compose '"' 'u' to 'ü' -compose '\'' 'Y' to 'Ý' -compose '\'' 'y' to 'ý' -compose 'T' 'H' to 'Þ' -compose 't' 'h' to 'þ' -compose 's' 's' to 'ß' -compose '"' 'y' to 'ÿ' -compose 's' 'z' to 'ß' -compose 'i' 'j' to 'ÿ' diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ppc/kernel/entry.S linux.20pre5-ac2/arch/ppc/kernel/entry.S --- linux.20pre5/arch/ppc/kernel/entry.S 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/arch/ppc/kernel/entry.S 2002-08-26 14:23:02.000000000 +0100 @@ -264,7 +264,9 @@ .globl ret_from_fork ret_from_fork: +#ifdef CONFIG_SMP bl schedule_tail +#endif lwz r0,TASK_PTRACE(r2) andi. r0,r0,PT_TRACESYS bnel- syscall_trace diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ppc/kernel/idle.c linux.20pre5-ac2/arch/ppc/kernel/idle.c --- linux.20pre5/arch/ppc/kernel/idle.c 2002-08-29 18:39:47.000000000 +0100 +++ linux.20pre5-ac2/arch/ppc/kernel/idle.c 2002-08-26 14:23:02.000000000 +0100 @@ -55,9 +55,6 @@ do_power_save = 1; /* endless loop with no priority at all */ - current->nice = 20; - current->counter = -100; - init_idle(); for (;;) { #ifdef CONFIG_SMP if (!do_power_save) { @@ -75,11 +72,8 @@ #endif if (do_power_save && !current->need_resched) power_save(); - - if (current->need_resched) { - schedule(); - check_pgt_cache(); - } + schedule(); + check_pgt_cache(); } return 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ppc/kernel/mk_defs.c linux.20pre5-ac2/arch/ppc/kernel/mk_defs.c --- linux.20pre5/arch/ppc/kernel/mk_defs.c 2002-08-29 18:39:47.000000000 +0100 +++ linux.20pre5-ac2/arch/ppc/kernel/mk_defs.c 2002-08-29 23:15:28.000000000 +0100 @@ -37,8 +37,7 @@ /*DEFINE(KERNELBASE, KERNELBASE);*/ DEFINE(STATE, offsetof(struct task_struct, state)); DEFINE(NEXT_TASK, offsetof(struct task_struct, next_task)); - DEFINE(COUNTER, offsetof(struct task_struct, counter)); - DEFINE(PROCESSOR, offsetof(struct task_struct, processor)); + DEFINE(PROCESSOR, offsetof(struct task_struct, cpu)); DEFINE(SIGPENDING, offsetof(struct task_struct, sigpending)); DEFINE(THREAD, offsetof(struct task_struct, thread)); DEFINE(MM, offsetof(struct task_struct, mm)); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ppc/kernel/ppc_defs.h linux.20pre5-ac2/arch/ppc/kernel/ppc_defs.h --- linux.20pre5/arch/ppc/kernel/ppc_defs.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/arch/ppc/kernel/ppc_defs.h 2002-08-26 14:23:02.000000000 +0100 @@ -0,0 +1,81 @@ +/* + * WARNING! This file is automatically generated - DO NOT EDIT! + */ +#define STATE 0 +#define NEXT_TASK 76 +#define PROCESSOR 32 +#define SIGPENDING 8 +#define THREAD 608 +#define MM 84 +#define ACTIVE_MM 88 +#define TASK_STRUCT_SIZE 1520 +#define KSP 0 +#define PGDIR 16 +#define LAST_SYSCALL 20 +#define PT_REGS 8 +#define PT_TRACESYS 2 +#define TASK_FLAGS 4 +#define TASK_PTRACE 24 +#define NEED_RESCHED 20 +#define THREAD_FPR0 24 +#define THREAD_FPSCR 284 +#define THREAD_VR0 288 +#define THREAD_VRSAVE 816 +#define THREAD_VSCR 800 +#define TASK_UNION_SIZE 8192 +#define STACK_FRAME_OVERHEAD 16 +#define INT_FRAME_SIZE 192 +#define GPR0 16 +#define GPR1 20 +#define GPR2 24 +#define GPR3 28 +#define GPR4 32 +#define GPR5 36 +#define GPR6 40 +#define GPR7 44 +#define GPR8 48 +#define GPR9 52 +#define GPR10 56 +#define GPR11 60 +#define GPR12 64 +#define GPR13 68 +#define GPR14 72 +#define GPR15 76 +#define GPR16 80 +#define GPR17 84 +#define GPR18 88 +#define GPR19 92 +#define GPR20 96 +#define GPR21 100 +#define GPR22 104 +#define GPR23 108 +#define GPR24 112 +#define GPR25 116 +#define GPR26 120 +#define GPR27 124 +#define GPR28 128 +#define GPR29 132 +#define GPR30 136 +#define GPR31 140 +#define _NIP 144 +#define _MSR 148 +#define _CTR 156 +#define _LINK 160 +#define _CCR 168 +#define _MQ 172 +#define _XER 164 +#define _DAR 180 +#define _DSISR 184 +#define _DEAR 180 +#define _ESR 184 +#define ORIG_GPR3 152 +#define RESULT 188 +#define TRAP 176 +#define CLONE_VM 256 +#define MM_PGD 12 +#define CPU_SPEC_ENTRY_SIZE 32 +#define CPU_SPEC_PVR_MASK 0 +#define CPU_SPEC_PVR_VALUE 4 +#define CPU_SPEC_FEATURES 12 +#define CPU_SPEC_SETUP 28 +#define NUM_USER_SEGMENTS 8 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ppc/kernel/setup.c linux.20pre5-ac2/arch/ppc/kernel/setup.c --- linux.20pre5/arch/ppc/kernel/setup.c 2002-08-29 18:39:53.000000000 +0100 +++ linux.20pre5-ac2/arch/ppc/kernel/setup.c 2002-08-29 18:44:13.000000000 +0100 @@ -684,14 +684,16 @@ id->cfs_enable_2 = __le16_to_cpu(id->cfs_enable_2); id->csf_default = __le16_to_cpu(id->csf_default); id->dma_ultra = __le16_to_cpu(id->dma_ultra); - id->word89 = __le16_to_cpu(id->word89); - id->word90 = __le16_to_cpu(id->word90); + id->trseuc = __le16_to_cpu(id->trseuc); + id->trsEuc = __le16_to_cpu(id->trsEuc); id->CurAPMvalues = __le16_to_cpu(id->CurAPMvalues); - id->word92 = __le16_to_cpu(id->word92); + id->mprc = __le16_to_cpu(id->mprc); id->hw_config = __le16_to_cpu(id->hw_config); id->acoustic = __le16_to_cpu(id->acoustic); - for (i = 0; i < 5; i++) - id->words95_99[i] = __le16_to_cpu(id->words95_99[i]); + id->msrqs = __le16_to_cpu(id->msrqs); + id->sxfert = __le16_to_cpu(id->sxfert); + id->sal = __le16_to_cpu(id->sal); + id->spg = __le32_to_cpu(id->spg); id->lba_capacity_2 = __le64_to_cpu(id->lba_capacity_2); for (i = 0; i < 22; i++) id->words104_125[i] = __le16_to_cpu(id->words104_125[i]); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ppc/kernel/smp.c linux.20pre5-ac2/arch/ppc/kernel/smp.c --- linux.20pre5/arch/ppc/kernel/smp.c 2002-08-29 18:39:47.000000000 +0100 +++ linux.20pre5-ac2/arch/ppc/kernel/smp.c 2002-08-26 14:23:02.000000000 +0100 @@ -294,8 +294,6 @@ cpu_callin_map[0] = 1; current->processor = 0; - init_idle(); - for (i = 0; i < NR_CPUS; i++) { prof_counter[i] = 1; prof_multiplier[i] = 1; @@ -348,7 +346,8 @@ p = init_task.prev_task; if (!p) panic("No idle task for CPU %d", i); - del_from_runqueue(p); + init_idle(p, i); + unhash_process(p); init_tasks[i] = p; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ppc/mm/fault.c linux.20pre5-ac2/arch/ppc/mm/fault.c --- linux.20pre5/arch/ppc/mm/fault.c 2002-08-29 18:39:53.000000000 +0100 +++ linux.20pre5-ac2/arch/ppc/mm/fault.c 2002-08-29 18:44:13.000000000 +0100 @@ -109,8 +109,6 @@ goto bad_area; if (vma->vm_start <= address) goto good_area; - if (!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; if (expand_stack(vma, address)) goto bad_area; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ppc/platforms/chrp_setup.c linux.20pre5-ac2/arch/ppc/platforms/chrp_setup.c --- linux.20pre5/arch/ppc/platforms/chrp_setup.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/arch/ppc/platforms/chrp_setup.c 2002-09-01 18:04:49.000000000 +0100 @@ -420,31 +420,6 @@ } #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) -/* - * IDE stuff. - */ - -static int __chrp -chrp_ide_check_region(ide_ioreg_t from, unsigned int extent) -{ - return check_region(from, extent); -} - -static void __chrp -chrp_ide_request_region(ide_ioreg_t from, - unsigned int extent, - const char *name) -{ - request_region(from, extent, name); -} - -static void __chrp -chrp_ide_release_region(ide_ioreg_t from, - unsigned int extent) -{ - release_region(from, extent); -} - static void __chrp chrp_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq) { @@ -576,9 +551,6 @@ #endif /* CONFIG_SMP */ #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) - ppc_ide_md.ide_check_region = chrp_ide_check_region; - ppc_ide_md.ide_request_region = chrp_ide_request_region; - ppc_ide_md.ide_release_region = chrp_ide_release_region; ppc_ide_md.ide_init_hwif = chrp_ide_init_hwif_ports; #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ppc/platforms/pmac_setup.c linux.20pre5-ac2/arch/ppc/platforms/pmac_setup.c --- linux.20pre5/arch/ppc/platforms/pmac_setup.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/arch/ppc/platforms/pmac_setup.c 2002-09-01 18:04:49.000000000 +0100 @@ -706,44 +706,7 @@ pmac_power_off(); } - #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) -/* - * IDE stuff. - */ -static int __pmac -pmac_ide_check_region(ide_ioreg_t from, unsigned int extent) -{ -#ifdef CONFIG_BLK_DEV_IDE_PMAC - if (pmac_ide_check_base(from) >= 0) - return 0; -#endif - return check_region(from, extent); -} - -static void __pmac -pmac_ide_request_region(ide_ioreg_t from, - unsigned int extent, - const char *name) -{ -#ifdef CONFIG_BLK_DEV_IDE_PMAC - if (pmac_ide_check_base(from) >= 0) - return; -#endif - request_region(from, extent, name); -} - -static void __pmac -pmac_ide_release_region(ide_ioreg_t from, - unsigned int extent) -{ -#ifdef CONFIG_BLK_DEV_IDE_PMAC - if (pmac_ide_check_base(from) >= 0) - return; -#endif - release_region(from, extent); -} - #ifndef CONFIG_BLK_DEV_IDE_PMAC /* * This is only used if we have a PCI IDE controller, not @@ -924,9 +887,6 @@ select_adb_keyboard(); #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) - ppc_ide_md.ide_check_region = pmac_ide_check_region; - ppc_ide_md.ide_request_region = pmac_ide_request_region; - ppc_ide_md.ide_release_region = pmac_ide_release_region; #ifdef CONFIG_BLK_DEV_IDE_PMAC ppc_ide_md.ide_init_hwif = pmac_ide_init_hwif_ports; ppc_ide_md.default_io_base = pmac_ide_get_base; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ppc/platforms/prep_setup.c linux.20pre5-ac2/arch/ppc/platforms/prep_setup.c --- linux.20pre5/arch/ppc/platforms/prep_setup.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/arch/ppc/platforms/prep_setup.c 2002-09-01 18:04:49.000000000 +0100 @@ -674,27 +674,6 @@ } } -static int __prep -prep_ide_check_region(ide_ioreg_t from, unsigned int extent) -{ - return check_region(from, extent); -} - -static void __prep -prep_ide_request_region(ide_ioreg_t from, - unsigned int extent, - const char *name) -{ - request_region(from, extent, name); -} - -static void __prep -prep_ide_release_region(ide_ioreg_t from, - unsigned int extent) -{ - release_region(from, extent); -} - static void __init prep_ide_init_hwif_ports (hw_regs_t *hw, ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq) { @@ -879,9 +858,6 @@ #if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE) ppc_ide_md.default_irq = prep_ide_default_irq; ppc_ide_md.default_io_base = prep_ide_default_io_base; - ppc_ide_md.ide_check_region = prep_ide_check_region; - ppc_ide_md.ide_request_region = prep_ide_request_region; - ppc_ide_md.ide_release_region = prep_ide_release_region; ppc_ide_md.ide_init_hwif = prep_ide_init_hwif_ports; #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/ppc64/kernel/setup.c linux.20pre5-ac2/arch/ppc64/kernel/setup.c --- linux.20pre5/arch/ppc64/kernel/setup.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/arch/ppc64/kernel/setup.c 2002-08-29 18:44:39.000000000 +0100 @@ -585,17 +585,19 @@ id->cfs_enable_2 = __le16_to_cpu(id->cfs_enable_2); id->csf_default = __le16_to_cpu(id->csf_default); id->dma_ultra = __le16_to_cpu(id->dma_ultra); - id->word89 = __le16_to_cpu(id->word89); - id->word90 = __le16_to_cpu(id->word90); + id->trseuc = __le16_to_cpu(id->trseuc); + id->trsEuc = __le16_to_cpu(id->trsEuc); id->CurAPMvalues = __le16_to_cpu(id->CurAPMvalues); - id->word92 = __le16_to_cpu(id->word92); + id->mprc = __le16_to_cpu(id->mprc); id->hw_config = __le16_to_cpu(id->hw_config); id->acoustic = __le16_to_cpu(id->acoustic); - for (i = 0; i < 5; i++) - id->words95_99[i] = __le16_to_cpu(id->words95_99[i]); + id->msrqs = __le16_to_cpu(id->msrqs); + id->sxfert = __le16_to_cpu(id->sxfert); + id->sal = __le16_to_cpu(id->sal); + id->spg = __le32_to_cpu(id->spg); id->lba_capacity_2 = __le64_to_cpu(id->lba_capacity_2); - for (i = 0; i < 21; i++) - id->words104_125[i] = __le16_to_cpu(id->words104_125[i]); + for (i = 0; i < 22; i++) + id->words104_125[i] = __le16_to_cpu(id->words104_125[i]); id->last_lun = __le16_to_cpu(id->last_lun); id->word127 = __le16_to_cpu(id->word127); id->dlf = __le16_to_cpu(id->dlf); @@ -605,14 +607,14 @@ id->word156 = __le16_to_cpu(id->word156); for (i = 0; i < 3; i++) id->words157_159[i] = __le16_to_cpu(id->words157_159[i]); - id->cfa_power=__le16_to_cpu(id->cfa_power); - for (i = 0; i < 15; i++) + id->cfa_power = __le16_to_cpu(id->cfa_power); + for (i = 0; i < 14; i++) id->words161_175[i] = __le16_to_cpu(id->words161_175[i]); - for (i = 0; i < 29; i++) + for (i = 0; i < 31; i++) id->words176_205[i] = __le16_to_cpu(id->words176_205[i]); for (i = 0; i < 48; i++) id->words206_254[i] = __le16_to_cpu(id->words206_254[i]); - id->integrity_word=__le16_to_cpu(id->integrity_word); + id->integrity_word = __le16_to_cpu(id->integrity_word); } #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/s390/kernel/entry.S linux.20pre5-ac2/arch/s390/kernel/entry.S --- linux.20pre5/arch/s390/kernel/entry.S 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/arch/s390/kernel/entry.S 2002-08-13 14:09:16.000000000 +0100 @@ -254,13 +254,14 @@ ret_from_fork: basr %r13,0 l %r13,.Lentry_base-.(%r13) # setup base pointer to &entry_base + # not saving R14 here because we go to sysc_return ultimately + l %r1,BASED(.Lschedtail) + basr %r14,%r1 # call schedule_tail (unlock stuff) GET_CURRENT # load pointer to task_struct to R9 stosm 24(%r15),0x03 # reenable interrupts sr %r0,%r0 # child returns 0 st %r0,SP_R2(%r15) # store return value (change R2 on stack) - l %r1,BASED(.Lschedtail) - la %r14,BASED(sysc_return) - br %r1 # call schedule_tail, return to sysc_return + b BASED(sysc_return) # # clone, fork, vfork, exec and sigreturn need glue, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/s390x/kernel/entry.S linux.20pre5-ac2/arch/s390x/kernel/entry.S --- linux.20pre5/arch/s390x/kernel/entry.S 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/arch/s390x/kernel/entry.S 2002-08-13 14:09:33.000000000 +0100 @@ -240,11 +240,11 @@ # .globl ret_from_fork ret_from_fork: + brasl %r14,schedule_tail GET_CURRENT # load pointer to task_struct to R9 stosm 48(%r15),0x03 # reenable interrupts xc SP_R2(8,%r15),SP_R2(%r15) # child returns 0 - larl %r14,sysc_return - jg schedule_tail # return to sysc_return + j sysc_return # # clone, fork, vfork, exec and sigreturn need glue, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/s390x/kernel/linux32.c linux.20pre5-ac2/arch/s390x/kernel/linux32.c --- linux.20pre5/arch/s390x/kernel/linux32.c 2002-08-29 18:39:51.000000000 +0100 +++ linux.20pre5-ac2/arch/s390x/kernel/linux32.c 2002-08-06 15:42:22.000000000 +0100 @@ -912,64 +912,97 @@ return sys32_fcntl(fd, cmd, arg); } -struct dqblk32 { - __u32 dqb_bhardlimit; - __u32 dqb_bsoftlimit; - __u32 dqb_curblocks; - __u32 dqb_ihardlimit; - __u32 dqb_isoftlimit; - __u32 dqb_curinodes; - __kernel_time_t32 dqb_btime; - __kernel_time_t32 dqb_itime; -}; - extern asmlinkage int sys_quotactl(int cmd, const char *special, int id, caddr_t addr); -asmlinkage int sys32_quotactl(int cmd, const char *special, int id, unsigned long addr) +#ifdef CONFIG_QIFACE_COMPAT +#ifdef CONFIG_QIFACE_V1 +struct user_dqblk32 { + __u32 dqb_bhardlimit; + __u32 dqb_bsoftlimit; + __u32 dqb_curblocks; + __u32 dqb_ihardlimit; + __u32 dqb_isoftlimit; + __u32 dqb_curinodes; + __kernel_time_t32 dqb_btime; + __kernel_time_t32 dqb_itime; +}; +typedef struct v1c_mem_dqblk comp_dqblk_t; + +#define Q_COMP_GETQUOTA Q_V1_GETQUOTA +#define Q_COMP_SETQUOTA Q_V1_SETQUOTA +#define Q_COMP_SETQLIM Q_V1_SETQLIM +#define Q_COMP_SETUSE Q_V1_SETUSE +#else +struct user_dqblk32 { + __u32 dqb_ihardlimit; + __u32 dqb_isoftlimit; + __u32 dqb_curinodes; + __u32 dqb_bhardlimit; + __u32 dqb_bsoftlimit; + __u64 dqb_curspace; + __kernel_time_t32 dqb_btime; + __kernel_time_t32 dqb_itime; +}; +typedef struct v2c_mem_dqblk comp_dqblk_t; + +#define Q_COMP_GETQUOTA Q_V2_GETQUOTA +#define Q_COMP_SETQUOTA Q_V2_SETQUOTA +#define Q_COMP_SETQLIM Q_V2_SETQLIM +#define Q_COMP_SETUSE Q_V2_SETUSE +#endif + +asmlinkage int sys32_quotactl(int cmd, const char *special, int id, caddr_t addr) { int cmds = cmd >> SUBCMDSHIFT; int err; - struct dqblk d; + comp_dqblk_t d; mm_segment_t old_fs; char *spec; switch (cmds) { - case Q_GETQUOTA: - break; - case Q_SETQUOTA: - case Q_SETUSE: - case Q_SETQLIM: - if (copy_from_user (&d, (struct dqblk32 *)addr, - sizeof (struct dqblk32))) - return -EFAULT; - d.dqb_itime = ((struct dqblk32 *)&d)->dqb_itime; - d.dqb_btime = ((struct dqblk32 *)&d)->dqb_btime; - break; + case Q_COMP_GETQUOTA: + break; + case Q_COMP_SETQUOTA: + case Q_COMP_SETUSE: + case Q_COMP_SETQLIM: + if (copy_from_user(&d, (struct user_dqblk32 *)addr, + sizeof (struct user_dqblk32))) + return -EFAULT; + d.dqb_itime = ((struct user_dqblk32 *)&d)->dqb_itime; + d.dqb_btime = ((struct user_dqblk32 *)&d)->dqb_btime; + break; default: - return sys_quotactl(cmd, special, - id, (caddr_t)addr); + return sys_quotactl(cmd, special, id, (__kernel_caddr_t)addr); } spec = getname (special); err = PTR_ERR(spec); if (IS_ERR(spec)) return err; - old_fs = get_fs (); + old_fs = get_fs(); set_fs (KERNEL_DS); - err = sys_quotactl(cmd, (const char *)spec, id, (caddr_t)&d); + err = sys_quotactl(cmd, (const char *)spec, id, (__kernel_caddr_t)&d); set_fs (old_fs); putname (spec); if (err) return err; - if (cmds == Q_GETQUOTA) { + if (cmds == Q_COMP_GETQUOTA) { __kernel_time_t b = d.dqb_btime, i = d.dqb_itime; - ((struct dqblk32 *)&d)->dqb_itime = i; - ((struct dqblk32 *)&d)->dqb_btime = b; - if (copy_to_user ((struct dqblk32 *)addr, &d, - sizeof (struct dqblk32))) + ((struct user_dqblk32 *)&d)->dqb_itime = i; + ((struct user_dqblk32 *)&d)->dqb_btime = b; + if (copy_to_user ((struct user_dqblk32 *)addr, &d, + sizeof (struct user_dqblk32))) return -EFAULT; } return 0; } +#else +/* No conversion needed for new interface */ +asmlinkage int sys32_quotactl(int cmd, const char *special, int id, caddr_t addr) +{ + return sys_quotactl(cmd, special, id, addr); +} +#endif + static inline int put_statfs (struct statfs32 *ubuf, struct statfs *kbuf) { int err; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/sh/mm/fault.c linux.20pre5-ac2/arch/sh/mm/fault.c --- linux.20pre5/arch/sh/mm/fault.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/arch/sh/mm/fault.c 2002-08-29 19:00:49.000000000 +0100 @@ -72,8 +72,6 @@ return 1; check_stack: - if (!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; if (expand_stack(vma, start) == 0) goto good_area; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/sparc/kernel/sunos_ioctl.c linux.20pre5-ac2/arch/sparc/kernel/sunos_ioctl.c --- linux.20pre5/arch/sparc/kernel/sunos_ioctl.c 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/sparc/kernel/sunos_ioctl.c 2002-08-06 15:42:19.000000000 +0100 @@ -39,8 +39,12 @@ { int ret = -EBADF; - if (fd >= SUNOS_NR_OPEN || !fcheck(fd)) + read_lock(¤t->files->file_lock); + if (fd >= SUNOS_NR_OPEN || !fcheck(fd)) { + read_unlock(¤t->files->file_lock); goto out; + } + read_unlock(¤t->files->file_lock); /* First handle an easy compat. case for tty ldisc. */ if(cmd == TIOCSETD) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/sparc/mm/fault.c linux.20pre5-ac2/arch/sparc/mm/fault.c --- linux.20pre5/arch/sparc/mm/fault.c 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/arch/sparc/mm/fault.c 2002-08-06 15:42:19.000000000 +0100 @@ -249,8 +249,6 @@ goto bad_area; if(vma->vm_start <= address) goto good_area; - if(!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; if(expand_stack(vma, address)) goto bad_area; /* @@ -496,8 +494,6 @@ goto bad_area; if(vma->vm_start <= address) goto good_area; - if(!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; if(expand_stack(vma, address)) goto bad_area; good_area: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/sparc/mm/srmmu.c linux.20pre5-ac2/arch/sparc/mm/srmmu.c --- linux.20pre5/arch/sparc/mm/srmmu.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/arch/sparc/mm/srmmu.c 2002-08-13 14:10:07.000000000 +0100 @@ -1994,7 +1994,7 @@ iaddr = &(insn); \ daddr = &(dest); \ *iaddr = SPARC_BRANCH((unsigned long) daddr, (unsigned long) iaddr); \ - } while(0); + } while(0) static void __init patch_window_trap_handlers(void) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/sparc/mm/sun4c.c linux.20pre5-ac2/arch/sparc/mm/sun4c.c --- linux.20pre5/arch/sparc/mm/sun4c.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/arch/sparc/mm/sun4c.c 2002-08-13 14:10:07.000000000 +0100 @@ -386,7 +386,7 @@ daddr = &(dst); \ iaddr = &(src); \ *daddr = *iaddr; \ - } while (0); + } while (0) static void __init patch_kernel_fault_handler(void) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/sparc64/kernel/binfmt_elf32.c linux.20pre5-ac2/arch/sparc64/kernel/binfmt_elf32.c --- linux.20pre5/arch/sparc64/kernel/binfmt_elf32.c 2002-08-29 18:39:50.000000000 +0100 +++ linux.20pre5-ac2/arch/sparc64/kernel/binfmt_elf32.c 2002-08-06 15:42:21.000000000 +0100 @@ -43,7 +43,7 @@ dest[34] = (unsigned int) src->tnpc; \ dest[35] = src->y; \ dest[36] = dest[37] = 0; /* XXX */ \ -} while (0); +} while(0) typedef struct { union { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/sparc64/kernel/sunos_ioctl32.c linux.20pre5-ac2/arch/sparc64/kernel/sunos_ioctl32.c --- linux.20pre5/arch/sparc64/kernel/sunos_ioctl32.c 2002-08-29 18:39:50.000000000 +0100 +++ linux.20pre5-ac2/arch/sparc64/kernel/sunos_ioctl32.c 2002-08-06 15:42:21.000000000 +0100 @@ -100,8 +100,12 @@ if(fd >= SUNOS_NR_OPEN) goto out; - if(!fcheck(fd)) + read_lock(¤t->files->file_lock); + if(!fcheck(fd)) { + read_unlock(¤t->files->file_lock); goto out; + } + read_unlock(¤t->files->file_lock); if(cmd == TIOCSETD) { mm_segment_t old_fs = get_fs(); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/sparc64/kernel/sys_sparc32.c linux.20pre5-ac2/arch/sparc64/kernel/sys_sparc32.c --- linux.20pre5/arch/sparc64/kernel/sys_sparc32.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/arch/sparc64/kernel/sys_sparc32.c 2002-08-06 15:55:38.000000000 +0100 @@ -888,62 +888,97 @@ return sys32_fcntl(fd, cmd, arg); } -struct dqblk32 { - __u32 dqb_bhardlimit; - __u32 dqb_bsoftlimit; - __u32 dqb_curblocks; - __u32 dqb_ihardlimit; - __u32 dqb_isoftlimit; - __u32 dqb_curinodes; - __kernel_time_t32 dqb_btime; - __kernel_time_t32 dqb_itime; -}; - extern asmlinkage int sys_quotactl(int cmd, const char *special, int id, caddr_t addr); -asmlinkage int sys32_quotactl(int cmd, const char *special, int id, unsigned long addr) +#ifdef CONFIG_QIFACE_COMPAT +#ifdef CONFIG_QIFACE_V1 +struct user_dqblk32 { + __u32 dqb_bhardlimit; + __u32 dqb_bsoftlimit; + __u32 dqb_curblocks; + __u32 dqb_ihardlimit; + __u32 dqb_isoftlimit; + __u32 dqb_curinodes; + __kernel_time_t32 dqb_btime; + __kernel_time_t32 dqb_itime; +}; +typedef struct v1c_mem_dqblk comp_dqblk_t; + +#define Q_COMP_GETQUOTA Q_V1_GETQUOTA +#define Q_COMP_SETQUOTA Q_V1_SETQUOTA +#define Q_COMP_SETQLIM Q_V1_SETQLIM +#define Q_COMP_SETUSE Q_V1_SETUSE +#else +struct user_dqblk32 { + __u32 dqb_ihardlimit; + __u32 dqb_isoftlimit; + __u32 dqb_curinodes; + __u32 dqb_bhardlimit; + __u32 dqb_bsoftlimit; + __u64 dqb_curspace; + __kernel_time_t32 dqb_btime; + __kernel_time_t32 dqb_itime; +}; +typedef struct v2c_mem_dqblk comp_dqblk_t; + +#define Q_COMP_GETQUOTA Q_V2_GETQUOTA +#define Q_COMP_SETQUOTA Q_V2_SETQUOTA +#define Q_COMP_SETQLIM Q_V2_SETQLIM +#define Q_COMP_SETUSE Q_V2_SETUSE +#endif + +asmlinkage int sys32_quotactl(int cmd, const char *special, int id, caddr_t addr) { int cmds = cmd >> SUBCMDSHIFT; int err; - struct dqblk d; + comp_dqblk_t d; mm_segment_t old_fs; char *spec; switch (cmds) { - case Q_GETQUOTA: - break; - case Q_SETQUOTA: - case Q_SETUSE: - case Q_SETQLIM: - if (copy_from_user (&d, (struct dqblk32 *)addr, - sizeof (struct dqblk32))) - return -EFAULT; - d.dqb_itime = ((struct dqblk32 *)&d)->dqb_itime; - d.dqb_btime = ((struct dqblk32 *)&d)->dqb_btime; - break; + case Q_COMP_GETQUOTA: + break; + case Q_COMP_SETQUOTA: + case Q_COMP_SETUSE: + case Q_COMP_SETQLIM: + if (copy_from_user(&d, (struct user_dqblk32 *)addr, + sizeof (struct user_dqblk32))) + return -EFAULT; + d.dqb_itime = ((struct user_dqblk32 *)&d)->dqb_itime; + d.dqb_btime = ((struct user_dqblk32 *)&d)->dqb_btime; + break; default: - return sys_quotactl(cmd, special, - id, (caddr_t)addr); + return sys_quotactl(cmd, special, id, (__kernel_caddr_t)addr); } spec = getname (special); err = PTR_ERR(spec); if (IS_ERR(spec)) return err; - old_fs = get_fs (); + old_fs = get_fs(); set_fs (KERNEL_DS); - err = sys_quotactl(cmd, (const char *)spec, id, (caddr_t)&d); + err = sys_quotactl(cmd, (const char *)spec, id, (__kernel_caddr_t)&d); set_fs (old_fs); putname (spec); - if (cmds == Q_GETQUOTA) { + if (err) + return err; + if (cmds == Q_COMP_GETQUOTA) { __kernel_time_t b = d.dqb_btime, i = d.dqb_itime; - ((struct dqblk32 *)&d)->dqb_itime = i; - ((struct dqblk32 *)&d)->dqb_btime = b; - if (copy_to_user ((struct dqblk32 *)addr, &d, - sizeof (struct dqblk32))) + ((struct user_dqblk32 *)&d)->dqb_itime = i; + ((struct user_dqblk32 *)&d)->dqb_btime = b; + if (copy_to_user ((struct user_dqblk32 *)addr, &d, + sizeof (struct user_dqblk32))) return -EFAULT; } - return err; + return 0; } +#else +/* No conversion needed for new interface */ +asmlinkage int sys32_quotactl(int cmd, const char *special, int id, caddr_t addr) +{ + return sys_quotactl(cmd, special, id, addr); +} +#endif + static inline int put_statfs (struct statfs32 *ubuf, struct statfs *kbuf) { int err; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/sparc64/mm/fault.c linux.20pre5-ac2/arch/sparc64/mm/fault.c --- linux.20pre5/arch/sparc64/mm/fault.c 2002-08-29 18:39:50.000000000 +0100 +++ linux.20pre5-ac2/arch/sparc64/mm/fault.c 2002-08-06 15:42:21.000000000 +0100 @@ -346,8 +346,6 @@ if (vma->vm_start <= address) goto good_area; - if (!(vma->vm_flags & VM_GROWSDOWN)) - goto bad_area; if (!(fault_code & FAULT_CODE_WRITE)) { /* Non-faulting loads shouldn't expand stack. */ insn = get_fault_insn(regs, insn); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/arch/sparc64/solaris/timod.c linux.20pre5-ac2/arch/sparc64/solaris/timod.c --- linux.20pre5/arch/sparc64/solaris/timod.c 2002-08-29 18:39:50.000000000 +0100 +++ linux.20pre5-ac2/arch/sparc64/solaris/timod.c 2002-08-06 15:42:21.000000000 +0100 @@ -149,7 +149,9 @@ struct socket *sock; SOLD("wakeing socket"); + read_lock(¤t->files->file_lock); sock = ¤t->files->fd[fd]->f_dentry->d_inode->u.socket_i; + read_unlock(¤t->files->file_lock); wake_up_interruptible(&sock->wait); read_lock(&sock->sk->callback_lock); if (sock->fasync_list && !test_bit(SOCK_ASYNC_WAITDATA, &sock->flags)) @@ -163,7 +165,9 @@ struct sol_socket_struct *sock; SOLD("queuing primsg"); + read_lock(¤t->files->file_lock); sock = (struct sol_socket_struct *)current->files->fd[fd]->private_data; + read_unlock(¤t->files->file_lock); it->next = sock->pfirst; sock->pfirst = it; if (!sock->plast) @@ -177,7 +181,9 @@ struct sol_socket_struct *sock; SOLD("queuing primsg at end"); + read_lock(¤t->files->file_lock); sock = (struct sol_socket_struct *)current->files->fd[fd]->private_data; + read_unlock(¤t->files->file_lock); it->next = NULL; if (sock->plast) sock->plast->next = it; @@ -355,7 +361,11 @@ (int (*)(int, unsigned long *))SYS(socketcall); int (*sys_sendto)(int, void *, size_t, unsigned, struct sockaddr *, int) = (int (*)(int, void *, size_t, unsigned, struct sockaddr *, int))SYS(sendto); - filp = current->files->fd[fd]; + read_lock(¤t->files->file_lock); + filp = fcheck(fd); + read_unlock(¤t->files->file_lock); + if (!filp) + return -EBADF; ino = filp->f_dentry->d_inode; sock = (struct sol_socket_struct *)filp->private_data; SOLD("entry"); @@ -636,7 +646,11 @@ SOLD("entry"); SOLDD(("%u %p %d %p %p %d %p %d\n", fd, ctl_buf, ctl_maxlen, ctl_len, data_buf, data_maxlen, data_len, *flags_p)); - filp = current->files->fd[fd]; + read_lock(¤t->files->file_lock); + filp = fcheck(fd); + read_unlock(¤t->files->file_lock); + if (!filp) + return -EBADF; ino = filp->f_dentry->d_inode; sock = (struct sol_socket_struct *)filp->private_data; SOLDD(("%p %p\n", sock->pfirst, sock->pfirst ? sock->pfirst->next : NULL)); @@ -847,7 +861,9 @@ lock_kernel(); if(fd >= NR_OPEN) goto out; - filp = current->files->fd[fd]; + read_lock(¤t->files->file_lock); + filp = fcheck(fd); + read_unlock(¤t->files->file_lock); if(!filp) goto out; ino = filp->f_dentry->d_inode; @@ -914,7 +930,9 @@ lock_kernel(); if(fd >= NR_OPEN) goto out; - filp = current->files->fd[fd]; + read_lock(¤t->files->file_lock); + filp = fcheck(fd); + read_unlock(¤t->files->file_lock); if(!filp) goto out; ino = filp->f_dentry->d_inode; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/CREDITS linux.20pre5-ac2/CREDITS --- linux.20pre5/CREDITS 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/CREDITS 2002-08-29 18:46:44.000000000 +0100 @@ -1888,7 +1888,8 @@ E: pavel@ucw.cz E: pavel@suse.cz D: Softcursor for vga, hypertech cdrom support, vcsa bugfix, nbd -D: sun4/330 port, capabilities for elf, speedup for rm on ext2, USB +D: sun4/330 port, capabilities for elf, speedup for rm on ext2, USB, +D: x86-64 port, software suspend S: Volkova 1131 S: 198 00 Praha 9 S: Czech Republic @@ -2541,6 +2542,12 @@ S: 7000 Stuttgart 50 S: Germany +N: Andrew Rodland +E: arodland@linuxguru.net +D: That crazy morse code thing. +P: D2B1 5215 B1B9 18E0 B6AD 6ADD 4373 165F 1770 BD5C +S: Pennsylvania, USA + N: Christoph Rohland E: hans-christoph.rohland@sap.com E: ch.rohland@gmx.net diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/Configure.help linux.20pre5-ac2/Documentation/Configure.help --- linux.20pre5/Documentation/Configure.help 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/Documentation/Configure.help 2002-09-02 00:06:57.000000000 +0100 @@ -230,20 +230,6 @@ network and embedded applications. For more information see the Axis Communication site, . -Unsynced TSC support -CONFIG_X86_TSC_DISABLE - This option is used for getting Linux to run on a NUMA multi-node - boxes, laptops and other systems suffering from unsynced TSCs or - TSC drift, which can cause gettimeofday to return non-monotonic values. - Choosing this option will disable the CONFIG_X86_TSC optimization, - and allows you to then specify "notsc" as a boot option regardless of - which processor you have compiled for. - - NOTE: If your system hangs when init should run, you are probably - using a i686 compiled glibc which reads the TSC wihout checking for - avaliability. Boot without "notsc" and install a i386 compiled glibc - to solve the problem. - Multiquad support for NUMA systems CONFIG_MULTIQUAD This option is used for getting Linux to run on a (IBM/Sequent) NUMA @@ -454,8 +440,14 @@ The initial RAM disk is a RAM disk that is loaded by the boot loader (loadlin or lilo) and that is mounted as root before the normal boot procedure. It is typically used to load modules needed to mount the - "real" root file system, etc. See - for details. + "real" root file system, etc. + + Due to a problem elsewhere in the kernel, initial RAM disks _must_ + have the file system on them created with a 1024 byte block size. + If any other value is used, the kernel will be unable to mount the + RAM disk at boot time, causing a kernel panic. + + See for details. Loopback device support CONFIG_BLK_DEV_LOOP @@ -511,7 +503,7 @@ CONFIG_BLK_DEV_UMEM Saying Y here will include support for the MM5415 family of battery backed (Non-volatile) RAM cards. - http://www.umem.com/ + The cards appear as block devices that can be partitioned into as many as 15 partitions. @@ -699,6 +691,12 @@ Support for outboard IDE disks, tape drives, and CD-ROM drives connected through a PCMCIA card. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + ide-cs.o + Include IDE/ATAPI CD-ROM support CONFIG_BLK_DEV_IDECD If you have a CD-ROM drive using the ATAPI protocol, say Y. ATAPI is @@ -845,6 +843,12 @@ If both this SCSI emulation and native ATAPI support are compiled into the kernel, the native support will be used. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + ide-scsi.o + Use the NOOP Elevator (WARNING) CONFIG_BLK_DEV_ELEVATOR_NOOP If you are using a raid class top-level driver above the ATA/IDE core, @@ -1100,10 +1104,10 @@ This effect can be also invoked by calling "idex=ata66" If unsure, say N. -CMD64X and CMD680 chipset support +CMD64X/CMD680 chipset support CONFIG_BLK_DEV_CMD64X Say Y here if you have an IDE controller which uses any of these - chipsets: CMD643, CMD646, CMD648, CMD649 or CMD680. + chipsets: CMD643, CMD646, CMD648 or CMD680. CY82C693 chipset support CONFIG_BLK_DEV_CY82C693 @@ -1808,6 +1812,20 @@ want), say M here and read . The module will be called lvm-mod.o. +Device-mapper support +CONFIG_BLK_DEV_DM + Device-mapper is a low level volume manager. It works by allowing + people to specify mappings for ranges of logical sectors. Various + mapping types are available, in addition people may write their own + modules containing custom mappings if they wish. + + Higher level volume managers such as LVM2 use this driver. + + If you want to compile this as a module, say M here and read + . The module will be called dm-mod.o. + + If unsure, say N. + Multiple devices driver support (RAID and LVM) CONFIG_MD Support multiple physical spindles through a single logical device. @@ -1829,6 +1847,12 @@ . There you will also learn where to get the supporting user space utilities raidtools. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + md.o + If unsure, say N. Linear (append) mode @@ -1918,6 +1942,12 @@ transparent failover to the backup path(s) happens if a IO errors arrives on the primary path. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + multipath.o + If unsure, say N. Support for IDE Raid controllers @@ -1932,6 +1962,12 @@ has its own Raid drivers, which you should use if you need better performance. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + ataraid.o + Support Promise software RAID (Fasttrak(tm)) CONFIG_BLK_DEV_ATARAID_PDC Say Y or M if you have a Promise Fasttrak (tm) Raid controller @@ -2688,7 +2724,7 @@ Please note that you will need a recent version (>= 1.2.6a) of the iptables userspace program in order to use this feature. - See http://www.iptables.org/ for download instructions. + See for download instructions. If unsure, say 'N'. @@ -2847,7 +2883,7 @@ which can only be viewed through syslog. The appropriate userspace logging daemon (ulogd) may be obtained from - http://www.gnumonks.org/projects/ulogd + If you want to compile it as a module, say M here and read Documentation/modules.txt. If unsure, say `N'. @@ -3411,6 +3447,16 @@ a module, say M here and read . If unsure, say N. +CONFIG_SYNCLINK_CS + Enable support for the SyncLink PC Card serial adapter, running + asynchronous and HDLC communications up to 512Kbps. The port is + selectable for RS-232, V.35, RS-449, RS-530, and X.21 + + This driver may be built as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called synclinkmp.o. If you want to do that, say M + here. + ACP Modem (Mwave) support CONFIG_MWAVE The ACP modem (Mwave) for Linux is a WinModem. It is composed of a @@ -4521,14 +4567,11 @@ BIOS routines contained in a ROM chip in HP PA-RISC based machines. Enabling this option will implement the linux framebuffer device and an fbcon color text console using calls to the STI BIOS routines. - The HP framebuffer device is usually planar, uses a strange memory + The HP framebuffer device is sometimes planar, using a strange memory layout, and changing the plane mask to create colored pixels - requires a call to the STI routines, so do not expect /dev/fb to - actually be useful. However, it is the best we have as far as - graphics on the HP chipsets due to lack of hardware level - documentation for the various on-board HP chipsets used in these - systems. It is sufficient for basic text console functions, - including fonts. + can require a call to the STI routines, so /dev/fb may not actually + be useful. However, on some systems packed pixel formats are supported. + It is sufficient for basic text console functions, including fonts. You should probably enable this option, unless you are having trouble getting video when booting the kernel (make sure it isn't @@ -4666,12 +4709,11 @@ messages. Most people will want to say N here. If unsure, you will also want to say N. -Matrox unified accelerated driver CONFIG_FB_MATROX - Say Y here if you have a Matrox Millennium, Millennium II, Mystique, - Mystique 220, Productiva G100, Mystique G200, Millennium G200, - Matrox G400, G450 or G550 card in your box. At this time, support for - the G-series digital output is almost non-existant. + Say Y here if you have a Matrox Millennium, Matrox Millennium II, + Matrox Mystique, Matrox Mystique 220, Matrox Productiva G100, Matrox + Mystique G200, Matrox Millennium G200, Matrox Marvel G200 video, + Matrox G400, G450 or G550 card in your box. This driver is also available as a module ( = code which can be inserted and removed from the running kernel whenever you want). @@ -4682,7 +4724,6 @@ module load time. The parameters look like "video=matrox:XXX", and are described in . -Matrox Millennium I/II support CONFIG_FB_MATROX_MILLENIUM Say Y here if you have a Matrox Millennium or Matrox Millennium II video card. If you select "Advanced lowlevel driver options" below, @@ -4690,7 +4731,6 @@ packed pixel, 24 bpp packed pixel and 32 bpp packed pixel. You can also use font widths different from 8. -Matrox Mystique support CONFIG_FB_MATROX_MYSTIQUE Say Y here if you have a Matrox Mystique or Matrox Mystique 220 video card. If you select "Advanced lowlevel driver options" below, @@ -4698,27 +4738,46 @@ packed pixel and 32 bpp packed pixel. You can also use font widths different from 8. -Matrox G100/G200/G400/G450/G550 support -CONFIG_FB_MATROX_G100 - Say Y here if you have a Matrox G100, G200, G400, G450, or G550 - based video card. If you select "Advanced lowlevel driver options", - you should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp - packed pixel and 32 bpp packed pixel. You can also use font widths +CONFIG_FB_MATROX_G450 + Say Y here if you have a Matrox G100, G200, G400, G450 or G550 based + video card. If you select "Advanced lowlevel driver options", you + should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp packed + pixel and 32 bpp packed pixel. You can also use font widths different from 8. If you need support for G400 secondary head, you must first say Y to "I2C support" and "I2C bit-banging support" in the character devices section, and then to "Matrox I2C support" and "G400 second head - support" here in the framebuffer section. + support" here in the framebuffer section. G450/G550 secondary head + and digital output are supported without additional modules. - If you have G550, you must also compile support for G450/G550 secondary - head into kernel, otherwise picture will be shown only on the output you - are probably not using... + The driver starts in monitor mode. You must use the matroxset tool + (available at ) to + swap primary and secondary head outputs, or to change output mode. + Secondary head driver always start in 640x480 resolution and you + must use fbset to change it. - If you need support for G450 or G550 secondary head, say Y to - "Matrox G450/G550 second head support" below. + Do not forget that second head supports only 16 and 32 bpp + packed pixels, so it is a good idea to compile them into the kernel + too. You can use only some font widths, as the driver uses generic + painting procedures (the secondary head does not use acceleration + engine). + + G450/G550 hardware can display TV picture only from secondary CRTC, + and it performs no scaling, so picture must have 525 or 625 lines. + +CONFIG_FB_MATROX_G100A + Say Y here if you have a Matrox G100, G200 or G400 based + video card. If you select "Advanced lowlevel driver options", you + should check 8 bpp packed pixel, 16 bpp packed pixel, 24 bpp packed + pixel and 32 bpp packed pixel. You can also use font widths + different from 8. + + If you need support for G400 secondary head, you must first say Y to + "I2C support" and "I2C bit-banging support" in the character devices + section, and then to "Matrox I2C support" and "G400 second head + support" here in the framebuffer section. -Matrox I2C support CONFIG_FB_MATROX_I2C This drivers creates I2C buses which are needed for accessing the DDC (I2C) bus present on all Matroxes, an I2C bus which @@ -4732,7 +4791,6 @@ If you compile it as module, it will create a module named i2c-matroxfb.o. -Matrox G400 second head support CONFIG_FB_MATROX_MAVEN WARNING !!! This support does not work with G450 !!! @@ -4761,32 +4819,14 @@ painting procedures (the secondary head does not use acceleration engine). -Matrox G450 second head support -CONFIG_FB_MATROX_G450 - Say Y or M here if you want to use a secondary head (meaning two - monitors in parallel) on G450, or if you are using analog output - of G550. - - If you compile it as module, two modules are created, - matroxfb_crtc2.o and matroxfb_g450.o. Both modules are needed if you - want two independent display devices. - - The driver starts in monitor mode and currently does not support - output in TV modes. You must use the matroxset tool (available - at ) to swap - primary and secondary head outputs. Secondary head driver always - start in 640x480 resolution and you must use fbset to change it. - - Note on most G550 cards the analog output is the secondary head, - so you will need to say Y here to use it. - - Also do not forget that second head supports only 16 and 32 bpp - packed pixels, so it is a good idea to compile them into the kernel - too. You can use only some font widths, as the driver uses generic - painting procedures (the secondary head does not use acceleration - engine). - -Matrox unified driver multihead support +CONFIG_FB_MATROX_PROC + Say Y or M here if you want to access some informations about driver + state through /proc interface. + + You should download matrox_pins tool (available at + ) to get human + readable output. + CONFIG_FB_MATROX_MULTIHEAD Say Y here if you have more than one (supported) Matrox device in your computer and you want to use all of them for different monitors @@ -5150,6 +5190,12 @@ Say Y here if you need PCMCIA support for your PC-style parallel ports. If unsure, say N. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + parport_cs.o + Support foreign hardware CONFIG_PARPORT_OTHER Say Y here if you want to be able to load driver modules to support @@ -5226,6 +5272,19 @@ replacement for kerneld.) Say Y here and read about configuring it in . +Kernel .config file saved in kernel image +CONFIG_IKCONFIG + This option enables the complete Linux kernel ".config" file contents + to be saved in the kernel (zipped) image file. It provides + documentation of which kernel options are used in a running kernel or + in an on-disk kernel. It can be extracted from the kernel image file + with a script and used as input to rebuild the current kernel or to + build another kernel. Since the kernel image is zipped, using this + option adds approximately 8 KB to a kernel image file. + This option is not available as a module. If you want a separate + file to save the kernel's .config contents, use 'installkernel' or 'cp' + or a similar tool, or just save it in '/lib/modules/'. + ARP daemon support CONFIG_ARPD Normally, the kernel maintains an internal cache which maps IP @@ -5454,6 +5513,12 @@ be inserted in and removed from the running kernel whenever you want). Most people won't need this and can say N. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + ipip.o + GRE tunnels over IP CONFIG_NET_IPGRE Tunneling means encapsulating data of one protocol type within @@ -5466,6 +5531,12 @@ tunneling" above). In addition, GRE allows multicast redistribution through the tunnel. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + ip_gre.o + Broadcast GRE over IP CONFIG_NET_IPGRE_BROADCAST One application of GRE/IP is to construct a broadcast WAN (Wide Area @@ -5796,6 +5867,12 @@ This driver is experimental, which means that it may not work. See the file . + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + ltpc.o + COPS LocalTalk PC card support CONFIG_COPS This allows you to use COPS AppleTalk cards to connect to LocalTalk @@ -5805,6 +5882,12 @@ networking support, above. Please read the file . + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + cops.o + Dayna firmware support CONFIG_COPS_DAYNA Support COPS compatible cards with Dayna style firmware (Dayna @@ -6241,6 +6324,12 @@ This is a Logical Link Layer protocol used for X.25 connections over Ethernet, using ordinary Ethernet cards. +ANSI/IEEE 802.2 Data link layer User Interface SAPs (EXPERIMENTAL) +CONFIG_LLC_UI + LLC User Interface SAPs is a Linux socket interface into the LLC datalink + layer. This allows a user to create entire user space network layers tied + to a real SAP. + Frame Diverter CONFIG_NET_DIVERT The Frame Diverter allows you to divert packets from the @@ -6351,6 +6440,12 @@ the real netlink socket. This is a backward compatibility option, choose Y for now. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + netlink_dev.o + Asynchronous Transfer Mode (ATM) CONFIG_ATM ATM is a high-speed networking technology for Local Area Networks @@ -6689,6 +6784,12 @@ boards supported by this driver, and for further information on the use of this driver. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + cciss.o + SCSI tape drive support for Smart Array 5xxx CONFIG_CISS_SCSI_TAPE When enabled (Y), this option allows SCSI tape drives and SCSI medium @@ -9038,13 +9139,13 @@ Aironet 4500/4800 I365 broken support CONFIG_AIRONET4500_I365 If you have a PCMCIA Aironet 4500/4800 card which you want to use - without the standard PCMCIA cardservices provided by the pcmcia-cs + without the standard PCMCIA card provided by the pcmcia-cs package, say Y here. This is not recommended, so say N. Aironet 4500/4800 PCMCIA support CONFIG_AIRONET4500_CS Say Y here if you have a PCMCIA Aironet 4500/4800 card which you - want to use with the standard PCMCIA cardservices provided by the + want to use with the standard PCMCIA card provided by the pcmcia-cs package. This driver is also available as a module ( = code which can be @@ -9766,7 +9867,7 @@ CONFIG_NET_SCH_HTB Say Y here if you want to use the Hierarchical Token Buckets (HTB) packet scheduling algorithm for some of your network devices. See - URL http://luxik.cdi.cz/~devik/qos/htb/ for complete manual and + URL for complete manual and in-depth articles. HTB is very similar to the CBQ regarding its goals however is has @@ -10357,7 +10458,7 @@ Read linux/Documentation/networking/slicecom.txt for help on configuring and using SliceCOM interfaces. Further info on these cards - can be found at http://www.itc.hu or . + can be found at or . Support for HDLC and syncPPP protocols on MultiGate boards CONFIG_COMX_PROTO_PPP @@ -10737,6 +10838,14 @@ experience problems, you can enable this option to restore the old RX-reset behavior. If unsure, say N. +Use older RX-reset method +CONFIG_8139_OLD_RX_RESET + The 8139too driver was recently updated to contain a more rapid + reset sequence, in the face of severe receive errors. This "new" + RX-reset method should be adequate for all boards. But if you + experience problems, you can enable this option to restore the + old RX-reset behavior. If unsure, say N. + SiS 900/7016 PCI Fast Ethernet Adapter support CONFIG_SIS900 This is a driver for the Fast Ethernet PCI network cards based on @@ -12511,12 +12620,44 @@ Quota support CONFIG_QUOTA If you say Y here, you will be able to set per user limits for disk - usage (also called disk quotas). Currently, it works only for the - ext2 file system. You need additional software in order to use quota - support; for details, read the Quota mini-HOWTO, available from + usage (also called disk quotas). Currently, it works for the + ext2, ext3, and reiserfs file system. You need additional software + in order to use quota support (you can download sources from + ). For further details, read + the Quota mini-HOWTO, available from . Probably the quota support is only useful for multi user systems. If unsure, say N. +Old quota format support +CONFIG_QFMT_V1 + This quota format was (is) used by kernels earlier than 2.4.??. If + you have quota working and you don't want to convert to new quota + format say Y here. + +VFS v0 quota format support +CONFIG_QFMT_V2 + This quota format allows using quotas with 32-bit UIDs/GIDs. If you + need this functionality say Y here. Note that you will need latest + quota utilities for new quota format with this kernel. + +Compatible quota interfaces +CONFIG_QIFACE_COMPAT + This option will enable old quota interface in kernel. + If you have old quota tools (version <= 3.04) and you don't want to + upgrade them say Y here. + +Original quota interface +CONFIG_QIFACE_V1 + This is the oldest quota interface. It was used for old quota format. + If you have old quota tools and you use old quota format choose this + interface (if unsure, this interface is the best one to choose). + +VFS v0 quota interface +CONFIG_QIFACE_V2 + This quota interface was used by VFS v0 quota format. If you need + support for VFS v0 quota format (eg. you're using quota on ReiserFS) + and you don't want to upgrade quota tools, choose this interface. + Memory Technology Device (MTD) support CONFIG_MTD Memory Technology Devices are flash, RAM and similar chips, often @@ -12527,6 +12668,12 @@ them. It will also allow you to select individual drivers for particular hardware and users of MTD devices. If unsure, say N. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + mtdcore.o + MTD debugging support CONFIG_MTD_DEBUG This turns on low-level debugging for the entire MTD sub-system. @@ -12539,6 +12686,12 @@ a separate MTD device, you require this option to be enabled. If unsure, say 'Y'. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + mtdpart.o + Note, however, that you don't need this option for the DiskOnChip devices. Partitioning on NFTL 'devices' is a different - that's the 'normal' form of partitioning used on a block device. @@ -12559,6 +12712,12 @@ SA1100 map driver (CONFIG_MTD_SA1100) has an option for this, for example. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + redboot.o + Compaq bootldr partition table parsing CONFIG_MTD_BOOTLDR_PARTS The Compaq bootldr deals with multiple 'images' in flash devices @@ -12600,6 +12759,12 @@ memory chips, and also use ioctl() to obtain information about the device, or to erase parts of it. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + mtdchar.o + Caching block device access to MTD devices CONFIG_MTD_BLOCK Although most flash chips have an erase size too large to be useful @@ -12620,6 +12785,12 @@ You do not need this option for use with the DiskOnChip devices. For those, enable NFTL support (CONFIG_NFTL) instead. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + mtdblock.o + Readonly block device access to MTD devices CONFIG_MTD_BLOCK_RO This allows you to mount read-only file systems (such as cramfs) @@ -12629,6 +12800,12 @@ You do not need this option for use with the DiskOnChip devices. For those, enable NFTL support (CONFIG_NFTL) instead. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + mtdblock_ro.o + FTL (Flash Translation Layer) support CONFIG_FTL This provides support for the original Flash Translation Layer which @@ -12643,6 +12820,12 @@ permitted to copy, modify and distribute the code as you wish. Just not use it. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + ftl.o + NFTL (NAND Flash Translation Layer) support CONFIG_NFTL This provides support for the NAND Flash Translation Layer which is @@ -12657,6 +12840,12 @@ permitted to copy, modify and distribute the code as you wish. Just not use it. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + nftl.o + Write support for NFTL (EXPERIMENTAL) CONFIG_NFTL_RW If you're lucky, this will actually work. Don't whinge if it @@ -12673,6 +12862,12 @@ option. Visit for more information on CFI. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + cfi_probe.o + CFI Advanced configuration options CONFIG_MTD_CFI_ADV_OPTIONS If you need to specify a specific endianness for access to flash @@ -12765,6 +12960,12 @@ commands, including some which are not CFI-compatible and hence cannot be used with the CONFIG_MTD_CFI_INTELxxx options. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + sharp.o + AMD compatible flash chip support (non-CFI) CONFIG_MTD_AMDSTD This option enables support for flash chips using AMD-compatible @@ -12773,16 +12974,34 @@ It also works on AMD compatible chips that do conform to CFI. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + amd_flash.o + Support for RAM chips in bus mapping CONFIG_MTD_RAM This option enables basic support for RAM chips accessed through a bus mapping driver. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + map_ram.o + Support for ROM chips in bus mapping CONFIG_MTD_ROM This option enables basic support for ROM chips accessed through a bus mapping driver. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + map_rom.o + JEDEC device support CONFIG_MTD_JEDEC Enable older older JEDEC flash interface devices for self @@ -12792,6 +13011,12 @@ chips. WARNING!!!! This code does not compile and is incomplete as are the specific JEDEC devices drivers. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + jedec.o + CFI Flash device mapped on StrongARM SA11x0 CONFIG_MTD_SA1100 This enables access to the flash chips on most platforms based on @@ -12822,6 +13047,12 @@ configure the physical address and size of the flash chips on your particular board as well as the bus width. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + physmap.o + Physical start location of flash chip mapping CONFIG_MTD_PHYSMAP_START This is the physical memory location at which the flash chips @@ -12875,6 +13106,12 @@ Dual-in-line JEDEC chip. This 'mapping' driver supports that arrangement, implementing three MTD devices. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + sc520cdp.o + Flash chip mapping on Arcom Control Systems SBC-MediaGX CONFIG_MTD_SBC_GXX This provides a driver for the on-board flash of Arcom Control @@ -12972,6 +13209,12 @@ Computer. More information on the board is available at . + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + octagon-5066.o + JEDEC Flash device mapped on Tempustech VMAX SBC301 CONFIG_MTD_VMAX This provides a 'mapping' driver which supports the way in which @@ -12979,11 +13222,23 @@ Board Computer. More information on the board is available at . + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + vmax301.o + Support for NAND flash devices CONFIG_MTD_NAND This enables support for accessing all type of NAND flash devices. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + nand.o + Support for software ECC algorithm CONFIG_MTD_NAND_ECC This enables software-based ECC for use with NAND flash chips. It @@ -13009,6 +13264,12 @@ This provides an MTD device driver for the M-Systems DiskOnChip 1000 devices, which are obsolete so you probably want to say 'N'. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + doc1000.o + M-Systems Disk-On-Chip 2000 and Millennium support CONFIG_MTD_DOC2000 This provides an MTD device driver for the M-Systems DiskOnChip @@ -13024,6 +13285,12 @@ emulate a block device by using a kind of file system on the flash chips. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + doc2000.o + Alternative Disk-On-Chip Millennium support CONFIG_MTD_DOC2001 This provides an alternative MTD device driver for the M-Systems @@ -13038,6 +13305,12 @@ emulate a block device by using a kind of file system on the flash chips. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + doc2001.o + Probe for DiskOnChip devices CONFIG_MTD_DOCPROBE This isn't a real config option, it's derived. @@ -13097,6 +13370,12 @@ particularly useful on the 2.2 kernels on PPC architectures as there was limited kernel space to deal with. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + pmc551.o + PMC551 256M DRAM Bugfix CONFIG_MTD_PMC551_BUGFIX Some of Ramix's PMC551 boards with 256M configurations have invalid @@ -13115,12 +13394,24 @@ you can still use it for storage or swap by using this driver to present it to the system as a Memory Technology Device. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + slram.o + Debugging RAM test driver CONFIG_MTD_MTDRAM This enables a test MTD device driver which uses vmalloc() to provide storage. You probably want to say 'N' unless you're testing stuff. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + mtdram.o + MTDRAM erase block size in KB CONFIG_MTDRAM_ERASE_SIZE This allows you to configure the size of the erase blocks in the @@ -13163,6 +13454,12 @@ the system regardless of media presence. Device nodes created with this driver will return -ENODEV upon access. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + map_absent.o + MTD emulation using block device CONFIG_MTD_BLKMTD This driver allows a block device to appear as an MTD. It would @@ -13173,6 +13470,12 @@ Testing MTD users (eg JFFS2) on large media and media that might be removed during a write (using the floppy drive). + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + blkmtd.o + Cirrus CDB89712 evaluation board mappings CONFIG_MTD_CDB89712 This enables access to the flash or ROM chips on the CDB89712 board. @@ -13190,6 +13493,12 @@ non-CFI Intel chips (that code is in MTD CVS and should shortly be sent for inclusion in Linus' tree) + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + jedec_probe.o + BIOS flash chip on Intel L440GX boards CONFIG_MTD_L440GX Support for treating the BIOS flash chip on Intel L440GX motherboards @@ -13197,6 +13506,12 @@ BE VERY CAREFUL. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + l440gx.o + 28F160xx flash driver for LART CONFIG_MTD_LART This enables the flash driver for LART. Please note that you do @@ -14055,7 +14370,7 @@ CONFIG_USB_RTL8150 Say Y here if you have RTL8150 based usb-ethernet adapter. Send me (petkan@users.sourceforge.net) any comments you may have. - You can also check for updates at http://pegasus2.sourceforge.net/ + You can also check for updates at This code is also available as a module ( = code which can be inserted in and removed from the running kernel whenever you want). @@ -14331,6 +14646,25 @@ If unsure, say N. +CONFIG_USB_TIGL + If you own a Texas Instruments graphing calculator and use a + TI-GRAPH LINK USB cable (aka SilverLink), then you might be + interested in this driver. + + If you enable this driver, you will be able to communicate with + your calculator through a set of device nodes under /dev. + + This code is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called tiglusb.o. If you want to compile it as a + module, say M here and read Documentation/modules.txt. + + If you don't know what the SilverLink cable is or what a Texas + Instruments graphing calculator is, then you probably don't need this + driver. + + If unsure, say N. + Tieman Voyager USB Braille display support CONFIG_USB_BRLVOYAGER Say Y here if you want to use the Voyager USB Braille display from @@ -14812,6 +15146,35 @@ Because this option adds considerably to the size of each buffer, most people will want to say N here. +BeOS filesystem support (BeFS) (read only) +CONFIG_BEFS_FS + The BeOS File System (BeFS) is the native file system of Be, Inc's + BeOS. Notable features include support for arbitrary attributes + on files and directories, and database-like indices on selected + attributes. (Also note that this driver doesn't make those features + available at this time). It is a 64 bit filesystem, so it supports + extremely large volumes and files. + + If you use this filesystem, you should also say Y to at least one + of the NLS (native language support) options below. + + If you don't know what this is about, say N. + + If you want to compile this as a module ( = code which can be + inserted in and removed from the running kernel whenever you want), + say M here and read Documentation/modules.txt. The module will be + called befs.o. + +Debug BeFS +CONFIG_BEFS_DEBUG + If you say Y here, you can use the 'debug' mount option to enable + debugging output from the driver. This is unlike previous versions + of the driver, where enabling this option would turn on debugging + output automatically. + + Example: + mount -t befs /dev/hda2 /mnt -o debug + BFS file system support CONFIG_BFS_FS Boot File System (BFS) is a file system used under SCO UnixWare to @@ -15607,7 +15970,7 @@ Say Y here if you would like to use hard disks under Linux which were partitioned on a Macintosh. -Windows Logical Disk Manager (Dynamic Disk) support (EXPERIMENTAL) +Windows Logical Disk Manager (Dynamic Disk) support CONFIG_LDM_PARTITION Say Y here if you would like to use hard disks under Linux which were partitioned using Windows 2000's or XP's Logical Disk Manager. @@ -15622,8 +15985,7 @@ Normal partitions are now called Basic Disks under Windows 2000 and XP. - Technical documentation to accompany this driver is available from: - . + For a fuller description read . If unsure, say N. @@ -15696,14 +16058,9 @@ Intel EFI GUID partition support CONFIG_EFI_PARTITION Say Y here if you would like to use hard disks under Linux which - were partitioned using EFI GPT. Presently only useful on the - IA-64 platform. - -/dev/guid support (EXPERIMENTAL) -CONFIG_DEVFS_GUID - Say Y here if you would like to access disks and partitions by - their Globally Unique Identifiers (GUIDs) which will appear as - symbolic links in /dev/guid. + were partitioned using EFI GPT. This is the default partition + scheme on IA64, and can be used on other platforms when + large block device (64-bit block address) support is desired. Ultrix partition table support CONFIG_ULTRIX_PARTITION @@ -16545,17 +16902,36 @@ HIL keyboard support CONFIG_HIL The "Human Interface Loop" is a older, 8-channel USB-like controller - used in Hewlett Packard PA-RISC based machines. There are a few - cases where it is seen on PC/MAC architectures as well, usually also - manufactured by HP. This driver is based off MACH and BSD drivers, - and implements support for a keyboard attached to the HIL port. + used in several Hewlett Packard models. This driver is based off + MACH and BSD drivers, and implements support for a keyboard attached + to the HIL port, but not for any other types of HIL input devices + like mice or tablets. However, it has been thoroughly tested and is + stable. + Full support for the USB-like functions and non-keyboard channels of - the HIL is not provided for in this driver. There are vestiges of - mouse support in the driver, but it is probably not working. The - necessary hardware documentation to fully support the HIL controller - and interface it to the linux-input API is lacking. + the HIL is currently being added to the PA-RISC port and will + be backported to work on the m68k port as well. + + Enable this option if you intend to use a HIL keyboard as your + primary keyboard and/or do not wish to test the new HIL driver. - Enable this option if you intend to use a HIL keyboard. +HP System Device Controller support +CONFIG_HP_SDC + This option enables supports for the the "System Device Controller", + an i8042 carrying microcode to manage a few miscellanous devices + on some Hewlett Packard systems. The SDC itself contains a 10ms + resolution timer/clock capable of delivering interrupts on periodic + and one-shot basis. The SDC may also be connected to a battery-backed + real-time clock, a basic audio waveform generator, and an HP-HIL + Master Link Controller serving up to seven input devices. + + By itself this option is rather useless, but enabling it will + enable selection of drivers for the abovementioned devices. + It is, however, incompatible with the old, reliable HIL keyboard + driver, and the new HIL driver is experimental, so if you plan to + use a HIL keyboard as your primary keyboard, you may wish to + keep using that driver until the new HIL drivers have had more + testing. Include IOP (IIfx/Quadra 9x0) ADB driver CONFIG_ADB_IOP @@ -16865,6 +17241,19 @@ read . The module will be called istallion.o. +PDC software console support +CONFIG_PDC_CONSOLE + Saying Y here will enable the software based PDC console to be + used as the system console. This is useful for machines in + which the hardware based console has not been written yet. The + following steps must be competed to use the PDC console: + + 1. create the device entry (mknod /dev/ttyB0 c 60 0) + 2. Edit the /etc/inittab to start a getty listening on /dev/ttyB0 + 3. Add device ttyB0 to /etc/securetty (if you want to log on as + root on this console.) + 4. Change the kernel command console parameter to: console=ttyB0 + Microgate SyncLink adapter support CONFIG_SYNCLINK Provides support for the SyncLink ISA and PCI multiprotocol serial @@ -16876,6 +17265,17 @@ The module will be called synclink.o. If you want to do that, say M here. +CONFIG_SYNCLINKMP + Enable support for the SyncLink Multiport (2 or 4 ports) + serial adapter, running asynchronous and HDLC communications up + to 2.048Mbps. Each ports is independently selectable for + RS-232, V.35, RS-449, RS-530, and X.21 + + This driver may be built as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + The module will be called synclinkmp.o. If you want to do that, say M + here. + Synchronous HDLC line discipline support CONFIG_N_HDLC Allows synchronous HDLC communications with tty device drivers that @@ -17003,6 +17403,10 @@ doing that; to actually get it to happen you need to pass the option "console=lp0" to the kernel at boot time. + Note that kernel messages can get lost if the printer is out of + paper (or off, or unplugged, or too busy..), but this behaviour + can be changed. See drivers/char/lp.c (do this at your own risk). + If the printer is out of paper (or off, or unplugged, or too busy..) the kernel will stall until the printer is ready again. By defining CONSOLE_LP_STRICT to 0 (at your own risk) you @@ -17890,7 +18294,134 @@ determined automatically, so you need to specify it here ONLY if running a DEC Alpha, otherwise this setting has no effect. -Double Talk PC internal speech card support +Speakup console speech output for Linux +CONFIG_SPEAKUP + Choosing this Option will include support for console speech output. + + Speakup provides access to Linux for the visually impaired community. + It does this by sending console output to a number of different + hardware speech synthesizers. It provides access to Linux by Making + screen review functions available such as are used in comercial screen + review packages for the MSDOS and MSWINDOWS world. + + The drivers supplied under this option are not standard devices in the + /dev/ sence of the meaning. They can be thought of as a video card + for the blind. They are used by speakup and only speakup. + + For more information about speakup and its drivers check out + , or read the Documentation in + linux/Documentation/speakup. + + The currently supported synthesizers are: + Accent PC internal synthesizer. + Accent SA external Accent synthesizer. + Apollo II external synthesizer. + Audapter external synthesizer. + Braille 'N Speak external synthesizer. + Dectalk Express and external synthesizers. + DoubleTalk PC Internal synthesizer, + LiteTalk/DoubleTalk-LT external serial synthesizers, + Speakout external synthesizer, + Transport external synthesizer. + + If you do not have one of these synths, say 'N' to this option. + +Default synthesizer for Speakup +CONFIG_SPEAKUP_DEFAULT + This option specifies which synthesizer Speakup should use by + default at boot time. + Valid values are: none, acntpc, acntsa, apolo, audptr, bns, decext, + dectlk dtlk, ltlk, spkout, txprt + + You can choose an alternatively compiled-in synthesizer at boot time + by using the speakup_synth kernel command line option, + I.E. speakup_synth=dtlk. + +Use Speakup keymap by default +CONFIG_SPEAKUP_KEYMAP + If this option is enabled, then a modified US keymap which includes + Speakup's screen review commands will be used by default. + +DoubleTalk driver for speakup. +CONFIG_SPEAKUP_DTLK + The DoubleTalk synthesizer is made by RC Systems. It is an internal + ISA card which uses no interrupts. Do not confuse this driver with + the standard DoubleTalk driver included in the kernel. + + If you don't have a DoubleTalk card say 'N' here. + +LiteTalk/DoubleTalk-LT driver for speakup. +CONFIG_SPEAKUP_LTLK + This driver is for the LiteTalk synthesizer made by MicroTalk or the + DoubleTalk-LT synthesizer made by RC Systems. These are serial + drivers for those external synths. + + If you don't have a LiteTalk or DoubleTalk-LT, say 'N' here. + +Speakout driver for speakup. +CONFIG_SPEAKUP_SPKOUT + This driver is for the Speakout external serial synthesizer made by + GW Micro. + + If you don't have a Speakout, say 'N' here. + +Accent PC driver for speakup. +CONFIG_SPEAKUP_ACNTPC + This driver is for the Accent PC internal synthesizer made by Aicom + Corp. + + If you Don't have an Accent PC, say 'N' here. + +Accent SA driver for speakup. +CONFIG_SPEAKUP_ACNTSA + This driver is for the Accent SA external synthesizer made by Aicom + Corp. + + If you Don't have an Accent SA, say 'N' here. + +Apollo II driver for speakup. +CONFIG_SPEAKUP_APOLO + This driver is for the Apollo II external synthesizer made + by Dolphin Computer Access limited. + + If you Don't have an Apollo II, say 'N' here. + +Audapter Speech System driver for speakup. +CONFIG_SPEAKUP_AUDPTR + This driver is for the Audapter external synthesizer made by + Personal Data System Inc. + + If you Don't have an Audapter, say 'N' here. + +Braille 'N Speak driver for speakup. +CONFIG_SPEAKUP_BNS + This driver is for the Braille 'N Speak external synthesizer made by + Blazie Engineering. + + If you Don't have a bns, say 'N' here. + +Dectalk Express driver for speakup. +CONFIG_SPEAKUP_DECTLK + This driver is for the Dectalk Express external synthesizer made by + Digital Equipment Corp. + + If you Don't have a Dectalk Express, say 'N' here. + +Dectalk External driver for speakup. +CONFIG_SPEAKUP_DECEXT + This driver is for the older Dectalk external synthesizer made by + Digital Equipment Corp. + + If you Don't have a Dectalk external, say 'N' here. + +Transport driver for speakup. +CONFIG_SPEAKUP_TXPRT + This driver is for the Artic Transport external synthesizer made by + Artic Technologies. + + If you Don't have a Transport, say 'N' here. + +Double Talk PC internal speech card support CONFIG_DTLK This driver is for the DoubleTalk PC, a speech synthesizer manufactured by RC Systems (). It is also @@ -18426,6 +18957,12 @@ Toshiba Linux utilities web site at: . + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + toshiba.o + Say Y if you intend to run this kernel on a Toshiba portable. Say N otherwise. @@ -18442,6 +18979,12 @@ You can force loading on unsupported models by passing the parameter `force=1' to the module. Use at your own risk. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + i8k.o + For more information on this driver and for utilities that make use of the module see the I8K Linux Utilities web site at: . @@ -18477,6 +19020,12 @@ MSR accesses are directed to a specific CPU on multi-processor systems. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + msr.o + /dev/cpu/*/cpuid - CPU information support CONFIG_X86_CPUID This device gives processes access to the x86 CPUID instruction to @@ -18484,6 +19033,12 @@ with major 203 and minors 0 to 31 for /dev/cpu/0/cpuid to /dev/cpu/31/cpuid. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + cpuid.o + SBC-60XX Watchdog Timer CONFIG_60XX_WDT This driver can be used with the watchdog timer found on some @@ -19781,6 +20336,12 @@ Say Y or M if you have a sound system driven by ESS's Maestro 3 PCI sound chip. +ForteMedia FM801 driver +CONFIG_SOUND_FORTE + Say Y or M if you want driver support for the ForteMedia FM801 PCI + audio controller (Abit AU10, Genius Sound Maker, HP Workstation + zx2000, and others). + Adlib Cards CONFIG_SOUND_ADLIB Includes ASB 64 4D. Information on programming AdLib cards is @@ -22173,7 +22734,7 @@ CU824: VMEBus Board with PCI extension with MPC8240 CPU - Manufacturer: MicroSys GmbH, http://www.microsys.de/ + Manufacturer: MicroSys GmbH, Date of Release: early 2001 (?) End of life: - URL: @@ -23123,6 +23684,12 @@ supported by this driver, and for further information on the use of this driver. + This driver is also available as a module ( = code which can be + inserted in and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . The module will be called + cpqarray.o + Show crashed user process info CONFIG_PROCESS_DEBUG Say Y to print all process fault locations to the console. This is @@ -25208,6 +25775,14 @@ of the BUG call as well as the EIP and oops trace. This aids debugging but costs about 70-100K of memory. +Morse code panics +CONFIG_PANIC_MORSE + Say Y here to receive panic messages in morse code on your keyboard LEDs, and + optionally the PC speaker, if available. + The kernel param "panicblink" controls this feature, set it to 0 to disable, + 1 for LEDs only, 2 for pc speaker, or 3 for both. If you disable this option, + then you will receive a steady blink on the LEDs instead. + Include kgdb kernel debugger CONFIG_KGDB Include in-kernel hooks for kgdb, the Linux kernel source level @@ -25241,9 +25816,11 @@ U2/Uturn I/O MMU CONFIG_IOMMU_CCIO - Say Y here to enable DMA management routines for the first - generation of PA-RISC cache-coherent machines. Programs the - U2/Uturn chip in "Virtual Mode" and use the I/O MMU. + The U2/UTurn is a bus converter with io mmu present in the Cxxx, D, + J, K, and R class machines. Compiling this driver into the kernel will + not hurt anything, removing it will reduce your kernel by about 14k. + + If unsure, say Y. LBA/Elroy PCI support CONFIG_PCI_LBA @@ -25575,7 +26152,7 @@ ethernet interface does, including firewalling, bridging, and of course IP traffic. You will need the 'vconfig' tool from the VLAN project in order to effectively use VLANs. See the VLAN web page for more - information: http://www.candelatech.com/~greear/vlan.html If unsure, + information: If unsure, you can safely say 'N'. ARC console support @@ -25616,6 +26193,61 @@ written) to implement the policy. If you don't understand what this is all about, it's safe to say 'N'. + For more information, take a look at linux/Documentation/cpufreq or + at + + If in doubt, say N. + +CONFIG_X86_POWERNOW_K6 + This adds the CPUFreq driver for mobile AMD K6-2+ and mobile + AMD K6-3+ processors. + + For details, take a look at linux/Documentation/cpufreq. + + If in doubt, say N. + +CONFIG_X86_P4_CLOCKMOD + This adds the CPUFreq driver for Intel Pentium 4 / XEON + processors. + + You need to specify the processor minimum and maximum speed as + boot parameter: cpufreq=minspeed-maxspeed , with both arguments + given in kHz. + + For details, take a look at linux/Documentation/cpufreq. + + If in doubt, say N. + +CONFIG_ELAN_CPUFREQ + This adds the CPUFreq driver for AMD Elan SC400 and SC410 + processors. + + You need to specify the processor minimum and maximum speed as + boot parameter: cpufreq=minspeed-maxspeed , with both arguments + given in kHz. + + For details, take a look at linux/Documentation/cpufreq. + + If in doubt, say N. + +CONFIG_X86_LONGHAUL + This adds the CPUFreq driver for VIA Samuel/CyrixIII, + VIA Cyrix Samuel/C3, VIA Cyrix Ezra and VIA Cyrix Ezra-T + processors. + + For details, take a look at linux/Documentation/cpufreq. + + If in doubt, say N. + +CONFIG_X86_SPEEDSTEP + This adds the CPUFreq driver for certain mobile Intel Pentium III + (Coppermine), all mobile Intel Pentium III-M (Tulatin) and all + mobile Intel Pentium 4 P4-Ms. + + For details, take a look at linux/Documentation/cpufreq. + + If in doubt, say N. + SiS CONFIG_DRM_SIS Choose this option if you have a SIS graphics card. AGP support is @@ -25629,7 +26261,7 @@ Slave has its own LEDs CONFIG_ETRAX_ETHERNET_LPSLAVE_HAS_LEDS - Enable if the slave has it's own LEDs. + Enable if the slave has its own LEDs. ATA/IDE support CONFIG_ETRAX_IDE diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/cpufreq linux.20pre5-ac2/Documentation/cpufreq --- linux.20pre5/Documentation/cpufreq 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/Documentation/cpufreq 2002-09-01 13:27:38.000000000 +0100 @@ -0,0 +1,332 @@ + CPU frequency and voltage scaling code in the Linux(TM) kernel + + + L i n u x C P U F r e q + + + + + Dominik Brodowski + David Kimdon + + + + Clock scaling allows you to change the clock speed of the CPUs on the + fly. This is a nice method to save battery power, because the lower + the clock speed, the less power the CPU consumes. + + + +Contents: +--------- +1. Supported architectures +2. User interface +2.1 Sample script for command line interface +3. CPUFreq core and interfaces +3.1 General information +3.2 CPUFreq notifiers +3.3 CPUFreq architecture drivers +4. Mailing list and Links + + + +1. Supported architectures +========================== + +Some architectures detect the lowest and highest possible speed +settings, while others rely on user information on this. For the +latter, a boot parameter is required. For the former, you can specify +a boot parameter to set limits on the speed settings which may occur. +The boot parameter has the following syntax: + + cpufreq=minspeed-maxspeed + +with both minspeed and maxspeed given in kHz. To set the lower +limit to 59 MHz and the upper limit to 221 MHz, specify: + + cpufreq=59000-221000 + +Check the "Speed Limits Detection" information below on whether +the driver detects the lowest and highest allowed speed setting +automatically. + + +ARM: + ARM Integrator, SA 1100, SA1110 +-------------------------------- + Speed Limits Detection: On Integrators, the minimum speed is set + and the maximum speed has to be specified using the boot + parameter. On SA11x0s, the frequencies are fixed (59 - 287 MHz) + + +AMD Elan: + SC400, SC410 +-------------------------------- + Speed Limits Detection: Not implemented. You need to specify the + minimum and maximum frequency in the boot parameter (see above). + + +VIA Cyrix Longhaul: + VIA Samuel/CyrixIII, VIA Cyrix Samuel/C3, + VIA Cyrix Ezra, VIA Cyrix Ezra-T +-------------------------------- + Speed Limits Detection: working. No need for boot parameters. + + +Intel SpeedStep: + certain mobile Intel Pentium III (Coppermine), and all mobile + Intel Pentium III-M (Tualatin) and mobile Intel Pentium 4 P4-Ms. +-------------------------------- + Speed Limits Detection: working. No need for boot parameters. + + +P4 CPU Clock Modulation: + Intel Pentium 4 Xeon processors +-------------------------------- + Speed Limits Detection: Not implemented. You need to specify the + minimum and maximum frequency in the boot parameter (see above). + + +PowerNow! K6: + mobile AMD K6-2+ / K6-3+: +-------------------------------- + Speed Limits Detection: working. No need for boot parameters. + + + + +2. User Interface +================= + +CPUFreq uses a "sysctl" interface which is located in + /proc/sys/cpu/0/ + /proc/sys/cpu/1/ ... (SMP only) + +In these directories, you will find four files of importance for +CPUFreq: speed-max, speed-min, speed-sync and speed: + +speed shows the current CPU frequency in kHz, +speed-min the minimum supported CPU frequency, and +speed-max the maximum supported CPU frequency. +speed-sync is one if all CPUs need to run on the same clock + frequency, else zero. + +Please note that you might have to specify the speed limits as a boot +parameter depending on the architecture (see above). + + +To change the CPU frequency, "echo" the desired CPU frequency (in kHz) +to speed. For example, to set the CPU speed to the lowest/highest +allowed frequency do: + +root@notebook:# cat /proc/sys/cpu/0/speed-min > /proc/sys/cpu/0/speed +root@notebook:# cat /proc/sys/cpu/0/speed-max > /proc/sys/cpu/0/speed + + +2.1 Sample script for command line interface +********************************************** + + +Michael Ossmann has written a small command line +interface for the infinitely lazy. + +#!/bin/bash +# +# /usr/local/bin/freq +# simple command line interface to cpufreq + +[ -n "$1" ] && case "$1" in + "min" ) + # set frequency to minimum + cat /proc/sys/cpu/0/speed-min >/proc/sys/cpu/0/speed + ;; + "max" ) + # set frequency to maximum + cat /proc/sys/cpu/0/speed-max >/proc/sys/cpu/0/speed + ;; + * ) + echo "Usage: $0 [min|max]" + echo " min: set frequency to minimum and display new frequency" + echo " max: set frequency to maximum and display new frequency" + echo " no options: display current frequency" + exit 1 + ;; +esac + +# display current frequency +cat /proc/sys/cpu/0/speed +exit 0 + + + +3. CPUFreq core and interfaces +=============================== + +3.1 General information +************************* + +The CPUFreq core code is located in linux/kernel/cpufreq.c. This +cpufreq code offers a standardized interface for the CPUFreq +architecture drivers (those pieces of code that do the actual +frequency transition), as well as to "notifiers". These are device +drivers or other part of the kernel that need to be informed of +frequency changes (like timing code) or even need to force certain +speed limits (like LCD drivers on ARM architecture). Additionally, the +kernel "constant" loops_per_jiffy is updated on frequency changes +here. + + +3.2 CPUFreq notifiers +*********************** + +CPUFreq notifiers conform to the standard kernel notifier interface. +See linux/include/linux/notifier.h for details on notifiers. + +The second argument to a CPUFreq notifier is the phase of the +transition. + +The third argument, a void *pointer, points to a struct cpufreq_freqs +consisting of five values: cpu, min, max, cur and new. min and max +are the minimum and maximum frequency rates that the device can +tolerate. cur is the current/old speed. new is the new speed, but +might only be valid during the CPUFREQ_PRECHANGE or +CPUFREQ_POSTCHANGE phases. And cpu is either the number of the +affected CPU or CPUFREQ_ALL_CPUS when all CPUs are affected. + +Each CPUFreq notifier is called three times for a speed transition : + + 1. In preparation for a speed transition the kernel calls the + notifier with a phase of CPUFREQ_MINMAX in order to determine a + valid new frequency. At this point the notifier updates the min + and max values to the limits the protected device / kernel code + needs. Please note: Never update these values directly, use + cpufreq_updateminmax() instead. + + 2. Right before the transition the notifier is called with a phase + of CPUFREQ_PRECHANGE. + + 3. Right after the transition the notifier is called with a phase + of CPUFREQ_POSTCHANGE. + +For the CPUFREQ_PRECHANGE and CPUFREQ_POSTCHANGE phases the notifier +updates all internal (e.g. device driver) states which depend on the +CPU frequency. + + +3.3 CPUFreq architecture drivers +********************************** + +CPUFreq architecture drivers are the pieces of kernel code that +actually perform CPU frequency transitions. These need to be +initialized separately (separate initcalls), and may be +modularized. They interact with the CPUFreq core in the following way: + + +cpufreq_register() +------------------ +cpufreq_register registers an arch driver to the CPUFreq core. Please +note that only one arch driver may be registered at any time. -EBUSY +is returned when an arch driver is already registered. The argument to +cpufreq_register, struct cpufreq_driver *driver, is described later. + + +cpufreq_unregister() +-------------------- +cpufreq_unregister unregisters an arch driver, e.g. on module +unloading. Please note that there is no check done that this is called +from the driver which actually registered itself to the core, so +please only call this function when you are sure the arch driver got +registered correctly before. + + +struct cpufreq_driver +---------------- +On initialization, the arch driver is supposed to pass a pointer +to a struct cpufreq_driver *cpufreq_driver consistng of the following +entries: + +cpufreq_verify_t validate: This is a pointer to a function with the +following definition: + unsigned int validating_function (unsigned int cpu, + unsigned int kHz). +It is called right before a transition occurs. The proposed new +speed setting is passed as an argument in kHz; the validating code +should verify this is a valid speed setting which is currently +supported by the CPU. It shall return the closest valid CPU frequency +in kHz. + +cpufreq_setspeed_t setspeed: This is a pointer to a function with the +following definition: + void setspeed_function (unsigned int cpu, unsigned int kHz). +This function shall perform the transition to the new CPU frequency +given as argument in kHz. Note that this argument is exactly the same +as the one returned by cpufreq_verify_t validate. + +unsigned int snyc: one if all CPUs need to run on the same core frequency +all the time, or zero if asynchronous frequencies are possible. + +struct cpufreq_freqs *freq: if (sync==1) this must point to one struct +cpufreq_freqs, if (sync==0) it must point to an array of NR_CPUS struct +cpufreq_freqs. Each struct cpufreq_freq consists of the following entries: + +unsigned int freq->cur: The current CPU core frequency. Note that this +is a requirement while the next two entries are optional. + +unsigned int freq->min (optional): The minimum CPU core frequency this +CPU supports. This value may be limited further by the +cpufreq_verify_t validate function, and so this value should be the +minimum core frequency allowed "theoretically" on this system in this +configuration. + + +unsigned int freq->max (optional): The maximum CPU core frequency this +CPU supports. This value may be limited further by the +cpufreq_verify_t validate function, and so this value should be the +maximum core frequency allowed "theoretically" on this system in this +configuration. + + +Some Requirements to CPUFreq architecture drivers +------------------------------------------------- +* Only call cpufreq_register() when the ability to switch CPU + frequencies is _verified_ or can't be missing +* cpufreq_unregister() may only be called if cpufreq_register() has + been successfully(!) called before. +* kfree() the struct cpufreq_driver only after the call to + cpufreq_unregister(), except cpufreq_register() failed. +* Be aware that there is currently no error management in the + setspeed() code in the CPUFreq core. So only call yourself a + cpufreq_driver if you are really a working cpufreq_driver! + + + +4. Mailing list and Links +************************** + + +Mailing List +------------ +There is a CPU frequency changing CVS commit and general list where +you can report bugs, problems or submit patches. To post a message, +send an email to cpufreq@www.linux.org.uk, to subscribe go to +http://www.linux.org.uk/mailman/listinfo/cpufreq. Previous post to the +mailing list are available to subscribers at +http://www.linux.org.uk/mailman/private/cpufreq/. + + +Links +----- +the FTP archives: +* ftp://ftp.linux.org.uk/pub/linux/cpufreq/ + +how to access the CVS repository: +* http://cvs.arm.linux.org.uk/ + +the CPUFreq Mailing list: +* http://www.linux.org.uk/mailman/listinfo/cpufreq + +Clock and voltage scaling for the SA-1100: +* http://www.lart.tudelft.nl/projects/scaling + +CPUFreq project homepage +* http://www.brodo.de/cpufreq/ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/filesystems/ramfs.txt linux.20pre5-ac2/Documentation/filesystems/ramfs.txt --- linux.20pre5/Documentation/filesystems/ramfs.txt 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/Documentation/filesystems/ramfs.txt 2002-08-06 15:42:23.000000000 +0100 @@ -0,0 +1,47 @@ + ramfs - An automatically resizing memory based filesystem + + + Ramfs is a file system which keeps all files in RAM. It allows read + and write access. In contrast to RAM disks, which get allocated a + fixed amount of RAM, ramfs grows and shrinks to accommodate the + files it contains. + + You can mount the ramfs with: + mount -t ramfs none /mnt/wherever + + Then just create and use files. When the filesystem is unmounted, all + its contents are lost. + + NOTE! This filesystem is probably most useful not as a real + filesystem, but as an example of how virtual filesystems can be + written. + +Resource limits: + +By default a ramfs will be limited to using half of (physical) memory +for storing file contents, a bit over that when the metadata is +included. The resource usage limits of ramfs can be controlled with +the following mount options: + + maxsize=NNN + Sets the maximum allowed memory usage of the +filesystem to NNN kilobytes. This will be rounded down to a multiple +of the page size. The default is half of physical memory. NB. unlike +most of the other limits, setting this to zero does *not* mean no +limit, but will actually limit the size of the filesystem data to zero +pages. There might be a use for this in some perverse situation. + + maxfilesize=NNN + Sets the maximum size of a single file on the +filesystem to NNN kilobytes. This will be rounded down to a multiple +of the page size. If NNN=0 there is no limit. The default is no limit. + + maxdentries=NNN + Sets the maximum number of directory entries (hard +links) on the filesystem to NNN. If NNN=0 there is no limit. By +default this is set to maxsize/4. + + maxinodes=NNN + Sets the maximum number of inodes (i.e. distinct +files) on the filesystem to NNN. If NNN=0 there is no limit. The +default is no limit (but there can never be more inodes than dentries). diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/networking/khttpd.txt linux.20pre5-ac2/Documentation/networking/khttpd.txt --- linux.20pre5/Documentation/networking/khttpd.txt 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/Documentation/networking/khttpd.txt 2002-08-25 15:56:45.000000000 +0100 @@ -0,0 +1 @@ +See net/khttpd/README for documentation on khttpd, the kernel http server. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/sched-coding.txt linux.20pre5-ac2/Documentation/sched-coding.txt --- linux.20pre5/Documentation/sched-coding.txt 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/Documentation/sched-coding.txt 2002-08-06 15:42:28.000000000 +0100 @@ -0,0 +1,126 @@ + Reference for various scheduler-related methods in the O(1) scheduler + Robert Love , MontaVista Software + + +Note most of these methods are local to kernel/sched.c - this is by design. +The scheduler is meant to be self-contained and abstracted away. This document +is primarily for understanding the scheduler, not interfacing to it. Some of +the discussed interfaces, however, are general process/scheduling methods. +They are typically defined in include/linux/sched.h. + + +Main Scheduling Methods +----------------------- + +void load_balance(runqueue_t *this_rq, int idle) + Attempts to pull tasks from one cpu to another to balance cpu usage, + if needed. This method is called explicitly if the runqueues are + inbalanced or periodically by the timer tick. Prior to calling, + the current runqueue must be locked and interrupts disabled. + +void schedule() + The main scheduling function. Upon return, the highest priority + process will be active. + + +Locking +------- + +Each runqueue has its own lock, rq->lock. When multiple runqueues need +to be locked, lock acquires must be ordered by ascending &runqueue value. + +A specific runqueue is locked via + + task_rq_lock(task_t pid, unsigned long *flags) + +which disables preemption, disables interrupts, and locks the runqueue pid is +running on. Likewise, + + task_rq_unlock(task_t pid, unsigned long *flags) + +unlocks the runqueue pid is running on, restores interrupts to their previous +state, and reenables preemption. + +The routines + + double_rq_lock(runqueue_t *rq1, runqueue_t *rq2) + +and + + double_rq_unlock(runqueue_t *rq1, runqueue_t rq2) + +safely lock and unlock, respectively, the two specified runqueues. They do +not, however, disable and restore interrupts. Users are required to do so +manually before and after calls. + + +Values +------ + +MAX_PRIO + The maximum priority of the system, stored in the task as task->prio. + Lower priorities are higher. Normal (non-RT) priorities range from + MAX_RT_PRIO to (MAX_PRIO - 1). +MAX_RT_PRIO + The maximum real-time priority of the system. Valid RT priorities + range from 0 to (MAX_RT_PRIO - 1). +MAX_USER_RT_PRIO + The maximum real-time priority that is exported to user-space. Should + always be equal to or less than MAX_RT_PRIO. Setting it less allows + kernel threads to have higher priorities than any user-space task. +MIN_TIMESLICE +MAX_TIMESLICE + Respectively, the minimum and maximum timeslices (quanta) of a process. + +Data +---- + +struct runqueue + The main per-CPU runqueue data structure. +struct task_struct + The main per-process data structure. + + +General Methods +--------------- + +cpu_rq(cpu) + Returns the runqueue of the specified cpu. +this_rq() + Returns the runqueue of the current cpu. +task_rq(pid) + Returns the runqueue which holds the specified pid. +cpu_curr(cpu) + Returns the task currently running on the given cpu. +rt_task(pid) + Returns true if pid is real-time, false if not. + + +Process Control Methods +----------------------- + +void set_user_nice(task_t *p, long nice) + Sets the "nice" value of task p to the given value. +int setscheduler(pid_t pid, int policy, struct sched_param *param) + Sets the scheduling policy and parameters for the given pid. +void set_cpus_allowed(task_t *p, unsigned long new_mask) + Sets a given task's CPU affinity and migrates it to a proper cpu. + Callers must have a valid reference to the task and assure the + task not exit prematurely. No locks can be held during the call. +set_task_state(tsk, state_value) + Sets the given task's state to the given value. +set_current_state(state_value) + Sets the current task's state to the given value. +void set_tsk_need_resched(struct task_struct *tsk) + Sets need_resched in the given task. +void clear_tsk_need_resched(struct task_struct *tsk) + Clears need_resched in the given task. +void set_need_resched() + Sets need_resched in the current task. +void clear_need_resched() + Clears need_resched in the current task. +int need_resched() + Returns true if need_resched is set in the current task, false + otherwise. +yield() + Place the current process at the end of the runqueue and call schedule. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/sched-design.txt linux.20pre5-ac2/Documentation/sched-design.txt --- linux.20pre5/Documentation/sched-design.txt 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/Documentation/sched-design.txt 2002-08-06 15:42:28.000000000 +0100 @@ -0,0 +1,165 @@ + Goals, Design and Implementation of the + new ultra-scalable O(1) scheduler + + + This is an edited version of an email Ingo Molnar sent to + lkml on 4 Jan 2002. It describes the goals, design, and + implementation of Ingo's new ultra-scalable O(1) scheduler. + Last Updated: 18 April 2002. + + +Goal +==== + +The main goal of the new scheduler is to keep all the good things we know +and love about the current Linux scheduler: + + - good interactive performance even during high load: if the user + types or clicks then the system must react instantly and must execute + the user tasks smoothly, even during considerable background load. + + - good scheduling/wakeup performance with 1-2 runnable processes. + + - fairness: no process should stay without any timeslice for any + unreasonable amount of time. No process should get an unjustly high + amount of CPU time. + + - priorities: less important tasks can be started with lower priority, + more important tasks with higher priority. + + - SMP efficiency: no CPU should stay idle if there is work to do. + + - SMP affinity: processes which run on one CPU should stay affine to + that CPU. Processes should not bounce between CPUs too frequently. + + - plus additional scheduler features: RT scheduling, CPU binding. + +and the goal is also to add a few new things: + + - fully O(1) scheduling. Are you tired of the recalculation loop + blowing the L1 cache away every now and then? Do you think the goodness + loop is taking a bit too long to finish if there are lots of runnable + processes? This new scheduler takes no prisoners: wakeup(), schedule(), + the timer interrupt are all O(1) algorithms. There is no recalculation + loop. There is no goodness loop either. + + - 'perfect' SMP scalability. With the new scheduler there is no 'big' + runqueue_lock anymore - it's all per-CPU runqueues and locks - two + tasks on two separate CPUs can wake up, schedule and context-switch + completely in parallel, without any interlocking. All + scheduling-relevant data is structured for maximum scalability. + + - better SMP affinity. The old scheduler has a particular weakness that + causes the random bouncing of tasks between CPUs if/when higher + priority/interactive tasks, this was observed and reported by many + people. The reason is that the timeslice recalculation loop first needs + every currently running task to consume its timeslice. But when this + happens on eg. an 8-way system, then this property starves an + increasing number of CPUs from executing any process. Once the last + task that has a timeslice left has finished using up that timeslice, + the recalculation loop is triggered and other CPUs can start executing + tasks again - after having idled around for a number of timer ticks. + The more CPUs, the worse this effect. + + Furthermore, this same effect causes the bouncing effect as well: + whenever there is such a 'timeslice squeeze' of the global runqueue, + idle processors start executing tasks which are not affine to that CPU. + (because the affine tasks have finished off their timeslices already.) + + The new scheduler solves this problem by distributing timeslices on a + per-CPU basis, without having any global synchronization or + recalculation. + + - batch scheduling. A significant proportion of computing-intensive tasks + benefit from batch-scheduling, where timeslices are long and processes + are roundrobin scheduled. The new scheduler does such batch-scheduling + of the lowest priority tasks - so nice +19 jobs will get + 'batch-scheduled' automatically. With this scheduler, nice +19 jobs are + in essence SCHED_IDLE, from an interactiveness point of view. + + - handle extreme loads more smoothly, without breakdown and scheduling + storms. + + - O(1) RT scheduling. For those RT folks who are paranoid about the + O(nr_running) property of the goodness loop and the recalculation loop. + + - run fork()ed children before the parent. Andrea has pointed out the + advantages of this a few months ago, but patches for this feature + do not work with the old scheduler as well as they should, + because idle processes often steal the new child before the fork()ing + CPU gets to execute it. + + +Design +====== + +the core of the new scheduler are the following mechanizms: + + - *two*, priority-ordered 'priority arrays' per CPU. There is an 'active' + array and an 'expired' array. The active array contains all tasks that + are affine to this CPU and have timeslices left. The expired array + contains all tasks which have used up their timeslices - but this array + is kept sorted as well. The active and expired array is not accessed + directly, it's accessed through two pointers in the per-CPU runqueue + structure. If all active tasks are used up then we 'switch' the two + pointers and from now on the ready-to-go (former-) expired array is the + active array - and the empty active array serves as the new collector + for expired tasks. + + - there is a 64-bit bitmap cache for array indices. Finding the highest + priority task is thus a matter of two x86 BSFL bit-search instructions. + +the split-array solution enables us to have an arbitrary number of active +and expired tasks, and the recalculation of timeslices can be done +immediately when the timeslice expires. Because the arrays are always +access through the pointers in the runqueue, switching the two arrays can +be done very quickly. + +this is a hybride priority-list approach coupled with roundrobin +scheduling and the array-switch method of distributing timeslices. + + - there is a per-task 'load estimator'. + +one of the toughest things to get right is good interactive feel during +heavy system load. While playing with various scheduler variants i found +that the best interactive feel is achieved not by 'boosting' interactive +tasks, but by 'punishing' tasks that want to use more CPU time than there +is available. This method is also much easier to do in an O(1) fashion. + +to establish the actual 'load' the task contributes to the system, a +complex-looking but pretty accurate method is used: there is a 4-entry +'history' ringbuffer of the task's activities during the last 4 seconds. +This ringbuffer is operated without much overhead. The entries tell the +scheduler a pretty accurate load-history of the task: has it used up more +CPU time or less during the past N seconds. [the size '4' and the interval +of 4x 1 seconds was found by lots of experimentation - this part is +flexible and can be changed in both directions.] + +the penalty a task gets for generating more load than the CPU can handle +is a priority decrease - there is a maximum amount to this penalty +relative to their static priority, so even fully CPU-bound tasks will +observe each other's priorities, and will share the CPU accordingly. + +the SMP load-balancer can be extended/switched with additional parallel +computing and cache hierarchy concepts: NUMA scheduling, multi-core CPUs +can be supported easily by changing the load-balancer. Right now it's +tuned for my SMP systems. + +i skipped the prev->mm == next->mm advantage - no workload i know of shows +any sensitivity to this. It can be added back by sacrificing O(1) +schedule() [the current and one-lower priority list can be searched for a +that->mm == current->mm condition], but costs a fair number of cycles +during a number of important workloads, so i wanted to avoid this as much +as possible. + +- the SMP idle-task startup code was still racy and the new scheduler +triggered this. So i streamlined the idle-setup code a bit. We do not call +into schedule() before all processors have started up fully and all idle +threads are in place. + +- the patch also cleans up a number of aspects of sched.c - moves code +into other areas of the kernel where it's appropriate, and simplifies +certain code paths and data constructs. As a result, the new scheduler's +code is smaller than the old one. + + Ingo diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/sound/forte linux.20pre5-ac2/Documentation/sound/forte --- linux.20pre5/Documentation/sound/forte 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/Documentation/sound/forte 2002-08-23 01:07:36.000000000 +0100 @@ -0,0 +1,41 @@ + + forte - an OSS/Lite driver for FortéMedia FM801 sound chips + =========================================================== + +This is a driver for cards using the FortéMedia FM801 audio +controller. The Genius Sound Maker Live card and the onboard audio in +HP Workstation zx2000 has been tested. + +Both IA-32 and IA-64 architectures are supported, but the driver +should work on any platform. + +The FM801 controller supports a variety of AC'97 codecs. This driver +lets the OSS core code figure the codec out, and should thus support +any codec with support in the Linux kernel. + +The driver supports /dev/mixer and /dev/dsp for generic OSS audio +support. In general it adheres to the OSS spec to the extent it can +be done with the way the hardware works. The FM801 controller doesn't +support scatter-gather, so if the application sets fragment size too +low, it puts strict requirements on interrupt processing speed. The +driver tries to compensate by enforcing bigger buffers than requested +by the application if the fragment size is low. + +The forte driver includes both standard read()/write() and the +unsupported mmap() interface used by Quake. mmap() is only supported +in playback mode. + +U8 and S16 audio formats are supported, mono/stereo, as well as most +all sample rates implemented by the chip. Default is 48 KHz, 16-bit, +mono. + +MIDI, FM audio, and the gameport controller are not currently +supported. + + +The latest version of this driver can be found at: + + http://mkp.net/forte/ + + +Martin K. Petersen, July 2002 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/speakup/DefaultKeyAssignments linux.20pre5-ac2/Documentation/speakup/DefaultKeyAssignments --- linux.20pre5/Documentation/speakup/DefaultKeyAssignments 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/Documentation/speakup/DefaultKeyAssignments 2002-08-06 15:42:28.000000000 +0100 @@ -0,0 +1,45 @@ +This file is intended to give you an overview of the default keys used +by speakup for it's review functions. You may change them to be +anything you want but that will take some familiarity with key +mapping. + +We have remapped the insert or zero key on the keypad to act as a +shift key. Well, actually as an altgr key. So in the following list +InsKeyPad-period means hold down the insert key like a shift key and +hit the keypad period. + +KeyPad-8 Say current Line +InsKeyPad-8 say from top of screen to reading cursor. +KeyPad-7 Say Previous Line (UP one line) +KeyPad-9 Say Next Line (down one line) +KeyPad-5 Say Current Word +InsKeyPad-5 Spell Current Word +KeyPad-4 Say Previous Word (left one word) +InsKeyPad-4 say from left edge of line to reading cursor. +KeyPad-6 Say Next Word (right one word) +InsKeyPad-6 Say from reading cursor to right edge of line. +KeyPad-2 Say Current Letter +InsKeyPad-2 say current letter phonetically +KeyPad-1 Say Previous Character (left one letter) +KeyPad-3 Say Next Character (right one letter) +KeyPad-plus Say Entire Screen +InsKeyPad-plus Say from reading cursor line to bottom of screen. +KeyPad-Minus Park reading cursor (toggle) +InsKeyPad-minus Say character hex and decimal value. +KeyPad-period Say Position (current line, position and console) +InsKeyPad-period say colour attributes of current position. +InsKeyPad-9 Move reading cursor to top of screen (insert pgup) +InsKeyPad-3 Move reading cursor to bottom of screen (insert pgdn) +InsKeyPad-7 Move reading cursor to left edge of screen (insert home) +InsKeyPad-1 Move reading cursor to right edge of screen (insert end) +KeyPad-Enter Shut Up (until another key is hit) and sync reading cursor +InsKeyPad-Enter Shut Up (until toggled back on) and sync cursors +InsKeyPad-star n go to line (y) or column (x). Where 'n' is any + allowed value for the row or column for your current screen. +KeyPad-/ Mark and Cut screen region. +InsKeyPad-/ Paste screen region into any console. + +Hitting any key while speakup is outputting speech will quiet the +synth until it has caught up with what is being printed on the +console. + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/speakup/INSTALLATION linux.20pre5-ac2/Documentation/speakup/INSTALLATION --- linux.20pre5/Documentation/speakup/INSTALLATION 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/Documentation/speakup/INSTALLATION 2002-08-06 15:42:28.000000000 +0100 @@ -0,0 +1,108 @@ +This document assumes you have had some experience with kernel +compilation and installation. If you have not, I recommend you get +the kernel source and read the README and various documents in the +linux/Documentation directory. In particular the Changes file to make +sure you have the appropriate utilities needed for installing a 2.2.xx +or 2.4xx kernel. It isn't as difficult as you might think. The +kernel README is intimidating the first time but once you get the +steps down, it's really pretty easy. Getting through the "make +config" is the tedious bit. + +The first thing to do is to place a copy of the tarball in the /usr/src +directory which is the directory the linux tree is located in as well. +Next untar speakup by typing: + +tar zxf speakup-1.00.tar.gz +cd speakup-1.00 +./install + +Note the dot-slash before the install. This will copy the speakup +directory to the kernel tree and apply the various patches and +components to the appropriate kernel files. Depending on how +experienced you are with kernel compiling and hacking will determine +whether you should bother looking at any failed patches. If this +happens, you should probably write to the speakup mailing list for +help or myself. + +If all of the patch hunks apply successfully then just continue with +the standard steps to compile the kernel with: + +make mrproper +make config + +When you get to the section console speech output, answer 'y' to the +CONFIG_SPEAKUP prompt. You will be given a submenu with the list of +synthesizers which are currently supported. You can include as many +synths in the kernel as you wish but remember each one takes up kernel +space. You can only choose one of the synths as the default or none, +so just type dtlk or whatever is the correct string for the +synthesizer you have. You will also be asked if you wish to build-in +a speakup key map. If you do not say 'y' to this option you will need +to load a speakup map at boot time with whichever mechanism your +distribution uses for loading key maps. + +We have placed the speakup configuration options in make config just +after the vga console choice. For the DoubleTalk PC driver included +by Jim Van Zandt. I recommend you say no to that option. I have not +tried configuring them both in, but I wouldn't be at all surprised if +it didn't work. + +If all goes well up to this point you can continue with the compiling +process by doing: + +make dep >dep.file 2>&1 & +make bzImage >cc.file 2>&1 & +make modules >mod.file 2>&1 & + +I always redirect output to the files dep.file and cc.file so I can +look over the compilation record to make sure there are no errors and +warnings. + +Okay, you are ready to install the newly compiled kernel. Make sure +you make an linux.old entry in your lilo.conf file so you can recover +if it blows up. next as root run "make modules_install" to install +whatever modules you compiled and move the bzImage from +/usr/src/linux/arch/i386/boot to wherever your kernel lives. Also +move the System.map from /usr/src/linux to where your System.map +lives. On our systems we use debian so we create an vmlinuz-speakup +and System.map-speakup in our /boot directory and set the symbolic +links vmlinuz and System.map in the root (/) directory to point to the +images. Now type lilo to tell lilo to build the new booter file and +install it. + +As of version 0.07, the keymap for speakup is automatically built in +at compile time. If you have other keymaps installed at boot time, +you might want to consider removing them before you reboot the system. + +If everything has gone OK up until now, cross your fingers and type: + +shutdown -r now + +Your system should start talking to you as soon as it starts booting. +It will talk and talk and ... well, you might want to hit the +keypad-enter key to tell it to shut up. You should also read the +DefaultKeyAssignments file to learn the various review functions +available. + +As of v-0.10 the speakup configuration options are in the +/proc/speakup subtree. The individual options should be fairly +obvious by their names such as rate, volume, punc_level and so forth. +You can manipulate them by cat'ing or echoing new values to them such +as: + +echo 9 >/proc/speakup/rate + +You can see what the current values are by cat'ing those files to the console: + +cat /proc/speakup/rate + +I have probably managed to overlook a whole whack of things because +this is the, enter version number here, draft. Don't worry we'll get +it right eventually. If you like the package you really should get on +the mailing list and start participating in it's development. + + Kirk + +email: kirk@braille.uwo.ca +phone: (519) 679-6845 (home) + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/speakup/keymap-tutorial linux.20pre5-ac2/Documentation/speakup/keymap-tutorial --- linux.20pre5/Documentation/speakup/keymap-tutorial 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/Documentation/speakup/keymap-tutorial 2002-08-06 15:42:28.000000000 +0100 @@ -0,0 +1,140 @@ + Speakup Keymap Tutorial + +This is meant to be a basic tutorial on how to change the Linux keymap +file to assign speakup review functions to desired keys. It is not +intended to be a replacement for the loadkeys(8) or keymap(5) man +pages. + +The basic lay-out of the keymap file is a series of lines with the +following fields. The keyword keycode indicates this is the start of +a new key assignment. It is then followed by a number which +represents the actual key on the keyboard. That number is followed by +the equals '=' operator and finally a list of keywords representing +key names such as keypad5. Each line can have quite a few key +functions on it. They are interpreted by loadkeys in order and +assigned to key shift states depending on the order they are +encountered. So for example, the first value after the equals is the +keys unshifted state, while the second is the keys shifted state. If +you wish to learn the order they are interpreted in read the +loadkeys(8) and keymap(5) man pages. + +You can have subsequent lines which are indented and start with +another keyword for the various shifted states. This way you can +assign some of the states without having to specify them all in order +up until you get to the one you want to assign. + +In speakup, we have assigned the insert key on the number pad to the +altgr keyword. This is not required; you could choose any other +shifted state keyword. We used altgr because it typically represents +the right hand alt key. In Linux each shift key is separate and +independent, so the left shift and the right shift keys are not +necessarily the same. The altgr key is not really used for anything +important, so we steel it. + +Here are the default key assignments for the number eight on the +keypad: + +keycode 72 = KP_8 + alt keycode 72 = Ascii_8 + +As you can see, the first line starts with keycode followed by 72 +which is the actual number assigned to the key when the keyboard port +is read. The KP_8 after the equal sign, is the symbolic representation +of the function called when that key is hit. + +The second line is the same format except it starts with the keyword +alt which is indented. That means that the function at the end of +that line Ascii_8 is applied to the alt-shifted eight key. + +Now here are the speakup assignments for that key: + +keycode 72 = 0x0d0a + altgr keycode 72 = 0x0d20 +#keycode 72 = KP_8 + alt keycode 72 = Ascii_8 + +Notice that the only thing which has changed on the first line is the +function called when the key is struck. It is a hexadecimal number +identifying the function called in a look up table. It is not a +symbolic representation yet because that means we need to change the +loadkeys program to understand our symbolic names. We will do this in +the future but for now it is more expedient to just use the table +indices. You will find a table at the bottom of this document +listing the review functions and their corresponding hex lookups. + +The 0x0d0a in the first line above is speakup's say line function. +The second line ends with 0x0d20 which is speakup's read from top of +screen to reading cursor line. + +The third line is the original key assignment commented out with a +number-sign '#' at the beginning. I do that so I can easily find the +keys I want to affect by symbolic name. Otherwise I would need to +keep a look up table for all the keycodes. I recommend you do this as +well or you'll be very sorry at some point in the future. + +The forth line is just the standard key assignment for the left hand +alt key. + +Now let's say we want to design a different keyboard layout. I'll use +an example for the JAWS style keypad because I've specifically been +asked to help with that. JAWS uses the eight on the keypad to move up +a line or the speakup function to read previous line. JAWS also uses +the keypad_8 key in a shifted mode to read the current line. I +apologize if these are not quite right. It has been a long time since +I used JAWS. So we would have the following two lines: + +keycode 72 = 0x0d0b + altgr keycode 72 = 0x0d0a + +The hex value 0x0d0b in the first line is speakup's SAY_PREVIOUS_LINE +function. The 0x0d0a in the second line is the same say_line function +as we had earlier. So when the number eight is hit on the keypad +speakup will read the previous line and when the number eight is +shifted with the insert key on the keypad it will read the current +line. + +As you can tell, it is not really very difficult to reassign the keys +to different review functions. + +Once you have carefully edited the keymap file, called default.map in +the speakup distribution, you copy it into the /etc/kbd directory. +Make sure you back up the original default.map from that directory +first, if there is one. Then you run loadkeys to load the new map +into the kernel: + +loadkeys /etc/kbd/default.map + +If you wish to build your new keyboard lay-out into the kernel, after +testing it, copy the default.map file into the drivers/char directory, +with the name defkeymap.map, of your Linux source tree. Then rm the +defkeymap.c file and recompile the kernel. Because there is no +defkeymap.c `make' will rebuild it on the next compile. + +Here is a list of the available speakup review functions at this point +in time. + +SAY_CHAR 0x0d04 /* say this character */ +SAY_PREV_CHAR 0x0d05 /* say character left of this char */ +SAY_NEXT_CHAR 0x0d06 /* say char right of this char */ +SAY_WORD 0x0d07 /* say this word under reading cursor */ +SAY_PREV_WORD 0x0d08 +SAY_NEXT_WORD 0x0d09 +SAY_LINE 0x0d0a /* say this line */ +SAY_PREV_LINE 0x0d0b /* say line above this line */ +SAY_NEXT_LINE 0x0d0c +TOP_EDGE 0x0d0d /* move to top edge of screen */ +BOTTOM_EDGE 0x0d0e +LEFT_EDGE 0x0d0f +RIGHT_EDGE 0x0d10 +SAY_PHONETIC_CHAR 0x0d11 /* say this character phonetically */ +SPELL_WORD 0x0d12 /* spell this word letter by letter */ +SAY_SCREEN 0x0d14 +SAY_POSITION 0x0d1b +SPEECH_OFF 0x0d1c +SAY_ATTRIBUTES 0x0d1d +SPEAKUP_PARKED 0x0d1e +SAY_FROM_TOP 0x0d20 +SAY_TO_BOTTOM 0x0d21 +SAY_FROM_LEFT 0x0d22 +SAY_TO_RIGHT 0x0d23 + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/speakup/README linux.20pre5-ac2/Documentation/speakup/README --- linux.20pre5/Documentation/speakup/README 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/Documentation/speakup/README 2002-08-06 15:42:28.000000000 +0100 @@ -0,0 +1,98 @@ +Welcome to the speakup project for the Speakup speech package for Linux. + +Speakup is written by Kirk Reiser and Andy Berdan. It is licensed +under the GPL. If you don't already know, the GPL stands for the GNU +General Public License. Which basically states that this code is free to +copy, modify and distribute to anyone interested in playing with it. +The one thing you may not do is turn any part of it into proprietary +or commercial code without the permission of the author. That's me. + +If you are interested in being involved with the development of speech +output for Linux you can subscribe to the Speakup mailing list by +sending a message to speakup-request@braille.uwo.ca with the line: subscribe. You can also subscribe by going to the speakup web page and following the links at http://www.linux-speakup.org. + +We are at a very early stage in the development of this package. +Hopefully changes will happen often and many. The current files in +this directory are: + +DefaultKeyAssignments # speakup's default review keys +INSTALLATION # for installing speakup from the tar ball. +README # this file +keymap-tutorial # a tutorial on how to layout the keyboard + +Read the INSTALLATION file to learn how to apply the patches and the +default.map for the keyboard. You should also read the Changes file. +It really has any new things I've added since last time. + +There is no documentation in any of these files to instruct you what +to do if something goes wrong with the patching or compilation. If +you would like that information you will need to subscribe to the +mailing list and ask for help, or write me kirk@braille.uwo.ca for +help. I suggest the mailing list because I will probably tire quickly +of answering the same questions over and over. You could always +decide to dig-in and take on the task, and write documentation to help +others. + +There also is a speakup reflector for the Speak Freely package, which +many of us hang out on and discuss all sorts of topics from speakup +problems to ALSA driver installation and just about anything else +you'd like to talk about. The reflector is at lwl.braille.uwo.ca:4074 +with it's lwl page at lwl.braille.uwo.ca/speakup.html. Come and join +us, it's fun! + +Acknowledgements: + +I am really very new at kernel hacking and screen review package +writing, so I have depended heavily on other folks kindness to help me +a long. No doubt I will continue to abuse them freely and others +before this is a really good speech solution for Linux. (Oh Well!, +somebody's got to do it.) + +Theodore Ts'o. He gave me a good discussion of unicode and UTF and +the like. He doesn't even remember writing me about it. + +Alan Cox. He has answered many questions about scheduling and wait +queues and timers along with code fragments and so on. I just wish I +understood it all totally. He has also helped immensely in moving +this package toward inclusion in the standard kernel tree. (Maybe next +release!) + +Martin Mares. He pointed me in the right direction to figuring out +the colour attributes and other useful tidbits. + +Paul McDermott. He really is the catalyst for me to actually get +this all working. Besides I like seeing him bounce around and get all +excited every time I have something new working. + +John Covici, He was the first person to actually attempt writing +another synthesizer driver for speakup. It was the Speakout driver so +it was also the first serial driver. + +Brian Borowski, he was the first person to actually write a speakup +function other than Andy and I. + +Jim Danley, he has more or less become my main man in helping test +code, add new features, bounce ideas off and generally become a good +friend. + +Matt Campbell, he basically rewrote the drivers to be able to include +all synths in the kernel at the same time. The distribution +maintainers appreciate him a lot as well. + +Gene Collins, he was very helpful debugging the current release prior +to its public showing. He has also worked hard educating others on +the list and writing the ALSA mini howto. + +I would also like to really thank the folks that handle the +distribution packages. I and many other people would not find access +to speakup nearly so convenient without their efforts. They include +Bill Acker, Tom Moore, Matt Campbell, Joe Norton and Joshua Lambert. + +There are probably many more I am forgetting right now. I guess I'll +just have to add you all later. + + +Happy Hacking! + + Kirk + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/video4linux/README.cpia linux.20pre5-ac2/Documentation/video4linux/README.cpia --- linux.20pre5/Documentation/video4linux/README.cpia 2002-08-29 18:39:52.000000000 +0100 +++ linux.20pre5-ac2/Documentation/video4linux/README.cpia 2002-08-06 15:42:28.000000000 +0100 @@ -1,8 +1,18 @@ -This is a driver for the CPiA PPC2 driven parallel connected -Camera. For example the Creative WebcamII is CPiA driven. +This is a driver for the CPiA PPC2 driven parallel connected or USB +Camera. For example the Creative WebcamII is CPiA driven. Also +various USB cameras, and the Intel Play QX3 microscope. ) [1]Peter Pregler, Linz 2000, published under the [2]GNU GPL + +NOTE ADDED (2002/05/23): +An improved version of the driver (cpia.c, cpia.h, cpia_usb.c, cpia_pp.c) +with extra features not yet integrated into the Official Linux Kernel versions +is available from http://sourceforge.net/projects/webcam as +cpia-2.2.1.tgz. This is a drop-in replacement for the driver in the kernel +sources, at least up to 2.4.18 kernels. The driver at sourceforge has been +stable for over a year, and is currently in low maintenance mode +(tracking kernel changes only). --------------------------------------------------------------------------- USAGE: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/Documentation/vm/overcommit-accounting linux.20pre5-ac2/Documentation/vm/overcommit-accounting --- linux.20pre5/Documentation/vm/overcommit-accounting 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/Documentation/vm/overcommit-accounting 2002-08-06 15:42:27.000000000 +0100 @@ -0,0 +1,73 @@ +* This describes the overcommit management facility in the latest kernel + tree (FIXME: actually it also describes the stuff that isnt yet done) + +The Linux kernel supports four overcommit handling modes + +0 - Heuristic overcommit handling. Obvious overcommits of + address space are refused. Used for a typical system. It + ensures a seriously wild allocation fails while allowing + overcommit to reduce swap usage + +1 - No overcommit handling. Appropriate for some scientific + applications + +2 - (NEW) strict overcommit. The total address space commit + for the system is not permitted to exceed swap + half ram. + In almost all situations this means a process will not be + killed while accessing pages but only by malloc failures + that are reported back by the kernel mmap/brk code. + +3 - (NEW) paranoid overcommit The total address space commit + for the system is not permitted to exceed swap. The machine + will never kill a process accessing pages it has mapped + except due to a bug (ie report it!) + +Gotchas +------- + +The C language stack growth does an implicit mremap. If you want absolute +guarantees and run close to the edge you MUST mmap your stack for the +largest size you think you will need. For typical stack usage is does +not matter much but its a corner case if you really really care + +In modes 2 and 3 the MAP_NORESERVE flag is ignored. + + +How It Works +------------ + +The overcommit is based on the following rules + +For a file backed map + SHARED or READ only - 0 cost (the file is the map not swap) + + WRITABLE SHARED - size of mapping per instance + +For a direct map + SHARED or READ only - size of mapping + PRIVATE WRITEABLE - size of mapping per instance + +Additional accounting + Pages made writable copies by mmap + shmfs memory drawn from the same pool + +Status +------ + +o We account mmap memory mappings +o We account mprotect changes in commit +o We account mremap changes in size +o We account brk +o We account munmap +o We report the commit status in /proc +o Account and check on fork +o Review stack handling/building on exec +o SHMfs accounting +o Implement actual limit enforcement + +To Do +----- +o Account ptrace pages (this is hard) +o Disable MAP_NORESERVE in mode 2/3 +o Account for shared anonymous mappings properly + - right now we account them per instance diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/acorn/block/fd1772.c linux.20pre5-ac2/drivers/acorn/block/fd1772.c --- linux.20pre5/drivers/acorn/block/fd1772.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/acorn/block/fd1772.c 2002-08-25 15:54:13.000000000 +0100 @@ -1567,6 +1567,7 @@ int fd1772_init(void) { + int err; int i; if (!machine_is_archimedes()) @@ -1584,24 +1585,28 @@ if (request_dma(FIQ_FD1772, "fd1772 end")) { printk("Unable to grab DMA%d for the floppy (1772) driver\n", FIQ_FD1772); - free_dma(FLOPPY_DMA); - return 1; + err = 1; /* XXX */ + goto cleanup_dma; }; - enable_dma(FIQ_FD1772); /* This inserts a call to our command end routine */ /* initialize variables */ + err = -ENOMEM; SelectedDrive = -1; #ifdef TRACKBUFFER BufferDrive = BufferSide = BufferTrack = -1; /* Atari uses 512 - I want to eventually cope with 1K sectors */ DMABuffer = (char *)kmalloc((FD1772_MAX_SECTORS+1)*512,GFP_KERNEL); + if (DMABuffer == NULL) + goto cleanup_dma; TrackBuffer = DMABuffer + 512; #else /* Allocate memory for the DMAbuffer - on the Atari this takes it out of some special memory... */ DMABuffer = (char *) kmalloc(2048); /* Copes with pretty large sectors */ + if (DMABuffer == NULL) + goto cleanup_dma; #endif - + enable_dma(FIQ_FD1772); /* This inserts a call to our command end routine */ for (i = 0; i < FD_MAX_UNITS; i++) { unit[i].track = -1; } @@ -1619,4 +1624,7 @@ config_types(); return 0; +cleanup_dma: + free_dma(FLOPPY_DMA); + return err; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/acorn/char/mouse_ps2.c linux.20pre5-ac2/drivers/acorn/char/mouse_ps2.c --- linux.20pre5/drivers/acorn/char/mouse_ps2.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/acorn/char/mouse_ps2.c 2002-08-25 15:55:31.000000000 +0100 @@ -273,9 +273,15 @@ iomd_writeb(0, IOMD_MSECTL); iomd_writeb(8, IOMD_MSECTL); - if (misc_register(&psaux_mouse)) - return -ENODEV; queue = (struct aux_queue *) kmalloc(sizeof(*queue), GFP_KERNEL); + if (queue == NULL) + return -ENOMEM; + + if (misc_register(&psaux_mouse)) { + kfree(queue); + return -ENODEV; + } + memset(queue, 0, sizeof(*queue)); queue->head = queue->tail = 0; init_waitqueue_head(&queue->proc_list); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/acorn/char/pcf8583.c linux.20pre5-ac2/drivers/acorn/char/pcf8583.c --- linux.20pre5/drivers/acorn/char/pcf8583.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/acorn/char/pcf8583.c 2002-08-26 14:28:36.000000000 +0100 @@ -73,6 +73,7 @@ pcf8583_detach(struct i2c_client *client) { i2c_detach_client(client); + kfree(client); return 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/block/elevator.c linux.20pre5-ac2/drivers/block/elevator.c --- linux.20pre5/drivers/block/elevator.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/block/elevator.c 2002-08-25 16:23:25.000000000 +0100 @@ -219,3 +219,5 @@ *elevator = type; elevator->queue_ID = queue_ID++; } + +EXPORT_SYMBOL(elevator_init); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/block/ll_rw_blk.c linux.20pre5-ac2/drivers/block/ll_rw_blk.c --- linux.20pre5/drivers/block/ll_rw_blk.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/block/ll_rw_blk.c 2002-08-15 13:16:44.000000000 +0100 @@ -118,6 +118,13 @@ */ int * max_sectors[MAX_BLKDEV]; +/* + * blkdev_varyio indicates if variable size IO can be done on a device. + * + * Currently used for doing variable size IO on RAW devices. + */ +char * blkdev_varyio[MAX_BLKDEV]; + unsigned long blk_max_low_pfn, blk_max_pfn; int blk_nohighio = 0; @@ -1209,6 +1216,38 @@ } } +/* + * submit_bh_blknr() - same as submit_bh() except that b_rsector is + * set to b_blocknr. Used for RAW VARY. + */ +void submit_bh_blknr(int rw, struct buffer_head * bh) +{ + int count = bh->b_size >> 9; + + if (!test_bit(BH_Lock, &bh->b_state)) + BUG(); + + set_bit(BH_Req, &bh->b_state); + + /* + * First step, 'identity mapping' - RAID or LVM might + * further remap this. + */ + bh->b_rdev = bh->b_dev; + bh->b_rsector = bh->b_blocknr; + + generic_make_request(rw, bh); + + switch (rw) { + case WRITE: + kstat.pgpgout += count; + break; + default: + kstat.pgpgin += count; + break; + } +} + /** * ll_rw_block: low-level access to block devices * @rw: whether to %READ or %WRITE or maybe %READA (readahead) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/block/loop.c linux.20pre5-ac2/drivers/block/loop.c --- linux.20pre5/drivers/block/loop.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/block/loop.c 2002-08-13 14:19:36.000000000 +0100 @@ -199,9 +199,9 @@ page = grab_cache_page(mapping, index); if (!page) goto fail; + kaddr = kmap(page); if (aops->prepare_write(file, page, offset, offset+size)) goto unlock; - kaddr = page_address(page); flush_dcache_page(page); transfer_result = lo_do_transfer(lo, WRITE, kaddr + offset, data, size, IV); if (transfer_result) { @@ -216,6 +216,7 @@ goto unlock; if (transfer_result) goto unlock; + kunmap(page); data += size; len -= size; offset = 0; @@ -228,6 +229,7 @@ return 0; unlock: + kunmap(page); UnlockPage(page); page_cache_release(page); fail: @@ -418,6 +420,7 @@ break; run_task_queue(&tq_disk); + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(HZ); } while (1); memset(bh, 0, sizeof(*bh)); @@ -437,6 +440,7 @@ break; run_task_queue(&tq_disk); + set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(HZ); } while (1); @@ -563,6 +567,7 @@ daemonize(); exit_files(current); + reparent_to_init(); sprintf(current->comm, "loop%d", lo->lo_number); @@ -571,9 +576,6 @@ flush_signals(current); spin_unlock_irq(¤t->sigmask_lock); - current->policy = SCHED_OTHER; - current->nice = -20; - spin_lock_irq(&lo->lo_lock); lo->lo_state = Lo_bound; atomic_inc(&lo->lo_pending); @@ -645,7 +647,7 @@ lo_device = inode->i_rdev; if (lo_device == dev) { error = -EBUSY; - goto out; + goto out_putf; } } else if (S_ISREG(inode->i_mode)) { struct address_space_operations *aops = inode->i_mapping->a_ops; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/block/Makefile linux.20pre5-ac2/drivers/block/Makefile --- linux.20pre5/drivers/block/Makefile 2002-08-29 18:39:37.000000000 +0100 +++ linux.20pre5-ac2/drivers/block/Makefile 2002-08-25 16:23:25.000000000 +0100 @@ -10,7 +10,7 @@ O_TARGET := block.o -export-objs := ll_rw_blk.o blkpg.o loop.o DAC960.o genhd.o +export-objs := ll_rw_blk.o blkpg.o elevator.o loop.o DAC960.o genhd.o obj-y := ll_rw_blk.o blkpg.o genhd.o elevator.o diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/block/paride/epat.c linux.20pre5-ac2/drivers/block/paride/epat.c --- linux.20pre5/drivers/block/paride/epat.c 2002-08-29 18:39:37.000000000 +0100 +++ linux.20pre5-ac2/drivers/block/paride/epat.c 2002-08-26 14:22:09.000000000 +0100 @@ -303,7 +303,6 @@ static void epat_init_proto( PIA *pi) { MOD_INC_USE_COUNT; - printk("epat_init_proto"); } static void epat_release_proto( PIA *pi) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/block/paride/pd.c linux.20pre5-ac2/drivers/block/paride/pd.c --- linux.20pre5/drivers/block/paride/pd.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/block/paride/pd.c 2002-08-26 14:45:39.000000000 +0100 @@ -180,7 +180,8 @@ void pd_setup( char *str, int *ints) -{ generic_setup(pd_stt,7,str); +{ + generic_setup(pd_stt,7,str); } #endif @@ -299,6 +300,7 @@ int heads; /* physical geometry */ int sectors; int cylinders; + int can_lba; int drive; /* master=0 slave=1 */ int changed; /* Have we seen a disk change ? */ int removable; /* removable media device ? */ @@ -306,7 +308,7 @@ int alt_geom; int present; char name[PD_NAMELEN]; /* pda, pdb, etc ... */ - }; +}; struct pd_unit pd[PD_UNITS]; @@ -656,14 +658,20 @@ /* Don't use this call if the capacity is zero. */ -{ int c1, c0, h, s; - - s = ( block % PD.sectors) + 1; - h = ( block / PD.sectors) % PD.heads; - c0 = ( block / (PD.sectors*PD.heads)) % 256; - c1 = ( block / (PD.sectors*PD.heads*256)); - - pd_send_command(unit,count,s,h,c0,c1,func); +{ + int c1, c0, h, s; + if (PD.can_lba) { + s = block & 255; + c0 = (block >>= 8) & 255; + c1 = (block >>= 8) & 255; + h = ((block >>= 8) & 15) + 0x40; + } else { + s = ( block % PD.sectors) + 1; + h = ( block /= PD.sectors) % PD.heads; + c0 = ( block /= PD.heads) % 256; + c1 = (block >>= 8); + } + pd_send_command(unit,count,s,h,c0,c1,func); } /* According to the ATA standard, the default CHS geometry should be @@ -762,10 +770,14 @@ } pi_read_block(PI,pd_scratch,512); pi_disconnect(PI); - PD.sectors = word_val(6); - PD.heads = word_val(3); - PD.cylinders = word_val(1); - PD.capacity = PD.sectors*PD.heads*PD.cylinders; + PD.can_lba = pd_scratch[99] & 2; + PD.sectors = le16_to_cpu(*(u16*)(pd_scratch+12)); + PD.heads = le16_to_cpu(*(u16*)(pd_scratch+6)); + PD.cylinders = le16_to_cpu(*(u16*)(pd_scratch+2)); + if (PD.can_lba) + PD.capacity = le32_to_cpu(*(u32*)(pd_scratch + 120)); + else + PD.capacity = PD.sectors*PD.heads*PD.cylinders; for(j=0;jb_page); } else { SetPageDirty(page); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/agp/agpgart_be.c linux.20pre5-ac2/drivers/char/agp/agpgart_be.c --- linux.20pre5/drivers/char/agp/agpgart_be.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/agp/agpgart_be.c 2002-08-25 16:06:16.000000000 +0100 @@ -1704,6 +1704,12 @@ return 0; } +static void intel_845_resume(void) +{ + intel_845_configure(); +} + + static int intel_850_configure(void) { u32 temp; @@ -2012,7 +2018,7 @@ agp_bridge.agp_alloc_page = agp_generic_alloc_page; agp_bridge.agp_destroy_page = agp_generic_destroy_page; agp_bridge.suspend = agp_generic_suspend; - agp_bridge.resume = agp_generic_resume; + agp_bridge.resume = intel_845_resume; agp_bridge.cant_use_aperture = 0; return 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/alim1535d_wdt.c linux.20pre5-ac2/drivers/char/alim1535d_wdt.c --- linux.20pre5/drivers/char/alim1535d_wdt.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/alim1535d_wdt.c 2002-08-12 14:58:07.000000000 +0100 @@ -0,0 +1,356 @@ +/* + * Watchdog for the 7101 PMU version found in the ALi1535 chipsets + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static spinlock_t ali_lock; /* Guards the hardware */ + +#ifdef CONFIG_WATCHDOG_NOWAYOUT +static int nowayout = 1; +#else +static int nowayout = 0; +#endif + +MODULE_PARM(nowayout,"i"); +MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default=CONFIG_WATCHDOG_NOWAYOUT)"); + +static unsigned long timer_alive; +static char ali_expect_close; +static u32 ali_timeout = 60; /* 60 seconds */ +static u32 ali_timeout_bits = 1 | (1<<7); /* 1 count in minutes */ + +static struct pci_dev *ali_pci; + +/** + * ali_timer_start - start watchdog countdown + * @dev: PCI device of the PMU + * + * Starts the timer running providing the timer has a counter + * configuration set. + */ + +static void ali_timer_start(struct pci_dev *pdev) +{ + u32 val; + + spin_lock(&ali_lock); + + pci_read_config_dword(pdev, 0xCC, &val); + val &= ~0x3F; /* Mask count */ + val |= (1<<25) | ali_timeout_bits; + pci_write_config_dword(pdev, 0xCC, val); + spin_unlock(&ali_lock); +} + +/** + * ali_timer_stop - stop the timer countdown + * @pdev: PCI device of the PMU + * + * Stop the ALi watchdog countdown + */ + +static void ali_timer_stop (struct pci_dev *pdev) +{ + u32 val; + + spin_lock(&ali_lock); + pci_read_config_dword(pdev, 0xCC, &val); + val &= ~0x3F; /* Mask count to zero (disabled) */ + val &= ~(1<<25);/* and for safety mask the reset enable */ + pci_write_config_dword(pdev, 0xCC, val); + spin_unlock(&ali_lock); +} + +/** + * ali_timer_settimer - compute the timer reload value + * @pdev: PCI device of the PMU + * @t: time in seconds + * + * Computes the timeout values needed and then restarts the timer + * running with the new timeout values + */ + +static int ali_timer_settimer(struct pci_dev *pdev, unsigned long t) +{ + if(t < 60) + ali_timeout_bits = t|(1<<6); + else if(t < 3600) + ali_timeout_bits = (t/60)|(1<<7); + else if(t < 18000) + ali_timeout_bits = (t/300)|(1<<6)|(1<<7); + else return -EINVAL; + + ali_timeout = t; + ali_timer_start(pdev); + return 0; +} + +/** + * ali_open - handle open of ali watchdog + * @inode: inode from VFS + * @file: file from VFS + * + * Open the ALi watchdog device. Ensure only one person opens it + * at a time. Also start the watchdog running. + */ + +static int ali_open(struct inode *inode, struct file *file) +{ + if (test_and_set_bit(0, &timer_alive)) + return -EBUSY; + ali_timer_start (ali_pci); + return 0; +} + +/** + * ali_release - close an ALi watchdog + * @inode: inode from VFS + * @file: file from VFS + * + * Close the ALi watchdog device. Actual shutdown of the timer + * only occurs if the magic sequence has been set or nowayout is + * disabled + */ + +static int ali_release (struct inode *inode, struct file *file) +{ + /* + * Shut off the timer. + */ + if (ali_expect_close == 42 && !nowayout) { + ali_timer_stop(ali_pci); + } else { + ali_timer_start(ali_pci); + printk(KERN_CRIT "ali1535_wdt: Unexpected close, not stopping watchdog!\n"); + } + clear_bit(0, &timer_alive); + ali_expect_close = 0; + return 0; +} + +/** + * ali_write - writes to ALi watchdog + * @file: file from VFS + * @data: user address of data + * @len: length of data + * @ppos: pointer to the file offset + * + * Handle a write to the ALi watchdog. Writing to the file pings + * the watchdog and resets it. Writing the magic 'V' sequence allows + * the next close to turn off the watchdog. + */ + +static ssize_t ali_write (struct file *file, const char *data, + size_t len, loff_t * ppos) +{ + /* Can't seek (pwrite) on this device */ + if (ppos != &file->f_pos) + return -ESPIPE; + + /* See if we got the magic character 'V' and reload the timer */ + if (len) { + size_t i; + + ali_expect_close = 0; + + /* scan to see wether or not we got the magic character */ + for (i = 0; i != len; i++) { + u8 c; + if(get_user(c, data+i)) + return -EFAULT; + if (c == 'V') + ali_expect_close = 42; + } + + /* someone wrote to us, we should reload the timer */ + ali_timer_start(ali_pci); + return 1; + } + return 0; +} + +/** + * ali_ioctl - handle watchdog ioctls + * @inode: VFS inode + * @file: VFS file pointer + * @cmd: ioctl number + * @arg: arguments to the ioctl + * + * Handle the watchdog ioctls supported by the ALi driver. Really + * we want an extension to enable irq ack monitoring and the like + */ + +static int ali_ioctl (struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + int options, retval = -EINVAL; + u32 t; + static struct watchdog_info ident = { + options: WDIOF_SETTIMEOUT | WDIOF_KEEPALIVEPING, + firmware_version: 0, + identity: "ALi 1535D+ TCO timer", + }; + switch (cmd) { + default: + return -ENOTTY; + case WDIOC_GETSUPPORT: + if (copy_to_user((struct watchdog_info *) arg, &ident, sizeof (ident))) + return -EFAULT; + return 0; + case WDIOC_GETSTATUS: + case WDIOC_GETBOOTSTATUS: + return put_user(0, (int *) arg); + case WDIOC_SETOPTIONS: + if (get_user (options, (int *) arg)) + return -EFAULT; + if (options & WDIOS_DISABLECARD) { + ali_timer_stop(ali_pci); + retval = 0; + } + if (options & WDIOS_ENABLECARD) { + ali_timer_start(ali_pci); + retval = 0; + } + return retval; + case WDIOC_KEEPALIVE: + ali_timer_start(ali_pci); + return 0; + case WDIOC_SETTIMEOUT: + if (get_user(t, (int *) arg)) + return -EFAULT; + if (ali_timer_settimer(ali_pci, t)) + return -EINVAL; + ali_timer_start(ali_pci); + /* Fall */ + case WDIOC_GETTIMEOUT: + return put_user(ali_timeout, (int *)arg); + } +} + +/* + * Data for PCI driver interface + * + * This data only exists for exporting the supported + * PCI ids via MODULE_DEVICE_TABLE. We do not actually + * register a pci_driver, because someone else might one day + * want to register another driver on the same PCI id. + */ + +static struct pci_device_id ali_pci_tbl[] __initdata = { + { PCI_VENDOR_ID_AL, 1535, PCI_ANY_ID, PCI_ANY_ID,}, + { 0, }, +}; +MODULE_DEVICE_TABLE (pci, ali_pci_tbl); + + +/** + * ali_find_watchdog - find a 1535 and 7101 + * + * Scans the PCI hardware for a 1535 series bridge and matching 7101 + * watchdog device. This may be overtight but it is better to be safe + */ + +static int __init ali_find_watchdog(void) +{ + struct pci_dev *pdev; + u32 wdog; + + /* Check for a 1535 series bridge */ + pdev = pci_find_device(PCI_VENDOR_ID_AL, 0x1535, NULL); + if(pdev == NULL) + return -ENODEV; + + /* Check for the a 7101 PMU */ + pdev = pci_find_device(PCI_VENDOR_ID_AL, 0x7101, NULL); + if(pdev == NULL) + return -ENODEV; + + if(pci_enable_device(pdev)) + return -EIO; + + ali_pci = pdev; + + /* + * Initialize the timer bits + */ + + pci_read_config_dword(pdev, 0xCC, &wdog); + + wdog &= ~0x3F; /* Timer bits */ + wdog &= ~((1<<27)|(1<<26)|(1<<25)|(1<<24)); /* Issued events */ + wdog &= ~((1<<16)|(1<<13)|(1<<12)|(1<<11)|(1<<10)|(1<<9)); /* No monitor bits */ + + pci_write_config_dword(pdev, 0xCC, wdog); + return 0; +} + +static struct file_operations ali_fops = { + owner: THIS_MODULE, + write: ali_write, + ioctl: ali_ioctl, + open: ali_open, + release: ali_release, +}; + +static struct miscdevice ali_miscdev = { + minor: WATCHDOG_MINOR, + name: "watchdog", + fops: &ali_fops, +}; + +/** + * watchdog_init - module initialiser + * + * Scan for a suitable watchdog and if so initialize it. Return an error + * if we cannot, the error causes the module to unload + */ + +static int __init watchdog_init (void) +{ + spin_lock_init(&ali_lock); + if (!ali_find_watchdog()) + return -ENODEV; + if (misc_register (&ali_miscdev) != 0) { + printk (KERN_ERR "alim1535d: cannot register watchdog device node.\n"); + return -EIO; + } + return 0; +} + +/** + * watchdog_cleanup - unload watchdog + * + * Called on the unload of a successfully installed watchdog module. + */ + +static void __exit watchdog_cleanup (void) +{ + ali_timer_stop(ali_pci); + misc_deregister (&ali_miscdev); +} + +module_init(watchdog_init); +module_exit(watchdog_cleanup); + +MODULE_AUTHOR("Alan Cox"); +MODULE_DESCRIPTION("Watchdog driver for the ALi 1535+ PMU"); +MODULE_LICENSE("GPL"); +EXPORT_NO_SYMBOLS; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/amd76x_pm.c linux.20pre5-ac2/drivers/char/amd76x_pm.c --- linux.20pre5/drivers/char/amd76x_pm.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/amd76x_pm.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,688 @@ +/* + * ACPI sytle PM for SMP AMD-760MP(X) based systems. + * For use until the ACPI project catches up. :-) + * + * Copyright (C) 2002 Johnathan Hicks + * + * History: + * + * 20020702 - amd-smp-idle: Tony Lindgren + * Influenced by Vcool, and LVCool. Rewrote everything from scratch to + * use the PCI features in Linux, and to support SMP systems. Provides + * C2 idling on SMP AMD-760MP systems. + * + * 20020722: JH + * I adapted Tony's code for the AMD-765/766 southbridge and adapted it + * according to the AMD-768 data sheet to provide the same capability for + * SMP AMD-760MPX systems. Posted to acpi-devel list. + * + * 20020722: Alan Cox + * Replaces non-functional amd76x_pm code in -ac tree. + * + * 20020730: JH + * Added ability to do normal throttling (the non-thermal kind), C3 idling + * and Power On Suspend (S1 sleep). It would be very easy to tie swsusp + * into activate_amd76x_SLP(). C3 idling doesn't happen yet; see my note + * in amd76x_smp_idle(). I've noticed that when NTH and idling are both + * enabled, my hardware locks and requires a hard reset, so I have + * #ifndefed around the idle loop setting to prevent this. POS locks it up + * too, both ought to be fixable. I've also noticed that idling and NTH + * make some interference that is picked up by the onboard sound chip on + * my ASUS A7M266-D motherboard. + * + * + * TODO: Thermal throttling (TTH). + * /proc interface for normal throttling level. + * /proc interface for POS. + * + * + * + * + * Processor idle mode module for AMD SMP 760MP(X) based systems + * + * Copyright (C) 2002 Tony Lindgren + * Johnathan Hicks (768 support) + * + * Using this module saves about 70 - 90W of energy in the idle mode compared + * to the default idle mode. Waking up from the idle mode is fast to keep the + * system response time good. Currently no CPU load calculation is done, the + * system exits the idle mode if the idle function runs twice on the same + * processor in a row. This only works on SMP systems, but maybe the idle mode + * enabling can be integrated to ACPI to provide C2 mode at some point. + * + * NOTE: Currently there's a bug somewhere where the reading the + * P_LVL2 for the first time causes the system to sleep instead of + * idling. This means that you need to hit the power button once to + * wake the system after loading the module for the first time after + * reboot. After that the system idles as supposed. + * + * + * Influenced by Vcool, and LVCool. Rewrote everything from scratch to + * use the PCI features in Linux, and to support SMP systems. + * + * Currently only tested on a TYAN S2460 (760MP) system (Tony) and an + * ASUS A7M266-D (760MPX) system (Johnathan). Adding support for other Athlon + * SMP or single processor systems should be easy if desired. + * + * This software is licensed under GNU General Public License Version 2 + * as specified in file COPYING in the Linux kernel source tree main + * directory. + * + * + */ + + +#include +#include +#include +#include +#include +#include + +#include "amd76x_pm.h" + +#define VERSION "20020730" + +// #define AMD76X_C3 1 +// #define AMD76X_NTH 1 +// #define AMD76X_POS 1 + + +extern void default_idle(void); +static void amd76x_smp_idle(void); +static int amd76x_pm_main(void); +static int __devinit amd_nb_init(struct pci_dev *pdev, + const struct pci_device_id *ent); +static void amd_nb_remove(struct pci_dev *pdev); +static int __devinit amd_sb_init(struct pci_dev *pdev, + const struct pci_device_id *ent); +static void amd_sb_remove(struct pci_dev *pdev); + + +static struct pci_dev *pdev_nb; +static struct pci_dev *pdev_sb; + +struct PM_cfg { + unsigned int status_reg; + unsigned int C2_reg; + unsigned int C3_reg; + unsigned int NTH_reg; + unsigned int slp_reg; + unsigned int resume_reg; + void (*orig_idle) (void); + void (*curr_idle) (void); + unsigned long C2_cnt, C3_cnt; + int last_pr; +}; +static struct PM_cfg amd76x_pm_cfg; + +struct cpu_idle_state { + int idle; + int count; +}; +static struct cpu_idle_state prs[2]; + +static struct pci_device_id amd_nb_tbl[] __devinitdata = { + {PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_FE_GATE_700C, PCI_ANY_ID, PCI_ANY_ID,}, + {0,} +}; + +static struct pci_device_id amd_sb_tbl[] __devinitdata = { + {PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7413, PCI_ANY_ID, PCI_ANY_ID,}, + {PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7443, PCI_ANY_ID, PCI_ANY_ID,}, + {0,} +}; + +static struct pci_driver amd_nb_driver = { + name:"amd76x_pm-nb", + id_table:amd_nb_tbl, + probe:amd_nb_init, + remove:__devexit_p(amd_nb_remove), +}; + +static struct pci_driver amd_sb_driver = { + name:"amd76x_pm-sb", + id_table:amd_sb_tbl, + probe:amd_sb_init, + remove:__devexit_p(amd_sb_remove), +}; + + +static int __devinit +amd_nb_init(struct pci_dev *pdev, const struct pci_device_id *ent) +{ + pdev_nb = pdev; + printk(KERN_INFO "amd76x_pm: Initializing northbridge %s\n", + pdev_nb->name); + + return 0; +} + + +static void __devexit +amd_nb_remove(struct pci_dev *pdev) +{ +} + + +static int __devinit +amd_sb_init(struct pci_dev *pdev, const struct pci_device_id *ent) +{ + pdev_sb = pdev; + printk(KERN_INFO "amd76x_pm: Initializing southbridge %s\n", + pdev_sb->name); + + return 0; +} + + +static void __devexit +amd_sb_remove(struct pci_dev *pdev) +{ +} + + +/* + * Configures the AMD-762 northbridge to support PM calls + */ +static int +config_amd762(int enable) +{ + unsigned int regdword; + + /* Enable STPGNT in BIU Status/Control for cpu0 */ + pci_read_config_dword(pdev_nb, 0x60, ®dword); + regdword |= (1 << 17); + pci_write_config_dword(pdev_nb, 0x60, regdword); + + /* Enable STPGNT in BIU Status/Control for cpu1 */ + pci_read_config_dword(pdev_nb, 0x68, ®dword); + regdword |= (1 << 17); + pci_write_config_dword(pdev_nb, 0x68, regdword); + + /* DRAM refresh enable */ + pci_read_config_dword(pdev_nb, 0x58, ®dword); + regdword &= ~(1 << 19); + pci_write_config_dword(pdev_nb, 0x58, regdword); + + /* Self refresh enable */ + pci_read_config_dword(pdev_nb, 0x70, ®dword); + regdword |= (1 << 18); + pci_write_config_dword(pdev_nb, 0x70, regdword); + + return 0; +} + + +/* + * Get the base PMIO address and set the pm registers in amd76x_pm_cfg. + */ +static void +amd76x_get_PM(void) +{ + unsigned int regdword; + + /* Get the address for pm status, P_LVL2, etc */ + pci_read_config_dword(pdev_sb, 0x58, ®dword); + regdword &= 0xff80; + amd76x_pm_cfg.status_reg = (regdword + 0x00); + amd76x_pm_cfg.slp_reg = (regdword + 0x04); + amd76x_pm_cfg.NTH_reg = (regdword + 0x10); + amd76x_pm_cfg.C2_reg = (regdword + 0x14); + amd76x_pm_cfg.C3_reg = (regdword + 0x15); + amd76x_pm_cfg.resume_reg = (regdword + 0x16); /* N/A for 768 */ +} + + +/* + * En/Disable PMIO and configure W4SG & STPGNT. + */ +static int +config_PMIO_amd76x(int is_766, int enable) +{ + unsigned char regbyte; + + /* Clear W4SG, and set PMIOEN, if using a 765/766 set STPGNT as well. + * AMD-766: C3A41; page 59 in AMD-766 doc + * AMD-768: DevB:3x41C; page 94 in AMD-768 doc */ + pci_read_config_byte(pdev_sb, 0x41, ®byte); + if(enable) { + regbyte |= ((0 << 0) | (is_766?1:0 << 1) | (1 << 7)); + } + else { + regbyte |= (0 << 7); + } + pci_write_config_byte(pdev_sb, 0x41, regbyte); + + return 0; +} + +/* + * C2 idle support for AMD-766. + */ +static void +config_amd766_C2(int enable) +{ + unsigned int regdword; + + /* Set C2 options in C3A50, page 63 in AMD-766 doc */ + pci_read_config_dword(pdev_sb, 0x50, ®dword); + if(enable) { + regdword &= ~((DCSTOP_EN | CPUSTP_EN | PCISTP_EN | SUSPND_EN | + CPURST_EN) << C2_REGS); + regdword |= (STPCLK_EN /* ~ 20 Watt savings max */ + | CPUSLP_EN) /* Additional ~ 70 Watts max! */ + << C2_REGS; + } + else + regdword &= ~((STPCLK_EN | CPUSLP_EN) << C2_REGS); + pci_write_config_dword(pdev_sb, 0x50, regdword); +} + + +#ifdef AMD76X_C3 +/* + * Untested C3 idle support for AMD-766. + */ +static void +config_amd766_C3(int enable) +{ + unsigned int regdword; + + /* Set C3 options in C3A50, page 63 in AMD-766 doc */ + pci_read_config_dword(pdev_sb, 0x50, ®dword); + if(enable) { + regdword &= ~((DCSTOP_EN | PCISTP_EN | SUSPND_EN | CPURST_EN) + << C3_REGS); + regdword |= (STPCLK_EN /* ~ 20 Watt savings max */ + | CPUSLP_EN /* Additional ~ 70 Watts max! */ + | CPUSTP_EN) /* yet more savings! */ + << C3_REGS; + } + else + regdword &= ~((STPCLK_EN | CPUSLP_EN | CPUSTP_EN) << C3_REGS); + pci_write_config_dword(pdev_sb, 0x50, regdword); +} +#endif + + +#ifdef AMD76X_POS +static void +config_amd766_POS(int enable) +{ + unsigned int regdword; + + /* Set C3 options in C3A50, page 63 in AMD-766 doc */ + pci_read_config_dword(pdev_sb, 0x50, ®dword); + if(enable) { + regdword &= ~((ZZ_CACHE_EN | CPURST_EN) << POS_REGS); + regdword |= ((DCSTOP_EN | STPCLK_EN | CPUSTP_EN | PCISTP_EN | + CPUSLP_EN | SUSPND_EN) << POS_REGS); + } + else + regdword ^= (0xff << POS_REGS); + pci_write_config_dword(pdev_sb, 0x50, regdword); +} +#endif + + +/* + * Configures the 765 & 766 southbridges. + */ +static int +config_amd766(int enable) +{ + amd76x_get_PM(); + config_PMIO_amd76x(1, 1); + + config_amd766_C2(enable); +#ifdef AMD76X_C3 + config_amd766_C3(enable); +#endif +#ifdef AMD76X_POS + config_amd766_POS(enable); +#endif + + return 0; +} + + +/* + * C2 idling support for AMD-768. + */ +static void +config_amd768_C2(int enable) +{ + unsigned char regbyte; + + /* Set C2 options in DevB:3x4F, page 100 in AMD-768 doc */ + pci_read_config_byte(pdev_sb, 0x4F, ®byte); + if(enable) + regbyte |= C2EN; + else + regbyte ^= C2EN; + pci_write_config_byte(pdev_sb, 0x4F, regbyte); +} + + +#ifdef AMD76X_C3 +/* + * C3 idle support for AMD-768. The idle loop would need some extra + * handling for C3, but it would make more sense for ACPI to handle CX level + * transitions like it is supposed to. Unfortunately ACPI doesn't do CX + * levels on SMP systems yet. + */ +static void +config_amd768_C3(int enable) +{ + unsigned char regbyte; + + /* Set C3 options in DevB:3x4F, page 100 in AMD-768 doc */ + pci_read_config_byte(pdev_sb, 0x4F, ®byte); + if(enable) + regbyte |= (C3EN /* | ZZ_C3EN | CSLP_C3EN | CSTP_C3EN */); + else + regbyte ^= C3EN; + pci_write_config_byte(pdev_sb, 0x4F, regbyte); +} +#endif + + +#ifdef AMD76X_POS +/* + * Untested Power On Suspend support for AMD-768. This should also be handled + * by ACPI. + */ +static void +config_amd768_POS(int enable) +{ + unsigned int regdword; + + /* Set POS options in DevB:3x50, page 101 in AMD-768 doc */ + pci_read_config_dword(pdev_sb, 0x50, ®dword); + if(enable) + regdword |= (POSEN | CSTP | PSTP | ASTP | DCSTP | CSLP | SUSP); + else + regdword ^= POSEN; + pci_write_config_dword(pdev_sb, 0x50, regdword); +} +#endif + + +#ifdef AMD76X_NTH +/* + * Normal Throttling support for AMD-768. There are several settings + * that can be set depending on how long you want some of the delays to be. + * I'm not sure if this is even neccessary at all as the 766 doesn't need this. + */ +static void +config_amd768_NTH(int enable, int ntper, int thminen) +{ + unsigned char regbyte; + + /* DevB:3x40, pg 93 of 768 doc */ + pci_read_config_byte(pdev_sb, 0x40, ®byte); + /* Is it neccessary to use THMINEN at ANY time? */ + regbyte |= (NTPER(ntper) | THMINEN(thminen)); + pci_write_config_byte(pdev_sb, 0x40, regbyte); +} +#endif + + +/* + * Configures the 768 southbridge to support idle calls, and gets + * the processor idle call register location. + */ +static int +config_amd768(int enable) +{ + amd76x_get_PM(); + config_PMIO_amd76x(0, 1); + + config_amd768_C2(enable); +#ifdef AMD76X_C3 + config_amd768_C3(enable); +#endif +#ifdef AMD76X_POS + config_amd768_POS(enable); +#endif +#ifdef AMD76X_NTH + config_amd768_NTH(enable, 1, 2); +#endif + + return 0; +} + + +#ifdef AMD76X_NTH +/* + * Activate normal throttling via its ACPI register (P_CNT). + */ +static void +activate_amd76x_NTH(int enable, int ratio) +{ + unsigned int regdword; + + /* PM10, pg 110 of 768 doc, pg 70 of 766 doc */ + regdword=inl(amd76x_pm_cfg.NTH_reg); + if(enable) + regdword |= (NTH_EN | NTH_RATIO(ratio)); + else + regdword ^= NTH_EN; + outl(regdword, amd76x_pm_cfg.NTH_reg); +} +#endif + + +/* + * Activate sleep state via its ACPI register (PM1_CNT). + */ +static void +activate_amd76x_SLP(int type) +{ + unsigned short regshort; + + /* PM04, pg 109 of 768 doc, pg 69 of 766 doc */ + regshort=inw(amd76x_pm_cfg.slp_reg); + regshort |= (SLP_EN | SLP_TYP(type)) ; + outw(regshort, amd76x_pm_cfg.slp_reg); +} + + +#ifdef AMD76X_POS +/* + * Wrapper function to activate POS sleep state. + */ +static void +activate_amd76x_POS(void) +{ + activate_amd76x_SLP(1); +} +#endif + + +#if 0 +/* + * Idle loop for single processor systems + */ +void +amd76x_up_idle(void) +{ + // FIXME: Optionally add non-smp idle loop here +} +#endif + + +/* + * Idle loop for SMP systems, supports currently only 2 processors. + * + * Note; for 2.5 folks - not pre-empt safe + */ +static void +amd76x_smp_idle(void) +{ + + /* + * Exit idle mode immediately if the CPU does not change. + * Usually that means that we have some load on another CPU. + */ + if (prs[0].idle && prs[1].idle && amd76x_pm_cfg.last_pr == smp_processor_id()) { + prs[0].idle = 0; + prs[1].idle = 0; + /* This looks redundent as it was just checked in the if() */ + /* amd76x_pm_cfg.last_pr = smp_processor_id(); */ + return; + } + + prs[smp_processor_id()].count++; + + /* Don't start the idle mode immediately */ + if (prs[smp_processor_id()].count >= LAZY_IDLE_DELAY) { + + /* Put the current processor into idle mode */ + prs[smp_processor_id()].idle = + (prs[smp_processor_id()].idle ? 2 : 1); + + /* Only idle if both processors are idle */ + if ((prs[0].idle==1) && (prs[1].idle==1)) { + amd76x_pm_cfg.C2_cnt++; + inb(amd76x_pm_cfg.C2_reg); + } + #ifdef AMD76X_C3 + /* + * JH: I've not been able to get into here. Could this have + * something to do with the way the kernel handles the idle + * loop, or and error that I've made? + */ + else if ((prs[0].idle==2) && (prs[1].idle==2)) { + amd76x_pm_cfg.C3_cnt++; + inb(amd76x_pm_cfg.C3_reg); + } + #endif + + prs[smp_processor_id()].count = 0; + + } + amd76x_pm_cfg.last_pr = smp_processor_id(); +} + + +/* + * Finds and initializes the bridges, and then sets the idle function + */ +static int +amd76x_pm_main(void) +{ + int found; + + /* Find northbridge */ + found = pci_module_init(&amd_nb_driver); + if (found < 0) { + printk(KERN_ERR "amd76x_pm: Could not find northbridge\n"); + return 1; + } + + /* Find southbridge */ + found = pci_module_init(&amd_sb_driver); + if (found < 0) { + printk(KERN_ERR "amd76x_pm: Could not find southbridge\n"); + pci_unregister_driver(&amd_nb_driver); + return 1; + } + + /* Init southbridge */ + switch (pdev_sb->device) { + case PCI_DEVICE_ID_AMD_VIPER_7413: /* AMD-765 or 766 */ + config_amd766(1); + break; + case PCI_DEVICE_ID_AMD_VIPER_7443: /* AMD-768 */ + config_amd768(1); + break; + default: + printk(KERN_ERR "amd76x_pm: No southbridge to initialize\n"); + break; + } + + /* Init northbridge and queue the new idle function */ + switch (pdev_nb->device) { + case PCI_DEVICE_ID_AMD_FE_GATE_700C: /* AMD-762 */ + config_amd762(1); +#ifndef AMD76X_NTH + amd76x_pm_cfg.curr_idle = amd76x_smp_idle; +#endif + break; + default: + printk(KERN_ERR "amd76x_pm: No northbridge to initialize\n"); + break; + } + +#ifndef AMD76X_NTH + if (!amd76x_pm_cfg.curr_idle) { + printk(KERN_ERR "amd76x_pm: Idle function not changed\n"); + return 1; + } + + amd76x_pm_cfg.orig_idle = pm_idle; + pm_idle = amd76x_pm_cfg.curr_idle; +#endif + +#ifdef AMD76X_NTH + /* Turn NTH on with maxium throttling for testing. */ + activate_amd76x_NTH(1, 1); +#endif + +#ifdef AMD76X_POS + /* Testing here only. */ + activate_amd76x_POS(); +#endif + + return 0; +} + + +static int __init +amd76x_pm_init(void) +{ + printk(KERN_INFO "amd76x_pm: Version %s\n", VERSION); + return amd76x_pm_main(); +} + + +static void __exit +amd76x_pm_cleanup(void) +{ +#ifndef AMD76X_NTH + pm_idle = amd76x_pm_cfg.orig_idle; + + /* This isn't really needed. */ + printk(KERN_INFO "amd76x_pm: %lu C2 calls\n", amd76x_pm_cfg.C2_cnt); +#ifdef AMD76X_C3 + printk(KERN_INFO "amd76x_pm: %lu C3 calls\n", amd76x_pm_cfg.C3_cnt); +#endif + + /* + * FIXME: We want to wait until all CPUs have set the new + * idle function, otherwise we will oops. This may not be + * the right way to do it, but seems to work. + * + * - Best answer is going to be to ban unload, but when its debugged + * --- Alan + */ + schedule(); + mdelay(1000); +#endif + +#ifdef AMD76X_NTH + /* Turn NTH off*/ + activate_amd76x_NTH(0, 0); +#endif + + pci_unregister_driver(&amd_nb_driver); + pci_unregister_driver(&amd_sb_driver); + +} + + +MODULE_LICENSE("GPL"); +module_init(amd76x_pm_init); +module_exit(amd76x_pm_cleanup); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/amd76x_pm.h linux.20pre5-ac2/drivers/char/amd76x_pm.h --- linux.20pre5/drivers/char/amd76x_pm.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/amd76x_pm.h 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,59 @@ +/* + * Begin 765/766 + */ +/* C2/C3/POS options in C3A50, page 63 in AMD-766 doc */ +#define ZZ_CACHE_EN 1 +#define DCSTOP_EN (1 << 1) +#define STPCLK_EN (1 << 2) +#define CPUSTP_EN (1 << 3) +#define PCISTP_EN (1 << 4) +#define CPUSLP_EN (1 << 5) +#define SUSPND_EN (1 << 6) +#define CPURST_EN (1 << 7) + +#define C2_REGS 0 +#define C3_REGS 8 +#define POS_REGS 16 +/* + * End 765/766 + */ + + +/* + * Begin 768 + */ +/* C2/C3 options in DevB:3x4F, page 100 in AMD-768 doc */ +#define C2EN 1 +#define C3EN (1 << 1) +#define ZZ_C3EN (1 << 2) +#define CSLP_C3EN (1 << 3) +#define CSTP_C3EN (1 << 4) + +/* POS options in DevB:3x50, page 101 in AMD-768 doc */ +#define POSEN 1 +#define CSTP (1 << 2) +#define PSTP (1 << 3) +#define ASTP (1 << 4) +#define DCSTP (1 << 5) +#define CSLP (1 << 6) +#define SUSP (1 << 8) +#define MSRSM (1 << 14) +#define PITRSM (1 << 15) + +/* NTH options DevB:3x40, pg 93 of 768 doc */ +#define NTPER(x) (x << 3) +#define THMINEN(x) (x << 4) + +/* + * End 768 + */ + +/* NTH activate. PM10, pg 110 of 768 doc, pg 70 of 766 doc */ +#define NTH_RATIO(x) (x << 1) +#define NTH_EN (1 << 4) + +/* Sleep state. PM04, pg 109 of 768 doc, pg 69 of 766 doc */ +#define SLP_EN (1 << 13) +#define SLP_TYP(x) (x << 10) + +#define LAZY_IDLE_DELAY 800 /* 0: Best savings, 3000: More responsive */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/Config.in linux.20pre5-ac2/drivers/char/Config.in --- linux.20pre5/drivers/char/Config.in 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/Config.in 2002-08-29 19:01:10.000000000 +0100 @@ -193,6 +193,7 @@ bool ' Disable watchdog shutdown on close' CONFIG_WATCHDOG_NOWAYOUT tristate ' Acquire SBC Watchdog Timer' CONFIG_ACQUIRE_WDT tristate ' Advantech SBC Watchdog Timer' CONFIG_ADVANTECH_WDT + tristate ' ALi M7101 PMU on ALi 1535D+ Watchdog Timer' CONFIG_ALIM1535_WDT tristate ' ALi M7101 PMU Watchdog Timer' CONFIG_ALIM7101_WDT tristate ' AMD "Elan" SC520 Watchdog Timer' CONFIG_SC520_WDT tristate ' Berkshire Products PC Watchdog' CONFIG_PCWATCHDOG @@ -223,6 +224,7 @@ fi fi tristate ' ZF MachZ Watchdog' CONFIG_MACHZ_WDT + dep_tristate ' AMD 766/768 TCO Timer/Watchdog' CONFIG_AMD7XX_TCO $CONFIG_EXPERIMENTAL fi endmenu @@ -241,6 +243,7 @@ if [ "$CONFIG_X86" = "y" -o "$CONFIG_IA64" = "y" ]; then dep_tristate 'Intel i8x0 Random Number Generator support' CONFIG_INTEL_RNG $CONFIG_PCI fi +dep_tristate 'AMD 76x native power management (Experimental)' CONFIG_AMD_PM768 $CONFIG_PCI tristate '/dev/nvram support' CONFIG_NVRAM tristate 'Enhanced Real Time Clock Support' CONFIG_RTC if [ "$CONFIG_IA64" = "y" ]; then diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/console.c linux.20pre5-ac2/drivers/char/console.c --- linux.20pre5/drivers/char/console.c 2002-08-29 18:39:37.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/console.c 2002-08-06 15:42:07.000000000 +0100 @@ -101,6 +101,7 @@ #include #include #include +#include #include #include @@ -155,6 +156,7 @@ static void unblank_screen_t(unsigned long dummy); static void console_callback(void *ignored); + static int printable; /* Is console ready for printing? */ int do_poke_blanked_console; @@ -686,6 +688,8 @@ screenbuf = (unsigned short *) q; kmalloced = 1; vc_init(currcons, video_num_lines, video_num_columns, 1); + speakup_allocate(currcons); /* speakup needs more too. */ + if (!pm_con) { pm_con = pm_register(PM_SYS_DEV, @@ -912,6 +916,7 @@ pos += video_size_row; } need_wrap = 0; + speakup_con_write(currcons, "\n",1); } static void ri(int currcons) @@ -938,8 +943,9 @@ { if (x) { pos -= 2; - x--; need_wrap = 0; + x--; + speakup_bs(currcons); } } @@ -1421,7 +1427,10 @@ kbd_table[currcons].slockstate = 0; kbd_table[currcons].ledmode = LED_SHOW_FLAGS; kbd_table[currcons].ledflagstate = kbd_table[currcons].default_ledflagstate; - set_leds(); + + /* Only schedule the keyboard_tasklet if it is enabled. */ + if(!atomic_read(&keyboard_tasklet.count)) + set_leds(); cursor_type = CUR_DEFAULT; complement_mask = s_complement_mask; @@ -1680,7 +1689,12 @@ if (par[0]) par[0]--; gotoxay(currcons,x,par[0]); return; - case 'H': case 'f': + case 'f': + if (par[0]) par[0]--; + if (par[1]) par[1]--; + gotoxay(currcons,par[1],par[0]); + return; + case 'H': if (par[0]) par[0]--; if (par[1]) par[1]--; gotoxay(currcons,par[1],par[0]); @@ -1957,6 +1971,7 @@ if (vc_state == ESnormal && ok) { /* Now try to find out how to display it */ tc = conv_uni_to_pc(vc_cons[currcons].d, tc); + if ( tc == -4 ) { /* If we got -4 (not found) then see if we have defined a replacement character (U+FFFD) */ @@ -1982,6 +1997,7 @@ } if (decim) insert_char(currcons, 1); + speakup_con_write(currcons, (char *) &tc,1); scr_writew(himask ? ((attr << 8) & ~himask) + ((tc & 0x100) ? himask : 0) + (tc & 0xff) : (attr << 8) + tc, @@ -2022,6 +2038,7 @@ up(&con_buf_sem); } + speakup_con_update(currcons); return n; #undef FLUSH @@ -2047,6 +2064,7 @@ /* we only changed when the console had already been allocated - a new console is not created in an interrupt routine */ + speakup_con_update(want_console); } want_console = -1; } @@ -2118,6 +2136,7 @@ /* Contrived structure to try to emulate original need_wrap behaviour * Problems caused when we have need_wrap set on '\n' character */ + speakup_con_write(currcons, b, count); while (count--) { c = *b++; if (c == 10 || c == 13 || c == 8 || need_wrap) { @@ -2162,6 +2181,7 @@ } } set_cursor(currcons); + speakup_con_update(currcons); if (!oops_in_progress) poke_blanked_console(); @@ -2509,6 +2529,8 @@ master_display_fg = vc_cons[currcons].d; set_origin(currcons); save_screen(currcons); + speakup_init(currcons); + gotoxy(currcons,x,y); csi_J(currcons, 0); update_screen(fg_console); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm/Config.in linux.20pre5-ac2/drivers/char/drm/Config.in --- linux.20pre5/drivers/char/drm/Config.in 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm/Config.in 2002-08-30 16:25:19.000000000 +0100 @@ -6,7 +6,7 @@ # tristate ' 3dfx Banshee/Voodoo3+' CONFIG_DRM_TDFX -#tristate ' 3dlabs GMX 2000' CONFIG_DRM_GAMMA +tristate ' 3dlabs GMX 2000' CONFIG_DRM_GAMMA tristate ' ATI Rage 128' CONFIG_DRM_R128 dep_tristate ' ATI Radeon' CONFIG_DRM_RADEON $CONFIG_AGP dep_tristate ' Intel I810' CONFIG_DRM_I810 $CONFIG_AGP diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm/drm_bufs.h linux.20pre5-ac2/drivers/char/drm/drm_bufs.h --- linux.20pre5/drivers/char/drm/drm_bufs.h 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm/drm_bufs.h 2002-09-02 14:57:05.000000000 +0100 @@ -181,6 +181,9 @@ sizeof(map->offset) ) ) return -EFAULT; } +#if __HAVE_MMIO_TRACKING + DRM(map_added)(dev, map); +#endif return 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm/drm_dma.h linux.20pre5-ac2/drivers/char/drm/drm_dma.h --- linux.20pre5/drivers/char/drm/drm_dma.h 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm/drm_dma.h 2002-09-02 14:57:05.000000000 +0100 @@ -509,9 +509,10 @@ { int ret; - if ( !irq ) + if ( !irq || !dev->dma) return -EINVAL; + printk("irq_install\n"); down( &dev->struct_sem ); if ( dev->irq ) { up( &dev->struct_sem ); @@ -526,6 +527,8 @@ dev->interrupt_flag = 0; dev->dma_flag = 0; + printk("irq_install dma\n"); + dev->dma->next_buffer = NULL; dev->dma->next_queue = NULL; dev->dma->this_buffer = NULL; @@ -536,9 +539,13 @@ dev->tq.routine = DRM(dma_immediate_bh); dev->tq.data = dev; #endif + printk("irq_install pred\n"); + /* Before installing handler */ DRIVER_PREINSTALL(); + printk("irq_install prod\n"); + /* Install handler */ ret = request_irq( dev->irq, DRM(dma_service), @@ -549,9 +556,13 @@ up( &dev->struct_sem ); return ret; } + printk("irq_install pos\n"); + /* After installing handler */ DRIVER_POSTINSTALL(); + printk("irq_install done\n"); + return 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm/drm_drv.h linux.20pre5-ac2/drivers/char/drm/drm_drv.h --- linux.20pre5/drivers/char/drm/drm_drv.h 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm/drm_drv.h 2002-08-06 15:42:07.000000000 +0100 @@ -220,7 +220,9 @@ MODULE_AUTHOR( DRIVER_AUTHOR ); MODULE_DESCRIPTION( DRIVER_DESC ); MODULE_PARM( drm_opts, "s" ); +#ifdef MODULE_LICENSE MODULE_LICENSE("GPL and additional rights"); +#endif static int DRM(setup)( drm_device_t *dev ) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm/drm_vm.h linux.20pre5-ac2/drivers/char/drm/drm_vm.h --- linux.20pre5/drivers/char/drm/drm_vm.h 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm/drm_vm.h 2002-09-02 14:57:05.000000000 +0100 @@ -141,7 +141,7 @@ return NOPAGE_OOM; get_page(page); - DRM_DEBUG("0x%08lx => 0x%08llx\n", address, (u64)page_to_bus(page)); + DRM_DEBUG("0x%08lx => 0x%08x\n", address, page_to_bus(page)); return page; } @@ -243,8 +243,8 @@ get_page(page); - DRM_DEBUG("0x%08lx (page %lu) => 0x%08llx\n", address, page_nr, - (u64)page_to_bus(page)); + DRM_DEBUG("0x%08lx (page %lu) => 0x%08x\n", address, page_nr, + page_to_bus(page)); return page; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm/gamma_dma.c linux.20pre5-ac2/drivers/char/drm/gamma_dma.c --- linux.20pre5/drivers/char/drm/gamma_dma.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm/gamma_dma.c 2002-08-31 01:08:17.000000000 +0100 @@ -581,3 +581,15 @@ return retcode; } + +void DRM(map_added)(drm_device_t *dev, drm_map_t *map) +{ + drm_gamma_private_t *dev_priv = (drm_gamma_private_t *)dev->dev_private; + switch(dev_priv->mmioct++) + { + case 0: dev_priv->mmio0 = map;break; + case 1: dev_priv->mmio1 = map;break; + case 2: dev_priv->mmio2 = map;break; + case 3: dev_priv->mmio3 = map;break; + } +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm/gamma_drv.h linux.20pre5-ac2/drivers/char/drm/gamma_drv.h --- linux.20pre5/drivers/char/drm/gamma_drv.h 2002-08-29 18:39:40.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm/gamma_drv.h 2002-08-31 01:04:06.000000000 +0100 @@ -39,6 +39,7 @@ drm_map_t *mmio1; drm_map_t *mmio2; drm_map_t *mmio3; + int mmioct; } drm_gamma_private_t; #define LOCK_TEST_WITH_RETURN( dev ) \ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm/gamma.h linux.20pre5-ac2/drivers/char/drm/gamma.h --- linux.20pre5/drivers/char/drm/gamma.h 2002-08-29 18:39:40.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm/gamma.h 2002-08-31 01:06:16.000000000 +0100 @@ -90,4 +90,6 @@ GAMMA_WRITE( GAMMA_GINTENABLE, 0x00000000 ); \ } while (0) +#define __HAVE_MMIO_TRACKING 1 + #endif /* __GAMMA_H__ */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm/i810_dma.c linux.20pre5-ac2/drivers/char/drm/i810_dma.c --- linux.20pre5/drivers/char/drm/i810_dma.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm/i810_dma.c 2002-08-30 13:37:06.000000000 +0100 @@ -218,7 +218,7 @@ down_write( ¤t->mm->mmap_sem ); retcode = do_munmap(current->mm, (unsigned long)buf_priv->virtual, - (size_t) buf->total); + (size_t) buf->total, 1); up_write( ¤t->mm->mmap_sem ); } buf_priv->currently_mapped = I810_BUF_UNMAPPED; @@ -484,24 +484,18 @@ if (copy_from_user(&init, (drm_i810_init_t *)arg, sizeof(init))) return -EFAULT; - if ((xfreeversion == 41) || - ((xfreeversion == -1) && (init.pitch == 0))) { - /* - * Ok we have a problem here. Someone decided it was - * funny to add two fields in the middle of the - * drm_i810_init_it structure in the transition between - * XFree86 4.1.0 and 4.2.0. - * - * The code below tries to fix this ABI breakage up as - * good as possible, unfortionatly it's impossible to - * autodetect which interface the user wants, hence the - * module parameter -- Arjan - */ - + if ((xfreeversion==41) || ((xfreeversion==-1)&&(init.pitch==0))) { + /* Ok we have a problem here. Someone decided it was funny to add + * two fields in the middle of the drm_i810_init_it structure in the + * transition between XFree86 4.1.0 and 4.2.0. The code below tries + * to fix this ABI breakage up as good as possible, unfortionatly + * it's impossible to autodetect which interface the user wants, + * hence the module parameter -- Arjan + */ init.pitch_bits = init.h; - init.pitch = init.w; - init.h = init.overlay_physical; - init.w = init.overlay_offset; + init.pitch = init.w; + init.h = init.overlay_physical; + init.w = init.overlay_offset; init.overlay_physical = 0; init.overlay_offset = 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm/i830_dma.c linux.20pre5-ac2/drivers/char/drm/i830_dma.c --- linux.20pre5/drivers/char/drm/i830_dma.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm/i830_dma.c 2002-08-29 22:54:38.000000000 +0100 @@ -95,7 +95,7 @@ { drm_device_dma_t *dma = dev->dma; drm_i830_private_t *dev_priv = dev->dev_private; - u8 *temp = dev_priv->hw_status_page; + u32 *temp = dev_priv->hw_status_page; int i; DRM_DEBUG( "hw_status: Interrupt Status : %x\n", temp[0]); @@ -233,7 +233,7 @@ down_write( ¤t->mm->mmap_sem ); retcode = do_munmap(current->mm, (unsigned long)buf_priv->virtual, - (size_t) buf->total); + (size_t) buf->total, 1); up_write( ¤t->mm->mmap_sem ); } buf_priv->currently_mapped = I830_BUF_UNMAPPED; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm/mga_dma.c linux.20pre5-ac2/drivers/char/drm/mga_dma.c --- linux.20pre5/drivers/char/drm/mga_dma.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm/mga_dma.c 2002-08-29 22:54:44.000000000 +0100 @@ -158,9 +158,18 @@ { drm_mga_primary_buffer_t *primary = &dev_priv->prim; u32 head, tail; + u32 status = 0; + int i; DMA_LOCALS; DRM_DEBUG( "%s:\n", __FUNCTION__ ); + /* We need to wait so that we can do an safe flush */ + for ( i = 0 ; i < dev_priv->usec_timeout ; i++ ) { + status = MGA_READ( MGA_STATUS ) & MGA_ENGINE_IDLE_MASK; + if ( status == MGA_ENDPRDMASTS ) break; + udelay( 1 ); + } + if ( primary->tail == primary->last_flush ) { DRM_DEBUG( " bailing out...\n" ); return; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm/sis_ds.c linux.20pre5-ac2/drivers/char/drm/sis_ds.c --- linux.20pre5/drivers/char/drm/sis_ds.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm/sis_ds.c 2002-09-01 17:44:07.000000000 +0100 @@ -49,15 +49,16 @@ set_t *set; set = (set_t *)MALLOC(sizeof(set_t)); - for(i = 0; i < SET_SIZE; i++){ - set->list[i].free_next = i+1; - set->list[i].alloc_next = -1; - } - set->list[SET_SIZE-1].free_next = -1; - set->free = 0; - set->alloc = -1; - set->trace = -1; - + if (set) { + for(i = 0; i < SET_SIZE; i++){ + set->list[i].free_next = i+1; + set->list[i].alloc_next = -1; + } + set->list[SET_SIZE-1].free_next = -1; + set->free = 0; + set->alloc = -1; + set->trace = -1; + } return set; } @@ -171,7 +172,8 @@ { void *addr; addr = kmalloc(nmemb*size, GFP_KERNEL); - memset(addr, 0, nmemb*size); + if (addr) + memset(addr, 0, nmemb*size); return addr; } #define free(n) kfree(n) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm-4.0/i810_dma.c linux.20pre5-ac2/drivers/char/drm-4.0/i810_dma.c --- linux.20pre5/drivers/char/drm-4.0/i810_dma.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm-4.0/i810_dma.c 2002-08-06 15:42:07.000000000 +0100 @@ -231,7 +231,7 @@ #else retcode = do_munmap(current->mm, (unsigned long)buf_priv->virtual, - (size_t) buf->total); + (size_t) buf->total, 1); #endif up_write(¤t->mm->mmap_sem); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/drm-4.0/tdfx_drv.c linux.20pre5-ac2/drivers/char/drm-4.0/tdfx_drv.c --- linux.20pre5/drivers/char/drm-4.0/tdfx_drv.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/drm-4.0/tdfx_drv.c 2002-08-21 22:26:53.000000000 +0100 @@ -554,7 +554,6 @@ lock.context, current->pid, j, dev->lock.lock_time, jiffies); current->state = TASK_INTERRUPTIBLE; - current->policy |= SCHED_YIELD; schedule_timeout(DRM_LOCK_SLICE-j); DRM_DEBUG("jiffies=%d\n", jiffies); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/keyboard.c linux.20pre5-ac2/drivers/char/keyboard.c --- linux.20pre5/drivers/char/keyboard.c 2002-08-29 18:39:37.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/keyboard.c 2002-08-06 15:42:07.000000000 +0100 @@ -42,6 +42,9 @@ #include #include #include +#include /* for mdelay() */ + +#include #define SIZE(x) (sizeof(x)/sizeof((x)[0])) @@ -100,20 +103,21 @@ typedef void (*k_hand)(unsigned char value, char up_flag); typedef void (k_handfn)(unsigned char value, char up_flag); + static k_handfn do_self, do_fn, do_spec, do_pad, do_dead, do_cons, do_cur, do_shift, - do_meta, do_ascii, do_lock, do_lowercase, do_slock, do_dead2, - do_ignore; + do_meta, do_ascii, do_lock, do_lowercase, do_slock, + do_spkup, do_dead2, do_ignore; -static k_hand key_handler[16] = { +static k_hand key_handler[17] = { do_self, do_fn, do_spec, do_pad, do_dead, do_cons, do_cur, do_shift, - do_meta, do_ascii, do_lock, do_lowercase, do_slock, do_dead2, - do_ignore, do_ignore + do_meta, do_ascii, do_lock, do_lowercase, do_slock, + do_spkup, do_dead2, do_ignore, do_ignore }; /* Key types processed even in raw modes */ -#define TYPES_ALLOWED_IN_RAW_MODE ((1 << KT_SPEC) | (1 << KT_SHIFT)) +#define TYPES_ALLOWED_IN_RAW_MODE ((1 << KT_SPEC) | (1 << KT_SHIFT) | (1 << KT_SPKUP)) typedef void (*void_fnp)(void); typedef void (void_fn)(void); @@ -137,7 +141,7 @@ 255, SIZE(func_table) - 1, SIZE(spec_fn_table) - 1, NR_PAD - 1, NR_DEAD - 1, 255, 3, NR_SHIFT - 1, 255, NR_ASCII - 1, NR_LOCK - 1, 255, - NR_LOCK - 1, 255 + NR_LOCK - 1, NR_SPKUP - 1, 255, 255 }; const int NR_TYPES = SIZE(max_vals); @@ -257,6 +261,7 @@ raw_mode = 1; /* Most key classes will be ignored */ } + /* * Small change in philosophy: earlier we defined repetition by * rep = keycode == prev_keycode; @@ -286,24 +291,26 @@ type = KTYP(keysym); if (type >= 0xf0) { - type -= 0xf0; - if (raw_mode && ! (TYPES_ALLOWED_IN_RAW_MODE & (1 << type))) - goto out; - if (type == KT_LETTER) { - type = KT_LATIN; - if (vc_kbd_led(kbd, VC_CAPSLOCK)) { - key_map = key_maps[shift_final ^ (1<slockstate = 0; + if (!up_flag) + speakup_reset(fg_console, type); + (*key_handler[type])(keysym & 0xff, up_flag); + if (type != KT_SLOCK) + kbd->slockstate = 0; } else { - /* maybe only if (kbd->kbdmode == VC_UNICODE) ? */ - if (!up_flag && !raw_mode) - to_utf8(keysym); + /* maybe only if (kbd->kbdmode == VC_UNICODE) ? */ + if (!up_flag && !raw_mode) + to_utf8(keysym); } } else { /* maybe beep? */ @@ -315,7 +322,7 @@ keysym = U(key_maps[0][keycode]); type = KTYP(keysym); if (type == KT_SHIFT) - (*key_handler[type])(keysym & 0xff, up_flag); + (*key_handler[type])(keysym & 0xff, up_flag); #endif } } @@ -528,6 +535,138 @@ compute_shiftstate(); } +#ifdef CONFIG_SPEAKUP /* speech output for linux */ +static void do_spkup(unsigned char value, char up_flag) +{ + speakup_savekey(0); /* clear! brzzzot */ + if (up_flag) + return; /* do nothing on key release */ + + if (value == SPEECH_KILL) { + speakup_kill(fg_console); + return; + } + + if (speakup_console[fg_console]->shut_up & 0x40) return; + + switch(value) { + case (QUICK_QUIET): + /* -x- */ + spkup_write("\x18", 1); + return; + case (LINE_QUIET): + return; + case (FULL_QUIET): + spkup_write("\x18", 1); + speakup_shut_up(fg_console); + return; + case (SAY_CHAR): + say_curr_char(fg_console); + return; + case (SAY_PREV_CHAR): + say_prev_char(fg_console); + return; + case (SAY_NEXT_CHAR): + say_next_char(fg_console); + return; + case (SAY_WORD): + say_curr_word(fg_console); + return; + case (SAY_PREV_WORD): + say_prev_word(fg_console); + return; + case (SAY_NEXT_WORD): + say_next_word(fg_console); + return; + case (SAY_LINE): + say_curr_line(fg_console); + return; + case (SAY_PREV_LINE): + say_prev_line(fg_console); + return; + case (SAY_NEXT_LINE): + say_next_line(fg_console); + return; + case (TOP_EDGE): + top_edge(fg_console); + return; + case (BOTTOM_EDGE): + bottom_edge(fg_console); + return; + case (LEFT_EDGE): + left_edge(fg_console); + return; + case (RIGHT_EDGE): + right_edge(fg_console); + return; + case (SAY_PHONETIC_CHAR): + say_phonetic_char(fg_console); + return; + case (SPELL_WORD): + spell_word(fg_console); + return; + case (SPELL_PHONETIC_WORD): + return; + case (SAY_SCREEN): + say_screen(fg_console); + return; + case (SAY_WINDOW): + return; + case (SET_SPEED): + return; + case (SET_PITCH): + return; + case (SET_PUNCTUATION): + return; + case (SET_VOICE): + return; + case (SET_TONE): + return; + case (SAY_POSITION): + say_position(fg_console); + return; + case (SAY_CHAR_NUM): + say_char_num(fg_console); + return; + case (SPEECH_OFF): + speakup_off(fg_console); + return; + case (SPEAKUP_CURSORING): + speakup_cursoring(fg_console); + return; + case (SPEAKUP_CUT): + speakup_cut(fg_console, tty); + return; + case (SPEAKUP_PASTE): + speakup_paste(tty); + return; + case (SAY_ATTRIBUTES): + say_attributes(fg_console); + return; + case (SPEAKUP_PARKED): + speakup_parked(fg_console); + return; + case (SAY_FROM_TOP): + say_from_top(fg_console); + return; + case (SAY_TO_BOTTOM): + say_to_bottom(fg_console); + return; + case (SAY_FROM_LEFT): + say_from_left(fg_console); + return; + case (SAY_TO_RIGHT): + say_to_right(fg_console); + return; + default: + spkup_write("SpeakUp: Invalid command", 25); + return; +} +} +#else +static void do_spkup(unsigned char value, char up_flag) {}; +#endif + static void do_spec(unsigned char value, char up_flag) { if (up_flag) @@ -538,6 +677,7 @@ !(SPECIALS_ALLOWED_IN_RAW_MODE & (1 << value))) return; spec_fn_table[value](); + speakup_control(fg_console, kbd, value); } static void do_lowercase(unsigned char value, char up_flag) @@ -551,7 +691,8 @@ return; /* no action, if this is a key release */ if (diacr) - value = handle_diacr(value); + if ((value = handle_diacr(value)) == 0xff) /* speakup goto pos trigger*/ + return; if (dead_key_next) { dead_key_next = 0; @@ -559,6 +700,7 @@ return; } + speakup_savekey(value); put_queue(value); } @@ -568,8 +710,10 @@ #define A_TILDE '~' #define A_DIAER '"' #define A_CEDIL ',' +#define SPEAKUP_DIACR '$' + static unsigned char ret_diacr[NR_DEAD] = - {A_GRAVE, A_ACUTE, A_CFLEX, A_TILDE, A_DIAER, A_CEDIL }; + {A_GRAVE, A_ACUTE, A_CFLEX, A_TILDE, A_DIAER, A_CEDIL, SPEAKUP_DIACR}; /* Obsolete - for backwards compatibility only */ static void do_dead(unsigned char value, char up_flag) @@ -588,6 +732,12 @@ if (up_flag) return; + if (value == SPEAKUP_DIACR) { /*beep to alert that speakup's waiting */ + kd_mksound(1250,10); + mdelay(100); + kd_mksound(1500,15); + } + diacr = (diacr ? handle_diacr(value) : value); } @@ -604,6 +754,12 @@ int d = diacr; int i; + if (d == '$') { + if (speakup_diacr(ch,fg_console)) + diacr = 0; + return 0xff; + } + diacr = 0; for (i = 0; i < accent_table_size; i++) { @@ -657,7 +813,7 @@ do_fn(KVAL(K_REMOVE), 0); return; case KVAL(K_P0): - do_fn(KVAL(K_INSERT), 0); + do_fn(KVAL(K_INSERT), 0); return; case KVAL(K_P1): do_fn(KVAL(K_SELECT), 0); @@ -717,6 +873,10 @@ clr_vc_kbd_led(kbd, VC_CAPSLOCK); } + /* shift = 0, altgr = 1, ctrl=2, alt=3 */ + if (!up_flag) + speakup_control(fg_console, kbd, value); + if (up_flag) { /* handle the case that two shift or control keys are depressed simultaneously */ @@ -805,6 +965,7 @@ if (up_flag || rep) return; chg_vc_kbd_lock(kbd, value); + } static void do_slock(unsigned char value, char up_flag) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/Makefile linux.20pre5-ac2/drivers/char/Makefile --- linux.20pre5/drivers/char/Makefile 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/Makefile 2002-08-13 14:21:38.000000000 +0100 @@ -226,6 +226,7 @@ obj-$(CONFIG_DS1620) += ds1620.o obj-$(CONFIG_INTEL_RNG) += i810_rng.o obj-$(CONFIG_AMD_RNG) += amd768_rng.o +obj-$(CONFIG_AMD_PM768) += amd76x_pm.o obj-$(CONFIG_ITE_GPIO) += ite_gpio.o obj-$(CONFIG_AU1000_GPIO) += au1000_gpio.o @@ -243,6 +244,14 @@ obj-y += ftape/ftape.o endif +ifeq ($(CONFIG_SPEAKUP),y) +subdir-y += speakup +obj-y += speakup/spk.o +ifeq ($(CONFIG_SPEAKUP_KEYMAP),y) +KEYMAP = speakup/speakupmap.o +endif +endif + obj-$(CONFIG_H8) += h8.o obj-$(CONFIG_PPDEV) += ppdev.o obj-$(CONFIG_DZ) += dz.o @@ -271,10 +280,12 @@ obj-$(CONFIG_SH_WDT) += shwdt.o obj-$(CONFIG_EUROTECH_WDT) += eurotechwdt.o obj-$(CONFIG_ALIM7101_WDT) += alim7101_wdt.o +obj-$(CONFIG_ALIM1535_WDT) += alim1535d_wdt.o obj-$(CONFIG_INDYDOG) += indydog.o obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o obj-$(CONFIG_WAFER_WDT) += wafer5823wdt.o obj-$(CONFIG_SOFT_WATCHDOG) += softdog.o +obj-$(CONFIG_AMD7XX_TCO) += amd7xx_tco.o subdir-$(CONFIG_MWAVE) += mwave ifeq ($(CONFIG_MWAVE),y) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/mwave/mwavedd.c linux.20pre5-ac2/drivers/char/mwave/mwavedd.c --- linux.20pre5/drivers/char/mwave/mwavedd.c 2002-08-29 18:39:40.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/mwave/mwavedd.c 2002-08-06 15:42:07.000000000 +0100 @@ -279,7 +279,6 @@ pDrvData->IPCs[ipcnum].bIsHere = FALSE; pDrvData->IPCs[ipcnum].bIsEnabled = TRUE; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) - current->nice = -20; /* boost to provide priority timing */ #else current->priority = 0x28; /* boost to provide priority timing */ #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/n_r3964.c linux.20pre5-ac2/drivers/char/n_r3964.c --- linux.20pre5/drivers/char/n_r3964.c 2002-08-29 18:39:40.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/n_r3964.c 2002-08-06 15:42:07.000000000 +0100 @@ -1364,7 +1364,7 @@ pHeader->owner = pClient; } - copy_from_user (pHeader->data, data, count); /* We already verified this */ + __copy_from_user(pHeader->data, data, count); /* We already verified this */ if(pInfo->flags & R3964_DEBUG) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/nwflash.c linux.20pre5-ac2/drivers/char/nwflash.c --- linux.20pre5/drivers/char/nwflash.c 2002-08-29 18:39:37.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/nwflash.c 2002-08-06 15:42:07.000000000 +0100 @@ -154,12 +154,11 @@ if (down_interruptible(&nwflash_sem)) return -ERESTARTSYS; - ret = copy_to_user(buf, (void *)(FLASH_BASE + p), count); - if (ret == 0) { - ret = count; - *ppos += count; - } + ret = count - copy_to_user(buf, (void *)(FLASH_BASE + p), count); + *ppos += ret; up(&nwflash_sem); + if (ret == 0) + ret = -EFAULT; } return ret; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/pc_keyb.c linux.20pre5-ac2/drivers/char/pc_keyb.c --- linux.20pre5/drivers/char/pc_keyb.c 2002-08-29 18:39:37.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/pc_keyb.c 2002-08-06 15:42:07.000000000 +0100 @@ -64,7 +64,6 @@ static void kbd_write_command_w(int data); static void kbd_write_output_w(int data); #ifdef CONFIG_PSMOUSE -static void aux_write_ack(int val); static void __aux_write_ack(int val); static int aux_reconnect = 0; #endif @@ -1001,6 +1000,7 @@ kb_wait(); } +#ifdef INITIALIZE_MOUSE static void aux_write_ack(int val) { unsigned long flags; @@ -1009,6 +1009,7 @@ __aux_write_ack(val); spin_unlock_irqrestore(&kbd_controller_lock, flags); } +#endif static unsigned char get_from_queue(void) { @@ -1066,6 +1067,9 @@ static int open_aux(struct inode * inode, struct file * file) { + unsigned long flags; + int cnt, status; + if (aux_count++) { return 0; } @@ -1077,7 +1081,30 @@ kbd_write_command_w(KBD_CCMD_MOUSE_ENABLE); /* Enable the auxiliary port on controller. */ - aux_write_ack(AUX_ENABLE_DEV); /* Enable aux device */ + + spin_lock_irqsave(&kbd_controller_lock, flags); + __aux_write_ack(AUX_ENABLE_DEV); /* Enable aux device */ + for(cnt = 50; cnt > 0; --cnt) { + status = handle_kbd_event(); + if (mouse_reply_expected == 0 || + (status & (KBD_STAT_GTO | KBD_STAT_PERR))) + break; + set_current_state(TASK_UNINTERRUPTIBLE); + spin_unlock_irqrestore(&kbd_controller_lock, flags); + schedule_timeout(2); + spin_lock_irqsave(&kbd_controller_lock, flags); + set_current_state(TASK_RUNNING); + } + if (cnt == 0 || (status & (KBD_STAT_GTO | KBD_STAT_PERR))) { + --aux_count; + spin_unlock_irqrestore(&kbd_controller_lock, flags); + kbd_write_cmd(AUX_INTS_OFF); + kbd_write_command_w(KBD_CCMD_MOUSE_DISABLE); + aux_free_irq(AUX_DEV); + return -ENXIO; + } + spin_unlock_irqrestore(&kbd_controller_lock, flags); + kbd_write_cmd(AUX_INTS_ON); /* Enable controller ints */ mdelay(2); /* Ensure we follow the kbc access delay rules.. */ @@ -1217,41 +1244,13 @@ #endif /* CONFIG_PSMOUSE */ -static int blink_frequency = HZ/2; +void pckbd_blink (char led) { + led = led ? (0x01 | 0x04) : 0x00; -/* Tell the user who may be running in X and not see the console that we have - panic'ed. This is to distingush panics from "real" lockups. - Could in theory send the panic message as morse, but that is left as an - exercise for the reader. */ -void panic_blink(void) -{ - static unsigned long last_jiffie; - static char led; - /* Roughly 1/2s frequency. KDB uses about 1s. Make sure it is - different. */ - if (!blink_frequency) - return; - if (jiffies - last_jiffie > blink_frequency) { - led ^= 0x01 | 0x04; while (kbd_read_status() & KBD_STAT_IBF) mdelay(1); kbd_write_output(KBD_CMD_SET_LEDS); mdelay(1); while (kbd_read_status() & KBD_STAT_IBF) mdelay(1); mdelay(1); kbd_write_output(led); - last_jiffie = jiffies; - } -} - -static int __init panicblink_setup(char *str) -{ - int par; - if (get_option(&str,&par)) - blink_frequency = par*(1000/HZ); - return 1; } - -/* panicblink=0 disables the blinking as it caused problems with some console - switches. otherwise argument is ms of a blink period. */ -__setup("panicblink=", panicblink_setup); - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/raw.c linux.20pre5-ac2/drivers/char/raw.c --- linux.20pre5/drivers/char/raw.c 2002-08-29 18:39:40.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/raw.c 2002-08-06 15:42:07.000000000 +0100 @@ -23,6 +23,7 @@ struct block_device *binding; int inuse, sector_size, sector_bits; struct semaphore mutex; + int can_do_vary; } raw_device_data_t; static raw_device_data_t raw_devices[256]; @@ -119,6 +120,8 @@ if (raw_devices[minor].inuse++) goto out; + raw_devices[minor].can_do_vary = + get_blkdev_varyio(MAJOR(rdev), MINOR(rdev)); /* * Don't interfere with mounted devices: we cannot safely set * the blocksize on a device which is already mounted. @@ -128,6 +131,7 @@ if (is_mounted(rdev)) { if (blksize_size[MAJOR(rdev)]) sector_size = blksize_size[MAJOR(rdev)][MINOR(rdev)]; + raw_devices[minor].can_do_vary = 0; } else { if (hardsect_size[MAJOR(rdev)]) sector_size = hardsect_size[MAJOR(rdev)][MINOR(rdev)]; @@ -135,6 +139,7 @@ set_blocksize(rdev, sector_size); raw_devices[minor].sector_size = sector_size; + filp->f_iobuf->dovary = raw_devices[minor].can_do_vary; for (sector_bits = 0; !(sector_size & 1); ) sector_size>>=1, sector_bits++; @@ -201,9 +206,10 @@ /* First, find out which raw minor we want */ - err = copy_from_user(&rq, (void *) arg, sizeof(rq)); - if (err) + if (copy_from_user(&rq, (void *) arg, sizeof(rq))) { + err = -EFAULT; break; + } minor = rq.raw_minor; if (minor <= 0 || minor > MINORMASK) { @@ -260,6 +266,8 @@ rq.block_major = rq.block_minor = 0; } err = copy_to_user((void *) arg, &rq, sizeof(rq)); + if (err) + err = -EFAULT; } break; @@ -322,6 +330,7 @@ if (err) goto out; new_iobuf = 1; + iobuf->dovary = raw_devices[minor].can_do_vary; } dev = to_kdev_t(raw_devices[minor].binding->bd_dev); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/sbc60xxwdt.c linux.20pre5-ac2/drivers/char/sbc60xxwdt.c --- linux.20pre5/drivers/char/sbc60xxwdt.c 2002-08-29 18:39:40.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/sbc60xxwdt.c 2002-08-25 16:20:25.000000000 +0100 @@ -300,15 +300,16 @@ unregister_reboot_notifier(&wdt_notifier); release_region(WDT_START,1); - release_region(WDT_STOP,1); +// release_region(WDT_STOP,1); } static int __init sbc60xxwdt_init(void) { int rc = -EBUSY; - if (!request_region(WDT_STOP, 1, "SBC 60XX WDT")) - goto err_out; +// We cannot reserve 0x45 - the kernel already has! +// if (!request_region(WDT_STOP, 1, "SBC 60XX WDT")) +// goto err_out; if (!request_region(WDT_START, 1, "SBC 60XX WDT")) goto err_out_region1; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/serial.c linux.20pre5-ac2/drivers/char/serial.c --- linux.20pre5/drivers/char/serial.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/serial.c 2002-08-13 14:21:58.000000000 +0100 @@ -62,6 +62,10 @@ * Robert Schwebel , * Juergen Beisert , * Theodore Ts'o + * 4/02: added TTY_DO_WRITE_WAKEUP to enable n_tty to send POLL_OUTS + * to waiting processes + * Sapan Bhatia + * */ static char *serial_version = "5.05c"; @@ -203,6 +207,7 @@ #include #include #include +#include #if (LINUX_VERSION_CODE >= 131343) #include #endif @@ -1213,7 +1218,7 @@ if (!page) return -ENOMEM; - save_flags(flags); cli(); + spin_lock_irqsave( &info->irq_spinlock, flags); if (info->flags & ASYNC_INITIALIZED) { free_page(page); @@ -1451,11 +1456,11 @@ change_speed(info, 0); info->flags |= ASYNC_INITIALIZED; - restore_flags(flags); + spin_unlock_irqrestore( &info->irq_spinlock, flags); return 0; errout: - restore_flags(flags); + spin_unlock_irqrestore( &info->irq_spinlock, flags); return retval; } @@ -1479,7 +1484,7 @@ state->irq); #endif - save_flags(flags); cli(); /* Disable interrupts */ + spin_lock_irqsave( &info->irq_spinlock, flags); /* * clear delta_msr_wait queue to avoid mem leaks: we may free the irq @@ -1487,41 +1492,6 @@ */ wake_up_interruptible(&info->delta_msr_wait); - /* - * First unlink the serial port from the IRQ chain... - */ - if (info->next_port) - info->next_port->prev_port = info->prev_port; - if (info->prev_port) - info->prev_port->next_port = info->next_port; - else - IRQ_ports[state->irq] = info->next_port; - figure_IRQ_timeout(state->irq); - - /* - * Free the IRQ, if necessary - */ - if (state->irq && (!IRQ_ports[state->irq] || - !IRQ_ports[state->irq]->next_port)) { - if (IRQ_ports[state->irq]) { - free_irq(state->irq, &IRQ_ports[state->irq]); - retval = request_irq(state->irq, rs_interrupt_single, - SA_SHIRQ, "serial", - &IRQ_ports[state->irq]); - - if (retval) - printk("serial shutdown: request_irq: error %d" - " Couldn't reacquire IRQ.\n", retval); - } else - free_irq(state->irq, &IRQ_ports[state->irq]); - } - - if (info->xmit.buf) { - unsigned long pg = (unsigned long) info->xmit.buf; - info->xmit.buf = 0; - free_page(pg); - } - info->IER = 0; serial_outp(info, UART_IER, 0x00); /* disable all intrs */ #ifdef CONFIG_SERIAL_MANY_PORTS @@ -1578,7 +1548,43 @@ serial_outp(info, UART_IER, UART_IERX_SLEEP); } info->flags &= ~ASYNC_INITIALIZED; - restore_flags(flags); + + /* + * First unlink the serial port from the IRQ chain... + */ + if (info->next_port) + info->next_port->prev_port = info->prev_port; + if (info->prev_port) + info->prev_port->next_port = info->next_port; + else + IRQ_ports[state->irq] = info->next_port; + figure_IRQ_timeout(state->irq); + + /* + * Free the IRQ, if necessary + */ + if (state->irq && (!IRQ_ports[state->irq] || + !IRQ_ports[state->irq]->next_port)) { + if (IRQ_ports[state->irq]) { + free_irq(state->irq, &IRQ_ports[state->irq]); + retval = request_irq(state->irq, rs_interrupt_single, + SA_SHIRQ, "serial", + &IRQ_ports[state->irq]); + + if (retval) + printk("serial shutdown: request_irq: error %d" + " Couldn't reacquire IRQ.\n", retval); + } else + free_irq(state->irq, &IRQ_ports[state->irq]); + } + + if (info->xmit.buf) { + unsigned long pg = (unsigned long) info->xmit.buf; + info->xmit.buf = 0; + free_page(pg); + } + + spin_unlock_irqrestore( &info->irq_spinlock, flags); } #if (LINUX_VERSION_CODE < 131394) /* Linux 2.1.66 */ @@ -3123,6 +3129,7 @@ info->tqueue.routine = do_softint; info->tqueue.data = info; info->state = sstate; + spin_lock_init(&info->irq_spinlock); if (sstate->info) { kfree(info); *ret_info = sstate->info; @@ -3237,6 +3244,7 @@ #ifdef SERIAL_DEBUG_OPEN printk("rs_open ttys%d successful...", info->line); #endif + set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); return 0; } @@ -3650,6 +3658,7 @@ info->io_type = state->io_type; info->iomem_base = state->iomem_base; info->iomem_reg_shift = state->iomem_reg_shift; + info->irq_spinlock= (spinlock_t) SPIN_LOCK_UNLOCKED; save_flags(flags); cli(); @@ -3902,7 +3911,14 @@ case 6: /* BAR 4*/ case 7: base_idx=idx-2; /* BAR 5*/ } - + + /* AFAVLAB uses a different mixture of BARs and offsets */ + /* Not that ugly ;) -- HW */ + if (dev->vendor == PCI_VENDOR_ID_AFAVLAB && idx >= 4) { + base_idx = 4; + offset = (idx - 4) * 8; + } + /* Some Titan cards are also a little weird */ if (dev->vendor == PCI_VENDOR_ID_TITAN && (dev->device == PCI_DEVICE_ID_TITAN_400L || @@ -4306,9 +4322,11 @@ pbn_b0_bt_1_115200, pbn_b0_bt_2_115200, + pbn_b0_bt_8_115200, pbn_b0_bt_1_460800, pbn_b0_bt_2_460800, pbn_b0_bt_2_921600, + pbn_b0_bt_4_460800, pbn_b1_1_115200, pbn_b1_2_115200, @@ -4387,9 +4405,11 @@ { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 115200 }, /* pbn_b0_bt_1_115200 */ { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 115200 }, /* pbn_b0_bt_2_115200 */ + { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 8, 115200 }, /* pbn_b0_bt_8_115200 */ { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 1, 460800 }, /* pbn_b0_bt_1_460800 */ { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 460800 }, /* pbn_b0_bt_2_460800 */ { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 2, 921600 }, /* pbn_b0_bt_2_921600 */ + { SPCI_FL_BASE0 | SPCI_FL_BASE_TABLE, 4, 460800 }, /* pbn_b0_bt_4_460800 */ { SPCI_FL_BASE1, 1, 115200 }, /* pbn_b1_1_115200 */ { SPCI_FL_BASE1, 2, 115200 }, /* pbn_b1_2_115200 */ @@ -4854,6 +4874,12 @@ { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_QUAD_B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b0_bt_2_460800 }, + { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_A, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, + pbn_b0_bt_4_460800 }, + { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_OCTO_B, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, + pbn_b0_bt_4_460800 }, { PCI_VENDOR_ID_LAVA, PCI_DEVICE_ID_LAVA_SSERIAL, PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b0_bt_1_115200 }, @@ -4866,6 +4892,11 @@ PCI_ANY_ID, PCI_ANY_ID, 0, 0, pbn_b2_bt_2_115200 }, + /* AFAVLAB serial card, from Harald Welte */ + { PCI_VENDOR_ID_AFAVLAB, PCI_DEVICE_ID_AFAVLAB_P028, + PCI_ANY_ID, PCI_ANY_ID, 0, 0, + pbn_b0_bt_8_115200 }, + /* EKF addition for i960 Boards form EKF with serial port */ { PCI_VENDOR_ID_INTEL, 0x1960, 0xE4BF, PCI_ANY_ID, 0, 0, @@ -4885,6 +4916,7 @@ 0x1048, 0x1500, 0, 0, pbn_b1_1_115200 }, + /* SGI IOC3 board */ { PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC3, 0xFF00, 0, 0, 0, pbn_sgi_ioc3 }, @@ -5537,12 +5569,22 @@ tty_register_devfs(&callout_driver, 0, callout_driver.minor_start + state->line); } +#ifdef CONFIG_SERIAL_GSC + probe_serial_gsc(); +#endif +#ifdef CONFIG_SUPERIO + superio_serial_init(); +#endif #ifdef ENABLE_SERIAL_PCI probe_serial_pci(); #endif #ifdef ENABLE_SERIAL_PNP probe_serial_pnp(); #endif + // FIXME: Clean this one up +#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_PARISC) + serial_console_init(); +#endif return 0; } @@ -5652,6 +5694,7 @@ info->io_type = req->io_type; info->iomem_base = req->iomem_base; info->iomem_reg_shift = req->iomem_reg_shift; + info->irq_spinlock= (spinlock_t) SPIN_LOCK_UNLOCKED; } autoconfig(state); if (state->type == PORT_UNKNOWN) { @@ -5959,6 +6002,7 @@ info->io_type = state->io_type; info->iomem_base = state->iomem_base; info->iomem_reg_shift = state->iomem_reg_shift; + info->irq_spinlock= (spinlock_t) SPIN_LOCK_UNLOCKED; quot = state->baud_base / baud; cval = cflag & (CSIZE | CSTOPB); #if defined(__powerpc__) || defined(__alpha__) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/serial_tx3912.h linux.20pre5-ac2/drivers/char/serial_tx3912.h --- linux.20pre5/drivers/char/serial_tx3912.h 2002-08-29 18:39:40.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/serial_tx3912.h 2002-09-02 14:57:05.000000000 +0100 @@ -12,6 +12,27 @@ #include #include +/* UART Interrupt (Interrupt 2) bits (UARTA,UARTB) */ +#define UART_RX_INT 9 /* receiver holding register full (31, 21) */ +#define UART_RXOVERRUN_INT 8 /* receiver overrun error (30, 20) */ +#define UART_FRAMEERR_INT 7 /* receiver frame error (29, 19) */ +#define UART_BREAK_INT 6 /* received break signal (28, 18) */ +#define UART_PARITYERR_INT 5 /* receiver parity error (27, 17) */ +#define UART_TX_INT 4 /* transmit holding register empty (26, 16) */ +#define UART_TXOVERRUN_INT 3 /* transmit overrun error (25, 15) */ +#define UART_EMPTY_INT 2 /* both trans/recv regs empty (24, 14) */ +#define UART_DMAFULL_INT 1 /* DMA at end of buffer (23, 13) */ +#define UART_DMAHALF_INT 0 /* DMA halfway through buffer (22, 12) */ + +#define UARTA_SHIFT 22 +#define UARTB_SHIFT 12 + +#define INTTYPE(interrupttype) (1 << interrupttype) + +/* + * This driver can spew a whole lot of debugging output at you. If you + * need maximum performance, you should disable the DEBUG define. + */ #undef TX3912_UART_DEBUG #ifdef TX3912_UART_DEBUG diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/BUGS linux.20pre5-ac2/drivers/char/speakup/BUGS --- linux.20pre5/drivers/char/speakup/BUGS 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/BUGS 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,10 @@ +Well, there are probably just thousands to squash, but these are the +ones I think of as bugs. + +There is a problem with speakup interrogating LiteTalks with rom +versions of at least 3.22 and earlier. (kirk) + +I define bugs as things which aren't working correctly although +they've been implemented. NOT features which haven't been added yet. + + Kirk diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/ChangeLog linux.20pre5-ac2/drivers/char/speakup/ChangeLog --- linux.20pre5/drivers/char/speakup/ChangeLog 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/ChangeLog 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,1214 @@ +2001-10-18 Thursday 08:53 jim + + Removed the cut and paste bug description from the BUGS file. (Jim) + +2001-10-14 Sunday 15:28 jim + + Part two of the selection.c patch for 2.2. This process sure was fun! (Jim) + +2001-10-14 Sunday 15:21 jim + + Just adding the new patch file for selection.c in the diff-v22 patch + directory. (Jim) + +2001-10-14 Sunday 14:45 kirk + + Just adding the new patch file for selection.c in the diff-v24 patch + directory. (kirk) + +2001-10-14 Sunday 14:42 kirk + + Changed selection.c to test if call is coming from userspace or kernel + space and using GFP_ATOMIC if it is being called from kernel-space. + This works around kmalloc not returning and hanging the system in + set_selection for the block and paste function of speakup. (Jim) + +2001-10-12 Friday 12:10 jim + + speakup.c: + Removed statements which were appending 0x00 to buffers to be spoken + from functions say_curr_line and say_line_from_to. + + Inspected and modified all spkup_write() calls to be consistent, + that is, end in \n and count is correct. + (Jim Danley) + +2001-10-09 Tuesday 08:34 kirk + + Updated the BUGS and Todo list to reflect current speakup + states. (kirk) + +2001-10-07 Sunday 21:19 jim + + speakup.c: + Moved following variable declarations to top of function speakup_cut(). + int ret; + unsigned char args[6*sizeof(short)]; + unsigned short *arg; + static char *buf = "speakup_cut: set_selection failed: "; + (Jim Danley) + +2001-10-07 Sunday 17:11 jim + + Put speakup_dectlk.c back to its original state. Sorry about that! + + Also added a clear_selection() call to speakup.c when hitting the "mark" + key to remove (if any) hi-lighting of a previous mark/cut from the screen. + (Jim Danley) + +2001-10-05 Friday 09:14 kirk + + Checking in a slight change to speakupmap.map to uncomment alt-keypad + five to allow ascii five for extended character sets. (kirk) + +2001-10-02 Tuesday 12:34 kirk + + Modified installation and readme files for the version 1.0 release in + linux/Documentation/speakup. (kirk) + +2001-10-02 Tuesday 11:00 kirk + + Start of the check-ins for the official speakup v-1.00 release. + Modified checkin to change cvsversion format. Modified install to + remove reference to touching speakupmap.map. Modified speakup.c to + reflect version now moved to v-1.00. (kirk) + +2001-10-02 Tuesday 01:18 jim + + Modified the way that cut/paste variables are stored. No longer in spk_t + structure but stand-alone (one per speakup rather than one per console). + + speakup.c: + eliminated unsigned short mode = 0; /* char-by-char selection */ + by assigning it directly. + + Added globals + char mark_cut_flag; + unsigned short mark_x, mark_y; + + /usr/include/linux/include/linux/speakup.h: + removed mark_x and mark_y from the spk_t structure and the associated + defines. + (Jim Danley) + +2001-09-17 Monday 19:58 jim + + speakup.c: + Added: + #define Mark_Cut_Bit 0x04 + #define Mark_Cut_Bit_Mask 0xFB + + Changed from using bit 2 of spk_shut_up to bit 2 of spk_sound to + indicate mark/cut state. + + Removed statement that was assigning 2 to second byte of first short + in args array. + (Jim Danley) + +2001-09-14 Friday 15:43 kirk + + Removed the blank line at the bottom of drivers/char/Makefile which I + must have dreamed I removed in the last log. (kirk) + +2001-09-14 Friday 15:28 kirk + + Added a couple of missing key definitions in DefaultKeyAssignments. + Removed the blank line at the bottom of drivers/char/Makefile. + Rewrote spell_word() to use say_curr_char() and super stream line + it. (kirk) + +2001-09-14 Friday 14:11 jim + + speakup_dectlk.c: + Changed the valid pitch range from 0-99 to 50-350. + (Jim Danley) + +2001-09-14 Friday 01:28 jim + + Made similar changes to add cut and paste feature to 2.2 kernels. (Jim Danley + +2001-09-13 Thursday 23:13 jim + + diff-v2[24]/^usr^src^linux^Documentation^speakup^DefaultKeyAssignments.copy: + Added: + KeyPad-/ Mark and Cut screen region. + InsKeyPad-/ Paste screen region into any console. + (Jim Danley) + +2001-09-13 Thursday 21:41 jim + + Wrote mark/cut/paste feature. + + Usage: + 1. Move reading cursor to one end of the block of text you wish to cut + 2. Press the mark/cut key. You should hear "mark". + 3. Move reading cursor to other end of block of text to be cut. + 4. Press the mark/cut key. You should hear "cut". + 5. The cut buffer is now saved. + 6. Move to a program in any console where you wish to copy the cut buffer. + 7. Press the paste key. You should hear "paste" and text from + the cut buffer will be output just as if you had entered it + at the keyboard. + + Note: Trailing whitespace is stripped and newlines added where appropriate. + + speakup.c: + Added two new functions; speakup_cut() and speakup_paste() + + speakupmap.map: + Modified default keymap so that keypad divide toggles mark/cut and + insert-keypad divide is paste. + + /usr/src/linux/include/linux/speakup.h: + Added two new variables to the spk_t structure; unsigned long mark_x, mark_y + to store the coordinates of the beginning of the mark area to be cut. + Added: + #define spk_mx speakup_console[currcons]->mark_x + #define spk_my speakup_console[currcons]->mark_y + #define SPEAKUP_CUT 0x27 + #define SPEAKUP_PASTE 0x28 + Added two new prototypes: + extern void speakup_cut(unsigned int, struct tty_struct *); + extern void speakup_paste(struct tty_struct *); + + /usr/src/linux/drivers/char/keyboard.c: + In function do_spkup(): + Added case blocks for SPEAKUP_CUT and SPEAKUP_PASTE. + + /usr/src/linux/include/linux/keyboard.h: + Added: + #define K_SPEAKUP_CUT K(KT_SPKUP,SPEAKUP_CUT) + #define K_SPEAKUP_PASTE K(KT_SPKUP,SPEAKUP_PASTE) + and modified: (was 27) + #define NR_SPKUP 0x29 + + Also modified patch/copy files below in both diff-v22 and diff-v24 directories. + ^usr^src^linux^include^linux^keyboard.h.patch + ^usr^src^linux^drivers^char^keyboard.c.patch + ^usr^src^linux^include^linux^speakup.h.copy + +2001-09-08 Saturday 22:22 kirk + + Re-implementing the alpha patch for kernels 2.4.x which somehow keeps + getting lost. I also removed the bottom three lines of the checkout + script which are not needed anymore because we include a + speakupmap.c. (Kirk) + +2001-08-30 Thursday 17:25 kirk + + Modified drivers/char/Makefile to work with the new speakupmap.c + changes to 2.4.x. These changes include a portion of Shane's patch as + well as other rewrites by me. (kirk) + +2001-08-30 Thursday 16:17 kirk + + Modified drivers/char/Makefile and speakup/Makefile to accomodate the + new 2.4.9ac3 Makefile changes. This will also include a new + speakupmap.c moving towards Shane's Makefile patches for the 2.2.x + kernels, not included yet. (kirk) + +2001-08-29 Wednesday 21:26 kirk + + Just adding new patch against linux/init/main.c to cvs. (kirk) + +2001-08-29 Wednesday 21:23 kirk + + Rewrote speakup_init() to call a function speakup_register_devsynth() + which gets called from do_basic_setup in init/main.c. We need to do + this so that miscdevice will get called after the mm has been set up. + This should allow devfs to work with speakup. (kirk) + +2001-08-26 Sunday 13:54 kirk + + Removed an old comment line from console.c which prevent clean + patching against 2.4.8ac11. (kirk) + +2001-08-25 Saturday 18:46 kirk + + Modified keyboard.c, keyboard.h, speakup.c and speakup.h to conform with the standard kernel source tree under 2.4.x kernels. (Kirk) + +2001-08-25 Saturday 18:30 kirk + + Removing lxdialog patch files and removing their entries from + patchlist-22. These are now part of the standard 2.2.19+ kernel + tree. (Kirk) + ---------------------------------------------------------------------- + patchlist-v22 speakupmap.map symbols.h CVS: + diff-v22/^usr^src^linux^Documentation^speakup^DefaultKeyAssignments.copy + diff-v22/^usr^src^linux^Documentation^speakup^keymap-tutorial.copy + Removed Files: CVS: + diff-v22/^usr^src^linux^scripts^lxdialog^menubox.c.patch CVS: + ---------------------------------------------------------------------- + +2001-08-25 Saturday 18:15 kirk + + Changed keyboard.c, keyboard.h, speakup.c and speakup.h to conform to + the standard linux kernel tree code style for the 2.2.x + kernels. (Kirk) + +2001-08-18 Saturday 03:31 jim + + diff-v22/^usr^src^linux^drivers^char^keyboard.c.patch: Modified patch + to allow raw keyboard for version 2.2 kernels. (Jim Danley) + +2001-08-02 Thursday 13:47 kirk + + Adding \x20 to the flush string for the Audapter synths. (Kirk) + +2001-07-31 Tuesday 19:07 jim + + speakup_ltlk.c: appended \x20 to flush string of \x18 for litetalk driver. + This seems to fix the bug that was causing first chars to be dropped by + the double lt and litetalk synths for some users. (Jim Danley) + +2001-07-26 Thursday 20:12 kirk + + A few small clean ups trying to get 2.4.7 to work. (Kirk) + +2001-07-16 Monday 11:30 kirk + + Added KT_SPKUP to allowed_in_raw_mode macro so speakup's review + functions are available in raw mode for v-2.4.x kernels. (Kirk) + +2001-03-17 Saturday 15:40 jim + + speakup.c: + Added silent feature. + The print screen key kills and revives speakup. Sending specific values to + /proc/speakup/silent now allows the same control without having to press a key. + Valid settings are 0 through 3. + 0 and 2 turn on speakup if not already alive. + 1 and 3 turn off speakup if not already killed. + 0 and 1 announce the changes as the print screen key does, + 2 and 3 act silently. + (Jim Danley) + +2001-03-17 Saturday 08:45 jim + + speakup.c and symbols.h: + Added bell position feature. + When a letter is typed in column bell_pos, console beeps. + Valid settings are 0 through video_num_columns. Zero disables. + Get/set via /proc/speakup/bell_pos. + (Brian Borowski) + +2001-03-13 Tuesday 14:50 jim + + speakup.c: + Added code in say_screen() to insert a space at the end of full lines. + (Gene Collins) + +2001-03-13 Tuesday 14:40 jim + + speakup.c: + Found and fixed a couple of places where synth_write() was writing len of + string plus 1 which caused a NULL to be sent to the synth which causes + problems for the Doubletalk LT. + + speakup.c and keyboard.c for 2.2 and 2.4 + Corrected the length parameter on several spkup_write() statements which + were also sending unnecessary NULLs. + + Corrected spelling of /proc/speakup/transport directory. (Jim Danley) + +2001-02-28 Wednesday 10:55 kirk + + Removing the make menuconfig patches for checklist.c and menubox.c + because they have been included in linux 2.4.2. (Kirk) + +2001-02-11 Sunday 14:05 kirk + + Checking support for alpha support in 2.4.x kernels. (Kirk) + +2001-01-30 Tuesday 20:55 kirk + + Fixed arch/ppc/config.in to source drivers/char/Config.in which had + gotten broken in the post 2.4.0 ac patches. (Kirk) + +2001-01-28 Sunday 23:53 jim + + Reduced duplicate code in proc_speakup_synth_init() by creating two arrays + of strings, read_only[] and root_writable[] and using these arrays in + for loops. + Bumped version numbers on remaining serial synth drivers. (Jim Danley) + +2001-01-28 Sunday 20:26 kirk + + Made modifications to speakup.h for v2.2 and the remainder of the + serial synth drivers to use the initialize_uart() function in + speakup_drvcommon.c. (Kirk) + +2001-01-28 Sunday 19:15 kirk + + Made changes to 2.4.0 to move uart initialization code into + speakup_drvcommon.c and modified speakup_dectlk.c to use that + change. (Kirk) + +2001-01-28 Sunday 00:26 jim + + Modified the serprobe() function in the Accent SA driver. + This should allow the Accent SA to start talking from a cold boot with + no help from the lilo serial= or speakup_ser= options. + Ran speakup_acntsa.c through Lindent. + Bumped speakup_acntsa.c version number. (Jim Danley) + +2001-01-27 Saturday 23:26 jim + + Modified the serprobe() function in the Dectalk Express driver. + My Dectalk Express now starts talking just fine from a cold boot with + no help from the lilo serial= or speakup_ser= options. + Ran speakup_dectlk.c through Lindent and cleaned up some comments. + Bumped Dectalk Express driver version number. (Jim Danley) + +2001-01-25 Thursday 17:58 jim + + Worked on the write handler for /proc/speakup/synth. + It error-checks new_synth_name, prints out msg if synth selected is + already in use, looks for new_synth_name in list of synths compiled into + kernel, and prepares to switch to new synth. + Ran speakup.c through Lindent and cleaned up some comments. (Jim Danley) + +2001-01-24 Wednesday 22:59 jim + + + Modified speakup_drvcommon.c so that those synth-specific /proc file + entries which are writable will now accept "" to trigger resetting of + the default value. + Ran speakup_drvcommon.c through Lindent and cleaned up some comments. + (Jim Danley) + +2001-01-24 Wednesday 12:33 kirk + + Made changes for Maintaners to v-24. (Kirk) + +2001-01-24 Wednesday 12:31 kirk + + Another typo fix in Configure.help and an update to the URL in Maintaners. (Kirk) + +2001-01-24 Wednesday 11:57 kirk + + Fixed clarification in Configure.help in v-24. (Kirk) + +2001-01-24 Wednesday 11:56 kirk + + Fixed spelling error in Config.in and modified Configure.help yet again. (Kirk) + +2001-01-24 Wednesday 11:47 kirk + + Fixed formatting in v-24 configure.help. (Kirk) + +2001-01-24 Wednesday 11:46 kirk + + Fixed indentation and spelling errors in configure.help. (Kirk) + +2001-01-24 Wednesday 10:49 kirk + + Fixing the v-2.4 version of the Configure.help file. (Kirk) + +2001-01-24 Wednesday 10:47 kirk + + Updated the Configure.help documentation and re-arranged the speakup + Config.in file. (Kirk) + +2001-01-23 Tuesday 15:45 jim + + + Modified speakup.c to handle input in either upper or lower case written + to the /proc file entries for those settings that accept a range of + values that includes alpha chars. + The value is forced to lower case before any comparisons. + Modified the synth driver range parameters to accept only lower case as follows: + rate in both speakup_acntpc.c and speakup_acntsa.c, + pitch and volume in speakup_apolo.c, + tone in speakup_txprt.c. + Bumped synth driver version numbers. + (Jim Danley) + +2001-01-23 Tuesday 11:58 jim + + + Fixed typo in speakup_dectlk.c. + (Jim Danley) + +2001-01-23 Tuesday 11:39 jim + + + Moved full_time into the spk_synth structure for all synths and created + /proc/speakup/synth-specific/full_time entry. + Modified /usr/include/linux/speakup.h and associated files in diff-v22 and diff-v24. + (Jim Danley) + +2001-01-23 Tuesday 01:14 jim + + + Added to the TODO list. + (Jim Danley) + +2001-01-23 Tuesday 00:42 jim + + + Moved delay_time, trigger_time, and jiffy_delta into the spk_synth + structure for all synths. + Modified /usr/include/linux/speakup.h and associated files in diff-v22 and diff-v24. + Assigned following default values for Accent SA and Audapter drivers: + delay_time = 400, trigger_time = 5, jiffy_delta = 3. + Bumped synth driver version numbers. + (Jim Danley) + +2001-01-22 Monday 21:32 jim + + + Moved INIT_STRING and REINIT_STRING into the spk_synth structure for all synths. + Modified /usr/include/linux/speakup.h and associated files in diff-v22 and diff-v24. + Commented out some unused driver code that caused compile warnings. + (Jim Danley) + +2001-01-22 Monday 17:44 jim + + + Test number 2. + (Jim Danley) + +2001-01-22 Monday 16:28 kirk + + + Testing my new CVS login. + (Jim Danley) + +2001-01-21 Sunday 19:48 kirk + + Wrote char *strlwr(char *) and now use it to be certain that the + synth_name (provided by the user in config or at boot time) is forced + to lower case. + (Jim Danley) + +2001-01-21 Sunday 13:53 kirk + + Added /proc/speakup/synth entry -- read-only so far. + Removed old ioctl functions from speakup.c + Wrote xlate function to translate escape chars in user provided strings. + Added synth_name to "unknown synthesizer" message at boot up. + Check for length of synth_name. + Made certain that synth_name is NULL terminated. + (Jim Danley) + +2001-01-21 Sunday 09:03 kirk + + Changed synth_write("\n", 2); + to synth_write("\n", 1); + when sending user provided synth settings via /proc to the synth. + This *might* fix the problem reported by litetalk users. + Cleaned up some comments and indenting. + (Jim Danley) + +2001-01-14 Sunday 21:05 matt + + Checking in 2.2.x patches for the last modification. (Matt) + +2001-01-14 Sunday 20:49 kirk + + Checking in Matt Campbells driver rewrite to include all the synths in + the kernel at the same time. (Kirk) + +2001-01-10 Wednesday 12:16 kirk + + Fixed bug when writing to /proc/speakup files caps_start, caps_stop, + punc_some, and punc_most. + Defined PUNC_CHARS and PUNC_CHARS_SIZE in symbols.h. + Added MULTI_CHAR to list of possible spk_variable.flags, necessary to + define a list of chars that must belong to another list of chars -- + used for punc_some and punc_most. + Set arbitrary limit of 33 chars on caps_*. + Set PUNC_CHARS_SIZE char limit on user supplied value to punc_some and punc_most. + Fixed erroneous error strings. + #define'd error conditions to make code more clear. + Added STRING_TOO_LONG and CHAR_NOT_ONE_OF. + Added missing volume setting to DEFAULT_STATIC for Dectalk Express. + (Jim Danley) + +2001-01-08 Monday 19:08 kirk + + Made more changes to the cursoring. I got backspace working in and + out of cursoring. (Kirk) + +2001-01-08 Monday 16:25 kirk + + I have rewritten the cursoring routine speakup_check() to hopefully + improve it. We are not there yet! (Kirk) + +2001-01-07 Sunday 16:05 kirk + + Just fixing some indentation settings. (Kirk) + +2001-01-07 Sunday 13:37 kirk + + added a single line to the top of speakup.c for testing. + (Jim Danley) + +2001-01-07 Sunday 12:58 kirk + + Fixed char/Makefile to build depends which it wasn't doing for some + reason under 2.2.18. (Kirk) + +2001-01-07 Sunday 12:16 kirk + + Fixed char/Makefile to create the speakup/.depend correctly. I don't + know why it wasn't working before. Everything else did. (Kirk) + +2001-01-07 Sunday 12:05 kirk + + modified range checking code in speakup.c to handle negative numbers in + user provided parameter to /proc/speakup/* and also in spk_variable.valid. + (Jim Danley) + +2001-01-07 Sunday 09:02 kirk + + cleaned up and commented symbols.h. + re-wrote some of the range logic in symbols.h and speakup.c. + changed char valid[33] to char *valid in spk_variable struct. + dropped 0xff as char string terminator for spk_variable.valid member. + removed NUMERIC from rate flags for accents. + made /proc/speakup/tone read-only for dectalk express. + (Jim Danley) + +2001-01-06 Saturday 15:52 kirk + + Reorganized the Todo list and placed bugs in the bugs file. (Kirk) + +2001-01-05 Friday 21:19 kirk + + Made modifications to fix the make menuconfig bug in 2.4.0. (Kirk) + +2001-01-05 Friday 20:42 kirk + + Modified menubox.c in lxdialog to fix bug with initial menus not being + shown completely. (Kirk) + +2001-01-05 Friday 15:54 kirk + + merged symbols_*.h into symbols.h and removed symbols_*.h from CVS. + cleaned up the format a bit along the way. + (Jim Danley) + +2001-01-04 Thursday 18:33 kirk + + Modified the console.c, speakup.h and speakup.c for the 2.4.0 kernels. + I have also removed vt.c in preparation for just using the + /proc/speakup configuration system. (Kirk) + +2001-01-04 Thursday 12:11 kirk + + Starting major changes for merging into the kernel source tree. Files + updated are console.c speakup.c speakup.h and vt.c. I have built a + new set of functions to interact with the kernel which will be speakup + functions if speakup is configured in and null stubs if speakup is not + configured in. So far they include: speakup_allocate(), speakup_bs(), + speakup_con_update(), speakup_con_write() and speakup_init(). These + changes only affect the 2.2.18 tree currently. (Kirk) + +2001-01-03 Wednesday 10:04 kirk + + Fixed transport driver by giving the uart time to settle before + testing for the port. (Kirk) + +2001-01-02 Tuesday 20:18 kirk + + First attempt to change checkout to work with an installed tarball and + update it to cvs. (Kirk) + +2001-01-02 Tuesday 14:09 kirk + + Made tchanges to make v24 compatible with 2.4.0-prerelease. (Kirk) + +2001-01-02 Tuesday 09:50 kirk + + Added code to correctly parse range string for /proc file speech + parameters which use a range of chars. + Added a priority of KERN_ALERT to printk statements that need to be + displayed on user's console regardless. + Enhanced warning output if user attempts to assign a value out of range + to a /proc variable. + (Jim Danley) + +2000-12-31 Sunday 13:20 kirk + + Rewrote checkclean and changed semee to semi in the character + array. (Kirk) + +2000-12-31 Sunday 12:12 kirk + + Fixed syntax errors in speakup_txprt.c and modified the install + script. (Kirk) + +2000-12-31 Sunday 11:43 kirk + + Fixing typo's in the documentation files. (Kirk) + +2000-12-30 Saturday 23:33 kirk + + Rewrote install and INSTALLATION for a different installing + design. (Kirk) + +2000-12-30 Saturday 17:03 kirk + + We are officially version v-0.10. (Kirk) + +2000-12-30 Saturday 16:58 kirk + + Modified the installation file and created an install script. (Kirk) + +2000-12-30 Saturday 15:13 kirk + + Fixed a syntax problem with speakup_audptr.c. (Kirk) + +2000-12-30 Saturday 14:58 kirk + + Placed a length limit on reading of version number in + speakup_audptr.c. (Kirk) + +2000-12-30 Saturday 13:12 kirk + + Adding file changes for v22. (Kirk) + +2000-12-30 Saturday 13:10 kirk + + Removing files related to version changes. (Kirk) + +2000-12-30 Saturday 13:00 kirk + + Changed structure of Documentation/speakup and related files to remove + references to speakup version for ease in updating documentation. + (Kirk) + +2000-12-29 Friday 14:00 kirk + + echo "" > /proc/speakup/characters now resets to defaults for consistency. + wrote script to reset all speakup defaults + added key_echo toggle to speakup vars controllable by user + via /proc/speakup/key_echo + key_echo is not 100% -- keypad slash talks even if key_echo == 0 + (Jim Danley) + +2000-12-24 Sunday 16:46 kirk + + finished ability to write to /proc files, changed some default char descs, added "direct" to /proc + +2000-12-22 Friday 15:04 kirk + + These are the cursoring fixes for the 2.4.0-testxx kernels. They also + include the requested changes I was experimenting with by Alan Cox in + preparation for kernel source tree inclusion. (Kirk) + +2000-12-22 Friday 13:54 kirk + + Fixed up some of the cursoring issues and have started making the + changes requested by Alan Cox in preparation for kernel source tree + inclusion. (Kirk) + +2000-12-21 Thursday 08:56 kirk + + rewrite of speakup_characters_write_proc() to handle fragmented buffers when called by dd, cp, or cat in kernel 2.4 (Jim Danley) + +2000-12-20 Wednesday 12:17 kirk + + Cleaned up some warnings. (Kirk) + +2000-12-20 Wednesday 11:32 kirk + + Fixed toggle for synth timeout to set it off when waking up the + synth. (Kirk) + +2000-12-19 Tuesday 19:31 kirk + + This is atest fix to see if I have helped eliminate the synth bleed + through problem with all of the synths. (Kirk) + +2000-12-19 Tuesday 16:29 kirk + + quick change to speakup_audptr.c to fix synth_ver typo for kernel 2.2.18 (Jim Danley) + +2000-12-19 Tuesday 15:35 kirk + + Checking in the 2.2.18 fixes for the synth hanging problems. (Kirk) + +2000-12-19 Tuesday 15:10 kirk + + Finally fixed the synth hanging problem on synth turn off. (Kirk) + +2000-12-18 Monday 14:44 kirk + + Just updating BUGS to put the backspace problem to bed. (Kirk) + +2000-12-18 Monday 14:40 kirk + + Checking in the backspace fix for 2.4.0-test11. Yeah! Finally + fixed. (Kirk) + +2000-12-18 Monday 14:14 kirk + + Fixed the backspace bug at last! In 2.2.18 so far. (Kirk) + +2000-12-18 Monday 10:03 kirk + + Checking in Jim Danleys changes again. When will I learn to checkout + before checking in?? (Kirk) + +2000-12-15 Friday 13:50 kirk + + Checking first draft of menubox.c and checklist.c for + v-2.4.0-testxx. (Kirk) + +2000-12-15 Friday 13:48 kirk + + Taking first diff of menubox.c and checklist.c for v2.4.0-test11 for + make menuconfig cursoring. (Kirk) + +2000-12-15 Friday 13:17 kirk + + Checking in the new diffs of menubox.c and checklist.c for the first + time. (Kirk) + +2000-12-15 Friday 13:14 kirk + + Taking first diff of the make menuconfig patches from checklist.c and + menubox.c. (Kirk) + +2000-12-12 Tuesday 18:56 kirk + + Fixed a spelling error added to Todo list and fix speakup.c to not + need the is_alive() function. (Kirk) + +2000-12-12 Tuesday 15:21 kirk + + Fixed speakup to patch correctly with 2.2.18. Unfortunately it won't + work with kernels less than 2.2.18 anymore. It was totally agreed + upon by the folks on the reflector. It's not my fault mom! (Kirk) + +2000-12-12 Tuesday 10:41 kirk + + Fix a problem with a conflict in cvsversion.h. (Kirk) + +2000-12-11 Monday 20:40 kirk + + Attempt to fix the Audapter driver by limiting how long it can stay in + kernel space. (Kirk) + +2000-12-11 Monday 17:37 kirk + + Made a slight fix to spk_reset() and moved it's call up a bit in + handle_scancodes(); (Kirk) + +2000-12-11 Monday 16:28 kirk + + Just checking in the cvs adds for the new diff-v24 patch files. (Kirk) + +2000-12-11 Monday 16:25 kirk + + Checking in the 2.4.0 kernel patches for Jim Danley's /proc file + system additions. (Kirk) + +2000-12-11 Monday 14:34 kirk + + Checking in added proc files. (Kirk) + +2000-12-11 Monday 14:31 kirk + + Added two new files to v22 kernel for /proc file system, + linux/include/linux/proc_fs.h and linux/fs/proc/root.c. (Kirk) + +2000-12-11 Monday 12:59 kirk + + Checking in Jim Danleys /proc file system additions to speakup. (Kirk) + +2000-12-09 Saturday 19:14 kirk + + Changed spk_control to test for zero specifically on say_control. (Kirk) + +2000-12-09 Saturday 18:29 kirk + + Changed spk_control to say capslock scroll_lock and num_lock even when + say_control isn't on. (Kirk) + +2000-12-08 Friday 16:21 kirk + + Removing the linux version 2.3.xx stuff again. (Kirk) + +2000-12-08 Friday 15:40 kirk + + patched Configure.help by hand from v2.4 and committing. (Kirk) + +2000-12-08 Friday 14:47 kirk + + Checked in diff-v22/^usr^src^linux^Documentation^Configure.help.patch + which seems to have been missed as well as the init/main.c stuff. + This is really weird (Kirk) + +2000-12-08 Friday 14:40 kirk + + Added the -d flag to updat in checkout to see if we get cleanup + improvement. (Kirk) + +2000-12-08 Friday 13:13 kirk + + Removing patchlist and the linux 2.3.xx support. (Kirk) + +2000-12-08 Friday 13:07 kirk + + Edited check.orig and fix.orig to use the new patchlist filename + convention. (Kirk) + +2000-12-07 Thursday 22:17 kirk + + Just checking in the new files, three to be exact. (kirk) + +2000-12-07 Thursday 22:14 kirk + + rewrote checkin, checkout and moved patchlist to patchlist-v22 and + patchlist-v24 because we were missing the linux/init/main.c patches + and we didn't have a way to handle different files for different + versions. (kirk) + +2000-12-06 Wednesday 19:06 kirk + + Added support for the codepage 437 extended character set. (Jim and Kirk) + +2000-11-29 Wednesday 11:30 kirk + + Fixed the 2.2.xx kernels to have the almost correct backspace code. + Also move the new character output in do_con_write() to lf(). I've + experimentally put a 'space' in to see if that helps the wrapping + during console output. (Kirk) + +2000-11-27 Monday 15:38 kirk + + Fix or partial to the backspace problem at least on 2.4.0-test11. I + probably broke cursoring. + +2000-11-22 Wednesday 20:12 kirk + + Fixed a stupid unused variable by deleting it. + Fixed speakup_file_write to send raw user data to the synth. (Thanx Matt) + +2000-11-21 Tuesday 15:10 kirk + + Adjusted console.c patch for test11 of 2.4.0. + +2000-11-16 Thursday 11:42 kirk + + Modified all drivers to test for no port when clearing the holding + register. + +2000-11-16 Thursday 07:56 kirk + + Fixed console.c patch to compensate for the line movement. in Test10. + +2000-10-24 Tuesday 11:10 kirk + + Fix to the LiteTalk driver to get around the hanging when the synth isn't + on. + +2000-10-23 Monday 12:15 kirk + + Fixed dtlk driver so non-valid ports are released correctly in + dev_probe. Also added externs for synth_request_region and + release. (Kirk) + +2000-08-28 Monday 13:29 kirk + + Fixed Makefile for 2.4.0-test7 in drivers/char. + +2000-08-17 Thursday 16:21 kirk + + Birth of cursoring for version 2.4.xx kernels. + +2000-08-17 Thursday 12:06 kirk + + Okay, I proclaim the birth of cursoring, at least in the 2.2.x kernels. Next we'll try the 2.3/4.x kernels. + +2000-08-17 Thursday 11:01 kirk + + Fixed CFLAGS to EXTRA_CFLAGS in Makefile to get speakup to compile + again. The break took place between 2.4.0-test4 and test5. + +2000-07-20 Thursday 10:43 kirk + + Changed krealloc to just use kfree instead of kfree_s. Kirk + +2000-07-03 Monday 14:19 kirk + + Fixed one line in keyboard.c and changes to cvs + +2000-06-29 Thursday 16:32 andy + + Fixed checkin / cvsversion.h + +2000-06-29 Thursday 16:27 andy + + v2.3 keyboard.c + speakup_kill() fix + +2000-06-29 Thursday 16:26 andy + + v2.2.x keyboard.c + speakup_kill() fix + +2000-06-29 Thursday 16:03 andy + + v2.3 addition of speakup_kill() function (bound to sysreq key) + +2000-06-29 Thursday 16:00 andy + + v2.2 addition of speakup_kill() function (bound to sysreq key) + +2000-06-29 Thursday 15:56 andy + + v2.4 addition of speakup_kill() function (bound to sysrq key) + +2000-06-26 Monday 16:19 andy + + Added (very minimal) read() and ioctl() functions for /dev/synth. + +2000-06-23 Friday 11:16 andy + + Fixed miscdevice.h bad patch + +2000-06-22 Thursday 15:47 andy + + Fixed defkeymap.c not being built properly. + +2000-06-22 Thursday 15:17 andy + + Fixed v2.2.x zero-byte patch bug + +2000-06-22 Thursday 14:48 andy + + Checkout prunes now. + +2000-06-22 Thursday 12:48 andy + + Forgot to kill the old patch files... cleaning up. + +2000-06-22 Thursday 12:45 andy + + Changed checkin/checkout philosophy... + v2.2.x, v2.3.x, v2.4.x trees are all in this release + +2000-06-21 Wednesday 16:27 andy + + More checkin/checkout fixes. + +2000-06-21 Wednesday 16:19 andy + + Changed checkin/checkout philosophy, so 0-byte files aren't such a headache + +2000-06-21 Wednesday 14:13 andy + + New checkout script, fixing non-updating of previously patched files. + +2000-06-20 Tuesday 15:14 andy + + /dev/synth (MAJOR 10, MINOR 25) fix for v2.2.x tree + +2000-06-19 Monday 16:02 andy + + checkin script that fixes busted/nonexstant .orig files + +2000-06-19 Monday 13:08 andy + + cvsversion.h fix + speakup_decext.c fix for v2.2.x (no such member 'list' problem) + +2000-06-14 Wednesday 16:00 andy + + TODO update + +2000-06-14 Wednesday 15:25 andy + + Fixed: + checkin 'older than' bug + disabled -lock speech when spk_shut_up is set + +2000-06-14 Wednesday 13:15 andy + + Added a cvsversion.h and cvs date tracking into speakup. + +2000-06-14 Wednesday 12:44 andy + + Oops. Forgot these. + +2000-06-14 Wednesday 08:06 kirk + + Put SYNTH_MINOR #ifdefs in miscdevices.h for v2.2.x kernels. + Updated Todo file and temporarily incremented version number of speakup. (Kirk) + +2000-06-13 Tuesday 16:30 andy + + v2.4.x spanky checkin + +2000-06-13 Tuesday 15:36 andy + + v2.4.x checkin for /dev/synth stuff. + +2000-06-13 Tuesday 15:28 andy + + typo fix. + +2000-06-13 Tuesday 15:23 andy + + v2.2.x checkin for the new /dev/synth stuff. + +2000-06-13 Tuesday 15:17 andy + + Added a /dev/synth fops to speakup (MAJOR 10, MINOR 25), so that users can + use the synth without speakup (but why?). :) + + Also fixed a couple of issues with the check* scripts, and added a -p option + to checkin to just create patches. + +2000-06-12 Monday 14:36 andy + + Had a 0-byte defkeymap.c file... + +2000-06-12 Monday 14:26 andy + + Fixed the screwed up v2.2.x patch files, and added a fixorig script which + copies .orig files from /usr/src/linux.orig as stated in the + patchlist file + +2000-06-09 Friday 16:03 andy + + TODO change + +2000-06-09 Friday 14:21 andy + + added checkclean script + +2000-06-09 Friday 12:46 andy + + updates to the v2.2.x tree. + +2000-06-08 Thursday 14:59 andy + + Fixed v2.2.x diffs, and made a few changes to checkin/checkout/checkorig.. + + Namely, + checkin: + fixed bailout on CVSROOT set + diffs only for new or files that have changed since last patch + cvs adds directories properly + checks exit values of cvs commands + checkout/checkorig: + zeroes out .orig files that should exist and should be zeroed + patchlist: + now specifies patchfiles in the form: + <0|1>, + where the first number is a flag to copy the file to create + a .orig, or create a zero-byte file (0) for .orig + +2000-06-07 Wednesday 15:52 kirk + + [no log message] + +2000-06-07 Wednesday 14:15 andy + + checkin mod + +2000-06-07 Wednesday 14:14 andy + + date test added to ./checkin + +2000-06-07 Wednesday 14:11 andy + + test + +2000-06-07 Wednesday 14:09 andy + + test patch + +2000-06-07 Wednesday 13:02 kirk + + test of checkin on spanky + +2000-06-07 Wednesday 12:32 andy + + more checkin/checkout updates + +2000-06-07 Wednesday 12:19 andy + + quick print fix for checkin script + +2000-06-07 Wednesday 12:17 andy + + Fixed new tree commit/checkout/update bugs with checkin and checkout + +2000-06-07 Wednesday 12:10 kirk + + v24 tree added to cvs + +2000-06-07 Wednesday 11:30 andy + + logic error in ./checkin + + New diff-vXX directories are added now... just cp -a diff-vYY div-vXX, and + kill the CVS/ dir. + +2000-06-05 Monday 15:54 andy + + Fixed ./checkin to 'cvs add' created patch directories. + +2000-06-05 Monday 15:39 andy + + Added synth_release_region, and seperated out a speakup_drvcommon.c file, + which contains common driver stuff -- current just synth_release_region(), + and synth_request_region(). + +2000-06-02 Friday 15:32 andy + + Final test?? + +2000-06-02 Friday 14:11 andy + + bleah + +2000-06-02 Friday 13:58 andy + + another test.. *sigh* + +2000-06-02 Friday 13:57 andy + + foo + +2000-06-02 Friday 13:56 andy + + adding speakup.h.patch + +2000-06-02 Friday 13:55 andy + + bleah + +2000-06-02 Friday 13:49 andy + + test 342.7 + +2000-06-02 Friday 12:56 andy + + wrong checkout script. + +2000-06-02 Friday 12:51 andy + + Yet another test. + +2000-06-01 Thursday 15:45 andy + + test #2 + +2000-06-01 Thursday 15:40 andy + + ./checkin script test + +2000-06-01 Thursday 15:38 andy + + Initial revision + +2000-06-01 Thursday 15:38 andy + + Initial version of speakup in CVS. + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/Config.in linux.20pre5-ac2/drivers/char/speakup/Config.in --- linux.20pre5/drivers/char/speakup/Config.in 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/Config.in 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,18 @@ +bool 'Speakup console speech' CONFIG_SPEAKUP +if [ "$CONFIG_SPEAKUP" != "n" ]; then + comment 'Type "y" for each synthesizer you want built into the kernel.' + bool "Accent SA, acntsa" CONFIG_SPEAKUP_ACNTSA + bool "Accent PC, acntpc" CONFIG_SPEAKUP_ACNTPC + bool "Apollo, apolo" CONFIG_SPEAKUP_APOLO + bool "Audapter, audptr" CONFIG_SPEAKUP_AUDPTR + bool "Braille 'n' Speak, bns" CONFIG_SPEAKUP_BNS + bool "DECtalk Express, dectlk" CONFIG_SPEAKUP_DECTLK + bool "DECtalk External (old), decext" CONFIG_SPEAKUP_DECEXT + bool "DoubleTalk PC, dtlk" CONFIG_SPEAKUP_DTLK + bool "DoubleTalk LT or LiteTalk, ltlk" CONFIG_SPEAKUP_LTLK + bool "Speak Out, spkout" CONFIG_SPEAKUP_SPKOUT + bool "Transport, txprt" CONFIG_SPEAKUP_TXPRT + comment 'Enter the four to six character synth string from above or none.' + string "Default synthesizer for Speakup" CONFIG_SPEAKUP_DEFAULT "none" + bool "Use Speakup keymap by default" CONFIG_SPEAKUP_KEYMAP +fi diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/Makefile linux.20pre5-ac2/drivers/char/speakup/Makefile --- linux.20pre5/drivers/char/speakup/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/Makefile 2002-08-15 02:35:45.000000000 +0100 @@ -0,0 +1,25 @@ +# +# Makefile for the speakup speech output system. +# + +O_TARGET := spk.o + +obj-$(CONFIG_SPEAKUP) += speakup.o speakup_drvcommon.o +obj-$(CONFIG_SPEAKUP_DTLK) += speakup_dtlk.o +obj-$(CONFIG_SPEAKUP_LTLK) += speakup_ltlk.o +obj-$(CONFIG_SPEAKUP_ACNTPC) += speakup_acntpc.o +obj-$(CONFIG_SPEAKUP_ACNTSA) += speakup_acntsa.o +obj-$(CONFIG_SPEAKUP_TXPRT) += speakup_txprt.o +obj-$(CONFIG_SPEAKUP_BNS) += speakup_bns.o +obj-$(CONFIG_SPEAKUP_AUDPTR) += speakup_audptr.o +obj-$(CONFIG_SPEAKUP_DECTLK) += speakup_dectlk.o +obj-$(CONFIG_SPEAKUP_DECEXT) += speakup_decext.o +obj-$(CONFIG_SPEAKUP_APOLO) += speakup_apolo.o +obj-$(CONFIG_SPEAKUP_SPKOUT) += speakup_spkout.o +obj-$(CONFIG_SPEAKUP_KEYMAP) += speakupmap.o + +include $(TOPDIR)/Rules.make + +speakupmap.c: speakupmap.map + set -e ; loadkeys --mktable $< | sed -e 's/^static *//' > $@ + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_acnt.h linux.20pre5-ac2/drivers/char/speakup/speakup_acnt.h --- linux.20pre5/drivers/char/speakup/speakup_acnt.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_acnt.h 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,17 @@ +/* speakup_acntpc.h - header file for speakups Accent-PC driver. */ + +#define SYNTH_IO_EXTENT 0x02 + +#define SYNTH_CLEAR 0x18 /* stops speech */ + + /* Port Status Flags */ +#define SYNTH_READABLE 0x01 /* mask for bit which is nonzero if a + byte can be read from the data port */ +#define SYNTH_WRITABLE 0x02 /* mask for RDY bit, which when set to + 1, indicates the data port is ready + to accept a byte of data. */ +#define SYNTH_QUIET 'S' /* synth is not speaking */ +#define SYNTH_FULL 'F' /* synth is full. */ +#define SYNTH_ALMOST_EMPTY 'M' /* synth has les than 2 seconds of text left */ +#define SYNTH_SPEAKING 's' /* synth is speaking and has a fare way to go */ + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_acntpc.c linux.20pre5-ac2/drivers/char/speakup/speakup_acntpc.c --- linux.20pre5/drivers/char/speakup/speakup_acntpc.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_acntpc.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,240 @@ +/* + * speakup_acntpc.c - Accent PC driver for Linux kernel 2.3.x and speakup + * + * author: Kirk Reiser + + Copyright (C) 1998-99 Kirk Reiser. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Kirk Reiser + 261 Trott dr. London, Ontario, Canada. N6G 1B6 + */ + +/* These routines are written to control the Accent PC speech + synthesizer by Aicom. They are not ment to be thought of as a device driver + in that they do not register themselves as a chr device and there + is no file_operations structure. They are strictly to provide an + interface to the Accent-pc from the speakup screen review package. +*/ + +#define KERNEL +#include +#include +#include +#include /* for -EBUSY */ +#include /* for check_region, request_region */ +#include /* for loops_per_sec */ +#include /* for put_user_byte */ +#include /* for inb_p, outb_p, inb, outb, etc... */ +#include /* for wait_queue */ +#include /* kd_mksound */ +#include /* for __init */ +#include + +#include +#include "speakup_acnt.h" /* local header file for Accent values */ + +#define synth_readable() (inb_p(synth_port_control) & SYNTH_READABLE) +#define synth_writable() (inb_p(synth_port_control) & SYNTH_WRITABLE) +#define synth_full() (inb_p(synth_port_tts) == 'F') +static int synth_port_control; +/* 160 ms delay and ctrl-x as flush */ +static unsigned int synth_portlist[] = { 0x2a8, 0 }; + +static void do_catch_up(unsigned long data) +{ + unsigned long jiff_in = jiffies; + + synth_stop_timer(); + while ((synth_sent_bytes < synth_queued_bytes) && !synth_full()) { + while (synth_writable()); + + outb_p(*(synth_buffer + synth_sent_bytes++), synth_port_tts); + if (jiffies >= jiff_in + synth_jiffy_delta && + *(synth_buffer + synth_sent_bytes - 1) == ' ') { + while (synth_writable()); + + outb_p('\r', synth_port_tts); + synth_delay(synth_delay_time); + return; + } + } + if (synth_full()) { + synth_delay(synth_full_time); + return; + } + while (synth_writable()); + + outb_p('\r', synth_port_tts); + synth_sent_bytes = synth_queued_bytes = synth_timer_active = 0; + + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); +} + +static void synth_write_tts(char ch) +{ + if (ch < 0x00) + return; /* don't want unprintable chars */ + if (ch == 0x0a) /* turn lf into to force talking. */ + ch = 0x0D; + if (ch == SYNTH_CLEAR) { /* clear all and wake sleeping */ + outb_p(ch, synth_port_tts); /* output to data port */ + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); + synth_timer_active = synth_queued_bytes = synth_sent_bytes = 0; + return; + } + + synth_buffer_add(ch); + + if (synth_buffering && !synth_timer_active) + synth_delay(synth_trigger_time); +} + +static int __init synth_dev_probe(void) +{ + unsigned int port_val = 0; + int i = 0; + + printk(KERN_INFO "Probing for Accent PC.\n"); + if (synth_port_tts) { + printk(KERN_INFO "probe forced to %x by kernel command line\n", + synth_port_tts); + + if (synth_request_region(synth_port_tts - 1, SYNTH_IO_EXTENT)) { + printk(KERN_WARNING "sorry, port already reserved\n"); + return -EBUSY; + } + + port_val = inw(synth_port_tts-1); + synth_port_control = synth_port_tts-1; + } else { + for (i = 0; synth_portlist[i]; i++) { + if (synth_request_region(synth_portlist[i], + SYNTH_IO_EXTENT)) { + printk(KERN_WARNING "request_region: failed " + "with 0x%x, %d\n", + synth_portlist[i], SYNTH_IO_EXTENT); + continue; + } + + port_val = inw(synth_portlist[i]); + if ((port_val &= 0xfffc) == 0x53fc) { + /* 'S' and out & input bits */ + synth_port_control = synth_portlist[i]; + synth_port_tts = synth_port_control+1; + break; + } + } + } + + if ((port_val &= 0xfffc) != 0x53fc) { /* 'S' and out&input bits */ + printk(KERN_WARNING "Accent PC: not found\n"); + synth_release_region(synth_portlist[i], SYNTH_IO_EXTENT); + return -ENODEV; + } + + printk(KERN_INFO "Accent-PC: %03x-%03x, driver version %s,\n", + synth_port_control, synth_port_control + SYNTH_IO_EXTENT - 1, + synth->version); + synth_write(synth->init, strlen(synth->init)); + return 0; +} + +static int synth_alive(void) +{ + return 1; +} + +static const char init_string[] = "\x1b=X \x1bOi\x1bT2\x1b=M\x1bN1\x1bR9\n" + "Accent PC Found\n"; +static const char reinit_string[] = ""; + +static struct spk_variable vars[] = { + { + .id = "flush", + .param = "\x18", + .build = "_", + .flags = BUILDER | HARD_DIRECT | USE_RANGE | NO_USER, + .valid = "*", + }, + { + .id = "pitch", + .param = "5", + .build = "\x1bP_", + .flags = NUMERIC | HARD_DIRECT | USE_RANGE, + .valid = "0,9", + }, + { + .id = "caps_start", + .param = "\x1bP8", + .build = "_", + .flags = 0, + .valid = "*", + }, + { + .id = "caps_stop", + .param = "\x1bP5", + .build = "_", + .flags = 0, + .valid = "*", + }, + { + .id = "rate", + .param = "9", + .build = "\x1bR_", + .flags = HARD_DIRECT, + .valid = "0123456789abcdefgh", + }, + { + .id = "tone", + .param = "5", + .build = "\x1bV_", + .flags = NUMERIC | HARD_DIRECT | USE_RANGE, + .valid = "0,9", + }, + { + .id = "volume", + .param = "9", + .build = "\x1b\x41_", + .flags = NUMERIC | HARD_DIRECT | USE_RANGE, + .valid = "0,9", + }, + { NULL, } +}; + +static char *config[] = { "\x18", "\x1bP5", "\x1bP8", "\x1bP5", "\x1bR9", + "\x1bV5", "\x1b\x41\x39"}; + +struct spk_synth synth_acntpc = { + .name = "acntpc", + .version = "Version-0.9", + .proc_name = "accent_pc", + .init = init_string, + .reinit = reinit_string, + .delay_time = 500, + .trigger_time = 50, + .jiffy_delta = 5, + .full_time = 1000, + .vars = vars, + .config = config, + .config_map = 0, + .probe = synth_dev_probe, + .catch_up = do_catch_up, + .write = synth_write_tts, + .is_alive = synth_alive, +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_acntsa.c linux.20pre5-ac2/drivers/char/speakup/speakup_acntsa.c --- linux.20pre5/drivers/char/speakup/speakup_acntsa.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_acntsa.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,352 @@ +/* + * speakup_acntsa.c - Accent SA driver for Linux kernel 2.3.x and speakup + * + * author: Kirk Reiser + + Copyright (C) 1998-99 Kirk Reiser. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Kirk Reiser + 261 Trott dr. London, Ontario, Canada. N6G 1B6 + */ + +/* These routines are written to control the Accent SA speech + synthesizer by Aicom. They are not ment to be thought of as a device driver + in that they do not register themselves as a chr device and there + is no file_operations structure. They are strictly to provide an + interface to the Accent-SA from the speakup screen review package. +*/ + +#define KERNEL +#include +#include +#include +#include /* for verify_area */ +#include /* for -EBUSY */ +#include /* for check_region, request_region */ +#include /* for loops_per_sec */ +/* #include */ +#include /* for put_user_byte */ +/* #include */ +#include /* for inb_p, outb_p, inb, outb, etc... */ +#include /* for wait_queue */ +#include /* kd_mksound */ +#include /* for __init */ +#include +#include /* for rs_table, serial constants & + serial_uart_config */ +#include /* for more serial constants */ +#include /* for struct serial_state */ +#include + +#include +#include "speakup_acnt.h" /* local header file for Accent values */ + +#define synth_full() (inb_p(synth_port_tts) == 'F') +/* countdown values for serial timeouts */ +#define SPK_SERIAL_TIMEOUT 1000000 +/* countdown values transmitter/dsr timeouts */ +#define SPK_XMITR_TIMEOUT 1000000 +#define SPK_LO_TTY 0 /* check ttyS0 ... ttyS3 */ +#define SPK_HI_TTY 3 +#define NUM_DISABLE_TIMEOUTS 3 /* # of timeouts permitted before disable */ + +static int acntsa_alive; + /* 160 ms delay and ctrl-x as flush */ +#ifdef OLDSUCKYWAY +#define INIT_LEN 45 +static char INIT_STRING[] = "\x1bT2\x1b=M\x1bN1\x1bRD\x1bOp\x1bOL\x1bOi\x1b=" + "B\x1bM2\nAccent S A found\n"; +#define REINIT_LEN 49 +static char *REINIT_STRING = "\x1bT2\x1b=M\x1bN1\x1bRB\x1bOp\x1bOL\x1bOi\x1b" + "=B\x1bM3\nAccent S A restarted\n"; +#endif + +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) + +static struct serial_state rs_table[] __initdata = { + SERIAL_PORT_DFNS +}; + +static int timeouts; /* sequential number of timeouts */ + +static int wait_for_xmitr(void) +{ + int check, tmout = SPK_XMITR_TIMEOUT; + + if (acntsa_alive && timeouts >= NUM_DISABLE_TIMEOUTS) { + acntsa_alive = 0; + return 0; + } + + /* holding register empty? */ + do { + check = inb_p(synth_port_tts + UART_LSR); + if (--tmout == 0) { + printk(KERN_WARNING "Accent-SA: timed out\n"); + timeouts++; + return 0; + } + } while ((check & BOTH_EMPTY) != BOTH_EMPTY); + + tmout = SPK_XMITR_TIMEOUT; + /* CTS */ + do { + check = inb_p(synth_port_tts + UART_MSR); + if (--tmout == 0) { + timeouts++; + return 0; + } + } while ((check & UART_MSR_CTS) != UART_MSR_CTS); + + timeouts = 0; + return 1; +} + +static inline int spk_serial_out(const char ch) +{ + if (acntsa_alive && synth_port_tts) { + if (wait_for_xmitr()) { + outb_p(ch, synth_port_tts); + return 1; + } + } + return 0; +} + +static void do_catch_up(unsigned long data) +{ + unsigned long jiff_in = jiffies; + + synth_stop_timer(); + while ((synth_sent_bytes < synth_queued_bytes) && !synth_full()) { + if (!spk_serial_out(*(synth_buffer + synth_sent_bytes))) { + synth_delay(synth_full_time); + return; + } + synth_sent_bytes++; + if (jiffies >= jiff_in + synth_jiffy_delta + && *(synth_buffer + synth_sent_bytes - 1) == ' ') { + spk_serial_out('\r'); + synth_delay(synth_delay_time); + return; + } + } + + synth_sent_bytes = synth_queued_bytes = 0; + spk_serial_out('\r'); + synth_timer_active = 0; + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); +} + +static void synth_write_tts(char ch) +{ + if (!acntsa_alive) + return; + if (ch < 0x00) + return; /* don't want unprintable chars */ + if (ch == 0x0a) /* turn lf into to force talking. */ + ch = 0x0D; + if (ch == SYNTH_CLEAR) { /* clear all and wake sleeping */ + spk_serial_out(ch); + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); + synth_timer_active = synth_queued_bytes = synth_sent_bytes = 0; + return; + } + + synth_buffer_add(ch); + if (synth_buffering) + return; + if (synth_timer_active == 0) + synth_delay(synth_trigger_time); +} + +static inline void synth_immediate_tts(const char *buf, size_t count) +{ + while (count--) + spk_serial_out(*buf++); + return; +} + +/* + * Setup initial baud/bits/parity. Swiped from serial.c (console section) + * Return non-zero if we didn't find a serial port. + */ +static int __init serprobe(int index) +{ + struct serial_state *ser = NULL; + unsigned char test = 0; + + if (synth_port_tts) { + for (test = 0; test <= SPK_HI_TTY; test++) + if ((rs_table + test)->port == synth_port_tts) { + ser = rs_table + test; + break; + } + } else + ser = rs_table + index; + + /* don't do output yet... */ + if (synth_request_region(ser->port, 8)) + return -1; + + initialize_uart(ser); + /* If we read 0xff from the LSR, there is no UART here. */ + if (inb(ser->port + UART_LSR) == 0xff) { + synth_release_region(ser->port, 8); + return -1; + } + outb(0x0d, ser->port); + mdelay(1); + + acntsa_alive = 1; + /* ignore any error results, if port was forced */ + if (synth_port_tts) + return 0; + + synth_port_tts = ser->port; + /* check for accent s.a now... */ + if (spk_serial_out(0x18)) + return 0; + + synth_release_region(ser->port, 8); + timeouts = acntsa_alive = synth_port_tts = 0; /* not ignoring */ + return -1; +} + +static int __init synth_dev_probe(void) +{ + int i = 0; + + printk(KERN_INFO "Probing for Accent-SA.\n"); + if (synth_port_tts) + printk(KERN_INFO "probe forced to 0x%x by " + "kernel command line\n", synth_port_tts); + + /* check ttyS0-ttyS3 */ + for (i = SPK_LO_TTY; i <= SPK_HI_TTY; i++) { + if (serprobe(i) == 0) + break; /* found it */ + } + + if (acntsa_alive) { + printk(KERN_INFO "Acnt-SA: %03x-%03x, Driver Version %s,\n", + synth_port_tts, synth_port_tts + 7, synth->version); + synth_immediate_tts("\x1b=R\r", 5); + synth_write(synth->init, strlen(synth->init)); + return 0; + } + + printk(KERN_INFO "Accent-SA: not found\n"); + return -ENODEV; +} + +static int synth_alive(void) +{ + if (acntsa_alive) + return 1; /* already on */ + else if (!acntsa_alive && synth_port_tts) { + if (wait_for_xmitr() > 0) { /* restart */ + acntsa_alive = 1; + synth_write(synth->reinit, strlen(synth->reinit)); + return 2; /* reenabled */ + } else + printk(KERN_INFO "Accent-SA: can't restart synth\n"); + } + return 0; +} + +static const char init_string[] = "\x1bT2\x1b=M\x1bOi\x1bN1\x1bRB\n" + "Accent S A Found\n"; +static const char reinit_string[] = "\x1bT2\x1bOi\x1b=M\x1bN1\x1bR9\n" + "Accent S A restarted\n"; + +static struct spk_variable vars[] = { + { + .id = "flush", + .param = "\x18", + .build = "_", + .flags = BUILDER | HARD_DIRECT | USE_RANGE | NO_USER, + .valid = "*", + }, + { + .id = "pitch", + .param = "5", + .build = "\x1bP_", + .flags = NUMERIC | HARD_DIRECT | USE_RANGE, + .valid = "0,9", + }, + { + .id = "caps_start", + .param = "\x1bP8", + .build = "_", + .flags = 0, + .valid = "*", + }, + { + .id = "caps_stop", + .param = "\x1bP5", + .build = "_", + .flags = 0, + .valid = "*", + }, + { + .id = "rate", + .param = "9", + .build = "\x1bR_", + .flags = HARD_DIRECT, + .valid = "0123456789abcdefgh", + }, + { + .id = "tone", + .param = "5", + .build = "\x1bV_", + .flags = NUMERIC | HARD_DIRECT | USE_RANGE, + .valid = "0,9", + }, + { + .id = "volume", + .param = "9", + .build = "\x1b\x41_", + .flags = NUMERIC | HARD_DIRECT | USE_RANGE, + .valid = "0,9", + }, + { NULL, } +}; + +static char *config[] = { "\x18", "\x1bP5", "\x1bP8", "\x1bP5", "\x1bR9", + "\x1bV5", "\x1b\x41\x39" }; + +struct spk_synth synth_acntsa = { + .name = "acntsa", + .version = "Version-0.14", + .proc_name = "accent_sa", + .init = init_string, + .reinit = reinit_string, + .delay_time = 400, + .trigger_time = 5, + .jiffy_delta = 3, + .full_time = 1000, + .vars = vars, + .config = config, + .config_map = 0, + .probe = synth_dev_probe, + .catch_up = do_catch_up, + .write = synth_write_tts, + .is_alive = synth_alive, +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_apolo.c linux.20pre5-ac2/drivers/char/speakup/speakup_apolo.c --- linux.20pre5/drivers/char/speakup/speakup_apolo.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_apolo.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,346 @@ +/* + * speakup_apolo.c for linux kernels 2.2.x and speakup + * + * author: Kirk Reiser + + Copyright (C) 2000 Kirk Reiser. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Kirk Reiser + 261 Trott dr. London, Ontario, Canada. N6G 1B6 + */ + + +/* These routines are written to control the Apolo serial speech + synthesizer. They are not ment to be thought of as a device driver + in that they do not register themselves as a chr device and there + is no file_operations structure. They are strictly to provide an + interface to the apolo from the speakup screen review package. */ + +#define KERNEL +#include +#include +#include +#include /* for verify_area */ +#include /* for -EBUSY */ +#include /* for loops_per_sec */ +#include /* for put_user_byte */ +#include /* for inb_p, outb_p, inb, outb, etc... */ +#include /* for wait_queue */ +#include /* kd_mksound */ +#include /* for __init */ +#include +#include /* for rs_table, serial constants and + serial_uart_config */ +#include /* for more serial constants */ +#include /* for struct serial_state */ +#include +#include + +#define SYNTH_CLEAR 0x18 +#define PROCSPEECH '\r' +#define SPK_TIMEOUT 100 /* buffer timeout in ms */ +#define NUM_DISABLE_TIMEOUTS 3 /* disable synth if n timeouts */ +/* countdown values for serial timeouts */ +#define SPK_SERIAL_TIMEOUT 1000000 +/* countdown values transmitter/dsr timeouts */ +#define SPK_XMITR_TIMEOUT 1000000 +#define SPK_LO_TTY 0 /* check ttyS0 ... ttyS3 */ +#define SPK_HI_TTY 3 + +static int apolo_alive; + +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) + +static struct serial_state rs_table[] = { + SERIAL_PORT_DFNS /* Defined in serial.h */ +}; + +static int timeouts; /* sequential number of timeouts */ + +static int wait_for_xmitr(void) +{ + int check, tmout = SPK_XMITR_TIMEOUT; + + if (apolo_alive && timeouts >= NUM_DISABLE_TIMEOUTS) { + apolo_alive = 0; + timeouts = 0; + return 0; + } + + /* holding register empty? */ + do { + check = inb(synth_port_tts + UART_LSR); + if (--tmout == 0) { + printk(KERN_WARNING "APOLO: timed out\n"); + timeouts++; + return 0; + } + } while ((check & BOTH_EMPTY) != BOTH_EMPTY); + + tmout = SPK_XMITR_TIMEOUT; + /* CTS */ + do { + check = inb(synth_port_tts + UART_MSR); + if (--tmout == 0) { + timeouts++; + return 0; + } + } while ((check & UART_MSR_CTS) != UART_MSR_CTS); + + timeouts = 0; + return 1; +} + +static inline int spk_serial_out(const char ch) +{ + if (apolo_alive && synth_port_tts) { + if (wait_for_xmitr()) { + outb(ch, synth_port_tts); + return 1; + } + } + return 0; +} + +static void do_catch_up(unsigned long data) +{ + unsigned long jiff_in = jiffies; + + synth_stop_timer(); + while (synth_sent_bytes < synth_queued_bytes) { + if (!spk_serial_out(*(synth_buffer+synth_sent_bytes))) { + outb(UART_MCR_DTR, synth_port_tts + UART_MCR); + outb(UART_MCR_DTR | UART_MCR_RTS, + synth_port_tts + UART_MCR); + synth_delay(synth_full_time); + return; + } + synth_sent_bytes++; + if (jiffies >= jiff_in + synth_jiffy_delta && + synth_sent_bytes > 10) { + spk_serial_out(PROCSPEECH); + synth_delay(synth_delay_time); + return; + } + } + + synth_sent_bytes = synth_queued_bytes = 0; + spk_serial_out(PROCSPEECH); + synth_timer_active = 0; + + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); +} + +static void synth_write_tts(char ch) +{ + if (!apolo_alive) + return; + if (ch < 0x00) + return; /* don't want unprintable chars */ + if (ch == 0x0a) /* turn lf into to force talking. */ + ch = PROCSPEECH; + if (ch == SYNTH_CLEAR) { /* clear all and wake sleeping */ + spk_serial_out(ch); + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); + synth_timer_active = synth_queued_bytes = synth_sent_bytes = 0; + return; + } + + synth_buffer_add(ch); + + if (!synth_buffering && !synth_timer_active) + synth_delay(synth_trigger_time); +} + +static inline void synth_immediate_tts(const char *buf, short count) +{ + while (count--) + spk_serial_out(*buf++); +} + +static int __init serprobe(int index) +{ + struct serial_state *ser = NULL; + + if (synth_port_tts) { + unsigned char test; + + for (test = 0; test <= SPK_HI_TTY; test++) + if ((rs_table + test)->port == synth_port_tts) { + ser = rs_table + test; + break; + } + } else + ser = rs_table + index; + + if (synth_request_region(ser->port, 8)) + return -1; + + initialize_uart(ser); + /* If we read 0xff from the LSR, there is no UART here. */ + if (inb (ser->port + UART_LSR) == 0xff) { + synth_release_region(ser->port,8); + return -1; + } + outb(0x0d, ser->port); /* wake it up if older BIOS */ + mdelay(1); + + apolo_alive = 1; + if (synth_port_tts) + return 0; + synth_port_tts = ser->port; + + /* check for apolo now... */ + if (spk_serial_out(0x18)) + return 0; + else + printk(KERN_WARNING "port %x failed\n", synth_port_tts); + + synth_release_region(ser->port,8); + timeouts = apolo_alive = synth_port_tts = 0; + return -1; +} + +static int __init synth_dev_probe(void) +{ + int i; + + printk(KERN_INFO "Probing for Apolo.\n"); + if (synth_port_tts) + printk(KERN_INFO "Probe forced to 0x%x by " + "kernel command line\n", synth_port_tts); + for (i = SPK_LO_TTY; i <= SPK_HI_TTY; i++) { + if (serprobe(i) == 0) + break; /* found it */ + } + + if (apolo_alive) { + /* found 'em */ + printk(KERN_INFO "Apolo: %03x-%03x, Driver version %s,\n", + synth_port_tts, synth_port_tts + 7, synth->version); + synth_immediate_tts(synth->init, strlen(synth->init)); + return 0; + } + + printk(KERN_INFO "Apolo: not found\n"); + return -ENODEV; +} + +static int synth_alive(void) +{ + if (apolo_alive) + return 1; /* already on */ + + if (!apolo_alive && synth_port_tts) { + if (wait_for_xmitr() > 0) { /* restart */ + apolo_alive = 1; + synth_write(synth->reinit, strlen(synth->reinit)); + return 2; /* reenabled */ + } + + printk(KERN_INFO "Apolo: can't restart synth\n"); + } + + return 0; +} + +static const char init_string[] = "@R0@D0@K1@W5\rApolo found\r"; +static const char reinit_string[] = "@R0@D0@K1@W5\rApolo Restarted\r"; + +static struct spk_variable vars[] = { + { + .id = "flush", + .param = "\x18", + .build = "_", + .flags = BUILDER | HARD_DIRECT | NO_USER, + .valid = "*", + }, + { + .id = "pitch", + .param = "8", + .build = "@F_", + .flags = HARD_DIRECT, + .valid = "0123456789abcdef", + }, + { + .id = "caps_start", + .param = "cap ", + .build = "_", + .flags = 0, + .valid = "*", + }, + { + .id = "caps_stop", + .param = "", + .build = "_", + .flags = 0, + .valid = "*", + }, + { + .id = "rate", + .param = "5", + .build = "@W_", + .flags = NUMERIC | HARD_DIRECT | USE_RANGE, + .valid = "1,9", + }, + { + .id = "voice", + .param = "1", + .build = "@V_", + .flags = NUMERIC | HARD_DIRECT | USE_RANGE, + .valid = "1,6", + }, + { + .id = "volume", + .param = "A", + .build = "@A_", + .flags = HARD_DIRECT, + .valid = "0123456789abcdef", + }, + { + .id = "language", + .param = "1", + .build = "@=_,", + .flags = NUMERIC | HARD_DIRECT | USE_RANGE, + .valid = "1,4", + }, + { NULL, }, +}; + +static char *config[] = { "\x18", "@F8", "cap ", "", "@W5", + "@V1", "@AA", "@=1,"}; + +struct spk_synth synth_apolo = { + .name = "apolo", + .version = "Version-0.10", + .proc_name = "apolo", + .init = init_string, + .reinit = reinit_string, + .delay_time = 500, + .trigger_time = 50, + .jiffy_delta = 5, + .full_time = 5000, + .vars = vars, + .config = config, + .config_map = 0, + .probe = synth_dev_probe, + .catch_up = do_catch_up, + .write = synth_write_tts, + .is_alive = synth_alive, +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_audptr.c linux.20pre5-ac2/drivers/char/speakup/speakup_audptr.c --- linux.20pre5/drivers/char/speakup/speakup_audptr.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_audptr.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,311 @@ +/* + * speakup_audapter.c for linux kernels 2.2.x and speakup + * + * author: Kirk Reiser and William Acker + + Copyright (C) 1998-2000 Kirk Reiser. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Kirk Reiser + 261 Trott dr. London, Ontario, Canada. N6G 1B6 + */ + + +/* These routines are written to control the audapter serial speech + synthesizer. They are not ment to be thought of as a device driver + in that they do not register themselves as a chr device and there + is no file_operations structure. They are strictly to provide an + interface to the audapter from the speakup screen review package. +*/ + +#define KERNEL +#include +#include +#include +#include /* for verify_area */ +#include /* for -EBUSY */ +#include /* for check_region, request_region */ +#include /* for loops_per_sec */ +#include /* for put_user_byte */ +#include /* for inb_p, outb_p, inb, outb, etc... */ +#include /* for wait_queue */ +#include /* kd_mksound */ +#include /* for __init */ +#include +#include /* for rs_table, serial constants and + serial_uart_config */ +#include /* for more serial constants */ +#if (LINUX_VERSION_CODE >= 0x20332) /* v 2.3.50+ */ +#include /* for struct serial_state */ +#endif +#include +#include + +#define SYNTH_CLEAR 0x18 /* flush synth buffer */ +#define PROCSPEECH '\r' /* start synth processing speech char */ +#define SPK_TIMEOUT 100 /* buffer timeout in ms */ +#define NUM_DISABLE_TIMEOUTS 3 /* disable synth if n timeouts */ +#define SPK_SERIAL_TIMEOUT 1000000 /* countdown values for serial timeouts */ +#define SPK_XMITR_TIMEOUT 1000000 /* countdown values transmitter/dsr timeouts */ +#define SPK_LO_TTY 0 /* check ttyS0 ... ttyS3 */ +#define SPK_HI_TTY 3 + +static int audptr_alive = 0; + +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) + +static struct serial_state rs_table[] __initdata = { + SERIAL_PORT_DFNS +}; + +static int timeouts = 0; /* sequential number of timeouts */ + +static int wait_for_xmitr(void) +{ +int check, tmout = SPK_XMITR_TIMEOUT; + + if ((audptr_alive) && (timeouts >= NUM_DISABLE_TIMEOUTS)) { + audptr_alive = 0; + timeouts = 0; + return 0; + } + + /* holding register empty? */ + do { + check = inb(synth_port_tts + UART_LSR); + if (--tmout == 0) { + printk("Audapter: timed out\n"); + timeouts++; + return 0; + } + } while ((check & BOTH_EMPTY) != BOTH_EMPTY); + + tmout = SPK_XMITR_TIMEOUT; + /* CTS */ + do { + check = inb(synth_port_tts + UART_MSR); + if (--tmout == 0) { + timeouts++; + return 0; + } + } while ((check & UART_MSR_CTS) != UART_MSR_CTS); + + timeouts = 0; + return 1; +} + +static inline int spk_serial_out(const char ch) +{ + if (audptr_alive && synth_port_tts) { + if (wait_for_xmitr()) { + outb(ch, synth_port_tts); + return 1; + } + } + return 0; +} + +static unsigned char __init spk_serial_in(void) +{ +int c, lsr, tmout = SPK_SERIAL_TIMEOUT; + + do { + lsr = inb(synth_port_tts + UART_LSR); + if (--tmout == 0) return 0xff; + } while (!(lsr & UART_LSR_DR)); + c = inb(synth_port_tts + UART_RX); + return (unsigned char) c; +} + +static void do_catch_up(unsigned long data) +{ + unsigned long jiff_in = jiffies; + +synth_stop_timer(); + while (synth_sent_bytes < synth_queued_bytes) + { + if (!spk_serial_out(*(synth_buffer+synth_sent_bytes))) { + synth_delay(synth_full_time); + return; + } + synth_sent_bytes++; + if ((jiffies >= jiff_in+synth_jiffy_delta && *(synth_buffer+synth_sent_bytes-1) == ' ') + || (jiffies > jiff_in+HZ/10)) { + spk_serial_out(PROCSPEECH); + synth_delay(synth_delay_time); + return; + } + } + +synth_sent_bytes = synth_queued_bytes = 0; +synth_timer_active = 0; +spk_serial_out(PROCSPEECH); +if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); +} + +static inline void clear_it(char ch) +{ + while ((inb(synth_port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY); + outb(ch, synth_port_tts); +} + +static void synth_write_tts(char ch) +{ + if (!audptr_alive) return; + if (ch < 0x00) return; /* don't want unprintable chars */ + if (ch == 0x0a) /* turn lf into to force talking. */ + ch = '\r'; + if (ch == SYNTH_CLEAR) /* clear all and wake sleeping */ + { + clear_it(ch); + spk_serial_out(PROCSPEECH); + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); + synth_timer_active = synth_queued_bytes = synth_sent_bytes = 0; + return; + } + +synth_buffer_add(ch); +if (synth_buffering) return; +if (synth_timer_active == 0) synth_delay( synth_trigger_time ); +} + +static inline void synth_immediate_tts(const char *buf, short count) +{ + while (count--) spk_serial_out(*buf++); +return; +} + +static char synth_id[40] = ""; + +static int __init serprobe(int index) +{ + struct serial_state *ser = NULL; + unsigned char test=0; + + if (synth_port_tts) { + for (test=0; test <= SPK_HI_TTY; test++) + if ( (rs_table+test)->port == synth_port_tts) { + ser = rs_table+test; + break; + } + } else ser = rs_table + index; + + if (synth_request_region(ser->port,8)) + return -1; + + initialize_uart(ser); + /* If we read 0xff from the LSR, there is no UART here. */ + if (inb (ser->port + UART_LSR) == 0xff) { + synth_release_region(ser->port,8); + return -1; + } + mdelay(1); + + audptr_alive = 1; + /* ignore any error results, if port was forced */ + if (synth_port_tts) + return 0; + + synth_port_tts = ser->port; + test = 0; + spk_serial_out(0x05); + spk_serial_out('['); + spk_serial_out('Q'); /* query command */ + spk_serial_out(']'); /* close the query. */ + + if ((synth_id[test] = spk_serial_in()) == 'A') { + do { /* read version string from synth */ + synth_id[++test] = spk_serial_in(); + } while (synth_id[test] != '\n' && test < 32); + synth_id[++test] = 0x00; + if (test != 32) + return 0; + } + + synth_release_region(ser->port,8); + timeouts = audptr_alive = synth_port_tts = 0; /* not ignoring */ + return -1; +} + +static int __init synth_dev_probe(void) +{ +int i=0; + + printk("Probing for Audapter.\n"); + if (synth_port_tts != 0) /* set from commandline */ + printk("Probe forced to 0x%x by kernel command line.\n",synth_port_tts); + + for (i=SPK_LO_TTY; i <= SPK_HI_TTY; i++) { + if (serprobe(i) == 0) break; /* found it */ + } + + if (audptr_alive) { + /* found 'em */ + printk("Audapter: %03x-%03x, Driver %s,\n", + synth_port_tts, synth_port_tts + 7, synth->version); + if (synth_id[0] == 'A') + printk("Audapter version: %s", synth_id); + synth_immediate_tts(synth->init, strlen(synth->init)); + return 0; + } + + printk("Audapter: not found\n"); + return -ENODEV; +} + + /* this is a new function required by speakup: + * if synth is not active, make it active and return 2 + * if synth is already active, return 1 + * otherwise (if it can't be made active), return 0 + */ +static int synth_alive(void) +{ + if (audptr_alive) + return 1; /* already on */ + else if ((!audptr_alive) && (synth_port_tts)) { + if (wait_for_xmitr() > 0) { /* restart */ + audptr_alive = 1; + synth_write(synth->reinit, strlen(synth->reinit)); + return 2; /* reenabled */ + } else printk("Audapter: can't restart synth\n"); + } + return 0; +} + +static const char init_string[] = "\x05[An]\x05[D1]\x05[Ol]Audapter found\r"; +static const char reinit_string[] = "\x05[An]\x05[D1]\x05[Ol]Audapter found\r"; + +static struct spk_variable vars[] = +{{"flush", "\x18\x20", "_", (BUILDER|HARD_DIRECT|NO_USER), "*"}, + {"pitch", "80", "\x05[f_]", (NUMERIC|HARD_DIRECT|USE_RANGE), "39,4500"}, + {"caps_start", "\x05[f99]", "_", 0, "*"}, + {"caps_stop", "\x05[f80]", "_", 0, "*"}, + {"rate", "0", "\x05[r_]", (NUMERIC|HARD_DIRECT|USE_RANGE), "-100,100"}, + {"tone", "9", "\x05[s_]", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,63"}, + {"volume", "21", "\x05[g_]", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,40"}, + {"punct", "n", "\x05[A_]", HARD_DIRECT, "nmsa"}, + END_VARS}; + +static char *config[] = +{"\x18\x20", "\x05[f80]", "\x05[f99]", "\x05[f80]", "\x05[r0]", "\x05[s9]", + "\x05[g21]", "\x05[An]"}; + +struct spk_synth synth_audptr = {"audptr", "Version-0.13", "audapter", + init_string, reinit_string, 400, 5, 3, 5000, + vars, config, 0, synth_dev_probe, do_catch_up, + synth_write_tts, synth_alive}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_bns.c linux.20pre5-ac2/drivers/char/speakup/speakup_bns.c --- linux.20pre5/drivers/char/speakup/speakup_bns.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_bns.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,286 @@ +/* + * speakup_bns.c for linux kernels 2.2.x and speakup + * + * author: Kirk Reiser + + Copyright (C) 1998-99 Kirk Reiser. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Kirk Reiser + 261 Trott dr. London, Ontario, Canada. N6G 1B6 + */ + + +/* These routines are written to control the Braille 'n Speak serial + speech synthesizer in speech box mode. They are not ment to be + thought of as a device driver in that they do not register + themselves as a chr device and there is no file_operations + structure. They are strictly to provide an interface to the bns + from the speakup screen review package. */ + +#define KERNEL +#include +#include +#include +#include /* for verify_area */ +#include /* for -EBUSY */ +#include /* for check_region, request_region */ +#include /* for loops_per_sec */ +#include /* for put_user_byte */ +#include /* for inb_p, outb_p, inb, outb, etc... */ +#include /* for wait_queue */ +#include /* kd_mksound */ +#include /* for __init */ +#include +#include /* for rs_table, serial constants and + serial_uart_config */ +#include /* for more serial constants */ +#if (LINUX_VERSION_CODE >= 0x20300) /* v 2.3.50+ */ +#include /* for struct serial_state */ +#endif +#include +#include + +#define SYNTH_CLEAR 0x18 +#define SPK_TIMEOUT 100 /* buffer timeout in ms */ +#define NUM_DISABLE_TIMEOUTS 3 /* disable synth if n timeouts */ +#define SPK_SERIAL_TIMEOUT 1000000 /* countdown values for serial timeouts */ +#define SPK_XMITR_TIMEOUT 1000000 /* countdown values transmitter/dsr timeouts */ +#define SPK_LO_TTY 0 /* check ttyS0 ... ttyS3 */ +#define SPK_HI_TTY 3 +#define PROCSPEECH '\r' /* process speech char */ + +static int bns_alive = 0; + +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) + +static struct serial_state rs_table[] = { + SERIAL_PORT_DFNS /* Defined in serial.h */ +}; + +static int wait_for_xmitr(void) +{ +static int timeouts = 0; /* sequential number of timeouts */ +int check, tmout = SPK_XMITR_TIMEOUT; + + if ((bns_alive) && (timeouts >= NUM_DISABLE_TIMEOUTS)) { + bns_alive = 0; + timeouts = 0; + return 0; + } + + /* holding register empty? */ + do { + check = inb(synth_port_tts + UART_LSR); + if (--tmout == 0) { + printk("BNS: timed out\n"); + timeouts++; + return 0; + } + } while ((check & BOTH_EMPTY) != BOTH_EMPTY); + + tmout = SPK_XMITR_TIMEOUT; + /* CTS */ + do { + check = inb(synth_port_tts + UART_MSR); + if (--tmout == 0) { + timeouts++; + return 0; + } + } while ((check & UART_MSR_CTS) != UART_MSR_CTS); + + timeouts = 0; + return 1; +} + +static inline int spk_serial_out(const char ch) +{ + if (bns_alive && synth_port_tts) { + if (wait_for_xmitr()) { + outb(ch, synth_port_tts); + return 1; + } + } + return 0; +} + +#if 0 +static unsigned char __init spk_serial_in(void) +{ +int c, lsr, tmout = SPK_SERIAL_TIMEOUT; + + do { + lsr = inb(synth_port_tts + UART_LSR); + if (--tmout == 0) return 0xff; + } while (!(lsr & UART_LSR_DR)); + c = inb(synth_port_tts + UART_RX); + return (unsigned char) c; +} +#endif + +static void do_catch_up(unsigned long data) +{ + unsigned long jiff_in = jiffies; + +synth_stop_timer(); + while (synth_sent_bytes < synth_queued_bytes) + { + if (!spk_serial_out(*(synth_buffer+synth_sent_bytes))) { + synth_delay(synth_full_time); + return; + } + synth_sent_bytes++; + if (jiffies >= jiff_in+synth_jiffy_delta && *(synth_buffer+synth_sent_bytes-1) == ' ') + { + spk_serial_out(PROCSPEECH); + synth_delay(synth_delay_time); + return; + } + } + +synth_sent_bytes = synth_queued_bytes = 0; +spk_serial_out(PROCSPEECH); +synth_timer_active = 0; +if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); +} + +static void synth_write_tts(char ch) +{ + if (!bns_alive) return; + if (ch < 0x00) return; /* don't want unprintable chars */ + if (ch == 0x0a) /* turn lf into to force talking. */ + ch = PROCSPEECH; + if (ch == SYNTH_CLEAR) /* clear all and wake sleeping */ + { + spk_serial_out(ch); + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); + synth_timer_active = synth_queued_bytes = synth_sent_bytes = 0; + return; + } + +synth_buffer_add(ch); +if (synth_buffering) return; +if (synth_timer_active == 0) synth_delay( synth_trigger_time ); +return; +} + +static inline void synth_immediate_tts(const char *buf, short count) +{ + while (count--) spk_serial_out(*buf++); +return; +} + +static int __init serprobe(int index) +{ + struct serial_state *ser = NULL; + unsigned char test=0; + + if (synth_port_tts) { + for (test=0; test <= SPK_HI_TTY; test++) + if ( (rs_table+test)->port == synth_port_tts) { + ser = rs_table+test; + break; + } + } else ser = rs_table + index; + + if (synth_request_region(ser->port,8)) + return -1; + + initialize_uart(ser); + /* If we read 0xff from the LSR, there is no UART here. */ + if (inb (ser->port + UART_LSR) == 0xff) { + synth_release_region(ser->port,8); + return -1; + } + mdelay(1); + outb('\r', ser->port); + + bns_alive = 1; + if (synth_port_tts) return 0; + synth_port_tts = ser->port; + + /* check for bns now... */ + if (spk_serial_out(SYNTH_CLEAR)) return 0; + /*spk_serial_out('\r'); * flush buffer for safety * + spk_serial_out(0x06); + mdelay(10); + if (spk_serial_in() == 0x06) return 0;*/ + + synth_release_region(ser->port,8); + bns_alive = synth_port_tts = 0; + return -1; +} + +static int __init synth_dev_probe(void) +{ +int i; + + printk("Probing for Braille 'N Speak.\n"); + if (synth_port_tts) + printk("Probe forced to 0x%x by kernel command line\n", synth_port_tts); + for (i=SPK_LO_TTY; i <= SPK_HI_TTY; i++) { + if (serprobe(i) == 0) break; /* found it */ + } + + if (bns_alive) { + /* found 'em */ + printk("Braille 'N Speak: %03x-%03x, Driver version %s,\n", + synth_port_tts, synth_port_tts + 7, synth->version); + synth_immediate_tts(synth->init, strlen(synth->init)); + return 0; + } + + printk("Braille 'N Speak: not found\n"); + return -ENODEV; +} + +static int synth_alive(void) +{ + if (bns_alive) + return 1; /* already on */ + else if ((!bns_alive) && (synth_port_tts)) { + if (wait_for_xmitr() > 0) { /* restart */ + bns_alive = 1; + synth_write(synth->reinit, strlen(synth->reinit)); + return 2; /* reenabled */ + } else printk("Braille 'N Speak: can't restart synth\n"); + } + return 0; +} + +static const char init_string[] = "\x05Z\x05\x38P\x05\x43 Braille 'n Speak found\r"; +static const char reinit_string[] = "\x05Z\x05\x38P\x05\x43 Braille 'N Speak initialized\r"; + +static struct spk_variable vars[] = +{{"flush", "\x18", "_", (BUILDER|HARD_DIRECT|NO_USER), "*"}, + {"pitch", "8", "\x05_P", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,16"}, + {"caps_start", "\x05\x31\x32P", "_", 0, "*"}, + {"caps_stop", "\x05\x38P", "_", 0, "*"}, + {"rate", "8", "\x05_E", (NUMERIC|HARD_DIRECT|USE_RANGE), "1,16"}, + {"tone", "8", "\x05_T", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,16"}, + {"volume", "8", "\x05_V", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,16"}, + END_VARS}; + +static char *config[] = +{"\x18", "\x05\x38P", "\x05\x31\x32P", "\x05\x38P", "\x05\x38\x45", + "\x05\x38T", "\x05\x38V"}; + +struct spk_synth synth_bns = {"bns", "Version-0.10", "bns", + init_string, reinit_string, 500, 50, 5, 5000, + vars, config, 0, synth_dev_probe, do_catch_up, + synth_write_tts, synth_alive}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup.c linux.20pre5-ac2/drivers/char/speakup/speakup.c --- linux.20pre5/drivers/char/speakup/speakup.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,2246 @@ +/* speakup.c + review functions for the speakup screen review package. + written by: Kirk Reiser and Andy Berdan. + + Thanks to Barry Pollock for the more responsive diacritical code. + + Thanx eternal to Jim Danley for help with the extended codepage 437 + character array! Very nice job on the /proc file system entries as + well. + + Thanks also to Matt Campbell for a fine job on the driver code + building in the ability to include a number of drivers in at the + same time. + + Copyright (C) 1998 Kirk Reiser. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Kirk Reiser + 261 Trott dr. London, Ontario, Canada. N6G 1B6 */ + +#define __KERNEL_SYSCALLS__ +#include + +#include +#include +#include +#include +#include +#include /* __get_free_page() and friends */ +#include +#include +#include +#include +#include /* copy_from|to|user() and others */ +#include +#include /* for mdelay() */ +#include /* for __init */ +#include /* for misc_register, and SYNTH_MINOR */ + +#ifdef CONFIG_PROC_FS +#include +#endif + +#include +#include /* for alloc_bootmem */ + +#include "../console_macros.h" /* for x, y, attr and pos macros */ +#include /* for KT_SHIFT */ +#include /* for vc_kbd_* and friends */ +#include +#include +#include +#include + +#include /* for isdigit() and friends */ +#include +#include "symbols.h" + + +#define SPEAKUP_VERSION "Speakup v-1.00" + +/* these are globals from the kernel code */ +extern void *kmalloc (size_t, int); +extern void kfree (const void *); +extern struct tty_struct *tty; +extern int fg_console; + +/* These are ours from synth drivers. */ +extern void proc_speakup_synth_init (void); // init /proc synth-specific subtree +#ifdef CONFIG_SPEAKUP_ACNTPC +extern struct spk_synth synth_acntpc; +#endif +#ifdef CONFIG_SPEAKUP_ACNTSA +extern struct spk_synth synth_acntsa; +#endif +#ifdef CONFIG_SPEAKUP_APOLO +extern struct spk_synth synth_apolo; +#endif +#ifdef CONFIG_SPEAKUP_AUDPTR +extern struct spk_synth synth_audptr; +#endif +#ifdef CONFIG_SPEAKUP_BNS +extern struct spk_synth synth_bns; +#endif +#ifdef CONFIG_SPEAKUP_DECEXT +extern struct spk_synth synth_decext; +#endif +#ifdef CONFIG_SPEAKUP_DECTLK +extern struct spk_synth synth_dectlk; +#endif +#ifdef CONFIG_SPEAKUP_DTLK +extern struct spk_synth synth_dtlk; +#endif +#ifdef CONFIG_SPEAKUP_LTLK +extern struct spk_synth synth_ltlk; +#endif +#ifdef CONFIG_SPEAKUP_SPKOUT +extern struct spk_synth synth_spkout; +#endif +#ifdef CONFIG_SPEAKUP_TXPRT +extern struct spk_synth synth_txprt; +#endif + +#define MIN(a,b) ( ((a) < (b))?(a):(b) ) +#define krealloc(ptr,newsize) ( kfree(ptr), ptr = kmalloc(newsize,GFP_KERNEL) ) +#define toctrl(x) ( ( ((x) >= 'A') && ((x) <='Z')) ? ((x) - 'A') : \ + (((x) >= 'a') && ((x) <= 'z')) ? ((x) - 'a') : 0 ) +#define allowable(c) ( ((c) > 0x2f && (c) < 0x3a) \ + || (((c)&0x5f) > 0x40 && ((c)&0x5f) < 0x5b) \ + || (strchr(" \n,.'-:?!", (c)) != NULL) \ + ) + +static int errno; +char *spk_cfg[] = { DEFAULT_SPKUP_VARS }; +long spk_cfg_map; /* which ones have been re'alloc'ed */ +int synth_file_inuse; +static struct spk_variable spk_vars[] = { SPKUP_VARS }; +static unsigned char pitch_shift; +char saved_punc_level = 0x30; +char mark_cut_flag; +unsigned short mark_x; +unsigned short mark_y; +static char synth_name[10] = CONFIG_SPEAKUP_DEFAULT; +static struct spk_synth *synths[] = { +#ifdef CONFIG_SPEAKUP_ACNTPC + &synth_acntpc, +#endif +#ifdef CONFIG_SPEAKUP_ACNTSA + &synth_acntsa, +#endif +#ifdef CONFIG_SPEAKUP_APOLO + &synth_apolo, +#endif +#ifdef CONFIG_SPEAKUP_AUDPTR + &synth_audptr, +#endif +#ifdef CONFIG_SPEAKUP_BNS + &synth_bns, +#endif +#ifdef CONFIG_SPEAKUP_DECEXT + &synth_decext, +#endif +#ifdef CONFIG_SPEAKUP_DECTLK + &synth_dectlk, +#endif +#ifdef CONFIG_SPEAKUP_DTLK + &synth_dtlk, +#endif +#ifdef CONFIG_SPEAKUP_LTLK + &synth_ltlk, +#endif +#ifdef CONFIG_SPEAKUP_SPKOUT + &synth_spkout, +#endif +#ifdef CONFIG_SPEAKUP_TXPRT + &synth_txprt, +#endif + NULL, /* Leave room for one dynamically registered synth. */ + NULL +}; + +#define LineWrapBleep 0x01 +#define LineWrapMask 0xFE +#define AttributeChangeBleep 0x02 +#define AttributeChangeMask 0xFD + +#define punc_level (*(spk_cfg[PUNCT_LEVEL])) +#define spell_delay (*(spk_cfg[SPELL_DELAY])-0x30) +#define key_echo (*(spk_cfg[KEY_ECHO])-0x30) + +/* how about a couple of arrays to index our colours and attributes */ +char *fg_color[] = { + "black", "blue", "green", "cyan", "red", "magenta", "yellow", "white", + "grey", "bright blue", "bright green", "bright cyan", "bright red", + "bright magenta", "bright yellow", "bright white" +}; + +char *bg_color[] = { + "black", "blue", "green", "cyan", "red", "magenta", "yellow", "white", + "blinking black", "blinking blue", "blinking green", "blinking cyan", + "blinking red", "blinking magenta", "blinking yellow", "blinking white" +}; + +char *phonetic[] = { + "alpha", "beta", "charley", "delta", "echo", "fox", "gamma", "hotel", + "india", "juleiet", "keelo", "leema", "mike", "november", "oscar", + "papa", + "quebec", "romeo", "seeara", "tango", "uniform", "victer", "wiskey", + "x ray", + "yankee", "zooloo" +}; + +// array of 256 char pointers (one for each ASCII character description) +// initialized to default_chars and user selectable via /proc/speakup/characters +char *characters[256]; + +char *default_chars[256] = { + "null", "control-a", "control-b", "control-c", "control-d", "control-e", + "control-f", "control-g", "control-h", "control-i", "control-j", + "control-k", + "control-l", "control-m", "control-n", "control-o", "control-p", + "control-q", + "control-r", "control-s", "control-t", "control-u", "control-v", + "control-w", + "control-x", "control-y", "control-z", NULL, NULL, NULL, NULL, NULL, + "space", "bang!", "quote", "number", "dollars", "percent", "and", + "tick", + "left paren", "right paren", "star", "plus", "comma,", "dash", "dot", + "slash", + "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", + "nine", + "colon", "semi", "less", "equals", "greater", "question?", "at", "eigh", + "b", + "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", + "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", + "y", "zehd", "left bracket", "backslash", "right bracket", "caret", + "line", + "accent", "eigh", "b", "c", "d", "e", "f", "g", "h", "i", "j", + "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", + "v", "w", "x", "y", "zehd", "left brace", "bar", "right brace", + "tihlduh", "cap delta", "cap see cedilla", "u oomlout", "e acute", + "eigh circumflex", "eigh oomlout", "eigh grave", "eigh ring", + "see cedilla", + "e circumflex", "e oomlout", "e grave", "i oomlout", "i circumflex", + "i grave", "cap eigh oomlout", "cap eigh ring", "cap e acute", + "eigh e dipthong", "cap eigh cap e dipthong", "o circumflex", + "o oomlout", + "o grave", "u circumflex", "u grave", "y oomlout", "cap o oomlout", + "cap u oomlout", "cents", "pounds", "yen", "peseta", "florin", + "eigh acute", + "i acute", "o acute", "u acute", "n tilde", "cap n tilde", + "feminine ordinal", + "masculin ordinal", "inverted question", + "reversed not", "not", "half", "quarter", "inverted bang", + "much less than", "much greater than", "dark shading", "medium shading", + "light shading", "verticle line", "left tee", "double left tee", + "left double tee", "double top right", "top double right", + "double left double tee", "double vertical line", + "double top double right", + "double bottom double right", "double bottom right", + "bottom double right", + "top right", "left bottom", "up tee", "tee down", "tee right", + "horizontal line", "cross bars", "tee double right", "double tee right", + "double left double bottom", "double left double top", + "double up double tee", + "double tee double down", "double tee double right", + "double horizontal line", + "double cross bars", "up double tee", "double up tee", + "double tee down", + "tee double down", "double left bottom", "left double bottom", + "double left top", "left double top", "double vertical cross", + "double horizontal cross", "bottom right", "left top", "solid square", + "solid lower half", "solid left half", "solid right half", + "solid upper half", + "alpha", "beta", "cap gamma", "pie", "cap sigma", "sigma", "mu", "tou", + "cap phigh", "cap thayta", "cap ohmega", "delta", "infinity", "phigh", + "epsilaun", "intersection", "identical to", "plus or minus", + "equal grater than", "less than equal", "upper integral", + "lower integral", + "divided by", "almost equal", "degrees", "centre dot", + "bullet", "square root", "power", "squared", "black square", + "white space" +}; + +int spk_keydown; +int bell_pos; +static int spk_lastkey; + +struct spk_t *speakup_console[MAX_NR_CONSOLES]; + +int spk_setup (char *str) +{ + int ints[4]; + str = get_options (str, ARRAY_SIZE (ints), ints); + if (ints[0] > 0 && ints[1] >= 0) + synth_port_tts = ints[1]; + return 1; +} + +int spk_ser_setup (char *str) +{ + int lookup[4] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; + int ints[4]; + str = get_options (str, ARRAY_SIZE (ints), ints); + if (ints[0] > 0 && ints[1] >= 0) + synth_port_tts = lookup[ints[1]]; + return 1; +} + +int spk_synth_setup (char *str) +{ + size_t len = MIN (strlen (str), 9); + memcpy (synth_name, str, len); + synth_name[len] = '\0'; + return 1; +} + +__setup ("speakup_port=", spk_setup); +__setup ("speakup_ser=", spk_ser_setup); +__setup ("speakup_synth=", spk_synth_setup); + +void speakup_savekey (unsigned char ch) +{ + /* keydown is seperate since they are handled by two + seperate routines */ + if (ch) + spk_keydown++; + else + spk_keydown = 0; + // keypad slash key is not calling this function as it should -- jd + spk_lastkey = ch; +} + +static void spk_control (int currcons, int value) +{ + if (spk_shut_up || (synth == NULL)) + return; + /* interrupt active + not shut up + not shift key (value == 0) */ + if ((*spk_cfg[NO_INTERRUPT] - 0x30) && value) { + synth_write (synth->config[FLUSH], + strlen (synth->config[FLUSH])); + synth_write (synth->config[PITCH], + strlen (synth->config[PITCH])); + } + + if ((*spk_cfg[SAY_CONTROL] - 0x30 == 0) && (value < 4)) + return; + switch (value) { + case 0: + spkup_write ("shift\n", 6); + break; + case 1: + spkup_write ("insert\n", 7); + break; + case 2: + spkup_write ("control\n", 8); + break; + case 3: + spkup_write ("ault\n", 5); + break; + + case 10: + spkup_write ("caps lock on\n", 13); + break; + case 11: + spkup_write ("caps lock off\n", 14); + break; + case 12: + spkup_write ("numm lock on\n", 13); + break; + case 13: + spkup_write ("numm lock off\n", 14); + break; + case 14: + spkup_write ("scroll lock on\n", 15); + break; + case 15: + spkup_write ("scroll lock off\n", 16); + break; + } +} + +static void s2i (char *start, int length, int *dest) +{ + int i; + for (i = 0; i < length; i++) { + *dest *= 10; + *dest += start[i] - 0x30; + } +} + +static inline void bleep (unsigned short val) +{ + int time = 0; + val = (val + 1) * 75 + 75; + time = *(spk_cfg[BLEEP_TIME]) - 0x30; + if (*(spk_cfg[BLEEP_TIME] + 1) != '\0') { + time *= 10; + time += (*(spk_cfg[BLEEP_TIME] + 1) - 0x30); + } + kd_mksound (val, time); +} + +void speakup_reset (int currcons, unsigned char type) +{ + + spk_shut_up &= 0xfe; + if (spk_killed) + return; + spk_parked &= 0xfe; + if (*(spk_cfg[NO_INTERRUPT]) - 0x30) + return; + spk_keydown++; + + if (synth == NULL) + return; + synth_write (synth->config[FLUSH], strlen (synth->config[FLUSH])); + if (pitch_shift) { + synth_write (synth->config[PITCH], + strlen (synth->config[PITCH])); + pitch_shift = 0; + } +} + +void speakup_shut_up (unsigned int currcons) +{ + spk_shut_up |= 0x01; + speakup_date (currcons); + if (synth == NULL) + return; + synth_write (synth->config[FLUSH], strlen (synth->config[FLUSH])); + synth_write (synth->config[PITCH], strlen (synth->config[PITCH])); +} + +int speakup_diacr (unsigned char ch, unsigned int currcons) +{ + static unsigned char *buf = "\0\0\0\0\0"; + static int num; + int tmp = 0; + + buf[num++] = ch; + buf[num] = '\0'; + + if ((ch == '$' || ch == 27 || (ch > 47 && ch < 58) || ch == 'x' + || ch == 'y' || ch == '+' || ch == '-') && num < 5) + switch (ch) { + case '$': + case 0x1b: /* cancel */ + num = 0; + buf[0] = '\0'; + return 1; + case 'x': + case 'y': + if (buf[0] == '+' || buf[0] == '-') { + s2i (buf + 1, num - 2, &tmp); + tmp = (buf[0] == '+') ? tmp : -tmp; + + /* set tmp to new position */ + if (ch == 'x') + tmp = tmp + spk_x; + else + tmp = tmp + spk_y; + } else { + s2i (buf, num - 1, &tmp); + --tmp; + } + + /* range checking */ + if (ch == 'x') { + if (tmp > video_num_columns) + tmp = video_num_columns; + if (tmp < 0) + tmp = 0; + } else { + if (tmp > video_num_lines) + tmp = video_num_lines; + if (tmp < 0) + tmp = 0; + } + + /* move it, baby... */ + if (ch == 'x') { + spk_pos -= spk_x * 2; + /* set x */ + spk_x = tmp; + spk_pos += tmp * 2; + } else { + /* zero y */ + spk_pos -= spk_y * video_size_row; + /* set y */ + spk_y = tmp; + spk_pos += tmp * video_size_row; + } + num = 0; + buf[0] = '\0'; + return 1; /* no more characters req'd */ + } else { + /* no valid terminator characters or wrong key */ + num = 0; + buf[0] = '\0'; + if (!spk_killed) + spkup_write ("Error\n", 6); + return -1; + } + return 0; /* I want more! */ +} + +void speakup_kill (unsigned int currcons) +{ + if (spk_killed) { /* dead */ + spk_shut_up &= ~0x40; + spkup_write ("Eyem a Lighve!\n", 15); + } else { + spkup_write ("You killed speak up!\n", 21); + spk_shut_up |= 0x40; + } +} + +void speakup_off (unsigned int currcons) +{ + char val = 0; + + if (spk_shut_up & 0x40) + return; /* if speech is killed don't bother. */ + if ((synth == NULL) || (val = synth->is_alive ())) { + /* re-enables synth, if disabled */ + if (spk_shut_up & 0x80 || (val == 2)) { + spk_shut_up &= 0x7f; + spkup_write ("hey. That's better!\n", 20); + } else { + spk_shut_up |= 0x80; + spkup_write ("You turned me off!\n", 19); + } + } + speakup_date (currcons); +} + +void function_announce (unsigned int currcons) +{ + if (spk_sound & 0x40) { + spk_sound &= 0xbf; + spkup_write ("Function announce off.\n", 23); + } else { + spk_sound |= 0x40; + spkup_write ("Function announce on.\n", 22); + } +} + +void speakup_parked (unsigned int currcons) +{ + if (spk_parked & 0x80) { + spk_parked = 0; + spkup_write ("unparked!\n", 10); + } else { + spk_parked |= 0x80; + spkup_write ("parked!\n", 8); + } +} + +void speakup_cursoring (unsigned int currcons) +{ + if (spk_shut_up & 0x02) { + spk_shut_up &= 0xfd; + spkup_write ("cursoring off!\n", 15); + } else { + spk_shut_up |= 0x02; + spkup_write ("cursoring on!\n", 14); + } +} + +void speakup_cut (unsigned int currcons, struct tty_struct *tty) +{ + int ret; + unsigned char args[6*sizeof(short)]; + unsigned short *arg; + static char *buf = "speakup_cut: set_selection failed: "; + + if (mark_cut_flag) { + /* cut */ + arg = (unsigned short *)args + 1; + arg[0] = mark_x + 1; + arg[1] = mark_y + 1; + arg[2] = (unsigned short)spk_x + 1; + arg[3] = (unsigned short)spk_y + 1; + arg[4] = 0; /* char-by-char selection */ + mark_cut_flag = 0; + spkup_write ("cut\n", 4); + + if ((ret = set_selection ((const unsigned long)args+sizeof(short)-1, tty, 0))) { + switch (ret) { + case -EFAULT : + printk(KERN_WARNING "%sEFAULT\n", buf); + break; + case -EINVAL : + printk(KERN_WARNING "%sEINVAL\n", buf); + break; + case -ENOMEM : + printk(KERN_WARNING "%sENOMEM\n", buf); + break; + } + } + } else { + /* mark */ + mark_cut_flag = 1; + mark_x = spk_x; + mark_y = spk_y; + spkup_write ("mark\n", 5); + clear_selection(); + } +} + +void speakup_paste (struct tty_struct *tty) +{ + spkup_write ("paste\n", 6); + paste_selection (tty); +} + +void say_attributes (int currcons) +{ + char buf[80], cnt; + + if (synth == NULL) + return; + spk_parked |= 0x01; + cnt = sprintf (buf, "%s on %s\n", *(fg_color + (spk_attr & 0x0f)), + *(bg_color + (spk_attr >> 4))); + synth_write (buf, cnt); +} + +void say_curr_char (unsigned int currcons) +{ + unsigned short ch; + char buf[128]; + + if (synth == NULL) + return; + spk_parked |= 0x01; + spk_old_attr = spk_attr; + ch = scr_readw ((unsigned short *) spk_pos); + spk_attr = ((ch & 0xff00) >> 8); + if (spk_attr != spk_old_attr && spk_sound & AttributeChangeBleep) + bleep (spk_y); + if ((ch & 0x00ff) > 0x40 && (ch & 0x00ff) < 0x5b) { + pitch_shift++; + ch = sprintf (buf, "%s %s %s", synth->config[CAPS_START], + characters[(unsigned char) ch], + synth->config[CAPS_STOP]); + } else + ch = sprintf (buf, " %s ", characters[(unsigned char) ch]); + synth_write (buf, ch); +} + +void say_phonetic_char (unsigned int currcons) +{ + unsigned short ch; + char buf[64]; + + if (synth == NULL) + return; + spk_parked |= 0x01; + spk_old_attr = spk_attr; + ch = scr_readw ((unsigned short *) spk_pos); + spk_attr = ((ch & 0xff00) >> 8); + if ((ch & 0x00ff) > 0x40 && (ch & 0x00ff) < 0x5b) + ch = ((ch - 0x41) & 0x00ff); + else if ((ch & 0x00ff) > 0x60 && (ch & 0x00ff) < 0x7b) + ch = ((ch - 0x61) & 0x00ff); + else { + say_curr_char (currcons); + return; + } + ch = sprintf (buf, "%s\n", *(phonetic + ch)); + synth_write (buf, ch); +} + +void say_prev_char (unsigned int currcons) +{ + spk_parked |= 0x01; + if (spk_x == 0) { + spkup_write ("left edge\n", 10); + return; + } + spk_x--; + spk_pos -= 2; + say_curr_char (currcons); +} + +void say_next_char (unsigned int currcons) +{ + spk_parked |= 0x01; + if (spk_x == video_num_columns - 1) { + spkup_write ("right edge\n", 11); + return; + } + spk_x++; + spk_pos += 2; + say_curr_char (currcons); +} + +void say_curr_word (unsigned int currcons) +{ + unsigned long cnt = 0, tmpx = 0, tmp_pos = spk_pos; + char buf[video_num_columns + 2]; + + spk_parked |= 0x01; + spk_old_attr = spk_attr; + tmpx = spk_x; + if (((char) scr_readw ((unsigned short *) tmp_pos) == 0x20) + && ((char) scr_readw ((unsigned short *) tmp_pos + 1) > 0x20)) { + tmp_pos += 2; + tmpx++; + } else + while ((tmpx > 0) + && ((scr_readw ((unsigned short *) tmp_pos - 1) & 0x00ff) + != 0x20)) { + tmp_pos -= 2; + tmpx--; + } + spk_attr = + (unsigned char) (scr_readw ((unsigned short *) tmp_pos) >> 8); + while (tmpx < video_num_columns) { + if ((*(buf + cnt) = + (char) scr_readw ((unsigned short *) tmp_pos)) == 0x20) + break; + tmpx++; + tmp_pos += 2; + cnt++; + } + *(buf + cnt++) = '\n'; + saved_punc_level = punc_level; + punc_level = ALL; + spkup_write (buf, cnt); + punc_level = saved_punc_level; +} + +void say_prev_word (unsigned int currcons) +{ + spk_parked |= 0x01; + if (((scr_readw ((unsigned short *) spk_pos) & 0x00ff) > 0x20) + && (((scr_readw ((unsigned short *) spk_pos - 1) & 0x00ff) == 0x20) + || spk_x == 0)) { + if (spk_x > 0) { + spk_x--; + spk_pos -= 2; + } else { + if (spk_y > 0) { + spk_y--; + spk_pos -= 2; + spk_x = video_num_columns - 1; + if (spk_sound & LineWrapBleep) + bleep (spk_y); + else + spkup_write ("left edge.\n", 11); + } else { + spkup_write ("top edge.\n", 10); + return; + } + } + } + + while (!(((scr_readw ((unsigned short *) spk_pos) & 0x00ff) > 0x20) + && + (((scr_readw ((unsigned short *) spk_pos - 1) & 0x00ff) == + 0x20) + || spk_x == 0))) { + if (spk_x > 0) { + spk_x--; + spk_pos -= 2; + } else { + if (spk_y > 0) { + spk_y--; + spk_pos -= 2; + spk_x = video_num_columns - 1; + if (spk_sound & LineWrapBleep) + bleep (spk_y); + else + spkup_write ("left edge.\n", 11); + } else { + spkup_write ("top edge.\n", 10); + break; + } + } + } + + say_curr_word (currcons); +} + +void say_next_word (unsigned int currcons) +{ + spk_parked |= 0x01; + if (((scr_readw ((unsigned short *) spk_pos) & 0x00ff) > 0x20) + && (((scr_readw ((unsigned short *) spk_pos - 1) & 0x00ff) == 0x20) + || spk_x == 0)) { + if (spk_x < video_num_columns - 1) { + spk_x++; + spk_pos += 2; + } else { + if (spk_y < video_num_lines - 1) + spk_y++; + else { + spkup_write ("bottom edge.\n", 13); + return; + } + spk_x = 0; + spk_pos += 2; + if (spk_sound & LineWrapBleep) + bleep (spk_y); + else + spkup_write ("right edge.\n", 12); + } + } + + while (!(((scr_readw ((unsigned short *) spk_pos) & 0x00ff) > 0x20) + && + (((scr_readw ((unsigned short *) spk_pos - 1) & 0x00ff) == + 0x20) + || spk_x == 0))) { + if (spk_x < video_num_columns - 1) { + spk_x++; + spk_pos += 2; + } else { + if (spk_y < video_num_lines - 1) + spk_y++; + else { + spkup_write ("bottom edge.\n", 13); + break; + } + spk_x = 0; + spk_pos += 2; + if (spk_sound & LineWrapBleep) + bleep (spk_y); + else + spkup_write ("right edge.\n", 12); + } + } + + say_curr_word (currcons); +} + +void spell_word (unsigned int currcons) +{ + unsigned long tmpx = spk_x, tmp_pos = spk_pos; + char *delay_str[] = { " ", ", ", ". ", ". . ", ". . . " }; + char dnum[] = { 1, 2, 2, 4, 6 }; + + if (synth == NULL) + return; + spk_parked |= 0x01; + if (((char) scr_readw ((unsigned short *) spk_pos) == 0x20) + && ((char) scr_readw ((unsigned short *) spk_pos + 1) > 0x20)) { + spk_pos += 2; + spk_x++; + } else + while ((spk_x > 0) + && ((scr_readw ((unsigned short *) spk_pos - 1) & 0x00ff) + != 0x20)) { + spk_pos -= 2; + spk_x--; + } + + for (; spk_x < video_num_columns; spk_x++, spk_pos += 2) { + if ((char) scr_readw ((unsigned short *) spk_pos) == 0x20) + break; + synth_write (delay_str[spell_delay - 1], dnum[spell_delay - 1]); + say_curr_char (currcons); + } + + spk_pos = tmp_pos; + spk_x = tmpx; +} + +void say_curr_line (unsigned int currcons) +{ + unsigned long tmp; + unsigned char buf[video_num_columns + 2], i = 0, not_blank = 0; + + spk_parked |= 0x01; + spk_old_attr = spk_attr; + spk_attr = + (unsigned char) (scr_readw ((unsigned short *) spk_pos) >> 8); + for (tmp = spk_pos - (spk_x * 2); + tmp < spk_pos + ((video_num_columns - spk_x) * 2); tmp += 2) { + *(buf + i) = (unsigned char) scr_readw ((unsigned short *) tmp); + if (*(buf + i++) != 0x20) + not_blank++; + } + *(buf + i++) = '\n'; + + if (not_blank) + spkup_write (buf, i); + else + spkup_write ("blank\n", 6); +} + +void say_prev_line (unsigned int currcons) +{ + spk_parked |= 0x01; + if (spk_y == 0) { + spkup_write ("top edge.\n", 10); + return; + } + + spk_y--; + spk_pos -= video_size_row; + say_curr_line (currcons); +} + +void say_next_line (unsigned int currcons) +{ + spk_parked |= 0x01; + if (spk_y == video_num_lines - 1) { + spkup_write ("bottom edge.\n", 13); + return; + } + + spk_y++; + spk_pos += video_size_row; + say_curr_line (currcons); +} + +static inline void say_line_from_to (unsigned int currcons, unsigned long from, unsigned long to) +{ + unsigned long tmp; + unsigned char buf[video_num_columns + 2], i = 0, not_blank = 0; + + spk_parked |= 0x01; + spk_old_attr = spk_attr; + spk_attr = + (unsigned char) (scr_readw ((unsigned short *) spk_pos) >> 8); + for (tmp = origin + (spk_y * video_size_row) + (from * 2); + tmp < origin + (spk_y * video_size_row) + (to * 2); tmp += 2) { + *(buf + i) = (unsigned char) scr_readw ((unsigned short *) tmp); + if (*(buf + i++) != 0x20) + not_blank++; + } + *(buf + i++) = '\n'; + + if (not_blank) + spkup_write (buf, i); + else + spkup_write ("blank\n", 6); +} + +void say_screen (unsigned int currcons) +{ + unsigned long tmp_pos = origin; + unsigned char c, blank = 0; + + spk_parked |= 0x01; + while (tmp_pos < origin + (video_num_lines * video_size_row)) { + if ((c = + (unsigned char) scr_readw ((unsigned long *) tmp_pos)) == + 0x20) + blank++; + else + blank = 0; + tmp_pos += 2; + if (blank > 1) + continue; + spkup_write (&c, 1); +/* insert a space at the end of full lines */ + if ((tmp_pos - origin) % video_size_row == 0 && blank == 0) + spkup_write(" ", 1); + } +} + +static inline void say_screen_from_to (unsigned int currcons, unsigned long from, unsigned long to) +{ + unsigned long tmp_pos; + unsigned char c, blank = 0; + + spk_parked |= 0x01; + if (from > 0) + tmp_pos = origin + ((from - 1) * video_size_row); + else + tmp_pos = origin; + if (to > video_num_lines) + to = video_num_lines; + while (tmp_pos < origin + (to * video_size_row)) { + if ((c = + (unsigned char) scr_readw ((unsigned long *) tmp_pos)) == + 0x20) + blank++; + else + blank = 0; + tmp_pos += 2; + if (blank > 1) + continue; + spkup_write (&c, 1); + } +} + +void top_edge (unsigned int currcons) +{ + spk_parked |= 0x01; + spk_pos -= spk_y * video_size_row; + spk_y = 0; + say_curr_line (currcons); +} + +void bottom_edge (unsigned int currcons) +{ + spk_parked |= 0x01; + spk_pos += (video_num_lines - spk_y - 1) * video_size_row; + spk_y = video_num_lines - 1; + say_curr_line (currcons); +} + +void left_edge (unsigned int currcons) +{ + spk_parked |= 0x01; + spk_pos -= spk_x * 2; + spk_x = 0; + say_curr_char (currcons); +} + +void right_edge (unsigned int currcons) +{ + spk_parked |= 0x01; + spk_pos += (video_num_columns - spk_x - 1) * 2; + spk_x = video_num_columns - 1; + say_curr_char (currcons); +} + +void say_position (unsigned int currcons) +{ + char buf[40]; + int count; + + spk_parked |= 0x01; + count = + sprintf (buf, "line %ld, position %ld, t t y. %d\n", spk_y + 1, + spk_x + 1, currcons + 1); + spkup_write (buf, count); +} + +// Added by brianb +void say_char_num (unsigned int currcons) +{ + char buf[32]; + unsigned short ch; + + spk_parked |= 0x01; + ch = scr_readw ((unsigned short *) spk_pos); + ch &= 0x0ff; + ch = sprintf (buf, "hex %02x, decimal %d\n", ch, ch); + spkup_write (buf, ch); +} + +/* these are stub functions to keep keyboard.c happy. */ + +void say_from_top (unsigned int currcons) +{ + say_screen_from_to (currcons, 0, spk_y + 1); +} + +void say_to_bottom (unsigned int currcons) +{ + say_screen_from_to (currcons, spk_y + 1, video_num_lines); +} + +void say_from_left (unsigned int currcons) +{ + say_line_from_to (currcons, 0, spk_x); +} + +void say_to_right (unsigned int currcons) +{ + say_line_from_to (currcons, spk_x, video_num_columns); +} + +/* end of stub functions. */ + +extern int synth_init (void); +extern char synth_buffering; /* flag to indicate we're buffering */ +unsigned short skip_count = 0; + +void spk_skip (unsigned short cnt) +{ + skip_count += cnt; +} + +int spkup_write (const char *buf, int count) +{ + static unsigned short rep_count; + static char old_ch, oldest_ch, count_buf[30], punc_buf[128]; + int in_count = count; + char *punc_search = NULL; + + if (synth == NULL) + return count; + spk_keydown = 0; + while (count--) { + if (rep_count) { + if (*buf == old_ch) { + buf++; + rep_count++; + continue; + } else { + if (rep_count > 3) { + synth_write (count_buf, + sprintf (count_buf, + " repeated %d times. \n", + rep_count)); + } + rep_count = 0; + } + } + if (!key_echo && (*buf == spk_lastkey)) + goto forget_about_it; + // keypad slash is the only key that slips through and speaks when + // key_echo is 0, not sure why -- bug + if (((*buf == spk_lastkey) || + ((punc_search = + strchr (*(spk_cfg + PUNC_OFFSET + (punc_level - 0x30)), + *buf)) != NULL)) + && *buf != 0x00) { + if ((*buf == spk_lastkey) && (*buf & 0x00ff) > 0x40 + && (*buf & 0x00ff) < 0x5b) { + /* keyboard caps character */ + pitch_shift++; + synth_write (punc_buf, + sprintf (punc_buf, "%s %s %s", + synth->config[CAPS_START], + *(characters + *buf), + synth-> + config[CAPS_STOP])); + } else + synth_write (punc_buf, + sprintf (punc_buf, " %s ", + *(characters + *buf))); + } else if (allowable (*buf)) + synth->write (*buf); + + forget_about_it: + if (*buf == old_ch && *buf == oldest_ch && rep_count == 0 + && punc_search != NULL) + rep_count = 3; + oldest_ch = old_ch; + old_ch = *buf++; + } + + spk_lastkey = 0; + if (in_count > 3 && rep_count > 3) { + synth_write (count_buf, + sprintf (count_buf, " repeated %d times. \n", + rep_count)); + rep_count = 0; + } + return 0; +} + +char *strlwr (char *s) +{ + char *p = s; + while (*p) + { + *p = tolower (*p); + p++; + } + return s; +} + +void __init speakup_open (unsigned int currcons) +{ + int i = 0; + + strlwr (synth_name); + while ((synth == NULL) && (synths[i] != NULL)) { + if (strcmp (synths[i]->name, synth_name) == 0) + synth = synths[i]; + else + i++; + } + + if ((synth == NULL) && (strcmp (synth_name, "none") != 0)) + printk (KERN_WARNING "Speakup: unknown synthesizer \"%s\"\n", + synth_name); + + if ((synth != NULL) && synth_init ()) { + spk_shut_up |= 0x80; /* hopefully let the system work without the synth */ + return; + } + synth_buffering = 0; +} + +// provide a file to users, so people can send to /dev/synth + +static ssize_t speakup_file_write (struct file *fp, const char *buf, + size_t nbytes, loff_t * ppos) +{ + size_t count = nbytes; + const char *ptr = buf; + + int bytes; + char tbuf[256]; + + while (count > 0) { + bytes = MIN (count, sizeof (tbuf)); + if (copy_from_user (&tbuf, ptr, bytes)) + return -EFAULT; + + count -= bytes; + ptr += bytes; + + synth_write (tbuf, bytes); + } + return (ssize_t) nbytes; +} + +static int speakup_file_ioctl (struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + return 0; // silently ignore +} + +static ssize_t speakup_file_read (struct file *fp, char *buf, size_t nbytes, loff_t * ppos) +{ + /* *nod* *nod* We'll take care of that, ma'am. *flush* */ + return 0; +} + +static int speakup_file_open (struct inode *ip, struct file *fp) +{ + if (synth_file_inuse) + return -EBUSY; + else if (synth == NULL) + return -ENODEV; + + synth_file_inuse++; + return 0; +} + +static int speakup_file_release (struct inode *ip, struct file *fp) +{ + synth_file_inuse = 0; + return 0; +} + +static struct file_operations synth_fops = { + .owner = THIS_MODULE, + .read = speakup_file_read, + .write = speakup_file_write, + .ioctl = speakup_file_ioctl, + .open = speakup_file_open, + .release = speakup_file_release, +}; + +void speakup_register_devsynth (void) +{ + static struct miscdevice synth_device; + + synth_device.minor = SYNTH_MINOR; + synth_device.name = "synth"; + synth_device.fops = &synth_fops; + + if (misc_register (&synth_device)) + printk ("speakup: Couldn't initialize miscdevice /dev/synth.\n"); + else + printk + ("speakup: initialized device: /dev/synth, node (MAJOR 10, MINOR 25)\n"); +} + +static void reset_default_chars (void) +{ + static int first_pass = 1; + int i; + + for (i = 0; i < 256; ++i) { + // if pointing to allocated memory, free it! + if (first_pass || characters[i] != default_chars[i]) { + if (!first_pass) + kfree (characters[i]); + characters[i] = default_chars[i]; + } + } + first_pass = 0; +} + +#ifdef CONFIG_PROC_FS + +// speakup /proc interface code + +/* +Notes: +currently, user may store an unlimited character definition + +Usage: +cat /proc/speakup/version + +cat /proc/speakup/characters > foo +less /proc/speakup/characters +vi /proc/speakup/characters + +cat foo > /proc/speakup/characters +cat > /proc/speakup/characters +echo 39 apostrophe > /proc/speakup/characters +echo 87 w > /proc/speakup/characters +echo 119 w > /proc/speakup/characters +echo defaults > /proc/speakup/characters +echo reset > /proc/speakup/characters +*/ + +// the /proc/speakup directory inodes +// static struct proc_dir_entry *proc_speakup_device; +// synth-specific directory created in synth driver file + +// this is the handler for /proc/speakup/version +static int speakup_version_read_proc (char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len = sprintf (page, "%s\n", SPEAKUP_VERSION); + *start = 0; + *eof = 1; + return len; +} + +// this is the read handler for /proc/speakup/characters +static int speakup_characters_read_proc (char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int i; + int len = 0; + off_t begin = 0; + + for (i = 0; i < 256; ++i) { + if (characters[i]) + len += + sprintf (page + len, "%d\t%s\n", i, characters[i]); + else + len += sprintf (page + len, "%d\tNULL\n", i); + if (len + begin > off + count) + break; + if (len + begin < off) { + begin += len; + len = 0; + } + } + if (i >= 256) + *eof = 1; + if (off >= len + begin) + return 0; + *start = page + (off - begin); + return ((count < begin + len - off) ? count : begin + len - off); +} + +static volatile int chars_timer_active; // indicates when a timer is set +static DECLARE_WAIT_QUEUE_HEAD (chars_sleeping_list); +static struct timer_list chars_timer; + +static inline void chars_stop_timer (void) +{ + if (chars_timer_active) + del_timer (&chars_timer); +} + +static int strings, rejects, updates; + +static void show_char_results (unsigned long data) +{ + int len; + char buf[80]; + + chars_stop_timer (); + // tell what happened + len = sprintf (buf, " updated %d of %d character descriptions", + updates, strings); + if (rejects) + sprintf (buf + len, " with %d reject%s\n", + rejects, rejects > 1 ? "s" : ""); + else + sprintf (buf + len, "\n"); + printk (buf); + chars_timer_active = 0; +} + +/* this is the write handler for /proc/speakup/silent */ +static int speakup_silent_write_proc (struct file *file, const char *buffer, + unsigned long count, void *data) +{ + unsigned int currcons = fg_console; + char ch = 0; + if (count < 0 || count > 2) + goto msg_out; + if (count) + get_user (ch, buffer); + if (!count || ch == '\n') + ch = '0'; + switch (ch) { + case '0' : + if (spk_killed) + speakup_kill(currcons); + goto out; + case '1' : + if (!spk_killed) + speakup_kill(currcons); + goto out; + case '2' : + if (spk_killed) + spk_shut_up &= ~0x40; + goto out; + case '3' : + if (!spk_killed) + spk_shut_up |= 0x40; + goto out; + } + +msg_out: + printk (KERN_ALERT "setting silent: value not in range (0,3)\n"); + +out: + return count; +} + +// this is the write handler for /proc/speakup/characters +static int speakup_characters_write_proc (struct file *file, const char *buffer, + unsigned long count, void *data) +{ + static const int max_description_len = 72; + static int cnt, num, state; + static char desc[max_description_len + 1]; + static unsigned long jiff_last; + int i; + char ch, *s1, *s2; + + // reset certain vars if enough time has elapsed since last called + if (jiffies - jiff_last > HZ/10) { + state = strings = rejects = updates = 0; + } + jiff_last = jiffies; + // walk through the buffer + for (i = 0; i < count; ++i) { + get_user (ch, buffer + i); + switch (state) { + case 0: // initial state, only happens once per "write" + // if input matches "defaults" or "reset" reset_default_chars() and return + if ((ch == '\n' && count == 1) || strchr ("dDrR", ch)) { + reset_default_chars (); + printk (KERN_ALERT + "character descriptions reset to defaults\n"); + return count; + } + ++state; + // intentionally fall through to next state + case 1: // check for comment and skip whitespace + if (ch == '#') { // comment + num = -1; // don't count as rejected + state = 6; // ignore remainder of line + break; // and don't process + } + if (ch == ' ' || ch == '\t') // skip whitespace + break; + if (!isdigit (ch)) { + state = 6; + break; + } + num = ch - '0'; // convert first digit from ASCII + ++state; // now expecting only digits or whitespace + break; + case 2: // building number + if (isdigit (ch)) { + num *= 10; + num += ch - '0'; // convert from ASCII + break; + } + if (ch != ' ' && ch != '\t') { // not whitespace + state = 6; + break; + } + // pointing to 1st whitespace past digits -- number is complete + if (num < 0 || num > 255) { // not in range + state = 6; + break; + } + if (num >= 27 && num <= 31) { // no descriptions for these + num = -1; // don't count as rejected + state = 6; // but don't process either + break; + } + ++state; // now looking for 1st char of description + break; + case 3: /* skipping whitespace prior to description */ + if (ch == ' ' || ch == '\t') // skip whitespace + break; + if (ch == '\n') { // reached EOL + state = 6; + break; + } + cnt = 0; // starting new description + desc[cnt++] = ch; + ++state; // now looking for EOL + break; + case 4: // looking for newline + if (ch != '\n') { // not yet + // add char to description + desc[cnt++] = ch; + if (cnt < max_description_len) + break; // building description + // maximum description length reached, truncate remainder + state = 5; + } + // prepare to work on next string + state = state == 5 ? state : 1; + // description string is complete + desc[cnt] = '\0'; // NULL terminate + // if new description matches old, we don't need to update + s1 = desc; // point to new description + s2 = characters[num]; // point to old/current + while (*s1 == *s2) { + if (!*s1) // reached end of strings + break; + ++s1; + ++s2; + } + if (*s1 == *s2) { // strings match + ++strings; + break; + } + // handle new description + // is this description the default or has it already been modified? + if (characters[num] == default_chars[num]) // original + characters[num] = + (char *) kmalloc (sizeof (char) * + (strlen (desc) + 1), + GFP_KERNEL); + else // already redefined/allocated + krealloc (characters[num], strlen (desc) + 1); + if (!characters[num]) { // allocation failed + characters[num] = default_chars[num]; // reset to default + return -ENOMEM; + } + // got mem, copy the string + strcpy (characters[num], desc); + ++updates; + ++strings; + break; + case 5: // truncating oversized description + if (ch == '\n') + state = 1; // ready to start anew + // all other chars go to the bit bucket + break; + case 6: // skipping all chars while looking for newline + // we only get here if the data is invalid + if (ch == '\n') { + state = 1; + // -1 indicates chars with no description (ASCII 27-31) + if (num != -1) + ++rejects; + ++strings; + } + break; + } // end switch + } // finished processing entire buffer + + chars_stop_timer (); + init_timer (&chars_timer); + chars_timer.function = show_char_results; + init_waitqueue_head (&chars_sleeping_list); + + chars_timer.expires = jiffies + HZ/20; + if (!chars_timer.list.prev) + add_timer (&chars_timer); + chars_timer_active++; + return count; +} + +static int human_readable (char *s, struct spk_variable *var, char *buf) +{ + char *fmt = var->build; // point to start of it's format + int len = 0; + char *end = s + strlen (s) - 1; // point to end of string holding value + char *end_fmt = fmt + strlen (fmt) - 1; // point to end of it's format + + while (*fmt != '_' && *s == *fmt) { + ++s; + ++fmt; + } + // s now points to beginning of unformatted value, find the end + while (*end_fmt != '_' && *end == *end_fmt) { + --end; + --end_fmt; + } + // end now points to last char of unformatted value + // store value converting to human readable if necessary + for (; s <= end; ++s) { + if (*s < 32) { // don't print these directly + // convert to hex, 0x00 - 0xff + *(buf + len++) = '\\'; + *(buf + len++) = 'x'; + if (*s > 15) + *(buf + len++) = '1'; + else + *(buf + len++) = '0'; + if ((*s % 16) < 10) + *(buf + len++) = (*s % 16) + '0'; + else + *(buf + len++) = (*s % 16) + 'a' - 10; + } else + *(buf + len++) = *s; + if (*s == '\\') + *(buf + len++) = *s; // double up on escape char + } + // append a newline + *(buf + len++) = '\n'; + return len; +} + +static int find_config_var (const char *name, char ***value, + struct spk_variable **var, long **cfg_map) +{ + int i; + + if (synth != NULL) + for (i = 0; synth->vars[i].id != NULL; i++) { + if (strcmp (synth->vars[i].id, name) == 0) { + *value = &(synth->config[i]); + *var = &(synth->vars[i]); + *cfg_map = &(synth->config_map); + return i; + } + } + + for (i = 0; spk_vars[i].id != NULL; i++) { + if (strcmp (spk_vars[i].id, name) == 0) { + *value = &(spk_cfg[i]); + *var = &(spk_vars[i]); + *cfg_map = &spk_cfg_map; + return i; + } + } + + return -1; +} + +// this is the read handler for /proc/speakup/settings +int speakup_settings_read_proc (char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct proc_dir_entry *ent = data; + char **value; + struct spk_variable *var; + long *cfg_map; + int index = find_config_var (ent->name, &value, &var, &cfg_map); + + *start = 0; + *eof = 1; + + if (index == -1) + return sprintf (page, "%s slipped through the cracks!\n", + ent->name); + + return human_readable (*value, var, page); +} + +char *xlate (char *s) +{ + char *p = s, c; + size_t len = strlen (s); + int num, num_len; + + while ((p = strchr (p, '\\'))) { + num_len = 1; + switch (*(p + 1)) { + case '\\': + break; + case 'r': + *p = '\r'; + break; + case 'n': + *p = '\n'; + break; + case 't': + *p = '\t'; + break; + case 'v': + *p = '\v'; + break; + case 'a': + *p = '\a'; + break; +#ifdef fix_octal + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + if (sscanf (p + 1, "%3o%n", &num, &num_len)) + *p = (char) num; + break; +#endif + case 'x': + c = *(p + 2); + if (isdigit (c)) + num = c - '0'; + else if (isxdigit (c)) + num = tolower (c) - 'a' + 10; + else + break; + num *= 0x10; + c = *(p + 3); + if (isdigit (c)) + num += c - '0'; + else if (isxdigit (c)) + num += tolower (c) - 'a' + 10; + else + break; + num_len = 3; + *p = (char) num; + break; + default: + *p = *(p + 1); + } + num = p - s + num_len; + ++p; + memmove (p, p + num_len, len - num); + } + return s; +} + +#define NOT_IN_RANGE -1 +#define NOT_ONE_OF -2 +#define STRING_TOO_LONG -3 +#define RESET_DEFAULT -4 + +// this is the write handler for /proc/speakup/settings +static int speakup_settings_write_proc (struct file *file, const char *buffer, + unsigned long count, void *data) +{ + struct proc_dir_entry *ent = data; + int ret = NOT_IN_RANGE, i, limit, val = 0; + long *cfg_map; + char *p = NULL, *parm, *formatted, *src, *dest, **value; + struct spk_variable *sv; + int index = find_config_var (ent->name, &value, &sv, &cfg_map); + int currcons = 0; + + if (count < 0 || count > 1024) + return -EINVAL; + if (!(parm = (char *) __get_free_page (GFP_KERNEL))) + return -ENOMEM; + if (copy_from_user (parm, buffer, count)) { + ret = -EFAULT; + goto out; + } + // NULL terminate + if (*(parm + count - 1) == '\n') + *(parm + count - 1) = '\0'; + else + *(parm + count) = '\0'; + xlate (parm); + formatted = parm + strlen (parm) + 1; + if (index == -1) { + printk (KERN_ALERT "%s slipped through the cracks!\n", + ent->name); + ret = count; + goto out; + } + // wildcard + if (!sv->flags && *sv->valid == '*') { + // arbitrary 33 char limit + if (strlen (parm) > PUNC_CHARS_SIZE) { + ret = STRING_TOO_LONG; + goto msg_out; + } + // all is well + } else if (*parm && (sv->flags & USE_RANGE)) { + // check range + if (sv->flags & NUMERIC) { + int neg = 0; + // atoi on user provided value + p = parm; + if (*p == '-') { + ++neg; + ++p; + } + for (val = 0; *p; ++p) { + if (!isdigit (*p)) + goto msg_out; + val *= 10; + val += *p - '0'; + } + if (neg) { + val = -val; + neg = 0; + } + // atoi on lower limit of range + p = sv->valid; + if (*p == '-') { + ++neg; + ++p; + } + for (limit = 0; *p && *p != ','; ++p) { + // valid range? + if (!isdigit (*p)) + goto msg_out; + limit *= 10; + limit += *p - '0'; + } + if (neg) { + limit = -limit; + neg = 0; + } + if (val < limit) + goto msg_out; + // should be pointing to the comma in range + if (*p == ',') + ++p; + else + goto msg_out; + // atoi on upper limit of range + /* if bell_pos, this value is video_num_columns */ + dest = p; + if (*p == '-') { + ++neg; + ++p; + } + for (limit = 0; *p; ++p) { + // valid range? + if (!isdigit (*p)) + goto msg_out; + limit *= 10; + limit += *p - '0'; + } + if (neg) + limit = -limit; + if (index == BELL_POS) { + limit = video_num_columns; + sprintf (dest, "%-d", limit); + } + if (val > limit) + goto msg_out; + // numeric val is in range + } else { + // range of chars + p = sv->valid; + // parm should be exactly 1 char + if (*(parm + 1)) { + ret = NOT_ONE_OF; + goto msg_out; + } + *parm = tolower (*parm); + // expecting a comma here and char in range + if (*(p + 1) != ',' || *parm < *p || *parm > *(p + 2)) { + ret = NOT_ONE_OF; + goto msg_out; + } + } + } else if (*parm && (sv->flags & MULTI_SET)) { + // each char must be one of valid + if (strlen (parm) > PUNC_CHARS_SIZE) { + ret = STRING_TOO_LONG; + goto msg_out; + } + for (p = parm; *p; ++p) + if (!strchr (sv->valid, *p)) { + ret = NOT_ONE_OF; + goto msg_out; + } + } else if (*parm) { + // find_is_one_of + p = sv->valid; + // parm should be exactly 1 char + if (*(parm + 1)) { + ret = NOT_ONE_OF; + goto msg_out; + } + *parm = tolower (*parm); + for (; *p; ++p) + if (*parm == *p) + break; + if (!*p) { + // no match found + ret = NOT_ONE_OF; + goto msg_out; + } + } + // in range or doesn't matter + if (sv->flags & (HARD_DIRECT | SOFT_DIRECT) || !sv->flags) { + // replace string provided by user with formated string + if (*parm) { + // copy the format string up to the underscore + src = sv->build; + dest = formatted; + while (*src && *src != '_') + *dest++ = *src++; + // append parm + p = parm; + while (*p) + *dest++ = *p++; + // skip over the underscore + if (*src == '_') + ++src; + // append remainder of format + while (*src) + *dest++ = *src++; + // null terminate + *dest = '\0'; + } + } + // reset to default? + if (!*parm) { + // copy the format string up to the underscore + src = sv->build; + dest = formatted; + while (*src && *src != '_') + *dest++ = *src++; + // append default parameter + p = sv->param; + while (*p) + *dest++ = *p++; + // skip over the underscore + if (*src == '_') + ++src; + // append remainder of format + while (*src) + *dest++ = *src++; + // null terminate + *dest = '\0'; + ret = RESET_DEFAULT; + } + // store formatted value + if (*cfg_map & (0x01 << index)) + krealloc (*value, strlen (formatted) + 1); + else { + *cfg_map |= (0x01 << index); + *value = kmalloc (strlen (formatted) + 1, GFP_KERNEL); + } + strcpy (*value, formatted); + if (sv->flags & HARD_DIRECT) { + synth_write (formatted, strlen (formatted)); + synth_write ("\n", 1); + } + + /* set bell position */ + if (index == BELL_POS) + bell_pos = val; + + /* bleep settings need to be replicated through every console */ + if ((index == LINE_WRAP_BLEEP) || (index == ATTRIBUTE_BLEEP)) + for (i = 0; speakup_console[i] != NULL; ++i) { + if (index == LINE_WRAP_BLEEP) { + if (*parm == '1' || !*parm) + speakup_console[i]->sound |= + LineWrapBleep; + else + speakup_console[i]->sound &= + LineWrapMask; + } else { + // ATTRIBUTE_BLEEP + if (*parm == '1' || !*parm) + speakup_console[i]->sound |= + AttributeChangeBleep; + else + speakup_console[i]->sound &= + AttributeChangeMask; + } + } + if (ret == RESET_DEFAULT) + printk (KERN_ALERT "%s reset to default value\n", sv->id); + ret = count; + goto out; + +msg_out: + switch (ret) { + case NOT_IN_RANGE: + p = "value not in range"; + ret = count; + break; + case NOT_ONE_OF: + p = "value not one of"; + ret = count; + break; + case STRING_TOO_LONG: + p = "string longer than 33 chars"; + ret = count; + break; + } + printk (KERN_ALERT "setting %s (%s): %s (%s)\n", ent->name, parm, p, + sv->valid); + + out: + free_page ((unsigned long) parm); + return ret; +} + +// this is the read handler for /proc/speakup/synth +static int speakup_synth_read_proc (char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len = sprintf (page, "%s\n", synth_name); + *start = 0; + *eof = 1; + return len; +} + +// this is the write handler for /proc/speakup/synth +static int speakup_synth_write_proc (struct file *file, const char *buffer, + unsigned long count, void *data) +{ + int ret = count, i = 0; + char new_synth_name[10]; + struct spk_synth *new_synth = NULL; + + if (count < 1 || count > 9) + return -EINVAL; + if (copy_from_user (new_synth_name, buffer, count)) + return -EFAULT; + // NULL terminate + if (new_synth_name[count - 1] == '\n') + new_synth_name[count - 1] = '\0'; + else + new_synth_name[count] = '\0'; + strlwr (new_synth_name); + if (!strcmp (new_synth_name, synth->name)) { + printk (KERN_WARNING "already in use\n"); + return ret; + } + + for (i = 0; !new_synth && synths[i]; ++i) { + if (!strcmp (synths[i]->name, new_synth_name)) + new_synth = synths[i]; + } + + if (!new_synth && strcmp (new_synth_name, "none")) { + printk (KERN_WARNING + "there is no synth named \"%s\" built into this kernel\n", + new_synth_name); + return ret; + } + + /* At this point, we know that new_synth_name is valid, built into the + kernel, and not already in use. + Next, do the magic to select it as the new active synth */ + + // still working here. announce attempt and leave + printk (KERN_ALERT "attempt to change synth to %s\n", new_synth_name); + return ret; +} + +// called by proc_root_init() to initialize the /proc/speakup subtree +void __init proc_speakup_init (void) +{ + int i; + char path[40]; + mode_t mode; + struct proc_dir_entry *ent; +#define PROC_SPK_DIR "speakup" + + ent = create_proc_entry (PROC_SPK_DIR, S_IFDIR, 0); + if (!ent) { + printk (KERN_ALERT "Unable to create /proc/speakup entry.\n"); + return; + } + + ent = create_proc_entry (PROC_SPK_DIR "/version", S_IFREG | S_IRUGO, 0); + ent->read_proc = speakup_version_read_proc; + + ent = create_proc_entry (PROC_SPK_DIR "/silent", S_IFREG | S_IWUGO, 0); + ent->write_proc = speakup_silent_write_proc; + + ent = + create_proc_entry (PROC_SPK_DIR "/characters", + S_IFREG | S_IRUGO | S_IWUGO, 0); + ent->read_proc = speakup_characters_read_proc; + ent->write_proc = speakup_characters_write_proc; + + ent = + create_proc_entry (PROC_SPK_DIR "/synth", + S_IFREG | S_IRUGO | S_IWUGO, 0); + ent->read_proc = speakup_synth_read_proc; + ent->write_proc = speakup_synth_write_proc; + + if (synth != NULL) { + for (i = 0; synth->vars[i].id != NULL; i++) { + mode = S_IFREG | S_IRUGO; + if (~(synth->vars[i].flags) & NO_USER) + mode |= S_IWUGO; + sprintf (path, PROC_SPK_DIR "/%s", synth->vars[i].id); + ent = create_proc_entry (path, mode, 0); + ent->read_proc = speakup_settings_read_proc; + if (mode & S_IWUGO) + ent->write_proc = speakup_settings_write_proc; + ent->data = (void *) ent; + } + } + + for (i = 0; spk_vars[i].id != '\0'; ++i) { + if (!strcmp (spk_vars[i].id, "punc_none")) + continue; // no /proc file for this one -- it's empty + mode = S_IFREG | S_IRUGO; + if (~(spk_vars[i].flags) & NO_USER) + mode |= S_IWUGO; + sprintf (path, PROC_SPK_DIR "/%s", spk_vars[i].id); + ent = create_proc_entry (path, mode, 0); + ent->read_proc = speakup_settings_read_proc; + if (mode & S_IWUGO) + ent->write_proc = speakup_settings_write_proc; + ent->data = (void *) ent; + } + + // initialize the synth-specific subtree + if (synth != NULL) + proc_speakup_synth_init (); +} + +#endif // CONFIG_PROC_FS + +/* version 2.3.x */ +void __init +speakup_init (int currcons) +{ + unsigned char i; + + reset_default_chars (); + + speakup_console[currcons] = + (struct spk_t *) alloc_bootmem (sizeof (struct spk_t) + 1); + + for (i = 0; i < MIN_NR_CONSOLES; i++) { + spk_shut_up = 0; + spk_x = x; + spk_y = y; + spk_attr = spk_old_attr = attr; + spk_pos = pos; + spk_sound = 3; + spk_parked = 0; + spk_o_cp = spk_o_cy = spk_o_cx = 0; + } + for (; i < MAX_NR_CONSOLES; i++) + speakup_console[i] = NULL; + speakup_open (currcons); /* we'll try it here. */ + printk ("%s: initialized\n", SPEAKUP_VERSION); +} + +void speakup_allocate (int currcons) +{ + + speakup_console[currcons] = (struct spk_t *) kmalloc (sizeof (struct spk_t) + 1, GFP_KERNEL); + + spk_shut_up = 0; + spk_x = x; + spk_y = -1; + spk_old_attr = spk_attr = attr; + spk_pos = pos; + spk_sound = 3; + spk_parked = 0; + spk_o_cp = spk_o_cy = spk_o_cx = 0; +} + +void speakup_date (unsigned int currcons) +{ + spk_x = spk_cx = x; + spk_y = spk_cy = y; + spk_pos = spk_cp = pos; + spk_old_attr = spk_attr; + spk_attr = ((scr_readw ((unsigned short *) spk_pos) & 0xff00) >> 8); +} + +void speakup_check (unsigned int currcons) +{ + if (!spk_keydown) + return; + + if ((x == spk_o_cx + 1 || x == spk_o_cx - 1) && y == spk_o_cy) { + if (spk_keydown > 1 && x > spk_o_cx) + say_prev_char (currcons); + else + say_curr_char (currcons); + } else + if ((x == 0 && spk_o_cx == video_num_columns - 1 + && y == spk_o_cy + 1) + || (x == video_num_columns - 1 && spk_o_cx == 0 + && y == spk_o_cy - 1)) { + say_curr_char (currcons); + } else if (y == spk_o_cy && (y == bottom || y == top)) { + say_curr_line (currcons); + } else if ((y > spk_o_cy || y < spk_o_cy)) { + say_curr_line (currcons); + } else if (pos == spk_o_cp) { + say_curr_char (currcons); + } else + say_curr_word (currcons); + + spk_o_cp = pos; + spk_o_cx = x; + spk_o_cy = y; + spk_keydown = 0; + spk_parked &= 0xfe; + speakup_date (currcons); +} + +/* These functions are the interface to speakup from the actual kernel code. */ + +void speakup_bs (int currcons) +{ + if (!spk_parked) + speakup_date (currcons); + if ((!spk_shut_up || spk_shut_up & 0x02) && (currcons == fg_console) + && spk_keydown) { + spk_keydown = 0; + say_curr_char (currcons); + } +} + +void speakup_con_write (int currcons, const char *str, int len) +{ + if (!spk_shut_up && (currcons == fg_console)) { + if (bell_pos && spk_keydown && (x == bell_pos - 1)) + bleep(38); + spkup_write (str, len); + } +} + +void speakup_con_update (int currcons) +{ + if (speakup_console[currcons] == NULL) + return; + if (!spk_parked) + speakup_date (currcons); + if ((currcons == fg_console) && !spk_parked && spk_shut_up & 0x02) + speakup_check (currcons); +} + +void speakup_control(int currcons, struct kbd_struct * kbd, int value) +{ + /* let there be speech! */ + switch (value) { + case KVAL(K_CAPS): + if (vc_kbd_led(kbd , VC_CAPSLOCK)) + spk_control(fg_console, 10); + else + spk_control(fg_console, 11); + break; + case KVAL(K_NUM): + if (vc_kbd_led(kbd , VC_NUMLOCK)) + spk_control(fg_console, 12); + else + spk_control(fg_console, 13); + break; + case KVAL(K_HOLD): + if (vc_kbd_led(kbd , VC_SCROLLOCK)) + spk_control(fg_console, 14); + else + spk_control(fg_console, 15); + break; + default: + spk_control(currcons, value); + } +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_decext.c linux.20pre5-ac2/drivers/char/speakup/speakup_decext.c --- linux.20pre5/drivers/char/speakup/speakup_decext.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_decext.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,307 @@ +/* + * speakup_dectlk.c - Dectalk External driver for Linux kernel 2.3.x and speakup + * + * author: Kirk Reiser + + Copyright (C) 2000 Kirk Reiser. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Kirk Reiser + 261 Trott dr. London, Ontario, Canada. N6G 1B6 + */ + + +/* These routines are written to control the Dectalk External speech + synthesizer by Digital Equipment Corp. They are not ment to be + thought of as a device driver in that they do not register + themselves as a chr device and there is no file_operations + structure. They are strictly to provide an interface to the + Dectalk External from the speakup screen review package. */ + +#define KERNEL +#include +#include +#include +#include /* for verify_area */ +#include /* for -EBUSY */ +#include /* for check_region, request_region */ +#include /* for loops_per_sec */ +#include /* for put_user_byte */ +#include /* for inb_p, outb_p, inb, outb, etc... */ +#include /* for wait_queue */ +#include /* kd_mksound */ +#include /* for __init */ +#include +#include /* for rs_table, serial constants & + serial_uart_config */ +#include /* for more serial constants */ +#if (LINUX_VERSION_CODE >= 0x20300) /* v 2.3.x */ +#include /* for struct serial_state */ +#endif +#include +#include + +#define SYNTH_CLEAR 0x03 /* synth flush char */ +#define PROCSPEECH 0x0b /* start synth processing char */ +static int full_status = 0; +#define synth_full() (full_status = (inb_p(synth_port_tts) == 0x13)) +#define SPK_SERIAL_TIMEOUT 1000000 /* countdown values for serial timeouts */ +#define SPK_XMITR_TIMEOUT 1000000 /* countdown values transmitter/dsr timeouts */ +#define SPK_LO_TTY 0 /* check ttyS0 ... ttyS3 */ +#define SPK_HI_TTY 3 +#define NUM_DISABLE_TIMEOUTS 3 /* # of timeouts permitted before disable */ + +static int dectlk_alive = 0; + /* 160 ms delay and ctrl-x as flush */ + +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) + +static struct serial_state rs_table[] __initdata = { + SERIAL_PORT_DFNS +}; + +static int timeouts = 0; /* sequential number of timeouts */ + +static int wait_for_xmitr(void) +{ +int check, tmout = SPK_XMITR_TIMEOUT; + + if ((dectlk_alive) && (timeouts >= NUM_DISABLE_TIMEOUTS)) { + dectlk_alive = 0; + timeouts = 0; + return 0; + } + + /* holding register empty? */ + do { + check = inb_p(synth_port_tts + UART_LSR); + if (--tmout == 0) { + printk("Dectalk External: timed out\n"); + timeouts++; + return 0; + } + } while ((check & BOTH_EMPTY) != BOTH_EMPTY); + + tmout = SPK_XMITR_TIMEOUT; + /* CTS */ + do { + check = inb_p(synth_port_tts + UART_MSR); + if (--tmout == 0) { + timeouts++; + return 0; + } + } while ((check & UART_MSR_CTS) != UART_MSR_CTS); + + timeouts = 0; + return 1; +} + +static inline int spk_serial_out(const char ch) +{ + if (dectlk_alive && synth_port_tts) { + if (wait_for_xmitr()) { + outb_p(ch, synth_port_tts); + return 1; + } + } + return 0; +} + +static unsigned char __init spk_serial_in(void) +{ +int lsr, tmout = SPK_SERIAL_TIMEOUT; +int c; + + do { + lsr = inb_p(synth_port_tts + UART_LSR); + if (--tmout == 0) return 0xff; + } while (!(lsr & UART_LSR_DR)); + c = inb_p(synth_port_tts + UART_RX); + return (unsigned char) c; +} + +static void do_catch_up(unsigned long data) +{ +unsigned long jiff_in = jiffies; + +synth_stop_timer(); +while ((synth_sent_bytes < synth_queued_bytes) && !synth_full()) + { + if (!spk_serial_out(*(synth_buffer+synth_sent_bytes))) { + synth_delay(synth_full_time); + return; + } + synth_sent_bytes++; + if (jiffies >= jiff_in+synth_jiffy_delta && *(synth_buffer+synth_sent_bytes-1) == ' ') { + spk_serial_out(PROCSPEECH); + synth_delay(synth_delay_time); + return; + } + } + + if (full_status) { + synth_delay(synth_full_time); + return; + } +synth_sent_bytes = synth_queued_bytes = 0; +spk_serial_out(PROCSPEECH); +synth_timer_active = 0; +if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); +} + +static inline void synth_immediate_tts(const char *buf, size_t count) +{ + while (count--) spk_serial_out(*buf++); +return; +} + +static void synth_write_tts(char ch) +{ +static char last='['; + + if (!dectlk_alive) return; + if (ch < 0x00) return; /* don't want unprintable chars */ + if (ch == 0x0a) /* turn lf into to force talking. */ + ch = 0x0D; + if (ch == SYNTH_CLEAR) { /* clear all and wake sleeping */ + synth_immediate_tts("\x1bP;10z\x1b\\", 8); + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); +#if (LINUX_VERSION_CODE >= 0x20300) /* is it a 2.3.x kernel? */ + if (synth_timer.list.prev) synth_stop_timer(); +#else + if (synth_timer.prev) synth_stop_timer(); +#endif + synth_timer_active = synth_queued_bytes = synth_sent_bytes = 0; + return; + } + +synth_buffer_add(ch); +if ((last != '[') && strchr(",.@!?/-:", ch)) synth_buffer_add(PROCSPEECH); +last = ch; +if (synth_buffering) return; +if (synth_timer_active == 0) synth_delay( synth_trigger_time ); +} + +static int __init serprobe(int index) +{ + struct serial_state *ser = NULL; + unsigned char test=0; + + if (synth_port_tts) { + for (test=0; test <= SPK_HI_TTY; test++) + if ( (rs_table+test)->port == synth_port_tts) { + ser = rs_table+test; + break; + } + } else ser = rs_table + index; + + if (synth_request_region(ser->port,8)) + return -1; + + initialize_uart(ser); + /* If we read 0xff from the LSR, there is no UART here. */ + if (inb (ser->port + UART_LSR) == 0xff) { + synth_release_region(ser->port,8); + return -1; + } + mdelay(1); + + dectlk_alive = 1; + /* ignore any error results, if port was forced */ + if (synth_port_tts) + return 0; + + synth_port_tts = ser->port; + /* check for dectalk external now... */ + spk_serial_out(0x1b); + spk_serial_out('['); + spk_serial_out(';'); + spk_serial_out('5'); + spk_serial_out('n'); + spk_serial_out(0x1b); + spk_serial_out('\\'); + if ((test = spk_serial_in()) == 0x1b) + return 0; + /*printk("test = %x\n", test);*/ + + synth_release_region(ser->port,8); + timeouts = dectlk_alive = synth_port_tts = 0; /* not ignoring */ + return -1; +} + +static int __init synth_dev_probe(void) +{ +int i=0; + + printk("Probing for Dectalk External.\n"); + if (synth_port_tts) + printk("probe forced to 0x%x by kernel command line\n", synth_port_tts); + + /* check ttyS0-ttyS3 */ + for (i=SPK_LO_TTY; i <= SPK_HI_TTY; i++) { + if (serprobe(i) == 0) break; /* found it */ + } + + if (dectlk_alive) { + /* found 'em */ + printk("Dectalk External: %03x-%03x, Driver Version %s,\n", + synth_port_tts, synth_port_tts+7, synth->version); + synth_immediate_tts(synth->init, strlen(synth->init)); + return 0; + } + + printk("Dectalk External: not found\n"); + return -ENODEV; +} + +static int synth_alive(void) +{ + if (dectlk_alive) + return 1; /* already on */ + else if ((!dectlk_alive) && (synth_port_tts)) { + if (wait_for_xmitr() > 0) { /* restart */ + dectlk_alive = 1; + synth_write(synth->reinit, strlen(synth->reinit)); + return 2; /* reenabled */ + } else printk("Dectalk External: can't restart synth\n"); + } + return 0; +} + +static const char init_string[] = "[:ra 300][:dv ap 100][:punc n][:pe -380]Dectalk External found\n"; +static const char reinit_string[] = "[:ra 300][:dv ap 100][:punc n][:pe -380]Dectalk restarted\n"; + +static struct spk_variable vars[] = +{{"flush", "\x03", "_", (BUILDER|HARD_DIRECT|USE_RANGE|NO_USER), "*"}, + {"pitch", "100", "[:dv ap _]", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,99"}, + {"caps_start", "[:dv ap 222]", "_", 0, "*"}, + {"caps_stop", "[:dv ap 100]", "_", 0, "*"}, + {"rate", "300", "[:ra _]", (NUMERIC|HARD_DIRECT|USE_RANGE), "75,650"}, + {"volume", "65", "[:dv gv _]", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,80"}, + {"voice", "p", "[:n_]", HARD_DIRECT, "phfdburwkv"}, + {"punct", "n", "[:pu _]", HARD_DIRECT, "nsa"}, + END_VARS}; + +static char *config[] = +{"\x03", "[:dv ap 100]", "[:dv ap 222]", "[:dv ap 100]", "[:ra 300]", "", + "[:np]", "[:pu n]"}; + +struct spk_synth synth_decext = {"decext", "Version-0.10", "dec_external", + init_string, reinit_string, 500, 50, 5, 1000, + vars, config, 0, synth_dev_probe, do_catch_up, + synth_write_tts, synth_alive}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_dectlk.c linux.20pre5-ac2/drivers/char/speakup/speakup_dectlk.c --- linux.20pre5/drivers/char/speakup/speakup_dectlk.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_dectlk.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,337 @@ +/* + * speakup_dectlk.c - Dectalk Express driver for Linux kernel 2.3.x and speakup + * + * author: Kirk Reiser + + Copyright (C) 1998-99 Kirk Reiser. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Kirk Reiser + 261 Trott dr. London, Ontario, Canada. N6G 1B6 + */ + +/* These routines are written to control the Dectalk Express speech + synthesizer by Digital Equipment Corp. They are not ment to be + thought of as a device driver in that they do not register + themselves as a chr device and there is no file_operations + structure. They are strictly to provide an interface to the + Dectalk Express from the speakup screen review package. */ + +#define KERNEL +#include +#include +#include +#include +#include /* for verify_area */ +#include /* for -EBUSY */ +#include /* for check_region, request_region */ +#include /* for loops_per_sec */ +#include /* for put_user_byte */ +#include /* for inb_p, outb_p, inb, outb, etc... */ +#include /* for wait_queue */ +#include /* kd_mksound */ +#include /* for __init */ +#include /* for rs_table, serial constants & + serial_uart_config */ +#include /* for more serial constants */ +#if LINUX_VERSION_CODE >= 0x020200 +#include /* for struct serial_state */ +#endif +#include +#include + +#define SYNTH_CLEAR 0x03 /* synth flush char */ +#define PROCSPEECH 0x0b /* start synth processing char */ +static int full_status = 0; +#define synth_full() (full_status = (inb_p(synth_port_tts) == 0x13)) +#define SPK_SERIAL_TIMEOUT 1000000 /* countdown values for serial timeouts */ +#define SPK_XMITR_TIMEOUT 1000000 /* countdown values transmitter/dsr timeouts */ +#define SPK_LO_TTY 0 /* check ttyS0 ... ttyS3 */ +#define SPK_HI_TTY 3 +#define NUM_DISABLE_TIMEOUTS 3 /* # of timeouts permitted before disable */ + +static int dectlk_alive = 0; + /* 160 ms delay and ctrl-x as flush */ +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) + +static struct serial_state rs_table[] __initdata = { + SERIAL_PORT_DFNS +}; + +static int timeouts = 0; /* sequential number of timeouts */ + +static int +wait_for_xmitr (void) +{ + int check; + unsigned int tmout = SPK_XMITR_TIMEOUT; + + if ((dectlk_alive) && (timeouts >= NUM_DISABLE_TIMEOUTS)) { + dectlk_alive = 0; + timeouts = 0; + return 0; + } + + /* holding register empty? */ + do { + check = inb_p(synth_port_tts + UART_LSR); + if (--tmout == 0) { + printk ("Dectalk Express: timed out\n"); + timeouts++; + return 0; + } + } while ((check & BOTH_EMPTY) != BOTH_EMPTY); + + tmout = SPK_XMITR_TIMEOUT; + /* CTS */ + do { + check = inb_p (synth_port_tts + UART_MSR); + if (--tmout == 0) { + timeouts++; + return 0; + } + } while ((check & UART_MSR_CTS) != UART_MSR_CTS); + + timeouts = 0; + return 1; +} + +static inline int +spk_serial_out (const char ch) +{ + if (dectlk_alive && synth_port_tts) { + if (wait_for_xmitr ()) { + outb_p (ch, synth_port_tts); + return 1; + } + } + return 0; +} + +static unsigned char __init +spk_serial_in (void) +{ + int lsr, tmout = SPK_SERIAL_TIMEOUT; + int c; + + do { + lsr = inb_p (synth_port_tts + UART_LSR); + if (--tmout == 0) + return 0xff; + } while (!(lsr & UART_LSR_DR)); + c = inb_p (synth_port_tts + UART_RX); + return (unsigned char) c; +} + +static void +do_catch_up (unsigned long data) +{ + unsigned long jiff_in = jiffies; + + synth_stop_timer (); + while ((synth_sent_bytes < synth_queued_bytes) && !synth_full ()) { + if (!spk_serial_out (*(synth_buffer + synth_sent_bytes))) { + synth_delay (synth_full_time); + return; + } + synth_sent_bytes++; + if (jiffies >= jiff_in + synth_jiffy_delta + && *(synth_buffer + synth_sent_bytes - 1) == ' ') { + spk_serial_out (PROCSPEECH); + synth_delay (synth_delay_time); + return; + } + } + + if (full_status) { + synth_delay (synth_full_time); + return; + } + synth_sent_bytes = synth_queued_bytes = 0; + synth_trigger_time = 50; + spk_serial_out (PROCSPEECH); + synth_timer_active = 0; + if (waitqueue_active (&synth_sleeping_list)) + wake_up_interruptible (&synth_sleeping_list); +} + +static inline void +synth_immediate_tts (const char *buf, size_t count) +{ + while (count--) + spk_serial_out (*buf++); + return; +} + +static void +synth_write_tts (char ch) +{ +/* int i = SPK_SERIAL_TIMEOUT; */ + static char last = '['; + + if (!dectlk_alive) + return; + if (ch < 0x00) + return; /* don't want unprintable chars */ + if (ch == 0x0a) /* turn lf into to force talking. */ + ch = 0x0D; + if (strchr ("-'", ch)) + ch = ' '; + if (ch == SYNTH_CLEAR) { /* clear all and wake sleeping */ + spk_serial_out (ch); + /*while(spk_serial_in() != 0x01 && i-- > 0); */ + synth_trigger_time = 100; + if (waitqueue_active (&synth_sleeping_list)) + wake_up_interruptible (&synth_sleeping_list); +#if LINUX_VERSION_CODE >= 0x020300 + if (synth_timer.list.prev) + synth_stop_timer (); +#else + if (synth_timer.prev) + synth_stop_timer (); +#endif + synth_timer_active = synth_queued_bytes = synth_sent_bytes = 0; + return; + } + + synth_buffer_add (ch); + if ((last != '[') && strchr (",_.@!?/-:", ch)) + synth_buffer_add (PROCSPEECH); + last = ch; + if (synth_buffering) + return; + if (synth_timer_active == 0) + synth_delay (synth_trigger_time); + return; +} + +static int __init +serprobe (int index) +{ + struct serial_state *ser = NULL; + unsigned char test = 0; + + if (synth_port_tts) { + for (test = 0; test <= SPK_HI_TTY; test++) + if ((rs_table + test)->port == synth_port_tts) { + ser = rs_table + test; + break; + } + } else + ser = rs_table + index; + + /* don't do output yet... */ + if (synth_request_region (ser->port, 8)) + return -1; + + initialize_uart(ser); + /* If we read 0xff from the LSR, there is no UART here. */ + if (inb (ser->port + UART_LSR) == 0xff) { + synth_release_region (ser->port, 8); + return -1; + } + mdelay (1); + outb (0x0d, ser->port); + + dectlk_alive = 1; + /* ignore any error results, if port was forced */ + if (synth_port_tts) + return 0; + + synth_port_tts = ser->port; + /* check for dectalk express now... */ + if (spk_serial_out (0x03)) { + while (spk_serial_in () != 0x01) ; + return 0; + } + + synth_release_region (ser->port, 8); + timeouts = dectlk_alive = synth_port_tts = 0; /* not ignoring */ + return -1; +} + +static int __init +synth_dev_probe (void) +{ + int i = 0; + + printk ("Probing for Dectalk Express.\n"); + if (synth_port_tts) + printk ("probe forced to 0x%x by kernel command line\n", + synth_port_tts); + + /* check ttyS0-ttyS3 */ + for (i = SPK_LO_TTY; i <= SPK_HI_TTY; i++) { + if (serprobe (i) == 0) + break; /* found it */ + } + + if (dectlk_alive) { + /* found 'em */ + printk ("Dectalk Express: %03x-%03x, Driver Version %s,\n", + synth_port_tts, synth_port_tts + 7, synth->version); + synth_immediate_tts (synth->init, strlen (synth->init)); + return 0; + } + + printk ("Dectalk Express: not found\n"); + return -ENODEV; +} + +static int +synth_alive (void) +{ + if (dectlk_alive) + return 1; /* already on */ + else if ((!dectlk_alive) && (synth_port_tts)) { + if (wait_for_xmitr () > 0) { /* restart */ + dectlk_alive = 1; + synth_write (synth->reinit, strlen (synth->reinit)); + return 2; /* reenabled */ + } else + printk ("Dectalk Express: can't restart synth\n"); + } + return 0; +} + +static const char init_string[] = + "[:ra 300][:dv ap 100][:punc n][:pe -380]Dectalk Express found\n"; +static const char reinit_string[] = + "[:ra 300][:dv ap 100][:punc n][:pe -380]Dectalk restarted\n"; + +static struct spk_variable vars[] = + { {"flush", "\x03", "_", (BUILDER | HARD_DIRECT | USE_RANGE | NO_USER), + "*"}, +{"pitch", "100", "[:dv ap _]", (NUMERIC | HARD_DIRECT | USE_RANGE), "50,350"}, +{"caps_start", "[:dv ap 222]", "_", 0, "*"}, +{"caps_stop", "[:dv ap 100]", "_", 0, "*"}, +{"rate", "300", "[:ra _]", (NUMERIC | HARD_DIRECT | USE_RANGE), "75,650"}, +{"volume", "65", "[:dv gv _]", (NUMERIC | HARD_DIRECT | USE_RANGE), "0,80"}, +{"voice", "p", "[:n_]", HARD_DIRECT, "phfdburwkv"}, +{"punct", "n", "[:pu _]", HARD_DIRECT, "nsa"}, +END_VARS +}; + +static char *config[] = + { "\x03", "[:dv ap 100]", "[:dv ap 222]", "[:dv ap 100]", "[:ra 300]", + "[:dv gv 65]", "[:np]", "[:pu n]" +}; + +struct spk_synth synth_dectlk = { "dectlk", "Version-0.12", "dec_express", + init_string, reinit_string, 500, 50, 5, 1000, + vars, config, 0, synth_dev_probe, do_catch_up, + synth_write_tts, synth_alive +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_drvcommon.c linux.20pre5-ac2/drivers/char/speakup/speakup_drvcommon.c --- linux.20pre5/drivers/char/speakup/speakup_drvcommon.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_drvcommon.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,399 @@ +#define KERNEL +#include +#include +#include /* for isdigit() and friends */ +#include +#include /* for verify_area */ +#include /* for -EBUSY */ +#include /* for check_region, request_region */ +#include /* for loops_per_sec */ +#include /* for put_user_byte */ +#include /* for inb_p, outb_p, inb, outb, etc... */ +#include /* for wait_queue */ +#include /* kd_mksound */ +#include /* for __init */ +#include +#include /* for rs_table, serial constants & + serial_uart_config */ +#include /* for more serial constants */ +#include /* for struct serial_state */ +#include +#include + +#define synthBufferSize 8192 /* currently 8K bytes */ +struct spk_synth *synth = NULL; +unsigned char synth_jiffy_delta = HZ/20; +int synth_port_tts = 0; +volatile int synth_timer_active = 0; /* indicates when a timer is set */ +DECLARE_WAIT_QUEUE_HEAD (synth_sleeping_list); +struct timer_list synth_timer; +unsigned short synth_delay_time = 500; /* time to schedule handler */ +unsigned short synth_trigger_time = 50; +unsigned short synth_full_time = 1000; /* time before coming back when synth is full */ +char synth_buffering = 1; /* flag to indicate we're buffering */ +unsigned char synth_buffer[synthBufferSize]; /* guess what this is for! */ +unsigned short synth_end_of_buffer = synthBufferSize; +volatile unsigned short synth_queued_bytes = 0, synth_sent_bytes = 0; +/* synth_queued_bytes points to top of chars queued, + * synth_sent_bytes points at top of bytes sent by synth->catch_up() */ + +void +initialize_uart(struct serial_state *ser) +{ + int baud = 9600; + int quot = 0; + unsigned cval = 0; + int cflag = CREAD | HUPCL | CLOCAL | B9600 | CS8; + + /* + * Divisor, bytesize and parity + */ + quot = ser->baud_base / baud; + cval = cflag & (CSIZE | CSTOPB); +#if defined(__powerpc__) || defined(__alpha__) + cval >>= 8; +#else /* !__powerpc__ && !__alpha__ */ + cval >>= 4; +#endif /* !__powerpc__ && !__alpha__ */ + if (cflag & PARENB) + cval |= UART_LCR_PARITY; + if (!(cflag & PARODD)) + cval |= UART_LCR_EPAR; + + /* + * Disable UART interrupts, set DTR and RTS high + * and set speed. + */ + outb(cval | UART_LCR_DLAB, ser->port + UART_LCR); /* set DLAB */ + outb(quot & 0xff, ser->port + UART_DLL); /* LS of divisor */ + outb(quot >> 8, ser->port + UART_DLM); /* MS of divisor */ + outb(cval, ser->port + UART_LCR); /* reset DLAB */ + outb(0, ser->port + UART_IER); + outb(UART_MCR_DTR | UART_MCR_RTS, ser->port + UART_MCR); +} + +/* sleep for ms milliseconds */ +void +synth_delay (int ms) +{ + synth_timer.expires = jiffies + (ms * HZ + 1000 - HZ) / 1000; +# if (LINUX_VERSION_CODE >= 0x20300) /* is it a 2.3.x kernel? */ + if (!synth_timer.list.prev) + add_timer (&synth_timer); +# else + if (!synth_timer.prev) + add_timer (&synth_timer); +# endif + synth_timer_active++; +} + +void +synth_stop_timer (void) +{ + if (synth_timer_active) + del_timer (&synth_timer); +} + +void +synth_buffer_add (char ch) +{ + /* someone needs to take a nap for a while. */ + if (synth_queued_bytes + 1 == synth_end_of_buffer - 100 + && (!waitqueue_active (&synth_sleeping_list))) { + interruptible_sleep_on (&synth_sleeping_list); + } + *(synth_buffer + synth_queued_bytes++) = ch; +} + +void +synth_write (const char *buf, size_t count) +{ + while (count--) + synth->write (*buf++); +} + +#if LINUX_VERSION_CODE >= 0x20300 +static struct resource synth_res; +#endif + +int __init +synth_request_region (unsigned long start, unsigned long n) +{ +#if (LINUX_VERSION_CODE >= 0x20300) /* is it a 2.3.x kernel? */ + struct resource *parent = &ioport_resource; + + memset (&synth_res, 0, sizeof (synth_res)); + synth_res.name = synth->name; + synth_res.start = start; + synth_res.end = start + n - 1; + synth_res.flags = IORESOURCE_BUSY; + + return request_resource (parent, &synth_res); +#else + if (check_region (start, n)) + return -EBUSY; + request_region (start, n, synth->name); + return 0; +#endif +} + +int __init +synth_release_region (unsigned long start, unsigned long n) +{ +#if (LINUX_VERSION_CODE >= 0x20300) + return release_resource (&synth_res); +#else + release_region (start, n); + return 0; +#endif +} + +#ifdef CONFIG_PROC_FS + +// /proc/synth-specific code + +#include +#include + +static struct proc_dir_entry *proc_speakup_synth; + +// this is the read handler for /proc/speakup/synth-specific vars +static int +speakup_vars_read_proc (char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct proc_dir_entry *ent = data; + + *start = 0; + *eof = 1; + + if (!strcmp (ent->name, "jiffy_delta")) + return sprintf (page, "%d\n", synth_jiffy_delta); + if (!strcmp (ent->name, "delay_time")) + return sprintf (page, "%d\n", synth_delay_time); + if (!strcmp (ent->name, "queued_bytes")) + return sprintf (page, "%d\n", synth_queued_bytes); + if (!strcmp (ent->name, "sent_bytes")) + return sprintf (page, "%d\n", synth_sent_bytes); + if (!strcmp (ent->name, "trigger_time")) + return sprintf (page, "%d\n", synth_trigger_time); + if (!strcmp (ent->name, "full_time")) + return sprintf (page, "%d\n", synth_full_time); + if (!strcmp (ent->name, "version")) + return sprintf (page, "%s\n", synth->version); + + return sprintf (page, "%s slipped through the cracks!\n", ent->name); +} + +#define RESET_DEFAULT -4 + +// this is the write handler for /proc/speakup/synth-specific vars +static int +speakup_vars_write_proc (struct file *file, const char *buffer, + unsigned long count, void *data) +{ + struct proc_dir_entry *ent = data; + int i, len = count, val = 0, ret = -ERANGE; + long min = 0, max = 0; + char *page; + + if (!(page = (char *) __get_free_page (GFP_KERNEL))) + return -ENOMEM; + if (copy_from_user (page, buffer, count)) { + ret = -EFAULT; + goto out; + } + // lose the newline + if (page[len - 1] == '\n') + --len; + + // trigger_time is an unsigned short 0 <= val <= 65535 + if (!strcmp (ent->name, "trigger_time")) { + if (!len) { + synth_trigger_time = synth->trigger_time; + ret = RESET_DEFAULT; + goto out; + } + max = 65535; + // 1 to 5 digits + if (len < 1 || len > 5) + goto out; + for (i = 0; i < len; ++i) { + if (!isdigit (page[i])) + goto out; + val *= 10; + val += page[i] - '0'; + } + if (val < min || val > max) + goto out; + synth_trigger_time = val; + ret = count; + } + // full_time is an unsigned short 0 <= val <= 65535 + else if (!strcmp (ent->name, "full_time")) { + if (!len) { + synth_full_time = synth->full_time; + ret = RESET_DEFAULT; + goto out; + } + max = 65535; + // 1 to 5 digits + if (len < 1 || len > 5) + goto out; + for (i = 0; i < len; ++i) { + if (!isdigit (page[i])) + goto out; + val *= 10; + val += page[i] - '0'; + } + if (val < min || val > max) + goto out; + synth_full_time = val; + ret = count; + } + // jiffy_delta is an unsigned char 0 <= val <= 255 + else if (!strcmp (ent->name, "jiffy_delta")) { + if (!len) { + synth_jiffy_delta = synth->jiffy_delta; + ret = RESET_DEFAULT; + goto out; + } + max = 255; + // 1 to 3 digits + if (len < 1 || len > 3) + goto out; + for (i = 0; i < len; ++i) { + if (!isdigit (page[i])) + goto out; + val *= 10; + val += page[i] - '0'; + } + if (val < min || val > max) + goto out; + synth_jiffy_delta = val; + ret = count; + } + // delay_time is an unsigned short 0 <= val <= 65535 + else if (!strcmp (ent->name, "delay_time")) { + if (!len) { + synth_delay_time = synth->delay_time; + ret = RESET_DEFAULT; + goto out; + } + max = 65535; + // 1 to 5 digits + if (len < 1 || len > 5) + goto out; + for (i = 0; i < len; ++i) { + if (!isdigit (page[i])) + goto out; + val *= 10; + val += page[i] - '0'; + } + if (val < min || val > max) + goto out; + synth_delay_time = val; + ret = count; + } + + out: + if (ret == -ERANGE) { + printk (KERN_ALERT + "setting %s (%.*s): value out of range (%ld-%ld)\n", + ent->name, len, page, min, max); + ret = count; + } else if (ret == RESET_DEFAULT) { + printk (KERN_ALERT "%s reset to default value\n", ent->name); + ret = count; + } + free_page ((unsigned long) page); + return ret; +} + +#define MIN(a,b) ( ((a) < (b))?(a):(b) ) + +// this is the write handler for /proc/speakup/synth-specific/direct +static int +speakup_direct_write_proc (struct file *file, const char *buffer, + unsigned long count, void *data) +{ + static const int max_buf_len = 100; + unsigned char buf[max_buf_len + 1]; + int ret = count; + extern char *xlate (char *); + + if (copy_from_user (buf, buffer, count = (MIN (count, max_buf_len)))) + return -EFAULT; + buf[count] = '\0'; + xlate (buf); + synth_write (buf, strlen (buf)); + return ret; +} + +char *read_only[] = { + "queued_bytes", "sent_bytes", "version", NULL +}; + +char *root_writable[] = { + "delay_time", "full_time", "jiffy_delta", "trigger_time", NULL +}; + +// called by proc_speakup_init() to initialize the /proc/speakup/synth-specific subtree +void +proc_speakup_synth_init (void) +{ + struct proc_dir_entry *ent; + char *dir = "speakup/"; + char path[80]; + int i; + + sprintf (path, "%s%s", dir, synth->proc_name); + proc_speakup_synth = create_proc_entry (path, S_IFDIR, 0); + if (!proc_speakup_synth) { + printk (KERN_WARNING "Unable to create /proc/%s entry.\n", + path); + return; + } + + for (i = 0; read_only[i]; ++i) { + sprintf (path, "%s%s/%s", dir, synth->proc_name, read_only[i]); + ent = create_proc_entry (path, S_IFREG | S_IRUGO, 0); + ent->read_proc = speakup_vars_read_proc; + ent->data = (void *) ent; + } + + for (i = 0; root_writable[i]; ++i) { + sprintf (path, "%s%s/%s", dir, synth->proc_name, root_writable[i]); + ent = create_proc_entry (path, S_IFREG | S_IRUGO | S_IWUSR, 0); + ent->read_proc = speakup_vars_read_proc; + ent->write_proc = speakup_vars_write_proc; + ent->data = (void *) ent; + } + + sprintf (path, "%s%s/direct", dir, synth->proc_name); + ent = create_proc_entry (path, S_IFREG | S_IWUGO, 0); + ent->write_proc = speakup_direct_write_proc; +} + +#endif + +int __init +synth_init (void) +{ + if (synth->probe () < 0) { + printk ("%s: device probe failed\n", synth->name); + return -ENODEV; + } + init_timer (&synth_timer); + synth_timer.function = synth->catch_up; +#if (LINUX_VERSION_CODE >= 0x20300) /* it's a 2.3.x kernel */ + init_waitqueue_head (&synth_sleeping_list); +#else /* it's a 2.2.x kernel */ + init_waitqueue (&synth_sleeping_list); +#endif + synth_delay_time = synth->delay_time; + synth_trigger_time = synth->trigger_time; + synth_jiffy_delta = synth->jiffy_delta; + synth_full_time = synth->full_time; + return 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_dtlk.c linux.20pre5-ac2/drivers/char/speakup/speakup_dtlk.c --- linux.20pre5/drivers/char/speakup/speakup_dtlk.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_dtlk.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,259 @@ +/* + * speakup_dtlk.c - DoubleTalk PC driver for Linux kernel 2.3.x and speakup + * + * author: Kirk Reiser + + Copyright (C) 1998-99 Kirk Reiser. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Kirk Reiser + 261 Trott dr. London, Ontario, Canada. N6G 1B6 + */ + + +/* These routines are written to control the Double Talk PC speech + synthesizer. They are not ment to be thought of as a device driver + in that they do not register themselves as a chr device and there + is no file_operations structure. They are strictly to provide an + interface to the DoubleTalk from the speakup screen review package. +*/ + +#define KERNEL +#include +#include +#include +#include /* for verify_area */ +#include /* for -EBUSY */ +#include /* for check_region, request_region */ +#include /* for loops_per_sec */ +#include /* for put_user_byte */ +#include /* for inb_p, outb_p, inb, outb, etc... */ +#include /* for wait_queue */ +#include /* kd_mksound */ +#include /* for __init */ +#include /* need to know if 2.2.x or 2.3.x */ + +#include +#include "speakup_dtlk.h" /* local header file for DoubleTalk values */ + +#define synth_readable() ((synth_status = inb_p(synth_port_tts)) & TTS_READABLE) +#define synth_full() ((synth_status = inb_p(synth_port_tts)) & TTS_ALMOST_FULL) +static int synth_port_lpc; +static unsigned int synth_portlist[] = + { 0x25e, 0x29e, 0x2de, 0x31e, 0x35e, 0x39e, 0 }; +/* 200ms delay */ +static unsigned char synth_status = 0; /* speed up some checks which are done regularly */ + +static inline void spk_out(const char ch) +{ +int tmout = 100000; + + while (((synth_status = inb_p(synth_port_tts)) & TTS_WRITABLE) == 0); +outb_p(ch, synth_port_tts); + while ((((synth_status = inb_p(synth_port_tts)) & TTS_WRITABLE) != 0) + && (--tmout != 0) ); +} + +static void do_catch_up(unsigned long data) +{ +unsigned long jiff_in = jiffies; + +synth_stop_timer(); +synth_status = inb_p(synth_port_tts); +while ((synth_sent_bytes < synth_queued_bytes) && !(synth_status & TTS_ALMOST_FULL)) + { + spk_out(*(synth_buffer+synth_sent_bytes++)); + if (jiffies >= jiff_in+synth_jiffy_delta && *(synth_buffer+synth_sent_bytes-1) == ' ') { + spk_out(0x00); + synth_delay(synth_delay_time); + return; + } + } +if (synth_status & TTS_ALMOST_FULL) + { + synth_delay(synth_full_time); + return; + } +spk_out(0x00); +synth_sent_bytes = synth_queued_bytes = 0; +synth_timer_active = 0; +if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); +} + +static void synth_write_tts(char ch) +{ + + if (ch < 0x00) return; /* don't want unprintable chars */ + if (ch == 0x0a) /* turn lf into NULL to force talking. */ + ch = 0x00; + if (ch == SYNTH_CLEAR) { /* clear all and wake sleeping */ + outb_p(ch, synth_port_tts); /* output to TTS port */ + while (((synth_status = inb_p(synth_port_tts)) & TTS_WRITABLE) != 0); + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); + synth_queued_bytes = synth_sent_bytes = 0; + return; + } + + synth_buffer_add(ch); + if (synth_buffering) return; + if (synth_timer_active == 0) synth_delay( synth_trigger_time ); +} + +static inline void synth_immediate_tts(const char *buf, short count) +{ +char ch; + + while (count--) { + ch = *buf++; + if (ch != SYNTH_CLEAR) + spk_out(ch); /* output to TTS port */ + } +} + +static char __init synth_read_tts(void) +{ +unsigned char ch; + + while (((synth_status = inb_p(synth_port_tts)) & TTS_READABLE) == 0); + ch = synth_status & 0x7f; + outb_p(ch, synth_port_tts); + while ((inb_p(synth_port_tts) & TTS_READABLE) != 0); +return (char) ch; +} + +/* interrogate the DoubleTalk PC and return its settings */ +static struct synth_settings * __init synth_interrogate(void) +{ +unsigned char *t; +static char buf[sizeof(struct synth_settings) + 1]; +int total, i; +static struct synth_settings status; + + synth_immediate_tts("\x18\x01?", 3); + + for (total = 0, i = 0; i < 50; i++) + { + buf[total] = synth_read_tts(); + if (total > 2 && buf[total] == 0x7f) break; + if (total < sizeof(struct synth_settings)) total++; + } + + t = buf; + status.serial_number = t[0] + t[1]*256; /* serial number is little endian */ + t += 2; + + i = 0; + while (*t != '\r') + { + status.rom_version[i] = *t; + if (i < sizeof(status.rom_version)-1) i++; + t++; + } + status.rom_version[i] = 0; + t++; + + status.mode = *t++; + status.punc_level = *t++; + status.formant_freq = *t++; + status.pitch = *t++; + status.speed = *t++; + status.volume = *t++; + status.tone = *t++; + status.expression = *t++; + status.ext_dict_loaded = *t++; + status.ext_dict_status = *t++; + status.free_ram = *t++; + status.articulation = *t++; + status.reverb = *t++; + status.eob = *t++; + return &status; +} + +static int __init synth_dev_probe(void) +{ +unsigned int port_val = 0; +int i = 0; +struct synth_settings *sp; + + printk("Probing for DoubleTalk.\n"); + if (synth_port_tts) { + printk("probe forced to %x by kernel command line\n", synth_port_tts); + if (synth_request_region(synth_port_tts-1, SYNTH_IO_EXTENT)) { + printk("sorry, port already reserved\n"); + return -EBUSY; + } + port_val = inw(synth_port_tts-1); + synth_port_lpc = synth_port_tts-1; + } + else { + for(i=0; synth_portlist[i]; i++) { + if (synth_request_region(synth_portlist[i], SYNTH_IO_EXTENT)) + continue; + port_val = inw(synth_portlist[i]); + if ((port_val &= 0xfbff) == 0x107f) { + synth_port_lpc = synth_portlist[i]; + synth_port_tts = synth_port_lpc+1; + break; + } + synth_release_region(synth_portlist[i], SYNTH_IO_EXTENT); + } + } + + if ((port_val &= 0xfbff) != 0x107f) { + printk("DoubleTalk PC: not found\n"); + return -ENODEV; + } + + while (inw_p(synth_port_lpc) != 0x147f ); /* wait until it's ready */ + sp = synth_interrogate(); + printk("DoubleTalk PC: %03x-%03x, ROM version %s,\n" + "DoubleTalk PC: serial number %u, driver: %s\n", + synth_port_lpc, synth_port_lpc+SYNTH_IO_EXTENT - 1, + sp->rom_version, sp->serial_number, synth->version); + synth_immediate_tts(synth->init, strlen(synth->init)); + return 0; +} + +static int synth_alive(void) { + return 1; /* I'm *INVINCIBLE* */ +} + +static const char init_string[] = "\x01@doubletalk found\n\x01\x31y\n"; +static const char reinit_string[] = "\x01@doubletalk found\n\x01\x31y\n"; + +static struct spk_variable vars[] = +{{"flush", "\x18", "_", (BUILDER|HARD_DIRECT|USE_RANGE|NO_USER), "*"}, + {"pitch", "50", "\x01_p", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,99"}, + {"caps_start", "\x01+35p", "_", 0, "*"}, + {"caps_stop", "\x01-35p", "_", 0, "*"}, + {"rate", "5", "\x01_s", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,9"}, + {"tone", "1", "\x01_x", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,2"}, + {"volume", "5", "\x01_v", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,9"}, + {"voice", "0", "\x01_o", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,7"}, + {"ffreq", "5", "\x01_f", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,9"}, + {"punct", "7", "\x01_b", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,15"}, + END_VARS}; + +static char *config[] = +{"\x18", "\x01\x35\x30p", "\x01\x38\x35p", "\x01\x35\x30p", "\x01\x35s", + "\x01\x31x", "\x01\x35v", "\x01\x30o", "\x01\x35\x66", "\x01\x37\x62"}; + +struct spk_synth synth_dtlk = {"dtlk", "Version-0.13", "doubletalk_pc", + init_string, reinit_string, 500, 50, 5, 1000, + vars, config, 0, synth_dev_probe, do_catch_up, + synth_write_tts, synth_alive}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_dtlk.h linux.20pre5-ac2/drivers/char/speakup/speakup_dtlk.h --- linux.20pre5/drivers/char/speakup/speakup_dtlk.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_dtlk.h 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,57 @@ +/* speakup_dtlk.h - header file for speakups DoubleTalk driver. */ + +#define SYNTH_IO_EXTENT 0x02 + +#define SYNTH_CLEAR 0x18 /* stops speech */ + + /* TTS Port Status Flags */ +#define TTS_READABLE 0x80 /* mask for bit which is nonzero if a + byte can be read from the TTS port */ +#define TTS_SPEAKING 0x40 /* mask for SYNC bit, which is nonzero + while DoubleTalk is producing + output with TTS, PCM or CVSD + synthesizers or tone generators + (that is, all but LPC) */ +#define TTS_SPEAKING2 0x20 /* mask for SYNC2 bit, + which falls to zero up to 0.4 sec + before speech stops */ +#define TTS_WRITABLE 0x10 /* mask for RDY bit, which when set to + 1, indicates the TTS port is ready + to accept a byte of data. The RDY + bit goes zero 2-3 usec after + writing, and goes 1 again 180-190 + usec later. */ +#define TTS_ALMOST_FULL 0x08 /* mask for AF bit: When set to 1, + indicates that less than 300 bytes + are available in the TTS input + buffer. AF is always 0 in the PCM, + TGN and CVSD modes. */ +#define TTS_ALMOST_EMPTY 0x04 /* mask for AE bit: When set to 1, + indicates that less than 300 bytes + are remaining in DoubleTalk's input + (TTS or PCM) buffer. AE is always 1 + in the TGN and CVSD modes. */ + + /* data returned by Interrogate command */ +struct synth_settings +{ + unsigned short serial_number; /* 0-7Fh:0-7Fh */ + unsigned char rom_version[24]; /* null terminated string */ + unsigned char mode; /* 0=Character; 1=Phoneme; 2=Text */ + unsigned char punc_level; /* nB; 0-7 */ + unsigned char formant_freq; /* nF; 0-9 */ + unsigned char pitch; /* nP; 0-99 */ + unsigned char speed; /* nS; 0-9 */ + unsigned char volume; /* nV; 0-9 */ + unsigned char tone; /* nX; 0-2 */ + unsigned char expression; /* nE; 0-9 */ + unsigned char ext_dict_loaded; /* 1=exception dictionary loaded */ + unsigned char ext_dict_status; /* 1=exception dictionary enabled */ + unsigned char free_ram; /* # pages (truncated) remaining for + text buffer */ + unsigned char articulation; /* nA; 0-9 */ + unsigned char reverb; /* nR; 0-9 */ + unsigned char eob; /* 7Fh value indicating end of + parameter block */ + unsigned char has_indexing; /* nonzero if indexing is implemented */ +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_ltlk.c linux.20pre5-ac2/drivers/char/speakup/speakup_ltlk.c --- linux.20pre5/drivers/char/speakup/speakup_ltlk.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_ltlk.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,342 @@ +/* + * speakup_ltlk.c - LiteTalk driver for Linux kernel 2.3.x and speakup + * + * author: Kirk Reiser and Andy Berdan + + Copyright (C) 1998-99 Kirk Reiser, and Andy Berdan + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Kirk Reiser + 261 Trott dr. London, Ontario, Canada. N6G 1B6 + + Andy Berdan + 3-337 Wharncliffe Rd. N London, Ontario, Canada N6G 1E4 + */ + + +/* These routines are written to control the Lite Talk speech + synthesizer. They are not ment to be thought of as a device driver + in that they do not register themselves as a chr device and there + is no file_operations structure. They are strictly to provide an + interface to the LiteTalk from the speakup screen review package. +*/ + +#define KERNEL +#include +#include +#include +#include /* for verify_area */ +#include /* for -EBUSY */ +#include /* for check_region, request_region */ +#include /* for loops_per_sec */ +#include /* for put_user_byte */ +#include /* for inb_p, outb_p, inb, outb, etc... */ +#include /* for wait_queue */ +#include /* kd_mksound */ +#include /* for __init */ +#include +#include /* for rs_table, serial constants & + serial_uart_config */ +#include /* for more serial constants */ +#if (LINUX_VERSION_CODE >= 0x20300) /* v 2.3.x */ +#include /* for struct serial_state */ +#endif +#include +#include + +#include "speakup_dtlk.h" /* local header file for LiteTalk values */ + +#define synth_full() ( !(inb(synth_port_tts + UART_MSR) & UART_MSR_CTS) ) +#define PROCSPEECH 0x00 /* synth process speech char */ +#define SPK_SERIAL_TIMEOUT 1000000 /* countdown values for serial timeouts */ +#define SPK_XMITR_TIMEOUT 3000000 /* countdown values transmitter/dsr timeouts */ +#define SPK_LO_TTY 0 /* check ttyS0 ... ttyS3 */ +#define SPK_HI_TTY 3 +#define NUM_DISABLE_TIMEOUTS 3 /* # of timeouts permitted before disable */ + +static int ltlk_alive = 0; + +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) + +static struct serial_state rs_table[] __initdata = { + SERIAL_PORT_DFNS +}; + +static inline int wait_for_xmitr(void) +{ + static int timeouts = 0; /* sequential number of timeouts */ + int check, tmout = SPK_XMITR_TIMEOUT; + + if ((ltlk_alive) && (timeouts >= NUM_DISABLE_TIMEOUTS)) { + ltlk_alive = 0; + timeouts = 0; + return 0; + } + + /* holding register empty? */ + + do { + check = inb(synth_port_tts + UART_LSR); + if (--tmout == 0) { + printk("LiteTalk: register timed out\n"); + timeouts++; + return 0; + } + } while ((check & BOTH_EMPTY) != BOTH_EMPTY); + tmout = SPK_XMITR_TIMEOUT; + + /* CTS */ + do { + check = inb(synth_port_tts + UART_MSR); + if (--tmout == 0) { + timeouts++; + return 0; + } + } while ((check & UART_MSR_CTS) != UART_MSR_CTS); + + timeouts = 0; + return 1; +} + +static inline int spk_serial_out(const char ch) +{ + if (ltlk_alive && synth_port_tts) { + if (wait_for_xmitr()) { + outb(ch, synth_port_tts); + return 1; + } + } + return 0; +} + +static unsigned char __init spk_serial_in(void) +{ + int c, lsr, tmout = SPK_SERIAL_TIMEOUT; + + do { + lsr = inb(synth_port_tts + UART_LSR); + if (--tmout == 0) { + printk("time out while waiting for input.\n"); + return 0xff; + } + } while ((lsr & UART_LSR_DR) != UART_LSR_DR); + c = inb(synth_port_tts + UART_RX); + return (unsigned char) c; +} + +static void do_catch_up(unsigned long data) +{ + unsigned long jiff_in = jiffies; + + synth_stop_timer(); + while (synth_sent_bytes < synth_queued_bytes) + { + if (!spk_serial_out(*(synth_buffer+synth_sent_bytes))) { + synth_delay(synth_full_time); + return; + } + synth_sent_bytes++; + if (jiffies >= jiff_in+synth_jiffy_delta + && *(synth_buffer+synth_sent_bytes-1) == ' ') { + spk_serial_out(PROCSPEECH); + synth_delay(synth_delay_time); + return; + } + } + + synth_sent_bytes = synth_queued_bytes = 0; + spk_serial_out(PROCSPEECH); + synth_timer_active = 0; + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); +} + +static void synth_write_tts(char ch) +{ + if (!ltlk_alive) return; + if (ch < 0x00) return; /* don't want unprintable chars */ + if (ch == 0x0a) /* turn lf into to force talking. */ + ch = PROCSPEECH; + + /* clear all and wake sleeping */ + if (ch == SYNTH_CLEAR) { + spk_serial_out(ch); + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); + synth_timer_active = synth_queued_bytes = synth_sent_bytes = 0; + return; + } + + synth_buffer_add(ch); + if (synth_buffering) return; + if (synth_timer_active == 0) synth_delay( synth_trigger_time ); +} + +static inline void synth_immediate_tts(const char *buf, short count) +{ + while (count--) spk_serial_out(*buf++); + return; +} + +/* interrogate the LiteTalk and print its settings */ +static void __init synth_interrogate(void) +{ + unsigned char *t, i; + unsigned char buf[50], rom_v[20]; + + synth_immediate_tts("\x18\x01?", 3); + + for (i = 0; i < 50; i++) + { + buf[i] = spk_serial_in(); + if (i > 2 && buf[i] == 0x7f) break; + } + + t = buf+2; + i = 0; + while (*t != '\r') + { + rom_v[i] = *t; + t++; i++; + } + rom_v[i] = 0; + + printk("LiteTalk: ROM version: %s\n", rom_v); + return; +} + +static int __init serprobe(int index) +{ + struct serial_state *ser = NULL; + unsigned char test=0; + + if (synth_port_tts) { + for (test=0; test <= SPK_HI_TTY; test++) + if ( (rs_table+test)->port == synth_port_tts) { + ser = rs_table+test; + break; + } + } else ser = rs_table + index; + + /* don't do output yet... */ + if (synth_request_region(ser->port,8)) + return -1; + + initialize_uart(ser); + /* If we read 0xff from the LSR, there is no UART here. */ + if (inb (ser->port + UART_LSR) == 0xff) { + // printk("initial test = %x\n", test); + synth_release_region(ser->port,8); + return -1; + } + outb(0, ser->port); + mdelay(1); + outb('\r', ser->port); + + ltlk_alive = 1; + /* ignore any error results, if port was forced */ + if (synth_port_tts) { + return 0; + } + + synth_port_tts = ser->port; + + /* check for device... */ + if (spk_serial_out(SYNTH_CLEAR)) return 0; + /*spk_serial_out('@'); + mdelay(100); + + spk_serial_out(0); + + if ((spk_serial_in() == ('C'+ 0x80)) + && ((test = spk_serial_in()) > ('A' + 0x80)) + && (test < ('Z' + 0x80)) + && (spk_serial_in() == 0x8d) ) + return 0; */ + + synth_release_region(ser->port,8); + ltlk_alive = synth_port_tts = 0; /* try next port */ + return -1; +} + +static int __init synth_dev_probe(void) +{ + int i; + + printk("Probing for LiteTalk.\n"); + if (synth_port_tts) + printk("Probe forced to 0x%x by kernel command line\n", synth_port_tts); + + for (i=SPK_LO_TTY; i <= SPK_HI_TTY; i++) { + if (serprobe(i) == 0) break; /* found it */ + } + + if (ltlk_alive) { + /* found 'em */ + synth_interrogate(); + printk("LiteTalk: at %03x-%03x, driver %s\n", + synth_port_tts, synth_port_tts + 7, synth->version); + synth_write(synth->init, strlen(synth->init)); + return 0; + } + + printk("LiteTalk: not found\n"); + return -ENODEV; +} + +static int synth_alive(void) { + + if (ltlk_alive) { + return 1; /* already on */ + } else { + if ((!ltlk_alive) && (synth_port_tts)) { + if (wait_for_xmitr() > 0) { /* restart */ + ltlk_alive = 1; + synth_write(synth->reinit, strlen(synth->reinit)); + return 2; /* reenabled */ + } else printk("LiteTalk: can't restart synth\n"); + } + } + return 0; +} + +static const char init_string[] = "\01@light talk found\n\x01\x31y\n\0"; +static const char reinit_string[] = "\01@light talk restarted\n\x01\x31y\n\0"; +/* 200ms delay */ + +static struct spk_variable vars[] = +{ + { "flush", "\x18\x20", "_", (BUILDER|HARD_DIRECT|USE_RANGE|NO_USER), "*" }, + { "pitch", "50", "\x01_p", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,99" }, + { "caps_start", "\x01+35p", "_", 0, "*" }, + { "caps_stop", "\x01-35p", "_", 0, "*" }, + { "rate", "5", "\x01_s", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,9" }, + { "tone", "1", "\x01_x", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,2" }, + { "volume", "5", "\x01_v", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,9" }, + { "voice", "0", "\x01_o", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,7" }, + { "ffreq", "5", "\x01_f", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,9" }, + { "punct", "7", "\x01_b", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,15" }, + END_VARS +}; + +static char *config[] = +{ "\x18\x20", "\x01\x35\x30p", "\x01\x38\x35p", "\x01\x35\x30p", "\x01\x35s", + "\x01\x31x", "\x01\x35v", "\x01\x30o", "\x01\x35\x66", "\x01\x37\x62" }; + +struct spk_synth synth_ltlk = { "ltlk", "Version-0.13", "litetalk", + init_string, reinit_string, 500, 50, 5, 5000, + vars, config, 0, synth_dev_probe, do_catch_up, + synth_write_tts, synth_alive }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakupmap.c linux.20pre5-ac2/drivers/char/speakup/speakupmap.c --- linux.20pre5/drivers/char/speakup/speakupmap.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakupmap.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,298 @@ + +/* Do not edit this file! It was automatically generated by */ +/* loadkeys --mktable defkeymap.map > defkeymap.c */ + +#include +#include +#include + +u_short plain_map[NR_KEYS] = { + 0xf200, 0xf01b, 0xf031, 0xf032, 0xf033, 0xf034, 0xf035, 0xf036, + 0xf037, 0xf038, 0xf039, 0xf030, 0xf02d, 0xf03d, 0xf07f, 0xf009, + 0xfb71, 0xfb77, 0xfb65, 0xfb72, 0xfb74, 0xfb79, 0xfb75, 0xfb69, + 0xfb6f, 0xfb70, 0xf05b, 0xf05d, 0xf201, 0xf702, 0xfb61, 0xfb73, + 0xfb64, 0xfb66, 0xfb67, 0xfb68, 0xfb6a, 0xfb6b, 0xfb6c, 0xf03b, + 0xf027, 0xf060, 0xf700, 0xf05c, 0xfb7a, 0xfb78, 0xfb63, 0xfb76, + 0xfb62, 0xfb6e, 0xfb6d, 0xf02c, 0xf02e, 0xf02f, 0xf700, 0xfd26, + 0xf703, 0xf020, 0xf207, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, + 0xf105, 0xf106, 0xf107, 0xf108, 0xf109, 0xf208, 0xf209, 0xfd0b, + 0xfd0a, 0xfd0c, 0xfd1e, 0xfd08, 0xfd07, 0xfd09, 0xfd14, 0xfd05, + 0xfd04, 0xfd06, 0xf701, 0xfd1b, 0xf206, 0xf200, 0xf03c, 0xf10a, + 0xf10b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xfd03, 0xf702, 0xfd27, 0xfd25, 0xf703, 0xf205, 0xf114, 0xf603, + 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, +}; + +u_short shift_map[NR_KEYS] = { + 0xf200, 0xf01b, 0xf021, 0xf040, 0xf023, 0xf024, 0xf025, 0xf05e, + 0xf026, 0xf02a, 0xf028, 0xf029, 0xf05f, 0xf02b, 0xf07f, 0xf009, + 0xfb51, 0xfb57, 0xfb45, 0xfb52, 0xfb54, 0xfb59, 0xfb55, 0xfb49, + 0xfb4f, 0xfb50, 0xf07b, 0xf07d, 0xf201, 0xf702, 0xfb41, 0xfb53, + 0xfb44, 0xfb46, 0xfb47, 0xfb48, 0xfb4a, 0xfb4b, 0xfb4c, 0xf03a, + 0xf022, 0xf07e, 0xf700, 0xf07c, 0xfb5a, 0xfb58, 0xfb43, 0xfb56, + 0xfb42, 0xfb4e, 0xfb4d, 0xf03c, 0xf03e, 0xf03f, 0xf700, 0xfd26, + 0xf703, 0xf020, 0xf207, 0xf10a, 0xf10b, 0xf10c, 0xf10d, 0xf10e, + 0xf10f, 0xf110, 0xf111, 0xf112, 0xf113, 0xf208, 0xf203, 0xfd0b, + 0xfd0a, 0xfd0c, 0xfd1e, 0xfd08, 0xfd07, 0xfd09, 0xfd14, 0xfd05, + 0xfd04, 0xfd06, 0xf701, 0xfd1b, 0xf206, 0xf200, 0xf03e, 0xf10a, + 0xf10b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xfd03, 0xf702, 0xfd27, 0xfd25, 0xf703, 0xf205, 0xf114, 0xf603, + 0xf20b, 0xf601, 0xf602, 0xf117, 0xf600, 0xf20a, 0xf115, 0xf116, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, +}; + +u_short altgr_map[NR_KEYS] = { + 0xf200, 0xf200, 0xf200, 0xf040, 0xf200, 0xf024, 0xf200, 0xf200, + 0xf07b, 0xf05b, 0xf05d, 0xf07d, 0xf05c, 0xf200, 0xf200, 0xf200, + 0xfb71, 0xfb77, 0xfb65, 0xfb72, 0xfb74, 0xfb79, 0xfb75, 0xfb69, + 0xfb6f, 0xfb70, 0xf200, 0xf07e, 0xf201, 0xf702, 0xfb61, 0xfb73, + 0xfb64, 0xfb66, 0xfb67, 0xfb68, 0xfb6a, 0xfb6b, 0xfb6c, 0xf200, + 0xf200, 0xf200, 0xf700, 0xf200, 0xfb7a, 0xfb78, 0xfb63, 0xfb76, + 0xfb62, 0xfb6e, 0xfb6d, 0xf200, 0xf200, 0xf200, 0xf700, 0xf406, + 0xf703, 0xf200, 0xf207, 0xf50c, 0xf50d, 0xf50e, 0xf50f, 0xf510, + 0xf511, 0xf512, 0xf513, 0xf514, 0xf515, 0xf208, 0xf202, 0xfd0f, + 0xfd20, 0xfd0d, 0xfd24, 0xfd22, 0xfd12, 0xfd23, 0xfd21, 0xfd10, + 0xfd11, 0xfd0e, 0xf701, 0xfd1d, 0xf206, 0xf200, 0xf07c, 0xf516, + 0xf517, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xfd1c, 0xf702, 0xfd28, 0xfd25, 0xf703, 0xf205, 0xf114, 0xf603, + 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, +}; + +u_short ctrl_map[NR_KEYS] = { + 0xf200, 0xf200, 0xf200, 0xf000, 0xf01b, 0xf01c, 0xf01d, 0xf01e, + 0xf01f, 0xf07f, 0xf200, 0xf200, 0xf01f, 0xf200, 0xf200, 0xf200, + 0xf011, 0xf017, 0xf005, 0xf012, 0xf014, 0xf019, 0xf015, 0xf009, + 0xf00f, 0xf010, 0xf01b, 0xf01d, 0xf201, 0xf702, 0xf001, 0xf013, + 0xf004, 0xf006, 0xf007, 0xf008, 0xf00a, 0xf00b, 0xf00c, 0xf200, + 0xf007, 0xf000, 0xf700, 0xf01c, 0xf01a, 0xf018, 0xf003, 0xf016, + 0xf002, 0xf00e, 0xf00d, 0xf200, 0xf200, 0xf07f, 0xf700, 0xfd26, + 0xf703, 0xf000, 0xf207, 0xf100, 0xf101, 0xf102, 0xf103, 0xf104, + 0xf105, 0xf106, 0xf107, 0xf108, 0xf109, 0xf208, 0xf204, 0xfd0b, + 0xfd0a, 0xfd0c, 0xfd1e, 0xfd08, 0xfd07, 0xfd09, 0xfd14, 0xfd05, + 0xfd04, 0xfd06, 0xf701, 0xfd1b, 0xf206, 0xf200, 0xf200, 0xf10a, + 0xf10b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xfd03, 0xf702, 0xfd27, 0xf01c, 0xf703, 0xf205, 0xf114, 0xf603, + 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, +}; + +u_short shift_ctrl_map[NR_KEYS] = { + 0xf200, 0xf200, 0xf200, 0xf000, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf01f, 0xf200, 0xf200, 0xf200, + 0xf011, 0xf017, 0xf005, 0xf012, 0xf014, 0xf019, 0xf015, 0xf009, + 0xf00f, 0xf010, 0xf200, 0xf200, 0xf201, 0xf702, 0xf001, 0xf013, + 0xf004, 0xf006, 0xf007, 0xf008, 0xf00a, 0xf00b, 0xf00c, 0xf200, + 0xf200, 0xf200, 0xf700, 0xf200, 0xf01a, 0xf018, 0xf003, 0xf016, + 0xf002, 0xf00e, 0xf00d, 0xf200, 0xf200, 0xf200, 0xf700, 0xfd26, + 0xf703, 0xf200, 0xf207, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf208, 0xf200, 0xfd0b, + 0xfd0a, 0xfd0c, 0xfd1e, 0xfd08, 0xfd07, 0xfd09, 0xfd14, 0xfd05, + 0xfd04, 0xfd06, 0xf701, 0xfd1b, 0xf206, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xfd03, 0xf702, 0xfd27, 0xfd25, 0xf703, 0xf205, 0xf114, 0xf603, + 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, +}; + +u_short altgr_ctrl_map[NR_KEYS] = { + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf011, 0xf017, 0xf005, 0xf012, 0xf014, 0xf019, 0xf015, 0xf009, + 0xf00f, 0xf010, 0xf200, 0xf200, 0xf201, 0xf702, 0xf001, 0xf013, + 0xf004, 0xf006, 0xf007, 0xf008, 0xf00a, 0xf00b, 0xf00c, 0xf200, + 0xf200, 0xf200, 0xf700, 0xf200, 0xf01a, 0xf018, 0xf003, 0xf016, + 0xf002, 0xf00e, 0xf00d, 0xf200, 0xf200, 0xf200, 0xf700, 0xfd26, + 0xf703, 0xf200, 0xf207, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf208, 0xf200, 0xfd0b, + 0xfd0a, 0xfd0c, 0xfd1e, 0xfd08, 0xfd07, 0xfd09, 0xfd14, 0xfd05, + 0xfd04, 0xfd06, 0xf701, 0xf20c, 0xf206, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xfd03, 0xf702, 0xfd27, 0xfd25, 0xf703, 0xf205, 0xf114, 0xf603, + 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf20c, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, +}; + +u_short alt_map[NR_KEYS] = { + 0xf200, 0xf81b, 0xf831, 0xf832, 0xf833, 0xf834, 0xf835, 0xf836, + 0xf837, 0xf838, 0xf839, 0xf830, 0xf82d, 0xf83d, 0xf87f, 0xf809, + 0xf871, 0xf877, 0xf865, 0xf872, 0xf874, 0xf879, 0xf875, 0xf869, + 0xf86f, 0xf870, 0xf85b, 0xf85d, 0xf80d, 0xf702, 0xf861, 0xf873, + 0xf864, 0xf866, 0xf867, 0xf868, 0xf86a, 0xf86b, 0xf86c, 0xf83b, + 0xf827, 0xf860, 0xf700, 0xf85c, 0xf87a, 0xf878, 0xf863, 0xf876, + 0xf862, 0xf86e, 0xf86d, 0xf82c, 0xf82e, 0xf82f, 0xf700, 0xfd26, + 0xf703, 0xf820, 0xf207, 0xf500, 0xf501, 0xf502, 0xf503, 0xf504, + 0xf505, 0xf506, 0xf507, 0xf508, 0xf509, 0xf208, 0xf209, 0xf907, + 0xf908, 0xf909, 0xfd1e, 0xf904, 0xf905, 0xf906, 0xfd14, 0xf901, + 0xf902, 0xf903, 0xf900, 0xfd1b, 0xf206, 0xf200, 0xf83c, 0xf50a, + 0xf50b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xfd03, 0xf702, 0xfd27, 0xf01c, 0xf703, 0xf205, 0xf114, 0xf603, + 0xf118, 0xf210, 0xf211, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, +}; + +u_short shift_alt_map[NR_KEYS] = { + 0xf200, 0xf200, 0xf821, 0xf840, 0xf823, 0xf824, 0xf825, 0xf85e, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf851, 0xf857, 0xf845, 0xf852, 0xf854, 0xf859, 0xf855, 0xf849, + 0xf84f, 0xf850, 0xf87b, 0xf87d, 0xf201, 0xf702, 0xf841, 0xf853, + 0xf844, 0xf846, 0xf847, 0xf848, 0xf84a, 0xf84b, 0xf84c, 0xf200, + 0xf200, 0xf200, 0xf700, 0xf87c, 0xf85a, 0xf858, 0xf843, 0xf856, + 0xf842, 0xf84e, 0xf84d, 0xf83c, 0xf83e, 0xf200, 0xf700, 0xfd26, + 0xf703, 0xf200, 0xf207, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf208, 0xf200, 0xfd0b, + 0xfd0a, 0xfd0c, 0xfd1e, 0xfd08, 0xfd07, 0xfd09, 0xfd14, 0xfd05, + 0xfd04, 0xfd06, 0xf701, 0xfd1b, 0xf206, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xfd03, 0xf702, 0xfd27, 0xfd25, 0xf703, 0xf205, 0xf114, 0xf603, + 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, +}; + +u_short ctrl_alt_map[NR_KEYS] = { + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf811, 0xf817, 0xf805, 0xf812, 0xf814, 0xf819, 0xf815, 0xf809, + 0xf80f, 0xf810, 0xf200, 0xf200, 0xf201, 0xf702, 0xf801, 0xf813, + 0xf804, 0xf806, 0xf807, 0xf808, 0xf80a, 0xf80b, 0xf80c, 0xf200, + 0xf200, 0xf200, 0xf700, 0xf200, 0xf81a, 0xf818, 0xf803, 0xf816, + 0xf802, 0xf80e, 0xf80d, 0xf200, 0xf200, 0xf200, 0xf700, 0xfd26, + 0xf703, 0xf200, 0xf207, 0xf500, 0xf501, 0xf502, 0xf503, 0xf504, + 0xf505, 0xf506, 0xf507, 0xf508, 0xf509, 0xf208, 0xf200, 0xfd0b, + 0xfd0a, 0xfd0c, 0xfd1e, 0xfd08, 0xfd07, 0xfd09, 0xfd14, 0xfd05, + 0xfd04, 0xfd06, 0xf701, 0xf20c, 0xf206, 0xf200, 0xf200, 0xf50a, + 0xf50b, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xfd03, 0xf702, 0xfd27, 0xfd25, 0xf703, 0xf205, 0xf114, 0xf603, + 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf20c, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, +}; + +u_short shift_ctrl_alt_map[NR_KEYS] = { + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf811, 0xf817, 0xf805, 0xf812, 0xf814, 0xf819, 0xf815, 0xf809, + 0xf80f, 0xf810, 0xf200, 0xf200, 0xf201, 0xf702, 0xf801, 0xf813, + 0xf804, 0xf806, 0xf807, 0xf808, 0xf80a, 0xf80b, 0xf80c, 0xf200, + 0xf200, 0xf200, 0xf700, 0xf200, 0xf81a, 0xf818, 0xf803, 0xf816, + 0xf802, 0xf80e, 0xf80d, 0xf200, 0xf200, 0xf200, 0xf700, 0xfd26, + 0xf703, 0xf200, 0xf207, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf208, 0xf200, 0xfd0b, + 0xfd0a, 0xfd0c, 0xfd1e, 0xfd08, 0xfd07, 0xfd09, 0xfd14, 0xfd05, + 0xfd04, 0xfd06, 0xf701, 0xfd1b, 0xf206, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xfd03, 0xf702, 0xfd27, 0xfd25, 0xf703, 0xf205, 0xf114, 0xf603, + 0xf118, 0xf601, 0xf602, 0xf117, 0xf600, 0xf119, 0xf115, 0xf116, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, + 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, 0xf200, +}; + +ushort *key_maps[MAX_NR_KEYMAPS] = { + plain_map, shift_map, altgr_map, 0, + ctrl_map, shift_ctrl_map, altgr_ctrl_map, 0, + alt_map, shift_alt_map, 0, 0, + ctrl_alt_map, shift_ctrl_alt_map, 0 +}; + +unsigned int keymap_count = 10; + + +/* + * Philosophy: most people do not define more strings, but they who do + * often want quite a lot of string space. So, we statically allocate + * the default and allocate dynamically in chunks of 512 bytes. + */ + +char func_buf[] = { + '\033', '[', '[', 'A', 0, + '\033', '[', '[', 'B', 0, + '\033', '[', '[', 'C', 0, + '\033', '[', '[', 'D', 0, + '\033', '[', '[', 'E', 0, + '\033', '[', '1', '7', '~', 0, + '\033', '[', '1', '8', '~', 0, + '\033', '[', '1', '9', '~', 0, + '\033', '[', '2', '0', '~', 0, + '\033', '[', '2', '1', '~', 0, + '\033', '[', '2', '3', '~', 0, + '\033', '[', '2', '4', '~', 0, + '\033', '[', '2', '5', '~', 0, + '\033', '[', '2', '6', '~', 0, + '\033', '[', '2', '8', '~', 0, + '\033', '[', '2', '9', '~', 0, + '\033', '[', '3', '1', '~', 0, + '\033', '[', '3', '2', '~', 0, + '\033', '[', '3', '3', '~', 0, + '\033', '[', '3', '4', '~', 0, + '\033', '[', '1', '~', 0, + '\033', '[', '2', '~', 0, + '\033', '[', '3', '~', 0, + '\033', '[', '4', '~', 0, + '\033', '[', '5', '~', 0, + '\033', '[', '6', '~', 0, + 0, + 0, + 0, + 0, + 0, + 0, +}; + + +char *funcbufptr = func_buf; +int funcbufsize = sizeof(func_buf); +int funcbufleft = 0; /* space left */ + +char *func_table[MAX_NR_FUNC] = { + func_buf + 0, + func_buf + 5, + func_buf + 10, + func_buf + 15, + func_buf + 20, + func_buf + 25, + func_buf + 31, + func_buf + 37, + func_buf + 43, + func_buf + 49, + func_buf + 55, + func_buf + 61, + func_buf + 67, + func_buf + 73, + func_buf + 79, + func_buf + 85, + func_buf + 91, + func_buf + 97, + func_buf + 103, + func_buf + 109, + func_buf + 115, + func_buf + 120, + func_buf + 125, + func_buf + 130, + func_buf + 135, + func_buf + 140, + 0, + 0, + 0, + 0, + func_buf + 145, + func_buf + 146, + func_buf + 147, + func_buf + 148, + func_buf + 149, + func_buf + 150, + 0, +}; + +struct kbdiacr accent_table[MAX_DIACR] = { +}; + +unsigned int accent_table_size = 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakupmap.map linux.20pre5-ac2/drivers/char/speakup/speakupmap.map --- linux.20pre5/drivers/char/speakup/speakupmap.map 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakupmap.map 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,308 @@ +# us.map +# with some additions from quinlan@spectrum.cs.bucknell.edu (Daniel Quinlan) +# 14 Mar 1994 +keymaps 0-2,4-6,8,9,12,13 +keycode 1 = Escape Escape + alt keycode 1 = Meta_Escape +keycode 2 = one exclam + alt keycode 2 = Meta_one + alt shift keycode 2 = Meta_exclam +keycode 3 = two at at + control keycode 3 = nul + control shift keycode 3 = nul + alt keycode 3 = Meta_two + alt shift keycode 3 = Meta_at +keycode 4 = three numbersign + control keycode 4 = Escape + alt keycode 4 = Meta_three + alt shift keycode 4 = Meta_numbersign +keycode 5 = four dollar dollar + control keycode 5 = Control_backslash + alt keycode 5 = Meta_four + alt shift keycode 5 = Meta_dollar +keycode 6 = five percent + control keycode 6 = Control_bracketright + alt keycode 6 = Meta_five + alt shift keycode 6 = Meta_percent +keycode 7 = six asciicircum + control keycode 7 = Control_asciicircum + alt keycode 7 = Meta_six + alt shift keycode 7 = Meta_asciicircum +keycode 8 = seven ampersand braceleft + control keycode 8 = Control_underscore + alt keycode 8 = Meta_seven +keycode 9 = eight asterisk bracketleft + control keycode 9 = Delete + alt keycode 9 = Meta_eight +keycode 10 = nine parenleft bracketright + alt keycode 10 = Meta_nine +keycode 11 = zero parenright braceright + alt keycode 11 = Meta_zero +keycode 12 = minus underscore backslash + control keycode 12 = Control_underscore + control shift keycode 12 = Control_underscore + alt keycode 12 = Meta_minus +keycode 13 = equal plus + alt keycode 13 = Meta_equal +keycode 14 = Delete Delete + alt keycode 14 = Meta_Delete +keycode 15 = Tab Tab + alt keycode 15 = Meta_Tab +keycode 16 = q +keycode 17 = w +keycode 18 = e +keycode 19 = r +keycode 20 = t +keycode 21 = y +keycode 22 = u +keycode 23 = i +keycode 24 = o +keycode 25 = p +keycode 26 = bracketleft braceleft + control keycode 26 = Escape + alt keycode 26 = Meta_bracketleft + alt shift keycode 26 = Meta_braceleft +keycode 27 = bracketright braceright asciitilde + control keycode 27 = Control_bracketright + alt keycode 27 = Meta_bracketright + alt shift keycode 27 = Meta_braceright +keycode 28 = Return + alt keycode 28 = 0x080d +keycode 29 = Control +keycode 30 = a +keycode 31 = s +keycode 32 = d +keycode 33 = f +keycode 34 = g +keycode 35 = h +keycode 36 = j +keycode 37 = k +keycode 38 = l +keycode 39 = semicolon colon + alt keycode 39 = Meta_semicolon +keycode 40 = apostrophe quotedbl + control keycode 40 = Control_g + alt keycode 40 = Meta_apostrophe +keycode 41 = grave asciitilde + control keycode 41 = nul + alt keycode 41 = Meta_grave +keycode 42 = Shift +keycode 43 = backslash bar + control keycode 43 = Control_backslash + alt keycode 43 = Meta_backslash + alt shift keycode 43 = Meta_bar +keycode 44 = z +keycode 45 = x +keycode 46 = c +keycode 47 = v +keycode 48 = b +keycode 49 = n +keycode 50 = m +keycode 51 = comma less + alt keycode 51 = Meta_comma + alt shift keycode 51 = Meta_less +keycode 52 = period greater + alt keycode 52 = Meta_period + alt shift keycode 52 = Meta_greater +keycode 53 = slash question + control keycode 53 = Delete + alt keycode 53 = Meta_slash +keycode 54 = Shift +keycode 55 = 0x0d26 +#keycode 55 = KP_Multiply + altgr keycode 55 = 0x0406 +keycode 56 = Alt +keycode 57 = space space + control keycode 57 = nul + alt keycode 57 = Meta_space +keycode 58 = Caps_Lock +keycode 59 = F1 F11 Console_13 + control keycode 59 = F1 + alt keycode 59 = Console_1 + control alt keycode 59 = Console_1 +keycode 60 = F2 F12 Console_14 + control keycode 60 = F2 + alt keycode 60 = Console_2 + control alt keycode 60 = Console_2 +keycode 61 = F3 F13 Console_15 + control keycode 61 = F3 + alt keycode 61 = Console_3 + control alt keycode 61 = Console_3 +keycode 62 = F4 F14 Console_16 + control keycode 62 = F4 + alt keycode 62 = Console_4 + control alt keycode 62 = Console_4 +keycode 63 = F5 F15 Console_17 + control keycode 63 = F5 + alt keycode 63 = Console_5 + control alt keycode 63 = Console_5 +keycode 64 = F6 F16 Console_18 + control keycode 64 = F6 + alt keycode 64 = Console_6 + control alt keycode 64 = Console_6 +keycode 65 = F7 F17 Console_19 + control keycode 65 = F7 + alt keycode 65 = Console_7 + control alt keycode 65 = Console_7 +keycode 66 = F8 F18 Console_20 + control keycode 66 = F8 + alt keycode 66 = Console_8 + control alt keycode 66 = Console_8 +keycode 67 = F9 F19 Console_21 + control keycode 67 = F9 + alt keycode 67 = Console_9 + control alt keycode 67 = Console_9 +keycode 68 = F10 F20 Console_22 + control keycode 68 = F10 + alt keycode 68 = Console_10 + control alt keycode 68 = Console_10 +keycode 69 = Num_Lock +keycode 70 = Scroll_Lock Show_Memory Show_Registers + control keycode 70 = Show_State + alt keycode 70 = Scroll_Lock +keycode 71 = 0x0d0b + altgr keycode 71 = 0x0d0f +#keycode 71 = KP_7 + alt keycode 71 = Ascii_7 +keycode 72 = 0x0d0a + altgr keycode 72 = 0x0d20 +#keycode 72 = KP_8 + alt keycode 72 = Ascii_8 +keycode 73 = 0x0d0c + altgr keycode 73 = 0x0d0d +#keycode 73 = KP_9 + alt keycode 73 = Ascii_9 +keycode 74 = 0x0d1e + altgr keycode 74 = 0x0d24 +keycode 75 = 0x0d08 + altgr keycode 75 = 0x0d22 +#keycode 75 = KP_4 + alt keycode 75 = Ascii_4 +keycode 76 = 0x0d07 +#keycode 76 = KP_5 + altgr keycode 76 = 0x0d12 + alt keycode 76 = Ascii_5 +keycode 77 = 0x0d09 + altgr keycode 77 = 0x0d23 +#keycode 77 = KP_6 + alt keycode 77 = Ascii_6 +#keycode 78 = KP_Add +keycode 78 = 0x0d14 + altgr keycode 78 = 0x0d21 +keycode 79 = 0x0d05 +#keycode 79 = KP_1 + altgr keycode 79 = 0x0d10 + alt keycode 79 = Ascii_1 +keycode 80 = 0x0d04 +#keycode 80 = KP_2 + altgr keycode 80 = 0x0d11 + alt keycode 80 = Ascii_2 +keycode 81 = 0x0d06 + altgr keycode 81 = 0x0d0e +#keycode 81 = KP_3 + alt keycode 81 = Ascii_3 +#keycode 82 = 0x0d14 +keycode 82 = AltGr +#keycode 82 = KP_0 + alt keycode 82 = Ascii_0 +#keycode 83 = KP_Period +keycode 83 = 0x0d1b + altgr keycode 83 = 0x0d1d + altgr control keycode 83 = Boot + control alt keycode 83 = Boot +keycode 84 = Last_Console +keycode 85 = +keycode 86 = less greater bar + alt keycode 86 = Meta_less +keycode 87 = F11 F11 Console_23 + control keycode 87 = F11 + alt keycode 87 = Console_11 + control alt keycode 87 = Console_11 +keycode 88 = F12 F12 Console_24 + control keycode 88 = F12 + alt keycode 88 = Console_12 + control alt keycode 88 = Console_12 +keycode 89 = +keycode 90 = +keycode 91 = +keycode 92 = +keycode 93 = +keycode 94 = +keycode 95 = +keycode 96 = 0x0d03 + altgr keycode 96 = 0x0d1c +#keycode 96 = KP_Enter +keycode 97 = Control +keycode 98 = 0x0d27 +#keycode 98 = KP_Divide + altgr keycode 98 = 0x0d28 +#keycode 99 = Control_backslash +keycode 99 = 0x0d25 + control keycode 99 = Control_backslash + alt keycode 99 = Control_backslash +keycode 100 = Alt +keycode 101 = Break +keycode 102 = Find +keycode 103 = Up +keycode 104 = Prior + shift keycode 104 = Scroll_Backward +keycode 105 = Left + alt keycode 105 = Decr_Console +keycode 106 = Right + alt keycode 106 = Incr_Console +keycode 107 = Select +keycode 108 = Down +keycode 109 = Next + shift keycode 109 = Scroll_Forward +keycode 110 = Insert +keycode 111 = Remove + altgr control keycode 111 = Boot + control alt keycode 111 = Boot +keycode 112 = +keycode 113 = +keycode 114 = +keycode 115 = +keycode 116 = +keycode 117 = +keycode 118 = +keycode 119 = +keycode 120 = +keycode 121 = +keycode 122 = +keycode 123 = +keycode 124 = +keycode 125 = +keycode 126 = +keycode 127 = +string F1 = "\033[[A" +string F2 = "\033[[B" +string F3 = "\033[[C" +string F4 = "\033[[D" +string F5 = "\033[[E" +string F6 = "\033[17~" +string F7 = "\033[18~" +string F8 = "\033[19~" +string F9 = "\033[20~" +string F10 = "\033[21~" +string F11 = "\033[23~" +string F12 = "\033[24~" +string F13 = "\033[25~" +string F14 = "\033[26~" +string F15 = "\033[28~" +string F16 = "\033[29~" +string F17 = "\033[31~" +string F18 = "\033[32~" +string F19 = "\033[33~" +string F20 = "\033[34~" +string Find = "\033[1~" +string Insert = "\033[2~" +string Remove = "\033[3~" +string Select = "\033[4~" +string Prior = "\033[5~" +string Next = "\033[6~" +string F21 = "" +string F22 = "" +string F23 = "" +string F24 = "" +string F25 = "" +string F26 = "" diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_spkout.c linux.20pre5-ac2/drivers/char/speakup/speakup_spkout.c --- linux.20pre5/drivers/char/speakup/speakup_spkout.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_spkout.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,301 @@ +/* + * speakup_speakout.c for linux kernels 2.2.x and speakup + * + * author: Kirk Reiser and John Covici + 261 Trott dr. London, Ontario, Canada. N6G 1B6 + */ + + +/* These routines are written to control the speakout serial speech + synthesizer. They are not ment to be thought of as a device driver + in that they do not register themselves as a chr device and there + is no file_operations structure. They are strictly to provide an + interface to the speakout from the speakup screen review package. +*/ + +#define KERNEL +#include +#include +#include +#include /* for verify_area */ +#include /* for -EBUSY */ +#include /* for check_region, request_region */ +#include /* for loops_per_sec */ +#include /* for put_user_byte */ +#include /* for inb_p, outb_p, inb, outb, etc... */ +#include /* for wait_queue */ +#include /* kd_mksound */ +#include /* for __init */ +#include +#include /* for rs_table, serial constants and + serial_uart_config */ +#include /* for more serial constants */ +#if (LINUX_VERSION_CODE >= 0x20300) /* v 2.3.x */ +#include /* for struct serial_state */ +#endif +#include +#include + +#define SYNTH_CLEAR 0x18 +#define SPK_TIMEOUT 100 /* buffer timeout in ms */ +#define NUM_DISABLE_TIMEOUTS 3 /* disable synth if n timeouts */ +#define SPK_SERIAL_TIMEOUT 1000000 /* countdown values for serial timeouts */ +#define SPK_XMITR_TIMEOUT 1000000 /* countdown values transmitter/dsr timeouts */ +#define SPK_LO_TTY 0 /* check ttyS0 ... ttyS3 */ +#define SPK_HI_TTY 3 + +static int spkout_alive = 0; +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) + +static struct serial_state rs_table[] = { + SERIAL_PORT_DFNS /* Defined in serial.h */ +}; + +static int wait_for_xmitr(void) +{ +static int timeouts = 0; /* sequential number of timeouts */ +int check, tmout = SPK_XMITR_TIMEOUT; + + if ((spkout_alive) && (timeouts >= NUM_DISABLE_TIMEOUTS)) { + spkout_alive = 0; + timeouts = 0; + return 0; + } + + /* holding register empty? */ + do { + check = inb(synth_port_tts + UART_LSR); + if (--tmout == 0) { + printk("SpeakOut: timed out\n"); + timeouts++; + return 0; + } + } while ((check & BOTH_EMPTY) != BOTH_EMPTY); + + tmout = SPK_XMITR_TIMEOUT; + /* CTS */ + do { + check = inb(synth_port_tts + UART_MSR); + if (--tmout == 0) { + timeouts++; + return 0; + } + } while ((check & UART_MSR_CTS) != UART_MSR_CTS); + + timeouts = 0; + return 1; +} + +static inline int spk_serial_out(const char ch) +{ + if (spkout_alive && synth_port_tts) { + if (wait_for_xmitr()) { + outb(ch, synth_port_tts); + return 1; + } + } + return 0; +} + +static unsigned char __init spk_serial_in(void) +{ +int c, lsr, tmout = SPK_SERIAL_TIMEOUT; + + do { + lsr = inb(synth_port_tts + UART_LSR); + if (--tmout == 0) return 0xff; + } while (!(lsr & UART_LSR_DR)); + c = inb(synth_port_tts + UART_RX); + return (unsigned char) c; +} + +static void do_catch_up(unsigned long data) +{ + unsigned long jiff_in = jiffies; + +synth_stop_timer(); + while (synth_sent_bytes < synth_queued_bytes) + { + if (!spk_serial_out(*(synth_buffer+synth_sent_bytes))) { + synth_delay(synth_full_time); + return; + } + synth_sent_bytes++; + if (jiffies >= jiff_in+synth_jiffy_delta && *(synth_buffer+synth_sent_bytes-1) == ' ') { + spk_serial_out('\r'); + synth_delay(synth_delay_time); + return; + } + } + +synth_sent_bytes = synth_queued_bytes = 0; +synth_timer_active = 0; +spk_serial_out('\r'); +if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); +} + +static inline void clear_it(char ch) +{ + while ((inb(synth_port_tts + UART_LSR) & BOTH_EMPTY) != BOTH_EMPTY); + outb(ch, synth_port_tts); +} + +void synth_write_tts(char ch) +{ + if (!spkout_alive) return; + if (ch < 0x00) return; /* don't want unprintable chars */ + if (ch == 0x0a) /* turn lf into to force talking. */ + ch = '\r'; + if (ch == SYNTH_CLEAR) /* clear all and wake sleeping */ + { + clear_it(ch); + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); + synth_timer_active = synth_queued_bytes = synth_sent_bytes = 0; + return; + } + +synth_buffer_add(ch); +if (synth_buffering) return; +if (synth_timer_active == 0) synth_delay( synth_trigger_time ); +return; +} + +static inline void synth_immediate_tts(const char *buf, short count) +{ + while (count--) synth_write_tts(*buf++); +return; +} + +/* + * Setup initial baud/bits/parity. Swiped from serial.c (console section) + * Return non-zero if we didn't find a serial port. + */ +static int __init serprobe(int index) +{ + struct serial_state *ser = NULL; + unsigned char test=0; + + if (synth_port_tts) { + for (test=0; test <= SPK_HI_TTY; test++) + if ( (rs_table+test)->port == synth_port_tts) { + ser = rs_table+test; + break; + } + } else ser = rs_table + index; + + if (synth_request_region(ser->port,8)) + return -1; + + initialize_uart(ser); + /* If we read 0xff from the LSR, there is no UART here. */ + if (inb (ser->port + UART_LSR) == 0xff) { + synth_release_region(ser->port,8); + return -1; + } + mdelay(1); + + spkout_alive = 1; + /* ignore any error results, if port was forced */ + if (synth_port_tts) + return 0; + + synth_port_tts = ser->port; + + /* check for speak out now... */ + spk_serial_out(0x05); + spk_serial_out('['); /* set index cmd */ + spk_serial_out(0x0a); /* index mark */ + spk_serial_out('\r'); /* flush buffer for safety */ + mdelay(10); + if (spk_serial_in() == 0x0a) return 0; + + synth_release_region(ser->port,8); + spkout_alive = synth_port_tts = 0; /* not ignoring */ + return -1; +} + +static int __init synth_dev_probe(void) +{ +int i=0; + + printk("Probing for Speak Out.\n"); + if (synth_port_tts != 0) /* set from commandline */ + printk("Probe forced to 0x%x by kernel command line.\n",synth_port_tts); + + for (i=SPK_LO_TTY; i <= SPK_HI_TTY; i++) { + if (serprobe(i) == 0) break; /* found it */ + } + + if (spkout_alive) { + /* found 'em */ + printk("Speak Out: %03x-%03x, Driver version %s,\n", + synth_port_tts, synth_port_tts + 7, synth->version); + synth_immediate_tts(synth->init, strlen(synth->init)); + return 0; + } + + printk("Speak Out: not found\n"); + return -ENODEV; +} + + /* this is a new function required by speakup: + * if synth is not active, make it active and return 2 + * if synth is already active, return 1 + * otherwise (if it can't be made active), return 0 + */ +static int synth_alive(void) +{ + if (spkout_alive) + return 1; /* already on */ + else if ((!spkout_alive) && (synth_port_tts)) { + if (wait_for_xmitr() > 0) { /* restart */ + spkout_alive = 1; + synth_write(synth->reinit, strlen(synth->reinit)); + return 2; /* reenabled */ + } else printk("Speak Out: can't restart synth\n"); + } + return 0; +} + +static const char init_string[] = "\x05R7\x05P3\x05Ti\x05W1\x05I2\x05\x43\x33\x05MnSpeakout found\r"; +static const char reinit_string[] = "\x05R7\x05P3\x05Ti\x05W1\x05I2\x05\x43\x33\x05MnSpeakout found\r"; + +static struct spk_variable vars[] = +{{"flush", "\x18", "_", (BUILDER|HARD_DIRECT|NO_USER), "*"}, + {"pitch", "3", "\x05P_", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,9"}, + {"caps_start", "\x05P+", "_", 0, "*"}, + {"caps_stop", "\x05P-", "_", 0, "*"}, + {"rate", "7", "\x05R_", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,9"}, + {"tone", "i", "\x05T_", (HARD_DIRECT|USE_RANGE), "a,z"}, + {"volume", "9", "\x05V_", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,9"}, + {"punct", "n", "\x05M_", HARD_DIRECT, "nmsa"}, + END_VARS}; + +static char *config[] = +{"\x18", "\x05P3", "\x05P+", "\x05P-", "\x05R7", "\x05Ti", "\x05V9", + "\x05Mn"}; + +struct spk_synth synth_spkout = {"spkout", "Version-0.12", "speakout", + init_string, reinit_string, 500, 50, 5, 5000, + vars, config, 0, synth_dev_probe, do_catch_up, + synth_write_tts, synth_alive}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/speakup_txprt.c linux.20pre5-ac2/drivers/char/speakup/speakup_txprt.c --- linux.20pre5/drivers/char/speakup/speakup_txprt.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/speakup_txprt.c 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,287 @@ +/* + * speakup_txprt.c for linux kernels 2.2.x and speakup + * + * author: Kirk Reiser + + Copyright (C) 1998-99 Kirk Reiser. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Kirk Reiser + 261 Trott dr. London, Ontario, Canada. N6G 1B6 + */ + + +/* These routines are written to control the Transport serial speech + synthesizer. They are not ment to be thought of as a device driver + in that they do not register themselves as a chr device and there + is no file_operations structure. They are strictly to provide an + interface to the txprt from the speakup screen review package. */ + +#define KERNEL +#include +#include +#include +#include /* for verify_area */ +#include /* for -EBUSY */ +#include /* for check_region, request_region */ +#include /* for loops_per_sec */ +#include /* for put_user_byte */ +#include /* for inb_p, outb_p, inb, outb, etc... */ +#include /* for wait_queue */ +#include /* kd_mksound */ +#include /* for __init */ +#include +#include /* for rs_table, serial constants and + serial_uart_config */ +#include /* for more serial constants */ +#if (LINUX_VERSION_CODE >= 0x20300) /* v 2.3.x */ +#include /* for struct serial_state */ +#endif +#include +#include + +#define SYNTH_CLEAR 0x18 +#define SPK_TIMEOUT 100 /* buffer timeout in ms */ +#define NUM_DISABLE_TIMEOUTS 3 /* disable synth if n timeouts */ +#define SPK_SERIAL_TIMEOUT 1000000 /* countdown values for serial timeouts */ +#define SPK_XMITR_TIMEOUT 1000000 /* countdown values transmitter/dsr timeouts */ +#define SPK_LO_TTY 0 /* check ttyS0 ... ttyS3 */ +#define SPK_HI_TTY 3 +#define PROCSPEECH '\r' /* process speech char */ + +static int txprt_alive = 0; +#define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) + +static struct serial_state rs_table[] = { + SERIAL_PORT_DFNS /* Defined in serial.h */ +}; + +static int timeouts = 0; /* sequential number of timeouts */ + +static int wait_for_xmitr(void) +{ +int check, tmout = SPK_XMITR_TIMEOUT; + + if ((txprt_alive) && (timeouts >= NUM_DISABLE_TIMEOUTS)) { + txprt_alive = 0; + timeouts = 0; + return 0; + } + + /* holding register empty? */ + do { + check = inb(synth_port_tts + UART_LSR); + if (--tmout == 0) { + printk("TXPRT: timed out\n"); + timeouts++; + return 0; + } + } while ((check & BOTH_EMPTY) != BOTH_EMPTY); + + tmout = SPK_XMITR_TIMEOUT; + /* CTS */ + do { + check = inb(synth_port_tts + UART_MSR); + if (--tmout == 0) { + timeouts++; + return 0; + } + } while ((check & UART_MSR_CTS) != UART_MSR_CTS); + + timeouts = 0; + return 1; +} + +static inline int spk_serial_out(const char ch) +{ + if (txprt_alive && synth_port_tts) { + if (wait_for_xmitr()) { + outb(ch, synth_port_tts); + return 1; + } + } + return 0; +} + +static unsigned char __init spk_serial_in(void) +{ +int c, lsr, tmout = SPK_SERIAL_TIMEOUT; + + do { + lsr = inb(synth_port_tts + UART_LSR); + if (--tmout == 0) return 0xff; + } while (!(lsr & UART_LSR_DR)); + c = inb(synth_port_tts + UART_RX); + return (unsigned char) c; +} + +static void do_catch_up(unsigned long data) +{ + unsigned long jiff_in = jiffies; + +synth_stop_timer(); + while (synth_sent_bytes < synth_queued_bytes) + { + if (!spk_serial_out(*(synth_buffer+synth_sent_bytes))) { + synth_delay(synth_full_time); + return; + } + synth_sent_bytes++; + if (jiffies >= jiff_in+synth_jiffy_delta && *(synth_buffer+synth_sent_bytes-1) == ' ') + { + spk_serial_out(PROCSPEECH); + synth_delay(synth_delay_time); + return; + } + } + +synth_sent_bytes = synth_queued_bytes = 0; +spk_serial_out(PROCSPEECH); +synth_timer_active = 0; +if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); +} + + +static void synth_write_tts(char ch) +{ + if (!txprt_alive) return; + if (ch < 0x00) return; /* don't want unprintable chars */ + if (ch == 0x0a) /* turn lf into to force talking. */ + ch = PROCSPEECH; + if (ch == SYNTH_CLEAR) /* clear all and wake sleeping */ + { + spk_serial_out(ch); + if (waitqueue_active(&synth_sleeping_list)) + wake_up_interruptible(&synth_sleeping_list); + synth_timer_active = synth_queued_bytes = synth_sent_bytes = 0; + return; + } + +synth_buffer_add(ch); +if (synth_buffering) return; +if (synth_timer_active == 0) synth_delay( synth_trigger_time ); +return; +} + +static inline void synth_immediate_tts(const char *buf, short count) +{ + while (count--) spk_serial_out(*buf++); +return; +} + +static int __init serprobe(int index) +{ + struct serial_state *ser = NULL; + unsigned char test=0; + + if (synth_port_tts) { + for (test=0; test <= SPK_HI_TTY; test++) + if ( (rs_table+test)->port == synth_port_tts) { + ser = rs_table+test; + break; + } + } else ser = rs_table + index; + + if (synth_request_region(ser->port,8)) + return -1; + + initialize_uart(ser); + /* If we read 0xff from the LSR, there is no UART here. */ + if (inb (ser->port + UART_LSR) == 0xff) { + synth_release_region(ser->port,8); + return -1; + } + + txprt_alive = 1; + if (synth_port_tts) return 0; + synth_port_tts = ser->port; + + /* check for txprt now... */ + spk_serial_out(0x18); + spk_serial_out('\r'); + mdelay(1); + spk_serial_out(0x05); + spk_serial_out('I'); + spk_serial_out('k'); + mdelay(10); + spk_serial_out(0x05); + spk_serial_out('Q'); + if ((test = spk_serial_in()) == 'k') return 0; + else printk("synth returned %x\n", test); + + synth_release_region(ser->port,8); + timeouts = txprt_alive = synth_port_tts = 0; + return -1; +} + +static int __init synth_dev_probe(void) +{ +int i; + + printk("Probing for Transport.\n"); + if (synth_port_tts) + printk("Probe forced to 0x%x by kernel command line\n", synth_port_tts); + for (i=SPK_LO_TTY; i <= SPK_HI_TTY; i++) { + if (serprobe(i) == 0) break; /* found it */ + } + + if (txprt_alive) { + /* found 'em */ + printk("Transport: %03x-%03x, Driver version %s,\n", + synth_port_tts, synth_port_tts + 7, synth->version); + synth_immediate_tts(synth->init, strlen(synth->init)); + return 0; + } + + printk("Transport: not found\n"); + return -ENODEV; +} + +static int synth_alive(void) +{ + if (txprt_alive) + return 1; /* already on */ + else if ((!txprt_alive) && (synth_port_tts)) { + if (wait_for_xmitr() > 0) { /* restart */ + txprt_alive = 1; + synth_write(synth->reinit, strlen(synth->reinit)); + return 2; /* reenabled */ + } else printk("Transport: can't restart synth\n"); + } + return 0; +} + + +static const char init_string[] = "\x05$\x05P5\x05R5\x05N1Transport found\r"; +static const char reinit_string[] = "\x05$\x05P5\x05R5\x05N1Transport initialized\r"; +static struct spk_variable vars[] = +{{"flush", "\x18\r", "_", (BUILDER|HARD_DIRECT|NO_USER), "*"}, + {"pitch", "5", "\x05P_", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,9"}, + {"caps_start", "\x05P8", "_", 0, "*"}, + {"caps_stop", "\x05P5", "_", 0, "*"}, + {"rate", "5", "\x05R_", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,9"}, + {"tone", "I", "\x05T_", (HARD_DIRECT|USE_RANGE), "a,z"}, + {"volume", "5", "\x05V_", (NUMERIC|HARD_DIRECT|USE_RANGE), "0,9"}, + END_VARS}; + +static char *config[] = +{"\x18\r", "\x05P5", "\x05P8", "\x05P5", "\x05R5", "\x05TI", "\x05V5", NULL}; + +struct spk_synth synth_txprt = {"txprt", "Version-0.13", "transport", + init_string, reinit_string, 500, 50, 5, 5000, + vars, config, 0, synth_dev_probe, do_catch_up, + synth_write_tts, synth_alive}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/symbols.h linux.20pre5-ac2/drivers/char/speakup/symbols.h --- linux.20pre5/drivers/char/speakup/symbols.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/symbols.h 2002-09-02 14:22:35.000000000 +0100 @@ -0,0 +1,62 @@ +#ifndef _SPEAKUP_SYMBOLS_H +#define _SPEAKUP_SYMBOLS_H + +#include + +#define PUNC_CHARS_SIZE 33 +#define PUNC_CHARS "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~" + +#define DEFAULT_SPKUP_VARS \ +/* line_wrap_bleep */ "1", \ +/* attribute_bleep */ "1", \ +/* bleep_time (ms) */ "3", \ +/* spell_delay */ "1", \ +/* punc_level */ "1", \ +/* say_control */ "0", \ +/* no_interrupt */ "0", \ +/* punc_none */ "", \ +/* punc_some */ "/$%&@", \ +/* punc_most */ "($%&#@=+*^<>|\\)", \ +/* punc_all */ PUNC_CHARS, \ +/* key_echo */ "1", \ +/* bell_pos */ "0" + +// alias the necessary hardware constants off to generalized constants +#define FLUSH 0 +#define PITCH 1 +#define CAPS_START 2 +#define CAPS_STOP 3 + +#define LINE_WRAP_BLEEP 0 +#define ATTRIBUTE_BLEEP 1 +#define BLEEP_TIME 2 +#define SPELL_DELAY 3 +#define PUNCT_LEVEL 4 +#define SAY_CONTROL 5 +#define NO_INTERRUPT 6 +#define PUNC_NONE 7 +#define PUNC_SOME 8 +#define PUNC_MOST 9 +#define PUNC_ALL 10 +#define KEY_ECHO 11 +#define BELL_POS 12 + +// beginning of the 4 punc levels +#define PUNC_OFFSET PUNC_NONE + +#define SPKUP_VARS \ +{"line_wrap_bleep", "1", "_", (NUMERIC|SOFT_DIRECT|USE_RANGE), TOGGLE}, \ +{"attribute_bleep", "1", "_", (NUMERIC|SOFT_DIRECT|USE_RANGE), TOGGLE}, \ +{"bleep_time", "3", "_", (NUMERIC|SOFT_DIRECT|USE_RANGE), "1,9"}, \ +{"spell_delay", "1", "_", (NUMERIC|SOFT_DIRECT|USE_RANGE), "1,5"}, \ +{"punc_level", "1", "_", (NUMERIC|SOFT_DIRECT|USE_RANGE), "0,3"}, \ +{"say_control", "0", "_", (NUMERIC|SOFT_DIRECT|USE_RANGE), TOGGLE}, \ +{"no_interrupt", "0", "_", (NUMERIC|SOFT_DIRECT|USE_RANGE), TOGGLE}, \ +{"punc_none", "", "_", (SOFT_DIRECT|NO_USER), ""}, \ +{"punc_some", "/$%&", "_", (MULTI_SET|SOFT_DIRECT), PUNC_CHARS}, \ +{"punc_most", "($%&#@=+*^<>|\\)", "_", (MULTI_SET|SOFT_DIRECT), PUNC_CHARS}, \ +{"punc_all", PUNC_CHARS, "_", (SOFT_DIRECT|NO_USER), ""}, \ +{"key_echo", "1", "_", (NUMERIC|SOFT_DIRECT|USE_RANGE), TOGGLE}, \ +{"bell_pos", "0", "_", (NUMERIC|SOFT_DIRECT|USE_RANGE), "0,200"}, \ +END_VARS +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/char/speakup/TODO linux.20pre5-ac2/drivers/char/speakup/TODO --- linux.20pre5/drivers/char/speakup/TODO 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/char/speakup/TODO 2002-08-06 15:42:07.000000000 +0100 @@ -0,0 +1,66 @@ +The format of this file is getting organized to help me keep track of +where we are going. I am organizing it into three sections. +Immediate things which need to be done I.E. code re-organization. New +features we are currently working on or at least in the near future. +Long term features which will move to the new features list as the new +features list empties. + +Immediate: + +Screen cursoring needs to become more reliable and consistant. + +New-Features: + +convert the individual synth drivers into modules (involves moving buffering + into speakup proper). + +synth_file fops need to be filled in and expanded such as some type of +ioctl function and a real synth_file_read() function. + + +Long-Term-Features: + +keyboard macros (ala ASAP/qedit) + +finding calling process, so per-program configurations can be loaded + +Check park status and store it before doing a console switch. (non-trivial) + +make numlock turn review pad to number pad. + +user defined scroll-back ala shift-pgup. + +insert as 'capslock-style'/'next-style' key -- have internalized speakup + variable, which tracks state of the insert key; each speakup bare-key + function checks the variable, and possibly calls the alternate + function and returns + +Expand phonetic spelling to toggle on and off and work with previous + and next and spell_word functions. Also shift pitch on phonetic words + for capitalized letters. [partially complete] + +Chuck wants a bleep if the shift key is hit and the capslock is on. +Here is his suggested test sequence: +1. check if the caps lock is set; if it is, +2. check if the char is alphabetic; if it is, +3. check if the shift key is pressed; if it is, +4. send a bell char to the console. + +Frank would like a fast way to go to the end of the word in addition +to moving to the beginning. + +I'd like a function to move the reading cursor to the last char on a +line in addition to the right edge of the screen. + +Gene thinks we should have a /proc function to store and show the rom +version of any synth currently operating. + +The items in each list have no connection with the order of +implementation. I just jotted them down as I thought of them. + +Bill Acker WB2FLW: When the final result is "none", then, no trace of +Speakup. and use default keymap otherwise business as usual plus use +"built-in" speakupmap.map + +Look at lilo routines which init the serial device and compare to speakup drivers. + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/hotplug/Config.in linux.20pre5-ac2/drivers/hotplug/Config.in --- linux.20pre5/drivers/hotplug/Config.in 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/drivers/hotplug/Config.in 2002-08-18 23:30:48.000000000 +0100 @@ -6,11 +6,11 @@ dep_tristate 'Support for PCI Hotplug (EXPERIMENTAL)' CONFIG_HOTPLUG_PCI $CONFIG_EXPERIMENTAL $CONFIG_PCI +dep_tristate ' ACPI PCI Hotplug driver' CONFIG_HOTPLUG_PCI_ACPI $CONFIG_ACPI $CONFIG_HOTPLUG_PCI dep_tristate ' Compaq PCI Hotplug driver' CONFIG_HOTPLUG_PCI_COMPAQ $CONFIG_HOTPLUG_PCI $CONFIG_X86 dep_mbool ' Save configuration into NVRAM on Compaq servers' CONFIG_HOTPLUG_PCI_COMPAQ_NVRAM $CONFIG_HOTPLUG_PCI_COMPAQ if [ "$CONFIG_X86_IO_APIC" = "y" ]; then dep_tristate ' IBM PCI Hotplug driver' CONFIG_HOTPLUG_PCI_IBM $CONFIG_HOTPLUG_PCI $CONFIG_X86_IO_APIC $CONFIG_X86 fi -dep_tristate ' ACPI PCI Hotplug driver' CONFIG_HOTPLUG_PCI_ACPI $CONFIG_ACPI $CONFIG_HOTPLUG_PCI - +dep_tristate ' IBM Thinkpad (20H2999) Docking driver (VERY EXPERIMENTAL) ' CONFIG_HOTPLUG_PCI_H2999 $CONFIG_HOTPLUG_PCI $CONFIG_X86 endmenu diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/hotplug/Makefile linux.20pre5-ac2/drivers/hotplug/Makefile --- linux.20pre5/drivers/hotplug/Makefile 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/hotplug/Makefile 2002-08-18 15:41:12.000000000 +0100 @@ -12,6 +12,7 @@ obj-$(CONFIG_HOTPLUG_PCI_COMPAQ) += cpqphp.o obj-$(CONFIG_HOTPLUG_PCI_IBM) += ibmphp.o obj-$(CONFIG_HOTPLUG_PCI_ACPI) += acpiphp.o +obj-$(CONFIG_HOTPLUG_PCI_H2999) += tp600.o pci_hotplug-objs := pci_hotplug_core.o \ pci_hotplug_util.o diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/hotplug/tp600.c linux.20pre5-ac2/drivers/hotplug/tp600.c --- linux.20pre5/drivers/hotplug/tp600.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/hotplug/tp600.c 2002-08-19 01:34:39.000000000 +0100 @@ -0,0 +1,542 @@ +/* + * Drivers for the IBM 20H2999 found in the IBM thinkpad series + * machines. + * + * This driver was done without documentation from IBM (despite the + * best efforts of some sane IBM employees to obtain it). For that + * reason we only support warm not hot undocking at the moment. + * + * Known bugs: + * Sometimes we hang with an IRQ storm. I don't know what + * deals with the IRQ disables yet + * Sometimes busmastering (and maybe IRQs) don't come back + * + * Yet to do: + * ISA is not yet handled + * Instead of saving/restoring pci devices we should + * re-enumerate that subtree so you can change devices + * (That also deals with stale save problems) + * We need to do a proper warm save/restore interface + * + * Usage: + * Load module + * Pray + * + * Stuff we know: + * Undock sets 0x07 to 0x2A, rewriting it sets it back to 0x02 + * + * Docking status is controlled by officially undefined bits + * in the secondary bus status register 0x1E + * + * The bits we know about are: + * bit 15: PCI parity (sometimes asserted on undock) + * bit 14: PCI serr (specced, sometimes asserted on undock) + * bit 13: Set if dock absent ?? + * bit 12: Sometimes set on undock + * + * bits 12,14,15 are cleared by writing 1 bits + * bit 13 clears only if the dock is now present (sometimes ?) + * + * Undock changes 0xEE/EF to 0xX0Y0. Seems not to be rewritable + * Writing will set 0xEE low bits + * Undock changes 0xF0->FF apparently randomly + * 0xF0->0xFF are not writable + * + * Writing 0xE0->EF to 0 + * changes 0x07 from 0x02 to 0x06 + * changes 0x1F from 0x22 to 0x26 + * changes 0xE0->0xEF indicating writable bits + * E0 01010111 + * E1 11111111 + * E2 11111111 + * E3 00001111 + * E4 11111000 + * E5 11111000 + * E6 11110111 + * E7 11100000 + * E8 00111111 + * E9 11111111 + * EA 11111111 + * EB 11111111 + * EC 11110000 + * ED 11111111 + * EE 11110000 + * EF 11111111 + * + * Clearing shows + * E0 00000000 + * E1 00000000 + * E2 00000000 + * E3 00000000 + * E4 00000000 + * E5 00000000 + * E6 11110000 + * E7 11100000 + * E8 00000000 (e8.l clears 0x1F bit 1 it seems and 0x07 bit 1) + * E9 00000000 + * EA 00000000 + * EB 00000000 + * EC 00000000 + * ED 00000000 + * EE 00000000 + * EF 00000000 + * + */ + +#include +#include +#include +#include +#include +#include +#include + +#include "pci_hotplug.h" +#include "tp600.h" + +static struct h2999_dev *testdev; + +/** + * pci_save_slot - save slot PCI data + * @slot: slot to save + * + * Save the slot data from a PCI device + */ + +static void pci_save_slot(struct h2999_slot *s) +{ + int i, n; + + for(i=0;i<8;i++) + { + struct pci_dev *p = pci_find_slot(s->dev->hotplug_bus, PCI_DEVFN(s->slotid, i)); + s->pci[i] = p; + if(p) + { + for(n = 0; n < 64; n++) + pci_read_config_dword(p, n * 4, &s->save[i][n]); +// printk("Saved %02X:%02X.%X\n", +// s->dev->hotplug_bus, s->slotid, i); + } + } +} + +static void pci_restore_slot(struct h2999_slot *s) +{ + int i,n; + + for(i = 0 ; i < 8; i++) + { + if(s->pci[i]) + { + pci_set_power_state(s->pci[i], 0); + + for(n = 0; n < 54; n++) + if(n!=1) + pci_write_config_dword(s->pci[i], n * 4, s->save[i][n]); + pci_write_config_dword(s->pci[i], 4, s->save[i][1]); +// printk("Restored %02X:%02X.%X\n", +// s->dev->hotplug_bus, s->slotid, i); + } + } +} + +/** + * slot_enable - enable H2999 slot + * @slot: slot to enable + * + * Enable a slot. Its not actually clear what this means with + * a hot dock. We can certainly 'discover' the PCI device in the + * slot when asked. + */ + +static int slot_enable(struct hotplug_slot *slot) +{ + struct h2999_slot *s = slot->private; + int i; + pci_restore_slot(s); + for(i=0; i < 8; i++) + { + if(s->pci[i] && (s->drivermap&(1<pci[i]); + } + return 0; +} + +/** + * slot_disable - disable H2999 slot + * @slot: slot to disable + * + * Disable a slot. Its not actually clear what to do here. We could + * report the device as having been removed when we are told to do + * this. + */ + +static int slot_disable(struct hotplug_slot *slot) +{ + struct h2999_slot *s = slot->private; + struct pci_dev *pdev; + int i; + + for(i = 0; i < 8; i++) + { + pdev = s->pci[i]; + /* Hack for now */ + if (pdev && pdev->driver) { + if (!pdev->driver->remove) + return -EBUSY; + } + } + + s->drivermap = 0; + + for(i = 0; i < 8; i++) + { + pdev = s->pci[i]; + if(pdev) + { + if(pdev->driver) + { + s->drivermap|=(1<driver->remove(pdev); + pdev->driver = NULL; + } + } + } + return 0; +} + +/** + * set_attention_status - set attention callback + * @slot: slot to set + * @value: on/off + * + * Called when the hotplug layer wants to set the attention status of + * the hotplug slot. The H2999 doesn't have an attention control (at + * least not that we know of). So we ignore this. + */ + +static int set_attention_status(struct hotplug_slot *slot, u8 value) +{ + return 0; +} + +/** + * hardware_test - test hardware callback + * @slot: slot to test + * value: test to run + * + * The H2999 does not support any hardware tests that we know of. + */ + +static int hardware_test(struct hotplug_slot *slot, u32 value) +{ + return 0; +} + +/** + * get_power_status - power query callback + * @slot; slot to query + * @value: returned state + * + * Called when the hotplug layer wants to ask us if the slot is + * powered. We work on the basis that all slots are powered when + * the unit is docked. This seems to be correct but I've not actually + * rammed a voltmeter into the slots to see if they are cleverer than + * that. + */ + +static int get_power_status(struct hotplug_slot *slot, u8 *value) +{ + struct h2999_slot *s = slot->private; + + /* Slots are all powered when docked */ + if(s->dev->docked > 0) + *value = 1; + else + *value = 0; + return 0; +} + +/** + * get_adapter_status - card presence query + * @slot: slot to query + * @value: returned state + * + * If we are not docked, we know the "slot" is empty. If we are + * docked its a bit more complicated. + */ + +static int get_adapter_status(struct hotplug_slot *slot, u8 *value) +{ + struct h2999_slot *s = slot->private; + + *value = 0; + + if(s->dev->docked) + *value = 1; + return 0; +} + +static struct hotplug_slot_ops h2999_ops = { + THIS_MODULE, + slot_enable, + slot_disable, + set_attention_status, + hardware_test, + get_power_status, + NULL, + NULL, + get_adapter_status +}; + +/** + * h2999_is_docked - check if docked + * @dev: h2999 device + * + * Check if we are currently docked. The method we use at the moment + * relies on poking around behind the bridge. There is no doubt a + * correct way to do this. Maybe one day IBM will be decide to + * actually provide documentation + */ + +static int h2999_is_docked(struct h2999_dev *dev) +{ + struct pci_dev *pdev = pci_find_slot(dev->hotplug_bus, PCI_DEVFN(0,0)); + u32 status; + + if(pdev == NULL) + return 0; /* Shouldnt happen - must be undocked */ + + if(pci_read_config_dword(pdev, PCI_VENDOR_ID, &status)) + return 0; /* Config read failed - its missing */ + + if(status == 0xFFFFFFFFUL) /* Failed */ + return 0; + + /* Must be docked */ + return 1; +} +/** + * h2999_reconfigure_dock - redock event handler + * @dev: h2999 device + * + * A redocking event has occurred. There may also have been an undock + * before hand. If so then the unconfigure routine is called first. + */ + +static void h2999_reconfigure_dock(struct h2999_dev *dev) +{ + int docked, i; + + docked = h2999_is_docked(dev); + + if(docked ^ dev->docked) + { + printk("h2999: Now %sdocked.\n", + docked?"":"un"); + if(docked) + { + /* We should do the re-enumeration of the bus here + The current save/restore is a test hack */ + for(i=0; i < H2999_SLOTS; i++) + { + if(dev->slots[i].hotplug_slot.private != &dev->slots[i]) + BUG(); + slot_enable(&dev->slots[i].hotplug_slot); + } + } + else + { + for(i=0; i < H2999_SLOTS; i++) + { + if(slot_disable(&dev->slots[i].hotplug_slot)) + printk(KERN_ERR "h2999: someone undocked while devices were in use, how rude!\n"); + } + } + dev->docked = docked; + } + /* Clear bits */ + pci_write_config_byte(dev->pdev, 0x1f, 0xf0); +} + +/* + * h2999_attach - attach an H2999 bridge + * @pdev: PCI device + * @unused: unused + * + * Called when the PCI layer discovers an H2999 docking bridge is + * present in the system. We scan the bridge to obtain its current + * status and register it with the hot plug layer + */ + +static int __devinit h2999_attach(struct pci_dev *pdev, const struct pci_device_id *unused) +{ + /* PCI core found a new H2999 */ + struct h2999_dev *dev; + u8 bus; + int i; + + dev = kmalloc(sizeof(*dev), GFP_KERNEL); + if(dev == NULL) + goto nomem; + + memset(dev, 0, sizeof(*dev)); + + dev->pdev = pdev; + + pci_read_config_byte(pdev, PCI_SECONDARY_BUS, &bus); + dev->hotplug_bus = bus; + + /* Requires hotplug_bus and pdev are set */ + + dev->docked = h2999_is_docked(dev); + + printk(KERN_INFO "Found IBM 20H2999. Status is %sdocked, docking bus is %d.\n", + dev->docked?"":"un", dev->hotplug_bus); + + /* + * Allow for 8 devices. On the TP600 at least we have + * 0-3 as the onboard devices, and 4-7 as the slots. + * To add more fun there is an ISA bridge which we + * don't really handle yet. + */ + + for(i = 0; i < H2999_SLOTS; i++) + { + struct h2999_slot *s = &dev->slots[i]; + int ret; + + s->hotplug_slot.info = &s->hotplug_info; + s->hotplug_slot.private = s; + s->slotid = i; + s->dev = dev; + s->live = 1; + s->hotplug_slot.ops = &h2999_ops; + s->hotplug_slot.name = s->name; + s->hotplug_info.power_status = dev->docked; + /* FIXME - should probe here + In truth the hp_register ought to call thse as needed! */ + s->hotplug_info.adapter_status = 0; + s->pdev = pci_find_slot(dev->hotplug_bus, PCI_DEVFN(i, 0)); + snprintf(s->name, SLOT_NAME_SIZE, "Dock%d.%d", dev->hotplug_bus, i); + pci_save_slot(s); + ret = pci_hp_register(&s->hotplug_slot); + if(ret) + { + printk(KERN_ERR "pci_hp_register failed for slot %d with error %d\n", i, ret); + s->live = 0; + } + } + pci_set_drvdata(pdev, dev); + + testdev = dev; + return 0; +nomem: + printk(KERN_ERR "h2999_attach: out of memory.\n"); + return -ENOMEM; +} + +/** + * h2999_cleanup - free H2999 memory resources + * @dev: h2999 device + * + * Unregister and free up all of our slots + */ + +static int __devinit h2999_cleanup(struct h2999_dev *dev) +{ + struct h2999_slot *s; + int slot; + + for(slot = 0; slot < H2999_SLOTS; slot++) + { + s = &dev->slots[slot]; + if(s->live) + pci_hp_deregister(&s->hotplug_slot); + } + kfree(dev); +} + +/** + * h2999_detach - an H2999 controller vanished + * @dev: device that vanished + * + * Called when the PCI layer sees the bridge unplugged. At the moment + * this doesn't happen and since its currently unclear what to do + * in the hot plug layer if it does this may be a good thing 8) + */ + +static void __devinit h2999_detach(struct pci_dev *pdev) +{ + struct h2999_dev *dev = pci_get_drvdata(pdev); + h2999_cleanup(dev); +} + + +static struct pci_device_id h2999_id_tbl[] __devinitdata = { + { PCI_VENDOR_ID_IBM, 0x0095, PCI_ANY_ID, PCI_ANY_ID, }, + { 0, } +}; + +MODULE_DEVICE_TABLE(pci, h2999_id_tbl); + +static struct pci_driver h2999_driver = { + name: "h2999", + id_table: h2999_id_tbl, + probe: h2999_attach, + remove: __devexit_p(h2999_detach) + /* FIXME - PM functions */ +}; + +/* + * Test harness + */ + +static struct completion thread_done; + +static int h2999_thread(void *unused) +{ + lock_kernel(); + while(testdev != NULL) + { + set_current_state(TASK_INTERRUPTIBLE); + if(signal_pending(current)) + break; + schedule_timeout(HZ); + h2999_reconfigure_dock(testdev); + } + unlock_kernel(); + complete_and_exit(&thread_done, 0); +} + +static int __init h2999_init_module(void) +{ + int rc; + printk(KERN_INFO "IBM 20H2999 PCI docking bridge driver v0.01\n"); + + init_completion(&thread_done); + + rc = pci_module_init(&h2999_driver); + if (rc == 0) + { + if( kernel_thread(h2999_thread, NULL, CLONE_SIGHAND) >= 0) + return 0; + } + complete(&thread_done); + return rc; +} + +static void __exit h2999_cleanup_module(void) +{ + pci_unregister_driver(&h2999_driver); + wait_for_completion(&thread_done); +} + +module_init(h2999_init_module); +module_exit(h2999_cleanup_module); + +MODULE_AUTHOR("Alan Cox"); +MODULE_DESCRIPTION("IBM 20H2999 Docking Bridge Driver"); +MODULE_LICENSE("GPL"); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/hotplug/tp600.h linux.20pre5-ac2/drivers/hotplug/tp600.h --- linux.20pre5/drivers/hotplug/tp600.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/hotplug/tp600.h 2002-08-19 01:34:17.000000000 +0100 @@ -0,0 +1,29 @@ +#define SLOT_NAME_SIZE 12 + +struct h2999_slot +{ + int slotid; + + struct hotplug_slot hotplug_slot; + struct hotplug_slot_info hotplug_info; + char name[SLOT_NAME_SIZE]; + + struct h2999_dev *dev; + struct pci_dev *pdev; + int live; + + struct pci_dev *pci[8]; + u32 save[8][64]; + u8 drivermap; +}; + +#define H2999_SLOTS 8 + +struct h2999_dev +{ + int docked; + int hotplug_bus; + struct pci_dev *pdev; + + struct h2999_slot slots[H2999_SLOTS]; +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/aec62xx.c linux.20pre5-ac2/drivers/ide/aec62xx.c --- linux.20pre5/drivers/ide/aec62xx.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/aec62xx.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,582 +0,0 @@ -/* - * linux/drivers/ide/aec62xx.c Version 0.09 June. 9, 2000 - * - * Copyright (C) 1999-2000 Andre Hedrick (andre@linux-ide.org) - * May be copied or modified under the terms of the GNU General Public License - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "ide_modes.h" - -#define DISPLAY_AEC62XX_TIMINGS - -#ifndef HIGH_4 -#define HIGH_4(H) ((H)=(H>>4)) -#endif -#ifndef LOW_4 -#define LOW_4(L) ((L)=(L-((L>>4)<<4))) -#endif -#ifndef SPLIT_BYTE -#define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4))) -#endif -#ifndef MAKE_WORD -#define MAKE_WORD(W,HB,LB) ((W)=((HB<<8)+LB)) -#endif - - -#if defined(DISPLAY_AEC62XX_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static int aec62xx_get_info(char *, char **, off_t, int); -extern int (*aec62xx_display_info)(char *, char **, off_t, int); /* ide-proc.c */ -extern char *ide_media_verbose(ide_drive_t *); -static struct pci_dev *bmide_dev; - -static int aec62xx_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - - u32 bibma = pci_resource_start(bmide_dev, 4); - u8 c0 = 0, c1 = 0; - u8 art = 0, uart = 0; - - switch(bmide_dev->device) { - case PCI_DEVICE_ID_ARTOP_ATP850UF: - p += sprintf(p, "\n AEC6210 Chipset.\n"); - break; - case PCI_DEVICE_ID_ARTOP_ATP860: - p += sprintf(p, "\n AEC6260 No Bios Chipset.\n"); - break; - case PCI_DEVICE_ID_ARTOP_ATP860R: - p += sprintf(p, "\n AEC6260 Chipset.\n"); - break; - default: - p += sprintf(p, "\n AEC62?? Chipset.\n"); - break; - } - - /* - * at that point bibma+0x2 et bibma+0xa are byte registers - * to investigate: - */ - c0 = inb_p((unsigned short)bibma + 0x02); - c1 = inb_p((unsigned short)bibma + 0x0a); - - p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n"); - (void) pci_read_config_byte(bmide_dev, 0x4a, &art); - p += sprintf(p, " %sabled %sabled\n", - (art&0x02)?" en":"dis",(art&0x04)?" en":"dis"); - p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n"); - p += sprintf(p, "DMA enabled: %s %s %s %s\n", - (c0&0x20)?"yes":"no ",(c0&0x40)?"yes":"no ",(c1&0x20)?"yes":"no ",(c1&0x40)?"yes":"no "); - - switch(bmide_dev->device) { - case PCI_DEVICE_ID_ARTOP_ATP850UF: - (void) pci_read_config_byte(bmide_dev, 0x54, &art); - p += sprintf(p, "DMA Mode: %s(%s) %s(%s) %s(%s) %s(%s)\n", - (c0&0x20)?((art&0x03)?"UDMA":" DMA"):" PIO", - (art&0x02)?"2":(art&0x01)?"1":"0", - (c0&0x40)?((art&0x0c)?"UDMA":" DMA"):" PIO", - (art&0x08)?"2":(art&0x04)?"1":"0", - (c1&0x20)?((art&0x30)?"UDMA":" DMA"):" PIO", - (art&0x20)?"2":(art&0x10)?"1":"0", - (c1&0x40)?((art&0xc0)?"UDMA":" DMA"):" PIO", - (art&0x80)?"2":(art&0x40)?"1":"0"); - (void) pci_read_config_byte(bmide_dev, 0x40, &art); - p += sprintf(p, "Active: 0x%02x", art); - (void) pci_read_config_byte(bmide_dev, 0x42, &art); - p += sprintf(p, " 0x%02x", art); - (void) pci_read_config_byte(bmide_dev, 0x44, &art); - p += sprintf(p, " 0x%02x", art); - (void) pci_read_config_byte(bmide_dev, 0x46, &art); - p += sprintf(p, " 0x%02x\n", art); - (void) pci_read_config_byte(bmide_dev, 0x41, &art); - p += sprintf(p, "Recovery: 0x%02x", art); - (void) pci_read_config_byte(bmide_dev, 0x43, &art); - p += sprintf(p, " 0x%02x", art); - (void) pci_read_config_byte(bmide_dev, 0x45, &art); - p += sprintf(p, " 0x%02x", art); - (void) pci_read_config_byte(bmide_dev, 0x47, &art); - p += sprintf(p, " 0x%02x\n", art); - break; - case PCI_DEVICE_ID_ARTOP_ATP860: - case PCI_DEVICE_ID_ARTOP_ATP860R: - (void) pci_read_config_byte(bmide_dev, 0x44, &art); - p += sprintf(p, "DMA Mode: %s(%s) %s(%s)", - (c0&0x20)?((art&0x07)?"UDMA":" DMA"):" PIO", - ((art&0x06)==0x06)?"4":((art&0x05)==0x05)?"4":((art&0x04)==0x04)?"3":((art&0x03)==0x03)?"2":((art&0x02)==0x02)?"1":((art&0x01)==0x01)?"0":"?", - (c0&0x40)?((art&0x70)?"UDMA":" DMA"):" PIO", - ((art&0x60)==0x60)?"4":((art&0x50)==0x50)?"4":((art&0x40)==0x40)?"3":((art&0x30)==0x30)?"2":((art&0x20)==0x20)?"1":((art&0x10)==0x10)?"0":"?"); - (void) pci_read_config_byte(bmide_dev, 0x45, &art); - p += sprintf(p, " %s(%s) %s(%s)\n", - (c1&0x20)?((art&0x07)?"UDMA":" DMA"):" PIO", - ((art&0x06)==0x06)?"4":((art&0x05)==0x05)?"4":((art&0x04)==0x04)?"3":((art&0x03)==0x03)?"2":((art&0x02)==0x02)?"1":((art&0x01)==0x01)?"0":"?", - (c1&0x40)?((art&0x70)?"UDMA":" DMA"):" PIO", - ((art&0x60)==0x60)?"4":((art&0x50)==0x50)?"4":((art&0x40)==0x40)?"3":((art&0x30)==0x30)?"2":((art&0x20)==0x20)?"1":((art&0x10)==0x10)?"0":"?"); - (void) pci_read_config_byte(bmide_dev, 0x40, &art); - p += sprintf(p, "Active: 0x%02x", HIGH_4(art)); - (void) pci_read_config_byte(bmide_dev, 0x41, &art); - p += sprintf(p, " 0x%02x", HIGH_4(art)); - (void) pci_read_config_byte(bmide_dev, 0x42, &art); - p += sprintf(p, " 0x%02x", HIGH_4(art)); - (void) pci_read_config_byte(bmide_dev, 0x43, &art); - p += sprintf(p, " 0x%02x\n", HIGH_4(art)); - (void) pci_read_config_byte(bmide_dev, 0x40, &art); - p += sprintf(p, "Recovery: 0x%02x", LOW_4(art)); - (void) pci_read_config_byte(bmide_dev, 0x41, &art); - p += sprintf(p, " 0x%02x", LOW_4(art)); - (void) pci_read_config_byte(bmide_dev, 0x42, &art); - p += sprintf(p, " 0x%02x", LOW_4(art)); - (void) pci_read_config_byte(bmide_dev, 0x43, &art); - p += sprintf(p, " 0x%02x\n", LOW_4(art)); - (void) pci_read_config_byte(bmide_dev, 0x49, &uart); - p += sprintf(p, "reg49h = 0x%02x ", uart); - (void) pci_read_config_byte(bmide_dev, 0x4a, &uart); - p += sprintf(p, "reg4ah = 0x%02x\n", uart); - break; - default: - break; - } - - return p-buffer;/* => must be less than 4k! */ -} -#endif /* defined(DISPLAY_AEC62xx_TIMINGS) && defined(CONFIG_PROC_FS) */ - -byte aec62xx_proc = 0; - -#ifdef CONFIG_AEC62XX_TUNING - -struct chipset_bus_clock_list_entry { - byte xfer_speed; - - byte chipset_settings_34; - byte ultra_settings_34; - - byte chipset_settings_33; - byte ultra_settings_33; -}; - -struct chipset_bus_clock_list_entry aec62xx_base [] = { -#ifdef CONFIG_BLK_DEV_IDEDMA - { XFER_UDMA_4, 0x41, 0x04, 0x31, 0x05 }, - { XFER_UDMA_3, 0x41, 0x03, 0x31, 0x04 }, - { XFER_UDMA_2, 0x41, 0x02, 0x31, 0x03 }, - { XFER_UDMA_1, 0x41, 0x01, 0x31, 0x02 }, - { XFER_UDMA_0, 0x41, 0x01, 0x31, 0x01 }, - - { XFER_MW_DMA_2, 0x41, 0x00, 0x31, 0x00 }, - { XFER_MW_DMA_1, 0x42, 0x00, 0x31, 0x00 }, - { XFER_MW_DMA_0, 0x7a, 0x00, 0x0a, 0x00 }, -#endif /* CONFIG_BLK_DEV_IDEDMA */ - { XFER_PIO_4, 0x41, 0x00, 0x31, 0x00 }, - { XFER_PIO_3, 0x43, 0x00, 0x33, 0x00 }, - { XFER_PIO_2, 0x78, 0x00, 0x08, 0x00 }, - { XFER_PIO_1, 0x7a, 0x00, 0x0a, 0x00 }, - { XFER_PIO_0, 0x70, 0x00, 0x00, 0x00 }, - { 0, 0x00, 0x00, 0x00, 0x00 } -}; - -extern char *ide_xfer_verbose (byte xfer_rate); - -/* - * TO DO: active tuning and correction of cards without a bios. - */ - -static byte pci_bus_clock_list (byte speed, struct chipset_bus_clock_list_entry * chipset_table) -{ - int bus_speed = system_bus_clock(); - - for ( ; chipset_table->xfer_speed ; chipset_table++) - if (chipset_table->xfer_speed == speed) { - return ((byte) ((bus_speed <= 33) ? chipset_table->chipset_settings_33 : chipset_table->chipset_settings_34)); - } - return 0x00; -} - -static byte pci_bus_clock_list_ultra (byte speed, struct chipset_bus_clock_list_entry * chipset_table) -{ - int bus_speed = system_bus_clock(); - - for ( ; chipset_table->xfer_speed ; chipset_table++) - if (chipset_table->xfer_speed == speed) { - return ((byte) ((bus_speed <= 33) ? chipset_table->ultra_settings_33 : chipset_table->ultra_settings_34)); - } - return 0x00; -} - -static int aec6210_tune_chipset (ide_drive_t *drive, byte speed) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - int err = 0; - unsigned short d_conf = 0x0000; - byte ultra = 0x00; - byte ultra_conf = 0x00; - byte tmp0 = 0x00; - byte tmp1 = 0x00; - byte tmp2 = 0x00; - unsigned long flags; - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - - pci_read_config_word(dev, 0x40|(2*drive->dn), &d_conf); - tmp0 = pci_bus_clock_list(speed, aec62xx_base); - SPLIT_BYTE(tmp0,tmp1,tmp2); - MAKE_WORD(d_conf,tmp1,tmp2); - pci_write_config_word(dev, 0x40|(2*drive->dn), d_conf); - - tmp1 = 0x00; - tmp2 = 0x00; - pci_read_config_byte(dev, 0x54, &ultra); - tmp1 = ((0x00 << (2*drive->dn)) | (ultra & ~(3 << (2*drive->dn)))); - ultra_conf = pci_bus_clock_list_ultra(speed, aec62xx_base); - tmp2 = ((ultra_conf << (2*drive->dn)) | (tmp1 & ~(3 << (2*drive->dn)))); - pci_write_config_byte(dev, 0x54, tmp2); - - __restore_flags(flags); /* local CPU only */ - - err = ide_config_drive_speed(drive, speed); - return(err); -} - -static int aec6260_tune_chipset (ide_drive_t *drive, byte speed) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - byte unit = (drive->select.b.unit & 0x01); - byte ultra_pci = hwif->channel ? 0x45 : 0x44; - int err = 0; - byte drive_conf = 0x00; - byte ultra_conf = 0x00; - byte ultra = 0x00; - byte tmp1 = 0x00; - byte tmp2 = 0x00; - unsigned long flags; - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - - pci_read_config_byte(dev, 0x40|drive->dn, &drive_conf); - drive_conf = pci_bus_clock_list(speed, aec62xx_base); - pci_write_config_byte(dev, 0x40|drive->dn, drive_conf); - - pci_read_config_byte(dev, ultra_pci, &ultra); - tmp1 = ((0x00 << (4*unit)) | (ultra & ~(7 << (4*unit)))); - ultra_conf = pci_bus_clock_list_ultra(speed, aec62xx_base); - tmp2 = ((ultra_conf << (4*unit)) | (tmp1 & ~(7 << (4*unit)))); - pci_write_config_byte(dev, ultra_pci, tmp2); - __restore_flags(flags); /* local CPU only */ - - if (!drive->init_speed) - drive->init_speed = speed; - - err = ide_config_drive_speed(drive, speed); - drive->current_speed = speed; - return(err); -} - - -static int aec62xx_tune_chipset (ide_drive_t *drive, byte speed) -{ - if (HWIF(drive)->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) { - return ((int) aec6210_tune_chipset(drive, speed)); - } else { - return ((int) aec6260_tune_chipset(drive, speed)); - } -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -static int config_aec6210_chipset_for_dma (ide_drive_t *drive, byte ultra) -{ - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - byte unit = (drive->select.b.unit & 0x01); - unsigned long dma_base = hwif->dma_base; - byte speed = -1; - - if (drive->media != ide_disk) - return ((int) ide_dma_off_quietly); - - if (((id->dma_ultra & 0x0010) || - (id->dma_ultra & 0x0008) || - (id->dma_ultra & 0x0004)) && (ultra)) { - speed = XFER_UDMA_2; - } else if ((id->dma_ultra & 0x0002) && (ultra)) { - speed = XFER_UDMA_1; - } else if ((id->dma_ultra & 0x0001) && (ultra)) { - speed = XFER_UDMA_0; - } else if (id->dma_mword & 0x0004) { - speed = XFER_MW_DMA_2; - } else if (id->dma_mword & 0x0002) { - speed = XFER_MW_DMA_1; - } else if (id->dma_mword & 0x0001) { - speed = XFER_MW_DMA_0; - } else if (id->dma_1word & 0x0004) { - speed = XFER_SW_DMA_2; - } else if (id->dma_1word & 0x0002) { - speed = XFER_SW_DMA_1; - } else if (id->dma_1word & 0x0001) { - speed = XFER_SW_DMA_0; - } else { - return ((int) ide_dma_off_quietly); - } - - outb(inb(dma_base+2) & ~(1<<(5+unit)), dma_base+2); - (void) aec6210_tune_chipset(drive, speed); - - return ((int) ((id->dma_ultra >> 11) & 3) ? ide_dma_off : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ((id->dma_1word >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); -} - -static int config_aec6260_chipset_for_dma (ide_drive_t *drive, byte ultra) -{ - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - byte unit = (drive->select.b.unit & 0x01); - unsigned long dma_base = hwif->dma_base; - byte speed = -1; - byte ultra66 = eighty_ninty_three(drive); - - if (drive->media != ide_disk) - return ((int) ide_dma_off_quietly); - - if ((id->dma_ultra & 0x0010) && (ultra) && (ultra66)) { - speed = XFER_UDMA_4; - } else if ((id->dma_ultra & 0x0008) && (ultra) && (ultra66)) { - speed = XFER_UDMA_3; - } else if ((id->dma_ultra & 0x0004) && (ultra)) { - speed = XFER_UDMA_2; - } else if ((id->dma_ultra & 0x0002) && (ultra)) { - speed = XFER_UDMA_1; - } else if ((id->dma_ultra & 0x0001) && (ultra)) { - speed = XFER_UDMA_0; - } else if (id->dma_mword & 0x0004) { - speed = XFER_MW_DMA_2; - } else if (id->dma_mword & 0x0002) { - speed = XFER_MW_DMA_1; - } else if (id->dma_mword & 0x0001) { - speed = XFER_MW_DMA_0; - } else if (id->dma_1word & 0x0004) { - speed = XFER_SW_DMA_2; - } else if (id->dma_1word & 0x0002) { - speed = XFER_SW_DMA_1; - } else if (id->dma_1word & 0x0001) { - speed = XFER_SW_DMA_0; - } else { - return ((int) ide_dma_off_quietly); - } - - outb(inb(dma_base+2) & ~(1<<(5+unit)), dma_base+2); - (void) aec6260_tune_chipset(drive, speed); - - return ((int) ((id->dma_ultra >> 11) & 3) ? ide_dma_on : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ((id->dma_1word >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); -} - -static int config_chipset_for_dma (ide_drive_t *drive, byte ultra) -{ - switch(HWIF(drive)->pci_dev->device) { - case PCI_DEVICE_ID_ARTOP_ATP850UF: - return config_aec6210_chipset_for_dma(drive, ultra); - case PCI_DEVICE_ID_ARTOP_ATP860: - case PCI_DEVICE_ID_ARTOP_ATP860R: - return config_aec6260_chipset_for_dma(drive, ultra); - default: - return ((int) ide_dma_off_quietly); - } -} - -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -static void aec62xx_tune_drive (ide_drive_t *drive, byte pio) -{ - byte speed; - byte new_pio = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL); - - switch(pio) { - case 5: speed = new_pio; break; - case 4: speed = XFER_PIO_4; break; - case 3: speed = XFER_PIO_3; break; - case 2: speed = XFER_PIO_2; break; - case 1: speed = XFER_PIO_1; break; - default: speed = XFER_PIO_0; break; - } - - switch(HWIF(drive)->pci_dev->device) { - case PCI_DEVICE_ID_ARTOP_ATP850UF: - (void) aec6210_tune_chipset(drive, speed); - case PCI_DEVICE_ID_ARTOP_ATP860: - case PCI_DEVICE_ID_ARTOP_ATP860R: - (void) aec6260_tune_chipset(drive, speed); - default: - break; - } -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -static int config_drive_xfer_rate (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - ide_dma_action_t dma_func = ide_dma_on; - - if (id && (id->capability & 1) && HWIF(drive)->autodma) { - /* Consult the list of known "bad" drives */ - if (ide_dmaproc(ide_dma_bad_drive, drive)) { - dma_func = ide_dma_off; - goto fast_ata_pio; - } - dma_func = ide_dma_off_quietly; - if (id->field_valid & 4) { - if (id->dma_ultra & 0x001F) { - /* Force if Capable UltraDMA */ - dma_func = config_chipset_for_dma(drive, 1); - if ((id->field_valid & 2) && - (dma_func != ide_dma_on)) - goto try_dma_modes; - } - } else if (id->field_valid & 2) { -try_dma_modes: - if ((id->dma_mword & 0x0007) || - (id->dma_1word & 0x0007)) { - /* Force if Capable regular DMA modes */ - dma_func = config_chipset_for_dma(drive, 0); - if (dma_func != ide_dma_on) - goto no_dma_set; - } - } else if (ide_dmaproc(ide_dma_good_drive, drive)) { - if (id->eide_dma_time > 150) { - goto no_dma_set; - } - /* Consult the list of known "good" drives */ - dma_func = config_chipset_for_dma(drive, 0); - if (dma_func != ide_dma_on) - goto no_dma_set; - } else { - goto fast_ata_pio; - } - } else if ((id->capability & 8) || (id->field_valid & 2)) { -fast_ata_pio: - dma_func = ide_dma_off_quietly; -no_dma_set: - aec62xx_tune_drive(drive, 5); - } - return HWIF(drive)->dmaproc(dma_func, drive); -} - -/* - * aec62xx_dmaproc() initiates/aborts (U)DMA read/write operations on a drive. - */ -int aec62xx_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - switch (func) { - case ide_dma_check: - return config_drive_xfer_rate(drive); - case ide_dma_lostirq: - case ide_dma_timeout: - switch(HWIF(drive)->pci_dev->device) { - case PCI_DEVICE_ID_ARTOP_ATP860: - case PCI_DEVICE_ID_ARTOP_ATP860R: -// { -// int i = 0; -// byte reg49h = 0; -// pci_read_config_byte(HWIF(drive)->pci_dev, 0x49, ®49h); -// for (i=0;i<256;i++) -// pci_write_config_byte(HWIF(drive)->pci_dev, 0x49, reg49h|0x10); -// pci_write_config_byte(HWIF(drive)->pci_dev, 0x49, reg49h & ~0x10); -// } -// return 0; - default: - break; - } - default: - break; - } - return ide_dmaproc(func, drive); /* use standard DMA stuff */ -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ -#endif /* CONFIG_AEC62XX_TUNING */ - -unsigned int __init pci_init_aec62xx (struct pci_dev *dev, const char *name) -{ - if (dev->resource[PCI_ROM_RESOURCE].start) { - pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); - printk("%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start); - } - -#if defined(DISPLAY_AEC62XX_TIMINGS) && defined(CONFIG_PROC_FS) - if (!aec62xx_proc) { - aec62xx_proc = 1; - bmide_dev = dev; - aec62xx_display_info = &aec62xx_get_info; - } -#endif /* DISPLAY_AEC62XX_TIMINGS && CONFIG_PROC_FS */ - - return dev->irq; -} - -unsigned int __init ata66_aec62xx (ide_hwif_t *hwif) -{ - byte mask = hwif->channel ? 0x02 : 0x01; - byte ata66 = 0; - - pci_read_config_byte(hwif->pci_dev, 0x49, &ata66); - return ((ata66 & mask) ? 0 : 1); -} - -void __init ide_init_aec62xx (ide_hwif_t *hwif) -{ -#ifdef CONFIG_AEC62XX_TUNING - hwif->tuneproc = &aec62xx_tune_drive; - hwif->speedproc = &aec62xx_tune_chipset; -#ifdef CONFIG_BLK_DEV_IDEDMA - if (hwif->dma_base) - hwif->dmaproc = &aec62xx_dmaproc; -#else /* !CONFIG_BLK_DEV_IDEDMA */ - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; -#endif /* CONFIG_BLK_DEV_IDEDMA */ -#endif /* CONFIG_AEC62XX_TUNING */ -} - -void __init ide_dmacapable_aec62xx (ide_hwif_t *hwif, unsigned long dmabase) -{ -#ifdef CONFIG_AEC62XX_TUNING - unsigned long flags; - byte reg54h = 0; - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - - pci_read_config_byte(hwif->pci_dev, 0x54, ®54h); - pci_write_config_byte(hwif->pci_dev, 0x54, reg54h & ~(hwif->channel ? 0xF0 : 0x0F)); - - __restore_flags(flags); /* local CPU only */ -#endif /* CONFIG_AEC62XX_TUNING */ - ide_setup_dma(hwif, dmabase, 8); -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ali14xx.c linux.20pre5-ac2/drivers/ide/ali14xx.c --- linux.20pre5/drivers/ide/ali14xx.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ali14xx.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,226 +0,0 @@ -/* - * linux/drivers/ide/ali14xx.c Version 0.03 Feb 09, 1996 - * - * Copyright (C) 1996 Linus Torvalds & author (see below) - */ - -/* - * ALI M14xx chipset EIDE controller - * - * Works for ALI M1439/1443/1445/1487/1489 chipsets. - * - * Adapted from code developed by derekn@vw.ece.cmu.edu. -ml - * Derek's notes follow: - * - * I think the code should be pretty understandable, - * but I'll be happy to (try to) answer questions. - * - * The critical part is in the setupDrive function. The initRegisters - * function doesn't seem to be necessary, but the DOS driver does it, so - * I threw it in. - * - * I've only tested this on my system, which only has one disk. I posted - * it to comp.sys.linux.hardware, so maybe some other people will try it - * out. - * - * Derek Noonburg (derekn@ece.cmu.edu) - * 95-sep-26 - * - * Update 96-jul-13: - * - * I've since upgraded to two disks and a CD-ROM, with no trouble, and - * I've also heard from several others who have used it successfully. - * This driver appears to work with both the 1443/1445 and the 1487/1489 - * chipsets. I've added support for PIO mode 4 for the 1487. This - * seems to work just fine on the 1443 also, although I'm not sure it's - * advertised as supporting mode 4. (I've been running a WDC AC21200 in - * mode 4 for a while now with no trouble.) -Derek - */ - -#undef REALLY_SLOW_IO /* most systems can safely undef this */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "ide_modes.h" - -/* port addresses for auto-detection */ -#define ALI_NUM_PORTS 4 -static int ports[ALI_NUM_PORTS] __initdata = {0x074, 0x0f4, 0x034, 0x0e4}; - -/* register initialization data */ -typedef struct { byte reg, data; } RegInitializer; - -static RegInitializer initData[] __initdata = { - {0x01, 0x0f}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, - {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x2b}, {0x0a, 0x0f}, - {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, - {0x29, 0x00}, {0x2a, 0x00}, {0x2f, 0x00}, {0x2b, 0x00}, - {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x30, 0x00}, - {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0xff}, - {0x35, 0x03}, {0x00, 0x00} -}; - -#define ALI_MAX_PIO 4 - -/* timing parameter registers for each drive */ -static struct { byte reg1, reg2, reg3, reg4; } regTab[4] = { - {0x03, 0x26, 0x04, 0x27}, /* drive 0 */ - {0x05, 0x28, 0x06, 0x29}, /* drive 1 */ - {0x2b, 0x30, 0x2c, 0x31}, /* drive 2 */ - {0x2d, 0x32, 0x2e, 0x33}, /* drive 3 */ -}; - -static int basePort; /* base port address */ -static int regPort; /* port for register number */ -static int dataPort; /* port for register data */ -static byte regOn; /* output to base port to access registers */ -static byte regOff; /* output to base port to close registers */ - -/*------------------------------------------------------------------------*/ - -/* - * Read a controller register. - */ -static inline byte inReg (byte reg) -{ - outb_p(reg, regPort); - return inb(dataPort); -} - -/* - * Write a controller register. - */ -static void outReg (byte data, byte reg) -{ - outb_p(reg, regPort); - outb_p(data, dataPort); -} - -/* - * Set PIO mode for the specified drive. - * This function computes timing parameters - * and sets controller registers accordingly. - */ -static void ali14xx_tune_drive (ide_drive_t *drive, byte pio) -{ - int driveNum; - int time1, time2; - byte param1, param2, param3, param4; - unsigned long flags; - ide_pio_data_t d; - int bus_speed = system_bus_clock(); - - pio = ide_get_best_pio_mode(drive, pio, ALI_MAX_PIO, &d); - - /* calculate timing, according to PIO mode */ - time1 = d.cycle_time; - time2 = ide_pio_timings[pio].active_time; - param3 = param1 = (time2 * bus_speed + 999) / 1000; - param4 = param2 = (time1 * bus_speed + 999) / 1000 - param1; - if (pio < 3) { - param3 += 8; - param4 += 8; - } - printk("%s: PIO mode%d, t1=%dns, t2=%dns, cycles = %d+%d, %d+%d\n", - drive->name, pio, time1, time2, param1, param2, param3, param4); - - /* stuff timing parameters into controller registers */ - driveNum = (HWIF(drive)->index << 1) + drive->select.b.unit; - save_flags(flags); /* all CPUs */ - cli(); /* all CPUs */ - outb_p(regOn, basePort); - outReg(param1, regTab[driveNum].reg1); - outReg(param2, regTab[driveNum].reg2); - outReg(param3, regTab[driveNum].reg3); - outReg(param4, regTab[driveNum].reg4); - outb_p(regOff, basePort); - restore_flags(flags); /* all CPUs */ -} - -/* - * Auto-detect the IDE controller port. - */ -static int __init findPort (void) -{ - int i; - byte t; - unsigned long flags; - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - for (i = 0; i < ALI_NUM_PORTS; ++i) { - basePort = ports[i]; - regOff = inb(basePort); - for (regOn = 0x30; regOn <= 0x33; ++regOn) { - outb_p(regOn, basePort); - if (inb(basePort) == regOn) { - regPort = basePort + 4; - dataPort = basePort + 8; - t = inReg(0) & 0xf0; - outb_p(regOff, basePort); - __restore_flags(flags); /* local CPU only */ - if (t != 0x50) - return 0; - return 1; /* success */ - } - } - outb_p(regOff, basePort); - } - __restore_flags(flags); /* local CPU only */ - return 0; -} - -/* - * Initialize controller registers with default values. - */ -static int __init initRegisters (void) { - RegInitializer *p; - byte t; - unsigned long flags; - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - outb_p(regOn, basePort); - for (p = initData; p->reg != 0; ++p) - outReg(p->data, p->reg); - outb_p(0x01, regPort); - t = inb(regPort) & 0x01; - outb_p(regOff, basePort); - __restore_flags(flags); /* local CPU only */ - return t; -} - -void __init init_ali14xx (void) -{ - /* auto-detect IDE controller port */ - if (!findPort()) { - printk("\nali14xx: not found"); - return; - } - - printk("\nali14xx: base= 0x%03x, regOn = 0x%02x", basePort, regOn); - ide_hwifs[0].chipset = ide_ali14xx; - ide_hwifs[1].chipset = ide_ali14xx; - ide_hwifs[0].tuneproc = &ali14xx_tune_drive; - ide_hwifs[1].tuneproc = &ali14xx_tune_drive; - ide_hwifs[0].mate = &ide_hwifs[1]; - ide_hwifs[1].mate = &ide_hwifs[0]; - ide_hwifs[1].channel = 1; - - /* initialize controller registers */ - if (!initRegisters()) { - printk("\nali14xx: Chip initialization failed"); - return; - } -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/alim15x3.c linux.20pre5-ac2/drivers/ide/alim15x3.c --- linux.20pre5/drivers/ide/alim15x3.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/alim15x3.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,705 +0,0 @@ -/* - * linux/drivers/ide/alim15x3.c Version 0.10 Jun. 9, 2000 - * - * Copyright (C) 1998-2000 Michel Aubry, Maintainer - * Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer - * Copyright (C) 1999-2000 CJ, cjtsai@ali.com.tw, Maintainer - * - * Copyright (C) 1998-2000 Andre Hedrick (andre@linux-ide.org) - * May be copied or modified under the terms of the GNU General Public License - * - * (U)DMA capable version of ali 1533/1543(C), 1535(D) - * - ********************************************************************** - * 9/7/99 --Parts from the above author are included and need to be - * converted into standard interface, once I finish the thought. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "ide_modes.h" - -#define DISPLAY_ALI_TIMINGS - -#if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static int ali_get_info(char *buffer, char **addr, off_t offset, int count); -extern int (*ali_display_info)(char *, char **, off_t, int); /* ide-proc.c */ -static struct pci_dev *bmide_dev; - -char *fifo[4] = { - "FIFO Off", - "FIFO On ", - "DMA mode", - "PIO mode" }; - -char *udmaT[8] = { - "1.5T", - " 2T", - "2.5T", - " 3T", - "3.5T", - " 4T", - " 6T", - " 8T" -}; - -char *channel_status[8] = { - "OK ", - "busy ", - "DRQ ", - "DRQ busy ", - "error ", - "error busy ", - "error DRQ ", - "error DRQ busy" -}; - -static int ali_get_info (char *buffer, char **addr, off_t offset, int count) -{ - byte reg53h, reg5xh, reg5yh, reg5xh1, reg5yh1; - unsigned int bibma; - byte c0, c1; - byte rev, tmp; - char *p = buffer; - char *q; - - /* fetch rev. */ - pci_read_config_byte(bmide_dev, 0x08, &rev); - if (rev >= 0xc1) /* M1543C or newer */ - udmaT[7] = " ???"; - else - fifo[3] = " ??? "; - - /* first fetch bibma: */ - pci_read_config_dword(bmide_dev, 0x20, &bibma); - bibma = (bibma & 0xfff0) ; - /* - * at that point bibma+0x2 et bibma+0xa are byte - * registers to investigate: - */ - c0 = inb((unsigned short)bibma + 0x02); - c1 = inb((unsigned short)bibma + 0x0a); - - p += sprintf(p, - "\n Ali M15x3 Chipset.\n"); - p += sprintf(p, - " ------------------\n"); - pci_read_config_byte(bmide_dev, 0x78, ®53h); - p += sprintf(p, "PCI Clock: %d.\n", reg53h); - - pci_read_config_byte(bmide_dev, 0x53, ®53h); - p += sprintf(p, - "CD_ROM FIFO:%s, CD_ROM DMA:%s\n", - (reg53h & 0x02) ? "Yes" : "No ", - (reg53h & 0x01) ? "Yes" : "No " ); - pci_read_config_byte(bmide_dev, 0x74, ®53h); - p += sprintf(p, - "FIFO Status: contains %d Words, runs%s%s\n\n", - (reg53h & 0x3f), - (reg53h & 0x40) ? " OVERWR" : "", - (reg53h & 0x80) ? " OVERRD." : "." ); - - p += sprintf(p, - "-------------------primary channel-------------------secondary channel---------\n\n"); - - pci_read_config_byte(bmide_dev, 0x09, ®53h); - p += sprintf(p, - "channel status: %s %s\n", - (reg53h & 0x20) ? "On " : "Off", - (reg53h & 0x10) ? "On " : "Off" ); - - p += sprintf(p, - "both channels togth: %s %s\n", - (c0&0x80) ? "No " : "Yes", - (c1&0x80) ? "No " : "Yes" ); - - pci_read_config_byte(bmide_dev, 0x76, ®53h); - p += sprintf(p, - "Channel state: %s %s\n", - channel_status[reg53h & 0x07], - channel_status[(reg53h & 0x70) >> 4] ); - - pci_read_config_byte(bmide_dev, 0x58, ®5xh); - pci_read_config_byte(bmide_dev, 0x5c, ®5yh); - p += sprintf(p, - "Add. Setup Timing: %dT %dT\n", - (reg5xh & 0x07) ? (reg5xh & 0x07) : 8, - (reg5yh & 0x07) ? (reg5yh & 0x07) : 8 ); - - pci_read_config_byte(bmide_dev, 0x59, ®5xh); - pci_read_config_byte(bmide_dev, 0x5d, ®5yh); - p += sprintf(p, - "Command Act. Count: %dT %dT\n" - "Command Rec. Count: %dT %dT\n\n", - (reg5xh & 0x70) ? ((reg5xh & 0x70) >> 4) : 8, - (reg5yh & 0x70) ? ((reg5yh & 0x70) >> 4) : 8, - (reg5xh & 0x0f) ? (reg5xh & 0x0f) : 16, - (reg5yh & 0x0f) ? (reg5yh & 0x0f) : 16 ); - - p += sprintf(p, - "----------------drive0-----------drive1------------drive0-----------drive1------\n\n"); - p += sprintf(p, - "DMA enabled: %s %s %s %s\n", - (c0&0x20) ? "Yes" : "No ", - (c0&0x40) ? "Yes" : "No ", - (c1&0x20) ? "Yes" : "No ", - (c1&0x40) ? "Yes" : "No " ); - - pci_read_config_byte(bmide_dev, 0x54, ®5xh); - pci_read_config_byte(bmide_dev, 0x55, ®5yh); - q = "FIFO threshold: %2d Words %2d Words %2d Words %2d Words\n"; - if (rev < 0xc1) { - if ((rev == 0x20) && (pci_read_config_byte(bmide_dev, 0x4f, &tmp), (tmp &= 0x20))) { - p += sprintf(p, q, 8, 8, 8, 8); - } else { - p += sprintf(p, q, - (reg5xh & 0x03) + 12, - ((reg5xh & 0x30)>>4) + 12, - (reg5yh & 0x03) + 12, - ((reg5yh & 0x30)>>4) + 12 ); - } - } else { - int t1 = (tmp = (reg5xh & 0x03)) ? (tmp << 3) : 4; - int t2 = (tmp = ((reg5xh & 0x30)>>4)) ? (tmp << 3) : 4; - int t3 = (tmp = (reg5yh & 0x03)) ? (tmp << 3) : 4; - int t4 = (tmp = ((reg5yh & 0x30)>>4)) ? (tmp << 3) : 4; - p += sprintf(p, q, t1, t2, t3, t4); - } - -#if 0 - p += sprintf(p, - "FIFO threshold: %2d Words %2d Words %2d Words %2d Words\n", - (reg5xh & 0x03) + 12, - ((reg5xh & 0x30)>>4) + 12, - (reg5yh & 0x03) + 12, - ((reg5yh & 0x30)>>4) + 12 ); -#endif - - p += sprintf(p, - "FIFO mode: %s %s %s %s\n", - fifo[((reg5xh & 0x0c) >> 2)], - fifo[((reg5xh & 0xc0) >> 6)], - fifo[((reg5yh & 0x0c) >> 2)], - fifo[((reg5yh & 0xc0) >> 6)] ); - - pci_read_config_byte(bmide_dev, 0x5a, ®5xh); - pci_read_config_byte(bmide_dev, 0x5b, ®5xh1); - pci_read_config_byte(bmide_dev, 0x5e, ®5yh); - pci_read_config_byte(bmide_dev, 0x5f, ®5yh1); - - p += sprintf(p,/* - "------------------drive0-----------drive1------------drive0-----------drive1------\n")*/ - "Dt RW act. Cnt %2dT %2dT %2dT %2dT\n" - "Dt RW rec. Cnt %2dT %2dT %2dT %2dT\n\n", - (reg5xh & 0x70) ? ((reg5xh & 0x70) >> 4) : 8, - (reg5xh1 & 0x70) ? ((reg5xh1 & 0x70) >> 4) : 8, - (reg5yh & 0x70) ? ((reg5yh & 0x70) >> 4) : 8, - (reg5yh1 & 0x70) ? ((reg5yh1 & 0x70) >> 4) : 8, - (reg5xh & 0x0f) ? (reg5xh & 0x0f) : 16, - (reg5xh1 & 0x0f) ? (reg5xh1 & 0x0f) : 16, - (reg5yh & 0x0f) ? (reg5yh & 0x0f) : 16, - (reg5yh1 & 0x0f) ? (reg5yh1 & 0x0f) : 16 ); - - p += sprintf(p, - "-----------------------------------UDMA Timings--------------------------------\n\n"); - - pci_read_config_byte(bmide_dev, 0x56, ®5xh); - pci_read_config_byte(bmide_dev, 0x57, ®5yh); - p += sprintf(p, - "UDMA: %s %s %s %s\n" - "UDMA timings: %s %s %s %s\n\n", - (reg5xh & 0x08) ? "OK" : "No", - (reg5xh & 0x80) ? "OK" : "No", - (reg5yh & 0x08) ? "OK" : "No", - (reg5yh & 0x80) ? "OK" : "No", - udmaT[(reg5xh & 0x07)], - udmaT[(reg5xh & 0x70) >> 4], - udmaT[reg5yh & 0x07], - udmaT[(reg5yh & 0x70) >> 4] ); - - return p-buffer; /* => must be less than 4k! */ -} -#endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */ - -static byte m5229_revision; -static byte chip_is_1543c_e; - -byte ali_proc = 0; -static struct pci_dev *isa_dev; - -static void ali15x3_tune_drive (ide_drive_t *drive, byte pio) -{ - ide_pio_data_t d; - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - int s_time, a_time, c_time; - byte s_clc, a_clc, r_clc; - unsigned long flags; - int bus_speed = system_bus_clock(); - int port = hwif->index ? 0x5c : 0x58; - int portFIFO = hwif->channel ? 0x55 : 0x54; - byte cd_dma_fifo = 0; - - pio = ide_get_best_pio_mode(drive, pio, 5, &d); - s_time = ide_pio_timings[pio].setup_time; - a_time = ide_pio_timings[pio].active_time; - if ((s_clc = (s_time * bus_speed + 999) / 1000) >= 8) - s_clc = 0; - if ((a_clc = (a_time * bus_speed + 999) / 1000) >= 8) - a_clc = 0; - c_time = ide_pio_timings[pio].cycle_time; - -#if 0 - if ((r_clc = ((c_time - s_time - a_time) * bus_speed + 999) / 1000) >= 16) - r_clc = 0; -#endif - - if (!(r_clc = (c_time * bus_speed + 999) / 1000 - a_clc - s_clc)) { - r_clc = 1; - } else { - if (r_clc >= 16) - r_clc = 0; - } - __save_flags(flags); - __cli(); - - /* - * PIO mode => ATA FIFO on, ATAPI FIFO off - */ - pci_read_config_byte(dev, portFIFO, &cd_dma_fifo); - if (drive->media==ide_disk) { - if (hwif->index) { - pci_write_config_byte(dev, portFIFO, (cd_dma_fifo & 0x0F) | 0x50); - } else { - pci_write_config_byte(dev, portFIFO, (cd_dma_fifo & 0xF0) | 0x05); - } - } else { - if (hwif->index) { - pci_write_config_byte(dev, portFIFO, cd_dma_fifo & 0x0F); - } else { - pci_write_config_byte(dev, portFIFO, cd_dma_fifo & 0xF0); - } - } - - pci_write_config_byte(dev, port, s_clc); - pci_write_config_byte(dev, port+drive->select.b.unit+2, (a_clc << 4) | r_clc); - __restore_flags(flags); - - /* - * setup active rec - * { 70, 165, 365 }, PIO Mode 0 - * { 50, 125, 208 }, PIO Mode 1 - * { 30, 100, 110 }, PIO Mode 2 - * { 30, 80, 70 }, PIO Mode 3 with IORDY - * { 25, 70, 25 }, PIO Mode 4 with IORDY ns - * { 20, 50, 30 } PIO Mode 5 with IORDY (nonstandard) - */ - -} - -static int ali15x3_tune_chipset (ide_drive_t *drive, byte speed) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - byte unit = (drive->select.b.unit & 0x01); - byte tmpbyte = 0x00; - int m5229_udma = hwif->channel? 0x57 : 0x56; - int err = 0; - - if (speed < XFER_UDMA_0) { - byte ultra_enable = (unit) ? 0x7f : 0xf7; - /* - * clear "ultra enable" bit - */ - pci_read_config_byte(dev, m5229_udma, &tmpbyte); - tmpbyte &= ultra_enable; - pci_write_config_byte(dev, m5229_udma, tmpbyte); - } - - err = ide_config_drive_speed(drive, speed); - -#ifdef CONFIG_BLK_DEV_IDEDMA - if (speed >= XFER_SW_DMA_0) { - unsigned long dma_base = hwif->dma_base; - - outb(inb(dma_base+2)|(1<<(5+unit)), dma_base+2); - } - - if (speed >= XFER_UDMA_0) { - pci_read_config_byte(dev, m5229_udma, &tmpbyte); - tmpbyte &= (0x0f << ((1-unit) << 2)); - /* - * enable ultra dma and set timing - */ - tmpbyte |= ((0x08 | ((4-speed)&0x07)) << (unit << 2)); - pci_write_config_byte(dev, m5229_udma, tmpbyte); - if (speed >= XFER_UDMA_3) { - pci_read_config_byte(dev, 0x4b, &tmpbyte); - tmpbyte |= 1; - pci_write_config_byte(dev, 0x4b, tmpbyte); - } - } -#endif /* CONFIG_BLK_DEV_IDEDMA */ - - drive->current_speed = speed; - - return (err); -} - -static void config_chipset_for_pio (ide_drive_t *drive) -{ - ali15x3_tune_drive(drive, 5); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -static int config_chipset_for_dma (ide_drive_t *drive, byte ultra33) -{ - struct hd_driveid *id = drive->id; - byte speed = 0x00; - byte ultra66 = eighty_ninty_three(drive); - byte ultra100 = (m5229_revision>=0xc4) ? 1 : 0; - int rval; - - if ((id->dma_ultra & 0x0020) && (ultra100) && (ultra66) && (ultra33)) { - speed = XFER_UDMA_5; - } else if ((id->dma_ultra & 0x0010) && (ultra66) && (ultra33)) { - speed = XFER_UDMA_4; - } else if ((id->dma_ultra & 0x0008) && (ultra66) && (ultra33)) { - speed = XFER_UDMA_3; - } else if ((id->dma_ultra & 0x0004) && (ultra33)) { - speed = XFER_UDMA_2; - } else if ((id->dma_ultra & 0x0002) && (ultra33)) { - speed = XFER_UDMA_1; - } else if ((id->dma_ultra & 0x0001) && (ultra33)) { - speed = XFER_UDMA_0; - } else if (id->dma_mword & 0x0004) { - speed = XFER_MW_DMA_2; - } else if (id->dma_mword & 0x0002) { - speed = XFER_MW_DMA_1; - } else if (id->dma_mword & 0x0001) { - speed = XFER_MW_DMA_0; - } else if (id->dma_1word & 0x0004) { - speed = XFER_SW_DMA_2; - } else if (id->dma_1word & 0x0002) { - speed = XFER_SW_DMA_1; - } else if (id->dma_1word & 0x0001) { - speed = XFER_SW_DMA_0; - } else { - return ((int) ide_dma_off_quietly); - } - - (void) ali15x3_tune_chipset(drive, speed); - - if (!drive->init_speed) - drive->init_speed = speed; - - rval = (int)( ((id->dma_ultra >> 11) & 3) ? ide_dma_on : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ((id->dma_1word >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); - - return rval; -} - -static byte ali15x3_can_ultra (ide_drive_t *drive) -{ -#ifndef CONFIG_WDC_ALI15X3 - struct hd_driveid *id = drive->id; -#endif /* CONFIG_WDC_ALI15X3 */ - - if (m5229_revision <= 0x20) { - return 0; - } else if ((m5229_revision < 0xC2) && -#ifndef CONFIG_WDC_ALI15X3 - ((chip_is_1543c_e && strstr(id->model, "WDC ")) || - (drive->media!=ide_disk))) { -#else /* CONFIG_WDC_ALI15X3 */ - (drive->media!=ide_disk)) { -#endif /* CONFIG_WDC_ALI15X3 */ - return 0; - } else { - return 1; - } -} - -static int ali15x3_config_drive_for_dma(ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - ide_dma_action_t dma_func = ide_dma_on; - byte can_ultra_dma = ali15x3_can_ultra(drive); - - if ((m5229_revision<=0x20) && (drive->media!=ide_disk)) - return hwif->dmaproc(ide_dma_off_quietly, drive); - - if ((id != NULL) && ((id->capability & 1) != 0) && hwif->autodma) { - /* Consult the list of known "bad" drives */ - if (ide_dmaproc(ide_dma_bad_drive, drive)) { - dma_func = ide_dma_off; - goto fast_ata_pio; - } - dma_func = ide_dma_off_quietly; - if ((id->field_valid & 4) && (m5229_revision >= 0xC2)) { - if (id->dma_ultra & 0x003F) { - /* Force if Capable UltraDMA */ - dma_func = config_chipset_for_dma(drive, can_ultra_dma); - if ((id->field_valid & 2) && - (dma_func != ide_dma_on)) - goto try_dma_modes; - } - } else if (id->field_valid & 2) { -try_dma_modes: - if ((id->dma_mword & 0x0007) || - (id->dma_1word & 0x0007)) { - /* Force if Capable regular DMA modes */ - dma_func = config_chipset_for_dma(drive, can_ultra_dma); - if (dma_func != ide_dma_on) - goto no_dma_set; - } - } else if (ide_dmaproc(ide_dma_good_drive, drive)) { - if (id->eide_dma_time > 150) { - goto no_dma_set; - } - /* Consult the list of known "good" drives */ - dma_func = config_chipset_for_dma(drive, can_ultra_dma); - if (dma_func != ide_dma_on) - goto no_dma_set; - } else { - goto fast_ata_pio; - } - } else if ((id->capability & 8) || (id->field_valid & 2)) { -fast_ata_pio: - dma_func = ide_dma_off_quietly; -no_dma_set: - config_chipset_for_pio(drive); - } - return hwif->dmaproc(dma_func, drive); -} - -static int ali15x3_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - switch(func) { - case ide_dma_check: - return ali15x3_config_drive_for_dma(drive); - case ide_dma_write: - if ((m5229_revision < 0xC2) && (drive->media != ide_disk)) - return 1; /* try PIO instead of DMA */ - break; - default: - break; - } - return ide_dmaproc(func, drive); /* use standard DMA stuff */ -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -unsigned int __init pci_init_ali15x3 (struct pci_dev *dev, const char *name) -{ - unsigned long fixdma_base = pci_resource_start(dev, 4); - - pci_read_config_byte(dev, PCI_REVISION_ID, &m5229_revision); - - isa_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); - - if (!fixdma_base) { - /* - * - */ - } else { - /* - * enable DMA capable bit, and "not" simplex only - */ - outb(inb(fixdma_base+2) & 0x60, fixdma_base+2); - - if (inb(fixdma_base+2) & 0x80) - printk("%s: simplex device: DMA will fail!!\n", name); - } - -#if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) - if (!ali_proc) { - ali_proc = 1; - bmide_dev = dev; - ali_display_info = &ali_get_info; - } -#endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */ - - return 0; -} - -/* - * This checks if the controller and the cable are capable - * of UDMA66 transfers. It doesn't check the drives. - * But see note 2 below! - */ -unsigned int __init ata66_ali15x3 (ide_hwif_t *hwif) -{ - struct pci_dev *dev = hwif->pci_dev; - unsigned int ata66 = 0; - byte cable_80_pin[2] = { 0, 0 }; - - unsigned long flags; - byte tmpbyte; - - __save_flags(flags); - __cli(); - - if (m5229_revision >= 0xC2) { - /* - * 1543C-B?, 1535, 1535D, 1553 - * Note 1: not all "motherboard" support this detection - * Note 2: if no udma 66 device, the detection may "error". - * but in this case, we will not set the device to - * ultra 66, the detection result is not important - */ - - /* - * enable "Cable Detection", m5229, 0x4b, bit3 - */ - pci_read_config_byte(dev, 0x4b, &tmpbyte); - pci_write_config_byte(dev, 0x4b, tmpbyte | 0x08); - - /* - * set south-bridge's enable bit, m1533, 0x79 - */ - pci_read_config_byte(isa_dev, 0x79, &tmpbyte); - if (m5229_revision == 0xC2) { - /* - * 1543C-B0 (m1533, 0x79, bit 2) - */ - pci_write_config_byte(isa_dev, 0x79, tmpbyte | 0x04); - } else if (m5229_revision >= 0xC3) { - /* - * 1553/1535 (m1533, 0x79, bit 1) - */ - pci_write_config_byte(isa_dev, 0x79, tmpbyte | 0x02); - } - /* - * Ultra66 cable detection (from Host View) - * m5229, 0x4a, bit0: primary, bit1: secondary 80 pin - */ - pci_read_config_byte(dev, 0x4a, &tmpbyte); - /* - * 0x4a, bit0 is 0 => primary channel - * has 80-pin (from host view) - */ - if (!(tmpbyte & 0x01)) cable_80_pin[0] = 1; - /* - * 0x4a, bit1 is 0 => secondary channel - * has 80-pin (from host view) - */ - if (!(tmpbyte & 0x02)) cable_80_pin[1] = 1; - /* - * Allow ata66 if cable of current channel has 80 pins - */ - ata66 = (hwif->channel)?cable_80_pin[1]:cable_80_pin[0]; - } else { - /* - * revision 0x20 (1543-E, 1543-F) - * revision 0xC0, 0xC1 (1543C-C, 1543C-D, 1543C-E) - * clear CD-ROM DMA write bit, m5229, 0x4b, bit 7 - */ - pci_read_config_byte(dev, 0x4b, &tmpbyte); - /* - * clear bit 7 - */ - pci_write_config_byte(dev, 0x4b, tmpbyte & 0x7F); - /* - * check m1533, 0x5e, bit 1~4 == 1001 => & 00011110 = 00010010 - */ - pci_read_config_byte(isa_dev, 0x5e, &tmpbyte); - chip_is_1543c_e = ((tmpbyte & 0x1e) == 0x12) ? 1: 0; - } - - /* - * CD_ROM DMA on (m5229, 0x53, bit0) - * Enable this bit even if we want to use PIO - * PIO FIFO off (m5229, 0x53, bit1) - * The hardware will use 0x54h and 0x55h to control PIO FIFO - */ - pci_read_config_byte(dev, 0x53, &tmpbyte); - tmpbyte = (tmpbyte & (~0x02)) | 0x01; - - pci_write_config_byte(dev, 0x53, tmpbyte); - - __restore_flags(flags); - - return(ata66); -} - -void __init ide_init_ali15x3 (ide_hwif_t *hwif) -{ -#ifndef CONFIG_SPARC64 - byte ideic, inmir; - byte irq_routing_table[] = { -1, 9, 3, 10, 4, 5, 7, 6, - 1, 11, 0, 12, 0, 14, 0, 15 }; - - hwif->irq = hwif->channel ? 15 : 14; - - if (isa_dev) { - /* - * read IDE interface control - */ - pci_read_config_byte(isa_dev, 0x58, &ideic); - - /* bit0, bit1 */ - ideic = ideic & 0x03; - - /* get IRQ for IDE Controller */ - if ((hwif->channel && ideic == 0x03) || (!hwif->channel && !ideic)) { - /* - * get SIRQ1 routing table - */ - pci_read_config_byte(isa_dev, 0x44, &inmir); - inmir = inmir & 0x0f; - hwif->irq = irq_routing_table[inmir]; - } else if (hwif->channel && !(ideic & 0x01)) { - /* - * get SIRQ2 routing table - */ - pci_read_config_byte(isa_dev, 0x75, &inmir); - inmir = inmir & 0x0f; - hwif->irq = irq_routing_table[inmir]; - } - } -#endif /* CONFIG_SPARC64 */ - - hwif->tuneproc = &ali15x3_tune_drive; - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - hwif->speedproc = &ali15x3_tune_chipset; - -#ifdef CONFIG_BLK_DEV_IDEDMA - if ((hwif->dma_base) && (m5229_revision >= 0x20)) { - /* - * M1543C or newer for DMAing - */ - hwif->dmaproc = &ali15x3_dmaproc; - hwif->autodma = 1; - } - - if (noautodma) - hwif->autodma = 0; -#else - hwif->autodma = 0; -#endif /* CONFIG_BLK_DEV_IDEDMA */ -} - -void __init ide_dmacapable_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase) -{ - if ((dmabase) && (m5229_revision < 0x20)) { - return; - } - ide_setup_dma(hwif, dmabase, 8); -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/amd74xx.c linux.20pre5-ac2/drivers/ide/amd74xx.c --- linux.20pre5/drivers/ide/amd74xx.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/amd74xx.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,513 +0,0 @@ -/* - * linux/drivers/ide/amd74xx.c Version 0.05 June 9, 2000 - * - * Copyright (C) 1999-2000 Andre Hedrick - * May be copied or modified under the terms of the GNU General Public License - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "ide_modes.h" - -#define DISPLAY_VIPER_TIMINGS - -#if defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static int amd74xx_get_info(char *, char **, off_t, int); -extern int (*amd74xx_display_info)(char *, char **, off_t, int); /* ide-proc.c */ -extern char *ide_media_verbose(ide_drive_t *); -static struct pci_dev *bmide_dev; - -static int amd74xx_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - u32 bibma = pci_resource_start(bmide_dev, 4); - u8 c0 = 0, c1 = 0; - - /* - * at that point bibma+0x2 et bibma+0xa are byte registers - * to investigate: - */ - c0 = inb_p((unsigned short)bibma + 0x02); - c1 = inb_p((unsigned short)bibma + 0x0a); - - p += sprintf(p, "\n AMD %04X VIPER Chipset.\n", bmide_dev->device); - p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n"); - p += sprintf(p, " %sabled %sabled\n", - (c0&0x80) ? "dis" : " en", - (c1&0x80) ? "dis" : " en"); - p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n"); - p += sprintf(p, "DMA enabled: %s %s %s %s\n", - (c0&0x20) ? "yes" : "no ", (c0&0x40) ? "yes" : "no ", - (c1&0x20) ? "yes" : "no ", (c1&0x40) ? "yes" : "no " ); - p += sprintf(p, "UDMA\n"); - p += sprintf(p, "DMA\n"); - p += sprintf(p, "PIO\n"); - - return p-buffer; /* => must be less than 4k! */ -} -#endif /* defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) */ - -byte amd74xx_proc = 0; - -extern char *ide_xfer_verbose (byte xfer_rate); - -static unsigned int amd74xx_swdma_check (struct pci_dev *dev) -{ - unsigned int class_rev; - - if ((dev->device == PCI_DEVICE_ID_AMD_VIPER_7411) || - (dev->device == PCI_DEVICE_ID_AMD_VIPER_7441)) - return 0; - - pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); - class_rev &= 0xff; - return ((int) (class_rev >= 7) ? 1 : 0); -} - -static int amd74xx_swdma_error(ide_drive_t *drive) -{ - printk("%s: single-word DMA not support (revision < C4)\n", drive->name); - return 0; -} - -/* - * Here is where all the hard work goes to program the chipset. - * - */ -static int amd74xx_tune_chipset (ide_drive_t *drive, byte speed) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - int err = 0; - byte unit = (drive->select.b.unit & 0x01); -#ifdef CONFIG_BLK_DEV_IDEDMA - unsigned long dma_base = hwif->dma_base; -#endif /* CONFIG_BLK_DEV_IDEDMA */ - byte drive_pci = 0x00; - byte drive_pci2 = 0x00; - byte ultra_timing = 0x00; - byte dma_pio_timing = 0x00; - byte pio_timing = 0x00; - - switch (drive->dn) { - case 0: drive_pci = 0x53; drive_pci2 = 0x4b; break; - case 1: drive_pci = 0x52; drive_pci2 = 0x4a; break; - case 2: drive_pci = 0x51; drive_pci2 = 0x49; break; - case 3: drive_pci = 0x50; drive_pci2 = 0x48; break; - default: - return -1; - } - - pci_read_config_byte(dev, drive_pci, &ultra_timing); - pci_read_config_byte(dev, drive_pci2, &dma_pio_timing); - pci_read_config_byte(dev, 0x4c, &pio_timing); - -#ifdef DEBUG - printk("%s:%d: Speed 0x%02x UDMA 0x%02x DMAPIO 0x%02x PIO 0x%02x\n", - drive->name, drive->dn, speed, ultra_timing, dma_pio_timing, pio_timing); -#endif - - ultra_timing &= ~0xC7; - dma_pio_timing &= ~0xFF; - pio_timing &= ~(0x03 << drive->dn); - -#ifdef DEBUG - printk("%s: UDMA 0x%02x DMAPIO 0x%02x PIO 0x%02x\n", - drive->name, ultra_timing, dma_pio_timing, pio_timing); -#endif - - switch(speed) { -#ifdef CONFIG_BLK_DEV_IDEDMA - case XFER_UDMA_7: - case XFER_UDMA_6: - speed = XFER_UDMA_5; - case XFER_UDMA_5: - ultra_timing |= 0x46; - dma_pio_timing |= 0x20; - break; - case XFER_UDMA_4: - ultra_timing |= 0x45; - dma_pio_timing |= 0x20; - break; - case XFER_UDMA_3: - ultra_timing |= 0x44; - dma_pio_timing |= 0x20; - break; - case XFER_UDMA_2: - ultra_timing |= 0x40; - dma_pio_timing |= 0x20; - break; - case XFER_UDMA_1: - ultra_timing |= 0x41; - dma_pio_timing |= 0x20; - break; - case XFER_UDMA_0: - ultra_timing |= 0x42; - dma_pio_timing |= 0x20; - break; - case XFER_MW_DMA_2: - dma_pio_timing |= 0x20; - break; - case XFER_MW_DMA_1: - dma_pio_timing |= 0x21; - break; - case XFER_MW_DMA_0: - dma_pio_timing |= 0x77; - break; - case XFER_SW_DMA_2: - if (!amd74xx_swdma_check(dev)) - return amd74xx_swdma_error(drive); - dma_pio_timing |= 0x42; - break; - case XFER_SW_DMA_1: - if (!amd74xx_swdma_check(dev)) - return amd74xx_swdma_error(drive); - dma_pio_timing |= 0x65; - break; - case XFER_SW_DMA_0: - if (!amd74xx_swdma_check(dev)) - return amd74xx_swdma_error(drive); - dma_pio_timing |= 0xA8; - break; -#endif /* CONFIG_BLK_DEV_IDEDMA */ - case XFER_PIO_4: - dma_pio_timing |= 0x20; - break; - case XFER_PIO_3: - dma_pio_timing |= 0x22; - break; - case XFER_PIO_2: - dma_pio_timing |= 0x42; - break; - case XFER_PIO_1: - dma_pio_timing |= 0x65; - break; - case XFER_PIO_0: - default: - dma_pio_timing |= 0xA8; - break; - } - - pio_timing |= (0x03 << drive->dn); - - if (!drive->init_speed) - drive->init_speed = speed; - -#ifdef CONFIG_BLK_DEV_IDEDMA - pci_write_config_byte(dev, drive_pci, ultra_timing); -#endif /* CONFIG_BLK_DEV_IDEDMA */ - pci_write_config_byte(dev, drive_pci2, dma_pio_timing); - pci_write_config_byte(dev, 0x4c, pio_timing); - -#ifdef DEBUG - printk("%s: UDMA 0x%02x DMAPIO 0x%02x PIO 0x%02x\n", - drive->name, ultra_timing, dma_pio_timing, pio_timing); -#endif - -#ifdef CONFIG_BLK_DEV_IDEDMA - if (speed > XFER_PIO_4) { - outb(inb(dma_base+2)|(1<<(5+unit)), dma_base+2); - } else { - outb(inb(dma_base+2) & ~(1<<(5+unit)), dma_base+2); - } -#endif /* CONFIG_BLK_DEV_IDEDMA */ - - err = ide_config_drive_speed(drive, speed); - drive->current_speed = speed; - return (err); -} - -static void config_chipset_for_pio (ide_drive_t *drive) -{ - unsigned short eide_pio_timing[6] = {960, 480, 240, 180, 120, 90}; - unsigned short xfer_pio = drive->id->eide_pio_modes; - byte timing, speed, pio; - - pio = ide_get_best_pio_mode(drive, 255, 5, NULL); - - if (xfer_pio> 4) - xfer_pio = 0; - - if (drive->id->eide_pio_iordy > 0) { - for (xfer_pio = 5; - xfer_pio>0 && - drive->id->eide_pio_iordy>eide_pio_timing[xfer_pio]; - xfer_pio--); - } else { - xfer_pio = (drive->id->eide_pio_modes & 4) ? 0x05 : - (drive->id->eide_pio_modes & 2) ? 0x04 : - (drive->id->eide_pio_modes & 1) ? 0x03 : - (drive->id->tPIO & 2) ? 0x02 : - (drive->id->tPIO & 1) ? 0x01 : xfer_pio; - } - - timing = (xfer_pio >= pio) ? xfer_pio : pio; - - switch(timing) { - case 4: speed = XFER_PIO_4;break; - case 3: speed = XFER_PIO_3;break; - case 2: speed = XFER_PIO_2;break; - case 1: speed = XFER_PIO_1;break; - default: - speed = (!drive->id->tPIO) ? XFER_PIO_0 : XFER_PIO_SLOW; - break; - } - (void) amd74xx_tune_chipset(drive, speed); - drive->current_speed = speed; -} - -static void amd74xx_tune_drive (ide_drive_t *drive, byte pio) -{ - byte speed; - switch(pio) { - case 4: speed = XFER_PIO_4;break; - case 3: speed = XFER_PIO_3;break; - case 2: speed = XFER_PIO_2;break; - case 1: speed = XFER_PIO_1;break; - default: speed = XFER_PIO_0;break; - } - (void) amd74xx_tune_chipset(drive, speed); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -/* - * This allows the configuration of ide_pci chipset registers - * for cards that learn about the drive's UDMA, DMA, PIO capabilities - * after the drive is reported by the OS. - */ -static int config_chipset_for_dma (ide_drive_t *drive) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - struct hd_driveid *id = drive->id; - byte udma_66 = eighty_ninty_three(drive); - byte udma_100 = ((dev->device==PCI_DEVICE_ID_AMD_VIPER_7411)|| - (dev->device==PCI_DEVICE_ID_AMD_VIPER_7441)) ? 1 : 0; - byte speed = 0x00; - int rval; - - if (udma_100) - udma_66 = eighty_ninty_three(drive); - - if ((id->dma_ultra & 0x0020) && (udma_66) && (udma_100)) { - speed = XFER_UDMA_5; - } else if ((id->dma_ultra & 0x0010) && (udma_66)) { - speed = XFER_UDMA_4; - } else if ((id->dma_ultra & 0x0008) && (udma_66)) { - speed = XFER_UDMA_3; - } else if (id->dma_ultra & 0x0004) { - speed = XFER_UDMA_2; - } else if (id->dma_ultra & 0x0002) { - speed = XFER_UDMA_1; - } else if (id->dma_ultra & 0x0001) { - speed = XFER_UDMA_0; - } else if (id->dma_mword & 0x0004) { - speed = XFER_MW_DMA_2; - } else if (id->dma_mword & 0x0002) { - speed = XFER_MW_DMA_1; - } else if (id->dma_mword & 0x0001) { - speed = XFER_MW_DMA_0; - } else { - return ((int) ide_dma_off_quietly); - } - - (void) amd74xx_tune_chipset(drive, speed); - - rval = (int)( ((id->dma_ultra >> 11) & 7) ? ide_dma_on : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); - - return rval; -} - -static int config_drive_xfer_rate (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - ide_dma_action_t dma_func = ide_dma_on; - - if (id && (id->capability & 1) && HWIF(drive)->autodma) { - /* Consult the list of known "bad" drives */ - if (ide_dmaproc(ide_dma_bad_drive, drive)) { - dma_func = ide_dma_off; - goto fast_ata_pio; - } - dma_func = ide_dma_off_quietly; - if (id->field_valid & 4) { - if (id->dma_ultra & 0x003F) { - /* Force if Capable UltraDMA */ - dma_func = config_chipset_for_dma(drive); - if ((id->field_valid & 2) && - (dma_func != ide_dma_on)) - goto try_dma_modes; - } - } else if (id->field_valid & 2) { -try_dma_modes: - if ((id->dma_mword & 0x0007) || - ((id->dma_1word & 0x007) && - (amd74xx_swdma_check(HWIF(drive)->pci_dev)))) { - /* Force if Capable regular DMA modes */ - dma_func = config_chipset_for_dma(drive); - if (dma_func != ide_dma_on) - goto no_dma_set; - } - - } else if (ide_dmaproc(ide_dma_good_drive, drive)) { - if (id->eide_dma_time > 150) { - goto no_dma_set; - } - /* Consult the list of known "good" drives */ - dma_func = config_chipset_for_dma(drive); - if (dma_func != ide_dma_on) - goto no_dma_set; - } else { - goto fast_ata_pio; - } - } else if ((id->capability & 8) || (id->field_valid & 2)) { -fast_ata_pio: - dma_func = ide_dma_off_quietly; -no_dma_set: - - config_chipset_for_pio(drive); - } - return HWIF(drive)->dmaproc(dma_func, drive); -} - -/* - * amd74xx_dmaproc() initiates/aborts (U)DMA read/write operations on a drive. - */ - -int amd74xx_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - switch (func) { - case ide_dma_check: - return config_drive_xfer_rate(drive); - default: - break; - } - return ide_dmaproc(func, drive); /* use standard DMA stuff */ -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -unsigned int __init pci_init_amd74xx (struct pci_dev *dev, const char *name) -{ - unsigned long fixdma_base = pci_resource_start(dev, 4); - -#ifdef CONFIG_BLK_DEV_IDEDMA - if (!amd74xx_swdma_check(dev)) - printk("%s: disabling single-word DMA support (revision < C4)\n", name); -#endif /* CONFIG_BLK_DEV_IDEDMA */ - - if (!fixdma_base) { - /* - * - */ - } else { - /* - * enable DMA capable bit, and "not" simplex only - */ - outb(inb(fixdma_base+2) & 0x60, fixdma_base+2); - - if (inb(fixdma_base+2) & 0x80) - printk("%s: simplex device: DMA will fail!!\n", name); - } -#if defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) - if (!amd74xx_proc) { - amd74xx_proc = 1; - bmide_dev = dev; - amd74xx_display_info = &amd74xx_get_info; - } -#endif /* DISPLAY_VIPER_TIMINGS && CONFIG_PROC_FS */ - - return 0; -} - -unsigned int __init ata66_amd74xx (ide_hwif_t *hwif) -{ - struct pci_dev *dev = hwif->pci_dev; - byte cable_80_pin[2] = { 0, 0 }; - byte ata66 = 0; - byte tmpbyte; - - /* - * Ultra66 cable detection (from Host View) - * 7411, 7441, 0x42, bit0: primary, bit2: secondary 80 pin - */ - pci_read_config_byte(dev, 0x42, &tmpbyte); - - /* - * 0x42, bit0 is 1 => primary channel - * has 80-pin (from host view) - */ - if (tmpbyte & 0x01) cable_80_pin[0] = 1; - - /* - * 0x42, bit2 is 1 => secondary channel - * has 80-pin (from host view) - */ - if (tmpbyte & 0x04) cable_80_pin[1] = 1; - - switch(dev->device) { - case PCI_DEVICE_ID_AMD_VIPER_7441: - case PCI_DEVICE_ID_AMD_VIPER_7411: - ata66 = (hwif->channel) ? - cable_80_pin[1] : - cable_80_pin[0]; - default: - break; - } -#ifdef CONFIG_AMD74XX_OVERRIDE - return(1); -#else - return (unsigned int) ata66; -#endif /* CONFIG_AMD74XX_OVERRIDE */ -} - -void __init ide_init_amd74xx (ide_hwif_t *hwif) -{ - hwif->tuneproc = &amd74xx_tune_drive; - hwif->speedproc = &amd74xx_tune_chipset; - -#ifndef CONFIG_BLK_DEV_IDEDMA - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - hwif->autodma = 0; - return; -#else - - if (hwif->dma_base) { - hwif->dmaproc = &amd74xx_dmaproc; - if (!noautodma) - hwif->autodma = 1; - } else { - hwif->autodma = 0; - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - } -#endif /* CONFIG_BLK_DEV_IDEDMA */ -} - -void __init ide_dmacapable_amd74xx (ide_hwif_t *hwif, unsigned long dmabase) -{ - ide_setup_dma(hwif, dmabase, 8); -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/arm/icside.c linux.20pre5-ac2/drivers/ide/arm/icside.c --- linux.20pre5/drivers/ide/arm/icside.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/arm/icside.c 2002-09-01 17:56:28.000000000 +0100 @@ -0,0 +1,875 @@ +/* + * linux/drivers/ide/icside.c + * + * Copyright (c) 1996,1997 Russell King. + * + * Changelog: + * 08-Jun-1996 RMK Created + * 12-Sep-1997 RMK Added interrupt enable/disable + * 17-Apr-1999 RMK Added support for V6 EASI + * 22-May-1999 RMK Added support for V6 DMA + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "ide-noise.h" + +/* + * FIXME: We want to drop the the MACRO CRAP! + * + * ec->iops->in{b/w/l} + * ec->iops->in{b/w/l}_p + * ec->iops->out{b/w/l} + * ec->iops->out{b/w/l}_p + * + * the new core supports clean MMIO calls and other goodies + */ + +/* + * Maximum number of interfaces per card + */ +#define MAX_IFS 2 + +#define ICS_IDENT_OFFSET 0x8a0 + +#define ICS_ARCIN_V5_INTRSTAT 0x000 +#define ICS_ARCIN_V5_INTROFFSET 0x001 +#define ICS_ARCIN_V5_IDEOFFSET 0xa00 +#define ICS_ARCIN_V5_IDEALTOFFSET 0xae0 +#define ICS_ARCIN_V5_IDESTEPPING 4 + +#define ICS_ARCIN_V6_IDEOFFSET_1 0x800 +#define ICS_ARCIN_V6_INTROFFSET_1 0x880 +#define ICS_ARCIN_V6_INTRSTAT_1 0x8a4 +#define ICS_ARCIN_V6_IDEALTOFFSET_1 0x8e0 +#define ICS_ARCIN_V6_IDEOFFSET_2 0xc00 +#define ICS_ARCIN_V6_INTROFFSET_2 0xc80 +#define ICS_ARCIN_V6_INTRSTAT_2 0xca4 +#define ICS_ARCIN_V6_IDEALTOFFSET_2 0xce0 +#define ICS_ARCIN_V6_IDESTEPPING 4 + +struct cardinfo { + unsigned int dataoffset; + unsigned int ctrloffset; + unsigned int stepping; +}; + +static struct cardinfo icside_cardinfo_v5 = { + ICS_ARCIN_V5_IDEOFFSET, + ICS_ARCIN_V5_IDEALTOFFSET, + ICS_ARCIN_V5_IDESTEPPING +}; + +static struct cardinfo icside_cardinfo_v6_1 = { + ICS_ARCIN_V6_IDEOFFSET_1, + ICS_ARCIN_V6_IDEALTOFFSET_1, + ICS_ARCIN_V6_IDESTEPPING +}; + +static struct cardinfo icside_cardinfo_v6_2 = { + ICS_ARCIN_V6_IDEOFFSET_2, + ICS_ARCIN_V6_IDEALTOFFSET_2, + ICS_ARCIN_V6_IDESTEPPING +}; + +static const card_ids icside_cids[] = { + { MANU_ICS, PROD_ICS_IDE }, + { MANU_ICS2, PROD_ICS2_IDE }, + { 0xffff, 0xffff } +}; + +typedef enum { + ics_if_unknown, + ics_if_arcin_v5, + ics_if_arcin_v6 +} iftype_t; + +/* ---------------- Version 5 PCB Support Functions --------------------- */ +/* Prototype: icside_irqenable_arcin_v5 (struct expansion_card *ec, int irqnr) + * Purpose : enable interrupts from card + */ +static void icside_irqenable_arcin_v5 (struct expansion_card *ec, int irqnr) +{ + unsigned int memc_port = (unsigned int)ec->irq_data; + outb(0, memc_port + ICS_ARCIN_V5_INTROFFSET); +} + +/* Prototype: icside_irqdisable_arcin_v5 (struct expansion_card *ec, int irqnr) + * Purpose : disable interrupts from card + */ +static void icside_irqdisable_arcin_v5 (struct expansion_card *ec, int irqnr) +{ + unsigned int memc_port = (unsigned int)ec->irq_data; + inb(memc_port + ICS_ARCIN_V5_INTROFFSET); +} + +static const expansioncard_ops_t icside_ops_arcin_v5 = { + icside_irqenable_arcin_v5, + icside_irqdisable_arcin_v5, + NULL, + NULL, + NULL, + NULL +}; + + +/* ---------------- Version 6 PCB Support Functions --------------------- */ +/* Prototype: icside_irqenable_arcin_v6 (struct expansion_card *ec, int irqnr) + * Purpose : enable interrupts from card + */ +static void icside_irqenable_arcin_v6 (struct expansion_card *ec, int irqnr) +{ + unsigned int ide_base_port = (unsigned int)ec->irq_data; + + outb(0, ide_base_port + ICS_ARCIN_V6_INTROFFSET_1); + outb(0, ide_base_port + ICS_ARCIN_V6_INTROFFSET_2); +} + +/* Prototype: icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr) + * Purpose : disable interrupts from card + */ +static void icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr) +{ + unsigned int ide_base_port = (unsigned int)ec->irq_data; + + inb(ide_base_port + ICS_ARCIN_V6_INTROFFSET_1); + inb(ide_base_port + ICS_ARCIN_V6_INTROFFSET_2); +} + +/* Prototype: icside_irqprobe(struct expansion_card *ec) + * Purpose : detect an active interrupt from card + */ +static int icside_irqpending_arcin_v6(struct expansion_card *ec) +{ + unsigned int ide_base_port = (unsigned int)ec->irq_data; + + return inb(ide_base_port + ICS_ARCIN_V6_INTRSTAT_1) & 1 || + inb(ide_base_port + ICS_ARCIN_V6_INTRSTAT_2) & 1; +} + +static const expansioncard_ops_t icside_ops_arcin_v6 = { + icside_irqenable_arcin_v6, + icside_irqdisable_arcin_v6, + icside_irqpending_arcin_v6, + NULL, + NULL, + NULL +}; + +/* Prototype: icside_identifyif (struct expansion_card *ec) + * Purpose : identify IDE interface type + * Notes : checks the description string + */ +static iftype_t __init icside_identifyif (struct expansion_card *ec) +{ + unsigned int addr; + iftype_t iftype; + int id = 0; + + iftype = ics_if_unknown; + + addr = ecard_address (ec, ECARD_IOC, ECARD_FAST) + ICS_IDENT_OFFSET; + + id = inb(addr) & 1; + id |= (inb(addr + 1) & 1) << 1; + id |= (inb(addr + 2) & 1) << 2; + id |= (inb & 1) << 3; + + switch (id) { + case 0: /* A3IN */ + printk("icside: A3IN unsupported\n"); + break; + + case 1: /* A3USER */ + printk("icside: A3USER unsupported\n"); + break; + + case 3: /* ARCIN V6 */ + printk(KERN_DEBUG "icside: detected ARCIN V6 in slot %d\n", ec->slot_no); + iftype = ics_if_arcin_v6; + break; + + case 15:/* ARCIN V5 (no id) */ + printk(KERN_DEBUG "icside: detected ARCIN V5 in slot %d\n", ec->slot_no); + iftype = ics_if_arcin_v5; + break; + + default:/* we don't know - complain very loudly */ + printk("icside: ***********************************\n"); + printk("icside: *** UNKNOWN ICS INTERFACE id=%d ***\n", id); + printk("icside: ***********************************\n"); + printk("icside: please report this to linux@arm.linux.org.uk\n"); + printk("icside: defaulting to ARCIN V5\n"); + iftype = ics_if_arcin_v5; + break; + } + + return iftype; +} + +#ifdef CONFIG_BLK_DEV_IDEDMA_ICS +/* + * SG-DMA support. + * + * Similar to the BM-DMA, but we use the RiscPCs IOMD DMA controllers. + * There is only one DMA controller per card, which means that only + * one drive can be accessed at one time. NOTE! We do not enforce that + * here, but we rely on the main IDE driver spotting that both + * interfaces use the same IRQ, which should guarantee this. + */ +#define NR_ENTRIES 256 +#define TABLE_SIZE (NR_ENTRIES * 8) + +static int ide_build_sglist(ide_hwif_t *hwif, struct request *rq) +{ + struct buffer_head *bh; + struct scatterlist *sg = hwif->sg_table; + int nents = 0; + + if (rq->cmd == READ) + hwif->sg_dma_direction = PCI_DMA_FROMDEVICE; + else + hwif->sg_dma_direction = PCI_DMA_TODEVICE; + bh = rq->bh; + do { + unsigned char *virt_addr = bh->b_data; + unsigned int size = bh->b_size; + + while ((bh = bh->b_reqnext) != NULL) { + if ((virt_addr + size) != (unsigned char *)bh->b_data) + break; + size += bh->b_size; + } + memset(&sg[nents], 0, sizeof(*sg)); + sg[nents].address = virt_addr; + sg[nents].length = size; + nents++; + } while (bh != NULL); + + return pci_map_sg(NULL, sg, nents, hwif->sg_dma_direction); +} + +static int +icside_build_dmatable(ide_drive_t *drive, int reading) +{ + return HWIF(drive)->sg_nents = ide_build_sglist(HWIF(drive), HWGROUP(drive)->rq); +} + +/* Teardown mappings after DMA has completed. */ +static void icside_destroy_dmatable(ide_drive_t *drive) +{ + struct scatterlist *sg = HWIF(drive)->sg_table; + int nents = HWIF(drive)->sg_nents; + + pci_unmap_sg(NULL, sg, nents, HWIF(drive)->sg_dma_direction); +} + +static int +icside_config_if(ide_drive_t *drive, int xfer_mode) +{ + int func = ide_dma_off; + + switch (xfer_mode) { + case XFER_MW_DMA_2: + /* + * The cycle time is limited to 250ns by the r/w + * pulse width (90ns), however we should still + * have a maximum burst transfer rate of 8MB/s. + */ + drive->drive_data = 250; + break; + + case XFER_MW_DMA_1: + drive->drive_data = 250; + break; + + case XFER_MW_DMA_0: + drive->drive_data = 480; + break; + + default: + drive->drive_data = 0; + break; + } + + if (!drive->init_speed) + drive->init_speed = (u8) xfer_mode; + + if (drive->drive_data && + ide_config_drive_speed(drive, (u8) xfer_mode) == 0) + func = ide_dma_on; + else + drive->drive_data = 480; + + printk("%s: %s selected (peak %dMB/s)\n", drive->name, + ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data); + + drive->current_speed = (u8) xfer_mode; + + return func; +} + +static int +icside_set_speed(ide_drive_t *drive, u8 speed) +{ + return icside_config_if(drive, speed); +} + +/* + * dma_intr() is the handler for disk read/write DMA interrupts + */ +static ide_startstop_t icside_dmaintr(ide_drive_t *drive) +{ + u8 dma_stat = HWIF(drive)->ide_dma_end(drive); + /* get drive status */ + u8 stat = HWIF(drive)->INB(IDE_STATUS_REG); + int i; + + if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) { + if (!dma_stat) { + struct request *rq = HWGROUP(drive)->rq; + rq = HWGROUP(drive)->rq; + for (i = rq->nr_sectors; i > 0;) { + i -= rq->current_nr_sectors; + DRIVER(drive)->end_request(drive, 1); + } + return ide_stopped; + } + printk("%s: dma_intr: bad DMA status (dma_stat=%x)\n", + drive->name, dma_stat); + } + return DRIVER(drive)->error(drive, "dma_intr", stat); +} + +/* + * The following is a sick duplication from ide-dma.c ;( + * + * This should be defined in one place only. + */ +struct drive_list_entry { + char * id_model; + char * id_firmware; +}; + +static struct drive_list_entry drive_whitelist [] = { + { "Micropolis 2112A", "ALL" }, + { "CONNER CTMA 4000", "ALL" }, + { "CONNER CTT8000-A", "ALL" }, + { "ST34342A", "ALL" }, + { NULL, 0 } +}; + +static struct drive_list_entry drive_blacklist [] = { + { "WDC AC11000H", "ALL" }, + { "WDC AC22100H", "ALL" }, + { "WDC AC32500H", "ALL" }, + { "WDC AC33100H", "ALL" }, + { "WDC AC31600H", "ALL" }, + { "WDC AC32100H", "24.09P07" }, + { "WDC AC23200L", "21.10N21" }, + { "Compaq CRD-8241B", "ALL" }, + { "CRD-8400B", "ALL" }, + { "CRD-8480B", "ALL" }, + { "CRD-8480C", "ALL" }, + { "CRD-8482B", "ALL" }, + { "CRD-84", "ALL" }, + { "SanDisk SDP3B", "ALL" }, + { "SanDisk SDP3B-64", "ALL" }, + { "SANYO CD-ROM CRD", "ALL" }, + { "HITACHI CDR-8", "ALL" }, + { "HITACHI CDR-8335", "ALL" }, + { "HITACHI CDR-8435", "ALL" }, + { "Toshiba CD-ROM XM-6202B", "ALL" }, + { "CD-532E-A", "ALL" }, + { "E-IDE CD-ROM CR-840", "ALL" }, + { "CD-ROM Drive/F5A", "ALL" }, + { "RICOH CD-R/RW MP7083A", "ALL" }, + { "WPI CDD-820", "ALL" }, + { "SAMSUNG CD-ROM SC-148C", "ALL" }, + { "SAMSUNG CD-ROM SC-148F", "ALL" }, + { "SAMSUNG CD-ROM SC", "ALL" }, + { "SanDisk SDP3B-64", "ALL" }, + { "SAMSUNG CD-ROM SN-124", "ALL" }, + { "PLEXTOR CD-R PX-W8432T", "ALL" }, + { "ATAPI CD-ROM DRIVE 40X MAXIMUM", "ALL" }, + { "_NEC DV5800A", "ALL" }, + { NULL, 0 } +}; + +static int in_drive_list(struct hd_driveid *id, struct drive_list_entry * drive_table) +{ + for ( ; drive_table->id_model ; drive_table++) + if ((!strcmp(drive_table->id_model, id->model)) && + ((!strstr(drive_table->id_firmware, id->fw_rev)) || + (!strcmp(drive_table->id_firmware, "ALL")))) + return 1; + return 0; +} + +/* + * For both Blacklisted and Whitelisted drives. + * This is setup to be called as an extern for future support + * to other special driver code. + */ +int check_drive_good_lists (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + return in_drive_list(id, drive_whitelist); +} + +int check_drive_bad_lists (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + int blacklist = in_drive_list(id, drive_blacklist); + if (blacklist) + printk("%s: Disabling DMA for %s\n", drive->name, id->model); + return(blacklist); +} + +int icside_dma_check(ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + ide_hwif_t *hwif = HWIF(drive); + int autodma = hwif->autodma; + int xfer_mode = XFER_PIO_2; + + if (!id || !(id->capability & 1) || !autodma) + return hwif->ide_dma_off_quietly(drive); + + /* + * Consult the list of known "bad" drives + */ + if (check_drive_bad_lists(drive)) + return hwif->ide_dma_off(drive); + + /* + * Enable DMA on any drive that has multiword DMA + */ + if (id->field_valid & 2) { + if (id->dma_mword & 4) { + xfer_mode = XFER_MW_DMA_2; + } else if (id->dma_mword & 2) { + xfer_mode = XFER_MW_DMA_1; + } else if (id->dma_mword & 1) { + xfer_mode = XFER_MW_DMA_0; + } + goto out; + } + + /* + * Consult the list of known "good" drives + */ + if (check_drive_good_lists(drive)) { + if (id->eide_dma_time > 150) + goto out; + xfer_mode = XFER_MW_DMA_1; + } + +out: + if (icside_config_if(drive, xfer_mode)) + return hwif->ide_dma_on(drive); + return hwif->ide_dma_off(drive); +} + +int icside_dma_verbose(ide_drive_t *drive) +{ + printk(", DMA"); + return 1; +} + +int icside_dma_test_irq(ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + return inb((unsigned long)hwif->hw.priv) & 1; +} + +int icside_dma_host_off(ide_drive_t *drive) +{ + return 0; +} + +int icside_dma_off_quietly(ide_drive_t *drive) +{ + drive->using_dma = 0; + return icside_dma_host_off(drive); +} + +int icside_dma_off(ide_drive_t *drive) +{ + printk("%s: DMA disabled\n", drive->name); + return icside_dma_off_quietly(drive); +} + +int icside_dma_host_on(ide_drive_t *drive) +{ + return 0; +} + +int icside_dma_on(ide_drive_t *drive) +{ + drive->using_dma = 1; + return icside_dma_host_on(drive); +} + +int icside_dma_begin(ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + + enable_dma(hwif->hw.dma); + return 0; +} + +int icside_dma_end(ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + + drive->waiting_for_dma = 0; + disable_dma(hwif->hw.dma); + icside_destroy_dmatable(drive); + return get_dma_residue(hwif->hw.dma) != 0; +} + +int icside_dma_count (ide_drive_t *drive) +{ + return icside_dma_begin(drive); +} + +int icside_dma_read(ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); +// ide_task_t *args = HWGROUP(drive)->rq->special; + int count = 0; + u8 lba48 = (drive->addressing == 1) ? 1 : 0; + task_ioreg_t command = WIN_NOP; + + count = icside_build_dmatable(drive, 1); + if (!count) + return 1; + disable_dma(hwif->hw.dma); + + /* Route the DMA signals to + * to the correct interface. + */ + HWIF(drive)->OUTB(hwif->select_data, hwif->config_data); + + /* Select the correct timing + * for this drive + */ + set_dma_speed(hwif->hw.dma, drive->drive_data); + + set_dma_sg(hwif->hw.dma, HWIF(drive)->sg_table, count); + set_dma_mode(hwif->hw.dma, DMA_MODE_READ); + + drive->waiting_for_dma = 1; + if (drive->media != ide_disk) + return 0; + + if (HWGROUP(drive)->handler != NULL) /* paranoia check */ + BUG(); + ide_set_handler(drive, &icside_dmaintr, WAIT_CMD, NULL); + /* + * FIX ME to use only ACB ide_task_t args Struct + */ +#if 0 + { + ide_task_t *args = HWGROUP(drive)->rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#else + command = (lba48) ? WIN_READDMA_EXT : WIN_READDMA; + if (HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE) { + ide_task_t *args = HWGROUP(drive)->rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#endif + /* issue cmd to drive */ + HWIF(drive)->OUTB(command, IDE_COMMAND_REG); + + return icside_dma_count(drive); +} + +int icside_dma_write(ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); +// ide_task_t *args = HWGROUP(drive)->rq->special; + int count = 0; + u8 lba48 = (drive->addressing == 1) ? 1 : 0; + task_ioreg_t command = WIN_NOP; + + count = icside_build_dmatable(drive, 0); + if (!count) + return 1; + disable_dma(hwif->hw.dma); + + /* Route the DMA signals to + * to the correct interface. + */ + HWIF(drive)->OUTB(hwif->select_data, hwif->config_data); + + /* Select the correct timing + * for this drive + */ + set_dma_speed(hwif->hw.dma, drive->drive_data); + + set_dma_sg(hwif->hw.dma, HWIF(drive)->sg_table, count); + set_dma_mode(hwif->hw.dma, DMA_MODE_WRITE); + + drive->waiting_for_dma = 1; + if (drive->media != ide_disk) + return 0; + + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &icside_dmaintr, WAIT_CMD, NULL); + /* + * FIX ME to use only ACB ide_task_t args Struct + */ +#if 0 + { + ide_task_t *args = HWGROUP(drive)->rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#else + command = (lba48) ? WIN_WRITEDMA_EXT : WIN_WRITEDMA; + if (HWGROUP(drive)->rq->flags & REQ_DRIVE_TASKFILE) { + ide_task_t *args = HWGROUP(drive)->rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#endif + /* issue cmd to drive */ + HWIF(drive)->OUTB(command, IDE_COMMAND_REG); + + return icside_dma_count(drive); +} + +static int +icside_setup_dma(ide_hwif_t *hwif, int autodma) +{ + printk(" %s: SG-DMA", hwif->name); + + hwif->sg_table = kmalloc(sizeof(struct scatterlist) * NR_ENTRIES, + GFP_KERNEL); + if (!hwif->sg_table) + goto failed; + + hwif->dmatable_cpu = NULL; + hwif->dmatable_dma = 0; + hwif->speedproc = icside_set_speed; + hwif->autodma = autodma; + + hwif->ide_dma_check = icside_dma_check; + hwif->ide_dma_host_off = icside_dma_host_off; + hwif->ide_dma_off_quietly = icside_dma_off_quietly; + hwif->ide_dma_off = icside_dma_off; + hwif->ide_dma_host_on = icside_dma_host_on; + hwif->ide_dma_on = icside_dma_on; + hwif->ide_dma_read = icside_dma_read; + hwif->ide_dma_write = icside_dma_write; + hwif->ide_dma_count = icside_dma_count; + hwif->ide_dma_begin = icside_dma_begin; + hwif->ide_dma_end = icside_dma_end; + hwif->ide_dma_verbose = icside_dma_verbose; + hwif->ide_dma_bad_drive = check_drive_bad_lists; + hwif->ide_dma_good_drive = check_drive_good_lists; + hwif->ide_dma_test_irq = icside_dma_test_irq; + + printk(" capable%s\n", autodma ? + ", auto-enable" : ""); + + return 1; + +failed: + printk(" -- ERROR, unable to allocate DMA table\n"); + return 0; +} +#endif + +static ide_hwif_t * +icside_find_hwif(unsigned long dataport) +{ + ide_hwif_t *hwif; + int index; + + for (index = 0; index < MAX_HWIFS; ++index) { + hwif = &ide_hwifs[index]; + if (hwif->io_ports[IDE_DATA_OFFSET] == (ide_ioreg_t)dataport) + goto found; + } + + for (index = 0; index < MAX_HWIFS; ++index) { + hwif = &ide_hwifs[index]; + if (!hwif->io_ports[IDE_DATA_OFFSET]) + goto found; + } + + return NULL; +found: + return hwif; +} + +static ide_hwif_t * +icside_setup(unsigned long base, struct cardinfo *info, int irq) +{ + unsigned long port = base + info->dataoffset; + ide_hwif_t *hwif; + + hwif = icside_find_hwif(base); + if (hwif) { + int i; + + memset(&hwif->hw, 0, sizeof(hw_regs_t)); + + for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { + hwif->hw.io_ports[i] = (ide_ioreg_t)port; + hwif->io_ports[i] = (ide_ioreg_t)port; + port += 1 << info->stepping; + } + hwif->hw.io_ports[IDE_CONTROL_OFFSET] = base + info->ctrloffset; + hwif->io_ports[IDE_CONTROL_OFFSET] = base + info->ctrloffset; + hwif->hw.irq = irq; + hwif->irq = irq; + hwif->hw.dma = NO_DMA; + hwif->noprobe = 0; + hwif->chipset = ide_acorn; + } + + return hwif; +} + +static int __init icside_register_v5(struct expansion_card *ec, int autodma) +{ + unsigned long slot_port; + ide_hwif_t *hwif; + + slot_port = ecard_address(ec, ECARD_MEMC, 0); + + ec->irqaddr = (unsigned char *)ioaddr(slot_port + ICS_ARCIN_V5_INTRSTAT); + ec->irqmask = 1; + ec->irq_data = (void *)slot_port; + ec->ops = (expansioncard_ops_t *)&icside_ops_arcin_v5; + + /* + * Be on the safe side - disable interrupts + */ + inb(slot_port + ICS_ARCIN_V5_INTROFFSET); + + hwif = icside_setup(slot_port, &icside_cardinfo_v5, ec->irq); + + return hwif ? 0 : -1; +} + +static int __init icside_register_v6(struct expansion_card *ec, int autodma) +{ + unsigned long slot_port, port; + ide_hwif_t *hwif, *mate; + int sel = 0; + + slot_port = ecard_address(ec, ECARD_IOC, ECARD_FAST); + port = ecard_address(ec, ECARD_EASI, ECARD_FAST); + + if (port == 0) + port = slot_port; + else + sel = 1 << 5; + + outb(sel, slot_port); + + ec->irq_data = (void *)port; + ec->ops = (expansioncard_ops_t *)&icside_ops_arcin_v6; + + /* + * Be on the safe side - disable interrupts + */ + inb(port + ICS_ARCIN_V6_INTROFFSET_1); + inb(port + ICS_ARCIN_V6_INTROFFSET_2); + + hwif = icside_setup(port, &icside_cardinfo_v6_1, ec->irq); + mate = icside_setup(port, &icside_cardinfo_v6_2, ec->irq); + +#ifdef CONFIG_BLK_DEV_IDEDMA_ICS + if (ec->dma != NO_DMA) { + if (request_dma(ec->dma, hwif->name)) + goto no_dma; + + if (hwif) { + hwif->config_data = slot_port; + hwif->select_data = sel; + hwif->hw.dma = ec->dma; + hwif->hw.priv = (void *) + (port + ICS_ARCIN_V6_INTRSTAT_1); + hwif->channel = 0; + icside_setup_dma(hwif, autodma); + hwif->drives[0].autodma = autodma; + hwif->drives[1].autodma = autodma; + } + if (mate) { + mate->config_data = slot_port; + mate->select_data = sel | 1; + mate->hw.dma = ec->dma; + mate->hw.priv = (void *) + (port + ICS_ARCIN_V6_INTRSTAT_2); + mate->channel = 1; + icside_setup_dma(mate, autodma); + mate->drives[0].autodma = autodma; + mate->drives[1].autodma = autodma; + } + } +no_dma: +#endif + return hwif || mate ? 0 : -1; +} + +int __init icside_init(void) +{ + int autodma = 0; + +#ifdef CONFIG_IDEDMA_ICS_AUTO + autodma = 1; +#endif + + ecard_startfind (); + + do { + struct expansion_card *ec; + int result; + + ec = ecard_find(0, icside_cids); + if (ec == NULL) + break; + + ecard_claim(ec); + + switch (icside_identifyif(ec)) { + case ics_if_arcin_v5: + result = icside_register_v5(ec, autodma); + break; + + case ics_if_arcin_v6: + result = icside_register_v6(ec, autodma); + break; + + default: + result = -1; + break; + } + + if (result) + ecard_release(ec); + } while (1); + + return 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/arm/Makefile linux.20pre5-ac2/drivers/ide/arm/Makefile --- linux.20pre5/drivers/ide/arm/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/arm/Makefile 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,12 @@ + +O_TARGET := idedriver-arm.o + +obj-y := +obj-m := + +obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o +obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o + +EXTRA_CFLAGS := -I../ + +include $(TOPDIR)/Rules.make diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/arm/rapide.c linux.20pre5-ac2/drivers/ide/arm/rapide.c --- linux.20pre5/drivers/ide/arm/rapide.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/arm/rapide.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,94 @@ +/* + * linux/drivers/ide/rapide.c + * + * Copyright (c) 1996-1998 Russell King. + * + * Changelog: + * 08-06-1996 RMK Created + * 13-04-1998 RMK Added manufacturer and product IDs + */ + +#include +#include +#include +#include +#include +#include + +#include + +static card_ids __init rapide_cids[] = { + { MANU_YELLOWSTONE, PROD_YELLOWSTONE_RAPIDE32 }, + { 0xffff, 0xffff } +}; + +static struct expansion_card *ec[MAX_ECARDS]; +static int result[MAX_ECARDS]; + +static inline int rapide_register(struct expansion_card *ec) +{ + unsigned long port = ecard_address (ec, ECARD_MEMC, 0); + hw_regs_t hw; + + int i; + + memset(&hw, 0, sizeof(hw)); + + for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { + hw.io_ports[i] = (ide_ioreg_t)port; + port += 1 << 4; + } + hw.io_ports[IDE_CONTROL_OFFSET] = port + 0x206; + hw.irq = ec->irq; + + return ide_register_hw(&hw, NULL); +} + +int __init rapide_init(void) +{ + int i; + + for (i = 0; i < MAX_ECARDS; i++) + ec[i] = NULL; + + ecard_startfind(); + + for (i = 0; ; i++) { + if ((ec[i] = ecard_find(0, rapide_cids)) == NULL) + break; + + ecard_claim(ec[i]); + result[i] = rapide_register(ec[i]); + } + for (i = 0; i < MAX_ECARDS; i++) + if (ec[i] && result[i] < 0) { + ecard_release(ec[i]); + ec[i] = NULL; + } + return 0; +} + +#ifdef MODULE +MODULE_LICENSE("GPL"); + +int init_module (void) +{ + return rapide_init(); +} + +void cleanup_module (void) +{ + int i; + + for (i = 0; i < MAX_ECARDS; i++) + if (ec[i]) { + unsigned long port; + port = ecard_address(ec[i], ECARD_MEMC, 0); + + ide_unregister_port(port, ec[i]->irq, 16); + ecard_release(ec[i]); + ec[i] = NULL; + } +} +#endif + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ataraid.c linux.20pre5-ac2/drivers/ide/ataraid.c --- linux.20pre5/drivers/ide/ataraid.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ataraid.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,313 +0,0 @@ -/* - ataraid.c Copyright (C) 2001 Red Hat, Inc. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - You should have received a copy of the GNU General Public License - (for example /usr/src/linux/COPYING); if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - Authors: Arjan van de Ven - - -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "ataraid.h" - - -static int ataraid_hardsect_size[256]; -static int ataraid_blksize_size[256]; - -static struct raid_device_operations* ataraid_ops[16]; - -static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); -static int ataraid_open(struct inode * inode, struct file * filp); -static int ataraid_release(struct inode * inode, struct file * filp); -static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head * bh); - - -struct gendisk ataraid_gendisk; -static int ataraid_gendisk_sizes[256]; -static int ataraid_readahead[256]; - -static struct block_device_operations ataraid_fops = { - owner: THIS_MODULE, - open: ataraid_open, - release: ataraid_release, - ioctl: ataraid_ioctl, -}; - - - -static DECLARE_MUTEX(ataraid_sem); - -/* Bitmap for the devices currently in use */ -static unsigned int ataraiduse; - - -/* stub fops functions */ - -static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) -{ - int minor; - minor = MINOR(inode->i_rdev)>>SHIFT; - - if ((ataraid_ops[minor])&&(ataraid_ops[minor]->ioctl)) - return (ataraid_ops[minor]->ioctl)(inode,file,cmd,arg); - return -EINVAL; -} - -static int ataraid_open(struct inode * inode, struct file * filp) -{ - int minor; - minor = MINOR(inode->i_rdev)>>SHIFT; - - if ((ataraid_ops[minor])&&(ataraid_ops[minor]->open)) - return (ataraid_ops[minor]->open)(inode,filp); - return -EINVAL; -} - - -static int ataraid_release(struct inode * inode, struct file * filp) -{ - int minor; - minor = MINOR(inode->i_rdev)>>SHIFT; - - if ((ataraid_ops[minor])&&(ataraid_ops[minor]->release)) - return (ataraid_ops[minor]->release)(inode,filp); - return -EINVAL; -} - -static int ataraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh) -{ - int minor; - int retval; - minor = MINOR(bh->b_rdev)>>SHIFT; - - if ((ataraid_ops[minor])&&(ataraid_ops[minor]->make_request)) { - - retval= (ataraid_ops[minor]->make_request)(q,rw,bh); - if (retval == -1) { - ataraid_split_request(q,rw,bh); - return 0; - } else - return retval; - } - return -EINVAL; -} - -struct buffer_head *ataraid_get_bhead(void) -{ - void *ptr = NULL; - while (!ptr) { - ptr=kmalloc(sizeof(struct buffer_head),GFP_NOIO); - if (!ptr) - yield(); - } - return ptr; -} - -EXPORT_SYMBOL(ataraid_get_bhead); - -struct ataraid_bh_private *ataraid_get_private(void) -{ - void *ptr = NULL; - while (!ptr) { - ptr=kmalloc(sizeof(struct ataraid_bh_private),GFP_NOIO); - if (!ptr) - yield(); - } - return ptr; -} - -EXPORT_SYMBOL(ataraid_get_private); - -void ataraid_end_request(struct buffer_head *bh, int uptodate) -{ - struct ataraid_bh_private *private = bh->b_private; - - if (private==NULL) - BUG(); - - if (atomic_dec_and_test(&private->count)) { - private->parent->b_end_io(private->parent,uptodate); - private->parent = NULL; - kfree(private); - } - kfree(bh); -} - -EXPORT_SYMBOL(ataraid_end_request); - -static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head * bh) -{ - struct buffer_head *bh1,*bh2; - struct ataraid_bh_private *private; - bh1=ataraid_get_bhead(); - bh2=ataraid_get_bhead(); - - /* If either of those ever fails we're doomed */ - if ((!bh1)||(!bh2)) - BUG(); - private = ataraid_get_private(); - if (private==NULL) - BUG(); - - memcpy(bh1, bh, sizeof(*bh)); - memcpy(bh2, bh, sizeof(*bh)); - - bh1->b_end_io = ataraid_end_request; - bh2->b_end_io = ataraid_end_request; - - bh2->b_rsector += bh->b_size >> 10; - bh1->b_size /= 2; - bh2->b_size /= 2; - private->parent = bh; - - bh1->b_private = private; - bh2->b_private = private; - atomic_set(&private->count,2); - - bh2->b_data += bh->b_size/2; - - generic_make_request(rw,bh1); - generic_make_request(rw,bh2); -} - - - - -/* device register / release functions */ - - -int ataraid_get_device(struct raid_device_operations *fops) -{ - int bit; - down(&ataraid_sem); - if (ataraiduse==~0U) { - up(&ataraid_sem); - return -ENODEV; - } - bit=ffz(ataraiduse); - ataraiduse |= 1< - - -*/ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#define ATAMAJOR 114 -#define SHIFT 4 -#define MINOR_MASK 15 -#define MAJOR_MASK 15 - - -/* raid_device_operations is a light struct block_device_operations with an - added method for make_request */ -struct raid_device_operations { - int (*open) (struct inode *, struct file *); - int (*release) (struct inode *, struct file *); - int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long); - int (*make_request) (request_queue_t *q, int rw, struct buffer_head * bh); -}; - - -struct geom { - unsigned char heads; - unsigned int cylinders; - unsigned char sectors; -}; - -/* structure for the splitting of bufferheads */ - -struct ataraid_bh_private { - struct buffer_head *parent; - atomic_t count; -}; - -extern struct gendisk ataraid_gendisk; - -extern int ataraid_get_device(struct raid_device_operations *fops); -extern void ataraid_release_device(int device); -extern int get_blocksize(kdev_t dev); -extern void ataraid_register_disk(int device,long size); -extern struct buffer_head *ataraid_get_bhead(void); -extern struct ataraid_bh_private *ataraid_get_private(void); -extern void ataraid_end_request(struct buffer_head *bh, int uptodate); - - - - - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/buddha.c linux.20pre5-ac2/drivers/ide/buddha.c --- linux.20pre5/drivers/ide/buddha.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/buddha.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,225 +0,0 @@ -/* - * linux/drivers/ide/buddha.c -- Amiga Buddha, Catweasel and X-Surf IDE Driver - * - * Copyright (C) 1997, 2001 by Geert Uytterhoeven and others - * - * This driver was written based on the specifications in README.buddha and - * the X-Surf info from Inside_XSurf.txt available at - * http://www.jschoenfeld.com - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - * - * TODO: - * - test it :-) - * - tune the timings using the speed-register - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - - - /* - * The Buddha has 2 IDE interfaces, the Catweasel has 3, X-Surf has 2 - */ - -#define BUDDHA_NUM_HWIFS 2 -#define CATWEASEL_NUM_HWIFS 3 -#define XSURF_NUM_HWIFS 2 - - /* - * Bases of the IDE interfaces (relative to the board address) - */ - -#define BUDDHA_BASE1 0x800 -#define BUDDHA_BASE2 0xa00 -#define BUDDHA_BASE3 0xc00 - -#define XSURF_BASE1 0xb000 /* 2.5" Interface */ -#define XSURF_BASE2 0xd000 /* 3.5" Interface */ - -static u_int buddha_bases[CATWEASEL_NUM_HWIFS] __initdata = { - BUDDHA_BASE1, BUDDHA_BASE2, BUDDHA_BASE3 -}; - -static u_int xsurf_bases[XSURF_NUM_HWIFS] __initdata = { - XSURF_BASE1, XSURF_BASE2 -}; - - - /* - * Offsets from one of the above bases - */ - -#define BUDDHA_DATA 0x00 -#define BUDDHA_ERROR 0x06 /* see err-bits */ -#define BUDDHA_NSECTOR 0x0a /* nr of sectors to read/write */ -#define BUDDHA_SECTOR 0x0e /* starting sector */ -#define BUDDHA_LCYL 0x12 /* starting cylinder */ -#define BUDDHA_HCYL 0x16 /* high byte of starting cyl */ -#define BUDDHA_SELECT 0x1a /* 101dhhhh , d=drive, hhhh=head */ -#define BUDDHA_STATUS 0x1e /* see status-bits */ -#define BUDDHA_CONTROL 0x11a -#define XSURF_CONTROL -1 /* X-Surf has no CS1* (Control/AltStat) */ - -static int buddha_offsets[IDE_NR_PORTS] __initdata = { - BUDDHA_DATA, BUDDHA_ERROR, BUDDHA_NSECTOR, BUDDHA_SECTOR, BUDDHA_LCYL, - BUDDHA_HCYL, BUDDHA_SELECT, BUDDHA_STATUS, BUDDHA_CONTROL, -1 -}; - -static int xsurf_offsets[IDE_NR_PORTS] __initdata = { - BUDDHA_DATA, BUDDHA_ERROR, BUDDHA_NSECTOR, BUDDHA_SECTOR, BUDDHA_LCYL, - BUDDHA_HCYL, BUDDHA_SELECT, BUDDHA_STATUS, XSURF_CONTROL, -1 -}; - - /* - * Other registers - */ - -#define BUDDHA_IRQ1 0xf00 /* MSB = 1, Harddisk is source of */ -#define BUDDHA_IRQ2 0xf40 /* interrupt */ -#define BUDDHA_IRQ3 0xf80 - -#define XSURF_IRQ1 0x7e -#define XSURF_IRQ2 0x7e - -static int buddha_irqports[CATWEASEL_NUM_HWIFS] __initdata = { - BUDDHA_IRQ1, BUDDHA_IRQ2, BUDDHA_IRQ3 -}; - -static int xsurf_irqports[XSURF_NUM_HWIFS] __initdata = { - XSURF_IRQ1, XSURF_IRQ2 -}; - -#define BUDDHA_IRQ_MR 0xfc0 /* master interrupt enable */ - - - /* - * Board information - */ - -typedef enum BuddhaType_Enum { - BOARD_BUDDHA, BOARD_CATWEASEL, BOARD_XSURF -} BuddhaType; - - - /* - * Check and acknowledge the interrupt status - */ - -static int buddha_ack_intr(ide_hwif_t *hwif) -{ - unsigned char ch; - - ch = z_readb(hwif->io_ports[IDE_IRQ_OFFSET]); - if (!(ch & 0x80)) - return 0; - return 1; -} - -static int xsurf_ack_intr(ide_hwif_t *hwif) -{ - unsigned char ch; - - ch = z_readb(hwif->io_ports[IDE_IRQ_OFFSET]); - /* X-Surf needs a 0 written to IRQ register to ensure ISA bit A11 stays at 0 */ - z_writeb(0, hwif->io_ports[IDE_IRQ_OFFSET]); - if (!(ch & 0x80)) - return 0; - return 1; -} - - /* - * Probe for a Buddha or Catweasel IDE interface - */ - -void __init buddha_init(void) -{ - hw_regs_t hw; - int i, index; - - struct zorro_dev *z = NULL; - u_long buddha_board = 0; - BuddhaType type; - int buddha_num_hwifs; - - while ((z = zorro_find_device(ZORRO_WILDCARD, z))) { - unsigned long board; - if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) { - buddha_num_hwifs = BUDDHA_NUM_HWIFS; - type=BOARD_BUDDHA; - } else if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL) { - buddha_num_hwifs = CATWEASEL_NUM_HWIFS; - type=BOARD_CATWEASEL; - } else if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF) { - buddha_num_hwifs = XSURF_NUM_HWIFS; - type=BOARD_XSURF; - } else - continue; - - board = z->resource.start; - - if(type != BOARD_XSURF) { - if (!request_mem_region(board+BUDDHA_BASE1, 0x800, "IDE")) - continue; - } else { - if (!request_mem_region(board+XSURF_BASE1, 0x1000, "IDE")) - continue; - if (!request_mem_region(board+XSURF_BASE2, 0x1000, "IDE")) - goto fail_base2; - if (!request_mem_region(board+XSURF_IRQ1, 0x8, "IDE")) { - release_mem_region(board+XSURF_BASE2, 0x1000); -fail_base2: - release_mem_region(board+XSURF_BASE1, 0x1000); - continue; - } - } - buddha_board = ZTWO_VADDR(board); - - /* write to BUDDHA_IRQ_MR to enable the board IRQ */ - /* X-Surf doesn't have this. IRQs are always on */ - if (type != BOARD_XSURF) - z_writeb(0, buddha_board+BUDDHA_IRQ_MR); - - for(i=0;i -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "ide_modes.h" - -/* - * This flag is set in ide.c by the parameter: ide0=cmd640_vlb - */ -int cmd640_vlb = 0; - -/* - * CMD640 specific registers definition. - */ - -#define VID 0x00 -#define DID 0x02 -#define PCMD 0x04 -#define PCMD_ENA 0x01 -#define PSTTS 0x06 -#define REVID 0x08 -#define PROGIF 0x09 -#define SUBCL 0x0a -#define BASCL 0x0b -#define BaseA0 0x10 -#define BaseA1 0x14 -#define BaseA2 0x18 -#define BaseA3 0x1c -#define INTLINE 0x3c -#define INPINE 0x3d - -#define CFR 0x50 -#define CFR_DEVREV 0x03 -#define CFR_IDE01INTR 0x04 -#define CFR_DEVID 0x18 -#define CFR_AT_VESA_078h 0x20 -#define CFR_DSA1 0x40 -#define CFR_DSA0 0x80 - -#define CNTRL 0x51 -#define CNTRL_DIS_RA0 0x40 -#define CNTRL_DIS_RA1 0x80 -#define CNTRL_ENA_2ND 0x08 - -#define CMDTIM 0x52 -#define ARTTIM0 0x53 -#define DRWTIM0 0x54 -#define ARTTIM1 0x55 -#define DRWTIM1 0x56 -#define ARTTIM23 0x57 -#define ARTTIM23_DIS_RA2 0x04 -#define ARTTIM23_DIS_RA3 0x08 -#define DRWTIM23 0x58 -#define BRST 0x59 - -/* - * Registers and masks for easy access by drive index: - */ -static byte prefetch_regs[4] = {CNTRL, CNTRL, ARTTIM23, ARTTIM23}; -static byte prefetch_masks[4] = {CNTRL_DIS_RA0, CNTRL_DIS_RA1, ARTTIM23_DIS_RA2, ARTTIM23_DIS_RA3}; - -#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED - -static byte arttim_regs[4] = {ARTTIM0, ARTTIM1, ARTTIM23, ARTTIM23}; -static byte drwtim_regs[4] = {DRWTIM0, DRWTIM1, DRWTIM23, DRWTIM23}; - -/* - * Current cmd640 timing values for each drive. - * The defaults for each are the slowest possible timings. - */ -static byte setup_counts[4] = {4, 4, 4, 4}; /* Address setup count (in clocks) */ -static byte active_counts[4] = {16, 16, 16, 16}; /* Active count (encoded) */ -static byte recovery_counts[4] = {16, 16, 16, 16}; /* Recovery count (encoded) */ - -#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ - -/* - * These are initialized to point at the devices we control - */ -static ide_hwif_t *cmd_hwif0, *cmd_hwif1; -static ide_drive_t *cmd_drives[4]; - -/* - * Interface to access cmd640x registers - */ -static unsigned int cmd640_key; -static void (*put_cmd640_reg)(unsigned short reg, byte val); -static byte (*get_cmd640_reg)(unsigned short reg); - -/* - * This is read from the CFR reg, and is used in several places. - */ -static unsigned int cmd640_chip_version; - -/* - * The CMD640x chip does not support DWORD config write cycles, but some - * of the BIOSes use them to implement the config services. - * Therefore, we must use direct IO instead. - */ - -/* PCI method 1 access */ - -static void put_cmd640_reg_pci1 (unsigned short reg, byte val) -{ - unsigned long flags; - - save_flags(flags); - cli(); - outl_p((reg & 0xfc) | cmd640_key, 0xcf8); - outb_p(val, (reg & 3) | 0xcfc); - restore_flags(flags); -} - -static byte get_cmd640_reg_pci1 (unsigned short reg) -{ - byte b; - unsigned long flags; - - save_flags(flags); - cli(); - outl_p((reg & 0xfc) | cmd640_key, 0xcf8); - b = inb_p((reg & 3) | 0xcfc); - restore_flags(flags); - return b; -} - -/* PCI method 2 access (from CMD datasheet) */ - -static void put_cmd640_reg_pci2 (unsigned short reg, byte val) -{ - unsigned long flags; - - save_flags(flags); - cli(); - outb_p(0x10, 0xcf8); - outb_p(val, cmd640_key + reg); - outb_p(0, 0xcf8); - restore_flags(flags); -} - -static byte get_cmd640_reg_pci2 (unsigned short reg) -{ - byte b; - unsigned long flags; - - save_flags(flags); - cli(); - outb_p(0x10, 0xcf8); - b = inb_p(cmd640_key + reg); - outb_p(0, 0xcf8); - restore_flags(flags); - return b; -} - -/* VLB access */ - -static void put_cmd640_reg_vlb (unsigned short reg, byte val) -{ - unsigned long flags; - - save_flags(flags); - cli(); - outb_p(reg, cmd640_key); - outb_p(val, cmd640_key + 4); - restore_flags(flags); -} - -static byte get_cmd640_reg_vlb (unsigned short reg) -{ - byte b; - unsigned long flags; - - save_flags(flags); - cli(); - outb_p(reg, cmd640_key); - b = inb_p(cmd640_key + 4); - restore_flags(flags); - return b; -} - -static int __init match_pci_cmd640_device (void) -{ - const byte ven_dev[4] = {0x95, 0x10, 0x40, 0x06}; - unsigned int i; - for (i = 0; i < 4; i++) { - if (get_cmd640_reg(i) != ven_dev[i]) - return 0; - } -#ifdef STUPIDLY_TRUST_BROKEN_PCMD_ENA_BIT - if ((get_cmd640_reg(PCMD) & PCMD_ENA) == 0) { - printk("ide: cmd640 on PCI disabled by BIOS\n"); - return 0; - } -#endif /* STUPIDLY_TRUST_BROKEN_PCMD_ENA_BIT */ - return 1; /* success */ -} - -/* - * Probe for CMD640x -- pci method 1 - */ -static int __init probe_for_cmd640_pci1 (void) -{ - get_cmd640_reg = get_cmd640_reg_pci1; - put_cmd640_reg = put_cmd640_reg_pci1; - for (cmd640_key = 0x80000000; cmd640_key <= 0x8000f800; cmd640_key += 0x800) { - if (match_pci_cmd640_device()) - return 1; /* success */ - } - return 0; -} - -/* - * Probe for CMD640x -- pci method 2 - */ -static int __init probe_for_cmd640_pci2 (void) -{ - get_cmd640_reg = get_cmd640_reg_pci2; - put_cmd640_reg = put_cmd640_reg_pci2; - for (cmd640_key = 0xc000; cmd640_key <= 0xcf00; cmd640_key += 0x100) { - if (match_pci_cmd640_device()) - return 1; /* success */ - } - return 0; -} - -/* - * Probe for CMD640x -- vlb - */ -static int __init probe_for_cmd640_vlb (void) -{ - byte b; - - get_cmd640_reg = get_cmd640_reg_vlb; - put_cmd640_reg = put_cmd640_reg_vlb; - cmd640_key = 0x178; - b = get_cmd640_reg(CFR); - if (b == 0xff || b == 0x00 || (b & CFR_AT_VESA_078h)) { - cmd640_key = 0x78; - b = get_cmd640_reg(CFR); - if (b == 0xff || b == 0x00 || !(b & CFR_AT_VESA_078h)) - return 0; - } - return 1; /* success */ -} - -/* - * Returns 1 if an IDE interface/drive exists at 0x170, - * Returns 0 otherwise. - */ -static int __init secondary_port_responding (void) -{ - unsigned long flags; - - save_flags(flags); - cli(); - - outb_p(0x0a, 0x170 + IDE_SELECT_OFFSET); /* select drive0 */ - udelay(100); - if ((inb_p(0x170 + IDE_SELECT_OFFSET) & 0x1f) != 0x0a) { - outb_p(0x1a, 0x170 + IDE_SELECT_OFFSET); /* select drive1 */ - udelay(100); - if ((inb_p(0x170 + IDE_SELECT_OFFSET) & 0x1f) != 0x1a) { - restore_flags(flags); - return 0; /* nothing responded */ - } - } - restore_flags(flags); - return 1; /* success */ -} - -#ifdef CMD640_DUMP_REGS -/* - * Dump out all cmd640 registers. May be called from ide.c - */ -void cmd640_dump_regs (void) -{ - unsigned int reg = cmd640_vlb ? 0x50 : 0x00; - - /* Dump current state of chip registers */ - printk("ide: cmd640 internal register dump:"); - for (; reg <= 0x59; reg++) { - if (!(reg & 0x0f)) - printk("\n%04x:", reg); - printk(" %02x", get_cmd640_reg(reg)); - } - printk("\n"); -} -#endif - -/* - * Check whether prefetch is on for a drive, - * and initialize the unmask flags for safe operation. - */ -static void __init check_prefetch (unsigned int index) -{ - ide_drive_t *drive = cmd_drives[index]; - byte b = get_cmd640_reg(prefetch_regs[index]); - - if (b & prefetch_masks[index]) { /* is prefetch off? */ - drive->no_unmask = 0; - drive->no_io_32bit = 1; - drive->io_32bit = 0; - } else { -#if CMD640_PREFETCH_MASKS - drive->no_unmask = 1; - drive->unmask = 0; -#endif - drive->no_io_32bit = 0; - } -} - -/* - * Figure out which devices we control - */ -static void __init setup_device_ptrs (void) -{ - unsigned int i; - - cmd_hwif0 = &ide_hwifs[0]; /* default, if not found below */ - cmd_hwif1 = &ide_hwifs[1]; /* default, if not found below */ - for (i = 0; i < MAX_HWIFS; i++) { - ide_hwif_t *hwif = &ide_hwifs[i]; - if (hwif->chipset == ide_unknown || hwif->chipset == ide_generic) { - if (hwif->io_ports[IDE_DATA_OFFSET] == 0x1f0) - cmd_hwif0 = hwif; - else if (hwif->io_ports[IDE_DATA_OFFSET] == 0x170) - cmd_hwif1 = hwif; - } - } - cmd_drives[0] = &cmd_hwif0->drives[0]; - cmd_drives[1] = &cmd_hwif0->drives[1]; - cmd_drives[2] = &cmd_hwif1->drives[0]; - cmd_drives[3] = &cmd_hwif1->drives[1]; -} - -#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED - -/* - * Sets prefetch mode for a drive. - */ -static void set_prefetch_mode (unsigned int index, int mode) -{ - ide_drive_t *drive = cmd_drives[index]; - int reg = prefetch_regs[index]; - byte b; - unsigned long flags; - - save_flags(flags); - cli(); - b = get_cmd640_reg(reg); - if (mode) { /* want prefetch on? */ -#if CMD640_PREFETCH_MASKS - drive->no_unmask = 1; - drive->unmask = 0; -#endif - drive->no_io_32bit = 0; - b &= ~prefetch_masks[index]; /* enable prefetch */ - } else { - drive->no_unmask = 0; - drive->no_io_32bit = 1; - drive->io_32bit = 0; - b |= prefetch_masks[index]; /* disable prefetch */ - } - put_cmd640_reg(reg, b); - restore_flags(flags); -} - -/* - * Dump out current drive clocks settings - */ -static void display_clocks (unsigned int index) -{ - byte active_count, recovery_count; - - active_count = active_counts[index]; - if (active_count == 1) - ++active_count; - recovery_count = recovery_counts[index]; - if (active_count > 3 && recovery_count == 1) - ++recovery_count; - if (cmd640_chip_version > 1) - recovery_count += 1; /* cmd640b uses (count + 1)*/ - printk(", clocks=%d/%d/%d\n", setup_counts[index], active_count, recovery_count); -} - -/* - * Pack active and recovery counts into single byte representation - * used by controller - */ -inline static byte pack_nibbles (byte upper, byte lower) -{ - return ((upper & 0x0f) << 4) | (lower & 0x0f); -} - -/* - * This routine retrieves the initial drive timings from the chipset. - */ -static void __init retrieve_drive_counts (unsigned int index) -{ - byte b; - - /* - * Get the internal setup timing, and convert to clock count - */ - b = get_cmd640_reg(arttim_regs[index]) & ~0x3f; - switch (b) { - case 0x00: b = 4; break; - case 0x80: b = 3; break; - case 0x40: b = 2; break; - default: b = 5; break; - } - setup_counts[index] = b; - - /* - * Get the active/recovery counts - */ - b = get_cmd640_reg(drwtim_regs[index]); - active_counts[index] = (b >> 4) ? (b >> 4) : 0x10; - recovery_counts[index] = (b & 0x0f) ? (b & 0x0f) : 0x10; -} - - -/* - * This routine writes the prepared setup/active/recovery counts - * for a drive into the cmd640 chipset registers to active them. - */ -static void program_drive_counts (unsigned int index) -{ - unsigned long flags; - byte setup_count = setup_counts[index]; - byte active_count = active_counts[index]; - byte recovery_count = recovery_counts[index]; - - /* - * Set up address setup count and drive read/write timing registers. - * Primary interface has individual count/timing registers for - * each drive. Secondary interface has one common set of registers, - * so we merge the timings, using the slowest value for each timing. - */ - if (index > 1) { - unsigned int mate; - if (cmd_drives[mate = index ^ 1]->present) { - if (setup_count < setup_counts[mate]) - setup_count = setup_counts[mate]; - if (active_count < active_counts[mate]) - active_count = active_counts[mate]; - if (recovery_count < recovery_counts[mate]) - recovery_count = recovery_counts[mate]; - } - } - - /* - * Convert setup_count to internal chipset representation - */ - switch (setup_count) { - case 4: setup_count = 0x00; break; - case 3: setup_count = 0x80; break; - case 1: - case 2: setup_count = 0x40; break; - default: setup_count = 0xc0; /* case 5 */ - } - - /* - * Now that everything is ready, program the new timings - */ - save_flags (flags); - cli(); - /* - * Program the address_setup clocks into ARTTIM reg, - * and then the active/recovery counts into the DRWTIM reg - * (this converts counts of 16 into counts of zero -- okay). - */ - setup_count |= get_cmd640_reg(arttim_regs[index]) & 0x3f; - put_cmd640_reg(arttim_regs[index], setup_count); - put_cmd640_reg(drwtim_regs[index], pack_nibbles(active_count, recovery_count)); - restore_flags(flags); -} - -/* - * Set a specific pio_mode for a drive - */ -static void cmd640_set_mode (unsigned int index, byte pio_mode, unsigned int cycle_time) -{ - int setup_time, active_time, recovery_time, clock_time; - byte setup_count, active_count, recovery_count, recovery_count2, cycle_count; - int bus_speed = system_bus_clock(); - - if (pio_mode > 5) - pio_mode = 5; - setup_time = ide_pio_timings[pio_mode].setup_time; - active_time = ide_pio_timings[pio_mode].active_time; - recovery_time = cycle_time - (setup_time + active_time); - clock_time = 1000 / bus_speed; - cycle_count = (cycle_time + clock_time - 1) / clock_time; - - setup_count = (setup_time + clock_time - 1) / clock_time; - - active_count = (active_time + clock_time - 1) / clock_time; - if (active_count < 2) - active_count = 2; /* minimum allowed by cmd640 */ - - recovery_count = (recovery_time + clock_time - 1) / clock_time; - recovery_count2 = cycle_count - (setup_count + active_count); - if (recovery_count2 > recovery_count) - recovery_count = recovery_count2; - if (recovery_count < 2) - recovery_count = 2; /* minimum allowed by cmd640 */ - if (recovery_count > 17) { - active_count += recovery_count - 17; - recovery_count = 17; - } - if (active_count > 16) - active_count = 16; /* maximum allowed by cmd640 */ - if (cmd640_chip_version > 1) - recovery_count -= 1; /* cmd640b uses (count + 1)*/ - if (recovery_count > 16) - recovery_count = 16; /* maximum allowed by cmd640 */ - - setup_counts[index] = setup_count; - active_counts[index] = active_count; - recovery_counts[index] = recovery_count; - - /* - * In a perfect world, we might set the drive pio mode here - * (using WIN_SETFEATURE) before continuing. - * - * But we do not, because: - * 1) this is the wrong place to do it (proper is do_special() in ide.c) - * 2) in practice this is rarely, if ever, necessary - */ - program_drive_counts (index); -} - -/* - * Drive PIO mode selection: - */ -static void cmd640_tune_drive (ide_drive_t *drive, byte mode_wanted) -{ - byte b; - ide_pio_data_t d; - unsigned int index = 0; - - while (drive != cmd_drives[index]) { - if (++index > 3) { - printk("%s: bad news in cmd640_tune_drive\n", drive->name); - return; - } - } - switch (mode_wanted) { - case 6: /* set fast-devsel off */ - case 7: /* set fast-devsel on */ - mode_wanted &= 1; - b = get_cmd640_reg(CNTRL) & ~0x27; - if (mode_wanted) - b |= 0x27; - put_cmd640_reg(CNTRL, b); - printk("%s: %sabled cmd640 fast host timing (devsel)\n", drive->name, mode_wanted ? "en" : "dis"); - return; - - case 8: /* set prefetch off */ - case 9: /* set prefetch on */ - mode_wanted &= 1; - set_prefetch_mode(index, mode_wanted); - printk("%s: %sabled cmd640 prefetch\n", drive->name, mode_wanted ? "en" : "dis"); - return; - } - - (void) ide_get_best_pio_mode (drive, mode_wanted, 5, &d); - cmd640_set_mode (index, d.pio_mode, d.cycle_time); - - printk ("%s: selected cmd640 PIO mode%d (%dns)%s", - drive->name, - d.pio_mode, - d.cycle_time, - d.overridden ? " (overriding vendor mode)" : ""); - display_clocks(index); - return; -} - -#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ - -/* - * Probe for a cmd640 chipset, and initialize it if found. Called from ide.c - */ -int __init ide_probe_for_cmd640x (void) -{ -#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED - int second_port_toggled = 0; -#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ - int second_port_cmd640 = 0; - const char *bus_type, *port2; - unsigned int index; - byte b, cfr; - - if (cmd640_vlb && probe_for_cmd640_vlb()) { - bus_type = "VLB"; - } else { - cmd640_vlb = 0; - if (probe_for_cmd640_pci1()) - bus_type = "PCI (type1)"; - else if (probe_for_cmd640_pci2()) - bus_type = "PCI (type2)"; - else - return 0; - } - /* - * Undocumented magic (there is no 0x5b reg in specs) - */ - put_cmd640_reg(0x5b, 0xbd); - if (get_cmd640_reg(0x5b) != 0xbd) { - printk("ide: cmd640 init failed: wrong value in reg 0x5b\n"); - return 0; - } - put_cmd640_reg(0x5b, 0); - -#ifdef CMD640_DUMP_REGS - CMD640_DUMP_REGS; -#endif - - /* - * Documented magic begins here - */ - cfr = get_cmd640_reg(CFR); - cmd640_chip_version = cfr & CFR_DEVREV; - if (cmd640_chip_version == 0) { - printk ("ide: bad cmd640 revision: %d\n", cmd640_chip_version); - return 0; - } - - /* - * Initialize data for primary port - */ - setup_device_ptrs (); - printk("%s: buggy cmd640%c interface on %s, config=0x%02x\n", - cmd_hwif0->name, 'a' + cmd640_chip_version - 1, bus_type, cfr); - cmd_hwif0->chipset = ide_cmd640; -#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED - cmd_hwif0->tuneproc = &cmd640_tune_drive; -#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ - - /* - * Ensure compatibility by always using the slowest timings - * for access to the drive's command register block, - * and reset the prefetch burstsize to default (512 bytes). - * - * Maybe we need a way to NOT do these on *some* systems? - */ - put_cmd640_reg(CMDTIM, 0); - put_cmd640_reg(BRST, 0x40); - - /* - * Try to enable the secondary interface, if not already enabled - */ - if (cmd_hwif1->noprobe) { - port2 = "not probed"; - } else { - b = get_cmd640_reg(CNTRL); - if (secondary_port_responding()) { - if ((b & CNTRL_ENA_2ND)) { - second_port_cmd640 = 1; - port2 = "okay"; - } else if (cmd640_vlb) { - second_port_cmd640 = 1; - port2 = "alive"; - } else - port2 = "not cmd640"; - } else { - put_cmd640_reg(CNTRL, b ^ CNTRL_ENA_2ND); /* toggle the bit */ - if (secondary_port_responding()) { - second_port_cmd640 = 1; -#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED - second_port_toggled = 1; -#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ - port2 = "enabled"; - } else { - put_cmd640_reg(CNTRL, b); /* restore original setting */ - port2 = "not responding"; - } - } - } - - /* - * Initialize data for secondary cmd640 port, if enabled - */ - if (second_port_cmd640) { - cmd_hwif0->serialized = 1; - cmd_hwif1->serialized = 1; - cmd_hwif1->chipset = ide_cmd640; - cmd_hwif0->mate = cmd_hwif1; - cmd_hwif1->mate = cmd_hwif0; - cmd_hwif1->channel = 1; -#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED - cmd_hwif1->tuneproc = &cmd640_tune_drive; -#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ - } - printk("%s: %sserialized, secondary interface %s\n", cmd_hwif1->name, - cmd_hwif0->serialized ? "" : "not ", port2); - - /* - * Establish initial timings/prefetch for all drives. - * Do not unnecessarily disturb any prior BIOS setup of these. - */ - for (index = 0; index < (2 + (second_port_cmd640 << 1)); index++) { - ide_drive_t *drive = cmd_drives[index]; -#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED - if (drive->autotune || ((index > 1) && second_port_toggled)) { - /* - * Reset timing to the slowest speed and turn off prefetch. - * This way, the drive identify code has a better chance. - */ - setup_counts [index] = 4; /* max possible */ - active_counts [index] = 16; /* max possible */ - recovery_counts [index] = 16; /* max possible */ - program_drive_counts (index); - set_prefetch_mode (index, 0); - printk("cmd640: drive%d timings/prefetch cleared\n", index); - } else { - /* - * Record timings/prefetch without changing them. - * This preserves any prior BIOS setup. - */ - retrieve_drive_counts (index); - check_prefetch (index); - printk("cmd640: drive%d timings/prefetch(%s) preserved", - index, drive->no_io_32bit ? "off" : "on"); - display_clocks(index); - } -#else - /* - * Set the drive unmask flags to match the prefetch setting - */ - check_prefetch (index); - printk("cmd640: drive%d timings/prefetch(%s) preserved\n", - index, drive->no_io_32bit ? "off" : "on"); -#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ - } - -#ifdef CMD640_DUMP_REGS - CMD640_DUMP_REGS; -#endif - return 1; -} - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/cmd64x.c linux.20pre5-ac2/drivers/ide/cmd64x.c --- linux.20pre5/drivers/ide/cmd64x.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/cmd64x.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,1163 +0,0 @@ -/* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 - * - * linux/drivers/ide/cmd64x.c Version 1.22 June 9, 2000 - * - * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. - * Note, this driver is not used at all on other systems because - * there the "BIOS" has done all of the following already. - * Due to massive hardware bugs, UltraDMA is only supported - * on the 646U2 and not on the 646U. - * - * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) - * Copyright (C) 1998 David S. Miller (davem@redhat.com) - * Copyright (C) 1999-2000 Andre Hedrick - */ - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "ide_modes.h" - -#ifndef SPLIT_BYTE -#define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4))) -#endif - -#define CMD_DEBUG 0 - -#if CMD_DEBUG -#define cmdprintk(x...) printk(##x) -#else -#define cmdprintk(x...) -#endif - -/* - * CMD64x specific registers definition. - */ - -#define CFR 0x50 -#define CFR_INTR_CH0 0x02 -#define CNTRL 0x51 -#define CNTRL_DIS_RA0 0x40 -#define CNTRL_DIS_RA1 0x80 -#define CNTRL_ENA_2ND 0x08 - -#define CMDTIM 0x52 -#define ARTTIM0 0x53 -#define DRWTIM0 0x54 -#define ARTTIM1 0x55 -#define DRWTIM1 0x56 -#define ARTTIM23 0x57 -#define ARTTIM23_DIS_RA2 0x04 -#define ARTTIM23_DIS_RA3 0x08 -#define ARTTIM23_INTR_CH1 0x10 -#define ARTTIM2 0x57 -#define ARTTIM3 0x57 -#define DRWTIM23 0x58 -#define DRWTIM2 0x58 -#define BRST 0x59 -#define DRWTIM3 0x5b - -#define BMIDECR0 0x70 -#define MRDMODE 0x71 -#define MRDMODE_INTR_CH0 0x04 -#define MRDMODE_INTR_CH1 0x08 -#define MRDMODE_BLK_CH0 0x10 -#define MRDMODE_BLK_CH1 0x20 -#define BMIDESR0 0x72 -#define UDIDETCR0 0x73 -#define DTPR0 0x74 -#define BMIDECR1 0x78 -#define BMIDECSR 0x79 -#define BMIDESR1 0x7A -#define UDIDETCR1 0x7B -#define DTPR1 0x7C - -#define DISPLAY_CMD64X_TIMINGS - -#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static int cmd64x_get_info(char *, char **, off_t, int); -static int cmd680_get_info(char *, char **, off_t, int); -extern int (*cmd64x_display_info)(char *, char **, off_t, int); /* ide-proc.c */ -extern char *ide_media_verbose(ide_drive_t *); -static struct pci_dev *bmide_dev; - -static int cmd64x_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - u8 reg53 = 0, reg54 = 0, reg55 = 0, reg56 = 0; /* primary */ - u8 reg57 = 0, reg58 = 0, reg5b; /* secondary */ - u8 reg72 = 0, reg73 = 0; /* primary */ - u8 reg7a = 0, reg7b = 0; /* secondary */ - u8 reg50 = 0, reg71 = 0; /* extra */ - u8 hi_byte = 0, lo_byte = 0; - - switch(bmide_dev->device) { - case PCI_DEVICE_ID_CMD_649: - p += sprintf(p, "\n CMD649 Chipset.\n"); - break; - case PCI_DEVICE_ID_CMD_648: - p += sprintf(p, "\n CMD648 Chipset.\n"); - break; - case PCI_DEVICE_ID_CMD_646: - p += sprintf(p, "\n CMD646 Chipset.\n"); - break; - case PCI_DEVICE_ID_CMD_643: - p += sprintf(p, "\n CMD643 Chipset.\n"); - break; - default: - p += sprintf(p, "\n CMD64? Chipse.\n"); - break; - } - (void) pci_read_config_byte(bmide_dev, CFR, ®50); - (void) pci_read_config_byte(bmide_dev, ARTTIM0, ®53); - (void) pci_read_config_byte(bmide_dev, DRWTIM0, ®54); - (void) pci_read_config_byte(bmide_dev, ARTTIM1, ®55); - (void) pci_read_config_byte(bmide_dev, DRWTIM1, ®56); - (void) pci_read_config_byte(bmide_dev, ARTTIM2, ®57); - (void) pci_read_config_byte(bmide_dev, DRWTIM2, ®58); - (void) pci_read_config_byte(bmide_dev, DRWTIM3, ®5b); - (void) pci_read_config_byte(bmide_dev, MRDMODE, ®71); - (void) pci_read_config_byte(bmide_dev, BMIDESR0, ®72); - (void) pci_read_config_byte(bmide_dev, UDIDETCR0, ®73); - (void) pci_read_config_byte(bmide_dev, BMIDESR1, ®7a); - (void) pci_read_config_byte(bmide_dev, UDIDETCR1, ®7b); - - p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n"); - p += sprintf(p, " %sabled %sabled\n", - (reg72&0x80)?"dis":" en",(reg7a&0x80)?"dis":" en"); - p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n"); - p += sprintf(p, "DMA enabled: %s %s %s %s\n", - (reg72&0x20)?"yes":"no ",(reg72&0x40)?"yes":"no ",(reg7a&0x20)?"yes":"no ",(reg7a&0x40)?"yes":"no "); - p += sprintf(p, "DMA Mode: %s(%s) %s(%s) %s(%s) %s(%s)\n", - (reg72&0x20)?((reg73&0x01)?"UDMA":" DMA"):" PIO", - (reg72&0x20)?( ((reg73&0x30)==0x30)?(((reg73&0x35)==0x35)?"3":"0"): - ((reg73&0x20)==0x20)?(((reg73&0x25)==0x25)?"3":"1"): - ((reg73&0x10)==0x10)?(((reg73&0x15)==0x15)?"4":"2"): - ((reg73&0x00)==0x00)?(((reg73&0x05)==0x05)?"5":"2"):"X"):"?", - (reg72&0x40)?((reg73&0x02)?"UDMA":" DMA"):" PIO", - (reg72&0x40)?( ((reg73&0xC0)==0xC0)?(((reg73&0xC5)==0xC5)?"3":"0"): - ((reg73&0x80)==0x80)?(((reg73&0x85)==0x85)?"3":"1"): - ((reg73&0x40)==0x40)?(((reg73&0x4A)==0x4A)?"4":"2"): - ((reg73&0x00)==0x00)?(((reg73&0x0A)==0x0A)?"5":"2"):"X"):"?", - (reg7a&0x20)?((reg7b&0x01)?"UDMA":" DMA"):" PIO", - (reg7a&0x20)?( ((reg7b&0x30)==0x30)?(((reg7b&0x35)==0x35)?"3":"0"): - ((reg7b&0x20)==0x20)?(((reg7b&0x25)==0x25)?"3":"1"): - ((reg7b&0x10)==0x10)?(((reg7b&0x15)==0x15)?"4":"2"): - ((reg7b&0x00)==0x00)?(((reg7b&0x05)==0x05)?"5":"2"):"X"):"?", - (reg7a&0x40)?((reg7b&0x02)?"UDMA":" DMA"):" PIO", - (reg7a&0x40)?( ((reg7b&0xC0)==0xC0)?(((reg7b&0xC5)==0xC5)?"3":"0"): - ((reg7b&0x80)==0x80)?(((reg7b&0x85)==0x85)?"3":"1"): - ((reg7b&0x40)==0x40)?(((reg7b&0x4A)==0x4A)?"4":"2"): - ((reg7b&0x00)==0x00)?(((reg7b&0x0A)==0x0A)?"5":"2"):"X"):"?" ); - p += sprintf(p, "PIO Mode: %s %s %s %s\n", - "?", "?", "?", "?"); - p += sprintf(p, " %s %s\n", - (reg50 & CFR_INTR_CH0) ? "interrupting" : "polling ", - (reg57 & ARTTIM23_INTR_CH1) ? "interrupting" : "polling"); - p += sprintf(p, " %s %s\n", - (reg71 & MRDMODE_INTR_CH0) ? "pending" : "clear ", - (reg71 & MRDMODE_INTR_CH1) ? "pending" : "clear"); - p += sprintf(p, " %s %s\n", - (reg71 & MRDMODE_BLK_CH0) ? "blocked" : "enabled", - (reg71 & MRDMODE_BLK_CH1) ? "blocked" : "enabled"); - - SPLIT_BYTE(reg50, hi_byte, lo_byte); - p += sprintf(p, "CFR = 0x%02x, HI = 0x%02x, LOW = 0x%02x\n", reg50, hi_byte, lo_byte); - SPLIT_BYTE(reg57, hi_byte, lo_byte); - p += sprintf(p, "ARTTIM23 = 0x%02x, HI = 0x%02x, LOW = 0x%02x\n", reg57, hi_byte, lo_byte); - SPLIT_BYTE(reg71, hi_byte, lo_byte); - p += sprintf(p, "MRDMODE = 0x%02x, HI = 0x%02x, LOW = 0x%02x\n", reg71, hi_byte, lo_byte); - - return p-buffer; /* => must be less than 4k! */ -} - -static int cmd680_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - p += sprintf(p, "\n CMD680 Chipset.\n"); - p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n"); - p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n"); - p += sprintf(p, "PIO Mode: %s %s %s %s\n", - "?", "?", "?", "?"); - return p-buffer; /* => must be less than 4k! */ -} - -#endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */ - -byte cmd64x_proc = 0; -byte cmd680_proc = 0; - -/* - * Registers and masks for easy access by drive index: - */ -#if 0 -static byte prefetch_regs[4] = {CNTRL, CNTRL, ARTTIM23, ARTTIM23}; -static byte prefetch_masks[4] = {CNTRL_DIS_RA0, CNTRL_DIS_RA1, ARTTIM23_DIS_RA2, ARTTIM23_DIS_RA3}; -#endif - -/* - * This routine writes the prepared setup/active/recovery counts - * for a drive into the cmd646 chipset registers to active them. - */ -static void program_drive_counts (ide_drive_t *drive, int setup_count, int active_count, int recovery_count) -{ - unsigned long flags; - ide_drive_t *drives = HWIF(drive)->drives; - byte temp_b; - static const byte setup_counts[] = {0x40, 0x40, 0x40, 0x80, 0, 0xc0}; - static const byte recovery_counts[] = - {15, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0}; - static const byte arttim_regs[2][2] = { - { ARTTIM0, ARTTIM1 }, - { ARTTIM23, ARTTIM23 } - }; - static const byte drwtim_regs[2][2] = { - { DRWTIM0, DRWTIM1 }, - { DRWTIM2, DRWTIM3 } - }; - int channel = (int) HWIF(drive)->channel; - int slave = (drives != drive); /* Is this really the best way to determine this?? */ - - cmdprintk("program_drive_count parameters = s(%d),a(%d),r(%d),p(%d)\n", setup_count, - active_count, recovery_count, drive->present); - /* - * Set up address setup count registers. - * Primary interface has individual count/timing registers for - * each drive. Secondary interface has one common set of registers, - * for address setup so we merge these timings, using the slowest - * value. - */ - if (channel) { - drive->drive_data = setup_count; - setup_count = IDE_MAX(drives[0].drive_data, drives[1].drive_data); - cmdprintk("Secondary interface, setup_count = %d\n", setup_count); - } - - /* - * Convert values to internal chipset representation - */ - setup_count = (setup_count > 5) ? 0xc0 : (int) setup_counts[setup_count]; - active_count &= 0xf; /* Remember, max value is 16 */ - recovery_count = (int) recovery_counts[recovery_count]; - - cmdprintk("Final values = %d,%d,%d\n", setup_count, active_count, recovery_count); - - /* - * Now that everything is ready, program the new timings - */ - __save_flags (flags); - __cli(); - /* - * Program the address_setup clocks into ARTTIM reg, - * and then the active/recovery counts into the DRWTIM reg - */ - (void) pci_read_config_byte(HWIF(drive)->pci_dev, arttim_regs[channel][slave], &temp_b); - (void) pci_write_config_byte(HWIF(drive)->pci_dev, arttim_regs[channel][slave], - ((byte) setup_count) | (temp_b & 0x3f)); - (void) pci_write_config_byte(HWIF(drive)->pci_dev, drwtim_regs[channel][slave], - (byte) ((active_count << 4) | recovery_count)); - cmdprintk ("Write %x to %x\n", ((byte) setup_count) | (temp_b & 0x3f), arttim_regs[channel][slave]); - cmdprintk ("Write %x to %x\n", (byte) ((active_count << 4) | recovery_count), drwtim_regs[channel][slave]); - __restore_flags(flags); -} - -/* - * Attempts to set the interface PIO mode. - * The preferred method of selecting PIO modes (e.g. mode 4) is - * "echo 'piomode:4' > /proc/ide/hdx/settings". Special cases are - * 8: prefetch off, 9: prefetch on, 255: auto-select best mode. - * Called with 255 at boot time. - */ -static void cmd64x_tuneproc (ide_drive_t *drive, byte mode_wanted) -{ - int setup_time, active_time, recovery_time, clock_time, pio_mode, cycle_time; - byte recovery_count2, cycle_count; - int setup_count, active_count, recovery_count; - int bus_speed = system_bus_clock(); - /*byte b;*/ - ide_pio_data_t d; - - switch (mode_wanted) { - case 8: /* set prefetch off */ - case 9: /* set prefetch on */ - mode_wanted &= 1; - /*set_prefetch_mode(index, mode_wanted);*/ - cmdprintk("%s: %sabled cmd640 prefetch\n", drive->name, mode_wanted ? "en" : "dis"); - return; - } - - mode_wanted = ide_get_best_pio_mode (drive, mode_wanted, 5, &d); - pio_mode = d.pio_mode; - cycle_time = d.cycle_time; - - /* - * I copied all this complicated stuff from cmd640.c and made a few minor changes. - * For now I am just going to pray that it is correct. - */ - if (pio_mode > 5) - pio_mode = 5; - setup_time = ide_pio_timings[pio_mode].setup_time; - active_time = ide_pio_timings[pio_mode].active_time; - recovery_time = cycle_time - (setup_time + active_time); - clock_time = 1000 / bus_speed; - cycle_count = (cycle_time + clock_time - 1) / clock_time; - - setup_count = (setup_time + clock_time - 1) / clock_time; - - active_count = (active_time + clock_time - 1) / clock_time; - - recovery_count = (recovery_time + clock_time - 1) / clock_time; - recovery_count2 = cycle_count - (setup_count + active_count); - if (recovery_count2 > recovery_count) - recovery_count = recovery_count2; - if (recovery_count > 16) { - active_count += recovery_count - 16; - recovery_count = 16; - } - if (active_count > 16) - active_count = 16; /* maximum allowed by cmd646 */ - - /* - * In a perfect world, we might set the drive pio mode here - * (using WIN_SETFEATURE) before continuing. - * - * But we do not, because: - * 1) this is the wrong place to do it (proper is do_special() in ide.c) - * 2) in practice this is rarely, if ever, necessary - */ - program_drive_counts (drive, setup_count, active_count, recovery_count); - - cmdprintk("%s: selected cmd646 PIO mode%d : %d (%dns)%s, clocks=%d/%d/%d\n", - drive->name, pio_mode, mode_wanted, cycle_time, - d.overridden ? " (overriding vendor mode)" : "", - setup_count, active_count, recovery_count); -} - -static byte cmd680_taskfile_timing (ide_hwif_t *hwif) -{ - struct pci_dev *dev = hwif->pci_dev; - byte addr_mask = (hwif->channel) ? 0xB2 : 0xA2; - unsigned short timing; - - pci_read_config_word(dev, addr_mask, &timing); - - switch (timing) { - case 0x10c1: return 4; - case 0x10c3: return 3; - case 0x1281: return 2; - case 0x2283: return 1; - case 0x328a: - default: return 0; - } -} - -static void cmd680_tuneproc (ide_drive_t *drive, byte mode_wanted) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - byte drive_pci; - unsigned short speedt; - - switch (drive->dn) { - case 0: drive_pci = 0xA4; break; - case 1: drive_pci = 0xA6; break; - case 2: drive_pci = 0xB4; break; - case 3: drive_pci = 0xB6; break; - default: return; - } - - pci_read_config_word(dev, drive_pci, &speedt); - - /* cheat for now and use the docs */ -// switch(cmd680_taskfile_timing(hwif)) { - switch(mode_wanted) { - case 4: speedt = 0x10c1; break; - case 3: speedt = 0x10C3; break; - case 2: speedt = 0x1104; break; - case 1: speedt = 0x2283; break; - case 0: - default: speedt = 0x328A; break; - } - pci_write_config_word(dev, drive_pci, speedt); -} - -static void config_cmd64x_chipset_for_pio (ide_drive_t *drive, byte set_speed) -{ - byte speed = 0x00; - byte set_pio = ide_get_best_pio_mode(drive, 4, 5, NULL); - - cmd64x_tuneproc(drive, set_pio); - speed = XFER_PIO_0 + set_pio; - if (set_speed) - (void) ide_config_drive_speed(drive, speed); -} - -static void config_cmd680_chipset_for_pio (ide_drive_t *drive, byte set_speed) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - u8 unit = (drive->select.b.unit & 0x01); - u8 addr_mask = (hwif->channel) ? 0x84 : 0x80; - u8 speed = 0x00; - u8 mode_pci = 0x00; - u8 channel_timings = cmd680_taskfile_timing(hwif); - u8 set_pio = ide_get_best_pio_mode(drive, 4, 5, NULL); - - pci_read_config_byte(dev, addr_mask, &mode_pci); - mode_pci &= ~((unit) ? 0x30 : 0x03); - - /* WARNING PIO timing mess is going to happen b/w devices, argh */ - if ((channel_timings != set_pio) && (set_pio > channel_timings)) - set_pio = channel_timings; - - cmd680_tuneproc(drive, set_pio); - speed = XFER_PIO_0 + set_pio; - if (set_speed) { - (void) ide_config_drive_speed(drive, speed); - drive->current_speed = speed; - } -} - -static void config_chipset_for_pio (ide_drive_t *drive, byte set_speed) -{ - if (HWIF(drive)->pci_dev->device == PCI_DEVICE_ID_CMD_680) { - config_cmd680_chipset_for_pio(drive, set_speed); - } else { - config_cmd64x_chipset_for_pio(drive, set_speed); - } -} - -static int cmd64x_tune_chipset (ide_drive_t *drive, byte speed) -{ -#ifdef CONFIG_BLK_DEV_IDEDMA - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - int err = 0; - - u8 unit = (drive->select.b.unit & 0x01); - u8 pciU = (hwif->channel) ? UDIDETCR1 : UDIDETCR0; - u8 pciD = (hwif->channel) ? BMIDESR1 : BMIDESR0; - u8 regU = 0; - u8 regD = 0; - - if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0)) return 1; - - (void) pci_read_config_byte(dev, pciD, ®D); - (void) pci_read_config_byte(dev, pciU, ®U); - regD &= ~(unit ? 0x40 : 0x20); - regU &= ~(unit ? 0xCA : 0x35); - (void) pci_write_config_byte(dev, pciD, regD); - (void) pci_write_config_byte(dev, pciU, regU); - - (void) pci_read_config_byte(dev, pciD, ®D); - (void) pci_read_config_byte(dev, pciU, ®U); - switch(speed) { - case XFER_UDMA_5: regU |= (unit ? 0x0A : 0x05); break; - case XFER_UDMA_4: regU |= (unit ? 0x4A : 0x15); break; - case XFER_UDMA_3: regU |= (unit ? 0x8A : 0x25); break; - case XFER_UDMA_2: regU |= (unit ? 0x42 : 0x11); break; - case XFER_UDMA_1: regU |= (unit ? 0x82 : 0x21); break; - case XFER_UDMA_0: regU |= (unit ? 0xC2 : 0x31); break; - case XFER_MW_DMA_2: regD |= (unit ? 0x40 : 0x10); break; - case XFER_MW_DMA_1: regD |= (unit ? 0x80 : 0x20); break; - case XFER_MW_DMA_0: regD |= (unit ? 0xC0 : 0x30); break; - case XFER_SW_DMA_2: regD |= (unit ? 0x40 : 0x10); break; - case XFER_SW_DMA_1: regD |= (unit ? 0x80 : 0x20); break; - case XFER_SW_DMA_0: regD |= (unit ? 0xC0 : 0x30); break; -#else - int err = 0; - - switch(speed) { -#endif /* CONFIG_BLK_DEV_IDEDMA */ - case XFER_PIO_4: cmd64x_tuneproc(drive, 4); break; - case XFER_PIO_3: cmd64x_tuneproc(drive, 3); break; - case XFER_PIO_2: cmd64x_tuneproc(drive, 2); break; - case XFER_PIO_1: cmd64x_tuneproc(drive, 1); break; - case XFER_PIO_0: cmd64x_tuneproc(drive, 0); break; - - default: - return 1; - } - -#ifdef CONFIG_BLK_DEV_IDEDMA - (void) pci_write_config_byte(dev, pciU, regU); -#endif /* CONFIG_BLK_DEV_IDEDMA */ - - err = ide_config_drive_speed(drive, speed); - - drive->current_speed = speed; - -#ifdef CONFIG_BLK_DEV_IDEDMA - regD |= (unit ? 0x40 : 0x20); - (void) pci_write_config_byte(dev, pciD, regD); -#endif /* CONFIG_BLK_DEV_IDEDMA */ - - return err; -} - -static int cmd680_tune_chipset (ide_drive_t *drive, byte speed) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - u8 addr_mask = (hwif->channel) ? 0x84 : 0x80; - u8 unit = (drive->select.b.unit & 0x01); - u8 dma_pci = 0; - u8 udma_pci = 0; - u8 mode_pci = 0; - u8 scsc = 0; - u16 ultra = 0; - u16 multi = 0; - int err = 0; - - pci_read_config_byte(dev, addr_mask, &mode_pci); - pci_read_config_byte(dev, 0x8A, &scsc); - - switch (drive->dn) { - case 0: dma_pci = 0xA8; udma_pci = 0xAC; break; - case 1: dma_pci = 0xAA; udma_pci = 0xAE; break; - case 2: dma_pci = 0xB8; udma_pci = 0xBC; break; - case 3: dma_pci = 0xBA; udma_pci = 0xBE; break; - default: return 1; - } - - pci_read_config_byte(dev, addr_mask, &mode_pci); - mode_pci &= ~((unit) ? 0x30 : 0x03); - pci_read_config_word(dev, dma_pci, &multi); - pci_read_config_word(dev, udma_pci, &ultra); - - if ((speed == XFER_UDMA_6) && (scsc & 0x30) == 0x00) { - pci_write_config_byte(dev, 0x8A, scsc|0x01); - pci_read_config_byte(dev, 0x8A, &scsc); - } - - switch(speed) { -#ifdef CONFIG_BLK_DEV_IDEDMA - case XFER_UDMA_6: - if ((scsc & 0x30) == 0x00) - goto speed_break; - multi = 0x10C1; - ultra &= ~0x3F; - ultra |= 0x01; - break; -speed_break : - speed = XFER_UDMA_5; - case XFER_UDMA_5: - multi = 0x10C1; - ultra &= ~0x3F; - ultra |= (((scsc & 0x30) == 0x00) ? 0x01 : 0x02); - break; - case XFER_UDMA_4: - multi = 0x10C1; - ultra &= ~0x3F; - ultra |= (((scsc & 0x30) == 0x00) ? 0x02 : 0x03); - break; - case XFER_UDMA_3: - multi = 0x10C1; - ultra &= ~0x3F; - ultra |= (((scsc & 0x30) == 0x00) ? 0x04 : 0x05); - break; - case XFER_UDMA_2: - multi = 0x10C1; - ultra &= ~0x3F; - ultra |= (((scsc & 0x30) == 0x00) ? 0x05 : 0x07); - break; - case XFER_UDMA_1: - multi = 0x10C1; - ultra &= ~0x3F; - ultra |= (((scsc & 0x30) == 0x00) ? 0x07 : 0x0B); - break; - case XFER_UDMA_0: - multi = 0x10C1; - ultra &= ~0x3F; - ultra |= (((scsc & 0x30) == 0x00) ? 0x0C : 0x0F); - break; - case XFER_MW_DMA_2: - multi = 0x10C1; - break; - case XFER_MW_DMA_1: - multi = 0x10C2; - break; - case XFER_MW_DMA_0: - multi = 0x2208; - break; -#endif /* CONFIG_BLK_DEV_IDEDMA */ - case XFER_PIO_4: cmd680_tuneproc(drive, 4); break; - case XFER_PIO_3: cmd680_tuneproc(drive, 3); break; - case XFER_PIO_2: cmd680_tuneproc(drive, 2); break; - case XFER_PIO_1: cmd680_tuneproc(drive, 1); break; - case XFER_PIO_0: cmd680_tuneproc(drive, 0); break; - default: - return 1; - } - - - if (speed >= XFER_MW_DMA_0) - config_cmd680_chipset_for_pio(drive, 0); - - if (speed >= XFER_UDMA_0) - mode_pci |= ((unit) ? 0x30 : 0x03); - else if (speed >= XFER_MW_DMA_0) - mode_pci |= ((unit) ? 0x20 : 0x02); - else - mode_pci |= ((unit) ? 0x10 : 0x01); - - pci_write_config_byte(dev, addr_mask, mode_pci); - pci_write_config_word(dev, dma_pci, multi); - pci_write_config_word(dev, udma_pci, ultra); - - err = ide_config_drive_speed(drive, speed); - drive->current_speed = speed; - return err; -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -static int config_cmd64x_chipset_for_dma (ide_drive_t *drive, unsigned int rev, byte ultra_66) -{ - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - - byte speed = 0x00; - byte set_pio = 0x00; - byte udma_33 = ((rev >= 0x05) || (ultra_66)) ? 1 : 0; - byte udma_66 = eighty_ninty_three(drive); - byte udma_100 = 0; - int rval; - - switch(dev->device) { - case PCI_DEVICE_ID_CMD_649: udma_100 = 1; break; - case PCI_DEVICE_ID_CMD_648: - case PCI_DEVICE_ID_CMD_646: - case PCI_DEVICE_ID_CMD_643: - default: - break; - } - - if (drive->media != ide_disk) { - cmdprintk("CMD64X: drive->media != ide_disk at double check, inital check failed!!\n"); - return ((int) ide_dma_off); - } - - /* UltraDMA only supported on PCI646U and PCI646U2, - * which correspond to revisions 0x03, 0x05 and 0x07 respectively. - * Actually, although the CMD tech support people won't - * tell me the details, the 0x03 revision cannot support - * UDMA correctly without hardware modifications, and even - * then it only works with Quantum disks due to some - * hold time assumptions in the 646U part which are fixed - * in the 646U2. - * So we only do UltraDMA on revision 0x05 and 0x07 chipsets. - */ - if ((id->dma_ultra & 0x0020) && (udma_100) && (udma_66) && (udma_33)) { - speed = XFER_UDMA_5; - } else if ((id->dma_ultra & 0x0010) && (udma_66) && (udma_33)) { - speed = XFER_UDMA_4; - } else if ((id->dma_ultra & 0x0008) && (udma_66) && (udma_33)) { - speed = XFER_UDMA_3; - } else if ((id->dma_ultra & 0x0004) && (udma_33)) { - speed = XFER_UDMA_2; - } else if ((id->dma_ultra & 0x0002) && (udma_33)) { - speed = XFER_UDMA_1; - } else if ((id->dma_ultra & 0x0001) && (udma_33)) { - speed = XFER_UDMA_0; - } else if (id->dma_mword & 0x0004) { - speed = XFER_MW_DMA_2; - } else if (id->dma_mword & 0x0002) { - speed = XFER_MW_DMA_1; - } else if (id->dma_mword & 0x0001) { - speed = XFER_MW_DMA_0; - } else if (id->dma_1word & 0x0004) { - speed = XFER_SW_DMA_2; - } else if (id->dma_1word & 0x0002) { - speed = XFER_SW_DMA_1; - } else if (id->dma_1word & 0x0001) { - speed = XFER_SW_DMA_0; - } else { - set_pio = 1; - } - - if (!drive->init_speed) - drive->init_speed = speed; - - config_chipset_for_pio(drive, set_pio); - - if (set_pio) - return ((int) ide_dma_off_quietly); - - if (cmd64x_tune_chipset(drive, speed)) - return ((int) ide_dma_off); - - rval = (int)( ((id->dma_ultra >> 11) & 7) ? ide_dma_on : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ((id->dma_1word >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); - - return rval; -} - -static int config_cmd680_chipset_for_dma (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - byte udma_66 = eighty_ninty_three(drive); - byte speed = 0x00; - byte set_pio = 0x00; - int rval; - - if ((id->dma_ultra & 0x0040) && (udma_66)) speed = XFER_UDMA_6; - else if ((id->dma_ultra & 0x0020) && (udma_66)) speed = XFER_UDMA_5; - else if ((id->dma_ultra & 0x0010) && (udma_66)) speed = XFER_UDMA_4; - else if ((id->dma_ultra & 0x0008) && (udma_66)) speed = XFER_UDMA_3; - else if (id->dma_ultra & 0x0004) speed = XFER_UDMA_2; - else if (id->dma_ultra & 0x0002) speed = XFER_UDMA_1; - else if (id->dma_ultra & 0x0001) speed = XFER_UDMA_0; - else if (id->dma_mword & 0x0004) speed = XFER_MW_DMA_2; - else if (id->dma_mword & 0x0002) speed = XFER_MW_DMA_1; - else if (id->dma_mword & 0x0001) speed = XFER_MW_DMA_0; - else { - set_pio = 1; - } - - if (!drive->init_speed) - drive->init_speed = speed; - - config_chipset_for_pio(drive, set_pio); - - if (set_pio) - return ((int) ide_dma_off_quietly); - - if (cmd680_tune_chipset(drive, speed)) - return ((int) ide_dma_off); - - rval = (int)( ((id->dma_ultra >> 14) & 3) ? ide_dma_on : - ((id->dma_ultra >> 11) & 7) ? ide_dma_on : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ((id->dma_1word >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); - return rval; -} - -static int config_chipset_for_dma (ide_drive_t *drive, unsigned int rev, byte ultra_66) -{ - if (HWIF(drive)->pci_dev->device == PCI_DEVICE_ID_CMD_680) - return (config_cmd680_chipset_for_dma(drive)); - return (config_cmd64x_chipset_for_dma(drive, rev, ultra_66)); -} - -static int cmd64x_config_drive_for_dma (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - unsigned int class_rev = 0; - byte can_ultra_33 = 0; - byte can_ultra_66 = 0; - byte can_ultra_100 = 0; - byte can_ultra_133 = 0; - ide_dma_action_t dma_func = ide_dma_on; - - pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); - class_rev &= 0xff; - - switch(dev->device) { - case PCI_DEVICE_ID_CMD_680: - can_ultra_133 = 1; - case PCI_DEVICE_ID_CMD_649: - can_ultra_100 = 1; - case PCI_DEVICE_ID_CMD_648: - can_ultra_66 = 1; - case PCI_DEVICE_ID_CMD_643: - can_ultra_33 = 1; - break; - case PCI_DEVICE_ID_CMD_646: - can_ultra_33 = (class_rev >= 0x05) ? 1 : 0; - can_ultra_66 = 0; - can_ultra_100 = 0; - break; - default: - return hwif->dmaproc(ide_dma_off, drive); - } - - if ((id != NULL) && ((id->capability & 1) != 0) && - hwif->autodma && (drive->media == ide_disk)) { - /* Consult the list of known "bad" drives */ - if (ide_dmaproc(ide_dma_bad_drive, drive)) { - dma_func = ide_dma_off; - goto fast_ata_pio; - } - dma_func = ide_dma_off_quietly; - if ((id->field_valid & 4) && (can_ultra_33)) { - if (id->dma_ultra & 0x007F) { - /* Force if Capable UltraDMA */ - dma_func = config_chipset_for_dma(drive, class_rev, can_ultra_66); - if ((id->field_valid & 2) && - (dma_func != ide_dma_on)) - goto try_dma_modes; - } - } else if (id->field_valid & 2) { -try_dma_modes: - if ((id->dma_mword & 0x0007) || - (id->dma_1word & 0x0007)) { - /* Force if Capable regular DMA modes */ - dma_func = config_chipset_for_dma(drive, class_rev, 0); - if (dma_func != ide_dma_on) - goto no_dma_set; - } - } else if (ide_dmaproc(ide_dma_good_drive, drive)) { - if (id->eide_dma_time > 150) { - goto no_dma_set; - } - /* Consult the list of known "good" drives */ - dma_func = config_chipset_for_dma(drive, class_rev, 0); - if (dma_func != ide_dma_on) - goto no_dma_set; - } else { - goto fast_ata_pio; - } - } else if ((id->capability & 8) || (id->field_valid & 2)) { -fast_ata_pio: - dma_func = ide_dma_off_quietly; -no_dma_set: - config_chipset_for_pio(drive, 1); - } - return HWIF(drive)->dmaproc(dma_func, drive); -} - -static int cmd680_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - switch (func) { - case ide_dma_check: - return cmd64x_config_drive_for_dma(drive); - default: - break; - } - /* Other cases are done by generic IDE-DMA code. */ - return ide_dmaproc(func, drive); -} - -static int cmd64x_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - byte dma_stat = 0; - byte dma_alt_stat = 0; - byte mask = (HWIF(drive)->channel) ? MRDMODE_INTR_CH1 : MRDMODE_INTR_CH0; - unsigned long dma_base = HWIF(drive)->dma_base; - struct pci_dev *dev = HWIF(drive)->pci_dev; - byte jack_slap = ((dev->device == PCI_DEVICE_ID_CMD_648) || (dev->device == PCI_DEVICE_ID_CMD_649)) ? 1 : 0; - - switch (func) { - case ide_dma_check: - return cmd64x_config_drive_for_dma(drive); - case ide_dma_end: /* returns 1 on error, 0 otherwise */ - drive->waiting_for_dma = 0; - outb(inb(dma_base)&~1, dma_base); /* stop DMA */ - dma_stat = inb(dma_base+2); /* get DMA status */ - outb(dma_stat|6, dma_base+2); /* clear the INTR & ERROR bits */ - if (jack_slap) { - byte dma_intr = 0; - byte dma_mask = (HWIF(drive)->channel) ? ARTTIM23_INTR_CH1 : CFR_INTR_CH0; - byte dma_reg = (HWIF(drive)->channel) ? ARTTIM2 : CFR; - (void) pci_read_config_byte(dev, dma_reg, &dma_intr); - /* - * DAMN BMIDE is not connected to PCI space! - * Have to manually jack-slap that bitch! - * To allow the PCI side to read incoming interrupts. - */ - (void) pci_write_config_byte(dev, dma_reg, dma_intr|dma_mask); /* clear the INTR bit */ - } - ide_destroy_dmatable(drive); /* purge DMA mappings */ - return (dma_stat & 7) != 4; /* verify good DMA status */ - case ide_dma_test_irq: /* returns 1 if dma irq issued, 0 otherwise */ - dma_stat = inb(dma_base+2); - (void) pci_read_config_byte(dev, MRDMODE, &dma_alt_stat); -#ifdef DEBUG - printk("%s: dma_stat: 0x%02x dma_alt_stat: 0x%02x mask: 0x%02x\n", drive->name, dma_stat, dma_alt_stat, mask); -#endif - if (!(dma_alt_stat & mask)) { - return 0; - } - return (dma_stat & 4) == 4; /* return 1 if INTR asserted */ - default: - break; - } - /* Other cases are done by generic IDE-DMA code. */ - return ide_dmaproc(func, drive); -} - -/* - * ASUS P55T2P4D with CMD646 chipset revision 0x01 requires the old - * event order for DMA transfers. - */ -static int cmd646_1_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - ide_hwif_t *hwif = HWIF(drive); - unsigned long dma_base = hwif->dma_base; - byte dma_stat; - - switch (func) { - case ide_dma_check: - return cmd64x_config_drive_for_dma(drive); - case ide_dma_end: - drive->waiting_for_dma = 0; - dma_stat = inb(dma_base+2); /* get DMA status */ - outb(inb(dma_base)&~1, dma_base); /* stop DMA */ - outb(dma_stat|6, dma_base+2); /* clear the INTR & ERROR bits */ - ide_destroy_dmatable(drive); /* and free any DMA resources */ - return (dma_stat & 7) != 4; /* verify good DMA status */ - default: - break; - } - - /* Other cases are done by generic IDE-DMA code. */ - return ide_dmaproc(func, drive); -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -static int cmd680_busproc (ide_drive_t * drive, int state) -{ -#if 0 - ide_hwif_t *hwif = HWIF(drive); - u8 addr_mask = (hwif->channel) ? 0xB0 : 0xA0; - u32 stat_config = 0; - - pci_read_config_dword(hwif->pci_dev, addr_mask, &stat_config); - - if (!hwif) - return -EINVAL; - - switch (state) { - case BUSSTATE_ON: - hwif->drives[0].failures = 0; - hwif->drives[1].failures = 0; - break; - case BUSSTATE_OFF: - hwif->drives[0].failures = hwif->drives[0].max_failures + 1; - hwif->drives[1].failures = hwif->drives[1].max_failures + 1; - break; - case BUSSTATE_TRISTATE: - hwif->drives[0].failures = hwif->drives[0].max_failures + 1; - hwif->drives[1].failures = hwif->drives[1].max_failures + 1; - break; - default: - return 0; - } - hwif->bus_state = state; -#endif - return 0; -} - -void cmd680_reset (ide_drive_t *drive) -{ -#if 0 - ide_hwif_t *hwif = HWIF(drive); - u8 addr_mask = (hwif->channel) ? 0xB0 : 0xA0; - byte reset = 0; - - pci_read_config_byte(hwif->pci_dev, addr_mask, &reset); - pci_write_config_byte(hwif->pci_dev, addr_mask, reset|0x03); -#endif -} - -unsigned int cmd680_pci_init (struct pci_dev *dev, const char *name) -{ - u8 tmpbyte = 0; - pci_write_config_byte(dev, 0x80, 0x00); - pci_write_config_byte(dev, 0x84, 0x00); - pci_read_config_byte(dev, 0x8A, &tmpbyte); - pci_write_config_byte(dev, 0x8A, tmpbyte|0x01); - pci_write_config_word(dev, 0xA2, 0x328A); - pci_write_config_dword(dev, 0xA4, 0x328A); - pci_write_config_dword(dev, 0xA8, 0x4392); - pci_write_config_dword(dev, 0xAC, 0x4009); - pci_write_config_word(dev, 0xB2, 0x328A); - pci_write_config_dword(dev, 0xB4, 0x328A); - pci_write_config_dword(dev, 0xB8, 0x4392); - pci_write_config_dword(dev, 0xBC, 0x4009); - -#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) - if (!cmd64x_proc) { - cmd64x_proc = 1; - bmide_dev = dev; - cmd64x_display_info = &cmd680_get_info; - } -#endif /* DISPLAY_CMD64X_TIMINGS && CONFIG_PROC_FS */ - return 0; -} - -unsigned int cmd64x_pci_init (struct pci_dev *dev, const char *name) -{ - unsigned char mrdmode; - unsigned int class_rev; - - pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); - class_rev &= 0xff; - -#ifdef __i386__ - if (dev->resource[PCI_ROM_RESOURCE].start) { - pci_write_config_byte(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); - printk("%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start); - } -#endif - - switch(dev->device) { - case PCI_DEVICE_ID_CMD_643: - break; - case PCI_DEVICE_ID_CMD_646: - printk("%s: chipset revision 0x%02X, ", name, class_rev); - switch(class_rev) { - case 0x07: - case 0x05: - printk("UltraDMA Capable"); - break; - case 0x03: - printk("MultiWord DMA Force Limited"); - break; - case 0x01: - default: - printk("MultiWord DMA Limited, IRQ workaround enabled"); - break; - } - printk("\n"); - break; - case PCI_DEVICE_ID_CMD_648: - case PCI_DEVICE_ID_CMD_649: - break; - default: - break; - } - - /* Set a good latency timer and cache line size value. */ - (void) pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64); -#ifdef __sparc_v9__ - (void) pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 0x10); -#endif - - - /* Setup interrupts. */ - (void) pci_read_config_byte(dev, MRDMODE, &mrdmode); - mrdmode &= ~(0x30); - (void) pci_write_config_byte(dev, MRDMODE, mrdmode); - - /* Use MEMORY READ LINE for reads. - * NOTE: Although not mentioned in the PCI0646U specs, - * these bits are write only and won't be read - * back as set or not. The PCI0646U2 specs clarify - * this point. - */ - (void) pci_write_config_byte(dev, MRDMODE, mrdmode | 0x02); - - /* Set reasonable active/recovery/address-setup values. */ - (void) pci_write_config_byte(dev, ARTTIM0, 0x40); - (void) pci_write_config_byte(dev, DRWTIM0, 0x3f); - (void) pci_write_config_byte(dev, ARTTIM1, 0x40); - (void) pci_write_config_byte(dev, DRWTIM1, 0x3f); -#ifdef __i386__ - (void) pci_write_config_byte(dev, ARTTIM23, 0x1c); -#else - (void) pci_write_config_byte(dev, ARTTIM23, 0x5c); -#endif - (void) pci_write_config_byte(dev, DRWTIM23, 0x3f); - (void) pci_write_config_byte(dev, DRWTIM3, 0x3f); -#ifdef CONFIG_PPC - (void) pci_write_config_byte(dev, UDIDETCR0, 0xf0); -#endif /* CONFIG_PPC */ - -#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) - if (!cmd64x_proc) { - cmd64x_proc = 1; - bmide_dev = dev; - cmd64x_display_info = &cmd64x_get_info; - } -#endif /* DISPLAY_CMD64X_TIMINGS && CONFIG_PROC_FS */ - - return 0; -} - -unsigned int __init pci_init_cmd64x (struct pci_dev *dev, const char *name) -{ - if (dev->device == PCI_DEVICE_ID_CMD_680) - return cmd680_pci_init (dev, name); - return cmd64x_pci_init (dev, name); -} - -unsigned int cmd680_ata66 (ide_hwif_t *hwif) -{ - byte ata66 = 0; - byte addr_mask = (hwif->channel) ? 0xB0 : 0xA0; - - pci_read_config_byte(hwif->pci_dev, addr_mask, &ata66); - return (ata66 & 0x01) ? 1 : 0; -} - -unsigned int cmd64x_ata66 (ide_hwif_t *hwif) -{ - byte ata66 = 0; - byte mask = (hwif->channel) ? 0x02 : 0x01; - - pci_read_config_byte(hwif->pci_dev, BMIDECSR, &ata66); - return (ata66 & mask) ? 1 : 0; -} - -unsigned int __init ata66_cmd64x (ide_hwif_t *hwif) -{ - struct pci_dev *dev = hwif->pci_dev; - if (dev->device == PCI_DEVICE_ID_CMD_680) - return cmd680_ata66(hwif); - return cmd64x_ata66(hwif); -} - -void __init ide_init_cmd64x (ide_hwif_t *hwif) -{ - struct pci_dev *dev = hwif->pci_dev; - unsigned int class_rev; - - pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); - class_rev &= 0xff; - - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - - if (!hwif->dma_base) - return; - -#ifdef CONFIG_BLK_DEV_IDEDMA - switch(dev->device) { - case PCI_DEVICE_ID_CMD_680: - hwif->busproc = &cmd680_busproc; - hwif->dmaproc = &cmd680_dmaproc; - hwif->resetproc = &cmd680_reset; - hwif->speedproc = &cmd680_tune_chipset; - hwif->tuneproc = &cmd680_tuneproc; - break; - case PCI_DEVICE_ID_CMD_649: - case PCI_DEVICE_ID_CMD_648: - case PCI_DEVICE_ID_CMD_643: - hwif->dmaproc = &cmd64x_dmaproc; - hwif->tuneproc = &cmd64x_tuneproc; - hwif->speedproc = &cmd64x_tune_chipset; - break; - case PCI_DEVICE_ID_CMD_646: - hwif->chipset = ide_cmd646; - if (class_rev == 0x01) { - hwif->dmaproc = &cmd646_1_dmaproc; - } else { - hwif->dmaproc = &cmd64x_dmaproc; - } - hwif->tuneproc = &cmd64x_tuneproc; - hwif->speedproc = &cmd64x_tune_chipset; - break; - default: - break; - } -#endif /* CONFIG_BLK_DEV_IDEDMA */ -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/Config.in linux.20pre5-ac2/drivers/ide/Config.in --- linux.20pre5/drivers/ide/Config.in 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/Config.in 2002-09-02 15:07:45.000000000 +0100 @@ -29,12 +29,13 @@ dep_tristate ' PCMCIA IDE support' CONFIG_BLK_DEV_IDECS $CONFIG_BLK_DEV_IDE $CONFIG_PCMCIA dep_tristate ' Include IDE/ATAPI CDROM support' CONFIG_BLK_DEV_IDECD $CONFIG_BLK_DEV_IDE + dep_mbool ' Reduce media failure retries support' CONFIG_BLK_DEV_IDECD_BAILOUT $CONFIG_BLK_DEV_IDECD dep_tristate ' Include IDE/ATAPI TAPE support' CONFIG_BLK_DEV_IDETAPE $CONFIG_BLK_DEV_IDE dep_tristate ' Include IDE/ATAPI FLOPPY support' CONFIG_BLK_DEV_IDEFLOPPY $CONFIG_BLK_DEV_IDE dep_tristate ' SCSI emulation support' CONFIG_BLK_DEV_IDESCSI $CONFIG_BLK_DEV_IDE $CONFIG_SCSI bool ' IDE Taskfile Access' CONFIG_IDE_TASK_IOCTL -# bool ' IDE Taskfile IO' CONFIG_IDE_TASKFILE_IO + bool ' IDE Taskfile IO' CONFIG_IDE_TASKFILE_IO comment 'IDE chipset support/bugfixes' if [ "$CONFIG_BLK_DEV_IDE" != "n" ]; then @@ -42,9 +43,9 @@ dep_bool ' CMD640 enhanced support' CONFIG_BLK_DEV_CMD640_ENHANCED $CONFIG_BLK_DEV_CMD640 dep_bool ' ISA-PNP EIDE support' CONFIG_BLK_DEV_ISAPNP $CONFIG_ISAPNP if [ "$CONFIG_PCI" = "y" ]; then - dep_bool ' RZ1000 chipset bugfix/support' CONFIG_BLK_DEV_RZ1000 $CONFIG_X86 bool ' Generic PCI IDE chipset support' CONFIG_BLK_DEV_IDEPCI if [ "$CONFIG_BLK_DEV_IDEPCI" = "y" ]; then + dep_bool ' Orphan Chipset Support' CONFIG_BLK_DEV_GENERIC $CONFIG_BLK_DEV_IDEPCI bool ' Sharing PCI IDE interrupts support' CONFIG_IDEPCI_SHARE_IRQ bool ' Generic PCI bus-master DMA support' CONFIG_BLK_DEV_IDEDMA_PCI bool ' Boot off-board chipsets first support' CONFIG_BLK_DEV_OFFBOARD @@ -53,20 +54,17 @@ dep_bool ' Enable DMA only for disks ' CONFIG_IDEDMA_ONLYDISK $CONFIG_IDEDMA_PCI_AUTO define_bool CONFIG_BLK_DEV_IDEDMA $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' ATA Work(s) In Progress (EXPERIMENTAL)' CONFIG_IDEDMA_PCI_WIP $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_EXPERIMENTAL - dep_bool ' Attempt to HACK around Chipsets that TIMEOUT (WIP)' CONFIG_BLK_DEV_IDEDMA_TIMEOUT $CONFIG_IDEDMA_PCI_WIP dep_bool ' Good-Bad DMA Model-Firmware (WIP)' CONFIG_IDEDMA_NEW_DRIVE_LISTINGS $CONFIG_IDEDMA_PCI_WIP -# dep_bool ' Asynchronous DMA support (WIP) (EXPERIMENTAL)' CONFIG_BLK_DEV_ADMA $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_IDEDMA_PCI_WIP $CONFIG_EXPERIMENTAL - define_bool CONFIG_BLK_DEV_ADMA $CONFIG_BLK_DEV_IDEDMA_PCI +# dep_bool ' Asynchronous DMA support (WIP) (EXPERIMENTAL)' CONFIG_BLK_DEV_ADMA $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_IDEDMA_PCI_WIP $CONFIG_EXPERIMENTAL + define_bool CONFIG_BLK_DEV_ADMA $CONFIG_BLK_DEV_IDEDMA_PCI # dep_bool ' Tag Command Queue DMA support (WIP) (EXPERIMENTAL)' CONFIG_BLK_DEV_IDEDMA_TCQ $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_IDEDMA_PCI_WIP $CONFIG_EXPERIMENTAL dep_bool ' AEC62XX chipset support' CONFIG_BLK_DEV_AEC62XX $CONFIG_BLK_DEV_IDEDMA_PCI - dep_mbool ' AEC62XX Tuning support' CONFIG_AEC62XX_TUNING $CONFIG_BLK_DEV_AEC62XX dep_bool ' ALI M15x3 chipset support' CONFIG_BLK_DEV_ALI15X3 $CONFIG_BLK_DEV_IDEDMA_PCI dep_mbool ' ALI M15x3 WDC support (DANGEROUS)' CONFIG_WDC_ALI15X3 $CONFIG_BLK_DEV_ALI15X3 dep_bool ' AMD Viper support' CONFIG_BLK_DEV_AMD74XX $CONFIG_BLK_DEV_IDEDMA_PCI - dep_mbool ' AMD Viper ATA-66 Override (WIP)' CONFIG_AMD74XX_OVERRIDE $CONFIG_BLK_DEV_AMD74XX $CONFIG_IDEDMA_PCI_WIP - dep_bool ' CMD64X and CMD680 chipset support' CONFIG_BLK_DEV_CMD64X $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' CMD680 chipset tuning support' CONFIG_BLK_DEV_CMD680 $CONFIG_BLK_DEV_CMD64X + dep_mbool ' AMD Viper ATA-66 Override' CONFIG_AMD74XX_OVERRIDE $CONFIG_BLK_DEV_AMD74XX + dep_bool ' CMD64{3|6|8|9} chipset support' CONFIG_BLK_DEV_CMD64X $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' CY82C693 chipset support' CONFIG_BLK_DEV_CY82C693 $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' Cyrix CS5530 MediaGX chipset support' CONFIG_BLK_DEV_CS5530 $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' HPT34X chipset support' CONFIG_BLK_DEV_HPT34X $CONFIG_BLK_DEV_IDEDMA_PCI @@ -74,25 +72,27 @@ dep_bool ' HPT366/368/370 chipset support' CONFIG_BLK_DEV_HPT366 $CONFIG_BLK_DEV_IDEDMA_PCI if [ "$CONFIG_X86" = "y" -o "$CONFIG_IA64" = "y" ]; then dep_mbool ' Intel PIIXn chipsets support' CONFIG_BLK_DEV_PIIX $CONFIG_BLK_DEV_IDEDMA_PCI - dep_mbool ' PIIXn Tuning support' CONFIG_PIIX_TUNING $CONFIG_BLK_DEV_PIIX $CONFIG_IDEDMA_PCI_AUTO fi if [ "$CONFIG_MIPS_ITE8172" = "y" -o "$CONFIG_MIPS_IVR" = "y" ]; then dep_mbool ' IT8172 IDE support' CONFIG_BLK_DEV_IT8172 $CONFIG_BLK_DEV_IDEDMA_PCI - dep_mbool ' IT8172 IDE Tuning support' CONFIG_IT8172_TUNING $CONFIG_BLK_DEV_IT8172 $CONFIG_IDEDMA_PCI_AUTO fi - dep_bool ' NS87415 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_NS87415 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_EXPERIMENTAL + dep_bool ' nVidia NFORCE support' CONFIG_BLK_DEV_NFORCE $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' NS87415 chipset support' CONFIG_BLK_DEV_NS87415 $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' OPTi 82C621 chipset enhanced support (EXPERIMENTAL)' CONFIG_BLK_DEV_OPTI621 $CONFIG_EXPERIMENTAL -# dep_mbool ' Pacific Digital A-DMA support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC_ADMA $CONFIG_BLK_DEV_ADMA $CONFIG_IDEDMA_PCI_WIP $CONFIG_EXPERIMENTAL - dep_bool ' PROMISE PDC202{46|62|65|67|68|69|70} support' CONFIG_BLK_DEV_PDC202XX $CONFIG_BLK_DEV_IDEDMA_PCI - dep_bool ' Special UDMA Feature' CONFIG_PDC202XX_BURST $CONFIG_BLK_DEV_PDC202XX +# dep_bool ' Pacific Digital ADMA100 basic support' CONFIG_BLK_DEV_ADMA100 $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' PROMISE PDC202{46|62|65|67} support' CONFIG_BLK_DEV_PDC202XX_OLD $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' Special UDMA Feature' CONFIG_PDC202XX_BURST $CONFIG_BLK_DEV_PDC202XX_OLD $CONFI_BLK_DEV_IDEDMA_PCI + dep_bool ' PROMISE PDC202{68|69|70|71|75|76|77} support' CONFIG_BLK_DEV_PDC202XX_NEW $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' Special FastTrak Feature' CONFIG_PDC202XX_FORCE $CONFIG_BLK_DEV_PDC202XX - dep_bool ' ServerWorks OSB4/CSB5 chipsets support' CONFIG_BLK_DEV_SVWKS $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86 + dep_bool ' RZ1000 chipset bugfix/support' CONFIG_BLK_DEV_RZ1000 $CONFIG_X86 + dep_bool ' ServerWorks OSB4/CSB5/CSB6 chipsets support' CONFIG_BLK_DEV_SVWKS $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' Silicon Image chipset support' CONFIG_BLK_DEV_SIIMAGE $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' SiS5513 chipset support' CONFIG_BLK_DEV_SIS5513 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86 - dep_bool ' SLC90E66 chipset support' CONFIG_BLK_DEV_SLC90E66 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_X86 - dep_bool ' Tekram TRM290 chipset support (EXPERIMENTAL)' CONFIG_BLK_DEV_TRM290 $CONFIG_BLK_DEV_IDEDMA_PCI $CONFIG_EXPERIMENTAL + dep_bool ' SLC90E66 chipset support' CONFIG_BLK_DEV_SLC90E66 $CONFIG_BLK_DEV_IDEDMA_PCI + dep_bool ' Tekram TRM290 chipset support' CONFIG_BLK_DEV_TRM290 $CONFIG_BLK_DEV_IDEDMA_PCI dep_bool ' VIA82CXXX chipset support' CONFIG_BLK_DEV_VIA82CXXX $CONFIG_BLK_DEV_IDEDMA_PCI if [ "$CONFIG_PPC" = "y" -o "$CONFIG_ARM" = "y" ]; then - bool ' Winbond SL82c105 support' CONFIG_BLK_DEV_SL82C105 + dep_bool ' Winbond SL82c105 support' CONFIG_BLK_DEV_SL82C105 $CONFIG_BLK_DEV_IDEPCI fi fi fi @@ -149,14 +149,12 @@ if [ "$CONFIG_IDE_CHIPSETS" = "y" ]; then comment 'Note: most of these also require special kernel boot parameters' bool ' Generic 4 drives/port support' CONFIG_BLK_DEV_4DRIVES - bool ' ALI M14xx support' CONFIG_BLK_DEV_ALI14XX - bool ' DTC-2278 support' CONFIG_BLK_DEV_DTC2278 - bool ' Holtek HT6560B support' CONFIG_BLK_DEV_HT6560B - if [ "$CONFIG_BLK_DEV_IDEDISK" = "y" -a "$CONFIG_EXPERIMENTAL" = "y" ]; then - bool ' PROMISE DC4030 support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC4030 - fi - bool ' QDI QD65xx support' CONFIG_BLK_DEV_QD65XX - bool ' UMC-8672 support' CONFIG_BLK_DEV_UMC8672 + dep_tristate ' ALI M14xx support' CONFIG_BLK_DEV_ALI14XX $CONFIG_BLK_DEV_IDE + dep_tristate ' DTC-2278 support' CONFIG_BLK_DEV_DTC2278 $CONFIG_BLK_DEV_IDE + dep_tristate ' Holtek HT6560B support' CONFIG_BLK_DEV_HT6560B $CONFIG_BLK_DEV_IDE + dep_tristate ' PROMISE DC4030 support (EXPERIMENTAL)' CONFIG_BLK_DEV_PDC4030 $CONFIG_BLK_DEV_IDEDISK $CONFIG_EXPERIMENTAL + dep_tristate ' QDI QD65xx support' CONFIG_BLK_DEV_QD65XX $CONFIG_BLK_DEV_IDE + dep_tristate ' UMC-8672 support' CONFIG_BLK_DEV_UMC8672 $CONFIG_BLK_DEV_IDE fi fi else @@ -184,7 +182,26 @@ define_bool CONFIG_DMA_NONPCI n fi -if [ "$CONFIG_IDE_CHIPSETS" = "y" -o \ +if [ "$CONFIG_BLK_DEV_IDEDMA_PCI" = "y" ]; then + if [ "$CONFIG_BLK_DEV_PDC202XX_OLD" != "n" -o \ + "$CONFIG_BLK_DEV_PDC202XX_NEW" != "n" ]; then + define_bool CONFIG_BLK_DEV_PDC202XX y + fi +fi + +##if [ "$CONFIG_IDE_TASKFILE_IO" = "y" ]; then +## dep_mbool CONFIG_BLK_DEV_TF_DISK $CONFIG_BLK_DEV_IDEDISK +##else +## dep_mbool CONFIG_BLK_DEV_NTF_DISK $CONFIG_BLK_DEV_IDEDISK +##fi + +if [ "$CONFIG_BLK_DEV_4DRIVES" = "y" -o \ + "$CONFIG_BLK_DEV_ALI14XX" != "n" -o \ + "$CONFIG_BLK_DEV_DTC2278" != "n" -o \ + "$CONFIG_BLK_DEV_HT6560B" != "n" -o \ + "$CONFIG_BLK_DEV_PDC4030" != "n" -o \ + "$CONFIG_BLK_DEV_QD65XX" != "n" -o \ + "$CONFIG_BLK_DEV_UMC8672" != "n" -o \ "$CONFIG_BLK_DEV_AEC62XX" = "y" -o \ "$CONFIG_BLK_DEV_ALI15X3" = "y" -o \ "$CONFIG_BLK_DEV_AMD74XX" = "y" -o \ @@ -195,16 +212,19 @@ "$CONFIG_BLK_DEV_HPT34X" = "y" -o \ "$CONFIG_BLK_DEV_HPT366" = "y" -o \ "$CONFIG_BLK_DEV_IDE_PMAC" = "y" -o \ + "$CONFIG_BLK_DEV_IT8172" = "y" -o \ + "$CONFIG_BLK_DEV_MPC8xx_IDE" = "y" -o \ + "$CONFIG_BLK_DEV_NFORCE" = "y" -o \ "$CONFIG_BLK_DEV_OPTI621" = "y" -o \ "$CONFIG_BLK_DEV_SVWKS" = "y" -o \ "$CONFIG_BLK_DEV_PDC202XX" = "y" -o \ "$CONFIG_BLK_DEV_PIIX" = "y" -o \ - "$CONFIG_BLK_DEV_IT8172" = "y" -o \ + "$CONFIG_BLK_DEV_SVWKS" = "y" -o \ + "$CONFIG_BLK_DEV_SIIMAGE" = "y" -o \ "$CONFIG_BLK_DEV_SIS5513" = "y" -o \ - "$CONFIG_BLK_DEV_SLC90E66" = "y" -o \ "$CONFIG_BLK_DEV_SL82C105" = "y" -o \ - "$CONFIG_BLK_DEV_VIA82CXXX" = "y" -o \ - "$CONFIG_BLK_DEV_MPC8xx_IDE" = "y" ]; then + "$CONFIG_BLK_DEV_SLC90E66" = "y" -o \ + "$CONFIG_BLK_DEV_VIA82CXXX" = "y" ]; then define_bool CONFIG_BLK_DEV_IDE_MODES y else define_bool CONFIG_BLK_DEV_IDE_MODES n diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/cs5530.c linux.20pre5-ac2/drivers/ide/cs5530.c --- linux.20pre5/drivers/ide/cs5530.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/cs5530.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,374 +0,0 @@ -/* - * linux/drivers/ide/cs5530.c Version 0.6 Mar. 18, 2000 - * - * Copyright (C) 2000 Andre Hedrick - * Ditto of GNU General Public License. - * - * Copyright (C) 2000 Mark Lord - * May be copied or modified under the terms of the GNU General Public License - * - * Development of this chipset driver was funded - * by the nice folks at National Semiconductor. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ide_modes.h" - -#define DISPLAY_CS5530_TIMINGS - -#if defined(DISPLAY_CS5530_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static int cs5530_get_info(char *, char **, off_t, int); -extern int (*cs5530_display_info)(char *, char **, off_t, int); /* ide-proc.c */ -extern char *ide_media_verbose(ide_drive_t *); -static struct pci_dev *bmide_dev; - -static int cs5530_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - u32 bibma = pci_resource_start(bmide_dev, 4); - u8 c0 = 0, c1 = 0; - - /* - * at that point bibma+0x2 et bibma+0xa are byte registers - * to investigate: - */ - - c0 = inb_p((unsigned short)bibma + 0x02); - c1 = inb_p((unsigned short)bibma + 0x0a); - - p += sprintf(p, "\n Cyrix 5530 Chipset.\n"); - p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n"); - p += sprintf(p, " %sabled %sabled\n", - (c0&0x80) ? "dis" : " en", - (c1&0x80) ? "dis" : " en"); - p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n"); - p += sprintf(p, "DMA enabled: %s %s %s %s\n", - (c0&0x20) ? "yes" : "no ", (c0&0x40) ? "yes" : "no ", - (c1&0x20) ? "yes" : "no ", (c1&0x40) ? "yes" : "no " ); - - p += sprintf(p, "UDMA\n"); - p += sprintf(p, "DMA\n"); - p += sprintf(p, "PIO\n"); - - return p-buffer; -} -#endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */ - -byte cs5530_proc = 0; - -extern char *ide_xfer_verbose (byte xfer_rate); - -/* - * Set a new transfer mode at the drive - */ -int cs5530_set_xfer_mode (ide_drive_t *drive, byte mode) -{ - int error = 0; - - printk("%s: cs5530_set_xfer_mode(%s)\n", drive->name, ide_xfer_verbose(mode)); - error = ide_config_drive_speed(drive, mode); - - return error; -} - -/* - * Here are the standard PIO mode 0-4 timings for each "format". - * Format-0 uses fast data reg timings, with slower command reg timings. - * Format-1 uses fast timings for all registers, but won't work with all drives. - */ -static unsigned int cs5530_pio_timings[2][5] = - {{0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010}, - {0xd1329172, 0x71212171, 0x30200080, 0x20102010, 0x00100010}}; - -/* - * After chip reset, the PIO timings are set to 0x0000e132, which is not valid. - */ -#define CS5530_BAD_PIO(timings) (((timings)&~0x80000000)==0x0000e132) -#define CS5530_BASEREG(hwif) (((hwif)->dma_base & ~0xf) + ((hwif)->channel ? 0x30 : 0x20)) - -/* - * cs5530_tuneproc() handles selection/setting of PIO modes - * for both the chipset and drive. - * - * The ide_init_cs5530() routine guarantees that all drives - * will have valid default PIO timings set up before we get here. - */ -static void cs5530_tuneproc (ide_drive_t *drive, byte pio) /* pio=255 means "autotune" */ -{ - ide_hwif_t *hwif = HWIF(drive); - unsigned int format, basereg = CS5530_BASEREG(hwif); - static byte modes[5] = {XFER_PIO_0, XFER_PIO_1, XFER_PIO_2, XFER_PIO_3, XFER_PIO_4}; - - pio = ide_get_best_pio_mode(drive, pio, 4, NULL); - if (!cs5530_set_xfer_mode(drive, modes[pio])) { - format = (inl(basereg+4) >> 31) & 1; - outl(cs5530_pio_timings[format][pio], basereg+(drive->select.b.unit<<3)); - } -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -/* - * cs5530_config_dma() handles selection/setting of DMA/UDMA modes - * for both the chipset and drive. - */ -static int cs5530_config_dma (ide_drive_t *drive) -{ - int udma_ok = 1, mode = 0; - ide_hwif_t *hwif = HWIF(drive); - int unit = drive->select.b.unit; - ide_drive_t *mate = &hwif->drives[unit^1]; - struct hd_driveid *id = drive->id; - unsigned int basereg, reg, timings; - - - /* - * Default to DMA-off in case we run into trouble here. - */ - (void)hwif->dmaproc(ide_dma_off_quietly, drive); /* turn off DMA while we fiddle */ - outb(inb(hwif->dma_base+2)&~(unit?0x40:0x20), hwif->dma_base+2); /* clear DMA_capable bit */ - - /* - * The CS5530 specifies that two drives sharing a cable cannot - * mix UDMA/MDMA. It has to be one or the other, for the pair, - * though different timings can still be chosen for each drive. - * We could set the appropriate timing bits on the fly, - * but that might be a bit confusing. So, for now we statically - * handle this requirement by looking at our mate drive to see - * what it is capable of, before choosing a mode for our own drive. - */ - if (mate->present) { - struct hd_driveid *mateid = mate->id; - if (mateid && (mateid->capability & 1) && !hwif->dmaproc(ide_dma_bad_drive, mate)) { - if ((mateid->field_valid & 4) && (mateid->dma_ultra & 7)) - udma_ok = 1; - else if ((mateid->field_valid & 2) && (mateid->dma_mword & 7)) - udma_ok = 0; - else - udma_ok = 1; - } - } - - /* - * Now see what the current drive is capable of, - * selecting UDMA only if the mate said it was ok. - */ - if (id && (id->capability & 1) && hwif->autodma && !hwif->dmaproc(ide_dma_bad_drive, drive)) { - if (udma_ok && (id->field_valid & 4) && (id->dma_ultra & 7)) { - if (id->dma_ultra & 4) - mode = XFER_UDMA_2; - else if (id->dma_ultra & 2) - mode = XFER_UDMA_1; - else if (id->dma_ultra & 1) - mode = XFER_UDMA_0; - } - if (!mode && (id->field_valid & 2) && (id->dma_mword & 7)) { - if (id->dma_mword & 4) - mode = XFER_MW_DMA_2; - else if (id->dma_mword & 2) - mode = XFER_MW_DMA_1; - else if (id->dma_mword & 1) - mode = XFER_MW_DMA_0; - } - } - - /* - * Tell the drive to switch to the new mode; abort on failure. - */ - if (!mode || cs5530_set_xfer_mode(drive, mode)) - return 1; /* failure */ - - /* - * Now tune the chipset to match the drive: - */ - switch (mode) { - case XFER_UDMA_0: timings = 0x00921250; break; - case XFER_UDMA_1: timings = 0x00911140; break; - case XFER_UDMA_2: timings = 0x00911030; break; - case XFER_MW_DMA_0: timings = 0x00077771; break; - case XFER_MW_DMA_1: timings = 0x00012121; break; - case XFER_MW_DMA_2: timings = 0x00002020; break; - default: - printk("%s: cs5530_config_dma: huh? mode=%02x\n", drive->name, mode); - return 1; /* failure */ - } - basereg = CS5530_BASEREG(hwif); - reg = inl(basereg+4); /* get drive0 config register */ - timings |= reg & 0x80000000; /* preserve PIO format bit */ - if (unit == 0) { /* are we configuring drive0? */ - outl(timings, basereg+4); /* write drive0 config register */ - } else { - if (timings & 0x00100000) - reg |= 0x00100000; /* enable UDMA timings for both drives */ - else - reg &= ~0x00100000; /* disable UDMA timings for both drives */ - outl(reg, basereg+4); /* write drive0 config register */ - outl(timings, basereg+12); /* write drive1 config register */ - } - outb(inb(hwif->dma_base+2)|(unit?0x40:0x20), hwif->dma_base+2); /* set DMA_capable bit */ - - /* - * Finally, turn DMA on in software, and exit. - */ - return hwif->dmaproc(ide_dma_on, drive); /* success */ -} - -/* - * This is a CS5530-specific wrapper for the standard ide_dmaproc(). - * We need it for our custom "ide_dma_check" function. - * All other requests are forwarded to the standard ide_dmaproc(). - */ -int cs5530_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - switch (func) { - case ide_dma_check: - return cs5530_config_dma(drive); - default: - break; - } - /* Other cases are done by generic IDE-DMA code. */ - return ide_dmaproc(func, drive); -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -/* - * Initialize the cs5530 bridge for reliable IDE DMA operation. - */ -unsigned int __init pci_init_cs5530 (struct pci_dev *dev, const char *name) -{ - struct pci_dev *master_0 = NULL, *cs5530_0 = NULL; - unsigned short pcicmd = 0; - unsigned long flags; - -#if defined(DISPLAY_CS5530_TIMINGS) && defined(CONFIG_PROC_FS) - if (!cs5530_proc) { - cs5530_proc = 1; - bmide_dev = dev; - cs5530_display_info = &cs5530_get_info; - } -#endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */ - - pci_for_each_dev (dev) { - if (dev->vendor == PCI_VENDOR_ID_CYRIX) { - switch (dev->device) { - case PCI_DEVICE_ID_CYRIX_PCI_MASTER: - master_0 = dev; - break; - case PCI_DEVICE_ID_CYRIX_5530_LEGACY: - cs5530_0 = dev; - break; - } - } - } - if (!master_0) { - printk("%s: unable to locate PCI MASTER function\n", name); - return 0; - } - if (!cs5530_0) { - printk("%s: unable to locate CS5530 LEGACY function\n", name); - return 0; - } - - save_flags(flags); - cli(); /* all CPUs (there should only be one CPU with this chipset) */ - - /* - * Enable BusMaster and MemoryWriteAndInvalidate for the cs5530: - * --> OR 0x14 into 16-bit PCI COMMAND reg of function 0 of the cs5530 - */ - pci_read_config_word (cs5530_0, PCI_COMMAND, &pcicmd); - pci_write_config_word(cs5530_0, PCI_COMMAND, pcicmd | PCI_COMMAND_MASTER | PCI_COMMAND_INVALIDATE); - - /* - * Set PCI CacheLineSize to 16-bytes: - * --> Write 0x04 into 8-bit PCI CACHELINESIZE reg of function 0 of the cs5530 - */ - pci_write_config_byte(cs5530_0, PCI_CACHE_LINE_SIZE, 0x04); - - /* - * Disable trapping of UDMA register accesses (Win98 hack): - * --> Write 0x5006 into 16-bit reg at offset 0xd0 of function 0 of the cs5530 - */ - pci_write_config_word(cs5530_0, 0xd0, 0x5006); - - /* - * Bit-1 at 0x40 enables MemoryWriteAndInvalidate on internal X-bus: - * The other settings are what is necessary to get the register - * into a sane state for IDE DMA operation. - */ - pci_write_config_byte(master_0, 0x40, 0x1e); - - /* - * Set max PCI burst size (16-bytes seems to work best): - * 16bytes: set bit-1 at 0x41 (reg value of 0x16) - * all others: clear bit-1 at 0x41, and do: - * 128bytes: OR 0x00 at 0x41 - * 256bytes: OR 0x04 at 0x41 - * 512bytes: OR 0x08 at 0x41 - * 1024bytes: OR 0x0c at 0x41 - */ - pci_write_config_byte(master_0, 0x41, 0x14); - - /* - * These settings are necessary to get the chip - * into a sane state for IDE DMA operation. - */ - pci_write_config_byte(master_0, 0x42, 0x00); - pci_write_config_byte(master_0, 0x43, 0xc1); - - restore_flags(flags); - - return 0; -} - -/* - * This gets invoked by the IDE driver once for each channel, - * and performs channel-specific pre-initialization before drive probing. - */ -void __init ide_init_cs5530 (ide_hwif_t *hwif) -{ - if (hwif->mate) - hwif->serialized = hwif->mate->serialized = 1; - if (!hwif->dma_base) { - hwif->autodma = 0; - } else { - unsigned int basereg, d0_timings; - -#ifdef CONFIG_BLK_DEV_IDEDMA - hwif->dmaproc = &cs5530_dmaproc; -#else - hwif->autodma = 0; -#endif /* CONFIG_BLK_DEV_IDEDMA */ - - hwif->tuneproc = &cs5530_tuneproc; - basereg = CS5530_BASEREG(hwif); - d0_timings = inl(basereg+0); - if (CS5530_BAD_PIO(d0_timings)) { /* PIO timings not initialized? */ - outl(cs5530_pio_timings[(d0_timings>>31)&1][0], basereg+0); - if (!hwif->drives[0].autotune) - hwif->drives[0].autotune = 1; /* needs autotuning later */ - } - if (CS5530_BAD_PIO(inl(basereg+8))) { /* PIO timings not initialized? */ - outl(cs5530_pio_timings[(d0_timings>>31)&1][0], basereg+8); - if (!hwif->drives[1].autotune) - hwif->drives[1].autotune = 1; /* needs autotuning later */ - } - } -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/cy82c693.c linux.20pre5-ac2/drivers/ide/cy82c693.c --- linux.20pre5/drivers/ide/cy82c693.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/cy82c693.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,449 +0,0 @@ -/* - * linux/drivers/ide/cy82c693.c Version 0.34 Dec. 13, 1999 - * - * Copyright (C) 1998-2000 Andreas S. Krebs (akrebs@altavista.net), Maintainer - * Copyright (C) 1998-2000 Andre Hedrick , Integrater - * - * CYPRESS CY82C693 chipset IDE controller - * - * The CY82C693 chipset is used on Digital's PC-Alpha 164SX boards. - * Writting the driver was quite simple, since most of the job is - * done by the generic pci-ide support. - * The hard part was finding the CY82C693's datasheet on Cypress's - * web page :-(. But Altavista solved this problem :-). - * - * - * Notes: - * - I recently got a 16.8G IBM DTTA, so I was able to test it with - * a large and fast disk - the results look great, so I'd say the - * driver is working fine :-) - * hdparm -t reports 8.17 MB/sec at about 6% CPU usage for the DTTA - * - this is my first linux driver, so there's probably a lot of room - * for optimizations and bug fixing, so feel free to do it. - * - use idebus=xx parameter to set PCI bus speed - needed to calc - * timings for PIO modes (default will be 40) - * - if using PIO mode it's a good idea to set the PIO mode and - * 32-bit I/O support (if possible), e.g. hdparm -p2 -c1 /dev/hda - * - I had some problems with my IBM DHEA with PIO modes < 2 - * (lost interrupts) ????? - * - first tests with DMA look okay, they seem to work, but there is a - * problem with sound - the BusMaster IDE TimeOut should fixed this - * - * - * History: - * AMH@1999-08-24: v0.34 init_cy82c693_chip moved to pci_init_cy82c693 - * ASK@1999-01-23: v0.33 made a few minor code clean ups - * removed DMA clock speed setting by default - * added boot message - * ASK@1998-11-01: v0.32 added support to set BusMaster IDE TimeOut - * added support to set DMA Controller Clock Speed - * ASK@1998-10-31: v0.31 fixed problem with setting to high DMA modes on some drive - * ASK@1998-10-29: v0.3 added support to set DMA modes - * ASK@1998-10-28: v0.2 added support to set PIO modes - * ASK@1998-10-27: v0.1 first version - chipset detection - * - */ - -#include -#include -#include -#include -#include -#include - -#include - -#include "ide_modes.h" - -/* the current version */ -#define CY82_VERSION "CY82C693U driver v0.34 99-13-12 Andreas S. Krebs (akrebs@altavista.net)" - -/* - * The following are used to debug the driver. - */ -#define CY82C693_DEBUG_LOGS 0 -#define CY82C693_DEBUG_INFO 0 - -/* define CY82C693_SETDMA_CLOCK to set DMA Controller Clock Speed to ATCLK */ -#undef CY82C693_SETDMA_CLOCK - -/* - * note: the value for busmaster timeout is tricky and i got it by trial and error ! - * using a to low value will cause DMA timeouts and drop IDE performance - * using a to high value will cause audio playback to scatter - * if you know a better value or how to calc it, please let me know - */ -#define BUSMASTER_TIMEOUT 0x50 /* twice the value written in cy82c693ub datasheet */ -/* - * the value above was tested on my machine and it seems to work okay - */ - -/* here are the offset definitions for the registers */ -#define CY82_IDE_CMDREG 0x04 -#define CY82_IDE_ADDRSETUP 0x48 -#define CY82_IDE_MASTER_IOR 0x4C -#define CY82_IDE_MASTER_IOW 0x4D -#define CY82_IDE_SLAVE_IOR 0x4E -#define CY82_IDE_SLAVE_IOW 0x4F -#define CY82_IDE_MASTER_8BIT 0x50 -#define CY82_IDE_SLAVE_8BIT 0x51 - -#define CY82_INDEX_PORT 0x22 -#define CY82_DATA_PORT 0x23 - -#define CY82_INDEX_CTRLREG1 0x01 -#define CY82_INDEX_CHANNEL0 0x30 -#define CY82_INDEX_CHANNEL1 0x31 -#define CY82_INDEX_TIMEOUT 0x32 - -/* the max PIO mode - from datasheet */ -#define CY82C693_MAX_PIO 4 - -/* the min and max PCI bus speed in MHz - from datasheet */ -#define CY82C963_MIN_BUS_SPEED 25 -#define CY82C963_MAX_BUS_SPEED 33 - -/* the struct for the PIO mode timings */ -typedef struct pio_clocks_s { - byte address_time; /* Address setup (clocks) */ - byte time_16r; /* clocks for 16bit IOR (0xF0=Active/data, 0x0F=Recovery) */ - byte time_16w; /* clocks for 16bit IOW (0xF0=Active/data, 0x0F=Recovery) */ - byte time_8; /* clocks for 8bit (0xF0=Active/data, 0x0F=Recovery) */ -} pio_clocks_t; - -/* - * calc clocks using bus_speed - * returns (rounded up) time in bus clocks for time in ns - */ -static int calc_clk (int time, int bus_speed) -{ - int clocks; - - clocks = (time*bus_speed+999)/1000 -1; - - if (clocks < 0) - clocks = 0; - - if (clocks > 0x0F) - clocks = 0x0F; - - return clocks; -} - -/* - * compute the values for the clock registers for PIO - * mode and pci_clk [MHz] speed - * - * NOTE: for mode 0,1 and 2 drives 8-bit IDE command control registers are used - * for mode 3 and 4 drives 8 and 16-bit timings are the same - * - */ -static void compute_clocks (byte pio, pio_clocks_t *p_pclk) -{ - int clk1, clk2; - int bus_speed = system_bus_clock(); /* get speed of PCI bus */ - - /* we don't check against CY82C693's min and max speed, - * so you can play with the idebus=xx parameter - */ - - if (pio > CY82C693_MAX_PIO) - pio = CY82C693_MAX_PIO; - - /* let's calc the address setup time clocks */ - p_pclk->address_time = (byte)calc_clk(ide_pio_timings[pio].setup_time, bus_speed); - - /* let's calc the active and recovery time clocks */ - clk1 = calc_clk(ide_pio_timings[pio].active_time, bus_speed); - - /* calc recovery timing */ - clk2 = ide_pio_timings[pio].cycle_time - - ide_pio_timings[pio].active_time - - ide_pio_timings[pio].setup_time; - - clk2 = calc_clk(clk2, bus_speed); - - clk1 = (clk1<<4)|clk2; /* combine active and recovery clocks */ - - /* note: we use the same values for 16bit IOR and IOW - * those are all the same, since I don't have other - * timings than those from ide_modes.h - */ - - p_pclk->time_16r = (byte)clk1; - p_pclk->time_16w = (byte)clk1; - - /* what are good values for 8bit ?? */ - p_pclk->time_8 = (byte)clk1; -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -/* - * set DMA mode a specific channel for CY82C693 - */ -static void cy82c693_dma_enable (ide_drive_t *drive, int mode, int single) -{ - byte index; - byte data; - - if (mode>2) /* make sure we set a valid mode */ - mode = 2; - - if (mode > drive->id->tDMA) /* to be absolutly sure we have a valid mode */ - mode = drive->id->tDMA; - - index = (HWIF(drive)->channel==0) ? CY82_INDEX_CHANNEL0 : CY82_INDEX_CHANNEL1; - -#if CY82C693_DEBUG_LOGS - /* for debug let's show the previous values */ - - OUT_BYTE(index, CY82_INDEX_PORT); - data = IN_BYTE(CY82_DATA_PORT); - - printk (KERN_INFO "%s (ch=%d, dev=%d): DMA mode is %d (single=%d)\n", drive->name, HWIF(drive)->channel, drive->select.b.unit, (data&0x3), ((data>>2)&1)); -#endif /* CY82C693_DEBUG_LOGS */ - - data = (byte)mode|(byte)(single<<2); - - OUT_BYTE(index, CY82_INDEX_PORT); - OUT_BYTE(data, CY82_DATA_PORT); - -#if CY82C693_DEBUG_INFO - printk (KERN_INFO "%s (ch=%d, dev=%d): set DMA mode to %d (single=%d)\n", drive->name, HWIF(drive)->channel, drive->select.b.unit, mode, single); -#endif /* CY82C693_DEBUG_INFO */ - - /* - * note: below we set the value for Bus Master IDE TimeOut Register - * I'm not absolutly sure what this does, but it solved my problem - * with IDE DMA and sound, so I now can play sound and work with - * my IDE driver at the same time :-) - * - * If you know the correct (best) value for this register please - * let me know - ASK - */ - - data = BUSMASTER_TIMEOUT; - OUT_BYTE(CY82_INDEX_TIMEOUT, CY82_INDEX_PORT); - OUT_BYTE(data, CY82_DATA_PORT); - -#if CY82C693_DEBUG_INFO - printk (KERN_INFO "%s: Set IDE Bus Master TimeOut Register to 0x%X\n", drive->name, data); -#endif /* CY82C693_DEBUG_INFO */ -} - -/* - * used to set DMA mode for CY82C693 (single and multi modes) - */ -static int cy82c693_dmaproc(ide_dma_action_t func, ide_drive_t *drive) -{ - /* - * if the function is dma on, set dma mode for drive everything - * else is done by the defaul func - */ - if (func == ide_dma_on) { - struct hd_driveid *id = drive->id; - -#if CY82C693_DEBUG_INFO - printk (KERN_INFO "dma_on: %s\n", drive->name); -#endif /* CY82C693_DEBUG_INFO */ - - if (id != NULL) { - /* Enable DMA on any drive that has DMA (multi or single) enabled */ - if (id->field_valid & 2) { /* regular DMA */ - int mmode, smode; - - mmode = id->dma_mword & (id->dma_mword >> 8); - smode = id->dma_1word & (id->dma_1word >> 8); - - if (mmode != 0) - cy82c693_dma_enable(drive, (mmode >> 1), 0); /* enable multi */ - else if (smode != 0) - cy82c693_dma_enable(drive, (smode >> 1), 1); /* enable single */ - } - } - } - return ide_dmaproc(func, drive); -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -/* - * tune ide drive - set PIO mode - */ -static void cy82c693_tune_drive (ide_drive_t *drive, byte pio) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - pio_clocks_t pclk; - unsigned int addrCtrl; - - /* select primary or secondary channel */ - if (hwif->index > 0) { /* drive is on the secondary channel */ - dev = pci_find_slot(dev->bus->number, dev->devfn+1); - if (!dev) { - printk(KERN_ERR "%s: tune_drive: Cannot find secondary interface!\n", drive->name); - return; - } - } - -#if CY82C693_DEBUG_LOGS - /* for debug let's show the register values */ - - if (drive->select.b.unit == 0) { - /* - * get master drive registers - * address setup control register - * is 32 bit !!! - */ - pci_read_config_dword(dev, CY82_IDE_ADDRSETUP, &addrCtrl); - addrCtrl &= 0x0F; - - /* now let's get the remaining registers */ - pci_read_config_byte(dev, CY82_IDE_MASTER_IOR, &pclk.time_16r); - pci_read_config_byte(dev, CY82_IDE_MASTER_IOW, &pclk.time_16w); - pci_read_config_byte(dev, CY82_IDE_MASTER_8BIT, &pclk.time_8); - } else { - /* - * set slave drive registers - * address setup control register - * is 32 bit !!! - */ - pci_read_config_dword(dev, CY82_IDE_ADDRSETUP, &addrCtrl); - - addrCtrl &= 0xF0; - addrCtrl >>= 4; - - /* now let's get the remaining registers */ - pci_read_config_byte(dev, CY82_IDE_SLAVE_IOR, &pclk.time_16r); - pci_read_config_byte(dev, CY82_IDE_SLAVE_IOW, &pclk.time_16w); - pci_read_config_byte(dev, CY82_IDE_SLAVE_8BIT, &pclk.time_8); - } - - printk (KERN_INFO "%s (ch=%d, dev=%d): PIO timing is (addr=0x%X, ior=0x%X, iow=0x%X, 8bit=0x%X)\n", drive->name, hwif->channel, drive->select.b.unit, addrCtrl, pclk.time_16r, pclk.time_16w, pclk.time_8); -#endif /* CY82C693_DEBUG_LOGS */ - - /* first let's calc the pio modes */ - pio = ide_get_best_pio_mode(drive, pio, CY82C693_MAX_PIO, NULL); - -#if CY82C693_DEBUG_INFO - printk (KERN_INFO "%s: Selected PIO mode %d\n", drive->name, pio); -#endif /* CY82C693_DEBUG_INFO */ - - compute_clocks(pio, &pclk); /* let's calc the values for this PIO mode */ - - /* now let's write the clocks registers */ - if (drive->select.b.unit == 0) { - /* - * set master drive - * address setup control register - * is 32 bit !!! - */ - pci_read_config_dword(dev, CY82_IDE_ADDRSETUP, &addrCtrl); - - addrCtrl &= (~0xF); - addrCtrl |= (unsigned int)pclk.address_time; - pci_write_config_dword(dev, CY82_IDE_ADDRSETUP, addrCtrl); - - /* now let's set the remaining registers */ - pci_write_config_byte(dev, CY82_IDE_MASTER_IOR, pclk.time_16r); - pci_write_config_byte(dev, CY82_IDE_MASTER_IOW, pclk.time_16w); - pci_write_config_byte(dev, CY82_IDE_MASTER_8BIT, pclk.time_8); - - addrCtrl &= 0xF; - } else { - /* - * set slave drive - * address setup control register - * is 32 bit !!! - */ - pci_read_config_dword(dev, CY82_IDE_ADDRSETUP, &addrCtrl); - - addrCtrl &= (~0xF0); - addrCtrl |= ((unsigned int)pclk.address_time<<4); - pci_write_config_dword(dev, CY82_IDE_ADDRSETUP, addrCtrl); - - /* now let's set the remaining registers */ - pci_write_config_byte(dev, CY82_IDE_SLAVE_IOR, pclk.time_16r); - pci_write_config_byte(dev, CY82_IDE_SLAVE_IOW, pclk.time_16w); - pci_write_config_byte(dev, CY82_IDE_SLAVE_8BIT, pclk.time_8); - - addrCtrl >>= 4; - addrCtrl &= 0xF; - } - -#if CY82C693_DEBUG_INFO - printk (KERN_INFO "%s (ch=%d, dev=%d): set PIO timing to (addr=0x%X, ior=0x%X, iow=0x%X, 8bit=0x%X)\n", drive->name, hwif->channel, drive->select.b.unit, addrCtrl, pclk.time_16r, pclk.time_16w, pclk.time_8); -#endif /* CY82C693_DEBUG_INFO */ -} - -/* - * this function is called during init and is used to setup the cy82c693 chip - */ -/* - * FIXME! "pci_init_cy82c693" really should replace - * the "init_cy82c693_chip", it is the correct location to tinker/setup - * the device prior to INIT. - */ - -unsigned int __init pci_init_cy82c693(struct pci_dev *dev, const char *name) -{ -#ifdef CY82C693_SETDMA_CLOCK - byte data; -#endif /* CY82C693_SETDMA_CLOCK */ - - /* write info about this verion of the driver */ - printk (KERN_INFO CY82_VERSION "\n"); - -#ifdef CY82C693_SETDMA_CLOCK - /* okay let's set the DMA clock speed */ - - OUT_BYTE(CY82_INDEX_CTRLREG1, CY82_INDEX_PORT); - data = IN_BYTE(CY82_DATA_PORT); - -#if CY82C693_DEBUG_INFO - printk (KERN_INFO "%s: Peripheral Configuration Register: 0x%X\n", name, data); -#endif /* CY82C693_DEBUG_INFO */ - - /* - * for some reason sometimes the DMA controller - * speed is set to ATCLK/2 ???? - we fix this here - * - * note: i don't know what causes this strange behaviour, - * but even changing the dma speed doesn't solve it :-( - * the ide performance is still only half the normal speed - * - * if anybody knows what goes wrong with my machine, please - * let me know - ASK - */ - - data |= 0x03; - - OUT_BYTE(CY82_INDEX_CTRLREG1, CY82_INDEX_PORT); - OUT_BYTE(data, CY82_DATA_PORT); - -#if CY82C693_DEBUG_INFO - printk (KERN_INFO "%s: New Peripheral Configuration Register: 0x%X\n", name, data); -#endif /* CY82C693_DEBUG_INFO */ - -#endif /* CY82C693_SETDMA_CLOCK */ - return 0; -} - -/* - * the init function - called for each ide channel once - */ -void __init ide_init_cy82c693(ide_hwif_t *hwif) -{ - hwif->chipset = ide_cy82c693; - hwif->tuneproc = &cy82c693_tune_drive; - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - hwif->autodma = 0; - -#ifdef CONFIG_BLK_DEV_IDEDMA - if (hwif->dma_base) { - hwif->dmaproc = &cy82c693_dmaproc; - if (!noautodma) - hwif->autodma = 1; - } -#endif /* CONFIG_BLK_DEV_IDEDMA */ -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/dtc2278.c linux.20pre5-ac2/drivers/ide/dtc2278.c --- linux.20pre5/drivers/ide/dtc2278.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/dtc2278.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,134 +0,0 @@ -/* - * linux/drivers/ide/dtc2278.c Version 0.02 Feb 10, 1996 - * - * Copyright (C) 1996 Linus Torvalds & author (see below) - */ - -#undef REALLY_SLOW_IO /* most systems can safely undef this */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "ide_modes.h" - -/* - * Changing this #undef to #define may solve start up problems in some systems. - */ -#undef ALWAYS_SET_DTC2278_PIO_MODE - -/* - * From: andy@cercle.cts.com (Dyan Wile) - * - * Below is a patch for DTC-2278 - alike software-programmable controllers - * The code enables the secondary IDE controller and the PIO4 (3?) timings on - * the primary (EIDE). You may probably have to enable the 32-bit support to - * get the full speed. You better get the disk interrupts disabled ( hdparm -u0 - * /dev/hd.. ) for the drives connected to the EIDE interface. (I get my - * filesystem corrupted with -u1, but under heavy disk load only :-) - * - * This card is now forced to use the "serialize" feature, - * and irq-unmasking is disallowed. If io_32bit is enabled, - * it must be done for BOTH drives on each interface. - * - * This code was written for the DTC2278E, but might work with any of these: - * - * DTC2278S has only a single IDE interface. - * DTC2278D has two IDE interfaces and is otherwise identical to the S version. - * DTC2278E also has serial ports and a printer port - * DTC2278EB: has onboard BIOS, and "works like a charm" -- Kent Bradford - * - * There may be a fourth controller type. The S and D versions use the - * Winbond chip, and I think the E version does also. - * - */ - -static void sub22 (char b, char c) -{ - int i; - - for(i = 0; i < 3; ++i) { - inb(0x3f6); - outb_p(b,0xb0); - inb(0x3f6); - outb_p(c,0xb4); - inb(0x3f6); - if(inb(0xb4) == c) { - outb_p(7,0xb0); - inb(0x3f6); - return; /* success */ - } - } -} - -static void tune_dtc2278 (ide_drive_t *drive, byte pio) -{ - unsigned long flags; - - pio = ide_get_best_pio_mode(drive, pio, 4, NULL); - - if (pio >= 3) { - save_flags(flags); /* all CPUs */ - cli(); /* all CPUs */ - /* - * This enables PIO mode4 (3?) on the first interface - */ - sub22(1,0xc3); - sub22(0,0xa0); - restore_flags(flags); /* all CPUs */ - } else { - /* we don't know how to set it back again.. */ - } - - /* - * 32bit I/O has to be enabled for *both* drives at the same time. - */ - drive->io_32bit = 1; - HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1; -} - -void __init init_dtc2278 (void) -{ - unsigned long flags; - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - /* - * This enables the second interface - */ - outb_p(4,0xb0); - inb(0x3f6); - outb_p(0x20,0xb4); - inb(0x3f6); -#ifdef ALWAYS_SET_DTC2278_PIO_MODE - /* - * This enables PIO mode4 (3?) on the first interface - * and may solve start-up problems for some people. - */ - sub22(1,0xc3); - sub22(0,0xa0); -#endif - __restore_flags(flags); /* local CPU only */ - - ide_hwifs[0].serialized = 1; - ide_hwifs[1].serialized = 1; - ide_hwifs[0].chipset = ide_dtc2278; - ide_hwifs[1].chipset = ide_dtc2278; - ide_hwifs[0].tuneproc = &tune_dtc2278; - ide_hwifs[0].drives[0].no_unmask = 1; - ide_hwifs[0].drives[1].no_unmask = 1; - ide_hwifs[1].drives[0].no_unmask = 1; - ide_hwifs[1].drives[1].no_unmask = 1; - ide_hwifs[0].mate = &ide_hwifs[1]; - ide_hwifs[1].mate = &ide_hwifs[0]; - ide_hwifs[1].channel = 1; -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/falconide.c linux.20pre5-ac2/drivers/ide/falconide.c --- linux.20pre5/drivers/ide/falconide.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/falconide.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,68 +0,0 @@ -/* - * linux/drivers/ide/falconide.c -- Atari Falcon IDE Driver - * - * Created 12 Jul 1997 by Geert Uytterhoeven - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - */ - -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - - /* - * Base of the IDE interface - */ - -#define ATA_HD_BASE 0xfff00000 - - /* - * Offsets from the above base - */ - -#define ATA_HD_DATA 0x00 -#define ATA_HD_ERROR 0x05 /* see err-bits */ -#define ATA_HD_NSECTOR 0x09 /* nr of sectors to read/write */ -#define ATA_HD_SECTOR 0x0d /* starting sector */ -#define ATA_HD_LCYL 0x11 /* starting cylinder */ -#define ATA_HD_HCYL 0x15 /* high byte of starting cyl */ -#define ATA_HD_SELECT 0x19 /* 101dhhhh , d=drive, hhhh=head */ -#define ATA_HD_STATUS 0x1d /* see status-bits */ -#define ATA_HD_CONTROL 0x39 - -static int falconide_offsets[IDE_NR_PORTS] __initdata = { - ATA_HD_DATA, ATA_HD_ERROR, ATA_HD_NSECTOR, ATA_HD_SECTOR, ATA_HD_LCYL, - ATA_HD_HCYL, ATA_HD_SELECT, ATA_HD_STATUS, ATA_HD_CONTROL, -1 -}; - - - /* - * Probe for a Falcon IDE interface - */ - -void __init falconide_init(void) -{ - if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) { - hw_regs_t hw; - int index; - - ide_setup_ports(&hw, (ide_ioreg_t)ATA_HD_BASE, falconide_offsets, - 0, 0, NULL, IRQ_MFP_IDE); - index = ide_register_hw(&hw, NULL); - - if (index != -1) - printk("ide%d: Falcon IDE interface\n", index); - } -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/gayle.c linux.20pre5-ac2/drivers/ide/gayle.c --- linux.20pre5/drivers/ide/gayle.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/gayle.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,181 +0,0 @@ -/* - * linux/drivers/ide/gayle.c -- Amiga Gayle IDE Driver - * - * Created 9 Jul 1997 by Geert Uytterhoeven - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - - /* - * Bases of the IDE interfaces - */ - -#define GAYLE_BASE_4000 0xdd2020 /* A4000/A4000T */ -#define GAYLE_BASE_1200 0xda0000 /* A1200/A600 */ - - /* - * Offsets from one of the above bases - */ - -#define GAYLE_DATA 0x00 -#define GAYLE_ERROR 0x06 /* see err-bits */ -#define GAYLE_NSECTOR 0x0a /* nr of sectors to read/write */ -#define GAYLE_SECTOR 0x0e /* starting sector */ -#define GAYLE_LCYL 0x12 /* starting cylinder */ -#define GAYLE_HCYL 0x16 /* high byte of starting cyl */ -#define GAYLE_SELECT 0x1a /* 101dhhhh , d=drive, hhhh=head */ -#define GAYLE_STATUS 0x1e /* see status-bits */ -#define GAYLE_CONTROL 0x101a - -static int gayle_offsets[IDE_NR_PORTS] __initdata = { - GAYLE_DATA, GAYLE_ERROR, GAYLE_NSECTOR, GAYLE_SECTOR, GAYLE_LCYL, - GAYLE_HCYL, GAYLE_SELECT, GAYLE_STATUS, -1, -1 -}; - - - /* - * These are at different offsets from the base - */ - -#define GAYLE_IRQ_4000 0xdd3020 /* MSB = 1, Harddisk is source of */ -#define GAYLE_IRQ_1200 0xda9000 /* interrupt */ - - - /* - * Offset of the secondary port for IDE doublers - * Note that GAYLE_CONTROL is NOT available then! - */ - -#define GAYLE_NEXT_PORT 0x1000 - -#ifndef CONFIG_BLK_DEV_IDEDOUBLER -#define GAYLE_NUM_HWIFS 1 -#define GAYLE_NUM_PROBE_HWIFS GAYLE_NUM_HWIFS -#define GAYLE_HAS_CONTROL_REG 1 -#define GAYLE_IDEREG_SIZE 0x2000 -#else /* CONFIG_BLK_DEV_IDEDOUBLER */ -#define GAYLE_NUM_HWIFS 2 -#define GAYLE_NUM_PROBE_HWIFS (ide_doubler ? GAYLE_NUM_HWIFS : \ - GAYLE_NUM_HWIFS-1) -#define GAYLE_HAS_CONTROL_REG (!ide_doubler) -#define GAYLE_IDEREG_SIZE (ide_doubler ? 0x1000 : 0x2000) -int ide_doubler = 0; /* support IDE doublers? */ -#endif /* CONFIG_BLK_DEV_IDEDOUBLER */ - - - /* - * Check and acknowledge the interrupt status - */ - -static int gayle_ack_intr_a4000(ide_hwif_t *hwif) -{ - unsigned char ch; - - ch = z_readb(hwif->io_ports[IDE_IRQ_OFFSET]); - if (!(ch & GAYLE_IRQ_IDE)) - return 0; - return 1; -} - -static int gayle_ack_intr_a1200(ide_hwif_t *hwif) -{ - unsigned char ch; - - ch = z_readb(hwif->io_ports[IDE_IRQ_OFFSET]); - if (!(ch & GAYLE_IRQ_IDE)) - return 0; - (void)z_readb(hwif->io_ports[IDE_STATUS_OFFSET]); - z_writeb(0x7c, hwif->io_ports[IDE_IRQ_OFFSET]); - return 1; -} - - /* - * Probe for a Gayle IDE interface (and optionally for an IDE doubler) - */ - -void __init gayle_init(void) -{ - int a4000, i; - - if (!MACH_IS_AMIGA) - return; - - if (!(a4000 = AMIGAHW_PRESENT(A4000_IDE)) && !AMIGAHW_PRESENT(A1200_IDE)) - return; - - for (i = 0; i < GAYLE_NUM_PROBE_HWIFS; i++) { - ide_ioreg_t base, ctrlport, irqport; - ide_ack_intr_t *ack_intr; - hw_regs_t hw; - int index; - unsigned long phys_base, res_start, res_n; - - if (a4000) { - phys_base = GAYLE_BASE_4000; - irqport = (ide_ioreg_t)ZTWO_VADDR(GAYLE_IRQ_4000); - ack_intr = gayle_ack_intr_a4000; - } else { - phys_base = GAYLE_BASE_1200; - irqport = (ide_ioreg_t)ZTWO_VADDR(GAYLE_IRQ_1200); - ack_intr = gayle_ack_intr_a1200; - } - phys_base += i*GAYLE_NEXT_PORT; - - res_start = ((unsigned long)phys_base) & ~(GAYLE_NEXT_PORT-1); - res_n = GAYLE_IDEREG_SIZE; - - if (!request_mem_region(res_start, res_n, "IDE")) - continue; - - base = (ide_ioreg_t)ZTWO_VADDR(phys_base); - ctrlport = GAYLE_HAS_CONTROL_REG ? (base + GAYLE_CONTROL) : 0; - - ide_setup_ports(&hw, base, gayle_offsets, - ctrlport, irqport, ack_intr, IRQ_AMIGA_PORTS); - - index = ide_register_hw(&hw, NULL); - if (index != -1) { - switch (i) { - case 0: - printk("ide%d: Gayle IDE interface (A%d style)\n", index, - a4000 ? 4000 : 1200); - break; -#ifdef CONFIG_BLK_DEV_IDEDOUBLER - case 1: - printk("ide%d: IDE doubler\n", index); - break; -#endif /* CONFIG_BLK_DEV_IDEDOUBLER */ - } - } else - release_mem_region(res_start, res_n); - -#if 1 /* TESTING */ - if (i == 1) { - volatile u_short *addr = (u_short *)base; - u_short data; - printk("+++ Probing for IDE doubler... "); - *addr = 0xffff; - data = *addr; - printk("probe returned 0x%02x (PLEASE REPORT THIS!!)\n", data); - } -#endif /* TESTING */ - } -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/hd.c linux.20pre5-ac2/drivers/ide/hd.c --- linux.20pre5/drivers/ide/hd.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/hd.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,918 +0,0 @@ -/* - * linux/drivers/ide/hd.c - * - * Copyright (C) 1991, 1992 Linus Torvalds - */ - -/* - * This is the low-level hd interrupt support. It traverses the - * request-list, using interrupts to jump between functions. As - * all the functions are called within interrupts, we may not - * sleep. Special care is recommended. - * - * modified by Drew Eckhardt to check nr of hd's from the CMOS. - * - * Thanks to Branko Lankester, lankeste@fwi.uva.nl, who found a bug - * in the early extended-partition checks and added DM partitions - * - * IRQ-unmask, drive-id, multiple-mode, support for ">16 heads", - * and general streamlining by Mark Lord. - * - * Removed 99% of above. Use Mark's ide driver for those options. - * This is now a lightweight ST-506 driver. (Paul Gortmaker) - * - * Modified 1995 Russell King for ARM processor. - * - * Bugfix: max_sectors must be <= 255 or the wheels tend to come - * off in a hurry once you queue things up - Paul G. 02/2001 - */ - -/* Uncomment the following if you want verbose error reports. */ -/* #define VERBOSE_ERRORS */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include /* CMOS defines */ -#include -#include - -#define REALLY_SLOW_IO -#include -#include -#include - -#define MAJOR_NR HD_MAJOR -#include - -#ifdef __arm__ -#undef HD_IRQ -#endif -#include -#ifdef __arm__ -#define HD_IRQ IRQ_HARDDISK -#endif - -static int revalidate_hddisk(kdev_t, int); - -#define HD_DELAY 0 - -#define MAX_ERRORS 16 /* Max read/write errors/sector */ -#define RESET_FREQ 8 /* Reset controller every 8th retry */ -#define RECAL_FREQ 4 /* Recalibrate every 4th retry */ -#define MAX_HD 2 - -#define STAT_OK (READY_STAT|SEEK_STAT) -#define OK_STATUS(s) (((s)&(STAT_OK|(BUSY_STAT|WRERR_STAT|ERR_STAT)))==STAT_OK) - -static void recal_intr(void); -static void bad_rw_intr(void); - -static char recalibrate[MAX_HD]; -static char special_op[MAX_HD]; -static int access_count[MAX_HD]; -static char busy[MAX_HD]; -static DECLARE_WAIT_QUEUE_HEAD(busy_wait); - -static int reset; -static int hd_error; - -#define SUBSECTOR(block) (CURRENT->current_nr_sectors > 0) - -/* - * This struct defines the HD's and their types. - */ -struct hd_i_struct { - unsigned int head,sect,cyl,wpcom,lzone,ctl; -}; - -#ifdef HD_TYPE -static struct hd_i_struct hd_info[] = { HD_TYPE }; -static int NR_HD = ((sizeof (hd_info))/(sizeof (struct hd_i_struct))); -#else -static struct hd_i_struct hd_info[MAX_HD]; -static int NR_HD; -#endif - -static struct hd_struct hd[MAX_HD<<6]; -static int hd_sizes[MAX_HD<<6]; -static int hd_blocksizes[MAX_HD<<6]; -static int hd_hardsectsizes[MAX_HD<<6]; -static int hd_maxsect[MAX_HD<<6]; - -static struct timer_list device_timer; - -#define SET_TIMER \ - do { \ - mod_timer(&device_timer, jiffies + TIMEOUT_VALUE); \ - } while (0) - -#define CLEAR_TIMER del_timer(&device_timer); - -#undef SET_INTR - -#define SET_INTR(x) \ -if ((DEVICE_INTR = (x)) != NULL) \ - SET_TIMER; \ -else \ - CLEAR_TIMER; - - -#if (HD_DELAY > 0) -unsigned long last_req; - -unsigned long read_timer(void) -{ - unsigned long t, flags; - int i; - - save_flags(flags); - cli(); - t = jiffies * 11932; - outb_p(0, 0x43); - i = inb_p(0x40); - i |= inb(0x40) << 8; - restore_flags(flags); - return(t - i); -} -#endif - -void __init hd_setup(char *str, int *ints) -{ - int hdind = 0; - - if (ints[0] != 3) - return; - if (hd_info[0].head != 0) - hdind=1; - hd_info[hdind].head = ints[2]; - hd_info[hdind].sect = ints[3]; - hd_info[hdind].cyl = ints[1]; - hd_info[hdind].wpcom = 0; - hd_info[hdind].lzone = ints[1]; - hd_info[hdind].ctl = (ints[2] > 8 ? 8 : 0); - NR_HD = hdind+1; -} - -static void dump_status (const char *msg, unsigned int stat) -{ - unsigned long flags; - char devc; - - devc = !QUEUE_EMPTY ? 'a' + DEVICE_NR(CURRENT->rq_dev) : '?'; - save_flags (flags); - sti(); -#ifdef VERBOSE_ERRORS - printk("hd%c: %s: status=0x%02x { ", devc, msg, stat & 0xff); - if (stat & BUSY_STAT) printk("Busy "); - if (stat & READY_STAT) printk("DriveReady "); - if (stat & WRERR_STAT) printk("WriteFault "); - if (stat & SEEK_STAT) printk("SeekComplete "); - if (stat & DRQ_STAT) printk("DataRequest "); - if (stat & ECC_STAT) printk("CorrectedError "); - if (stat & INDEX_STAT) printk("Index "); - if (stat & ERR_STAT) printk("Error "); - printk("}\n"); - if ((stat & ERR_STAT) == 0) { - hd_error = 0; - } else { - hd_error = inb(HD_ERROR); - printk("hd%c: %s: error=0x%02x { ", devc, msg, hd_error & 0xff); - if (hd_error & BBD_ERR) printk("BadSector "); - if (hd_error & ECC_ERR) printk("UncorrectableError "); - if (hd_error & ID_ERR) printk("SectorIdNotFound "); - if (hd_error & ABRT_ERR) printk("DriveStatusError "); - if (hd_error & TRK0_ERR) printk("TrackZeroNotFound "); - if (hd_error & MARK_ERR) printk("AddrMarkNotFound "); - printk("}"); - if (hd_error & (BBD_ERR|ECC_ERR|ID_ERR|MARK_ERR)) { - printk(", CHS=%d/%d/%d", (inb(HD_HCYL)<<8) + inb(HD_LCYL), - inb(HD_CURRENT) & 0xf, inb(HD_SECTOR)); - if (!QUEUE_EMPTY) - printk(", sector=%ld", CURRENT->sector); - } - printk("\n"); - } -#else - printk("hd%c: %s: status=0x%02x.\n", devc, msg, stat & 0xff); - if ((stat & ERR_STAT) == 0) { - hd_error = 0; - } else { - hd_error = inb(HD_ERROR); - printk("hd%c: %s: error=0x%02x.\n", devc, msg, hd_error & 0xff); - } -#endif /* verbose errors */ - restore_flags (flags); -} - -void check_status(void) -{ - int i = inb_p(HD_STATUS); - - if (!OK_STATUS(i)) { - dump_status("check_status", i); - bad_rw_intr(); - } -} - -static int controller_busy(void) -{ - int retries = 100000; - unsigned char status; - - do { - status = inb_p(HD_STATUS); - } while ((status & BUSY_STAT) && --retries); - return status; -} - -static int status_ok(void) -{ - unsigned char status = inb_p(HD_STATUS); - - if (status & BUSY_STAT) - return 1; /* Ancient, but does it make sense??? */ - if (status & WRERR_STAT) - return 0; - if (!(status & READY_STAT)) - return 0; - if (!(status & SEEK_STAT)) - return 0; - return 1; -} - -static int controller_ready(unsigned int drive, unsigned int head) -{ - int retry = 100; - - do { - if (controller_busy() & BUSY_STAT) - return 0; - outb_p(0xA0 | (drive<<4) | head, HD_CURRENT); - if (status_ok()) - return 1; - } while (--retry); - return 0; -} - -static void hd_out(unsigned int drive,unsigned int nsect,unsigned int sect, - unsigned int head,unsigned int cyl,unsigned int cmd, - void (*intr_addr)(void)) -{ - unsigned short port; - -#if (HD_DELAY > 0) - while (read_timer() - last_req < HD_DELAY) - /* nothing */; -#endif - if (reset) - return; - if (!controller_ready(drive, head)) { - reset = 1; - return; - } - SET_INTR(intr_addr); - outb_p(hd_info[drive].ctl,HD_CMD); - port=HD_DATA; - outb_p(hd_info[drive].wpcom>>2,++port); - outb_p(nsect,++port); - outb_p(sect,++port); - outb_p(cyl,++port); - outb_p(cyl>>8,++port); - outb_p(0xA0|(drive<<4)|head,++port); - outb_p(cmd,++port); -} - -static void hd_request (void); - -static int drive_busy(void) -{ - unsigned int i; - unsigned char c; - - for (i = 0; i < 500000 ; i++) { - c = inb_p(HD_STATUS); - if ((c & (BUSY_STAT | READY_STAT | SEEK_STAT)) == STAT_OK) - return 0; - } - dump_status("reset timed out", c); - return 1; -} - -static void reset_controller(void) -{ - int i; - - outb_p(4,HD_CMD); - for(i = 0; i < 1000; i++) barrier(); - outb_p(hd_info[0].ctl & 0x0f,HD_CMD); - for(i = 0; i < 1000; i++) barrier(); - if (drive_busy()) - printk("hd: controller still busy\n"); - else if ((hd_error = inb(HD_ERROR)) != 1) - printk("hd: controller reset failed: %02x\n",hd_error); -} - -static void reset_hd(void) -{ - static int i; - -repeat: - if (reset) { - reset = 0; - i = -1; - reset_controller(); - } else { - check_status(); - if (reset) - goto repeat; - } - if (++i < NR_HD) { - special_op[i] = recalibrate[i] = 1; - hd_out(i,hd_info[i].sect,hd_info[i].sect,hd_info[i].head-1, - hd_info[i].cyl,WIN_SPECIFY,&reset_hd); - if (reset) - goto repeat; - } else - hd_request(); -} - -/* - * Ok, don't know what to do with the unexpected interrupts: on some machines - * doing a reset and a retry seems to result in an eternal loop. Right now I - * ignore it, and just set the timeout. - * - * On laptops (and "green" PCs), an unexpected interrupt occurs whenever the - * drive enters "idle", "standby", or "sleep" mode, so if the status looks - * "good", we just ignore the interrupt completely. - */ -void unexpected_hd_interrupt(void) -{ - unsigned int stat = inb_p(HD_STATUS); - - if (stat & (BUSY_STAT|DRQ_STAT|ECC_STAT|ERR_STAT)) { - dump_status ("unexpected interrupt", stat); - SET_TIMER; - } -} - -/* - * bad_rw_intr() now tries to be a bit smarter and does things - * according to the error returned by the controller. - * -Mika Liljeberg (liljeber@cs.Helsinki.FI) - */ -static void bad_rw_intr(void) -{ - int dev; - - if (QUEUE_EMPTY) - return; - dev = DEVICE_NR(CURRENT->rq_dev); - if (++CURRENT->errors >= MAX_ERRORS || (hd_error & BBD_ERR)) { - end_request(0); - special_op[dev] = recalibrate[dev] = 1; - } else if (CURRENT->errors % RESET_FREQ == 0) - reset = 1; - else if ((hd_error & TRK0_ERR) || CURRENT->errors % RECAL_FREQ == 0) - special_op[dev] = recalibrate[dev] = 1; - /* Otherwise just retry */ -} - -static inline int wait_DRQ(void) -{ - int retries = 100000, stat; - - while (--retries > 0) - if ((stat = inb_p(HD_STATUS)) & DRQ_STAT) - return 0; - dump_status("wait_DRQ", stat); - return -1; -} - -static void read_intr(void) -{ - int i, retries = 100000; - - do { - i = (unsigned) inb_p(HD_STATUS); - if (i & BUSY_STAT) - continue; - if (!OK_STATUS(i)) - break; - if (i & DRQ_STAT) - goto ok_to_read; - } while (--retries > 0); - dump_status("read_intr", i); - bad_rw_intr(); - hd_request(); - return; -ok_to_read: - insw(HD_DATA,CURRENT->buffer,256); - CURRENT->sector++; - CURRENT->buffer += 512; - CURRENT->errors = 0; - i = --CURRENT->nr_sectors; - --CURRENT->current_nr_sectors; -#ifdef DEBUG - printk("hd%c: read: sector %ld, remaining = %ld, buffer=0x%08lx\n", - dev+'a', CURRENT->sector, CURRENT->nr_sectors, - (unsigned long) CURRENT->buffer+512)); -#endif - if (CURRENT->current_nr_sectors <= 0) - end_request(1); - if (i > 0) { - SET_INTR(&read_intr); - return; - } - (void) inb_p(HD_STATUS); -#if (HD_DELAY > 0) - last_req = read_timer(); -#endif - if (!QUEUE_EMPTY) - hd_request(); - return; -} - -static void write_intr(void) -{ - int i; - int retries = 100000; - - do { - i = (unsigned) inb_p(HD_STATUS); - if (i & BUSY_STAT) - continue; - if (!OK_STATUS(i)) - break; - if ((CURRENT->nr_sectors <= 1) || (i & DRQ_STAT)) - goto ok_to_write; - } while (--retries > 0); - dump_status("write_intr", i); - bad_rw_intr(); - hd_request(); - return; -ok_to_write: - CURRENT->sector++; - i = --CURRENT->nr_sectors; - --CURRENT->current_nr_sectors; - CURRENT->buffer += 512; - if (!i || (CURRENT->bh && !SUBSECTOR(i))) - end_request(1); - if (i > 0) { - SET_INTR(&write_intr); - outsw(HD_DATA,CURRENT->buffer,256); - sti(); - } else { -#if (HD_DELAY > 0) - last_req = read_timer(); -#endif - hd_request(); - } - return; -} - -static void recal_intr(void) -{ - check_status(); -#if (HD_DELAY > 0) - last_req = read_timer(); -#endif - hd_request(); -} - -/* - * This is another of the error-routines I don't know what to do with. The - * best idea seems to just set reset, and start all over again. - */ -static void hd_times_out(unsigned long dummy) -{ - unsigned int dev; - - DEVICE_INTR = NULL; - if (QUEUE_EMPTY) - return; - disable_irq(HD_IRQ); - sti(); - reset = 1; - dev = DEVICE_NR(CURRENT->rq_dev); - printk("hd%c: timeout\n", dev+'a'); - if (++CURRENT->errors >= MAX_ERRORS) { -#ifdef DEBUG - printk("hd%c: too many errors\n", dev+'a'); -#endif - end_request(0); - } - cli(); - hd_request(); - enable_irq(HD_IRQ); -} - -int do_special_op (unsigned int dev) -{ - if (recalibrate[dev]) { - recalibrate[dev] = 0; - hd_out(dev,hd_info[dev].sect,0,0,0,WIN_RESTORE,&recal_intr); - return reset; - } - if (hd_info[dev].head > 16) { - printk ("hd%c: cannot handle device with more than 16 heads - giving up\n", dev+'a'); - end_request(0); - } - special_op[dev] = 0; - return 1; -} - -/* - * The driver enables interrupts as much as possible. In order to do this, - * (a) the device-interrupt is disabled before entering hd_request(), - * and (b) the timeout-interrupt is disabled before the sti(). - * - * Interrupts are still masked (by default) whenever we are exchanging - * data/cmds with a drive, because some drives seem to have very poor - * tolerance for latency during I/O. The IDE driver has support to unmask - * interrupts for non-broken hardware, so use that driver if required. - */ -static void hd_request(void) -{ - unsigned int dev, block, nsect, sec, track, head, cyl; - - if (!QUEUE_EMPTY && CURRENT->rq_status == RQ_INACTIVE) return; - if (DEVICE_INTR) - return; -repeat: - del_timer(&device_timer); - sti(); - INIT_REQUEST; - if (reset) { - cli(); - reset_hd(); - return; - } - dev = MINOR(CURRENT->rq_dev); - block = CURRENT->sector; - nsect = CURRENT->nr_sectors; - if (dev >= (NR_HD<<6) || block >= hd[dev].nr_sects || ((block+nsect) > hd[dev].nr_sects)) { -#ifdef DEBUG - if (dev >= (NR_HD<<6)) - printk("hd: bad minor number: device=%s\n", - kdevname(CURRENT->rq_dev)); - else - printk("hd%c: bad access: block=%d, count=%d\n", - (MINOR(CURRENT->rq_dev)>>6)+'a', block, nsect); -#endif - end_request(0); - goto repeat; - } - block += hd[dev].start_sect; - dev >>= 6; - if (special_op[dev]) { - if (do_special_op(dev)) - goto repeat; - return; - } - sec = block % hd_info[dev].sect + 1; - track = block / hd_info[dev].sect; - head = track % hd_info[dev].head; - cyl = track / hd_info[dev].head; -#ifdef DEBUG - printk("hd%c: %sing: CHS=%d/%d/%d, sectors=%d, buffer=0x%08lx\n", - dev+'a', (CURRENT->cmd == READ)?"read":"writ", - cyl, head, sec, nsect, (unsigned long) CURRENT->buffer); -#endif - if (CURRENT->cmd == READ) { - hd_out(dev,nsect,sec,head,cyl,WIN_READ,&read_intr); - if (reset) - goto repeat; - return; - } - if (CURRENT->cmd == WRITE) { - hd_out(dev,nsect,sec,head,cyl,WIN_WRITE,&write_intr); - if (reset) - goto repeat; - if (wait_DRQ()) { - bad_rw_intr(); - goto repeat; - } - outsw(HD_DATA,CURRENT->buffer,256); - return; - } - panic("unknown hd-command"); -} - -static void do_hd_request (request_queue_t * q) -{ - disable_irq(HD_IRQ); - hd_request(); - enable_irq(HD_IRQ); -} - -static int hd_ioctl(struct inode * inode, struct file * file, - unsigned int cmd, unsigned long arg) -{ - struct hd_geometry *loc = (struct hd_geometry *) arg; - int dev; - - if ((!inode) || !(inode->i_rdev)) - return -EINVAL; - dev = DEVICE_NR(inode->i_rdev); - if (dev >= NR_HD) - return -EINVAL; - switch (cmd) { - case HDIO_GETGEO: - { - struct hd_geometry g; - if (!loc) return -EINVAL; - g.heads = hd_info[dev].head; - g.sectors = hd_info[dev].sect; - g.cylinders = hd_info[dev].cyl; - g.start = hd[MINOR(inode->i_rdev)].start_sect; - return copy_to_user(loc, &g, sizeof g) ? -EFAULT : 0; - } - - case BLKGETSIZE: /* Return device size */ - return put_user(hd[MINOR(inode->i_rdev)].nr_sects, - (unsigned long *) arg); - case BLKGETSIZE64: - return put_user((u64)hd[MINOR(inode->i_rdev)].nr_sects << 9, - (u64 *) arg); - - case BLKRRPART: /* Re-read partition tables */ - if (!capable(CAP_SYS_ADMIN)) - return -EACCES; - return revalidate_hddisk(inode->i_rdev, 1); - - case BLKROSET: - case BLKROGET: - case BLKRASET: - case BLKRAGET: - case BLKFLSBUF: - case BLKPG: - return blk_ioctl(inode->i_rdev, cmd, arg); - - default: - return -EINVAL; - } -} - -static int hd_open(struct inode * inode, struct file * filp) -{ - int target; - target = DEVICE_NR(inode->i_rdev); - - if (target >= NR_HD) - return -ENODEV; - while (busy[target]) - sleep_on(&busy_wait); - access_count[target]++; - return 0; -} - -/* - * Releasing a block device means we sync() it, so that it can safely - * be forgotten about... - */ -static int hd_release(struct inode * inode, struct file * file) -{ - int target = DEVICE_NR(inode->i_rdev); - access_count[target]--; - return 0; -} - -extern struct block_device_operations hd_fops; - -static struct gendisk hd_gendisk = { - major: MAJOR_NR, - major_name: "hd", - minor_shift: 6, - max_p: 1 << 6, - part: hd, - sizes: hd_sizes, - fops: &hd_fops, -}; - -static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs) -{ - void (*handler)(void) = DEVICE_INTR; - - DEVICE_INTR = NULL; - del_timer(&device_timer); - if (!handler) - handler = unexpected_hd_interrupt; - handler(); - sti(); -} - -static struct block_device_operations hd_fops = { - open: hd_open, - release: hd_release, - ioctl: hd_ioctl, -}; - -/* - * This is the hard disk IRQ description. The SA_INTERRUPT in sa_flags - * means we run the IRQ-handler with interrupts disabled: this is bad for - * interrupt latency, but anything else has led to problems on some - * machines. - * - * We enable interrupts in some of the routines after making sure it's - * safe. - */ -static void __init hd_geninit(void) -{ - int drive; - - for(drive=0; drive < (MAX_HD << 6); drive++) { - hd_blocksizes[drive] = 1024; - hd_hardsectsizes[drive] = 512; - hd_maxsect[drive]=255; - } - blksize_size[MAJOR_NR] = hd_blocksizes; - hardsect_size[MAJOR_NR] = hd_hardsectsizes; - max_sectors[MAJOR_NR] = hd_maxsect; - -#ifdef __i386__ - if (!NR_HD) { - extern struct drive_info drive_info; - unsigned char *BIOS = (unsigned char *) &drive_info; - unsigned long flags; - int cmos_disks; - - for (drive=0 ; drive<2 ; drive++) { - hd_info[drive].cyl = *(unsigned short *) BIOS; - hd_info[drive].head = *(2+BIOS); - hd_info[drive].wpcom = *(unsigned short *) (5+BIOS); - hd_info[drive].ctl = *(8+BIOS); - hd_info[drive].lzone = *(unsigned short *) (12+BIOS); - hd_info[drive].sect = *(14+BIOS); -#ifdef does_not_work_for_everybody_with_scsi_but_helps_ibm_vp - if (hd_info[drive].cyl && NR_HD == drive) - NR_HD++; -#endif - BIOS += 16; - } - - /* - We query CMOS about hard disks : it could be that - we have a SCSI/ESDI/etc controller that is BIOS - compatible with ST-506, and thus showing up in our - BIOS table, but not register compatible, and therefore - not present in CMOS. - - Furthermore, we will assume that our ST-506 drives - are the primary drives in the system, and - the ones reflected as drive 1 or 2. - - The first drive is stored in the high nibble of CMOS - byte 0x12, the second in the low nibble. This will be - either a 4 bit drive type or 0xf indicating use byte 0x19 - for an 8 bit type, drive 1, 0x1a for drive 2 in CMOS. - - Needless to say, a non-zero value means we have - an AT controller hard disk for that drive. - - Currently the rtc_lock is a bit academic since this - driver is non-modular, but someday... ? Paul G. - */ - - spin_lock_irqsave(&rtc_lock, flags); - cmos_disks = CMOS_READ(0x12); - spin_unlock_irqrestore(&rtc_lock, flags); - - if (cmos_disks & 0xf0) { - if (cmos_disks & 0x0f) - NR_HD = 2; - else - NR_HD = 1; - } - } -#endif /* __i386__ */ -#ifdef __arm__ - if (!NR_HD) { - /* We don't know anything about the drive. This means - * that you *MUST* specify the drive parameters to the - * kernel yourself. - */ - printk("hd: no drives specified - use hd=cyl,head,sectors" - " on kernel command line\n"); - } -#endif - - for (drive=0 ; drive < NR_HD ; drive++) { - hd[drive<<6].nr_sects = hd_info[drive].head * - hd_info[drive].sect * hd_info[drive].cyl; - printk ("hd%c: %ldMB, CHS=%d/%d/%d\n", drive+'a', - hd[drive<<6].nr_sects / 2048, hd_info[drive].cyl, - hd_info[drive].head, hd_info[drive].sect); - } - if (!NR_HD) - return; - - if (request_irq(HD_IRQ, hd_interrupt, SA_INTERRUPT, "hd", NULL)) { - printk("hd: unable to get IRQ%d for the hard disk driver\n", - HD_IRQ); - NR_HD = 0; - return; - } - request_region(HD_DATA, 8, "hd"); - request_region(HD_CMD, 1, "hd(cmd)"); - - hd_gendisk.nr_real = NR_HD; - - for(drive=0; drive < NR_HD; drive++) - register_disk(&hd_gendisk, MKDEV(MAJOR_NR,drive<<6), 1<<6, - &hd_fops, hd_info[drive].head * hd_info[drive].sect * - hd_info[drive].cyl); -} - -int __init hd_init(void) -{ - if (devfs_register_blkdev(MAJOR_NR,"hd",&hd_fops)) { - printk("hd: unable to get major %d for hard disk\n",MAJOR_NR); - return -1; - } - blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST); - read_ahead[MAJOR_NR] = 8; /* 8 sector (4kB) read-ahead */ - add_gendisk(&hd_gendisk); - init_timer(&device_timer); - device_timer.function = hd_times_out; - hd_geninit(); - return 0; -} - -#define DEVICE_BUSY busy[target] -#define USAGE access_count[target] -#define CAPACITY (hd_info[target].head*hd_info[target].sect*hd_info[target].cyl) -/* We assume that the BIOS parameters do not change, so the disk capacity - will not change */ -#undef MAYBE_REINIT -#define GENDISK_STRUCT hd_gendisk - -/* - * This routine is called to flush all partitions and partition tables - * for a changed disk, and then re-read the new partition table. - * If we are revalidating a disk because of a media change, then we - * enter with usage == 0. If we are using an ioctl, we automatically have - * usage == 1 (we need an open channel to use an ioctl :-), so this - * is our limit. - */ -static int revalidate_hddisk(kdev_t dev, int maxusage) -{ - int target; - struct gendisk * gdev; - int max_p; - int start; - int i; - long flags; - - target = DEVICE_NR(dev); - gdev = &GENDISK_STRUCT; - - save_flags(flags); - cli(); - if (DEVICE_BUSY || USAGE > maxusage) { - restore_flags(flags); - return -EBUSY; - } - DEVICE_BUSY = 1; - restore_flags(flags); - - max_p = gdev->max_p; - start = target << gdev->minor_shift; - - for (i=max_p - 1; i >=0 ; i--) { - int minor = start + i; - invalidate_device(MKDEV(MAJOR_NR, minor), 1); - gdev->part[minor].start_sect = 0; - gdev->part[minor].nr_sects = 0; - } - -#ifdef MAYBE_REINIT - MAYBE_REINIT; -#endif - - grok_partitions(gdev, target, 1<<6, CAPACITY); - - DEVICE_BUSY = 0; - wake_up(&busy_wait); - return 0; -} - -static int parse_hd_setup (char *line) { - int ints[6]; - - (void) get_options(line, ARRAY_SIZE(ints), ints); - hd_setup(NULL, ints); - - return 1; -} -__setup("hd=", parse_hd_setup); - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/hpt34x.c linux.20pre5-ac2/drivers/ide/hpt34x.c --- linux.20pre5/drivers/ide/hpt34x.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/hpt34x.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,437 +0,0 @@ -/* - * linux/drivers/ide/hpt34x.c Version 0.31 June. 9, 2000 - * - * Copyright (C) 1998-2000 Andre Hedrick - * May be copied or modified under the terms of the GNU General Public License - * - * - * 00:12.0 Unknown mass storage controller: - * Triones Technologies, Inc. - * Unknown device 0003 (rev 01) - * - * hde: UDMA 2 (0x0000 0x0002) (0x0000 0x0010) - * hdf: UDMA 2 (0x0002 0x0012) (0x0010 0x0030) - * hde: DMA 2 (0x0000 0x0002) (0x0000 0x0010) - * hdf: DMA 2 (0x0002 0x0012) (0x0010 0x0030) - * hdg: DMA 1 (0x0012 0x0052) (0x0030 0x0070) - * hdh: DMA 1 (0x0052 0x0252) (0x0070 0x00f0) - * - * ide-pci.c reference - * - * Since there are two cards that report almost identically, - * the only discernable difference is the values reported in pcicmd. - * Booting-BIOS card or HPT363 :: pcicmd == 0x07 - * Non-bootable card or HPT343 :: pcicmd == 0x05 - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include "ide_modes.h" - -#ifndef SPLIT_BYTE -#define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4))) -#endif - -#define HPT343_DEBUG_DRIVE_INFO 0 - -#undef DISPLAY_HPT34X_TIMINGS - -#if defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static int hpt34x_get_info(char *, char **, off_t, int); -extern int (*hpt34x_display_info)(char *, char **, off_t, int); /* ide-proc.c */ -extern char *ide_media_verbose(ide_drive_t *); -static struct pci_dev *bmide_dev; - -static int hpt34x_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - u32 bibma = pci_resource_start(bmide_dev, 4); - u8 c0 = 0, c1 = 0; - - /* - * at that point bibma+0x2 et bibma+0xa are byte registers - * to investigate: - */ - c0 = inb_p((unsigned short)bibma + 0x02); - c1 = inb_p((unsigned short)bibma + 0x0a); - - p += sprintf(p, "\n HPT34X Chipset.\n"); - p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n"); - p += sprintf(p, " %sabled %sabled\n", - (c0&0x80) ? "dis" : " en", - (c1&0x80) ? "dis" : " en"); - p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n"); - p += sprintf(p, "DMA enabled: %s %s %s %s\n", - (c0&0x20) ? "yes" : "no ", (c0&0x40) ? "yes" : "no ", - (c1&0x20) ? "yes" : "no ", (c1&0x40) ? "yes" : "no " ); - - p += sprintf(p, "UDMA\n"); - p += sprintf(p, "DMA\n"); - p += sprintf(p, "PIO\n"); - - return p-buffer; /* => must be less than 4k! */ -} -#endif /* defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) */ - -byte hpt34x_proc = 0; - -extern char *ide_xfer_verbose (byte xfer_rate); - -static void hpt34x_clear_chipset (ide_drive_t *drive) -{ - unsigned int reg1 = 0, tmp1 = 0; - unsigned int reg2 = 0, tmp2 = 0; - - pci_read_config_dword(HWIF(drive)->pci_dev, 0x44, ®1); - pci_read_config_dword(HWIF(drive)->pci_dev, 0x48, ®2); - tmp1 = ((0x00 << (3*drive->dn)) | (reg1 & ~(7 << (3*drive->dn)))); - tmp2 = (reg2 & ~(0x11 << drive->dn)); - pci_write_config_dword(HWIF(drive)->pci_dev, 0x44, tmp1); - pci_write_config_dword(HWIF(drive)->pci_dev, 0x48, tmp2); -} - -static int hpt34x_tune_chipset (ide_drive_t *drive, byte speed) -{ - int err; - byte hi_speed, lo_speed; - unsigned int reg1 = 0, tmp1 = 0; - unsigned int reg2 = 0, tmp2 = 0; - - SPLIT_BYTE(speed, hi_speed, lo_speed); - - if (hi_speed & 7) { - hi_speed = (hi_speed & 4) ? 0x01 : 0x10; - } else { - lo_speed <<= 5; - lo_speed >>= 5; - } - - pci_read_config_dword(HWIF(drive)->pci_dev, 0x44, ®1); - pci_read_config_dword(HWIF(drive)->pci_dev, 0x48, ®2); - tmp1 = ((lo_speed << (3*drive->dn)) | (reg1 & ~(7 << (3*drive->dn)))); - tmp2 = ((hi_speed << drive->dn) | reg2); - err = ide_config_drive_speed(drive, speed); - pci_write_config_dword(HWIF(drive)->pci_dev, 0x44, tmp1); - pci_write_config_dword(HWIF(drive)->pci_dev, 0x48, tmp2); - - if (!drive->init_speed) - drive->init_speed = speed; - -#if HPT343_DEBUG_DRIVE_INFO - printk("%s: %s drive%d (0x%04x 0x%04x) (0x%04x 0x%04x)" \ - " (0x%02x 0x%02x) 0x%04x\n", - drive->name, ide_xfer_verbose(speed), - drive->dn, reg1, tmp1, reg2, tmp2, - hi_speed, lo_speed, err); -#endif /* HPT343_DEBUG_DRIVE_INFO */ - - drive->current_speed = speed; - return(err); -} - -static void config_chipset_for_pio (ide_drive_t *drive) -{ - unsigned short eide_pio_timing[6] = {960, 480, 240, 180, 120, 90}; - unsigned short xfer_pio = drive->id->eide_pio_modes; - - byte timing, speed, pio; - - pio = ide_get_best_pio_mode(drive, 255, 5, NULL); - - if (xfer_pio> 4) - xfer_pio = 0; - - if (drive->id->eide_pio_iordy > 0) { - for (xfer_pio = 5; - xfer_pio>0 && - drive->id->eide_pio_iordy>eide_pio_timing[xfer_pio]; - xfer_pio--); - } else { - xfer_pio = (drive->id->eide_pio_modes & 4) ? 0x05 : - (drive->id->eide_pio_modes & 2) ? 0x04 : - (drive->id->eide_pio_modes & 1) ? 0x03 : xfer_pio; - } - - timing = (xfer_pio >= pio) ? xfer_pio : pio; - - switch(timing) { - case 4: speed = XFER_PIO_4;break; - case 3: speed = XFER_PIO_3;break; - case 2: speed = XFER_PIO_2;break; - case 1: speed = XFER_PIO_1;break; - default: - speed = (!drive->id->tPIO) ? XFER_PIO_0 : XFER_PIO_SLOW; - break; - } - (void) hpt34x_tune_chipset(drive, speed); -} - -static void hpt34x_tune_drive (ide_drive_t *drive, byte pio) -{ - byte speed; - - switch(pio) { - case 4: speed = XFER_PIO_4;break; - case 3: speed = XFER_PIO_3;break; - case 2: speed = XFER_PIO_2;break; - case 1: speed = XFER_PIO_1;break; - default: speed = XFER_PIO_0;break; - } - hpt34x_clear_chipset(drive); - (void) hpt34x_tune_chipset(drive, speed); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -/* - * This allows the configuration of ide_pci chipset registers - * for cards that learn about the drive's UDMA, DMA, PIO capabilities - * after the drive is reported by the OS. Initally for designed for - * HPT343 UDMA chipset by HighPoint|Triones Technologies, Inc. - */ -static int config_chipset_for_dma (ide_drive_t *drive, byte ultra) -{ - struct hd_driveid *id = drive->id; - byte speed = 0x00; - - if (drive->media != ide_disk) - return ((int) ide_dma_off_quietly); - - hpt34x_clear_chipset(drive); - - if ((id->dma_ultra & 0x0010) && ultra) { - speed = XFER_UDMA_2; - } else if ((id->dma_ultra & 0x0008) && ultra) { - speed = XFER_UDMA_2; - } else if ((id->dma_ultra & 0x0004) && ultra) { - speed = XFER_UDMA_2; - } else if ((id->dma_ultra & 0x0002) && ultra) { - speed = XFER_UDMA_1; - } else if ((id->dma_ultra & 0x0001) && ultra) { - speed = XFER_UDMA_0; - } else if (id->dma_mword & 0x0004) { - speed = XFER_MW_DMA_2; - } else if (id->dma_mword & 0x0002) { - speed = XFER_MW_DMA_1; - } else if (id->dma_mword & 0x0001) { - speed = XFER_MW_DMA_0; - } else if (id->dma_1word & 0x0004) { - speed = XFER_SW_DMA_2; - } else if (id->dma_1word & 0x0002) { - speed = XFER_SW_DMA_1; - } else if (id->dma_1word & 0x0001) { - speed = XFER_SW_DMA_0; - } else { - return ((int) ide_dma_off_quietly); - } - - (void) hpt34x_tune_chipset(drive, speed); - - return ((int) ((id->dma_ultra >> 11) & 3) ? ide_dma_off : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ((id->dma_1word >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); -} - -static int config_drive_xfer_rate (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - ide_dma_action_t dma_func = ide_dma_on; - - if (id && (id->capability & 1) && HWIF(drive)->autodma) { - /* Consult the list of known "bad" drives */ - if (ide_dmaproc(ide_dma_bad_drive, drive)) { - dma_func = ide_dma_off; - goto fast_ata_pio; - } - dma_func = ide_dma_off_quietly; - if (id->field_valid & 4) { - if (id->dma_ultra & 0x0007) { - /* Force if Capable UltraDMA */ - dma_func = config_chipset_for_dma(drive, 1); - if ((id->field_valid & 2) && - (dma_func != ide_dma_on)) - goto try_dma_modes; - } - } else if (id->field_valid & 2) { -try_dma_modes: - if ((id->dma_mword & 0x0007) || - (id->dma_1word & 0x0007)) { - /* Force if Capable regular DMA modes */ - dma_func = config_chipset_for_dma(drive, 0); - if (dma_func != ide_dma_on) - goto no_dma_set; - } - } else if (ide_dmaproc(ide_dma_good_drive, drive)) { - if (id->eide_dma_time > 150) { - goto no_dma_set; - } - /* Consult the list of known "good" drives */ - dma_func = config_chipset_for_dma(drive, 0); - if (dma_func != ide_dma_on) - goto no_dma_set; - } else { - goto fast_ata_pio; - } - } else if ((id->capability & 8) || (id->field_valid & 2)) { -fast_ata_pio: - dma_func = ide_dma_off_quietly; -no_dma_set: - config_chipset_for_pio(drive); - } - -#ifndef CONFIG_HPT34X_AUTODMA - if (dma_func == ide_dma_on) - dma_func = ide_dma_off; -#endif /* CONFIG_HPT34X_AUTODMA */ - - return HWIF(drive)->dmaproc(dma_func, drive); -} - -/* - * hpt34x_dmaproc() initiates/aborts (U)DMA read/write operations on a drive. - * - * This is specific to the HPT343 UDMA bios-less chipset - * and HPT345 UDMA bios chipset (stamped HPT363) - * by HighPoint|Triones Technologies, Inc. - */ - -int hpt34x_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - ide_hwif_t *hwif = HWIF(drive); - unsigned long dma_base = hwif->dma_base; - unsigned int count, reading = 0; - byte dma_stat; - - switch (func) { - case ide_dma_check: - return config_drive_xfer_rate(drive); - case ide_dma_read: - reading = 1 << 3; - case ide_dma_write: - if (!(count = ide_build_dmatable(drive, func))) - return 1; /* try PIO instead of DMA */ - outl(hwif->dmatable_dma, dma_base + 4); /* PRD table */ - reading |= 0x01; - outb(reading, dma_base); /* specify r/w */ - outb(inb(dma_base+2)|6, dma_base+2); /* clear INTR & ERROR flags */ - drive->waiting_for_dma = 1; - if (drive->media != ide_disk) - return 0; - ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); /* issue cmd to drive */ - OUT_BYTE((reading == 9) ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG); - return 0; - case ide_dma_end: /* returns 1 on error, 0 otherwise */ - drive->waiting_for_dma = 0; - outb(inb(dma_base)&~1, dma_base); /* stop DMA */ - dma_stat = inb(dma_base+2); /* get DMA status */ - outb(dma_stat|6, dma_base+2); /* clear the INTR & ERROR bits */ - ide_destroy_dmatable(drive); /* purge DMA mappings */ - return (dma_stat & 7) != 4; /* verify good DMA status */ - default: - break; - } - return ide_dmaproc(func, drive); /* use standard DMA stuff */ -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -/* - * If the BIOS does not set the IO base addaress to XX00, 343 will fail. - */ -#define HPT34X_PCI_INIT_REG 0x80 - -unsigned int __init pci_init_hpt34x (struct pci_dev *dev, const char *name) -{ - int i = 0; - unsigned long hpt34xIoBase = pci_resource_start(dev, 4); - unsigned short cmd; - unsigned long flags; - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - - pci_write_config_byte(dev, HPT34X_PCI_INIT_REG, 0x00); - pci_read_config_word(dev, PCI_COMMAND, &cmd); - - if (cmd & PCI_COMMAND_MEMORY) { - if (pci_resource_start(dev, PCI_ROM_RESOURCE)) { - pci_write_config_byte(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); - printk(KERN_INFO "HPT345: ROM enabled at 0x%08lx\n", dev->resource[PCI_ROM_RESOURCE].start); - } - pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0xF0); - } else { - pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x20); - } - - pci_write_config_word(dev, PCI_COMMAND, cmd & ~PCI_COMMAND_IO); - dev->resource[0].start = (hpt34xIoBase + 0x20); - dev->resource[1].start = (hpt34xIoBase + 0x34); - dev->resource[2].start = (hpt34xIoBase + 0x28); - dev->resource[3].start = (hpt34xIoBase + 0x3c); - for(i=0; i<4; i++) - dev->resource[i].flags |= PCI_BASE_ADDRESS_SPACE_IO; - /* - * Since 20-23 can be assigned and are R/W, we correct them. - */ - pci_write_config_dword(dev, PCI_BASE_ADDRESS_0, dev->resource[0].start); - pci_write_config_dword(dev, PCI_BASE_ADDRESS_1, dev->resource[1].start); - pci_write_config_dword(dev, PCI_BASE_ADDRESS_2, dev->resource[2].start); - pci_write_config_dword(dev, PCI_BASE_ADDRESS_3, dev->resource[3].start); - pci_write_config_word(dev, PCI_COMMAND, cmd); - - __restore_flags(flags); /* local CPU only */ - -#if defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) - if (!hpt34x_proc) { - hpt34x_proc = 1; - bmide_dev = dev; - hpt34x_display_info = &hpt34x_get_info; - } -#endif /* DISPLAY_HPT34X_TIMINGS && CONFIG_PROC_FS */ - - return dev->irq; -} - -void __init ide_init_hpt34x (ide_hwif_t *hwif) -{ - hwif->tuneproc = &hpt34x_tune_drive; - hwif->speedproc = &hpt34x_tune_chipset; - -#ifdef CONFIG_BLK_DEV_IDEDMA - if (hwif->dma_base) { - unsigned short pcicmd = 0; - - pci_read_config_word(hwif->pci_dev, PCI_COMMAND, &pcicmd); - if (!noautodma) - hwif->autodma = (pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0; - else - hwif->autodma = 0; - - hwif->dmaproc = &hpt34x_dmaproc; - } else { - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - } -#else /* !CONFIG_BLK_DEV_IDEDMA */ - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - hwif->autodma = 0; -#endif /* CONFIG_BLK_DEV_IDEDMA */ -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/hpt366.c linux.20pre5-ac2/drivers/ide/hpt366.c --- linux.20pre5/drivers/ide/hpt366.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/hpt366.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,1233 +0,0 @@ -/* - * linux/drivers/ide/hpt366.c Version 0.22 20 Sep 2001 - * - * Copyright (C) 1999-2000 Andre Hedrick - * Portions Copyright (C) 2001 Sun Microsystems, Inc. - * May be copied or modified under the terms of the GNU General Public License - * - * Thanks to HighPoint Technologies for their assistance, and hardware. - * Special Thanks to Jon Burchmore in SanDiego for the deep pockets, his - * donation of an ABit BP6 mainboard, processor, and memory acellerated - * development and support. - * - * Note that final HPT370 support was done by force extraction of GPL. - * - * - add function for getting/setting power status of drive - * - the HPT370's state machine can get confused. reset it before each dma - * xfer to prevent that from happening. - * - reset state engine whenever we get an error. - * - check for busmaster state at end of dma. - * - use new highpoint timings. - * - detect bus speed using highpoint register. - * - use pll if we don't have a clock table. added a 66MHz table that's - * just 2x the 33MHz table. - * - removed turnaround. NOTE: we never want to switch between pll and - * pci clocks as the chip can glitch in those cases. the highpoint - * approved workaround slows everything down too much to be useful. in - * addition, we would have to serialize access to each chip. - * Adrian Sun - * - * add drive timings for 66MHz PCI bus, - * fix ATA Cable signal detection, fix incorrect /proc info - * add /proc display for per-drive PIO/DMA/UDMA mode and - * per-channel ATA-33/66 Cable detect. - * Duncan Laurie - * - * fixup /proc output for multiple controllers - * Tim Hockin - * - * On hpt366: - * Reset the hpt366 on error, reset on dma - * Fix disabling Fast Interrupt hpt366. - * Mike Waychison - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include -#include - -#include "ide_modes.h" - -#define DISPLAY_HPT366_TIMINGS - -/* various tuning parameters */ -#define HPT_RESET_STATE_ENGINE -/*#define HPT_DELAY_INTERRUPT*/ -/*#define HPT_SERIALIZE_IO*/ - -#if defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include -#endif /* defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) */ - -extern char *ide_dmafunc_verbose(ide_dma_action_t dmafunc); - -const char *quirk_drives[] = { - "QUANTUM FIREBALLlct08 08", - "QUANTUM FIREBALLP KA6.4", - "QUANTUM FIREBALLP LM20.4", - "QUANTUM FIREBALLP LM20.5", - NULL -}; - -const char *bad_ata100_5[] = { - "IBM-DTLA-307075", - "IBM-DTLA-307060", - "IBM-DTLA-307045", - "IBM-DTLA-307030", - "IBM-DTLA-307020", - "IBM-DTLA-307015", - "IBM-DTLA-305040", - "IBM-DTLA-305030", - "IBM-DTLA-305020", - "IC35L010AVER07-0", - "IC35L020AVER07-0", - "IC35L030AVER07-0", - "IC35L040AVER07-0", - "IC35L060AVER07-0", - "WDC AC310200R", - NULL -}; - -const char *bad_ata66_4[] = { - "IBM-DTLA-307075", - "IBM-DTLA-307060", - "IBM-DTLA-307045", - "IBM-DTLA-307030", - "IBM-DTLA-307020", - "IBM-DTLA-307015", - "IBM-DTLA-305040", - "IBM-DTLA-305030", - "IBM-DTLA-305020", - "IC35L010AVER07-0", - "IC35L020AVER07-0", - "IC35L030AVER07-0", - "IC35L040AVER07-0", - "IC35L060AVER07-0", - "WDC AC310200R", - NULL -}; - -const char *bad_ata66_3[] = { - "WDC AC310200R", - NULL -}; - -const char *bad_ata33[] = { - "Maxtor 92720U8", "Maxtor 92040U6", "Maxtor 91360U4", "Maxtor 91020U3", "Maxtor 90845U3", "Maxtor 90650U2", - "Maxtor 91360D8", "Maxtor 91190D7", "Maxtor 91020D6", "Maxtor 90845D5", "Maxtor 90680D4", "Maxtor 90510D3", "Maxtor 90340D2", - "Maxtor 91152D8", "Maxtor 91008D7", "Maxtor 90845D6", "Maxtor 90840D6", "Maxtor 90720D5", "Maxtor 90648D5", "Maxtor 90576D4", - "Maxtor 90510D4", - "Maxtor 90432D3", "Maxtor 90288D2", "Maxtor 90256D2", - "Maxtor 91000D8", "Maxtor 90910D8", "Maxtor 90875D7", "Maxtor 90840D7", "Maxtor 90750D6", "Maxtor 90625D5", "Maxtor 90500D4", - "Maxtor 91728D8", "Maxtor 91512D7", "Maxtor 91303D6", "Maxtor 91080D5", "Maxtor 90845D4", "Maxtor 90680D4", "Maxtor 90648D3", "Maxtor 90432D2", - NULL -}; - -struct chipset_bus_clock_list_entry { - byte xfer_speed; - unsigned int chipset_settings; -}; - -/* key for bus clock timings - * bit - * 0:3 data_high_time. inactive time of DIOW_/DIOR_ for PIO and MW - * DMA. cycles = value + 1 - * 4:8 data_low_time. active time of DIOW_/DIOR_ for PIO and MW - * DMA. cycles = value + 1 - * 9:12 cmd_high_time. inactive time of DIOW_/DIOR_ during task file - * register access. - * 13:17 cmd_low_time. active time of DIOW_/DIOR_ during task file - * register access. - * 18:21 udma_cycle_time. clock freq and clock cycles for UDMA xfer. - * during task file register access. - * 22:24 pre_high_time. time to initialize 1st cycle for PIO and MW DMA - * xfer. - * 25:27 cmd_pre_high_time. time to initialize 1st PIO cycle for task - * register access. - * 28 UDMA enable - * 29 DMA enable - * 30 PIO_MST enable. if set, the chip is in bus master mode during - * PIO. - * 31 FIFO enable. - */ -struct chipset_bus_clock_list_entry forty_base [] = { - - { XFER_UDMA_4, 0x900fd943 }, - { XFER_UDMA_3, 0x900ad943 }, - { XFER_UDMA_2, 0x900bd943 }, - { XFER_UDMA_1, 0x9008d943 }, - { XFER_UDMA_0, 0x9008d943 }, - - { XFER_MW_DMA_2, 0xa008d943 }, - { XFER_MW_DMA_1, 0xa010d955 }, - { XFER_MW_DMA_0, 0xa010d9fc }, - - { XFER_PIO_4, 0xc008d963 }, - { XFER_PIO_3, 0xc010d974 }, - { XFER_PIO_2, 0xc010d997 }, - { XFER_PIO_1, 0xc010d9c7 }, - { XFER_PIO_0, 0xc018d9d9 }, - { 0, 0x0120d9d9 } -}; - -struct chipset_bus_clock_list_entry thirty_three_base [] = { - - { XFER_UDMA_4, 0x90c9a731 }, - { XFER_UDMA_3, 0x90cfa731 }, - { XFER_UDMA_2, 0x90caa731 }, - { XFER_UDMA_1, 0x90cba731 }, - { XFER_UDMA_0, 0x90c8a731 }, - - { XFER_MW_DMA_2, 0xa0c8a731 }, - { XFER_MW_DMA_1, 0xa0c8a732 }, /* 0xa0c8a733 */ - { XFER_MW_DMA_0, 0xa0c8a797 }, - - { XFER_PIO_4, 0xc0c8a731 }, - { XFER_PIO_3, 0xc0c8a742 }, - { XFER_PIO_2, 0xc0d0a753 }, - { XFER_PIO_1, 0xc0d0a7a3 }, /* 0xc0d0a793 */ - { XFER_PIO_0, 0xc0d0a7aa }, /* 0xc0d0a7a7 */ - { 0, 0x0120a7a7 } -}; - -struct chipset_bus_clock_list_entry twenty_five_base [] = { - - { XFER_UDMA_4, 0x90c98521 }, - { XFER_UDMA_3, 0x90cf8521 }, - { XFER_UDMA_2, 0x90cf8521 }, - { XFER_UDMA_1, 0x90cb8521 }, - { XFER_UDMA_0, 0x90cb8521 }, - - { XFER_MW_DMA_2, 0xa0ca8521 }, - { XFER_MW_DMA_1, 0xa0ca8532 }, - { XFER_MW_DMA_0, 0xa0ca8575 }, - - { XFER_PIO_4, 0xc0ca8521 }, - { XFER_PIO_3, 0xc0ca8532 }, - { XFER_PIO_2, 0xc0ca8542 }, - { XFER_PIO_1, 0xc0d08572 }, - { XFER_PIO_0, 0xc0d08585 }, - { 0, 0x01208585 } -}; - -#if 1 -/* these are the current (4 sep 2001) timings from highpoint */ -struct chipset_bus_clock_list_entry thirty_three_base_hpt370[] = { - { XFER_UDMA_5, 0x12446231 }, - { XFER_UDMA_4, 0x12446231 }, - { XFER_UDMA_3, 0x126c6231 }, - { XFER_UDMA_2, 0x12486231 }, - { XFER_UDMA_1, 0x124c6233 }, - { XFER_UDMA_0, 0x12506297 }, - - { XFER_MW_DMA_2, 0x22406c31 }, - { XFER_MW_DMA_1, 0x22406c33 }, - { XFER_MW_DMA_0, 0x22406c97 }, - - { XFER_PIO_4, 0x06414e31 }, - { XFER_PIO_3, 0x06414e42 }, - { XFER_PIO_2, 0x06414e53 }, - { XFER_PIO_1, 0x06814e93 }, - { XFER_PIO_0, 0x06814ea7 }, - { 0, 0x06814ea7 } -}; - -/* 2x 33MHz timings */ -struct chipset_bus_clock_list_entry sixty_six_base_hpt370[] = { - { XFER_UDMA_5, 0x1488e673 }, - { XFER_UDMA_4, 0x1488e673 }, - { XFER_UDMA_3, 0x1498e673 }, - { XFER_UDMA_2, 0x1490e673 }, - { XFER_UDMA_1, 0x1498e677 }, - { XFER_UDMA_0, 0x14a0e73f }, - - { XFER_MW_DMA_2, 0x2480fa73 }, - { XFER_MW_DMA_1, 0x2480fa77 }, - { XFER_MW_DMA_0, 0x2480fb3f }, - - { XFER_PIO_4, 0x0c82be73 }, - { XFER_PIO_3, 0x0c82be95 }, - { XFER_PIO_2, 0x0c82beb7 }, - { XFER_PIO_1, 0x0d02bf37 }, - { XFER_PIO_0, 0x0d02bf5f }, - { 0, 0x0d02bf5f } -}; -#else -/* from highpoint documentation. these are old values */ -struct chipset_bus_clock_list_entry thirty_three_base_hpt370[] = { - { XFER_UDMA_5, 0x16454e31 }, - { XFER_UDMA_4, 0x16454e31 }, - { XFER_UDMA_3, 0x166d4e31 }, - { XFER_UDMA_2, 0x16494e31 }, - { XFER_UDMA_1, 0x164d4e31 }, - { XFER_UDMA_0, 0x16514e31 }, - - { XFER_MW_DMA_2, 0x26514e21 }, - { XFER_MW_DMA_1, 0x26514e33 }, - { XFER_MW_DMA_0, 0x26514e97 }, - - { XFER_PIO_4, 0x06514e21 }, - { XFER_PIO_3, 0x06514e22 }, - { XFER_PIO_2, 0x06514e33 }, - { XFER_PIO_1, 0x06914e43 }, - { XFER_PIO_0, 0x06914e57 }, - { 0, 0x06514e57 } -}; - -struct chipset_bus_clock_list_entry sixty_six_base_hpt370[] = { - { XFER_UDMA_5, 0x14846231 }, - { XFER_UDMA_4, 0x14886231 }, - { XFER_UDMA_3, 0x148c6231 }, - { XFER_UDMA_2, 0x148c6231 }, - { XFER_UDMA_1, 0x14906231 }, - { XFER_UDMA_0, 0x14986231 }, - - { XFER_MW_DMA_2, 0x26514e21 }, - { XFER_MW_DMA_1, 0x26514e33 }, - { XFER_MW_DMA_0, 0x26514e97 }, - - { XFER_PIO_4, 0x06514e21 }, - { XFER_PIO_3, 0x06514e22 }, - { XFER_PIO_2, 0x06514e33 }, - { XFER_PIO_1, 0x06914e43 }, - { XFER_PIO_0, 0x06914e57 }, - { 0, 0x06514e57 } -}; -#endif - -struct chipset_bus_clock_list_entry fifty_base_hpt370[] = { - { XFER_UDMA_5, 0x12848242 }, - { XFER_UDMA_4, 0x12ac8242 }, - { XFER_UDMA_3, 0x128c8242 }, - { XFER_UDMA_2, 0x120c8242 }, - { XFER_UDMA_1, 0x12148254 }, - { XFER_UDMA_0, 0x121882ea }, - - { XFER_MW_DMA_2, 0x22808242 }, - { XFER_MW_DMA_1, 0x22808254 }, - { XFER_MW_DMA_0, 0x228082ea }, - - { XFER_PIO_4, 0x0a81f442 }, - { XFER_PIO_3, 0x0a81f443 }, - { XFER_PIO_2, 0x0a81f454 }, - { XFER_PIO_1, 0x0ac1f465 }, - { XFER_PIO_0, 0x0ac1f48a }, - { 0, 0x0ac1f48a } -}; - -#define HPT366_DEBUG_DRIVE_INFO 0 -#define HPT370_ALLOW_ATA100_5 1 -#define HPT366_ALLOW_ATA66_4 1 -#define HPT366_ALLOW_ATA66_3 1 -#define HPT366_MAX_DEVS 8 - -#define F_LOW_PCI_33 0x23 -#define F_LOW_PCI_40 0x29 -#define F_LOW_PCI_50 0x2d -#define F_LOW_PCI_66 0x42 - -static struct pci_dev *hpt_devs[HPT366_MAX_DEVS]; -static int n_hpt_devs; - -static unsigned int pci_rev_check_hpt3xx(struct pci_dev *dev); -static unsigned int pci_rev2_check_hpt3xx(struct pci_dev *dev); -byte hpt366_proc = 0; -byte hpt363_shared_irq; -byte hpt363_shared_pin; -extern char *ide_xfer_verbose (byte xfer_rate); - -#if defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) -static int hpt366_get_info(char *, char **, off_t, int); -extern int (*hpt366_display_info)(char *, char **, off_t, int); /* ide-proc.c */ -extern char *ide_media_verbose(ide_drive_t *); - -static int hpt366_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - char *chipset_nums[] = {"366", "366", "368", "370", "370A"}; - int i; - - p += sprintf(p, "\n " - "HighPoint HPT366/368/370\n"); - for (i = 0; i < n_hpt_devs; i++) { - struct pci_dev *dev = hpt_devs[i]; - unsigned long iobase = dev->resource[4].start; - u32 class_rev; - u8 c0, c1; - - pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); - class_rev &= 0xff; - - p += sprintf(p, "\nController: %d\n", i); - p += sprintf(p, "Chipset: HPT%s\n", chipset_nums[class_rev]); - p += sprintf(p, "--------------- Primary Channel " - "--------------- Secondary Channel " - "--------------\n"); - - /* get the bus master status registers */ - c0 = inb_p(iobase + 0x2); - c1 = inb_p(iobase + 0xa); - p += sprintf(p, "Enabled: %s" - " %s\n", - (c0 & 0x80) ? "no" : "yes", - (c1 & 0x80) ? "no" : "yes"); - - if (pci_rev_check_hpt3xx(dev)) { - u8 cbl; - cbl = inb_p(iobase + 0x7b); - outb_p(cbl | 1, iobase + 0x7b); - outb_p(cbl & ~1, iobase + 0x7b); - cbl = inb_p(iobase + 0x7a); - p += sprintf(p, "Cable: ATA-%d" - " ATA-%d\n", - (cbl & 0x02) ? 33 : 66, - (cbl & 0x01) ? 33 : 66); - p += sprintf(p, "\n"); - } - - p += sprintf(p, "--------------- drive0 --------- drive1 " - "------- drive0 ---------- drive1 -------\n"); - p += sprintf(p, "DMA capable: %s %s" - " %s %s\n", - (c0 & 0x20) ? "yes" : "no ", - (c0 & 0x40) ? "yes" : "no ", - (c1 & 0x20) ? "yes" : "no ", - (c1 & 0x40) ? "yes" : "no "); - - { - u8 c2, c3; - /* older revs don't have these registers mapped - * into io space */ - pci_read_config_byte(dev, 0x43, &c0); - pci_read_config_byte(dev, 0x47, &c1); - pci_read_config_byte(dev, 0x4b, &c2); - pci_read_config_byte(dev, 0x4f, &c3); - - p += sprintf(p, "Mode: %s %s" - " %s %s\n", - (c0 & 0x10) ? "UDMA" : (c0 & 0x20) ? "DMA " : - (c0 & 0x80) ? "PIO " : "off ", - (c1 & 0x10) ? "UDMA" : (c1 & 0x20) ? "DMA " : - (c1 & 0x80) ? "PIO " : "off ", - (c2 & 0x10) ? "UDMA" : (c2 & 0x20) ? "DMA " : - (c2 & 0x80) ? "PIO " : "off ", - (c3 & 0x10) ? "UDMA" : (c3 & 0x20) ? "DMA " : - (c3 & 0x80) ? "PIO " : "off "); - } - } - p += sprintf(p, "\n"); - - return p-buffer;/* => must be less than 4k! */ -} -#endif /* defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) */ - -static unsigned int pci_rev_check_hpt3xx (struct pci_dev *dev) -{ - unsigned int class_rev; - pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); - class_rev &= 0xff; - return ((int) (class_rev > 0x02) ? 1 : 0); -} - -static unsigned int pci_rev2_check_hpt3xx (struct pci_dev *dev) -{ - unsigned int class_rev; - pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); - class_rev &= 0xff; - return ((int) (class_rev > 0x01) ? 1 : 0); -} - -static int check_in_drive_lists (ide_drive_t *drive, const char **list) -{ - struct hd_driveid *id = drive->id; - - if (quirk_drives == list) { - while (*list) { - if (strstr(id->model, *list++)) { - return 1; - } - } - } else { - while (*list) { - if (!strcmp(*list++,id->model)) { - return 1; - } - } - } - return 0; -} - -static unsigned int pci_bus_clock_list (byte speed, struct chipset_bus_clock_list_entry * chipset_table) -{ - for ( ; chipset_table->xfer_speed ; chipset_table++) - if (chipset_table->xfer_speed == speed) { - return chipset_table->chipset_settings; - } - return chipset_table->chipset_settings; -} - -static void hpt366_tune_chipset (ide_drive_t *drive, byte speed) -{ - byte regtime = (drive->select.b.unit & 0x01) ? 0x44 : 0x40; - byte regfast = (HWIF(drive)->channel) ? 0x55 : 0x51; - /* - * since the channel is always 0 it does not matter. - */ - - unsigned int reg1 = 0; - unsigned int reg2 = 0; - byte drive_fast = 0; - - /* - * Disable the "fast interrupt" prediction. - */ - pci_read_config_byte(HWIF(drive)->pci_dev, regfast, &drive_fast); - if (drive_fast & 0x02) - pci_write_config_byte(HWIF(drive)->pci_dev, regfast, drive_fast & ~0x20); - - pci_read_config_dword(HWIF(drive)->pci_dev, regtime, ®1); - /* detect bus speed by looking at control reg timing: */ - switch((reg1 >> 8) & 7) { - case 5: - reg2 = pci_bus_clock_list(speed, forty_base); - break; - case 9: - reg2 = pci_bus_clock_list(speed, twenty_five_base); - break; - default: - case 7: - reg2 = pci_bus_clock_list(speed, thirty_three_base); - break; - } -#if 0 - /* this is a nice idea ... */ - list_conf = pci_bus_clock_list(speed, - (struct chipset_bus_clock_list_entry *) - dev->sysdata); -#endif - /* - * Disable on-chip PIO FIFO/buffer (to avoid problems handling I/O errors later) - */ - if (speed >= XFER_MW_DMA_0) { - reg2 = (reg2 & ~0xc0000000) | (reg1 & 0xc0000000); - } else { - reg2 = (reg2 & ~0x30070000) | (reg1 & 0x30070000); - } - reg2 &= ~0x80000000; - - pci_write_config_dword(HWIF(drive)->pci_dev, regtime, reg2); -} - -static void hpt370_tune_chipset (ide_drive_t *drive, byte speed) -{ - byte regfast = (HWIF(drive)->channel) ? 0x55 : 0x51; - unsigned int list_conf = 0; - unsigned int drive_conf = 0; - unsigned int conf_mask = (speed >= XFER_MW_DMA_0) ? 0xc0000000 : 0x30070000; - byte drive_pci = 0x40 + (drive->dn * 4); - byte new_fast, drive_fast = 0; - struct pci_dev *dev = HWIF(drive)->pci_dev; - - /* - * Disable the "fast interrupt" prediction. - * don't holdoff on interrupts. (== 0x01 despite what the docs say) - */ - pci_read_config_byte(dev, regfast, &drive_fast); - new_fast = drive_fast; - if (new_fast & 0x02) - new_fast &= ~0x02; - -#ifdef HPT_DELAY_INTERRUPT - if (new_fast & 0x01) - new_fast &= ~0x01; -#else - if ((new_fast & 0x01) == 0) - new_fast |= 0x01; -#endif - if (new_fast != drive_fast) - pci_write_config_byte(HWIF(drive)->pci_dev, regfast, new_fast); - - list_conf = pci_bus_clock_list(speed, - (struct chipset_bus_clock_list_entry *) - dev->sysdata); - - pci_read_config_dword(dev, drive_pci, &drive_conf); - list_conf = (list_conf & ~conf_mask) | (drive_conf & conf_mask); - - if (speed < XFER_MW_DMA_0) { - list_conf &= ~0x80000000; /* Disable on-chip PIO FIFO/buffer */ - } - - pci_write_config_dword(dev, drive_pci, list_conf); -} - -static int hpt3xx_tune_chipset (ide_drive_t *drive, byte speed) -{ - if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0)) - return -1; - - if (!drive->init_speed) - drive->init_speed = speed; - - if (pci_rev_check_hpt3xx(HWIF(drive)->pci_dev)) { - hpt370_tune_chipset(drive, speed); - } else { - hpt366_tune_chipset(drive, speed); - } - drive->current_speed = speed; - return ((int) ide_config_drive_speed(drive, speed)); -} - -static void config_chipset_for_pio (ide_drive_t *drive) -{ - unsigned short eide_pio_timing[6] = {960, 480, 240, 180, 120, 90}; - unsigned short xfer_pio = drive->id->eide_pio_modes; - byte timing, speed, pio; - - pio = ide_get_best_pio_mode(drive, 255, 5, NULL); - - if (xfer_pio> 4) - xfer_pio = 0; - - if (drive->id->eide_pio_iordy > 0) { - for (xfer_pio = 5; - xfer_pio>0 && - drive->id->eide_pio_iordy>eide_pio_timing[xfer_pio]; - xfer_pio--); - } else { - xfer_pio = (drive->id->eide_pio_modes & 4) ? 0x05 : - (drive->id->eide_pio_modes & 2) ? 0x04 : - (drive->id->eide_pio_modes & 1) ? 0x03 : - (drive->id->tPIO & 2) ? 0x02 : - (drive->id->tPIO & 1) ? 0x01 : xfer_pio; - } - - timing = (xfer_pio >= pio) ? xfer_pio : pio; - - switch(timing) { - case 4: speed = XFER_PIO_4;break; - case 3: speed = XFER_PIO_3;break; - case 2: speed = XFER_PIO_2;break; - case 1: speed = XFER_PIO_1;break; - default: - speed = (!drive->id->tPIO) ? XFER_PIO_0 : XFER_PIO_SLOW; - break; - } - (void) hpt3xx_tune_chipset(drive, speed); -} - -static void hpt3xx_tune_drive (ide_drive_t *drive, byte pio) -{ - byte speed; - switch(pio) { - case 4: speed = XFER_PIO_4;break; - case 3: speed = XFER_PIO_3;break; - case 2: speed = XFER_PIO_2;break; - case 1: speed = XFER_PIO_1;break; - default: speed = XFER_PIO_0;break; - } - (void) hpt3xx_tune_chipset(drive, speed); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -/* - * This allows the configuration of ide_pci chipset registers - * for cards that learn about the drive's UDMA, DMA, PIO capabilities - * after the drive is reported by the OS. Initally for designed for - * HPT366 UDMA chipset by HighPoint|Triones Technologies, Inc. - * - * check_in_drive_lists(drive, bad_ata66_4) - * check_in_drive_lists(drive, bad_ata66_3) - * check_in_drive_lists(drive, bad_ata33) - * - */ -static int config_chipset_for_dma (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - byte speed = 0x00; - byte ultra66 = eighty_ninty_three(drive); - int rval; - - if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0)) - return ((int) ide_dma_off_quietly); - - if ((id->dma_ultra & 0x0020) && - (!check_in_drive_lists(drive, bad_ata100_5)) && - (HPT370_ALLOW_ATA100_5) && - (pci_rev_check_hpt3xx(HWIF(drive)->pci_dev)) && - (ultra66)) { - speed = XFER_UDMA_5; - } else if ((id->dma_ultra & 0x0010) && - (!check_in_drive_lists(drive, bad_ata66_4)) && - (HPT366_ALLOW_ATA66_4) && - (ultra66)) { - speed = XFER_UDMA_4; - } else if ((id->dma_ultra & 0x0008) && - (!check_in_drive_lists(drive, bad_ata66_3)) && - (HPT366_ALLOW_ATA66_3) && - (ultra66)) { - speed = XFER_UDMA_3; - } else if (id->dma_ultra && (!check_in_drive_lists(drive, bad_ata33))) { - if (id->dma_ultra & 0x0004) { - speed = XFER_UDMA_2; - } else if (id->dma_ultra & 0x0002) { - speed = XFER_UDMA_1; - } else if (id->dma_ultra & 0x0001) { - speed = XFER_UDMA_0; - } - } else if (id->dma_mword & 0x0004) { - speed = XFER_MW_DMA_2; - } else if (id->dma_mword & 0x0002) { - speed = XFER_MW_DMA_1; - } else if (id->dma_mword & 0x0001) { - speed = XFER_MW_DMA_0; - } else { - return ((int) ide_dma_off_quietly); - } - - (void) hpt3xx_tune_chipset(drive, speed); - - rval = (int)( ((id->dma_ultra >> 11) & 7) ? ide_dma_on : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); - return rval; -} - -int hpt3xx_quirkproc (ide_drive_t *drive) -{ - return ((int) check_in_drive_lists(drive, quirk_drives)); -} - -void hpt3xx_intrproc (ide_drive_t *drive) -{ - if (drive->quirk_list) { - /* drives in the quirk_list may not like intr setups/cleanups */ - } else { - OUT_BYTE((drive)->ctl|2, HWIF(drive)->io_ports[IDE_CONTROL_OFFSET]); - } -} - -void hpt3xx_maskproc (ide_drive_t *drive, int mask) -{ - if (drive->quirk_list) { - if (pci_rev_check_hpt3xx(HWIF(drive)->pci_dev)) { - byte reg5a = 0; - pci_read_config_byte(HWIF(drive)->pci_dev, 0x5a, ®5a); - if (((reg5a & 0x10) >> 4) != mask) - pci_write_config_byte(HWIF(drive)->pci_dev, 0x5a, mask ? (reg5a | 0x10) : (reg5a & ~0x10)); - } else { - if (mask) { - disable_irq(HWIF(drive)->irq); - } else { - enable_irq(HWIF(drive)->irq); - } - } - } else { - if (IDE_CONTROL_REG) - OUT_BYTE(mask ? (drive->ctl | 2) : (drive->ctl & ~2), IDE_CONTROL_REG); - } -} - -static int config_drive_xfer_rate (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - ide_dma_action_t dma_func = ide_dma_on; - - if (id && (id->capability & 1) && HWIF(drive)->autodma) { - /* Consult the list of known "bad" drives */ - if (ide_dmaproc(ide_dma_bad_drive, drive)) { - dma_func = ide_dma_off; - goto fast_ata_pio; - } - dma_func = ide_dma_off_quietly; - if (id->field_valid & 4) { - if (id->dma_ultra & 0x002F) { - /* Force if Capable UltraDMA */ - dma_func = config_chipset_for_dma(drive); - if ((id->field_valid & 2) && - (dma_func != ide_dma_on)) - goto try_dma_modes; - } - } else if (id->field_valid & 2) { -try_dma_modes: - if (id->dma_mword & 0x0007) { - /* Force if Capable regular DMA modes */ - dma_func = config_chipset_for_dma(drive); - if (dma_func != ide_dma_on) - goto no_dma_set; - } - } else if (ide_dmaproc(ide_dma_good_drive, drive)) { - if (id->eide_dma_time > 150) { - goto no_dma_set; - } - /* Consult the list of known "good" drives */ - dma_func = config_chipset_for_dma(drive); - if (dma_func != ide_dma_on) - goto no_dma_set; - } else { - goto fast_ata_pio; - } - } else if ((id->capability & 8) || (id->field_valid & 2)) { -fast_ata_pio: - dma_func = ide_dma_off_quietly; -no_dma_set: - - config_chipset_for_pio(drive); - } - return HWIF(drive)->dmaproc(dma_func, drive); -} - -/* - * hpt366_dmaproc() initiates/aborts (U)DMA read/write operations on a drive. - * - * This is specific to the HPT366 UDMA bios chipset - * by HighPoint|Triones Technologies, Inc. - */ -int hpt366_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - byte reg50h = 0, reg52h = 0, reg5ah = 0, dma_stat = 0; - unsigned long dma_base = HWIF(drive)->dma_base; - - switch (func) { - case ide_dma_check: - return config_drive_xfer_rate(drive); - case ide_dma_test_irq: /* returns 1 if dma irq issued, 0 otherwise */ - dma_stat = inb(dma_base+2); - return (dma_stat & 4) == 4; /* return 1 if INTR asserted */ - case ide_dma_lostirq: - pci_read_config_byte(HWIF(drive)->pci_dev, 0x50, ®50h); - pci_read_config_byte(HWIF(drive)->pci_dev, 0x52, ®52h); - pci_read_config_byte(HWIF(drive)->pci_dev, 0x5a, ®5ah); - printk("%s: (%s) reg50h=0x%02x, reg52h=0x%02x, reg5ah=0x%02x\n", - drive->name, - ide_dmafunc_verbose(func), - reg50h, reg52h, reg5ah); - if (reg5ah & 0x10) - pci_write_config_byte(HWIF(drive)->pci_dev, 0x5a, reg5ah & ~0x10); - /* fall through to a reset */ -#if 0 - case ide_dma_begin: - case ide_dma_end: - /* reset the chips state over and over.. */ - pci_write_config_byte(HWIF(drive)->pci_dev, 0x51, 0x13); -#endif - break; - case ide_dma_timeout: - default: - break; - } - return ide_dmaproc(func, drive); /* use standard DMA stuff */ -} - -int hpt370_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - ide_hwif_t *hwif = HWIF(drive); - unsigned long dma_base = hwif->dma_base; - byte regstate = hwif->channel ? 0x54 : 0x50; - byte reginfo = hwif->channel ? 0x56 : 0x52; - byte dma_stat; - - switch (func) { - case ide_dma_check: - return config_drive_xfer_rate(drive); - case ide_dma_test_irq: /* returns 1 if dma irq issued, 0 otherwise */ - dma_stat = inb(dma_base+2); - return (dma_stat & 4) == 4; /* return 1 if INTR asserted */ - - case ide_dma_end: - dma_stat = inb(dma_base + 2); - if (dma_stat & 0x01) { - udelay(20); /* wait a little */ - dma_stat = inb(dma_base + 2); - } - if ((dma_stat & 0x01) == 0) - break; - - func = ide_dma_timeout; - /* fallthrough */ - - case ide_dma_timeout: - case ide_dma_lostirq: - pci_read_config_byte(hwif->pci_dev, reginfo, - &dma_stat); - printk("%s: %d bytes in FIFO\n", drive->name, - dma_stat); - pci_write_config_byte(hwif->pci_dev, regstate, 0x37); - udelay(10); - dma_stat = inb(dma_base); - outb(dma_stat & ~0x1, dma_base); /* stop dma */ - dma_stat = inb(dma_base + 2); - outb(dma_stat | 0x6, dma_base+2); /* clear errors */ - /* fallthrough */ - -#ifdef HPT_RESET_STATE_ENGINE - case ide_dma_begin: -#endif - pci_write_config_byte(hwif->pci_dev, regstate, 0x37); - udelay(10); - break; - - default: - break; - } - return ide_dmaproc(func, drive); /* use standard DMA stuff */ -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -/* - * Since SUN Cobalt is attempting to do this operation, I should disclose - * this has been a long time ago Thu Jul 27 16:40:57 2000 was the patch date - * HOTSWAP ATA Infrastructure. - */ -void hpt3xx_reset (ide_drive_t *drive) -{ -#if 0 - unsigned long high_16 = pci_resource_start(HWIF(drive)->pci_dev, 4); - byte reset = (HWIF(drive)->channel) ? 0x80 : 0x40; - byte reg59h = 0; - - pci_read_config_byte(HWIF(drive)->pci_dev, 0x59, ®59h); - pci_write_config_byte(HWIF(drive)->pci_dev, 0x59, reg59h|reset); - pci_write_config_byte(HWIF(drive)->pci_dev, 0x59, reg59h); -#endif -} - -static int hpt3xx_tristate (ide_drive_t * drive, int state) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - byte reset = (hwif->channel) ? 0x80 : 0x40; - byte state_reg = (hwif->channel) ? 0x57 : 0x53; - byte reg59h = 0; - byte regXXh = 0; - - if (!hwif) - return -EINVAL; - -// hwif->bus_state = state; - - pci_read_config_byte(dev, 0x59, ®59h); - pci_read_config_byte(dev, state_reg, ®XXh); - - if (state) { - (void) ide_do_reset(drive); - pci_write_config_byte(dev, state_reg, regXXh|0x80); - pci_write_config_byte(dev, 0x59, reg59h|reset); - } else { - pci_write_config_byte(dev, 0x59, reg59h & ~(reset)); - pci_write_config_byte(dev, state_reg, regXXh & ~(0x80)); - (void) ide_do_reset(drive); - } - return 0; -} - -/* - * set/get power state for a drive. - * turning the power off does the following things: - * 1) soft-reset the drive - * 2) tri-states the ide bus - * - * when we turn things back on, we need to re-initialize things. - */ -#define TRISTATE_BIT 0x8000 -static int hpt370_busproc(ide_drive_t * drive, int state) -{ - ide_hwif_t *hwif = HWIF(drive); - byte tristate, resetmask, bus_reg; - u16 tri_reg; - - if (!hwif) - return -EINVAL; - - hwif->bus_state = state; - - if (hwif->channel) { - /* secondary channel */ - tristate = 0x56; - resetmask = 0x80; - } else { - /* primary channel */ - tristate = 0x52; - resetmask = 0x40; - } - - /* grab status */ - pci_read_config_word(hwif->pci_dev, tristate, &tri_reg); - pci_read_config_byte(hwif->pci_dev, 0x59, &bus_reg); - - /* set the state. we don't set it if we don't need to do so. - * make sure that the drive knows that it has failed if it's off */ - switch (state) { - case BUSSTATE_ON: - hwif->drives[0].failures = 0; - hwif->drives[1].failures = 0; - if ((bus_reg & resetmask) == 0) - return 0; - tri_reg &= ~TRISTATE_BIT; - bus_reg &= ~resetmask; - break; - case BUSSTATE_OFF: - hwif->drives[0].failures = hwif->drives[0].max_failures + 1; - hwif->drives[1].failures = hwif->drives[1].max_failures + 1; - if ((tri_reg & TRISTATE_BIT) == 0 && (bus_reg & resetmask)) - return 0; - tri_reg &= ~TRISTATE_BIT; - bus_reg |= resetmask; - break; - case BUSSTATE_TRISTATE: - hwif->drives[0].failures = hwif->drives[0].max_failures + 1; - hwif->drives[1].failures = hwif->drives[1].max_failures + 1; - if ((tri_reg & TRISTATE_BIT) && (bus_reg & resetmask)) - return 0; - tri_reg |= TRISTATE_BIT; - bus_reg |= resetmask; - break; - } - pci_write_config_byte(hwif->pci_dev, 0x59, bus_reg); - pci_write_config_word(hwif->pci_dev, tristate, tri_reg); - - return 0; -} - -static void __init init_hpt370(struct pci_dev *dev) -{ - int adjust, i; - u16 freq; - u32 pll; - byte reg5bh; - - /* - * default to pci clock. make sure MA15/16 are set to output - * to prevent drives having problems with 40-pin cables. - */ - pci_write_config_byte(dev, 0x5b, 0x23); - - /* - * set up the PLL. we need to adjust it so that it's stable. - * freq = Tpll * 192 / Tpci - */ - pci_read_config_word(dev, 0x78, &freq); - freq &= 0x1FF; - if (freq < 0x9c) { - pll = F_LOW_PCI_33; - dev->sysdata = (void *) thirty_three_base_hpt370; - printk("HPT370: using 33MHz PCI clock\n"); - } else if (freq < 0xb0) { - pll = F_LOW_PCI_40; - } else if (freq < 0xc8) { - pll = F_LOW_PCI_50; - dev->sysdata = (void *) fifty_base_hpt370; - printk("HPT370: using 50MHz PCI clock\n"); - } else { - pll = F_LOW_PCI_66; - dev->sysdata = (void *) sixty_six_base_hpt370; - printk("HPT370: using 66MHz PCI clock\n"); - } - - /* - * only try the pll if we don't have a table for the clock - * speed that we're running at. NOTE: the internal PLL will - * result in slow reads when using a 33MHz PCI clock. we also - * don't like to use the PLL because it will cause glitches - * on PRST/SRST when the HPT state engine gets reset. - */ - if (dev->sysdata) - goto init_hpt370_done; - - /* - * adjust PLL based upon PCI clock, enable it, and wait for - * stabilization. - */ - adjust = 0; - freq = (pll < F_LOW_PCI_50) ? 2 : 4; - while (adjust++ < 6) { - pci_write_config_dword(dev, 0x5c, (freq + pll) << 16 | - pll | 0x100); - - /* wait for clock stabilization */ - for (i = 0; i < 0x50000; i++) { - pci_read_config_byte(dev, 0x5b, ®5bh); - if (reg5bh & 0x80) { - /* spin looking for the clock to destabilize */ - for (i = 0; i < 0x1000; ++i) { - pci_read_config_byte(dev, 0x5b, - ®5bh); - if ((reg5bh & 0x80) == 0) - goto pll_recal; - } - pci_read_config_dword(dev, 0x5c, &pll); - pci_write_config_dword(dev, 0x5c, - pll & ~0x100); - pci_write_config_byte(dev, 0x5b, 0x21); - dev->sysdata = (void *) fifty_base_hpt370; - printk("HPT370: using 50MHz internal PLL\n"); - goto init_hpt370_done; - } - } -pll_recal: - if (adjust & 1) - pll -= (adjust >> 1); - else - pll += (adjust >> 1); - } - -init_hpt370_done: - /* reset state engine */ - pci_write_config_byte(dev, 0x50, 0x37); - pci_write_config_byte(dev, 0x54, 0x37); - udelay(100); -} - -unsigned int __init pci_init_hpt366 (struct pci_dev *dev, const char *name) -{ - byte test = 0; - - if (dev->resource[PCI_ROM_RESOURCE].start) - pci_write_config_byte(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); - - pci_read_config_byte(dev, PCI_CACHE_LINE_SIZE, &test); - if (test != (L1_CACHE_BYTES / 4)) - pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (L1_CACHE_BYTES / 4)); - - pci_read_config_byte(dev, PCI_LATENCY_TIMER, &test); - if (test != 0x78) - pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78); - - pci_read_config_byte(dev, PCI_MIN_GNT, &test); - if (test != 0x08) - pci_write_config_byte(dev, PCI_MIN_GNT, 0x08); - - pci_read_config_byte(dev, PCI_MAX_LAT, &test); - if (test != 0x08) - pci_write_config_byte(dev, PCI_MAX_LAT, 0x08); - - if (pci_rev_check_hpt3xx(dev)) { - init_hpt370(dev); - hpt_devs[n_hpt_devs++] = dev; - } else { - hpt_devs[n_hpt_devs++] = dev; - } - -#if defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) - if (!hpt366_proc) { - hpt366_proc = 1; - hpt366_display_info = &hpt366_get_info; - } -#endif /* DISPLAY_HPT366_TIMINGS && CONFIG_PROC_FS */ - - return dev->irq; -} - -unsigned int __init ata66_hpt366 (ide_hwif_t *hwif) -{ - byte ata66 = 0; - byte regmask = (hwif->channel) ? 0x01 : 0x02; - - pci_read_config_byte(hwif->pci_dev, 0x5a, &ata66); -#ifdef DEBUG - printk("HPT366: reg5ah=0x%02x ATA-%s Cable Port%d\n", - ata66, (ata66 & regmask) ? "33" : "66", - PCI_FUNC(hwif->pci_dev->devfn)); -#endif /* DEBUG */ - return ((ata66 & regmask) ? 0 : 1); -} - -void __init ide_init_hpt366 (ide_hwif_t *hwif) -{ - int hpt_rev; - - hwif->tuneproc = &hpt3xx_tune_drive; - hwif->speedproc = &hpt3xx_tune_chipset; - hwif->quirkproc = &hpt3xx_quirkproc; - hwif->intrproc = &hpt3xx_intrproc; - hwif->maskproc = &hpt3xx_maskproc; - -#ifdef HPT_SERIALIZE_IO - /* serialize access to this device */ - if (hwif->mate) - hwif->serialized = hwif->mate->serialized = 1; -#endif - - hpt_rev = pci_rev_check_hpt3xx(hwif->pci_dev); - if (hpt_rev) { - /* set up ioctl for power status. note: power affects both - * drives on each channel */ - hwif->busproc = &hpt370_busproc; - } - - if (pci_rev2_check_hpt3xx(hwif->pci_dev)) { - /* do nothing now but will split device types */ - hwif->resetproc = &hpt3xx_reset; -/* - * don't do until we can parse out the cobalt box argh ... - * hwif->busproc = &hpt3xx_tristate; - */ - } - -#ifdef CONFIG_BLK_DEV_IDEDMA - if (hwif->dma_base) { - if (hpt_rev) { - byte reg5ah = 0; - pci_read_config_byte(hwif->pci_dev, 0x5a, ®5ah); - if (reg5ah & 0x10) /* interrupt force enable */ - pci_write_config_byte(hwif->pci_dev, 0x5a, reg5ah & ~0x10); - hwif->dmaproc = &hpt370_dmaproc; - } else { - hwif->dmaproc = &hpt366_dmaproc; - } - if (!noautodma) - hwif->autodma = 1; - else - hwif->autodma = 0; - } else { - hwif->autodma = 0; - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - } -#else /* !CONFIG_BLK_DEV_IDEDMA */ - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - hwif->autodma = 0; -#endif /* CONFIG_BLK_DEV_IDEDMA */ -} - -void __init ide_dmacapable_hpt366 (ide_hwif_t *hwif, unsigned long dmabase) -{ - byte masterdma = 0, slavedma = 0; - byte dma_new = 0, dma_old = inb(dmabase+2); - byte primary = hwif->channel ? 0x4b : 0x43; - byte secondary = hwif->channel ? 0x4f : 0x47; - unsigned long flags; - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - - dma_new = dma_old; - pci_read_config_byte(hwif->pci_dev, primary, &masterdma); - pci_read_config_byte(hwif->pci_dev, secondary, &slavedma); - - if (masterdma & 0x30) dma_new |= 0x20; - if (slavedma & 0x30) dma_new |= 0x40; - if (dma_new != dma_old) outb(dma_new, dmabase+2); - - __restore_flags(flags); /* local CPU only */ - - ide_setup_dma(hwif, dmabase, 8); -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/hptraid.c linux.20pre5-ac2/drivers/ide/hptraid.c --- linux.20pre5/drivers/ide/hptraid.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/hptraid.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,436 +0,0 @@ -/* - hptraid.c Copyright (C) 2001 Red Hat, Inc. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - You should have received a copy of the GNU General Public License - (for example /usr/src/linux/COPYING); if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - Authors: Arjan van de Ven - - Based on work - Copyleft (C) 2001 by Wilfried Weissmann - Copyright (C) 1994-96 Marc ZYNGIER - Based on work done by Søren Schmidt for FreeBSD - - -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "ataraid.h" - -static int hptraid_open(struct inode * inode, struct file * filp); -static int hptraid_release(struct inode * inode, struct file * filp); -static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); -static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh); - - - -struct hptdisk { - kdev_t device; - unsigned long sectors; - struct block_device *bdev; -}; - -struct hptraid { - unsigned int stride; - unsigned int disks; - unsigned long sectors; - struct geom geom; - - struct hptdisk disk[8]; - - unsigned long cutoff[8]; - unsigned int cutoff_disks[8]; -}; - -static struct raid_device_operations hptraid_ops = { - open: hptraid_open, - release: hptraid_release, - ioctl: hptraid_ioctl, - make_request: hptraid_make_request -}; - -static struct hptraid raid[16]; - -static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) -{ - unsigned int minor; - unsigned char val; - unsigned long sectors; - - if (!inode || !inode->i_rdev) - return -EINVAL; - - minor = MINOR(inode->i_rdev)>>SHIFT; - - switch (cmd) { - case BLKGETSIZE: /* Return device size */ - if (!arg) return -EINVAL; - sectors = ataraid_gendisk.part[MINOR(inode->i_rdev)].nr_sects; - if (MINOR(inode->i_rdev)&15) - return put_user(sectors, (unsigned long *) arg); - return put_user(raid[minor].sectors , (unsigned long *) arg); - break; - - - case HDIO_GETGEO: - { - struct hd_geometry *loc = (struct hd_geometry *) arg; - unsigned short bios_cyl; - - if (!loc) return -EINVAL; - val = 255; - if (put_user(val, (byte *) &loc->heads)) return -EFAULT; - val=63; - if (put_user(val, (byte *) &loc->sectors)) return -EFAULT; - bios_cyl = raid[minor].sectors/63/255; - if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT; - if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect, - (unsigned long *) &loc->start)) return -EFAULT; - return 0; - } - - case HDIO_GETGEO_BIG: - { - struct hd_big_geometry *loc = (struct hd_big_geometry *) arg; - unsigned int bios_cyl; - if (!loc) return -EINVAL; - val = 255; - if (put_user(val, (byte *) &loc->heads)) return -EFAULT; - val = 63; - if (put_user(val, (byte *) &loc->sectors)) return -EFAULT; - bios_cyl = raid[minor].sectors/63/255; - if (put_user(bios_cyl, (unsigned int *) &loc->cylinders)) return -EFAULT; - if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect, - (unsigned long *) &loc->start)) return -EFAULT; - return 0; - } - - default: - return blk_ioctl(inode->i_rdev, cmd, arg); - }; - - return 0; -} - - -static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh) -{ - unsigned long rsect; - unsigned long rsect_left,rsect_accum = 0; - unsigned long block; - unsigned int disk=0,real_disk=0; - int i; - int device; - struct hptraid *thisraid; - - rsect = bh->b_rsector; - - /* Ok. We need to modify this sector number to a new disk + new sector number. - * If there are disks of different sizes, this gets tricky. - * Example with 3 disks (1Gb, 4Gb and 5 GB): - * The first 3 Gb of the "RAID" are evenly spread over the 3 disks. - * Then things get interesting. The next 2Gb (RAID view) are spread across disk 2 and 3 - * and the last 1Gb is disk 3 only. - * - * the way this is solved is like this: We have a list of "cutoff" points where everytime - * a disk falls out of the "higher" count, we mark the max sector. So once we pass a cutoff - * point, we have to divide by one less. - */ - - device = (bh->b_rdev >> SHIFT)&MAJOR_MASK; - thisraid = &raid[device]; - if (thisraid->stride==0) - thisraid->stride=1; - - /* Partitions need adding of the start sector of the partition to the requested sector */ - - rsect += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; - - /* Woops we need to split the request to avoid crossing a stride barrier */ - if ((rsect/thisraid->stride) != ((rsect+(bh->b_size/512)-1)/thisraid->stride)) { - return -1; - } - - rsect_left = rsect; - - for (i=0;i<8;i++) { - if (thisraid->cutoff_disks[i]==0) - break; - if (rsect > thisraid->cutoff[i]) { - /* we're in the wrong area so far */ - rsect_left -= thisraid->cutoff[i]; - rsect_accum += thisraid->cutoff[i]/thisraid->cutoff_disks[i]; - } else { - block = rsect_left / thisraid->stride; - disk = block % thisraid->cutoff_disks[i]; - block = (block / thisraid->cutoff_disks[i]) * thisraid->stride; - rsect = rsect_accum + (rsect_left % thisraid->stride) + block; - break; - } - } - - for (i=0;i<8;i++) { - if ((disk==0) && (thisraid->disk[i].sectors > rsect_accum)) { - real_disk = i; - break; - } - if ((disk>0) && (thisraid->disk[i].sectors >= rsect_accum)) { - disk--; - } - - } - disk = real_disk; - - /* All but the first disk have a 10 sector offset */ - if (i>0) - rsect+=10; - - - /* - * The new BH_Lock semantics in ll_rw_blk.c guarantee that this - * is the only IO operation happening on this bh. - */ - - bh->b_rdev = thisraid->disk[disk].device; - bh->b_rsector = rsect; - - /* - * Let the main block layer submit the IO and resolve recursion: - */ - return 1; -} - - -#include "hptraid.h" - -static int read_disk_sb (int major, int minor, unsigned char *buffer,int bufsize) -{ - int ret = -EINVAL; - struct buffer_head *bh = NULL; - kdev_t dev = MKDEV(major,minor); - - if (blksize_size[major]==NULL) /* device doesn't exist */ - return -EINVAL; - - - /* Superblock is at 4096+412 bytes */ - set_blocksize (dev, 4096); - bh = bread (dev, 1, 4096); - - - if (bh) { - memcpy (buffer, bh->b_data, bufsize); - } else { - printk(KERN_ERR "hptraid: Error reading superblock.\n"); - goto abort; - } - ret = 0; -abort: - if (bh) - brelse (bh); - return ret; -} - -static unsigned long maxsectors (int major,int minor) -{ - unsigned long lba = 0; - kdev_t dev; - ide_drive_t *ideinfo; - - dev = MKDEV(major,minor); - ideinfo = get_info_ptr (dev); - if (ideinfo==NULL) - return 0; - - - /* first sector of the last cluster */ - if (ideinfo->head==0) - return 0; - if (ideinfo->sect==0) - return 0; - lba = (ideinfo->capacity); - - return lba; -} - -static void __init probedisk(int major, int minor,int device) -{ - int i; - struct highpoint_raid_conf *prom; - static unsigned char block[4096]; - struct block_device *bdev; - - if (maxsectors(major,minor)==0) - return; - - if (read_disk_sb(major,minor,(unsigned char*)&block,sizeof(block))) - return; - - prom = (struct highpoint_raid_conf*)&block[512]; - - if (prom->magic!= 0x5a7816f0) - return; - if (prom->type) { - printk(KERN_INFO "hptraid: only RAID0 is supported currently\n"); - return; - } - - i = prom->disk_number; - if (i<0) - return; - if (i>8) - return; - - bdev = bdget(MKDEV(major,minor)); - if (bdev && blkdev_get(bdev,FMODE_READ|FMODE_WRITE,0,BDEV_RAW) == 0) { - int j=0; - struct gendisk *gd; - raid[device].disk[i].bdev = bdev; - /* This is supposed to prevent others from stealing our underlying disks */ - /* now blank the /proc/partitions table for the wrong partition table, - so that scripts don't accidentally mount it and crash the kernel */ - /* XXX: the 0 is an utter hack --hch */ - gd=get_gendisk(MKDEV(major, 0)); - if (gd!=NULL) { - for (j=1+(minor<minor_shift);j<((minor+1)<minor_shift);j++) - gd->part[j].nr_sects=0; - } - } - raid[device].disk[i].device = MKDEV(major,minor); - raid[device].disk[i].sectors = maxsectors(major,minor); - raid[device].stride = (1<raid0_shift); - raid[device].disks = prom->raid_disks; - raid[device].sectors = prom->total_secs; - -} - -static void __init fill_cutoff(int device) -{ - int i,j; - unsigned long smallest; - unsigned long bar; - int count; - - bar = 0; - for (i=0;i<8;i++) { - smallest = ~0; - for (j=0;j<8;j++) - if ((raid[device].disk[j].sectors < smallest) && (raid[device].disk[j].sectors>bar)) - smallest = raid[device].disk[j].sectors; - count = 0; - for (j=0;j<8;j++) - if (raid[device].disk[j].sectors >= smallest) - count++; - - smallest = smallest * count; - bar = smallest; - raid[device].cutoff[i] = smallest; - raid[device].cutoff_disks[i] = count; - - } -} - - -static __init int hptraid_init_one(int device) -{ - int i,count; - - probedisk(IDE0_MAJOR, 0, device); - probedisk(IDE0_MAJOR, 64, device); - probedisk(IDE1_MAJOR, 0, device); - probedisk(IDE1_MAJOR, 64, device); - probedisk(IDE2_MAJOR, 0, device); - probedisk(IDE2_MAJOR, 64, device); - probedisk(IDE3_MAJOR, 0, device); - probedisk(IDE3_MAJOR, 64, device); - probedisk(IDE4_MAJOR, 0, device); - probedisk(IDE4_MAJOR, 64, device); - probedisk(IDE5_MAJOR, 0, device); - probedisk(IDE5_MAJOR, 64, device); - - fill_cutoff(device); - - /* Initialize the gendisk structure */ - - ataraid_register_disk(device,raid[device].sectors); - - count=0; - printk(KERN_INFO "Highpoint HPT370 Softwareraid driver for linux version 0.01\n"); - - for (i=0;i<8;i++) { - if (raid[device].disk[i].device!=0) { - printk(KERN_INFO "Drive %i is %li Mb \n", - i,raid[device].disk[i].sectors/2048); - count++; - } - } - if (count) { - printk(KERN_INFO "Raid array consists of %i drives. \n",count); - return 0; - } else { - printk(KERN_INFO "No raid array found\n"); - return -ENODEV; - } - -} - -static __init int hptraid_init(void) -{ - int retval,device; - - device=ataraid_get_device(&hptraid_ops); - if (device<0) - return -ENODEV; - retval = hptraid_init_one(device); - if (retval) - ataraid_release_device(device); - return retval; -} - -static void __exit hptraid_exit (void) -{ - int i,device; - for (device = 0; device<16; device++) { - for (i=0;i<8;i++) { - struct block_device *bdev = raid[device].disk[i].bdev; - raid[device].disk[i].bdev = NULL; - if (bdev) - blkdev_put(bdev, BDEV_RAW); - } - if (raid[device].sectors) - ataraid_release_device(device); - } -} - -static int hptraid_open(struct inode * inode, struct file * filp) -{ - MOD_INC_USE_COUNT; - return 0; -} -static int hptraid_release(struct inode * inode, struct file * filp) -{ - MOD_DEC_USE_COUNT; - return 0; -} - -module_init(hptraid_init); -module_exit(hptraid_exit); -MODULE_LICENSE("GPL"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/hptraid.h linux.20pre5-ac2/drivers/ide/hptraid.h --- linux.20pre5/drivers/ide/hptraid.h 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/hptraid.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,77 +0,0 @@ -/*- - * Copyright (c) 2000,2001 Søren Schmidt - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer, - * without modification, immediately at the beginning of the file. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -struct highpoint_raid_conf -{ - int8_t filler1[32]; - u_int32_t magic; -#define HPT_MAGIC_OK 0x5a7816f0 -#define HPT_MAGIC_BAD 0x5a7816fd - - u_int32_t magic_0; - u_int32_t magic_1; - u_int32_t order; -#define HPT_O_MIRROR 0x01 -#define HPT_O_STRIPE 0x02 -#define HPT_O_OK 0x04 - - u_int8_t raid_disks; - u_int8_t raid0_shift; - u_int8_t type; -#define HPT_T_RAID_0 0x00 -#define HPT_T_RAID_1 0x01 -#define HPT_T_RAID_01_RAID_0 0x02 -#define HPT_T_SPAN 0x03 -#define HPT_T_RAID_3 0x04 -#define HPT_T_RAID_5 0x05 -#define HPT_T_SINGLEDISK 0x06 -#define HPT_T_RAID_01_RAID_1 0x07 - - u_int8_t disk_number; - u_int32_t total_secs; - u_int32_t disk_mode; - u_int32_t boot_mode; - u_int8_t boot_disk; - u_int8_t boot_protect; - u_int8_t error_log_entries; - u_int8_t error_log_index; - struct - { - u_int32_t timestamp; - u_int8_t reason; -#define HPT_R_REMOVED 0xfe -#define HPT_R_BROKEN 0xff - - u_int8_t disk; - u_int8_t status; - u_int8_t sectors; - u_int32_t lba; - } errorlog[32]; - u_int8_t filler[60]; -}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ht6560b.c linux.20pre5-ac2/drivers/ide/ht6560b.c --- linux.20pre5/drivers/ide/ht6560b.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ht6560b.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,343 +0,0 @@ -/* - * linux/drivers/ide/ht6560b.c Version 0.07 Feb 1, 2000 - * - * Copyright (C) 1995-2000 Linus Torvalds & author (see below) - */ - -/* - * - * Version 0.01 Initial version hacked out of ide.c - * - * Version 0.02 Added support for PIO modes, auto-tune - * - * Version 0.03 Some cleanups - * - * Version 0.05 PIO mode cycle timings auto-tune using bus-speed - * - * Version 0.06 Prefetch mode now defaults no OFF. To set - * prefetch mode OFF/ON use "hdparm -p8/-p9". - * Unmask irq is disabled when prefetch mode - * is enabled. - * - * Version 0.07 Trying to fix CD-ROM detection problem. - * "Prefetch" mode bit OFF for ide disks and - * ON for anything else. - * - * - * HT-6560B EIDE-controller support - * To activate controller support use kernel parameter "ide0=ht6560b". - * Use hdparm utility to enable PIO mode support. - * - * Author: Mikko Ala-Fossi - * Jan Evert van Grootheest - * - * Try: http://www.maf.iki.fi/~maf/ht6560b/ - */ - -#define HT6560B_VERSION "v0.07" - -#undef REALLY_SLOW_IO /* most systems can safely undef this */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "ide_modes.h" - -/* #define DEBUG */ /* remove comments for DEBUG messages */ - -/* - * The special i/o-port that HT-6560B uses to configuration: - * bit0 (0x01): "1" selects secondary interface - * bit2 (0x04): "1" enables FIFO function - * bit5 (0x20): "1" enables prefetched data read function (???) - * - * The special i/o-port that HT-6560A uses to configuration: - * bit0 (0x01): "1" selects secondary interface - * bit1 (0x02): "1" enables prefetched data read function - * bit2 (0x04): "0" enables multi-master system (?) - * bit3 (0x08): "1" 3 cycle time, "0" 2 cycle time (?) - */ -#define HT_CONFIG_PORT 0x3e6 -#define HT_CONFIG(drivea) (byte)(((drivea)->drive_data & 0xff00) >> 8) -/* - * FIFO + PREFETCH (both a/b-model) - */ -#define HT_CONFIG_DEFAULT 0x1c /* no prefetch */ -/* #define HT_CONFIG_DEFAULT 0x3c */ /* with prefetch */ -#define HT_SECONDARY_IF 0x01 -#define HT_PREFETCH_MODE 0x20 - -/* - * ht6560b Timing values: - * - * I reviewed some assembler source listings of htide drivers and found - * out how they setup those cycle time interfacing values, as they at Holtek - * call them. IDESETUP.COM that is supplied with the drivers figures out - * optimal values and fetches those values to drivers. I found out that - * they use IDE_SELECT_REG to fetch timings to the ide board right after - * interface switching. After that it was quite easy to add code to - * ht6560b.c. - * - * IDESETUP.COM gave me values 0x24, 0x45, 0xaa, 0xff that worked fine - * for hda and hdc. But hdb needed higher values to work, so I guess - * that sometimes it is necessary to give higher value than IDESETUP - * gives. [see cmd640.c for an extreme example of this. -ml] - * - * Perhaps I should explain something about these timing values: - * The higher nibble of value is the Recovery Time (rt) and the lower nibble - * of the value is the Active Time (at). Minimum value 2 is the fastest and - * the maximum value 15 is the slowest. Default values should be 15 for both. - * So 0x24 means 2 for rt and 4 for at. Each of the drives should have - * both values, and IDESETUP gives automatically rt=15 st=15 for CDROMs or - * similar. If value is too small there will be all sorts of failures. - * - * Timing byte consists of - * High nibble: Recovery Cycle Time (rt) - * The valid values range from 2 to 15. The default is 15. - * - * Low nibble: Active Cycle Time (at) - * The valid values range from 2 to 15. The default is 15. - * - * You can obtain optimized timing values by running Holtek IDESETUP.COM - * for DOS. DOS drivers get their timing values from command line, where - * the first value is the Recovery Time and the second value is the - * Active Time for each drive. Smaller value gives higher speed. - * In case of failures you should probably fall back to a higher value. - */ -#define HT_TIMING(drivea) (byte)((drivea)->drive_data & 0x00ff) -#define HT_TIMING_DEFAULT 0xff - -/* - * This routine handles interface switching for the peculiar hardware design - * on the F.G.I./Holtek HT-6560B VLB IDE interface. - * The HT-6560B can only enable one IDE port at a time, and requires a - * silly sequence (below) whenever we switch between primary and secondary. - */ - -/* - * This routine is invoked from ide.c to prepare for access to a given drive. - */ -static void ht6560b_selectproc (ide_drive_t *drive) -{ - unsigned long flags; - static byte current_select = 0; - static byte current_timing = 0; - byte select, timing; - - __save_flags (flags); /* local CPU only */ - __cli(); /* local CPU only */ - - select = HT_CONFIG(drive); - timing = HT_TIMING(drive); - - if (select != current_select || timing != current_timing) { - current_select = select; - current_timing = timing; - if (drive->media != ide_disk || !drive->present) - select |= HT_PREFETCH_MODE; - (void) inb(HT_CONFIG_PORT); - (void) inb(HT_CONFIG_PORT); - (void) inb(HT_CONFIG_PORT); - (void) inb(HT_CONFIG_PORT); - outb(select, HT_CONFIG_PORT); - /* - * Set timing for this drive: - */ - outb(timing, IDE_SELECT_REG); - (void) inb(IDE_STATUS_REG); -#ifdef DEBUG - printk("ht6560b: %s: select=%#x timing=%#x\n", drive->name, select, timing); -#endif - } - __restore_flags (flags); /* local CPU only */ -} - -/* - * Autodetection and initialization of ht6560b - */ -static int __init try_to_init_ht6560b(void) -{ - byte orig_value; - int i; - - /* Autodetect ht6560b */ - if ((orig_value=inb(HT_CONFIG_PORT)) == 0xff) - return 0; - - for (i=3;i>0;i--) { - outb(0x00, HT_CONFIG_PORT); - if (!( (~inb(HT_CONFIG_PORT)) & 0x3f )) { - outb(orig_value, HT_CONFIG_PORT); - return 0; - } - } - outb(0x00, HT_CONFIG_PORT); - if ((~inb(HT_CONFIG_PORT))& 0x3f) { - outb(orig_value, HT_CONFIG_PORT); - return 0; - } - /* - * Ht6560b autodetected - */ - outb(HT_CONFIG_DEFAULT, HT_CONFIG_PORT); - outb(HT_TIMING_DEFAULT, 0x1f6); /* IDE_SELECT_REG */ - (void) inb(0x1f7); /* IDE_STATUS_REG */ - - printk("\nht6560b " HT6560B_VERSION - ": chipset detected and initialized" -#ifdef DEBUG - " with debug enabled" -#endif - ); - return 1; -} - -static byte ht_pio2timings(ide_drive_t *drive, byte pio) -{ - int active_time, recovery_time; - int active_cycles, recovery_cycles; - ide_pio_data_t d; - int bus_speed = system_bus_clock(); - - if (pio) { - pio = ide_get_best_pio_mode(drive, pio, 5, &d); - - /* - * Just like opti621.c we try to calculate the - * actual cycle time for recovery and activity - * according system bus speed. - */ - active_time = ide_pio_timings[pio].active_time; - recovery_time = d.cycle_time - - active_time - - ide_pio_timings[pio].setup_time; - /* - * Cycle times should be Vesa bus cycles - */ - active_cycles = (active_time * bus_speed + 999) / 1000; - recovery_cycles = (recovery_time * bus_speed + 999) / 1000; - /* - * Upper and lower limits - */ - if (active_cycles < 2) active_cycles = 2; - if (recovery_cycles < 2) recovery_cycles = 2; - if (active_cycles > 15) active_cycles = 15; - if (recovery_cycles > 15) recovery_cycles = 0; /* 0==16 */ - -#ifdef DEBUG - printk("ht6560b: drive %s setting pio=%d recovery=%d (%dns) active=%d (%dns)\n", drive->name, pio, recovery_cycles, recovery_time, active_cycles, active_time); -#endif - - return (byte)((recovery_cycles << 4) | active_cycles); - } else { - -#ifdef DEBUG - printk("ht6560b: drive %s setting pio=0\n", drive->name); -#endif - - return HT_TIMING_DEFAULT; /* default setting */ - } -} - -/* - * Enable/Disable so called prefetch mode - */ -static void ht_set_prefetch(ide_drive_t *drive, byte state) -{ - unsigned long flags; - int t = HT_PREFETCH_MODE << 8; - - save_flags (flags); /* all CPUs */ - cli(); /* all CPUs */ - - /* - * Prefetch mode and unmask irq seems to conflict - */ - if (state) { - drive->drive_data |= t; /* enable prefetch mode */ - drive->no_unmask = 1; - drive->unmask = 0; - } else { - drive->drive_data &= ~t; /* disable prefetch mode */ - drive->no_unmask = 0; - } - - restore_flags (flags); /* all CPUs */ - -#ifdef DEBUG - printk("ht6560b: drive %s prefetch mode %sabled\n", drive->name, (state ? "en" : "dis")); -#endif -} - -static void tune_ht6560b (ide_drive_t *drive, byte pio) -{ - unsigned long flags; - byte timing; - - switch (pio) { - case 8: /* set prefetch off */ - case 9: /* set prefetch on */ - ht_set_prefetch(drive, pio & 1); - return; - } - - timing = ht_pio2timings(drive, pio); - - save_flags (flags); /* all CPUs */ - cli(); /* all CPUs */ - - drive->drive_data &= 0xff00; - drive->drive_data |= timing; - - restore_flags (flags); /* all CPUs */ - -#ifdef DEBUG - printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing); -#endif -} - -void __init init_ht6560b (void) -{ - int t; - - if (check_region(HT_CONFIG_PORT,1)) { - printk(KERN_ERR "ht6560b: PORT %#x ALREADY IN USE\n", HT_CONFIG_PORT); - } else { - if (try_to_init_ht6560b()) { - request_region(HT_CONFIG_PORT, 1, ide_hwifs[0].name); - ide_hwifs[0].chipset = ide_ht6560b; - ide_hwifs[1].chipset = ide_ht6560b; - ide_hwifs[0].selectproc = &ht6560b_selectproc; - ide_hwifs[1].selectproc = &ht6560b_selectproc; - ide_hwifs[0].tuneproc = &tune_ht6560b; - ide_hwifs[1].tuneproc = &tune_ht6560b; - ide_hwifs[0].serialized = 1; /* is this needed? */ - ide_hwifs[1].serialized = 1; /* is this needed? */ - ide_hwifs[0].mate = &ide_hwifs[1]; - ide_hwifs[1].mate = &ide_hwifs[0]; - ide_hwifs[1].channel = 1; - - /* - * Setting default configurations for drives - */ - t = (HT_CONFIG_DEFAULT << 8); - t |= HT_TIMING_DEFAULT; - ide_hwifs[0].drives[0].drive_data = t; - ide_hwifs[0].drives[1].drive_data = t; - t |= (HT_SECONDARY_IF << 8); - ide_hwifs[1].drives[0].drive_data = t; - ide_hwifs[1].drives[1].drive_data = t; - } else - printk(KERN_ERR "ht6560b: not found\n"); - } -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/icside.c linux.20pre5-ac2/drivers/ide/icside.c --- linux.20pre5/drivers/ide/icside.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/icside.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,766 +0,0 @@ -/* - * linux/drivers/ide/icside.c - * - * Copyright (c) 1996,1997 Russell King. - * - * Changelog: - * 08-Jun-1996 RMK Created - * 12-Sep-1997 RMK Added interrupt enable/disable - * 17-Apr-1999 RMK Added support for V6 EASI - * 22-May-1999 RMK Added support for V6 DMA - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -extern char *ide_xfer_verbose (byte xfer_rate); - -/* - * Maximum number of interfaces per card - */ -#define MAX_IFS 2 - -#define ICS_IDENT_OFFSET 0x8a0 - -#define ICS_ARCIN_V5_INTRSTAT 0x000 -#define ICS_ARCIN_V5_INTROFFSET 0x001 -#define ICS_ARCIN_V5_IDEOFFSET 0xa00 -#define ICS_ARCIN_V5_IDEALTOFFSET 0xae0 -#define ICS_ARCIN_V5_IDESTEPPING 4 - -#define ICS_ARCIN_V6_IDEOFFSET_1 0x800 -#define ICS_ARCIN_V6_INTROFFSET_1 0x880 -#define ICS_ARCIN_V6_INTRSTAT_1 0x8a4 -#define ICS_ARCIN_V6_IDEALTOFFSET_1 0x8e0 -#define ICS_ARCIN_V6_IDEOFFSET_2 0xc00 -#define ICS_ARCIN_V6_INTROFFSET_2 0xc80 -#define ICS_ARCIN_V6_INTRSTAT_2 0xca4 -#define ICS_ARCIN_V6_IDEALTOFFSET_2 0xce0 -#define ICS_ARCIN_V6_IDESTEPPING 4 - -struct cardinfo { - unsigned int dataoffset; - unsigned int ctrloffset; - unsigned int stepping; -}; - -static struct cardinfo icside_cardinfo_v5 = { - ICS_ARCIN_V5_IDEOFFSET, - ICS_ARCIN_V5_IDEALTOFFSET, - ICS_ARCIN_V5_IDESTEPPING -}; - -static struct cardinfo icside_cardinfo_v6_1 = { - ICS_ARCIN_V6_IDEOFFSET_1, - ICS_ARCIN_V6_IDEALTOFFSET_1, - ICS_ARCIN_V6_IDESTEPPING -}; - -static struct cardinfo icside_cardinfo_v6_2 = { - ICS_ARCIN_V6_IDEOFFSET_2, - ICS_ARCIN_V6_IDEALTOFFSET_2, - ICS_ARCIN_V6_IDESTEPPING -}; - -static const card_ids icside_cids[] = { - { MANU_ICS, PROD_ICS_IDE }, - { MANU_ICS2, PROD_ICS2_IDE }, - { 0xffff, 0xffff } -}; - -typedef enum { - ics_if_unknown, - ics_if_arcin_v5, - ics_if_arcin_v6 -} iftype_t; - -/* ---------------- Version 5 PCB Support Functions --------------------- */ -/* Prototype: icside_irqenable_arcin_v5 (struct expansion_card *ec, int irqnr) - * Purpose : enable interrupts from card - */ -static void icside_irqenable_arcin_v5 (struct expansion_card *ec, int irqnr) -{ - unsigned int memc_port = (unsigned int)ec->irq_data; - outb (0, memc_port + ICS_ARCIN_V5_INTROFFSET); -} - -/* Prototype: icside_irqdisable_arcin_v5 (struct expansion_card *ec, int irqnr) - * Purpose : disable interrupts from card - */ -static void icside_irqdisable_arcin_v5 (struct expansion_card *ec, int irqnr) -{ - unsigned int memc_port = (unsigned int)ec->irq_data; - inb (memc_port + ICS_ARCIN_V5_INTROFFSET); -} - -static const expansioncard_ops_t icside_ops_arcin_v5 = { - icside_irqenable_arcin_v5, - icside_irqdisable_arcin_v5, - NULL, - NULL, - NULL, - NULL -}; - - -/* ---------------- Version 6 PCB Support Functions --------------------- */ -/* Prototype: icside_irqenable_arcin_v6 (struct expansion_card *ec, int irqnr) - * Purpose : enable interrupts from card - */ -static void icside_irqenable_arcin_v6 (struct expansion_card *ec, int irqnr) -{ - unsigned int ide_base_port = (unsigned int)ec->irq_data; - - outb (0, ide_base_port + ICS_ARCIN_V6_INTROFFSET_1); - outb (0, ide_base_port + ICS_ARCIN_V6_INTROFFSET_2); -} - -/* Prototype: icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr) - * Purpose : disable interrupts from card - */ -static void icside_irqdisable_arcin_v6 (struct expansion_card *ec, int irqnr) -{ - unsigned int ide_base_port = (unsigned int)ec->irq_data; - - inb (ide_base_port + ICS_ARCIN_V6_INTROFFSET_1); - inb (ide_base_port + ICS_ARCIN_V6_INTROFFSET_2); -} - -/* Prototype: icside_irqprobe(struct expansion_card *ec) - * Purpose : detect an active interrupt from card - */ -static int icside_irqpending_arcin_v6(struct expansion_card *ec) -{ - unsigned int ide_base_port = (unsigned int)ec->irq_data; - - return inb(ide_base_port + ICS_ARCIN_V6_INTRSTAT_1) & 1 || - inb(ide_base_port + ICS_ARCIN_V6_INTRSTAT_2) & 1; -} - -static const expansioncard_ops_t icside_ops_arcin_v6 = { - icside_irqenable_arcin_v6, - icside_irqdisable_arcin_v6, - icside_irqpending_arcin_v6, - NULL, - NULL, - NULL -}; - -/* Prototype: icside_identifyif (struct expansion_card *ec) - * Purpose : identify IDE interface type - * Notes : checks the description string - */ -static iftype_t __init icside_identifyif (struct expansion_card *ec) -{ - unsigned int addr; - iftype_t iftype; - int id = 0; - - iftype = ics_if_unknown; - - addr = ecard_address (ec, ECARD_IOC, ECARD_FAST) + ICS_IDENT_OFFSET; - - id = inb (addr) & 1; - id |= (inb (addr + 1) & 1) << 1; - id |= (inb (addr + 2) & 1) << 2; - id |= (inb (addr + 3) & 1) << 3; - - switch (id) { - case 0: /* A3IN */ - printk("icside: A3IN unsupported\n"); - break; - - case 1: /* A3USER */ - printk("icside: A3USER unsupported\n"); - break; - - case 3: /* ARCIN V6 */ - printk(KERN_DEBUG "icside: detected ARCIN V6 in slot %d\n", ec->slot_no); - iftype = ics_if_arcin_v6; - break; - - case 15:/* ARCIN V5 (no id) */ - printk(KERN_DEBUG "icside: detected ARCIN V5 in slot %d\n", ec->slot_no); - iftype = ics_if_arcin_v5; - break; - - default:/* we don't know - complain very loudly */ - printk("icside: ***********************************\n"); - printk("icside: *** UNKNOWN ICS INTERFACE id=%d ***\n", id); - printk("icside: ***********************************\n"); - printk("icside: please report this to linux@arm.linux.org.uk\n"); - printk("icside: defaulting to ARCIN V5\n"); - iftype = ics_if_arcin_v5; - break; - } - - return iftype; -} - -#ifdef CONFIG_BLK_DEV_IDEDMA_ICS -/* - * SG-DMA support. - * - * Similar to the BM-DMA, but we use the RiscPCs IOMD DMA controllers. - * There is only one DMA controller per card, which means that only - * one drive can be accessed at one time. NOTE! We do not enforce that - * here, but we rely on the main IDE driver spotting that both - * interfaces use the same IRQ, which should guarantee this. - */ -#define NR_ENTRIES 256 -#define TABLE_SIZE (NR_ENTRIES * 8) - -static int ide_build_sglist(ide_hwif_t *hwif, struct request *rq) -{ - struct buffer_head *bh; - struct scatterlist *sg = hwif->sg_table; - int nents = 0; - - if (rq->cmd == READ) - hwif->sg_dma_direction = PCI_DMA_FROMDEVICE; - else - hwif->sg_dma_direction = PCI_DMA_TODEVICE; - bh = rq->bh; - do { - unsigned char *virt_addr = bh->b_data; - unsigned int size = bh->b_size; - - while ((bh = bh->b_reqnext) != NULL) { - if ((virt_addr + size) != (unsigned char *)bh->b_data) - break; - size += bh->b_size; - } - memset(&sg[nents], 0, sizeof(*sg)); - sg[nents].address = virt_addr; - sg[nents].length = size; - nents++; - } while (bh != NULL); - - return pci_map_sg(NULL, sg, nents, hwif->sg_dma_direction); -} - -static int -icside_build_dmatable(ide_drive_t *drive, int reading) -{ - return HWIF(drive)->sg_nents = ide_build_sglist(HWIF(drive), HWGROUP(drive)->rq); -} - -/* Teardown mappings after DMA has completed. */ -static void icside_destroy_dmatable(ide_drive_t *drive) -{ - struct scatterlist *sg = HWIF(drive)->sg_table; - int nents = HWIF(drive)->sg_nents; - - pci_unmap_sg(NULL, sg, nents, HWIF(drive)->sg_dma_direction); -} - -static int -icside_config_if(ide_drive_t *drive, int xfer_mode) -{ - int func = ide_dma_off; - - switch (xfer_mode) { - case XFER_MW_DMA_2: - /* - * The cycle time is limited to 250ns by the r/w - * pulse width (90ns), however we should still - * have a maximum burst transfer rate of 8MB/s. - */ - drive->drive_data = 250; - break; - - case XFER_MW_DMA_1: - drive->drive_data = 250; - break; - - case XFER_MW_DMA_0: - drive->drive_data = 480; - break; - - default: - drive->drive_data = 0; - break; - } - - if (!drive->init_speed) - drive->init_speed = (byte) xfer_mode; - - if (drive->drive_data && - ide_config_drive_speed(drive, (byte) xfer_mode) == 0) - func = ide_dma_on; - else - drive->drive_data = 480; - - printk("%s: %s selected (peak %dMB/s)\n", drive->name, - ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data); - - drive->current_speed = (byte) xfer_mode; - - return func; -} - -static int -icside_set_speed(ide_drive_t *drive, byte speed) -{ - return icside_config_if(drive, speed); -} - -/* - * dma_intr() is the handler for disk read/write DMA interrupts - */ -static ide_startstop_t icside_dmaintr(ide_drive_t *drive) -{ - int i; - byte stat, dma_stat; - - dma_stat = HWIF(drive)->dmaproc(ide_dma_end, drive); - stat = GET_STAT(); /* get drive status */ - if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) { - if (!dma_stat) { - struct request *rq = HWGROUP(drive)->rq; - rq = HWGROUP(drive)->rq; - for (i = rq->nr_sectors; i > 0;) { - i -= rq->current_nr_sectors; - ide_end_request(1, HWGROUP(drive)); - } - return ide_stopped; - } - printk("%s: dma_intr: bad DMA status (dma_stat=%x)\n", - drive->name, dma_stat); - } - return ide_error(drive, "dma_intr", stat); -} - -/* - * The following is a sick duplication from ide-dma.c ;( - * - * This should be defined in one place only. - */ -struct drive_list_entry { - char * id_model; - char * id_firmware; -}; - -static struct drive_list_entry drive_whitelist [] = { - { "Micropolis 2112A", "ALL" }, - { "CONNER CTMA 4000", "ALL" }, - { "CONNER CTT8000-A", "ALL" }, - { "ST34342A", "ALL" }, - { NULL, 0 } -}; - -static struct drive_list_entry drive_blacklist [] = { - { "WDC AC11000H", "ALL" }, - { "WDC AC22100H", "ALL" }, - { "WDC AC32500H", "ALL" }, - { "WDC AC33100H", "ALL" }, - { "WDC AC31600H", "ALL" }, - { "WDC AC32100H", "24.09P07" }, - { "WDC AC23200L", "21.10N21" }, - { "Compaq CRD-8241B", "ALL" }, - { "CRD-8400B", "ALL" }, - { "CRD-8480B", "ALL" }, - { "CRD-8480C", "ALL" }, - { "CRD-8482B", "ALL" }, - { "CRD-84", "ALL" }, - { "SanDisk SDP3B", "ALL" }, - { "SanDisk SDP3B-64", "ALL" }, - { "SANYO CD-ROM CRD", "ALL" }, - { "HITACHI CDR-8", "ALL" }, - { "HITACHI CDR-8335", "ALL" }, - { "HITACHI CDR-8435", "ALL" }, - { "Toshiba CD-ROM XM-6202B", "ALL" }, - { "CD-532E-A", "ALL" }, - { "E-IDE CD-ROM CR-840", "ALL" }, - { "CD-ROM Drive/F5A", "ALL" }, - { "RICOH CD-R/RW MP7083A", "ALL" }, - { "WPI CDD-820", "ALL" }, - { "SAMSUNG CD-ROM SC-148C", "ALL" }, - { "SAMSUNG CD-ROM SC-148F", "ALL" }, - { "SAMSUNG CD-ROM SC", "ALL" }, - { "SanDisk SDP3B-64", "ALL" }, - { "SAMSUNG CD-ROM SN-124", "ALL" }, - { "PLEXTOR CD-R PX-W8432T", "ALL" }, - { "ATAPI CD-ROM DRIVE 40X MAXIMUM", "ALL" }, - { "_NEC DV5800A", "ALL" }, - { NULL, 0 } -}; - -static int in_drive_list(struct hd_driveid *id, struct drive_list_entry * drive_table) -{ - for ( ; drive_table->id_model ; drive_table++) - if ((!strcmp(drive_table->id_model, id->model)) && - ((!strstr(drive_table->id_firmware, id->fw_rev)) || - (!strcmp(drive_table->id_firmware, "ALL")))) - return 1; - return 0; -} - -/* - * For both Blacklisted and Whitelisted drives. - * This is setup to be called as an extern for future support - * to other special driver code. - */ -static int check_drive_lists(ide_drive_t *drive, int good_bad) -{ - struct hd_driveid *id = drive->id; - - if (good_bad) { - return in_drive_list(id, drive_whitelist); - } else { - int blacklist = in_drive_list(id, drive_blacklist); - if (blacklist) - printk("%s: Disabling DMA for %s\n", drive->name, id->model); - return(blacklist); - } - return 0; -} - -static int -icside_dma_check(ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - int autodma = hwif->autodma; - int xfer_mode = XFER_PIO_2; - int func = ide_dma_off_quietly; - - if (!id || !(id->capability & 1) || !autodma) - goto out; - - /* - * Consult the list of known "bad" drives - */ - if (check_drive_lists(drive, 0)) { - func = ide_dma_off; - goto out; - } - - /* - * Enable DMA on any drive that has multiword DMA - */ - if (id->field_valid & 2) { - if (id->dma_mword & 4) { - xfer_mode = XFER_MW_DMA_2; - func = ide_dma_on; - } else if (id->dma_mword & 2) { - xfer_mode = XFER_MW_DMA_1; - func = ide_dma_on; - } else if (id->dma_mword & 1) { - xfer_mode = XFER_MW_DMA_0; - func = ide_dma_on; - } - goto out; - } - - /* - * Consult the list of known "good" drives - */ - if (check_drive_lists(drive, 1)) { - if (id->eide_dma_time > 150) - goto out; - xfer_mode = XFER_MW_DMA_1; - func = ide_dma_on; - } - -out: - func = icside_config_if(drive, xfer_mode); - - return hwif->dmaproc(func, drive); -} - -static int -icside_dma_verbose(ide_drive_t *drive) -{ - printk(", DMA"); - return 1; -} - -static int -icside_dmaproc(ide_dma_action_t func, ide_drive_t *drive) -{ - ide_hwif_t *hwif = HWIF(drive); - int count, reading = 0; - - switch (func) { - case ide_dma_off: - printk("%s: DMA disabled\n", drive->name); - /*FALLTHROUGH*/ - - case ide_dma_off_quietly: - case ide_dma_on: - drive->using_dma = (func == ide_dma_on); - return 0; - - case ide_dma_check: - return icside_dma_check(drive); - - case ide_dma_read: - reading = 1; - case ide_dma_write: - count = icside_build_dmatable(drive, reading); - if (!count) - return 1; - disable_dma(hwif->hw.dma); - - /* Route the DMA signals to - * to the correct interface. - */ - outb(hwif->select_data, hwif->config_data); - - /* Select the correct timing - * for this drive - */ - set_dma_speed(hwif->hw.dma, drive->drive_data); - - set_dma_sg(hwif->hw.dma, HWIF(drive)->sg_table, count); - set_dma_mode(hwif->hw.dma, reading ? DMA_MODE_READ - : DMA_MODE_WRITE); - - drive->waiting_for_dma = 1; - if (drive->media != ide_disk) - return 0; - - ide_set_handler(drive, &icside_dmaintr, WAIT_CMD, NULL); - OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, - IDE_COMMAND_REG); - - case ide_dma_begin: - enable_dma(hwif->hw.dma); - return 0; - - case ide_dma_end: - drive->waiting_for_dma = 0; - disable_dma(hwif->hw.dma); - icside_destroy_dmatable(drive); - return get_dma_residue(hwif->hw.dma) != 0; - - case ide_dma_test_irq: - return inb((unsigned long)hwif->hw.priv) & 1; - - case ide_dma_bad_drive: - case ide_dma_good_drive: - return check_drive_lists(drive, (func == ide_dma_good_drive)); - - case ide_dma_verbose: - return icside_dma_verbose(drive); - - case ide_dma_timeout: - default: - printk("icside_dmaproc: unsupported %s func: %d\n", - ide_dmafunc_verbose(func), func); - } - return 1; -} - -static int -icside_setup_dma(ide_hwif_t *hwif, int autodma) -{ - printk(" %s: SG-DMA", hwif->name); - - hwif->sg_table = kmalloc(sizeof(struct scatterlist) * NR_ENTRIES, - GFP_KERNEL); - if (!hwif->sg_table) - goto failed; - - hwif->dmatable_cpu = NULL; - hwif->dmatable_dma = 0; - hwif->speedproc = icside_set_speed; - hwif->dmaproc = icside_dmaproc; - hwif->autodma = autodma; - - printk(" capable%s\n", autodma ? - ", auto-enable" : ""); - - return 1; - -failed: - printk(" -- ERROR, unable to allocate DMA table\n"); - return 0; -} -#endif - -static ide_hwif_t * -icside_find_hwif(unsigned long dataport) -{ - ide_hwif_t *hwif; - int index; - - for (index = 0; index < MAX_HWIFS; ++index) { - hwif = &ide_hwifs[index]; - if (hwif->io_ports[IDE_DATA_OFFSET] == (ide_ioreg_t)dataport) - goto found; - } - - for (index = 0; index < MAX_HWIFS; ++index) { - hwif = &ide_hwifs[index]; - if (!hwif->io_ports[IDE_DATA_OFFSET]) - goto found; - } - - return NULL; -found: - return hwif; -} - -static ide_hwif_t * -icside_setup(unsigned long base, struct cardinfo *info, int irq) -{ - unsigned long port = base + info->dataoffset; - ide_hwif_t *hwif; - - hwif = icside_find_hwif(base); - if (hwif) { - int i; - - memset(&hwif->hw, 0, sizeof(hw_regs_t)); - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hwif->hw.io_ports[i] = (ide_ioreg_t)port; - hwif->io_ports[i] = (ide_ioreg_t)port; - port += 1 << info->stepping; - } - hwif->hw.io_ports[IDE_CONTROL_OFFSET] = base + info->ctrloffset; - hwif->io_ports[IDE_CONTROL_OFFSET] = base + info->ctrloffset; - hwif->hw.irq = irq; - hwif->irq = irq; - hwif->hw.dma = NO_DMA; - hwif->noprobe = 0; - hwif->chipset = ide_acorn; - } - - return hwif; -} - -static int __init icside_register_v5(struct expansion_card *ec, int autodma) -{ - unsigned long slot_port; - ide_hwif_t *hwif; - - slot_port = ecard_address(ec, ECARD_MEMC, 0); - - ec->irqaddr = (unsigned char *)ioaddr(slot_port + ICS_ARCIN_V5_INTRSTAT); - ec->irqmask = 1; - ec->irq_data = (void *)slot_port; - ec->ops = (expansioncard_ops_t *)&icside_ops_arcin_v5; - - /* - * Be on the safe side - disable interrupts - */ - inb(slot_port + ICS_ARCIN_V5_INTROFFSET); - - hwif = icside_setup(slot_port, &icside_cardinfo_v5, ec->irq); - - return hwif ? 0 : -1; -} - -static int __init icside_register_v6(struct expansion_card *ec, int autodma) -{ - unsigned long slot_port, port; - ide_hwif_t *hwif, *mate; - int sel = 0; - - slot_port = ecard_address(ec, ECARD_IOC, ECARD_FAST); - port = ecard_address(ec, ECARD_EASI, ECARD_FAST); - - if (port == 0) - port = slot_port; - else - sel = 1 << 5; - - outb(sel, slot_port); - - ec->irq_data = (void *)port; - ec->ops = (expansioncard_ops_t *)&icside_ops_arcin_v6; - - /* - * Be on the safe side - disable interrupts - */ - inb(port + ICS_ARCIN_V6_INTROFFSET_1); - inb(port + ICS_ARCIN_V6_INTROFFSET_2); - - hwif = icside_setup(port, &icside_cardinfo_v6_1, ec->irq); - mate = icside_setup(port, &icside_cardinfo_v6_2, ec->irq); - -#ifdef CONFIG_BLK_DEV_IDEDMA_ICS - if (ec->dma != NO_DMA) { - if (request_dma(ec->dma, hwif->name)) - goto no_dma; - - if (hwif) { - hwif->config_data = slot_port; - hwif->select_data = sel; - hwif->hw.dma = ec->dma; - hwif->hw.priv = (void *) - (port + ICS_ARCIN_V6_INTRSTAT_1); - hwif->channel = 0; - icside_setup_dma(hwif, autodma); - } - if (mate) { - mate->config_data = slot_port; - mate->select_data = sel | 1; - mate->hw.dma = ec->dma; - mate->hw.priv = (void *) - (port + ICS_ARCIN_V6_INTRSTAT_2); - mate->channel = 1; - icside_setup_dma(mate, autodma); - } - } -no_dma: -#endif - return hwif || mate ? 0 : -1; -} - -int __init icside_init(void) -{ - int autodma = 0; - -#ifdef CONFIG_IDEDMA_ICS_AUTO - autodma = 1; -#endif - - ecard_startfind (); - - do { - struct expansion_card *ec; - int result; - - ec = ecard_find(0, icside_cids); - if (ec == NULL) - break; - - ecard_claim(ec); - - switch (icside_identifyif(ec)) { - case ics_if_arcin_v5: - result = icside_register_v5(ec, autodma); - break; - - case ics_if_arcin_v6: - result = icside_register_v6(ec, autodma); - break; - - default: - result = -1; - break; - } - - if (result) - ecard_release(ec); - } while (1); - - return 0; -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-adma.c linux.20pre5-ac2/drivers/ide/ide-adma.c --- linux.20pre5/drivers/ide/ide-adma.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-adma.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,9 +0,0 @@ -/* - * linux/drivers/ide/ide-adma.c Version 0.00 June 24, 2001 - * - * Copyright (c) 2001 Andre Hedrick - * - * Asynchronous DMA -- TBA, this is a holding file. - * - */ - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide.c linux.20pre5-ac2/drivers/ide/ide.c --- linux.20pre5/drivers/ide/ide.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide.c 2002-09-01 18:20:48.000000000 +0100 @@ -1,5 +1,5 @@ /* - * linux/drivers/ide/ide.c Version 6.31 June 9, 2000 + * linux/drivers/ide/ide.c Version 7.00alpha1 August 19 2002 * * Copyright (C) 1994-1998 Linus Torvalds & authors (see below) */ @@ -12,7 +12,8 @@ * See linux/MAINTAINERS for address of current maintainer. * * This is the multiple IDE interface driver, as evolved from hd.c. - * It supports up to MAX_HWIFS IDE interfaces, on one or more IRQs (usually 14 & 15). + * It supports up to MAX_HWIFS IDE interfaces, on one or more IRQs + * (usually 14 & 15). * There can be up to two drives per interface, as per the ATA-2 spec. * * Primary: ide0, port 0x1f0; major=3; hda is minor=0; hdb is minor=64 @@ -113,6 +114,7 @@ * Version 6.31 Debug Share INTR's and request queue streaming * Native ATA-100 support * Prep for Cascades Project + * Version 7.00alpha First named revision of ide rearrange * * Some additional driver compile-time options are in ./include/linux/ide.h * @@ -121,8 +123,8 @@ * */ -#define REVISION "Revision: 6.31" -#define VERSION "Id: ide.c 6.31 2000/06/09" +#define REVISION "Revision: 7.00alpha1" +#define VERSION "Id: ide.c 7.00a1 20020819" #undef REALLY_SLOW_IO /* most systems can safely undef this */ @@ -141,9 +143,7 @@ #include #include #include -#ifndef MODULE #include -#endif /* MODULE */ #include #include #include @@ -159,31 +159,27 @@ #include "ide_modes.h" -#ifdef CONFIG_KMOD #include -#endif /* CONFIG_KMOD */ - -#ifdef CONFIG_IDE_TASKFILE_IO -# define __TASKFILE__IO -#else /* CONFIG_IDE_TASKFILE_IO */ -# undef __TASKFILE__IO -#endif /* CONFIG_IDE_TASKFILE_IO */ - -#ifdef __TASKFILE__IO -#else /* !__TASKFILE__IO */ -#endif /* __TASKFILE__IO */ /* default maximum number of failures */ #define IDE_DEFAULT_MAX_FAILURES 1 -static const byte ide_hwif_to_major[] = { IDE0_MAJOR, IDE1_MAJOR, IDE2_MAJOR, IDE3_MAJOR, IDE4_MAJOR, IDE5_MAJOR, IDE6_MAJOR, IDE7_MAJOR, IDE8_MAJOR, IDE9_MAJOR }; +static const u8 ide_hwif_to_major[] = { IDE0_MAJOR, IDE1_MAJOR, + IDE2_MAJOR, IDE3_MAJOR, + IDE4_MAJOR, IDE5_MAJOR, + IDE6_MAJOR, IDE7_MAJOR, + IDE8_MAJOR, IDE9_MAJOR }; + +static int idebus_parameter; /* holds the "idebus=" parameter */ +static int system_bus_speed; /* holds what we think is VESA/PCI bus speed */ +static int initializing; /* set while initializing built-in drivers */ -static int idebus_parameter; /* holds the "idebus=" parameter */ -static int system_bus_speed; /* holds what we think is VESA/PCI bus speed */ -static int initializing; /* set while initializing built-in drivers */ +#if 0 +spinlock_t ide_lock __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED; +#endif #ifdef CONFIG_BLK_DEV_IDEPCI -static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ +static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ #endif /* CONFIG_BLK_DEV_IDEPCI */ #if defined(__mc68000__) || defined(CONFIG_APUS) @@ -191,39 +187,63 @@ * ide_lock is used by the Atari code to obtain access to the IDE interrupt, * which is shared between several drivers. */ -static int ide_lock; +static int ide_intr_lock; #endif /* __mc68000__ || CONFIG_APUS */ +#ifdef CONFIG_IDEDMA_AUTO int noautodma = 0; +#else +int noautodma = 1; +#endif + /* * ide_modules keeps track of the available IDE chipset/probe/driver modules. */ +ide_module_t *ide_chipsets; ide_module_t *ide_modules; ide_module_t *ide_probe; /* * This is declared extern in ide.h, for access by other IDE modules: */ -ide_hwif_t ide_hwifs[MAX_HWIFS]; /* master data repository */ +ide_hwif_t ide_hwifs[MAX_HWIFS]; /* master data repository */ + +EXPORT_SYMBOL(ide_hwifs); + +ide_devices_t *idedisk; +ide_devices_t *idecd; +ide_devices_t *idefloppy; +ide_devices_t *idetape; +ide_devices_t *idescsi; + +EXPORT_SYMBOL(idedisk); +EXPORT_SYMBOL(idecd); +EXPORT_SYMBOL(idefloppy); +EXPORT_SYMBOL(idetape); +EXPORT_SYMBOL(idescsi); #if (DISK_RECOVERY_TIME > 0) + +Error So the User Has To Fix the Compilation And Stop Hacking Port 0x43 +Does anyone ever use this anyway ?? + /* * For really screwy hardware (hey, at least it *can* be used with Linux) * we can enforce a minimum delay time between successive operations. */ -static unsigned long read_timer (void) +static unsigned long read_timer (ide_hwif_t *hwif) { unsigned long t, flags; int i; - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ + + /* FIXME this is completely unsafe! */ + local_irq_save(flags); t = jiffies * 11932; - outb_p(0, 0x43); + outb_p(0, 0x43); i = inb_p(0x40); - i |= inb(0x40) << 8; - __restore_flags(flags); /* local CPU only */ + i |= inb_p(0x40) << 8; + local_irq_restore(flags); return (t - i); } #endif /* DISK_RECOVERY_TIME */ @@ -231,7 +251,7 @@ static inline void set_recovery_timer (ide_hwif_t *hwif) { #if (DISK_RECOVERY_TIME > 0) - hwif->last_time = read_timer(); + hwif->last_time = read_timer(hwif); #endif /* DISK_RECOVERY_TIME */ } @@ -264,6 +284,10 @@ hwif->name[2] = 'e'; hwif->name[3] = '0' + index; hwif->bus_state = BUSSTATE_ON; + hwif->reset_poll= NULL; + hwif->pre_reset = NULL; + default_hwif_iops(hwif); + default_hwif_transport(hwif); for (unit = 0; unit < MAX_DRIVES; ++unit) { ide_drive_t *drive = &hwif->drives[unit]; @@ -279,6 +303,8 @@ drive->name[1] = 'd'; drive->name[2] = 'a' + (index * MAX_DRIVES) + unit; drive->max_failures = IDE_DEFAULT_MAX_FAILURES; + drive->using_dma = 0; + drive->is_flash = 0; init_waitqueue_head(&drive->wqueue); } } @@ -319,37 +345,6 @@ } /* - * CompactFlash cards and their brethern pretend to be removable hard disks, except: - * (1) they never have a slave unit, and - * (2) they don't have doorlock mechanisms. - * This test catches them, and is invoked elsewhere when setting appropriate config bits. - * - * FIXME: This treatment is probably applicable for *all* PCMCIA (PC CARD) devices, - * so in linux 2.3.x we should change this to just treat all PCMCIA drives this way, - * and get rid of the model-name tests below (too big of an interface change for 2.2.x). - * At that time, we might also consider parameterizing the timeouts and retries, - * since these are MUCH faster than mechanical drives. -M.Lord - */ -int drive_is_flashcard (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - - if (drive->removable && id != NULL) { - if (id->config == 0x848a) return 1; /* CompactFlash */ - if (!strncmp(id->model, "KODAK ATA_FLASH", 15) /* Kodak */ - || !strncmp(id->model, "Hitachi CV", 10) /* Hitachi */ - || !strncmp(id->model, "SunDisk SDCFB", 13) /* SunDisk */ - || !strncmp(id->model, "HAGIWARA HPC", 12) /* Hagiwara */ - || !strncmp(id->model, "LEXAR ATA_FLASH", 15) /* Lexar */ - || !strncmp(id->model, "ATA_FLASH", 9)) /* Simple Tech */ - { - return 1; /* yes, it is a flash memory card */ - } - } - return 0; /* no, it is not a flash memory card */ -} - -/* * ide_system_bus_speed() returns what we think is the system VESA/PCI * bus speed (in MHz). This is used for calculating interface PIO timings. * The default is 40 for known PCI systems, 50 otherwise. @@ -359,212 +354,36 @@ int ide_system_bus_speed (void) { if (!system_bus_speed) { - if (idebus_parameter) - system_bus_speed = idebus_parameter; /* user supplied value */ + if (idebus_parameter) { + /* user supplied value */ + system_bus_speed = idebus_parameter; #ifdef CONFIG_PCI - else if (pci_present()) - system_bus_speed = 33; /* safe default value for PCI */ + } else if (pci_present()) { + /* safe default value for PCI */ + system_bus_speed = 33; #endif /* CONFIG_PCI */ - else - system_bus_speed = 50; /* safe default value for VESA and PCI */ - printk("ide: Assuming %dMHz system bus speed for PIO modes%s\n", system_bus_speed, + } else { + /* safe default value for VESA and PCI */ + system_bus_speed = 50; + } + printk("ide: Assuming %dMHz system bus speed " + "for PIO modes%s\n", system_bus_speed, idebus_parameter ? "" : "; override with idebus=xx"); } return system_bus_speed; } -#if SUPPORT_VLB_SYNC -/* - * Some localbus EIDE interfaces require a special access sequence - * when using 32-bit I/O instructions to transfer data. We call this - * the "vlb_sync" sequence, which consists of three successive reads - * of the sector count register location, with interrupts disabled - * to ensure that the reads all happen together. - */ -static inline void do_vlb_sync (ide_ioreg_t port) { - (void) inb (port); - (void) inb (port); - (void) inb (port); -} -#endif /* SUPPORT_VLB_SYNC */ - -/* - * This is used for most PIO data transfers *from* the IDE interface - */ -void ide_input_data (ide_drive_t *drive, void *buffer, unsigned int wcount) -{ - byte io_32bit; - - /* first check if this controller has defined a special function - * for handling polled ide transfers - */ - - if(HWIF(drive)->ideproc) { - HWIF(drive)->ideproc(ideproc_ide_input_data, - drive, buffer, wcount); - return; - } - - io_32bit = drive->io_32bit; - - if (io_32bit) { -#if SUPPORT_VLB_SYNC - if (io_32bit & 2) { - unsigned long flags; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - do_vlb_sync(IDE_NSECTOR_REG); - insl(IDE_DATA_REG, buffer, wcount); - __restore_flags(flags); /* local CPU only */ - } else -#endif /* SUPPORT_VLB_SYNC */ - insl(IDE_DATA_REG, buffer, wcount); - } else { -#if SUPPORT_SLOW_DATA_PORTS - if (drive->slow) { - unsigned short *ptr = (unsigned short *) buffer; - while (wcount--) { - *ptr++ = inw_p(IDE_DATA_REG); - *ptr++ = inw_p(IDE_DATA_REG); - } - } else -#endif /* SUPPORT_SLOW_DATA_PORTS */ - insw(IDE_DATA_REG, buffer, wcount<<1); - } -} - -/* - * This is used for most PIO data transfers *to* the IDE interface - */ -void ide_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount) -{ - byte io_32bit; - - if(HWIF(drive)->ideproc) { - HWIF(drive)->ideproc(ideproc_ide_output_data, - drive, buffer, wcount); - return; - } - - io_32bit = drive->io_32bit; - - if (io_32bit) { -#if SUPPORT_VLB_SYNC - if (io_32bit & 2) { - unsigned long flags; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - do_vlb_sync(IDE_NSECTOR_REG); - outsl(IDE_DATA_REG, buffer, wcount); - __restore_flags(flags); /* local CPU only */ - } else -#endif /* SUPPORT_VLB_SYNC */ - outsl(IDE_DATA_REG, buffer, wcount); - } else { -#if SUPPORT_SLOW_DATA_PORTS - if (drive->slow) { - unsigned short *ptr = (unsigned short *) buffer; - while (wcount--) { - outw_p(*ptr++, IDE_DATA_REG); - outw_p(*ptr++, IDE_DATA_REG); - } - } else -#endif /* SUPPORT_SLOW_DATA_PORTS */ - outsw(IDE_DATA_REG, buffer, wcount<<1); - } -} - -/* - * The following routines are mainly used by the ATAPI drivers. - * - * These routines will round up any request for an odd number of bytes, - * so if an odd bytecount is specified, be sure that there's at least one - * extra byte allocated for the buffer. - */ -void atapi_input_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount) -{ - if(HWIF(drive)->ideproc) { - HWIF(drive)->ideproc(ideproc_atapi_input_bytes, - drive, buffer, bytecount); - return; - } - - ++bytecount; -#if defined(CONFIG_ATARI) || defined(CONFIG_Q40) - if (MACH_IS_ATARI || MACH_IS_Q40) { - /* Atari has a byte-swapped IDE interface */ - insw_swapw(IDE_DATA_REG, buffer, bytecount / 2); - return; - } -#endif /* CONFIG_ATARI */ - ide_input_data (drive, buffer, bytecount / 4); - if ((bytecount & 0x03) >= 2) - insw (IDE_DATA_REG, ((byte *)buffer) + (bytecount & ~0x03), 1); -} - -void atapi_output_bytes (ide_drive_t *drive, void *buffer, unsigned int bytecount) -{ - if(HWIF(drive)->ideproc) { - HWIF(drive)->ideproc(ideproc_atapi_output_bytes, - drive, buffer, bytecount); - return; - } - - ++bytecount; -#if defined(CONFIG_ATARI) || defined(CONFIG_Q40) - if (MACH_IS_ATARI || MACH_IS_Q40) { - /* Atari has a byte-swapped IDE interface */ - outsw_swapw(IDE_DATA_REG, buffer, bytecount / 2); - return; - } -#endif /* CONFIG_ATARI */ - ide_output_data (drive, buffer, bytecount / 4); - if ((bytecount & 0x03) >= 2) - outsw (IDE_DATA_REG, ((byte *)buffer) + (bytecount & ~0x03), 1); -} - -/* - * Needed for PCI irq sharing - */ -//static inline -int drive_is_ready (ide_drive_t *drive) -{ - byte stat = 0; - if (drive->waiting_for_dma) - return HWIF(drive)->dmaproc(ide_dma_test_irq, drive); -#if 0 - udelay(1); /* need to guarantee 400ns since last command was issued */ -#endif - -#ifdef CONFIG_IDEPCI_SHARE_IRQ - /* - * We do a passive status test under shared PCI interrupts on - * cards that truly share the ATA side interrupt, but may also share - * an interrupt with another pci card/device. We make no assumptions - * about possible isa-pnp and pci-pnp issues yet. - */ - if (IDE_CONTROL_REG) - stat = GET_ALTSTAT(); - else -#endif /* CONFIG_IDEPCI_SHARE_IRQ */ - stat = GET_STAT(); /* Note: this may clear a pending IRQ!! */ - - if (stat & BUSY_STAT) - return 0; /* drive busy: definitely not interrupting */ - return 1; /* drive ready: *might* be interrupting */ -} - /* * This is our end_request replacement function. */ -void ide_end_request (byte uptodate, ide_hwgroup_t *hwgroup) +int ide_end_request (ide_drive_t *drive, int uptodate) { struct request *rq; unsigned long flags; - ide_drive_t *drive = hwgroup->drive; + int ret = 1; spin_lock_irqsave(&io_request_lock, flags); - rq = hwgroup->rq; + rq = HWGROUP(drive)->rq; /* * decide whether to reenable DMA -- 3 is a random magic for now, @@ -572,43 +391,23 @@ */ if (drive->state == DMA_PIO_RETRY && drive->retry_pio <= 3) { drive->state = 0; - hwgroup->hwif->dmaproc(ide_dma_on, drive); + HWGROUP(drive)->hwif->ide_dma_on(drive); } - if (!end_that_request_first(rq, uptodate, hwgroup->drive->name)) { + if (!end_that_request_first(rq, uptodate, drive->name)) { add_blkdev_randomness(MAJOR(rq->rq_dev)); blkdev_dequeue_request(rq); - hwgroup->rq = NULL; + HWGROUP(drive)->rq = NULL; end_that_request_last(rq); + ret = 0; } - spin_unlock_irqrestore(&io_request_lock, flags); -} -/* - * This should get invoked any time we exit the driver to - * wait for an interrupt response from a drive. handler() points - * at the appropriate code to handle the next interrupt, and a - * timer is started to prevent us from waiting forever in case - * something goes wrong (see the ide_timer_expiry() handler later on). - */ -void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, - unsigned int timeout, ide_expiry_t *expiry) -{ - unsigned long flags; - ide_hwgroup_t *hwgroup = HWGROUP(drive); - - spin_lock_irqsave(&io_request_lock, flags); - if (hwgroup->handler != NULL) { - printk("%s: ide_set_handler: handler not null; old=%p, new=%p\n", - drive->name, hwgroup->handler, handler); - } - hwgroup->handler = handler; - hwgroup->expiry = expiry; - hwgroup->timer.expires = jiffies + timeout; - add_timer(&hwgroup->timer); spin_unlock_irqrestore(&io_request_lock, flags); + return ret; } +EXPORT_SYMBOL(ide_end_request); + /* * current_capacity() returns the capacity (in sectors) of a drive * according to its current geometry/LBA settings. @@ -622,248 +421,21 @@ return 0; } -extern struct block_device_operations ide_fops[]; -/* - * ide_geninit() is called exactly *once* for each interface. - */ -void ide_geninit (ide_hwif_t *hwif) -{ - unsigned int unit; - struct gendisk *gd = hwif->gd; - - for (unit = 0; unit < MAX_DRIVES; ++unit) { - ide_drive_t *drive = &hwif->drives[unit]; - - if (!drive->present) - continue; - if (drive->media!=ide_disk && drive->media!=ide_floppy) - continue; - register_disk(gd,MKDEV(hwif->major,unit<forced_geom && drive->noprobe) ? 1 : -#endif /* CONFIG_BLK_DEV_ISAPNP */ - 1<name); - } else { - if (0 < (signed long)(hwgroup->poll_timeout - jiffies)) { - ide_set_handler (drive, &atapi_reset_pollfunc, HZ/20, NULL); - return ide_started; /* continue polling */ - } - hwgroup->poll_timeout = 0; /* end of polling */ - printk("%s: ATAPI reset timed-out, status=0x%02x\n", drive->name, stat); - return do_reset1 (drive, 1); /* do it the old fashioned way */ - } - hwgroup->poll_timeout = 0; /* done polling */ - return ide_stopped; -} - -/* - * reset_pollfunc() gets invoked to poll the interface for completion every 50ms - * during an ide reset operation. If the drives have not yet responded, - * and we have not yet hit our maximum waiting time, then the timer is restarted - * for another 50ms. - */ -static ide_startstop_t reset_pollfunc (ide_drive_t *drive) -{ - ide_hwgroup_t *hwgroup = HWGROUP(drive); - ide_hwif_t *hwif = HWIF(drive); - byte tmp; - - if (!OK_STAT(tmp=GET_STAT(), 0, BUSY_STAT)) { - if (0 < (signed long)(hwgroup->poll_timeout - jiffies)) { - ide_set_handler (drive, &reset_pollfunc, HZ/20, NULL); - return ide_started; /* continue polling */ - } - printk("%s: reset timed-out, status=0x%02x\n", hwif->name, tmp); - drive->failures++; - } else { - printk("%s: reset: ", hwif->name); - if ((tmp = GET_ERR()) == 1) { - printk("success\n"); - drive->failures = 0; - } else { - drive->failures++; -#if FANCY_STATUS_DUMPS - printk("master: "); - switch (tmp & 0x7f) { - case 1: printk("passed"); - break; - case 2: printk("formatter device error"); - break; - case 3: printk("sector buffer error"); - break; - case 4: printk("ECC circuitry error"); - break; - case 5: printk("controlling MPU error"); - break; - default:printk("error (0x%02x?)", tmp); - } - if (tmp & 0x80) - printk("; slave: failed"); - printk("\n"); -#else - printk("failed\n"); -#endif /* FANCY_STATUS_DUMPS */ - } - } - hwgroup->poll_timeout = 0; /* done polling */ - return ide_stopped; -} - -static void check_dma_crc (ide_drive_t *drive) -{ - if (drive->crc_count) { - (void) HWIF(drive)->dmaproc(ide_dma_off_quietly, drive); - if ((HWIF(drive)->speedproc) != NULL) - HWIF(drive)->speedproc(drive, ide_auto_reduce_xfer(drive)); - if (drive->current_speed >= XFER_SW_DMA_0) - (void) HWIF(drive)->dmaproc(ide_dma_on, drive); - } else { - (void) HWIF(drive)->dmaproc(ide_dma_off, drive); - } -} - -static void pre_reset (ide_drive_t *drive) -{ - if (drive->driver != NULL) - DRIVER(drive)->pre_reset(drive); - - if (!drive->keep_settings) { - if (drive->using_dma) { - check_dma_crc(drive); - } else { - drive->unmask = 0; - drive->io_32bit = 0; - } - return; - } - if (drive->using_dma) - check_dma_crc(drive); -} - -/* - * do_reset1() attempts to recover a confused drive by resetting it. - * Unfortunately, resetting a disk drive actually resets all devices on - * the same interface, so it can really be thought of as resetting the - * interface rather than resetting the drive. - * - * ATAPI devices have their own reset mechanism which allows them to be - * individually reset without clobbering other devices on the same interface. - * - * Unfortunately, the IDE interface does not generate an interrupt to let - * us know when the reset operation has finished, so we must poll for this. - * Equally poor, though, is the fact that this may a very long time to complete, - * (up to 30 seconds worstcase). So, instead of busy-waiting here for it, - * we set a timer to poll at 50ms intervals. - */ -static ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi) -{ - unsigned int unit; - unsigned long flags; - ide_hwif_t *hwif = HWIF(drive); - ide_hwgroup_t *hwgroup = HWGROUP(drive); - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - - /* For an ATAPI device, first try an ATAPI SRST. */ - if (drive->media != ide_disk && !do_not_try_atapi) { - pre_reset(drive); - SELECT_DRIVE(hwif,drive); - udelay (20); - OUT_BYTE (WIN_SRST, IDE_COMMAND_REG); - hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; - ide_set_handler (drive, &atapi_reset_pollfunc, HZ/20, NULL); - __restore_flags (flags); /* local CPU only */ - return ide_started; - } - - /* - * First, reset any device state data we were maintaining - * for any of the drives on this interface. - */ - for (unit = 0; unit < MAX_DRIVES; ++unit) - pre_reset(&hwif->drives[unit]); - -#if OK_TO_RESET_CONTROLLER - if (!IDE_CONTROL_REG) { - __restore_flags(flags); - return ide_stopped; - } - /* - * Note that we also set nIEN while resetting the device, - * to mask unwanted interrupts from the interface during the reset. - * However, due to the design of PC hardware, this will cause an - * immediate interrupt due to the edge transition it produces. - * This single interrupt gives us a "fast poll" for drives that - * recover from reset very quickly, saving us the first 50ms wait time. - */ - OUT_BYTE(drive->ctl|6,IDE_CONTROL_REG); /* set SRST and nIEN */ - udelay(10); /* more than enough time */ - if (drive->quirk_list == 2) { - OUT_BYTE(drive->ctl,IDE_CONTROL_REG); /* clear SRST and nIEN */ - } else { - OUT_BYTE(drive->ctl|2,IDE_CONTROL_REG); /* clear SRST, leave nIEN */ - } - udelay(10); /* more than enough time */ - hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; - ide_set_handler (drive, &reset_pollfunc, HZ/20, NULL); - - /* - * Some weird controller like resetting themselves to a strange - * state when the disks are reset this way. At least, the Winbond - * 553 documentation says that - */ - if (hwif->resetproc != NULL) - hwif->resetproc(drive); - -#endif /* OK_TO_RESET_CONTROLLER */ - - __restore_flags (flags); /* local CPU only */ - return ide_started; -} - -/* - * ide_do_reset() is the entry point to the drive/interface reset code. - */ -ide_startstop_t ide_do_reset (ide_drive_t *drive) -{ - return do_reset1 (drive, 0); -} +EXPORT_SYMBOL(current_capacity); static inline u32 read_24 (ide_drive_t *drive) { - return (IN_BYTE(IDE_HCYL_REG)<<16) | - (IN_BYTE(IDE_LCYL_REG)<<8) | - IN_BYTE(IDE_SECTOR_REG); + return (HWIF(drive)->INB(IDE_HCYL_REG)<<16) | + (HWIF(drive)->INB(IDE_LCYL_REG)<<8) | + HWIF(drive)->INB(IDE_SECTOR_REG); } /* * Clean up after success/failure of an explicit drive cmd */ -void ide_end_drive_cmd (ide_drive_t *drive, byte stat, byte err) +void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) { + ide_hwif_t *hwif = HWIF(drive); unsigned long flags; struct request *rq; @@ -874,57 +446,61 @@ switch(rq->cmd) { case IDE_DRIVE_CMD: { - byte *args = (byte *) rq->buffer; - rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); + u8 *args = (u8 *) rq->buffer; + if (rq->errors == 0) + rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); + if (args) { args[0] = stat; args[1] = err; - args[2] = IN_BYTE(IDE_NSECTOR_REG); + args[2] = hwif->INB(IDE_NSECTOR_REG); } break; } case IDE_DRIVE_TASK: { - byte *args = (byte *) rq->buffer; - rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); + u8 *args = (u8 *) rq->buffer; + if (rq->errors == 0) + rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); + if (args) { args[0] = stat; args[1] = err; - args[2] = IN_BYTE(IDE_NSECTOR_REG); - args[3] = IN_BYTE(IDE_SECTOR_REG); - args[4] = IN_BYTE(IDE_LCYL_REG); - args[5] = IN_BYTE(IDE_HCYL_REG); - args[6] = IN_BYTE(IDE_SELECT_REG); + args[2] = hwif->INB(IDE_NSECTOR_REG); + args[3] = hwif->INB(IDE_SECTOR_REG); + args[4] = hwif->INB(IDE_LCYL_REG); + args[5] = hwif->INB(IDE_HCYL_REG); + args[6] = hwif->INB(IDE_SELECT_REG); } break; } case IDE_DRIVE_TASKFILE: { ide_task_t *args = (ide_task_t *) rq->special; - rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); + if (rq->errors == 0) + rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); + if (args) { if (args->tf_in_flags.b.data) { - unsigned short data = IN_WORD(IDE_DATA_REG); + u16 data = hwif->INW(IDE_DATA_REG); args->tfRegister[IDE_DATA_OFFSET] = (data) & 0xFF; args->hobRegister[IDE_DATA_OFFSET_HOB] = (data >> 8) & 0xFF; } args->tfRegister[IDE_ERROR_OFFSET] = err; - args->tfRegister[IDE_NSECTOR_OFFSET] = IN_BYTE(IDE_NSECTOR_REG); - args->tfRegister[IDE_SECTOR_OFFSET] = IN_BYTE(IDE_SECTOR_REG); - args->tfRegister[IDE_LCYL_OFFSET] = IN_BYTE(IDE_LCYL_REG); - args->tfRegister[IDE_HCYL_OFFSET] = IN_BYTE(IDE_HCYL_REG); - args->tfRegister[IDE_SELECT_OFFSET] = IN_BYTE(IDE_SELECT_REG); + args->tfRegister[IDE_NSECTOR_OFFSET] = hwif->INB(IDE_NSECTOR_REG); + args->tfRegister[IDE_SECTOR_OFFSET] = hwif->INB(IDE_SECTOR_REG); + args->tfRegister[IDE_LCYL_OFFSET] = hwif->INB(IDE_LCYL_REG); + args->tfRegister[IDE_HCYL_OFFSET] = hwif->INB(IDE_HCYL_REG); + args->tfRegister[IDE_SELECT_OFFSET] = hwif->INB(IDE_SELECT_REG); args->tfRegister[IDE_STATUS_OFFSET] = stat; - if ((drive->id->command_set_2 & 0x0400) && - (drive->id->cfs_enable_2 & 0x0400) && - (drive->addressing == 1)) { - OUT_BYTE(drive->ctl|0x80, IDE_CONTROL_REG_HOB); - args->hobRegister[IDE_FEATURE_OFFSET_HOB] = IN_BYTE(IDE_FEATURE_REG); - args->hobRegister[IDE_NSECTOR_OFFSET_HOB] = IN_BYTE(IDE_NSECTOR_REG); - args->hobRegister[IDE_SECTOR_OFFSET_HOB] = IN_BYTE(IDE_SECTOR_REG); - args->hobRegister[IDE_LCYL_OFFSET_HOB] = IN_BYTE(IDE_LCYL_REG); - args->hobRegister[IDE_HCYL_OFFSET_HOB] = IN_BYTE(IDE_HCYL_REG); + if (drive->addressing == 1) { + hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG_HOB); + args->hobRegister[IDE_FEATURE_OFFSET_HOB] = hwif->INB(IDE_FEATURE_REG); + args->hobRegister[IDE_NSECTOR_OFFSET_HOB] = hwif->INB(IDE_NSECTOR_REG); + args->hobRegister[IDE_SECTOR_OFFSET_HOB] = hwif->INB(IDE_SECTOR_REG); + args->hobRegister[IDE_LCYL_OFFSET_HOB] = hwif->INB(IDE_LCYL_REG); + args->hobRegister[IDE_HCYL_OFFSET_HOB] = hwif->INB(IDE_HCYL_REG); } } break; @@ -939,22 +515,24 @@ spin_unlock_irqrestore(&io_request_lock, flags); } +EXPORT_SYMBOL(ide_end_drive_cmd); + /* * Error reporting, in human readable form (luxurious, but a memory hog). */ -byte ide_dump_status (ide_drive_t *drive, const char *msg, byte stat) +u8 ide_dump_status (ide_drive_t *drive, const char *msg, u8 stat) { + ide_hwif_t *hwif = HWIF(drive); unsigned long flags; - byte err = 0; + u8 err = 0; - __save_flags (flags); /* local CPU only */ - ide__sti(); /* local CPU only */ + local_irq_set(flags); printk("%s: %s: status=0x%02x", drive->name, msg, stat); #if FANCY_STATUS_DUMPS printk(" { "); - if (stat & BUSY_STAT) + if (stat & BUSY_STAT) { printk("Busy "); - else { + } else { if (stat & READY_STAT) printk("DriveReady "); if (stat & WRERR_STAT) printk("DeviceFault "); if (stat & SEEK_STAT) printk("SeekComplete "); @@ -967,13 +545,13 @@ #endif /* FANCY_STATUS_DUMPS */ printk("\n"); if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) { - err = GET_ERR(); + err = hwif->INB(IDE_ERROR_REG); printk("%s: %s: error=0x%02x", drive->name, msg, err); #if FANCY_STATUS_DUMPS if (drive->media == ide_disk) { printk(" { "); if (err & ABRT_ERR) printk("DriveStatusError "); - if (err & ICRC_ERR) printk("%s", (err & ABRT_ERR) ? "BadCRC " : "BadSector "); + if (err & ICRC_ERR) printk("Bad%s ", (err & ABRT_ERR) ? "CRC" : "Sector"); if (err & ECC_ERR) printk("UncorrectableError "); if (err & ID_ERR) printk("SectorIdNotFound "); if (err & TRK0_ERR) printk("TrackZeroNotFound "); @@ -983,30 +561,30 @@ if ((drive->id->command_set_2 & 0x0400) && (drive->id->cfs_enable_2 & 0x0400) && (drive->addressing == 1)) { - __u64 sectors = 0; - u32 low = 0, high = 0; - low = read_24(drive); - OUT_BYTE(drive->ctl|0x80, IDE_CONTROL_REG); + u64 sectors = 0; + u32 high = 0; + u32 low = read_24(drive); + hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG); high = read_24(drive); - sectors = ((__u64)high << 24) | low; + sectors = ((u64)high << 24) | low; printk(", LBAsect=%llu, high=%d, low=%d", - (unsigned long long) sectors, + (u64) sectors, high, low); } else { - byte cur = IN_BYTE(IDE_SELECT_REG); + u8 cur = hwif->INB(IDE_SELECT_REG); if (cur & 0x40) { /* using LBA? */ printk(", LBAsect=%ld", (unsigned long) ((cur&0xf)<<24) - |(IN_BYTE(IDE_HCYL_REG)<<16) - |(IN_BYTE(IDE_LCYL_REG)<<8) - | IN_BYTE(IDE_SECTOR_REG)); + |(hwif->INB(IDE_HCYL_REG)<<16) + |(hwif->INB(IDE_LCYL_REG)<<8) + | hwif->INB(IDE_SECTOR_REG)); } else { printk(", CHS=%d/%d/%d", - (IN_BYTE(IDE_HCYL_REG)<<8) + - IN_BYTE(IDE_LCYL_REG), + (hwif->INB(IDE_HCYL_REG)<<8) + + hwif->INB(IDE_LCYL_REG), cur & 0xf, - IN_BYTE(IDE_SECTOR_REG)); + hwif->INB(IDE_SECTOR_REG)); } } if (HWGROUP(drive) && HWGROUP(drive)->rq) @@ -1016,10 +594,12 @@ #endif /* FANCY_STATUS_DUMPS */ printk("\n"); } - __restore_flags (flags); /* local CPU only */ + local_irq_restore(flags); return err; } +EXPORT_SYMBOL(ide_dump_status); + /* * try_to_flush_leftover_data() is invoked in response to a drive * unexpectedly having its DRQ_STAT bit set. As an alternative to @@ -1027,7 +607,7 @@ * by read a sector's worth of data from the drive. Of course, * this may not help if the drive is *waiting* for data from *us*. */ -static void try_to_flush_leftover_data (ide_drive_t *drive) +void try_to_flush_leftover_data (ide_drive_t *drive) { int i = (drive->mult_count ? drive->mult_count : 1) * SECTOR_WORDS; @@ -1035,23 +615,33 @@ return; while (i > 0) { u32 buffer[16]; - unsigned int wcount = (i > 16) ? 16 : i; + u32 wcount = (i > 16) ? 16 : i; + i -= wcount; - ide_input_data (drive, buffer, wcount); + HWIF(drive)->ata_input_data(drive, buffer, wcount); } } +EXPORT_SYMBOL(try_to_flush_leftover_data); + +/* + * FIXME Add an ATAPI error + */ + /* * ide_error() takes action based on the error returned by the drive. */ -ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat) +ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, u8 stat) { + ide_hwif_t *hwif; struct request *rq; - byte err; + u8 err; err = ide_dump_status(drive, msg, stat); if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL) return ide_stopped; + + hwif = HWIF(drive); /* retry only "normal" I/O: */ if (rq->cmd == IDE_DRIVE_CMD || rq->cmd == IDE_DRIVE_TASK) { rq->errors = 1; @@ -1065,32 +655,46 @@ return ide_stopped; } - if (stat & BUSY_STAT || ((stat & WRERR_STAT) && !drive->nowerr)) { /* other bits are useless when BUSY */ + if (stat & BUSY_STAT || ((stat & WRERR_STAT) && !drive->nowerr)) { + /* other bits are useless when BUSY */ rq->errors |= ERROR_RESET; } else { - if (drive->media == ide_disk && (stat & ERR_STAT)) { + if (drive->media != ide_disk) + goto media_out; + + if (stat & ERR_STAT) { /* err has different meaning on cdrom and tape */ if (err == ABRT_ERR) { - if (drive->select.b.lba && IN_BYTE(IDE_COMMAND_REG) == WIN_SPECIFY) - return ide_stopped; /* some newer drives don't support WIN_SPECIFY */ - } else if ((err & (ABRT_ERR | ICRC_ERR)) == (ABRT_ERR | ICRC_ERR)) { - drive->crc_count++; /* UDMA crc error -- just retry the operation */ - } else if (err & (BBD_ERR | ECC_ERR)) /* retries won't help these */ + if (drive->select.b.lba && + (hwif->INB(IDE_COMMAND_REG) == WIN_SPECIFY)) + /* some newer drives don't + * support WIN_SPECIFY + */ + return ide_stopped; + } else if ((err & BAD_CRC) == BAD_CRC) { + drive->crc_count++; + /* UDMA crc error -- just retry the operation */ + } else if (err & (BBD_ERR | ECC_ERR)) { + /* retries won't help these */ rq->errors = ERROR_MAX; - else if (err & TRK0_ERR) /* help it find track zero */ + } else if (err & TRK0_ERR) { + /* help it find track zero */ rq->errors |= ERROR_RECAL; + } } +media_out: if ((stat & DRQ_STAT) && rq->cmd != WRITE) try_to_flush_leftover_data(drive); } - if (GET_STAT() & (BUSY_STAT|DRQ_STAT)) - OUT_BYTE(WIN_IDLEIMMEDIATE,IDE_COMMAND_REG); /* force an abort */ - + if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT)) { + /* force an abort */ + hwif->OUTB(WIN_IDLEIMMEDIATE,IDE_COMMAND_REG); + } if (rq->errors >= ERROR_MAX) { if (drive->driver != NULL) - DRIVER(drive)->end_request(0, HWGROUP(drive)); + DRIVER(drive)->end_request(drive, 0); else - ide_end_request(0, HWGROUP(drive)); + ide_end_request(drive, 0); } else { if ((rq->errors & ERROR_RESET) == ERROR_RESET) { ++rq->errors; @@ -1103,51 +707,62 @@ return ide_stopped; } +EXPORT_SYMBOL(ide_error); + /* * Issue a simple drive command * The drive must be selected beforehand. */ -void ide_cmd (ide_drive_t *drive, byte cmd, byte nsect, ide_handler_t *handler) +void ide_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, ide_handler_t *handler) { - ide_set_handler (drive, handler, WAIT_CMD, NULL); + ide_hwif_t *hwif = HWIF(drive); + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, handler, WAIT_CMD, NULL); if (IDE_CONTROL_REG) - OUT_BYTE(drive->ctl,IDE_CONTROL_REG); /* clear nIEN */ - SELECT_MASK(HWIF(drive),drive,0); - OUT_BYTE(nsect,IDE_NSECTOR_REG); - OUT_BYTE(cmd,IDE_COMMAND_REG); + hwif->OUTB(drive->ctl,IDE_CONTROL_REG); /* clear nIEN */ + SELECT_MASK(drive,0); + hwif->OUTB(nsect,IDE_NSECTOR_REG); + hwif->OUTB(cmd,IDE_COMMAND_REG); } +EXPORT_SYMBOL(ide_cmd); + /* * drive_cmd_intr() is invoked on completion of a special DRIVE_CMD. */ -static ide_startstop_t drive_cmd_intr (ide_drive_t *drive) +ide_startstop_t drive_cmd_intr (ide_drive_t *drive) { struct request *rq = HWGROUP(drive)->rq; - byte *args = (byte *) rq->buffer; - byte stat = GET_STAT(); + ide_hwif_t *hwif = HWIF(drive); + u8 *args = (u8 *) rq->buffer; + u8 stat = hwif->INB(IDE_STATUS_REG); int retries = 10; - ide__sti(); /* local CPU only */ + local_irq_enable(); if ((stat & DRQ_STAT) && args && args[3]) { - byte io_32bit = drive->io_32bit; + u8 io_32bit = drive->io_32bit; drive->io_32bit = 0; - ide_input_data(drive, &args[4], args[3] * SECTOR_WORDS); + hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS); drive->io_32bit = io_32bit; - while (((stat = GET_STAT()) & BUSY_STAT) && retries--) + while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && retries--) udelay(100); } if (!OK_STAT(stat, READY_STAT, BAD_STAT)) - return ide_error(drive, "drive_cmd", stat); /* calls ide_end_drive_cmd */ - ide_end_drive_cmd (drive, stat, GET_ERR()); + return DRIVER(drive)->error(drive, "drive_cmd", stat); + /* calls ide_end_drive_cmd */ + ide_end_drive_cmd(drive, stat, hwif->INB(IDE_ERROR_REG)); return ide_stopped; } +EXPORT_SYMBOL(drive_cmd_intr); + /* * do_special() is used to issue WIN_SPECIFY, WIN_RESTORE, and WIN_SETMULT * commands to a drive. It used to do much more, but has been scaled back. */ -static ide_startstop_t do_special (ide_drive_t *drive) +ide_startstop_t do_special (ide_drive_t *drive) { special_t *s = &drive->special; @@ -1155,10 +770,9 @@ printk("%s: do_special: 0x%02x\n", drive->name, s->all); #endif if (s->b.set_tune) { - ide_tuneproc_t *tuneproc = HWIF(drive)->tuneproc; s->b.set_tune = 0; - if (tuneproc != NULL) - tuneproc(drive, drive->tune_req); + if (HWIF(drive)->tuneproc != NULL) + HWIF(drive)->tuneproc(drive, drive->tune_req); } else if (drive->driver != NULL) { return DRIVER(drive)->special(drive); } else if (s->all) { @@ -1168,64 +782,15 @@ return ide_stopped; } -/* - * This routine busy-waits for the drive status to be not "busy". - * It then checks the status for all of the "good" bits and none - * of the "bad" bits, and if all is okay it returns 0. All other - * cases return 1 after invoking ide_error() -- caller should just return. - * - * This routine should get fixed to not hog the cpu during extra long waits.. - * That could be done by busy-waiting for the first jiffy or two, and then - * setting a timer to wake up at half second intervals thereafter, - * until timeout is achieved, before timing out. - */ -int ide_wait_stat (ide_startstop_t *startstop, ide_drive_t *drive, byte good, byte bad, unsigned long timeout) { - byte stat; - int i; - unsigned long flags; - - /* bail early if we've exceeded max_failures */ - if (drive->max_failures && (drive->failures > drive->max_failures)) { - *startstop = ide_stopped; - return 1; - } - - udelay(1); /* spec allows drive 400ns to assert "BUSY" */ - if ((stat = GET_STAT()) & BUSY_STAT) { - __save_flags(flags); /* local CPU only */ - ide__sti(); /* local CPU only */ - timeout += jiffies; - while ((stat = GET_STAT()) & BUSY_STAT) { - if (0 < (signed long)(jiffies - timeout)) { - __restore_flags(flags); /* local CPU only */ - *startstop = ide_error(drive, "status timeout", stat); - return 1; - } - } - __restore_flags(flags); /* local CPU only */ - } - /* - * Allow status to settle, then read it again. - * A few rare drives vastly violate the 400ns spec here, - * so we'll wait up to 10usec for a "good" status - * rather than expensively fail things immediately. - * This fix courtesy of Matthew Faupel & Niccolo Rigacci. - */ - for (i = 0; i < 10; i++) { - udelay(1); - if (OK_STAT((stat = GET_STAT()), good, bad)) - return 0; - } - *startstop = ide_error(drive, "status error", stat); - return 1; -} +EXPORT_SYMBOL(do_special); /* * execute_drive_cmd() issues a special drive command, * usually initiated by ioctl() from the external hdparm program. */ -static ide_startstop_t execute_drive_cmd (ide_drive_t *drive, struct request *rq) +ide_startstop_t execute_drive_cmd (ide_drive_t *drive, struct request *rq) { + ide_hwif_t *hwif = HWIF(drive); switch(rq->cmd) { case IDE_DRIVE_TASKFILE: { @@ -1233,48 +798,14 @@ if (!(args)) break; -#ifdef CONFIG_IDE_TASK_IOCTL_DEBUG - { - printk(KERN_INFO "%s: ", drive->name); -// printk("TF.0=x%02x ", args->tfRegister[IDE_DATA_OFFSET]); - printk("TF.1=x%02x ", args->tfRegister[IDE_FEATURE_OFFSET]); - printk("TF.2=x%02x ", args->tfRegister[IDE_NSECTOR_OFFSET]); - printk("TF.3=x%02x ", args->tfRegister[IDE_SECTOR_OFFSET]); - printk("TF.4=x%02x ", args->tfRegister[IDE_LCYL_OFFSET]); - printk("TF.5=x%02x ", args->tfRegister[IDE_HCYL_OFFSET]); - printk("TF.6=x%02x ", args->tfRegister[IDE_SELECT_OFFSET]); - printk("TF.7=x%02x\n", args->tfRegister[IDE_COMMAND_OFFSET]); - printk(KERN_INFO "%s: ", drive->name); -// printk("HTF.0=x%02x ", args->hobRegister[IDE_DATA_OFFSET_HOB]); - printk("HTF.1=x%02x ", args->hobRegister[IDE_FEATURE_OFFSET_HOB]); - printk("HTF.2=x%02x ", args->hobRegister[IDE_NSECTOR_OFFSET_HOB]); - printk("HTF.3=x%02x ", args->hobRegister[IDE_SECTOR_OFFSET_HOB]); - printk("HTF.4=x%02x ", args->hobRegister[IDE_LCYL_OFFSET_HOB]); - printk("HTF.5=x%02x ", args->hobRegister[IDE_HCYL_OFFSET_HOB]); - printk("HTF.6=x%02x ", args->hobRegister[IDE_SELECT_OFFSET_HOB]); - printk("HTF.7=x%02x\n", args->hobRegister[IDE_CONTROL_OFFSET_HOB]); - } -#endif /* CONFIG_IDE_TASK_IOCTL_DEBUG */ - -// if (args->tf_out_flags.all == 0) { - do_taskfile(drive, - (struct hd_drive_task_hdr *)&args->tfRegister, - (struct hd_drive_hob_hdr *)&args->hobRegister, - args->handler); -// } else { -// return flagged_taskfile(drive, args); -// } - - if (((args->command_type == IDE_DRIVE_TASK_RAW_WRITE) || - (args->command_type == IDE_DRIVE_TASK_OUT)) && - args->prehandler && args->handler) - return args->prehandler(drive, rq); - return ide_started; + if (args->tf_out_flags.all != 0) + return flagged_taskfile(drive, args); + return do_rw_taskfile(drive, args); } case IDE_DRIVE_TASK: { - byte *args = rq->buffer; - byte sel; + u8 *args = rq->buffer; + u8 sel; if (!(args)) break; #ifdef DEBUG @@ -1287,20 +818,20 @@ printk("hcyl=0x%02x ", args[5]); printk("sel=0x%02x\n", args[6]); #endif - OUT_BYTE(args[1], IDE_FEATURE_REG); - OUT_BYTE(args[3], IDE_SECTOR_REG); - OUT_BYTE(args[4], IDE_LCYL_REG); - OUT_BYTE(args[5], IDE_HCYL_REG); + hwif->OUTB(args[1], IDE_FEATURE_REG); + hwif->OUTB(args[3], IDE_SECTOR_REG); + hwif->OUTB(args[4], IDE_LCYL_REG); + hwif->OUTB(args[5], IDE_HCYL_REG); sel = (args[6] & ~0x10); if (drive->select.b.unit) sel |= 0x10; - OUT_BYTE(sel, IDE_SELECT_REG); + hwif->OUTB(sel, IDE_SELECT_REG); ide_cmd(drive, args[0], args[2], &drive_cmd_intr); return ide_started; } case IDE_DRIVE_CMD: { - byte *args = rq->buffer; + u8 *args = rq->buffer; if (!(args)) break; #ifdef DEBUG @@ -1311,14 +842,14 @@ printk("xx=0x%02x\n", args[3]); #endif if (args[0] == WIN_SMART) { - OUT_BYTE(0x4f, IDE_LCYL_REG); - OUT_BYTE(0xc2, IDE_HCYL_REG); - OUT_BYTE(args[2],IDE_FEATURE_REG); - OUT_BYTE(args[1],IDE_SECTOR_REG); + hwif->OUTB(0x4f, IDE_LCYL_REG); + hwif->OUTB(0xc2, IDE_HCYL_REG); + hwif->OUTB(args[2],IDE_FEATURE_REG); + hwif->OUTB(args[1],IDE_SECTOR_REG); ide_cmd(drive, args[0], args[3], &drive_cmd_intr); return ide_started; } - OUT_BYTE(args[2],IDE_FEATURE_REG); + hwif->OUTB(args[2],IDE_FEATURE_REG); ide_cmd(drive, args[0], args[1], &drive_cmd_intr); return ide_started; } @@ -1332,16 +863,20 @@ #ifdef DEBUG printk("%s: DRIVE_CMD (null)\n", drive->name); #endif - ide_end_drive_cmd(drive, GET_STAT(), GET_ERR()); + ide_end_drive_cmd(drive, + hwif->INB(IDE_STATUS_REG), + hwif->INB(IDE_ERROR_REG)); return ide_stopped; } +EXPORT_SYMBOL(execute_drive_cmd); + /* * start_request() initiates handling of a new I/O request * needed to reverse the perverted changes anonymously made back * 2.3.99-pre6 */ -static ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) +ide_startstop_t start_request (ide_drive_t *drive, struct request *rq) { ide_startstop_t startstop; unsigned long block, blockend; @@ -1349,15 +884,26 @@ ide_hwif_t *hwif = HWIF(drive); #ifdef DEBUG - printk("%s: start_request: current=0x%08lx\n", hwif->name, (unsigned long) rq); + printk("%s: start_request: current=0x%08lx\n", + hwif->name, (unsigned long) rq); #endif + /* bail early if we've exceeded max_failures */ if (drive->max_failures && (drive->failures > drive->max_failures)) { goto kill_rq; } + /* + * bail early if we've sent a device to sleep, however how to wake + * this needs to be a masked flag. FIXME for proper operations. + */ + if (drive->suspend_reset) { + goto kill_rq; + } + if (unit >= MAX_DRIVES) { - printk("%s: bad device number: %s\n", hwif->name, kdevname(rq->rq_dev)); + printk("%s: bad device number: %s\n", + hwif->name, kdevname(rq->rq_dev)); goto kill_rq; } #ifdef DEBUG @@ -1387,7 +933,7 @@ while ((read_timer() - hwif->last_time) < DISK_RECOVERY_TIME); #endif - SELECT_DRIVE(hwif, drive); + SELECT_DRIVE(drive); if (ide_wait_stat(&startstop, drive, drive->ready_stat, BUSY_STAT|DRQ_STAT, WAIT_READY)) { printk("%s: drive not ready for command\n", drive->name); return startstop; @@ -1396,6 +942,7 @@ switch(rq->cmd) { case IDE_DRIVE_CMD: case IDE_DRIVE_TASK: + return execute_drive_cmd(drive, rq); case IDE_DRIVE_TASKFILE: return execute_drive_cmd(drive, rq); default: @@ -1410,27 +957,22 @@ return do_special(drive); kill_rq: if (drive->driver != NULL) - DRIVER(drive)->end_request(0, HWGROUP(drive)); + DRIVER(drive)->end_request(drive, 0); else - ide_end_request(0, HWGROUP(drive)); + ide_end_request(drive, 0); return ide_stopped; } -ide_startstop_t restart_request (ide_drive_t *drive) -{ - ide_hwgroup_t *hwgroup = HWGROUP(drive); - unsigned long flags; - struct request *rq; +EXPORT_SYMBOL(start_request); - spin_lock_irqsave(&io_request_lock, flags); - hwgroup->handler = NULL; - del_timer(&hwgroup->timer); - rq = hwgroup->rq; - spin_unlock_irqrestore(&io_request_lock, flags); - - return start_request(drive, rq); +int restart_request (ide_drive_t *drive, struct request *rq) +{ + (void) start_request(drive, rq); + return 0; } +EXPORT_SYMBOL(restart_request); + /* * ide_stall_queue() can be used by a drive to give excess bandwidth back * to the hwgroup by sleeping for timeout jiffies. @@ -1442,6 +984,8 @@ drive->sleep = timeout + jiffies; } +EXPORT_SYMBOL(ide_stall_queue); + #define WAKEUP(drive) ((drive)->service_start + 2 * (drive)->service_time) /* @@ -1455,7 +999,7 @@ best = NULL; drive = hwgroup->drive; do { - if (!list_empty(&drive->queue.queue_head) && (!drive->sleep || 0 <= (signed long)(jiffies - drive->sleep))) { + if (!list_empty(&drive->queue.queue_head) && (!drive->sleep || time_after_eq(jiffies, drive->sleep))) { if (!best || (drive->sleep && (!best->sleep || 0 < (signed long)(best->sleep - drive->sleep))) || (!best->sleep && 0 < (signed long)(WAKEUP(best) - WAKEUP(drive)))) @@ -1468,10 +1012,10 @@ if (best && best->nice1 && !best->sleep && best != hwgroup->drive && best->service_time > WAIT_MIN_SLEEP) { long t = (signed long)(WAKEUP(best) - jiffies); if (t >= WAIT_MIN_SLEEP) { - /* - * We *may* have some time to spare, but first let's see if - * someone can potentially benefit from our nice mood today.. - */ + /* + * We *may* have some time to spare, but first let's see if + * someone can potentially benefit from our nice mood today.. + */ drive = best->next; do { if (!drive->sleep @@ -1532,9 +1076,11 @@ struct request *rq; ide_startstop_t startstop; - ide_get_lock(&ide_lock, ide_intr, hwgroup); /* for atari only: POSSIBLY BROKEN HERE(?) */ + /* for atari only: POSSIBLY BROKEN HERE(?) */ + ide_get_lock(&ide_intr_lock, ide_intr, hwgroup); - __cli(); /* necessary paranoia: ensure IRQs are masked on local CPU */ + /* necessary paranoia: ensure IRQs are masked on local CPU */ + local_irq_disable(); while (!hwgroup->busy) { hwgroup->busy = 1; @@ -1548,42 +1094,53 @@ sleep = drive->sleep; } while ((drive = drive->next) != hwgroup->drive); if (sleep) { - /* - * Take a short snooze, and then wake up this hwgroup again. - * This gives other hwgroups on the same a chance to - * play fairly with us, just in case there are big differences - * in relative throughputs.. don't want to hog the cpu too much. - */ - if (0 < (signed long)(jiffies + WAIT_MIN_SLEEP - sleep)) + /* + * Take a short snooze, and then wake up this hwgroup again. + * This gives other hwgroups on the same a chance to + * play fairly with us, just in case there are big differences + * in relative throughputs.. don't want to hog the cpu too much. + */ + if (time_before(sleep, jiffies + WAIT_MIN_SLEEP)) sleep = jiffies + WAIT_MIN_SLEEP; #if 1 if (timer_pending(&hwgroup->timer)) printk("ide_set_handler: timer already active\n"); #endif - hwgroup->sleeping = 1; /* so that ide_timer_expiry knows what to do */ + /* so that ide_timer_expiry knows what to do */ + hwgroup->sleeping = 1; mod_timer(&hwgroup->timer, sleep); - /* we purposely leave hwgroup->busy==1 while sleeping */ + /* we purposely leave hwgroup->busy==1 + * while sleeping */ } else { - /* Ugly, but how can we sleep for the lock otherwise? perhaps from tq_disk? */ - ide_release_lock(&ide_lock); /* for atari only */ + /* Ugly, but how can we sleep for the lock + * otherwise? perhaps from tq_disk? + */ + + /* for atari only */ + ide_release_lock(&ide_intr_lock); hwgroup->busy = 0; } - return; /* no more work for this hwgroup (for now) */ + /* no more work for this hwgroup (for now) */ + return; } hwif = HWIF(drive); - if (hwgroup->hwif->sharing_irq && hwif != hwgroup->hwif && hwif->io_ports[IDE_CONTROL_OFFSET]) { + if (hwgroup->hwif->sharing_irq && + hwif != hwgroup->hwif && + hwif->io_ports[IDE_CONTROL_OFFSET]) { /* set nIEN for previous hwif */ - SELECT_INTERRUPT(hwif, drive); + SELECT_INTERRUPT(drive); } hwgroup->hwif = hwif; hwgroup->drive = drive; drive->sleep = 0; drive->service_start = jiffies; - if ( drive->queue.plugged ) /* paranoia */ + if (drive->queue.plugged) { /* paranoia */ printk("%s: Huh? nuking plugged queue\n", drive->name); + } - rq = hwgroup->rq = blkdev_entry_next_request(&drive->queue.queue_head); + rq = blkdev_entry_next_request(&drive->queue.queue_head); + hwgroup->rq = rq; /* * Some systems have trouble with IDE IRQs arriving while * the driver is still setting things up. So, here we disable @@ -1595,7 +1152,8 @@ if (masked_irq && hwif->irq != masked_irq) disable_irq_nosync(hwif->irq); spin_unlock(&io_request_lock); - ide__sti(); /* allow other IRQs while we start this request */ + local_irq_enable(); + /* allow other IRQs while we start this request */ startstop = start_request(drive, rq); spin_lock_irq(&io_request_lock); if (masked_irq && hwif->irq != masked_irq) @@ -1605,6 +1163,8 @@ } } +EXPORT_SYMBOL(ide_do_request); + /* * ide_get_queue() returns the queue which corresponds to a given device. */ @@ -1615,6 +1175,8 @@ return &hwif->drives[DEVICE_NR(dev) & 1].queue; } +EXPORT_SYMBOL(ide_get_queue); + /* * Passes the stuff to ide_do_request */ @@ -1636,13 +1198,13 @@ /* * end current dma transaction */ - (void) hwif->dmaproc(ide_dma_end, drive); + (void) hwif->ide_dma_end(drive); /* * complain a little, later we might remove some of this verbosity */ printk("%s: timeout waiting for DMA\n", drive->name); - (void) hwif->dmaproc(ide_dma_timeout, drive); + (void) hwif->ide_dma_timeout(drive); /* * disable dma for now, but remember that we did so because of @@ -1651,7 +1213,7 @@ */ drive->retry_pio++; drive->state = DMA_PIO_RETRY; - (void) hwif->dmaproc(ide_dma_off_quietly, drive); + (void) hwif->ide_dma_off_quietly(drive); /* * un-busy drive etc (hwgroup->busy is cleared on return) and @@ -1663,9 +1225,12 @@ rq->errors = 0; rq->sector = rq->bh->b_rsector; rq->current_nr_sectors = rq->bh->b_size >> 9; + rq->hard_cur_sectors = rq->current_nr_sectors; rq->buffer = rq->bh->b_data; } +EXPORT_SYMBOL(ide_dma_timeout_retry); + /* * ide_timer_expiry() is our timeout function for all drive operations. * But note that it can also be invoked as a result of a "sleep" operation @@ -1700,7 +1265,7 @@ hwgroup->handler = NULL; } else { ide_hwif_t *hwif; - ide_startstop_t startstop; + ide_startstop_t startstop = ide_stopped; if (!hwgroup->busy) { hwgroup->busy = 1; /* paranoia */ printk("%s: ide_timer_expiry: hwgroup->busy was 0 ??\n", drive->name); @@ -1718,22 +1283,26 @@ hwgroup->handler = NULL; /* * We need to simulate a real interrupt when invoking - * the handler() function, which means we need to globally - * mask the specific IRQ: + * the handler() function, which means we need to + * globally mask the specific IRQ: */ spin_unlock(&io_request_lock); hwif = HWIF(drive); #if DISABLE_IRQ_NOSYNC disable_irq_nosync(hwif->irq); #else - disable_irq(hwif->irq); /* disable_irq_nosync ?? */ + /* disable_irq_nosync ?? */ + disable_irq(hwif->irq); #endif /* DISABLE_IRQ_NOSYNC */ - __cli(); /* local CPU only, as if we were handling an interrupt */ + + /* local CPU only, + * as if we were handling an interrupt */ + local_irq_disable(); if (hwgroup->poll_timeout != 0) { startstop = handler(drive); } else if (drive_is_ready(drive)) { if (drive->waiting_for_dma) - (void) hwgroup->hwif->dmaproc(ide_dma_lostirq, drive); + (void) hwgroup->hwif->ide_dma_lostirq(drive); (void)ide_ack_intr(hwif); printk("%s: lost interrupt\n", drive->name); startstop = handler(drive); @@ -1742,7 +1311,7 @@ startstop = ide_stopped; ide_dma_timeout_retry(drive); } else - startstop = ide_error(drive, "irq timeout", GET_STAT()); + startstop = DRIVER(drive)->error(drive, "irq timeout", hwif->INB(IDE_STATUS_REG)); } set_recovery_timer(hwif); drive->service_time = jiffies - drive->service_start; @@ -1756,6 +1325,8 @@ spin_unlock_irqrestore(&io_request_lock, flags); } +EXPORT_SYMBOL(ide_timer_expiry); + /* * There's nothing really useful we can do with an unexpected interrupt, * other than reading the status register (to clear it), and logging it. @@ -1781,7 +1352,7 @@ */ static void unexpected_intr (int irq, ide_hwgroup_t *hwgroup) { - byte stat; + u8 stat; ide_hwif_t *hwif = hwgroup->hwif; /* @@ -1789,15 +1360,17 @@ */ do { if (hwif->irq == irq) { - stat = IN_BYTE(hwif->io_ports[IDE_STATUS_OFFSET]); + stat = hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]); if (!OK_STAT(stat, READY_STAT, BAD_STAT)) { /* Try to not flood the console with msgs */ static unsigned long last_msgtime, count; ++count; - if (0 < (signed long)(jiffies - (last_msgtime + HZ))) { + if (time_after(jiffies, last_msgtime + HZ)) { last_msgtime = jiffies; - printk("%s%s: unexpected interrupt, status=0x%02x, count=%ld\n", - hwif->name, (hwif->next == hwgroup->hwif) ? "" : "(?)", stat, count); + printk("%s%s: unexpected interrupt, " + "status=0x%02x, count=%ld\n", + hwif->name, + (hwif->next==hwgroup->hwif) ? "" : "(?)", stat, count); } } } @@ -1824,7 +1397,8 @@ return; } - if ((handler = hwgroup->handler) == NULL || hwgroup->poll_timeout != 0) { + if ((handler = hwgroup->handler) == NULL || + hwgroup->poll_timeout != 0) { /* * Not expecting an interrupt from this drive. * That means this could be: @@ -1838,7 +1412,7 @@ * so in that case we just ignore it and hope it goes away. */ #ifdef CONFIG_BLK_DEV_IDEPCI - if (IDE_PCI_DEVID_EQ(hwif->pci_devid, IDE_PCI_DEVID_NULL)) + if (hwif->pci_dev && !hwif->pci_dev->vendor) #endif /* CONFIG_BLK_DEV_IDEPCI */ { /* @@ -1849,9 +1423,10 @@ #ifdef CONFIG_BLK_DEV_IDEPCI } else { /* - * Whack the status register, just in case we have a leftover pending IRQ. + * Whack the status register, just in case + * we have a leftover pending IRQ. */ - (void) IN_BYTE(hwif->io_ports[IDE_STATUS_OFFSET]); + (void) hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]); #endif /* CONFIG_BLK_DEV_IDEPCI */ } spin_unlock_irqrestore(&io_request_lock, flags); @@ -1860,16 +1435,18 @@ drive = hwgroup->drive; if (!drive) { /* - * This should NEVER happen, and there isn't much we could do about it here. + * This should NEVER happen, and there isn't much + * we could do about it here. */ spin_unlock_irqrestore(&io_request_lock, flags); return; } if (!drive_is_ready(drive)) { /* - * This happens regularly when we share a PCI IRQ with another device. - * Unfortunately, it can also happen with some buggy drives that trigger - * the IRQ before their status register is up to date. Hopefully we have + * This happens regularly when we share a PCI IRQ with + * another device. Unfortunately, it can also happen + * with some buggy drives that trigger the IRQ before + * their status register is up to date. Hopefully we have * enough advance overhead that the latter isn't a problem. */ spin_unlock_irqrestore(&io_request_lock, flags); @@ -1884,8 +1461,10 @@ spin_unlock(&io_request_lock); if (drive->unmask) - ide__sti(); /* local CPU only */ - startstop = handler(drive); /* service this interrupt, may set handler for next interrupt */ + local_irq_enable(); + + /* service this interrupt, may set handler for next interrupt */ + startstop = handler(drive); spin_lock_irq(&io_request_lock); /* @@ -1902,12 +1481,15 @@ hwgroup->busy = 0; ide_do_request(hwgroup, hwif->irq); } else { - printk("%s: ide_intr: huh? expected NULL handler on exit\n", drive->name); + printk("%s: ide_intr: huh? expected NULL handler " + "on exit\n", drive->name); } } spin_unlock_irqrestore(&io_request_lock, flags); } +EXPORT_SYMBOL(ide_intr); + /* * get_info_ptr() returns the (ide_drive_t *) for a given device number. * It returns NULL if the given device number does not match any present drives. @@ -1915,9 +1497,6 @@ ide_drive_t *get_info_ptr (kdev_t i_rdev) { int major = MAJOR(i_rdev); -#if 0 - int minor = MINOR(i_rdev) & PARTN_MASK; -#endif unsigned int h; for (h = 0; h < MAX_HWIFS; ++h) { @@ -1926,11 +1505,7 @@ unsigned unit = DEVICE_NR(i_rdev); if (unit < MAX_DRIVES) { ide_drive_t *drive = &hwif->drives[unit]; -#if 0 - if ((drive->present) && (drive->part[minor].nr_sects)) -#else if (drive->present) -#endif return drive; } break; @@ -1939,6 +1514,8 @@ return NULL; } +EXPORT_SYMBOL(get_info_ptr); + /* * This function is intended to be used prior to invoking ide_do_drive_cmd(). */ @@ -1948,6 +1525,8 @@ rq->cmd = IDE_DRIVE_CMD; } +EXPORT_SYMBOL(ide_init_drive_cmd); + /* * This function issues a special IDE device request * onto the request queue. @@ -2004,13 +1583,17 @@ ide_do_request(hwgroup, 0); spin_unlock_irqrestore(&io_request_lock, flags); if (action == ide_wait) { - wait_for_completion(&wait); /* wait for it to be serviced */ - return rq->errors ? -EIO : 0; /* return -EIO if errors */ + /* wait for it to be serviced */ + wait_for_completion(&wait); + /* return -EIO if errors */ + return rq->errors ? -EIO : 0; } return 0; } +EXPORT_SYMBOL(ide_do_drive_cmd); + /* * This routine is called to flush all partitions and partition tables * for a changed disk, and then re-read the new partition table. @@ -2058,6 +1641,8 @@ return 0; } +EXPORT_SYMBOL(ide_revalidate_disk); + static void revalidate_drives (void) { ide_hwif_t *hwif; @@ -2077,7 +1662,7 @@ } } -static void ide_probe_module (void) +void ide_probe_module (void) { if (!ide_probe) { #if defined(CONFIG_KMOD) && defined(CONFIG_BLK_DEV_IDE_MODULE) @@ -2089,7 +1674,9 @@ revalidate_drives(); } -static void ide_driver_module (void) +EXPORT_SYMBOL(ide_probe_module); + +void ide_driver_module (void) { int index; ide_module_t *module = ide_modules; @@ -2106,6 +1693,8 @@ revalidate_drives(); } +EXPORT_SYMBOL(ide_driver_module); + static int ide_open (struct inode * inode, struct file * filp) { ide_drive_t *drive; @@ -2124,10 +1713,8 @@ (void) request_module("ide-tape"); if (drive->media == ide_floppy) (void) request_module("ide-floppy"); -#if defined(CONFIG_BLK_DEV_IDESCSI) && defined(CONFIG_SCSI) if (drive->media == ide_scsi) (void) request_module("ide-scsi"); -#endif /* defined(CONFIG_BLK_DEV_IDESCSI) && defined(CONFIG_SCSI) */ } #endif /* CONFIG_KMOD */ while (drive->busy) @@ -2156,22 +1743,6 @@ return 0; } -int ide_replace_subdriver (ide_drive_t *drive, const char *driver) -{ - if (!drive->present || drive->busy || drive->usage) - goto abort; - if (drive->driver != NULL && DRIVER(drive)->cleanup(drive)) - goto abort; - strncpy(drive->driver_req, driver, 9); - ide_driver_module(); - drive->driver_req[0] = 0; - ide_driver_module(); - if (DRIVER(drive) && !strcmp(DRIVER(drive)->name, driver)) - return 0; -abort: - return 1; -} - #ifdef CONFIG_PROC_FS ide_proc_entry_t generic_subdriver_entries[] = { { "capacity", S_IFREG|S_IRUGO, proc_ide_read_capacity, NULL }, @@ -2179,6 +1750,10 @@ }; #endif + +#define hwif_release_region(addr, num) \ + ((hwif->mmio) ? release_mem_region((addr),(num)) : release_region((addr),(num))) + /* * Note that we only release the standard ports, * and do not even try to handle any extra ports @@ -2186,35 +1761,30 @@ */ void hwif_unregister (ide_hwif_t *hwif) { - if (hwif->straight8) { - ide_release_region(hwif->io_ports[IDE_DATA_OFFSET], 8); - goto jump_eight; - } - if (hwif->io_ports[IDE_DATA_OFFSET]) - ide_release_region(hwif->io_ports[IDE_DATA_OFFSET], 1); - if (hwif->io_ports[IDE_ERROR_OFFSET]) - ide_release_region(hwif->io_ports[IDE_ERROR_OFFSET], 1); - if (hwif->io_ports[IDE_NSECTOR_OFFSET]) - ide_release_region(hwif->io_ports[IDE_NSECTOR_OFFSET], 1); - if (hwif->io_ports[IDE_SECTOR_OFFSET]) - ide_release_region(hwif->io_ports[IDE_SECTOR_OFFSET], 1); - if (hwif->io_ports[IDE_LCYL_OFFSET]) - ide_release_region(hwif->io_ports[IDE_LCYL_OFFSET], 1); - if (hwif->io_ports[IDE_HCYL_OFFSET]) - ide_release_region(hwif->io_ports[IDE_HCYL_OFFSET], 1); - if (hwif->io_ports[IDE_SELECT_OFFSET]) - ide_release_region(hwif->io_ports[IDE_SELECT_OFFSET], 1); - if (hwif->io_ports[IDE_STATUS_OFFSET]) - ide_release_region(hwif->io_ports[IDE_STATUS_OFFSET], 1); -jump_eight: + u32 i = 0; + if (hwif->io_ports[IDE_CONTROL_OFFSET]) - ide_release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1); + hwif_release_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1); #if defined(CONFIG_AMIGA) || defined(CONFIG_MAC) if (hwif->io_ports[IDE_IRQ_OFFSET]) - ide_release_region(hwif->io_ports[IDE_IRQ_OFFSET], 1); + hwif_release_region(hwif->io_ports[IDE_IRQ_OFFSET], 1); #endif /* (CONFIG_AMIGA) || (CONFIG_MAC) */ + + if (hwif->straight8) { + hwif_release_region(hwif->io_ports[IDE_DATA_OFFSET], 8); + return; + } + for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { + if (hwif->io_ports[i]) { + hwif_release_region(hwif->io_ports[i], 1); + } + } } +EXPORT_SYMBOL(hwif_unregister); + +extern void init_hwif_data(unsigned int index); + void ide_unregister (unsigned int index) { struct gendisk *gd; @@ -2228,8 +1798,7 @@ if (index >= MAX_HWIFS) return; - save_flags(flags); /* all CPUs */ - cli(); /* all CPUs */ + spin_lock_irqsave(&io_request_lock, flags); hwif = &ide_hwifs[index]; if (!hwif->present) goto abort; @@ -2247,7 +1816,7 @@ /* * All clear? Then blow away the buffer cache */ - sti(); + spin_unlock_irqrestore(&io_request_lock, flags); for (unit = 0; unit < MAX_DRIVES; ++unit) { drive = &hwif->drives[unit]; if (!drive->present) @@ -2263,7 +1832,7 @@ destroy_proc_ide_drives(hwif); #endif } - cli(); + spin_lock_irqsave(&io_request_lock, flags); hwgroup = hwif->hwgroup; /* @@ -2293,7 +1862,7 @@ for (i = 0; i < MAX_DRIVES; ++i) { drive = &hwif->drives[i]; if (drive->de) { - devfs_unregister (drive->de); + devfs_unregister(drive->de); drive->de = NULL; } if (!drive->present) @@ -2323,7 +1892,14 @@ #if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI) if (hwif->dma_base) { (void) ide_release_dma(hwif); + hwif->dma_base = 0; + hwif->dma_master = 0; + hwif->dma_command = 0; + hwif->dma_vendor1 = 0; + hwif->dma_status = 0; + hwif->dma_vendor3 = 0; + hwif->dma_prdtable = 0; } #endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */ @@ -2343,49 +1919,137 @@ kfree(gd->sizes); kfree(gd->part); if (gd->de_arr) - kfree (gd->de_arr); + kfree(gd->de_arr); if (gd->flags) - kfree (gd->flags); + kfree(gd->flags); kfree(gd); hwif->gd = NULL; } - old_hwif = *hwif; - init_hwif_data (index); /* restore hwif data to pristine status */ - hwif->hwgroup = old_hwif.hwgroup; - hwif->tuneproc = old_hwif.tuneproc; - hwif->speedproc = old_hwif.speedproc; - hwif->selectproc = old_hwif.selectproc; - hwif->resetproc = old_hwif.resetproc; - hwif->intrproc = old_hwif.intrproc; - hwif->maskproc = old_hwif.maskproc; - hwif->quirkproc = old_hwif.quirkproc; - hwif->rwproc = old_hwif.rwproc; - hwif->ideproc = old_hwif.ideproc; - hwif->dmaproc = old_hwif.dmaproc; - hwif->busproc = old_hwif.busproc; - hwif->bus_state = old_hwif.bus_state; - hwif->dma_base = old_hwif.dma_base; - hwif->dma_extra = old_hwif.dma_extra; - hwif->config_data = old_hwif.config_data; - hwif->select_data = old_hwif.select_data; - hwif->proc = old_hwif.proc; -#ifndef CONFIG_BLK_DEV_IDECS - hwif->irq = old_hwif.irq; -#endif /* CONFIG_BLK_DEV_IDECS */ - hwif->major = old_hwif.major; - hwif->chipset = old_hwif.chipset; - hwif->autodma = old_hwif.autodma; - hwif->udma_four = old_hwif.udma_four; + old_hwif = *hwif; + init_hwif_data(index); /* restore hwif data to pristine status */ + hwif->hwgroup = old_hwif.hwgroup; + + hwif->proc = old_hwif.proc; + + hwif->major = old_hwif.major; +// hwif->index = old_hwif.index; +// hwif->channel = old_hwif.channel; + hwif->straight8 = old_hwif.straight8; + hwif->bus_state = old_hwif.bus_state; + + hwif->chipset = old_hwif.chipset; + #ifdef CONFIG_BLK_DEV_IDEPCI - hwif->pci_dev = old_hwif.pci_dev; - hwif->pci_devid = old_hwif.pci_devid; + hwif->pci_dev = old_hwif.pci_dev; + hwif->cds = old_hwif.cds; #endif /* CONFIG_BLK_DEV_IDEPCI */ - hwif->straight8 = old_hwif.straight8; - hwif->hwif_data = old_hwif.hwif_data; + +#if 0 + hwif->hwifops = old_hwif.hwifops; +#else + hwif->identify = old_hwif.identify; + hwif->tuneproc = old_hwif.tuneproc; + hwif->speedproc = old_hwif.speedproc; + hwif->selectproc = old_hwif.selectproc; + hwif->reset_poll = old_hwif.reset_poll; + hwif->pre_reset = old_hwif.pre_reset; + hwif->resetproc = old_hwif.resetproc; + hwif->intrproc = old_hwif.intrproc; + hwif->maskproc = old_hwif.maskproc; + hwif->quirkproc = old_hwif.quirkproc; + hwif->busproc = old_hwif.busproc; + hwif->ratemask = old_hwif.ratemask; + hwif->ratefilter = old_hwif.ratefilter; +#endif + +#if 0 + hwif->pioops = old_hwif.pioops; +#else + hwif->ata_input_data = old_hwif.ata_input_data; + hwif->ata_output_data = old_hwif.ata_output_data; + hwif->atapi_input_bytes = old_hwif.atapi_input_bytes; + hwif->atapi_output_bytes = old_hwif.atapi_output_bytes; +#endif + +#if 0 + hwif->dmaops = old_hwif.dmaops; +#else + hwif->ide_dma_read = old_hwif.ide_dma_read; + hwif->ide_dma_write = old_hwif.ide_dma_write; + hwif->ide_dma_begin = old_hwif.ide_dma_begin; + hwif->ide_dma_end = old_hwif.ide_dma_end; + hwif->ide_dma_check = old_hwif.ide_dma_check; + hwif->ide_dma_on = old_hwif.ide_dma_on; + hwif->ide_dma_off = old_hwif.ide_dma_off; + hwif->ide_dma_off_quietly = old_hwif.ide_dma_off_quietly; + hwif->ide_dma_test_irq = old_hwif.ide_dma_test_irq; + hwif->ide_dma_host_on = old_hwif.ide_dma_host_on; + hwif->ide_dma_host_off = old_hwif.ide_dma_host_off; + hwif->ide_dma_bad_drive = old_hwif.ide_dma_bad_drive; + hwif->ide_dma_good_drive = old_hwif.ide_dma_good_drive; + hwif->ide_dma_count = old_hwif.ide_dma_count; + hwif->ide_dma_verbose = old_hwif.ide_dma_verbose; + hwif->ide_dma_retune = old_hwif.ide_dma_retune; + hwif->ide_dma_lostirq = old_hwif.ide_dma_lostirq; + hwif->ide_dma_timeout = old_hwif.ide_dma_timeout; +#endif + +#if 0 + hwif->iops = old_hwif.iops; +#else + hwif->OUTB = old_hwif.OUTB; + hwif->OUTW = old_hwif.OUTW; + hwif->OUTL = old_hwif.OUTL; + hwif->OUTBP = old_hwif.OUTBP; + hwif->OUTWP = old_hwif.OUTWP; + hwif->OUTLP = old_hwif.OUTLP; + hwif->OUTSW = old_hwif.OUTSW; + hwif->OUTSWP = old_hwif.OUTSWP; + hwif->OUTSL = old_hwif.OUTSL; + hwif->OUTSLP = old_hwif.OUTSLP; + + hwif->INB = old_hwif.INB; + hwif->INW = old_hwif.INW; + hwif->INL = old_hwif.INL; + hwif->INBP = old_hwif.INBP; + hwif->INWP = old_hwif.INWP; + hwif->INLP = old_hwif.INLP; + hwif->INSW = old_hwif.INSW; + hwif->INSWP = old_hwif.INSWP; + hwif->INSL = old_hwif.INSL; + hwif->INSLP = old_hwif.INSLP; +#endif + + hwif->mmio = old_hwif.mmio; + hwif->rqsize = old_hwif.rqsize; + hwif->addressing = old_hwif.addressing; +#ifndef CONFIG_BLK_DEV_IDECS + hwif->irq = old_hwif.irq; +#endif /* CONFIG_BLK_DEV_IDECS */ + hwif->initializing = old_hwif.initializing; + + hwif->dma_base = old_hwif.dma_base; + hwif->dma_master = old_hwif.dma_master; + hwif->dma_command = old_hwif.dma_command; + hwif->dma_vendor1 = old_hwif.dma_vendor1; + hwif->dma_status = old_hwif.dma_status; + hwif->dma_vendor3 = old_hwif.dma_vendor3; + hwif->dma_prdtable = old_hwif.dma_prdtable; + + hwif->dma_extra = old_hwif.dma_extra; + hwif->config_data = old_hwif.config_data; + hwif->select_data = old_hwif.select_data; + hwif->autodma = old_hwif.autodma; + hwif->udma_four = old_hwif.udma_four; + hwif->no_dsc = old_hwif.no_dsc; + + hwif->hwif_data = old_hwif.hwif_data; abort: - restore_flags(flags); /* all CPUs */ + spin_unlock_irqrestore(&io_request_lock, flags); } +EXPORT_SYMBOL(ide_unregister); + /* * Setup hw_regs_t structure described by parameters. You * may set up the hw structure yourself OR use this routine to @@ -2394,7 +2058,11 @@ void ide_setup_ports ( hw_regs_t *hw, ide_ioreg_t base, int *offsets, ide_ioreg_t ctrl, ide_ioreg_t intr, - ide_ack_intr_t *ack_intr, int irq) + ide_ack_intr_t *ack_intr, +/* + * ide_io_ops_t *iops, + */ + int irq) { int i; @@ -2420,8 +2088,13 @@ hw->irq = irq; hw->dma = NO_DMA; hw->ack_intr = ack_intr; +/* + * hw->iops = iops; + */ } +EXPORT_SYMBOL(ide_setup_ports); + /* * Register an IDE interface, specifing exactly the registers etc * Set init=1 iff calling before probes have taken place. @@ -2472,6 +2145,8 @@ return (initializing || hwif->present) ? index : -1; } +EXPORT_SYMBOL(ide_register_hw); + /* * Compatability function with existing drivers. If you want * something different, use the function above. @@ -2484,6 +2159,8 @@ return ide_register_hw(&hw, NULL); } +EXPORT_SYMBOL(ide_register); + void ide_add_setting (ide_drive_t *drive, const char *name, int rw, int read_ioctl, int write_ioctl, int data_type, int min, int max, int mul_factor, int div_factor, void *data, ide_procset_t *set) { ide_settings_t **p = (ide_settings_t **) &drive->settings, *setting = NULL; @@ -2495,12 +2172,18 @@ memset(setting, 0, sizeof(*setting)); if ((setting->name = kmalloc(strlen(name) + 1, GFP_KERNEL)) == NULL) goto abort; - strcpy(setting->name, name); setting->rw = rw; - setting->read_ioctl = read_ioctl; setting->write_ioctl = write_ioctl; - setting->data_type = data_type; setting->min = min; - setting->max = max; setting->mul_factor = mul_factor; - setting->div_factor = div_factor; setting->data = data; - setting->set = set; setting->next = *p; + strcpy(setting->name, name); + setting->rw = rw; + setting->read_ioctl = read_ioctl; + setting->write_ioctl = write_ioctl; + setting->data_type = data_type; + setting->min = min; + setting->max = max; + setting->mul_factor = mul_factor; + setting->div_factor = div_factor; + setting->data = data; + setting->set = set; + setting->next = *p; if (drive->driver) setting->auto_remove = 1; *p = setting; @@ -2510,6 +2193,8 @@ kfree(setting); } +EXPORT_SYMBOL(ide_add_setting); + void ide_remove_setting (ide_drive_t *drive, char *name) { ide_settings_t **p = (ide_settings_t **) &drive->settings, *setting; @@ -2523,6 +2208,8 @@ kfree(setting); } +EXPORT_SYMBOL(ide_remove_setting); + static ide_settings_t *ide_find_setting_by_ioctl (ide_drive_t *drive, int cmd) { ide_settings_t *setting = drive->settings; @@ -2595,19 +2282,20 @@ while (hwgroup->busy) { unsigned long lflags; spin_unlock_irq(&io_request_lock); - __save_flags(lflags); /* local CPU only */ - __sti(); /* local CPU only; needed for jiffies */ - if (0 < (signed long)(jiffies - timeout)) { - __restore_flags(lflags); /* local CPU only */ + local_irq_set(lflags); + if (time_after(jiffies, timeout)) { + local_irq_restore(lflags); printk("%s: channel busy\n", drive->name); return -EBUSY; } - __restore_flags(lflags); /* local CPU only */ + local_irq_restore(lflags); spin_lock_irq(&io_request_lock); } return 0; } +EXPORT_SYMBOL(ide_spin_wait_hwgroup); + /* * FIXME: This should be changed to enqueue a special request * to the driver to change settings, and then wait on a sema for completion. @@ -2648,6 +2336,8 @@ return 0; } +EXPORT_SYMBOL(ide_write_setting); + static int set_io_32bit(ide_drive_t *drive, int arg) { drive->io_32bit = arg; @@ -2662,10 +2352,15 @@ { if (!drive->driver || !DRIVER(drive)->supports_dma) return -EPERM; - if (!drive->id || !(drive->id->capability & 1) || !HWIF(drive)->dmaproc) + if (!drive->id || !(drive->id->capability & 1)) + return -EPERM; + if (HWIF(drive)->ide_dma_check == NULL) return -EPERM; - if (HWIF(drive)->dmaproc(arg ? ide_dma_on : ide_dma_off, drive)) - return -EIO; + if (arg) { + if (HWIF(drive)->ide_dma_on(drive)) return -EIO; + } else { + if (HWIF(drive)->ide_dma_off(drive)) return -EIO; + } return 0; } @@ -2673,14 +2368,54 @@ { struct request rq; - if (!HWIF(drive)->tuneproc) - return -ENOSYS; - if (drive->special.b.set_tune) - return -EBUSY; - ide_init_drive_cmd(&rq); - drive->tune_req = (byte) arg; - drive->special.b.set_tune = 1; - (void) ide_do_drive_cmd (drive, &rq, ide_wait); + if (!HWIF(drive)->tuneproc) + return -ENOSYS; + if (drive->special.b.set_tune) + return -EBUSY; + ide_init_drive_cmd(&rq); + drive->tune_req = (u8) arg; + drive->special.b.set_tune = 1; + (void) ide_do_drive_cmd(drive, &rq, ide_wait); + return 0; +} + +static int set_xfer_rate (ide_drive_t *drive, int arg) +{ + int err = ide_wait_cmd(drive, + WIN_SETFEATURES, (u8) arg, + SETFEATURES_XFER, 0, NULL); + + if (!err && arg) { + if ((HWIF(drive)->speedproc) != NULL) + HWIF(drive)->speedproc(drive, (u8) arg); + ide_driveid_update(drive); + } + return err; +} + +int ide_atapi_to_scsi (ide_drive_t *drive, int arg) +{ + u8 media = drive->media; + + if (drive->media == ide_disk) { + drive->scsi = 0; + return 0; + } + + if (drive->driver != NULL) { + if (DRIVER(drive)->cleanup(drive)) { + drive->scsi = 0; + return 0; + } + } + if (drive->driver == NULL) + ide_probe_module(); + + drive->scsi = (u8) arg; + if (drive->scsi) + drive->media = ide_scsi; + ide_attach_drive(drive); + drive->media = media; return 0; } @@ -2696,37 +2431,11 @@ ide_add_setting(drive, "slow", SETTING_RW, -1, -1, TYPE_BYTE, 0, 1, 1, 1, &drive->slow, NULL); ide_add_setting(drive, "unmaskirq", drive->no_unmask ? SETTING_READ : SETTING_RW, HDIO_GET_UNMASKINTR, HDIO_SET_UNMASKINTR, TYPE_BYTE, 0, 1, 1, 1, &drive->unmask, NULL); ide_add_setting(drive, "using_dma", SETTING_RW, HDIO_GET_DMA, HDIO_SET_DMA, TYPE_BYTE, 0, 1, 1, 1, &drive->using_dma, set_using_dma); - ide_add_setting(drive, "ide_scsi", SETTING_RW, -1, -1, TYPE_BYTE, 0, 1, 1, 1, &drive->scsi, NULL); - ide_add_setting(drive, "init_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 69, 1, 1, &drive->init_speed, NULL); - ide_add_setting(drive, "current_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 69, 1, 1, &drive->current_speed, NULL); + ide_add_setting(drive, "init_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->init_speed, NULL); + ide_add_setting(drive, "current_speed", SETTING_RW, -1, -1, TYPE_BYTE, 0, 70, 1, 1, &drive->current_speed, set_xfer_rate); ide_add_setting(drive, "number", SETTING_RW, -1, -1, TYPE_BYTE, 0, 3, 1, 1, &drive->dn, NULL); -} - -int ide_wait_cmd (ide_drive_t *drive, int cmd, int nsect, int feature, int sectors, byte *buf) -{ - struct request rq; - byte buffer[4]; - - if (!buf) - buf = buffer; - memset(buf, 0, 4 + SECTOR_WORDS * 4 * sectors); - ide_init_drive_cmd(&rq); - rq.buffer = buf; - *buf++ = cmd; - *buf++ = nsect; - *buf++ = feature; - *buf++ = sectors; - return ide_do_drive_cmd(drive, &rq, ide_wait); -} - -int ide_wait_cmd_task (ide_drive_t *drive, byte *buf) -{ - struct request rq; - - ide_init_drive_cmd(&rq); - rq.cmd = IDE_DRIVE_TASK; - rq.buffer = buf; - return ide_do_drive_cmd(drive, &rq, ide_wait); + if (drive->media != ide_disk) + ide_add_setting(drive, "ide-scsi", SETTING_RW, -1, HDIO_SET_IDE_SCSI, TYPE_BYTE, 0, 1, 1, 1, &drive->scsi, ide_atapi_to_scsi); } /* @@ -2747,19 +2456,41 @@ #endif /* CONFIG_BLK_DEV_IDECS */ } +EXPORT_SYMBOL(ide_delay_50ms); + int system_bus_clock (void) { return((int) ((!system_bus_speed) ? ide_system_bus_speed() : system_bus_speed )); } -int ide_reinit_drive (ide_drive_t *drive) +EXPORT_SYMBOL(system_bus_clock); + +int ide_replace_subdriver (ide_drive_t *drive, const char *driver) +{ + if (!drive->present || drive->busy || drive->usage) + goto abort; + if (drive->driver != NULL && DRIVER(drive)->cleanup(drive)) + goto abort; + strncpy(drive->driver_req, driver, 9); + ide_driver_module(); + drive->driver_req[0] = 0; + ide_driver_module(); + if (DRIVER(drive) && !strcmp(DRIVER(drive)->name, driver)) + return 0; +abort: + return 1; +} + +EXPORT_SYMBOL(ide_replace_subdriver); + +int ide_attach_drive (ide_drive_t *drive) { switch (drive->media) { #ifdef CONFIG_BLK_DEV_IDECD case ide_cdrom: { - extern int ide_cdrom_reinit(ide_drive_t *drive); - if (ide_cdrom_reinit(drive)) + extern int ide_cdrom_attach(ide_drive_t *drive); + if (ide_cdrom_attach(drive)) return 1; break; } @@ -2767,8 +2498,8 @@ #ifdef CONFIG_BLK_DEV_IDEDISK case ide_disk: { - extern int idedisk_reinit(ide_drive_t *drive); - if (idedisk_reinit(drive)) + extern int idedisk_attach(ide_drive_t *drive); + if (idedisk_attach(drive)) return 1; break; } @@ -2776,8 +2507,8 @@ #ifdef CONFIG_BLK_DEV_IDEFLOPPY case ide_floppy: { - extern int idefloppy_reinit(ide_drive_t *drive); - if (idefloppy_reinit(drive)) + extern int idefloppy_attach(ide_drive_t *drive); + if (idefloppy_attach(drive)) return 1; break; } @@ -2785,28 +2516,30 @@ #ifdef CONFIG_BLK_DEV_IDETAPE case ide_tape: { - extern int idetape_reinit(ide_drive_t *drive); - if (idetape_reinit(drive)) + extern int idetape_attach(ide_drive_t *drive); + if (idetape_attach(drive)) return 1; break; } #endif /* CONFIG_BLK_DEV_IDETAPE */ + default: #ifdef CONFIG_BLK_DEV_IDESCSI -/* - * { - * extern int idescsi_reinit(ide_drive_t *drive); - * if (idescsi_reinit(drive)) - * return 1; - * break; - * } - */ + case ide_scsi: + { + extern int idescsi_attach(ide_drive_t *drive); + if (idescsi_attach(drive)) + return 1; + break; + } + #endif /* CONFIG_BLK_DEV_IDESCSI */ - default: return 1; } return 0; } +EXPORT_SYMBOL(ide_attach_drive); + static int ide_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { @@ -2838,11 +2571,11 @@ case HDIO_GETGEO: { struct hd_geometry *loc = (struct hd_geometry *) arg; - unsigned short bios_cyl = drive->bios_cyl; /* truncate */ + u16 bios_cyl = drive->bios_cyl; /* truncate */ if (!loc || (drive->media != ide_disk && drive->media != ide_floppy)) return -EINVAL; - if (put_user(drive->bios_head, (byte *) &loc->heads)) return -EFAULT; - if (put_user(drive->bios_sect, (byte *) &loc->sectors)) return -EFAULT; - if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT; + if (put_user(drive->bios_head, (u8 *) &loc->heads)) return -EFAULT; + if (put_user(drive->bios_sect, (u8 *) &loc->sectors)) return -EFAULT; + if (put_user(bios_cyl, (u16 *) &loc->cylinders)) return -EFAULT; if (put_user((unsigned)drive->part[MINOR(inode->i_rdev)&PARTN_MASK].start_sect, (unsigned long *) &loc->start)) return -EFAULT; return 0; @@ -2852,8 +2585,8 @@ { struct hd_big_geometry *loc = (struct hd_big_geometry *) arg; if (!loc || (drive->media != ide_disk && drive->media != ide_floppy)) return -EINVAL; - if (put_user(drive->bios_head, (byte *) &loc->heads)) return -EFAULT; - if (put_user(drive->bios_sect, (byte *) &loc->sectors)) return -EFAULT; + if (put_user(drive->bios_head, (u8 *) &loc->heads)) return -EFAULT; + if (put_user(drive->bios_sect, (u8 *) &loc->sectors)) return -EFAULT; if (put_user(drive->bios_cyl, (unsigned int *) &loc->cylinders)) return -EFAULT; if (put_user((unsigned)drive->part[MINOR(inode->i_rdev)&PARTN_MASK].start_sect, (unsigned long *) &loc->start)) return -EFAULT; @@ -2864,8 +2597,8 @@ { struct hd_big_geometry *loc = (struct hd_big_geometry *) arg; if (!loc || (drive->media != ide_disk && drive->media != ide_floppy)) return -EINVAL; - if (put_user(drive->head, (byte *) &loc->heads)) return -EFAULT; - if (put_user(drive->sect, (byte *) &loc->sectors)) return -EFAULT; + if (put_user(drive->head, (u8 *) &loc->heads)) return -EFAULT; + if (put_user(drive->sect, (u8 *) &loc->sectors)) return -EFAULT; if (put_user(drive->cyl, (unsigned int *) &loc->cylinders)) return -EFAULT; if (put_user((unsigned)drive->part[MINOR(inode->i_rdev)&PARTN_MASK].start_sect, (unsigned long *) &loc->start)) return -EFAULT; @@ -2918,68 +2651,15 @@ #endif /* CONFIG_IDE_TASK_IOCTL */ case HDIO_DRIVE_CMD: - { - byte args[4], *argbuf = args; - byte xfer_rate = 0; - int argsize = 4; - ide_task_t tfargs; - if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO)) return -EACCES; - if (NULL == (void *) arg) - return ide_do_drive_cmd(drive, &rq, ide_wait); - if (copy_from_user(args, (void *)arg, 4)) - return -EFAULT; - - tfargs.tfRegister[IDE_FEATURE_OFFSET] = args[2]; - tfargs.tfRegister[IDE_NSECTOR_OFFSET] = args[3]; - tfargs.tfRegister[IDE_SECTOR_OFFSET] = args[1]; - tfargs.tfRegister[IDE_LCYL_OFFSET] = 0x00; - tfargs.tfRegister[IDE_HCYL_OFFSET] = 0x00; - tfargs.tfRegister[IDE_SELECT_OFFSET] = 0x00; - tfargs.tfRegister[IDE_COMMAND_OFFSET] = args[0]; - - if (args[3]) { - argsize = 4 + (SECTOR_WORDS * 4 * args[3]); - argbuf = kmalloc(argsize, GFP_KERNEL); - if (argbuf == NULL) - return -ENOMEM; - memcpy(argbuf, args, 4); - } - - if (set_transfer(drive, &tfargs)) { - xfer_rate = args[1]; - if (ide_ata66_check(drive, &tfargs)) - goto abort; - } - - err = ide_wait_cmd(drive, args[0], args[1], args[2], args[3], argbuf); + return ide_cmd_ioctl(drive, inode, file, cmd, arg); - if (!err && xfer_rate) { - /* active-retuning-calls future */ - if ((HWIF(drive)->speedproc) != NULL) - HWIF(drive)->speedproc(drive, xfer_rate); - ide_driveid_update(drive); - } - abort: - if (copy_to_user((void *)arg, argbuf, argsize)) - err = -EFAULT; - if (argsize > 4) - kfree(argbuf); - return err; - } case HDIO_DRIVE_TASK: - { - byte args[7], *argbuf = args; - int argsize = 7; - if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO)) return -EACCES; - if (copy_from_user(args, (void *)arg, 7)) - return -EFAULT; - err = ide_wait_cmd_task(drive, argbuf); - if (copy_to_user((void *)arg, argbuf, argsize)) - err = -EFAULT; - return err; - } + if (!capable(CAP_SYS_ADMIN) || !capable(CAP_SYS_RAWIO)) + return -EACCES; + return ide_task_ioctl(drive, inode, file, cmd, arg); + case HDIO_SCAN_HWIF: { int args[3]; @@ -3011,18 +2691,15 @@ case HDIO_DRIVE_RESET: { unsigned long flags; - ide_hwgroup_t *hwgroup = HWGROUP(drive); - if (!capable(CAP_SYS_ADMIN)) return -EACCES; #if 1 spin_lock_irqsave(&io_request_lock, flags); - if (hwgroup->handler != NULL) { - printk("%s: ide_set_handler: handler not null; %p\n", drive->name, hwgroup->handler); - (void) hwgroup->handler(drive); -// hwgroup->handler = NULL; -// hwgroup->expiry = NULL; - hwgroup->timer.expires = jiffies + 0;; - del_timer(&hwgroup->timer); + if ( HWGROUP(drive)->handler != NULL) { + printk("%s: ide_set_handler: handler not null; %p\n", drive->name, HWGROUP(drive)->handler); + (void) HWGROUP(drive)->handler(drive); +// HWGROUP(drive)->handler = NULL; + HWGROUP(drive)->expiry = NULL; + del_timer(&HWGROUP(drive)->timer); } spin_unlock_irqrestore(&io_request_lock, flags); @@ -3085,33 +2762,6 @@ return 0; } -void ide_fixstring (byte *s, const int bytecount, const int byteswap) -{ - byte *p = s, *end = &s[bytecount & ~1]; /* bytecount must be even */ - - if (byteswap) { - /* convert from big-endian to host byte order */ - for (p = end ; p != s;) { - unsigned short *pp = (unsigned short *) (p -= 2); - *pp = ntohs(*pp); - } - } - - /* strip leading blanks */ - while (s != end && *s == ' ') - ++s; - - /* compress internal blanks and strip trailing blanks */ - while (s != end && *s) { - if (*s++ != ' ' || (s != end && *s && *s != ' ')) - *p++ = *(s-1); - } - - /* wipe out trailing garbage */ - while (p != end) - *p++ = '\0'; -} - /* * stridx() returns the offset of c within s, * or -1 if c is '\0' or not found within s. @@ -3418,7 +3068,7 @@ const char *ide_words[] = { "noprobe", "serialize", "autotune", "noautotune", "reset", "dma", "ata66", "minus8", "minus9", "minus10", - "four", "qd65xx", "ht6560b", "cmd640_vlb", "dtc2278", "umc8672", "ali14xx", "dc4030", "nohighio", NULL }; + "four", "qd65xx", "ht6560b", "cmd640_vlb", "dtc2278", "umc8672", "ali14xx", "dc4030", NULL }; hw = s[3] - '0'; hwif = &ide_hwifs[hw]; i = match_parm(&s[4], ide_words, vals, 3); @@ -3437,10 +3087,6 @@ } switch (i) { - case -19: /* nohighio */ - hwif->no_highio = 1; - printk("%s: disabled high i/o capability\n", hwif->name); - goto done; #ifdef CONFIG_BLK_DEV_PDC4030 case -18: /* "dc4030" */ { @@ -3585,13 +3231,6 @@ { #ifdef CONFIG_BLK_DEV_IDEPCI ide_scan_pcibus(ide_scan_direction); -#else -#ifdef CONFIG_BLK_DEV_RZ1000 - { - extern void ide_probe_for_rz100x(void); - ide_probe_for_rz100x(); - } -#endif /* CONFIG_BLK_DEV_RZ1000 */ #endif /* CONFIG_BLK_DEV_IDEPCI */ } #endif /* CONFIG_PCI */ @@ -3676,6 +3315,56 @@ #endif /* CONFIG_BLK_DEV_ISAPNP */ } +void __init ide_init_builtin_subdrivers (void) +{ +#ifdef CONFIG_BLK_DEV_IDEDISK + (void) idedisk_init(); +#endif /* CONFIG_BLK_DEV_IDEDISK */ +#ifdef CONFIG_BLK_DEV_IDECD + (void) ide_cdrom_init(); +#endif /* CONFIG_BLK_DEV_IDECD */ +#ifdef CONFIG_BLK_DEV_IDETAPE + (void) idetape_init(); +#endif /* CONFIG_BLK_DEV_IDETAPE */ +#ifdef CONFIG_BLK_DEV_IDEFLOPPY + (void) idefloppy_init(); +#endif /* CONFIG_BLK_DEV_IDEFLOPPY */ +#ifdef CONFIG_BLK_DEV_IDESCSI + #ifdef CONFIG_SCSI + (void) idescsi_init(); + #else + #warning ide scsi-emulation selected but no SCSI-subsystem in kernel + #endif +#endif /* CONFIG_BLK_DEV_IDESCSI */ +} + +#ifndef CLASSIC_BUILTINS_METHOD +# ifndef DIRECT_HWIF_PROBE_ATTACH_METHOD +# ifdef FAKE_CLASSIC_ATTACH_METHOD +/* + * Attempt to match drivers for the available drives + */ +void ide_attach_devices (void) +{ + ide_hwif_t *hwif; + ide_drive_t *drive; + int i, unit; + + for (i = 0; i < MAX_HWIFS; i++) { + hwif = &ide_hwifs[i]; + if (!hwif->present) + continue; + for (unit = 0; unit < MAX_DRIVES; ++unit) { + drive = &hwif->drives[unit]; + if (drive->present) + ide_attach_drive(drive); + } + } +} +# endif /* FAKE_CLASSIC_ATTACH_METHOD */ +# endif /* DIRECT_HWIF_PROBE_ATTACH_METHOD */ +#endif /* CLASSIC_BUILTINS_METHOD */ + void __init ide_init_builtin_drivers (void) { /* @@ -3686,8 +3375,10 @@ #ifdef CONFIG_BLK_DEV_IDE #if defined(__mc68000__) || defined(CONFIG_APUS) if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) { - ide_get_lock(&ide_lock, NULL, NULL); /* for atari only */ - disable_irq(ide_hwifs[0].irq); /* disable_irq_nosync ?? */ + /* for atari only */ + ide_get_lock(&ide_intr_lock, NULL, NULL); + /* disable_irq_nosync ?? */ + disable_irq(ide_hwifs[0].irq); // disable_irq_nosync(ide_hwifs[0].irq); } #endif /* __mc68000__ || CONFIG_APUS */ @@ -3697,7 +3388,8 @@ #if defined(__mc68000__) || defined(CONFIG_APUS) if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET]) { enable_irq(ide_hwifs[0].irq); - ide_release_lock(&ide_lock); /* for atari only */ + /* for atari only */ + ide_release_lock(&ide_intr_lock); } #endif /* __mc68000__ || CONFIG_APUS */ #endif /* CONFIG_BLK_DEV_IDE */ @@ -3706,28 +3398,15 @@ proc_ide_create(); #endif - /* - * Attempt to match drivers for the available drives - */ -#ifdef CONFIG_BLK_DEV_IDEDISK - (void) idedisk_init(); -#endif /* CONFIG_BLK_DEV_IDEDISK */ -#ifdef CONFIG_BLK_DEV_IDECD - (void) ide_cdrom_init(); -#endif /* CONFIG_BLK_DEV_IDECD */ -#ifdef CONFIG_BLK_DEV_IDETAPE - (void) idetape_init(); -#endif /* CONFIG_BLK_DEV_IDETAPE */ -#ifdef CONFIG_BLK_DEV_IDEFLOPPY - (void) idefloppy_init(); -#endif /* CONFIG_BLK_DEV_IDEFLOPPY */ -#ifdef CONFIG_BLK_DEV_IDESCSI - #ifdef CONFIG_SCSI - (void) idescsi_init(); - #else - #warning ide scsi-emulation selected but no SCSI-subsystem in kernel - #endif -#endif /* CONFIG_BLK_DEV_IDESCSI */ +#ifdef CLASSIC_BUILTINS_METHOD + ide_init_builtin_subdrivers(); +#else /* ! CLASSIC_BUILTINS_METHOD */ +# ifndef DIRECT_HWIF_PROBE_ATTACH_METHOD +# ifdef FAKE_CLASSIC_ATTACH_METHOD + ide_attach_devices(); +# endif /* FAKE_CLASSIC_ATTACH_METHOD */ +# endif /* DIRECT_HWIF_PROBE_ATTACH_METHOD */ +#endif /* CLASSIC_BUILTINS_METHOD */ } static int default_cleanup (ide_drive_t *drive) @@ -3740,22 +3419,42 @@ return 0; } +static int default_suspend (ide_drive_t *drive) +{ + return 0; +} + +static int default_resume (ide_drive_t *drive) +{ + return 0; +} + static int default_flushcache (ide_drive_t *drive) { return 0; } -static ide_startstop_t default_do_request(ide_drive_t *drive, struct request *rq, unsigned long block) +static ide_startstop_t default_do_request (ide_drive_t *drive, struct request *rq, unsigned long block) { - ide_end_request(0, HWGROUP(drive)); + ide_end_request(drive, 0); return ide_stopped; } - -static void default_end_request (byte uptodate, ide_hwgroup_t *hwgroup) + +static int default_end_request (ide_drive_t *drive, int uptodate) +{ + return ide_end_request(drive, uptodate); +} + +static u8 default_sense (ide_drive_t *drive, const char *msg, u8 stat) { - ide_end_request(uptodate, hwgroup); + return ide_dump_status(drive, msg, stat); } - + +static ide_startstop_t default_error (ide_drive_t *drive, const char *msg, u8 stat) +{ + return ide_error(drive, msg, stat); +} + static int default_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { @@ -3795,9 +3494,15 @@ return ide_stopped; } -static int default_reinit (ide_drive_t *drive) +static int default_init (void) +{ + return 0; +} + +static int default_attach (ide_drive_t *drive) { - printk(KERN_ERR "%s: does not support hotswap of device class !\n", drive->name); + printk(KERN_ERR "%s: does not support hotswap of device class !\n", + drive->name); return 0; } @@ -3808,9 +3513,13 @@ if (d->cleanup == NULL) d->cleanup = default_cleanup; if (d->standby == NULL) d->standby = default_standby; + if (d->suspend == NULL) d->suspend = default_suspend; + if (d->resume == NULL) d->resume = default_resume; if (d->flushcache == NULL) d->flushcache = default_flushcache; if (d->do_request == NULL) d->do_request = default_do_request; if (d->end_request == NULL) d->end_request = default_end_request; + if (d->sense == NULL) d->sense = default_sense; + if (d->error == NULL) d->error = default_error; if (d->ioctl == NULL) d->ioctl = default_ioctl; if (d->open == NULL) d->open = default_open; if (d->release == NULL) d->release = default_release; @@ -3818,10 +3527,11 @@ if (d->pre_reset == NULL) d->pre_reset = default_pre_reset; if (d->capacity == NULL) d->capacity = default_capacity; if (d->special == NULL) d->special = default_special; - if (d->reinit == NULL) d->reinit = default_reinit; + if (d->init == NULL) d->init = default_init; + if (d->attach == NULL) d->attach = default_attach; } -ide_drive_t *ide_scan_devices (byte media, const char *name, ide_driver_t *driver, int n) +ide_drive_t *ide_scan_devices (u8 media, const char *name, ide_driver_t *driver, int n) { unsigned int unit, index, i; @@ -3834,37 +3544,33 @@ char *req = drive->driver_req; if (*req && !strstr(name, req)) continue; - if (drive->present && drive->media == media && drive->driver == driver && ++i > n) + if (drive->present && drive->media == media && + drive->driver == driver && ++i > n) return drive; } } return NULL; } +EXPORT_SYMBOL(ide_scan_devices); + int ide_register_subdriver (ide_drive_t *drive, ide_driver_t *driver, int version) { unsigned long flags; - save_flags(flags); /* all CPUs */ - cli(); /* all CPUs */ - if (version != IDE_SUBDRIVER_VERSION || !drive->present || drive->driver != NULL || drive->busy || drive->usage) { - restore_flags(flags); /* all CPUs */ + spin_lock_irqsave(&io_request_lock, flags); + if (version != IDE_SUBDRIVER_VERSION || !drive->present || + drive->driver != NULL || drive->busy || drive->usage) { + spin_unlock_irqrestore(&io_request_lock, flags); return 1; } drive->driver = driver; setup_driver_defaults(drive); - restore_flags(flags); /* all CPUs */ + spin_unlock_irqrestore(&io_request_lock, flags); if (drive->autotune != 2) { - if (driver->supports_dma && HWIF(drive)->dmaproc != NULL) { - /* - * Force DMAing for the beginning of the check. - * Some chipsets appear to do interesting things, - * if not checked and cleared. - * PARANOIA!!! - */ - (void) (HWIF(drive)->dmaproc(ide_dma_off_quietly, drive)); - (void) (HWIF(drive)->dmaproc(ide_dma_check, drive)); - } + /* DMA timings and setup moved to ide-probe.c */ + if (!driver->supports_dma && HWIF(drive)->ide_dma_off_quietly) + HWIF(drive)->ide_dma_off_quietly(drive); drive->dsc_overlap = (drive->next != drive && driver->supports_dsc_overlap); drive->nice1 = 1; } @@ -3877,14 +3583,16 @@ return 0; } +EXPORT_SYMBOL(ide_register_subdriver); + int ide_unregister_subdriver (ide_drive_t *drive) { unsigned long flags; - save_flags(flags); /* all CPUs */ - cli(); /* all CPUs */ - if (drive->usage || drive->busy || drive->driver == NULL || DRIVER(drive)->busy) { - restore_flags(flags); /* all CPUs */ + spin_lock_irqsave(&io_request_lock, flags); + if (drive->usage || drive->busy || + drive->driver == NULL || DRIVER(drive)->busy) { + spin_unlock_irqrestore(&io_request_lock, flags); return 1; } #if defined(CONFIG_BLK_DEV_ISAPNP) && defined(CONFIG_ISAPNP) && defined(MODULE) @@ -3896,10 +3604,12 @@ #endif auto_remove_settings(drive); drive->driver = NULL; - restore_flags(flags); /* all CPUs */ + spin_unlock_irqrestore(&io_request_lock, flags); return 0; } +EXPORT_SYMBOL(ide_unregister_subdriver); + int ide_register_module (ide_module_t *module) { ide_module_t *p = ide_modules; @@ -3915,6 +3625,8 @@ return 0; } +EXPORT_SYMBOL(ide_register_module); + void ide_unregister_module (ide_module_t *module) { ide_module_t **p; @@ -3924,6 +3636,8 @@ *p = (*p)->next; } +EXPORT_SYMBOL(ide_unregister_module); + struct block_device_operations ide_fops[] = {{ owner: THIS_MODULE, open: ide_open, @@ -3933,10 +3647,34 @@ revalidate: ide_revalidate_disk }}; -EXPORT_SYMBOL(ide_hwifs); -EXPORT_SYMBOL(ide_register_module); -EXPORT_SYMBOL(ide_unregister_module); -EXPORT_SYMBOL(ide_spin_wait_hwgroup); +EXPORT_SYMBOL(ide_fops); + +/* + * ide_geninit() is called exactly *once* for each interface. + */ +void ide_geninit (ide_hwif_t *hwif) +{ + unsigned int unit; + struct gendisk *gd = hwif->gd; + + for (unit = 0; unit < MAX_DRIVES; ++unit) { + ide_drive_t *drive = &hwif->drives[unit]; + + if (!drive->present) + continue; + if (drive->media!=ide_disk && drive->media!=ide_floppy) + continue; + register_disk(gd,MKDEV(hwif->major,unit<forced_geom && drive->noprobe) ? 1 : +#endif /* CONFIG_BLK_DEV_ISAPNP */ + 1<rq; + + /* + * decide whether to reenable DMA -- 3 is a random magic for now, + * if we DMA timeout more than 3 times, just stay in PIO + */ + if (drive->state == DMA_PIO_RETRY && drive->retry_pio <= 3) { + drive->state = 0; + HWGROUP(drive)->hwif->ide_dma_on(drive); + } + + if (!end_that_request_first(rq, uptodate, drive->name)) { + add_blkdev_randomness(MAJOR(rq->rq_dev)); + blkdev_dequeue_request(rq); + HWGROUP(drive)->rq = NULL; + end_that_request_last(rq); + ret = 0; + } + spin_unlock_irqrestore(&io_request_lock, flags); + return ret; +} + +/* + * Error reporting, in human readable form (luxurious, but a memory hog). + */ +byte ide_cdrom_dump_status (ide_drive_t *drive, const char *msg, byte stat) +{ + unsigned long flags; + + atapi_status_t status; + atapi_error_t error; + + status.all = stat; + local_irq_set(flags); + printk("%s: %s: status=0x%02x", drive->name, msg, stat); +#if FANCY_STATUS_DUMPS + printk(" { "); + if (status.b.bsy) + printk("Busy "); + else { + if (status.b.drdy) printk("DriveReady "); + if (status.b.df) printk("DeviceFault "); + if (status.b.dsc) printk("SeekComplete "); + if (status.b.drq) printk("DataRequest "); + if (status.b.corr) printk("CorrectedError "); + if (status.b.idx) printk("Index "); + if (status.b.check) printk("Error "); + } + printk("}"); +#endif /* FANCY_STATUS_DUMPS */ + printk("\n"); + if ((status.all & (status.b.bsy|status.b.check)) == status.b.check) { + error.all = HWIF(drive)->INB(IDE_ERROR_REG); + printk("%s: %s: error=0x%02x", drive->name, msg, error.all); +#if FANCY_STATUS_DUMPS + if (error.b.ili) printk("IllegalLengthIndication "); + if (error.b.eom) printk("EndOfMedia "); + if (error.b.abrt) printk("Aborted Command "); + if (error.b.mcr) printk("MediaChangeRequested "); + if (error.b.sense_key) printk("LastFailedSense 0x%02x ", + error.b.sense_key); +#endif /* FANCY_STATUS_DUMPS */ + printk("\n"); + } + local_irq_restore(flags); + return error.all; +} + +/* + * ide_error() takes action based on the error returned by the drive. + */ +ide_startstop_t ide_cdrom_error (ide_drive_t *drive, const char *msg, byte stat) +{ + struct request *rq; + byte err; + + err = ide_cdrom_dump_status(drive, msg, stat); + if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL) + return ide_stopped; + /* retry only "normal" I/O: */ + if (rq->cmd == IDE_DRIVE_CMD || rq->cmd == IDE_DRIVE_TASK) { + rq->errors = 1; + ide_end_drive_cmd(drive, stat, err); + return ide_stopped; + } + + if (stat & BUSY_STAT || ((stat & WRERR_STAT) && !drive->nowerr)) { + /* other bits are useless when BUSY */ + rq->errors |= ERROR_RESET; + } else { + /* add decoding error stuff */ + } + if (HWIF(drive)->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT)) + /* force an abort */ + HWIF(drive)->OUTB(WIN_IDLEIMMEDIATE,IDE_COMMAND_REG); + if (rq->errors >= ERROR_MAX) { + DRIVER(drive)->end_request(drive, 0); + } else { + if ((rq->errors & ERROR_RESET) == ERROR_RESET) { + ++rq->errors; + return ide_do_reset(drive); + } + ++rq->errors; + } + return ide_stopped; +} + +static void cdrom_end_request (ide_drive_t *drive, int uptodate) { struct request *rq = HWGROUP(drive)->rq; @@ -554,7 +671,7 @@ if (!rq->current_nr_sectors) uptodate = 1; - ide_end_request (uptodate, HWGROUP(drive)); + ide_cdrom_end_request(drive, uptodate); } @@ -568,14 +685,13 @@ struct packet_command *pc; /* Check for errors. */ - stat = GET_STAT(); - *stat_ret = stat; + *stat_ret = stat = HWIF(drive)->INB(IDE_STATUS_REG); if (OK_STAT (stat, good_stat, BAD_R_STAT)) return 0; /* Get the IDE error register. */ - err = GET_ERR(); + err = HWIF(drive)->INB(IDE_ERROR_REG); sense_key = err >> 4; if (rq == NULL) { @@ -591,8 +707,8 @@ pc = (struct packet_command *) rq->buffer; pc->stat = 1; - cdrom_end_request (1, drive); - *startstop = ide_error (drive, "request sense failure", stat); + cdrom_end_request(drive, 1); + *startstop = DRIVER(drive)->error(drive, "request sense failure", stat); return 1; } else if (rq->cmd == PACKET_COMMAND) { @@ -628,7 +744,7 @@ } pc->stat = 1; - cdrom_end_request (1, drive); + cdrom_end_request(drive, 1); if ((stat & ERR_STAT) != 0) cdrom_queue_request_sense(drive, wait, pc->sense, pc); @@ -641,7 +757,7 @@ /* Fail the request. */ printk ("%s: tray open\n", drive->name); - cdrom_end_request (0, drive); + cdrom_end_request(drive, 0); } else if (sense_key == UNIT_ATTENTION) { /* Media change. */ cdrom_saw_media_change (drive); @@ -650,21 +766,26 @@ But be sure to give up if we've retried too many times. */ if (++rq->errors > ERROR_MAX) - cdrom_end_request (0, drive); + cdrom_end_request(drive, 0); } else if (sense_key == ILLEGAL_REQUEST || sense_key == DATA_PROTECT) { /* No point in retrying after an illegal request or data protect error.*/ ide_dump_status (drive, "command error", stat); - cdrom_end_request (0, drive); + cdrom_end_request(drive, 0); } else if ((err & ~ABRT_ERR) != 0) { /* Go to the default handler for other errors. */ - *startstop = ide_error (drive, "cdrom_decode_status", stat); + *startstop = DRIVER(drive)->error(drive, "cdrom_decode_status", stat); return 1; + } else if (sense_key == MEDIUM_ERROR) { + /* No point in re-trying a zillion times on a bad + * sector... If we got here the error is not correctable */ + ide_dump_status (drive, "media error (bad sector)", stat); + cdrom_end_request(drive, 0); } else if ((++rq->errors > ERROR_MAX)) { /* We've racked up too many retries. Abort. */ - cdrom_end_request (0, drive); + cdrom_end_request(drive, 0); } /* If we got a CHECK_CONDITION status, @@ -723,33 +844,37 @@ if (info->dma) { if (info->cmd == READ) { - info->dma = !HWIF(drive)->dmaproc(ide_dma_read, drive); + info->dma = !HWIF(drive)->ide_dma_read(drive); } else if (info->cmd == WRITE) { - info->dma = !HWIF(drive)->dmaproc(ide_dma_write, drive); + info->dma = !HWIF(drive)->ide_dma_write(drive); } else { printk("ide-cd: DMA set, but not allowed\n"); } } /* Set up the controller registers. */ - OUT_BYTE (info->dma, IDE_FEATURE_REG); - OUT_BYTE (0, IDE_NSECTOR_REG); - OUT_BYTE (0, IDE_SECTOR_REG); + HWIF(drive)->OUTB(info->dma, IDE_FEATURE_REG); + HWIF(drive)->OUTB(0, IDE_IREASON_REG); + HWIF(drive)->OUTB(0, IDE_SECTOR_REG); - OUT_BYTE (xferlen & 0xff, IDE_LCYL_REG); - OUT_BYTE (xferlen >> 8 , IDE_HCYL_REG); + HWIF(drive)->OUTB(xferlen & 0xff, IDE_BCOUNTL_REG); + HWIF(drive)->OUTB(xferlen >> 8 , IDE_BCOUNTH_REG); if (IDE_CONTROL_REG) - OUT_BYTE (drive->ctl, IDE_CONTROL_REG); + HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG); if (info->dma) - (void) (HWIF(drive)->dmaproc(ide_dma_begin, drive)); + (void) (HWIF(drive)->ide_dma_begin(drive)); if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt) { + if (HWGROUP(drive)->handler != NULL) + BUG(); ide_set_handler (drive, handler, WAIT_CMD, cdrom_timer_expiry); - OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); /* packet command */ + /* packet command */ + HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG); return ide_started; } else { - OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); /* packet command */ + /* packet command */ + HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG); return (*handler) (drive); } } @@ -772,25 +897,29 @@ unsigned int timeout = pc->timeout; ide_startstop_t startstop; - if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt) { + if (CDROM_CONFIG_FLAGS(drive)->drq_interrupt) { /* Here we should have been called after receiving an interrupt from the device. DRQ should how be set. */ int stat_dum; /* Check for errors. */ - if (cdrom_decode_status (&startstop, drive, DRQ_STAT, &stat_dum)) + if (cdrom_decode_status(&startstop, drive, DRQ_STAT, &stat_dum)) return startstop; } else { /* Otherwise, we must wait for DRQ to get set. */ - if (ide_wait_stat (&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) + if (ide_wait_stat(&startstop, drive, DRQ_STAT, + BUSY_STAT, WAIT_READY)) return startstop; } + if (HWGROUP(drive)->handler != NULL) /* paranoia check */ + BUG(); + /* Arm the interrupt handler. */ - ide_set_handler (drive, handler, timeout, cdrom_timer_expiry); + ide_set_handler(drive, handler, timeout, cdrom_timer_expiry); /* Send the command to the device. */ - atapi_output_bytes (drive, cmd_buf, cmd_len); + HWIF(drive)->atapi_output_bytes(drive, cmd_buf, cmd_len); return ide_started; } @@ -828,7 +957,7 @@ /* Read the data into the buffer. */ dest = info->buffer + info->nsectors_buffered * SECTOR_SIZE; while (sectors_to_buffer > 0) { - atapi_input_bytes (drive, dest, SECTOR_SIZE); + HWIF(drive)->atapi_input_bytes(drive, dest, SECTOR_SIZE); --sectors_to_buffer; --sectors_to_transfer; ++info->nsectors_buffered; @@ -838,7 +967,7 @@ /* Throw away any remaining data. */ while (sectors_to_transfer > 0) { char dum[SECTOR_SIZE]; - atapi_input_bytes (drive, dum, sizeof (dum)); + HWIF(drive)->atapi_input_bytes(drive, dum, sizeof (dum)); --sectors_to_transfer; } } @@ -864,14 +993,14 @@ and quit this request. */ while (len > 0) { int dum = 0; - atapi_output_bytes (drive, &dum, sizeof (dum)); + HWIF(drive)->atapi_output_bytes(drive, &dum, sizeof (dum)); len -= sizeof (dum); } } else if (ireason == 1) { /* Some drives (ASUS) seem to tell us that status * info is available. just get it and ignore. */ - GET_STAT(); + (void) HWIF(drive)->INB(IDE_STATUS_REG); return 0; } else { /* Drive wants a command packet, or invalid ireason... */ @@ -879,7 +1008,7 @@ drive->name, ireason); } - cdrom_end_request (0, drive); + cdrom_end_request(drive, 0); return -1; } @@ -891,6 +1020,7 @@ int stat; int ireason, len, sectors_to_transfer, nskip; struct cdrom_info *info = drive->driver_data; + u8 lowcyl = 0, highcyl = 0; int i, dma = info->dma, dma_error = 0; ide_startstop_t startstop; @@ -899,8 +1029,8 @@ /* Check for errors. */ if (dma) { info->dma = 0; - if ((dma_error = HWIF(drive)->dmaproc(ide_dma_end, drive))) - HWIF(drive)->dmaproc(ide_dma_off, drive); + if ((dma_error = HWIF(drive)->ide_dma_end(drive))) + HWIF(drive)->ide_dma_off(drive); } if (cdrom_decode_status (&startstop, drive, 0, &stat)) @@ -910,16 +1040,19 @@ if (!dma_error) { for (i = rq->nr_sectors; i > 0;) { i -= rq->current_nr_sectors; - ide_end_request(1, HWGROUP(drive)); + ide_cdrom_end_request(drive, 1); } return ide_stopped; } else - return ide_error (drive, "dma error", stat); + return DRIVER(drive)->error(drive, "dma error", stat); } /* Read the interrupt reason and the transfer length. */ - ireason = IN_BYTE (IDE_NSECTOR_REG); - len = IN_BYTE (IDE_LCYL_REG) + 256 * IN_BYTE (IDE_HCYL_REG); + ireason = HWIF(drive)->INB(IDE_IREASON_REG); + lowcyl = HWIF(drive)->INB(IDE_BCOUNTL_REG); + highcyl = HWIF(drive)->INB(IDE_BCOUNTH_REG); + + len = lowcyl + (256 * highcyl); /* If DRQ is clear, the command has completed. */ if ((stat & DRQ_STAT) == 0) { @@ -928,9 +1061,9 @@ if (rq->current_nr_sectors > 0) { printk ("%s: cdrom_read_intr: data underrun (%ld blocks)\n", drive->name, rq->current_nr_sectors); - cdrom_end_request (0, drive); + cdrom_end_request(drive, 0); } else - cdrom_end_request (1, drive); + cdrom_end_request(drive, 1); return ide_stopped; } @@ -944,13 +1077,13 @@ if ((len % SECTOR_SIZE) != 0) { printk ("%s: cdrom_read_intr: Bad transfer size %d\n", drive->name, len); - if (CDROM_CONFIG_FLAGS (drive)->limit_nframes) + if (CDROM_CONFIG_FLAGS(drive)->limit_nframes) printk (" This drive is not supported by this version of the driver\n"); else { printk (" Trying to limit transfer sizes\n"); - CDROM_CONFIG_FLAGS (drive)->limit_nframes = 1; + CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1; } - cdrom_end_request (0, drive); + cdrom_end_request(drive, 0); return ide_stopped; } @@ -965,7 +1098,7 @@ while (nskip > 0) { /* We need to throw away a sector. */ char dum[SECTOR_SIZE]; - atapi_input_bytes (drive, dum, sizeof (dum)); + HWIF(drive)->atapi_input_bytes(drive, dum, sizeof (dum)); --rq->current_nr_sectors; --nskip; @@ -979,7 +1112,7 @@ /* If we've filled the present buffer but there's another chained buffer after it, move on. */ if (rq->current_nr_sectors == 0 && rq->nr_sectors) - cdrom_end_request (1, drive); + cdrom_end_request(drive, 1); /* If the buffers are full, cache the rest of the data in our internal buffer. */ @@ -996,7 +1129,7 @@ /* Read this_transfer sectors into the current buffer. */ while (this_transfer > 0) { - atapi_input_bytes(drive, rq->buffer, SECTOR_SIZE); + HWIF(drive)->atapi_input_bytes(drive, rq->buffer, SECTOR_SIZE); rq->buffer += SECTOR_SIZE; --rq->nr_sectors; --rq->current_nr_sectors; @@ -1007,8 +1140,10 @@ } } - /* Done moving data! - Wait for another interrupt. */ + if (HWGROUP(drive)->handler != NULL) /* paranoia check */ + BUG(); + + /* Done moving data! Wait for another interrupt. */ ide_set_handler(drive, &cdrom_read_intr, WAIT_CMD, NULL); return ide_started; } @@ -1031,7 +1166,7 @@ rq->sector >= info->sector_buffered && rq->sector < info->sector_buffered + info->nsectors_buffered) { if (rq->current_nr_sectors == 0) - cdrom_end_request (1, drive); + cdrom_end_request(drive, 1); memcpy (rq->buffer, info->buffer + @@ -1046,13 +1181,13 @@ /* If we've satisfied the current request, terminate it successfully. */ if (rq->nr_sectors == 0) { - cdrom_end_request (1, drive); + cdrom_end_request(drive, 1); return -1; } /* Move on to the next buffer if needed. */ if (rq->current_nr_sectors == 0) - cdrom_end_request (1, drive); + cdrom_end_request(drive, 1); /* If this condition does not hold, then the kluge i use to represent the number of sectors to skip at the start of a transfer @@ -1060,9 +1195,9 @@ paranoid and check. */ if (rq->current_nr_sectors < (rq->bh->b_size >> SECTOR_BITS) && (rq->sector % SECTORS_PER_FRAME) != 0) { - printk ("%s: cdrom_read_from_buffer: buffer botch (%ld)\n", + printk("%s: cdrom_read_from_buffer: buffer botch (%ld)\n", drive->name, rq->sector); - cdrom_end_request (0, drive); + cdrom_end_request(drive, 0); return -1; } @@ -1101,7 +1236,7 @@ (rq->sector % CD_FRAMESIZE != 0)) { printk ("%s: cdrom_start_read_continuation: buffer botch (%lu)\n", drive->name, rq->current_nr_sectors); - cdrom_end_request (0, drive); + cdrom_end_request(drive, 0); return ide_stopped; } sector -= nskip; @@ -1147,7 +1282,7 @@ return startstop; CDROM_CONFIG_FLAGS(drive)->seeking = 1; - if (retry && jiffies - info->start_seek > IDECD_SEEK_TIMER) { + if (retry && time_after(jiffies, info->start_seek + IDECD_SEEK_TIMER)) { if (--retry == 0) { /* * this condition is far too common, to bother @@ -1189,7 +1324,7 @@ info->dma = 0; info->cmd = 0; info->start_seek = jiffies; - return cdrom_start_packet_command (drive, 0, cdrom_start_seek_continuation); + return cdrom_start_packet_command(drive, 0, cdrom_start_seek_continuation); } static inline int cdrom_merge_requests(struct request *rq, struct request *nxt) @@ -1263,7 +1398,7 @@ { struct cdrom_info *info = drive->driver_data; struct request *rq = HWGROUP(drive)->rq; - int minor = MINOR (rq->rq_dev); + int minor = MINOR(rq->rq_dev); /* If the request is relative to a partition, fix it up to refer to the absolute address. */ @@ -1313,14 +1448,18 @@ struct request *rq = HWGROUP(drive)->rq; struct packet_command *pc = (struct packet_command *)rq->buffer; ide_startstop_t startstop; + u8 lowcyl = 0, highcyl = 0; /* Check for errors. */ - if (cdrom_decode_status (&startstop, drive, 0, &stat)) + if (cdrom_decode_status(&startstop, drive, 0, &stat)) return startstop; /* Read the interrupt reason and the transfer length. */ - ireason = IN_BYTE (IDE_NSECTOR_REG); - len = IN_BYTE (IDE_LCYL_REG) + 256 * IN_BYTE (IDE_HCYL_REG); + ireason = HWIF(drive)->INB(IDE_IREASON_REG); + lowcyl = HWIF(drive)->INB(IDE_BCOUNTL_REG); + highcyl = HWIF(drive)->INB(IDE_BCOUNTH_REG); + + len = lowcyl + (256 * highcyl); /* If DRQ is clear, the command has completed. Complain if we still have data left to transfer. */ @@ -1337,7 +1476,7 @@ } if (pc->buflen == 0) - cdrom_end_request (1, drive); + cdrom_end_request(drive, 1); else { /* Comment this out, because this always happens right after a reset occurs, and it is annoying to @@ -1347,7 +1486,7 @@ drive->name, pc->buflen); */ pc->stat = 1; - cdrom_end_request (1, drive); + cdrom_end_request(drive, 1); } return ide_stopped; } @@ -1359,14 +1498,14 @@ /* The drive wants to be written to. */ if ((ireason & 3) == 0) { /* Transfer the data. */ - atapi_output_bytes (drive, pc->buffer, thislen); + HWIF(drive)->atapi_output_bytes(drive, pc->buffer, thislen); /* If we haven't moved enough data to satisfy the drive, add some padding. */ while (len > thislen) { int dum = 0; - atapi_output_bytes (drive, &dum, sizeof (dum)); - len -= sizeof (dum); + HWIF(drive)->atapi_output_bytes(drive, &dum, sizeof(dum)); + len -= sizeof(dum); } /* Keep count of how much data we've moved. */ @@ -1378,14 +1517,14 @@ else if ((ireason & 3) == 2) { /* Transfer the data. */ - atapi_input_bytes (drive, pc->buffer, thislen); + HWIF(drive)->atapi_input_bytes(drive, pc->buffer, thislen); /* If we haven't moved enough data to satisfy the drive, add some padding. */ while (len > thislen) { int dum = 0; - atapi_input_bytes (drive, &dum, sizeof (dum)); - len -= sizeof (dum); + HWIF(drive)->atapi_input_bytes(drive, &dum, sizeof(dum)); + len -= sizeof(dum); } /* Keep count of how much data we've moved. */ @@ -1398,8 +1537,11 @@ pc->stat = 1; } + if (HWGROUP(drive)->handler != NULL) + BUG(); + /* Now we wait for another interrupt. */ - ide_set_handler (drive, &cdrom_pc_intr, WAIT_CMD, cdrom_timer_expiry); + ide_set_handler(drive, &cdrom_pc_intr, WAIT_CMD, cdrom_timer_expiry); return ide_started; } @@ -1430,7 +1572,7 @@ len = pc->buflen; /* Start sending the command to the drive. */ - return cdrom_start_packet_command (drive, len, cdrom_do_pc_continuation); + return cdrom_start_packet_command(drive, len, cdrom_do_pc_continuation); } @@ -1462,7 +1604,7 @@ ide_init_drive_cmd (&req); req.cmd = PACKET_COMMAND; req.buffer = (char *)pc; - ide_do_drive_cmd (drive, &req, ide_wait); + ide_do_drive_cmd(drive, &req, ide_wait); /* FIXME: we should probably abort/retry or something * in case of failure */ if (pc->stat != 0) { @@ -1472,7 +1614,7 @@ struct request_sense *reqbuf = pc->sense; if (reqbuf->sense_key == UNIT_ATTENTION) - cdrom_saw_media_change (drive); + cdrom_saw_media_change(drive); else if (reqbuf->sense_key == NOT_READY && reqbuf->asc == 4 && reqbuf->ascq != 4) { /* The drive is in the process of loading @@ -1513,7 +1655,7 @@ and quit this request. */ while (len > 0) { int dum = 0; - atapi_output_bytes(drive, &dum, sizeof(dum)); + HWIF(drive)->atapi_output_bytes(drive, &dum, sizeof(dum)); len -= sizeof(dum); } } else { @@ -1522,7 +1664,7 @@ drive->name, ireason); } - cdrom_end_request(0, drive); + cdrom_end_request(drive, 0); return 1; } @@ -1531,6 +1673,7 @@ int stat, ireason, len, sectors_to_transfer, uptodate; struct cdrom_info *info = drive->driver_data; int i, dma_error = 0, dma = info->dma; + u8 lowcyl = 0, highcyl = 0; ide_startstop_t startstop; struct request *rq = HWGROUP(drive)->rq; @@ -1538,9 +1681,9 @@ /* Check for errors. */ if (dma) { info->dma = 0; - if ((dma_error = HWIF(drive)->dmaproc(ide_dma_end, drive))) { + if ((dma_error = HWIF(drive)->ide_dma_end(drive))) { printk("ide-cd: write dma error\n"); - HWIF(drive)->dmaproc(ide_dma_off, drive); + HWIF(drive)->ide_dma_off(drive); } } @@ -1554,19 +1697,22 @@ */ if (dma) { if (dma_error) - return ide_error(drive, "dma error", stat); + return DRIVER(drive)->error(drive, "dma error", stat); rq = HWGROUP(drive)->rq; for (i = rq->nr_sectors; i > 0;) { i -= rq->current_nr_sectors; - ide_end_request(1, HWGROUP(drive)); + ide_cdrom_end_request(drive, 1); } return ide_stopped; } /* Read the interrupt reason and the transfer length. */ - ireason = IN_BYTE(IDE_NSECTOR_REG); - len = IN_BYTE(IDE_LCYL_REG) + 256 * IN_BYTE(IDE_HCYL_REG); + ireason = HWIF(drive)->INB(IDE_IREASON_REG); + lowcyl = HWIF(drive)->INB(IDE_BCOUNTL_REG); + highcyl = HWIF(drive)->INB(IDE_BCOUNTH_REG); + + len = lowcyl + (256 * highcyl); /* If DRQ is clear, the command has completed. */ if ((stat & DRQ_STAT) == 0) { @@ -1579,7 +1725,7 @@ drive->name, rq->current_nr_sectors); uptodate = 0; } - cdrom_end_request(uptodate, drive); + cdrom_end_request(drive, uptodate); return ide_stopped; } @@ -1607,7 +1753,7 @@ this_transfer = MIN(sectors_to_transfer,rq->current_nr_sectors); while (this_transfer > 0) { - atapi_output_bytes(drive, rq->buffer, SECTOR_SIZE); + HWIF(drive)->atapi_output_bytes(drive, rq->buffer, SECTOR_SIZE); rq->buffer += SECTOR_SIZE; --rq->nr_sectors; --rq->current_nr_sectors; @@ -1620,9 +1766,12 @@ * current buffer complete, move on */ if (rq->current_nr_sectors == 0 && rq->nr_sectors) - cdrom_end_request (1, drive); + cdrom_end_request(drive, 1); } + if (HWGROUP(drive)->handler != NULL) /* paranoia check */ + BUG(); + /* re-arm handler */ ide_set_handler(drive, &cdrom_write_intr, 5 * WAIT_CMD, NULL); return ide_started; @@ -1662,7 +1811,7 @@ * writes *must* be 2kB frame aligned */ if ((rq->nr_sectors & 3) || (rq->sector & 3)) { - cdrom_end_request(0, drive); + cdrom_end_request(drive, 0); return ide_stopped; } @@ -1698,11 +1847,10 @@ case WRITE: case READ: { if (CDROM_CONFIG_FLAGS(drive)->seeking) { - unsigned long elpased = jiffies - info->start_seek; - int stat = GET_STAT(); + int stat = HWIF(drive)->INB(IDE_STATUS_REG); if ((stat & SEEK_STAT) != SEEK_STAT) { - if (elpased < IDECD_SEEK_TIMEOUT) { + if (time_before(jiffies, info->start_seek + IDECD_SEEK_TIMEOUT)) { ide_stall_queue(drive, IDECD_SEEK_TIMER); return ide_stopped; } @@ -1711,7 +1859,7 @@ CDROM_CONFIG_FLAGS(drive)->seeking = 0; } if (IDE_LARGE_SEEK(info->last_block, block, IDECD_SEEK_THRESHOLD) && drive->dsc_overlap) - action = cdrom_start_seek (drive, block); + action = cdrom_start_seek(drive, block); else { if (rq->cmd == READ) action = cdrom_start_read(drive, block); @@ -1728,13 +1876,13 @@ } case RESET_DRIVE_COMMAND: { - cdrom_end_request(1, drive); + cdrom_end_request(drive, 1); return ide_do_reset(drive); } default: { printk("ide-cd: bad cmd %d\n", rq->cmd); - cdrom_end_request(0, drive); + cdrom_end_request(drive, 0); return ide_stopped; } } @@ -1836,7 +1984,7 @@ pc.sense = sense; pc.c[0] = GPCMD_PREVENT_ALLOW_MEDIUM_REMOVAL; pc.c[4] = lockflag ? 1 : 0; - stat = cdrom_queue_packet_command (drive, &pc); + stat = cdrom_queue_packet_command(drive, &pc); } /* If we got an illegal field error, the drive @@ -1846,7 +1994,7 @@ (sense->asc == 0x24 || sense->asc == 0x20)) { printk ("%s: door locking not supported\n", drive->name); - CDROM_CONFIG_FLAGS (drive)->no_doorlock = 1; + CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1; stat = 0; } @@ -1855,7 +2003,7 @@ stat = 0; if (stat == 0) - CDROM_STATE_FLAGS (drive)->door_locked = lockflag; + CDROM_STATE_FLAGS(drive)->door_locked = lockflag; return stat; } @@ -1880,7 +2028,7 @@ pc.c[0] = GPCMD_START_STOP_UNIT; pc.c[4] = 0x02 + (ejectflag != 0); - return cdrom_queue_packet_command (drive, &pc); + return cdrom_queue_packet_command(drive, &pc); } static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, @@ -1929,7 +2077,7 @@ if (msf_flag) pc.c[1] = 2; - return cdrom_queue_packet_command (drive, &pc); + return cdrom_queue_packet_command(drive, &pc); } @@ -1969,9 +2117,9 @@ if (stat) return stat; #if ! STANDARD_ATAPI - if (CDROM_CONFIG_FLAGS (drive)->toctracks_as_bcd) { - toc->hdr.first_track = bcd2bin (toc->hdr.first_track); - toc->hdr.last_track = bcd2bin (toc->hdr.last_track); + if (CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd) { + toc->hdr.first_track = bcd2bin(toc->hdr.first_track); + toc->hdr.last_track = bcd2bin(toc->hdr.last_track); } #endif /* not STANDARD_ATAPI */ @@ -2009,7 +2157,7 @@ return stat; } #if ! STANDARD_ATAPI - if (CDROM_CONFIG_FLAGS (drive)->toctracks_as_bcd) { + if (CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd) { toc->hdr.first_track = bin2bcd(CDROM_LEADOUT); toc->hdr.last_track = bin2bcd(CDROM_LEADOUT); } else @@ -2026,18 +2174,18 @@ toc->hdr.toc_length = ntohs (toc->hdr.toc_length); #if ! STANDARD_ATAPI - if (CDROM_CONFIG_FLAGS (drive)->toctracks_as_bcd) { - toc->hdr.first_track = bcd2bin (toc->hdr.first_track); - toc->hdr.last_track = bcd2bin (toc->hdr.last_track); + if (CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd) { + toc->hdr.first_track = bcd2bin(toc->hdr.first_track); + toc->hdr.last_track = bcd2bin(toc->hdr.last_track); } #endif /* not STANDARD_ATAPI */ for (i=0; i<=ntracks; i++) { #if ! STANDARD_ATAPI - if (CDROM_CONFIG_FLAGS (drive)->tocaddr_as_bcd) { - if (CDROM_CONFIG_FLAGS (drive)->toctracks_as_bcd) - toc->ent[i].track = bcd2bin (toc->ent[i].track); - msf_from_bcd (&toc->ent[i].addr.msf); + if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd) { + if (CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd) + toc->ent[i].track = bcd2bin(toc->ent[i].track); + msf_from_bcd(&toc->ent[i].addr.msf); } #endif /* not STANDARD_ATAPI */ toc->ent[i].addr.lba = msf_to_lba (toc->ent[i].addr.msf.minute, @@ -2059,7 +2207,7 @@ } #if ! STANDARD_ATAPI - if (CDROM_CONFIG_FLAGS (drive)->tocaddr_as_bcd) + if (CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd) msf_from_bcd (&ms_tmp.ent.addr.msf); #endif /* not STANDARD_ATAPI */ @@ -2082,7 +2230,7 @@ drive->part[0].nr_sects = toc->capacity * SECTORS_PER_FRAME; /* Remember that we've read this stuff. */ - CDROM_STATE_FLAGS (drive)->toc_valid = 1; + CDROM_STATE_FLAGS(drive)->toc_valid = 1; return 0; } @@ -2306,7 +2454,7 @@ struct cdrom_tocentry *tocentry = (struct cdrom_tocentry*) arg; struct atapi_toc_entry *toce; - stat = cdrom_get_toc_entry (drive, tocentry->cdte_track, &toce); + stat = cdrom_get_toc_entry(drive, tocentry->cdte_track, &toce); if (stat) return stat; tocentry->cdte_ctrl = toce->control; @@ -2378,10 +2526,10 @@ struct request_sense sense; int stat; - if ((stat = cdrom_select_speed (drive, speed, &sense)) < 0) + if ((stat = cdrom_select_speed(drive, speed, &sense)) < 0) return stat; - cdi->speed = CDROM_STATE_FLAGS (drive)->current_speed; + cdi->speed = CDROM_STATE_FLAGS(drive)->current_speed; return 0; } @@ -2474,8 +2622,8 @@ if (slot_nr == CDSL_CURRENT) { (void) cdrom_check_status(drive, NULL); - retval = CDROM_STATE_FLAGS (drive)->media_changed; - CDROM_STATE_FLAGS (drive)->media_changed = 0; + retval = CDROM_STATE_FLAGS(drive)->media_changed; + CDROM_STATE_FLAGS(drive)->media_changed = 0; return retval; } else { return -EINVAL; @@ -2533,30 +2681,30 @@ struct cdrom_device_info *devinfo = &info->devinfo; int minor = (drive->select.b.unit) << PARTN_BITS; - devinfo->dev = MKDEV (HWIF(drive)->major, minor); + devinfo->dev = MKDEV(HWIF(drive)->major, minor); devinfo->ops = &ide_cdrom_dops; devinfo->mask = 0; - devinfo->speed = CDROM_STATE_FLAGS (drive)->current_speed; + devinfo->speed = CDROM_STATE_FLAGS(drive)->current_speed; devinfo->capacity = nslots; devinfo->handle = (void *) drive; strcpy(devinfo->name, drive->name); /* set capability mask to match the probe. */ - if (!CDROM_CONFIG_FLAGS (drive)->cd_r) + if (!CDROM_CONFIG_FLAGS(drive)->cd_r) devinfo->mask |= CDC_CD_R; - if (!CDROM_CONFIG_FLAGS (drive)->cd_rw) + if (!CDROM_CONFIG_FLAGS(drive)->cd_rw) devinfo->mask |= CDC_CD_RW; - if (!CDROM_CONFIG_FLAGS (drive)->dvd) + if (!CDROM_CONFIG_FLAGS(drive)->dvd) devinfo->mask |= CDC_DVD; - if (!CDROM_CONFIG_FLAGS (drive)->dvd_r) + if (!CDROM_CONFIG_FLAGS(drive)->dvd_r) devinfo->mask |= CDC_DVD_R; - if (!CDROM_CONFIG_FLAGS (drive)->dvd_ram) + if (!CDROM_CONFIG_FLAGS(drive)->dvd_ram) devinfo->mask |= CDC_DVD_RAM; - if (!CDROM_CONFIG_FLAGS (drive)->is_changer) + if (!CDROM_CONFIG_FLAGS(drive)->is_changer) devinfo->mask |= CDC_SELECT_DISC; - if (!CDROM_CONFIG_FLAGS (drive)->audio_play) + if (!CDROM_CONFIG_FLAGS(drive)->audio_play) devinfo->mask |= CDC_PLAY_AUDIO; - if (!CDROM_CONFIG_FLAGS (drive)->close_tray) + if (!CDROM_CONFIG_FLAGS(drive)->close_tray) devinfo->mask |= CDC_CLOSE_TRAY; devinfo->de = devfs_register(drive->de, "cd", DEVFS_FL_DEFAULT, @@ -2610,9 +2758,9 @@ struct atapi_capabilities_page cap; int nslots = 1; - if (CDROM_CONFIG_FLAGS (drive)->nec260) { - CDROM_CONFIG_FLAGS (drive)->no_eject = 0; - CDROM_CONFIG_FLAGS (drive)->audio_play = 1; + if (CDROM_CONFIG_FLAGS(drive)->nec260) { + CDROM_CONFIG_FLAGS(drive)->no_eject = 0; + CDROM_CONFIG_FLAGS(drive)->audio_play = 1; return nslots; } @@ -2620,38 +2768,38 @@ return 0; if (cap.lock == 0) - CDROM_CONFIG_FLAGS (drive)->no_doorlock = 1; + CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1; if (cap.eject) - CDROM_CONFIG_FLAGS (drive)->no_eject = 0; + CDROM_CONFIG_FLAGS(drive)->no_eject = 0; if (cap.cd_r_write) - CDROM_CONFIG_FLAGS (drive)->cd_r = 1; + CDROM_CONFIG_FLAGS(drive)->cd_r = 1; if (cap.cd_rw_write) - CDROM_CONFIG_FLAGS (drive)->cd_rw = 1; + CDROM_CONFIG_FLAGS(drive)->cd_rw = 1; if (cap.test_write) - CDROM_CONFIG_FLAGS (drive)->test_write = 1; + CDROM_CONFIG_FLAGS(drive)->test_write = 1; if (cap.dvd_ram_read || cap.dvd_r_read || cap.dvd_rom) - CDROM_CONFIG_FLAGS (drive)->dvd = 1; + CDROM_CONFIG_FLAGS(drive)->dvd = 1; if (cap.dvd_ram_write) - CDROM_CONFIG_FLAGS (drive)->dvd_ram = 1; + CDROM_CONFIG_FLAGS(drive)->dvd_ram = 1; if (cap.dvd_r_write) - CDROM_CONFIG_FLAGS (drive)->dvd_r = 1; + CDROM_CONFIG_FLAGS(drive)->dvd_r = 1; if (cap.audio_play) - CDROM_CONFIG_FLAGS (drive)->audio_play = 1; + CDROM_CONFIG_FLAGS(drive)->audio_play = 1; if (cap.mechtype == mechtype_caddy || cap.mechtype == mechtype_popup) - CDROM_CONFIG_FLAGS (drive)->close_tray = 0; + CDROM_CONFIG_FLAGS(drive)->close_tray = 0; /* Some drives used by Apple don't advertise audio play * but they do support reading TOC & audio datas */ - if (strcmp (drive->id->model, "MATSHITADVD-ROM SR-8187") == 0 || - strcmp (drive->id->model, "MATSHITADVD-ROM SR-8186") == 0 || - strcmp (drive->id->model, "MATSHITADVD-ROM SR-8176") == 0 || - strcmp (drive->id->model, "MATSHITADVD-ROM SR-8174") == 0) - CDROM_CONFIG_FLAGS (drive)->audio_play = 1; + if (strcmp(drive->id->model, "MATSHITADVD-ROM SR-8187") == 0 || + strcmp(drive->id->model, "MATSHITADVD-ROM SR-8186") == 0 || + strcmp(drive->id->model, "MATSHITADVD-ROM SR-8176") == 0 || + strcmp(drive->id->model, "MATSHITADVD-ROM SR-8174") == 0) + CDROM_CONFIG_FLAGS(drive)->audio_play = 1; #if ! STANDARD_ATAPI if (cdi->sanyo_slot > 0) { - CDROM_CONFIG_FLAGS (drive)->is_changer = 1; + CDROM_CONFIG_FLAGS(drive)->is_changer = 1; nslots = 3; } @@ -2660,21 +2808,22 @@ if (cap.mechtype == mechtype_individual_changer || cap.mechtype == mechtype_cartridge_changer) { if ((nslots = cdrom_number_of_slots(cdi)) > 1) { - CDROM_CONFIG_FLAGS (drive)->is_changer = 1; - CDROM_CONFIG_FLAGS (drive)->supp_disc_present = 1; + CDROM_CONFIG_FLAGS(drive)->is_changer = 1; + CDROM_CONFIG_FLAGS(drive)->supp_disc_present = 1; } } /* The ACER/AOpen 24X cdrom has the speed fields byte-swapped */ - if (drive->id && !drive->id->model[0] && !strncmp(drive->id->fw_rev, "241N", 4)) { - CDROM_STATE_FLAGS (drive)->current_speed = + if (drive->id && !drive->id->model[0] && + !strncmp(drive->id->fw_rev, "241N", 4)) { + CDROM_STATE_FLAGS(drive)->current_speed = (((unsigned int)cap.curspeed) + (176/2)) / 176; - CDROM_CONFIG_FLAGS (drive)->max_speed = + CDROM_CONFIG_FLAGS(drive)->max_speed = (((unsigned int)cap.maxspeed) + (176/2)) / 176; } else { - CDROM_STATE_FLAGS (drive)->current_speed = + CDROM_STATE_FLAGS(drive)->current_speed = (ntohs(cap.curspeed) + (176/2)) / 176; - CDROM_CONFIG_FLAGS (drive)->max_speed = + CDROM_CONFIG_FLAGS(drive)->max_speed = (ntohs(cap.maxspeed) + (176/2)) / 176; } @@ -2685,26 +2834,26 @@ printk(" %dX", CDROM_CONFIG_FLAGS(drive)->max_speed); printk(" %s", CDROM_CONFIG_FLAGS(drive)->dvd ? "DVD-ROM" : "CD-ROM"); - if (CDROM_CONFIG_FLAGS (drive)->dvd_r|CDROM_CONFIG_FLAGS (drive)->dvd_ram) - printk (" DVD%s%s", - (CDROM_CONFIG_FLAGS (drive)->dvd_r)? "-R" : "", - (CDROM_CONFIG_FLAGS (drive)->dvd_ram)? "-RAM" : ""); - - if (CDROM_CONFIG_FLAGS (drive)->cd_r|CDROM_CONFIG_FLAGS (drive)->cd_rw) - printk (" CD%s%s", - (CDROM_CONFIG_FLAGS (drive)->cd_r)? "-R" : "", - (CDROM_CONFIG_FLAGS (drive)->cd_rw)? "/RW" : ""); + if (CDROM_CONFIG_FLAGS(drive)->dvd_r|CDROM_CONFIG_FLAGS(drive)->dvd_ram) + printk(" DVD%s%s", + (CDROM_CONFIG_FLAGS(drive)->dvd_r)? "-R" : "", + (CDROM_CONFIG_FLAGS(drive)->dvd_ram)? "-RAM" : ""); + + if (CDROM_CONFIG_FLAGS(drive)->cd_r|CDROM_CONFIG_FLAGS(drive)->cd_rw) + printk(" CD%s%s", + (CDROM_CONFIG_FLAGS(drive)->cd_r)? "-R" : "", + (CDROM_CONFIG_FLAGS(drive)->cd_rw)? "/RW" : ""); - if (CDROM_CONFIG_FLAGS (drive)->is_changer) - printk (" changer w/%d slots", nslots); + if (CDROM_CONFIG_FLAGS(drive)->is_changer) + printk(" changer w/%d slots", nslots); else - printk (" drive"); + printk(" drive"); - printk (", %dkB Cache", be16_to_cpu(cap.buffer_size)); + printk(", %dkB Cache", be16_to_cpu(cap.buffer_size)); #ifdef CONFIG_BLK_DEV_IDEDMA if (drive->using_dma) - (void) HWIF(drive)->dmaproc(ide_dma_verbose, drive); + (void) HWIF(drive)->ide_dma_verbose(drive); #endif /* CONFIG_BLK_DEV_IDEDMA */ printk("\n"); @@ -2739,42 +2888,42 @@ drive->special.all = 0; drive->ready_stat = 0; - CDROM_STATE_FLAGS (drive)->media_changed = 1; - CDROM_STATE_FLAGS (drive)->toc_valid = 0; - CDROM_STATE_FLAGS (drive)->door_locked = 0; + CDROM_STATE_FLAGS(drive)->media_changed = 1; + CDROM_STATE_FLAGS(drive)->toc_valid = 0; + CDROM_STATE_FLAGS(drive)->door_locked = 0; #if NO_DOOR_LOCKING - CDROM_CONFIG_FLAGS (drive)->no_doorlock = 1; + CDROM_CONFIG_FLAGS(drive)->no_doorlock = 1; #else - CDROM_CONFIG_FLAGS (drive)->no_doorlock = 0; + CDROM_CONFIG_FLAGS(drive)->no_doorlock = 0; #endif if (drive->id != NULL) - CDROM_CONFIG_FLAGS (drive)->drq_interrupt = + CDROM_CONFIG_FLAGS(drive)->drq_interrupt = ((drive->id->config & 0x0060) == 0x20); else - CDROM_CONFIG_FLAGS (drive)->drq_interrupt = 0; + CDROM_CONFIG_FLAGS(drive)->drq_interrupt = 0; - CDROM_CONFIG_FLAGS (drive)->is_changer = 0; - CDROM_CONFIG_FLAGS (drive)->cd_r = 0; - CDROM_CONFIG_FLAGS (drive)->cd_rw = 0; - CDROM_CONFIG_FLAGS (drive)->test_write = 0; - CDROM_CONFIG_FLAGS (drive)->dvd = 0; - CDROM_CONFIG_FLAGS (drive)->dvd_r = 0; - CDROM_CONFIG_FLAGS (drive)->dvd_ram = 0; - CDROM_CONFIG_FLAGS (drive)->no_eject = 1; - CDROM_CONFIG_FLAGS (drive)->supp_disc_present = 0; - CDROM_CONFIG_FLAGS (drive)->audio_play = 0; - CDROM_CONFIG_FLAGS (drive)->close_tray = 1; + CDROM_CONFIG_FLAGS(drive)->is_changer = 0; + CDROM_CONFIG_FLAGS(drive)->cd_r = 0; + CDROM_CONFIG_FLAGS(drive)->cd_rw = 0; + CDROM_CONFIG_FLAGS(drive)->test_write = 0; + CDROM_CONFIG_FLAGS(drive)->dvd = 0; + CDROM_CONFIG_FLAGS(drive)->dvd_r = 0; + CDROM_CONFIG_FLAGS(drive)->dvd_ram = 0; + CDROM_CONFIG_FLAGS(drive)->no_eject = 1; + CDROM_CONFIG_FLAGS(drive)->supp_disc_present = 0; + CDROM_CONFIG_FLAGS(drive)->audio_play = 0; + CDROM_CONFIG_FLAGS(drive)->close_tray = 1; /* limit transfer size per interrupt. */ - CDROM_CONFIG_FLAGS (drive)->limit_nframes = 0; + CDROM_CONFIG_FLAGS(drive)->limit_nframes = 0; if (drive->id != NULL) { /* a testament to the nice quality of Samsung drives... */ if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-2430")) - CDROM_CONFIG_FLAGS (drive)->limit_nframes = 1; + CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1; else if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-2432")) - CDROM_CONFIG_FLAGS (drive)->limit_nframes = 1; + CDROM_CONFIG_FLAGS(drive)->limit_nframes = 1; /* the 3231 model does not support the SET_CD_SPEED command */ else if (!strcmp(drive->id->model, "SAMSUNG CD-ROM SCR-3231")) cdi->mask |= CDC_SELECT_SPEED; @@ -2785,11 +2934,11 @@ ATAPI Rev 2.2+ standard support for CD changers is used */ cdi->sanyo_slot = 0; - CDROM_CONFIG_FLAGS (drive)->nec260 = 0; - CDROM_CONFIG_FLAGS (drive)->toctracks_as_bcd = 0; - CDROM_CONFIG_FLAGS (drive)->tocaddr_as_bcd = 0; - CDROM_CONFIG_FLAGS (drive)->playmsf_as_bcd = 0; - CDROM_CONFIG_FLAGS (drive)->subchan_as_bcd = 0; + CDROM_CONFIG_FLAGS(drive)->nec260 = 0; + CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd = 0; + CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd = 0; + CDROM_CONFIG_FLAGS(drive)->playmsf_as_bcd = 0; + CDROM_CONFIG_FLAGS(drive)->subchan_as_bcd = 0; if (drive->id != NULL) { if (strcmp (drive->id->model, "V003S0DS") == 0 && @@ -2797,36 +2946,36 @@ drive->id->fw_rev[6] <= '2') { /* Vertos 300. Some versions of this drive like to talk BCD. */ - CDROM_CONFIG_FLAGS (drive)->toctracks_as_bcd = 1; - CDROM_CONFIG_FLAGS (drive)->tocaddr_as_bcd = 1; - CDROM_CONFIG_FLAGS (drive)->playmsf_as_bcd = 1; - CDROM_CONFIG_FLAGS (drive)->subchan_as_bcd = 1; + CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd = 1; + CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd = 1; + CDROM_CONFIG_FLAGS(drive)->playmsf_as_bcd = 1; + CDROM_CONFIG_FLAGS(drive)->subchan_as_bcd = 1; } else if (strcmp (drive->id->model, "V006E0DS") == 0 && drive->id->fw_rev[4] == '1' && drive->id->fw_rev[6] <= '2') { /* Vertos 600 ESD. */ - CDROM_CONFIG_FLAGS (drive)->toctracks_as_bcd = 1; + CDROM_CONFIG_FLAGS(drive)->toctracks_as_bcd = 1; } - else if (strcmp (drive->id->model, + else if (strcmp(drive->id->model, "NEC CD-ROM DRIVE:260") == 0 && - strncmp (drive->id->fw_rev, "1.01", 4) == 0) { /* FIXME */ + strncmp(drive->id->fw_rev, "1.01", 4) == 0) { /* FIXME */ /* Old NEC260 (not R). This drive was released before the 1.2 version of the spec. */ - CDROM_CONFIG_FLAGS (drive)->tocaddr_as_bcd = 1; - CDROM_CONFIG_FLAGS (drive)->playmsf_as_bcd = 1; - CDROM_CONFIG_FLAGS (drive)->subchan_as_bcd = 1; - CDROM_CONFIG_FLAGS (drive)->nec260 = 1; + CDROM_CONFIG_FLAGS(drive)->tocaddr_as_bcd = 1; + CDROM_CONFIG_FLAGS(drive)->playmsf_as_bcd = 1; + CDROM_CONFIG_FLAGS(drive)->subchan_as_bcd = 1; + CDROM_CONFIG_FLAGS(drive)->nec260 = 1; } - else if (strcmp (drive->id->model, "WEARNES CDD-120") == 0 && - strncmp (drive->id->fw_rev, "A1.1", 4) == 0) { /* FIXME */ + else if (strcmp(drive->id->model, "WEARNES CDD-120") == 0 && + strncmp(drive->id->fw_rev, "A1.1", 4) == 0) { /* FIXME */ /* Wearnes */ - CDROM_CONFIG_FLAGS (drive)->playmsf_as_bcd = 1; - CDROM_CONFIG_FLAGS (drive)->subchan_as_bcd = 1; + CDROM_CONFIG_FLAGS(drive)->playmsf_as_bcd = 1; + CDROM_CONFIG_FLAGS(drive)->subchan_as_bcd = 1; } /* Sanyo 3 CD changer uses a non-standard command @@ -2855,7 +3004,16 @@ if (CDROM_CONFIG_FLAGS(drive)->dvd_ram) set_device_ro(MKDEV(HWIF(drive)->major, minor), 0); - if (ide_cdrom_register (drive, nslots)) { +#if 0 + drive->dsc_overlap = (HWIF(drive)->no_dsc) ? 0 : 1; + if (HWIF(drive)->no_dsc) { + printk(KERN_INFO "ide-cd: %s: disabling DSC overlap\n", + drive->name); + drive->dsc_overlap = 0; + } +#endif + + if (ide_cdrom_register(drive, nslots)) { printk ("%s: ide_cdrom_setup failed to register device with the cdrom driver.\n", drive->name); info->devinfo.handle = NULL; return 1; @@ -2870,7 +3028,7 @@ struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - return cdrom_ioctl (inode, file, cmd, arg); + return cdrom_ioctl(inode, file, cmd, arg); } static @@ -2900,7 +3058,7 @@ static int ide_cdrom_check_media_change (ide_drive_t *drive) { - return cdrom_media_changed(MKDEV (HWIF (drive)->major, + return cdrom_media_changed(MKDEV (HWIF(drive)->major, (drive->select.b.unit) << PARTN_BITS)); } @@ -2948,35 +3106,47 @@ struct cdrom_info *info = drive->driver_data; struct cdrom_device_info *devinfo = &info->devinfo; - if (ide_unregister_subdriver (drive)) + if (ide_unregister_subdriver(drive)) { + printk("%s: %s: failed to ide_unregister_subdriver\n", + __FUNCTION__, drive->name); return 1; + } if (info->buffer != NULL) kfree(info->buffer); if (info->toc != NULL) kfree(info->toc); if (info->changer_info != NULL) kfree(info->changer_info); - if (devinfo->handle == drive && unregister_cdrom (devinfo)) - printk ("%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name); + if (devinfo->handle == drive && unregister_cdrom(devinfo)) + printk("%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name); kfree(info); drive->driver_data = NULL; return 0; } -int ide_cdrom_reinit (ide_drive_t *drive); +int ide_cdrom_init(void); +int ide_cdrom_attach (ide_drive_t *drive); static ide_driver_t ide_cdrom_driver = { name: "ide-cdrom", version: IDECD_VERSION, media: ide_cdrom, busy: 0, +#ifdef CONFIG_IDEDMA_ONLYDISK + supports_dma: 0, +#else supports_dma: 1, +#endif supports_dsc_overlap: 1, cleanup: ide_cdrom_cleanup, standby: NULL, + suspend: NULL, + resume: NULL, flushcache: NULL, do_request: ide_do_rw_cdrom, - end_request: NULL, + end_request: ide_cdrom_end_request, + sense: ide_cdrom_dump_status, + error: ide_cdrom_error, ioctl: ide_cdrom_ioctl, open: ide_cdrom_open, release: ide_cdrom_release, @@ -2986,12 +3156,12 @@ capacity: ide_cdrom_capacity, special: NULL, proc: NULL, - reinit: ide_cdrom_reinit, + init: ide_cdrom_init, + attach: ide_cdrom_attach, ata_prebuilder: NULL, atapi_prebuilder: NULL, }; -int ide_cdrom_init(void); static ide_module_t ide_cdrom_module = { IDE_DRIVER_MODULE, ide_cdrom_init, @@ -3005,35 +3175,46 @@ MODULE_PARM(ignore, "s"); MODULE_DESCRIPTION("ATAPI CD-ROM Driver"); -int ide_cdrom_reinit (ide_drive_t *drive) +int ide_cdrom_attach (ide_drive_t *drive) { struct cdrom_info *info; int failed = 0; + if (drive->scsi) { + printk("ide-cd: passing drive %s to ide-scsi emulation.\n", + drive->name); + return 1; + } + MOD_INC_USE_COUNT; info = (struct cdrom_info *) kmalloc (sizeof (struct cdrom_info), GFP_KERNEL); if (info == NULL) { - printk ("%s: Can't allocate a cdrom structure\n", drive->name); + printk("%s: Can't allocate a cdrom structure\n", drive->name); + MOD_DEC_USE_COUNT; return 1; } - if (ide_register_subdriver (drive, &ide_cdrom_driver, IDE_SUBDRIVER_VERSION)) { - printk ("%s: Failed to register the driver with ide.c\n", drive->name); - kfree (info); + if (ide_register_subdriver(drive, + &ide_cdrom_driver, IDE_SUBDRIVER_VERSION)) { + printk(KERN_ERR "ide-cd: %s: Failed to register the driver " + "with ide.c\n", drive->name); + kfree(info); + MOD_DEC_USE_COUNT; return 1; } - memset (info, 0, sizeof (struct cdrom_info)); + memset(info, 0, sizeof(struct cdrom_info)); drive->driver_data = info; DRIVER(drive)->busy++; - if (ide_cdrom_setup (drive)) { + if (ide_cdrom_setup(drive)) { DRIVER(drive)->busy--; - if (ide_cdrom_cleanup (drive)) - printk ("%s: ide_cdrom_cleanup failed in ide_cdrom_init\n", drive->name); + if (ide_cdrom_cleanup(drive)) + printk("%s: ide_cdrom_cleanup failed in " + "ide_cdrom_init\n", drive->name); + MOD_DEC_USE_COUNT; return 1; } DRIVER(drive)->busy--; failed--; - ide_register_module(&ide_cdrom_module); MOD_DEC_USE_COUNT; return 0; } @@ -3043,41 +3224,51 @@ ide_drive_t *drive; int failed = 0; - while ((drive = ide_scan_devices (ide_cdrom, ide_cdrom_driver.name, &ide_cdrom_driver, failed)) != NULL) - if (ide_cdrom_cleanup (drive)) { - printk ("%s: cleanup_module() called while still busy\n", drive->name); + while ((drive = ide_scan_devices(ide_cdrom, ide_cdrom_driver.name, + &ide_cdrom_driver, failed)) != NULL) + if (ide_cdrom_cleanup(drive)) { + printk("%s: cleanup_module() called while still " + "busy\n", drive->name); failed++; } - ide_unregister_module (&ide_cdrom_module); + ide_unregister_module(&ide_cdrom_module); } - + int ide_cdrom_init(void) { +#ifdef CLASSIC_BUILTINS_METHOD ide_drive_t *drive; struct cdrom_info *info; int failed = 0; - +#endif /* CLASSIC_BUILTINS_METHOD */ MOD_INC_USE_COUNT; - while ((drive = ide_scan_devices (ide_cdrom, ide_cdrom_driver.name, NULL, failed++)) != NULL) { +#ifdef CLASSIC_BUILTINS_METHOD + while ((drive = ide_scan_devices(ide_cdrom, + ide_cdrom_driver.name, NULL, failed++)) != NULL) { /* skip drives that we were told to ignore */ if (ignore != NULL) { if (strstr(ignore, drive->name)) { - printk("ide-cd: ignoring drive %s\n", drive->name); + printk("ide-cd: ignoring drive %s\n", + drive->name); continue; } } if (drive->scsi) { - printk("ide-cd: passing drive %s to ide-scsi emulation.\n", drive->name); + printk("ide-cd: passing drive %s to ide-scsi " + "emulation.\n", drive->name); continue; } info = (struct cdrom_info *) kmalloc (sizeof (struct cdrom_info), GFP_KERNEL); if (info == NULL) { - printk ("%s: Can't allocate a cdrom structure\n", drive->name); + printk ("%s: Can't allocate a cdrom structure\n", + drive->name); continue; } - if (ide_register_subdriver (drive, &ide_cdrom_driver, IDE_SUBDRIVER_VERSION)) { - printk ("%s: Failed to register the driver with ide.c\n", drive->name); - kfree (info); + if (ide_register_subdriver(drive, + &ide_cdrom_driver, IDE_SUBDRIVER_VERSION)) { + printk("%s: Failed to register the driver with " + "ide.c\n", drive->name); + kfree(info); continue; } memset (info, 0, sizeof (struct cdrom_info)); @@ -3086,12 +3277,14 @@ if (ide_cdrom_setup (drive)) { DRIVER(drive)->busy--; if (ide_cdrom_cleanup (drive)) - printk ("%s: ide_cdrom_cleanup failed in ide_cdrom_init\n", drive->name); + printk ("%s: ide_cdrom_cleanup failed in " + "ide_cdrom_init\n", drive->name); continue; } DRIVER(drive)->busy--; failed--; } +#endif /* CLASSIC_BUILTINS_METHOD */ ide_register_module(&ide_cdrom_module); MOD_DEC_USE_COUNT; return 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-cs.c linux.20pre5-ac2/drivers/ide/ide-cs.c --- linux.20pre5/drivers/ide/ide-cs.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-cs.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,492 +0,0 @@ -/*====================================================================== - - A driver for PCMCIA IDE/ATA disk cards - - ide_cs.c 1.26 1999/11/16 02:10:49 - - The contents of this file are subject to the Mozilla Public - License Version 1.1 (the "License"); you may not use this file - except in compliance with the License. You may obtain a copy of - the License at http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS - IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - implied. See the License for the specific language governing - rights and limitations under the License. - - The initial developer of the original code is David A. Hinds - . Portions created by David A. Hinds - are Copyright (C) 1999 David A. Hinds. All Rights Reserved. - - Alternatively, the contents of this file may be used under the - terms of the GNU General Public License version 2 (the "GPL"), in which - case the provisions of the GPL are applicable instead of the - above. If you wish to allow the use of your version of this file - only under the terms of the GPL and not to allow others to use - your version of this file under the MPL, indicate your decision - by deleting the provisions above and replace them with the notice - and other provisions required by the GPL. If you do not delete - the provisions above, a recipient may use your version of this - file under either the MPL or the GPL. - -======================================================================*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#ifdef PCMCIA_DEBUG -static int pc_debug = PCMCIA_DEBUG; -MODULE_PARM(pc_debug, "i"); -#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) -static char *version = -"ide_cs.c 1.26 1999/11/16 02:10:49 (David Hinds)"; -#else -#define DEBUG(n, args...) -#endif - -/*====================================================================*/ - -/* Parameters that can be set with 'insmod' */ - -/* Bit map of interrupts to choose from */ -static u_int irq_mask = 0xdeb8; -static int irq_list[4] = { -1 }; - -MODULE_PARM(irq_mask, "i"); -MODULE_PARM(irq_list, "1-4i"); - -MODULE_LICENSE("GPL"); - - -/*====================================================================*/ - -static const char ide_major[] = { - IDE0_MAJOR, IDE1_MAJOR, IDE2_MAJOR, IDE3_MAJOR, -#ifdef IDE4_MAJOR - IDE4_MAJOR, IDE5_MAJOR -#endif -}; - -typedef struct ide_info_t { - dev_link_t link; - int ndev; - dev_node_t node; - int hd; -} ide_info_t; - -static void ide_config(dev_link_t *link); -static void ide_release(u_long arg); -static int ide_event(event_t event, int priority, - event_callback_args_t *args); - -static dev_info_t dev_info = "ide-cs"; - -static dev_link_t *ide_attach(void); -static void ide_detach(dev_link_t *); - -static dev_link_t *dev_list = NULL; - -/*====================================================================*/ - -static void cs_error(client_handle_t handle, int func, int ret) -{ - error_info_t err = { func, ret }; - CardServices(ReportError, handle, &err); -} - -/*====================================================================== - - ide_attach() creates an "instance" of the driver, allocating - local data structures for one device. The device is registered - with Card Services. - -======================================================================*/ - -static dev_link_t *ide_attach(void) -{ - ide_info_t *info; - dev_link_t *link; - client_reg_t client_reg; - int i, ret; - - DEBUG(0, "ide_attach()\n"); - - /* Create new ide device */ - info = kmalloc(sizeof(*info), GFP_KERNEL); - if (!info) return NULL; - memset(info, 0, sizeof(*info)); - link = &info->link; link->priv = info; - - link->release.function = &ide_release; - link->release.data = (u_long)link; - link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; - link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; - link->io.IOAddrLines = 3; - link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; - link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID; - if (irq_list[0] == -1) - link->irq.IRQInfo2 = irq_mask; - else - for (i = 0; i < 4; i++) - link->irq.IRQInfo2 |= 1 << irq_list[i]; - link->conf.Attributes = CONF_ENABLE_IRQ; - link->conf.Vcc = 50; - link->conf.IntType = INT_MEMORY_AND_IO; - - /* Register with Card Services */ - link->next = dev_list; - dev_list = link; - client_reg.dev_info = &dev_info; - client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; - client_reg.EventMask = - CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | - CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | - CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME; - client_reg.event_handler = &ide_event; - client_reg.Version = 0x0210; - client_reg.event_callback_args.client_data = link; - ret = CardServices(RegisterClient, &link->handle, &client_reg); - if (ret != CS_SUCCESS) { - cs_error(link->handle, RegisterClient, ret); - ide_detach(link); - return NULL; - } - - return link; -} /* ide_attach */ - -/*====================================================================== - - This deletes a driver "instance". The device is de-registered - with Card Services. If it has been released, all local data - structures are freed. Otherwise, the structures will be freed - when the device is released. - -======================================================================*/ - -static void ide_detach(dev_link_t *link) -{ - dev_link_t **linkp; - int ret; - - DEBUG(0, "ide_detach(0x%p)\n", link); - - /* Locate device structure */ - for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) - if (*linkp == link) break; - if (*linkp == NULL) - return; - - del_timer(&link->release); - if (link->state & DEV_CONFIG) - ide_release((u_long)link); - - if (link->handle) { - ret = CardServices(DeregisterClient, link->handle); - if (ret != CS_SUCCESS) - cs_error(link->handle, DeregisterClient, ret); - } - - /* Unlink, free device structure */ - *linkp = link->next; - kfree(link->priv); - -} /* ide_detach */ - -/*====================================================================== - - ide_config() is scheduled to run after a CARD_INSERTION event - is received, to configure the PCMCIA socket, and to make the - ide device available to the system. - -======================================================================*/ - -#define CS_CHECK(fn, args...) \ -while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed - -#define CFG_CHECK(fn, args...) \ -if (CardServices(fn, args) != 0) goto next_entry - -int idecs_register (int arg1, int arg2, int irq) -{ - hw_regs_t hw; - ide_init_hwif_ports(&hw, (ide_ioreg_t) arg1, (ide_ioreg_t) arg2, NULL); - hw.irq = irq; - hw.chipset = ide_pci; /* this enables IRQ sharing w/ PCI irqs */ - return ide_register_hw(&hw, NULL); -} - -void ide_config(dev_link_t *link) -{ - client_handle_t handle = link->handle; - ide_info_t *info = link->priv; - tuple_t tuple; - u_short buf[128]; - cisparse_t parse; - config_info_t conf; - cistpl_cftable_entry_t *cfg = &parse.cftable_entry; - cistpl_cftable_entry_t dflt = { 0 }; - int i, pass, last_ret, last_fn, hd=-1, io_base, ctl_base; - - DEBUG(0, "ide_config(0x%p)\n", link); - - tuple.TupleData = (cisdata_t *)buf; - tuple.TupleOffset = 0; tuple.TupleDataMax = 255; - tuple.Attributes = 0; - tuple.DesiredTuple = CISTPL_CONFIG; - CS_CHECK(GetFirstTuple, handle, &tuple); - CS_CHECK(GetTupleData, handle, &tuple); - CS_CHECK(ParseTuple, handle, &tuple, &parse); - link->conf.ConfigBase = parse.config.base; - link->conf.Present = parse.config.rmask[0]; - - /* Configure card */ - link->state |= DEV_CONFIG; - - /* Not sure if this is right... look up the current Vcc */ - CS_CHECK(GetConfigurationInfo, handle, &conf); - link->conf.Vcc = conf.Vcc; - - pass = io_base = ctl_base = 0; - tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; - tuple.Attributes = 0; - CS_CHECK(GetFirstTuple, handle, &tuple); - while (1) { - CFG_CHECK(GetTupleData, handle, &tuple); - CFG_CHECK(ParseTuple, handle, &tuple, &parse); - - /* Check for matching Vcc, unless we're desperate */ - if (!pass) { - if (cfg->vcc.present & (1<vcc.param[CISTPL_POWER_VNOM]/10000) - goto next_entry; - } else if (dflt.vcc.present & (1<vpp1.present & (1<conf.Vpp1 = link->conf.Vpp2 = - cfg->vpp1.param[CISTPL_POWER_VNOM]/10000; - else if (dflt.vpp1.present & (1<conf.Vpp1 = link->conf.Vpp2 = - dflt.vpp1.param[CISTPL_POWER_VNOM]/10000; - - if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { - cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io; - link->conf.ConfigIndex = cfg->index; - link->io.BasePort1 = io->win[0].base; - link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; - if (!(io->flags & CISTPL_IO_16BIT)) - link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; - if (io->nwin == 2) { - link->io.NumPorts1 = 8; - link->io.BasePort2 = io->win[1].base; - link->io.NumPorts2 = 1; - CFG_CHECK(RequestIO, link->handle, &link->io); - io_base = link->io.BasePort1; - ctl_base = link->io.BasePort2; - } else if ((io->nwin == 1) && (io->win[0].len >= 16)) { - link->io.NumPorts1 = io->win[0].len; - link->io.NumPorts2 = 0; - CFG_CHECK(RequestIO, link->handle, &link->io); - io_base = link->io.BasePort1; - ctl_base = link->io.BasePort1+0x0e; - } else goto next_entry; - /* If we've got this far, we're done */ - break; - } - - next_entry: - if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; - if (pass) { - CS_CHECK(GetNextTuple, handle, &tuple); - } else if (CardServices(GetNextTuple, handle, &tuple) != 0) { - CS_CHECK(GetFirstTuple, handle, &tuple); - memset(&dflt, 0, sizeof(dflt)); - pass++; - } - } - - CS_CHECK(RequestIRQ, handle, &link->irq); - CS_CHECK(RequestConfiguration, handle, &link->conf); - - /* deal with brain dead IDE resource management */ - release_region(link->io.BasePort1, link->io.NumPorts1); - if (link->io.NumPorts2) - release_region(link->io.BasePort2, link->io.NumPorts2); - - /* retry registration in case device is still spinning up */ - for (i = 0; i < 10; i++) { - if (ctl_base) - outb(0x02, ctl_base); /* Set nIEN = disable device interrupts */ - hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ); - if (hd >= 0) break; - if (link->io.NumPorts1 == 0x20) { - if (ctl_base) - outb(0x02, ctl_base+0x10); - hd = idecs_register(io_base+0x10, ctl_base+0x10, - link->irq.AssignedIRQ); - if (hd >= 0) { - io_base += 0x10; ctl_base += 0x10; - break; - } - } - __set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(HZ/10); - } - - if (hd < 0) { - printk(KERN_NOTICE "ide_cs: ide_register() at 0x%03x & 0x%03x" - ", irq %u failed\n", io_base, ctl_base, - link->irq.AssignedIRQ); - goto failed; - } - - MOD_INC_USE_COUNT; - info->ndev = 1; - sprintf(info->node.dev_name, "hd%c", 'a'+(hd*2)); - info->node.major = ide_major[hd]; - info->node.minor = 0; - info->hd = hd; - link->dev = &info->node; - printk(KERN_INFO "ide_cs: %s: Vcc = %d.%d, Vpp = %d.%d\n", - info->node.dev_name, link->conf.Vcc/10, link->conf.Vcc%10, - link->conf.Vpp1/10, link->conf.Vpp1%10); - - link->state &= ~DEV_CONFIG_PENDING; - return; - -cs_failed: - cs_error(link->handle, last_fn, last_ret); -failed: - ide_release((u_long)link); - -} /* ide_config */ - -/*====================================================================== - - After a card is removed, ide_release() will unregister the net - device, and release the PCMCIA configuration. If the device is - still open, this will be postponed until it is closed. - -======================================================================*/ - -void ide_release(u_long arg) -{ - dev_link_t *link = (dev_link_t *)arg; - ide_info_t *info = link->priv; - - DEBUG(0, "ide_release(0x%p)\n", link); - - if (info->ndev) { - ide_unregister(info->hd); - MOD_DEC_USE_COUNT; - } - - request_region(link->io.BasePort1, link->io.NumPorts1,"ide-cs"); - if (link->io.NumPorts2) - request_region(link->io.BasePort2, link->io.NumPorts2,"ide-cs"); - - info->ndev = 0; - link->dev = NULL; - - CardServices(ReleaseConfiguration, link->handle); - CardServices(ReleaseIO, link->handle, &link->io); - CardServices(ReleaseIRQ, link->handle, &link->irq); - - link->state &= ~DEV_CONFIG; - -} /* ide_release */ - -/*====================================================================== - - The card status event handler. Mostly, this schedules other - stuff to run after an event is received. A CARD_REMOVAL event - also sets some flags to discourage the ide drivers from - talking to the ports. - -======================================================================*/ - -int ide_event(event_t event, int priority, - event_callback_args_t *args) -{ - dev_link_t *link = args->client_data; - - DEBUG(1, "ide_event(0x%06x)\n", event); - - switch (event) { - case CS_EVENT_CARD_REMOVAL: - link->state &= ~DEV_PRESENT; - if (link->state & DEV_CONFIG) - mod_timer(&link->release, jiffies + HZ/20); - break; - case CS_EVENT_CARD_INSERTION: - link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; - ide_config(link); - break; - case CS_EVENT_PM_SUSPEND: - link->state |= DEV_SUSPEND; - /* Fall through... */ - case CS_EVENT_RESET_PHYSICAL: - if (link->state & DEV_CONFIG) - CardServices(ReleaseConfiguration, link->handle); - break; - case CS_EVENT_PM_RESUME: - link->state &= ~DEV_SUSPEND; - /* Fall through... */ - case CS_EVENT_CARD_RESET: - if (DEV_OK(link)) - CardServices(RequestConfiguration, link->handle, &link->conf); - break; - } - return 0; -} /* ide_event */ - -/*====================================================================*/ - -static int __init init_ide_cs(void) -{ - servinfo_t serv; - DEBUG(0, "%s\n", version); - CardServices(GetCardServicesInfo, &serv); - if (serv.Revision != CS_RELEASE_CODE) { - printk(KERN_NOTICE "ide_cs: Card Services release " - "does not match!\n"); - return -1; - } - register_pccard_driver(&dev_info, &ide_attach, &ide_detach); - return 0; -} - -static void __exit exit_ide_cs(void) -{ - DEBUG(0, "ide_cs: unloading\n"); - unregister_pccard_driver(&dev_info); - while (dev_list != NULL) - ide_detach(dev_list); -} - -module_init(init_ide_cs); -module_exit(exit_ide_cs); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-disk.c linux.20pre5-ac2/drivers/ide/ide-disk.c --- linux.20pre5/drivers/ide/ide-disk.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-disk.c 2002-09-01 18:13:53.000000000 +0100 @@ -1,5 +1,9 @@ /* - * linux/drivers/ide/ide-disk.c Version 1.10 June 9, 2000 + * linux/drivers/ide/ide-disk.c Version 1.16 April 7, 2002 + * + * Copyright (C) 1998-2002 Linux ATA Developemt + * Andre Hedrick + * * * Copyright (C) 1994-1998 Linus Torvalds & authors (see below) */ @@ -29,10 +33,14 @@ * Version 1.10 request queue changes, Ultra DMA 100 * Version 1.11 added 48-bit lba * Version 1.12 adding taskfile io access method - * Highmem I/O support, Jens Axboe + * Version 1.13 added standby and flush-cache for notifier + * Version 1.14 added acoustic-wcache + * Version 1.15 convert all calls to ide_raw_taskfile + * since args will return register content. + * Version 1.16 added suspend-resume-checkpower */ -#define IDEDISK_VERSION "1.12" +#define IDEDISK_VERSION "1.16" #undef REALLY_SLOW_IO /* most systems can safely undef this */ @@ -49,6 +57,9 @@ #include #include #include + +#define _IDE_DISK + #include #include @@ -56,48 +67,27 @@ #include #include -#ifdef CONFIG_BLK_DEV_PDC4030 -#define IS_PDC4030_DRIVE (HWIF(drive)->chipset == ide_pdc4030) -#else -#define IS_PDC4030_DRIVE (0) /* auto-NULLs out pdc4030 code */ -#endif +/* FIXME: soem day we shouldnt need to look in here! */ -#ifdef CONFIG_IDE_TASKFILE_IO -# undef __TASKFILE__IO /* define __TASKFILE__IO */ -#else /* CONFIG_IDE_TASKFILE_IO */ -# undef __TASKFILE__IO -#endif /* CONFIG_IDE_TASKFILE_IO */ +#include "legacy/pdc4030.h" -#ifndef __TASKFILE__IO +static int driver_blocked; -static void idedisk_bswap_data (void *buffer, int wcount) +static inline u32 idedisk_read_24 (ide_drive_t *drive) { - u16 *p = buffer; - - while (wcount--) { - *p = *p << 8 | *p >> 8; p++; - *p = *p << 8 | *p >> 8; p++; - } -} - -static inline void idedisk_input_data (ide_drive_t *drive, void *buffer, unsigned int wcount) -{ - ide_input_data(drive, buffer, wcount); - if (drive->bswap) - idedisk_bswap_data(buffer, wcount); -} - -static inline void idedisk_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount) -{ - if (drive->bswap) { - idedisk_bswap_data(buffer, wcount); - ide_output_data(drive, buffer, wcount); - idedisk_bswap_data(buffer, wcount); - } else - ide_output_data(drive, buffer, wcount); +#if 0 + return (HWIF(drive)->INB(IDE_HCYL_REG)<<16) | + (HWIF(drive)->INB(IDE_LCYL_REG)<<8) | + HWIF(drive)->INB(IDE_SECTOR_REG); +#else + u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG); + u8 lcyl = HWIF(drive)->INB(IDE_LCYL_REG); + u8 sect = HWIF(drive)->INB(IDE_SECTOR_REG); + return (hcyl<<16)|(lcyl<<8)|sect; +#endif } -#endif /* __TASKFILE__IO */ +static int idedisk_end_request(ide_drive_t *drive, int uptodate); /* * lba_capacity_is_ok() performs a sanity check on the claimed "lba_capacity" @@ -127,7 +117,7 @@ || (id->cyls == 4092 && id->cur_cyls == 16383)) && id->sectors == 63 && (id->heads == 15 || id->heads == 16) && - id->lba_capacity >= 16383*63*id->heads) + (id->lba_capacity >= 16383*63*id->heads)) return 1; lba_sects = id->lba_capacity; @@ -149,31 +139,30 @@ return 0; /* lba_capacity value may be bad */ } -#ifndef __TASKFILE__IO +#ifndef CONFIG_IDE_TASKFILE_IO /* * read_intr() is the handler for disk read/multread interrupts */ static ide_startstop_t read_intr (ide_drive_t *drive) { - byte stat; - int i; - unsigned int msect, nsect; - unsigned long flags; + ide_hwif_t *hwif = HWIF(drive); + u32 i = 0, nsect = 0, msect = drive->mult_count; struct request *rq; - char *to; + u8 stat; /* new way for dealing with premature shared PCI interrupts */ - if (!OK_STAT(stat=GET_STAT(),DATA_READY,BAD_R_STAT)) { + if (!OK_STAT(stat=hwif->INB(IDE_STATUS_REG),DATA_READY,BAD_R_STAT)) { if (stat & (ERR_STAT|DRQ_STAT)) { - return ide_error(drive, "read_intr", stat); + return DRIVER(drive)->error(drive, "read_intr", stat); } /* no data yet, so wait for another interrupt */ + if (HWGROUP(drive)->handler != NULL) + BUG(); ide_set_handler(drive, &read_intr, WAIT_CMD, NULL); return ide_started; } - - msect = drive->mult_count; + read_next: rq = HWGROUP(drive)->rq; if (msect) { @@ -182,23 +171,31 @@ msect -= nsect; } else nsect = 1; - to = ide_map_buffer(rq, &flags); - idedisk_input_data(drive, to, nsect * SECTOR_WORDS); + taskfile_input_data(drive, rq->buffer, nsect * SECTOR_WORDS); + #ifdef DEBUG printk("%s: read: sectors(%ld-%ld), buffer=0x%08lx, remaining=%ld\n", drive->name, rq->sector, rq->sector+nsect-1, (unsigned long) rq->buffer+(nsect<<9), rq->nr_sectors-nsect); #endif - ide_unmap_buffer(to, &flags); + rq->sector += nsect; + rq->buffer += nsect<<9; rq->errors = 0; i = (rq->nr_sectors -= nsect); if (((long)(rq->current_nr_sectors -= nsect)) <= 0) - ide_end_request(1, HWGROUP(drive)); + idedisk_end_request(drive, 1); + /* + * Another BH Page walker and DATA INTERGRITY Questioned on ERROR. + * If passed back up on multimode read, BAD DATA could be ACKED + * to FILE SYSTEMS above ... + */ if (i > 0) { if (msect) goto read_next; - ide_set_handler (drive, &read_intr, WAIT_CMD, NULL); + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &read_intr, WAIT_CMD, NULL); return ide_started; } return ide_stopped; @@ -209,13 +206,16 @@ */ static ide_startstop_t write_intr (ide_drive_t *drive) { - byte stat; - int i; - ide_hwgroup_t *hwgroup = HWGROUP(drive); - struct request *rq = hwgroup->rq; - - if (!OK_STAT(stat=GET_STAT(),DRIVE_READY,drive->bad_wstat)) { - printk("%s: write_intr error1: nr_sectors=%ld, stat=0x%02x\n", drive->name, rq->nr_sectors, stat); + ide_hwgroup_t *hwgroup = HWGROUP(drive); + ide_hwif_t *hwif = HWIF(drive); + struct request *rq = hwgroup->rq; + u32 i = 0; + u8 stat; + + if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG), + DRIVE_READY, drive->bad_wstat)) { + printk("%s: write_intr error1: nr_sectors=%ld, stat=0x%02x\n", + drive->name, rq->nr_sectors, stat); } else { #ifdef DEBUG printk("%s: write: sector %ld, buffer=0x%08lx, remaining=%ld\n", @@ -224,24 +224,25 @@ #endif if ((rq->nr_sectors == 1) ^ ((stat & DRQ_STAT) != 0)) { rq->sector++; + rq->buffer += 512; rq->errors = 0; i = --rq->nr_sectors; --rq->current_nr_sectors; if (((long)rq->current_nr_sectors) <= 0) - ide_end_request(1, hwgroup); + idedisk_end_request(drive, 1); if (i > 0) { - unsigned long flags; - char *to = ide_map_buffer(rq, &flags); - idedisk_output_data (drive, to, SECTOR_WORDS); - ide_unmap_buffer(to, &flags); - ide_set_handler (drive, &write_intr, WAIT_CMD, NULL); + taskfile_output_data(drive, rq->buffer, SECTOR_WORDS); + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &write_intr, WAIT_CMD, NULL); return ide_started; } return ide_stopped; } - return ide_stopped; /* the original code did this here (?) */ + /* the original code did this here (?) */ + return ide_stopped; } - return ide_error(drive, "write_intr", stat); + return DRIVER(drive)->error(drive, "write_intr", stat); } /* @@ -254,23 +255,28 @@ * and IRQ context. The IRQ can happen any time after we've output the * full "mcount" number of sectors, so we must make sure we update the * state _before_ we output the final part of the data! + * + * The update and return to BH is a BLOCK Layer Fakey to get more data + * to satisfy the hardware atomic segment. If the hardware atomic segment + * is shorter or smaller than the BH segment then we should be OKAY. + * This is only valid if we can rewind the rq->current_nr_sectors counter. */ int ide_multwrite (ide_drive_t *drive, unsigned int mcount) { - ide_hwgroup_t *hwgroup= HWGROUP(drive); - struct request *rq = &hwgroup->wrq; + ide_hwgroup_t *hwgroup = HWGROUP(drive); + struct request *rq = &hwgroup->wrq; do { char *buffer; int nsect = rq->current_nr_sectors; - unsigned long flags; - + if (nsect > mcount) nsect = mcount; mcount -= nsect; + buffer = rq->buffer; - buffer = ide_map_buffer(rq, &flags); rq->sector += nsect; + rq->buffer += nsect << 9; rq->nr_sectors -= nsect; rq->current_nr_sectors -= nsect; @@ -284,7 +290,7 @@ } else { rq->bh = bh; rq->current_nr_sectors = bh->b_size >> 9; - rq->hard_cur_sectors = rq->current_nr_sectors; + rq->buffer = bh->b_data; } } @@ -292,8 +298,7 @@ * Ok, we're all setup for the interrupt * re-entering us on the last transfer. */ - idedisk_output_data(drive, buffer, nsect<<7); - ide_unmap_buffer(buffer, &flags); + taskfile_output_data(drive, buffer, nsect<<7); } while (mcount); return 0; @@ -304,12 +309,14 @@ */ static ide_startstop_t multwrite_intr (ide_drive_t *drive) { - byte stat; - int i; - ide_hwgroup_t *hwgroup = HWGROUP(drive); - struct request *rq = &hwgroup->wrq; + ide_hwgroup_t *hwgroup = HWGROUP(drive); + ide_hwif_t *hwif = HWIF(drive); + struct request *rq = &hwgroup->wrq; + u32 i = 0; + u8 stat; - if (OK_STAT(stat=GET_STAT(),DRIVE_READY,drive->bad_wstat)) { + if (OK_STAT(stat = hwif->INB(IDE_STATUS_REG), + DRIVE_READY, drive->bad_wstat)) { if (stat & DRQ_STAT) { /* * The drive wants data. Remember rq is the copy @@ -318,7 +325,9 @@ if (rq->nr_sectors) { if (ide_multwrite(drive, drive->mult_count)) return ide_stopped; - ide_set_handler (drive, &multwrite_intr, WAIT_CMD, NULL); + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &multwrite_intr, WAIT_CMD, NULL); return ide_started; } } else { @@ -328,24 +337,202 @@ */ if (!rq->nr_sectors) { /* all done? */ rq = hwgroup->rq; - for (i = rq->nr_sectors; i > 0;){ + for (i = rq->nr_sectors; i > 0;) { i -= rq->current_nr_sectors; - ide_end_request(1, hwgroup); + idedisk_end_request(drive, 1); } return ide_stopped; } } - return ide_stopped; /* the original code did this here (?) */ + /* the original code did this here (?) */ + return ide_stopped; + } + return DRIVER(drive)->error(drive, "multwrite_intr", stat); +} + + +/* + * do_rw_disk() issues READ and WRITE commands to a disk, + * using LBA if supported, or CHS otherwise, to address sectors. + * It also takes care of issuing special DRIVE_CMDs. + */ +static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 lba48 = (drive->addressing == 1) ? 1 : 0; + task_ioreg_t command = WIN_NOP; + ata_nsector_t nsectors; + + nsectors.all = (u16) rq->nr_sectors; + + if (driver_blocked) + panic("Request while ide driver is blocked?"); + +#if defined(CONFIG_BLK_DEV_PDC4030) || defined(CONFIG_BLK_DEV_PDC4030_MODULE) + if (IS_PDC4030_DRIVE) + return promise_rw_disk(drive, rq, block); +#endif /* CONFIG_BLK_DEV_PDC4030 */ + + if (IDE_CONTROL_REG) + hwif->OUTB(drive->ctl, IDE_CONTROL_REG); + + if (drive->select.b.lba) { + if (drive->addressing == 1) { + task_ioreg_t tasklets[10]; + + tasklets[0] = 0; + tasklets[1] = 0; + tasklets[2] = nsectors.b.low; + tasklets[3] = nsectors.b.high; + tasklets[4] = (task_ioreg_t) block; + tasklets[5] = (task_ioreg_t) (block>>8); + tasklets[6] = (task_ioreg_t) (block>>16); + tasklets[7] = (task_ioreg_t) (block>>24); + tasklets[8] = (task_ioreg_t) 0; + tasklets[9] = (task_ioreg_t) 0; +// tasklets[8] = (task_ioreg_t) (block>>32); +// tasklets[9] = (task_ioreg_t) (block>>40); +#ifdef DEBUG + printk("%s: %sing: LBAsect=%lu, sectors=%ld, " + "buffer=0x%08lx, LBAsect=0x%012lx\n", + drive->name, + (rq->cmd==READ)?"read":"writ", + block, + rq->nr_sectors, + (unsigned long) rq->buffer, + block); + printk("%s: 0x%02x%02x 0x%02x%02x%02x%02x%02x%02x\n", + drive->name, tasklets[3], tasklets[2], + tasklets[9], tasklets[8], tasklets[7], + tasklets[6], tasklets[5], tasklets[4]); +#endif + hwif->OUTB(tasklets[1], IDE_FEATURE_REG); + hwif->OUTB(tasklets[3], IDE_NSECTOR_REG); + hwif->OUTB(tasklets[7], IDE_SECTOR_REG); + hwif->OUTB(tasklets[8], IDE_LCYL_REG); + hwif->OUTB(tasklets[9], IDE_HCYL_REG); + + hwif->OUTB(tasklets[0], IDE_FEATURE_REG); + hwif->OUTB(tasklets[2], IDE_NSECTOR_REG); + hwif->OUTB(tasklets[4], IDE_SECTOR_REG); + hwif->OUTB(tasklets[5], IDE_LCYL_REG); + hwif->OUTB(tasklets[6], IDE_HCYL_REG); + hwif->OUTB(0x00|drive->select.all,IDE_SELECT_REG); + } else { +#ifdef DEBUG + printk("%s: %sing: LBAsect=%ld, sectors=%ld, " + "buffer=0x%08lx\n", + drive->name, (rq->cmd==READ)?"read":"writ", + block, rq->nr_sectors, + (unsigned long) rq->buffer); +#endif + hwif->OUTB(0x00, IDE_FEATURE_REG); + hwif->OUTB(nsectors.b.low, IDE_NSECTOR_REG); + hwif->OUTB(block, IDE_SECTOR_REG); + hwif->OUTB(block>>=8, IDE_LCYL_REG); + hwif->OUTB(block>>=8, IDE_HCYL_REG); + hwif->OUTB(((block>>8)&0x0f)|drive->select.all,IDE_SELECT_REG); + } + } else { + unsigned int sect,head,cyl,track; + track = block / drive->sect; + sect = block % drive->sect + 1; + hwif->OUTB(sect, IDE_SECTOR_REG); + head = track % drive->head; + cyl = track / drive->head; + + hwif->OUTB(0x00, IDE_FEATURE_REG); + hwif->OUTB(nsectors.b.low, IDE_NSECTOR_REG); + hwif->OUTB(cyl, IDE_LCYL_REG); + hwif->OUTB(cyl>>8, IDE_HCYL_REG); + hwif->OUTB(head|drive->select.all,IDE_SELECT_REG); +#ifdef DEBUG + printk("%s: %sing: CHS=%d/%d/%d, sectors=%ld, buffer=0x%08lx\n", + drive->name, (rq->cmd==READ)?"read":"writ", cyl, + head, sect, rq->nr_sectors, (unsigned long) rq->buffer); +#endif + } + + if (rq->cmd == READ) { +#ifdef CONFIG_BLK_DEV_IDEDMA + if (drive->using_dma && !(hwif->ide_dma_read(drive))) + return ide_started; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &read_intr, WAIT_CMD, NULL); + + command = ((drive->mult_count) ? + ((lba48) ? WIN_MULTREAD_EXT : WIN_MULTREAD) : + ((lba48) ? WIN_READ_EXT : WIN_READ)); + hwif->OUTB(command, IDE_COMMAND_REG); + return ide_started; + } + + if (rq->cmd == WRITE) { + ide_startstop_t startstop; +#ifdef CONFIG_BLK_DEV_IDEDMA + if (drive->using_dma && !(HWIF(drive)->ide_dma_write(drive))) + return ide_started; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + + command = ((drive->mult_count) ? + ((lba48) ? WIN_MULTWRITE_EXT : WIN_MULTWRITE) : + ((lba48) ? WIN_WRITE_EXT : WIN_WRITE)); + hwif->OUTB(command, IDE_COMMAND_REG); + + if (ide_wait_stat(&startstop, drive, DATA_READY, + drive->bad_wstat, WAIT_DRQ)) { + printk(KERN_ERR "%s: no DRQ after issuing %s\n", + drive->name, + drive->mult_count ? "MULTWRITE" : "WRITE"); + return startstop; + } + if (!drive->unmask) + local_irq_disable(); + if (drive->mult_count) { + ide_hwgroup_t *hwgroup = HWGROUP(drive); + /* + * Ugh.. this part looks ugly because we MUST set up + * the interrupt handler before outputting the first block + * of data to be written. If we hit an error (corrupted buffer list) + * in ide_multwrite(), then we need to remove the handler/timer + * before returning. Fortunately, this NEVER happens (right?). + * + * Except when you get an error it seems... + * + * MAJOR DATA INTEGRITY BUG !!! only if we error + */ + hwgroup->wrq = *rq; /* scratchpad */ + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &multwrite_intr, WAIT_CMD, NULL); + if (ide_multwrite(drive, drive->mult_count)) { + unsigned long flags; + spin_lock_irqsave(&io_request_lock, flags); + hwgroup->handler = NULL; + del_timer(&hwgroup->timer); + spin_unlock_irqrestore(&io_request_lock, flags); + return ide_stopped; + } + } else { + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &write_intr, WAIT_CMD, NULL); + taskfile_output_data(drive, rq->buffer, SECTOR_WORDS); + } + return ide_started; } - return ide_error(drive, "multwrite_intr", stat); + printk(KERN_ERR "%s: bad command: %d\n", drive->name, rq->cmd); + idedisk_end_request(drive, 0); + return ide_stopped; } -#endif /* __TASKFILE__IO */ -#ifdef __TASKFILE__IO +#else /* CONFIG_IDE_TASKFILE_IO */ -static ide_startstop_t chs_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block); -static ide_startstop_t lba_28_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block); -static ide_startstop_t lba_48_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long long block); +static ide_startstop_t chs_rw_disk(ide_drive_t *, struct request *, unsigned long); +static ide_startstop_t lba_28_rw_disk(ide_drive_t *, struct request *, unsigned long); +static ide_startstop_t lba_48_rw_disk(ide_drive_t *, struct request *, unsigned long long); /* * do_rw_disk() issues READ and WRITE commands to a disk, @@ -360,19 +547,25 @@ goto good_command; printk(KERN_ERR "%s: bad command: %d\n", drive->name, rq->cmd); - ide_end_request(0, HWGROUP(drive)); + idedisk_end_request(drive, 0); return ide_stopped; good_command: -#ifdef CONFIG_BLK_DEV_PDC4030 - if (IS_PDC4030_DRIVE) { - extern ide_startstop_t promise_rw_disk(ide_drive_t *, struct request *, unsigned long); - return promise_rw_disk(drive, rq, block); - } +#if 0 + /* + * 268435455 == 137439 MB or 28bit limit + * + * need to add split taskfile operations based on 28bit threshold. + */ +#endif + +#if defined(CONFIG_BLK_DEV_PDC4030) || defined(CONFIG_BLK_DEV_PDC4030_MODULE) + if (IS_PDC4030_DRIVE) + return promise_rw_disk(drive, rq, block); #endif /* CONFIG_BLK_DEV_PDC4030 */ - if ((drive->id->cfs_enable_2 & 0x0400) && (drive->addressing)) /* 48-bit LBA */ + if (drive->addressing == 1) /* 48-bit LBA */ return lba_48_rw_disk(drive, rq, (unsigned long long) block); if (drive->select.b.lba) /* 28-bit LBA */ return lba_28_rw_disk(drive, rq, (unsigned long) block); @@ -386,7 +579,7 @@ int lba48bit = (drive->id->cfs_enable_2 & 0x0400) ? 1 : 0; #if 1 - lba48bit = drive->addressing; + lba48bit = (drive->addressing == 1) ? 1 : 0; #endif if ((cmd == READ) && (drive->using_dma)) @@ -407,88 +600,68 @@ static ide_startstop_t chs_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - ide_task_t args; - + ide_task_t args; + int sectors; + ata_nsector_t nsectors; task_ioreg_t command = get_command(drive, rq->cmd); unsigned int track = (block / drive->sect); unsigned int sect = (block % drive->sect) + 1; unsigned int head = (track % drive->head); unsigned int cyl = (track / drive->head); - memset(&taskfile, 0, sizeof(task_struct_t)); - memset(&hobfile, 0, sizeof(hob_struct_t)); - - taskfile.sector_count = (rq->nr_sectors==256)?0x00:rq->nr_sectors; - taskfile.sector_number = sect; - taskfile.low_cylinder = cyl; - taskfile.high_cylinder = (cyl>>8); - taskfile.device_head = head; - taskfile.device_head |= drive->select.all; - taskfile.command = command; - + nsectors.all = (u16) rq->nr_sectors; #ifdef DEBUG printk("%s: %sing: ", drive->name, (rq->cmd==READ) ? "read" : "writ"); - if (lba) printk("LBAsect=%lld, ", block); - else printk("CHS=%d/%d/%d, ", cyl, head, sect); + printk("CHS=%d/%d/%d, ", cyl, head, sect); printk("sectors=%ld, ", rq->nr_sectors); printk("buffer=0x%08lx\n", (unsigned long) rq->buffer); #endif - memcpy(args.tfRegister, &taskfile, sizeof(struct hd_drive_task_hdr)); - memcpy(args.hobRegister, &hobfile, sizeof(struct hd_drive_hob_hdr)); - args.command_type = ide_cmd_type_parser(&args); - args.prehandler = ide_pre_handler_parser(&taskfile, &hobfile); - args.handler = ide_handler_parser(&taskfile, &hobfile); - args.posthandler = NULL; - args.rq = (struct request *) rq; - args.block = block; - rq->special = NULL; - rq->special = (ide_task_t *)&args; + memset(&args, 0, sizeof(ide_task_t)); + sectors = (rq->nr_sectors == 256) ? 0x00 : rq->nr_sectors; + args.tfRegister[IDE_NSECTOR_OFFSET] = sectors; + args.tfRegister[IDE_SECTOR_OFFSET] = sect; + args.tfRegister[IDE_LCYL_OFFSET] = cyl; + args.tfRegister[IDE_HCYL_OFFSET] = (cyl>>8); + args.tfRegister[IDE_SELECT_OFFSET] = head; + args.tfRegister[IDE_SELECT_OFFSET] |= drive->select.all; + args.tfRegister[IDE_COMMAND_OFFSET] = command; + args.command_type = ide_cmd_type_parser(&args); + args.rq = (struct request *) rq; + rq->special = (ide_task_t *)&args; return do_rw_taskfile(drive, &args); } static ide_startstop_t lba_28_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - ide_task_t args; - + ide_task_t args; + int sectors; + ata_nsector_t nsectors; task_ioreg_t command = get_command(drive, rq->cmd); - memset(&taskfile, 0, sizeof(task_struct_t)); - memset(&hobfile, 0, sizeof(hob_struct_t)); - - taskfile.sector_count = (rq->nr_sectors==256)?0x00:rq->nr_sectors; - taskfile.sector_number = block; - taskfile.low_cylinder = (block>>=8); - taskfile.high_cylinder = (block>>=8); - taskfile.device_head = ((block>>8)&0x0f); - taskfile.device_head |= drive->select.all; - taskfile.command = command; - + nsectors.all = (u16) rq->nr_sectors; #ifdef DEBUG printk("%s: %sing: ", drive->name, (rq->cmd==READ) ? "read" : "writ"); - if (lba) printk("LBAsect=%lld, ", block); - else printk("CHS=%d/%d/%d, ", cyl, head, sect); + printk("LBAsect=%lld, ", block); printk("sectors=%ld, ", rq->nr_sectors); printk("buffer=0x%08lx\n", (unsigned long) rq->buffer); #endif - memcpy(args.tfRegister, &taskfile, sizeof(struct hd_drive_task_hdr)); - memcpy(args.hobRegister, &hobfile, sizeof(struct hd_drive_hob_hdr)); - args.command_type = ide_cmd_type_parser(&args); - args.prehandler = ide_pre_handler_parser(&taskfile, &hobfile); - args.handler = ide_handler_parser(&taskfile, &hobfile); - args.posthandler = NULL; - args.rq = (struct request *) rq; - args.block = block; - rq->special = NULL; - rq->special = (ide_task_t *)&args; + memset(&args, 0, sizeof(ide_task_t)); + sectors = (rq->nr_sectors == 256) ? 0x00 : rq->nr_sectors; + args.tfRegister[IDE_NSECTOR_OFFSET] = sectors; + args.tfRegister[IDE_SECTOR_OFFSET] = block; + args.tfRegister[IDE_LCYL_OFFSET] = (block>>=8); + args.tfRegister[IDE_HCYL_OFFSET] = (block>>=8); + args.tfRegister[IDE_SELECT_OFFSET] = ((block>>8)&0x0f); + args.tfRegister[IDE_SELECT_OFFSET] |= drive->select.all; + args.tfRegister[IDE_COMMAND_OFFSET] = command; + args.command_type = ide_cmd_type_parser(&args); + args.rq = (struct request *) rq; + rq->special = (ide_task_t *)&args; return do_rw_taskfile(drive, &args); } @@ -500,239 +673,58 @@ static ide_startstop_t lba_48_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long long block) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - ide_task_t args; - + ide_task_t args; + int sectors; + ata_nsector_t nsectors; task_ioreg_t command = get_command(drive, rq->cmd); - memset(&taskfile, 0, sizeof(task_struct_t)); - memset(&hobfile, 0, sizeof(hob_struct_t)); - - taskfile.sector_count = rq->nr_sectors; - hobfile.sector_count = (rq->nr_sectors>>8); - - if (rq->nr_sectors == 65536) { - taskfile.sector_count = 0x00; - hobfile.sector_count = 0x00; - } - - taskfile.sector_number = block; /* low lba */ - taskfile.low_cylinder = (block>>=8); /* mid lba */ - taskfile.high_cylinder = (block>>=8); /* hi lba */ - hobfile.sector_number = (block>>=8); /* low lba */ - hobfile.low_cylinder = (block>>=8); /* mid lba */ - hobfile.high_cylinder = (block>>=8); /* hi lba */ - taskfile.device_head = drive->select.all; - hobfile.device_head = taskfile.device_head; - hobfile.control = (drive->ctl|0x80); - taskfile.command = command; + nsectors.all = (u16) rq->nr_sectors; #ifdef DEBUG printk("%s: %sing: ", drive->name, (rq->cmd==READ) ? "read" : "writ"); - if (lba) printk("LBAsect=%lld, ", block); - else printk("CHS=%d/%d/%d, ", cyl, head, sect); + printk("LBAsect=%lld, ", block); printk("sectors=%ld, ", rq->nr_sectors); printk("buffer=0x%08lx\n", (unsigned long) rq->buffer); #endif - memcpy(args.tfRegister, &taskfile, sizeof(struct hd_drive_task_hdr)); - memcpy(args.hobRegister, &hobfile, sizeof(struct hd_drive_hob_hdr)); - args.command_type = ide_cmd_type_parser(&args); - args.prehandler = ide_pre_handler_parser(&taskfile, &hobfile); - args.handler = ide_handler_parser(&taskfile, &hobfile); - args.posthandler = NULL; - args.rq = (struct request *) rq; - args.block = block; - rq->special = NULL; - rq->special = (ide_task_t *)&args; + memset(&args, 0, sizeof(ide_task_t)); + sectors = (rq->nr_sectors == 65536) ? 0 : rq->nr_sectors; + args.tfRegister[IDE_NSECTOR_OFFSET] = sectors; + args.tfRegister[IDE_SECTOR_OFFSET] = block; /* low lba */ + args.tfRegister[IDE_LCYL_OFFSET] = (block>>=8); /* mid lba */ + args.tfRegister[IDE_HCYL_OFFSET] = (block>>=8); /* hi lba */ + args.tfRegister[IDE_SELECT_OFFSET] = drive->select.all; + args.tfRegister[IDE_COMMAND_OFFSET] = command; + args.hobRegister[IDE_NSECTOR_OFFSET_HOB]= sectors >> 8; + args.hobRegister[IDE_SECTOR_OFFSET_HOB] = (block>>=8); /* low lba */ + args.hobRegister[IDE_LCYL_OFFSET_HOB] = (block>>=8); /* mid lba */ + args.hobRegister[IDE_HCYL_OFFSET_HOB] = (block>>=8); /* hi lba */ + args.hobRegister[IDE_SELECT_OFFSET_HOB] = drive->select.all; + args.hobRegister[IDE_CONTROL_OFFSET_HOB]= (drive->ctl|0x80); + args.command_type = ide_cmd_type_parser(&args); + args.rq = (struct request *) rq; + rq->special = (ide_task_t *)&args; return do_rw_taskfile(drive, &args); } -#else /* !__TASKFILE__IO */ -/* - * do_rw_disk() issues READ and WRITE commands to a disk, - * using LBA if supported, or CHS otherwise, to address sectors. - * It also takes care of issuing special DRIVE_CMDs. - */ -static ide_startstop_t do_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block) -{ - if (IDE_CONTROL_REG) - OUT_BYTE(drive->ctl,IDE_CONTROL_REG); - -#ifdef CONFIG_BLK_DEV_PDC4030 - if (drive->select.b.lba || IS_PDC4030_DRIVE) { -#else /* !CONFIG_BLK_DEV_PDC4030 */ - if (drive->select.b.lba) { -#endif /* CONFIG_BLK_DEV_PDC4030 */ - - if ((drive->id->cfs_enable_2 & 0x0400) && (drive->addressing)) { - task_ioreg_t tasklets[10]; - - tasklets[0] = 0; - tasklets[1] = 0; - tasklets[2] = rq->nr_sectors; - tasklets[3] = (rq->nr_sectors>>8); - if (rq->nr_sectors == 65536) { - tasklets[2] = 0x00; - tasklets[3] = 0x00; - } - tasklets[4] = (task_ioreg_t) block; - tasklets[5] = (task_ioreg_t) (block>>8); - tasklets[6] = (task_ioreg_t) (block>>16); - tasklets[7] = (task_ioreg_t) (block>>24); - tasklets[8] = (task_ioreg_t) 0; - tasklets[9] = (task_ioreg_t) 0; -// tasklets[8] = (task_ioreg_t) (block>>32); -// tasklets[9] = (task_ioreg_t) (block>>40); -#ifdef DEBUG - printk("%s: %sing: LBAsect=%lu, sectors=%ld, buffer=0x%08lx, LBAsect=0x%012lx\n", - drive->name, - (rq->cmd==READ)?"read":"writ", - block, - rq->nr_sectors, - (unsigned long) rq->buffer, - block); - printk("%s: 0x%02x%02x 0x%02x%02x%02x%02x%02x%02x\n", - drive->name, tasklets[3], tasklets[2], - tasklets[9], tasklets[8], tasklets[7], - tasklets[6], tasklets[5], tasklets[4]); -#endif - OUT_BYTE(tasklets[1], IDE_FEATURE_REG); - OUT_BYTE(tasklets[3], IDE_NSECTOR_REG); - OUT_BYTE(tasklets[7], IDE_SECTOR_REG); - OUT_BYTE(tasklets[8], IDE_LCYL_REG); - OUT_BYTE(tasklets[9], IDE_HCYL_REG); - - OUT_BYTE(tasklets[0], IDE_FEATURE_REG); - OUT_BYTE(tasklets[2], IDE_NSECTOR_REG); - OUT_BYTE(tasklets[4], IDE_SECTOR_REG); - OUT_BYTE(tasklets[5], IDE_LCYL_REG); - OUT_BYTE(tasklets[6], IDE_HCYL_REG); - OUT_BYTE(0x00|drive->select.all,IDE_SELECT_REG); - } else { -#ifdef DEBUG - printk("%s: %sing: LBAsect=%ld, sectors=%ld, buffer=0x%08lx\n", - drive->name, (rq->cmd==READ)?"read":"writ", - block, rq->nr_sectors, (unsigned long) rq->buffer); -#endif - OUT_BYTE(0x00, IDE_FEATURE_REG); - OUT_BYTE((rq->nr_sectors==256)?0x00:rq->nr_sectors,IDE_NSECTOR_REG); - OUT_BYTE(block,IDE_SECTOR_REG); - OUT_BYTE(block>>=8,IDE_LCYL_REG); - OUT_BYTE(block>>=8,IDE_HCYL_REG); - OUT_BYTE(((block>>8)&0x0f)|drive->select.all,IDE_SELECT_REG); - } - } else { - unsigned int sect,head,cyl,track; - track = block / drive->sect; - sect = block % drive->sect + 1; - OUT_BYTE(sect,IDE_SECTOR_REG); - head = track % drive->head; - cyl = track / drive->head; - - OUT_BYTE(0x00, IDE_FEATURE_REG); - OUT_BYTE((rq->nr_sectors==256)?0x00:rq->nr_sectors,IDE_NSECTOR_REG); - OUT_BYTE(cyl,IDE_LCYL_REG); - OUT_BYTE(cyl>>8,IDE_HCYL_REG); - OUT_BYTE(head|drive->select.all,IDE_SELECT_REG); -#ifdef DEBUG - printk("%s: %sing: CHS=%d/%d/%d, sectors=%ld, buffer=0x%08lx\n", - drive->name, (rq->cmd==READ)?"read":"writ", cyl, - head, sect, rq->nr_sectors, (unsigned long) rq->buffer); -#endif - } -#ifdef CONFIG_BLK_DEV_PDC4030 - if (IS_PDC4030_DRIVE) { - extern ide_startstop_t do_pdc4030_io(ide_drive_t *, struct request *); - return do_pdc4030_io (drive, rq); - } -#endif /* CONFIG_BLK_DEV_PDC4030 */ - if (rq->cmd == READ) { -#ifdef CONFIG_BLK_DEV_IDEDMA - if (drive->using_dma && !(HWIF(drive)->dmaproc(ide_dma_read, drive))) - return ide_started; -#endif /* CONFIG_BLK_DEV_IDEDMA */ - ide_set_handler(drive, &read_intr, WAIT_CMD, NULL); - if ((drive->id->cfs_enable_2 & 0x0400) && (drive->addressing)) { - OUT_BYTE(drive->mult_count ? WIN_MULTREAD_EXT : WIN_READ_EXT, IDE_COMMAND_REG); - } else { - OUT_BYTE(drive->mult_count ? WIN_MULTREAD : WIN_READ, IDE_COMMAND_REG); - } - return ide_started; - } - if (rq->cmd == WRITE) { - ide_startstop_t startstop; -#ifdef CONFIG_BLK_DEV_IDEDMA - if (drive->using_dma && !(HWIF(drive)->dmaproc(ide_dma_write, drive))) - return ide_started; -#endif /* CONFIG_BLK_DEV_IDEDMA */ - if ((drive->id->cfs_enable_2 & 0x0400) && (drive->addressing)) { - OUT_BYTE(drive->mult_count ? WIN_MULTWRITE_EXT : WIN_WRITE_EXT, IDE_COMMAND_REG); - } else { - OUT_BYTE(drive->mult_count ? WIN_MULTWRITE : WIN_WRITE, IDE_COMMAND_REG); - } - if (ide_wait_stat(&startstop, drive, DATA_READY, drive->bad_wstat, WAIT_DRQ)) { - printk(KERN_ERR "%s: no DRQ after issuing %s\n", drive->name, - drive->mult_count ? "MULTWRITE" : "WRITE"); - return startstop; - } - if (!drive->unmask) - __cli(); /* local CPU only */ - if (drive->mult_count) { - ide_hwgroup_t *hwgroup = HWGROUP(drive); - /* - * Ugh.. this part looks ugly because we MUST set up - * the interrupt handler before outputting the first block - * of data to be written. If we hit an error (corrupted buffer list) - * in ide_multwrite(), then we need to remove the handler/timer - * before returning. Fortunately, this NEVER happens (right?). - * - * Except when you get an error it seems... - */ - hwgroup->wrq = *rq; /* scratchpad */ - ide_set_handler(drive, &multwrite_intr, WAIT_CMD, NULL); - if (ide_multwrite(drive, drive->mult_count)) { - unsigned long flags; - spin_lock_irqsave(&io_request_lock, flags); - hwgroup->handler = NULL; - del_timer(&hwgroup->timer); - spin_unlock_irqrestore(&io_request_lock, flags); - return ide_stopped; - } - } else { - unsigned long flags; - char *buffer = ide_map_buffer(rq, &flags); - ide_set_handler (drive, &write_intr, WAIT_CMD, NULL); - idedisk_output_data(drive, buffer, SECTOR_WORDS); - ide_unmap_buffer(buffer, &flags); - } - return ide_started; - } - printk(KERN_ERR "%s: bad command: %d\n", drive->name, rq->cmd); - ide_end_request(0, HWGROUP(drive)); - return ide_stopped; -} - -#endif /* __TASKFILE__IO */ +#endif /* CONFIG_IDE_TASKFILE_IO */ static int idedisk_open (struct inode *inode, struct file *filp, ide_drive_t *drive) { MOD_INC_USE_COUNT; if (drive->removable && drive->usage == 1) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - taskfile.command = WIN_DOORLOCK; + ide_task_t args; + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_DOORLOCK; + args.command_type = ide_cmd_type_parser(&args); check_disk_change(inode->i_rdev); /* * Ignore the return code from door_lock, * since the open() has already succeeded, * and the door_lock is irrelevant at this point. */ - if (drive->doorlocking && ide_wait_taskfile(drive, &taskfile, &hobfile, NULL)) + if (drive->doorlocking && ide_raw_taskfile(drive, &args, NULL)) drive->doorlocking = 0; } return 0; @@ -743,13 +735,12 @@ static void idedisk_release (struct inode *inode, struct file *filp, ide_drive_t *drive) { if (drive->removable && !drive->usage) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - taskfile.command = WIN_DOORUNLOCK; + ide_task_t args; + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_DOORUNLOCK; + args.command_type = ide_cmd_type_parser(&args); invalidate_bdev(inode->i_bdev, 0); - if (drive->doorlocking && ide_wait_taskfile(drive, &taskfile, &hobfile, NULL)) + if (drive->doorlocking && ide_raw_taskfile(drive, &args, NULL)) drive->doorlocking = 0; } if ((drive->id->cfs_enable_2 & 0x3000) && drive->wcache) @@ -761,7 +752,8 @@ static int idedisk_media_change (ide_drive_t *drive) { - return drive->removable; /* if removable, always assume it was changed */ + /* if removable, always assume it was changed */ + return drive->removable; } static void idedisk_revalidate (ide_drive_t *drive) @@ -771,6 +763,198 @@ current_capacity(drive)); } +static int idedisk_end_request (ide_drive_t *drive, int uptodate) +{ + struct request *rq; + unsigned long flags; + int ret = 1; + + spin_lock_irqsave(&io_request_lock, flags); + rq = HWGROUP(drive)->rq; + + /* + * decide whether to reenable DMA -- 3 is a random magic for now, + * if we DMA timeout more than 3 times, just stay in PIO + */ + if (drive->state == DMA_PIO_RETRY && drive->retry_pio <= 3) { + drive->state = 0; + HWGROUP(drive)->hwif->ide_dma_on(drive); + } + + if (!end_that_request_first(rq, uptodate, drive->name)) { + add_blkdev_randomness(MAJOR(rq->rq_dev)); + blkdev_dequeue_request(rq); + HWGROUP(drive)->rq = NULL; + end_that_request_last(rq); + ret = 0; + } + + spin_unlock_irqrestore(&io_request_lock, flags); + return ret; +} + +static u8 idedisk_dump_status (ide_drive_t *drive, const char *msg, u8 stat) +{ + ide_hwif_t *hwif = HWIF(drive); + unsigned long flags; + u8 err = 0; + + local_irq_set(flags); + printk("%s: %s: status=0x%02x", drive->name, msg, stat); +#if FANCY_STATUS_DUMPS + printk(" { "); + if (stat & BUSY_STAT) + printk("Busy "); + else { + if (stat & READY_STAT) printk("DriveReady "); + if (stat & WRERR_STAT) printk("DeviceFault "); + if (stat & SEEK_STAT) printk("SeekComplete "); + if (stat & DRQ_STAT) printk("DataRequest "); + if (stat & ECC_STAT) printk("CorrectedError "); + if (stat & INDEX_STAT) printk("Index "); + if (stat & ERR_STAT) printk("Error "); + } + printk("}"); +#endif /* FANCY_STATUS_DUMPS */ + printk("\n"); + if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) { + err = hwif->INB(IDE_ERROR_REG); + printk("%s: %s: error=0x%02x", drive->name, msg, err); +#if FANCY_STATUS_DUMPS + printk(" { "); + if (err & ABRT_ERR) printk("DriveStatusError "); + if (err & ICRC_ERR) + printk("Bad%s ", (err & ABRT_ERR) ? "CRC" : "Sector"); + if (err & ECC_ERR) printk("UncorrectableError "); + if (err & ID_ERR) printk("SectorIdNotFound "); + if (err & TRK0_ERR) printk("TrackZeroNotFound "); + if (err & MARK_ERR) printk("AddrMarkNotFound "); + printk("}"); + if ((err & (BBD_ERR | ABRT_ERR)) == BBD_ERR || + (err & (ECC_ERR|ID_ERR|MARK_ERR))) { + if (drive->addressing == 1) { + __u64 sectors = 0; + u32 low = 0, high = 0; + low = idedisk_read_24(drive); + hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG); + high = idedisk_read_24(drive); + sectors = ((__u64)high << 24) | low; + printk(", LBAsect=%llu, high=%d, low=%d", + (unsigned long long) sectors, + high, low); + } else { + u8 cur = hwif->INB(IDE_SELECT_REG); + if (cur & 0x40) { /* using LBA? */ + printk(", LBAsect=%ld", (unsigned long) + ((cur&0xf)<<24) + |(hwif->INB(IDE_HCYL_REG)<<16) + |(hwif->INB(IDE_LCYL_REG)<<8) + | hwif->INB(IDE_SECTOR_REG)); + } else { + printk(", CHS=%d/%d/%d", + (hwif->INB(IDE_HCYL_REG)<<8) + + hwif->INB(IDE_LCYL_REG), + cur & 0xf, + hwif->INB(IDE_SECTOR_REG)); + } + } + if (HWGROUP(drive) && HWGROUP(drive)->rq) + printk(", sector=%ld", + HWGROUP(drive)->rq->sector); + } + } +#endif /* FANCY_STATUS_DUMPS */ + printk("\n"); + local_irq_restore(flags); + return err; +} + +ide_startstop_t idedisk_error (ide_drive_t *drive, const char *msg, u8 stat) +{ + ide_hwif_t *hwif; + struct request *rq; + u8 err; + int i = (drive->mult_count ? drive->mult_count : 1) * SECTOR_WORDS; + + err = idedisk_dump_status(drive, msg, stat); + + if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL) + return ide_stopped; + + hwif = HWIF(drive); + /* retry only "normal" I/O: */ + switch (rq->cmd) { + case IDE_DRIVE_CMD: + case IDE_DRIVE_TASK: + case IDE_DRIVE_TASKFILE: + rq->errors = 1; + ide_end_drive_cmd(drive, stat, err); + return ide_stopped; +#if 0 + case IDE_DRIVE_TASKFILE: + rq->errors = 1; + ide_end_taskfile(drive, stat, err); + return ide_stopped; +#endif + default: + break; + } + + if (stat & BUSY_STAT || ((stat & WRERR_STAT) && !drive->nowerr)) { + /* other bits are useless when BUSY */ + rq->errors |= ERROR_RESET; + } else if (stat & ERR_STAT) { + /* err has different meaning on cdrom and tape */ + if (err == ABRT_ERR) { + if (drive->select.b.lba && + /* some newer drives don't support WIN_SPECIFY */ + hwif->INB(IDE_COMMAND_REG) == WIN_SPECIFY) + return ide_stopped; + } else if ((err & BAD_CRC) == BAD_CRC) { + /* UDMA crc error, just retry the operation */ + drive->crc_count++; + } else if (err & (BBD_ERR | ECC_ERR)) { + /* retries won't help these */ + rq->errors = ERROR_MAX; + } else if (err & TRK0_ERR) { + /* help it find track zero */ + rq->errors |= ERROR_RECAL; + } + } + if ((stat & DRQ_STAT) && rq->cmd != WRITE) { + /* + * try_to_flush_leftover_data() is invoked in response to + * a drive unexpectedly having its DRQ_STAT bit set. As + * an alternative to resetting the drive, this routine + * tries to clear the condition by read a sector's worth + * of data from the drive. Of course, this may not help + * if the drive is *waiting* for data from *us*. + */ + while (i > 0) { + u32 buffer[16]; + unsigned int wcount = (i > 16) ? 16 : i; + i -= wcount; + taskfile_input_data(drive, buffer, wcount); + } + } + if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT)) { + /* force an abort */ + hwif->OUTB(WIN_IDLEIMMEDIATE,IDE_COMMAND_REG); + } + if (rq->errors >= ERROR_MAX) + DRIVER(drive)->end_request(drive, 0); + else { + if ((rq->errors & ERROR_RESET) == ERROR_RESET) { + ++rq->errors; + return ide_do_reset(drive); + } + if ((rq->errors & ERROR_RECAL) == ERROR_RECAL) + drive->special.b.recalibrate = 1; + ++rq->errors; + } + return ide_stopped; +} + /* * Queries for true maximum capacity of the drive. * Returns maximum LBA address (> 0) of the drive, 0 if failed. @@ -780,16 +964,11 @@ ide_task_t args; unsigned long addr = 0; - if (!(drive->id->command_set_1 & 0x0400) && - !(drive->id->cfs_enable_2 & 0x0100)) - return addr; - /* Create IDE/ATA command request structure */ memset(&args, 0, sizeof(ide_task_t)); args.tfRegister[IDE_SELECT_OFFSET] = 0x40; args.tfRegister[IDE_COMMAND_OFFSET] = WIN_READ_NATIVE_MAX; - args.handler = task_no_data_intr; - + args.command_type = ide_cmd_type_parser(&args); /* submit command request */ ide_raw_taskfile(drive, &args, NULL); @@ -814,8 +993,7 @@ args.tfRegister[IDE_SELECT_OFFSET] = 0x40; args.tfRegister[IDE_COMMAND_OFFSET] = WIN_READ_NATIVE_MAX_EXT; - args.handler = task_no_data_intr; - + args.command_type = ide_cmd_type_parser(&args); /* submit command request */ ide_raw_taskfile(drive, &args, NULL); @@ -851,7 +1029,7 @@ args.tfRegister[IDE_HCYL_OFFSET] = ((addr_req >> 16) & 0xff); args.tfRegister[IDE_SELECT_OFFSET] = ((addr_req >> 24) & 0x0f) | 0x40; args.tfRegister[IDE_COMMAND_OFFSET] = WIN_SET_MAX; - args.handler = task_no_data_intr; + args.command_type = ide_cmd_type_parser(&args); /* submit command request */ ide_raw_taskfile(drive, &args, NULL); /* if OK, read new maximum address value */ @@ -883,7 +1061,7 @@ args.hobRegister[IDE_HCYL_OFFSET_HOB] = ((addr_req >>= 8) & 0xff); args.hobRegister[IDE_SELECT_OFFSET_HOB] = 0x40; args.hobRegister[IDE_CONTROL_OFFSET_HOB]= (drive->ctl|0x80); - args.handler = task_no_data_intr; + args.command_type = ide_cmd_type_parser(&args); /* submit command request */ ide_raw_taskfile(drive, &args, NULL); /* if OK, compute maximum address value */ @@ -899,6 +1077,8 @@ return addr_set; } +#endif /* CONFIG_IDEDISK_STROKE */ + /* * Tests if the drive supports Host Protected Area feature. * Returns true if supported, false otherwise. @@ -906,12 +1086,11 @@ static inline int idedisk_supports_host_protected_area(ide_drive_t *drive) { int flag = (drive->id->cfs_enable_1 & 0x0400) ? 1 : 0; - printk("%s: host protected area => %d\n", drive->name, flag); + if (flag) + printk("%s: host protected area => %d\n", drive->name, flag); return flag; } -#endif /* CONFIG_IDEDISK_STROKE */ - /* * Compute drive->capacity, the full capacity of the drive * Called with drive->id != NULL. @@ -937,6 +1116,8 @@ drive->capacity48 = 0; drive->select.b.lba = 0; + (void) idedisk_supports_host_protected_area(drive); + if (id->cfs_enable_2 & 0x0400) { capacity_2 = id->lba_capacity_2; drive->head = drive->bios_head = 255; @@ -959,6 +1140,7 @@ drive->name, set_max_ext, capacity_2); #endif /* CONFIG_IDEDISK_STROKE */ } + drive->cyl = (unsigned int) capacity_2 / (drive->head * drive->sect); drive->bios_cyl = drive->cyl; drive->capacity48 = capacity_2; drive->capacity = (unsigned long) capacity_2; @@ -989,7 +1171,7 @@ drive->capacity = capacity; if ((id->command_set_2 & 0x0400) && (id->cfs_enable_2 & 0x0400)) { - drive->capacity48 = id->lba_capacity_2; + drive->capacity48 = id->lba_capacity_2; drive->head = 255; drive->sect = 63; drive->cyl = (unsigned long)(drive->capacity48) / (drive->head * drive->sect); @@ -1008,47 +1190,40 @@ special_t *s = &drive->special; if (s->b.set_geometry) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - ide_handler_t *handler = NULL; - - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - s->b.set_geometry = 0; - taskfile.sector_number = drive->sect; - taskfile.low_cylinder = drive->cyl; - taskfile.high_cylinder = drive->cyl>>8; - taskfile.device_head = ((drive->head-1)|drive->select.all)&0xBF; if (!IS_PDC4030_DRIVE) { - taskfile.sector_count = drive->sect; - taskfile.command = WIN_SPECIFY; - handler = ide_handler_parser(&taskfile, &hobfile); + ide_task_t args; + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_NSECTOR_OFFSET] = drive->sect; + args.tfRegister[IDE_SECTOR_OFFSET] = drive->sect; + args.tfRegister[IDE_LCYL_OFFSET] = drive->cyl; + args.tfRegister[IDE_HCYL_OFFSET] = drive->cyl>>8; + args.tfRegister[IDE_SELECT_OFFSET] = ((drive->head-1)|drive->select.all)&0xBF; + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_SPECIFY; + args.command_type = ide_cmd_type_parser(&args); + do_rw_taskfile(drive, &args); } - do_taskfile(drive, &taskfile, &hobfile, handler); } else if (s->b.recalibrate) { s->b.recalibrate = 0; if (!IS_PDC4030_DRIVE) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - taskfile.sector_count = drive->sect; - taskfile.command = WIN_RESTORE; - do_taskfile(drive, &taskfile, &hobfile, ide_handler_parser(&taskfile, &hobfile)); + ide_task_t args; + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_NSECTOR_OFFSET] = drive->sect; + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_RESTORE; + args.command_type = ide_cmd_type_parser(&args); + do_rw_taskfile(drive, &args); } } else if (s->b.set_multmode) { s->b.set_multmode = 0; if (drive->id && drive->mult_req > drive->id->max_multsect) drive->mult_req = drive->id->max_multsect; if (!IS_PDC4030_DRIVE) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - taskfile.sector_count = drive->mult_req; - taskfile.command = WIN_SETMULT; - do_taskfile(drive, &taskfile, &hobfile, ide_handler_parser(&taskfile, &hobfile)); + ide_task_t args; + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_NSECTOR_OFFSET] = drive->mult_req; + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_SETMULT; + args.command_type = ide_cmd_type_parser(&args); + do_rw_taskfile(drive, &args); } } else if (s->all) { int special = s->all; @@ -1078,45 +1253,44 @@ static int smart_enable(ide_drive_t *drive) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - taskfile.feature = SMART_ENABLE; - taskfile.low_cylinder = SMART_LCYL_PASS; - taskfile.high_cylinder = SMART_HCYL_PASS; - taskfile.command = WIN_SMART; - return ide_wait_taskfile(drive, &taskfile, &hobfile, NULL); -} - -static int get_smart_values(ide_drive_t *drive, byte *buf) -{ - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - taskfile.feature = SMART_READ_VALUES; - taskfile.sector_count = 0x01; - taskfile.low_cylinder = SMART_LCYL_PASS; - taskfile.high_cylinder = SMART_HCYL_PASS; - taskfile.command = WIN_SMART; + ide_task_t args; + + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_FEATURE_OFFSET] = SMART_ENABLE; + args.tfRegister[IDE_LCYL_OFFSET] = SMART_LCYL_PASS; + args.tfRegister[IDE_HCYL_OFFSET] = SMART_HCYL_PASS; + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_SMART; + args.command_type = ide_cmd_type_parser(&args); + return ide_raw_taskfile(drive, &args, NULL); +} + +static int get_smart_values(ide_drive_t *drive, u8 *buf) +{ + ide_task_t args; + + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_FEATURE_OFFSET] = SMART_READ_VALUES; + args.tfRegister[IDE_NSECTOR_OFFSET] = 0x01; + args.tfRegister[IDE_LCYL_OFFSET] = SMART_LCYL_PASS; + args.tfRegister[IDE_HCYL_OFFSET] = SMART_HCYL_PASS; + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_SMART; + args.command_type = ide_cmd_type_parser(&args); (void) smart_enable(drive); - return ide_wait_taskfile(drive, &taskfile, &hobfile, buf); + return ide_raw_taskfile(drive, &args, buf); } -static int get_smart_thresholds(ide_drive_t *drive, byte *buf) +static int get_smart_thresholds(ide_drive_t *drive, u8 *buf) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - taskfile.feature = SMART_READ_THRESHOLDS; - taskfile.sector_count = 0x01; - taskfile.low_cylinder = SMART_LCYL_PASS; - taskfile.high_cylinder = SMART_HCYL_PASS; - taskfile.command = WIN_SMART; + ide_task_t args; + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_FEATURE_OFFSET] = SMART_READ_THRESHOLDS; + args.tfRegister[IDE_NSECTOR_OFFSET] = 0x01; + args.tfRegister[IDE_LCYL_OFFSET] = SMART_LCYL_PASS; + args.tfRegister[IDE_HCYL_OFFSET] = SMART_HCYL_PASS; + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_SMART; + args.command_type = ide_cmd_type_parser(&args); (void) smart_enable(drive); - return ide_wait_taskfile(drive, &taskfile, &hobfile, buf); + return ide_raw_taskfile(drive, &args, buf); } static int proc_idedisk_read_cache @@ -1185,23 +1359,12 @@ #endif /* CONFIG_PROC_FS */ +/* + * This is tightly woven into the driver->do_special can not touch. + * DON'T do it again until a total personality rewrite is committed. + */ static int set_multcount(ide_drive_t *drive, int arg) { -#ifdef __TASKFILE__IO - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - - if (drive->special.b.set_multmode) - return -EBUSY; - - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - taskfile.sector_count = drive->mult_req; - taskfile.command = WIN_SETMULT; - drive->mult_req = arg; - drive->special.b.set_multmode = 1; - ide_wait_taskfile(drive, &taskfile, &hobfile, NULL); -#else /* !__TASKFILE__IO */ struct request rq; if (drive->special.b.set_multmode) @@ -1211,7 +1374,6 @@ drive->mult_req = arg; drive->special.b.set_multmode = 1; (void) ide_do_drive_cmd (drive, &rq, ide_wait); -#endif /* __TASKFILE__IO */ return (drive->mult_count == arg) ? 0 : -EIO; } @@ -1227,57 +1389,112 @@ static int write_cache (ide_drive_t *drive, int arg) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - taskfile.feature = (arg) ? SETFEATURES_EN_WCACHE : SETFEATURES_DIS_WCACHE; - taskfile.command = WIN_SETFEATURES; + ide_task_t args; if (!(drive->id->cfs_enable_2 & 0x3000)) return 1; - (void) ide_wait_taskfile(drive, &taskfile, &hobfile, NULL); + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_FEATURE_OFFSET] = (arg) ? + SETFEATURES_EN_WCACHE : SETFEATURES_DIS_WCACHE; + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_SETFEATURES; + args.command_type = ide_cmd_type_parser(&args); + (void) ide_raw_taskfile(drive, &args, NULL); + drive->wcache = arg; return 0; } +static int call_idedisk_standby (ide_drive_t *drive, int arg) +{ + ide_task_t args; + u8 standby = (arg) ? WIN_STANDBYNOW2 : WIN_STANDBYNOW1; + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_COMMAND_OFFSET] = standby; + args.command_type = ide_cmd_type_parser(&args); + return ide_raw_taskfile(drive, &args, NULL); +} + static int do_idedisk_standby (ide_drive_t *drive) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - taskfile.command = WIN_STANDBYNOW1; - return ide_wait_taskfile(drive, &taskfile, &hobfile, NULL); + return call_idedisk_standby(drive, 0); +} + +static int call_idedisk_suspend (ide_drive_t *drive, int arg) +{ + ide_task_t args; + u8 suspend = (arg) ? WIN_SLEEPNOW2 : WIN_SLEEPNOW1; + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_COMMAND_OFFSET] = suspend; + args.command_type = ide_cmd_type_parser(&args); + return ide_raw_taskfile(drive, &args, NULL); +} + +static int do_idedisk_suspend (ide_drive_t *drive) +{ + if (drive->suspend_reset) + return 1; + + return call_idedisk_suspend(drive, 0); +} + +#if 0 +static int call_idedisk_checkpower (ide_drive_t *drive, int arg) +{ + ide_task_t args; + u8 ckpw = (arg) ? WIN_CHECKPOWERMODE2 : WIN_CHECKPOWERMODE1; + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_COMMAND_OFFSET] = ckpw; + args.command_type = ide_cmd_type_parser(&args); + ide_raw_taskfile(drive, &args, NULL); +#if 0 +if (errno != EIO || args[0] != 0 || args[1] != 0) + state = "unknown"; +else + state = "sleeping"; +} else { + state = (args[2] == 255) ? "active/idle" : "standby"; +#endif + return 0; +} + +static int do_idedisk_checkpower (ide_drive_t *drive) +{ + return call_idedisk_checkpower(drive, 0); +} +#endif + +static int do_idedisk_resume (ide_drive_t *drive) +{ + if (!drive->suspend_reset) + return 1; + return 0; } static int do_idedisk_flushcache (ide_drive_t *drive) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - if (drive->id->cfs_enable_2 & 0x2400) { - taskfile.command = WIN_FLUSH_CACHE_EXT; - } else { - taskfile.command = WIN_FLUSH_CACHE; - } - return ide_wait_taskfile(drive, &taskfile, &hobfile, NULL); + ide_task_t args; + + memset(&args, 0, sizeof(ide_task_t)); + if (drive->id->cfs_enable_2 & 0x2400) + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_FLUSH_CACHE_EXT; + else + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_FLUSH_CACHE; + args.command_type = ide_cmd_type_parser(&args); + return ide_raw_taskfile(drive, &args, NULL); } static int set_acoustic (ide_drive_t *drive, int arg) { - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - - taskfile.feature = (arg)?SETFEATURES_EN_AAM:SETFEATURES_DIS_AAM; - taskfile.sector_count = arg; + ide_task_t args; - taskfile.command = WIN_SETFEATURES; - (void) ide_wait_taskfile(drive, &taskfile, &hobfile, NULL); + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_FEATURE_OFFSET] = (arg) ? SETFEATURES_EN_AAM : + SETFEATURES_DIS_AAM; + args.tfRegister[IDE_NSECTOR_OFFSET] = arg; + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_SETFEATURES; + args.command_type = ide_cmd_type_parser(&args); + ide_raw_taskfile(drive, &args, NULL); drive->acoustic = arg; return 0; } @@ -1286,9 +1503,11 @@ { drive->addressing = 0; + if (HWIF(drive)->addressing) + return 0; + if (!(drive->id->cfs_enable_2 & 0x0400)) return -EIO; - drive->addressing = arg; return 0; } @@ -1321,12 +1540,35 @@ ide_add_setting(drive, "max_failures", SETTING_RW, -1, -1, TYPE_INT, 0, 65535, 1, 1, &drive->max_failures, NULL); } +static int idedisk_ioctl (ide_drive_t *drive, struct inode *inode, + struct file *file, unsigned int cmd, unsigned long arg) +{ +#if 0 +HDIO_GET_ADDRESS +HDIO_SET_ADDRESS +HDIO_GET_WCACHE +HDIO_SET_WCACHE +HDIO_GET_ACOUSTIC +HDIO_SET_ACOUSTIC +HDIO_GET_MULTCOUNT +HDIO_SET_MULTCOUNT +HDIO_GET_NOWERR +HDIO_SET_NOWERR +#endif + return -EINVAL; +} + static void idedisk_setup (ide_drive_t *drive) { int i; struct hd_driveid *id = drive->id; unsigned long capacity; + +#if 0 + if (IS_PDC4030_DRIVE) + DRIVER(drive)->do_request = promise_rw_disk; +#endif idedisk_add_settings(drive); @@ -1337,7 +1579,7 @@ * CompactFlash cards and their brethern look just like hard drives * to us, but they are removable and don't have a doorlock mechanism. */ - if (drive->removable && !drive_is_flashcard(drive)) { + if (drive->removable && !(drive->is_flash)) { /* * Removable disks (eg. SYQUEST); ignore 'WD' drives */ @@ -1355,6 +1597,14 @@ break; } +#if 1 + (void) probe_lba_addressing(drive, 1); +#else + /* if using 48-bit addressing bump the request size up */ + if (probe_lba_addressing(drive, 1)) + blk_queue_max_sectors(&drive->queue, 2048); +#endif + /* Extract geometry if we did not already have one for the drive */ if (!drive->cyl || !drive->head || !drive->sect) { drive->cyl = drive->bios_cyl = id->cyls; @@ -1402,7 +1652,7 @@ drive->bios_cyl, drive->bios_head, drive->bios_sect); #ifdef CONFIG_BLK_DEV_IDEDMA if (drive->using_dma) - (void) HWIF(drive)->dmaproc(ide_dma_verbose, drive); + (void) HWIF(drive)->ide_dma_verbose(drive); #endif /* CONFIG_BLK_DEV_IDEDMA */ printk("\n"); @@ -1424,7 +1674,6 @@ drive->no_io_32bit = id->dword_io ? 1 : 0; if (drive->id->cfs_enable_2 & 0x3000) write_cache(drive, (id->cfs_enable_2 & 0x3000)); - (void) probe_lba_addressing(drive, 1); } static int idedisk_cleanup (ide_drive_t *drive) @@ -1436,7 +1685,8 @@ return ide_unregister_subdriver(drive); } -int idedisk_reinit(ide_drive_t *drive); +int idedisk_init (void); +int idedisk_attach(ide_drive_t *drive); /* * IDE subdriver functions, registered with ide.c @@ -1450,10 +1700,14 @@ supports_dsc_overlap: 0, cleanup: idedisk_cleanup, standby: do_idedisk_standby, + suspend: do_idedisk_suspend, + resume: do_idedisk_resume, flushcache: do_idedisk_flushcache, do_request: do_rw_disk, - end_request: NULL, - ioctl: NULL, + end_request: idedisk_end_request, + sense: idedisk_dump_status, + error: idedisk_error, + ioctl: idedisk_ioctl, open: idedisk_open, release: idedisk_release, media_change: idedisk_media_change, @@ -1462,12 +1716,12 @@ capacity: idedisk_capacity, special: idedisk_special, proc: idedisk_proc, - reinit: idedisk_reinit, + init: idedisk_init, + attach: idedisk_attach, ata_prebuilder: NULL, atapi_prebuilder: NULL, }; -int idedisk_init (void); static ide_module_t idedisk_module = { IDE_DRIVER_MODULE, idedisk_init, @@ -1477,30 +1731,30 @@ MODULE_DESCRIPTION("ATA DISK Driver"); -int idedisk_reinit (ide_drive_t *drive) +int idedisk_attach (ide_drive_t *drive) { - int failed = 0; + int ret = 0; MOD_INC_USE_COUNT; - - if (ide_register_subdriver (drive, &idedisk_driver, IDE_SUBDRIVER_VERSION)) { - printk (KERN_ERR "ide-disk: %s: Failed to register the driver with ide.c\n", drive->name); - return 1; + if (ide_register_subdriver(drive, + &idedisk_driver, IDE_SUBDRIVER_VERSION)) { + printk(KERN_ERR "ide-disk: %s: Failed to register the " + "driver with ide.c\n", drive->name); + ret= 1; + goto bye_game_over; } DRIVER(drive)->busy++; idedisk_setup(drive); if ((!drive->head || drive->head > 16) && !drive->select.b.lba) { - printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n", drive->name, drive->head); + printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n", + drive->name, drive->head); (void) idedisk_cleanup(drive); - DRIVER(drive)->busy--; - return 1; + ret= 1; } DRIVER(drive)->busy--; - failed--; - - ide_register_module(&idedisk_module); +bye_game_over: MOD_DEC_USE_COUNT; - return 0; + return ret; } static void __exit idedisk_exit (void) @@ -1508,14 +1762,17 @@ ide_drive_t *drive; int failed = 0; - while ((drive = ide_scan_devices (ide_disk, idedisk_driver.name, &idedisk_driver, failed)) != NULL) { + while ((drive = ide_scan_devices(ide_disk, idedisk_driver.name, + &idedisk_driver, failed)) != NULL) { if (idedisk_cleanup (drive)) { - printk (KERN_ERR "%s: cleanup_module() called while still busy\n", drive->name); + printk(KERN_ERR "%s: cleanup_module() called while " + "still busy\n", drive->name); failed++; } - /* We must remove proc entries defined in this module. - Otherwise we oops while accessing these entries */ #ifdef CONFIG_PROC_FS + /* We must remove proc entries defined in this module. + * Otherwise we oops while accessing these entries + */ if (drive->proc) ide_remove_proc_entries(drive->proc, idedisk_proc); #endif @@ -1525,19 +1782,28 @@ int idedisk_init (void) { +#ifdef CLASSIC_BUILTINS_METHOD ide_drive_t *drive; int failed = 0; - +#endif /* CLASSIC_BUILTINS_METHOD */ + MOD_INC_USE_COUNT; - while ((drive = ide_scan_devices (ide_disk, idedisk_driver.name, NULL, failed++)) != NULL) { - if (ide_register_subdriver (drive, &idedisk_driver, IDE_SUBDRIVER_VERSION)) { - printk (KERN_ERR "ide-disk: %s: Failed to register the driver with ide.c\n", drive->name); + +#ifdef CLASSIC_BUILTINS_METHOD + while ((drive = ide_scan_devices(ide_disk, + idedisk_driver.name, NULL, failed++)) != NULL) { + if (ide_register_subdriver(drive, + &idedisk_driver, IDE_SUBDRIVER_VERSION)) { + printk(KERN_ERR "ide-disk: %s: Failed to register " + "the driver with ide.c\n", drive->name); continue; } DRIVER(drive)->busy++; idedisk_setup(drive); - if ((!drive->head || drive->head > 16) && !drive->select.b.lba) { - printk(KERN_ERR "%s: INVALID GEOMETRY: %d PHYSICAL HEADS?\n", drive->name, drive->head); + if ((!drive->head || drive->head > 16) && + (!drive->select.b.lba)) { + printk(KERN_ERR "%s: INVALID GEOMETRY: %d " + "PHYSICAL HEADS?\n", drive->name, drive->head); (void) idedisk_cleanup(drive); DRIVER(drive)->busy--; continue; @@ -1545,11 +1811,85 @@ DRIVER(drive)->busy--; failed--; } +#endif /* CLASSIC_BUILTINS_METHOD */ + ide_register_module(&idedisk_module); MOD_DEC_USE_COUNT; return 0; } +ide_startstop_t panic_box(ide_drive_t *drive) +{ +#if 0 + panic("%s: Attempted to corrupt something: ide operation " +#else + printk(KERN_ERR "%s: Attempted to corrupt something: ide operation " +#endif + "was pending accross suspend/resume.\n", drive->name); + return ide_stopped; +} + +int ide_disks_busy(void) +{ + int i; + for (i=0; ihandler) && (hwgroup->handler != panic_box)) + return 1; + } + return 0; +} + +void ide_disk_suspend(void) +{ + int i; + while (ide_disks_busy()) { + printk("*"); + schedule(); + } + for (i=0; ihandler_save = hwgroup->handler; + hwgroup->handler = panic_box; + } + driver_blocked = 1; + if (ide_disks_busy()) + panic("How did you get that request through?!"); +} + +/* unsuspend and resume should be equal in the ideal world */ + +void ide_disk_unsuspend(void) +{ + int i; + for (i=0; ihandler = NULL; /* hwgroup->handler_save; */ + hwgroup->handler_save = NULL; + } + driver_blocked = 0; +} + +void ide_disk_resume(void) +{ + int i; + for (i=0; ihandler != panic_box) + panic("Handler was not set to panic?"); + hwgroup->handler_save = NULL; + hwgroup->handler = NULL; + } + driver_blocked = 0; +} + module_init(idedisk_init); module_exit(idedisk_exit); MODULE_LICENSE("GPL"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-dma.c linux.20pre5-ac2/drivers/ide/ide-dma.c --- linux.20pre5/drivers/ide/ide-dma.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-dma.c 2002-09-01 18:46:26.000000000 +0100 @@ -70,14 +70,13 @@ * * And, yes, Intel Zappa boards really *do* use both PIIX IDE ports. * - * check_drive_lists(ide_drive_t *drive, int good_bad) - * * ATA-66/100 and recovery functions, I forgot the rest...... - * SELECT_READ_WRITE(hwif,drive,func) for active tuning based on IO direction. * */ #include +#define __NO_VERSION__ +#include #include #include #include @@ -86,23 +85,11 @@ #include #include #include +#include #include #include -/* - * Long lost data from 2.0.34 that is now in 2.0.39 - * - * This was used in ./drivers/block/triton.c to do DMA Base address setup - * when PnP failed. Oh the things we forget. I believe this was part - * of SFF-8038i that has been withdrawn from public access... :-(( - */ -#define DEFAULT_BMIBA 0xe800 /* in case BIOS did not init it */ -#define DEFAULT_BMCRBA 0xcc00 /* VIA's default value */ -#define DEFAULT_BMALIBA 0xd400 /* ALI's default value */ - -extern char *ide_dmafunc_verbose(ide_dma_action_t dmafunc); - #ifdef CONFIG_IDEDMA_NEW_DRIVE_LISTINGS struct drive_list_entry { @@ -123,7 +110,6 @@ { "WDC AC11000H" , "ALL" }, { "WDC AC22100H" , "ALL" }, - { "WDC AC31000H" , "ALL" }, { "WDC AC32500H" , "ALL" }, { "WDC AC33100H" , "ALL" }, { "WDC AC31600H" , "ALL" }, @@ -204,102 +190,68 @@ #endif /* CONFIG_IDEDMA_NEW_DRIVE_LISTINGS */ /* - * Our Physical Region Descriptor (PRD) table should be large enough - * to handle the biggest I/O request we are likely to see. Since requests - * can have no more than 256 sectors, and since the typical blocksize is - * two or more sectors, we could get by with a limit of 128 entries here for - * the usual worst case. Most requests seem to include some contiguous blocks, - * further reducing the number of table entries required. - * - * The driver reverts to PIO mode for individual requests that exceed - * this limit (possible with 512 byte blocksizes, eg. MSDOS f/s), so handling - * 100% of all crazy scenarios here is not necessary. - * - * As it turns out though, we must allocate a full 4KB page for this, - * so the two PRD tables (ide0 & ide1) will each get half of that, - * allowing each to have about 256 entries (8 bytes each) from this. - */ -#define PRD_BYTES 8 -#define PRD_ENTRIES (PAGE_SIZE / (2 * PRD_BYTES)) - -/* * dma_intr() is the handler for disk read/write DMA interrupts */ ide_startstop_t ide_dma_intr (ide_drive_t *drive) { int i; - byte stat, dma_stat; + u8 stat = 0, dma_stat = 0; - dma_stat = HWIF(drive)->dmaproc(ide_dma_end, drive); - stat = GET_STAT(); /* get drive status */ + dma_stat = HWIF(drive)->ide_dma_end(drive); + stat = HWIF(drive)->INB(IDE_STATUS_REG); /* get drive status */ if (OK_STAT(stat,DRIVE_READY,drive->bad_wstat|DRQ_STAT)) { if (!dma_stat) { struct request *rq = HWGROUP(drive)->rq; rq = HWGROUP(drive)->rq; for (i = rq->nr_sectors; i > 0;) { i -= rq->current_nr_sectors; - ide_end_request(1, HWGROUP(drive)); + DRIVER(drive)->end_request(drive, 1); } return ide_stopped; } printk("%s: dma_intr: bad DMA status (dma_stat=%x)\n", drive->name, dma_stat); } - return ide_error(drive, "dma_intr", stat); + return DRIVER(drive)->error(drive, "dma_intr", stat); } static int ide_build_sglist (ide_hwif_t *hwif, struct request *rq) { struct buffer_head *bh; struct scatterlist *sg = hwif->sg_table; - unsigned long lastdataend = ~0UL; int nents = 0; if (hwif->sg_dma_active) BUG(); - + if (rq->cmd == READ) hwif->sg_dma_direction = PCI_DMA_FROMDEVICE; else hwif->sg_dma_direction = PCI_DMA_TODEVICE; - bh = rq->bh; do { - struct scatterlist *sge; - - /* - * continue segment from before? - */ - if (bh_phys(bh) == lastdataend) { - sg[nents - 1].length += bh->b_size; - lastdataend += bh->b_size; - continue; - } + unsigned char *virt_addr = bh->b_data; + unsigned int size = bh->b_size; - /* - * start new segment - */ if (nents >= PRD_ENTRIES) return 0; - sge = &sg[nents]; - memset(sge, 0, sizeof(*sge)); - - if (bh->b_page) { - sge->page = bh->b_page; - sge->offset = bh_offset(bh); - } else { - if (((unsigned long) bh->b_data) < PAGE_SIZE) - BUG(); - - sge->address = bh->b_data; + while ((bh = bh->b_reqnext) != NULL) { + if ((virt_addr + size) != (unsigned char *) bh->b_data) + break; + size += bh->b_size; } - - sge->length = bh->b_size; - lastdataend = bh_phys(bh) + bh->b_size; + memset(&sg[nents], 0, sizeof(*sg)); + sg[nents].address = virt_addr; + sg[nents].length = size; + if(size == 0) + BUG(); nents++; - } while ((bh = bh->b_reqnext) != NULL); + } while (bh != NULL); + if(nents == 0) + BUG(); + return pci_map_sg(hwif->pci_dev, sg, nents, hwif->sg_dma_direction); } @@ -308,16 +260,14 @@ struct scatterlist *sg = hwif->sg_table; int nents = 0; ide_task_t *args = rq->special; - unsigned char *virt_addr = rq->buffer; + u8 *virt_addr = rq->buffer; int sector_count = rq->nr_sectors; -// if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_WRITEDMA) || -// (args->tfRegister[IDE_COMMAND_OFFSET] == WIN_WRITEDMA_EXT)) if (args->command_type == IDE_DRIVE_TASK_RAW_WRITE) hwif->sg_dma_direction = PCI_DMA_TODEVICE; else hwif->sg_dma_direction = PCI_DMA_FROMDEVICE; - +#if 1 if (sector_count > 128) { memset(&sg[nents], 0, sizeof(*sg)); sg[nents].address = virt_addr; @@ -330,7 +280,20 @@ sg[nents].address = virt_addr; sg[nents].length = sector_count * SECTOR_SIZE; nents++; - +#else + while (sector_count > 128) { + memset(&sg[nents], 0, sizeof(*sg)); + sg[nents].address = virt_addr; + sg[nents].length = 128 * SECTOR_SIZE; + nents++; + virt_addr = virt_addr + (128 * SECTOR_SIZE); + sector_count -= 128; + }; + memset(&sg[nents], 0, sizeof(*sg)); + sg[nents].address = virt_addr; + sg[nents].length = sector_count * SECTOR_SIZE; + nents++; +#endif return pci_map_sg(hwif->pci_dev, sg, nents, hwif->sg_dma_direction); } @@ -339,28 +302,25 @@ * Returns 0 if all went okay, returns 1 otherwise. * May also be invoked from trm290.c */ -int ide_build_dmatable (ide_drive_t *drive, ide_dma_action_t func) +int ide_build_dmatable (ide_drive_t *drive, struct request *rq) { - unsigned int *table = HWIF(drive)->dmatable_cpu; -#ifdef CONFIG_BLK_DEV_TRM290 - unsigned int is_trm290_chipset = (HWIF(drive)->chipset == ide_trm290); -#else - const int is_trm290_chipset = 0; -#endif + ide_hwif_t *hwif = HWIF(drive); + unsigned int *table = hwif->dmatable_cpu; + unsigned int is_trm290 = (hwif->chipset == ide_trm290) ? 1 : 0; unsigned int count = 0; int i; struct scatterlist *sg; - if (HWGROUP(drive)->rq->cmd == IDE_DRIVE_TASKFILE) - HWIF(drive)->sg_nents = i = ide_raw_build_sglist(HWIF(drive), HWGROUP(drive)->rq); + if (rq->cmd == IDE_DRIVE_TASKFILE) + hwif->sg_nents = i = ide_raw_build_sglist(hwif, rq); else - HWIF(drive)->sg_nents = i = ide_build_sglist(HWIF(drive), HWGROUP(drive)->rq); + hwif->sg_nents = i = ide_build_sglist(hwif, rq); if (!i) return 0; - sg = HWIF(drive)->sg_table; - while (i) { + sg = hwif->sg_table; + while (i && sg_dma_len(sg)) { u32 cur_addr; u32 cur_len; @@ -374,35 +334,36 @@ */ while (cur_len) { - u32 xcount, bcount = 0x10000 - (cur_addr & 0xffff); - - if (count++ >= PRD_ENTRIES) - BUG(); - - if (bcount > cur_len) - bcount = cur_len; - *table++ = cpu_to_le32(cur_addr); - xcount = bcount & 0xffff; - if (is_trm290_chipset) - xcount = ((xcount >> 2) - 1) << 16; - if (xcount == 0x0000) { - /* - * Most chipsets correctly interpret a length - * of 0x0000 as 64KB, but at least one - * (e.g. CS5530) misinterprets it as zero (!). - * So here we break the 64KB entry into two - * 32KB entries instead. - */ - if (count++ >= PRD_ENTRIES) - goto use_pio_instead; - - *table++ = cpu_to_le32(0x8000); - *table++ = cpu_to_le32(cur_addr + 0x8000); - xcount = 0x8000; + if (count++ >= PRD_ENTRIES) { + printk("%s: DMA table too small\n", drive->name); + goto use_pio_instead; + } else { + u32 xcount, bcount = 0x10000 - (cur_addr & 0xffff); + + if (bcount > cur_len) + bcount = cur_len; + *table++ = cpu_to_le32(cur_addr); + xcount = bcount & 0xffff; + if (is_trm290) + xcount = ((xcount >> 2) - 1) << 16; + if (xcount == 0x0000) { + /* + * Most chipsets correctly interpret a length of 0x0000 as 64KB, + * but at least one (e.g. CS5530) misinterprets it as zero (!). + * So here we break the 64KB entry into two 32KB entries instead. + */ + if (count++ >= PRD_ENTRIES) { + printk("%s: DMA table too small\n", drive->name); + goto use_pio_instead; + } + *table++ = cpu_to_le32(0x8000); + *table++ = cpu_to_le32(cur_addr + 0x8000); + xcount = 0x8000; + } + *table++ = cpu_to_le32(xcount); + cur_addr += bcount; + cur_len -= bcount; } - *table++ = cpu_to_le32(xcount); - cur_addr += bcount; - cur_len -= bcount; } sg++; @@ -410,17 +371,17 @@ } if (count) { - if (!is_trm290_chipset) + if (!is_trm290) *--table |= cpu_to_le32(0x80000000); return count; } printk("%s: empty DMA table?\n", drive->name); use_pio_instead: - pci_unmap_sg(HWIF(drive)->pci_dev, - HWIF(drive)->sg_table, - HWIF(drive)->sg_nents, - HWIF(drive)->sg_dma_direction); - HWIF(drive)->sg_dma_active = 0; + pci_unmap_sg(hwif->pci_dev, + hwif->sg_table, + hwif->sg_nents, + hwif->sg_dma_direction); + hwif->sg_dma_active = 0; return 0; /* revert to PIO for this request */ } @@ -435,50 +396,368 @@ HWIF(drive)->sg_dma_active = 0; } +static int config_drive_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + ide_hwif_t *hwif = HWIF(drive); + + if (id && (id->capability & 1) && hwif->autodma) { + /* Consult the list of known "bad" drives */ + if (hwif->ide_dma_bad_drive(drive)) + return hwif->ide_dma_off(drive); + + /* + * Enable DMA on any drive that has + * UltraDMA (mode 0/1/2/3/4/5/6) enabled + */ + if ((id->field_valid & 4) && ((id->dma_ultra >> 8) & 0x7f)) + return hwif->ide_dma_on(drive); + /* + * Enable DMA on any drive that has mode2 DMA + * (multi or single) enabled + */ + if (id->field_valid & 2) /* regular DMA */ + if ((id->dma_mword & 0x404) == 0x404 || + (id->dma_1word & 0x404) == 0x404) + return hwif->ide_dma_on(drive); + + /* Consult the list of known "good" drives */ + if (hwif->ide_dma_good_drive(drive)) + return hwif->ide_dma_on(drive); + } + return hwif->ide_dma_off_quietly(drive); +} + /* - * For both Blacklisted and Whitelisted drives. - * This is setup to be called as an extern for future support - * to other special driver code. + * 1 dmaing, 2 error, 4 intr */ -int check_drive_lists (ide_drive_t *drive, int good_bad) +static int dma_timer_expiry (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 dma_stat = hwif->INB(hwif->dma_status); + + printk("%s: dma_timer_expiry: dma status == 0x%02x\n", + drive->name, dma_stat); + + if ((dma_stat & 0x18) == 0x18) /* BUSY Stupid Early Timer !! */ + return WAIT_CMD; + + HWGROUP(drive)->expiry = NULL; /* one free ride for now */ + + if (dma_stat & 2) { /* ERROR */ + (void) hwif->ide_dma_end(drive); + return DRIVER(drive)->error(drive, + "dma_timer_expiry", hwif->INB(IDE_STATUS_REG)); + } + if (dma_stat & 1) /* DMAing */ + return WAIT_CMD; + + if (dma_stat & 4) /* Got an Interrupt */ + HWGROUP(drive)->handler(drive); + + return 0; +} + +static void ide_toggle_bounce(ide_drive_t *drive, int on) +{ +#if 0 + u64 addr = BLK_BOUNCE_HIGH; /* dma64_addr_t */ + + if (on && drive->media == ide_disk) { + if (!PCI_DMA_BUS_IS_PHYS) + addr = BLK_BOUNCE_ANY; + else + addr = HWIF(drive)->pci_dev->dma_mask; + } + + blk_queue_bounce_limit(&drive->queue, addr); +#endif +} + +int __ide_dma_host_off (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 unit = (drive->select.b.unit & 0x01); + u8 dma_stat = hwif->INB(hwif->dma_status); + + hwif->OUTB((dma_stat & ~(1<<(5+unit))), hwif->dma_status); + return 0; +} + +EXPORT_SYMBOL(__ide_dma_host_off); + +int __ide_dma_off_quietly (ide_drive_t *drive) +{ + drive->using_dma = 0; + return HWIF(drive)->ide_dma_host_off(drive); +} + +EXPORT_SYMBOL(__ide_dma_off_quietly); + +int __ide_dma_off (ide_drive_t *drive) +{ + printk("%s: DMA disabled\n", drive->name); + return HWIF(drive)->ide_dma_off_quietly(drive); +} + +EXPORT_SYMBOL(__ide_dma_off); + +int __ide_dma_host_on (ide_drive_t *drive) +{ + if (drive->using_dma) { + ide_hwif_t *hwif = HWIF(drive); + u8 unit = (drive->select.b.unit & 0x01); + u8 dma_stat = hwif->INB(hwif->dma_status); + + hwif->OUTB((dma_stat|(1<<(5+unit))), hwif->dma_status); + return 0; + } + return 1; +} + +EXPORT_SYMBOL(__ide_dma_host_on); + +int __ide_dma_on (ide_drive_t *drive) +{ + drive->using_dma = 1; + ide_toggle_bounce(drive, drive->using_dma); + return HWIF(drive)->ide_dma_host_on(drive); +} + +EXPORT_SYMBOL(__ide_dma_on); + +int __ide_dma_check (ide_drive_t *drive) +{ + return config_drive_for_dma(drive); +} + +EXPORT_SYMBOL(__ide_dma_check); + +int __ide_dma_read (ide_drive_t *drive /*, struct request *rq */) +{ + ide_hwif_t *hwif = HWIF(drive); + struct request *rq = HWGROUP(drive)->rq; +// ide_task_t *args = rq->special; + unsigned int reading = 1 << 3; + unsigned int count = 0; + u8 dma_stat = 0, lba48 = (drive->addressing == 1) ? 1 : 0; + task_ioreg_t command = WIN_NOP; + + if (!(count = ide_build_dmatable(drive, rq))) + /* try PIO instead of DMA */ + return 1; + /* PRD table */ + hwif->OUTL(hwif->dmatable_dma, hwif->dma_prdtable); + /* specify r/w */ + hwif->OUTB(reading, hwif->dma_command); + /* read dma_status for INTR & ERROR flags */ + dma_stat = hwif->INB(hwif->dma_status); + /* clear INTR & ERROR flags */ + hwif->OUTB(dma_stat|6, hwif->dma_status); + drive->waiting_for_dma = 1; + if (drive->media != ide_disk) + return 0; + /* paranoia check */ + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &ide_dma_intr, 2*WAIT_CMD, dma_timer_expiry); + + /* + * FIX ME to use only ACB ide_task_t args Struct + */ +#if 0 + { + ide_task_t *args = rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#else + command = (lba48) ? WIN_READDMA_EXT : WIN_READDMA; + if (rq->cmd == IDE_DRIVE_TASKFILE) { + ide_task_t *args = rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#endif + /* issue cmd to drive */ + hwif->OUTB(command, IDE_COMMAND_REG); + + return HWIF(drive)->ide_dma_count(drive); +} + +EXPORT_SYMBOL(__ide_dma_read); + +int __ide_dma_write (ide_drive_t *drive /*, struct request *rq */) +{ + ide_hwif_t *hwif = HWIF(drive); + struct request *rq = HWGROUP(drive)->rq; +// ide_task_t *args = rq->special; + unsigned int reading = 0; + unsigned int count = 0; + u8 dma_stat = 0, lba48 = (drive->addressing == 1) ? 1 : 0; + task_ioreg_t command = WIN_NOP; + + if (!(count = ide_build_dmatable(drive, rq))) + /* try PIO instead of DMA */ + return 1; + /* PRD table */ + hwif->OUTL(hwif->dmatable_dma, hwif->dma_prdtable); + /* specify r/w */ + hwif->OUTB(reading, hwif->dma_command); + /* read dma_status for INTR & ERROR flags */ + dma_stat = hwif->INB(hwif->dma_status); + /* clear INTR & ERROR flags */ + hwif->OUTB(dma_stat|6, hwif->dma_status); + drive->waiting_for_dma = 1; + if (drive->media != ide_disk) + return 0; + /* paranoia check */ + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &ide_dma_intr, 2*WAIT_CMD, dma_timer_expiry); + /* + * FIX ME to use only ACB ide_task_t args Struct + */ +#if 0 + { + ide_task_t *args = rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#else + command = (lba48) ? WIN_WRITEDMA_EXT : WIN_WRITEDMA; + if (rq->cmd == IDE_DRIVE_TASKFILE) { + ide_task_t *args = rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#endif + /* issue cmd to drive */ + hwif->OUTB(command, IDE_COMMAND_REG); + return HWIF(drive)->ide_dma_count(drive); +} + +EXPORT_SYMBOL(__ide_dma_write); + +int __ide_dma_begin (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 dma_cmd = hwif->INB(hwif->dma_command); + + /* Note that this is done *after* the cmd has + * been issued to the drive, as per the BM-IDE spec. + * The Promise Ultra33 doesn't work correctly when + * we do this part before issuing the drive cmd. + */ + /* start DMA */ + hwif->OUTB(dma_cmd|1, hwif->dma_command); + return 0; +} + +EXPORT_SYMBOL(__ide_dma_begin); + +/* returns 1 on error, 0 otherwise */ +int __ide_dma_end (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 dma_stat = 0, dma_cmd = 0; + + drive->waiting_for_dma = 0; + /* get dma_command mode */ + dma_cmd = hwif->INB(hwif->dma_command); + /* stop DMA */ + hwif->OUTB(dma_cmd&~1, hwif->dma_command); + /* get DMA status */ + dma_stat = hwif->INB(hwif->dma_status); + /* clear the INTR & ERROR bits */ + hwif->OUTB(dma_stat|6, hwif->dma_status); + /* purge DMA mappings */ + ide_destroy_dmatable(drive); + /* verify good DMA status */ + return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0; +} + +EXPORT_SYMBOL(__ide_dma_end); + +/* returns 1 if dma irq issued, 0 otherwise */ +int __ide_dma_test_irq (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 dma_stat = hwif->INB(hwif->dma_status); + +#if 0 /* do not set unless you know what you are doing */ + if (dma_stat & 4) { + u8 stat = hwif->INB(IDE_STATUS_REG); + hwif->OUTB(hwif->dma_status, dma_stat & 0xE4); + } +#endif + /* return 1 if INTR asserted */ + if ((dma_stat & 4) == 4) + return 1; + if (!drive->waiting_for_dma) + printk(KERN_WARNING "%s: (%s) called while not waiting\n", + drive->name, __FUNCTION__); + drive->waiting_for_dma++; + return 0; +} + +EXPORT_SYMBOL(__ide_dma_test_irq); + +int __ide_dma_bad_drive (ide_drive_t *drive) { struct hd_driveid *id = drive->id; #ifdef CONFIG_IDEDMA_NEW_DRIVE_LISTINGS - if (good_bad) { - return in_drive_list(id, drive_whitelist); - } else { - int blacklist = in_drive_list(id, drive_blacklist); - if (blacklist) - printk("%s: Disabling (U)DMA for %s\n", drive->name, id->model); + int blacklist = in_drive_list(id, drive_blacklist); + if (blacklist) { + printk("%s: Disabling (U)DMA for %s\n", drive->name, id->model); return(blacklist); } #else /* !CONFIG_IDEDMA_NEW_DRIVE_LISTINGS */ const char **list; - - if (good_bad) { - /* Consult the list of known "good" drives */ - list = good_dma_drives; - while (*list) { - if (!strcmp(*list++,id->model)) - return 1; - } - } else { - /* Consult the list of known "bad" drives */ - list = bad_dma_drives; - while (*list) { - if (!strcmp(*list++,id->model)) { - printk("%s: Disabling (U)DMA for %s\n", - drive->name, id->model); - return 1; - } + /* Consult the list of known "bad" drives */ + list = bad_dma_drives; + while (*list) { + if (!strcmp(*list++,id->model)) { + printk("%s: Disabling (U)DMA for %s\n", + drive->name, id->model); + return 1; } } #endif /* CONFIG_IDEDMA_NEW_DRIVE_LISTINGS */ return 0; } -int report_drive_dmaing (ide_drive_t *drive) +EXPORT_SYMBOL(__ide_dma_bad_drive); + +int __ide_dma_good_drive (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + +#ifdef CONFIG_IDEDMA_NEW_DRIVE_LISTINGS + return in_drive_list(id, drive_whitelist); +#else /* !CONFIG_IDEDMA_NEW_DRIVE_LISTINGS */ + const char **list; + /* Consult the list of known "good" drives */ + list = good_dma_drives; + while (*list) { + if (!strcmp(*list++,id->model)) + return 1; + } +#endif /* CONFIG_IDEDMA_NEW_DRIVE_LISTINGS */ + return 0; +} + +EXPORT_SYMBOL(__ide_dma_good_drive); + +/* + * Used for HOST FIFO counters for VDMA + * PIO over DMA, effective ATA-Bridge operator. + */ +int __ide_dma_count (ide_drive_t *drive) +{ + return HWIF(drive)->ide_dma_begin(drive); +} + +EXPORT_SYMBOL(__ide_dma_count); + +int __ide_dma_verbose (ide_drive_t *drive) { struct hd_driveid *id = drive->id; @@ -515,256 +794,36 @@ return 1; } -static int config_drive_for_dma (ide_drive_t *drive) -{ - int config_allows_dma = 1; - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - -#ifdef CONFIG_IDEDMA_ONLYDISK - if (drive->media != ide_disk) - config_allows_dma = 0; -#endif - - if (id && (id->capability & 1) && hwif->autodma && config_allows_dma) { - /* Consult the list of known "bad" drives */ - if (ide_dmaproc(ide_dma_bad_drive, drive)) - return hwif->dmaproc(ide_dma_off, drive); - - /* Enable DMA on any drive that has UltraDMA (mode 6/7/?) enabled */ - if ((id->field_valid & 4) && (eighty_ninty_three(drive))) - if ((id->dma_ultra & (id->dma_ultra >> 14) & 2)) - return hwif->dmaproc(ide_dma_on, drive); - /* Enable DMA on any drive that has UltraDMA (mode 3/4/5) enabled */ - if ((id->field_valid & 4) && (eighty_ninty_three(drive))) - if ((id->dma_ultra & (id->dma_ultra >> 11) & 7)) - return hwif->dmaproc(ide_dma_on, drive); - /* Enable DMA on any drive that has UltraDMA (mode 0/1/2) enabled */ - if (id->field_valid & 4) /* UltraDMA */ - if ((id->dma_ultra & (id->dma_ultra >> 8) & 7)) - return hwif->dmaproc(ide_dma_on, drive); - /* Enable DMA on any drive that has mode2 DMA (multi or single) enabled */ - if (id->field_valid & 2) /* regular DMA */ - if ((id->dma_mword & 0x404) == 0x404 || (id->dma_1word & 0x404) == 0x404) - return hwif->dmaproc(ide_dma_on, drive); - /* Consult the list of known "good" drives */ - if (ide_dmaproc(ide_dma_good_drive, drive)) - return hwif->dmaproc(ide_dma_on, drive); - } - return hwif->dmaproc(ide_dma_off_quietly, drive); -} +EXPORT_SYMBOL(__ide_dma_verbose); -#ifndef CONFIG_BLK_DEV_IDEDMA_TIMEOUT -/* - * 1 dmaing, 2 error, 4 intr - */ -static int dma_timer_expiry (ide_drive_t *drive) +int __ide_dma_retune (ide_drive_t *drive) { - byte dma_stat = inb(HWIF(drive)->dma_base+2); - -#ifdef DEBUG - printk("%s: dma_timer_expiry: dma status == 0x%02x\n", drive->name, dma_stat); -#endif /* DEBUG */ - -#if 0 - HWGROUP(drive)->expiry = NULL; /* one free ride for now */ -#endif - - if (dma_stat & 2) { /* ERROR */ - byte stat = GET_STAT(); - return ide_error(drive, "dma_timer_expiry", stat); - } - if (dma_stat & 1) /* DMAing */ - return WAIT_CMD; - return 0; + printk("%s: chipset supported call only\n", __FUNCTION__); + return 1; } -#else /* CONFIG_BLK_DEV_IDEDMA_TIMEOUT */ -static ide_startstop_t ide_dma_timeout_revovery (ide_drive_t *drive) -{ - ide_hwgroup_t *hwgroup = HWGROUP(drive); - ide_hwif_t *hwif = HWIF(drive); - int enable_dma = drive->using_dma; - unsigned long flags; - ide_startstop_t startstop; - - spin_lock_irqsave(&io_request_lock, flags); - hwgroup->handler = NULL; - del_timer(&hwgroup->timer); - spin_unlock_irqrestore(&io_request_lock, flags); - - drive->waiting_for_dma = 0; - - startstop = ide_do_reset(drive); - if ((enable_dma) && !(drive->using_dma)) - (void) hwif->dmaproc(ide_dma_on, drive); +EXPORT_SYMBOL(__ide_dma_retune); - return startstop; -} -#endif /* CONFIG_BLK_DEV_IDEDMA_TIMEOUT */ - -static inline void ide_toggle_bounce(ide_drive_t *drive, int on) +int __ide_dma_lostirq (ide_drive_t *drive) { - dma64_addr_t addr = BLK_BOUNCE_HIGH; - - if (HWIF(drive)->no_highio || HWIF(drive)->pci_dev == NULL) - return; - - if (on && drive->media == ide_disk) { - if (!PCI_DMA_BUS_IS_PHYS) - addr = BLK_BOUNCE_ANY; - else - addr = HWIF(drive)->pci_dev->dma_mask; - } - - blk_queue_bounce_limit(&drive->queue, addr); + printk("%s: DMA interrupt recovery\n", drive->name); + return 1; } -/* - * ide_dmaproc() initiates/aborts DMA read/write operations on a drive. - * - * The caller is assumed to have selected the drive and programmed the drive's - * sector address using CHS or LBA. All that remains is to prepare for DMA - * and then issue the actual read/write DMA/PIO command to the drive. - * - * For ATAPI devices, we just prepare for DMA and return. The caller should - * then issue the packet command to the drive and call us again with - * ide_dma_begin afterwards. - * - * Returns 0 if all went well. - * Returns 1 if DMA read/write could not be started, in which case - * the caller should revert to PIO for the current request. - * May also be invoked from trm290.c - */ -int ide_dmaproc (ide_dma_action_t func, ide_drive_t *drive) +EXPORT_SYMBOL(__ide_dma_lostirq); + +int __ide_dma_timeout (ide_drive_t *drive) { -// ide_hwgroup_t *hwgroup = HWGROUP(drive); - ide_hwif_t *hwif = HWIF(drive); - unsigned long dma_base = hwif->dma_base; - byte unit = (drive->select.b.unit & 0x01); - unsigned int count, reading = 0, set_high = 1; - byte dma_stat; - - switch (func) { - case ide_dma_off: - printk("%s: DMA disabled\n", drive->name); - case ide_dma_off_quietly: - set_high = 0; - outb(inb(dma_base+2) & ~(1<<(5+unit)), dma_base+2); - case ide_dma_on: - drive->using_dma = (func == ide_dma_on); - if (drive->using_dma) - outb(inb(dma_base+2)|(1<<(5+unit)), dma_base+2); - ide_toggle_bounce(drive, set_high); - return 0; - case ide_dma_check: - return config_drive_for_dma (drive); - case ide_dma_read: - reading = 1 << 3; - case ide_dma_write: - SELECT_READ_WRITE(hwif,drive,func); - if (!(count = ide_build_dmatable(drive, func))) - return 1; /* try PIO instead of DMA */ - outl(hwif->dmatable_dma, dma_base + 4); /* PRD table */ - outb(reading, dma_base); /* specify r/w */ - outb(inb(dma_base+2)|6, dma_base+2); /* clear INTR & ERROR flags */ - drive->waiting_for_dma = 1; - if (drive->media != ide_disk) - return 0; -#ifdef CONFIG_BLK_DEV_IDEDMA_TIMEOUT - ide_set_handler(drive, &ide_dma_intr, 2*WAIT_CMD, NULL); /* issue cmd to drive */ -#else /* !CONFIG_BLK_DEV_IDEDMA_TIMEOUT */ - ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, dma_timer_expiry); /* issue cmd to drive */ -#endif /* CONFIG_BLK_DEV_IDEDMA_TIMEOUT */ - if ((HWGROUP(drive)->rq->cmd == IDE_DRIVE_TASKFILE) && - (drive->addressing == 1)) { - ide_task_t *args = HWGROUP(drive)->rq->special; - OUT_BYTE(args->tfRegister[IDE_COMMAND_OFFSET], IDE_COMMAND_REG); - } else if (drive->addressing) { - OUT_BYTE(reading ? WIN_READDMA_EXT : WIN_WRITEDMA_EXT, IDE_COMMAND_REG); - } else { - OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG); - } - return HWIF(drive)->dmaproc(ide_dma_begin, drive); - case ide_dma_begin: - /* Note that this is done *after* the cmd has - * been issued to the drive, as per the BM-IDE spec. - * The Promise Ultra33 doesn't work correctly when - * we do this part before issuing the drive cmd. - */ - outb(inb(dma_base)|1, dma_base); /* start DMA */ - return 0; - case ide_dma_end: /* returns 1 on error, 0 otherwise */ - drive->waiting_for_dma = 0; - outb(inb(dma_base)&~1, dma_base); /* stop DMA */ - dma_stat = inb(dma_base+2); /* get DMA status */ - outb(dma_stat|6, dma_base+2); /* clear the INTR & ERROR bits */ - ide_destroy_dmatable(drive); /* purge DMA mappings */ - return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0; /* verify good DMA status */ - case ide_dma_test_irq: /* returns 1 if dma irq issued, 0 otherwise */ - dma_stat = inb(dma_base+2); -#if 0 /* do not set unless you know what you are doing */ - if (dma_stat & 4) { - byte stat = GET_STAT(); - outb(dma_base+2, dma_stat & 0xE4); - } -#endif - return (dma_stat & 4) == 4; /* return 1 if INTR asserted */ - case ide_dma_bad_drive: - case ide_dma_good_drive: - return check_drive_lists(drive, (func == ide_dma_good_drive)); - case ide_dma_verbose: - return report_drive_dmaing(drive); - case ide_dma_timeout: - // FIXME: Many IDE chipsets do not permit command file register access - // FIXME: while the bus-master function is still active. - // FIXME: To prevent deadlock with those chipsets, we must be extremely - // FIXME: careful here (and in ide_intr() as well) to NOT access any - // FIXME: registers from the 0x1Fx/0x17x sets before terminating the - // FIXME: bus-master operation via the bus-master control reg. - // FIXME: Otherwise, chipset deadlock will occur, and some systems will - // FIXME: lock up completely!! -#ifdef CONFIG_BLK_DEV_IDEDMA_TIMEOUT - /* - * Have to issue an abort and requeue the request - * DMA engine got turned off by a goofy ASIC, and - * we have to clean up the mess, and here is as good - * as any. Do it globally for all chipsets. - */ - outb(0x00, dma_base); /* stop DMA */ - dma_stat = inb(dma_base+2); /* get DMA status */ - outb(dma_stat|6, dma_base+2); /* clear the INTR & ERROR bits */ - printk("%s: %s: Lets do it again!" \ - "stat = 0x%02x, dma_stat = 0x%02x\n", - drive->name, ide_dmafunc_verbose(func), - GET_STAT(), dma_stat); - - if (dma_stat & 0xF0) - return ide_dma_timeout_revovery(drive); - - printk("%s: %s: (restart_request) Lets do it again!" \ - "stat = 0x%02x, dma_stat = 0x%02x\n", - drive->name, ide_dmafunc_verbose(func), - GET_STAT(), dma_stat); - - return restart_request(drive); // BUG: return types do not match!! -//#else -// return HWGROUP(drive)->handler(drive); -#endif /* CONFIG_BLK_DEV_IDEDMA_TIMEOUT */ - case ide_dma_retune: - case ide_dma_lostirq: - printk("ide_dmaproc: chipset supported %s func only: %d\n", ide_dmafunc_verbose(func), func); - return 1; - default: - printk("ide_dmaproc: unsupported %s func: %d\n", ide_dmafunc_verbose(func), func); - return 1; - } + printk("%s: timeout waiting for DMA\n", drive->name); + if (HWIF(drive)->ide_dma_test_irq(drive)) + return 0; + return HWIF(drive)->ide_dma_end(drive); + return 1; } -/* - * Needed for allowing full modular support of ide-driver - */ -int ide_release_dma (ide_hwif_t *hwif) +EXPORT_SYMBOL(__ide_dma_timeout); + +void ide_release_dma_engine (ide_hwif_t *hwif) { if (hwif->dmatable_cpu) { pci_free_consistent(hwif->pci_dev, @@ -777,128 +836,185 @@ kfree(hwif->sg_table); hwif->sg_table = NULL; } +} + +int ide_release_mmio_dma (ide_hwif_t *hwif) +{ + if ((hwif->dma_extra) && (hwif->channel == 0)) + release_mem_region((hwif->dma_base + 16), hwif->dma_extra); + release_mem_region(hwif->dma_base, 8); + if (hwif->dma_base2) + release_mem_region(hwif->dma_base, 8); + return 1; +} + +int ide_release_iomio_dma (ide_hwif_t *hwif) +{ if ((hwif->dma_extra) && (hwif->channel == 0)) release_region((hwif->dma_base + 16), hwif->dma_extra); release_region(hwif->dma_base, 8); + if (hwif->dma_base2) + release_region(hwif->dma_base, 8); return 1; } /* - * This can be called for a dynamically installed interface. Don't __init it + * Needed for allowing full modular support of ide-driver */ - -void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_ports) +int ide_release_dma (ide_hwif_t *hwif) { - printk(" %s: BM-DMA at 0x%04lx-0x%04lx", hwif->name, dma_base, dma_base + num_ports - 1); - if (check_region(dma_base, num_ports)) { - printk(" -- ERROR, PORT ADDRESSES ALREADY IN USE\n"); - return; - } - request_region(dma_base, num_ports, hwif->name); - hwif->dma_base = dma_base; - hwif->dmatable_cpu = pci_alloc_consistent(hwif->pci_dev, - PRD_ENTRIES * PRD_BYTES, - &hwif->dmatable_dma); - if (hwif->dmatable_cpu == NULL) - goto dma_alloc_failure; + if (hwif->chipset == ide_etrax100) + return 1; + ide_release_dma_engine(hwif); + if (hwif->mmio) + return ide_release_mmio_dma(hwif); + return ide_release_iomio_dma(hwif); +} + +int ide_allocate_dma_engine (ide_hwif_t *hwif) +{ + hwif->dmatable_cpu = pci_alloc_consistent(hwif->pci_dev, + PRD_ENTRIES * PRD_BYTES, + &hwif->dmatable_dma); hwif->sg_table = kmalloc(sizeof(struct scatterlist) * PRD_ENTRIES, - GFP_KERNEL); - if (hwif->sg_table == NULL) { - pci_free_consistent(hwif->pci_dev, PRD_ENTRIES * PRD_BYTES, - hwif->dmatable_cpu, hwif->dmatable_dma); - goto dma_alloc_failure; - } + GFP_KERNEL); - hwif->dmaproc = &ide_dmaproc; + if ((hwif->dmatable_cpu) && (hwif->sg_table)) + return 0; - if (hwif->chipset != ide_trm290) { - byte dma_stat = inb(dma_base+2); - printk(", BIOS settings: %s:%s, %s:%s", - hwif->drives[0].name, (dma_stat & 0x20) ? "DMA" : "pio", - hwif->drives[1].name, (dma_stat & 0x40) ? "DMA" : "pio"); + printk("%s: -- Error, unable to allocate%s%s table(s).\n", + (hwif->dmatable_cpu == NULL) ? " CPU" : "", + (hwif->sg_table == NULL) ? " SG DMA" : " DMA", + hwif->cds->name); + + ide_release_dma_engine(hwif); + return 1; +} + +int ide_mmio_dma (ide_hwif_t *hwif, unsigned long base, unsigned int ports) +{ + printk(" %s: MMIO-DMA at 0x%08lx-0x%08lx", + hwif->name, base, base + ports - 1); + if (check_mem_region(base, ports)) { + printk(" -- Error, MMIO ports already in use.\n"); + return 1; + } + request_mem_region(base, ports, hwif->name); + hwif->dma_base = base; + if ((hwif->cds->extra) && (hwif->channel == 0)) { + request_region(base+16, hwif->cds->extra, hwif->cds->name); + hwif->dma_extra = hwif->cds->extra; + } + if (hwif->dma_base2) { + if (!check_mem_region(hwif->dma_base2, ports)) + request_mem_region(hwif->dma_base2, ports, hwif->name); } - printk("\n"); - return; + return 0; +} -dma_alloc_failure: - printk(" -- ERROR, UNABLE TO ALLOCATE DMA TABLES\n"); +int ide_iomio_dma (ide_hwif_t *hwif, unsigned long base, unsigned int ports) +{ + printk(" %s: BM-DMA at 0x%04lx-0x%04lx", + hwif->name, base, base + ports - 1); + if (!request_region(base, ports, hwif->name)) { + printk(" -- Error, ports in use.\n"); + return 1; + } + hwif->dma_base = base; + if ((hwif->cds->extra) && (hwif->channel == 0)) { + request_region(base+16, hwif->cds->extra, hwif->cds->name); + hwif->dma_extra = hwif->cds->extra; + } + if (hwif->dma_base2) { + if (!request_region(hwif->dma_base2, ports, hwif->name)) + { + printk(" -- Error, secondary ports in use.\n"); + release_region(base, ports); + return 1; + } + } + return 0; } /* - * Fetch the DMA Bus-Master-I/O-Base-Address (BMIBA) from PCI space: + * */ -unsigned long __init ide_get_or_set_dma_base (ide_hwif_t *hwif, int extra, const char *name) +int ide_dma_iobase (ide_hwif_t *hwif, unsigned long base, unsigned int ports) { - unsigned long dma_base = 0; - struct pci_dev *dev = hwif->pci_dev; - -#ifdef CONFIG_BLK_DEV_IDEDMA_FORCED - int second_chance = 0; + if (hwif->mmio) + return ide_mmio_dma(hwif, base, ports); + return ide_iomio_dma(hwif, base, ports); +} -second_chance_to_dma: -#endif /* CONFIG_BLK_DEV_IDEDMA_FORCED */ +/* + * This can be called for a dynamically installed interface. Don't __init it + */ +void ide_setup_dma (ide_hwif_t *hwif, unsigned long dma_base, unsigned int num_ports) +{ + if (ide_dma_iobase(hwif, dma_base, num_ports)) + return; - if (hwif->mate && hwif->mate->dma_base) { - dma_base = hwif->mate->dma_base - (hwif->channel ? 0 : 8); - } else { - dma_base = pci_resource_start(dev, 4); - if (!dma_base) { - printk("%s: dma_base is invalid (0x%04lx)\n", name, dma_base); - dma_base = 0; - } + if (ide_allocate_dma_engine(hwif)) { + ide_release_dma(hwif); + return; } -#ifdef CONFIG_BLK_DEV_IDEDMA_FORCED - if ((!dma_base) && (!second_chance)) { - unsigned long set_bmiba = 0; - second_chance++; - switch(dev->vendor) { - case PCI_VENDOR_ID_AL: - set_bmiba = DEFAULT_BMALIBA; break; - case PCI_VENDOR_ID_VIA: - set_bmiba = DEFAULT_BMCRBA; break; - case PCI_VENDOR_ID_INTEL: - set_bmiba = DEFAULT_BMIBA; break; - default: - return dma_base; - } - pci_write_config_dword(dev, 0x20, set_bmiba|1); - goto second_chance_to_dma; - } -#endif /* CONFIG_BLK_DEV_IDEDMA_FORCED */ + if (!(hwif->dma_command)) + hwif->dma_command = hwif->dma_base; + if (!(hwif->dma_vendor1)) + hwif->dma_vendor1 = (hwif->dma_base + 1); + if (!(hwif->dma_status)) + hwif->dma_status = (hwif->dma_base + 2); + if (!(hwif->dma_vendor3)) + hwif->dma_vendor3 = (hwif->dma_base + 3); + if (!(hwif->dma_prdtable)) + hwif->dma_prdtable = (hwif->dma_base + 4); + + if (!hwif->ide_dma_off) + hwif->ide_dma_off = &__ide_dma_off; + if (!hwif->ide_dma_off_quietly) + hwif->ide_dma_off_quietly = &__ide_dma_off_quietly; + if (!hwif->ide_dma_host_off) + hwif->ide_dma_host_off = &__ide_dma_host_off; + if (!hwif->ide_dma_on) + hwif->ide_dma_on = &__ide_dma_on; + if (!hwif->ide_dma_host_on) + hwif->ide_dma_host_on = &__ide_dma_host_on; + if (!hwif->ide_dma_check) + hwif->ide_dma_check = &__ide_dma_check; + if (!hwif->ide_dma_read) + hwif->ide_dma_read = &__ide_dma_read; + if (!hwif->ide_dma_write) + hwif->ide_dma_write = &__ide_dma_write; + if (!hwif->ide_dma_count) + hwif->ide_dma_count = &__ide_dma_count; + if (!hwif->ide_dma_begin) + hwif->ide_dma_begin = &__ide_dma_begin; + if (!hwif->ide_dma_end) + hwif->ide_dma_end = &__ide_dma_end; + if (!hwif->ide_dma_test_irq) + hwif->ide_dma_test_irq = &__ide_dma_test_irq; + if (!hwif->ide_dma_bad_drive) + hwif->ide_dma_bad_drive = &__ide_dma_bad_drive; + if (!hwif->ide_dma_good_drive) + hwif->ide_dma_good_drive = &__ide_dma_good_drive; + if (!hwif->ide_dma_verbose) + hwif->ide_dma_verbose = &__ide_dma_verbose; + if (!hwif->ide_dma_timeout) + hwif->ide_dma_timeout = &__ide_dma_timeout; + if (!hwif->ide_dma_retune) + hwif->ide_dma_retune = &__ide_dma_retune; + if (!hwif->ide_dma_lostirq) + hwif->ide_dma_lostirq = &__ide_dma_lostirq; - if (dma_base) { - if (extra) /* PDC20246, PDC20262, HPT343, & HPT366 */ - request_region(dma_base+16, extra, name); - dma_base += hwif->channel ? 8 : 0; - hwif->dma_extra = extra; - - switch(dev->device) { - case PCI_DEVICE_ID_AL_M5219: - case PCI_DEVICE_ID_AMD_VIPER_7409: - case PCI_DEVICE_ID_CMD_643: - outb(inb(dma_base+2) & 0x60, dma_base+2); - if (inb(dma_base+2) & 0x80) { - printk("%s: simplex device: DMA forced\n", name); - } - break; - default: - /* - * If the device claims "simplex" DMA, - * this means only one of the two interfaces - * can be trusted with DMA at any point in time. - * So we should enable DMA only on one of the - * two interfaces. - */ - if ((inb(dma_base+2) & 0x80)) { /* simplex device? */ - if ((!hwif->drives[0].present && !hwif->drives[1].present) || - (hwif->mate && hwif->mate->dma_base)) { - printk("%s: simplex device: DMA disabled\n", name); - dma_base = 0; - } - } - } + if (hwif->chipset != ide_trm290) { + u8 dma_stat = hwif->INB(hwif->dma_status); + printk(", BIOS settings: %s:%s, %s:%s", + hwif->drives[0].name, (dma_stat & 0x20) ? "DMA" : "pio", + hwif->drives[1].name, (dma_stat & 0x40) ? "DMA" : "pio"); } - return dma_base; + printk("\n"); } + + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-features.c linux.20pre5-ac2/drivers/ide/ide-features.c --- linux.20pre5/drivers/ide/ide-features.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-features.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,385 +0,0 @@ -/* - * linux/drivers/block/ide-features.c Version 0.04 June 9, 2000 - * - * Copyright (C) 1999-2000 Linus Torvalds & authors (see below) - * - * Copyright (C) 1999-2000 Andre Hedrick - * - * Extracts if ide.c to address the evolving transfer rate code for - * the SETFEATURES_XFER callouts. Various parts of any given function - * are credited to previous ATA-IDE maintainers. - * - * Auto-CRC downgrade for Ultra DMA(ing) - * - * May be copied or modified under the terms of the GNU General Public License - */ - -#include -#define __NO_VERSION__ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -/* - * A Verbose noise maker for debugging on the attempted transfer rates. - */ -char *ide_xfer_verbose (byte xfer_rate) -{ - switch(xfer_rate) { - case XFER_UDMA_7: return("UDMA 7"); - case XFER_UDMA_6: return("UDMA 6"); - case XFER_UDMA_5: return("UDMA 5"); - case XFER_UDMA_4: return("UDMA 4"); - case XFER_UDMA_3: return("UDMA 3"); - case XFER_UDMA_2: return("UDMA 2"); - case XFER_UDMA_1: return("UDMA 1"); - case XFER_UDMA_0: return("UDMA 0"); - case XFER_MW_DMA_2: return("MW DMA 2"); - case XFER_MW_DMA_1: return("MW DMA 1"); - case XFER_MW_DMA_0: return("MW DMA 0"); - case XFER_SW_DMA_2: return("SW DMA 2"); - case XFER_SW_DMA_1: return("SW DMA 1"); - case XFER_SW_DMA_0: return("SW DMA 0"); - case XFER_PIO_4: return("PIO 4"); - case XFER_PIO_3: return("PIO 3"); - case XFER_PIO_2: return("PIO 2"); - case XFER_PIO_1: return("PIO 1"); - case XFER_PIO_0: return("PIO 0"); - case XFER_PIO_SLOW: return("PIO SLOW"); - default: return("XFER ERROR"); - } -} - -/* - * - */ -char *ide_media_verbose (ide_drive_t *drive) -{ - switch (drive->media) { - case ide_scsi: return("scsi "); - case ide_disk: return("disk "); - case ide_optical: return("optical"); - case ide_cdrom: return("cdrom "); - case ide_tape: return("tape "); - case ide_floppy: return("floppy "); - default: return("???????"); - } -} - -/* - * A Verbose noise maker for debugging on the attempted dmaing calls. - */ -char *ide_dmafunc_verbose (ide_dma_action_t dmafunc) -{ - switch (dmafunc) { - case ide_dma_read: return("ide_dma_read"); - case ide_dma_write: return("ide_dma_write"); - case ide_dma_begin: return("ide_dma_begin"); - case ide_dma_end: return("ide_dma_end:"); - case ide_dma_check: return("ide_dma_check"); - case ide_dma_on: return("ide_dma_on"); - case ide_dma_off: return("ide_dma_off"); - case ide_dma_off_quietly: return("ide_dma_off_quietly"); - case ide_dma_test_irq: return("ide_dma_test_irq"); - case ide_dma_bad_drive: return("ide_dma_bad_drive"); - case ide_dma_good_drive: return("ide_dma_good_drive"); - case ide_dma_verbose: return("ide_dma_verbose"); - case ide_dma_retune: return("ide_dma_retune"); - case ide_dma_lostirq: return("ide_dma_lostirq"); - case ide_dma_timeout: return("ide_dma_timeout"); - default: return("unknown"); - } -} - -/* - * - */ -byte ide_auto_reduce_xfer (ide_drive_t *drive) -{ - if (!drive->crc_count) - return drive->current_speed; - drive->crc_count = 0; - - switch(drive->current_speed) { - case XFER_UDMA_7: return XFER_UDMA_6; - case XFER_UDMA_6: return XFER_UDMA_5; - case XFER_UDMA_5: return XFER_UDMA_4; - case XFER_UDMA_4: return XFER_UDMA_3; - case XFER_UDMA_3: return XFER_UDMA_2; - case XFER_UDMA_2: return XFER_UDMA_1; - case XFER_UDMA_1: return XFER_UDMA_0; - /* - * OOPS we do not goto non Ultra DMA modes - * without iCRC's available we force - * the system to PIO and make the user - * invoke the ATA-1 ATA-2 DMA modes. - */ - case XFER_UDMA_0: - default: return XFER_PIO_4; - } -} - -/* - * Update the - */ -int ide_driveid_update (ide_drive_t *drive) -{ - /* - * Re-read drive->id for possible DMA mode - * change (copied from ide-probe.c) - */ - struct hd_driveid *id; - unsigned long timeout, flags; - - SELECT_MASK(HWIF(drive), drive, 1); - if (IDE_CONTROL_REG) - OUT_BYTE(drive->ctl,IDE_CONTROL_REG); - ide_delay_50ms(); - OUT_BYTE(WIN_IDENTIFY, IDE_COMMAND_REG); - timeout = jiffies + WAIT_WORSTCASE; - do { - if (0 < (signed long)(jiffies - timeout)) { - SELECT_MASK(HWIF(drive), drive, 0); - return 0; /* drive timed-out */ - } - ide_delay_50ms(); /* give drive a breather */ - } while (IN_BYTE(IDE_ALTSTATUS_REG) & BUSY_STAT); - ide_delay_50ms(); /* wait for IRQ and DRQ_STAT */ - if (!OK_STAT(GET_STAT(),DRQ_STAT,BAD_R_STAT)) { - SELECT_MASK(HWIF(drive), drive, 0); - printk("%s: CHECK for good STATUS\n", drive->name); - return 0; - } - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only; some systems need this */ - SELECT_MASK(HWIF(drive), drive, 0); - id = kmalloc(SECTOR_WORDS*4, GFP_ATOMIC); - if (!id) { - __restore_flags(flags); /* local CPU only */ - return 0; - } - ide_input_data(drive, id, SECTOR_WORDS); - (void) GET_STAT(); /* clear drive IRQ */ - ide__sti(); /* local CPU only */ - __restore_flags(flags); /* local CPU only */ - ide_fix_driveid(id); - if (id) { - drive->id->dma_ultra = id->dma_ultra; - drive->id->dma_mword = id->dma_mword; - drive->id->dma_1word = id->dma_1word; - /* anything more ? */ - kfree(id); - } - - return 1; -} - -/* - * Verify that we are doing an approved SETFEATURES_XFER with respect - * to the hardware being able to support request. Since some hardware - * can improperly report capabilties, we check to see if the host adapter - * in combination with the device (usually a disk) properly detect - * and acknowledge each end of the ribbon. - */ -int ide_ata66_check (ide_drive_t *drive, ide_task_t *args) -{ - if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_SETFEATURES) && - (args->tfRegister[IDE_SECTOR_OFFSET] > XFER_UDMA_2) && - (args->tfRegister[IDE_FEATURE_OFFSET] == SETFEATURES_XFER)) { - if (!HWIF(drive)->udma_four) { - printk("%s: Speed warnings UDMA 3/4/5 is not functional.\n", HWIF(drive)->name); - return 1; - } -#ifndef CONFIG_IDEDMA_IVB - if ((drive->id->hw_config & 0x6000) == 0) { -#else /* !CONFIG_IDEDMA_IVB */ - if (((drive->id->hw_config & 0x2000) == 0) || - ((drive->id->hw_config & 0x4000) == 0)) { -#endif /* CONFIG_IDEDMA_IVB */ - printk("%s: Speed warnings UDMA 3/4/5 is not functional.\n", drive->name); - return 1; - } - } - return 0; -} - -/* - * Backside of HDIO_DRIVE_CMD call of SETFEATURES_XFER. - * 1 : Safe to update drive->id DMA registers. - * 0 : OOPs not allowed. - */ -int set_transfer (ide_drive_t *drive, ide_task_t *args) -{ - if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_SETFEATURES) && - (args->tfRegister[IDE_SECTOR_OFFSET] >= XFER_SW_DMA_0) && - (args->tfRegister[IDE_FEATURE_OFFSET] == SETFEATURES_XFER) && - (drive->id->dma_ultra || - drive->id->dma_mword || - drive->id->dma_1word)) - return 1; - - return 0; -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -/* - * All hosts that use the 80c ribbon mus use! - */ -byte eighty_ninty_three (ide_drive_t *drive) -{ -#ifdef CONFIG_BLK_DEV_IDEPCI - if (HWIF(drive)->pci_devid.vid==0x105a) - return(HWIF(drive)->udma_four); -#endif - /* PDC202XX: that's because some HDD will return wrong info */ - return ((byte) ((HWIF(drive)->udma_four) && -#ifndef CONFIG_IDEDMA_IVB - (drive->id->hw_config & 0x4000) && -#endif /* CONFIG_IDEDMA_IVB */ - (drive->id->hw_config & 0x6000)) ? 1 : 0); -} -#endif // CONFIG_BLK_DEV_IDEDMA - -/* - * Similar to ide_wait_stat(), except it never calls ide_error internally. - * This is a kludge to handle the new ide_config_drive_speed() function, - * and should not otherwise be used anywhere. Eventually, the tuneproc's - * should be updated to return ide_startstop_t, in which case we can get - * rid of this abomination again. :) -ml - * - * It is gone.......... - * - * const char *msg == consider adding for verbose errors. - */ -int ide_config_drive_speed (ide_drive_t *drive, byte speed) -{ - ide_hwif_t *hwif = HWIF(drive); - int i, error = 1; - byte stat; - -#if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI) - byte unit = (drive->select.b.unit & 0x01); - outb(inb(hwif->dma_base+2) & ~(1<<(5+unit)), hwif->dma_base+2); -#endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */ - - /* - * Don't use ide_wait_cmd here - it will - * attempt to set_geometry and recalibrate, - * but for some reason these don't work at - * this point (lost interrupt). - */ - /* - * Select the drive, and issue the SETFEATURES command - */ - disable_irq(hwif->irq); /* disable_irq_nosync ?? */ - udelay(1); - SELECT_DRIVE(HWIF(drive), drive); - SELECT_MASK(HWIF(drive), drive, 0); - udelay(1); - if (IDE_CONTROL_REG) - OUT_BYTE(drive->ctl | 2, IDE_CONTROL_REG); - OUT_BYTE(speed, IDE_NSECTOR_REG); - OUT_BYTE(SETFEATURES_XFER, IDE_FEATURE_REG); - OUT_BYTE(WIN_SETFEATURES, IDE_COMMAND_REG); - if ((IDE_CONTROL_REG) && (drive->quirk_list == 2)) - OUT_BYTE(drive->ctl, IDE_CONTROL_REG); - udelay(1); - /* - * Wait for drive to become non-BUSY - */ - if ((stat = GET_STAT()) & BUSY_STAT) { - unsigned long flags, timeout; - __save_flags(flags); /* local CPU only */ - ide__sti(); /* local CPU only -- for jiffies */ - timeout = jiffies + WAIT_CMD; - while ((stat = GET_STAT()) & BUSY_STAT) { - if (0 < (signed long)(jiffies - timeout)) - break; - } - __restore_flags(flags); /* local CPU only */ - } - - /* - * Allow status to settle, then read it again. - * A few rare drives vastly violate the 400ns spec here, - * so we'll wait up to 10usec for a "good" status - * rather than expensively fail things immediately. - * This fix courtesy of Matthew Faupel & Niccolo Rigacci. - */ - for (i = 0; i < 10; i++) { - udelay(1); - if (OK_STAT((stat = GET_STAT()), DRIVE_READY, BUSY_STAT|DRQ_STAT|ERR_STAT)) { - error = 0; - break; - } - } - - SELECT_MASK(HWIF(drive), drive, 0); - - enable_irq(hwif->irq); - - if (error) { - (void) ide_dump_status(drive, "set_drive_speed_status", stat); - return error; - } - - drive->id->dma_ultra &= ~0xFF00; - drive->id->dma_mword &= ~0x0F00; - drive->id->dma_1word &= ~0x0F00; - -#if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI) - if (speed > XFER_PIO_4) { - outb(inb(hwif->dma_base+2)|(1<<(5+unit)), hwif->dma_base+2); - } else { - outb(inb(hwif->dma_base+2) & ~(1<<(5+unit)), hwif->dma_base+2); - } -#endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */ - - switch(speed) { - case XFER_UDMA_7: drive->id->dma_ultra |= 0x8080; break; - case XFER_UDMA_6: drive->id->dma_ultra |= 0x4040; break; - case XFER_UDMA_5: drive->id->dma_ultra |= 0x2020; break; - case XFER_UDMA_4: drive->id->dma_ultra |= 0x1010; break; - case XFER_UDMA_3: drive->id->dma_ultra |= 0x0808; break; - case XFER_UDMA_2: drive->id->dma_ultra |= 0x0404; break; - case XFER_UDMA_1: drive->id->dma_ultra |= 0x0202; break; - case XFER_UDMA_0: drive->id->dma_ultra |= 0x0101; break; - case XFER_MW_DMA_2: drive->id->dma_mword |= 0x0404; break; - case XFER_MW_DMA_1: drive->id->dma_mword |= 0x0202; break; - case XFER_MW_DMA_0: drive->id->dma_mword |= 0x0101; break; - case XFER_SW_DMA_2: drive->id->dma_1word |= 0x0404; break; - case XFER_SW_DMA_1: drive->id->dma_1word |= 0x0202; break; - case XFER_SW_DMA_0: drive->id->dma_1word |= 0x0101; break; - default: break; - } - return error; -} - -EXPORT_SYMBOL(ide_auto_reduce_xfer); -EXPORT_SYMBOL(ide_driveid_update); -EXPORT_SYMBOL(ide_ata66_check); -EXPORT_SYMBOL(set_transfer); -#ifdef CONFIG_BLK_DEV_IDEDMA -EXPORT_SYMBOL(eighty_ninty_three); -#endif // CONFIG_BLK_DEV_IDEDMA -EXPORT_SYMBOL(ide_config_drive_speed); - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-floppy.c linux.20pre5-ac2/drivers/ide/ide-floppy.c --- linux.20pre5/drivers/ide/ide-floppy.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-floppy.c 2002-08-29 23:47:56.000000000 +0100 @@ -153,10 +153,10 @@ char *b_data; /* Pointer which runs on the buffers */ int b_count; /* Missing/Available data on the current buffer */ struct request *rq; /* The corresponding request */ - byte *buffer; /* Data buffer */ - byte *current_position; /* Pointer into the above buffer */ + u8 *buffer; /* Data buffer */ + u8 *current_position; /* Pointer into the above buffer */ void (*callback) (ide_drive_t *); /* Called when this packet command is completed */ - byte pc_buffer[IDEFLOPPY_PC_BUFFER_SIZE]; /* Temporary buffer */ + u8 pc_buffer[IDEFLOPPY_PC_BUFFER_SIZE]; /* Temporary buffer */ unsigned long flags; /* Status/Action bit flags: long for set_bit */ } idefloppy_pc_t; @@ -272,29 +272,41 @@ typedef struct { ide_drive_t *drive; - idefloppy_pc_t *pc; /* Current packet command */ - idefloppy_pc_t *failed_pc; /* Last failed packet command */ - idefloppy_pc_t pc_stack[IDEFLOPPY_PC_STACK];/* Packet command stack */ - int pc_stack_index; /* Next free packet command storage space */ + /* Current packet command */ + idefloppy_pc_t *pc; + /* Last failed packet command */ + idefloppy_pc_t *failed_pc; + /* Packet command stack */ + idefloppy_pc_t pc_stack[IDEFLOPPY_PC_STACK]; + /* Next free packet command storage space */ + int pc_stack_index; struct request rq_stack[IDEFLOPPY_PC_STACK]; - int rq_stack_index; /* We implement a circular array */ + /* We implement a circular array */ + int rq_stack_index; /* * Last error information */ - byte sense_key, asc, ascq; - byte ticks; /* delay this long before sending packet command */ + u8 sense_key, asc, ascq; + /* delay this long before sending packet command */ + u8 ticks; int progress_indication; /* * Device information */ - int blocks, block_size, bs_factor; /* Current format */ - idefloppy_capacity_descriptor_t capacity; /* Last format capacity */ - idefloppy_flexible_disk_page_t flexible_disk_page; /* Copy of the flexible disk page */ - int wp; /* Write protect */ - int srfp; /* Supports format progress report */ - unsigned long flags; /* Status/Action flags */ + /* Current format */ + int blocks, block_size, bs_factor; + /* Last format capacity */ + idefloppy_capacity_descriptor_t capacity; + /* Copy of the flexible disk page */ + idefloppy_flexible_disk_page_t flexible_disk_page; + /* Write protect */ + int wp; + /* Supports format progress report */ + int srfp; + /* Status/Action flags */ + unsigned long flags; } idefloppy_floppy_t; #define IDEFLOPPY_TICKS_DELAY 3 /* default delay for ZIP 100 */ @@ -349,20 +361,20 @@ /* * Special requests for our block device strategy routine. */ -#define IDEFLOPPY_FIRST_RQ 90 +#define IDEFLOPPY_FIRST_RQ 90 /* * IDEFLOPPY_PC_RQ is used to queue a packet command in the request queue. */ -#define IDEFLOPPY_PC_RQ 90 +#define IDEFLOPPY_PC_RQ 90 -#define IDEFLOPPY_LAST_RQ 90 +#define IDEFLOPPY_LAST_RQ 90 /* * A macro which can be used to check if a given request command * originated in the driver or in the buffer cache layer. */ -#define IDEFLOPPY_RQ_CMD(cmd) ((cmd >= IDEFLOPPY_FIRST_RQ) && (cmd <= IDEFLOPPY_LAST_RQ)) +#define IDEFLOPPY_RQ_CMD(cmd) ((cmd >= IDEFLOPPY_FIRST_RQ) && (cmd <= IDEFLOPPY_LAST_RQ)) /* * Error codes which are returned in rq->errors to the higher part @@ -371,170 +383,6 @@ #define IDEFLOPPY_ERROR_GENERAL 101 /* - * The ATAPI Status Register. - */ -typedef union { - unsigned all :8; - struct { -#if defined(__LITTLE_ENDIAN_BITFIELD) - unsigned check :1; /* Error occurred */ - unsigned idx :1; /* Reserved */ - unsigned corr :1; /* Correctable error occurred */ - unsigned drq :1; /* Data is request by the device */ - unsigned dsc :1; /* Media access command finished */ - unsigned reserved5 :1; /* Reserved */ - unsigned drdy :1; /* Ignored for ATAPI commands (ready to accept ATA command) */ - unsigned bsy :1; /* The device has access to the command block */ -#elif defined(__BIG_ENDIAN_BITFIELD) - unsigned bsy :1; /* The device has access to the command block */ - unsigned drdy :1; /* Ignored for ATAPI commands (ready to accept ATA command) */ - unsigned reserved5 :1; /* Reserved */ - unsigned dsc :1; /* Media access command finished */ - unsigned drq :1; /* Data is request by the device */ - unsigned corr :1; /* Correctable error occurred */ - unsigned idx :1; /* Reserved */ - unsigned check :1; /* Error occurred */ -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif - } b; -} idefloppy_status_reg_t; - -/* - * The ATAPI error register. - */ -typedef union { - unsigned all :8; - struct { -#if defined(__LITTLE_ENDIAN_BITFIELD) - unsigned ili :1; /* Illegal Length Indication */ - unsigned eom :1; /* End Of Media Detected */ - unsigned abrt :1; /* Aborted command - As defined by ATA */ - unsigned mcr :1; /* Media Change Requested - As defined by ATA */ - unsigned sense_key :4; /* Sense key of the last failed packet command */ -#elif defined(__BIG_ENDIAN_BITFIELD) - unsigned sense_key :4; /* Sense key of the last failed packet command */ - unsigned mcr :1; /* Media Change Requested - As defined by ATA */ - unsigned abrt :1; /* Aborted command - As defined by ATA */ - unsigned eom :1; /* End Of Media Detected */ - unsigned ili :1; /* Illegal Length Indication */ -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif - } b; -} idefloppy_error_reg_t; - -/* - * ATAPI Feature Register - */ -typedef union { - unsigned all :8; - struct { -#if defined(__LITTLE_ENDIAN_BITFIELD) - unsigned dma :1; /* Using DMA or PIO */ - unsigned reserved321 :3; /* Reserved */ - unsigned reserved654 :3; /* Reserved (Tag Type) */ - unsigned reserved7 :1; /* Reserved */ -#elif defined(__BIG_ENDIAN_BITFIELD) - unsigned reserved7 :1; /* Reserved */ - unsigned reserved654 :3; /* Reserved (Tag Type) */ - unsigned reserved321 :3; /* Reserved */ - unsigned dma :1; /* Using DMA or PIO */ -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif - } b; -} idefloppy_feature_reg_t; - -/* - * ATAPI Byte Count Register. - */ -typedef union { - unsigned all :16; - struct { -#if defined(__LITTLE_ENDIAN_BITFIELD) - unsigned low :8; /* LSB */ - unsigned high :8; /* MSB */ -#elif defined(__BIG_ENDIAN_BITFIELD) - unsigned high :8; /* MSB */ - unsigned low :8; /* LSB */ -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif - } b; -} idefloppy_bcount_reg_t; - -/* - * ATAPI Interrupt Reason Register. - */ -typedef union { - unsigned all :8; - struct { -#if defined(__LITTLE_ENDIAN_BITFIELD) - unsigned cod :1; /* Information transferred is command (1) or data (0) */ - unsigned io :1; /* The device requests us to read (1) or write (0) */ - unsigned reserved :6; /* Reserved */ -#elif defined(__BIG_ENDIAN_BITFIELD) - unsigned reserved :6; /* Reserved */ - unsigned io :1; /* The device requests us to read (1) or write (0) */ - unsigned cod :1; /* Information transferred is command (1) or data (0) */ -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif - } b; -} idefloppy_ireason_reg_t; - -/* - * ATAPI floppy Drive Select Register - */ -typedef union { - unsigned all :8; - struct { -#if defined(__LITTLE_ENDIAN_BITFIELD) - unsigned sam_lun :3; /* Logical unit number */ - unsigned reserved3 :1; /* Reserved */ - unsigned drv :1; /* The responding drive will be drive 0 (0) or drive 1 (1) */ - unsigned one5 :1; /* Should be set to 1 */ - unsigned reserved6 :1; /* Reserved */ - unsigned one7 :1; /* Should be set to 1 */ -#elif defined(__BIG_ENDIAN_BITFIELD) - unsigned one7 :1; /* Should be set to 1 */ - unsigned reserved6 :1; /* Reserved */ - unsigned one5 :1; /* Should be set to 1 */ - unsigned drv :1; /* The responding drive will be drive 0 (0) or drive 1 (1) */ - unsigned reserved3 :1; /* Reserved */ - unsigned sam_lun :3; /* Logical unit number */ -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif - } b; -} idefloppy_drivesel_reg_t; - -/* - * ATAPI Device Control Register - */ -typedef union { - unsigned all :8; - struct { -#if defined(__LITTLE_ENDIAN_BITFIELD) - unsigned zero0 :1; /* Should be set to zero */ - unsigned nien :1; /* Device interrupt is disabled (1) or enabled (0) */ - unsigned srst :1; /* ATA software reset. ATAPI devices should use the new ATAPI srst. */ - unsigned one3 :1; /* Should be set to 1 */ - unsigned reserved4567 :4; /* Reserved */ -#elif defined(__BIG_ENDIAN_BITFIELD) - unsigned reserved4567 :4; /* Reserved */ - unsigned one3 :1; /* Should be set to 1 */ - unsigned srst :1; /* ATA software reset. ATAPI devices should use the new ATAPI srst. */ - unsigned nien :1; /* Device interrupt is disabled (1) or enabled (0) */ - unsigned zero0 :1; /* Should be set to zero */ -#else -#error "Bitfield endianness not defined! Check your byteorder.h" -#endif - } b; -} idefloppy_control_reg_t; - -/* * The following is used to format the general configuration word of * the ATAPI IDENTIFY DEVICE command. */ @@ -668,32 +516,61 @@ static void idefloppy_discard_data (ide_drive_t *drive, unsigned int bcount) { while (bcount--) - IN_BYTE (IDE_DATA_REG); + (void) HWIF(drive)->INB(IDE_DATA_REG); } #if IDEFLOPPY_DEBUG_BUGS static void idefloppy_write_zeros (ide_drive_t *drive, unsigned int bcount) { while (bcount--) - OUT_BYTE (0, IDE_DATA_REG); + HWIF(drive)->OUTB(0, IDE_DATA_REG); } #endif /* IDEFLOPPY_DEBUG_BUGS */ + +static int idefloppy_end_request (ide_drive_t *drive, int uptodate) +{ + struct request *rq; + unsigned long flags; + int ret = 1; + + spin_lock_irqsave(&io_request_lock, flags); + rq = HWGROUP(drive)->rq; + + /* + * decide whether to reenable DMA -- 3 is a random magic for now, + * if we DMA timeout more than 3 times, just stay in PIO + */ + if (drive->state == DMA_PIO_RETRY && drive->retry_pio <= 3) { + drive->state = 0; + HWGROUP(drive)->hwif->ide_dma_on(drive); + } + + if (!end_that_request_first(rq, uptodate, drive->name)) { + add_blkdev_randomness(MAJOR(rq->rq_dev)); + blkdev_dequeue_request(rq); + HWGROUP(drive)->rq = NULL; + end_that_request_last(rq); + ret = 0; + } + spin_unlock_irqrestore(&io_request_lock, flags); + return ret; +} + /* - * idefloppy_end_request is used to finish servicing a request. + * idefloppy_do_end_request is used to finish servicing a request. * * For read/write requests, we will call ide_end_request to pass to the * next buffer. */ -static void idefloppy_end_request (byte uptodate, ide_hwgroup_t *hwgroup) +static int idefloppy_do_end_request (ide_drive_t *drive, int uptodate) { - ide_drive_t *drive = hwgroup->drive; idefloppy_floppy_t *floppy = drive->driver_data; - struct request *rq = hwgroup->rq; + struct request *rq = HWGROUP(drive)->rq; int error; #if IDEFLOPPY_DEBUG_LOG - printk (KERN_INFO "Reached idefloppy_end_request\n"); + printk(KERN_INFO "Reached idefloppy_end_request\n"); #endif /* IDEFLOPPY_DEBUG_LOG */ switch (uptodate) { @@ -705,13 +582,16 @@ floppy->failed_pc = NULL; /* Why does this happen? */ if (!rq) - return; - if (!IDEFLOPPY_RQ_CMD (rq->cmd)) { - ide_end_request (uptodate, hwgroup); - return; + return 0; + if (!IDEFLOPPY_RQ_CMD(rq->cmd)) { + /* our real local end request function */ + idefloppy_end_request(drive, uptodate); + return 0; } rq->errors = error; - ide_end_drive_cmd (drive, 0, 0); + /* fixme: need to move this local also */ + ide_end_drive_cmd(drive, 0, 0); + return 0; } static void idefloppy_input_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, unsigned int bcount) @@ -724,18 +604,21 @@ if (pc->b_count == bh->b_size) { rq->sector += rq->current_nr_sectors; rq->nr_sectors -= rq->current_nr_sectors; - idefloppy_end_request (1, HWGROUP(drive)); + idefloppy_do_end_request(drive, 1); if ((bh = rq->bh) != NULL) pc->b_count = 0; } if (bh == NULL) { - printk (KERN_ERR "%s: bh == NULL in idefloppy_input_buffers, bcount == %d\n", drive->name, bcount); - idefloppy_discard_data (drive, bcount); + printk(KERN_ERR "%s: bh == NULL in " + "idefloppy_input_buffers, bcount == %d\n", + drive->name, bcount); + idefloppy_discard_data(drive, bcount); return; } - count = IDEFLOPPY_MIN (bh->b_size - pc->b_count, bcount); - atapi_input_bytes (drive, bh->b_data + pc->b_count, count); - bcount -= count; pc->b_count += count; + count = IDEFLOPPY_MIN(bh->b_size - pc->b_count, bcount); + HWIF(drive)->atapi_input_bytes(drive, bh->b_data + pc->b_count, count); + bcount -= count; + pc->b_count += count; } } @@ -749,20 +632,24 @@ if (!pc->b_count) { rq->sector += rq->current_nr_sectors; rq->nr_sectors -= rq->current_nr_sectors; - idefloppy_end_request (1, HWGROUP(drive)); + idefloppy_do_end_request(drive, 1); if ((bh = rq->bh) != NULL) { pc->b_data = bh->b_data; pc->b_count = bh->b_size; } } if (bh == NULL) { - printk (KERN_ERR "%s: bh == NULL in idefloppy_output_buffers, bcount == %d\n", drive->name, bcount); + printk(KERN_ERR "%s: bh == NULL in " + "idefloppy_output_buffers, bcount == %d\n", + drive->name, bcount); idefloppy_write_zeros (drive, bcount); return; } - count = IDEFLOPPY_MIN (pc->b_count, bcount); - atapi_output_bytes (drive, pc->b_data, count); - bcount -= count; pc->b_data += count; pc->b_count -= count; + count = IDEFLOPPY_MIN(pc->b_count, bcount); + HWIF(drive)->atapi_output_bytes(drive, pc->b_data, count); + bcount -= count; + pc->b_data += count; + pc->b_count -= count; } } @@ -773,7 +660,7 @@ struct buffer_head *bh = rq->bh; while ((bh = rq->bh) != NULL) - idefloppy_end_request (1, HWGROUP(drive)); + idefloppy_do_end_request(drive, 1); } #endif /* CONFIG_BLK_DEV_IDEDMA */ @@ -784,17 +671,17 @@ */ static void idefloppy_queue_pc_head (ide_drive_t *drive,idefloppy_pc_t *pc,struct request *rq) { - ide_init_drive_cmd (rq); - rq->buffer = (char *) pc; + ide_init_drive_cmd(rq); + rq->buffer = (char *)pc; rq->cmd = IDEFLOPPY_PC_RQ; - (void) ide_do_drive_cmd (drive, rq, ide_preempt); + (void) ide_do_drive_cmd(drive, rq, ide_preempt); } static idefloppy_pc_t *idefloppy_next_pc_storage (ide_drive_t *drive) { idefloppy_floppy_t *floppy = drive->driver_data; - if (floppy->pc_stack_index==IDEFLOPPY_PC_STACK) + if (floppy->pc_stack_index == IDEFLOPPY_PC_STACK) floppy->pc_stack_index=0; return (&floppy->pc_stack[floppy->pc_stack_index++]); } @@ -803,8 +690,8 @@ { idefloppy_floppy_t *floppy = drive->driver_data; - if (floppy->rq_stack_index==IDEFLOPPY_PC_STACK) - floppy->rq_stack_index=0; + if (floppy->rq_stack_index == IDEFLOPPY_PC_STACK) + floppy->rq_stack_index = 0; return (&floppy->rq_stack[floppy->rq_stack_index++]); } @@ -816,14 +703,20 @@ { idefloppy_floppy_t *floppy = drive->driver_data; - floppy->sense_key = result->sense_key; floppy->asc = result->asc; floppy->ascq = result->ascq; - floppy->progress_indication= result->sksv[0] & 0x80 ? - (unsigned short)get_unaligned((u16 *)(result->sksv+1)):0x10000; + floppy->sense_key = result->sense_key; + floppy->asc = result->asc; + floppy->ascq = result->ascq; + floppy->progress_indication = result->sksv[0] & 0x80 ? + (u16)get_unaligned((u16 *)(result->sksv+1)):0x10000; #if IDEFLOPPY_DEBUG_LOG if (floppy->failed_pc) - printk (KERN_INFO "ide-floppy: pc = %x, sense key = %x, asc = %x, ascq = %x\n",floppy->failed_pc->c[0],result->sense_key,result->asc,result->ascq); + printk(KERN_INFO "ide-floppy: pc = %x, sense key = %x, " + "asc = %x, ascq = %x\n", floppy->failed_pc->c[0], + result->sense_key, result->asc, result->ascq); else - printk (KERN_INFO "ide-floppy: sense key = %x, asc = %x, ascq = %x\n",result->sense_key,result->asc,result->ascq); + printk(KERN_INFO "ide-floppy: sense key = %x, asc = %x, " + "ascq = %x\n", result->sense_key, + result->asc, result->ascq); #endif /* IDEFLOPPY_DEBUG_LOG */ } @@ -832,14 +725,14 @@ idefloppy_floppy_t *floppy = drive->driver_data; #if IDEFLOPPY_DEBUG_LOG - printk (KERN_INFO "ide-floppy: Reached idefloppy_request_sense_callback\n"); + printk(KERN_INFO "ide-floppy: Reached %s\n", __FUNCTION__); #endif /* IDEFLOPPY_DEBUG_LOG */ if (!floppy->pc->error) { - idefloppy_analyze_error (drive,(idefloppy_request_sense_result_t *) floppy->pc->buffer); - idefloppy_end_request (1,HWGROUP (drive)); + idefloppy_analyze_error(drive,(idefloppy_request_sense_result_t *) floppy->pc->buffer); + idefloppy_do_end_request(drive, 1); } else { - printk (KERN_ERR "Error in REQUEST SENSE itself - Aborting request!\n"); - idefloppy_end_request (0,HWGROUP (drive)); + printk(KERN_ERR "Error in REQUEST SENSE itself - Aborting request!\n"); + idefloppy_do_end_request(drive, 0); } } @@ -851,10 +744,10 @@ idefloppy_floppy_t *floppy = drive->driver_data; #if IDEFLOPPY_DEBUG_LOG - printk (KERN_INFO "ide-floppy: Reached idefloppy_pc_callback\n"); + printk (KERN_INFO "ide-floppy: Reached %s\n", __FUNCTION__); #endif /* IDEFLOPPY_DEBUG_LOG */ - idefloppy_end_request (floppy->pc->error ? 0:1, HWGROUP(drive)); + idefloppy_do_end_request(drive, floppy->pc->error ? 0 : 1); } /* @@ -862,7 +755,7 @@ */ static void idefloppy_init_pc (idefloppy_pc_t *pc) { - memset (pc->c, 0, 12); + memset(pc->c, 0, 12); pc->retries = 0; pc->flags = 0; pc->request_transfer = 0; @@ -874,7 +767,7 @@ static void idefloppy_create_request_sense_cmd (idefloppy_pc_t *pc) { - idefloppy_init_pc (pc); + idefloppy_init_pc(pc); pc->c[0] = IDEFLOPPY_REQUEST_SENSE_CMD; pc->c[4] = 255; pc->request_transfer = 18; @@ -890,13 +783,13 @@ { idefloppy_pc_t *pc; struct request *rq; - idefloppy_error_reg_t error; + atapi_error_t error; - error.all = IN_BYTE (IDE_ERROR_REG); - pc = idefloppy_next_pc_storage (drive); - rq = idefloppy_next_rq_storage (drive); - idefloppy_create_request_sense_cmd (pc); - idefloppy_queue_pc_head (drive, pc, rq); + error.all = HWIF(drive)->INB(IDE_ERROR_REG); + pc = idefloppy_next_pc_storage(drive); + rq = idefloppy_next_rq_storage(drive); + idefloppy_create_request_sense_cmd(pc); + idefloppy_queue_pc_head(drive, pc, rq); } /* @@ -906,24 +799,25 @@ static ide_startstop_t idefloppy_pc_intr (ide_drive_t *drive) { idefloppy_floppy_t *floppy = drive->driver_data; - idefloppy_status_reg_t status; - idefloppy_bcount_reg_t bcount; - idefloppy_ireason_reg_t ireason; - idefloppy_pc_t *pc=floppy->pc; + atapi_status_t status; + atapi_bcount_t bcount; + atapi_ireason_t ireason; + idefloppy_pc_t *pc = floppy->pc; struct request *rq = pc->rq; unsigned int temp; #if IDEFLOPPY_DEBUG_LOG - printk (KERN_INFO "ide-floppy: Reached idefloppy_pc_intr interrupt handler\n"); + printk(KERN_INFO "ide-floppy: Reached %s interrupt handler\n", + __FUNCTION__); #endif /* IDEFLOPPY_DEBUG_LOG */ #ifdef CONFIG_BLK_DEV_IDEDMA - if (test_bit (PC_DMA_IN_PROGRESS, &pc->flags)) { - if (HWIF(drive)->dmaproc(ide_dma_end, drive)) { - set_bit (PC_DMA_ERROR, &pc->flags); + if (test_bit(PC_DMA_IN_PROGRESS, &pc->flags)) { + if (HWIF(drive)->ide_dma_end(drive)) { + set_bit(PC_DMA_ERROR, &pc->flags); } else { - pc->actually_transferred=pc->request_transfer; - idefloppy_update_buffers (drive, pc); + pc->actually_transferred = pc->request_transfer; + idefloppy_update_buffers(drive, pc); } #if IDEFLOPPY_DEBUG_LOG printk (KERN_INFO "ide-floppy: DMA finished\n"); @@ -931,83 +825,116 @@ } #endif /* CONFIG_BLK_DEV_IDEDMA */ - status.all = GET_STAT(); /* Clear the interrupt */ + /* Clear the interrupt */ + status.all = HWIF(drive)->INB(IDE_STATUS_REG); - if (!status.b.drq) { /* No more interrupts */ + if (!status.b.drq) { /* No more interrupts */ #if IDEFLOPPY_DEBUG_LOG - printk (KERN_INFO "Packet command completed, %d bytes transferred\n", pc->actually_transferred); + printk(KERN_INFO "Packet command completed, %d bytes " + "transferred\n", pc->actually_transferred); #endif /* IDEFLOPPY_DEBUG_LOG */ - clear_bit (PC_DMA_IN_PROGRESS, &pc->flags); + clear_bit(PC_DMA_IN_PROGRESS, &pc->flags); - ide__sti(); /* local CPU only */ + local_irq_enable(); - if (status.b.check || test_bit (PC_DMA_ERROR, &pc->flags)) { /* Error detected */ + if (status.b.check || test_bit(PC_DMA_ERROR, &pc->flags)) { + /* Error detected */ #if IDEFLOPPY_DEBUG_LOG - printk (KERN_INFO "ide-floppy: %s: I/O error\n",drive->name); + printk(KERN_INFO "ide-floppy: %s: I/O error\n", + drive->name); #endif /* IDEFLOPPY_DEBUG_LOG */ rq->errors++; if (pc->c[0] == IDEFLOPPY_REQUEST_SENSE_CMD) { - printk (KERN_ERR "ide-floppy: I/O error in request sense command\n"); - return ide_do_reset (drive); + printk(KERN_ERR "ide-floppy: I/O error in " + "request sense command\n"); + return ide_do_reset(drive); } - idefloppy_retry_pc (drive); /* Retry operation */ - return ide_stopped; /* queued, but not started */ + /* Retry operation */ + idefloppy_retry_pc(drive); + /* queued, but not started */ + return ide_stopped; } pc->error = 0; if (floppy->failed_pc == pc) - floppy->failed_pc=NULL; - pc->callback(drive); /* Command finished - Call the callback function */ + floppy->failed_pc = NULL; + /* Command finished - Call the callback function */ + pc->callback(drive); return ide_stopped; } #ifdef CONFIG_BLK_DEV_IDEDMA - if (test_and_clear_bit (PC_DMA_IN_PROGRESS, &pc->flags)) { - printk (KERN_ERR "ide-floppy: The floppy wants to issue more interrupts in DMA mode\n"); - (void) HWIF(drive)->dmaproc(ide_dma_off, drive); - return ide_do_reset (drive); + if (test_and_clear_bit(PC_DMA_IN_PROGRESS, &pc->flags)) { + printk(KERN_ERR "ide-floppy: The floppy wants to issue " + "more interrupts in DMA mode\n"); + (void) HWIF(drive)->ide_dma_off(drive); + return ide_do_reset(drive); } #endif /* CONFIG_BLK_DEV_IDEDMA */ - bcount.b.high=IN_BYTE (IDE_BCOUNTH_REG); /* Get the number of bytes to transfer */ - bcount.b.low=IN_BYTE (IDE_BCOUNTL_REG); /* on this interrupt */ - ireason.all=IN_BYTE (IDE_IREASON_REG); + /* Get the number of bytes to transfer */ + bcount.b.high = HWIF(drive)->INB(IDE_BCOUNTH_REG); + bcount.b.low = HWIF(drive)->INB(IDE_BCOUNTL_REG); + /* on this interrupt */ + ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); if (ireason.b.cod) { - printk (KERN_ERR "ide-floppy: CoD != 0 in idefloppy_pc_intr\n"); - return ide_do_reset (drive); + printk(KERN_ERR "ide-floppy: CoD != 0 in idefloppy_pc_intr\n"); + return ide_do_reset(drive); } - if (ireason.b.io == test_bit (PC_WRITING, &pc->flags)) { /* Hopefully, we will never get here */ - printk (KERN_ERR "ide-floppy: We wanted to %s, ", ireason.b.io ? "Write":"Read"); - printk (KERN_ERR "but the floppy wants us to %s !\n",ireason.b.io ? "Read":"Write"); - return ide_do_reset (drive); + if (ireason.b.io == test_bit(PC_WRITING, &pc->flags)) { + /* Hopefully, we will never get here */ + printk(KERN_ERR "ide-floppy: We wanted to %s, ", + ireason.b.io ? "Write":"Read"); + printk(KERN_ERR "but the floppy wants us to %s !\n", + ireason.b.io ? "Read":"Write"); + return ide_do_reset(drive); } - if (!test_bit (PC_WRITING, &pc->flags)) { /* Reading - Check that we have enough space */ + if (!test_bit(PC_WRITING, &pc->flags)) { + /* Reading - Check that we have enough space */ temp = pc->actually_transferred + bcount.all; - if ( temp > pc->request_transfer) { + if (temp > pc->request_transfer) { if (temp > pc->buffer_size) { - printk (KERN_ERR "ide-floppy: The floppy wants to send us more data than expected - discarding data\n"); - idefloppy_discard_data (drive,bcount.all); - ide_set_handler (drive,&idefloppy_pc_intr,IDEFLOPPY_WAIT_CMD, NULL); + printk(KERN_ERR "ide-floppy: The floppy wants " + "to send us more data than expected " + "- discarding data\n"); + idefloppy_discard_data(drive,bcount.all); + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, + &idefloppy_pc_intr, + IDEFLOPPY_WAIT_CMD, + NULL); return ide_started; } #if IDEFLOPPY_DEBUG_LOG - printk (KERN_NOTICE "ide-floppy: The floppy wants to send us more data than expected - allowing transfer\n"); + printk(KERN_NOTICE "ide-floppy: The floppy wants to " + "send us more data than expected - " + "allowing transfer\n"); #endif /* IDEFLOPPY_DEBUG_LOG */ } } - if (test_bit (PC_WRITING, &pc->flags)) { + if (test_bit(PC_WRITING, &pc->flags)) { if (pc->buffer != NULL) - atapi_output_bytes (drive,pc->current_position,bcount.all); /* Write the current buffer */ + /* Write the current buffer */ + HWIF(drive)->atapi_output_bytes(drive, + pc->current_position, + bcount.all); else - idefloppy_output_buffers (drive, pc, bcount.all); + idefloppy_output_buffers(drive, pc, bcount.all); } else { if (pc->buffer != NULL) - atapi_input_bytes (drive,pc->current_position,bcount.all); /* Read the current buffer */ + /* Read the current buffer */ + HWIF(drive)->atapi_input_bytes(drive, + pc->current_position, + bcount.all); else - idefloppy_input_buffers (drive, pc, bcount.all); + idefloppy_input_buffers(drive, pc, bcount.all); } - pc->actually_transferred+=bcount.all; /* Update the current position */ - pc->current_position+=bcount.all; - - ide_set_handler (drive,&idefloppy_pc_intr,IDEFLOPPY_WAIT_CMD, NULL); /* And set the interrupt handler again */ + /* Update the current position */ + pc->actually_transferred += bcount.all; + pc->current_position += bcount.all; + + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL); /* And set the interrupt handler again */ return ide_started; } @@ -1020,19 +947,25 @@ { ide_startstop_t startstop; idefloppy_floppy_t *floppy = drive->driver_data; - idefloppy_ireason_reg_t ireason; + atapi_ireason_t ireason; - if (ide_wait_stat (&startstop,drive,DRQ_STAT,BUSY_STAT,WAIT_READY)) { - printk (KERN_ERR "ide-floppy: Strange, packet command initiated yet DRQ isn't asserted\n"); + if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) { + printk(KERN_ERR "ide-floppy: Strange, packet command " + "initiated yet DRQ isn't asserted\n"); return startstop; } - ireason.all=IN_BYTE (IDE_IREASON_REG); + ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); if (!ireason.b.cod || ireason.b.io) { - printk (KERN_ERR "ide-floppy: (IO,CoD) != (0,1) while issuing a packet command\n"); - return ide_do_reset (drive); - } - ide_set_handler (drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL); /* Set the interrupt routine */ - atapi_output_bytes (drive, floppy->pc->c, 12); /* Send the actual packet */ + printk(KERN_ERR "ide-floppy: (IO,CoD) != (0,1) while " + "issuing a packet command\n"); + return ide_do_reset(drive); + } + if (HWGROUP(drive)->handler != NULL) + BUG(); + /* Set the interrupt routine */ + ide_set_handler(drive, &idefloppy_pc_intr, IDEFLOPPY_WAIT_CMD, NULL); + /* Send the actual packet */ + HWIF(drive)->atapi_output_bytes(drive, floppy->pc->c, 12); return ide_started; } @@ -1053,35 +986,42 @@ { idefloppy_floppy_t *floppy = drive->driver_data; - atapi_output_bytes (drive, floppy->pc->c, 12); /* Send the actual packet */ - return IDEFLOPPY_WAIT_CMD; /* Timeout for the packet command */ + /* Send the actual packet */ + HWIF(drive)->atapi_output_bytes(drive, floppy->pc->c, 12); + /* Timeout for the packet command */ + return IDEFLOPPY_WAIT_CMD; } static ide_startstop_t idefloppy_transfer_pc1 (ide_drive_t *drive) { idefloppy_floppy_t *floppy = drive->driver_data; ide_startstop_t startstop; - idefloppy_ireason_reg_t ireason; + atapi_ireason_t ireason; - if (ide_wait_stat (&startstop,drive,DRQ_STAT,BUSY_STAT,WAIT_READY)) { - printk (KERN_ERR "ide-floppy: Strange, packet command initiated yet DRQ isn't asserted\n"); + if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) { + printk(KERN_ERR "ide-floppy: Strange, packet command " + "initiated yet DRQ isn't asserted\n"); return startstop; } - ireason.all=IN_BYTE (IDE_IREASON_REG); + ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); if (!ireason.b.cod || ireason.b.io) { - printk (KERN_ERR "ide-floppy: (IO,CoD) != (0,1) while issuing a packet command\n"); - return ide_do_reset (drive); + printk(KERN_ERR "ide-floppy: (IO,CoD) != (0,1) " + "while issuing a packet command\n"); + return ide_do_reset(drive); } /* - * The following delay solves a problem with ATAPI Zip 100 drives where the - * Busy flag was apparently being deasserted before the unit was ready to - * receive data. This was happening on a 1200 MHz Athlon system. 10/26/01 - * 25msec is too short, 40 and 50msec work well. idefloppy_pc_intr will - * not be actually used until after the packet is moved in about 50 msec. + * The following delay solves a problem with ATAPI Zip 100 drives + * where the Busy flag was apparently being deasserted before the + * unit was ready to receive data. This was happening on a + * 1200 MHz Athlon system. 10/26/01 25msec is too short, + * 40 and 50msec work well. idefloppy_pc_intr will not be actually + * used until after the packet is moved in about 50 msec. */ - ide_set_handler (drive, + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &idefloppy_pc_intr, /* service routine for packet command */ - floppy->ticks, /* wait this long before "failing" */ + floppy->ticks, /* wait this long before "failing" */ &idefloppy_transfer_pc2); /* fail == transfer_pc2 */ return ide_started; } @@ -1092,81 +1032,109 @@ static ide_startstop_t idefloppy_issue_pc (ide_drive_t *drive, idefloppy_pc_t *pc) { idefloppy_floppy_t *floppy = drive->driver_data; - idefloppy_bcount_reg_t bcount; - int dma_ok = 0; + atapi_feature_t feature; + atapi_bcount_t bcount; ide_handler_t *pkt_xfer_routine; #if IDEFLOPPY_DEBUG_BUGS - if (floppy->pc->c[0] == IDEFLOPPY_REQUEST_SENSE_CMD && pc->c[0] == IDEFLOPPY_REQUEST_SENSE_CMD) { - printk (KERN_ERR "ide-floppy: possible ide-floppy.c bug - Two request sense in serial were issued\n"); + if (floppy->pc->c[0] == IDEFLOPPY_REQUEST_SENSE_CMD && + pc->c[0] == IDEFLOPPY_REQUEST_SENSE_CMD) { + printk(KERN_ERR "ide-floppy: possible ide-floppy.c bug - " + "Two request sense in serial were issued\n"); } #endif /* IDEFLOPPY_DEBUG_BUGS */ - if (floppy->failed_pc == NULL && pc->c[0] != IDEFLOPPY_REQUEST_SENSE_CMD) - floppy->failed_pc=pc; - floppy->pc=pc; /* Set the current packet command */ + if (floppy->failed_pc == NULL && + pc->c[0] != IDEFLOPPY_REQUEST_SENSE_CMD) + floppy->failed_pc = pc; + /* Set the current packet command */ + floppy->pc = pc; - if (pc->retries > IDEFLOPPY_MAX_PC_RETRIES || test_bit (PC_ABORT, &pc->flags)) { + if (pc->retries > IDEFLOPPY_MAX_PC_RETRIES || + test_bit(PC_ABORT, &pc->flags)) { /* * We will "abort" retrying a packet command in case * a legitimate error code was received. */ - if (!test_bit (PC_ABORT, &pc->flags)) { - if (!test_bit (PC_SUPPRESS_ERROR, &pc->flags)) { - ; - printk( KERN_ERR "ide-floppy: %s: I/O error, pc = %2x, key = %2x, asc = %2x, ascq = %2x\n", - drive->name, pc->c[0], floppy->sense_key, floppy->asc, floppy->ascq); + if (!test_bit(PC_ABORT, &pc->flags)) { + if (!test_bit(PC_SUPPRESS_ERROR, &pc->flags)) { + printk(KERN_ERR "ide-floppy: %s: I/O error, " + "pc = %2x, key = %2x, " + "asc = %2x, ascq = %2x\n", + drive->name, pc->c[0], + floppy->sense_key, + floppy->asc, floppy->ascq); } - pc->error = IDEFLOPPY_ERROR_GENERAL; /* Giving up */ + /* Giving up */ + pc->error = IDEFLOPPY_ERROR_GENERAL; } - floppy->failed_pc=NULL; + floppy->failed_pc = NULL; pc->callback(drive); return ide_stopped; } #if IDEFLOPPY_DEBUG_LOG - printk (KERN_INFO "Retry number - %d\n",pc->retries); + printk (KERN_INFO "Retry number - %d\n", pc->retries); #endif /* IDEFLOPPY_DEBUG_LOG */ pc->retries++; - pc->actually_transferred=0; /* We haven't transferred any data yet */ - pc->current_position=pc->buffer; + /* We haven't transferred any data yet */ + pc->actually_transferred = 0; + pc->current_position = pc->buffer; bcount.all = IDE_MIN(pc->request_transfer, 63 * 1024); #ifdef CONFIG_BLK_DEV_IDEDMA - if (test_and_clear_bit (PC_DMA_ERROR, &pc->flags)) { - (void) HWIF(drive)->dmaproc(ide_dma_off, drive); + if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags)) { + (void) HWIF(drive)->ide_dma_off(drive); + } +#endif /* CONFIG_BLK_DEV_IDEDMA */ + feature.all = 0; +#ifdef CONFIG_BLK_DEV_IDEDMA + if (test_bit(PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma) { + if (test_bit(PC_WRITING, &pc->flags)) { + feature.b.dma = !HWIF(drive)->ide_dma_write(drive); + } else { + feature.b.dma = !HWIF(drive)->ide_dma_read(drive); + } } - if (test_bit (PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma) - dma_ok=!HWIF(drive)->dmaproc(test_bit (PC_WRITING, &pc->flags) ? ide_dma_write : ide_dma_read, drive); #endif /* CONFIG_BLK_DEV_IDEDMA */ if (IDE_CONTROL_REG) - OUT_BYTE (drive->ctl,IDE_CONTROL_REG); - OUT_BYTE (dma_ok ? 1:0,IDE_FEATURE_REG); /* Use PIO/DMA */ - OUT_BYTE (bcount.b.high,IDE_BCOUNTH_REG); - OUT_BYTE (bcount.b.low,IDE_BCOUNTL_REG); - OUT_BYTE (drive->select.all,IDE_SELECT_REG); + HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG); + /* Use PIO/DMA */ + HWIF(drive)->OUTB(feature.all, IDE_FEATURE_REG); + HWIF(drive)->OUTB(bcount.b.high, IDE_BCOUNTH_REG); + HWIF(drive)->OUTB(bcount.b.low, IDE_BCOUNTL_REG); + HWIF(drive)->OUTB(drive->select.all, IDE_SELECT_REG); #ifdef CONFIG_BLK_DEV_IDEDMA - if (dma_ok) { /* Begin DMA, if necessary */ - set_bit (PC_DMA_IN_PROGRESS, &pc->flags); - (void) (HWIF(drive)->dmaproc(ide_dma_begin, drive)); + if (feature.b.dma) { /* Begin DMA, if necessary */ + set_bit(PC_DMA_IN_PROGRESS, &pc->flags); + (void) (HWIF(drive)->ide_dma_begin(drive)); } #endif /* CONFIG_BLK_DEV_IDEDMA */ /* Can we transfer the packet when we get the interrupt or wait? */ - if (test_bit (IDEFLOPPY_ZIP_DRIVE, &floppy->flags)) { - pkt_xfer_routine = &idefloppy_transfer_pc1; /* wait */ + if (test_bit(IDEFLOPPY_ZIP_DRIVE, &floppy->flags)) { + /* wait */ + pkt_xfer_routine = &idefloppy_transfer_pc1; } else { - pkt_xfer_routine = &idefloppy_transfer_pc; /* immediate */ + /* immediate */ + pkt_xfer_routine = &idefloppy_transfer_pc; } - if (test_bit (IDEFLOPPY_DRQ_INTERRUPT, &floppy->flags)) { - ide_set_handler (drive, pkt_xfer_routine, IDEFLOPPY_WAIT_CMD, NULL); - OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); /* Issue the packet command */ + if (test_bit(IDEFLOPPY_DRQ_INTERRUPT, &floppy->flags)) { + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, + pkt_xfer_routine, + IDEFLOPPY_WAIT_CMD, + NULL); + /* Issue the packet command */ + HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG); return ide_started; } else { - OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); + /* Issue the packet command */ + HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG); return (*pkt_xfer_routine) (drive); } } @@ -1177,24 +1145,25 @@ printk (KERN_INFO "ide-floppy: Reached idefloppy_rw_callback\n"); #endif /* IDEFLOPPY_DEBUG_LOG */ - idefloppy_end_request(1, HWGROUP(drive)); + idefloppy_do_end_request(drive, 1); return; } static void idefloppy_create_prevent_cmd (idefloppy_pc_t *pc, int prevent) { #if IDEFLOPPY_DEBUG_LOG - printk (KERN_INFO "ide-floppy: creating prevent removal command, prevent = %d\n", prevent); + printk(KERN_INFO "ide-floppy: creating prevent removal command, " + "prevent = %d\n", prevent); #endif /* IDEFLOPPY_DEBUG_LOG */ - idefloppy_init_pc (pc); + idefloppy_init_pc(pc); pc->c[0] = IDEFLOPPY_PREVENT_REMOVAL_CMD; pc->c[4] = prevent; } static void idefloppy_create_read_capacity_cmd (idefloppy_pc_t *pc) { - idefloppy_init_pc (pc); + idefloppy_init_pc(pc); pc->c[0] = IDEFLOPPY_READ_CAPACITY_CMD; pc->c[7] = 255; pc->c[8] = 255; @@ -1204,13 +1173,13 @@ static void idefloppy_create_format_unit_cmd (idefloppy_pc_t *pc, int b, int l, int flags) { - idefloppy_init_pc (pc); + idefloppy_init_pc(pc); pc->c[0] = IDEFLOPPY_FORMAT_UNIT_CMD; pc->c[1] = 0x17; memset(pc->buffer, 0, 12); pc->buffer[1] = 0xA2; - /* Default format list header, byte 1: FOV/DCRT/IMM bits set */ + /* Default format list header, u8 1: FOV/DCRT/IMM bits set */ if (flags & 1) /* Verify bit on... */ pc->buffer[1] ^= 0x20; /* ... turn off DCRT bit */ @@ -1225,11 +1194,11 @@ /* * A mode sense command is used to "sense" floppy parameters. */ -static void idefloppy_create_mode_sense_cmd (idefloppy_pc_t *pc, byte page_code, byte type) +static void idefloppy_create_mode_sense_cmd (idefloppy_pc_t *pc, u8 page_code, u8 type) { - unsigned short length = sizeof (idefloppy_mode_parameter_header_t); + u16 length = sizeof(idefloppy_mode_parameter_header_t); - idefloppy_init_pc (pc); + idefloppy_init_pc(pc); pc->c[0] = IDEFLOPPY_MODE_SENSE_CMD; pc->c[1] = 0; pc->c[2] = page_code + (type << 6); @@ -1242,15 +1211,16 @@ length += 32; break; default: - printk (KERN_ERR "ide-floppy: unsupported page code in create_mode_sense_cmd\n"); + printk(KERN_ERR "ide-floppy: unsupported page code " + "in create_mode_sense_cmd\n"); } - put_unaligned (htons (length), (unsigned short *) &pc->c[7]); + put_unaligned(htons(length), (u16 *) &pc->c[7]); pc->request_transfer = length; } static void idefloppy_create_start_stop_cmd (idefloppy_pc_t *pc, int start) { - idefloppy_init_pc (pc); + idefloppy_init_pc(pc); pc->c[0] = IDEFLOPPY_START_STOP_CMD; pc->c[4] = start; } @@ -1267,28 +1237,29 @@ int blocks = rq->nr_sectors / floppy->bs_factor; #if IDEFLOPPY_DEBUG_LOG - printk ("create_rw1%d_cmd: block == %d, blocks == %d\n", - 2 * test_bit (IDEFLOPPY_USE_READ12, &floppy->flags), block, blocks); + printk("create_rw1%d_cmd: block == %d, blocks == %d\n", + 2 * test_bit(IDEFLOPPY_USE_READ12, &floppy->flags), + block, blocks); #endif /* IDEFLOPPY_DEBUG_LOG */ - idefloppy_init_pc (pc); - if (test_bit (IDEFLOPPY_USE_READ12, &floppy->flags)) { + idefloppy_init_pc(pc); + if (test_bit(IDEFLOPPY_USE_READ12, &floppy->flags)) { pc->c[0] = rq->cmd == READ ? IDEFLOPPY_READ12_CMD : IDEFLOPPY_WRITE12_CMD; - put_unaligned (htonl (blocks), (unsigned int *) &pc->c[6]); + put_unaligned(htonl(blocks), (unsigned int *) &pc->c[6]); } else { pc->c[0] = rq->cmd == READ ? IDEFLOPPY_READ10_CMD : IDEFLOPPY_WRITE10_CMD; - put_unaligned (htons (blocks), (unsigned short *) &pc->c[7]); + put_unaligned(htons(blocks), (u16 *) &pc->c[7]); } - put_unaligned (htonl (block), (unsigned int *) &pc->c[2]); + put_unaligned(htonl(block), (unsigned int *) &pc->c[2]); pc->callback = &idefloppy_rw_callback; pc->rq = rq; pc->b_data = rq->buffer; pc->b_count = rq->cmd == READ ? 0 : rq->bh->b_size; if (rq->cmd == WRITE) - set_bit (PC_WRITING, &pc->flags); + set_bit(PC_WRITING, &pc->flags); pc->buffer = NULL; pc->request_transfer = pc->buffer_size = blocks * floppy->block_size; - set_bit (PC_DMA_RECOMMENDED, &pc->flags); + set_bit(PC_DMA_RECOMMENDED, &pc->flags); } /* @@ -1300,40 +1271,49 @@ idefloppy_pc_t *pc; #if IDEFLOPPY_DEBUG_LOG - printk (KERN_INFO "rq_status: %d, rq_dev: %u, cmd: %d, errors: %d\n",rq->rq_status,(unsigned int) rq->rq_dev,rq->cmd,rq->errors); - printk (KERN_INFO "sector: %ld, nr_sectors: %ld, current_nr_sectors: %ld\n",rq->sector,rq->nr_sectors,rq->current_nr_sectors); + printk(KERN_INFO "rq_status: %d, rq_dev: %u, cmd: %d, errors: %d\n", + rq->rq_status, (unsigned int) rq->rq_dev, rq->cmd, rq->errors); + printk(KERN_INFO "sector: %ld, nr_sectors: %ld, " + "current_nr_sectors: %ld\n", rq->sector, + rq->nr_sectors, rq->current_nr_sectors); #endif /* IDEFLOPPY_DEBUG_LOG */ if (rq->errors >= ERROR_MAX) { if (floppy->failed_pc != NULL) - printk (KERN_ERR "ide-floppy: %s: I/O error, pc = %2x, key = %2x, asc = %2x, ascq = %2x\n", - drive->name, floppy->failed_pc->c[0], floppy->sense_key, floppy->asc, floppy->ascq); + printk(KERN_ERR "ide-floppy: %s: I/O error, pc = %2x," + " key = %2x, asc = %2x, ascq = %2x\n", + drive->name, floppy->failed_pc->c[0], + floppy->sense_key, floppy->asc, floppy->ascq); else - printk (KERN_ERR "ide-floppy: %s: I/O error\n", drive->name); - idefloppy_end_request (0, HWGROUP(drive)); + printk(KERN_ERR "ide-floppy: %s: I/O error\n", + drive->name); + idefloppy_do_end_request(drive, 0); return ide_stopped; } switch (rq->cmd) { case READ: case WRITE: - if (rq->sector % floppy->bs_factor || rq->nr_sectors % floppy->bs_factor) { - printk ("%s: unsupported r/w request size\n", drive->name); - idefloppy_end_request (0, HWGROUP(drive)); + if (rq->sector % floppy->bs_factor || + rq->nr_sectors % floppy->bs_factor) { + printk("%s: unsupported r/w request size\n", + drive->name); + idefloppy_do_end_request(drive, 0); return ide_stopped; } - pc = idefloppy_next_pc_storage (drive); - idefloppy_create_rw_cmd (floppy, pc, rq, block); + pc = idefloppy_next_pc_storage(drive); + idefloppy_create_rw_cmd(floppy, pc, rq, block); break; case IDEFLOPPY_PC_RQ: pc = (idefloppy_pc_t *) rq->buffer; break; default: - printk (KERN_ERR "ide-floppy: unsupported command %x in request queue\n", rq->cmd); - idefloppy_end_request (0,HWGROUP (drive)); + printk(KERN_ERR "ide-floppy: unsupported command %x" + " in request queue\n", rq->cmd); + idefloppy_do_end_request(drive, 0); return ide_stopped; } pc->rq = rq; - return idefloppy_issue_pc (drive, pc); + return idefloppy_issue_pc(drive, pc); } /* @@ -1344,10 +1324,10 @@ { struct request rq; - ide_init_drive_cmd (&rq); + ide_init_drive_cmd(&rq); rq.buffer = (char *) pc; rq.cmd = IDEFLOPPY_PC_RQ; - return ide_do_drive_cmd (drive, &rq, ide_wait); + return ide_do_drive_cmd(drive, &rq, ide_wait); } /* @@ -1362,23 +1342,26 @@ idefloppy_flexible_disk_page_t *page; int capacity, lba_capacity; - idefloppy_create_mode_sense_cmd (&pc, IDEFLOPPY_FLEXIBLE_DISK_PAGE, MODE_SENSE_CURRENT); - if (idefloppy_queue_pc_tail (drive,&pc)) { - printk (KERN_ERR "ide-floppy: Can't get flexible disk page parameters\n"); + idefloppy_create_mode_sense_cmd(&pc, IDEFLOPPY_FLEXIBLE_DISK_PAGE, MODE_SENSE_CURRENT); + if (idefloppy_queue_pc_tail(drive,&pc)) { + printk(KERN_ERR "ide-floppy: Can't get flexible disk " + "page parameters\n"); return 1; } header = (idefloppy_mode_parameter_header_t *) pc.buffer; floppy->wp = header->wp; page = (idefloppy_flexible_disk_page_t *) (header + 1); - page->transfer_rate = ntohs (page->transfer_rate); - page->sector_size = ntohs (page->sector_size); - page->cyls = ntohs (page->cyls); - page->rpm = ntohs (page->rpm); + page->transfer_rate = ntohs(page->transfer_rate); + page->sector_size = ntohs(page->sector_size); + page->cyls = ntohs(page->cyls); + page->rpm = ntohs(page->rpm); capacity = page->cyls * page->heads * page->sectors * page->sector_size; if (memcmp (page, &floppy->flexible_disk_page, sizeof (idefloppy_flexible_disk_page_t))) - printk (KERN_INFO "%s: %dkB, %d/%d/%d CHS, %d kBps, %d sector size, %d rpm\n", - drive->name, capacity / 1024, page->cyls, page->heads, page->sectors, + printk(KERN_INFO "%s: %dkB, %d/%d/%d CHS, %d kBps, " + "%d sector size, %d rpm\n", + drive->name, capacity / 1024, page->cyls, + page->heads, page->sectors, page->transfer_rate / 8, page->sector_size, page->rpm); floppy->flexible_disk_page = *page; @@ -1387,8 +1370,8 @@ drive->bios_sect = page->sectors; lba_capacity = floppy->blocks * floppy->block_size; if (capacity < lba_capacity) { - printk (KERN_NOTICE "%s: The disk reports a capacity of %d bytes, " - "but the drive only handles %d\n", + printk(KERN_NOTICE "%s: The disk reports a capacity of %d " + "bytes, but the drive only handles %d\n", drive->name, lba_capacity, capacity); floppy->blocks = floppy->block_size ? capacity / floppy->block_size : 0; } @@ -1402,18 +1385,18 @@ idefloppy_mode_parameter_header_t *header; idefloppy_capabilities_page_t *page; - floppy->srfp=0; - idefloppy_create_mode_sense_cmd (&pc, IDEFLOPPY_CAPABILITIES_PAGE, + floppy->srfp = 0; + idefloppy_create_mode_sense_cmd(&pc, IDEFLOPPY_CAPABILITIES_PAGE, MODE_SENSE_CURRENT); set_bit(PC_SUPPRESS_ERROR, &pc.flags); - if (idefloppy_queue_pc_tail (drive,&pc)) { + if (idefloppy_queue_pc_tail(drive,&pc)) { return 1; } header = (idefloppy_mode_parameter_header_t *) pc.buffer; page= (idefloppy_capabilities_page_t *)(header+1); - floppy->srfp=page->srfp; + floppy->srfp = page->srfp; return (0); } @@ -1434,58 +1417,76 @@ floppy->blocks = floppy->bs_factor = 0; drive->part[0].nr_sects = 0; - idefloppy_create_read_capacity_cmd (&pc); - if (idefloppy_queue_pc_tail (drive, &pc)) { - printk (KERN_ERR "ide-floppy: Can't get floppy parameters\n"); + idefloppy_create_read_capacity_cmd(&pc); + if (idefloppy_queue_pc_tail(drive, &pc)) { + printk(KERN_ERR "ide-floppy: Can't get floppy parameters\n"); return 1; } header = (idefloppy_capacity_header_t *) pc.buffer; - descriptors = header->length / sizeof (idefloppy_capacity_descriptor_t); + descriptors = header->length / sizeof(idefloppy_capacity_descriptor_t); descriptor = (idefloppy_capacity_descriptor_t *) (header + 1); for (i = 0; i < descriptors; i++, descriptor++) { - blocks = descriptor->blocks = ntohl (descriptor->blocks); - length = descriptor->length = ntohs (descriptor->length); + blocks = descriptor->blocks = ntohl(descriptor->blocks); + length = descriptor->length = ntohs(descriptor->length); if (!i) { - switch (descriptor->dc) { - case CAPACITY_UNFORMATTED: /* Clik! drive returns this instead of CAPACITY_CURRENT */ - if (!test_bit(IDEFLOPPY_CLIK_DRIVE, &floppy->flags)) - break; /* If it is not a clik drive, break out (maintains previous driver behaviour) */ - case CAPACITY_CURRENT: /* Normal Zip/LS-120 disks */ - if (memcmp (descriptor, &floppy->capacity, sizeof (idefloppy_capacity_descriptor_t))) - printk (KERN_INFO "%s: %dkB, %d blocks, %d sector size\n", drive->name, blocks * length / 1024, blocks, length); - floppy->capacity = *descriptor; - if (!length || length % 512) - printk (KERN_NOTICE "%s: %d bytes block size not supported\n", drive->name, length); - else { + switch (descriptor->dc) { + /* Clik! drive returns this instead of CAPACITY_CURRENT */ + case CAPACITY_UNFORMATTED: + if (!test_bit(IDEFLOPPY_CLIK_DRIVE, &floppy->flags)) + /* + * If it is not a clik drive, break out + * (maintains previous driver behaviour) + */ + break; + case CAPACITY_CURRENT: + /* Normal Zip/LS-120 disks */ + if (memcmp(descriptor, &floppy->capacity, sizeof (idefloppy_capacity_descriptor_t))) + printk(KERN_INFO "%s: %dkB, %d blocks, %d " + "sector size\n", drive->name, + blocks * length / 1024, blocks, length); + floppy->capacity = *descriptor; + if (!length || length % 512) { + printk(KERN_NOTICE "%s: %d bytes block size " + "not supported\n", drive->name, length); + } else { floppy->blocks = blocks; floppy->block_size = length; if ((floppy->bs_factor = length / 512) != 1) - printk (KERN_NOTICE "%s: warning: non 512 bytes block size not fully supported\n", drive->name); + printk(KERN_NOTICE "%s: warning: non " + "512 bytes block size not " + "fully supported\n", + drive->name); rc = 0; - } - break; - case CAPACITY_NO_CARTRIDGE: - /* This is a KERN_ERR so it appears on screen for the user to see */ - printk (KERN_ERR "%s: No disk in drive\n", drive->name); - break; - case CAPACITY_INVALID: - printk (KERN_ERR "%s: Invalid capacity for disk in drive\n", drive->name); - break; + } + break; + case CAPACITY_NO_CARTRIDGE: + /* + * This is a KERN_ERR so it appears on screen + * for the user to see + */ + printk(KERN_ERR "%s: No disk in drive\n", drive->name); + break; + case CAPACITY_INVALID: + printk(KERN_ERR "%s: Invalid capacity for disk " + "in drive\n", drive->name); + break; } } if (!i) { - IDEFLOPPY_DEBUG( "Descriptor 0 Code: %d\n", descriptor->dc); + IDEFLOPPY_DEBUG( "Descriptor 0 Code: %d\n", + descriptor->dc); } - IDEFLOPPY_DEBUG( "Descriptor %d: %dkB, %d blocks, %d sector size\n", i, blocks * length / 1024, blocks, length); + IDEFLOPPY_DEBUG( "Descriptor %d: %dkB, %d blocks, %d " + "sector size\n", i, blocks * length / 1024, blocks, + length); } /* Clik! disk does not support get_flexible_disk_page */ - if (!test_bit(IDEFLOPPY_CLIK_DRIVE, &floppy->flags)) - { - (void) idefloppy_get_flexible_disk_page (drive); + if (!test_bit(IDEFLOPPY_CLIK_DRIVE, &floppy->flags)) { + (void) idefloppy_get_flexible_disk_page(drive); } drive->part[0].nr_sects = floppy->blocks * floppy->bs_factor; @@ -1532,18 +1533,18 @@ if (u_array_size <= 0) return (-EINVAL); - idefloppy_create_read_capacity_cmd (&pc); - if (idefloppy_queue_pc_tail (drive, &pc)) { - printk (KERN_ERR "ide-floppy: Can't get floppy parameters\n"); + idefloppy_create_read_capacity_cmd(&pc); + if (idefloppy_queue_pc_tail(drive, &pc)) { + printk(KERN_ERR "ide-floppy: Can't get floppy parameters\n"); return (-EIO); } header = (idefloppy_capacity_header_t *) pc.buffer; descriptors = header->length / - sizeof (idefloppy_capacity_descriptor_t); + sizeof(idefloppy_capacity_descriptor_t); descriptor = (idefloppy_capacity_descriptor_t *) (header + 1); - u_index=0; - argp=arg+1; + u_index = 0; + argp = arg + 1; /* ** We always skip the first capacity descriptor. That's the @@ -1551,18 +1552,17 @@ ** the formattable capacities. */ - for (i=0; i= u_array_size) break; /* User-supplied buffer too small */ if (i == 0) continue; /* Skip the first descriptor */ - blocks = ntohl (descriptor->blocks); - length = ntohs (descriptor->length); + blocks = ntohl(descriptor->blocks); + length = ntohs(descriptor->length); if (put_user(blocks, argp)) - return (-EFAULT); + return(-EFAULT); ++argp; if (put_user(length, argp)) @@ -1603,19 +1603,19 @@ int flags; idefloppy_pc_t pc; - if (get_user(blocks, arg) - || get_user(length, arg+1) - || get_user(flags, arg+2)) - { + if (get_user(blocks, arg) || + get_user(length, arg+1) || + get_user(flags, arg+2)) { return (-EFAULT); } - (void) idefloppy_get_capability_page (drive); /* Get the SFRP bit */ + /* Get the SFRP bit */ + (void) idefloppy_get_capability_page(drive); idefloppy_create_format_unit_cmd(&pc, blocks, length, flags); - if (idefloppy_queue_pc_tail (drive, &pc)) - { + if (idefloppy_queue_pc_tail(drive, &pc)) { return (-EIO); - } + } + return (0); } @@ -1636,35 +1636,30 @@ { idefloppy_floppy_t *floppy = drive->driver_data; idefloppy_pc_t pc; - int progress_indication=0x10000; + int progress_indication = 0x10000; - if (floppy->srfp) - { + if (floppy->srfp) { idefloppy_create_request_sense_cmd(&pc); - if (idefloppy_queue_pc_tail (drive, &pc)) - { + if (idefloppy_queue_pc_tail(drive, &pc)) { return (-EIO); } - if (floppy->sense_key == 2 && floppy->asc == 4 && - floppy->ascq == 4) - { - progress_indication=floppy->progress_indication; + if (floppy->sense_key == 2 && + floppy->asc == 4 && + floppy->ascq == 4) { + progress_indication = floppy->progress_indication; } /* Else assume format_unit has finished, and we're ** at 0x10000 */ - } - else - { - idefloppy_status_reg_t status; + } else { + atapi_status_t status; unsigned long flags; - __save_flags(flags); - __cli(); - status.all=GET_STAT(); - __restore_flags(flags); + local_irq_save(flags); + status.all = HWIF(drive)->INB(IDE_STATUS_REG); + local_irq_restore(flags); - progress_indication= !status.b.dsc ? 0:0x10000; + progress_indication = !status.b.dsc ? 0 : 0x10000; } if (put_user(progress_indication, arg)) return (-EFAULT); @@ -1694,12 +1689,12 @@ /* The IOMEGA Clik! Drive doesn't support this command - no room for an eject mechanism */ if (!test_bit(IDEFLOPPY_CLIK_DRIVE, &floppy->flags)) { - idefloppy_create_prevent_cmd (&pc, prevent); - (void) idefloppy_queue_pc_tail (drive, &pc); + idefloppy_create_prevent_cmd(&pc, prevent); + (void) idefloppy_queue_pc_tail(drive, &pc); } if (cmd == CDROMEJECT) { - idefloppy_create_start_stop_cmd (&pc, 2); - (void) idefloppy_queue_pc_tail (drive, &pc); + idefloppy_create_start_stop_cmd(&pc, 2); + (void) idefloppy_queue_pc_tail(drive, &pc); } return 0; case IDEFLOPPY_IOCTL_FORMAT_SUPPORTED: @@ -1715,16 +1710,13 @@ { idefloppy_floppy_t *floppy = drive->driver_data; - if (drive->usage > 1) - { + if (drive->usage > 1) { /* Don't format if someone is using the disk */ clear_bit(IDEFLOPPY_FORMAT_IN_PROGRESS, &floppy->flags); return -EBUSY; - } - else - { + } else { int rc; set_bit(IDEFLOPPY_FORMAT_IN_PROGRESS, @@ -1763,7 +1755,7 @@ idefloppy_pc_t pc; #if IDEFLOPPY_DEBUG_LOG - printk (KERN_INFO "Reached idefloppy_open\n"); + printk(KERN_INFO "Reached idefloppy_open\n"); #endif /* IDEFLOPPY_DEBUG_LOG */ MOD_INC_USE_COUNT; @@ -1773,8 +1765,8 @@ idefloppy_create_test_unit_ready_cmd(&pc); if (idefloppy_queue_pc_tail(drive, &pc)) { - idefloppy_create_start_stop_cmd (&pc, 1); - (void) idefloppy_queue_pc_tail (drive, &pc); + idefloppy_create_start_stop_cmd(&pc, 1); + (void) idefloppy_queue_pc_tail(drive, &pc); } if (idefloppy_get_capacity (drive) @@ -1795,16 +1787,14 @@ MOD_DEC_USE_COUNT; return -EROFS; } - set_bit (IDEFLOPPY_MEDIA_CHANGED, &floppy->flags); + set_bit(IDEFLOPPY_MEDIA_CHANGED, &floppy->flags); /* IOMEGA Clik! drives do not support lock/unlock commands */ if (!test_bit(IDEFLOPPY_CLIK_DRIVE, &floppy->flags)) { - idefloppy_create_prevent_cmd (&pc, 1); - (void) idefloppy_queue_pc_tail (drive, &pc); + idefloppy_create_prevent_cmd(&pc, 1); + (void) idefloppy_queue_pc_tail(drive, &pc); } check_disk_change(inode->i_rdev); - } - else if (test_bit(IDEFLOPPY_FORMAT_IN_PROGRESS, &floppy->flags)) - { + } else if (test_bit(IDEFLOPPY_FORMAT_IN_PROGRESS, &floppy->flags)) { drive->usage--; MOD_DEC_USE_COUNT; return -EBUSY; @@ -1823,12 +1813,12 @@ if (!drive->usage) { idefloppy_floppy_t *floppy = drive->driver_data; - invalidate_bdev (inode->i_bdev, 0); + invalidate_bdev(inode->i_bdev, 0); /* IOMEGA Clik! drives do not support lock/unlock commands */ if (!test_bit(IDEFLOPPY_CLIK_DRIVE, &floppy->flags)) { - idefloppy_create_prevent_cmd (&pc, 0); - (void) idefloppy_queue_pc_tail (drive, &pc); + idefloppy_create_prevent_cmd(&pc, 0); + (void) idefloppy_queue_pc_tail(drive, &pc); } clear_bit(IDEFLOPPY_FORMAT_IN_PROGRESS, &floppy->flags); @@ -1843,7 +1833,7 @@ { idefloppy_floppy_t *floppy = drive->driver_data; - return test_and_clear_bit (IDEFLOPPY_MEDIA_CHANGED, &floppy->flags); + return test_and_clear_bit(IDEFLOPPY_MEDIA_CHANGED, &floppy->flags); } /* @@ -1875,109 +1865,114 @@ { struct idefloppy_id_gcw gcw; #if IDEFLOPPY_DEBUG_INFO - unsigned short mask,i; + u16 mask,i; char buffer[80]; #endif /* IDEFLOPPY_DEBUG_INFO */ - *((unsigned short *) &gcw) = id->config; + *((u16 *) &gcw) = id->config; #ifdef CONFIG_PPC /* kludge for Apple PowerBook internal zip */ - if ((gcw.device_type == 5) && !strstr(id->model, "CD-ROM") - && strstr(id->model, "ZIP")) + if ((gcw.device_type == 5) && + !strstr(id->model, "CD-ROM") && + strstr(id->model, "ZIP")) gcw.device_type = 0; #endif #if IDEFLOPPY_DEBUG_INFO - printk (KERN_INFO "Dumping ATAPI Identify Device floppy parameters\n"); + printk(KERN_INFO "Dumping ATAPI Identify Device floppy parameters\n"); switch (gcw.protocol) { - case 0: case 1: sprintf (buffer, "ATA");break; - case 2: sprintf (buffer, "ATAPI");break; - case 3: sprintf (buffer, "Reserved (Unknown to ide-floppy)");break; + case 0: case 1: sprintf(buffer, "ATA");break; + case 2: sprintf(buffer, "ATAPI");break; + case 3: sprintf(buffer, "Reserved (Unknown to ide-floppy)");break; } - printk (KERN_INFO "Protocol Type: %s\n", buffer); + printk(KERN_INFO "Protocol Type: %s\n", buffer); switch (gcw.device_type) { - case 0: sprintf (buffer, "Direct-access Device");break; - case 1: sprintf (buffer, "Streaming Tape Device");break; + case 0: sprintf(buffer, "Direct-access Device");break; + case 1: sprintf(buffer, "Streaming Tape Device");break; case 2: case 3: case 4: sprintf (buffer, "Reserved");break; - case 5: sprintf (buffer, "CD-ROM Device");break; - case 6: sprintf (buffer, "Reserved"); - case 7: sprintf (buffer, "Optical memory Device");break; - case 0x1f: sprintf (buffer, "Unknown or no Device type");break; - default: sprintf (buffer, "Reserved"); + case 5: sprintf(buffer, "CD-ROM Device");break; + case 6: sprintf(buffer, "Reserved"); + case 7: sprintf(buffer, "Optical memory Device");break; + case 0x1f: sprintf(buffer, "Unknown or no Device type");break; + default: sprintf(buffer, "Reserved"); } - printk (KERN_INFO "Device Type: %x - %s\n", gcw.device_type, buffer); - printk (KERN_INFO "Removable: %s\n",gcw.removable ? "Yes":"No"); + printk(KERN_INFO "Device Type: %x - %s\n", gcw.device_type, buffer); + printk(KERN_INFO "Removable: %s\n",gcw.removable ? "Yes":"No"); switch (gcw.drq_type) { - case 0: sprintf (buffer, "Microprocessor DRQ");break; - case 1: sprintf (buffer, "Interrupt DRQ");break; - case 2: sprintf (buffer, "Accelerated DRQ");break; - case 3: sprintf (buffer, "Reserved");break; + case 0: sprintf(buffer, "Microprocessor DRQ");break; + case 1: sprintf(buffer, "Interrupt DRQ");break; + case 2: sprintf(buffer, "Accelerated DRQ");break; + case 3: sprintf(buffer, "Reserved");break; } - printk (KERN_INFO "Command Packet DRQ Type: %s\n", buffer); + printk(KERN_INFO "Command Packet DRQ Type: %s\n", buffer); switch (gcw.packet_size) { - case 0: sprintf (buffer, "12 bytes");break; - case 1: sprintf (buffer, "16 bytes");break; - default: sprintf (buffer, "Reserved");break; - } - printk (KERN_INFO "Command Packet Size: %s\n", buffer); - printk (KERN_INFO "Model: %.40s\n",id->model); - printk (KERN_INFO "Firmware Revision: %.8s\n",id->fw_rev); - printk (KERN_INFO "Serial Number: %.20s\n",id->serial_no); - printk (KERN_INFO "Write buffer size(?): %d bytes\n",id->buf_size*512); - printk (KERN_INFO "DMA: %s",id->capability & 0x01 ? "Yes\n":"No\n"); - printk (KERN_INFO "LBA: %s",id->capability & 0x02 ? "Yes\n":"No\n"); - printk (KERN_INFO "IORDY can be disabled: %s",id->capability & 0x04 ? "Yes\n":"No\n"); - printk (KERN_INFO "IORDY supported: %s",id->capability & 0x08 ? "Yes\n":"Unknown\n"); - printk (KERN_INFO "ATAPI overlap supported: %s",id->capability & 0x20 ? "Yes\n":"No\n"); - printk (KERN_INFO "PIO Cycle Timing Category: %d\n",id->tPIO); - printk (KERN_INFO "DMA Cycle Timing Category: %d\n",id->tDMA); - printk (KERN_INFO "Single Word DMA supported modes:\n"); + case 0: sprintf(buffer, "12 bytes");break; + case 1: sprintf(buffer, "16 bytes");break; + default: sprintf(buffer, "Reserved");break; + } + printk(KERN_INFO "Command Packet Size: %s\n", buffer); + printk(KERN_INFO "Model: %.40s\n",id->model); + printk(KERN_INFO "Firmware Revision: %.8s\n",id->fw_rev); + printk(KERN_INFO "Serial Number: %.20s\n",id->serial_no); + printk(KERN_INFO "Write buffer size(?): %d bytes\n",id->buf_size*512); + printk(KERN_INFO "DMA: %s",id->capability & 0x01 ? "Yes\n":"No\n"); + printk(KERN_INFO "LBA: %s",id->capability & 0x02 ? "Yes\n":"No\n"); + printk(KERN_INFO "IORDY can be disabled: %s",id->capability & 0x04 ? "Yes\n":"No\n"); + printk(KERN_INFO "IORDY supported: %s",id->capability & 0x08 ? "Yes\n":"Unknown\n"); + printk(KERN_INFO "ATAPI overlap supported: %s",id->capability & 0x20 ? "Yes\n":"No\n"); + printk(KERN_INFO "PIO Cycle Timing Category: %d\n",id->tPIO); + printk(KERN_INFO "DMA Cycle Timing Category: %d\n",id->tDMA); + printk(KERN_INFO "Single Word DMA supported modes:\n"); for (i=0,mask=1;i<8;i++,mask=mask << 1) { if (id->dma_1word & mask) - printk (KERN_INFO " Mode %d%s\n", i, (id->dma_1word & (mask << 8)) ? " (active)" : ""); + printk(KERN_INFO " Mode %d%s\n", i, + (id->dma_1word & (mask << 8)) ? " (active)" : ""); } - printk (KERN_INFO "Multi Word DMA supported modes:\n"); + printk(KERN_INFO "Multi Word DMA supported modes:\n"); for (i=0,mask=1;i<8;i++,mask=mask << 1) { if (id->dma_mword & mask) - printk (KERN_INFO " Mode %d%s\n", i, (id->dma_mword & (mask << 8)) ? " (active)" : ""); + printk(KERN_INFO " Mode %d%s\n", i, + (id->dma_mword & (mask << 8)) ? " (active)" : ""); } if (id->field_valid & 0x0002) { - printk (KERN_INFO "Enhanced PIO Modes: %s\n",id->eide_pio_modes & 1 ? "Mode 3":"None"); + printk(KERN_INFO "Enhanced PIO Modes: %s\n", + id->eide_pio_modes & 1 ? "Mode 3":"None"); if (id->eide_dma_min == 0) - sprintf (buffer, "Not supported"); + sprintf(buffer, "Not supported"); else - sprintf (buffer, "%d ns",id->eide_dma_min); - printk (KERN_INFO "Minimum Multi-word DMA cycle per word: %s\n", buffer); + sprintf(buffer, "%d ns",id->eide_dma_min); + printk(KERN_INFO "Minimum Multi-word DMA cycle per word: %s\n", buffer); if (id->eide_dma_time == 0) - sprintf (buffer, "Not supported"); + sprintf(buffer, "Not supported"); else - sprintf (buffer, "%d ns",id->eide_dma_time); - printk (KERN_INFO "Manufacturer\'s Recommended Multi-word cycle: %s\n", buffer); + sprintf(buffer, "%d ns",id->eide_dma_time); + printk(KERN_INFO "Manufacturer\'s Recommended Multi-word cycle: %s\n", buffer); if (id->eide_pio == 0) - sprintf (buffer, "Not supported"); + sprintf(buffer, "Not supported"); else - sprintf (buffer, "%d ns",id->eide_pio); - printk (KERN_INFO "Minimum PIO cycle without IORDY: %s\n", buffer); + sprintf(buffer, "%d ns",id->eide_pio); + printk(KERN_INFO "Minimum PIO cycle without IORDY: %s\n", + buffer); if (id->eide_pio_iordy == 0) - sprintf (buffer, "Not supported"); + sprintf(buffer, "Not supported"); else - sprintf (buffer, "%d ns",id->eide_pio_iordy); - printk (KERN_INFO "Minimum PIO cycle with IORDY: %s\n", buffer); + sprintf(buffer, "%d ns",id->eide_pio_iordy); + printk(KERN_INFO "Minimum PIO cycle with IORDY: %s\n", buffer); } else - printk (KERN_INFO "According to the device, fields 64-70 are not valid.\n"); + printk(KERN_INFO "According to the device, fields 64-70 are not valid.\n"); #endif /* IDEFLOPPY_DEBUG_INFO */ if (gcw.protocol != 2) - printk (KERN_ERR "ide-floppy: Protocol is not ATAPI\n"); + printk(KERN_ERR "ide-floppy: Protocol is not ATAPI\n"); else if (gcw.device_type != 0) - printk (KERN_ERR "ide-floppy: Device type is not set to floppy\n"); + printk(KERN_ERR "ide-floppy: Device type is not set to floppy\n"); else if (!gcw.removable) - printk (KERN_ERR "ide-floppy: The removable flag is not set\n"); + printk(KERN_ERR "ide-floppy: The removable flag is not set\n"); else if (gcw.drq_type == 3) { - printk (KERN_ERR "ide-floppy: Sorry, DRQ type %d not supported\n", gcw.drq_type); + printk(KERN_ERR "ide-floppy: Sorry, DRQ type %d not supported\n", gcw.drq_type); } else if (gcw.packet_size != 0) { - printk (KERN_ERR "ide-floppy: Packet size is not 12 bytes long\n"); + printk(KERN_ERR "ide-floppy: Packet size is not 12 bytes long\n"); } else return 1; return 0; @@ -1999,7 +1994,6 @@ ide_add_setting(drive, "file_readahead", SETTING_RW, BLKFRAGET, BLKFRASET, TYPE_INTA, 0, INT_MAX, 1, 1024, &max_readahead[major][minor], NULL); ide_add_setting(drive, "max_kb_per_request", SETTING_RW, BLKSECTGET, BLKSECTSET, TYPE_INTA, 1, 255, 1, 2, &max_sectors[major][minor], NULL); ide_add_setting(drive, "ticks", SETTING_RW, -1, -1, TYPE_BYTE, 0, 255, 1, 1, &floppy->ticks, NULL); - } /* @@ -2011,14 +2005,14 @@ int major = HWIF(drive)->major, i; int minor = drive->select.b.unit << PARTN_BITS; - *((unsigned short *) &gcw) = drive->id->config; + *((u16 *) &gcw) = drive->id->config; drive->driver_data = floppy; drive->ready_stat = 0; - memset (floppy, 0, sizeof (idefloppy_floppy_t)); + memset(floppy, 0, sizeof(idefloppy_floppy_t)); floppy->drive = drive; floppy->pc = floppy->pc_stack; if (gcw.drq_type == 1) - set_bit (IDEFLOPPY_DRQ_INTERRUPT, &floppy->flags); + set_bit(IDEFLOPPY_DRQ_INTERRUPT, &floppy->flags); /* * We used to check revisions here. At this point however * I'm giving up. Just assume they are all broken, its easier. @@ -2030,8 +2024,7 @@ * we'll leave the limitation below for the 2.2.x tree. */ - if (strcmp(drive->id->model, "IOMEGA ZIP 100 ATAPI") == 0) - { + if (strcmp(drive->id->model, "IOMEGA ZIP 100 ATAPI") == 0) { set_bit(IDEFLOPPY_ZIP_DRIVE, &floppy->flags); /* This value will be visible in the /proc/ide/hdx/settings */ floppy->ticks = IDEFLOPPY_TICKS_DELAY; @@ -2044,15 +2037,14 @@ * above fix. It makes nasty clicking noises without * it, so please don't remove this. */ - if (strncmp(drive->id->model, "IOMEGA Clik!", 11) == 0) - { + if (strncmp(drive->id->model, "IOMEGA Clik!", 11) == 0) { for (i = 0; i < 1 << PARTN_BITS; i++) max_sectors[major][minor + i] = 64; set_bit(IDEFLOPPY_CLIK_DRIVE, &floppy->flags); } - (void) idefloppy_get_capacity (drive); + (void) idefloppy_get_capacity(drive); idefloppy_add_settings(drive); for (i = 0; i < MAX_DRIVES; ++i) { ide_hwif_t *hwif = HWIF(drive); @@ -2069,10 +2061,11 @@ { idefloppy_floppy_t *floppy = drive->driver_data; - if (ide_unregister_subdriver (drive)) + if (ide_unregister_subdriver(drive)) return 1; + drive->driver_data = NULL; - kfree (floppy); + kfree(floppy); return 0; } @@ -2089,7 +2082,8 @@ #endif /* CONFIG_PROC_FS */ -int idefloppy_reinit(ide_drive_t *drive); +int idefloppy_init (void); +int idefloppy_attach(ide_drive_t *drive); /* * IDE subdriver functions, registered with ide.c @@ -2099,13 +2093,21 @@ version: IDEFLOPPY_VERSION, media: ide_floppy, busy: 0, +#ifdef CONFIG_IDEDMA_ONLYDISK + supports_dma: 0, +#else supports_dma: 1, +#endif supports_dsc_overlap: 0, cleanup: idefloppy_cleanup, standby: NULL, + suspend: NULL, + resume: NULL, flushcache: NULL, do_request: idefloppy_do_request, - end_request: idefloppy_end_request, + end_request: idefloppy_do_end_request, + sense: NULL, + error: NULL, ioctl: idefloppy_ioctl, open: idefloppy_open, release: idefloppy_release, @@ -2115,12 +2117,12 @@ capacity: idefloppy_capacity, special: NULL, proc: idefloppy_proc, - reinit: idefloppy_reinit, + init: idefloppy_init, + attach: idefloppy_attach, ata_prebuilder: NULL, atapi_prebuilder: NULL, }; -int idefloppy_init (void); static ide_module_t idefloppy_module = { IDE_DRIVER_MODULE, idefloppy_init, @@ -2128,38 +2130,45 @@ NULL }; -int idefloppy_reinit (ide_drive_t *drive) +int idefloppy_attach (ide_drive_t *drive) { idefloppy_floppy_t *floppy; - int failed = 0; + int ret = 0; MOD_INC_USE_COUNT; - while ((drive = ide_scan_devices (ide_floppy, idefloppy_driver.name, NULL, failed++)) != NULL) { - if (!idefloppy_identify_device (drive, drive->id)) { - printk (KERN_ERR "ide-floppy: %s: not supported by this version of ide-floppy\n", drive->name); - continue; - } - if (drive->scsi) { - printk("ide-floppy: passing drive %s to ide-scsi emulation.\n", drive->name); - continue; - } - if ((floppy = (idefloppy_floppy_t *) kmalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) { - printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name); - continue; - } - if (ide_register_subdriver (drive, &idefloppy_driver, IDE_SUBDRIVER_VERSION)) { - printk (KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name); - kfree (floppy); - continue; - } - DRIVER(drive)->busy++; - idefloppy_setup (drive, floppy); - DRIVER(drive)->busy--; - failed--; - } - ide_register_module(&idefloppy_module); + if (!idefloppy_identify_device(drive, drive->id)) { + printk(KERN_ERR "ide-floppy: %s: not supported by this " + "version of ide-floppy\n", drive->name); + ret = 1; + goto bye_game_over; + } + if (drive->scsi) { + printk("ide-floppy: passing drive %s to ide-scsi " + "emulation.\n", drive->name); + ret = 1; + goto bye_game_over; + } + if ((floppy = (idefloppy_floppy_t *) kmalloc(sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) { + printk(KERN_ERR "ide-floppy: %s: Can't allocate a floppy " + "structure\n", drive->name); + ret = 1; + goto bye_game_over; + } + if (ide_register_subdriver(drive, + &idefloppy_driver, IDE_SUBDRIVER_VERSION)) { + printk(KERN_ERR "ide-floppy: %s: Failed to register the " + "driver with ide.c\n", drive->name); + kfree(floppy); + ret = 1; + goto bye_game_over; + } + DRIVER(drive)->busy++; + idefloppy_setup(drive, floppy); + DRIVER(drive)->busy--; + +bye_game_over: MOD_DEC_USE_COUNT; - return 0; + return ret; } MODULE_DESCRIPTION("ATAPI FLOPPY Driver"); @@ -2169,9 +2178,11 @@ ide_drive_t *drive; int failed = 0; - while ((drive = ide_scan_devices (ide_floppy, idefloppy_driver.name, &idefloppy_driver, failed)) != NULL) { - if (idefloppy_cleanup (drive)) { - printk ("%s: cleanup_module() called while still busy\n", drive->name); + while ((drive = ide_scan_devices(ide_floppy, idefloppy_driver.name, + &idefloppy_driver, failed)) != NULL) { + if (idefloppy_cleanup(drive)) { + printk("%s: cleanup_module() called while still " + "busy\n", drive->name); failed++; } /* We must remove proc entries defined in this module. @@ -2184,40 +2195,47 @@ ide_unregister_module(&idefloppy_module); } -/* - * idefloppy_init will register the driver for each floppy. - */ int idefloppy_init (void) { +#ifdef CLASSIC_BUILTINS_METHOD ide_drive_t *drive; idefloppy_floppy_t *floppy; int failed = 0; printk("ide-floppy driver " IDEFLOPPY_VERSION "\n"); +#endif /* CLASSIC_BUILTINS_METHOD */ MOD_INC_USE_COUNT; - while ((drive = ide_scan_devices (ide_floppy, idefloppy_driver.name, NULL, failed++)) != NULL) { - if (!idefloppy_identify_device (drive, drive->id)) { - printk (KERN_ERR "ide-floppy: %s: not supported by this version of ide-floppy\n", drive->name); +#ifdef CLASSIC_BUILTINS_METHOD + while ((drive = ide_scan_devices(ide_floppy, + idefloppy_driver.name, NULL, failed++)) != NULL) { + if (!idefloppy_identify_device(drive, drive->id)) { + printk(KERN_ERR "ide-floppy: %s: not supported by " + "this version of ide-floppy\n", drive->name); continue; } if (drive->scsi) { - printk("ide-floppy: passing drive %s to ide-scsi emulation.\n", drive->name); - continue; - } - if ((floppy = (idefloppy_floppy_t *) kmalloc (sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) { - printk (KERN_ERR "ide-floppy: %s: Can't allocate a floppy structure\n", drive->name); + printk("ide-floppy: passing drive %s to ide-scsi " + "emulation.\n", drive->name); continue; } - if (ide_register_subdriver (drive, &idefloppy_driver, IDE_SUBDRIVER_VERSION)) { - printk (KERN_ERR "ide-floppy: %s: Failed to register the driver with ide.c\n", drive->name); - kfree (floppy); + if ((floppy = (idefloppy_floppy_t *) kmalloc(sizeof (idefloppy_floppy_t), GFP_KERNEL)) == NULL) { + printk(KERN_ERR "ide-floppy: %s: Can't allocate a " + "floppy structure\n", drive->name); continue; } + if (ide_register_subdriver(drive, + &idefloppy_driver, IDE_SUBDRIVER_VERSION)) { + printk(KERN_ERR "ide-floppy: %s: Failed to register " + "the driver with ide.c\n", drive->name); + kfree(floppy); + continue; + } DRIVER(drive)->busy++; - idefloppy_setup (drive, floppy); + idefloppy_setup(drive, floppy); DRIVER(drive)->busy--; failed--; } +#endif /* CLASSIC_BUILTINS_METHOD */ ide_register_module(&idefloppy_module); MOD_DEC_USE_COUNT; return 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-geometry.c linux.20pre5-ac2/drivers/ide/ide-geometry.c --- linux.20pre5/drivers/ide/ide-geometry.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-geometry.c 2002-08-29 23:47:56.000000000 +0100 @@ -51,14 +51,13 @@ { #ifdef __i386__ extern struct drive_info_struct drive_info; - byte cmos_disks, *BIOS = (byte *) &drive_info; + u8 cmos_disks, *BIOS = (u8 *) &drive_info; int unit; unsigned long flags; -#ifdef CONFIG_BLK_DEV_PDC4030 if (hwif->chipset == ide_pdc4030 && hwif->channel != 0) return; -#endif /* CONFIG_BLK_DEV_PDC4030 */ + spin_lock_irqsave(&rtc_lock, flags); cmos_disks = CMOS_READ(0x12); spin_unlock_irqrestore(&rtc_lock, flags); @@ -68,7 +67,7 @@ if ((cmos_disks & (0xf0 >> (unit*4))) && !drive->present && !drive->nobios) { - unsigned short cyl = *(unsigned short *)BIOS; + u16 cyl = *(u16 *)BIOS; unsigned char head = *(BIOS+2); unsigned char sect = *(BIOS+14); if (cyl > 0 && head > 0 && sect > 0 && sect < 64) { @@ -100,8 +99,8 @@ */ static void ontrack(ide_drive_t *drive, int heads, unsigned int *c, int *h, int *s) { - static const byte dm_head_vals[] = {4, 8, 16, 32, 64, 128, 255, 0}; - const byte *headp = dm_head_vals; + static const u8 dm_head_vals[] = {4, 8, 16, 32, 64, 128, 255, 0}; + const u8 *headp = dm_head_vals; unsigned long total; /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-iops.c linux.20pre5-ac2/drivers/ide/ide-iops.c --- linux.20pre5/drivers/ide/ide-iops.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-iops.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,1249 @@ +/* + * linux/drivers/ide/ide-iops.c Version 0.33 April 11, 2002 + * + * Copyright (C) 2000-2002 Andre Hedrick + * + * + */ + +#include +#define __NO_VERSION__ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + + +static inline u8 ide_inb (u32 port) +{ + return (u8) IN_BYTE(port); +} + +static inline u8 ide_inb_p (u32 port) +{ + return (u8) IN_BYTE_P(port); +} + +static inline u16 ide_inw (u32 port) +{ + return (u16) IN_WORD(port); +} + +static inline u16 ide_inw_p (u32 port) +{ + return (u16) IN_WORD_P(port); +} + +static inline void ide_insw (u32 port, void *addr, u32 count) +{ + while (count--) { *(u16 *)addr = IN_WORD(port); addr += 2; } +} + +static inline void ide_insw_p (u32 port, void *addr, u32 count) +{ + while (count--) { *(u16 *)addr = IN_WORD_P(port); addr += 2; } +} + +static inline u32 ide_inl (u32 port) +{ + return (u32) IN_LONG(port); +} + +static inline u32 ide_inl_p (u32 port) +{ + return (u32) IN_LONG_P(port); +} + +static inline void ide_insl (u32 port, void *addr, u32 count) +{ + ide_insw(port, addr, (count)<<1); +// while (count--) { *(u32 *)addr = IN_LONG(port); addr += 4; } +} + +static inline void ide_insl_p (u32 port, void *addr, u32 count) +{ + ide_insw_p(port, addr, (count)<<1); +// while (count--) { *(u32 *)addr = IN_LONG(port); addr += 4; } +} + +static inline void ide_outb (u8 addr, u32 port) +{ + OUT_BYTE(addr, port); +} + +static inline void ide_outb_p (u8 addr, u32 port) +{ + OUT_BYTE_P(addr, port); +} + +static inline void ide_outw (u16 addr, u32 port) +{ + OUT_WORD(addr, port); +} + +static inline void ide_outw_p (u16 addr, u32 port) +{ + OUT_WORD_P(addr, port); +} + +static inline void ide_outsw (u32 port, void *addr, u32 count) +{ + while (count--) { OUT_WORD(*(u16 *)addr, port); addr += 2; } +} + +static inline void ide_outsw_p (u32 port, void *addr, u32 count) +{ + while (count--) { OUT_WORD_P(*(u16 *)addr, port); addr += 2; } +} + +static inline void ide_outl (u32 addr, u32 port) +{ + OUT_LONG(addr, port); +} + +static inline void ide_outl_p (u32 addr, u32 port) +{ + OUT_LONG_P(addr, port); +} + +static inline void ide_outsl (u32 port, void *addr, u32 count) +{ + ide_outsw(port, addr, (count)<<1); +// while (count--) { OUT_LONG(*(u32 *)addr, port); addr += 4; } +} + +static inline void ide_outsl_p (u32 port, void *addr, u32 count) +{ + ide_outsw_p(port, addr, (count)<<1); +// while (count--) { OUT_LONG_P(*(u32 *)addr, port); addr += 4; } +} + +void default_hwif_iops (ide_hwif_t *hwif) +{ + hwif->OUTB = ide_outb; + hwif->OUTBP = ide_outb_p; + hwif->OUTW = ide_outw; + hwif->OUTWP = ide_outw_p; + hwif->OUTL = ide_outl; + hwif->OUTLP = ide_outl_p; + hwif->OUTSW = ide_outsw; + hwif->OUTSWP = ide_outsw_p; + hwif->OUTSL = ide_outsl; + hwif->OUTSLP = ide_outsl_p; + hwif->INB = ide_inb; + hwif->INBP = ide_inb_p; + hwif->INW = ide_inw; + hwif->INWP = ide_inw_p; + hwif->INL = ide_inl; + hwif->INLP = ide_inl_p; + hwif->INSW = ide_insw; + hwif->INSWP = ide_insw_p; + hwif->INSL = ide_insl; + hwif->INSLP = ide_insl_p; +} + +EXPORT_SYMBOL(default_hwif_iops); + +void default_hwif_transport (ide_hwif_t *hwif) +{ + hwif->ata_input_data = ata_input_data; + hwif->ata_output_data = ata_output_data; + hwif->atapi_input_bytes = atapi_input_bytes; + hwif->atapi_output_bytes = atapi_output_bytes; +} + +EXPORT_SYMBOL(default_hwif_transport); + +u32 read_24 (ide_drive_t *drive) +{ + u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG); + u8 lcyl = HWIF(drive)->INB(IDE_LCYL_REG); + u8 sect = HWIF(drive)->INB(IDE_SECTOR_REG); + return (hcyl<<16)|(lcyl<<8)|sect; +} + +EXPORT_SYMBOL(read_24); + +void SELECT_DRIVE (ide_drive_t *drive) +{ + if (HWIF(drive)->selectproc) + HWIF(drive)->selectproc(drive); + HWIF(drive)->OUTB(drive->select.all, IDE_SELECT_REG); +} + +EXPORT_SYMBOL(SELECT_DRIVE); + +void SELECT_INTERRUPT (ide_drive_t *drive) +{ + if (HWIF(drive)->intrproc) + HWIF(drive)->intrproc(drive); + else + HWIF(drive)->OUTB(drive->ctl|2, IDE_CONTROL_REG); +} + +EXPORT_SYMBOL(SELECT_INTERRUPT); + +void SELECT_MASK (ide_drive_t *drive, int mask) +{ + if (HWIF(drive)->maskproc) + HWIF(drive)->maskproc(drive, mask); +} + +EXPORT_SYMBOL(SELECT_MASK); + +void QUIRK_LIST (ide_drive_t *drive) +{ + if (HWIF(drive)->quirkproc) + drive->quirk_list = HWIF(drive)->quirkproc(drive); +} + +EXPORT_SYMBOL(QUIRK_LIST); + +#if SUPPORT_VLB_SYNC +/* + * Some localbus EIDE interfaces require a special access sequence + * when using 32-bit I/O instructions to transfer data. We call this + * the "vlb_sync" sequence, which consists of three successive reads + * of the sector count register location, with interrupts disabled + * to ensure that the reads all happen together. + */ +void ata_vlb_sync (ide_drive_t *drive, ide_ioreg_t port) +{ + (void) HWIF(drive)->INB(port); + (void) HWIF(drive)->INB(port); + (void) HWIF(drive)->INB(port); +} + +EXPORT_SYMBOL(ata_vlb_sync); +#endif /* SUPPORT_VLB_SYNC */ + +/* + * This is used for most PIO data transfers *from* the IDE interface + */ +void ata_input_data (ide_drive_t *drive, void *buffer, u32 wcount) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 io_32bit = drive->io_32bit; + + if (io_32bit) { +#if SUPPORT_VLB_SYNC + if (io_32bit & 2) { + unsigned long flags; + local_irq_save(flags); + ata_vlb_sync(drive, IDE_NSECTOR_REG); + hwif->INSL(IDE_DATA_REG, buffer, wcount); + local_irq_restore(flags); + } else +#endif /* SUPPORT_VLB_SYNC */ + hwif->INSL(IDE_DATA_REG, buffer, wcount); + } else { +#if SUPPORT_SLOW_DATA_PORTS + if (drive->slow) { + u16 *ptr = (u16 *) buffer; + while (wcount--) { + *ptr++ = hwif->INWP(IDE_DATA_REG); + *ptr++ = hwif->INWP(IDE_DATA_REG); + } + } else +#endif /* SUPPORT_SLOW_DATA_PORTS */ + hwif->INSW(IDE_DATA_REG, buffer, wcount<<1); + } +} + +EXPORT_SYMBOL(ata_input_data); + +/* + * This is used for most PIO data transfers *to* the IDE interface + */ +void ata_output_data (ide_drive_t *drive, void *buffer, u32 wcount) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 io_32bit = drive->io_32bit; + + if (io_32bit) { +#if SUPPORT_VLB_SYNC + if (io_32bit & 2) { + unsigned long flags; + local_irq_save(flags); + ata_vlb_sync(drive, IDE_NSECTOR_REG); + hwif->OUTSL(IDE_DATA_REG, buffer, wcount); + local_irq_restore(flags); + } else +#endif /* SUPPORT_VLB_SYNC */ + hwif->OUTSL(IDE_DATA_REG, buffer, wcount); + } else { +#if SUPPORT_SLOW_DATA_PORTS + if (drive->slow) { + u16 *ptr = (u16 *) buffer; + while (wcount--) { + hwif->OUTWP(*ptr++, IDE_DATA_REG); + hwif->OUTWP(*ptr++, IDE_DATA_REG); + } + } else +#endif /* SUPPORT_SLOW_DATA_PORTS */ + hwif->OUTSW(IDE_DATA_REG, buffer, wcount<<1); + } +} + +EXPORT_SYMBOL(ata_output_data); + +/* + * The following routines are mainly used by the ATAPI drivers. + * + * These routines will round up any request for an odd number of bytes, + * so if an odd bytecount is specified, be sure that there's at least one + * extra byte allocated for the buffer. + */ +void atapi_input_bytes (ide_drive_t *drive, void *buffer, u32 bytecount) +{ + ide_hwif_t *hwif = HWIF(drive); + + ++bytecount; +#if defined(CONFIG_ATARI) || defined(CONFIG_Q40) + if (MACH_IS_ATARI || MACH_IS_Q40) { + /* Atari has a byte-swapped IDE interface */ + insw_swapw(IDE_DATA_REG, buffer, bytecount / 2); + return; + } +#endif /* CONFIG_ATARI */ + hwif->ata_input_data(drive, buffer, bytecount / 4); + if ((bytecount & 0x03) >= 2) + hwif->INSW(IDE_DATA_REG, ((u8 *)buffer)+(bytecount & ~0x03), 1); +} + +EXPORT_SYMBOL(atapi_input_bytes); + +void atapi_output_bytes (ide_drive_t *drive, void *buffer, u32 bytecount) +{ + ide_hwif_t *hwif = HWIF(drive); + + ++bytecount; +#if defined(CONFIG_ATARI) || defined(CONFIG_Q40) + if (MACH_IS_ATARI || MACH_IS_Q40) { + /* Atari has a byte-swapped IDE interface */ + outsw_swapw(IDE_DATA_REG, buffer, bytecount / 2); + return; + } +#endif /* CONFIG_ATARI */ + hwif->ata_output_data(drive, buffer, bytecount / 4); + if ((bytecount & 0x03) >= 2) + hwif->OUTSW(IDE_DATA_REG, ((u8*)buffer)+(bytecount & ~0x03), 1); +} + +EXPORT_SYMBOL(atapi_output_bytes); + +/* + * Beginning of Taskfile OPCODE Library and feature sets. + */ +void ide_fix_driveid (struct hd_driveid *id) +{ +#ifndef __LITTLE_ENDIAN +# ifdef __BIG_ENDIAN + int i; + u16 *stringcast; + + id->config = __le16_to_cpu(id->config); + id->cyls = __le16_to_cpu(id->cyls); + id->reserved2 = __le16_to_cpu(id->reserved2); + id->heads = __le16_to_cpu(id->heads); + id->track_bytes = __le16_to_cpu(id->track_bytes); + id->sector_bytes = __le16_to_cpu(id->sector_bytes); + id->sectors = __le16_to_cpu(id->sectors); + id->vendor0 = __le16_to_cpu(id->vendor0); + id->vendor1 = __le16_to_cpu(id->vendor1); + id->vendor2 = __le16_to_cpu(id->vendor2); + stringcast = (u16 *)&id->serial_no[0]; + for (i = 0; i < (20/2); i++) + stringcast[i] = __le16_to_cpu(stringcast[i]); + id->buf_type = __le16_to_cpu(id->buf_type); + id->buf_size = __le16_to_cpu(id->buf_size); + id->ecc_bytes = __le16_to_cpu(id->ecc_bytes); + stringcast = (u16 *)&id->fw_rev[0]; + for (i = 0; i < (8/2); i++) + stringcast[i] = __le16_to_cpu(stringcast[i]); + stringcast = (u16 *)&id->model[0]; + for (i = 0; i < (40/2); i++) + stringcast[i] = __le16_to_cpu(stringcast[i]); + id->dword_io = __le16_to_cpu(id->dword_io); + id->reserved50 = __le16_to_cpu(id->reserved50); + id->field_valid = __le16_to_cpu(id->field_valid); + id->cur_cyls = __le16_to_cpu(id->cur_cyls); + id->cur_heads = __le16_to_cpu(id->cur_heads); + id->cur_sectors = __le16_to_cpu(id->cur_sectors); + id->cur_capacity0 = __le16_to_cpu(id->cur_capacity0); + id->cur_capacity1 = __le16_to_cpu(id->cur_capacity1); + id->lba_capacity = __le32_to_cpu(id->lba_capacity); + id->dma_1word = __le16_to_cpu(id->dma_1word); + id->dma_mword = __le16_to_cpu(id->dma_mword); + id->eide_pio_modes = __le16_to_cpu(id->eide_pio_modes); + id->eide_dma_min = __le16_to_cpu(id->eide_dma_min); + id->eide_dma_time = __le16_to_cpu(id->eide_dma_time); + id->eide_pio = __le16_to_cpu(id->eide_pio); + id->eide_pio_iordy = __le16_to_cpu(id->eide_pio_iordy); + for (i = 0; i < 2; ++i) + id->words69_70[i] = __le16_to_cpu(id->words69_70[i]); + for (i = 0; i < 4; ++i) + id->words71_74[i] = __le16_to_cpu(id->words71_74[i]); + id->queue_depth = __le16_to_cpu(id->queue_depth); + for (i = 0; i < 4; ++i) + id->words76_79[i] = __le16_to_cpu(id->words76_79[i]); + id->major_rev_num = __le16_to_cpu(id->major_rev_num); + id->minor_rev_num = __le16_to_cpu(id->minor_rev_num); + id->command_set_1 = __le16_to_cpu(id->command_set_1); + id->command_set_2 = __le16_to_cpu(id->command_set_2); + id->cfsse = __le16_to_cpu(id->cfsse); + id->cfs_enable_1 = __le16_to_cpu(id->cfs_enable_1); + id->cfs_enable_2 = __le16_to_cpu(id->cfs_enable_2); + id->csf_default = __le16_to_cpu(id->csf_default); + id->dma_ultra = __le16_to_cpu(id->dma_ultra); + id->word89 = __le16_to_cpu(id->word89); + id->word90 = __le16_to_cpu(id->word90); + id->CurAPMvalues = __le16_to_cpu(id->CurAPMvalues); + id->word92 = __le16_to_cpu(id->word92); + id->hw_config = __le16_to_cpu(id->hw_config); + id->acoustic = __le16_to_cpu(id->acoustic); + for (i = 0; i < 5; i++) + id->words95_99[i] = __le16_to_cpu(id->words95_99[i]); + id->lba_capacity_2 = __le64_to_cpu(id->lba_capacity_2); + for (i = 0; i < 22; i++) + id->words104_125[i] = __le16_to_cpu(id->words104_125[i]); + id->last_lun = __le16_to_cpu(id->last_lun); + id->word127 = __le16_to_cpu(id->word127); + id->dlf = __le16_to_cpu(id->dlf); + id->csfo = __le16_to_cpu(id->csfo); + for (i = 0; i < 26; i++) + id->words130_155[i] = __le16_to_cpu(id->words130_155[i]); + id->word156 = __le16_to_cpu(id->word156); + for (i = 0; i < 3; i++) + id->words157_159[i] = __le16_to_cpu(id->words157_159[i]); + id->cfa_power = __le16_to_cpu(id->cfa_power); + for (i = 0; i < 14; i++) + id->words161_175[i] = __le16_to_cpu(id->words161_175[i]); + for (i = 0; i < 31; i++) + id->words176_205[i] = __le16_to_cpu(id->words176_205[i]); + for (i = 0; i < 48; i++) + id->words206_254[i] = __le16_to_cpu(id->words206_254[i]); + id->integrity_word = __le16_to_cpu(id->integrity_word); +# else +# error "Please fix " +# endif +#endif +} + +EXPORT_SYMBOL(ide_fix_driveid); + +void ide_fixstring (u8 *s, const int bytecount, const int byteswap) +{ + u8 *p = s, *end = &s[bytecount & ~1]; /* bytecount must be even */ + + if (byteswap) { + /* convert from big-endian to host byte order */ + for (p = end ; p != s;) { + unsigned short *pp = (unsigned short *) (p -= 2); + *pp = ntohs(*pp); + } + } + /* strip leading blanks */ + while (s != end && *s == ' ') + ++s; + /* compress internal blanks and strip trailing blanks */ + while (s != end && *s) { + if (*s++ != ' ' || (s != end && *s && *s != ' ')) + *p++ = *(s-1); + } + /* wipe out trailing garbage */ + while (p != end) + *p++ = '\0'; +} + +EXPORT_SYMBOL(ide_fixstring); + +/* + * Needed for PCI irq sharing + */ +int drive_is_ready (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 stat = 0; + + if (drive->waiting_for_dma) + return hwif->ide_dma_test_irq(drive); + +#if 0 + /* need to guarantee 400ns since last command was issued */ + udelay(1); +#endif + +#ifdef CONFIG_IDEPCI_SHARE_IRQ + /* + * We do a passive status test under shared PCI interrupts on + * cards that truly share the ATA side interrupt, but may also share + * an interrupt with another pci card/device. We make no assumptions + * about possible isa-pnp and pci-pnp issues yet. + */ + if (IDE_CONTROL_REG) + stat = hwif->INB(IDE_ALTSTATUS_REG); + else +#endif /* CONFIG_IDEPCI_SHARE_IRQ */ + /* Note: this may clear a pending IRQ!! */ + stat = hwif->INB(IDE_STATUS_REG); + + if (stat & BUSY_STAT) + /* drive busy: definitely not interrupting */ + return 0; + + /* drive ready: *might* be interrupting */ + return 1; +} + +EXPORT_SYMBOL(drive_is_ready); + +/* + * Global for All, and taken from ide-pmac.c + */ +int wait_for_ready (ide_drive_t *drive, int timeout) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 stat = 0; + + while(--timeout) { + stat = hwif->INB(IDE_STATUS_REG); + if (!(stat & BUSY_STAT)) { + if (drive->ready_stat == 0) + break; + else if ((stat & drive->ready_stat)||(stat & ERR_STAT)) + break; + } + mdelay(1); + } + if ((stat & ERR_STAT) || timeout <= 0) { + if (stat & ERR_STAT) { + printk(KERN_ERR "%s: wait_for_ready, " + "error status: %x\n", drive->name, stat); + } + return 1; + } + return 0; +} + +EXPORT_SYMBOL(wait_for_ready); + +/* + * This routine busy-waits for the drive status to be not "busy". + * It then checks the status for all of the "good" bits and none + * of the "bad" bits, and if all is okay it returns 0. All other + * cases return 1 after invoking ide_error() -- caller should just return. + * + * This routine should get fixed to not hog the cpu during extra long waits.. + * That could be done by busy-waiting for the first jiffy or two, and then + * setting a timer to wake up at half second intervals thereafter, + * until timeout is achieved, before timing out. + */ +int ide_wait_stat (ide_startstop_t *startstop, ide_drive_t *drive, u8 good, u8 bad, unsigned long timeout) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 stat; + int i; + unsigned long flags; + + /* bail early if we've exceeded max_failures */ + if (drive->max_failures && (drive->failures > drive->max_failures)) { + *startstop = ide_stopped; + return 1; + } + + udelay(1); /* spec allows drive 400ns to assert "BUSY" */ + if ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) { + local_irq_set(flags); + timeout += jiffies; + while ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) { + if (time_after(jiffies, timeout)) { + local_irq_restore(flags); + *startstop = DRIVER(drive)->error(drive, "status timeout", stat); + return 1; + } + } + local_irq_restore(flags); + } + /* + * Allow status to settle, then read it again. + * A few rare drives vastly violate the 400ns spec here, + * so we'll wait up to 10usec for a "good" status + * rather than expensively fail things immediately. + * This fix courtesy of Matthew Faupel & Niccolo Rigacci. + */ + for (i = 0; i < 10; i++) { + udelay(1); + if (OK_STAT((stat = hwif->INB(IDE_STATUS_REG)), good, bad)) + return 0; + } + *startstop = DRIVER(drive)->error(drive, "status error", stat); + return 1; +} + +EXPORT_SYMBOL(ide_wait_stat); + +/* + * All hosts that use the 80c ribbon must use! + * The name is derived from upper byte of word 93 and the 80c ribbon. + */ +u8 eighty_ninty_three (ide_drive_t *drive) +{ +#if 0 + if (!HWIF(drive)->udma_four) + return 0; + + if (drive->id->major_rev_num) { + int hssbd = 0; + int i; + /* + * Determime highest Supported SPEC + */ + for (i=1; i<=15; i++) + if (drive->id->major_rev_num & (1<id->hw_config & 0x4000) && +#endif /* CONFIG_IDEDMA_IVB */ + (drive->id->hw_config & 0x6000)) ? 1 : 0); + +#else + + return ((u8) ((HWIF(drive)->udma_four) && +#ifndef CONFIG_IDEDMA_IVB + (drive->id->hw_config & 0x4000) && +#endif /* CONFIG_IDEDMA_IVB */ + (drive->id->hw_config & 0x6000)) ? 1 : 0); +#endif +} + +EXPORT_SYMBOL(eighty_ninty_three); + +int ide_ata66_check (ide_drive_t *drive, ide_task_t *args) +{ + if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_SETFEATURES) && + (args->tfRegister[IDE_SECTOR_OFFSET] > XFER_UDMA_2) && + (args->tfRegister[IDE_FEATURE_OFFSET] == SETFEATURES_XFER)) { +#ifndef CONFIG_IDEDMA_IVB + if ((drive->id->hw_config & 0x6000) == 0) { +#else /* !CONFIG_IDEDMA_IVB */ + if (((drive->id->hw_config & 0x2000) == 0) || + ((drive->id->hw_config & 0x4000) == 0)) { +#endif /* CONFIG_IDEDMA_IVB */ + printk("%s: Speed warnings UDMA 3/4/5 is not " + "functional.\n", drive->name); + return 1; + } + if (!HWIF(drive)->udma_four) { + printk("%s: Speed warnings UDMA 3/4/5 is not " + "functional.\n", + HWIF(drive)->name); + return 1; + } + } + return 0; +} + +EXPORT_SYMBOL(ide_ata66_check); + +/* + * Backside of HDIO_DRIVE_CMD call of SETFEATURES_XFER. + * 1 : Safe to update drive->id DMA registers. + * 0 : OOPs not allowed. + */ +int set_transfer (ide_drive_t *drive, ide_task_t *args) +{ + if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_SETFEATURES) && + (args->tfRegister[IDE_SECTOR_OFFSET] >= XFER_SW_DMA_0) && + (args->tfRegister[IDE_FEATURE_OFFSET] == SETFEATURES_XFER) && + (drive->id->dma_ultra || + drive->id->dma_mword || + drive->id->dma_1word)) + return 1; + + return 0; +} + +EXPORT_SYMBOL(set_transfer); + +u8 ide_auto_reduce_xfer (ide_drive_t *drive) +{ + if (!drive->crc_count) + return drive->current_speed; + drive->crc_count = 0; + + switch(drive->current_speed) { + case XFER_UDMA_7: return XFER_UDMA_6; + case XFER_UDMA_6: return XFER_UDMA_5; + case XFER_UDMA_5: return XFER_UDMA_4; + case XFER_UDMA_4: return XFER_UDMA_3; + case XFER_UDMA_3: return XFER_UDMA_2; + case XFER_UDMA_2: return XFER_UDMA_1; + case XFER_UDMA_1: return XFER_UDMA_0; + /* + * OOPS we do not goto non Ultra DMA modes + * without iCRC's available we force + * the system to PIO and make the user + * invoke the ATA-1 ATA-2 DMA modes. + */ + case XFER_UDMA_0: + default: return XFER_PIO_4; + } +} + +EXPORT_SYMBOL(ide_auto_reduce_xfer); + +/* + * Update the + */ +int ide_driveid_update (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + struct hd_driveid *id; +#if 0 + id = kmalloc(SECTOR_WORDS*4, GFP_ATOMIC); + if (!id) + return 0; + + taskfile_lib_get_identify(drive, (char *)&id); + + ide_fix_driveid(id); + if (id) { + drive->id->dma_ultra = id->dma_ultra; + drive->id->dma_mword = id->dma_mword; + drive->id->dma_1word = id->dma_1word; + /* anything more ? */ + kfree(id); + } + return 1; +#else + /* + * Re-read drive->id for possible DMA mode + * change (copied from ide-probe.c) + */ + unsigned long timeout, flags; + + SELECT_MASK(drive, 1); + if (IDE_CONTROL_REG) + hwif->OUTB(drive->ctl,IDE_CONTROL_REG); + ide_delay_50ms(); + hwif->OUTB(WIN_IDENTIFY, IDE_COMMAND_REG); + timeout = jiffies + WAIT_WORSTCASE; + do { + if (time_after(jiffies, timeout)) { + SELECT_MASK(drive, 0); + return 0; /* drive timed-out */ + } + ide_delay_50ms(); /* give drive a breather */ + } while (hwif->INB(IDE_ALTSTATUS_REG) & BUSY_STAT); + ide_delay_50ms(); /* wait for IRQ and DRQ_STAT */ + if (!OK_STAT(hwif->INB(IDE_STATUS_REG),DRQ_STAT,BAD_R_STAT)) { + SELECT_MASK(drive, 0); + printk("%s: CHECK for good STATUS\n", drive->name); + return 0; + } + local_irq_save(flags); + SELECT_MASK(drive, 0); + id = kmalloc(SECTOR_WORDS*4, GFP_ATOMIC); + if (!id) { + local_irq_restore(flags); + return 0; + } + ata_input_data(drive, id, SECTOR_WORDS); + (void) hwif->INB(IDE_STATUS_REG); /* clear drive IRQ */ + local_irq_enable(); + local_irq_restore(flags); + ide_fix_driveid(id); + if (id) { + drive->id->dma_ultra = id->dma_ultra; + drive->id->dma_mword = id->dma_mword; + drive->id->dma_1word = id->dma_1word; + /* anything more ? */ + kfree(id); + } + + return 1; +#endif +} + +EXPORT_SYMBOL(ide_driveid_update); + +/* + * Similar to ide_wait_stat(), except it never calls ide_error internally. + * This is a kludge to handle the new ide_config_drive_speed() function, + * and should not otherwise be used anywhere. Eventually, the tuneproc's + * should be updated to return ide_startstop_t, in which case we can get + * rid of this abomination again. :) -ml + * + * It is gone.......... + * + * const char *msg == consider adding for verbose errors. + */ +int ide_config_drive_speed (ide_drive_t *drive, u8 speed) +{ + ide_hwif_t *hwif = HWIF(drive); + int i, error = 1; + u8 stat; + +// while (HWGROUP(drive)->busy) +// ide_delay_50ms(); + +#if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI) + hwif->ide_dma_host_off(drive); +#endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */ + + /* + * Don't use ide_wait_cmd here - it will + * attempt to set_geometry and recalibrate, + * but for some reason these don't work at + * this point (lost interrupt). + */ + /* + * Select the drive, and issue the SETFEATURES command + */ + disable_irq(hwif->irq); /* disable_irq_nosync ?? */ + udelay(1); + SELECT_DRIVE(drive); + SELECT_MASK(drive, 0); + udelay(1); + if (IDE_CONTROL_REG) + hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG); + hwif->OUTB(speed, IDE_NSECTOR_REG); + hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG); + hwif->OUTB(WIN_SETFEATURES, IDE_COMMAND_REG); + if ((IDE_CONTROL_REG) && (drive->quirk_list == 2)) + hwif->OUTB(drive->ctl, IDE_CONTROL_REG); + udelay(1); + /* + * Wait for drive to become non-BUSY + */ + if ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) { + unsigned long flags, timeout; + local_irq_set(flags); + timeout = jiffies + WAIT_CMD; + while ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) { + if (time_after(jiffies, timeout)) + break; + } + local_irq_restore(flags); + } + + /* + * Allow status to settle, then read it again. + * A few rare drives vastly violate the 400ns spec here, + * so we'll wait up to 10usec for a "good" status + * rather than expensively fail things immediately. + * This fix courtesy of Matthew Faupel & Niccolo Rigacci. + */ + for (i = 0; i < 10; i++) { + udelay(1); + if (OK_STAT((stat = hwif->INB(IDE_STATUS_REG)), DRIVE_READY, BUSY_STAT|DRQ_STAT|ERR_STAT)) { + error = 0; + break; + } + } + + SELECT_MASK(drive, 0); + + enable_irq(hwif->irq); + + if (error) { + (void) ide_dump_status(drive, "set_drive_speed_status", stat); + return error; + } + + drive->id->dma_ultra &= ~0xFF00; + drive->id->dma_mword &= ~0x0F00; + drive->id->dma_1word &= ~0x0F00; + +#if defined(CONFIG_BLK_DEV_IDEDMA) && !defined(CONFIG_DMA_NONPCI) + if (speed >= XFER_SW_DMA_0) + hwif->ide_dma_host_on(drive); +#endif /* (CONFIG_BLK_DEV_IDEDMA) && !(CONFIG_DMA_NONPCI) */ + + switch(speed) { + case XFER_UDMA_7: drive->id->dma_ultra |= 0x8080; break; + case XFER_UDMA_6: drive->id->dma_ultra |= 0x4040; break; + case XFER_UDMA_5: drive->id->dma_ultra |= 0x2020; break; + case XFER_UDMA_4: drive->id->dma_ultra |= 0x1010; break; + case XFER_UDMA_3: drive->id->dma_ultra |= 0x0808; break; + case XFER_UDMA_2: drive->id->dma_ultra |= 0x0404; break; + case XFER_UDMA_1: drive->id->dma_ultra |= 0x0202; break; + case XFER_UDMA_0: drive->id->dma_ultra |= 0x0101; break; + case XFER_MW_DMA_2: drive->id->dma_mword |= 0x0404; break; + case XFER_MW_DMA_1: drive->id->dma_mword |= 0x0202; break; + case XFER_MW_DMA_0: drive->id->dma_mword |= 0x0101; break; + case XFER_SW_DMA_2: drive->id->dma_1word |= 0x0404; break; + case XFER_SW_DMA_1: drive->id->dma_1word |= 0x0202; break; + case XFER_SW_DMA_0: drive->id->dma_1word |= 0x0101; break; + default: break; + } + if (!drive->init_speed) + drive->init_speed = speed; + drive->current_speed = speed; + return error; +} + +EXPORT_SYMBOL(ide_config_drive_speed); + + +/* + * This should get invoked any time we exit the driver to + * wait for an interrupt response from a drive. handler() points + * at the appropriate code to handle the next interrupt, and a + * timer is started to prevent us from waiting forever in case + * something goes wrong (see the ide_timer_expiry() handler later on). + */ +void ide_set_handler (ide_drive_t *drive, ide_handler_t *handler, + unsigned int timeout, ide_expiry_t *expiry) +{ + unsigned long flags; + ide_hwgroup_t *hwgroup = HWGROUP(drive); + + spin_lock_irqsave(&io_request_lock, flags); + if (hwgroup->handler != NULL) { + printk("%s: ide_set_handler: handler not null; " + "old=%p, new=%p\n", + drive->name, hwgroup->handler, handler); + } + hwgroup->handler = handler; + hwgroup->expiry = expiry; + hwgroup->timer.expires = jiffies + timeout; + add_timer(&hwgroup->timer); + spin_unlock_irqrestore(&io_request_lock, flags); +} + +EXPORT_SYMBOL(ide_set_handler); + + +/* needed below */ +ide_startstop_t do_reset1 (ide_drive_t *, int); + +/* + * atapi_reset_pollfunc() gets invoked to poll the interface for completion every 50ms + * during an atapi drive reset operation. If the drive has not yet responded, + * and we have not yet hit our maximum waiting time, then the timer is restarted + * for another 50ms. + */ +static ide_startstop_t atapi_reset_pollfunc (ide_drive_t *drive) +{ + ide_hwgroup_t *hwgroup = HWGROUP(drive); + ide_hwif_t *hwif = HWIF(drive); + u8 stat; + + SELECT_DRIVE(drive); + udelay (10); + + if (OK_STAT(stat = hwif->INB(IDE_STATUS_REG), 0, BUSY_STAT)) { + printk("%s: ATAPI reset complete\n", drive->name); + } else { + if (time_before(jiffies, hwgroup->poll_timeout)) { + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20, NULL); + /* continue polling */ + return ide_started; + } + /* end of polling */ + hwgroup->poll_timeout = 0; + printk("%s: ATAPI reset timed-out, status=0x%02x\n", + drive->name, stat); + /* do it the old fashioned way */ + return do_reset1(drive, 1); + } + /* done polling */ + hwgroup->poll_timeout = 0; + return ide_stopped; +} + +/* + * reset_pollfunc() gets invoked to poll the interface for completion every 50ms + * during an ide reset operation. If the drives have not yet responded, + * and we have not yet hit our maximum waiting time, then the timer is restarted + * for another 50ms. + */ +static ide_startstop_t reset_pollfunc (ide_drive_t *drive) +{ + ide_hwgroup_t *hwgroup = HWGROUP(drive); + ide_hwif_t *hwif = HWIF(drive); + u8 tmp; + + if (hwif->reset_poll != NULL) { + if (hwif->reset_poll(drive)) { + printk(KERN_ERR "%s: host reset_poll failure for %s.\n", + hwif->name, drive->name); + return ide_stopped; + } + } + + if (!OK_STAT(tmp = hwif->INB(IDE_STATUS_REG), 0, BUSY_STAT)) { + if (time_before(jiffies, hwgroup->poll_timeout)) { + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL); + /* continue polling */ + return ide_started; + } + printk("%s: reset timed-out, status=0x%02x\n", hwif->name, tmp); + drive->failures++; + } else { + printk("%s: reset: ", hwif->name); + if ((tmp = hwif->INB(IDE_ERROR_REG)) == 1) { + printk("success\n"); + drive->failures = 0; + } else { + drive->failures++; +#if FANCY_STATUS_DUMPS + printk("master: "); + switch (tmp & 0x7f) { + case 1: printk("passed"); + break; + case 2: printk("formatter device error"); + break; + case 3: printk("sector buffer error"); + break; + case 4: printk("ECC circuitry error"); + break; + case 5: printk("controlling MPU error"); + break; + default:printk("error (0x%02x?)", tmp); + } + if (tmp & 0x80) + printk("; slave: failed"); + printk("\n"); +#else + printk("failed\n"); +#endif /* FANCY_STATUS_DUMPS */ + } + } + hwgroup->poll_timeout = 0; /* done polling */ + return ide_stopped; +} + +void check_dma_crc (ide_drive_t *drive) +{ + if (drive->crc_count) { + (void) HWIF(drive)->ide_dma_off_quietly(drive); + if ((HWIF(drive)->speedproc) != NULL) + HWIF(drive)->speedproc(drive, ide_auto_reduce_xfer(drive)); + if (drive->current_speed >= XFER_SW_DMA_0) + (void) HWIF(drive)->ide_dma_on(drive); + } else { + (void) HWIF(drive)->ide_dma_off(drive); + } +} + +void pre_reset (ide_drive_t *drive) +{ + if (drive->driver != NULL) + DRIVER(drive)->pre_reset(drive); + + if (!drive->keep_settings) { + if (drive->using_dma) { + check_dma_crc(drive); + } else { + drive->unmask = 0; + drive->io_32bit = 0; + } + return; + } + if (drive->using_dma) + check_dma_crc(drive); + + if (HWIF(drive)->pre_reset != NULL) + HWIF(drive)->pre_reset(drive); + +} + +/* + * do_reset1() attempts to recover a confused drive by resetting it. + * Unfortunately, resetting a disk drive actually resets all devices on + * the same interface, so it can really be thought of as resetting the + * interface rather than resetting the drive. + * + * ATAPI devices have their own reset mechanism which allows them to be + * individually reset without clobbering other devices on the same interface. + * + * Unfortunately, the IDE interface does not generate an interrupt to let + * us know when the reset operation has finished, so we must poll for this. + * Equally poor, though, is the fact that this may a very long time to complete, + * (up to 30 seconds worstcase). So, instead of busy-waiting here for it, + * we set a timer to poll at 50ms intervals. + */ +ide_startstop_t do_reset1 (ide_drive_t *drive, int do_not_try_atapi) +{ + unsigned int unit; + unsigned long flags; + ide_hwif_t *hwif = HWIF(drive); + ide_hwgroup_t *hwgroup = HWGROUP(drive); + + local_irq_save(flags); + + /* For an ATAPI device, first try an ATAPI SRST. */ + if (drive->media != ide_disk && !do_not_try_atapi) { + pre_reset(drive); + SELECT_DRIVE(drive); + udelay (20); + hwif->OUTB(WIN_SRST, IDE_COMMAND_REG); + hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &atapi_reset_pollfunc, HZ/20, NULL); + local_irq_restore(flags); + return ide_started; + } + + /* + * First, reset any device state data we were maintaining + * for any of the drives on this interface. + */ + for (unit = 0; unit < MAX_DRIVES; ++unit) + pre_reset(&hwif->drives[unit]); + +#if OK_TO_RESET_CONTROLLER + if (!IDE_CONTROL_REG) { + local_irq_restore(flags); + return ide_stopped; + } + +# if 0 + { + u8 control = hwif->INB(IDE_CONTROL_REG); + control |= 0x04; + hwif->OUTB(control,IDE_CONTROL_REG); + udelay(30); + control &= 0xFB; + hwif->OUTB(control, IDE_CONTROL_REG); + } +# else + /* + * Note that we also set nIEN while resetting the device, + * to mask unwanted interrupts from the interface during the reset. + * However, due to the design of PC hardware, this will cause an + * immediate interrupt due to the edge transition it produces. + * This single interrupt gives us a "fast poll" for drives that + * recover from reset very quickly, saving us the first 50ms wait time. + */ + /* set SRST and nIEN */ + hwif->OUTB(drive->ctl|6,IDE_CONTROL_REG); + /* more than enough time */ + udelay(10); + if (drive->quirk_list == 2) { + /* clear SRST and nIEN */ + hwif->OUTB(drive->ctl, IDE_CONTROL_REG); + } else { + /* clear SRST, leave nIEN */ + hwif->OUTB(drive->ctl|2, IDE_CONTROL_REG); + } + /* more than enough time */ + udelay(10); + hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, &reset_pollfunc, HZ/20, NULL); +# endif + /* + * Some weird controller like resetting themselves to a strange + * state when the disks are reset this way. At least, the Winbond + * 553 documentation says that + */ + if (hwif->resetproc != NULL) { + hwif->resetproc(drive); + +# if 0 + if (drive->failures) { + local_irq_restore(flags); + return ide_stopped; + } +# endif + } + +#endif /* OK_TO_RESET_CONTROLLER */ + + local_irq_restore(flags); + return ide_started; +} + +#if 0 +/* + * ide_do_reset() is the entry point to the drive/interface reset code. + */ +ide_startstop_t ide_do_reset (ide_drive_t *drive) +{ + return do_reset1(drive, 0); +} +#else +/* + * ide_do_reset() is the entry point to the drive/interface reset code. + */ +ide_startstop_t ide_do_reset (ide_drive_t *drive) +{ + ide_startstop_t start_stop = ide_started; +# if 0 + u8 tmp_dma = drive->using_dma; + u8 cspeed = drive->current_speed; + u8 unmask = drive->unmask; +# endif + + if (HWGROUP(drive)->handler != NULL) { + unsigned long flags; + spin_lock_irqsave(&io_request_lock, flags); + HWGROUP(drive)->handler = NULL; + del_timer(&HWGROUP(drive)->timer); + spin_unlock_irqrestore(&io_request_lock, flags); + } + + start_stop = do_reset1(drive, 0); +# if 0 + /* + * check for suspend-spindown flag, + * to attempt a restart or spinup of device. + */ + if (drive->suspend_reset) { + /* + * APM WAKE UP todo !! + * int nogoodpower = 1; + * while(nogoodpower) { + * check_power1() or check_power2() + * nogoodpower = 0; + * } + * HWIF(drive)->multiproc(drive); + */ +# endif + + return start_stop; +} +#endif + +EXPORT_SYMBOL(ide_do_reset); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-lib.c linux.20pre5-ac2/drivers/ide/ide-lib.c --- linux.20pre5/drivers/ide/ide-lib.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-lib.c 2002-09-01 18:44:42.000000000 +0100 @@ -0,0 +1,189 @@ +#include +#define __NO_VERSION__ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +/* + * IDE library routines. These are plug in code that most + * drivers can use but occasionally may be weird enough + * to want to do their own thing with + * + * Add common non I/O op stuff here. Make sure it has proper + * kernel-doc function headers or your patch will be rejected + */ + + +/** + * ide_xfer_verbose - return IDE mode names + * @xfer_rate: rate to name + * + * Returns a constant string giving the name of the mode + * requested. + */ + +char *ide_xfer_verbose (u8 xfer_rate) +{ + switch(xfer_rate) { + case XFER_UDMA_7: return("UDMA 7"); + case XFER_UDMA_6: return("UDMA 6"); + case XFER_UDMA_5: return("UDMA 5"); + case XFER_UDMA_4: return("UDMA 4"); + case XFER_UDMA_3: return("UDMA 3"); + case XFER_UDMA_2: return("UDMA 2"); + case XFER_UDMA_1: return("UDMA 1"); + case XFER_UDMA_0: return("UDMA 0"); + case XFER_MW_DMA_2: return("MW DMA 2"); + case XFER_MW_DMA_1: return("MW DMA 1"); + case XFER_MW_DMA_0: return("MW DMA 0"); + case XFER_SW_DMA_2: return("SW DMA 2"); + case XFER_SW_DMA_1: return("SW DMA 1"); + case XFER_SW_DMA_0: return("SW DMA 0"); + case XFER_PIO_4: return("PIO 4"); + case XFER_PIO_3: return("PIO 3"); + case XFER_PIO_2: return("PIO 2"); + case XFER_PIO_1: return("PIO 1"); + case XFER_PIO_0: return("PIO 0"); + case XFER_PIO_SLOW: return("PIO SLOW"); + default: return("XFER ERROR"); + } +} + +EXPORT_SYMBOL(ide_xfer_verbose); +#if 0 +/** + * ide_dma_speed - compute DMA speed + * @drive: drive + * @mode; intended mode + * + * Checks the drive capabilities and returns the speed to use + * for the transfer. Returns -1 if the requested mode is unknown + * (eg PIO) + */ + +u8 ide_dma_speed(ide_drive_t *drive, u8 mode) +{ + struct hd_driveid *id = drive->id; + ide_hwif_t *hwif = HWIF(drive); + u8 speed = 0; + + if (hwif->atapi_dma == 0) + return 0; + + switch(mode) { + case 0x04: + if ((id->dma_ultra & 0x0040) && + (id->dma_ultra & hwif->ultra_mask)) + { speed = XFER_UDMA_6; break; } + case 0x03: + if ((id->dma_ultra & 0x0020) && + (id->dma_ultra & hwif->ultra_mask)) + { speed = XFER_UDMA_5; break; } + case 0x02: + if ((id->dma_ultra & 0x0010) && + (id->dma_ultra & hwif->ultra_mask)) + { speed = XFER_UDMA_4; break; } + if ((id->dma_ultra & 0x0008) && + (id->dma_ultra & hwif->ultra_mask)) + { speed = XFER_UDMA_3; break; } + case 0x01: + if ((id->dma_ultra & 0x0004) && + (id->dma_ultra & hwif->ultra_mask)) + { speed = XFER_UDMA_2; break; } + if ((id->dma_ultra & 0x0002) && + (id->dma_ultra & hwif->ultra_mask)) + { speed = XFER_UDMA_1; break; } + if ((id->dma_ultra & 0x0001) && + (id->dma_ultra & hwif->ultra_mask)) + { speed = XFER_UDMA_0; break; } + case 0x00: + if ((id->dma_mword & 0x0004) && + (id->dma_mword & hwif->mwdma_mask)) + { speed = XFER_MW_DMA_2; break; } + if ((id->dma_mword & 0x0002) && + (id->dma_mword & hwif->mwdma_mask)) + { speed = XFER_MW_DMA_1; break; } + if ((id->dma_mword & 0x0001) && + (id->dma_mword & hwif->mwdma_mask)) + { speed = XFER_MW_DMA_0; break; } + if ((id->dma_1word & 0x0004) && + (id->dma_1word & hwif->swdma_mask)) + { speed = XFER_SW_DMA_2; break; } + if ((id->dma_1word & 0x0002) && + (id->dma_1word & hwif->swdma_mask)) + { speed = XFER_SW_DMA_1; break; } + if ((id->dma_1word & 0x0001) && + (id->dma_1word & hwif->swdma_mask)) + { speed = XFER_SW_DMA_0; break; } + } + +// printk("%s: %s: mode 0x%02x, speed 0x%02x\n", +// __FUNCTION__, drive->name, mode, speed); + + return speed; +} + +EXPORT_SYMBOL(ide_dma_speed); + + +/** + * ide_rate_filter - return best speed for mode + * @mode: modes available + * @speed: desired speed + * + * Given the available DMA/UDMA mode this function returns + * the best available speed at or below the speed requested. + */ + +u8 ide_rate_filter (u8 mode, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + +// printk("%s: mode 0x%02x, speed 0x%02x\n", __FUNCTION__, mode, speed); + + /* So that we remember to update this if new modes appear */ + if (mode > 4) + BUG(); + return min(speed, speed_max[mode]); +#else /* !CONFIG_BLK_DEV_IDEDMA */ + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +EXPORT_SYMBOL(ide_rate_filter); + +int ide_dma_enable (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + struct hd_driveid *id = drive->id; + + return ((int) ((((id->dma_ultra >> 8) & hwif->ultra_mask) || + ((id->dma_mword >> 8) & hwif->mwdma_mask) || + ((id->dma_1word >> 8) & hwif->swdma_mask)) ? 1 : 0)); +} + +EXPORT_SYMBOL(ide_dma_enable); +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-m8xx.c linux.20pre5-ac2/drivers/ide/ide-m8xx.c --- linux.20pre5/drivers/ide/ide-m8xx.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-m8xx.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,857 +0,0 @@ -/* - * linux/drivers/ide/ide-m8xx.c - * - * Copyright (C) 2000, 2001 Wolfgang Denk, wd@denx.de - * Modified for direct IDE interface - * by Thomas Lange, thomas@corelatus.com - * Modified for direct IDE interface on 8xx without using the PCMCIA - * controller - * by Steven.Scholz@imc-berlin.de - * Moved out of arch/ppc/kernel/m8xx_setup.c, other minor cleanups - * by Mathew Locke - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ide_modes.h" -static int identify (volatile unsigned char *p); -static void print_fixed (volatile unsigned char *p); -static void print_funcid (int func); -static int check_ide_device (unsigned long base); - -static void ide_interrupt_ack (void *dev); -static void m8xx_ide_tuneproc(ide_drive_t *drive, byte pio); - -typedef struct ide_ioport_desc { - unsigned long base_off; /* Offset to PCMCIA memory */ - ide_ioreg_t reg_off[IDE_NR_PORTS]; /* controller register offsets */ - int irq; /* IRQ */ -} ide_ioport_desc_t; - -ide_ioport_desc_t ioport_dsc[MAX_HWIFS] = { -#ifdef IDE0_BASE_OFFSET - { IDE0_BASE_OFFSET, - { - IDE0_DATA_REG_OFFSET, - IDE0_ERROR_REG_OFFSET, - IDE0_NSECTOR_REG_OFFSET, - IDE0_SECTOR_REG_OFFSET, - IDE0_LCYL_REG_OFFSET, - IDE0_HCYL_REG_OFFSET, - IDE0_SELECT_REG_OFFSET, - IDE0_STATUS_REG_OFFSET, - IDE0_CONTROL_REG_OFFSET, - IDE0_IRQ_REG_OFFSET, - }, - IDE0_INTERRUPT, - }, -#ifdef IDE1_BASE_OFFSET - { IDE1_BASE_OFFSET, - { - IDE1_DATA_REG_OFFSET, - IDE1_ERROR_REG_OFFSET, - IDE1_NSECTOR_REG_OFFSET, - IDE1_SECTOR_REG_OFFSET, - IDE1_LCYL_REG_OFFSET, - IDE1_HCYL_REG_OFFSET, - IDE1_SELECT_REG_OFFSET, - IDE1_STATUS_REG_OFFSET, - IDE1_CONTROL_REG_OFFSET, - IDE1_IRQ_REG_OFFSET, - }, - IDE1_INTERRUPT, - }, -#endif /* IDE1_BASE_OFFSET */ -#endif /* IDE0_BASE_OFFSET */ -}; - -ide_pio_timings_t ide_pio_clocks[6]; -int hold_time[6] = {30, 20, 15, 10, 10, 10 }; /* PIO Mode 5 with IORDY (nonstandard) */ - -/* - * Warning: only 1 (ONE) PCMCIA slot supported here, - * which must be correctly initialized by the firmware (PPCBoot). - */ -static int _slot_ = -1; /* will be read from PCMCIA registers */ - -/* Make clock cycles and always round up */ -#define PCMCIA_MK_CLKS( t, T ) (( (t) * ((T)/1000000) + 999U ) / 1000U ) - - - -/* - * IDE stuff. - */ -static int -m8xx_ide_default_irq(ide_ioreg_t base) -{ -#ifdef CONFIG_BLK_DEV_MPC8xx_IDE - if (base >= MAX_HWIFS) - return 0; - - printk("[%d] m8xx_ide_default_irq %d\n",__LINE__,ioport_dsc[base].irq); - - return (ioport_dsc[base].irq); -#else - return 9; -#endif -} - -static ide_ioreg_t -m8xx_ide_default_io_base(int index) -{ - return index; -} - -#define M8XX_PCMCIA_CD2(slot) (0x10000000 >> (slot << 4)) -#define M8XX_PCMCIA_CD1(slot) (0x08000000 >> (slot << 4)) - -/* - * The TQM850L hardware has two pins swapped! Grrrrgh! - */ -#ifdef CONFIG_TQM850L -#define __MY_PCMCIA_GCRX_CXRESET PCMCIA_GCRX_CXOE -#define __MY_PCMCIA_GCRX_CXOE PCMCIA_GCRX_CXRESET -#else -#define __MY_PCMCIA_GCRX_CXRESET PCMCIA_GCRX_CXRESET -#define __MY_PCMCIA_GCRX_CXOE PCMCIA_GCRX_CXOE -#endif - -#if defined(CONFIG_BLK_DEV_MPC8xx_IDE) && defined(CONFIG_IDE_8xx_PCCARD) -#define PCMCIA_SCHLVL IDE0_INTERRUPT /* Status Change Interrupt Level */ -static int pcmcia_schlvl = PCMCIA_SCHLVL; -#endif - -/* - * See include/linux/ide.h for definition of hw_regs_t (p, base) - */ - -/* - * m8xx_ide_init_hwif_ports for a direct IDE interface _using_ - */ -#if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) -static void -m8xx_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, - ide_ioreg_t ctrl_port, int *irq) -{ - ide_ioreg_t *p = hw->io_ports; - int i; - - typedef struct { - ulong br; - ulong or; - } pcmcia_win_t; - volatile pcmcia_win_t *win; - volatile pcmconf8xx_t *pcmp; - - uint *pgcrx; - u32 pcmcia_phy_base; - u32 pcmcia_phy_end; - static unsigned long pcmcia_base = 0; - unsigned long base; - - *p = 0; - if (irq) - *irq = 0; - - pcmp = (pcmconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_pcmcia)); - - if (!pcmcia_base) { - /* - * Read out PCMCIA registers. Since the reset values - * are undefined, we sure hope that they have been - * set up by firmware - */ - - /* Scan all registers for valid settings */ - pcmcia_phy_base = 0xFFFFFFFF; - pcmcia_phy_end = 0; - /* br0 is start of brX and orX regs */ - win = (pcmcia_win_t *) \ - (&(((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pbr0)); - for (i = 0; i < 8; i++) { - if (win->or & 1) { /* This bank is marked as valid */ - if (win->br < pcmcia_phy_base) { - pcmcia_phy_base = win->br; - } - if ((win->br + PCMCIA_MEM_SIZE) > pcmcia_phy_end) { - pcmcia_phy_end = win->br + PCMCIA_MEM_SIZE; - } - /* Check which slot that has been defined */ - _slot_ = (win->or >> 2) & 1; - - } /* Valid bank */ - win++; - } /* for */ - - printk ("PCMCIA slot %c: phys mem %08x...%08x (size %08x)\n", - 'A' + _slot_, - pcmcia_phy_base, pcmcia_phy_end, - pcmcia_phy_end - pcmcia_phy_base); - - pcmcia_base=(unsigned long)ioremap(pcmcia_phy_base, - pcmcia_phy_end-pcmcia_phy_base); - -#ifdef DEBUG - printk ("PCMCIA virt base: %08lx\n", pcmcia_base); -#endif - /* Compute clock cycles for PIO timings */ - for (i=0; i<6; ++i) { - bd_t *binfo = (bd_t *)__res; - - hold_time[i] = - PCMCIA_MK_CLKS (hold_time[i], - binfo->bi_busfreq); - ide_pio_clocks[i].setup_time = - PCMCIA_MK_CLKS (ide_pio_timings[i].setup_time, - binfo->bi_busfreq); - ide_pio_clocks[i].active_time = - PCMCIA_MK_CLKS (ide_pio_timings[i].active_time, - binfo->bi_busfreq); - ide_pio_clocks[i].cycle_time = - PCMCIA_MK_CLKS (ide_pio_timings[i].cycle_time, - binfo->bi_busfreq); -#if 0 - printk ("PIO mode %d timings: %d/%d/%d => %d/%d/%d\n", - i, - ide_pio_clocks[i].setup_time, - ide_pio_clocks[i].active_time, - ide_pio_clocks[i].hold_time, - ide_pio_clocks[i].cycle_time, - ide_pio_timings[i].setup_time, - ide_pio_timings[i].active_time, - ide_pio_timings[i].hold_time, - ide_pio_timings[i].cycle_time); -#endif - } - } - - if (data_port >= MAX_HWIFS) - return; - - if (_slot_ == -1) { - printk ("PCMCIA slot has not been defined! Using A as default\n"); - _slot_ = 0; - } - -#ifdef CONFIG_IDE_8xx_PCCARD - -#ifdef DEBUG - printk ("PIPR = 0x%08X slot %c ==> mask = 0x%X\n", - pcmp->pcmc_pipr, - 'A' + _slot_, - M8XX_PCMCIA_CD1(_slot_) | M8XX_PCMCIA_CD2(_slot_) ); -#endif /* DEBUG */ - - if (pcmp->pcmc_pipr & (M8XX_PCMCIA_CD1(_slot_)|M8XX_PCMCIA_CD2(_slot_))) { - printk ("No card in slot %c: PIPR=%08x\n", - 'A' + _slot_, (u32) pcmp->pcmc_pipr); - return; /* No card in slot */ - } - - check_ide_device (pcmcia_base); - -#endif /* CONFIG_IDE_8xx_PCCARD */ - - base = pcmcia_base + ioport_dsc[data_port].base_off; -#ifdef DEBUG - printk ("base: %08x + %08x = %08x\n", - pcmcia_base, ioport_dsc[data_port].base_off, base); -#endif - - for (i = 0; i < IDE_NR_PORTS; ++i) { -#ifdef DEBUG - printk ("port[%d]: %08x + %08x = %08x\n", - i, - base, - ioport_dsc[data_port].reg_off[i], - i, base + ioport_dsc[data_port].reg_off[i]); -#endif - *p++ = base + ioport_dsc[data_port].reg_off[i]; - } - - if (irq) { -#ifdef CONFIG_IDE_8xx_PCCARD - unsigned int reg; - - *irq = ioport_dsc[data_port].irq; - if (_slot_) - pgcrx = &((immap_t *) IMAP_ADDR)->im_pcmcia.pcmc_pgcrb; - else - pgcrx = &((immap_t *) IMAP_ADDR)->im_pcmcia.pcmc_pgcra; - - reg = *pgcrx; - reg |= mk_int_int_mask (pcmcia_schlvl) << 24; - reg |= mk_int_int_mask (pcmcia_schlvl) << 16; - *pgcrx = reg; -#else /* direct connected IDE drive, i.e. external IRQ, not the PCMCIA irq */ - *irq = ioport_dsc[data_port].irq; -#endif /* CONFIG_IDE_8xx_PCCARD */ - } - - /* register routine to tune PIO mode */ - ide_hwifs[data_port].tuneproc = m8xx_ide_tuneproc; - - hw->ack_intr = (ide_ack_intr_t *) ide_interrupt_ack; - /* Enable Harddisk Interrupt, - * and make it edge sensitive - */ - /* (11-18) Set edge detect for irq, no wakeup from low power mode */ - ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel |= - (0x80000000 >> ioport_dsc[data_port].irq); - -#ifdef CONFIG_IDE_8xx_PCCARD - /* Make sure we dont get garbage irq */ - ((immap_t *) IMAP_ADDR)->im_pcmcia.pcmc_pscr = 0xFFFF; - - /* Enable falling edge irq */ - pcmp->pcmc_per = 0x100000 >> (16 * _slot_); -#endif /* CONFIG_IDE_8xx_PCCARD */ -} /* m8xx_ide_init_hwif_ports() using 8xx internal PCMCIA interface */ -#endif /* CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT */ - -/* - * m8xx_ide_init_hwif_ports for a direct IDE interface _not_ using - * MPC8xx's internal PCMCIA interface - */ -#if defined(CONFIG_IDE_EXT_DIRECT) -void m8xx_ide_init_hwif_ports (hw_regs_t *hw, - ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq) -{ - ide_ioreg_t *p = hw->io_ports; - int i; - - u32 ide_phy_base; - u32 ide_phy_end; - static unsigned long ide_base = 0; - unsigned long base; - - *p = 0; - if (irq) - *irq = 0; - - if (!ide_base) { - - /* TODO: - * - add code to read ORx, BRx - */ - ide_phy_base = CFG_ATA_BASE_ADDR; - ide_phy_end = CFG_ATA_BASE_ADDR + 0x200; - - printk ("IDE phys mem : %08x...%08x (size %08x)\n", - ide_phy_base, ide_phy_end, - ide_phy_end - ide_phy_base); - - ide_base=(unsigned long)ioremap(ide_phy_base, - ide_phy_end-ide_phy_base); - -#ifdef DEBUG - printk ("IDE virt base: %08lx\n", ide_base); -#endif - } - - if (data_port >= MAX_HWIFS) - return; - - base = ide_base + ioport_dsc[data_port].base_off; -#ifdef DEBUG - printk ("base: %08x + %08x = %08x\n", - ide_base, ioport_dsc[data_port].base_off, base); -#endif - - for (i = 0; i < IDE_NR_PORTS; ++i) { -#ifdef DEBUG - printk ("port[%d]: %08x + %08x = %08x\n", - i, - base, - ioport_dsc[data_port].reg_off[i], - i, base + ioport_dsc[data_port].reg_off[i]); -#endif - *p++ = base + ioport_dsc[data_port].reg_off[i]; - } - - if (irq) { - /* direct connected IDE drive, i.e. external IRQ */ - *irq = ioport_dsc[data_port].irq; - } - - /* register routine to tune PIO mode */ - ide_hwifs[data_port].tuneproc = m8xx_ide_tuneproc; - - hw->ack_intr = (ide_ack_intr_t *) ide_interrupt_ack; - /* Enable Harddisk Interrupt, - * and make it edge sensitive - */ - /* (11-18) Set edge detect for irq, no wakeup from low power mode */ - ((immap_t *) IMAP_ADDR)->im_siu_conf.sc_siel |= - (0x80000000 >> ioport_dsc[data_port].irq); -} /* m8xx_ide_init_hwif_ports() for CONFIG_IDE_8xx_DIRECT */ - -#endif /* CONFIG_IDE_8xx_DIRECT */ - - -/* -------------------------------------------------------------------- */ - - -/* PCMCIA Timing */ -#ifndef PCMCIA_SHT -#define PCMCIA_SHT(t) ((t & 0x0F)<<16) /* Strobe Hold Time */ -#define PCMCIA_SST(t) ((t & 0x0F)<<12) /* Strobe Setup Time */ -#define PCMCIA_SL(t) ((t==32) ? 0 : ((t & 0x1F)<<7)) /* Strobe Length */ -#endif - - -/* Calculate PIO timings */ -static void -m8xx_ide_tuneproc(ide_drive_t *drive, byte pio) -{ - ide_pio_data_t d; -#if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) - volatile pcmconf8xx_t *pcmp; - ulong timing, mask, reg; -#endif - - pio = ide_get_best_pio_mode(drive, pio, 4, &d); - -#if 1 - printk("%s[%d] %s: best PIO mode: %d\n", - __FILE__,__LINE__,__FUNCTION__, pio); -#endif - -#if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) - pcmp = (pcmconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_pcmcia)); - - mask = ~(PCMCIA_SHT(0xFF) | PCMCIA_SST(0xFF) | PCMCIA_SL(0xFF)); - - timing = PCMCIA_SHT(hold_time[pio] ) - | PCMCIA_SST(ide_pio_clocks[pio].setup_time ) - | PCMCIA_SL (ide_pio_clocks[pio].active_time) - ; - -#if 1 - printk ("Setting timing bits 0x%08lx in PCMCIA controller\n", timing); -#endif - if ((reg = pcmp->pcmc_por0 & mask) != 0) - pcmp->pcmc_por0 = reg | timing; - - if ((reg = pcmp->pcmc_por1 & mask) != 0) - pcmp->pcmc_por1 = reg | timing; - - if ((reg = pcmp->pcmc_por2 & mask) != 0) - pcmp->pcmc_por2 = reg | timing; - - if ((reg = pcmp->pcmc_por3 & mask) != 0) - pcmp->pcmc_por3 = reg | timing; - - if ((reg = pcmp->pcmc_por4 & mask) != 0) - pcmp->pcmc_por4 = reg | timing; - - if ((reg = pcmp->pcmc_por5 & mask) != 0) - pcmp->pcmc_por5 = reg | timing; - - if ((reg = pcmp->pcmc_por6 & mask) != 0) - pcmp->pcmc_por6 = reg | timing; - - if ((reg = pcmp->pcmc_por7 & mask) != 0) - pcmp->pcmc_por7 = reg | timing; - -#elif defined(CONFIG_IDE_EXT_DIRECT) - - printk("%s[%d] %s: not implemented yet!\n", - __FILE__,__LINE__,__FUNCTION__); -#endif /* defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_PCMCIA */ -} - -static void -ide_interrupt_ack (void *dev) -{ -#ifdef CONFIG_IDE_8xx_PCCARD - u_int pscr, pipr; - -#if (PCMCIA_SOCKETS_NO == 2) - u_int _slot_; -#endif - - /* get interrupt sources */ - - pscr = ((volatile immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr; - pipr = ((volatile immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pipr; - - /* - * report only if both card detect signals are the same - * not too nice done, - * we depend on that CD2 is the bit to the left of CD1... - */ - - if(_slot_==-1){ - printk("PCMCIA slot has not been defined! Using A as default\n"); - _slot_=0; - } - - if(((pipr & M8XX_PCMCIA_CD2(_slot_)) >> 1) ^ - (pipr & M8XX_PCMCIA_CD1(_slot_)) ) { - printk ("card detect interrupt\n"); - } - /* clear the interrupt sources */ - ((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr = pscr; - -#else /* ! CONFIG_IDE_8xx_PCCARD */ - /* - * Only CONFIG_IDE_8xx_PCCARD is using the interrupt of the - * MPC8xx's PCMCIA controller, so there is nothing to be done here - * for CONFIG_IDE_8xx_DIRECT and CONFIG_IDE_EXT_DIRECT. - * The interrupt is handled somewhere else. -- Steven - */ -#endif /* CONFIG_IDE_8xx_PCCARD */ -} - - - -/* - * CIS Tupel codes - */ -#define CISTPL_NULL 0x00 -#define CISTPL_DEVICE 0x01 -#define CISTPL_LONGLINK_CB 0x02 -#define CISTPL_INDIRECT 0x03 -#define CISTPL_CONFIG_CB 0x04 -#define CISTPL_CFTABLE_ENTRY_CB 0x05 -#define CISTPL_LONGLINK_MFC 0x06 -#define CISTPL_BAR 0x07 -#define CISTPL_PWR_MGMNT 0x08 -#define CISTPL_EXTDEVICE 0x09 -#define CISTPL_CHECKSUM 0x10 -#define CISTPL_LONGLINK_A 0x11 -#define CISTPL_LONGLINK_C 0x12 -#define CISTPL_LINKTARGET 0x13 -#define CISTPL_NO_LINK 0x14 -#define CISTPL_VERS_1 0x15 -#define CISTPL_ALTSTR 0x16 -#define CISTPL_DEVICE_A 0x17 -#define CISTPL_JEDEC_C 0x18 -#define CISTPL_JEDEC_A 0x19 -#define CISTPL_CONFIG 0x1a -#define CISTPL_CFTABLE_ENTRY 0x1b -#define CISTPL_DEVICE_OC 0x1c -#define CISTPL_DEVICE_OA 0x1d -#define CISTPL_DEVICE_GEO 0x1e -#define CISTPL_DEVICE_GEO_A 0x1f -#define CISTPL_MANFID 0x20 -#define CISTPL_FUNCID 0x21 -#define CISTPL_FUNCE 0x22 -#define CISTPL_SWIL 0x23 -#define CISTPL_END 0xff - -/* - * CIS Function ID codes - */ -#define CISTPL_FUNCID_MULTI 0x00 -#define CISTPL_FUNCID_MEMORY 0x01 -#define CISTPL_FUNCID_SERIAL 0x02 -#define CISTPL_FUNCID_PARALLEL 0x03 -#define CISTPL_FUNCID_FIXED 0x04 -#define CISTPL_FUNCID_VIDEO 0x05 -#define CISTPL_FUNCID_NETWORK 0x06 -#define CISTPL_FUNCID_AIMS 0x07 -#define CISTPL_FUNCID_SCSI 0x08 - -/* - * Fixed Disk FUNCE codes - */ -#define CISTPL_IDE_INTERFACE 0x01 - -#define CISTPL_FUNCE_IDE_IFACE 0x01 -#define CISTPL_FUNCE_IDE_MASTER 0x02 -#define CISTPL_FUNCE_IDE_SLAVE 0x03 - -/* First feature byte */ -#define CISTPL_IDE_SILICON 0x04 -#define CISTPL_IDE_UNIQUE 0x08 -#define CISTPL_IDE_DUAL 0x10 - -/* Second feature byte */ -#define CISTPL_IDE_HAS_SLEEP 0x01 -#define CISTPL_IDE_HAS_STANDBY 0x02 -#define CISTPL_IDE_HAS_IDLE 0x04 -#define CISTPL_IDE_LOW_POWER 0x08 -#define CISTPL_IDE_REG_INHIBIT 0x10 -#define CISTPL_IDE_HAS_INDEX 0x20 -#define CISTPL_IDE_IOIS16 0x40 - - -/* -------------------------------------------------------------------- */ - - -#define MAX_TUPEL_SZ 512 -#define MAX_FEATURES 4 - -static int check_ide_device (unsigned long base) -{ - volatile unsigned char *ident = NULL; - volatile unsigned char *feature_p[MAX_FEATURES]; - volatile unsigned char *p, *start; - int n_features = 0; - unsigned char func_id = ~0; - unsigned char code, len; - unsigned short config_base = 0; - int found = 0; - int i; - -#ifdef DEBUG - printk ("PCMCIA MEM: %08lX\n", base); -#endif - start = p = (volatile unsigned char *) base; - - while ((p - start) < MAX_TUPEL_SZ) { - - code = *p; p += 2; - - if (code == 0xFF) { /* End of chain */ - break; - } - - len = *p; p += 2; -#ifdef DEBUG_PCMCIA - { volatile unsigned char *q = p; - printk ("\nTuple code %02x length %d\n\tData:", - code, len); - - for (i = 0; i < len; ++i) { - printk (" %02x", *q); - q+= 2; - } - } -#endif /* DEBUG_PCMCIA */ - switch (code) { - case CISTPL_VERS_1: - ident = p + 4; - break; - case CISTPL_FUNCID: - func_id = *p; - break; - case CISTPL_FUNCE: - if (n_features < MAX_FEATURES) - feature_p[n_features++] = p; - break; - case CISTPL_CONFIG: - config_base = (*(p+6) << 8) + (*(p+4)); - default: - break; - } - p += 2 * len; - } - - found = identify (ident); - - if (func_id != ((unsigned char)~0)) { - print_funcid (func_id); - - if (func_id == CISTPL_FUNCID_FIXED) - found = 1; - else - return (1); /* no disk drive */ - } - - for (i=0; i id_str) { - if (*t == ' ') - *t = '\0'; - else - break; - } - printk ("Card ID: %s\n", id_str); - - for (card=known_cards; *card; ++card) { - if (strcmp(*card, id_str) == 0) { /* found! */ - return (1); - } - } - - return (0); /* don't know */ -} - -void m8xx_ide_init(void) -{ - ppc_ide_md.default_irq = m8xx_ide_default_irq; - ppc_ide_md.default_io_base = m8xx_ide_default_io_base; - ppc_ide_md.ide_init_hwif = m8xx_ide_init_hwif_ports; -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide_modes.h linux.20pre5-ac2/drivers/ide/ide_modes.h --- linux.20pre5/drivers/ide/ide_modes.h 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide_modes.h 2002-09-02 14:57:05.000000000 +0100 @@ -31,17 +31,17 @@ } ide_pio_timings_t; typedef struct ide_pio_data_s { - byte pio_mode; - byte use_iordy; - byte overridden; - byte blacklisted; + u8 pio_mode; + u8 use_iordy; + u8 overridden; + u8 blacklisted; unsigned int cycle_time; } ide_pio_data_t; #ifndef _IDE_C int ide_scan_pio_blacklist (char *model); -byte ide_get_best_pio_mode (ide_drive_t *drive, byte mode_wanted, byte max_mode, ide_pio_data_t *d); +u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d); extern const ide_pio_timings_t ide_pio_timings[6]; #else /* _IDE_C */ @@ -159,7 +159,7 @@ /* * Drive PIO mode auto selection */ -byte ide_get_best_pio_mode (ide_drive_t *drive, byte mode_wanted, byte max_mode, ide_pio_data_t *d) +u8 ide_get_best_pio_mode (ide_drive_t *drive, u8 mode_wanted, u8 max_mode, ide_pio_data_t *d) { int pio_mode; int cycle_time = 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-noise.h linux.20pre5-ac2/drivers/ide/ide-noise.h --- linux.20pre5/drivers/ide/ide-noise.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-noise.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,37 @@ + +#ifndef _IDE_NOISE_H +#define _IDE_NOISE_H + +#include + +/* + * A Verbose noise maker for debugging on the attempted transfer rates. + */ +extern inline char *ide_xfer_verbose (u8 xfer_rate) +{ + switch(xfer_rate) { + case XFER_UDMA_7: return("UDMA 7"); + case XFER_UDMA_6: return("UDMA 6"); + case XFER_UDMA_5: return("UDMA 5"); + case XFER_UDMA_4: return("UDMA 4"); + case XFER_UDMA_3: return("UDMA 3"); + case XFER_UDMA_2: return("UDMA 2"); + case XFER_UDMA_1: return("UDMA 1"); + case XFER_UDMA_0: return("UDMA 0"); + case XFER_MW_DMA_2: return("MW DMA 2"); + case XFER_MW_DMA_1: return("MW DMA 1"); + case XFER_MW_DMA_0: return("MW DMA 0"); + case XFER_SW_DMA_2: return("SW DMA 2"); + case XFER_SW_DMA_1: return("SW DMA 1"); + case XFER_SW_DMA_0: return("SW DMA 0"); + case XFER_PIO_4: return("PIO 4"); + case XFER_PIO_3: return("PIO 3"); + case XFER_PIO_2: return("PIO 2"); + case XFER_PIO_1: return("PIO 1"); + case XFER_PIO_0: return("PIO 0"); + case XFER_PIO_SLOW: return("PIO SLOW"); + default: return("XFER ERROR"); + } +} + +#endif /* _IDE_NOISE_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-pci.c linux.20pre5-ac2/drivers/ide/ide-pci.c --- linux.20pre5/drivers/ide/ide-pci.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-pci.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,1003 +0,0 @@ -/* - * linux/drivers/ide/ide-pci.c Version 1.05 June 9, 2000 - * - * Copyright (c) 1998-2000 Andre Hedrick - * - * Copyright (c) 1995-1998 Mark Lord - * May be copied or modified under the terms of the GNU General Public License - */ - -/* - * This module provides support for automatic detection and - * configuration of all PCI IDE interfaces present in a system. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#define DEVID_PIIXa ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_0}) -#define DEVID_PIIXb ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371FB_1}) -#define DEVID_MPIIX ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371MX}) -#define DEVID_PIIX3 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371SB_1}) -#define DEVID_PIIX4 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB}) -#define DEVID_ICH0 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_1}) -#define DEVID_PIIX4E2 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82443MX_1}) -#define DEVID_ICH ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_1}) -#define DEVID_PIIX4U2 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82372FB_1}) -#define DEVID_PIIX4NX ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX}) -#define DEVID_ICH2 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_9}) -#define DEVID_ICH2M ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_8}) -#define DEVID_ICH3M ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_10}) -#define DEVID_ICH3 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_11}) -#define DEVID_ICH4 ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_11}) -#define DEVID_CICH ((ide_pci_devid_t){PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_11}) -#define DEVID_VIA_IDE ((ide_pci_devid_t){PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C561}) -#define DEVID_MR_IDE ((ide_pci_devid_t){PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C576_1}) -#define DEVID_VP_IDE ((ide_pci_devid_t){PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1}) -#define DEVID_PDC20246 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20246}) -#define DEVID_PDC20262 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20262}) -#define DEVID_PDC20265 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20265}) -#define DEVID_PDC20267 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20267}) -#define DEVID_PDC20268 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20268}) -#define DEVID_PDC20270 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20270}) -#define DEVID_PDC20269 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20269}) -#define DEVID_PDC20275 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20275}) -#define DEVID_PDC20276 ((ide_pci_devid_t){PCI_VENDOR_ID_PROMISE, PCI_DEVICE_ID_PROMISE_20276}) -#define DEVID_RZ1000 ((ide_pci_devid_t){PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000}) -#define DEVID_RZ1001 ((ide_pci_devid_t){PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001}) -#define DEVID_SAMURAI ((ide_pci_devid_t){PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_SAMURAI_IDE}) -#define DEVID_CMD640 ((ide_pci_devid_t){PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_640}) -#define DEVID_CMD643 ((ide_pci_devid_t){PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_643}) -#define DEVID_CMD646 ((ide_pci_devid_t){PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_646}) -#define DEVID_CMD648 ((ide_pci_devid_t){PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_648}) -#define DEVID_CMD649 ((ide_pci_devid_t){PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_649}) -#define DEVID_CMD680 ((ide_pci_devid_t){PCI_VENDOR_ID_CMD, PCI_DEVICE_ID_CMD_680}) -#define DEVID_SIS5513 ((ide_pci_devid_t){PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5513}) -#define DEVID_OPTI621 ((ide_pci_devid_t){PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C621}) -#define DEVID_OPTI621V ((ide_pci_devid_t){PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C558}) -#define DEVID_OPTI621X ((ide_pci_devid_t){PCI_VENDOR_ID_OPTI, PCI_DEVICE_ID_OPTI_82C825}) -#define DEVID_TRM290 ((ide_pci_devid_t){PCI_VENDOR_ID_TEKRAM, PCI_DEVICE_ID_TEKRAM_DC290}) -#define DEVID_NS87410 ((ide_pci_devid_t){PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87410}) -#define DEVID_NS87415 ((ide_pci_devid_t){PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415}) -#define DEVID_HT6565 ((ide_pci_devid_t){PCI_VENDOR_ID_HOLTEK, PCI_DEVICE_ID_HOLTEK_6565}) -#define DEVID_AEC6210 ((ide_pci_devid_t){PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP850UF}) -#define DEVID_AEC6260 ((ide_pci_devid_t){PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860}) -#define DEVID_AEC6260R ((ide_pci_devid_t){PCI_VENDOR_ID_ARTOP, PCI_DEVICE_ID_ARTOP_ATP860R}) -#define DEVID_W82C105 ((ide_pci_devid_t){PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_82C105}) -#define DEVID_UM8673F ((ide_pci_devid_t){PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8673F}) -#define DEVID_UM8886A ((ide_pci_devid_t){PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886A}) -#define DEVID_UM8886BF ((ide_pci_devid_t){PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF}) -#define DEVID_HPT34X ((ide_pci_devid_t){PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT343}) -#define DEVID_HPT366 ((ide_pci_devid_t){PCI_VENDOR_ID_TTI, PCI_DEVICE_ID_TTI_HPT366}) -#define DEVID_ALI15X3 ((ide_pci_devid_t){PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M5229}) -#define DEVID_CY82C693 ((ide_pci_devid_t){PCI_VENDOR_ID_CONTAQ, PCI_DEVICE_ID_CONTAQ_82C693}) -#define DEVID_HINT ((ide_pci_devid_t){0x3388, 0x8013}) -#define DEVID_CS5530 ((ide_pci_devid_t){PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE}) -#define DEVID_AMD7401 ((ide_pci_devid_t){PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_COBRA_7401}) -#define DEVID_AMD7409 ((ide_pci_devid_t){PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7409}) -#define DEVID_AMD7411 ((ide_pci_devid_t){PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7411}) -#define DEVID_AMD7441 ((ide_pci_devid_t){PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_VIPER_7441}) -#define DEVID_PDCADMA ((ide_pci_devid_t){PCI_VENDOR_ID_PDC, PCI_DEVICE_ID_PDC_1841}) -#define DEVID_SLC90E66 ((ide_pci_devid_t){PCI_VENDOR_ID_EFAR, PCI_DEVICE_ID_EFAR_SLC90E66_1}) -#define DEVID_OSB4 ((ide_pci_devid_t){PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4IDE}) -#define DEVID_CSB5 ((ide_pci_devid_t){PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_CSB5IDE}) -#define DEVID_ITE8172G ((ide_pci_devid_t){PCI_VENDOR_ID_ITE, PCI_DEVICE_ID_ITE_IT8172G}) - -#define IDE_IGNORE ((void *)-1) -#define IDE_NO_DRIVER ((void *)-2) - -#ifdef CONFIG_BLK_DEV_AEC62XX -extern unsigned int pci_init_aec62xx(struct pci_dev *, const char *); -extern unsigned int ata66_aec62xx(ide_hwif_t *); -extern void ide_init_aec62xx(ide_hwif_t *); -extern void ide_dmacapable_aec62xx(ide_hwif_t *, unsigned long); -#define PCI_AEC62XX &pci_init_aec62xx -#define ATA66_AEC62XX &ata66_aec62xx -#define INIT_AEC62XX &ide_init_aec62xx -#define DMA_AEC62XX &ide_dmacapable_aec62xx -#else -#define PCI_AEC62XX NULL -#define ATA66_AEC62XX NULL -#define INIT_AEC62XX IDE_NO_DRIVER -#define DMA_AEC62XX NULL -#endif - -#ifdef CONFIG_BLK_DEV_ALI15X3 -extern unsigned int pci_init_ali15x3(struct pci_dev *, const char *); -extern unsigned int ata66_ali15x3(ide_hwif_t *); -extern void ide_init_ali15x3(ide_hwif_t *); -extern void ide_dmacapable_ali15x3(ide_hwif_t *, unsigned long); -#define PCI_ALI15X3 &pci_init_ali15x3 -#define ATA66_ALI15X3 &ata66_ali15x3 -#define INIT_ALI15X3 &ide_init_ali15x3 -#define DMA_ALI15X3 &ide_dmacapable_ali15x3 -#else -#define PCI_ALI15X3 NULL -#define ATA66_ALI15X3 NULL -#define INIT_ALI15X3 IDE_NO_DRIVER -#define DMA_ALI15X3 NULL -#endif - -#ifdef CONFIG_BLK_DEV_AMD74XX -extern unsigned int pci_init_amd74xx(struct pci_dev *, const char *); -extern unsigned int ata66_amd74xx(ide_hwif_t *); -extern void ide_init_amd74xx(ide_hwif_t *); -extern void ide_dmacapable_amd74xx(ide_hwif_t *, unsigned long); -#define PCI_AMD74XX &pci_init_amd74xx -#define ATA66_AMD74XX &ata66_amd74xx -#define INIT_AMD74XX &ide_init_amd74xx -#define DMA_AMD74XX &ide_dmacapable_amd74xx -#else -#define PCI_AMD74XX NULL -#define ATA66_AMD74XX NULL -#define INIT_AMD74XX IDE_NO_DRIVER -#define DMA_AMD74XX NULL -#endif - -#ifdef CONFIG_BLK_DEV_CMD64X -extern unsigned int pci_init_cmd64x(struct pci_dev *, const char *); -extern unsigned int ata66_cmd64x(ide_hwif_t *); -extern void ide_init_cmd64x(ide_hwif_t *); -extern void ide_dmacapable_cmd64x(ide_hwif_t *, unsigned long); -#define PCI_CMD64X &pci_init_cmd64x -#define ATA66_CMD64X &ata66_cmd64x -#define INIT_CMD64X &ide_init_cmd64x -#else -#define PCI_CMD64X NULL -#define ATA66_CMD64X NULL -#ifdef __sparc_v9__ -#define INIT_CMD64X IDE_IGNORE -#else -#define INIT_CMD64X IDE_NO_DRIVER -#endif -#endif - -#ifdef CONFIG_BLK_DEV_CY82C693 -extern unsigned int pci_init_cy82c693(struct pci_dev *, const char *); -extern void ide_init_cy82c693(ide_hwif_t *); -#define PCI_CY82C693 &pci_init_cy82c693 -#define INIT_CY82C693 &ide_init_cy82c693 -#else -#define PCI_CY82C693 NULL -#define INIT_CY82C693 IDE_NO_DRIVER -#endif - -#ifdef CONFIG_BLK_DEV_CS5530 -extern unsigned int pci_init_cs5530(struct pci_dev *, const char *); -extern void ide_init_cs5530(ide_hwif_t *); -#define PCI_CS5530 &pci_init_cs5530 -#define INIT_CS5530 &ide_init_cs5530 -#else -#define PCI_CS5530 NULL -#define INIT_CS5530 IDE_NO_DRIVER -#endif - -#ifdef CONFIG_BLK_DEV_HPT34X -extern unsigned int pci_init_hpt34x(struct pci_dev *, const char *); -extern void ide_init_hpt34x(ide_hwif_t *); -#define PCI_HPT34X &pci_init_hpt34x -#define INIT_HPT34X &ide_init_hpt34x -#else -#define PCI_HPT34X NULL -#define INIT_HPT34X IDE_IGNORE -#endif - -#ifdef CONFIG_BLK_DEV_HPT366 -extern byte hpt363_shared_irq; -extern byte hpt363_shared_pin; -extern unsigned int pci_init_hpt366(struct pci_dev *, const char *); -extern unsigned int ata66_hpt366(ide_hwif_t *); -extern void ide_init_hpt366(ide_hwif_t *); -extern void ide_dmacapable_hpt366(ide_hwif_t *, unsigned long); -#define PCI_HPT366 &pci_init_hpt366 -#define ATA66_HPT366 &ata66_hpt366 -#define INIT_HPT366 &ide_init_hpt366 -#define DMA_HPT366 &ide_dmacapable_hpt366 -#else -static byte hpt363_shared_irq; -static byte hpt363_shared_pin; -#define PCI_HPT366 NULL -#define ATA66_HPT366 NULL -#define INIT_HPT366 IDE_NO_DRIVER -#define DMA_HPT366 NULL -#endif - -#ifdef CONFIG_BLK_DEV_NS87415 -extern void ide_init_ns87415(ide_hwif_t *); -#define INIT_NS87415 &ide_init_ns87415 -#else -#define INIT_NS87415 IDE_IGNORE -#endif - -#ifdef CONFIG_BLK_DEV_OPTI621 -extern void ide_init_opti621(ide_hwif_t *); -#define INIT_OPTI621 &ide_init_opti621 -#else -#define INIT_OPTI621 IDE_NO_DRIVER -#endif - -#ifdef CONFIG_BLK_DEV_PDC_ADMA -extern unsigned int pci_init_pdcadma(struct pci_dev *, const char *); -extern unsigned int ata66_pdcadma(ide_hwif_t *); -extern void ide_init_pdcadma(ide_hwif_t *); -extern void ide_dmacapable_pdcadma(ide_hwif_t *, unsigned long); -#define PCI_PDCADMA &pci_init_pdcadma -#define ATA66_PDCADMA &ata66_pdcadma -#define INIT_PDCADMA &ide_init_pdcadma -#define DMA_PDCADMA &ide_dmacapable_pdcadma -#else -#define PCI_PDCADMA IDE_IGNORE -#define ATA66_PDCADMA IDE_IGNORE -#define INIT_PDCADMA IDE_IGNORE -#define DMA_PDCADMA IDE_IGNORE -#endif - -#ifdef CONFIG_BLK_DEV_PDC202XX -extern unsigned int pci_init_pdc202xx(struct pci_dev *, const char *); -extern unsigned int ata66_pdc202xx(ide_hwif_t *); -extern void ide_init_pdc202xx(ide_hwif_t *); -#define PCI_PDC202XX &pci_init_pdc202xx -#define ATA66_PDC202XX &ata66_pdc202xx -#define INIT_PDC202XX &ide_init_pdc202xx -#else -#define PCI_PDC202XX NULL -#define ATA66_PDC202XX NULL -#define INIT_PDC202XX NULL -#endif - -#ifdef CONFIG_BLK_DEV_PIIX -extern unsigned int pci_init_piix(struct pci_dev *, const char *); -extern unsigned int ata66_piix(ide_hwif_t *); -extern void ide_init_piix(ide_hwif_t *); -#define PCI_PIIX &pci_init_piix -#define ATA66_PIIX &ata66_piix -#define INIT_PIIX &ide_init_piix -#else -#define PCI_PIIX NULL -#define ATA66_PIIX NULL -#define INIT_PIIX IDE_NO_DRIVER -#endif - -#ifdef CONFIG_BLK_DEV_IT8172 -extern unsigned int pci_init_it8172(struct pci_dev *, const char *); -extern unsigned int ata66_it8172(ide_hwif_t *); -extern void ide_init_it8172(ide_hwif_t *); -#define PCI_IT8172 &pci_init_it8172 -#define INIT_IT8172 &ide_init_it8172 -#else -#define PCI_IT8172 NULL -#define ATA66_IT8172 NULL -#define INIT_IT8172 NULL -#endif - -#ifdef CONFIG_BLK_DEV_RZ1000 -extern void ide_init_rz1000(ide_hwif_t *); -#define INIT_RZ1000 &ide_init_rz1000 -#else -#define INIT_RZ1000 IDE_IGNORE -#endif - -#define INIT_SAMURAI NULL - -#ifdef CONFIG_BLK_DEV_SVWKS -extern unsigned int pci_init_svwks(struct pci_dev *, const char *); -extern unsigned int ata66_svwks(ide_hwif_t *); -extern void ide_init_svwks(ide_hwif_t *); -#define PCI_SVWKS &pci_init_svwks -#define ATA66_SVWKS &ata66_svwks -#define INIT_SVWKS &ide_init_svwks -#else -#define PCI_SVWKS NULL -#define ATA66_SVWKS NULL -#define INIT_SVWKS IDE_NO_DRIVER -#endif - -#ifdef CONFIG_BLK_DEV_SIS5513 -extern unsigned int pci_init_sis5513(struct pci_dev *, const char *); -extern unsigned int ata66_sis5513(ide_hwif_t *); -extern void ide_init_sis5513(ide_hwif_t *); -#define PCI_SIS5513 &pci_init_sis5513 -#define ATA66_SIS5513 &ata66_sis5513 -#define INIT_SIS5513 &ide_init_sis5513 -#else -#define PCI_SIS5513 NULL -#define ATA66_SIS5513 NULL -#define INIT_SIS5513 IDE_NO_DRIVER -#endif - -#ifdef CONFIG_BLK_DEV_SLC90E66 -extern unsigned int pci_init_slc90e66(struct pci_dev *, const char *); -extern unsigned int ata66_slc90e66(ide_hwif_t *); -extern void ide_init_slc90e66(ide_hwif_t *); -#define PCI_SLC90E66 &pci_init_slc90e66 -#define ATA66_SLC90E66 &ata66_slc90e66 -#define INIT_SLC90E66 &ide_init_slc90e66 -#else -#define PCI_SLC90E66 NULL -#define ATA66_SLC90E66 NULL -#define INIT_SLC90E66 IDE_NO_DRIVER -#endif - -#ifdef CONFIG_BLK_DEV_SL82C105 -extern unsigned int pci_init_sl82c105(struct pci_dev *, const char *); -extern void dma_init_sl82c105(ide_hwif_t *, unsigned long); -extern void ide_init_sl82c105(ide_hwif_t *); -#define PCI_W82C105 &pci_init_sl82c105 -#define DMA_W82C105 &dma_init_sl82c105 -#define INIT_W82C105 &ide_init_sl82c105 -#else -#define PCI_W82C105 NULL -#define DMA_W82C105 NULL -#define INIT_W82C105 IDE_IGNORE -#endif - -#ifdef CONFIG_BLK_DEV_TRM290 -extern void ide_init_trm290(ide_hwif_t *); -#define INIT_TRM290 &ide_init_trm290 -#else -#define INIT_TRM290 IDE_IGNORE -#endif - -#ifdef CONFIG_BLK_DEV_VIA82CXXX -extern unsigned int pci_init_via82cxxx(struct pci_dev *, const char *); -extern unsigned int ata66_via82cxxx(ide_hwif_t *); -extern void ide_init_via82cxxx(ide_hwif_t *); -extern void ide_dmacapable_via82cxxx(ide_hwif_t *, unsigned long); -#define PCI_VIA82CXXX &pci_init_via82cxxx -#define ATA66_VIA82CXXX &ata66_via82cxxx -#define INIT_VIA82CXXX &ide_init_via82cxxx -#define DMA_VIA82CXXX &ide_dmacapable_via82cxxx -#else -#define PCI_VIA82CXXX NULL -#define ATA66_VIA82CXXX NULL -#define INIT_VIA82CXXX IDE_NO_DRIVER -#define DMA_VIA82CXXX NULL -#endif - -typedef struct ide_pci_enablebit_s { - byte reg; /* byte pci reg holding the enable-bit */ - byte mask; /* mask to isolate the enable-bit */ - byte val; /* value of masked reg when "enabled" */ -} ide_pci_enablebit_t; - -typedef struct ide_pci_device_s { - ide_pci_devid_t devid; - char *name; - unsigned int (*init_chipset)(struct pci_dev *dev, const char *name); - unsigned int (*ata66_check)(ide_hwif_t *hwif); - void (*init_hwif)(ide_hwif_t *hwif); - void (*dma_init)(ide_hwif_t *hwif, unsigned long dmabase); - ide_pci_enablebit_t enablebits[2]; - byte bootable; - unsigned int extra; -} ide_pci_device_t; - -static ide_pci_device_t ide_pci_chipsets[] __initdata = { - {DEVID_PIIXa, "PIIX", NULL, NULL, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_PIIXb, "PIIX", NULL, NULL, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_MPIIX, "MPIIX", NULL, NULL, INIT_PIIX, NULL, {{0x6D,0x80,0x80}, {0x6F,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_PIIX3, "PIIX3", PCI_PIIX, NULL, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_PIIX4, "PIIX4", PCI_PIIX, NULL, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_ICH0, "ICH0", PCI_PIIX, NULL, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_PIIX4E2, "PIIX4", PCI_PIIX, NULL, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_ICH, "ICH", PCI_PIIX, ATA66_PIIX, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_PIIX4U2, "PIIX4", PCI_PIIX, ATA66_PIIX, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_PIIX4NX, "PIIX4", PCI_PIIX, NULL, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_ICH2, "ICH2", PCI_PIIX, ATA66_PIIX, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_ICH2M, "ICH2M", PCI_PIIX, ATA66_PIIX, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_ICH3M, "ICH3M", PCI_PIIX, ATA66_PIIX, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_ICH3, "ICH3", PCI_PIIX, ATA66_PIIX, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_ICH4, "ICH4", PCI_PIIX, ATA66_PIIX, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_CICH, "C-ICH", PCI_PIIX, ATA66_PIIX, INIT_PIIX, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_VIA_IDE, "VIA_IDE", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_MR_IDE, "VP_IDE", PCI_VIA82CXXX, ATA66_VIA82CXXX,INIT_VIA82CXXX, DMA_VIA82CXXX, {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, ON_BOARD, 0 }, - {DEVID_VP_IDE, "VP_IDE", PCI_VIA82CXXX, ATA66_VIA82CXXX,INIT_VIA82CXXX, DMA_VIA82CXXX, {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, ON_BOARD, 0 }, -#ifndef CONFIG_PDC202XX_FORCE - {DEVID_PDC20246,"PDC20246", PCI_PDC202XX, NULL, INIT_PDC202XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 16 }, - {DEVID_PDC20262,"PDC20262", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 48 }, - {DEVID_PDC20265,"PDC20265", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 48 }, - {DEVID_PDC20267,"PDC20267", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 48 }, -#else /* !CONFIG_PDC202XX_FORCE */ - {DEVID_PDC20246,"PDC20246", PCI_PDC202XX, NULL, INIT_PDC202XX, NULL, {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, OFF_BOARD, 16 }, - {DEVID_PDC20262,"PDC20262", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX, NULL, {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, OFF_BOARD, 48 }, - {DEVID_PDC20265,"PDC20265", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX, NULL, {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, OFF_BOARD, 48 }, - {DEVID_PDC20267,"PDC20267", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX, NULL, {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, OFF_BOARD, 48 }, -#endif - {DEVID_PDC20268,"PDC20268", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 0 }, - /* Promise used a different PCI ident for the raid card apparently to try and - prevent Linux detecting it and using our own raid code. We want to detect - it for the ataraid drivers, so we have to list both here.. */ - {DEVID_PDC20270,"PDC20270", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 0 }, - {DEVID_PDC20269,"PDC20269", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 0 }, - {DEVID_PDC20275,"PDC20275", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 0 }, - {DEVID_PDC20276,"PDC20276", PCI_PDC202XX, ATA66_PDC202XX, INIT_PDC202XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 0 }, - {DEVID_RZ1000, "RZ1000", NULL, NULL, INIT_RZ1000, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_RZ1001, "RZ1001", NULL, NULL, INIT_RZ1000, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_SAMURAI, "SAMURAI", NULL, NULL, INIT_SAMURAI, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_CMD640, "CMD640", NULL, NULL, IDE_IGNORE, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_NS87410, "NS87410", NULL, NULL, NULL, NULL, {{0x43,0x08,0x08}, {0x47,0x08,0x08}}, ON_BOARD, 0 }, - {DEVID_SIS5513, "SIS5513", PCI_SIS5513, ATA66_SIS5513, INIT_SIS5513, NULL, {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, ON_BOARD, 0 }, - {DEVID_CMD643, "CMD643", PCI_CMD64X, NULL, INIT_CMD64X, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_CMD646, "CMD646", PCI_CMD64X, NULL, INIT_CMD64X, NULL, {{0x00,0x00,0x00}, {0x51,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_CMD648, "CMD648", PCI_CMD64X, ATA66_CMD64X, INIT_CMD64X, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_CMD649, "CMD649", PCI_CMD64X, ATA66_CMD64X, INIT_CMD64X, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, -#ifndef CONFIG_BLK_DEV_CMD680 - {DEVID_CMD680, "CMD680", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, -#else /* CONFIG_BLK_DEV_CMD680 */ - {DEVID_CMD680, "CMD680", PCI_CMD64X, ATA66_CMD64X, INIT_CMD64X, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, -#endif /* !CONFIG_BLK_DEV_CMD680 */ - {DEVID_HT6565, "HT6565", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_OPTI621, "OPTI621", NULL, NULL, INIT_OPTI621, NULL, {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, ON_BOARD, 0 }, - {DEVID_OPTI621X,"OPTI621X", NULL, NULL, INIT_OPTI621, NULL, {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, ON_BOARD, 0 }, - {DEVID_TRM290, "TRM290", NULL, NULL, INIT_TRM290, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_NS87415, "NS87415", NULL, NULL, INIT_NS87415, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_AEC6210, "AEC6210", PCI_AEC62XX, NULL, INIT_AEC62XX, DMA_AEC62XX, {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, OFF_BOARD, 0 }, - {DEVID_AEC6260, "AEC6260", PCI_AEC62XX, ATA66_AEC62XX, INIT_AEC62XX, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, NEVER_BOARD, 0 }, - {DEVID_AEC6260R,"AEC6260R", PCI_AEC62XX, ATA66_AEC62XX, INIT_AEC62XX, NULL, {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, OFF_BOARD, 0 }, - {DEVID_W82C105, "W82C105", PCI_W82C105, NULL, INIT_W82C105, DMA_W82C105, {{0x40,0x01,0x01}, {0x40,0x10,0x10}}, ON_BOARD, 0 }, - {DEVID_UM8673F, "UM8673F", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_UM8886A, "UM8886A", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_UM8886BF,"UM8886BF", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_HPT34X, "HPT34X", PCI_HPT34X, NULL, INIT_HPT34X, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, NEVER_BOARD, 16 }, - {DEVID_HPT366, "HPT366", PCI_HPT366, ATA66_HPT366, INIT_HPT366, DMA_HPT366, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 240 }, - {DEVID_ALI15X3, "ALI15X3", PCI_ALI15X3, ATA66_ALI15X3, INIT_ALI15X3, DMA_ALI15X3, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_CY82C693,"CY82C693", PCI_CY82C693, NULL, INIT_CY82C693, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_HINT, "HINT_IDE", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_CS5530, "CS5530", PCI_CS5530, NULL, INIT_CS5530, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_AMD7401, "AMD7401", NULL, NULL, NULL, DMA_AMD74XX, {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, ON_BOARD, 0 }, - {DEVID_AMD7409, "AMD7409", PCI_AMD74XX, ATA66_AMD74XX, INIT_AMD74XX, DMA_AMD74XX, {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, ON_BOARD, 0 }, - {DEVID_AMD7411, "AMD7411", PCI_AMD74XX, ATA66_AMD74XX, INIT_AMD74XX, DMA_AMD74XX, {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, ON_BOARD, 0 }, - {DEVID_AMD7441, "AMD7441", PCI_AMD74XX, ATA66_AMD74XX, INIT_AMD74XX, DMA_AMD74XX, {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, ON_BOARD, 0 }, - {DEVID_PDCADMA, "PDCADMA", PCI_PDCADMA, ATA66_PDCADMA, INIT_PDCADMA, DMA_PDCADMA, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, OFF_BOARD, 0 }, - {DEVID_SLC90E66,"SLC90E66", PCI_SLC90E66, ATA66_SLC90E66, INIT_SLC90E66, NULL, {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, ON_BOARD, 0 }, - {DEVID_OSB4, "ServerWorks OSB4", PCI_SVWKS, ATA66_SVWKS, INIT_SVWKS, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_CSB5, "ServerWorks CSB5", PCI_SVWKS, ATA66_SVWKS, INIT_SVWKS, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }, - {DEVID_ITE8172G,"IT8172G", PCI_IT8172, NULL, INIT_IT8172, NULL, {{0x00,0x00,0x00}, {0x40,0x00,0x01}}, ON_BOARD, 0 }, - {IDE_PCI_DEVID_NULL, "PCI_IDE", NULL, NULL, NULL, NULL, {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, ON_BOARD, 0 }}; - -/* - * This allows offboard ide-pci cards the enable a BIOS, verify interrupt - * settings of split-mirror pci-config space, place chipset into init-mode, - * and/or preserve an interrupt if the card is not native ide support. - */ -static unsigned int __init ide_special_settings (struct pci_dev *dev, const char *name) -{ - switch(dev->device) { - case PCI_DEVICE_ID_TTI_HPT366: - case PCI_DEVICE_ID_PROMISE_20246: - case PCI_DEVICE_ID_PROMISE_20262: - case PCI_DEVICE_ID_PROMISE_20265: - case PCI_DEVICE_ID_PROMISE_20267: - case PCI_DEVICE_ID_PROMISE_20268: - case PCI_DEVICE_ID_PROMISE_20270: - case PCI_DEVICE_ID_PROMISE_20269: - case PCI_DEVICE_ID_PROMISE_20275: - case PCI_DEVICE_ID_PROMISE_20276: - case PCI_DEVICE_ID_ARTOP_ATP850UF: - case PCI_DEVICE_ID_ARTOP_ATP860: - case PCI_DEVICE_ID_ARTOP_ATP860R: - return dev->irq; - default: - break; - } - return 0; -} - -/* - * Match a PCI IDE port against an entry in ide_hwifs[], - * based on io_base port if possible. - */ -static ide_hwif_t __init *ide_match_hwif (unsigned long io_base, byte bootable, const char *name) -{ - int h; - ide_hwif_t *hwif; - - /* - * Look for a hwif with matching io_base specified using - * parameters to ide_setup(). - */ - for (h = 0; h < MAX_HWIFS; ++h) { - hwif = &ide_hwifs[h]; - if (hwif->io_ports[IDE_DATA_OFFSET] == io_base) { - if (hwif->chipset == ide_generic) - return hwif; /* a perfect match */ - } - } - /* - * Look for a hwif with matching io_base default value. - * If chipset is "ide_unknown", then claim that hwif slot. - * Otherwise, some other chipset has already claimed it.. :( - */ - for (h = 0; h < MAX_HWIFS; ++h) { - hwif = &ide_hwifs[h]; - if (hwif->io_ports[IDE_DATA_OFFSET] == io_base) { - if (hwif->chipset == ide_unknown) - return hwif; /* match */ - printk("%s: port 0x%04lx already claimed by %s\n", name, io_base, hwif->name); - return NULL; /* already claimed */ - } - } - /* - * Okay, there is no hwif matching our io_base, - * so we'll just claim an unassigned slot. - * Give preference to claiming other slots before claiming ide0/ide1, - * just in case there's another interface yet-to-be-scanned - * which uses ports 1f0/170 (the ide0/ide1 defaults). - * - * Unless there is a bootable card that does not use the standard - * ports 1f0/170 (the ide0/ide1 defaults). The (bootable) flag. - */ - if (bootable) { - for (h = 0; h < MAX_HWIFS; ++h) { - hwif = &ide_hwifs[h]; - if (hwif->chipset == ide_unknown) - return hwif; /* pick an unused entry */ - } - } else { - for (h = 2; h < MAX_HWIFS; ++h) { - hwif = ide_hwifs + h; - if (hwif->chipset == ide_unknown) - return hwif; /* pick an unused entry */ - } - } - for (h = 0; h < 2; ++h) { - hwif = ide_hwifs + h; - if (hwif->chipset == ide_unknown) - return hwif; /* pick an unused entry */ - } - printk("%s: too many IDE interfaces, no room in table\n", name); - return NULL; -} - -static int __init ide_setup_pci_baseregs (struct pci_dev *dev, const char *name) -{ - byte reg, progif = 0; - - /* - * Place both IDE interfaces into PCI "native" mode: - */ - if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) || (progif & 5) != 5) { - if ((progif & 0xa) != 0xa) { - printk("%s: device not capable of full native PCI mode\n", name); - return 1; - } - printk("%s: placing both ports into native PCI mode\n", name); - (void) pci_write_config_byte(dev, PCI_CLASS_PROG, progif|5); - if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) || (progif & 5) != 5) { - printk("%s: rewrite of PROGIF failed, wanted 0x%04x, got 0x%04x\n", name, progif|5, progif); - return 1; - } - } - /* - * Setup base registers for IDE command/control spaces for each interface: - */ - for (reg = 0; reg < 4; reg++) { - struct resource *res = dev->resource + reg; - if ((res->flags & IORESOURCE_IO) == 0) - continue; - if (!res->start) { - printk("%s: Missing I/O address #%d\n", name, reg); - return 1; - } - } - return 0; -} - -/* - * ide_setup_pci_device() looks at the primary/secondary interfaces - * on a PCI IDE device and, if they are enabled, prepares the IDE driver - * for use with them. This generic code works for most PCI chipsets. - * - * One thing that is not standardized is the location of the - * primary/secondary interface "enable/disable" bits. For chipsets that - * we "know" about, this information is in the ide_pci_device_t struct; - * for all other chipsets, we just assume both interfaces are enabled. - */ -static void __init ide_setup_pci_device (struct pci_dev *dev, ide_pci_device_t *d) -{ - unsigned int port, at_least_one_hwif_enabled = 0, autodma = 0, pciirq = 0; - unsigned short pcicmd = 0, tried_config = 0; - byte tmp = 0; - ide_hwif_t *hwif, *mate = NULL; - unsigned int class_rev; - static int secondpdc = 0; - -#ifdef CONFIG_IDEDMA_AUTO - if (!noautodma) - autodma = 1; -#endif - - if (d->init_hwif == IDE_NO_DRIVER) { - printk(KERN_WARNING "%s: detected chipset, but driver not compiled in!\n", d->name); - d->init_hwif = NULL; - } - - if (pci_enable_device(dev)) { - printk(KERN_WARNING "%s: (ide_setup_pci_device:) Could not enable device.\n", d->name); - return; - } - -check_if_enabled: - if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd)) { - printk("%s: error accessing PCI regs\n", d->name); - return; - } - if (!(pcicmd & PCI_COMMAND_IO)) { /* is device disabled? */ - /* - * PnP BIOS was *supposed* to have set this device up for us, - * but we can do it ourselves, so long as the BIOS has assigned an IRQ - * (or possibly the device is using a "legacy header" for IRQs). - * Maybe the user deliberately *disabled* the device, - * but we'll eventually ignore it again if no drives respond. - */ - if (tried_config++ - || ide_setup_pci_baseregs(dev, d->name) - || pci_write_config_word(dev, PCI_COMMAND, pcicmd | PCI_COMMAND_IO)) { - printk("%s: device disabled (BIOS)\n", d->name); - return; - } - autodma = 0; /* default DMA off if we had to configure it here */ - goto check_if_enabled; - } - if (tried_config) - printk("%s: device enabled (Linux)\n", d->name); - - pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); - class_rev &= 0xff; - - if (IDE_PCI_DEVID_EQ(d->devid, DEVID_HPT34X)) { - /* see comments in hpt34x.c on why..... */ - char *chipset_names[] = {"HPT343", "HPT345"}; - strcpy(d->name, chipset_names[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0]); - d->bootable = (pcicmd & PCI_COMMAND_MEMORY) ? OFF_BOARD : NEVER_BOARD; - } - - printk("%s: chipset revision %d\n", d->name, class_rev); - - /* - * Can we trust the reported IRQ? - */ - pciirq = dev->irq; - -#ifdef CONFIG_PDC202XX_FORCE - if (dev->class >> 8 == PCI_CLASS_STORAGE_RAID) { - /* - * By rights we want to ignore Promise FastTrak and SuperTrak - * series here, those use own driver. - */ - if (dev->vendor == PCI_VENDOR_ID_PROMISE) { - printk(KERN_INFO "ide: Skipping Promise RAID controller.\n"); - return; - } - } -#endif /* CONFIG_PDC202XX_FORCE */ - if ((dev->class & ~(0xfa)) != ((PCI_CLASS_STORAGE_IDE << 8) | 5)) { - printk("%s: not 100%% native mode: will probe irqs later\n", d->name); - /* - * This allows offboard ide-pci cards the enable a BIOS, - * verify interrupt settings of split-mirror pci-config - * space, place chipset into init-mode, and/or preserve - * an interrupt if the card is not native ide support. - */ - pciirq = (d->init_chipset) ? d->init_chipset(dev, d->name) : ide_special_settings(dev, d->name); - } else if (tried_config) { - printk("%s: will probe irqs later\n", d->name); - pciirq = 0; - } else if (!pciirq) { - printk("%s: bad irq (%d): will probe later\n", d->name, pciirq); - pciirq = 0; - } else { - if (d->init_chipset) - (void) d->init_chipset(dev, d->name); -#ifdef __sparc__ - printk("%s: 100%% native mode on irq %s\n", - d->name, __irq_itoa(pciirq)); -#else - printk("%s: 100%% native mode on irq %d\n", d->name, pciirq); -#endif - } - - /* - * Set up the IDE ports - */ - for (port = 0; port <= 1; ++port) { - unsigned long base = 0, ctl = 0; - ide_pci_enablebit_t *e = &(d->enablebits[port]); - - /* - * If this is a Promise FakeRaid controller, the 2nd controller will be marked as - * disabled while it is actually there and enabled by the bios for raid purposes. - * Skip the normal "is it enabled" test for those. - */ - if ((IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20265)) && (secondpdc++==1) && (port==1) ) - goto controller_ok; - if ((IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20262)) && (secondpdc++==1) && (port==1) ) - goto controller_ok; - - if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || (tmp & e->mask) != e->val)) - continue; /* port not enabled */ -controller_ok: - if (IDE_PCI_DEVID_EQ(d->devid, DEVID_HPT366) && (port) && (class_rev < 0x03)) - return; - if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE || (dev->class & (port ? 4 : 1)) != 0) { - ctl = dev->resource[(2*port)+1].start; - base = dev->resource[2*port].start; - if (!(ctl & PCI_BASE_ADDRESS_IO_MASK) || - !(base & PCI_BASE_ADDRESS_IO_MASK)) { - printk("%s: IO baseregs (BIOS) are reported as MEM, report to .\n", d->name); -#if 0 - /* FIXME! This really should check that it really gets the IO/MEM part right! */ - continue; -#endif - } - } - if ((ctl && !base) || (base && !ctl)) { - printk("%s: inconsistent baseregs (BIOS) for port %d, skipping\n", d->name, port); - continue; - } - if (!ctl) - ctl = port ? 0x374 : 0x3f4; /* use default value */ - if (!base) - base = port ? 0x170 : 0x1f0; /* use default value */ - if ((hwif = ide_match_hwif(base, d->bootable, d->name)) == NULL) - continue; /* no room in ide_hwifs[] */ - if (hwif->io_ports[IDE_DATA_OFFSET] != base) { - ide_init_hwif_ports(&hwif->hw, base, (ctl | 2), NULL); - memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); - hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; - } - hwif->chipset = ide_pci; - hwif->pci_dev = dev; - hwif->pci_devid = d->devid; - hwif->channel = port; - if (!hwif->irq) - hwif->irq = pciirq; - if (mate) { - hwif->mate = mate; - mate->mate = hwif; - if (IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6210)) { - hwif->serialized = 1; - mate->serialized = 1; - } - } - if (IDE_PCI_DEVID_EQ(d->devid, DEVID_UM8886A) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_UM8886BF) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_UM8673F)) { - hwif->irq = hwif->channel ? 15 : 14; - goto bypass_umc_dma; - } - if (IDE_PCI_DEVID_EQ(d->devid, DEVID_MPIIX)) - goto bypass_piix_dma; - if (IDE_PCI_DEVID_EQ(d->devid, DEVID_PDCADMA)) - goto bypass_legacy_dma; - if (hwif->udma_four) { - printk("%s: ATA-66/100 forced bit set (WARNING)!!\n", d->name); - } else { - hwif->udma_four = (d->ata66_check) ? d->ata66_check(hwif) : 0; - } -#ifdef CONFIG_BLK_DEV_IDEDMA - if (IDE_PCI_DEVID_EQ(d->devid, DEVID_SIS5513) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6260) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_PIIX4NX) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_HPT34X) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_VIA_IDE) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_MR_IDE) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_VP_IDE)) - autodma = 0; - if (autodma) - hwif->autodma = 1; - - if (IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20246) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20262) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20265) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20267) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20268) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20270) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20269) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20275) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20276) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6210) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6260) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_AEC6260R) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_HPT34X) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_HPT366) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_CS5530) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_CY82C693) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_CMD646) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_CMD648) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_CMD649) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_CMD680) || - IDE_PCI_DEVID_EQ(d->devid, DEVID_OSB4) || - ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && (dev->class & 0x80))) { - unsigned long dma_base = ide_get_or_set_dma_base(hwif, (!mate && d->extra) ? d->extra : 0, d->name); - if (dma_base && !(pcicmd & PCI_COMMAND_MASTER)) { - /* - * Set up BM-DMA capability (PnP BIOS should have done this) - */ - if (!IDE_PCI_DEVID_EQ(d->devid, DEVID_CS5530)) - hwif->autodma = 0; /* default DMA off if we had to configure it here */ - (void) pci_write_config_word(dev, PCI_COMMAND, pcicmd | PCI_COMMAND_MASTER); - if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd) || !(pcicmd & PCI_COMMAND_MASTER)) { - printk("%s: %s error updating PCICMD\n", hwif->name, d->name); - dma_base = 0; - } - } - if (dma_base) { - if (d->dma_init) { - d->dma_init(hwif, dma_base); - } else { - ide_setup_dma(hwif, dma_base, 8); - } - } else { - printk("%s: %s Bus-Master DMA disabled (BIOS)\n", hwif->name, d->name); - } - } -#endif /* CONFIG_BLK_DEV_IDEDMA */ -bypass_legacy_dma: -bypass_piix_dma: -bypass_umc_dma: - if (d->init_hwif) /* Call chipset-specific routine for each enabled hwif */ - d->init_hwif(hwif); - mate = hwif; - at_least_one_hwif_enabled = 1; - } - if (!at_least_one_hwif_enabled) - printk("%s: neither IDE port enabled (BIOS)\n", d->name); -} - -static void __init pdc20270_device_order_fixup (struct pci_dev *dev, ide_pci_device_t *d) -{ - struct pci_dev *dev2 = NULL, *findev; - ide_pci_device_t *d2; - - if ((dev->bus->self && - dev->bus->self->vendor == PCI_VENDOR_ID_DEC) && - (dev->bus->self->device == PCI_DEVICE_ID_DEC_21150)) { - if (PCI_SLOT(dev->devfn) & 2) { - return; - } - d->extra = 0; - pci_for_each_dev(findev) { - if ((findev->vendor == dev->vendor) && - (findev->device == dev->device) && - (PCI_SLOT(findev->devfn) & 2)) { - byte irq = 0, irq2 = 0; - dev2 = findev; - pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); - pci_read_config_byte(dev2, PCI_INTERRUPT_LINE, &irq2); - if (irq != irq2) { - dev2->irq = dev->irq; - pci_write_config_byte(dev2, PCI_INTERRUPT_LINE, irq); - } - - } - } - } - - printk("%s: IDE controller on PCI bus %02x dev %02x\n", d->name, dev->bus->number, dev->devfn); - ide_setup_pci_device(dev, d); - if (!dev2) - return; - d2 = d; - printk("%s: IDE controller on PCI bus %02x dev %02x\n", d2->name, dev2->bus->number, dev2->devfn); - ide_setup_pci_device(dev2, d2); -} - -static void __init hpt366_device_order_fixup (struct pci_dev *dev, ide_pci_device_t *d) -{ - struct pci_dev *dev2 = NULL, *findev; - ide_pci_device_t *d2; - unsigned char pin1 = 0, pin2 = 0; - unsigned int class_rev; - char *chipset_names[] = {"HPT366", "HPT366", "HPT368", "HPT370", "HPT370A", "HPT372"}; - - if (PCI_FUNC(dev->devfn) & 1) - return; - - pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); - class_rev &= 0xff; - if (class_rev > 5) - class_rev = 5; - - strcpy(d->name, chipset_names[class_rev]); - - switch(class_rev) { - case 4: - case 3: printk("%s: IDE controller on PCI bus %02x dev %02x\n", d->name, dev->bus->number, dev->devfn); - ide_setup_pci_device(dev, d); - return; - default: break; - } - - pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin1); - pci_for_each_dev(findev) { - if ((findev->vendor == dev->vendor) && - (findev->device == dev->device) && - ((findev->devfn - dev->devfn) == 1) && - (PCI_FUNC(findev->devfn) & 1)) { - dev2 = findev; - pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin2); - hpt363_shared_pin = (pin1 != pin2) ? 1 : 0; - hpt363_shared_irq = (dev->irq == dev2->irq) ? 1 : 0; - if (hpt363_shared_pin && hpt363_shared_irq) { - d->bootable = ON_BOARD; - printk("%s: onboard version of chipset, pin1=%d pin2=%d\n", d->name, pin1, pin2); -#if 0 - /* I forgot why I did this once, but it fixed something. */ - pci_write_config_byte(dev2, PCI_INTERRUPT_PIN, dev->irq); - printk("PCI: %s: Fixing interrupt %d pin %d to ZERO \n", d->name, dev2->irq, pin2); - pci_write_config_byte(dev2, PCI_INTERRUPT_LINE, 0); -#endif - } - break; - } - } - printk("%s: IDE controller on PCI bus %02x dev %02x\n", d->name, dev->bus->number, dev->devfn); - ide_setup_pci_device(dev, d); - if (!dev2) - return; - d2 = d; - printk("%s: IDE controller on PCI bus %02x dev %02x\n", d2->name, dev2->bus->number, dev2->devfn); - ide_setup_pci_device(dev2, d2); -} - -/* - * ide_scan_pcibus() gets invoked at boot time from ide.c. - * It finds all PCI IDE controllers and calls ide_setup_pci_device for them. - */ -void __init ide_scan_pcidev (struct pci_dev *dev) -{ - ide_pci_devid_t devid; - ide_pci_device_t *d; - - devid.vid = dev->vendor; - devid.did = dev->device; - for (d = ide_pci_chipsets; d->devid.vid && !IDE_PCI_DEVID_EQ(d->devid, devid); ++d); - if (d->init_hwif == IDE_IGNORE) - printk("%s: ignored by ide_scan_pci_device() (uses own driver)\n", d->name); - else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_OPTI621V) && !(PCI_FUNC(dev->devfn) & 1)) - return; - else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_CY82C693) && (!(PCI_FUNC(dev->devfn) & 1) || !((dev->class >> 8) == PCI_CLASS_STORAGE_IDE))) - return; /* CY82C693 is more than only a IDE controller */ - else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_ITE8172G) && (!(PCI_FUNC(dev->devfn) & 1) || !((dev->class >> 8) == PCI_CLASS_STORAGE_IDE))) - return; /* IT8172G is also more than only an IDE controller */ - else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_UM8886A) && !(PCI_FUNC(dev->devfn) & 1)) - return; /* UM8886A/BF pair */ - else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_HPT366)) - hpt366_device_order_fixup(dev, d); - else if (IDE_PCI_DEVID_EQ(d->devid, DEVID_PDC20270)) - pdc20270_device_order_fixup(dev, d); - else if (!IDE_PCI_DEVID_EQ(d->devid, IDE_PCI_DEVID_NULL) || (dev->class >> 8) == PCI_CLASS_STORAGE_IDE) { - if (IDE_PCI_DEVID_EQ(d->devid, IDE_PCI_DEVID_NULL)) - printk("%s: unknown IDE controller on PCI bus %02x device %02x, VID=%04x, DID=%04x\n", - d->name, dev->bus->number, dev->devfn, devid.vid, devid.did); - else - printk("%s: IDE controller on PCI bus %02x dev %02x\n", d->name, dev->bus->number, dev->devfn); - ide_setup_pci_device(dev, d); - } -} - -void __init ide_scan_pcibus (int scan_direction) -{ - struct pci_dev *dev; - - if (!scan_direction) { - pci_for_each_dev(dev) { - ide_scan_pcidev(dev); - } - } else { - pci_for_each_dev_reverse(dev) { - ide_scan_pcidev(dev); - } - } -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-pmac.c linux.20pre5-ac2/drivers/ide/ide-pmac.c --- linux.20pre5/drivers/ide/ide-pmac.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-pmac.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,1755 +0,0 @@ -/* - * linux/drivers/ide/ide-pmac.c - * - * Support for IDE interfaces on PowerMacs. - * These IDE interfaces are memory-mapped and have a DBDMA channel - * for doing DMA. - * - * Copyright (C) 1998-2001 Paul Mackerras & Ben. Herrenschmidt - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version - * 2 of the License, or (at your option) any later version. - * - * Some code taken from drivers/ide/ide-dma.c: - * - * Copyright (c) 1995-1998 Mark Lord - * - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifdef CONFIG_PMAC_PBOOK -#include -#include -#endif -#include "ide_modes.h" - -extern char *ide_dmafunc_verbose(ide_dma_action_t dmafunc); -extern void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq); - -#define IDE_PMAC_DEBUG - -#define DMA_WAIT_TIMEOUT 500 - -struct pmac_ide_hwif { - ide_ioreg_t regbase; - int irq; - int kind; - int aapl_bus_id; - struct device_node* node; - u32 timings[2]; -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC - /* Those fields are duplicating what is in hwif. We currently - * can't use the hwif ones because of some assumptions that are - * beeing done by the generic code about the kind of dma controller - * and format of the dma table. This will have to be fixed though. - */ - volatile struct dbdma_regs* dma_regs; - struct dbdma_cmd* dma_table_cpu; - dma_addr_t dma_table_dma; - struct scatterlist* sg_table; - int sg_nents; - int sg_dma_direction; -#endif - -} pmac_ide[MAX_HWIFS] __pmacdata; - -static int pmac_ide_count; - -enum { - controller_ohare, /* OHare based */ - controller_heathrow, /* Heathrow/Paddington */ - controller_kl_ata3, /* KeyLargo ATA-3 */ - controller_kl_ata4, /* KeyLargo ATA-4 */ - controller_kl_ata4_80 /* KeyLargo ATA-4 with 80 conductor cable */ -}; - -/* - * Extra registers, both 32-bit little-endian - */ -#define IDE_TIMING_CONFIG 0x200 -#define IDE_INTERRUPT 0x300 - -/* - * Timing configuration register definitions - */ - -/* Number of IDE_SYSCLK_NS ticks, argument is in nanoseconds */ -#define SYSCLK_TICKS(t) (((t) + IDE_SYSCLK_NS - 1) / IDE_SYSCLK_NS) -#define SYSCLK_TICKS_66(t) (((t) + IDE_SYSCLK_66_NS - 1) / IDE_SYSCLK_66_NS) -#define IDE_SYSCLK_NS 30 /* 33Mhz cell */ -#define IDE_SYSCLK_66_NS 15 /* 66Mhz cell */ - -/* 66Mhz cell, found in KeyLargo. Can do ultra mode 0 to 2 on - * 40 connector cable and to 4 on 80 connector one. - * Clock unit is 15ns (66Mhz) - * - * 3 Values can be programmed: - * - Write data setup, which appears to match the cycle time. They - * also call it DIOW setup. - * - Ready to pause time (from spec) - * - Address setup. That one is weird. I don't see where exactly - * it fits in UDMA cycles, I got it's name from an obscure piece - * of commented out code in Darwin. They leave it to 0, we do as - * well, despite a comment that would lead to think it has a - * min value of 45ns. - * Apple also add 60ns to the write data setup (or cycle time ?) on - * reads. I can't explain that, I tried it and it broke everything - * here. - */ -#define TR_66_UDMA_MASK 0xfff00000 -#define TR_66_UDMA_EN 0x00100000 /* Enable Ultra mode for DMA */ -#define TR_66_UDMA_ADDRSETUP_MASK 0xe0000000 /* Address setup */ -#define TR_66_UDMA_ADDRSETUP_SHIFT 29 -#define TR_66_UDMA_RDY2PAUS_MASK 0x1e000000 /* Ready 2 pause time */ -#define TR_66_UDMA_RDY2PAUS_SHIFT 25 -#define TR_66_UDMA_WRDATASETUP_MASK 0x01e00000 /* Write data setup time */ -#define TR_66_UDMA_WRDATASETUP_SHIFT 21 -#define TR_66_MDMA_MASK 0x000ffc00 -#define TR_66_MDMA_RECOVERY_MASK 0x000f8000 -#define TR_66_MDMA_RECOVERY_SHIFT 15 -#define TR_66_MDMA_ACCESS_MASK 0x00007c00 -#define TR_66_MDMA_ACCESS_SHIFT 10 -#define TR_66_PIO_MASK 0x000003ff -#define TR_66_PIO_RECOVERY_MASK 0x000003e0 -#define TR_66_PIO_RECOVERY_SHIFT 5 -#define TR_66_PIO_ACCESS_MASK 0x0000001f -#define TR_66_PIO_ACCESS_SHIFT 0 - -/* 33Mhz cell, found in OHare, Heathrow (& Paddington) and KeyLargo - * Can do pio & mdma modes, clock unit is 30ns (33Mhz) - * - * The access time and recovery time can be programmed. Some older - * Darwin code base limit OHare to 150ns cycle time. I decided to do - * the same here fore safety against broken old hardware ;) - * The HalfTick bit, when set, adds half a clock (15ns) to the access - * time and removes one from recovery. It's not supported on KeyLargo - * implementation afaik. The E bit appears to be set for PIO mode 0 and - * is used to reach long timings used in this mode. - */ -#define TR_33_MDMA_MASK 0x003ff800 -#define TR_33_MDMA_RECOVERY_MASK 0x001f0000 -#define TR_33_MDMA_RECOVERY_SHIFT 16 -#define TR_33_MDMA_ACCESS_MASK 0x0000f800 -#define TR_33_MDMA_ACCESS_SHIFT 11 -#define TR_33_MDMA_HALFTICK 0x00200000 -#define TR_33_PIO_MASK 0x000007ff -#define TR_33_PIO_E 0x00000400 -#define TR_33_PIO_RECOVERY_MASK 0x000003e0 -#define TR_33_PIO_RECOVERY_SHIFT 5 -#define TR_33_PIO_ACCESS_MASK 0x0000001f -#define TR_33_PIO_ACCESS_SHIFT 0 - -/* - * Interrupt register definitions - */ -#define IDE_INTR_DMA 0x80000000 -#define IDE_INTR_DEVICE 0x40000000 - -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC - -/* Rounded Multiword DMA timings - * - * I gave up finding a generic formula for all controller - * types and instead, built tables based on timing values - * used by Apple in Darwin's implementation. - */ -struct mdma_timings_t { - int accessTime; - int recoveryTime; - int cycleTime; -}; - -struct mdma_timings_t mdma_timings_33[] __pmacdata = -{ - { 240, 240, 480 }, - { 180, 180, 360 }, - { 135, 135, 270 }, - { 120, 120, 240 }, - { 105, 105, 210 }, - { 90, 90, 180 }, - { 75, 75, 150 }, - { 75, 45, 120 }, - { 0, 0, 0 } -}; - -struct mdma_timings_t mdma_timings_33k[] __pmacdata = -{ - { 240, 240, 480 }, - { 180, 180, 360 }, - { 150, 150, 300 }, - { 120, 120, 240 }, - { 90, 120, 210 }, - { 90, 90, 180 }, - { 90, 60, 150 }, - { 90, 30, 120 }, - { 0, 0, 0 } -}; - -struct mdma_timings_t mdma_timings_66[] __pmacdata = -{ - { 240, 240, 480 }, - { 180, 180, 360 }, - { 135, 135, 270 }, - { 120, 120, 240 }, - { 105, 105, 210 }, - { 90, 90, 180 }, - { 90, 75, 165 }, - { 75, 45, 120 }, - { 0, 0, 0 } -}; - -/* Ultra DMA timings (rounded) */ -struct { - int addrSetup; /* ??? */ - int rdy2pause; - int wrDataSetup; -} udma_timings[] __pmacdata = -{ - { 0, 180, 120 }, /* Mode 0 */ - { 0, 150, 90 }, /* 1 */ - { 0, 120, 60 }, /* 2 */ - { 0, 90, 45 }, /* 3 */ - { 0, 90, 30 } /* 4 */ -}; - -/* allow up to 256 DBDMA commands per xfer */ -#define MAX_DCMDS 256 - -/* Wait 2s for disk to answer on IDE bus after - * enable operation. - * NOTE: There is at least one case I know of a disk that needs about 10sec - * before anwering on the bus. I beleive we could add a kernel command - * line arg to override this delay for such cases. - */ -#define IDE_WAKEUP_DELAY_MS 2000 - -static void pmac_ide_setup_dma(struct device_node *np, int ix); -static int pmac_ide_dmaproc(ide_dma_action_t func, ide_drive_t *drive); -static int pmac_ide_build_dmatable(ide_drive_t *drive, int ix, int wr); -static int pmac_ide_tune_chipset(ide_drive_t *drive, byte speed); -static void pmac_ide_tuneproc(ide_drive_t *drive, byte pio); -static void pmac_ide_selectproc(ide_drive_t *drive); - -#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ - -#ifdef CONFIG_PMAC_PBOOK -static int idepmac_notify_sleep(struct pmu_sleep_notifier *self, int when); -struct pmu_sleep_notifier idepmac_sleep_notifier = { - idepmac_notify_sleep, SLEEP_LEVEL_BLOCK, -}; -#endif /* CONFIG_PMAC_PBOOK */ - -static int pmac_ide_notify_reboot(struct notifier_block *, unsigned long, void *); -static struct notifier_block pmac_ide_reboot_notifier = { - pmac_ide_notify_reboot, - NULL, - 0 -}; - -static int __pmac -pmac_ide_find(ide_drive_t *drive) -{ - ide_hwif_t *hwif = HWIF(drive); - ide_ioreg_t base; - int i; - - for (i=0; iio_ports[0]) - return i; - } - return -1; -} - -/* - * N.B. this can't be an initfunc, because the media-bay task can - * call ide_[un]register at any time. - */ -void __pmac -pmac_ide_init_hwif_ports(hw_regs_t *hw, - ide_ioreg_t data_port, ide_ioreg_t ctrl_port, - int *irq) -{ - int i, ix; - - if (data_port == 0) - return; - - for (ix = 0; ix < MAX_HWIFS; ++ix) - if (data_port == pmac_ide[ix].regbase) - break; - - if (ix >= MAX_HWIFS) { - /* Probably a PCI interface... */ - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; ++i) - hw->io_ports[i] = data_port + i - IDE_DATA_OFFSET; - hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; - return; - } - - for (i = 0; i < 8; ++i) - hw->io_ports[i] = data_port + i * 0x10; - hw->io_ports[8] = data_port + 0x160; - - if (irq != NULL) - *irq = pmac_ide[ix].irq; - - ide_hwifs[ix].tuneproc = pmac_ide_tuneproc; - ide_hwifs[ix].selectproc = pmac_ide_selectproc; - ide_hwifs[ix].speedproc = &pmac_ide_tune_chipset; - if (pmac_ide[ix].dma_regs && pmac_ide[ix].dma_table_cpu) { - ide_hwifs[ix].dmaproc = &pmac_ide_dmaproc; -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO - if (!noautodma) - ide_hwifs[ix].autodma = 1; -#endif - } -} - -#if 0 -/* This one could be later extended to handle CMD IDE and be used by some kind - * of /proc interface. I want to be able to get the devicetree path of a block - * device for yaboot configuration - */ -struct device_node* -pmac_ide_get_devnode(ide_drive_t *drive) -{ - int i = pmac_ide_find(drive); - if (i < 0) - return NULL; - return pmac_ide[i].node; -} -#endif - -/* Setup timings for the selected drive (master/slave). I still need to verify if this - * is enough, I beleive selectproc will be called whenever an IDE command is started, - * but... */ -static void __pmac -pmac_ide_selectproc(ide_drive_t *drive) -{ - int i = pmac_ide_find(drive); - if (i < 0) - return; - - if (drive->select.b.unit & 0x01) - out_le32((unsigned *)(IDE_DATA_REG + IDE_TIMING_CONFIG + _IO_BASE), - pmac_ide[i].timings[1]); - else - out_le32((unsigned *)(IDE_DATA_REG + IDE_TIMING_CONFIG + _IO_BASE), - pmac_ide[i].timings[0]); - (void)in_le32((unsigned *)(IDE_DATA_REG + IDE_TIMING_CONFIG + _IO_BASE)); -} - - -/* Note: We don't use the generic routine here because for some - * yet unexplained reasons, it cause some media-bay CD-ROMs to - * lockup the bus. Strangely, this new version of the code is - * almost identical to the generic one and works, I've not yet - * managed to figure out what bit is causing the lockup in the - * generic code, possibly a timing issue... - * - * --BenH - */ -static int __pmac -wait_for_ready(ide_drive_t *drive) -{ - /* Timeout bumped for some powerbooks */ - int timeout = 2000; - byte stat; - - while(--timeout) { - stat = GET_STAT(); - if(!(stat & BUSY_STAT)) { - if (drive->ready_stat == 0) - break; - else if((stat & drive->ready_stat) || (stat & ERR_STAT)) - break; - } - mdelay(1); - } - if((stat & ERR_STAT) || timeout <= 0) { - if (stat & ERR_STAT) { - printk(KERN_ERR "ide_pmac: wait_for_ready, error status: %x\n", stat); - } - return 1; - } - return 0; -} - -static int __pmac -pmac_ide_do_setfeature(ide_drive_t *drive, byte command) -{ - int result = 1; - unsigned long flags; - ide_hwif_t *hwif = HWIF(drive); - - disable_irq(hwif->irq); /* disable_irq_nosync ?? */ - udelay(1); - SELECT_DRIVE(HWIF(drive), drive); - SELECT_MASK(HWIF(drive), drive, 0); - udelay(1); - (void)GET_STAT(); /* Get rid of pending error state */ - if(wait_for_ready(drive)) { - printk(KERN_ERR "pmac_ide_do_setfeature disk not ready before SET_FEATURE!\n"); - goto out; - } - udelay(10); - OUT_BYTE(drive->ctl | 2, IDE_CONTROL_REG); - OUT_BYTE(command, IDE_NSECTOR_REG); - OUT_BYTE(SETFEATURES_XFER, IDE_FEATURE_REG); - OUT_BYTE(WIN_SETFEATURES, IDE_COMMAND_REG); - udelay(1); - __save_flags(flags); /* local CPU only */ - ide__sti(); /* local CPU only -- for jiffies */ - result = wait_for_ready(drive); - __restore_flags(flags); /* local CPU only */ - OUT_BYTE(drive->ctl, IDE_CONTROL_REG); - if (result) - printk(KERN_ERR "pmac_ide_do_setfeature disk not ready after SET_FEATURE !\n"); -out: - SELECT_MASK(HWIF(drive), drive, 0); - if (result == 0) { - drive->id->dma_ultra &= ~0xFF00; - drive->id->dma_mword &= ~0x0F00; - drive->id->dma_1word &= ~0x0F00; - switch(command) { - case XFER_UDMA_7: drive->id->dma_ultra |= 0x8080; break; - case XFER_UDMA_6: drive->id->dma_ultra |= 0x4040; break; - case XFER_UDMA_5: drive->id->dma_ultra |= 0x2020; break; - case XFER_UDMA_4: drive->id->dma_ultra |= 0x1010; break; - case XFER_UDMA_3: drive->id->dma_ultra |= 0x0808; break; - case XFER_UDMA_2: drive->id->dma_ultra |= 0x0404; break; - case XFER_UDMA_1: drive->id->dma_ultra |= 0x0202; break; - case XFER_UDMA_0: drive->id->dma_ultra |= 0x0101; break; - case XFER_MW_DMA_2: drive->id->dma_mword |= 0x0404; break; - case XFER_MW_DMA_1: drive->id->dma_mword |= 0x0202; break; - case XFER_MW_DMA_0: drive->id->dma_mword |= 0x0101; break; - case XFER_SW_DMA_2: drive->id->dma_1word |= 0x0404; break; - case XFER_SW_DMA_1: drive->id->dma_1word |= 0x0202; break; - case XFER_SW_DMA_0: drive->id->dma_1word |= 0x0101; break; - default: break; - } - } - enable_irq(hwif->irq); - return result; -} - -/* Calculate PIO timings */ -static void __pmac -pmac_ide_tuneproc(ide_drive_t *drive, byte pio) -{ - ide_pio_data_t d; - int i; - u32 *timings; - unsigned accessTicks, recTicks; - unsigned accessTime, recTime; - - i = pmac_ide_find(drive); - if (i < 0) - return; - - pio = ide_get_best_pio_mode(drive, pio, 4, &d); - accessTicks = SYSCLK_TICKS(ide_pio_timings[pio].active_time); - if (drive->select.b.unit & 0x01) - timings = &pmac_ide[i].timings[1]; - else - timings = &pmac_ide[i].timings[0]; - - recTime = d.cycle_time - ide_pio_timings[pio].active_time - - ide_pio_timings[pio].setup_time; - recTime = max(recTime, 150U); - accessTime = ide_pio_timings[pio].active_time; - accessTime = max(accessTime, 150U); - if (pmac_ide[i].kind == controller_kl_ata4 || - pmac_ide[i].kind == controller_kl_ata4_80) { - /* 66Mhz cell */ - accessTicks = SYSCLK_TICKS_66(accessTime); - accessTicks = min(accessTicks, 0x1fU); - recTicks = SYSCLK_TICKS_66(recTime); - recTicks = min(recTicks, 0x1fU); - *timings = ((*timings) & ~TR_66_PIO_MASK) | - (accessTicks << TR_66_PIO_ACCESS_SHIFT) | - (recTicks << TR_66_PIO_RECOVERY_SHIFT); - } else { - /* 33Mhz cell */ - int ebit = 0; - accessTicks = SYSCLK_TICKS(accessTime); - accessTicks = min(accessTicks, 0x1fU); - accessTicks = max(accessTicks, 4U); - recTicks = SYSCLK_TICKS(recTime); - recTicks = min(recTicks, 0x1fU); - recTicks = max(recTicks, 5U) - 4; - if (recTicks > 9) { - recTicks--; /* guess, but it's only for PIO0, so... */ - ebit = 1; - } - *timings = ((*timings) & ~TR_33_PIO_MASK) | - (accessTicks << TR_33_PIO_ACCESS_SHIFT) | - (recTicks << TR_33_PIO_RECOVERY_SHIFT); - if (ebit) - *timings |= TR_33_PIO_E; - } - -#ifdef IDE_PMAC_DEBUG - printk(KERN_ERR "ide_pmac: Set PIO timing for mode %d, reg: 0x%08x\n", - pio, *timings); -#endif - - if (drive->select.all == IN_BYTE(IDE_SELECT_REG)) - pmac_ide_selectproc(drive); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC -static int __pmac -set_timings_udma(u32 *timings, byte speed) -{ - unsigned rdyToPauseTicks, wrDataSetupTicks, addrTicks; - - rdyToPauseTicks = SYSCLK_TICKS_66(udma_timings[speed & 0xf].rdy2pause); - wrDataSetupTicks = SYSCLK_TICKS_66(udma_timings[speed & 0xf].wrDataSetup); - addrTicks = SYSCLK_TICKS_66(udma_timings[speed & 0xf].addrSetup); - - *timings = ((*timings) & ~(TR_66_UDMA_MASK | TR_66_MDMA_MASK)) | - (wrDataSetupTicks << TR_66_UDMA_WRDATASETUP_SHIFT) | - (rdyToPauseTicks << TR_66_UDMA_RDY2PAUS_SHIFT) | - (addrTicks < cycleTime) - cycleTime = drive_cycle_time; - /* OHare limits according to some old Apple sources */ - if ((intf_type == controller_ohare) && (cycleTime < 150)) - cycleTime = 150; - /* Get the proper timing array for this controller */ - switch(intf_type) { - case controller_kl_ata4: - case controller_kl_ata4_80: - tm = mdma_timings_66; - break; - case controller_kl_ata3: - tm = mdma_timings_33k; - break; - default: - tm = mdma_timings_33; - break; - } - /* Lookup matching access & recovery times */ - i = -1; - for (;;) { - if (tm[i+1].cycleTime < cycleTime) - break; - i++; - } - if (i < 0) - return -1; - cycleTime = tm[i].cycleTime; - accessTime = tm[i].accessTime; - recTime = tm[i].recoveryTime; - -#ifdef IDE_PMAC_DEBUG - printk(KERN_ERR "ide_pmac: MDMA, cycleTime: %d, accessTime: %d, recTime: %d\n", - cycleTime, accessTime, recTime); -#endif - if (intf_type == controller_kl_ata4 || intf_type == controller_kl_ata4_80) { - /* 66Mhz cell */ - accessTicks = SYSCLK_TICKS_66(accessTime); - accessTicks = min(accessTicks, 0x1fU); - accessTicks = max(accessTicks, 0x1U); - recTicks = SYSCLK_TICKS_66(recTime); - recTicks = min(recTicks, 0x1fU); - recTicks = max(recTicks, 0x3U); - /* Clear out mdma bits and disable udma */ - *timings = ((*timings) & ~(TR_66_MDMA_MASK | TR_66_UDMA_MASK)) | - (accessTicks << TR_66_MDMA_ACCESS_SHIFT) | - (recTicks << TR_66_MDMA_RECOVERY_SHIFT); - } else if (intf_type == controller_kl_ata3) { - /* 33Mhz cell on KeyLargo */ - accessTicks = SYSCLK_TICKS(accessTime); - accessTicks = max(accessTicks, 1U); - accessTicks = min(accessTicks, 0x1fU); - accessTime = accessTicks * IDE_SYSCLK_NS; - recTicks = SYSCLK_TICKS(recTime); - recTicks = max(recTicks, 1U); - recTicks = min(recTicks, 0x1fU); - *timings = ((*timings) & ~TR_33_MDMA_MASK) | - (accessTicks << TR_33_MDMA_ACCESS_SHIFT) | - (recTicks << TR_33_MDMA_RECOVERY_SHIFT); - } else { - /* 33Mhz cell on others */ - int halfTick = 0; - int origAccessTime = accessTime; - int origRecTime = recTime; - - accessTicks = SYSCLK_TICKS(accessTime); - accessTicks = max(accessTicks, 1U); - accessTicks = min(accessTicks, 0x1fU); - accessTime = accessTicks * IDE_SYSCLK_NS; - recTicks = SYSCLK_TICKS(recTime); - recTicks = max(recTicks, 2U) - 1; - recTicks = min(recTicks, 0x1fU); - recTime = (recTicks + 1) * IDE_SYSCLK_NS; - if ((accessTicks > 1) && - ((accessTime - IDE_SYSCLK_NS/2) >= origAccessTime) && - ((recTime - IDE_SYSCLK_NS/2) >= origRecTime)) { - halfTick = 1; - accessTicks--; - } - *timings = ((*timings) & ~TR_33_MDMA_MASK) | - (accessTicks << TR_33_MDMA_ACCESS_SHIFT) | - (recTicks << TR_33_MDMA_RECOVERY_SHIFT); - if (halfTick) - *timings |= TR_33_MDMA_HALFTICK; - } -#ifdef IDE_PMAC_DEBUG - printk(KERN_ERR "ide_pmac: Set MDMA timing for mode %d, reg: 0x%08x\n", - speed & 0xf, *timings); -#endif - return 0; -} -#endif /* #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC */ - -/* You may notice we don't use this function on normal operation, - * our, normal mdma function is supposed to be more precise - */ -static int __pmac -pmac_ide_tune_chipset (ide_drive_t *drive, byte speed) -{ - int intf = pmac_ide_find(drive); - int unit = (drive->select.b.unit & 0x01); - int ret = 0; - u32 *timings; - - if (intf < 0) - return 1; - - timings = &pmac_ide[intf].timings[unit]; - - switch(speed) { -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC - case XFER_UDMA_4: - case XFER_UDMA_3: - if (pmac_ide[intf].kind != controller_kl_ata4_80) - return 1; - case XFER_UDMA_2: - case XFER_UDMA_1: - case XFER_UDMA_0: - if (pmac_ide[intf].kind != controller_kl_ata4 && - pmac_ide[intf].kind != controller_kl_ata4_80) - return 1; - ret = set_timings_udma(timings, speed); - break; - case XFER_MW_DMA_2: - case XFER_MW_DMA_1: - case XFER_MW_DMA_0: - ret = set_timings_mdma(pmac_ide[intf].kind, timings, speed, 0); - break; - case XFER_SW_DMA_2: - case XFER_SW_DMA_1: - case XFER_SW_DMA_0: - return 1; -#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ - case XFER_PIO_4: - case XFER_PIO_3: - case XFER_PIO_2: - case XFER_PIO_1: - case XFER_PIO_0: - pmac_ide_tuneproc(drive, speed & 0x07); - break; - default: - ret = 1; - } - if (ret) - return ret; - - ret = pmac_ide_do_setfeature(drive, speed); - if (ret) - return ret; - - pmac_ide_selectproc(drive); - drive->current_speed = speed; - - return 0; -} - -static void __pmac -sanitize_timings(int i) -{ - unsigned value; - - switch(pmac_ide[i].kind) { - case controller_kl_ata4: - case controller_kl_ata4_80: - value = 0x0008438c; - break; - case controller_kl_ata3: - value = 0x00084526; - break; - case controller_heathrow: - case controller_ohare: - default: - value = 0x00074526; - break; - } - pmac_ide[i].timings[0] = pmac_ide[i].timings[1] = value; -} - -ide_ioreg_t __pmac -pmac_ide_get_base(int index) -{ - return pmac_ide[index].regbase; -} - -int __pmac -pmac_ide_check_base(ide_ioreg_t base) -{ - int ix; - - for (ix = 0; ix < MAX_HWIFS; ++ix) - if (base == pmac_ide[ix].regbase) - return ix; - return -1; -} - -int __pmac -pmac_ide_get_irq(ide_ioreg_t base) -{ - int ix; - - for (ix = 0; ix < MAX_HWIFS; ++ix) - if (base == pmac_ide[ix].regbase) - return pmac_ide[ix].irq; - return 0; -} - -static int ide_majors[] __pmacdata = { 3, 22, 33, 34, 56, 57 }; - -kdev_t __init -pmac_find_ide_boot(char *bootdevice, int n) -{ - int i; - - /* - * Look through the list of IDE interfaces for this one. - */ - for (i = 0; i < pmac_ide_count; ++i) { - char *name; - if (!pmac_ide[i].node || !pmac_ide[i].node->full_name) - continue; - name = pmac_ide[i].node->full_name; - if (memcmp(name, bootdevice, n) == 0 && name[n] == 0) { - /* XXX should cope with the 2nd drive as well... */ - return MKDEV(ide_majors[i], 0); - } - } - - return 0; -} - -void __init -pmac_ide_probe(void) -{ - struct device_node *np; - int i; - struct device_node *atas; - struct device_node *p, **pp, *removables, **rp; - unsigned long base; - int irq, big_delay; - ide_hwif_t *hwif; - - if (_machine != _MACH_Pmac) - return; - pp = &atas; - rp = &removables; - p = find_devices("ATA"); - if (p == NULL) - p = find_devices("IDE"); - if (p == NULL) - p = find_type_devices("ide"); - if (p == NULL) - p = find_type_devices("ata"); - /* Move removable devices such as the media-bay CDROM - on the PB3400 to the end of the list. */ - for (; p != NULL; p = p->next) { - if (p->parent && p->parent->type - && strcasecmp(p->parent->type, "media-bay") == 0) { - *rp = p; - rp = &p->next; - } else { - *pp = p; - pp = &p->next; - } - } - *rp = NULL; - *pp = removables; - big_delay = 0; - - for (i = 0, np = atas; i < MAX_HWIFS && np != NULL; np = np->next) { - struct device_node *tp; - struct pmac_ide_hwif* pmhw; - int *bidp; - int in_bay = 0; - u8 pbus, pid; - struct pci_dev *pdev = NULL; - - /* - * If this node is not under a mac-io or dbdma node, - * leave it to the generic PCI driver. - */ - for (tp = np->parent; tp != 0; tp = tp->parent) - if (tp->type && (strcmp(tp->type, "mac-io") == 0 - || strcmp(tp->type, "dbdma") == 0)) - break; - if (tp == 0) - continue; - - if (np->n_addrs == 0) { - printk(KERN_WARNING "ide: no address for device %s\n", - np->full_name); - continue; - } - - /* We need to find the pci_dev of the mac-io holding the - * IDE interface - */ - if (pci_device_from_OF_node(tp, &pbus, &pid) == 0) - pdev = pci_find_slot(pbus, pid); - if (pdev == NULL) - printk(KERN_WARNING "ide: no PCI host for device %s, DMA disabled\n", - np->full_name); - - /* - * If this slot is taken (e.g. by ide-pci.c) try the next one. - */ - while (i < MAX_HWIFS - && ide_hwifs[i].io_ports[IDE_DATA_OFFSET] != 0) - ++i; - if (i >= MAX_HWIFS) - break; - pmhw = &pmac_ide[i]; - - /* - * Some older OFs have bogus sizes, causing request_OF_resource - * to fail. We fix them up here - */ - if (np->addrs[0].size > 0x1000) - np->addrs[0].size = 0x1000; - if (np->n_addrs > 1 && np->addrs[1].size > 0x100) - np->addrs[1].size = 0x100; - - if (request_OF_resource(np, 0, " (mac-io IDE IO)") == NULL) { - printk(KERN_ERR "ide-pmac(%s): can't request IO resource !\n", np->name); - continue; - } - - base = (unsigned long) ioremap(np->addrs[0].address, 0x400) - _IO_BASE; - - /* XXX This is bogus. Should be fixed in the registry by checking - the kind of host interrupt controller, a bit like gatwick - fixes in irq.c - */ - if (np->n_intrs == 0) { - printk(KERN_WARNING "ide: no intrs for device %s, using 13\n", - np->full_name); - irq = 13; - } else { - irq = np->intrs[0].line; - } - pmhw->regbase = base; - pmhw->irq = irq; - pmhw->node = np; - if (device_is_compatible(np, "keylargo-ata")) { - if (strcmp(np->name, "ata-4") == 0) - pmhw->kind = controller_kl_ata4; - else - pmhw->kind = controller_kl_ata3; - } else if (device_is_compatible(np, "heathrow-ata")) - pmhw->kind = controller_heathrow; - else - pmhw->kind = controller_ohare; - - bidp = (int *)get_property(np, "AAPL,bus-id", NULL); - pmhw->aapl_bus_id = bidp ? *bidp : 0; - - if (pmhw->kind == controller_kl_ata4) { - char* cable = get_property(np, "cable-type", NULL); - if (cable && !strncmp(cable, "80-", 3)) - pmhw->kind = controller_kl_ata4_80; - } - - /* Make sure we have sane timings */ - sanitize_timings(i); - - if (np->parent && np->parent->name - && strcasecmp(np->parent->name, "media-bay") == 0) { -#ifdef CONFIG_PMAC_PBOOK - media_bay_set_ide_infos(np->parent,base,irq,i); -#endif /* CONFIG_PMAC_PBOOK */ - in_bay = 1; - if (!bidp) - pmhw->aapl_bus_id = 1; - } else if (pmhw->kind == controller_ohare) { - /* The code below is having trouble on some ohare machines - * (timing related ?). Until I can put my hand on one of these - * units, I keep the old way - */ - ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, 0, 1); - } else { - /* This is necessary to enable IDE when net-booting */ - printk(KERN_INFO "pmac_ide: enabling IDE bus ID %d\n", - pmhw->aapl_bus_id); - ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmhw->aapl_bus_id, 1); - ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmhw->aapl_bus_id, 1); - mdelay(10); - ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmhw->aapl_bus_id, 0); - big_delay = 1; - } - - hwif = &ide_hwifs[i]; - pmac_ide_init_hwif_ports(&hwif->hw, base, 0, &hwif->irq); - memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); - hwif->chipset = ide_pmac; - hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET] || in_bay; - hwif->udma_four = (pmhw->kind == controller_kl_ata4_80); - hwif->pci_dev = pdev; -#ifdef CONFIG_PMAC_PBOOK - if (in_bay && check_media_bay_by_base(base, MB_CD) == 0) - hwif->noprobe = 0; -#endif /* CONFIG_PMAC_PBOOK */ - -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC - if (np->n_addrs >= 2) { - /* has a DBDMA controller channel */ - pmac_ide_setup_dma(np, i); - } -#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ - - ++i; - } - pmac_ide_count = i; - if (big_delay) - mdelay(IDE_WAKEUP_DELAY_MS); - -#ifdef CONFIG_PMAC_PBOOK - pmu_register_sleep_notifier(&idepmac_sleep_notifier); -#endif /* CONFIG_PMAC_PBOOK */ - register_reboot_notifier(&pmac_ide_reboot_notifier); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC - -static void __init -pmac_ide_setup_dma(struct device_node *np, int ix) -{ - struct pmac_ide_hwif *pmif = &pmac_ide[ix]; - - if (request_OF_resource(np, 1, " (mac-io IDE DMA)") == NULL) { - printk(KERN_ERR "ide-pmac(%s): can't request DMA resource !\n", np->name); - return; - } - - pmif->dma_regs = - (volatile struct dbdma_regs*)ioremap(np->addrs[1].address, 0x200); - - /* - * Allocate space for the DBDMA commands. - * The +2 is +1 for the stop command and +1 to allow for - * aligning the start address to a multiple of 16 bytes. - */ - pmif->dma_table_cpu = (struct dbdma_cmd*)pci_alloc_consistent( - ide_hwifs[ix].pci_dev, - (MAX_DCMDS + 2) * sizeof(struct dbdma_cmd), - &pmif->dma_table_dma); - if (pmif->dma_table_cpu == NULL) { - printk(KERN_ERR "%s: unable to allocate DMA command list\n", - ide_hwifs[ix].name); - return; - } - - pmif->sg_table = kmalloc(sizeof(struct scatterlist) * MAX_DCMDS, - GFP_KERNEL); - if (pmif->sg_table == NULL) { - pci_free_consistent( ide_hwifs[ix].pci_dev, - (MAX_DCMDS + 2) * sizeof(struct dbdma_cmd), - pmif->dma_table_cpu, pmif->dma_table_dma); - return; - } - ide_hwifs[ix].dmaproc = &pmac_ide_dmaproc; -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO - if (!noautodma) - ide_hwifs[ix].autodma = 1; -#endif -} - -static int -pmac_ide_build_sglist (int ix, struct request *rq) -{ - ide_hwif_t *hwif = &ide_hwifs[ix]; - struct pmac_ide_hwif *pmif = &pmac_ide[ix]; - struct buffer_head *bh; - struct scatterlist *sg = pmif->sg_table; - int nents = 0; - - if (hwif->sg_dma_active) - BUG(); - - if (rq->cmd == READ) - pmif->sg_dma_direction = PCI_DMA_FROMDEVICE; - else - pmif->sg_dma_direction = PCI_DMA_TODEVICE; - bh = rq->bh; - do { - unsigned char *virt_addr = bh->b_data; - unsigned int size = bh->b_size; - - if (nents >= MAX_DCMDS) - return 0; - - while ((bh = bh->b_reqnext) != NULL) { - if ((virt_addr + size) != (unsigned char *) bh->b_data) - break; - size += bh->b_size; - } - memset(&sg[nents], 0, sizeof(*sg)); - sg[nents].address = virt_addr; - sg[nents].length = size; - nents++; - } while (bh != NULL); - - return pci_map_sg(hwif->pci_dev, sg, nents, pmif->sg_dma_direction); -} - -static int -pmac_ide_raw_build_sglist (int ix, struct request *rq) -{ - ide_hwif_t *hwif = &ide_hwifs[ix]; - struct pmac_ide_hwif *pmif = &pmac_ide[ix]; - struct scatterlist *sg = hwif->sg_table; - int nents = 0; - ide_task_t *args = rq->special; - unsigned char *virt_addr = rq->buffer; - int sector_count = rq->nr_sectors; - -// if ((args->tfRegister[IDE_COMMAND_OFFSET] == WIN_WRITEDMA) || -// (args->tfRegister[IDE_COMMAND_OFFSET] == WIN_WRITEDMA_EXT)) - if (args->command_type == IDE_DRIVE_TASK_RAW_WRITE) - pmif->sg_dma_direction = PCI_DMA_TODEVICE; - else - pmif->sg_dma_direction = PCI_DMA_FROMDEVICE; - - if (sector_count > 128) { - memset(&sg[nents], 0, sizeof(*sg)); - sg[nents].address = virt_addr; - sg[nents].length = 128 * SECTOR_SIZE; - nents++; - virt_addr = virt_addr + (128 * SECTOR_SIZE); - sector_count -= 128; - } - memset(&sg[nents], 0, sizeof(*sg)); - sg[nents].address = virt_addr; - sg[nents].length = sector_count * SECTOR_SIZE; - nents++; - - return pci_map_sg(hwif->pci_dev, sg, nents, pmif->sg_dma_direction); -} - -/* - * pmac_ide_build_dmatable builds the DBDMA command list - * for a transfer and sets the DBDMA channel to point to it. - */ -static int -pmac_ide_build_dmatable(ide_drive_t *drive, int ix, int wr) -{ - struct dbdma_cmd *table; - int i, count = 0; - struct request *rq = HWGROUP(drive)->rq; - volatile struct dbdma_regs *dma = pmac_ide[ix].dma_regs; - struct scatterlist *sg; - - /* DMA table is already aligned */ - table = (struct dbdma_cmd *) pmac_ide[ix].dma_table_cpu; - - /* Make sure DMA controller is stopped (necessary ?) */ - out_le32(&dma->control, (RUN|PAUSE|FLUSH|WAKE|DEAD) << 16); - while (in_le32(&dma->status) & RUN) - udelay(1); - - /* Build sglist */ - if (HWGROUP(drive)->rq->cmd == IDE_DRIVE_TASKFILE) - pmac_ide[ix].sg_nents = i = pmac_ide_raw_build_sglist(ix, rq); - else - pmac_ide[ix].sg_nents = i = pmac_ide_build_sglist(ix, rq); - if (!i) - return 0; - - /* Build DBDMA commands list */ - sg = pmac_ide[ix].sg_table; - while (i) { - u32 cur_addr; - u32 cur_len; - - cur_addr = sg_dma_address(sg); - cur_len = sg_dma_len(sg); - - while (cur_len) { - unsigned int tc = (cur_len < 0xfe00)? cur_len: 0xfe00; - - if (++count >= MAX_DCMDS) { - printk(KERN_WARNING "%s: DMA table too small\n", - drive->name); - return 0; /* revert to PIO for this request */ - } - st_le16(&table->command, wr? OUTPUT_MORE: INPUT_MORE); - st_le16(&table->req_count, tc); - st_le32(&table->phy_addr, cur_addr); - table->cmd_dep = 0; - table->xfer_status = 0; - table->res_count = 0; - cur_addr += tc; - cur_len -= tc; - ++table; - } - sg++; - i--; - } - - /* convert the last command to an input/output last command */ - if (count) - st_le16(&table[-1].command, wr? OUTPUT_LAST: INPUT_LAST); - else - printk(KERN_DEBUG "%s: empty DMA table?\n", drive->name); - - /* add the stop command to the end of the list */ - memset(table, 0, sizeof(struct dbdma_cmd)); - out_le16(&table->command, DBDMA_STOP); - - out_le32(&dma->cmdptr, pmac_ide[ix].dma_table_dma); - return 1; -} - -/* Teardown mappings after DMA has completed. */ -static void -pmac_ide_destroy_dmatable (ide_drive_t *drive, int ix) -{ - struct pci_dev *dev = HWIF(drive)->pci_dev; - struct scatterlist *sg = pmac_ide[ix].sg_table; - int nents = pmac_ide[ix].sg_nents; - - if (nents) { - pci_unmap_sg(dev, sg, nents, pmac_ide[ix].sg_dma_direction); - pmac_ide[ix].sg_nents = 0; - } -} - -static __inline__ unsigned char -dma_bits_to_command(unsigned char bits) -{ - if(bits & 0x04) - return XFER_MW_DMA_2; - if(bits & 0x02) - return XFER_MW_DMA_1; - if(bits & 0x01) - return XFER_MW_DMA_0; - return 0; -} - -static __inline__ unsigned char -udma_bits_to_command(unsigned char bits, int high_speed) -{ - if (high_speed) { - if(bits & 0x10) - return XFER_UDMA_4; - if(bits & 0x08) - return XFER_UDMA_3; - } - if(bits & 0x04) - return XFER_UDMA_2; - if(bits & 0x02) - return XFER_UDMA_1; - if(bits & 0x01) - return XFER_UDMA_0; - return 0; -} - -/* Calculate MultiWord DMA timings */ -static int __pmac -pmac_ide_mdma_enable(ide_drive_t *drive, int idx) -{ - byte bits = drive->id->dma_mword & 0x07; - byte feature = dma_bits_to_command(bits); - u32 *timings; - int drive_cycle_time; - struct hd_driveid *id = drive->id; - int ret; - - /* Set feature on drive */ - printk(KERN_INFO "%s: Enabling MultiWord DMA %d\n", drive->name, feature & 0xf); - ret = pmac_ide_do_setfeature(drive, feature); - if (ret) { - printk(KERN_WARNING "%s: Failed !\n", drive->name); - return 0; - } - - if (!drive->init_speed) - drive->init_speed = feature; - - /* which drive is it ? */ - if (drive->select.b.unit & 0x01) - timings = &pmac_ide[idx].timings[1]; - else - timings = &pmac_ide[idx].timings[0]; - - /* Check if drive provide explicit cycle time */ - if ((id->field_valid & 2) && (id->eide_dma_time)) - drive_cycle_time = id->eide_dma_time; - else - drive_cycle_time = 0; - - /* Calculate controller timings */ - set_timings_mdma(pmac_ide[idx].kind, timings, feature, drive_cycle_time); - - drive->current_speed = feature; - return 1; -} - -/* Calculate Ultra DMA timings */ -static int __pmac -pmac_ide_udma_enable(ide_drive_t *drive, int idx, int high_speed) -{ - byte bits = drive->id->dma_ultra & 0x1f; - byte feature = udma_bits_to_command(bits, high_speed); - u32 *timings; - int ret; - - /* Set feature on drive */ - printk(KERN_INFO "%s: Enabling Ultra DMA %d\n", drive->name, feature & 0xf); - ret = pmac_ide_do_setfeature(drive, feature); - if (ret) { - printk(KERN_WARNING "%s: Failed !\n", drive->name); - return 0; - } - - if (!drive->init_speed) - drive->init_speed = feature; - - /* which drive is it ? */ - if (drive->select.b.unit & 0x01) - timings = &pmac_ide[idx].timings[1]; - else - timings = &pmac_ide[idx].timings[0]; - - set_timings_udma(timings, feature); - - drive->current_speed = feature; - return 1; -} - -static int __pmac -pmac_ide_check_dma(ide_drive_t *drive) -{ - int ata4, udma, idx; - struct hd_driveid *id = drive->id; - int enable = 1; - - drive->using_dma = 0; - - idx = pmac_ide_find(drive); - if (idx < 0) - return 0; - - if (drive->media == ide_floppy) - enable = 0; - if (((id->capability & 1) == 0) && !check_drive_lists(drive, GOOD_DMA_DRIVE)) - enable = 0; - if (check_drive_lists(drive, BAD_DMA_DRIVE)) - enable = 0; - - udma = 0; - ata4 = (pmac_ide[idx].kind == controller_kl_ata4 || - pmac_ide[idx].kind == controller_kl_ata4_80); - - if(enable) { - if (ata4 && (drive->media == ide_disk) && - (id->field_valid & 0x0004) && (id->dma_ultra & 0x1f)) { - /* UltraDMA modes. */ - drive->using_dma = pmac_ide_udma_enable(drive, idx, - pmac_ide[idx].kind == controller_kl_ata4_80); - } - if (!drive->using_dma && (id->dma_mword & 0x0007)) { - /* Normal MultiWord DMA modes. */ - drive->using_dma = pmac_ide_mdma_enable(drive, idx); - } - OUT_BYTE(0, IDE_CONTROL_REG); - /* Apply settings to controller */ - pmac_ide_selectproc(drive); - } - return 0; -} - -static int __pmac -pmac_ide_dmaproc(ide_dma_action_t func, ide_drive_t *drive) -{ - int ix, dstat; - volatile struct dbdma_regs *dma; - byte unit = (drive->select.b.unit & 0x01); - byte ata4; - int reading = 0; - - /* Can we stuff a pointer to our intf structure in config_data - * or select_data in hwif ? - */ - ix = pmac_ide_find(drive); - if (ix < 0) - return 0; - dma = pmac_ide[ix].dma_regs; - ata4 = (pmac_ide[ix].kind == controller_kl_ata4 || - pmac_ide[ix].kind == controller_kl_ata4_80); - - switch (func) { - case ide_dma_off: - printk(KERN_INFO "%s: DMA disabled\n", drive->name); - case ide_dma_off_quietly: - drive->using_dma = 0; - break; - case ide_dma_on: - case ide_dma_check: - pmac_ide_check_dma(drive); - break; - case ide_dma_read: - reading = 1; - case ide_dma_write: - SELECT_READ_WRITE(HWIF(drive),drive,func); - if (!pmac_ide_build_dmatable(drive, ix, !reading)) - return 1; - /* Apple adds 60ns to wrDataSetup on reads */ - if (ata4 && (pmac_ide[ix].timings[unit] & TR_66_UDMA_EN)) { - out_le32((unsigned *)(IDE_DATA_REG + IDE_TIMING_CONFIG + _IO_BASE), - pmac_ide[ix].timings[unit] + - (reading ? 0x00800000UL : 0)); - (void)in_le32((unsigned *)(IDE_DATA_REG + IDE_TIMING_CONFIG + _IO_BASE)); - } - drive->waiting_for_dma = 1; - if (drive->media != ide_disk) - return 0; - ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); - if ((HWGROUP(drive)->rq->cmd == IDE_DRIVE_TASKFILE) && - (drive->addressing == 1)) { - ide_task_t *args = HWGROUP(drive)->rq->special; - OUT_BYTE(args->tfRegister[IDE_COMMAND_OFFSET], IDE_COMMAND_REG); - } else if (drive->addressing) { - OUT_BYTE(reading ? WIN_READDMA_EXT : WIN_WRITEDMA_EXT, IDE_COMMAND_REG); - } else { - OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG); - } - case ide_dma_begin: - out_le32(&dma->control, (RUN << 16) | RUN); - /* Make sure it gets to the controller right now */ - (void)in_le32(&dma->control); - break; - case ide_dma_end: /* returns 1 on error, 0 otherwise */ - drive->waiting_for_dma = 0; - dstat = in_le32(&dma->status); - out_le32(&dma->control, ((RUN|WAKE|DEAD) << 16)); - pmac_ide_destroy_dmatable(drive, ix); - /* verify good dma status */ - return (dstat & (RUN|DEAD|ACTIVE)) != RUN; - case ide_dma_test_irq: /* returns 1 if dma irq issued, 0 otherwise */ - /* We have to things to deal with here: - * - * - The dbdma won't stop if the command was started - * but completed with an error without transfering all - * datas. This happens when bad blocks are met during - * a multi-block transfer. - * - * - The dbdma fifo hasn't yet finished flushing to - * to system memory when the disk interrupt occurs. - * - * The trick here is to increment drive->waiting_for_dma, - * and return as if no interrupt occured. If the counter - * reach a certain timeout value, we then return 1. If - * we really got the interrupt, it will happen right away - * again. - * Apple's solution here may be more elegant. They issue - * a DMA channel interrupt (a separate irq line) via a DBDMA - * NOP command just before the STOP, and wait for both the - * disk and DBDMA interrupts to have completed. - */ - - /* If ACTIVE is cleared, the STOP command have passed and - * transfer is complete. - */ - if (!(in_le32(&dma->status) & ACTIVE)) - return 1; - if (!drive->waiting_for_dma) - printk(KERN_WARNING "ide%d, ide_dma_test_irq \ - called while not waiting\n", ix); - - /* If dbdma didn't execute the STOP command yet, the - * active bit is still set */ - drive->waiting_for_dma++; - if (drive->waiting_for_dma >= DMA_WAIT_TIMEOUT) { - printk(KERN_WARNING "ide%d, timeout waiting \ - for dbdma command stop\n", ix); - return 1; - } - udelay(1); - return 0; - - /* Let's implement tose just in case someone wants them */ - case ide_dma_bad_drive: - case ide_dma_good_drive: - return check_drive_lists(drive, (func == ide_dma_good_drive)); - case ide_dma_verbose: - return report_drive_dmaing(drive); - case ide_dma_retune: - case ide_dma_lostirq: - case ide_dma_timeout: - printk(KERN_WARNING "ide_pmac_dmaproc: chipset supported %s func only: %d\n", ide_dmafunc_verbose(func), func); - return 1; - default: - printk(KERN_WARNING "ide_pmac_dmaproc: unsupported %s func: %d\n", ide_dmafunc_verbose(func), func); - return 1; - } - return 0; -} -#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ - -static void __pmac -idepmac_sleep_device(ide_drive_t *drive, int i, unsigned base) -{ - int j; - - /* FIXME: We only handle the master IDE disk, we shoud - * try to fix CD-ROMs here - */ - switch (drive->media) { - case ide_disk: - /* Spin down the drive */ - outb(drive->select.all, base+0x60); - (void)inb(base+0x60); - udelay(100); - outb(0x0, base+0x30); - outb(0x0, base+0x20); - outb(0x0, base+0x40); - outb(0x0, base+0x50); - outb(0xe0, base+0x70); - outb(0x2, base+0x160); - for (j = 0; j < 10; j++) { - int status; - mdelay(100); - status = inb(base+0x70); - if (!(status & BUSY_STAT) && (status & DRQ_STAT)) - break; - } - break; - case ide_cdrom: - // todo - break; - case ide_floppy: - // todo - break; - } -} - -#ifdef CONFIG_PMAC_PBOOK -static void __pmac -idepmac_wake_device(ide_drive_t *drive, int used_dma) -{ - /* We force the IDE subdriver to check for a media change - * This must be done first or we may lost the condition - * - * Problem: This can schedule. I moved the block device - * wakeup almost late by priority because of that. - */ - if (DRIVER(drive) && DRIVER(drive)->media_change) - DRIVER(drive)->media_change(drive); - - /* We kick the VFS too (see fix in ide.c revalidate) */ - check_disk_change(MKDEV(HWIF(drive)->major, (drive->select.b.unit) << PARTN_BITS)); - -#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC - /* We re-enable DMA on the drive if it was active. */ - /* This doesn't work with the CD-ROM in the media-bay, probably - * because of a pending unit attention. The problem if that if I - * clear the error, the filesystem dies. - */ - if (used_dma && !ide_spin_wait_hwgroup(drive)) { - /* Lock HW group */ - HWGROUP(drive)->busy = 1; - pmac_ide_check_dma(drive); - HWGROUP(drive)->busy = 0; - if (!list_empty(&drive->queue.queue_head)) - ide_do_request(HWGROUP(drive), 0); - spin_unlock_irq(&io_request_lock); - } -#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ -} - -static void __pmac -idepmac_sleep_interface(int i, unsigned base, int mediabay) -{ - struct device_node* np = pmac_ide[i].node; - - /* We clear the timings */ - pmac_ide[i].timings[0] = 0; - pmac_ide[i].timings[1] = 0; - - /* The media bay will handle itself just fine */ - if (mediabay) - return; - - /* Disable the bus */ - ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmac_ide[i].aapl_bus_id, 0); -} - -static void __pmac -idepmac_wake_interface(int i, unsigned long base, int mediabay) -{ - struct device_node* np = pmac_ide[i].node; - - if (!mediabay) { - /* Revive IDE disk and controller */ - ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmac_ide[i].aapl_bus_id, 1); - ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmac_ide[i].aapl_bus_id, 1); - mdelay(10); - ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmac_ide[i].aapl_bus_id, 0); - } -} - -static void -idepmac_sleep_drive(ide_drive_t *drive, int idx, unsigned long base) -{ - int unlock = 0; - - /* Wait for HW group to complete operations */ - if (ide_spin_wait_hwgroup(drive)) { - // What can we do here ? Wake drive we had already - // put to sleep and return an error ? - } else { - unlock = 1; - /* Lock HW group */ - HWGROUP(drive)->busy = 1; - /* Stop the device */ - idepmac_sleep_device(drive, idx, base); - } - if (unlock) - spin_unlock_irq(&io_request_lock); -} - -static void -idepmac_wake_drive(ide_drive_t *drive, unsigned long base) -{ - unsigned long flags; - int j; - - /* Reset timings */ - pmac_ide_selectproc(drive); - mdelay(10); - - /* Wait up to 20 seconds for the drive to be ready */ - for (j = 0; j < 200; j++) { - int status; - mdelay(100); - outb(drive->select.all, base + 0x60); - if (inb(base + 0x60) != drive->select.all) - continue; - status = inb(base + 0x70); - if (!(status & BUSY_STAT)) - break; - } - - /* We resume processing on the HW group */ - spin_lock_irqsave(&io_request_lock, flags); - HWGROUP(drive)->busy = 0; - if (!list_empty(&drive->queue.queue_head)) - ide_do_request(HWGROUP(drive), 0); - spin_unlock_irqrestore(&io_request_lock, flags); -} - -/* Note: We support only master drives for now. This will have to be - * improved if we want to handle sleep on the iMacDV where the CD-ROM - * is a slave - */ -static int __pmac -idepmac_notify_sleep(struct pmu_sleep_notifier *self, int when) -{ - int i, ret; - unsigned long base; - int big_delay; - - switch (when) { - case PBOOK_SLEEP_REQUEST: - break; - case PBOOK_SLEEP_REJECT: - break; - case PBOOK_SLEEP_NOW: - for (i = 0; i < pmac_ide_count; ++i) { - ide_hwif_t *hwif; - int dn; - - if ((base = pmac_ide[i].regbase) == 0) - continue; - - hwif = &ide_hwifs[i]; - for (dn=0; dndrives[dn].present) - continue; - idepmac_sleep_drive(&hwif->drives[dn], i, base); - } - /* Disable irq during sleep */ - disable_irq(pmac_ide[i].irq); - - /* Check if this is a media bay with an IDE device or not - * a media bay. - */ - ret = check_media_bay_by_base(base, MB_CD); - if ((ret == 0) || (ret == -ENODEV)) - idepmac_sleep_interface(i, base, (ret == 0)); - } - break; - case PBOOK_WAKE: - big_delay = 0; - for (i = 0; i < pmac_ide_count; ++i) { - - if ((base = pmac_ide[i].regbase) == 0) - continue; - - /* Make sure we have sane timings */ - sanitize_timings(i); - - /* Check if this is a media bay with an IDE device or not - * a media bay - */ - ret = check_media_bay_by_base(base, MB_CD); - if ((ret == 0) || (ret == -ENODEV)) { - idepmac_wake_interface(i, base, (ret == 0)); - big_delay = 1; - } - - } - /* Let hardware get up to speed */ - if (big_delay) - mdelay(IDE_WAKEUP_DELAY_MS); - - for (i = 0; i < pmac_ide_count; ++i) { - ide_hwif_t *hwif; - int used_dma, dn; - int irq_on = 0; - - if ((base = pmac_ide[i].regbase) == 0) - continue; - - hwif = &ide_hwifs[i]; - for (dn=0; dndrives[dn]; - if (!drive->present) - continue; - /* We don't have re-configured DMA yet */ - used_dma = drive->using_dma; - drive->using_dma = 0; - idepmac_wake_drive(drive, base); - if (!irq_on) { - enable_irq(pmac_ide[i].irq); - irq_on = 1; - } - idepmac_wake_device(drive, used_dma); - } - if (!irq_on) - enable_irq(pmac_ide[i].irq); - } - break; - } - return PBOOK_SLEEP_OK; -} -#endif /* CONFIG_PMAC_PBOOK */ - -static int __pmac -pmac_ide_notify_reboot(struct notifier_block *this, unsigned long code, void *x) -{ - int i, gotone; - unsigned long base; - - if (code != SYS_HALT && code != SYS_POWER_OFF) - return 0; - - gotone = 0; - for (i = 0; i < pmac_ide_count; ++i) { - ide_hwif_t *hwif; - ide_drive_t *drive; - int unlock = 0; - int dn; - - if ((base = pmac_ide[i].regbase) == 0) - continue; - - hwif = &ide_hwifs[i]; - for (dn=0; dndrives[dn]; - if (drive->present) { - gotone = 1; - /* Wait for HW group to complete operations */ - if (ide_spin_wait_hwgroup(drive)) { - // What can we do here ? Wake drive we had already - // put to sleep and return an error ? - } else { - unlock = 1; - /* Lock HW group */ - HWGROUP(drive)->busy = 1; - - /* Stop the device */ - idepmac_sleep_device(drive, i, base); - } - } - if (unlock) - spin_unlock_irq(&io_request_lock); - } - } - if (gotone) - mdelay(1000); - - return NOTIFY_DONE; -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-pnp.c linux.20pre5-ac2/drivers/ide/ide-pnp.c --- linux.20pre5/drivers/ide/ide-pnp.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-pnp.c 2002-08-29 23:47:56.000000000 +0100 @@ -21,12 +21,6 @@ #include -#ifndef PREPARE_FUNC -#define PREPARE_FUNC(dev) (dev->prepare) -#define ACTIVATE_FUNC(dev) (dev->activate) -#define DEACTIVATE_FUNC(dev) (dev->deactivate) -#endif - #define DEV_IO(dev, index) (dev->resource[index].start) #define DEV_IRQ(dev, index) (dev->irq_resource[index].start) @@ -54,6 +48,7 @@ }; /* Generic initialisation function for ISA PnP IDE interface */ + static int __init pnpide_generic_init(struct pci_dev *dev, int enable) { hw_regs_t hw; @@ -66,13 +61,16 @@ return 1; ide_setup_ports(&hw, (ide_ioreg_t) DEV_IO(dev, 0), - generic_ide_offsets, (ide_ioreg_t) DEV_IO(dev, 1), - 0, NULL, DEV_IRQ(dev, 0)); + generic_ide_offsets, + (ide_ioreg_t) DEV_IO(dev, 1), + 0, NULL, +// generic_pnp_ide_iops, + DEV_IRQ(dev, 0)); index = ide_register_hw(&hw, NULL); if (index != -1) { - printk("ide%d: %s IDE interface\n", index, DEV_NAME(dev)); + printk(KERN_INFO "ide%d: %s IDE interface\n", index, DEV_NAME(dev)); return 0; } @@ -88,7 +86,6 @@ { 0 } }; -#ifdef MODULE #define NR_PNP_DEVICES 8 struct pnp_dev_inst { struct pci_dev *dev; @@ -96,11 +93,11 @@ }; static struct pnp_dev_inst devices[NR_PNP_DEVICES]; static int pnp_ide_dev_idx = 0; -#endif /* * Probe for ISA PnP IDE interfaces. */ + void __init pnpide_init(int enable) { struct pci_dev *dev = NULL; @@ -109,19 +106,18 @@ if (!isapnp_present()) return; -#ifdef MODULE /* Module unload, deactivate all registered devices. */ if (!enable) { int i; for (i = 0; i < pnp_ide_dev_idx; i++) { + dev = devices[i].dev; devices[i].dev_type->init_fn(dev, 0); - - if (DEACTIVATE_FUNC(devices[i].dev)) - DEACTIVATE_FUNC(devices[i].dev)(devices[i].dev); + if (dev->deactivate) + dev->deactivate(dev); } return; } -#endif + for (dev_type = idepnp_devices; dev_type->vendor; dev_type++) { while ((dev = isapnp_find_dev(NULL, dev_type->vendor, dev_type->device, dev))) { @@ -129,20 +125,20 @@ if (dev->active) continue; - if (PREPARE_FUNC(dev) && (PREPARE_FUNC(dev))(dev) < 0) { - printk("ide: %s prepare failed\n", DEV_NAME(dev)); + if (dev->prepare && dev->prepare(dev) < 0) { + printk(KERN_ERR"ide-pnp: %s prepare failed\n", DEV_NAME(dev)); continue; } - if (ACTIVATE_FUNC(dev) && (ACTIVATE_FUNC(dev))(dev) < 0) { - printk("ide: %s activate failed\n", DEV_NAME(dev)); + if (dev->activate && dev->activate(dev) < 0) { + printk(KERN_ERR"ide: %s activate failed\n", DEV_NAME(dev)); continue; } /* Call device initialization function */ if (dev_type->init_fn(dev, 1)) { - if (DEACTIVATE_FUNC(dev)) - DEACTIVATE_FUNC(dev)(dev); + if (dev->deactivate(dev)) + dev->deactivate(dev); } else { #ifdef MODULE /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-probe.c linux.20pre5-ac2/drivers/ide/ide-probe.c --- linux.20pre5/drivers/ide/ide-probe.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-probe.c 2002-09-01 18:19:00.000000000 +0100 @@ -52,34 +52,69 @@ #include #include -static inline void do_identify (ide_drive_t *drive, byte cmd) +/* + * CompactFlash cards and their brethern pretend to be removable + * hard disks, except: + * (1) they never have a slave unit, and + * (2) they don't have doorlock mechanisms. + * This test catches them, and is invoked elsewhere when setting + * appropriate config bits. + * + * FIXME: This treatment is probably applicable for *all* PCMCIA (PC CARD) + * devices, so in linux 2.3.x we should change this to just treat all PCMCIA + * drives this way, and get rid of the model-name tests below + * (too big of an interface change for 2.2.x). + * At that time, we might also consider parameterizing the timeouts and retries, + * since these are MUCH faster than mechanical drives. -M.Lord + */ +inline int drive_is_flashcard (ide_drive_t *drive) { + struct hd_driveid *id = drive->id; + + if (drive->removable && id != NULL) { + if (id->config == 0x848a) return 1; /* CompactFlash */ + if (!strncmp(id->model, "KODAK ATA_FLASH", 15) /* Kodak */ + || !strncmp(id->model, "Hitachi CV", 10) /* Hitachi */ + || !strncmp(id->model, "SunDisk SDCFB", 13) /* SunDisk */ + || !strncmp(id->model, "HAGIWARA HPC", 12) /* Hagiwara */ + || !strncmp(id->model, "LEXAR ATA_FLASH", 15) /* Lexar */ + || !strncmp(id->model, "ATA_FLASH", 9)) /* Simple Tech */ + { + return 1; /* yes, it is a flash memory card */ + } + } + return 0; /* no, it is not a flash memory card */ +} + +static inline void do_identify (ide_drive_t *drive, u8 cmd) +{ + ide_hwif_t *hwif = HWIF(drive); int bswap = 1; struct hd_driveid *id; - id = drive->id = kmalloc (SECTOR_WORDS*4, GFP_ATOMIC); /* called with interrupts disabled! */ + /* called with interrupts disabled! */ + id = drive->id = kmalloc(SECTOR_WORDS*4, GFP_ATOMIC); if (!id) { - printk(KERN_WARNING "(ide-probe::do_identify) Out of memory.\n"); + printk(KERN_WARNING "(ide-probe::do_identify) " + "Out of memory.\n"); goto err_kmalloc; } + /* read 512 bytes of id info */ + hwif->ata_input_data(drive, id, SECTOR_WORDS); - ide_input_data(drive, id, SECTOR_WORDS); /* read 512 bytes of id info */ - ide__sti(); /* local CPU only */ + local_irq_enable(); ide_fix_driveid(id); - if (id->word156 == 0x4d42) { - printk("%s: drive->id->word156 == 0x%04x \n", drive->name, drive->id->word156); - } - if (!drive->forced_lun) drive->last_lun = id->last_lun & 0x7; + #if defined (CONFIG_SCSI_EATA_DMA) || defined (CONFIG_SCSI_EATA_PIO) || defined (CONFIG_SCSI_EATA) /* * EATA SCSI controllers do a hardware ATA emulation: * Ignore them if there is a driver for them available. */ - if ((id->model[0] == 'P' && id->model[1] == 'M') - || (id->model[0] == 'S' && id->model[1] == 'K')) { + if ((id->model[0] == 'P' && id->model[1] == 'M') || + (id->model[0] == 'S' && id->model[1] == 'K')) { printk("%s: EATA SCSI HBA %.10s\n", drive->name, id->model); goto err_misc; } @@ -93,16 +128,18 @@ if ((id->model[0] == 'N' && id->model[1] == 'E') /* NEC */ || (id->model[0] == 'F' && id->model[1] == 'X') /* Mitsumi */ || (id->model[0] == 'P' && id->model[1] == 'i'))/* Pioneer */ - bswap ^= 1; /* Vertos drives may still be weird */ + /* Vertos drives may still be weird */ + bswap ^= 1; } - ide_fixstring (id->model, sizeof(id->model), bswap); - ide_fixstring (id->fw_rev, sizeof(id->fw_rev), bswap); - ide_fixstring (id->serial_no, sizeof(id->serial_no), bswap); + ide_fixstring(id->model, sizeof(id->model), bswap); + ide_fixstring(id->fw_rev, sizeof(id->fw_rev), bswap); + ide_fixstring(id->serial_no, sizeof(id->serial_no), bswap); if (strstr(id->model, "E X A B Y T E N E S T")) goto err_misc; - id->model[sizeof(id->model)-1] = '\0'; /* we depend on this a lot! */ + /* we depend on this a lot! */ + id->model[sizeof(id->model)-1] = '\0'; printk("%s: %s, ", drive->name, id->model); drive->present = 1; @@ -110,10 +147,10 @@ * Check for an ATAPI device */ if (cmd == WIN_PIDENTIFY) { - byte type = (id->config >> 8) & 0x1f; + u8 type = (id->config >> 8) & 0x1f; printk("ATAPI "); #ifdef CONFIG_BLK_DEV_PDC4030 - if (HWIF(drive)->channel == 1 && HWIF(drive)->chipset == ide_pdc4030) { + if (hwif->channel == 1 && hwif->chipset == ide_pdc4030) { printk(" -- not supported on 2nd Promise port\n"); goto err_misc; } @@ -121,19 +158,23 @@ switch (type) { case ide_floppy: if (!strstr(id->model, "CD-ROM")) { - if (!strstr(id->model, "oppy") && !strstr(id->model, "poyp") && !strstr(id->model, "ZIP")) + if (!strstr(id->model, "oppy") && + !strstr(id->model, "poyp") && + !strstr(id->model, "ZIP")) printk("cdrom or floppy?, assuming "); if (drive->media != ide_cdrom) { printk ("FLOPPY"); break; } } - type = ide_cdrom; /* Early cdrom models used zero */ + /* Early cdrom models used zero */ + type = ide_cdrom; case ide_cdrom: drive->removable = 1; #ifdef CONFIG_PPC /* kludge for Apple PowerBook internal zip */ - if (!strstr(id->model, "CD-ROM") && strstr(id->model, "ZIP")) { + if (!strstr(id->model, "CD-ROM") && + strstr(id->model, "ZIP")) { printk ("FLOPPY"); type = ide_floppy; break; @@ -164,18 +205,21 @@ drive->removable = 1; /* * Prevent long system lockup probing later for non-existant - * slave drive if the hwif is actually a flash memory card of some variety: + * slave drive if the hwif is actually a flash memory card of + * some variety: */ + drive->is_flash = 0; if (drive_is_flashcard(drive)) { - ide_drive_t *mate = &HWIF(drive)->drives[1^drive->select.b.unit]; + ide_drive_t *mate = &hwif->drives[1^drive->select.b.unit]; if (!mate->ata_flash) { mate->present = 0; mate->noprobe = 1; } + drive->is_flash = 1; } drive->media = ide_disk; - printk("ATA DISK drive\n"); - QUIRK_LIST(HWIF(drive),drive); + printk("%s DISK drive\n", (drive->is_flash) ? "CFA" : "ATA" ); + QUIRK_LIST(drive); return; err_misc: @@ -195,95 +239,117 @@ * 1 device timed-out (no response to identify request) * 2 device aborted the command (refused to identify itself) */ -static int actual_try_to_identify (ide_drive_t *drive, byte cmd) +static int actual_try_to_identify (ide_drive_t *drive, u8 cmd) { + ide_hwif_t *hwif = HWIF(drive); int rc; ide_ioreg_t hd_status; unsigned long timeout; - byte s, a; + u8 s = 0, a = 0; if (IDE_CONTROL_REG) { /* take a deep breath */ ide_delay_50ms(); - a = IN_BYTE(IDE_ALTSTATUS_REG); - s = IN_BYTE(IDE_STATUS_REG); + a = hwif->INB(IDE_ALTSTATUS_REG); + s = hwif->INB(IDE_STATUS_REG); if ((a ^ s) & ~INDEX_STAT) { - printk("%s: probing with STATUS(0x%02x) instead of ALTSTATUS(0x%02x)\n", drive->name, s, a); - hd_status = IDE_STATUS_REG; /* ancient Seagate drives, broken interfaces */ + printk("%s: probing with STATUS(0x%02x) instead of " + "ALTSTATUS(0x%02x)\n", drive->name, s, a); + /* ancient Seagate drives, broken interfaces */ + hd_status = IDE_STATUS_REG; } else { - hd_status = IDE_ALTSTATUS_REG; /* use non-intrusive polling */ + /* use non-intrusive polling */ + hd_status = IDE_ALTSTATUS_REG; } } else { ide_delay_50ms(); hd_status = IDE_STATUS_REG; } - /* set features register for atapi identify command to be sure of reply */ + /* set features register for atapi + * identify command to be sure of reply + */ if ((cmd == WIN_PIDENTIFY)) - OUT_BYTE(0,IDE_FEATURE_REG); /* disable dma & overlap */ + /* disable dma & overlap */ + hwif->OUTB(0, IDE_FEATURE_REG); -#if CONFIG_BLK_DEV_PDC4030 - if (HWIF(drive)->chipset == ide_pdc4030) { - /* DC4030 hosted drives need their own identify... */ - extern int pdc4030_identify(ide_drive_t *); - if (pdc4030_identify(drive)) { + if (hwif->identify != NULL) { + if (hwif->identify(drive)) return 1; - } - } else -#endif /* CONFIG_BLK_DEV_PDC4030 */ - OUT_BYTE(cmd,IDE_COMMAND_REG); /* ask drive for ID */ + } else { + /* ask drive for ID */ + hwif->OUTB(cmd, IDE_COMMAND_REG); + } timeout = ((cmd == WIN_IDENTIFY) ? WAIT_WORSTCASE : WAIT_PIDENTIFY) / 2; timeout += jiffies; do { - if (0 < (signed long)(jiffies - timeout)) { - return 1; /* drive timed-out */ + if (time_after(jiffies, timeout)) { + /* drive timed-out */ + return 1; } - ide_delay_50ms(); /* give drive a breather */ - } while (IN_BYTE(hd_status) & BUSY_STAT); + /* give drive a breather */ + ide_delay_50ms(); + } while ((hwif->INB(hd_status)) & BUSY_STAT); - ide_delay_50ms(); /* wait for IRQ and DRQ_STAT */ - if (OK_STAT(GET_STAT(),DRQ_STAT,BAD_R_STAT)) { + /* wait for IRQ and DRQ_STAT */ + ide_delay_50ms(); + if (OK_STAT((hwif->INB(IDE_STATUS_REG)), DRQ_STAT, BAD_R_STAT)) { unsigned long flags; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only; some systems need this */ - do_identify(drive, cmd); /* drive returned ID */ - rc = 0; /* drive responded with ID */ - (void) GET_STAT(); /* clear drive IRQ */ - __restore_flags(flags); /* local CPU only */ - } else - rc = 2; /* drive refused ID */ + + /* local CPU only; some systems need this */ + local_irq_save(flags); + /* drive returned ID */ + do_identify(drive, cmd); + /* drive responded with ID */ + rc = 0; + /* clear drive IRQ */ + (void) hwif->INB(IDE_STATUS_REG); + local_irq_restore(flags); + } else { + /* drive refused ID */ + rc = 2; + } return rc; } -static int try_to_identify (ide_drive_t *drive, byte cmd) +static int try_to_identify (ide_drive_t *drive, u8 cmd) { + ide_hwif_t *hwif = HWIF(drive); int retval; int autoprobe = 0; unsigned long cookie = 0; - if (IDE_CONTROL_REG && !HWIF(drive)->irq) { + if (IDE_CONTROL_REG && !hwif->irq) { autoprobe = 1; cookie = probe_irq_on(); - OUT_BYTE(drive->ctl,IDE_CONTROL_REG); /* enable device irq */ + /* enable device irq */ + hwif->OUTB(drive->ctl, IDE_CONTROL_REG); } retval = actual_try_to_identify(drive, cmd); if (autoprobe) { int irq; - OUT_BYTE(drive->ctl|2,IDE_CONTROL_REG); /* mask device irq */ - (void) GET_STAT(); /* clear drive IRQ */ + /* mask device irq */ + hwif->OUTB(drive->ctl|2, IDE_CONTROL_REG); + /* clear drive IRQ */ + (void) hwif->INB(IDE_STATUS_REG); udelay(5); irq = probe_irq_off(cookie); - if (!HWIF(drive)->irq) { + if (!hwif->irq) { if (irq > 0) { - HWIF(drive)->irq = irq; - } else { /* Mmmm.. multiple IRQs.. don't know which was ours */ - printk("%s: IRQ probe failed (0x%lx)\n", drive->name, cookie); + hwif->irq = irq; + } else { + /* Mmmm.. multiple IRQs.. + * don't know which was ours + */ + printk("%s: IRQ probe failed (0x%lx)\n", + drive->name, cookie); #ifdef CONFIG_BLK_DEV_CMD640 #ifdef CMD640_DUMP_REGS - if (HWIF(drive)->chipset == ide_cmd640) { - printk("%s: Hmmm.. probably a driver problem.\n", drive->name); + if (hwif->chipset == ide_cmd640) { + printk("%s: Hmmm.. probably a driver " + "problem.\n", drive->name); CMD640_DUMP_REGS; } #endif /* CMD640_DUMP_REGS */ @@ -311,11 +377,13 @@ * 3 bad status from device (possible for ATAPI drives) * 4 probe was not attempted because failure was obvious */ -static int do_probe (ide_drive_t *drive, byte cmd) +static int do_probe (ide_drive_t *drive, u8 cmd) { int rc; ide_hwif_t *hwif = HWIF(drive); - if (drive->present) { /* avoid waiting for inappropriate probes */ + + if (drive->present) { + /* avoid waiting for inappropriate probes */ if ((drive->media != ide_disk) && (cmd == WIN_IDENTIFY)) return 4; } @@ -324,44 +392,64 @@ drive->name, drive->present, drive->media, (cmd == WIN_IDENTIFY) ? "ATA" : "ATAPI"); #endif - ide_delay_50ms(); /* needed for some systems (e.g. crw9624 as drive0 with disk as slave) */ - SELECT_DRIVE(hwif,drive); + + /* needed for some systems + * (e.g. crw9624 as drive0 with disk as slave) + */ ide_delay_50ms(); - if (IN_BYTE(IDE_SELECT_REG) != drive->select.all && !drive->present) { + SELECT_DRIVE(drive); + ide_delay_50ms(); + if (hwif->INB(IDE_SELECT_REG) != drive->select.all && !drive->present) { if (drive->select.b.unit != 0) { - SELECT_DRIVE(hwif,&hwif->drives[0]); /* exit with drive0 selected */ - ide_delay_50ms(); /* allow BUSY_STAT to assert & clear */ + /* exit with drive0 selected */ + SELECT_DRIVE(&hwif->drives[0]); + /* allow BUSY_STAT to assert & clear */ + ide_delay_50ms(); } - return 3; /* no i/f present: mmm.. this should be a 4 -ml */ + /* no i/f present: mmm.. this should be a 4 -ml */ + return 3; } - if (OK_STAT(GET_STAT(),READY_STAT,BUSY_STAT) - || drive->present || cmd == WIN_PIDENTIFY) - { - if ((rc = try_to_identify(drive,cmd))) /* send cmd and wait */ - rc = try_to_identify(drive,cmd); /* failed: try again */ + if (OK_STAT((hwif->INB(IDE_STATUS_REG)), READY_STAT, BUSY_STAT) || + drive->present || cmd == WIN_PIDENTIFY) { + /* send cmd and wait */ + if ((rc = try_to_identify(drive, cmd))) { + /* failed: try again */ + rc = try_to_identify(drive,cmd); + } + if (hwif->INB(IDE_STATUS_REG) == (BUSY_STAT|READY_STAT)) + return 4; + if (rc == 1 && cmd == WIN_PIDENTIFY && drive->autotune != 2) { unsigned long timeout; - printk("%s: no response (status = 0x%02x), resetting drive\n", drive->name, GET_STAT()); + printk("%s: no response (status = 0x%02x), " + "resetting drive\n", drive->name, + hwif->INB(IDE_STATUS_REG)); ide_delay_50ms(); - OUT_BYTE (drive->select.all, IDE_SELECT_REG); + hwif->OUTB(drive->select.all, IDE_SELECT_REG); ide_delay_50ms(); - OUT_BYTE(WIN_SRST, IDE_COMMAND_REG); + hwif->OUTB(WIN_SRST, IDE_COMMAND_REG); timeout = jiffies; - while ((GET_STAT() & BUSY_STAT) && time_before(jiffies, timeout + WAIT_WORSTCASE)) + while (((hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && + time_before(jiffies, timeout + WAIT_WORSTCASE)) ide_delay_50ms(); rc = try_to_identify(drive, cmd); } if (rc == 1) - printk("%s: no response (status = 0x%02x)\n", drive->name, GET_STAT()); - (void) GET_STAT(); /* ensure drive irq is clear */ + printk("%s: no response (status = 0x%02x)\n", + drive->name, hwif->INB(IDE_STATUS_REG)); + /* ensure drive irq is clear */ + (void) hwif->INB(IDE_STATUS_REG); } else { - rc = 3; /* not present or maybe ATAPI */ + /* not present or maybe ATAPI */ + rc = 3; } if (drive->select.b.unit != 0) { - SELECT_DRIVE(hwif,&hwif->drives[0]); /* exit with drive0 selected */ + /* exit with drive0 selected */ + SELECT_DRIVE(&hwif->drives[0]); ide_delay_50ms(); - (void) GET_STAT(); /* ensure drive irq is clear */ + /* ensure drive irq is clear */ + (void) hwif->INB(IDE_STATUS_REG); } return rc; } @@ -371,12 +459,13 @@ */ static void enable_nest (ide_drive_t *drive) { + ide_hwif_t *hwif = HWIF(drive); unsigned long timeout; - printk("%s: enabling %s -- ", HWIF(drive)->name, drive->id->model); - SELECT_DRIVE(HWIF(drive), drive); + printk("%s: enabling %s -- ", hwif->name, drive->id->model); + SELECT_DRIVE(drive); ide_delay_50ms(); - OUT_BYTE(EXABYTE_ENABLE_NEST, IDE_COMMAND_REG); + hwif->OUTB(EXABYTE_ENABLE_NEST, IDE_COMMAND_REG); timeout = jiffies + WAIT_WORSTCASE; do { if (time_after(jiffies, timeout)) { @@ -384,14 +473,20 @@ return; } ide_delay_50ms(); - } while (GET_STAT() & BUSY_STAT); + } while ((hwif->INB(IDE_STATUS_REG)) & BUSY_STAT); + ide_delay_50ms(); - if (!OK_STAT(GET_STAT(), 0, BAD_STAT)) - printk("failed (status = 0x%02x)\n", GET_STAT()); - else + + if (!OK_STAT((hwif->INB(IDE_STATUS_REG)), 0, BAD_STAT)) { + printk("failed (status = 0x%02x)\n", hwif->INB(IDE_STATUS_REG)); + } else { printk("success\n"); - if (do_probe(drive, WIN_IDENTIFY) >= 2) { /* if !(success||timed-out) */ - (void) do_probe(drive, WIN_PIDENTIFY); /* look for ATAPI device */ + } + + /* if !(success||timed-out) */ + if (do_probe(drive, WIN_IDENTIFY) >= 2) { + /* look for ATAPI device */ + (void) do_probe(drive, WIN_PIDENTIFY); } } @@ -401,102 +496,99 @@ * Returns: 0 no device was found * 1 device was found (note: drive->present might still be 0) */ -static inline byte probe_for_drive (ide_drive_t *drive) +static inline u8 probe_for_drive (ide_drive_t *drive) { - if (drive->noprobe) /* skip probing? */ + /* skip probing? */ + if (drive->noprobe) return drive->present; - if (do_probe(drive, WIN_IDENTIFY) >= 2) { /* if !(success||timed-out) */ - (void) do_probe(drive, WIN_PIDENTIFY); /* look for ATAPI device */ + + /* if !(success||timed-out) */ + if (do_probe(drive, WIN_IDENTIFY) >= 2) { + /* look for ATAPI device */ + (void) do_probe(drive, WIN_PIDENTIFY); } if (drive->id && strstr(drive->id->model, "E X A B Y T E N E S T")) enable_nest(drive); if (!drive->present) - return 0; /* drive not found */ - if (drive->id == NULL) { /* identification failed? */ + /* drive not found */ + return 0; + + /* identification failed? */ + if (drive->id == NULL) { if (drive->media == ide_disk) { - printk ("%s: non-IDE drive, CHS=%d/%d/%d\n", - drive->name, drive->cyl, drive->head, drive->sect); + printk("%s: non-IDE drive, CHS=%d/%d/%d\n", + drive->name, drive->cyl, + drive->head, drive->sect); } else if (drive->media == ide_cdrom) { printk("%s: ATAPI cdrom (?)\n", drive->name); } else { - drive->present = 0; /* nuke it */ + /* nuke it */ + drive->present = 0; } } - return 1; /* drive was found */ + /* drive was found */ + return 1; } -/* - * Calculate the region that this interface occupies, - * handling interfaces where the registers may not be - * ordered sanely. We deal with the CONTROL register - * separately. - */ +#define hwif_check_region(addr, num) \ + ((hwif->mmio) ? check_mem_region((addr),(num)) : check_region((addr),(num))) + static int hwif_check_regions (ide_hwif_t *hwif) { - int region_errors = 0; - - hwif->straight8 = 0; - region_errors = ide_check_region(hwif->io_ports[IDE_DATA_OFFSET], 1); - region_errors += ide_check_region(hwif->io_ports[IDE_ERROR_OFFSET], 1); - region_errors += ide_check_region(hwif->io_ports[IDE_NSECTOR_OFFSET], 1); - region_errors += ide_check_region(hwif->io_ports[IDE_SECTOR_OFFSET], 1); - region_errors += ide_check_region(hwif->io_ports[IDE_LCYL_OFFSET], 1); - region_errors += ide_check_region(hwif->io_ports[IDE_HCYL_OFFSET], 1); - region_errors += ide_check_region(hwif->io_ports[IDE_SELECT_OFFSET], 1); - region_errors += ide_check_region(hwif->io_ports[IDE_STATUS_OFFSET], 1); + u32 i = 0; + int addr_errs = 0; + if (hwif->mmio == 2) + return 0; + addr_errs = hwif_check_region(hwif->io_ports[IDE_DATA_OFFSET], 1); + for (i = IDE_ERROR_OFFSET; i <= IDE_STATUS_OFFSET; i++) + addr_errs += hwif_check_region(hwif->io_ports[i], 1); if (hwif->io_ports[IDE_CONTROL_OFFSET]) - region_errors += ide_check_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1); + addr_errs += hwif_check_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1); #if defined(CONFIG_AMIGA) || defined(CONFIG_MAC) if (hwif->io_ports[IDE_IRQ_OFFSET]) - region_errors += ide_check_region(hwif->io_ports[IDE_IRQ_OFFSET], 1); + addr_errs += hwif_check_region(hwif->io_ports[IDE_IRQ_OFFSET], 1); #endif /* (CONFIG_AMIGA) || (CONFIG_MAC) */ - /* - * If any errors are return, we drop the hwif interface. - */ - return(region_errors); + /* If any errors are return, we drop the hwif interface. */ + hwif->straight8 = 0; + return(addr_errs); } +//EXPORT_SYMBOL(hwif_check_regions); + +#define hwif_request_region(addr, num, name) \ + ((hwif->mmio) ? request_mem_region((addr),(num),(name)) : request_region((addr),(num),(name))) + static void hwif_register (ide_hwif_t *hwif) { - if (((unsigned long)hwif->io_ports[IDE_DATA_OFFSET] | 7) == - ((unsigned long)hwif->io_ports[IDE_STATUS_OFFSET])) { - ide_request_region(hwif->io_ports[IDE_DATA_OFFSET], 8, hwif->name); - hwif->straight8 = 1; - goto jump_straight8; - } - - if (hwif->io_ports[IDE_DATA_OFFSET]) - ide_request_region(hwif->io_ports[IDE_DATA_OFFSET], 1, hwif->name); - if (hwif->io_ports[IDE_ERROR_OFFSET]) - ide_request_region(hwif->io_ports[IDE_ERROR_OFFSET], 1, hwif->name); - if (hwif->io_ports[IDE_NSECTOR_OFFSET]) - ide_request_region(hwif->io_ports[IDE_NSECTOR_OFFSET], 1, hwif->name); - if (hwif->io_ports[IDE_SECTOR_OFFSET]) - ide_request_region(hwif->io_ports[IDE_SECTOR_OFFSET], 1, hwif->name); - if (hwif->io_ports[IDE_LCYL_OFFSET]) - ide_request_region(hwif->io_ports[IDE_LCYL_OFFSET], 1, hwif->name); - if (hwif->io_ports[IDE_HCYL_OFFSET]) - ide_request_region(hwif->io_ports[IDE_HCYL_OFFSET], 1, hwif->name); - if (hwif->io_ports[IDE_SELECT_OFFSET]) - ide_request_region(hwif->io_ports[IDE_SELECT_OFFSET], 1, hwif->name); - if (hwif->io_ports[IDE_STATUS_OFFSET]) - ide_request_region(hwif->io_ports[IDE_STATUS_OFFSET], 1, hwif->name); + u32 i = 0; -jump_straight8: + if (hwif->mmio == 2) + return; if (hwif->io_ports[IDE_CONTROL_OFFSET]) - ide_request_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1, hwif->name); + hwif_request_region(hwif->io_ports[IDE_CONTROL_OFFSET], 1, hwif->name); #if defined(CONFIG_AMIGA) || defined(CONFIG_MAC) if (hwif->io_ports[IDE_IRQ_OFFSET]) - ide_request_region(hwif->io_ports[IDE_IRQ_OFFSET], 1, hwif->name); + hwif_request_region(hwif->io_ports[IDE_IRQ_OFFSET], 1, hwif->name); #endif /* (CONFIG_AMIGA) || (CONFIG_MAC) */ + if (((unsigned long)hwif->io_ports[IDE_DATA_OFFSET] | 7) == + ((unsigned long)hwif->io_ports[IDE_STATUS_OFFSET])) { + hwif_request_region(hwif->io_ports[IDE_DATA_OFFSET], 8, hwif->name); + hwif->straight8 = 1; + return; + } + + for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) + hwif_request_region(hwif->io_ports[i], 1, hwif->name); } +//EXPORT_SYMBOL(hwif_register); + /* * This routine only knows how to look for drive units 0 and 1 * on an interface, so any setting of MAX_DRIVES > 2 won't work here. */ -static void probe_hwif (ide_hwif_t *hwif) +void probe_hwif (ide_hwif_t *hwif) { unsigned int unit; unsigned long flags; @@ -506,8 +598,7 @@ #ifdef CONFIG_BLK_DEV_IDE if (hwif->io_ports[IDE_DATA_OFFSET] == HD_DATA) { extern void probe_cmos_for_drives(ide_hwif_t *); - - probe_cmos_for_drives (hwif); + probe_cmos_for_drives(hwif); } #endif @@ -516,61 +607,91 @@ (hwif->chipset != ide_pdc4030 || hwif->channel == 0) && #endif /* CONFIG_BLK_DEV_PDC4030 */ (hwif_check_regions(hwif))) { - int msgout = 0; + u16 msgout = 0; for (unit = 0; unit < MAX_DRIVES; ++unit) { ide_drive_t *drive = &hwif->drives[unit]; if (drive->present) { drive->present = 0; - printk("%s: ERROR, PORTS ALREADY IN USE\n", drive->name); + printk("%s: ERROR, PORTS ALREADY IN USE\n", + drive->name); msgout = 1; } } if (!msgout) - printk("%s: ports already in use, skipping probe\n", hwif->name); + printk("%s: ports already in use, skipping probe\n", + hwif->name); return; } - __save_flags(flags); /* local CPU only */ - __sti(); /* local CPU only; needed for jiffies and irq probing */ + if (hwif->hw.ack_intr && hwif->irq) + disable_irq(hwif->irq); + + local_irq_set(flags); /* * Second drive should only exist if first drive was found, * but a lot of cdrom drives are configured as single slaves. */ for (unit = 0; unit < MAX_DRIVES; ++unit) { ide_drive_t *drive = &hwif->drives[unit]; - (void) probe_for_drive (drive); + hwif->drives[unit].dn = ((hwif->channel ? 2 : 0) + unit); + (void) probe_for_drive(drive); if (drive->present && !hwif->present) { hwif->present = 1; - if (hwif->chipset != ide_4drives || !hwif->mate->present) { + if (hwif->chipset != ide_4drives || + !hwif->mate->present) { hwif_register(hwif); } } } if (hwif->io_ports[IDE_CONTROL_OFFSET] && hwif->reset) { unsigned long timeout = jiffies + WAIT_WORSTCASE; - byte stat; + u8 stat; printk("%s: reset\n", hwif->name); - OUT_BYTE(12, hwif->io_ports[IDE_CONTROL_OFFSET]); + hwif->OUTB(12, hwif->io_ports[IDE_CONTROL_OFFSET]); udelay(10); - OUT_BYTE(8, hwif->io_ports[IDE_CONTROL_OFFSET]); + hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]); do { ide_delay_50ms(); - stat = IN_BYTE(hwif->io_ports[IDE_STATUS_OFFSET]); - } while ((stat & BUSY_STAT) && 0 < (signed long)(timeout - jiffies)); + stat = hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]); + } while ((stat & BUSY_STAT) && time_after(timeout, jiffies)); } - __restore_flags(flags); /* local CPU only */ + local_irq_restore(flags); + if (hwif->hw.ack_intr && hwif->irq) + enable_irq(hwif->irq); + for (unit = 0; unit < MAX_DRIVES; ++unit) { ide_drive_t *drive = &hwif->drives[unit]; if (drive->present) { - ide_tuneproc_t *tuneproc = HWIF(drive)->tuneproc; - if (tuneproc != NULL && drive->autotune == 1) - tuneproc(drive, 255); /* auto-tune PIO mode */ + if (hwif->tuneproc != NULL && drive->autotune == 1) + /* auto-tune PIO mode */ + hwif->tuneproc(drive, 255); + /* + * MAJOR HACK BARF :-/ + * + * FIXME: chipsets own this cruft! + */ + /* + * Move here to prevent module loading clashing. + */ + // drive->autodma = hwif->autodma; + if ((drive->autotune != 2) && (hwif->ide_dma_check)) { + /* + * Force DMAing for the beginning of the check. + * Some chipsets appear to do interesting + * things, if not checked and cleared. + * PARANOIA!!! + */ + hwif->ide_dma_off_quietly(drive); + hwif->ide_dma_check(drive); + } } } } +EXPORT_SYMBOL(probe_hwif); + #if MAX_HWIFS > 1 /* * save_match() is used to simplify logic in init_irq() below. @@ -583,18 +704,20 @@ * * This routine detects and reports such situations, but does not fix them. */ -static void save_match (ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match) +void save_match (ide_hwif_t *hwif, ide_hwif_t *new, ide_hwif_t **match) { ide_hwif_t *m = *match; if (m && m->hwgroup && m->hwgroup != new->hwgroup) { if (!new->hwgroup) return; - printk("%s: potential irq problem with %s and %s\n", hwif->name, new->name, m->name); + printk("%s: potential irq problem with %s and %s\n", + hwif->name, new->name, m->name); } if (!m || m->irq != hwif->irq) /* don't undo a prior perfect match */ *match = new; } +EXPORT_SYMBOL(save_match); #endif /* MAX_HWIFS > 1 */ /* @@ -614,6 +737,7 @@ } } +#undef __IRQ_HELL_SPIN /* * This routine sets up the irq for an ide interface, and creates a new * hwgroup for the irq/hwif if none was previously assigned. @@ -627,20 +751,26 @@ * but anything else has led to problems on some machines. We re-enable * interrupts as much as we can safely do in most places. */ -static int init_irq (ide_hwif_t *hwif) +int init_irq (ide_hwif_t *hwif) { unsigned long flags; unsigned int index; ide_hwgroup_t *hwgroup, *new_hwgroup; ide_hwif_t *match = NULL; - +#if 0 + /* Allocate the buffer and no sleep allowed */ + new_hwgroup = kmalloc(sizeof(ide_hwgroup_t),GFP_ATOMIC); +#else /* Allocate the buffer and potentially sleep first */ - new_hwgroup = kmalloc(sizeof(ide_hwgroup_t),GFP_KERNEL); +#endif - save_flags(flags); /* all CPUs */ - cli(); /* all CPUs */ +#ifndef __IRQ_HELL_SPIN + save_and_cli(flags); +#else + spin_lock_irqsave(&io_request_lock, flags); +#endif hwif->hwgroup = NULL; #if MAX_HWIFS > 1 @@ -652,7 +782,8 @@ if (h->hwgroup) { /* scan only initialized hwif's */ if (hwif->irq == h->irq) { hwif->sharing_irq = h->sharing_irq = 1; - if (hwif->chipset != ide_pci || h->chipset != ide_pci) { + if (hwif->chipset != ide_pci || + h->chipset != ide_pci) { save_match(hwif, h, &match); } } @@ -677,7 +808,11 @@ } else { hwgroup = new_hwgroup; if (!hwgroup) { - restore_flags(flags); /* all CPUs */ +#ifndef __IRQ_HELL_SPIN + restore_flags(flags); +#else + spin_unlock_irqrestore(&io_request_lock, flags); +#endif return 1; } memset(hwgroup, 0, sizeof(ide_hwgroup_t)); @@ -702,12 +837,17 @@ #endif /* CONFIG_IDEPCI_SHARE_IRQ */ if (hwif->io_ports[IDE_CONTROL_OFFSET]) - OUT_BYTE(0x08, hwif->io_ports[IDE_CONTROL_OFFSET]); /* clear nIEN */ + /* clear nIEN */ + hwif->OUTB(0x08, hwif->io_ports[IDE_CONTROL_OFFSET]); - if (ide_request_irq(hwif->irq, &ide_intr, sa, hwif->name, hwgroup)) { + if (request_irq(hwif->irq, &ide_intr, sa, hwif->name, hwgroup)) { if (!match) kfree(hwgroup); - restore_flags(flags); /* all CPUs */ +#ifndef __IRQ_HELL_SPIN + restore_flags(flags); +#else + spin_unlock_irqrestore(&io_request_lock, flags); +#endif return 1; } } @@ -735,10 +875,16 @@ printk("%s : Adding missed hwif to hwgroup!!\n", hwif->name); #endif } - restore_flags(flags); /* all CPUs; safe now that hwif->hwgroup is set up */ + + /* all CPUs; safe now that hwif->hwgroup is set up */ +#ifndef __IRQ_HELL_SPIN + restore_flags(flags); +#else + spin_unlock_irqrestore(&io_request_lock, flags); +#endif #if !defined(__mc68000__) && !defined(CONFIG_APUS) && !defined(__sparc__) - printk("%s at 0x%03x-0x%03x,0x%03x on irq %d", hwif->name, + printk("%s at 0x%03lx-0x%03lx,0x%03lx on irq %d", hwif->name, hwif->io_ports[IDE_DATA_OFFSET], hwif->io_ports[IDE_DATA_OFFSET]+7, hwif->io_ports[IDE_CONTROL_OFFSET], hwif->irq); @@ -748,7 +894,7 @@ hwif->io_ports[IDE_DATA_OFFSET]+7, hwif->io_ports[IDE_CONTROL_OFFSET], __irq_itoa(hwif->irq)); #else - printk("%s at %p on irq 0x%08x", hwif->name, + printk("%s at %x on irq 0x%08x", hwif->name, hwif->io_ports[IDE_DATA_OFFSET], hwif->irq); #endif /* __mc68000__ && CONFIG_APUS */ if (match) @@ -758,6 +904,8 @@ return 0; } +EXPORT_SYMBOL(init_irq); + /* * init_gendisk() (as opposed to ide_geninit) is called for each major device, * after probing for drives, to allocate partition tables and other data @@ -771,34 +919,27 @@ int *bs, *max_sect, *max_ra; extern devfs_handle_t ide_devfs_handle; -#if 1 units = MAX_DRIVES; -#else - /* figure out maximum drive number on the interface */ - for (units = MAX_DRIVES; units > 0; --units) { - if (hwif->drives[units-1].present) - break; - } -#endif minors = units * (1<sizes = kmalloc (minors * sizeof(int), GFP_KERNEL); + memset(gd, 0, sizeof(struct gendisk)); + + gd->sizes = kmalloc(minors * sizeof(int), GFP_KERNEL); if (!gd->sizes) goto err_kmalloc_gd_sizes; - gd->part = kmalloc (minors * sizeof(struct hd_struct), GFP_KERNEL); + gd->part = kmalloc(minors * sizeof(struct hd_struct), GFP_KERNEL); if (!gd->part) goto err_kmalloc_gd_part; - bs = kmalloc (minors*sizeof(int), GFP_KERNEL); + bs = kmalloc(minors*sizeof(int), GFP_KERNEL); if (!bs) goto err_kmalloc_bs; - max_sect = kmalloc (minors*sizeof(int), GFP_KERNEL); + max_sect = kmalloc(minors*sizeof(int), GFP_KERNEL); if (!max_sect) goto err_kmalloc_max_sect; - max_ra = kmalloc (minors*sizeof(int), GFP_KERNEL); + max_ra = kmalloc(minors*sizeof(int), GFP_KERNEL); if (!max_ra) goto err_kmalloc_max_ra; @@ -813,55 +954,49 @@ /* * IDE can do up to 128K per request == 256 */ - *max_sect++ = ((hwif->chipset == ide_pdc4030) ? 127 : 128); + *max_sect++ = ((hwif->rqsize) ? hwif->rqsize : 128); *max_ra++ = vm_max_readahead; } for (unit = 0; unit < units; ++unit) hwif->drives[unit].part = &gd->part[unit << PARTN_BITS]; - gd->major = hwif->major; /* our major device number */ - gd->major_name = IDE_MAJOR_NAME; /* treated special in genhd.c */ - gd->minor_shift = PARTN_BITS; /* num bits for partitions */ - gd->max_p = 1<nr_real = units; /* current num real drives */ - gd->real_devices= hwif; /* ptr to internal data */ - gd->next = NULL; /* linked list of major devs */ - gd->fops = ide_fops; /* file operations */ - gd->de_arr = kmalloc (sizeof *gd->de_arr * units, GFP_KERNEL); - gd->flags = kmalloc (sizeof *gd->flags * units, GFP_KERNEL); + /* our major device number */ + gd->major = hwif->major; + /* treated special in genhd.c */ + gd->major_name = IDE_MAJOR_NAME; + /* num bits for partitions */ + gd->minor_shift = PARTN_BITS; + /* 1 + max partitions / drive */ + gd->max_p = 1<nr_real = units; + /* ptr to internal data */ + gd->real_devices= hwif; + /* linked list of major devs */ + gd->next = NULL; + /* file operations */ + gd->fops = ide_fops; + gd->de_arr = kmalloc(sizeof *gd->de_arr * units, GFP_KERNEL); + gd->flags = kmalloc(sizeof *gd->flags * units, GFP_KERNEL); if (gd->de_arr) - memset (gd->de_arr, 0, sizeof *gd->de_arr * units); + memset(gd->de_arr, 0, sizeof *gd->de_arr * units); if (gd->flags) - memset (gd->flags, 0, sizeof *gd->flags * units); + memset(gd->flags, 0, sizeof *gd->flags * units); hwif->gd = gd; add_gendisk(gd); for (unit = 0; unit < units; ++unit) { -#if 1 char name[64]; ide_add_generic_settings(hwif->drives + unit); - hwif->drives[unit].dn = ((hwif->channel ? 2 : 0) + unit); +// hwif->drives[unit].dn = ((hwif->channel ? 2 : 0) + unit); sprintf (name, "host%d/bus%d/target%d/lun%d", (hwif->channel && hwif->mate) ? hwif->mate->index : hwif->index, hwif->channel, unit, hwif->drives[unit].lun); if (hwif->drives[unit].present) hwif->drives[unit].de = devfs_mk_dir(ide_devfs_handle, name, NULL); -#else - if (hwif->drives[unit].present) { - char name[64]; - - ide_add_generic_settings(hwif->drives + unit); - hwif->drives[unit].dn = ((hwif->channel ? 2 : 0) + unit); - sprintf (name, "host%d/bus%d/target%d/lun%d", - (hwif->channel && hwif->mate) ? hwif->mate->index : hwif->index, - hwif->channel, unit, hwif->drives[unit].lun); - hwif->drives[unit].de = - devfs_mk_dir (ide_devfs_handle, name, NULL); - } -#endif } return; @@ -880,7 +1015,9 @@ return; } -static int hwif_init (ide_hwif_t *hwif) +EXPORT_SYMBOL(init_gendisk); + +int hwif_init (ide_hwif_t *hwif) { if (!hwif->present) return 0; @@ -893,15 +1030,18 @@ } #ifdef CONFIG_BLK_DEV_HD if (hwif->irq == HD_IRQ && hwif->io_ports[IDE_DATA_OFFSET] != HD_DATA) { - printk("%s: CANNOT SHARE IRQ WITH OLD HARDDISK DRIVER (hd.c)\n", hwif->name); + printk("%s: CANNOT SHARE IRQ WITH OLD " + "HARDDISK DRIVER (hd.c)\n", hwif->name); return (hwif->present = 0); } #endif /* CONFIG_BLK_DEV_HD */ - - hwif->present = 0; /* we set it back to 1 if all is ok below */ + + /* we set it back to 1 if all is ok below */ + hwif->present = 0; if (devfs_register_blkdev (hwif->major, hwif->name, ide_fops)) { - printk("%s: UNABLE TO GET MAJOR NUMBER %d\n", hwif->name, hwif->major); + printk("%s: UNABLE TO GET MAJOR NUMBER %d\n", + hwif->name, hwif->major); return (hwif->present = 0); } @@ -912,14 +1052,15 @@ * this port and try that. */ if (!(hwif->irq = ide_default_irq(hwif->io_ports[IDE_DATA_OFFSET]))) { - printk("%s: Disabled unable to get IRQ %d.\n", hwif->name, i); - (void) unregister_blkdev (hwif->major, hwif->name); + printk("%s: Disabled unable to get IRQ %d.\n", + hwif->name, i); + (void) unregister_blkdev(hwif->major, hwif->name); return (hwif->present = 0); } if (init_irq(hwif)) { printk("%s: probed IRQ %d and default IRQ %d failed.\n", hwif->name, i, hwif->irq); - (void) unregister_blkdev (hwif->major, hwif->name); + (void) unregister_blkdev(hwif->major, hwif->name); return (hwif->present = 0); } printk("%s: probed IRQ %d failed, using default.\n", @@ -942,19 +1083,51 @@ return hwif->present; } +EXPORT_SYMBOL(hwif_init); + void export_ide_init_queue (ide_drive_t *drive) { ide_init_queue(drive); } -byte export_probe_for_drive (ide_drive_t *drive) +EXPORT_SYMBOL(export_ide_init_queue); + +u8 export_probe_for_drive (ide_drive_t *drive) { return probe_for_drive(drive); } -EXPORT_SYMBOL(export_ide_init_queue); EXPORT_SYMBOL(export_probe_for_drive); +#ifndef HWIF_PROBE_CLASSIC_METHOD +int probe_hwif_init (ide_hwif_t *hwif) +{ + hwif->initializing = 1; + probe_hwif(hwif); + hwif_init(hwif); + +#ifndef CLASSIC_BUILTINS_METHOD +# ifndef FAKE_CLASSIC_ATTACH_METHOD +# ifdef DIRECT_HWIF_PROBE_ATTACH_METHOD + if (hwif->present) { + u16 unit = 0; + for (unit = 0; unit < MAX_DRIVES; ++unit) { + ide_drive_t *drive = &hwif->drives[unit]; + if (drive->present) + ide_attach_drive(drive); + } + } +# endif /* DIRECT_HWIF_PROBE_ATTACH_METHOD */ +# endif /* FAKE_CLASSIC_ATTACH_METHOD */ +#endif /* CLASSIC_BUILTINS_METHOD */ + hwif->initializing = 0; + return 0; +} + +EXPORT_SYMBOL(probe_hwif_init); + +#endif /* HWIF_PROBE_CLASSIC_METHOD */ + int ideprobe_init (void); static ide_module_t ideprobe_module = { IDE_PROBE_MODULE, @@ -975,12 +1148,20 @@ /* * Probe for drives in the usual way.. CMOS/BIOS, then poke at ports */ +#ifdef HWIF_PROBE_CLASSIC_METHOD for (index = 0; index < MAX_HWIFS; ++index) if (probe[index]) probe_hwif(&ide_hwifs[index]); + for (index = 0; index < MAX_HWIFS; ++index) if (probe[index]) hwif_init(&ide_hwifs[index]); +#else /* HWIF_PROBE_CLASSIC_METHOD */ + for (index = 0; index < MAX_HWIFS; ++index) + if (probe[index]) + probe_hwif_init(&ide_hwifs[index]); +#endif /* HWIF_PROBE_CLASSIC_METHOD */ + if (!ide_probe) ide_probe = &ideprobe_module; MOD_DEC_USE_COUNT; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-proc.c linux.20pre5-ac2/drivers/ide/ide-proc.c --- linux.20pre5/drivers/ide/ide-proc.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-proc.c 2002-08-29 23:47:56.000000000 +0100 @@ -57,6 +57,9 @@ */ #include +#define __NO_VERSION__ +#include + #include #include #include @@ -74,59 +77,6 @@ #define MIN(a,b) (((a) < (b)) ? (a) : (b)) #endif -#ifdef CONFIG_BLK_DEV_AEC62XX -extern byte aec62xx_proc; -int (*aec62xx_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_AEC62XX */ -#ifdef CONFIG_BLK_DEV_ALI15X3 -extern byte ali_proc; -int (*ali_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_ALI15X3 */ -#ifdef CONFIG_BLK_DEV_AMD74XX -extern byte amd74xx_proc; -int (*amd74xx_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_AMD74XX */ -#ifdef CONFIG_BLK_DEV_CMD64X -extern byte cmd64x_proc; -int (*cmd64x_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_CMD64X */ -#ifdef CONFIG_BLK_DEV_CS5530 -extern byte cs5530_proc; -int (*cs5530_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_CS5530 */ -#ifdef CONFIG_BLK_DEV_HPT34X -extern byte hpt34x_proc; -int (*hpt34x_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_HPT34X */ -#ifdef CONFIG_BLK_DEV_HPT366 -extern byte hpt366_proc; -int (*hpt366_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_HPT366 */ -#ifdef CONFIG_BLK_DEV_PDC202XX -extern byte pdc202xx_proc; -int (*pdc202xx_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_PDC202XX */ -#ifdef CONFIG_BLK_DEV_PIIX -extern byte piix_proc; -int (*piix_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_PIIX */ -#ifdef CONFIG_BLK_DEV_SVWKS -extern byte svwks_proc; -int (*svwks_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_SVWKS */ -#ifdef CONFIG_BLK_DEV_SIS5513 -extern byte sis_proc; -int (*sis_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_SIS5513 */ -#ifdef CONFIG_BLK_DEV_SLC90E66 -extern byte slc90e66_proc; -int (*slc90e66_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_SLC90E66 */ -#ifdef CONFIG_BLK_DEV_VIA82CXXX -extern byte via_proc; -int (*via_display_info)(char *, char **, off_t, int) = NULL; -#endif /* CONFIG_BLK_DEV_VIA82CXXX */ - static int ide_getxdigit(char c) { int digit; @@ -160,6 +110,17 @@ static struct proc_dir_entry * proc_ide_root = NULL; +#ifdef CONFIG_BLK_DEV_IDEPCI +#include +/* + * This is the list of registered PCI chipset driver data structures. + */ +static ide_pci_host_proc_t * ide_pci_host_proc_list; + +#endif /* CONFIG_BLK_DEV_IDEPCI */ + +#undef __PROC_HELL + static int proc_ide_write_config (struct file *file, const char *buffer, unsigned long count, void *data) { @@ -181,7 +142,11 @@ * Do one full pass to verify all parameters, * then do another to actually write the regs. */ +#ifndef __PROC_HELL save_flags(flags); /* all CPUs */ +#else + spin_lock_irqsave(&io_request_lock, flags); +#endif do { const char *p; if (for_real) { @@ -190,15 +155,32 @@ ide_hwgroup_t *mategroup = NULL; if (hwif->mate && hwif->mate->hwgroup) mategroup = (ide_hwgroup_t *)(hwif->mate->hwgroup); +#ifndef __PROC_HELL cli(); /* all CPUs; ensure all writes are done together */ - while (mygroup->busy || (mategroup && mategroup->busy)) { +#else + spin_lock_irqsave(&io_request_lock, flags); +#endif + while (mygroup->busy || + (mategroup && mategroup->busy)) { +#ifndef __PROC_HELL sti(); /* all CPUs */ - if (0 < (signed long)(jiffies - timeout)) { +#else + spin_unlock_irqrestore(&io_request_lock, flags); +#endif + if (time_after(jiffies, timeout)) { printk("/proc/ide/%s/config: channel(s) busy, cannot write\n", hwif->name); +#ifndef __PROC_HELL restore_flags(flags); /* all CPUs */ +#else + spin_unlock_irqrestore(&io_request_lock, flags); +#endif return -EBUSY; } +#ifndef __PROC_HELL cli(); /* all CPUs */ +#else + spin_lock_irqsave(&io_request_lock, flags); +#endif } } p = buffer; @@ -213,7 +195,7 @@ break; case 'P': is_pci = 1; #ifdef CONFIG_BLK_DEV_IDEPCI - if (hwif->pci_dev && !IDE_PCI_DEVID_EQ(hwif->pci_devid, IDE_PCI_DEVID_NULL)) + if (hwif->pci_dev && !hwif->pci_dev->vendor) break; #endif /* CONFIG_BLK_DEV_IDEPCI */ msg = "not a PCI device"; @@ -281,7 +263,11 @@ break; } if (rc) { +#ifndef __PROC_HELL restore_flags(flags); /* all CPUs */ +#else + spin_unlock_irqrestore(&io_request_lock, flags); +#endif printk("proc_ide_write_config: error writing %s at bus %02x dev %02x reg 0x%x value 0x%x\n", msg, dev->bus->number, dev->devfn, reg, val); printk("proc_ide_write_config: error %d\n", rc); @@ -311,11 +297,11 @@ * */ switch (digits) { - case 2: outb(val, reg); + case 2: hwif->OUTB(val, reg); break; - case 4: outw(val, reg); + case 4: hwif->OUTW(val, reg); break; - case 8: outl(val, reg); + case 8: hwif->OUTL(val, reg); break; } #endif /* !__mc68000__ && !CONFIG_APUS */ @@ -323,15 +309,23 @@ } } } while (!for_real++); +#ifndef __PROC_HELL restore_flags(flags); /* all CPUs */ +#else + spin_unlock_irqrestore(&io_request_lock, flags); +#endif return count; parse_error: +#ifndef __PROC_HELL restore_flags(flags); /* all CPUs */ +#else + spin_unlock_irqrestore(&io_request_lock, flags); +#endif printk("parse error\n"); return xx_xx_parse_error(start, startn, msg); } -static int proc_ide_read_config +int proc_ide_read_config (char *page, char **start, off_t off, int count, int *eof, void *data) { char *out = page; @@ -340,20 +334,26 @@ #ifdef CONFIG_BLK_DEV_IDEPCI ide_hwif_t *hwif = (ide_hwif_t *)data; struct pci_dev *dev = hwif->pci_dev; - if (!IDE_PCI_DEVID_EQ(hwif->pci_devid, IDE_PCI_DEVID_NULL) && dev && dev->bus) { + if ((hwif->pci_dev && hwif->pci_dev->vendor) && dev && dev->bus) { int reg = 0; - out += sprintf(out, "pci bus %02x device %02x vid %04x did %04x channel %d\n", - dev->bus->number, dev->devfn, hwif->pci_devid.vid, hwif->pci_devid.did, hwif->channel); + out += sprintf(out, "pci bus %02x device %02x vendor %04x " + "device %04x channel %d\n", + dev->bus->number, dev->devfn, + hwif->pci_dev->vendor, hwif->pci_dev->device, + hwif->channel); do { - byte val; + u8 val; int rc = pci_read_config_byte(dev, reg, &val); if (rc) { - printk("proc_ide_read_config: error %d reading bus %02x dev %02x reg 0x%02x\n", + printk("proc_ide_read_config: error %d reading" + " bus %02x dev %02x reg 0x%02x\n", rc, dev->bus->number, dev->devfn, reg); - out += sprintf(out, "??%c", (++reg & 0xf) ? ' ' : '\n'); + out += sprintf(out, "??%c", + (++reg & 0xf) ? ' ' : '\n'); } else - out += sprintf(out, "%02x%c", val, (++reg & 0xf) ? ' ' : '\n'); + out += sprintf(out, "%02x%c", + val, (++reg & 0xf) ? ' ' : '\n'); } while (reg < 0x100); } else #endif /* CONFIG_BLK_DEV_IDEPCI */ @@ -362,6 +362,7 @@ PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } +EXPORT_SYMBOL(proc_ide_read_config); static int ide_getdigit(char c) { @@ -373,7 +374,7 @@ return digit; } -static int proc_ide_read_drivers +int proc_ide_read_drivers (char *page, char **start, off_t off, int count, int *eof, void *data) { char *out = page; @@ -384,14 +385,17 @@ while (p) { driver = (ide_driver_t *) p->info; if (driver) - out += sprintf(out, "%s version %s\n", driver->name, driver->version); + out += sprintf(out, "%s version %s\n", + driver->name, driver->version); p = p->next; } len = out - page; PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } -static int proc_ide_read_imodel +EXPORT_SYMBOL(proc_ide_read_drivers); + +int proc_ide_read_imodel (char *page, char **start, off_t off, int count, int *eof, void *data) { ide_hwif_t *hwif = (ide_hwif_t *) data; @@ -421,7 +425,9 @@ PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } -static int proc_ide_read_mate +EXPORT_SYMBOL(proc_ide_read_imodel); + +int proc_ide_read_mate (char *page, char **start, off_t off, int count, int *eof, void *data) { ide_hwif_t *hwif = (ide_hwif_t *) data; @@ -434,7 +440,9 @@ PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } -static int proc_ide_read_channel +EXPORT_SYMBOL(proc_ide_read_mate); + +int proc_ide_read_channel (char *page, char **start, off_t off, int count, int *eof, void *data) { ide_hwif_t *hwif = (ide_hwif_t *) data; @@ -446,31 +454,21 @@ PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } -static int proc_ide_get_identify(ide_drive_t *drive, byte *buf) -{ - struct hd_drive_task_hdr taskfile; - struct hd_drive_hob_hdr hobfile; - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - memset(&hobfile, 0, sizeof(struct hd_drive_hob_hdr)); - - taskfile.sector_count = 0x01; - taskfile.command = (drive->media == ide_disk) ? WIN_IDENTIFY : WIN_PIDENTIFY ; - - return ide_wait_taskfile(drive, &taskfile, &hobfile, buf); -} +EXPORT_SYMBOL(proc_ide_read_channel); -static int proc_ide_read_identify +int proc_ide_read_identify (char *page, char **start, off_t off, int count, int *eof, void *data) { ide_drive_t *drive = (ide_drive_t *)data; int len = 0, i = 0; - if (drive && !proc_ide_get_identify(drive, page)) { + if (drive && !taskfile_lib_get_identify(drive, page)) { unsigned short *val = (unsigned short *) page; char *out = ((char *)val) + (SECTOR_WORDS * 4); page = out; do { - out += sprintf(out, "%04x%c", le16_to_cpu(*val), (++i & 7) ? ' ' : '\n'); + out += sprintf(out, "%04x%c", + le16_to_cpu(*val), (++i & 7) ? ' ' : '\n'); val += 1; } while (i < (SECTOR_WORDS * 2)); len = out - page; @@ -480,7 +478,9 @@ PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } -static int proc_ide_read_settings +EXPORT_SYMBOL(proc_ide_read_identify); + +int proc_ide_read_settings (char *page, char **start, off_t off, int count, int *eof, void *data) { ide_drive_t *drive = (ide_drive_t *) data; @@ -510,9 +510,11 @@ PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } +EXPORT_SYMBOL(proc_ide_read_settings); + #define MAX_LEN 30 -static int proc_ide_write_settings +int proc_ide_write_settings (struct file *file, const char *buffer, unsigned long count, void *data) { ide_drive_t *drive = (ide_drive_t *) data; @@ -587,6 +589,8 @@ return -EINVAL; } +EXPORT_SYMBOL(proc_ide_write_settings); + int proc_ide_read_capacity (char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -598,10 +602,12 @@ len = sprintf(page, "(none)\n"); else len = sprintf(page,"%llu\n", - (unsigned long long) ((ide_driver_t *)drive->driver)->capacity(drive)); + (u64) ((ide_driver_t *)drive->driver)->capacity(drive)); PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } +EXPORT_SYMBOL(proc_ide_read_capacity); + int proc_ide_read_geometry (char *page, char **start, off_t off, int count, int *eof, void *data) { @@ -609,24 +615,32 @@ char *out = page; int len; - out += sprintf(out,"physical %d/%d/%d\n", drive->cyl, drive->head, drive->sect); - out += sprintf(out,"logical %d/%d/%d\n", drive->bios_cyl, drive->bios_head, drive->bios_sect); + out += sprintf(out,"physical %d/%d/%d\n", + drive->cyl, drive->head, drive->sect); + out += sprintf(out,"logical %d/%d/%d\n", + drive->bios_cyl, drive->bios_head, drive->bios_sect); + len = out - page; PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } -static int proc_ide_read_dmodel +EXPORT_SYMBOL(proc_ide_read_geometry); + +int proc_ide_read_dmodel (char *page, char **start, off_t off, int count, int *eof, void *data) { ide_drive_t *drive = (ide_drive_t *) data; struct hd_driveid *id = drive->id; int len; - len = sprintf(page, "%.40s\n", (id && id->model[0]) ? (char *)id->model : "(none)"); + len = sprintf(page, "%.40s\n", + (id && id->model[0]) ? (char *)id->model : "(none)"); PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } -static int proc_ide_read_driver +EXPORT_SYMBOL(proc_ide_read_dmodel); + +int proc_ide_read_driver (char *page, char **start, off_t off, int count, int *eof, void *data) { ide_drive_t *drive = (ide_drive_t *) data; @@ -636,11 +650,14 @@ if (!driver) len = sprintf(page, "(none)\n"); else - len = sprintf(page, "%s version %s\n", driver->name, driver->version); + len = sprintf(page, "%s version %s\n", + driver->name, driver->version); PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } -static int proc_ide_write_driver +EXPORT_SYMBOL(proc_ide_read_driver); + +int proc_ide_write_driver (struct file *file, const char *buffer, unsigned long count, void *data) { ide_drive_t *drive = (ide_drive_t *) data; @@ -652,7 +669,9 @@ return count; } -static int proc_ide_read_media +EXPORT_SYMBOL(proc_ide_write_driver); + +int proc_ide_read_media (char *page, char **start, off_t off, int count, int *eof, void *data) { ide_drive_t *drive = (ide_drive_t *) data; @@ -676,6 +695,8 @@ PROC_IDE_READ_RETURN(page,start,off,count,eof,len); } +EXPORT_SYMBOL(proc_ide_read_media); + static ide_proc_entry_t generic_drive_entries[] = { { "driver", S_IFREG|S_IRUGO, proc_ide_read_driver, proc_ide_write_driver }, { "identify", S_IFREG|S_IRUSR, proc_ide_read_identify, NULL }, @@ -702,6 +723,8 @@ } } +EXPORT_SYMBOL(ide_add_proc_entries); + void ide_remove_proc_entries(struct proc_dir_entry *dir, ide_proc_entry_t *p) { if (!dir || !p) @@ -712,7 +735,9 @@ } } -static void create_proc_ide_drives(ide_hwif_t *hwif) +EXPORT_SYMBOL(ide_remove_proc_entries); + +void create_proc_ide_drives(ide_hwif_t *hwif) { int d; struct proc_dir_entry *ent; @@ -742,6 +767,8 @@ } } +EXPORT_SYMBOL(create_proc_ide_drives); + void recreate_proc_ide_device(ide_hwif_t *hwif, ide_drive_t *drive) { struct proc_dir_entry *ent; @@ -769,6 +796,8 @@ } } +EXPORT_SYMBOL(recreate_proc_ide_device); + void destroy_proc_ide_device(ide_hwif_t *hwif, ide_drive_t *drive) { ide_driver_t *driver = drive->driver; @@ -783,19 +812,21 @@ } } +EXPORT_SYMBOL(destroy_proc_ide_device); + void destroy_proc_ide_drives(ide_hwif_t *hwif) { int d; for (d = 0; d < MAX_DRIVES; d++) { ide_drive_t *drive = &hwif->drives[d]; -// ide_driver_t *driver = drive->driver; - if (drive->proc) destroy_proc_ide_device(hwif, drive); } } +EXPORT_SYMBOL(destroy_proc_ide_drives); + static ide_proc_entry_t hwif_entries[] = { { "channel", S_IFREG|S_IRUGO, proc_ide_read_channel, NULL }, { "config", S_IFREG|S_IRUGO|S_IWUSR,proc_ide_read_config, proc_ide_write_config }, @@ -823,7 +854,9 @@ } } -static void destroy_proc_ide_interfaces(void) +EXPORT_SYMBOL(create_proc_ide_interfaces); + +void destroy_proc_ide_interfaces(void) { int h; @@ -844,8 +877,34 @@ } } +EXPORT_SYMBOL(destroy_proc_ide_interfaces); + +#ifdef CONFIG_BLK_DEV_IDEPCI +void ide_pci_register_host_proc (ide_pci_host_proc_t *p) +{ + ide_pci_host_proc_t *tmp; + + if (!p) return; + p->next = NULL; + p->set = 1; + if (ide_pci_host_proc_list) { + tmp = ide_pci_host_proc_list; + while (tmp->next) tmp = tmp->next; + tmp->next = p; + } else + ide_pci_host_proc_list = p; +} + +EXPORT_SYMBOL(ide_pci_register_host_proc); + +#endif /* CONFIG_BLK_DEV_IDEPCI */ + void proc_ide_create(void) { +#ifdef CONFIG_BLK_DEV_IDEPCI + ide_pci_host_proc_t *p = ide_pci_host_proc_list; +#endif /* CONFIG_BLK_DEV_IDEPCI */ + proc_ide_root = proc_mkdir("ide", 0); if (!proc_ide_root) return; @@ -854,120 +913,40 @@ create_proc_read_entry("drivers", 0, proc_ide_root, proc_ide_read_drivers, NULL); -#ifdef CONFIG_BLK_DEV_AEC62XX - if ((aec62xx_display_info) && (aec62xx_proc)) - create_proc_info_entry("aec62xx", 0, proc_ide_root, aec62xx_display_info); -#endif /* CONFIG_BLK_DEV_AEC62XX */ -#ifdef CONFIG_BLK_DEV_ALI15X3 - if ((ali_display_info) && (ali_proc)) - create_proc_info_entry("ali", 0, proc_ide_root, ali_display_info); -#endif /* CONFIG_BLK_DEV_ALI15X3 */ -#ifdef CONFIG_BLK_DEV_AMD74XX - if ((amd74xx_display_info) && (amd74xx_proc)) - create_proc_info_entry("amd74xx", 0, proc_ide_root, amd74xx_display_info); -#endif /* CONFIG_BLK_DEV_AMD74XX */ -#ifdef CONFIG_BLK_DEV_CMD64X - if ((cmd64x_display_info) && (cmd64x_proc)) - create_proc_info_entry("cmd64x", 0, proc_ide_root, cmd64x_display_info); -#endif /* CONFIG_BLK_DEV_CMD64X */ -#ifdef CONFIG_BLK_DEV_CS5530 - if ((cs5530_display_info) && (cs5530_proc)) - create_proc_info_entry("cs5530", 0, proc_ide_root, cs5530_display_info); -#endif /* CONFIG_BLK_DEV_CS5530 */ -#ifdef CONFIG_BLK_DEV_HPT34X - if ((hpt34x_display_info) && (hpt34x_proc)) - create_proc_info_entry("hpt34x", 0, proc_ide_root, hpt34x_display_info); -#endif /* CONFIG_BLK_DEV_HPT34X */ -#ifdef CONFIG_BLK_DEV_HPT366 - if ((hpt366_display_info) && (hpt366_proc)) - create_proc_info_entry("hpt366", 0, proc_ide_root, hpt366_display_info); -#endif /* CONFIG_BLK_DEV_HPT366 */ -#ifdef CONFIG_BLK_DEV_SVWKS - if ((svwks_display_info) && (svwks_proc)) - create_proc_info_entry("svwks", 0, proc_ide_root, svwks_display_info); -#endif /* CONFIG_BLK_DEV_SVWKS */ -#ifdef CONFIG_BLK_DEV_PDC202XX - if ((pdc202xx_display_info) && (pdc202xx_proc)) - create_proc_info_entry("pdc202xx", 0, proc_ide_root, pdc202xx_display_info); -#endif /* CONFIG_BLK_DEV_PDC202XX */ -#ifdef CONFIG_BLK_DEV_PIIX - if ((piix_display_info) && (piix_proc)) - create_proc_info_entry("piix", 0, proc_ide_root, piix_display_info); -#endif /* CONFIG_BLK_DEV_PIIX */ -#ifdef CONFIG_BLK_DEV_SIS5513 - if ((sis_display_info) && (sis_proc)) - create_proc_info_entry("sis", 0, proc_ide_root, sis_display_info); -#endif /* CONFIG_BLK_DEV_SIS5513 */ -#ifdef CONFIG_BLK_DEV_SLC90E66 - if ((slc90e66_display_info) && (slc90e66_proc)) - create_proc_info_entry("slc90e66", 0, proc_ide_root, slc90e66_display_info); -#endif /* CONFIG_BLK_DEV_SLC90E66 */ -#ifdef CONFIG_BLK_DEV_VIA82CXXX - if ((via_display_info) && (via_proc)) - create_proc_info_entry("via", 0, proc_ide_root, via_display_info); -#endif /* CONFIG_BLK_DEV_VIA82CXXX */ +#ifdef CONFIG_BLK_DEV_IDEPCI + while (p != NULL) + { + if (p->name != NULL && p->set == 1 && p->get_info != NULL) + { + p->parent = proc_ide_root; + create_proc_info_entry(p->name, 0, p->parent, p->get_info); + p->set = 2; + } + p = p->next; + } +#endif /* CONFIG_BLK_DEV_IDEPCI */ } +EXPORT_SYMBOL(proc_ide_create); + void proc_ide_destroy(void) { - /* - * Mmmm.. does this free up all resources, - * or do we need to do a more proper cleanup here ?? - */ -#ifdef CONFIG_BLK_DEV_AEC62XX - if ((aec62xx_display_info) && (aec62xx_proc)) - remove_proc_entry("ide/aec62xx",0); -#endif /* CONFIG_BLK_DEV_AEC62XX */ -#ifdef CONFIG_BLK_DEV_ALI15X3 - if ((ali_display_info) && (ali_proc)) - remove_proc_entry("ide/ali",0); -#endif /* CONFIG_BLK_DEV_ALI15X3 */ -#ifdef CONFIG_BLK_DEV_AMD74XX - if ((amd74xx_display_info) && (amd74xx_proc)) - remove_proc_entry("ide/amd74xx",0); -#endif /* CONFIG_BLK_DEV_AMD74XX */ -#ifdef CONFIG_BLK_DEV_CMD64X - if ((cmd64x_display_info) && (cmd64x_proc)) - remove_proc_entry("ide/cmd64x",0); -#endif /* CONFIG_BLK_DEV_CMD64X */ -#ifdef CONFIG_BLK_DEV_CS5530 - if ((cs5530_display_info) && (cs5530_proc)) - remove_proc_entry("ide/cs5530",0); -#endif /* CONFIG_BLK_DEV_CS5530 */ -#ifdef CONFIG_BLK_DEV_HPT34X - if ((hpt34x_display_info) && (hpt34x_proc)) - remove_proc_entry("ide/hpt34x",0); -#endif /* CONFIG_BLK_DEV_HPT34X */ -#ifdef CONFIG_BLK_DEV_HPT366 - if ((hpt366_display_info) && (hpt366_proc)) - remove_proc_entry("ide/hpt366",0); -#endif /* CONFIG_BLK_DEV_HPT366 */ -#ifdef CONFIG_BLK_DEV_PDC202XX - if ((pdc202xx_display_info) && (pdc202xx_proc)) - remove_proc_entry("ide/pdc202xx",0); -#endif /* CONFIG_BLK_DEV_PDC202XX */ -#ifdef CONFIG_BLK_DEV_PIIX - if ((piix_display_info) && (piix_proc)) - remove_proc_entry("ide/piix",0); -#endif /* CONFIG_BLK_DEV_PIIX */ -#ifdef CONFIG_BLK_DEV_SVWKS - if ((svwks_display_info) && (svwks_proc)) - remove_proc_entry("ide/svwks",0); -#endif /* CONFIG_BLK_DEV_SVWKS */ -#ifdef CONFIG_BLK_DEV_SIS5513 - if ((sis_display_info) && (sis_proc)) - remove_proc_entry("ide/sis", 0); -#endif /* CONFIG_BLK_DEV_SIS5513 */ -#ifdef CONFIG_BLK_DEV_SLC90E66 - if ((slc90e66_display_info) && (slc90e66_proc)) - remove_proc_entry("ide/slc90e66",0); -#endif /* CONFIG_BLK_DEV_SLC90E66 */ -#ifdef CONFIG_BLK_DEV_VIA82CXXX - if ((via_display_info) && (via_proc)) - remove_proc_entry("ide/via",0); -#endif /* CONFIG_BLK_DEV_VIA82CXXX */ +#ifdef CONFIG_BLK_DEV_IDEPCI + ide_pci_host_proc_t *p = ide_pci_host_proc_list; + char name[32]; - remove_proc_entry("ide/drivers", 0); + while ((p->name != NULL) && (p->set) && (p->get_info != NULL)) { + name[0] = '\0'; + sprintf(name, "ide/%s", p->name); + if (p->set == 2) + remove_proc_entry(p->name, p->parent); + if (p->next == NULL) break; + p = p->next; + } +#endif /* CONFIG_BLK_DEV_IDEPCI */ + remove_proc_entry("ide/drivers", proc_ide_root); destroy_proc_ide_interfaces(); remove_proc_entry("ide", 0); } + +EXPORT_SYMBOL(proc_ide_destroy); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-swarm.c linux.20pre5-ac2/drivers/ide/ide-swarm.c --- linux.20pre5/drivers/ide/ide-swarm.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-swarm.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2001 Broadcom Corporation - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - */ - -/* Derived loosely from ide-pmac.c, so: - * - * Copyright (C) 1998 Paul Mackerras. - * Copyright (C) 1995-1998 Mark Lord - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -void __init swarm_ide_probe(void) -{ - int i; - ide_hwif_t *hwif; - /* - * Find the first untaken slot in hwifs - */ - for (i = 0; i < MAX_HWIFS; i++) { - if (!ide_hwifs[i].io_ports[IDE_DATA_OFFSET]) { - break; - } - } - if (i == MAX_HWIFS) { - printk("No space for SWARM onboard IDE driver in ide_hwifs[]. Not enabled.\n"); - return; - } - - /* Set up our stuff */ - hwif = &ide_hwifs[i]; - hwif->hw.io_ports[IDE_DATA_OFFSET] = SWARM_IDE_REG(0x1f0); - hwif->hw.io_ports[IDE_ERROR_OFFSET] = SWARM_IDE_REG(0x1f1); - hwif->hw.io_ports[IDE_NSECTOR_OFFSET] = SWARM_IDE_REG(0x1f2); - hwif->hw.io_ports[IDE_SECTOR_OFFSET] = SWARM_IDE_REG(0x1f3); - hwif->hw.io_ports[IDE_LCYL_OFFSET] = SWARM_IDE_REG(0x1f4); - hwif->hw.io_ports[IDE_HCYL_OFFSET] = SWARM_IDE_REG(0x1f5); - hwif->hw.io_ports[IDE_SELECT_OFFSET] = SWARM_IDE_REG(0x1f6); - hwif->hw.io_ports[IDE_STATUS_OFFSET] = SWARM_IDE_REG(0x1f7); - hwif->hw.io_ports[IDE_CONTROL_OFFSET] = SWARM_IDE_REG(0x3f6); - hwif->hw.io_ports[IDE_IRQ_OFFSET] = SWARM_IDE_REG(0x3f7); -// hwif->hw->ack_intr = swarm_ide_ack_intr; - hwif->hw.irq = SWARM_IDE_INT; - hwif->ideproc = swarm_ideproc; - - memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); - hwif->irq = hwif->hw.irq; - printk("SWARM onboard IDE configured as device %i\n", i); -} - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-tape.c linux.20pre5-ac2/drivers/ide/ide-tape.c --- linux.20pre5/drivers/ide/ide-tape.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-tape.c 2002-08-29 23:47:56.000000000 +0100 @@ -416,7 +416,6 @@ #include #include #include -#include #include #include #include @@ -724,22 +723,28 @@ struct buffer_head *bh; char *b_data; int b_count; - byte *buffer; /* Data buffer */ - byte *current_position; /* Pointer into the above buffer */ + u8 *buffer; /* Data buffer */ + u8 *current_position; /* Pointer into the above buffer */ ide_startstop_t (*callback) (ide_drive_t *); /* Called when this packet command is completed */ - byte pc_buffer[IDETAPE_PC_BUFFER_SIZE]; /* Temporary buffer */ + u8 pc_buffer[IDETAPE_PC_BUFFER_SIZE]; /* Temporary buffer */ unsigned long flags; /* Status/Action bit flags: long for set_bit */ } idetape_pc_t; /* * Packet command flag bits. */ -#define PC_ABORT 0 /* Set when an error is considered normal - We won't retry */ -#define PC_WAIT_FOR_DSC 1 /* 1 When polling for DSC on a media access command */ -#define PC_DMA_RECOMMENDED 2 /* 1 when we prefer to use DMA if possible */ -#define PC_DMA_IN_PROGRESS 3 /* 1 while DMA in progress */ -#define PC_DMA_ERROR 4 /* 1 when encountered problem during DMA */ -#define PC_WRITING 5 /* Data direction */ +/* Set when an error is considered normal - We won't retry */ +#define PC_ABORT 0 +/* 1 When polling for DSC on a media access command */ +#define PC_WAIT_FOR_DSC 1 +/* 1 when we prefer to use DMA if possible */ +#define PC_DMA_RECOMMENDED 2 +/* 1 while DMA in progress */ +#define PC_DMA_IN_PROGRESS 3 +/* 1 when encountered problem during DMA */ +#define PC_DMA_ERROR 4 +/* Data direction */ +#define PC_WRITING 5 /* * Capabilities and Mechanical Status Page @@ -814,6 +819,7 @@ * REQUEST SENSE packet command result - Data Format. */ typedef struct { +#if defined(__LITTLE_ENDIAN_BITFIELD) unsigned error_code :7; /* Current of deferred errors */ unsigned valid :1; /* The information field conforms to QIC-157C */ __u8 reserved1 :8; /* Segment Number - Reserved */ @@ -822,6 +828,18 @@ unsigned ili :1; /* Incorrect Length Indicator */ unsigned eom :1; /* End Of Medium */ unsigned filemark :1; /* Filemark */ +#elif defined(__BIG_ENDIAN_BITFIELD) + unsigned valid :1; + unsigned error_code :7; + __u8 reserved1 :8; + unsigned filemark :1; + unsigned eom :1; + unsigned ili :1; + unsigned reserved2_4 :1; + unsigned sense_key :4; +#else +#error "Please fix " +#endif __u32 information __attribute__ ((packed)); __u8 asl; /* Additional sense length (n-7) */ __u32 command_specific; /* Additional command specific information */ @@ -860,12 +878,17 @@ * required since an additional packet command is needed before the * retry, to get detailed information on what went wrong. */ - idetape_pc_t *pc; /* Current packet command */ - idetape_pc_t *failed_pc; /* Last failed packet command */ - idetape_pc_t pc_stack[IDETAPE_PC_STACK];/* Packet command stack */ - int pc_stack_index; /* Next free packet command storage space */ + /* Current packet command */ + idetape_pc_t *pc; + /* Last failed packet command */ + idetape_pc_t *failed_pc; + /* Packet command stack */ + idetape_pc_t pc_stack[IDETAPE_PC_STACK]; + /* Next free packet command storage space */ + int pc_stack_index; struct request rq_stack[IDETAPE_PC_STACK]; - int rq_stack_index; /* We implement a circular array */ + /* We implement a circular array */ + int rq_stack_index; /* * DSC polling variables. @@ -879,38 +902,48 @@ * to ide.c only one at a time. */ struct request *postponed_rq; - unsigned long dsc_polling_start; /* The time in which we started polling for DSC */ - struct timer_list dsc_timer; /* Timer used to poll for dsc */ - unsigned long best_dsc_rw_frequency; /* Read/Write dsc polling frequency */ - unsigned long dsc_polling_frequency; /* The current polling frequency */ - unsigned long dsc_timeout; /* Maximum waiting time */ + /* The time in which we started polling for DSC */ + unsigned long dsc_polling_start; + /* Timer used to poll for dsc */ + struct timer_list dsc_timer; + /* Read/Write dsc polling frequency */ + unsigned long best_dsc_rw_frequency; + /* The current polling frequency */ + unsigned long dsc_polling_frequency; + /* Maximum waiting time */ + unsigned long dsc_timeout; /* * Read position information */ - byte partition; - unsigned int first_frame_position; /* Current block */ + u8 partition; + /* Current block */ + unsigned int first_frame_position; unsigned int last_frame_position; unsigned int blocks_in_buffer; /* * Last error information */ - byte sense_key, asc, ascq; + u8 sense_key, asc, ascq; /* * Character device operation */ unsigned int minor; - char name[4]; /* device name */ - idetape_chrdev_direction_t chrdev_direction; /* Current character device data transfer direction */ + /* device name */ + char name[4]; + /* Current character device data transfer direction */ + idetape_chrdev_direction_t chrdev_direction; /* * Device information */ - unsigned short tape_block_size; /* Usually 512 or 1024 bytes */ + /* Usually 512 or 1024 bytes */ + unsigned short tape_block_size; int user_bs_factor; - idetape_capabilities_page_t capabilities; /* Copy of the tape's Capabilities and Mechanical Page */ + /* Copy of the tape's Capabilities and Mechanical Page */ + idetape_capabilities_page_t capabilities; /* * Active data transfer request parameters. @@ -925,8 +958,10 @@ * The data buffer size is chosen based on the tape's * recommendation. */ - struct request *active_data_request; /* Pointer to the request which is waiting in the device request queue */ - int stage_size; /* Data buffer size (chosen based on the tape's recommendation */ + /* Pointer to the request, waiting in the device request queue */ + struct request *active_data_request; + /* Data buffer size (chosen based on the tape's recommendation */ + int stage_size; idetape_stage_t *merge_stage; int merge_stage_size; struct buffer_head *bh; @@ -939,19 +974,30 @@ * To accomplish non-pipelined mode, we simply set the following * variables to zero (or NULL, where appropriate). */ - int nr_stages; /* Number of currently used stages */ - int nr_pending_stages; /* Number of pending stages */ - int max_stages, min_pipeline, max_pipeline; /* We will not allocate more than this number of stages */ - idetape_stage_t *first_stage; /* The first stage which will be removed from the pipeline */ - idetape_stage_t *active_stage; /* The currently active stage */ - idetape_stage_t *next_stage; /* Will be serviced after the currently active request */ - idetape_stage_t *last_stage; /* New requests will be added to the pipeline here */ - idetape_stage_t *cache_stage; /* Optional free stage which we can use */ + /* Number of currently used stages */ + int nr_stages; + /* Number of pending stages */ + int nr_pending_stages; + /* We will not allocate more than this number of stages */ + int max_stages, min_pipeline, max_pipeline; + /* The first stage which will be removed from the pipeline */ + idetape_stage_t *first_stage; + /* The currently active stage */ + idetape_stage_t *active_stage; + /* Will be serviced after the currently active request */ + idetape_stage_t *next_stage; + /* New requests will be added to the pipeline here */ + idetape_stage_t *last_stage; + /* Optional free stage which we can use */ + idetape_stage_t *cache_stage; int pages_per_stage; - int excess_bh_size; /* Wasted space in each stage */ + /* Wasted space in each stage */ + int excess_bh_size; - unsigned long flags; /* Status/Action flags: long for set_bit */ - spinlock_t spinlock; /* protects the ide-tape queue */ + /* Status/Action flags: long for set_bit */ + unsigned long flags; + /* protects the ide-tape queue */ + spinlock_t spinlock; /* * Measures average tape speed @@ -960,31 +1006,44 @@ int avg_size; int avg_speed; - idetape_request_sense_result_t sense; /* last sense information */ + /* last sense information */ + idetape_request_sense_result_t sense; char vendor_id[10]; char product_id[18]; char firmware_revision[6]; int firmware_revision_num; - int door_locked; /* the door is currently locked */ + /* the door is currently locked */ + int door_locked; /* * OnStream flags */ - int onstream; /* the tape is an OnStream tape */ - int raw; /* OnStream raw access (32.5KB block size) */ - int cur_frames; /* current number of frames in internal buffer */ - int max_frames; /* max number of frames in internal buffer */ - int logical_blk_num; /* logical block number */ - __u16 wrt_pass_cntr; /* write pass counter */ - __u32 update_frame_cntr; /* update frame counter */ + /* the tape is an OnStream tape */ + int onstream; + /* OnStream raw access (32.5KB block size) */ + int raw; + /* current number of frames in internal buffer */ + int cur_frames; + /* max number of frames in internal buffer */ + int max_frames; + /* logical block number */ + int logical_blk_num; + /* write pass counter */ + __u16 wrt_pass_cntr; + /* update frame counter */ + __u32 update_frame_cntr; struct completion *waiting; - int onstream_write_error; /* write error recovery active */ - int header_ok; /* header frame verified ok */ - int linux_media; /* reading linux-specifc media */ + /* write error recovery active */ + int onstream_write_error; + /* header frame verified ok */ + int header_ok; + /* reading linux-specifc media */ + int linux_media; int linux_media_version; - char application_sig[5]; /* application signature */ + /* application signature */ + char application_sig[5]; int filemark_cnt; int first_mark_addr; int last_mark_addr; @@ -997,8 +1056,10 @@ * Optimize the number of "buffer filling" * mode sense commands. */ - unsigned long last_buffer_fill; /* last time in which we issued fill cmd */ - int req_buffer_fill; /* buffer fill command requested */ + /* last time in which we issued fill cmd */ + unsigned long last_buffer_fill; + /* buffer fill command requested */ + int req_buffer_fill; int writes_since_buffer_fill; int reads_since_buffer_fill; @@ -1007,7 +1068,8 @@ * be postponed, to avoid an infinite postpone * deadlock. */ - int postpone_cnt; /* request postpone count limit */ + /* request postpone count limit */ + int postpone_cnt; /* * Measures number of frames: @@ -1040,11 +1102,17 @@ * Speed regulation negative feedback loop */ int speed_control; - int pipeline_head_speed, controlled_pipeline_head_speed, uncontrolled_pipeline_head_speed; - int controlled_last_pipeline_head, uncontrolled_last_pipeline_head; - unsigned long uncontrolled_pipeline_head_time, controlled_pipeline_head_time; - int controlled_previous_pipeline_head, uncontrolled_previous_pipeline_head; - unsigned long controlled_previous_head_time, uncontrolled_previous_head_time; + int pipeline_head_speed; + int controlled_pipeline_head_speed; + int uncontrolled_pipeline_head_speed; + int controlled_last_pipeline_head; + int uncontrolled_last_pipeline_head; + unsigned long uncontrolled_pipeline_head_time; + unsigned long controlled_pipeline_head_time; + int controlled_previous_pipeline_head; + int uncontrolled_previous_pipeline_head; + unsigned long controlled_previous_head_time; + unsigned long uncontrolled_previous_head_time; int restart_speed_control_req; /* @@ -1164,101 +1232,6 @@ #define IDETAPE_ERROR_EOD 103 /* - * The ATAPI Status Register. - */ -typedef union { - unsigned all :8; - struct { - unsigned check :1; /* Error occurred */ - unsigned idx :1; /* Reserved */ - unsigned corr :1; /* Correctable error occurred */ - unsigned drq :1; /* Data is request by the device */ - unsigned dsc :1; /* Buffer availability / Media access command finished */ - unsigned reserved5 :1; /* Reserved */ - unsigned drdy :1; /* Ignored for ATAPI commands (ready to accept ATA command) */ - unsigned bsy :1; /* The device has access to the command block */ - } b; -} idetape_status_reg_t; - -/* - * The ATAPI error register. - */ -typedef union { - unsigned all :8; - struct { - unsigned ili :1; /* Illegal Length Indication */ - unsigned eom :1; /* End Of Media Detected */ - unsigned abrt :1; /* Aborted command - As defined by ATA */ - unsigned mcr :1; /* Media Change Requested - As defined by ATA */ - unsigned sense_key :4; /* Sense key of the last failed packet command */ - } b; -} idetape_error_reg_t; - -/* - * ATAPI Feature Register - */ -typedef union { - unsigned all :8; - struct { - unsigned dma :1; /* Using DMA or PIO */ - unsigned reserved321 :3; /* Reserved */ - unsigned reserved654 :3; /* Reserved (Tag Type) */ - unsigned reserved7 :1; /* Reserved */ - } b; -} idetape_feature_reg_t; - -/* - * ATAPI Byte Count Register. - */ -typedef union { - unsigned all :16; - struct { - unsigned low :8; /* LSB */ - unsigned high :8; /* MSB */ - } b; -} idetape_bcount_reg_t; - -/* - * ATAPI Interrupt Reason Register. - */ -typedef union { - unsigned all :8; - struct { - unsigned cod :1; /* Information transferred is command (1) or data (0) */ - unsigned io :1; /* The device requests us to read (1) or write (0) */ - unsigned reserved :6; /* Reserved */ - } b; -} idetape_ireason_reg_t; - -/* - * ATAPI Drive Select Register - */ -typedef union { - unsigned all :8; - struct { - unsigned sam_lun :4; /* Should be zero with ATAPI (not used) */ - unsigned drv :1; /* The responding drive will be drive 0 (0) or drive 1 (1) */ - unsigned one5 :1; /* Should be set to 1 */ - unsigned reserved6 :1; /* Reserved */ - unsigned one7 :1; /* Should be set to 1 */ - } b; -} idetape_drivesel_reg_t; - -/* - * ATAPI Device Control Register - */ -typedef union { - unsigned all :8; - struct { - unsigned zero0 :1; /* Should be set to zero */ - unsigned nien :1; /* Device interrupt is disabled (1) or enabled (0) */ - unsigned srst :1; /* ATA software reset. ATAPI devices should use the new ATAPI srst. */ - unsigned one3 :1; /* Should be set to 1 */ - unsigned reserved4567 :4; /* Reserved */ - } b; -} idetape_control_reg_t; - -/* * idetape_chrdev_t provides the link between out character device * interface and our block device interface and the corresponding * ide_drive_t structure. @@ -1432,41 +1405,60 @@ * DO NOT REMOVE, BUILDING A VERBOSE DEBUG SCHEME FOR ATAPI */ -char *idetape_sense_key_verbose (byte idetape_sense_key) +char *idetape_sense_key_verbose (u8 idetape_sense_key) { switch (idetape_sense_key) { default: { char buf[22]; - sprintf(buf, "IDETAPE_SENSE (0x%02x)", idetape_sense_key); + sprintf(buf, "IDETAPE_SENSE (0x%02x)", + idetape_sense_key); return(buf); } } } -char *idetape_command_key_verbose (byte idetape_command_key) +char *idetape_command_key_verbose (u8 idetape_command_key) { switch (idetape_command_key) { - case IDETAPE_TEST_UNIT_READY_CMD: return("TEST_UNIT_READY_CMD"); - case IDETAPE_REWIND_CMD: return("REWIND_CMD"); - case IDETAPE_REQUEST_SENSE_CMD: return("REQUEST_SENSE_CMD"); - case IDETAPE_READ_CMD: return("READ_CMD"); - case IDETAPE_WRITE_CMD: return("WRITE_CMD"); - case IDETAPE_WRITE_FILEMARK_CMD: return("WRITE_FILEMARK_CMD"); - case IDETAPE_SPACE_CMD: return("SPACE_CMD"); - case IDETAPE_INQUIRY_CMD: return("INQUIRY_CMD"); - case IDETAPE_ERASE_CMD: return("ERASE_CMD"); - case IDETAPE_MODE_SENSE_CMD: return("MODE_SENSE_CMD"); - case IDETAPE_MODE_SELECT_CMD: return("MODE_SELECT_CMD"); - case IDETAPE_LOAD_UNLOAD_CMD: return("LOAD_UNLOAD_CMD"); - case IDETAPE_PREVENT_CMD: return("PREVENT_CMD"); - case IDETAPE_LOCATE_CMD: return("LOCATE_CMD"); - case IDETAPE_READ_POSITION_CMD: return("READ_POSITION_CMD"); - case IDETAPE_READ_BUFFER_CMD: return("READ_BUFFER_CMD"); - case IDETAPE_SET_SPEED_CMD: return("SET_SPEED_CMD"); + case IDETAPE_TEST_UNIT_READY_CMD: + return("TEST_UNIT_READY_CMD"); + case IDETAPE_REWIND_CMD: + return("REWIND_CMD"); + case IDETAPE_REQUEST_SENSE_CMD: + return("REQUEST_SENSE_CMD"); + case IDETAPE_READ_CMD: + return("READ_CMD"); + case IDETAPE_WRITE_CMD: + return("WRITE_CMD"); + case IDETAPE_WRITE_FILEMARK_CMD: + return("WRITE_FILEMARK_CMD"); + case IDETAPE_SPACE_CMD: + return("SPACE_CMD"); + case IDETAPE_INQUIRY_CMD: + return("INQUIRY_CMD"); + case IDETAPE_ERASE_CMD: + return("ERASE_CMD"); + case IDETAPE_MODE_SENSE_CMD: + return("MODE_SENSE_CMD"); + case IDETAPE_MODE_SELECT_CMD: + return("MODE_SELECT_CMD"); + case IDETAPE_LOAD_UNLOAD_CMD: + return("LOAD_UNLOAD_CMD"); + case IDETAPE_PREVENT_CMD: + return("PREVENT_CMD"); + case IDETAPE_LOCATE_CMD: + return("LOCATE_CMD"); + case IDETAPE_READ_POSITION_CMD: + return("READ_POSITION_CMD"); + case IDETAPE_READ_BUFFER_CMD: + return("READ_BUFFER_CMD"); + case IDETAPE_SET_SPEED_CMD: + return("SET_SPEED_CMD"); default: { char buf[20]; - sprintf(buf, "CMD (0x%02x)", idetape_command_key); + sprintf(buf, "CMD (0x%02x)", + idetape_command_key); return(buf); } } @@ -1482,13 +1474,13 @@ static void idetape_write_release (struct inode *inode); /* - * Too bad. The drive wants to send us data which we are not ready to accept. - * Just throw it away. + * Too bad. The drive wants to send us data which we are not ready to accept. + * Just throw it away. */ static void idetape_discard_data (ide_drive_t *drive, unsigned int bcount) { while (bcount--) - IN_BYTE (IDE_DATA_REG); + (void) HWIF(drive)->INB(IDE_DATA_REG); } static void idetape_input_buffers (ide_drive_t *drive, idetape_pc_t *pc, unsigned int bcount) @@ -1499,13 +1491,14 @@ while (bcount) { #if IDETAPE_DEBUG_BUGS if (bh == NULL) { - printk (KERN_ERR "ide-tape: bh == NULL in idetape_input_buffers\n"); - idetape_discard_data (drive, bcount); + printk(KERN_ERR "ide-tape: bh == NULL in %s\n", + __FUNCTION__); + idetape_discard_data(drive, bcount); return; } #endif /* IDETAPE_DEBUG_BUGS */ - count = IDE_MIN (bh->b_size - atomic_read(&bh->b_count), bcount); - atapi_input_bytes (drive, bh->b_data + atomic_read(&bh->b_count), count); + count = IDE_MIN(bh->b_size - atomic_read(&bh->b_count), bcount); + HWIF(drive)->atapi_input_bytes(drive, bh->b_data + atomic_read(&bh->b_count), count); bcount -= count; atomic_add(count, &bh->b_count); if (atomic_read(&bh->b_count) == bh->b_size) { @@ -1525,12 +1518,13 @@ while (bcount) { #if IDETAPE_DEBUG_BUGS if (bh == NULL) { - printk (KERN_ERR "ide-tape: bh == NULL in idetape_output_buffers\n"); + printk(KERN_ERR "ide-tape: bh == NULL in %s\n", + __FUNCTION__); return; } #endif /* IDETAPE_DEBUG_BUGS */ - count = IDE_MIN (pc->b_count, bcount); - atapi_output_bytes (drive, pc->b_data, count); + count = IDE_MIN(pc->b_count, bcount); + HWIF(drive)->atapi_output_bytes(drive, pc->b_data, count); bcount -= count; pc->b_data += count; pc->b_count -= count; @@ -1550,16 +1544,17 @@ struct buffer_head *bh = pc->bh; int count, bcount = pc->actually_transferred; - if (test_bit (PC_WRITING, &pc->flags)) + if (test_bit(PC_WRITING, &pc->flags)) return; while (bcount) { #if IDETAPE_DEBUG_BUGS if (bh == NULL) { - printk (KERN_ERR "ide-tape: bh == NULL in idetape_update_buffers\n"); + printk(KERN_ERR "ide-tape: bh == NULL in %s\n", + __FUNCTION__); return; } #endif /* IDETAPE_DEBUG_BUGS */ - count = IDE_MIN (bh->b_size, bcount); + count = IDE_MIN(bh->b_size, bcount); atomic_set(&bh->b_count, count); if (atomic_read(&bh->b_count) == bh->b_size) bh = bh->b_reqnext; @@ -1581,9 +1576,10 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 5) - printk (KERN_INFO "ide-tape: pc_stack_index=%d\n",tape->pc_stack_index); + printk(KERN_INFO "ide-tape: pc_stack_index=%d\n", + tape->pc_stack_index); #endif /* IDETAPE_DEBUG_LOG */ - if (tape->pc_stack_index==IDETAPE_PC_STACK) + if (tape->pc_stack_index == IDETAPE_PC_STACK) tape->pc_stack_index=0; return (&tape->pc_stack[tape->pc_stack_index++]); } @@ -1607,9 +1603,10 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 5) - printk (KERN_INFO "ide-tape: rq_stack_index=%d\n",tape->rq_stack_index); + printk(KERN_INFO "ide-tape: rq_stack_index=%d\n", + tape->rq_stack_index); #endif /* IDETAPE_DEBUG_LOG */ - if (tape->rq_stack_index==IDETAPE_PC_STACK) + if (tape->rq_stack_index == IDETAPE_PC_STACK) tape->rq_stack_index=0; return (&tape->rq_stack[tape->rq_stack_index++]); } @@ -1619,7 +1616,7 @@ */ static void idetape_init_pc (idetape_pc_t *pc) { - memset (pc->c, 0, 12); + memset(pc->c, 0, 12); pc->retries = 0; pc->flags = 0; pc->request_transfer = 0; @@ -1649,19 +1646,23 @@ * give up retrying. */ if (tape->debug_level >= 1) - printk (KERN_INFO "ide-tape: pc = %x, sense key = %x, asc = %x, ascq = %x\n", - pc->c[0], result->sense_key, result->asc, result->ascq); + printk(KERN_INFO "ide-tape: pc = %x, sense key = %x, " + "asc = %x, ascq = %x\n", + pc->c[0], result->sense_key, + result->asc, result->ascq); #if IDETAPE_DEBUG_LOG_VERBOSE if (tape->debug_level >= 1) - printk (KERN_INFO "ide-tape: pc = %s, sense key = %x, asc = %x, ascq = %x\n", - idetape_command_key_verbose((byte) pc->c[0]), + printk (KERN_INFO "ide-tape: pc = %s, sense key = %x, " + "asc = %x, ascq = %x\n", + idetape_command_key_verbose((u8) pc->c[0]), result->sense_key, result->asc, result->ascq); #endif /* IDETAPE_DEBUG_LOG_VERBOSE */ #endif /* IDETAPE_DEBUG_LOG */ - if (tape->onstream && result->sense_key == 2 && result->asc == 0x53 && result->ascq == 2) { + if (tape->onstream && result->sense_key == 2 && + result->asc == 0x53 && result->ascq == 2) { clear_bit(PC_DMA_ERROR, &pc->flags); ide_stall_queue(drive, HZ / 2); return; @@ -1671,27 +1672,29 @@ /* * Correct pc->actually_transferred by asking the tape. */ - if (test_bit (PC_DMA_ERROR, &pc->flags)) { - pc->actually_transferred = pc->request_transfer - tape->tape_block_size * ntohl (get_unaligned (&result->information)); - idetape_update_buffers (pc); + if (test_bit(PC_DMA_ERROR, &pc->flags)) { + pc->actually_transferred = pc->request_transfer - tape->tape_block_size * ntohl(get_unaligned (&result->information)); + idetape_update_buffers(pc); } #endif /* CONFIG_BLK_DEV_IDEDMA */ if (pc->c[0] == IDETAPE_READ_CMD && result->filemark) { pc->error = IDETAPE_ERROR_FILEMARK; - set_bit (PC_ABORT, &pc->flags); + set_bit(PC_ABORT, &pc->flags); } if (pc->c[0] == IDETAPE_WRITE_CMD) { - if (result->eom || (result->sense_key == 0xd && result->asc == 0x0 && result->ascq == 0x2)) { + if (result->eom || (result->sense_key == 0xd && + result->asc == 0x0 && result->ascq == 0x2)) { pc->error = IDETAPE_ERROR_EOD; - set_bit (PC_ABORT, &pc->flags); + set_bit(PC_ABORT, &pc->flags); } } if (pc->c[0] == IDETAPE_READ_CMD || pc->c[0] == IDETAPE_WRITE_CMD) { if (result->sense_key == 8) { pc->error = IDETAPE_ERROR_EOD; - set_bit (PC_ABORT, &pc->flags); + set_bit(PC_ABORT, &pc->flags); } - if (!test_bit (PC_ABORT, &pc->flags) && (tape->onstream || pc->actually_transferred)) + if (!test_bit(PC_ABORT, &pc->flags) && + (tape->onstream || pc->actually_transferred)) pc->retries = IDETAPE_MAX_PC_RETRIES + 1; } } @@ -1703,7 +1706,8 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk(KERN_INFO "ide-tape: %s: idetape_abort_pipeline called\n", tape->name); + printk(KERN_INFO "ide-tape: %s: %s called\n", + tape->name, __FUNCTION__); #endif while (stage) { if (stage->rq.cmd == IDETAPE_WRITE_RQ) @@ -1725,11 +1729,12 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_active_next_stage\n"); + printk(KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__); #endif /* IDETAPE_DEBUG_LOG */ #if IDETAPE_DEBUG_BUGS if (stage == NULL) { - printk (KERN_ERR "ide-tape: bug: Trying to activate a non existing stage\n"); + printk(KERN_ERR "ide-tape: bug: Trying to activate a " + "non existing stage\n"); return; } #endif /* IDETAPE_DEBUG_BUGS */ @@ -1755,7 +1760,7 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_increase_max_pipeline_stages\n"); + printk (KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__); #endif /* IDETAPE_DEBUG_LOG */ tape->max_stages += increase; @@ -1776,21 +1781,21 @@ if (bh->b_data != NULL) { size = (int) bh->b_size; while (size > 0) { - free_page ((unsigned long) bh->b_data); + free_page((unsigned long) bh->b_data); size -= PAGE_SIZE; bh->b_data += PAGE_SIZE; } } prev_bh = bh; bh = bh->b_reqnext; - kfree (prev_bh); + kfree(prev_bh); } - kfree (stage); + kfree(stage); } static void idetape_kfree_stage (idetape_tape_t *tape, idetape_stage_t *stage) { - __idetape_kfree_stage (stage); + __idetape_kfree_stage(stage); } /* @@ -1804,29 +1809,32 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_remove_stage_head\n"); + printk(KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__); #endif /* IDETAPE_DEBUG_LOG */ #if IDETAPE_DEBUG_BUGS if (tape->first_stage == NULL) { - printk (KERN_ERR "ide-tape: bug: tape->first_stage is NULL\n"); + printk(KERN_ERR "ide-tape: bug: tape->first_stage is NULL\n"); return; } if (tape->active_stage == tape->first_stage) { - printk (KERN_ERR "ide-tape: bug: Trying to free our active pipeline stage\n"); + printk(KERN_ERR "ide-tape: bug: Trying to free our " + "active pipeline stage\n"); return; } #endif /* IDETAPE_DEBUG_BUGS */ stage = tape->first_stage; tape->first_stage = stage->next; - idetape_kfree_stage (tape, stage); + idetape_kfree_stage(tape, stage); tape->nr_stages--; if (tape->first_stage == NULL) { tape->last_stage = NULL; #if IDETAPE_DEBUG_BUGS if (tape->next_stage != NULL) - printk (KERN_ERR "ide-tape: bug: tape->next_stage != NULL\n"); + printk(KERN_ERR "ide-tape: bug: " + "tape->next_stage != NULL\n"); if (tape->nr_stages) - printk (KERN_ERR "ide-tape: bug: nr_stages should be 0 now\n"); + printk(KERN_ERR "ide-tape: bug: nr_stages should " + "be 0 now\n"); #endif /* IDETAPE_DEBUG_BUGS */ } } @@ -1835,10 +1843,9 @@ * idetape_end_request is used to finish servicing a request, and to * insert a pending pipeline request into the main device queue. */ -static void idetape_end_request (byte uptodate, ide_hwgroup_t *hwgroup) +static int idetape_end_request (ide_drive_t *drive, int uptodate) { - ide_drive_t *drive = hwgroup->drive; - struct request *rq = hwgroup->rq; + struct request *rq = HWGROUP(drive)->rq; idetape_tape_t *tape = drive->driver_data; unsigned long flags; int error; @@ -1851,7 +1858,7 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_end_request\n"); + printk (KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__); #endif /* IDETAPE_DEBUG_LOG */ switch (uptodate) { @@ -1864,7 +1871,8 @@ tape->failed_pc = NULL; spin_lock_irqsave(&tape->spinlock, flags); - if (tape->active_data_request == rq) { /* The request was a pipelined data transfer request */ + if (tape->active_data_request == rq) { + /* The request was a pipelined data transfer request */ tape->active_stage = NULL; tape->active_data_request = NULL; tape->nr_pending_stages--; @@ -1893,11 +1901,13 @@ } remove_stage = 1; if (error) { - set_bit (IDETAPE_PIPELINE_ERROR, &tape->flags); + set_bit(IDETAPE_PIPELINE_ERROR, &tape->flags); if (error == IDETAPE_ERROR_EOD) - idetape_abort_pipeline (drive); - if (tape->onstream && !tape->raw && error == IDETAPE_ERROR_GENERAL && tape->sense.sense_key == 3) { - clear_bit (IDETAPE_PIPELINE_ERROR, &tape->flags); + idetape_abort_pipeline(drive); + if (tape->onstream && !tape->raw && + error == IDETAPE_ERROR_GENERAL && + tape->sense.sense_key == 3) { + clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags); printk(KERN_ERR "ide-tape: %s: write error, enabling error recovery\n", tape->name); tape->onstream_write_error = OS_WRITE_ERROR; remove_stage = 0; @@ -1910,7 +1920,7 @@ } } else if (rq->cmd == IDETAPE_READ_RQ) { if (error == IDETAPE_ERROR_EOD) { - set_bit (IDETAPE_PIPELINE_ERROR, &tape->flags); + set_bit(IDETAPE_PIPELINE_ERROR, &tape->flags); idetape_abort_pipeline(drive); } } @@ -1920,18 +1930,19 @@ /* * Insert the next request into the request queue. */ - (void) ide_do_drive_cmd (drive, tape->active_data_request, ide_end); + (void) ide_do_drive_cmd(drive, tape->active_data_request, ide_end); } else if (!error) { if (!tape->onstream) - idetape_increase_max_pipeline_stages (drive); + idetape_increase_max_pipeline_stages(drive); } } - ide_end_drive_cmd (drive, 0, 0); + ide_end_drive_cmd(drive, 0, 0); if (remove_stage) - idetape_remove_stage_head (drive); + idetape_remove_stage_head(drive); if (tape->active_data_request == NULL) clear_bit(IDETAPE_PIPELINE_ACTIVE, &tape->flags); spin_unlock_irqrestore(&tape->spinlock, flags); + return 0; } static ide_startstop_t idetape_request_sense_callback (ide_drive_t *drive) @@ -1940,21 +1951,22 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_request_sense_callback\n"); + printk(KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__); #endif /* IDETAPE_DEBUG_LOG */ if (!tape->pc->error) { - idetape_analyze_error (drive, (idetape_request_sense_result_t *) tape->pc->buffer); - idetape_end_request (1, HWGROUP (drive)); + idetape_analyze_error(drive, (idetape_request_sense_result_t *) tape->pc->buffer); + idetape_end_request(drive, 1); } else { - printk (KERN_ERR "ide-tape: Error in REQUEST SENSE itself - Aborting request!\n"); - idetape_end_request (0, HWGROUP (drive)); + printk(KERN_ERR "ide-tape: Error in REQUEST SENSE " + "itself - Aborting request!\n"); + idetape_end_request(drive, 0); } return ide_stopped; } static void idetape_create_request_sense_cmd (idetape_pc_t *pc) { - idetape_init_pc (pc); + idetape_init_pc(pc); pc->c[0] = IDETAPE_REQUEST_SENSE_CMD; pc->c[4] = 20; pc->request_transfer = 18; @@ -1982,10 +1994,10 @@ */ static void idetape_queue_pc_head (ide_drive_t *drive,idetape_pc_t *pc,struct request *rq) { - ide_init_drive_cmd (rq); + ide_init_drive_cmd(rq); rq->buffer = (char *) pc; rq->cmd = IDETAPE_PC_RQ1; - (void) ide_do_drive_cmd (drive, rq, ide_preempt); + (void) ide_do_drive_cmd(drive, rq, ide_preempt); } /* @@ -1998,14 +2010,14 @@ idetape_tape_t *tape = drive->driver_data; idetape_pc_t *pc; struct request *rq; - idetape_error_reg_t error; + atapi_error_t error; - error.all = IN_BYTE (IDE_ERROR_REG); + error.all = HWIF(drive)->INB(IDE_ERROR_REG); pc = idetape_next_pc_storage (drive); rq = idetape_next_rq_storage (drive); - idetape_create_request_sense_cmd (pc); - set_bit (IDETAPE_IGNORE_DSC, &tape->flags); - idetape_queue_pc_head (drive, pc, rq); + idetape_create_request_sense_cmd(pc); + set_bit(IDETAPE_IGNORE_DSC, &tape->flags); + idetape_queue_pc_head(drive, pc, rq); return ide_stopped; } @@ -2037,9 +2049,9 @@ static ide_startstop_t idetape_pc_intr (ide_drive_t *drive) { idetape_tape_t *tape = drive->driver_data; - idetape_status_reg_t status; - idetape_bcount_reg_t bcount; - idetape_ireason_reg_t ireason; + atapi_status_t status; + atapi_bcount_t bcount; + atapi_ireason_t ireason; idetape_pc_t *pc = tape->pc; unsigned int temp; @@ -2050,14 +2062,16 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_pc_intr interrupt handler\n"); + printk(KERN_INFO "ide-tape: Reached idetape_pc_intr " + "interrupt handler\n"); #endif /* IDETAPE_DEBUG_LOG */ - status.all = GET_STAT(); /* Clear the interrupt */ + /* Clear the interrupt */ + status.all = HWIF(drive)->INB(IDE_STATUS_REG); #ifdef CONFIG_BLK_DEV_IDEDMA - if (test_bit (PC_DMA_IN_PROGRESS, &pc->flags)) { - if (HWIF(drive)->dmaproc(ide_dma_end, drive)) { + if (test_bit(PC_DMA_IN_PROGRESS, &pc->flags)) { + if (HWIF(drive)->ide_dma_end(drive)) { /* * A DMA error is sometimes expected. For example, * if the tape is crossing a filemark during a @@ -2081,106 +2095,144 @@ } #endif /* CONFIG_BLK_DEV_IDEDMA */ - if (!status.b.drq) { /* No more interrupts */ + if (!status.b.drq) { /* No more interrupts */ cmd_time = (jiffies - tape->cmd_start_time) * 1000 / HZ; tape->max_cmd_time = IDE_MAX(cmd_time, tape->max_cmd_time); #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 2) - printk (KERN_INFO "ide-tape: Packet command completed, %d bytes transferred\n", pc->actually_transferred); + printk(KERN_INFO "ide-tape: Packet command completed, " + "%d bytes transferred\n", + pc->actually_transferred); #endif /* IDETAPE_DEBUG_LOG */ - clear_bit (PC_DMA_IN_PROGRESS, &pc->flags); + clear_bit(PC_DMA_IN_PROGRESS, &pc->flags); - ide__sti(); /* local CPU only */ + local_irq_enable(); #if SIMULATE_ERRORS - if ((pc->c[0] == IDETAPE_WRITE_CMD || pc->c[0] == IDETAPE_READ_CMD) && (++error_sim_count % 100) == 0) { - printk(KERN_INFO "ide-tape: %s: simulating error\n", tape->name); + if ((pc->c[0] == IDETAPE_WRITE_CMD || + pc->c[0] == IDETAPE_READ_CMD) && + (++error_sim_count % 100) == 0) { + printk(KERN_INFO "ide-tape: %s: simulating error\n", + tape->name); status.b.check = 1; } #endif if (status.b.check && pc->c[0] == IDETAPE_REQUEST_SENSE_CMD) status.b.check = 0; - if (status.b.check || test_bit (PC_DMA_ERROR, &pc->flags)) { /* Error detected */ + if (status.b.check || test_bit(PC_DMA_ERROR, &pc->flags)) { + /* Error detected */ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 1) - printk (KERN_INFO "ide-tape: %s: I/O error, ",tape->name); + printk(KERN_INFO "ide-tape: %s: I/O error, ", + tape->name); #endif /* IDETAPE_DEBUG_LOG */ if (pc->c[0] == IDETAPE_REQUEST_SENSE_CMD) { - printk (KERN_ERR "ide-tape: I/O error in request sense command\n"); - return ide_do_reset (drive); + printk(KERN_ERR "ide-tape: I/O error in " + "request sense command\n"); + return ide_do_reset(drive); } #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 1) - printk(KERN_INFO "ide-tape: [cmd %x]: check condition\n", pc->c[0]); + printk(KERN_INFO "ide-tape: [cmd %x]: check " + "condition\n", pc->c[0]); #endif - return idetape_retry_pc (drive); /* Retry operation */ + /* Retry operation */ + return idetape_retry_pc(drive); } pc->error = 0; - if (!tape->onstream && test_bit (PC_WAIT_FOR_DSC, &pc->flags) && !status.b.dsc) { /* Media access command */ + if (!tape->onstream && + test_bit(PC_WAIT_FOR_DSC, &pc->flags) && + !status.b.dsc) { + /* Media access command */ tape->dsc_polling_start = jiffies; tape->dsc_polling_frequency = IDETAPE_DSC_MA_FAST; tape->dsc_timeout = jiffies + IDETAPE_DSC_MA_TIMEOUT; - idetape_postpone_request (drive); /* Allow ide.c to handle other requests */ + /* Allow ide.c to handle other requests */ + idetape_postpone_request(drive); return ide_stopped; } if (tape->failed_pc == pc) tape->failed_pc = NULL; - return pc->callback(drive); /* Command finished - Call the callback function */ + /* Command finished - Call the callback function */ + return pc->callback(drive); } #ifdef CONFIG_BLK_DEV_IDEDMA - if (test_and_clear_bit (PC_DMA_IN_PROGRESS, &pc->flags)) { - printk (KERN_ERR "ide-tape: The tape wants to issue more interrupts in DMA mode\n"); - printk (KERN_ERR "ide-tape: DMA disabled, reverting to PIO\n"); - (void) HWIF(drive)->dmaproc(ide_dma_off, drive); - return ide_do_reset (drive); + if (test_and_clear_bit(PC_DMA_IN_PROGRESS, &pc->flags)) { + printk(KERN_ERR "ide-tape: The tape wants to issue more " + "interrupts in DMA mode\n"); + printk(KERN_ERR "ide-tape: DMA disabled, reverting to PIO\n"); + (void) HWIF(drive)->ide_dma_off(drive); + return ide_do_reset(drive); } #endif /* CONFIG_BLK_DEV_IDEDMA */ - bcount.b.high = IN_BYTE (IDE_BCOUNTH_REG); /* Get the number of bytes to transfer */ - bcount.b.low = IN_BYTE (IDE_BCOUNTL_REG); /* on this interrupt */ - ireason.all = IN_BYTE (IDE_IREASON_REG); + /* Get the number of bytes to transfer */ + bcount.b.high = HWIF(drive)->INB(IDE_BCOUNTH_REG); + bcount.b.low = HWIF(drive)->INB(IDE_BCOUNTL_REG); + /* on this interrupt */ + ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); if (ireason.b.cod) { - printk (KERN_ERR "ide-tape: CoD != 0 in idetape_pc_intr\n"); - return ide_do_reset (drive); + printk(KERN_ERR "ide-tape: CoD != 0 in idetape_pc_intr\n"); + return ide_do_reset(drive); } - if (ireason.b.io == test_bit (PC_WRITING, &pc->flags)) { /* Hopefully, we will never get here */ - printk (KERN_ERR "ide-tape: We wanted to %s, ", ireason.b.io ? "Write":"Read"); - printk (KERN_ERR "ide-tape: but the tape wants us to %s !\n",ireason.b.io ? "Read":"Write"); - return ide_do_reset (drive); + if (ireason.b.io == test_bit(PC_WRITING, &pc->flags)) { + /* Hopefully, we will never get here */ + printk(KERN_ERR "ide-tape: We wanted to %s, ", + ireason.b.io ? "Write":"Read"); + printk(KERN_ERR "ide-tape: but the tape wants us to %s !\n", + ireason.b.io ? "Read":"Write"); + return ide_do_reset(drive); } - if (!test_bit (PC_WRITING, &pc->flags)) { /* Reading - Check that we have enough space */ + if (!test_bit(PC_WRITING, &pc->flags)) { + /* Reading - Check that we have enough space */ temp = pc->actually_transferred + bcount.all; - if ( temp > pc->request_transfer) { + if (temp > pc->request_transfer) { if (temp > pc->buffer_size) { - printk (KERN_ERR "ide-tape: The tape wants to send us more data than expected - discarding data\n"); - idetape_discard_data (drive, bcount.all); - ide_set_handler (drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL); + printk(KERN_ERR "ide-tape: The tape wants to " + "send us more data than expected " + "- discarding data\n"); + idetape_discard_data(drive, bcount.all); + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, + &idetape_pc_intr, + IDETAPE_WAIT_CMD, + NULL); return ide_started; } #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 2) - printk (KERN_NOTICE "ide-tape: The tape wants to send us more data than expected - allowing transfer\n"); + printk(KERN_NOTICE "ide-tape: The tape wants " + "to send us more data than expected " + "- allowing transfer\n"); #endif /* IDETAPE_DEBUG_LOG */ } } - if (test_bit (PC_WRITING, &pc->flags)) { + if (test_bit(PC_WRITING, &pc->flags)) { if (pc->bh != NULL) - idetape_output_buffers (drive, pc, bcount.all); + idetape_output_buffers(drive, pc, bcount.all); else - atapi_output_bytes (drive,pc->current_position,bcount.all); /* Write the current buffer */ + /* Write the current buffer */ + HWIF(drive)->atapi_output_bytes(drive,pc->current_position,bcount.all); } else { if (pc->bh != NULL) - idetape_input_buffers (drive, pc, bcount.all); + idetape_input_buffers(drive, pc, bcount.all); else - atapi_input_bytes (drive,pc->current_position,bcount.all); /* Read the current buffer */ + /* Read the current buffer */ + HWIF(drive)->atapi_input_bytes(drive,pc->current_position,bcount.all); } - pc->actually_transferred += bcount.all; /* Update the current position */ - pc->current_position+=bcount.all; + /* Update the current position */ + pc->actually_transferred += bcount.all; + pc->current_position += bcount.all; #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: [cmd %x] transferred %d bytes on that interrupt\n", pc->c[0], bcount.all); + printk(KERN_INFO "ide-tape: [cmd %x] transferred %d bytes " + "on that interrupt\n", pc->c[0], bcount.all); #endif - ide_set_handler (drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL); /* And set the interrupt handler again */ + if (HWGROUP(drive)->handler != NULL) + BUG(); + /* And set the interrupt handler again */ + ide_set_handler (drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL); return ide_started; } @@ -2217,9 +2269,9 @@ * * 4. When the packet command is finished, it will be checked for errors. * - * 5. In case an error was found, we queue a request sense packet command - * in front of the request queue and retry the operation up to - * IDETAPE_MAX_PC_RETRIES times. + * 5. In case an error was found, we queue a request sense packet + * command in front of the request queue and retry the operation + * upto IDETAPE_MAX_PC_RETRIES times. * * 6. In case no error was found, or we decided to give up and not * to retry again, the callback function will be called and then @@ -2230,52 +2282,64 @@ { idetape_tape_t *tape = drive->driver_data; idetape_pc_t *pc = tape->pc; - idetape_ireason_reg_t ireason; + atapi_ireason_t ireason; int retries = 100; ide_startstop_t startstop; - if (ide_wait_stat (&startstop,drive,DRQ_STAT,BUSY_STAT,WAIT_READY)) { - printk (KERN_ERR "ide-tape: Strange, packet command initiated yet DRQ isn't asserted\n"); + if (ide_wait_stat(&startstop,drive,DRQ_STAT,BUSY_STAT,WAIT_READY)) { + printk(KERN_ERR "ide-tape: Strange, packet command " + "initiated yet DRQ isn't asserted\n"); return startstop; } - ireason.all = IN_BYTE (IDE_IREASON_REG); + ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); while (retries-- && (!ireason.b.cod || ireason.b.io)) { - printk(KERN_ERR "ide-tape: (IO,CoD != (0,1) while issuing a packet command, retrying\n"); + printk(KERN_ERR "ide-tape: (IO,CoD != (0,1) while issuing " + "a packet command, retrying\n"); udelay(100); - ireason.all = IN_BYTE(IDE_IREASON_REG); + ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); if (retries == 0) { - printk(KERN_ERR "ide-tape: (IO,CoD != (0,1) while issuing a packet command, ignoring\n"); + printk(KERN_ERR "ide-tape: (IO,CoD != (0,1) while " + "issuing a packet command, ignoring\n"); ireason.b.cod = 1; ireason.b.io = 0; } } if (!ireason.b.cod || ireason.b.io) { - printk (KERN_ERR "ide-tape: (IO,CoD) != (0,1) while issuing a packet command\n"); - return ide_do_reset (drive); + printk(KERN_ERR "ide-tape: (IO,CoD) != (0,1) while issuing " + "a packet command\n"); + return ide_do_reset(drive); } tape->cmd_start_time = jiffies; - ide_set_handler(drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL); /* Set the interrupt routine */ - atapi_output_bytes (drive,pc->c,12); /* Send the actual packet */ + if (HWGROUP(drive)->handler != NULL) /* paranoia check */ + BUG(); + /* Set the interrupt routine */ + ide_set_handler(drive, &idetape_pc_intr, IDETAPE_WAIT_CMD, NULL); + /* Send the actual packet */ + HWIF(drive)->atapi_output_bytes(drive, pc->c, 12); return ide_started; } static ide_startstop_t idetape_issue_packet_command (ide_drive_t *drive, idetape_pc_t *pc) { idetape_tape_t *tape = drive->driver_data; - idetape_bcount_reg_t bcount; - int dma_ok = 0; + atapi_feature_t feature; + atapi_bcount_t bcount; #if IDETAPE_DEBUG_BUGS - if (tape->pc->c[0] == IDETAPE_REQUEST_SENSE_CMD && pc->c[0] == IDETAPE_REQUEST_SENSE_CMD) { - printk (KERN_ERR "ide-tape: possible ide-tape.c bug - Two request sense in serial were issued\n"); + if (tape->pc->c[0] == IDETAPE_REQUEST_SENSE_CMD && + pc->c[0] == IDETAPE_REQUEST_SENSE_CMD) { + printk(KERN_ERR "ide-tape: possible ide-tape.c bug - " + "Two request sense in serial were issued\n"); } #endif /* IDETAPE_DEBUG_BUGS */ if (tape->failed_pc == NULL && pc->c[0] != IDETAPE_REQUEST_SENSE_CMD) tape->failed_pc = pc; - tape->pc = pc; /* Set the current packet command */ + /* Set the current packet command */ + tape->pc = pc; - if (pc->retries > IDETAPE_MAX_PC_RETRIES || test_bit (PC_ABORT, &pc->flags)) { + if (pc->retries > IDETAPE_MAX_PC_RETRIES || + test_bit(PC_ABORT, &pc->flags)) { /* * We will "abort" retrying a packet command in case * a legitimate error code was received (crossing a @@ -2283,55 +2347,79 @@ * example). */ if (!test_bit (PC_ABORT, &pc->flags)) { - if (!(pc->c[0] == IDETAPE_TEST_UNIT_READY_CMD && tape->sense_key == 2 && - tape->asc == 4 && (tape->ascq == 1 || tape->ascq == 8))) { - printk (KERN_ERR "ide-tape: %s: I/O error, pc = %2x, key = %2x, asc = %2x, ascq = %2x\n", - tape->name, pc->c[0], tape->sense_key, tape->asc, tape->ascq); - if (tape->onstream && pc->c[0] == IDETAPE_READ_CMD && tape->sense_key == 3 && tape->asc == 0x11) /* AJN-1: 11 should be 0x11 */ + if (!(pc->c[0] == IDETAPE_TEST_UNIT_READY_CMD && + tape->sense_key == 2 && tape->asc == 4 && + (tape->ascq == 1 || tape->ascq == 8))) { + printk(KERN_ERR "ide-tape: %s: I/O error, " + "pc = %2x, key = %2x, " + "asc = %2x, ascq = %2x\n", + tape->name, pc->c[0], + tape->sense_key, tape->asc, + tape->ascq); + if (tape->onstream && + pc->c[0] == IDETAPE_READ_CMD && + tape->sense_key == 3 && + tape->asc == 0x11) + /* AJN-1: 11 should be 0x11 */ printk(KERN_ERR "ide-tape: %s: enabling read error recovery\n", tape->name); } - pc->error = IDETAPE_ERROR_GENERAL; /* Giving up */ + /* Giving up */ + pc->error = IDETAPE_ERROR_GENERAL; } tape->failed_pc = NULL; return pc->callback(drive); } #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 2) - printk (KERN_INFO "ide-tape: Retry number - %d\n", pc->retries); + printk(KERN_INFO "ide-tape: Retry number - %d\n", pc->retries); #endif /* IDETAPE_DEBUG_LOG */ pc->retries++; - pc->actually_transferred = 0; /* We haven't transferred any data yet */ - pc->current_position=pc->buffer; - bcount.all=pc->request_transfer; /* Request to transfer the entire buffer at once */ + /* We haven't transferred any data yet */ + pc->actually_transferred = 0; + pc->current_position = pc->buffer; + /* Request to transfer the entire buffer at once */ + bcount.all = pc->request_transfer; #ifdef CONFIG_BLK_DEV_IDEDMA - if (test_and_clear_bit (PC_DMA_ERROR, &pc->flags)) { - printk (KERN_WARNING "ide-tape: DMA disabled, reverting to PIO\n"); - (void) HWIF(drive)->dmaproc(ide_dma_off, drive); + if (test_and_clear_bit(PC_DMA_ERROR, &pc->flags)) { + printk(KERN_WARNING "ide-tape: DMA disabled, " + "reverting to PIO\n"); + (void) HWIF(drive)->ide_dma_off(drive); + } + if (test_bit(PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma) { + if (test_bit(PC_WRITING, &pc->flags)) { + feature.b.dma = !HWIF(drive)->ide_dma_write(drive); + } else { + feature.b.dma = !HWIF(drive)->ide_dma_read(drive); + } } - if (test_bit (PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma) - dma_ok = !HWIF(drive)->dmaproc(test_bit (PC_WRITING, &pc->flags) ? ide_dma_write : ide_dma_read, drive); #endif /* CONFIG_BLK_DEV_IDEDMA */ if (IDE_CONTROL_REG) - OUT_BYTE (drive->ctl, IDE_CONTROL_REG); - OUT_BYTE (dma_ok ? 1 : 0, IDE_FEATURE_REG); /* Use PIO/DMA */ - OUT_BYTE (bcount.b.high, IDE_BCOUNTH_REG); - OUT_BYTE (bcount.b.low, IDE_BCOUNTL_REG); - OUT_BYTE (drive->select.all, IDE_SELECT_REG); + HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG); + /* Use PIO/DMA */ + HWIF(drive)->OUTB(feature.all, IDE_FEATURE_REG); + HWIF(drive)->OUTB(bcount.b.high, IDE_BCOUNTH_REG); + HWIF(drive)->OUTB(bcount.b.low, IDE_BCOUNTL_REG); + HWIF(drive)->OUTB(drive->select.all, IDE_SELECT_REG); #ifdef CONFIG_BLK_DEV_IDEDMA - if (dma_ok) { /* Begin DMA, if necessary */ - set_bit (PC_DMA_IN_PROGRESS, &pc->flags); - (void) (HWIF(drive)->dmaproc(ide_dma_begin, drive)); + if (feature.b.dma) { /* Begin DMA, if necessary */ + set_bit(PC_DMA_IN_PROGRESS, &pc->flags); + (void) (HWIF(drive)->ide_dma_begin(drive)); } #endif /* CONFIG_BLK_DEV_IDEDMA */ if (test_bit(IDETAPE_DRQ_INTERRUPT, &tape->flags)) { - ide_set_handler(drive, &idetape_transfer_pc, IDETAPE_WAIT_CMD, NULL); - OUT_BYTE(WIN_PACKETCMD, IDE_COMMAND_REG); + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, + &idetape_transfer_pc, + IDETAPE_WAIT_CMD, + NULL); + HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG); return ide_started; } else { - OUT_BYTE(WIN_PACKETCMD, IDE_COMMAND_REG); + HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG); return idetape_transfer_pc(drive); } } @@ -2348,22 +2436,22 @@ printk (KERN_INFO "ide-tape: Reached idetape_pc_callback\n"); #endif /* IDETAPE_DEBUG_LOG */ - idetape_end_request (tape->pc->error ? 0 : 1, HWGROUP(drive)); + idetape_end_request(drive, tape->pc->error ? 0 : 1); return ide_stopped; } /* * A mode sense command is used to "sense" tape parameters. */ -static void idetape_create_mode_sense_cmd (idetape_pc_t *pc, byte page_code) +static void idetape_create_mode_sense_cmd (idetape_pc_t *pc, u8 page_code) { idetape_init_pc (pc); pc->c[0] = IDETAPE_MODE_SENSE_CMD; if (page_code != IDETAPE_BLOCK_DESCRIPTOR) - pc->c[1] = 8; /* DBD = 1 - Don't return block descriptors */ + pc->c[1] = 8; /* DBD = 1 - Don't return block descriptors */ pc->c[2] = page_code; - pc->c[3] = 255; /* Don't limit the returned information */ - pc->c[4] = 255; /* (We will just discard data in that case) */ + pc->c[3] = 255; /* Don't limit the returned information */ + pc->c[4] = 255; /* (We will just discard data in that case) */ if (page_code == IDETAPE_BLOCK_DESCRIPTOR) pc->request_transfer = 12; else if (page_code == IDETAPE_CAPABILITIES_PAGE) @@ -2391,13 +2479,15 @@ } tape->tape_still_time = (jiffies - tape->tape_still_time_begin) * 1000 / HZ; #if USE_IOTRACE - IO_trace(IO_IDETAPE_FIFO, tape->pipeline_head, tape->buffer_head, tape->tape_head, tape->minor); + IO_trace(IO_IDETAPE_FIFO, tape->pipeline_head, tape->buffer_head, + tape->tape_head, tape->minor); #endif #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 1) - printk(KERN_INFO "ide-tape: buffer fill callback, %d/%d\n", tape->cur_frames, tape->max_frames); + printk(KERN_INFO "ide-tape: buffer fill callback, %d/%d\n", + tape->cur_frames, tape->max_frames); #endif - idetape_end_request (tape->pc->error ? 0 : 1, HWGROUP(drive)); + idetape_end_request(drive, tape->pc->error ? 0 : 1); return ide_stopped; } @@ -2429,7 +2519,8 @@ else if (time_after(jiffies, tape->controlled_previous_head_time)) tape->controlled_pipeline_head_speed = (tape->pipeline_head - tape->controlled_previous_pipeline_head) * 32 * HZ / (jiffies - tape->controlled_previous_head_time); - if (tape->nr_pending_stages < tape->max_stages /*- 1 */) { /* -1 for read mode error recovery */ + if (tape->nr_pending_stages < tape->max_stages /*- 1 */) { + /* -1 for read mode error recovery */ if (time_after(jiffies, tape->uncontrolled_previous_head_time + 10 * HZ)) { tape->uncontrolled_pipeline_head_time = jiffies; tape->uncontrolled_pipeline_head_speed = (tape->pipeline_head - tape->uncontrolled_previous_pipeline_head) * 32 * HZ / (jiffies - tape->uncontrolled_previous_head_time); @@ -2465,15 +2556,21 @@ { idetape_tape_t *tape = drive->driver_data; idetape_pc_t *pc = tape->pc; - idetape_status_reg_t status; + atapi_status_t status; if (tape->onstream) - printk(KERN_INFO "ide-tape: bug: onstream, media_access_finished\n"); - status.all = GET_STAT(); + printk(KERN_INFO "ide-tape: bug: " + "onstream, media_access_finished\n"); + + status.all = HWIF(drive)->INB(IDE_STATUS_REG); + if (status.b.dsc) { - if (status.b.check) { /* Error detected */ - printk (KERN_ERR "ide-tape: %s: I/O error, ",tape->name); - return idetape_retry_pc (drive); /* Retry operation */ + if (status.b.check) { + /* Error detected */ + printk(KERN_ERR "ide-tape: %s: I/O error, ", + tape->name); + /* Retry operation */ + return idetape_retry_pc(drive); } pc->error = 0; if (tape->failed_pc == pc) @@ -2510,16 +2607,16 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_rw_callback\n"); + printk(KERN_INFO "ide-tape: Reached idetape_rw_callback\n"); #endif /* IDETAPE_DEBUG_LOG */ tape->first_frame_position += blocks; rq->current_nr_sectors -= blocks; if (!tape->pc->error) - idetape_end_request (1, HWGROUP (drive)); + idetape_end_request(drive, 1); else - idetape_end_request (tape->pc->error, HWGROUP (drive)); + idetape_end_request(drive, tape->pc->error); return ide_stopped; } @@ -2528,7 +2625,7 @@ struct buffer_head *p = bh; idetape_init_pc (pc); pc->c[0] = IDETAPE_READ_CMD; - put_unaligned (htonl (length), (unsigned int *) &pc->c[1]); + put_unaligned(htonl (length), (unsigned int *) &pc->c[1]); pc->c[1] = 1; pc->callback = &idetape_rw_callback; pc->bh = bh; @@ -2543,11 +2640,11 @@ if (!tape->onstream) { pc->request_transfer = pc->buffer_size = length * tape->tape_block_size; if (pc->request_transfer == tape->stage_size) - set_bit (PC_DMA_RECOMMENDED, &pc->flags); + set_bit(PC_DMA_RECOMMENDED, &pc->flags); } else { if (length) { pc->request_transfer = pc->buffer_size = 32768 + 512; - set_bit (PC_DMA_RECOMMENDED, &pc->flags); + set_bit(PC_DMA_RECOMMENDED, &pc->flags); } else pc->request_transfer = 0; } @@ -2558,7 +2655,7 @@ int size = 32768; struct buffer_head *p = bh; - idetape_init_pc (pc); + idetape_init_pc(pc); pc->c[0] = IDETAPE_READ_BUFFER_CMD; pc->c[1] = IDETAPE_RETRIEVE_FAULTY_BLOCK; pc->c[7] = size >> 8; @@ -2577,9 +2674,9 @@ static void idetape_create_write_cmd (idetape_tape_t *tape, idetape_pc_t *pc, unsigned int length, struct buffer_head *bh) { struct buffer_head *p = bh; - idetape_init_pc (pc); + idetape_init_pc(pc); pc->c[0] = IDETAPE_WRITE_CMD; - put_unaligned (htonl (length), (unsigned int *) &pc->c[1]); + put_unaligned(htonl (length), (unsigned int *) &pc->c[1]); pc->c[1] = 1; pc->callback = &idetape_rw_callback; set_bit (PC_WRITING, &pc->flags); @@ -2596,17 +2693,49 @@ if (!tape->onstream) { pc->request_transfer = pc->buffer_size = length * tape->tape_block_size; if (pc->request_transfer == tape->stage_size) - set_bit (PC_DMA_RECOMMENDED, &pc->flags); + set_bit(PC_DMA_RECOMMENDED, &pc->flags); } else { if (length) { pc->request_transfer = pc->buffer_size = 32768 + 512; - set_bit (PC_DMA_RECOMMENDED, &pc->flags); + set_bit(PC_DMA_RECOMMENDED, &pc->flags); } else pc->request_transfer = 0; } } /* + * This is our end_request replacement function. + */ +static int idetape_do_end_request (ide_drive_t *drive, int uptodate) +{ + struct request *rq; + unsigned long flags; + int ret = 1; + + spin_lock_irqsave(&io_request_lock, flags); + rq = HWGROUP(drive)->rq; + + /* + * decide whether to reenable DMA -- 3 is a random magic for now, + * if we DMA timeout more than 3 times, just stay in PIO + */ + if (drive->state == DMA_PIO_RETRY && drive->retry_pio <= 3) { + drive->state = 0; + HWGROUP(drive)->hwif->ide_dma_on(drive); + } + + if (!end_that_request_first(rq, uptodate, drive->name)) { + add_blkdev_randomness(MAJOR(rq->rq_dev)); + blkdev_dequeue_request(rq); + HWGROUP(drive)->rq = NULL; + end_that_request_last(rq); + ret = 0; + } + spin_unlock_irqrestore(&io_request_lock, flags); + return ret; +} + +/* * idetape_do_request is our request handling function. */ static ide_startstop_t idetape_do_request (ide_drive_t *drive, struct request *rq, unsigned long block) @@ -2614,35 +2743,42 @@ idetape_tape_t *tape = drive->driver_data; idetape_pc_t *pc; struct request *postponed_rq = tape->postponed_rq; - idetape_status_reg_t status; + atapi_status_t status; #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 5) - printk (KERN_INFO "ide-tape: rq_status: %d, rq_dev: %u, cmd: %d, errors: %d\n",rq->rq_status,(unsigned int) rq->rq_dev,rq->cmd,rq->errors); + printk(KERN_INFO "ide-tape: rq_status: %d, " + "rq_dev: %u, cmd: %d, errors: %d\n", rq->rq_status, + (unsigned int) rq->rq_dev, rq->cmd, rq->errors); if (tape->debug_level >= 2) - printk (KERN_INFO "ide-tape: sector: %ld, nr_sectors: %ld, current_nr_sectors: %ld\n",rq->sector,rq->nr_sectors,rq->current_nr_sectors); + printk(KERN_INFO "ide-tape: sector: %ld, " + "nr_sectors: %ld, current_nr_sectors: %ld\n", + rq->sector, rq->nr_sectors, rq->current_nr_sectors); #endif /* IDETAPE_DEBUG_LOG */ - if (!IDETAPE_RQ_CMD (rq->cmd)) { + if (!IDETAPE_RQ_CMD(rq->cmd)) { /* * We do not support buffer cache originated requests. */ - printk (KERN_NOTICE "ide-tape: %s: Unsupported command in request queue (%d)\n", drive->name, rq->cmd); - ide_end_request (0, HWGROUP (drive)); /* Let the common code handle it */ + printk(KERN_NOTICE "ide-tape: %s: Unsupported command in " + "request queue (%d)\n", drive->name, rq->cmd); + idetape_do_end_request(drive, 0); return ide_stopped; } /* * Retry a failed packet command */ - if (tape->failed_pc != NULL && tape->pc->c[0] == IDETAPE_REQUEST_SENSE_CMD) { - return idetape_issue_packet_command (drive, tape->failed_pc); + if (tape->failed_pc != NULL && + tape->pc->c[0] == IDETAPE_REQUEST_SENSE_CMD) { + return idetape_issue_packet_command(drive, tape->failed_pc); } #if IDETAPE_DEBUG_BUGS if (postponed_rq != NULL) if (rq != postponed_rq) { - printk (KERN_ERR "ide-tape: ide-tape.c bug - Two DSC requests were queued\n"); - idetape_end_request (0, HWGROUP (drive)); + printk(KERN_ERR "ide-tape: ide-tape.c bug - " + "Two DSC requests were queued\n"); + idetape_end_request(drive, 0); return ide_stopped; } #endif /* IDETAPE_DEBUG_BUGS */ @@ -2653,7 +2789,7 @@ * If the tape is still busy, postpone our request and service * the other device meanwhile. */ - status.all = GET_STAT(); + status.all = HWIF(drive)->INB(IDE_STATUS_REG); /* * The OnStream tape drive doesn't support DSC. Assume @@ -2662,7 +2798,7 @@ if (tape->onstream) status.b.dsc = 1; if (!drive->dsc_overlap && rq->cmd != IDETAPE_PC_RQ2) - set_bit (IDETAPE_IGNORE_DSC, &tape->flags); + set_bit(IDETAPE_IGNORE_DSC, &tape->flags); /* * For the OnStream tape, check the current status of the tape @@ -2674,7 +2810,8 @@ */ if (tape->tape_still_time > 100 && tape->tape_still_time < 200) tape->measure_insert_time = 1; - if (tape->req_buffer_fill && (rq->cmd == IDETAPE_WRITE_RQ || rq->cmd == IDETAPE_READ_RQ)) { + if (tape->req_buffer_fill && + (rq->cmd == IDETAPE_WRITE_RQ || rq->cmd == IDETAPE_READ_RQ)) { tape->req_buffer_fill = 0; tape->writes_since_buffer_fill = 0; tape->reads_since_buffer_fill = 0; @@ -2699,7 +2836,8 @@ tape->insert_speed > tape->max_insert_speed ) ) && rq->nr_sectors) ) ) { #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk(KERN_INFO "ide-tape: postponing request, cmd %d, cur %d, max %d\n", + printk(KERN_INFO "ide-tape: postponing request, " + "cmd %d, cur %d, max %d\n", rq->cmd, tape->cur_frames, tape->max_frames); #endif if (tape->postpone_cnt++ < 500) { @@ -2708,25 +2846,28 @@ } #if ONSTREAM_DEBUG else if (tape->debug_level >= 4) - printk(KERN_INFO "ide-tape: %s: postpone_cnt %d\n", tape->name, tape->postpone_cnt); + printk(KERN_INFO "ide-tape: %s: postpone_cnt %d\n", + tape->name, tape->postpone_cnt); #endif } - if (!test_and_clear_bit (IDETAPE_IGNORE_DSC, &tape->flags) && !status.b.dsc) { + if (!test_and_clear_bit(IDETAPE_IGNORE_DSC, &tape->flags) && + !status.b.dsc) { if (postponed_rq == NULL) { tape->dsc_polling_start = jiffies; tape->dsc_polling_frequency = tape->best_dsc_rw_frequency; tape->dsc_timeout = jiffies + IDETAPE_DSC_RW_TIMEOUT; } else if ((signed long) (jiffies - tape->dsc_timeout) > 0) { - printk (KERN_ERR "ide-tape: %s: DSC timeout\n", tape->name); + printk(KERN_ERR "ide-tape: %s: DSC timeout\n", + tape->name); if (rq->cmd == IDETAPE_PC_RQ2) { - idetape_media_access_finished (drive); + idetape_media_access_finished(drive); return ide_stopped; } else { - return ide_do_reset (drive); + return ide_do_reset(drive); } } else if (jiffies - tape->dsc_polling_start > IDETAPE_DSC_MA_THRESHOLD) tape->dsc_polling_frequency = IDETAPE_DSC_MA_SLOW; - idetape_postpone_request (drive); + idetape_postpone_request(drive); return ide_stopped; } switch (rq->cmd) { @@ -2743,8 +2884,8 @@ if (time_after(jiffies, tape->last_buffer_fill + 5 * HZ / 100)) tape->req_buffer_fill = 1; } - pc = idetape_next_pc_storage (drive); - idetape_create_read_cmd (tape, pc, rq->current_nr_sectors, rq->bh); + pc = idetape_next_pc_storage(drive); + idetape_create_read_cmd(tape, pc, rq->current_nr_sectors, rq->bh); break; case IDETAPE_WRITE_RQ: tape->buffer_head++; @@ -2760,39 +2901,41 @@ tape->req_buffer_fill = 1; calculate_speeds(drive); } - pc = idetape_next_pc_storage (drive); - idetape_create_write_cmd (tape, pc, rq->current_nr_sectors, rq->bh); + pc = idetape_next_pc_storage(drive); + idetape_create_write_cmd(tape, pc, rq->current_nr_sectors, rq->bh); break; case IDETAPE_READ_BUFFER_RQ: tape->postpone_cnt = 0; - pc = idetape_next_pc_storage (drive); - idetape_create_read_buffer_cmd (tape, pc, rq->current_nr_sectors, rq->bh); + pc = idetape_next_pc_storage(drive); + idetape_create_read_buffer_cmd(tape, pc, rq->current_nr_sectors, rq->bh); break; case IDETAPE_ABORTED_WRITE_RQ: rq->cmd = IDETAPE_WRITE_RQ; - idetape_end_request (IDETAPE_ERROR_EOD, HWGROUP(drive)); + idetape_end_request(drive, IDETAPE_ERROR_EOD); return ide_stopped; case IDETAPE_ABORTED_READ_RQ: #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: %s: detected aborted read rq\n", tape->name); + printk(KERN_INFO "ide-tape: %s: detected " + "aborted read rq\n", tape->name); #endif rq->cmd = IDETAPE_READ_RQ; - idetape_end_request (IDETAPE_ERROR_EOD, HWGROUP(drive)); + idetape_end_request(drive, IDETAPE_ERROR_EOD); return ide_stopped; case IDETAPE_PC_RQ1: pc = (idetape_pc_t *) rq->buffer; rq->cmd = IDETAPE_PC_RQ2; break; case IDETAPE_PC_RQ2: - idetape_media_access_finished (drive); + idetape_media_access_finished(drive); return ide_stopped; default: - printk (KERN_ERR "ide-tape: bug in IDETAPE_RQ_CMD macro\n"); - idetape_end_request (0, HWGROUP (drive)); + printk(KERN_ERR "ide-tape: bug in " + "IDETAPE_RQ_CMD macro\n"); + idetape_end_request(drive, 0); return ide_stopped; } - return idetape_issue_packet_command (drive, pc); + return idetape_issue_packet_command(drive, pc); } /* @@ -2826,11 +2969,11 @@ int pages = tape->pages_per_stage; char *b_data; - if ((stage = (idetape_stage_t *) kmalloc (sizeof (idetape_stage_t),GFP_KERNEL)) == NULL) + if ((stage = (idetape_stage_t *) kmalloc(sizeof(idetape_stage_t),GFP_KERNEL)) == NULL) return NULL; stage->next = NULL; - bh = stage->bh = (struct buffer_head *) kmalloc (sizeof (struct buffer_head), GFP_KERNEL); + bh = stage->bh = (struct buffer_head *) kmalloc(sizeof(struct buffer_head), GFP_KERNEL); if (bh == NULL) goto abort; bh->b_reqnext = NULL; @@ -2840,7 +2983,7 @@ memset(bh->b_data, 0, PAGE_SIZE); bh->b_size = PAGE_SIZE; atomic_set(&bh->b_count, full ? bh->b_size : 0); - set_bit (BH_Lock, &bh->b_state); + set_bit(BH_Lock, &bh->b_state); while (--pages) { if ((b_data = (char *) __get_free_page (GFP_KERNEL)) == NULL) @@ -2861,15 +3004,15 @@ continue; } prev_bh = bh; - if ((bh = (struct buffer_head *) kmalloc (sizeof (struct buffer_head), GFP_KERNEL)) == NULL) { - free_page ((unsigned long) b_data); + if ((bh = (struct buffer_head *) kmalloc(sizeof(struct buffer_head), GFP_KERNEL)) == NULL) { + free_page((unsigned long) b_data); goto abort; } bh->b_reqnext = NULL; bh->b_data = b_data; bh->b_size = PAGE_SIZE; atomic_set(&bh->b_count, full ? bh->b_size : 0); - set_bit (BH_Lock, &bh->b_state); + set_bit(BH_Lock, &bh->b_state); prev_bh->b_reqnext = bh; } bh->b_size -= tape->excess_bh_size; @@ -2879,7 +3022,7 @@ stage->aux = (os_aux_t *) (bh->b_data + bh->b_size - OS_AUX_SIZE); return stage; abort: - __idetape_kfree_stage (stage); + __idetape_kfree_stage(stage); return NULL; } @@ -2889,7 +3032,7 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_kmalloc_stage\n"); + printk (KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__); #endif /* IDETAPE_DEBUG_LOG */ if (tape->nr_stages >= tape->max_stages) @@ -2898,7 +3041,7 @@ tape->cache_stage = NULL; return cache_stage; } - return __idetape_kmalloc_stage (tape, 0, 0); + return __idetape_kmalloc_stage(tape, 0, 0); } static void idetape_copy_stage_from_user (idetape_tape_t *tape, idetape_stage_t *stage, const char *buf, int n) @@ -2909,12 +3052,13 @@ while (n) { #if IDETAPE_DEBUG_BUGS if (bh == NULL) { - printk (KERN_ERR "ide-tape: bh == NULL in idetape_copy_stage_from_user\n"); + printk(KERN_ERR "ide-tape: bh == NULL in %s\n", + __FUNCTION__); return; } #endif /* IDETAPE_DEBUG_BUGS */ - count = IDE_MIN (bh->b_size - atomic_read(&bh->b_count), n); - copy_from_user (bh->b_data + atomic_read(&bh->b_count), buf, count); + count = IDE_MIN(bh->b_size - atomic_read(&bh->b_count), n); + copy_from_user(bh->b_data + atomic_read(&bh->b_count), buf, count); n -= count; atomic_add(count, &bh->b_count); buf += count; @@ -2935,12 +3079,13 @@ while (n) { #if IDETAPE_DEBUG_BUGS if (bh == NULL) { - printk (KERN_ERR "ide-tape: bh == NULL in idetape_copy_stage_to_user\n"); + printk(KERN_ERR "ide-tape: bh == NULL in %s\n", + __FUNCTION__); return; } #endif /* IDETAPE_DEBUG_BUGS */ - count = IDE_MIN (tape->b_count, n); - copy_to_user (buf, tape->b_data, count); + count = IDE_MIN(tape->b_count, n); + copy_to_user(buf, tape->b_data, count); n -= count; tape->b_data += count; tape->b_count -= count; @@ -2960,9 +3105,9 @@ struct buffer_head *bh = tape->merge_stage->bh; tape->bh = bh; - if (tape->chrdev_direction == idetape_direction_write) + if (tape->chrdev_direction == idetape_direction_write) { atomic_set(&bh->b_count, 0); - else { + } else { tape->b_data = bh->b_data; tape->b_count = atomic_read(&bh->b_count); } @@ -2973,9 +3118,12 @@ struct buffer_head *tmp; os_aux_t *tmp_aux; - tmp = stage->bh; tmp_aux = stage->aux; - stage->bh = tape->merge_stage->bh; stage->aux = tape->merge_stage->aux; - tape->merge_stage->bh = tmp; tape->merge_stage->aux = tmp_aux; + tmp = stage->bh; + tmp_aux = stage->aux; + stage->bh = tape->merge_stage->bh; + stage->aux = tape->merge_stage->aux; + tape->merge_stage->bh = tmp; + tape->merge_stage->aux = tmp_aux; idetape_init_merge_stage (tape); } @@ -2989,10 +3137,10 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_add_stage_tail\n"); + printk(KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__); #endif /* IDETAPE_DEBUG_LOG */ spin_lock_irqsave(&tape->spinlock, flags); - stage->next=NULL; + stage->next = NULL; if (tape->last_stage != NULL) tape->last_stage->next=stage; else @@ -3058,10 +3206,13 @@ else dat->dat_list[0].flags = OS_DAT_FLAGS_DATA; dat->dat_list[0].reserved = 0; - } - aux->filemark_cnt = ntohl(tape->filemark_cnt); /* shouldn't this be htonl ?? */ - aux->phys_fm = ntohl(0xffffffff); /* shouldn't this be htonl ?? */ - aux->last_mark_addr = ntohl(tape->last_mark_addr); /* shouldn't this be htonl ?? */ + } + /* shouldn't this be htonl ?? */ + aux->filemark_cnt = ntohl(tape->filemark_cnt); + /* shouldn't this be htonl ?? */ + aux->phys_fm = ntohl(0xffffffff); + /* shouldn't this be htonl ?? */ + aux->last_mark_addr = ntohl(tape->last_mark_addr); } /* @@ -3078,7 +3229,8 @@ #if IDETAPE_DEBUG_BUGS if (rq == NULL || !IDETAPE_RQ_CMD (rq->cmd)) { - printk (KERN_ERR "ide-tape: bug: Trying to sleep on non-valid request\n"); + printk(KERN_ERR "ide-tape: bug: Trying to sleep on " + "non-valid request\n"); return; } #endif /* IDETAPE_DEBUG_BUGS */ @@ -3098,35 +3250,39 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_read_position_callback\n"); + printk(KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__); #endif /* IDETAPE_DEBUG_LOG */ if (!tape->pc->error) { result = (idetape_read_position_result_t *) tape->pc->buffer; #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 2) - printk (KERN_INFO "ide-tape: BOP - %s\n",result->bop ? "Yes":"No"); + printk(KERN_INFO "ide-tape: BOP - %s\n", + result->bop ? "Yes":"No"); if (tape->debug_level >= 2) - printk (KERN_INFO "ide-tape: EOP - %s\n",result->eop ? "Yes":"No"); + printk(KERN_INFO "ide-tape: EOP - %s\n", + result->eop ? "Yes":"No"); #endif /* IDETAPE_DEBUG_LOG */ if (result->bpu) { - printk (KERN_INFO "ide-tape: Block location is unknown to the tape\n"); - clear_bit (IDETAPE_ADDRESS_VALID, &tape->flags); - idetape_end_request (0, HWGROUP (drive)); + printk(KERN_INFO "ide-tape: Block location is " + "unknown to the tape\n"); + clear_bit(IDETAPE_ADDRESS_VALID, &tape->flags); + idetape_end_request(drive, 0); } else { #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 2) - printk (KERN_INFO "ide-tape: Block Location - %u\n", ntohl (result->first_block)); + printk(KERN_INFO "ide-tape: Block Location " + "- %u\n", ntohl(result->first_block)); #endif /* IDETAPE_DEBUG_LOG */ tape->partition = result->partition; - tape->first_frame_position = ntohl (result->first_block); - tape->last_frame_position = ntohl (result->last_block); + tape->first_frame_position = ntohl(result->first_block); + tape->last_frame_position = ntohl(result->last_block); tape->blocks_in_buffer = result->blocks_in_buffer[2]; - set_bit (IDETAPE_ADDRESS_VALID, &tape->flags); - idetape_end_request (1, HWGROUP (drive)); + set_bit(IDETAPE_ADDRESS_VALID, &tape->flags); + idetape_end_request(drive, 1); } } else { - idetape_end_request (0, HWGROUP (drive)); + idetape_end_request(drive, 0); } return ide_stopped; } @@ -3143,12 +3299,12 @@ { idetape_tape_t *tape = drive->driver_data; - idetape_init_pc (pc); + idetape_init_pc(pc); pc->c[0] = IDETAPE_WRITE_FILEMARK_CMD; if (tape->onstream) pc->c[1] = 1; /* Immed bit */ pc->c[4] = write_filemark; /* not used for OnStream ?? */ - set_bit (PC_WAIT_FOR_DSC, &pc->flags); + set_bit(PC_WAIT_FOR_DSC, &pc->flags); pc->callback = &idetape_pc_callback; } @@ -3165,8 +3321,8 @@ * ide_do_drive_cmd from ide.c * cdrom_queue_request and cdrom_queue_packet_command from ide-cd.c * - * We add a special packet command request to the tail of the request queue, - * and wait for it to be serviced. + * We add a special packet command request to the tail of the request + * queue, and wait for it to be serviced. * * This is not to be called from within the request handling part * of the driver ! We allocate here data in the stack, and it is valid @@ -3183,17 +3339,17 @@ { struct request rq; - ide_init_drive_cmd (&rq); + ide_init_drive_cmd(&rq); rq.buffer = (char *) pc; rq.cmd = IDETAPE_PC_RQ1; - return ide_do_drive_cmd (drive, &rq, ide_wait); + return ide_do_drive_cmd(drive, &rq, ide_wait); } static void idetape_create_load_unload_cmd (ide_drive_t *drive, idetape_pc_t *pc,int cmd) { idetape_tape_t *tape = drive->driver_data; - idetape_init_pc (pc); + idetape_init_pc(pc); pc->c[0] = IDETAPE_LOAD_UNLOAD_CMD; pc->c[4] = cmd; if (tape->onstream) { @@ -3201,7 +3357,7 @@ if (cmd == !IDETAPE_LU_LOAD_MASK) pc->c[4] = 4; } - set_bit (PC_WAIT_FOR_DSC, &pc->flags); + set_bit(PC_WAIT_FOR_DSC, &pc->flags); pc->callback = &idetape_pc_callback; } @@ -3219,13 +3375,14 @@ if (!__idetape_queue_pc_tail(drive, &pc)) return 0; if (tape->sense_key == 2 && tape->asc == 4 && tape->ascq == 2) { - idetape_create_load_unload_cmd (drive, &pc, IDETAPE_LU_LOAD_MASK); + idetape_create_load_unload_cmd(drive, &pc, IDETAPE_LU_LOAD_MASK); __idetape_queue_pc_tail(drive, &pc); idetape_create_test_unit_ready_cmd(&pc); if (!__idetape_queue_pc_tail(drive, &pc)) return 0; } - if (!(tape->sense_key == 2 && tape->asc == 4 && (tape->ascq == 1 || tape->ascq == 8))) + if (!(tape->sense_key == 2 && tape->asc == 4 && + (tape->ascq == 1 || tape->ascq == 8))) break; current->state = TASK_INTERRUPTIBLE; schedule_timeout(HZ / 10); @@ -3241,9 +3398,13 @@ rc = __idetape_queue_pc_tail(drive, pc); if (rc) return rc; - if (tape->onstream && test_bit(PC_WAIT_FOR_DSC, &pc->flags)) - rc = idetape_wait_ready(drive, 60 * 10 * HZ); /* AJN-4: Changed from 5 to 10 minutes; - because retension takes approx. 8:20 with Onstream 30GB tape */ + if (tape->onstream && test_bit(PC_WAIT_FOR_DSC, &pc->flags)) { + /* AJN-4: Changed from 5 to 10 minutes; + * because retension takes approx. + * 8:20 with Onstream 30GB tape + */ + rc = idetape_wait_ready(drive, 60 * 10 * HZ); + } return rc; } @@ -3261,7 +3422,7 @@ static void idetape_create_read_position_cmd (idetape_pc_t *pc) { - idetape_init_pc (pc); + idetape_init_pc(pc); pc->c[0] = IDETAPE_READ_POSITION_CMD; pc->request_transfer = 20; pc->callback = &idetape_read_position_callback; @@ -3275,14 +3436,14 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_read_position\n"); + printk (KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__); #endif /* IDETAPE_DEBUG_LOG */ #ifdef NO_LONGER_REQUIRED idetape_flush_tape_buffers(drive); #endif idetape_create_read_position_cmd(&pc); - if (idetape_queue_pc_tail (drive, &pc)) + if (idetape_queue_pc_tail(drive, &pc)) return -1; position = tape->first_frame_position; #ifdef NO_LONGER_REQUIRED @@ -3290,7 +3451,11 @@ if ((position != tape->last_frame_position - tape->blocks_in_buffer) && (position != tape->last_frame_position + tape->blocks_in_buffer)) { if (tape->blocks_in_buffer == 0) { - printk("ide-tape: %s: correcting read position %d, %d, %d\n", tape->name, position, tape->last_frame_position, tape->blocks_in_buffer); + printk("ide-tape: %s: correcting read " + "position %d, %d, %d\n", + tape->name, position, + tape->last_frame_position, + tape->blocks_in_buffer); position = tape->last_frame_position; tape->first_frame_position = position; } @@ -3300,17 +3465,17 @@ return position; } -static void idetape_create_locate_cmd (ide_drive_t *drive, idetape_pc_t *pc, unsigned int block, byte partition, int skip) +static void idetape_create_locate_cmd (ide_drive_t *drive, idetape_pc_t *pc, unsigned int block, u8 partition, int skip) { idetape_tape_t *tape = drive->driver_data; - idetape_init_pc (pc); + idetape_init_pc(pc); pc->c[0] = IDETAPE_LOCATE_CMD; if (tape->onstream) pc->c[1] = 1; /* Immediate bit */ else pc->c[1] = 2; - put_unaligned (htonl (block), (unsigned int *) &pc->c[3]); + put_unaligned(htonl(block), (unsigned int *) &pc->c[3]); pc->c[8] = partition; if (tape->onstream) /* @@ -3319,7 +3484,7 @@ * data in the drive to this new position! */ pc->c[9] = skip << 7; - set_bit (PC_WAIT_FOR_DSC, &pc->flags); + set_bit(PC_WAIT_FOR_DSC, &pc->flags); pc->callback = &idetape_pc_callback; } @@ -3347,7 +3512,7 @@ return 0; tape->merge_stage_size = 0; if (tape->merge_stage != NULL) { - __idetape_kfree_stage (tape->merge_stage); + __idetape_kfree_stage(tape->merge_stage); tape->merge_stage = NULL; } tape->chrdev_direction = idetape_direction_none; @@ -3357,13 +3522,13 @@ spin_lock_irqsave(&tape->spinlock, flags); tape->next_stage = NULL; - if (idetape_pipeline_active (tape)) + if (idetape_pipeline_active(tape)) idetape_wait_for_request(drive, tape->active_data_request); spin_unlock_irqrestore(&tape->spinlock, flags); cnt = tape->nr_stages - tape->nr_pending_stages; while (tape->first_stage != NULL) - idetape_remove_stage_head (drive); + idetape_remove_stage_head(drive); tape->nr_pending_stages = 0; tape->max_stages = tape->min_pipeline; return cnt; @@ -3378,7 +3543,7 @@ * of the request queue and wait for their completion. * */ -static int idetape_position_tape (ide_drive_t *drive, unsigned int block, byte partition, int skip) +static int idetape_position_tape (ide_drive_t *drive, unsigned int block, u8 partition, int skip) { idetape_tape_t *tape = drive->driver_data; int retval; @@ -3387,13 +3552,13 @@ if (tape->chrdev_direction == idetape_direction_read) __idetape_discard_read_pipeline(drive); idetape_wait_ready(drive, 60 * 5 * HZ); - idetape_create_locate_cmd (drive, &pc, block, partition, skip); - retval = idetape_queue_pc_tail (drive, &pc); + idetape_create_locate_cmd(drive, &pc, block, partition, skip); + retval = idetape_queue_pc_tail(drive, &pc); if (retval) return (retval); - idetape_create_read_position_cmd (&pc); - return (idetape_queue_pc_tail (drive, &pc)); + idetape_create_read_position_cmd(&pc); + return (idetape_queue_pc_tail(drive, &pc)); } static void idetape_discard_read_pipeline (ide_drive_t *drive, int restore_position) @@ -3407,11 +3572,13 @@ position = idetape_read_position(drive); #if ONSTREAM_DEBUG if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: address %u, nr_stages %d\n", position, cnt); + printk(KERN_INFO "ide-tape: address %u, nr_stages %d\n", + position, cnt); #endif seek = position > cnt ? position - cnt : 0; if (idetape_position_tape(drive, seek, 0, 0)) { - printk(KERN_INFO "ide-tape: %s: position_tape failed in discard_pipeline()\n", tape->name); + printk(KERN_INFO "ide-tape: %s: position_tape " + "failed in discard_pipeline()\n", tape->name); return; } } @@ -3421,7 +3588,7 @@ { idetape_pc_t pc; - idetape_create_mode_sense_cmd (&pc, IDETAPE_BUFFER_FILLING_PAGE); + idetape_create_mode_sense_cmd(&pc, IDETAPE_BUFFER_FILLING_PAGE); pc.callback = idetape_onstream_buffer_fill_callback; (void) idetape_queue_pc_tail(drive, &pc); } @@ -3437,29 +3604,30 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 2) - printk (KERN_INFO "ide-tape: idetape_queue_rw_tail: cmd=%d\n",cmd); + printk(KERN_INFO "ide-tape: %s: cmd=%d\n", __FUNCTION__, cmd); #endif /* IDETAPE_DEBUG_LOG */ #if IDETAPE_DEBUG_BUGS if (idetape_pipeline_active (tape)) { - printk (KERN_ERR "ide-tape: bug: the pipeline is active in idetape_queue_rw_tail\n"); + printk(KERN_ERR "ide-tape: bug: the pipeline is active in %s\n", + __FUNCTION__); return (0); } #endif /* IDETAPE_DEBUG_BUGS */ - ide_init_drive_cmd (&rq); + ide_init_drive_cmd(&rq); rq.bh = bh; rq.cmd = cmd; rq.sector = tape->first_frame_position; rq.nr_sectors = rq.current_nr_sectors = blocks; if (tape->onstream) tape->postpone_cnt = 600; - (void) ide_do_drive_cmd (drive, &rq, ide_wait); + (void) ide_do_drive_cmd(drive, &rq, ide_wait); if (cmd != IDETAPE_READ_RQ && cmd != IDETAPE_WRITE_RQ) return 0; if (tape->merge_stage) - idetape_init_merge_stage (tape); + idetape_init_merge_stage(tape); if (rq.errors == IDETAPE_ERROR_GENERAL) return -EIO; return (tape->tape_block_size * (blocks-rq.current_nr_sectors)); @@ -3517,7 +3685,8 @@ idetape_update_stats(drive); #if ONSTREAM_DEBUG if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: %s: frames left in buffer: %d\n", tape->name, tape->cur_frames); + printk(KERN_INFO "ide-tape: %s: frames left in buffer: %d\n", + tape->name, tape->cur_frames); #endif } @@ -3578,12 +3747,12 @@ if (tape->next_stage == NULL) return; - if (!idetape_pipeline_active (tape)) { + if (!idetape_pipeline_active(tape)) { if (tape->onstream_write_error) idetape_onstream_write_error_recovery(drive); set_bit(IDETAPE_PIPELINE_ACTIVE, &tape->flags); - idetape_active_next_stage (drive); - (void) ide_do_drive_cmd (drive, tape->active_data_request, ide_end); + idetape_active_next_stage(drive); + (void) ide_do_drive_cmd(drive, tape->active_data_request, ide_end); } } @@ -3599,41 +3768,41 @@ { idetape_tape_t *tape = drive->driver_data; - idetape_init_pc (pc); + idetape_init_pc(pc); pc->c[0] = IDETAPE_REWIND_CMD; if (tape->onstream) pc->c[1] = 1; - set_bit (PC_WAIT_FOR_DSC, &pc->flags); + set_bit(PC_WAIT_FOR_DSC, &pc->flags); pc->callback = &idetape_pc_callback; } static void idetape_create_mode_select_cmd (idetape_pc_t *pc, int length) { - idetape_init_pc (pc); - set_bit (PC_WRITING, &pc->flags); + idetape_init_pc(pc); + set_bit(PC_WRITING, &pc->flags); pc->c[0] = IDETAPE_MODE_SELECT_CMD; pc->c[1] = 0x10; - put_unaligned (htons(length), (unsigned short *) &pc->c[3]); + put_unaligned(htons(length), (unsigned short *) &pc->c[3]); pc->request_transfer = 255; pc->callback = &idetape_pc_callback; } static void idetape_create_erase_cmd (idetape_pc_t *pc) { - idetape_init_pc (pc); + idetape_init_pc(pc); pc->c[0] = IDETAPE_ERASE_CMD; pc->c[1] = 1; - set_bit (PC_WAIT_FOR_DSC, &pc->flags); + set_bit(PC_WAIT_FOR_DSC, &pc->flags); pc->callback = &idetape_pc_callback; } -static void idetape_create_space_cmd (idetape_pc_t *pc,int count,byte cmd) +static void idetape_create_space_cmd (idetape_pc_t *pc,int count,u8 cmd) { - idetape_init_pc (pc); + idetape_init_pc(pc); pc->c[0] = IDETAPE_SPACE_CMD; - put_unaligned (htonl (count), (unsigned int *) &pc->c[1]); + put_unaligned(htonl (count), (unsigned int *) &pc->c[1]); pc->c[1] = cmd; - set_bit (PC_WAIT_FOR_DSC, &pc->flags); + set_bit(PC_WAIT_FOR_DSC, &pc->flags); pc->callback = &idetape_pc_callback; } @@ -3662,48 +3831,70 @@ return 1; } if (rq->errors == IDETAPE_ERROR_GENERAL) { - printk(KERN_INFO "ide-tape: %s: skipping frame %d, read error\n", tape->name, tape->first_frame_position); + printk(KERN_INFO "ide-tape: %s: skipping frame %d, " + "read error\n", tape->name, tape->first_frame_position); return 0; } if (rq->errors == IDETAPE_ERROR_EOD) { - printk(KERN_INFO "ide-tape: %s: skipping frame %d, eod\n", tape->name, tape->first_frame_position); + printk(KERN_INFO "ide-tape: %s: skipping frame %d, eod\n", + tape->name, tape->first_frame_position); return 0; } if (ntohl(aux->format_id) != 0) { - printk(KERN_INFO "ide-tape: %s: skipping frame %d, format_id %u\n", tape->name, tape->first_frame_position, ntohl(aux->format_id)); + printk(KERN_INFO "ide-tape: %s: skipping frame %d, " + "format_id %u\n", tape->name, + tape->first_frame_position, ntohl(aux->format_id)); return 0; } if (memcmp(aux->application_sig, tape->application_sig, 4) != 0) { - printk(KERN_INFO "ide-tape: %s: skipping frame %d, incorrect application signature\n", tape->name, tape->first_frame_position); + printk(KERN_INFO "ide-tape: %s: skipping frame %d, " + "incorrect application signature\n", + tape->name, tape->first_frame_position); return 0; } if (aux->frame_type != OS_FRAME_TYPE_DATA && aux->frame_type != OS_FRAME_TYPE_EOD && aux->frame_type != OS_FRAME_TYPE_MARKER) { - printk(KERN_INFO "ide-tape: %s: skipping frame %d, frame type %x\n", tape->name, tape->first_frame_position, aux->frame_type); + printk(KERN_INFO "ide-tape: %s: skipping frame %d, frame " + "type %x\n", tape->name, + tape->first_frame_position, aux->frame_type); return 0; } if (par->partition_num != OS_DATA_PARTITION) { if (!tape->linux_media || tape->linux_media_version != 2) { - printk(KERN_INFO "ide-tape: %s: skipping frame %d, partition num %d\n", tape->name, tape->first_frame_position, par->partition_num); + printk(KERN_INFO "ide-tape: %s: skipping frame %d, " + "partition num %d\n", tape->name, + tape->first_frame_position, par->partition_num); return 0; } } if (par->par_desc_ver != OS_PARTITION_VERSION) { - printk(KERN_INFO "ide-tape: %s: skipping frame %d, partition version %d\n", tape->name, tape->first_frame_position, par->par_desc_ver); + printk(KERN_INFO "ide-tape: %s: skipping frame %d, " + "partition version %d\n", tape->name, + tape->first_frame_position, par->par_desc_ver); return 0; } if (ntohs(par->wrt_pass_cntr) != tape->wrt_pass_cntr) { - printk(KERN_INFO "ide-tape: %s: skipping frame %d, wrt_pass_cntr %d (expected %d)(logical_blk_num %u)\n", tape->name, tape->first_frame_position, ntohs(par->wrt_pass_cntr), tape->wrt_pass_cntr, ntohl(aux->logical_blk_num)); + printk(KERN_INFO "ide-tape: %s: skipping frame %d, " + "wrt_pass_cntr %d (expected %d)(logical_blk_num %u)\n", + tape->name, tape->first_frame_position, + ntohs(par->wrt_pass_cntr), tape->wrt_pass_cntr, + ntohl(aux->logical_blk_num)); return 0; } if (aux->frame_seq_num != aux->logical_blk_num) { - printk(KERN_INFO "ide-tape: %s: skipping frame %d, seq != logical\n", tape->name, tape->first_frame_position); + printk(KERN_INFO "ide-tape: %s: skipping frame %d, " + "seq != logical\n", tape->name, + tape->first_frame_position); return 0; } - if (logical_blk_num != -1 && ntohl(aux->logical_blk_num) != logical_blk_num) { + if (logical_blk_num != -1 && + ntohl(aux->logical_blk_num) != logical_blk_num) { if (!quiet) - printk(KERN_INFO "ide-tape: %s: skipping frame %d, logical_blk_num %u (expected %d)\n", tape->name, tape->first_frame_position, ntohl(aux->logical_blk_num), logical_blk_num); + printk(KERN_INFO "ide-tape: %s: skipping frame %d, " + "logical_blk_num %u (expected %d)\n", + tape->name, tape->first_frame_position, + ntohl(aux->logical_blk_num), logical_blk_num); return 0; } if (aux->frame_type == OS_FRAME_TYPE_MARKER) { @@ -3746,7 +3937,7 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 3) - printk (KERN_INFO "ide-tape: Reached idetape_add_chrdev_write_request\n"); + printk(KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__); #endif /* IDETAPE_DEBUG_LOG */ /* @@ -3755,31 +3946,32 @@ */ while ((new_stage = idetape_kmalloc_stage (tape)) == NULL) { spin_lock_irqsave(&tape->spinlock, flags); - if (idetape_pipeline_active (tape)) { + if (idetape_pipeline_active(tape)) { idetape_wait_for_request(drive, tape->active_data_request); spin_unlock_irqrestore(&tape->spinlock, flags); } else { spin_unlock_irqrestore(&tape->spinlock, flags); - idetape_insert_pipeline_into_queue (drive); - if (idetape_pipeline_active (tape)) + idetape_insert_pipeline_into_queue(drive); + if (idetape_pipeline_active(tape)) continue; /* * Linux is short on memory. Fallback to * non-pipelined operation mode for this request. */ - return idetape_queue_rw_tail (drive, IDETAPE_WRITE_RQ, blocks, tape->merge_stage->bh); + return idetape_queue_rw_tail(drive, IDETAPE_WRITE_RQ, blocks, tape->merge_stage->bh); } } rq = &new_stage->rq; - ide_init_drive_cmd (rq); + ide_init_drive_cmd(rq); rq->cmd = IDETAPE_WRITE_RQ; - rq->sector = tape->first_frame_position; /* Doesn't actually matter - We always assume sequential access */ + /* Doesn't actually matter - We always assume sequential access */ + rq->sector = tape->first_frame_position; rq->nr_sectors = rq->current_nr_sectors = blocks; idetape_switch_buffers (tape, new_stage); idetape_init_stage(drive, new_stage, OS_FRAME_TYPE_DATA, tape->logical_blk_num); tape->logical_blk_num++; - idetape_add_stage_tail (drive, new_stage); + idetape_add_stage_tail(drive, new_stage); tape->pipeline_head++; #if USE_IOTRACE IO_trace(IO_IDETAPE_FIFO, tape->pipeline_head, tape->buffer_head, tape->tape_head, tape->minor); @@ -3813,10 +4005,11 @@ } else if (tape->onstream) { idetape_update_stats(drive); if (tape->cur_frames > 5) - idetape_insert_pipeline_into_queue (drive); + idetape_insert_pipeline_into_queue(drive); } } - if (test_and_clear_bit (IDETAPE_PIPELINE_ERROR, &tape->flags)) /* Return a deferred error */ + if (test_and_clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags)) + /* Return a deferred error */ return -EIO; return blocks; } @@ -3831,7 +4024,7 @@ unsigned long flags; while (tape->next_stage || idetape_pipeline_active(tape)) { - idetape_insert_pipeline_into_queue (drive); + idetape_insert_pipeline_into_queue(drive); spin_lock_irqsave(&tape->spinlock, flags); if (idetape_pipeline_active(tape)) idetape_wait_for_request(drive, tape->active_data_request); @@ -3847,11 +4040,12 @@ #if IDETAPE_DEBUG_BUGS if (tape->chrdev_direction != idetape_direction_write) { - printk (KERN_ERR "ide-tape: bug: Trying to empty write pipeline, but we are not writing.\n"); + printk(KERN_ERR "ide-tape: bug: Trying to empty write " + "pipeline, but we are not writing.\n"); return; } if (tape->merge_stage_size > tape->stage_size) { - printk (KERN_ERR "ide-tape: bug: merge_buffer too big\n"); + printk(KERN_ERR "ide-tape: bug: merge_buffer too big\n"); tape->merge_stage_size = tape->stage_size; } #endif /* IDETAPE_DEBUG_BUGS */ @@ -3878,15 +4072,15 @@ bh = bh->b_reqnext; } } - (void) idetape_add_chrdev_write_request (drive, blocks); + (void) idetape_add_chrdev_write_request(drive, blocks); tape->merge_stage_size = 0; } - idetape_wait_for_pipeline (drive); + idetape_wait_for_pipeline(drive); if (tape->merge_stage != NULL) { - __idetape_kfree_stage (tape->merge_stage); + __idetape_kfree_stage(tape->merge_stage); tape->merge_stage = NULL; } - clear_bit (IDETAPE_PIPELINE_ERROR, &tape->flags); + clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags); tape->chrdev_direction = idetape_direction_none; /* @@ -3897,10 +4091,14 @@ */ tape->max_stages = tape->min_pipeline; #if IDETAPE_DEBUG_BUGS - if (tape->first_stage != NULL || tape->next_stage != NULL || tape->last_stage != NULL || tape->nr_stages != 0) { - printk (KERN_ERR "ide-tape: ide-tape pipeline bug, " - "first_stage %p, next_stage %p, last_stage %p, nr_stages %d\n", - tape->first_stage, tape->next_stage, tape->last_stage, tape->nr_stages); + if (tape->first_stage != NULL || + tape->next_stage != NULL || + tape->last_stage != NULL || + tape->nr_stages != 0) { + printk(KERN_ERR "ide-tape: ide-tape pipeline bug, " + "first_stage %p, next_stage %p, last_stage %p, " + "nr_stages %d\n", tape->first_stage, + tape->next_stage, tape->last_stage, tape->nr_stages); } #endif /* IDETAPE_DEBUG_BUGS */ } @@ -3928,14 +4126,16 @@ int bytes_read; int blocks = tape->capabilities.ctl; - if (tape->chrdev_direction != idetape_direction_read) { /* Initialize read operation */ + /* Initialize read operation */ + if (tape->chrdev_direction != idetape_direction_read) { if (tape->chrdev_direction == idetape_direction_write) { - idetape_empty_write_pipeline (drive); - idetape_flush_tape_buffers (drive); + idetape_empty_write_pipeline(drive); + idetape_flush_tape_buffers(drive); } #if IDETAPE_DEBUG_BUGS if (tape->merge_stage || tape->merge_stage_size) { - printk (KERN_ERR "ide-tape: merge_stage_size should be 0 now\n"); + printk(KERN_ERR "ide-tape: merge_stage_size " + "should be 0 now\n"); tape->merge_stage_size = 0; } #endif /* IDETAPE_DEBUG_BUGS */ @@ -3949,9 +4149,9 @@ * is switched from completion mode to buffer available * mode. */ - bytes_read = idetape_queue_rw_tail (drive, IDETAPE_READ_RQ, 0, tape->merge_stage->bh); + bytes_read = idetape_queue_rw_tail(drive, IDETAPE_READ_RQ, 0, tape->merge_stage->bh); if (bytes_read < 0) { - kfree (tape->merge_stage); + kfree(tape->merge_stage); tape->merge_stage = NULL; tape->chrdev_direction = idetape_direction_none; return bytes_read; @@ -3959,18 +4159,19 @@ } if (tape->restart_speed_control_req) idetape_restart_speed_control(drive); - ide_init_drive_cmd (&rq); + ide_init_drive_cmd(&rq); rq.cmd = IDETAPE_READ_RQ; rq.sector = tape->first_frame_position; rq.nr_sectors = rq.current_nr_sectors = blocks; - if (!test_bit(IDETAPE_PIPELINE_ERROR, &tape->flags) && tape->nr_stages <= max_stages) { - new_stage = idetape_kmalloc_stage (tape); + if (!test_bit(IDETAPE_PIPELINE_ERROR, &tape->flags) && + tape->nr_stages <= max_stages) { + new_stage = idetape_kmalloc_stage(tape); while (new_stage != NULL) { new_stage->rq = rq; - idetape_add_stage_tail (drive, new_stage); + idetape_add_stage_tail(drive, new_stage); if (tape->nr_stages >= max_stages) break; - new_stage = idetape_kmalloc_stage (tape); + new_stage = idetape_kmalloc_stage(tape); } } if (!idetape_pipeline_active(tape)) { @@ -3979,11 +4180,11 @@ tape->insert_time = jiffies; tape->insert_size = 0; tape->insert_speed = 0; - idetape_insert_pipeline_into_queue (drive); + idetape_insert_pipeline_into_queue(drive); } else if (tape->onstream) { idetape_update_stats(drive); if (tape->cur_frames < tape->max_frames - 5) - idetape_insert_pipeline_into_queue (drive); + idetape_insert_pipeline_into_queue(drive); } } return 0; @@ -4000,7 +4201,9 @@ */ while (1) { if (cnt++ > 1000) { /* AJN: was 100 */ - printk(KERN_INFO "ide-tape: %s: couldn't find logical block %d, aborting\n", tape->name, logical_blk_num); + printk(KERN_INFO "ide-tape: %s: couldn't find " + "logical block %d, aborting\n", + tape->name, logical_blk_num); return 0; } idetape_initiate_read(drive, max_stages); @@ -4012,21 +4215,31 @@ #endif clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags); position = idetape_read_position(drive); - printk(KERN_INFO "ide-tape: %s: blank block detected at %d\n", tape->name, position); + printk(KERN_INFO "ide-tape: %s: blank block " + "detected at %d\n", tape->name, + position); if (position >= 3000 && position < 3080) - position += 32; /* Why is this check and number ??? MM */ - if (position >= OS_DATA_ENDFRAME1 && position < 3000) + /* Why is this check and number ??? MM */ + position += 32; + if (position >= OS_DATA_ENDFRAME1 && + position < 3000) position = 3000; else /* - * compensate for write errors that generally skip 80 frames, - * expect around 20 read errors in a row... + * compensate for write errors that + * generally skip 80 frames, expect + * around 20 read errors in a row... */ position += 60; - if (position >= OS_DATA_ENDFRAME1 && position < 3000) + if (position >= OS_DATA_ENDFRAME1 && + position < 3000) position = 3000; printk(KERN_INFO "ide-tape: %s: positioning tape to block %d\n", tape->name, position); - if (position == 3000) /* seems to be needed to correctly position at block 3000 MM */ + + /* seems to be needed to correctly position + * at block 3000 MM + */ + if (position == 3000) idetape_position_tape(drive, 0, 0, 0); idetape_position_tape(drive, position, 0, 0); cnt += 40; @@ -4069,7 +4282,8 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_add_chrdev_read_request, %d blocks\n", blocks); + printk(KERN_INFO "ide-tape: Reached %s, %d blocks\n", + __FUNCTION__, blocks); #endif /* IDETAPE_DEBUG_LOG */ /* @@ -4083,17 +4297,19 @@ } if (test_bit(IDETAPE_PIPELINE_ERROR, &tape->flags)) return 0; - return idetape_queue_rw_tail (drive, IDETAPE_READ_RQ, blocks, tape->merge_stage->bh); + return idetape_queue_rw_tail(drive, IDETAPE_READ_RQ, blocks, tape->merge_stage->bh); } rq_ptr = &tape->first_stage->rq; bytes_read = tape->tape_block_size * (rq_ptr->nr_sectors - rq_ptr->current_nr_sectors); rq_ptr->nr_sectors = rq_ptr->current_nr_sectors = 0; - if (tape->onstream && !tape->raw && tape->first_stage->aux->frame_type == OS_FRAME_TYPE_EOD) { + if (tape->onstream && !tape->raw && + tape->first_stage->aux->frame_type == OS_FRAME_TYPE_EOD) { #if ONSTREAM_DEBUG if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: %s: EOD reached\n", tape->name); + printk(KERN_INFO "ide-tape: %s: EOD reached\n", + tape->name); #endif return 0; } @@ -4101,20 +4317,21 @@ return 0; if (rq_ptr->errors == IDETAPE_ERROR_FILEMARK) { idetape_switch_buffers (tape, tape->first_stage); - set_bit (IDETAPE_FILEMARK, &tape->flags); + set_bit(IDETAPE_FILEMARK, &tape->flags); #if USE_IOTRACE IO_trace(IO_IDETAPE_FIFO, tape->pipeline_head, tape->buffer_head, tape->tape_head, tape->minor); #endif calculate_speeds(drive); } else { - idetape_switch_buffers (tape, tape->first_stage); + idetape_switch_buffers(tape, tape->first_stage); if (rq_ptr->errors == IDETAPE_ERROR_GENERAL) { #if ONSTREAM_DEBUG if (tape->debug_level >= 1) - printk(KERN_INFO "ide-tape: error detected, bytes_read %d\n", bytes_read); + printk(KERN_INFO "ide-tape: error detected, " + "bytes_read %d\n", bytes_read); #endif } - clear_bit (IDETAPE_FILEMARK, &tape->flags); + clear_bit(IDETAPE_FILEMARK, &tape->flags); spin_lock_irqsave(&tape->spinlock, flags); idetape_remove_stage_head (drive); spin_unlock_irqrestore(&tape->spinlock, flags); @@ -4126,9 +4343,10 @@ calculate_speeds(drive); } #if IDETAPE_DEBUG_BUGS - if (bytes_read > blocks*tape->tape_block_size) { - printk (KERN_ERR "ide-tape: bug: trying to return more bytes than requested\n"); - bytes_read=blocks*tape->tape_block_size; + if (bytes_read > blocks * tape->tape_block_size) { + printk(KERN_ERR "ide-tape: bug: trying to return more " + "bytes than requested\n"); + bytes_read = blocks * tape->tape_block_size; } #endif /* IDETAPE_DEBUG_BUGS */ return (bytes_read); @@ -4142,16 +4360,16 @@ while (bcount) { bh = tape->merge_stage->bh; - count = IDE_MIN (tape->stage_size, bcount); + count = IDE_MIN(tape->stage_size, bcount); bcount -= count; blocks = count / tape->tape_block_size; while (count) { atomic_set(&bh->b_count, IDE_MIN (count, bh->b_size)); - memset (bh->b_data, 0, atomic_read(&bh->b_count)); + memset(bh->b_data, 0, atomic_read(&bh->b_count)); count -= atomic_read(&bh->b_count); bh = bh->b_reqnext; } - idetape_queue_rw_tail (drive, IDETAPE_WRITE_RQ, blocks, tape->merge_stage->bh); + idetape_queue_rw_tail(drive, IDETAPE_WRITE_RQ, blocks, tape->merge_stage->bh); } } @@ -4162,7 +4380,7 @@ struct request *rq; int size = 0; - idetape_wait_for_pipeline (drive); + idetape_wait_for_pipeline(drive); stage = tape->first_stage; while (stage != NULL) { rq = &stage->rq; @@ -4187,16 +4405,16 @@ idetape_tape_t *tape = drive->driver_data; #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 2) - printk (KERN_INFO "ide-tape: Reached idetape_rewind_tape\n"); + printk(KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__); #endif /* IDETAPE_DEBUG_LOG */ - idetape_create_rewind_cmd (drive, &pc); - retval = idetape_queue_pc_tail (drive, &pc); + idetape_create_rewind_cmd(drive, &pc); + retval = idetape_queue_pc_tail(drive, &pc); if (retval) return retval; - idetape_create_read_position_cmd (&pc); - retval = idetape_queue_pc_tail (drive, &pc); + idetape_create_read_position_cmd(&pc); + retval = idetape_queue_pc_tail(drive, &pc); if (retval) return retval; tape->logical_blk_num = 0; @@ -4218,7 +4436,7 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 4) - printk (KERN_INFO "ide-tape: Reached idetape_blkdev_ioctl\n"); + printk(KERN_INFO "ide-tape: Reached %s\n", __FUNCTION__); #endif /* IDETAPE_DEBUG_LOG */ switch (cmd) { case 0x0340: @@ -4248,7 +4466,7 @@ { MOD_INC_USE_COUNT; #if ONSTREAM_DEBUG - printk(KERN_INFO "ide-tape: MOD_INC_USE_COUNT in idetape_blkdev_open\n"); + printk(KERN_INFO "ide-tape: MOD_INC_USE_COUNT in %s\n", __FUNCTION__); #endif return 0; } @@ -4257,7 +4475,7 @@ { MOD_DEC_USE_COUNT; #if ONSTREAM_DEBUG - printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_blkdev_release\n"); + printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in %s\n", __FUNCTION__); #endif } @@ -4268,7 +4486,7 @@ { idetape_tape_t *tape = drive->driver_data; if (tape != NULL) - set_bit (IDETAPE_IGNORE_DSC, &tape->flags); + set_bit(IDETAPE_IGNORE_DSC, &tape->flags); } /* @@ -4291,7 +4509,8 @@ unsigned long flags; if (!idetape_get_logical_blk(drive, -1, 10, 0)) { - printk(KERN_INFO "ide-tape: %s: couldn't get logical blk num in space_filemarks_bwd\n", tape->name); + printk(KERN_INFO "ide-tape: %s: couldn't get logical blk " + "num in space_filemarks_bwd\n", tape->name); return -EIO; } while (cnt != mt_count) { @@ -4300,16 +4519,20 @@ return -EIO; #if ONSTREAM_DEBUG if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: positioning to last mark at %d\n", last_mark_addr); + printk(KERN_INFO "ide-tape: positioning to last " + "mark at %d\n", last_mark_addr); #endif idetape_position_tape(drive, last_mark_addr, 0, 0); cnt++; if (!idetape_get_logical_blk(drive, -1, 10, 0)) { - printk(KERN_INFO "ide-tape: %s: couldn't get logical blk num in space_filemarks\n", tape->name); + printk(KERN_INFO "ide-tape: %s: couldn't get logical " + "blk num in space_filemarks\n", tape->name); return -EIO; } if (tape->first_stage->aux->frame_type != OS_FRAME_TYPE_MARKER) { - printk(KERN_INFO "ide-tape: %s: expected to find marker at block %d, not found\n", tape->name, last_mark_addr); + printk(KERN_INFO "ide-tape: %s: expected to find " + "marker at block %d, not found\n", + tape->name, last_mark_addr); return -EIO; } } @@ -4334,12 +4557,14 @@ unsigned long flags; if (!idetape_get_logical_blk(drive, -1, 10, 0)) { - printk(KERN_INFO "ide-tape: %s: couldn't get logical blk num in space_filemarks_fwd\n", tape->name); + printk(KERN_INFO "ide-tape: %s: couldn't get logical blk " + "num in space_filemarks_fwd\n", tape->name); return -EIO; } while (1) { if (!idetape_get_logical_blk(drive, -1, 10, 0)) { - printk(KERN_INFO "ide-tape: %s: couldn't get logical blk num in space_filemarks\n", tape->name); + printk(KERN_INFO "ide-tape: %s: couldn't get logical " + "blk num in space_filemarks\n", tape->name); return -EIO; } if (tape->first_stage->aux->frame_type == OS_FRAME_TYPE_MARKER) @@ -4347,19 +4572,20 @@ if (tape->first_stage->aux->frame_type == OS_FRAME_TYPE_EOD) { #if ONSTREAM_DEBUG if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: %s: space_fwd: EOD reached\n", tape->name); + printk(KERN_INFO "ide-tape: %s: space_fwd: " + "EOD reached\n", tape->name); #endif return -EIO; } if (cnt == mt_count) break; spin_lock_irqsave(&tape->spinlock, flags); - idetape_remove_stage_head (drive); + idetape_remove_stage_head(drive); spin_unlock_irqrestore(&tape->spinlock, flags); } if (mt_op == MTFSF) { spin_lock_irqsave(&tape->spinlock, flags); - idetape_remove_stage_head (drive); + idetape_remove_stage_head(drive); tape->logical_blk_num++; spin_unlock_irqrestore(&tape->spinlock, flags); } @@ -4377,7 +4603,8 @@ unsigned long flags; if (!idetape_get_logical_blk(drive, -1, 10, 0)) { - printk(KERN_INFO "ide-tape: %s: couldn't get logical blk num in space_filemarks_fwd\n", tape->name); + printk(KERN_INFO "ide-tape: %s: couldn't get logical blk " + "num in space_filemarks_fwd\n", tape->name); return -EIO; } @@ -4390,22 +4617,27 @@ if (tape->first_stage->aux->frame_type == OS_FRAME_TYPE_EOD) { #if ONSTREAM_DEBUG if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: %s: space_fwd: EOD reached\n", tape->name); + printk(KERN_INFO "ide-tape: %s: space_fwd: " + "EOD reached\n", tape->name); #endif return -EIO; } if (ntohl(tape->first_stage->aux->filemark_cnt) == 0) { if (tape->first_mark_addr == -1) { - printk(KERN_INFO "ide-tape: %s: reverting to slow filemark space\n", tape->name); + printk(KERN_INFO "ide-tape: %s: reverting to " + "slow filemark space\n", tape->name); return idetape_onstream_space_over_filemarks_forward_slow(drive, mt_op, mt_count); } idetape_position_tape(drive, tape->first_mark_addr, 0, 0); if (!idetape_get_logical_blk(drive, -1, 10, 0)) { - printk(KERN_INFO "ide-tape: %s: couldn't get logical blk num in space_filemarks_fwd_fast\n", tape->name); + printk(KERN_INFO "ide-tape: %s: couldn't get " + "logical blk num in %s\n", __FUNCTION__, tape->name); return -EIO; } if (tape->first_stage->aux->frame_type != OS_FRAME_TYPE_MARKER) { - printk(KERN_INFO "ide-tape: %s: expected to find filemark at %d\n", tape->name, tape->first_mark_addr); + printk(KERN_INFO "ide-tape: %s: expected to " + "find filemark at %d\n", + tape->name, tape->first_mark_addr); return -EIO; } } else { @@ -4418,7 +4650,8 @@ while (cnt != mt_count) { next_mark_addr = ntohl(tape->first_stage->aux->next_mark_addr); if (!next_mark_addr || next_mark_addr > tape->eod_frame_addr) { - printk(KERN_INFO "ide-tape: %s: reverting to slow filemark space\n", tape->name); + printk(KERN_INFO "ide-tape: %s: reverting to slow " + "filemark space\n", tape->name); return idetape_onstream_space_over_filemarks_forward_slow(drive, mt_op, mt_count - cnt); #if ONSTREAM_DEBUG } else if (tape->debug_level >= 2) { @@ -4428,17 +4661,20 @@ idetape_position_tape(drive, next_mark_addr, 0, 0); cnt++; if (!idetape_get_logical_blk(drive, -1, 10, 0)) { - printk(KERN_INFO "ide-tape: %s: couldn't get logical blk num in space_filemarks\n", tape->name); + printk(KERN_INFO "ide-tape: %s: couldn't get logical " + "blk num in space_filemarks\n", tape->name); return -EIO; } if (tape->first_stage->aux->frame_type != OS_FRAME_TYPE_MARKER) { - printk(KERN_INFO "ide-tape: %s: expected to find marker at block %d, not found\n", tape->name, next_mark_addr); + printk(KERN_INFO "ide-tape: %s: expected to find " + "marker at block %d, not found\n", + tape->name, next_mark_addr); return -EIO; } } if (mt_op == MTFSF) { spin_lock_irqsave(&tape->spinlock, flags); - idetape_remove_stage_head (drive); + idetape_remove_stage_head(drive); tape->logical_blk_num++; spin_unlock_irqrestore(&tape->spinlock, flags); } @@ -4485,7 +4721,7 @@ * filemarks. */ tape->merge_stage_size = 0; - clear_bit (IDETAPE_FILEMARK, &tape->flags); + clear_bit(IDETAPE_FILEMARK, &tape->flags); while (tape->first_stage != NULL) { idetape_wait_first_stage(drive); if (tape->first_stage->rq.errors == IDETAPE_ERROR_FILEMARK) @@ -4494,7 +4730,7 @@ switch (mt_op) { case MTFSF: spin_lock_irqsave(&tape->spinlock, flags); - idetape_remove_stage_head (drive); + idetape_remove_stage_head(drive); spin_unlock_irqrestore(&tape->spinlock, flags); case MTFSFM: return (0); @@ -4503,10 +4739,10 @@ } } spin_lock_irqsave(&tape->spinlock, flags); - idetape_remove_stage_head (drive); + idetape_remove_stage_head(drive); spin_unlock_irqrestore(&tape->spinlock, flags); } - idetape_discard_read_pipeline (drive, 1); + idetape_discard_read_pipeline(drive, 1); } /* @@ -4515,27 +4751,28 @@ */ switch (mt_op) { case MTFSF: - idetape_create_space_cmd (&pc,mt_count-count,IDETAPE_SPACE_OVER_FILEMARK); - return (idetape_queue_pc_tail (drive, &pc)); + idetape_create_space_cmd(&pc,mt_count-count,IDETAPE_SPACE_OVER_FILEMARK); + return (idetape_queue_pc_tail(drive, &pc)); case MTFSFM: if (!tape->capabilities.sprev) return (-EIO); - retval = idetape_space_over_filemarks (drive, MTFSF, mt_count-count); + retval = idetape_space_over_filemarks(drive, MTFSF, mt_count-count); if (retval) return (retval); - return (idetape_space_over_filemarks (drive, MTBSF, 1)); + return (idetape_space_over_filemarks(drive, MTBSF, 1)); case MTBSF: if (!tape->capabilities.sprev) return (-EIO); - idetape_create_space_cmd (&pc,-(mt_count+count),IDETAPE_SPACE_OVER_FILEMARK); - return (idetape_queue_pc_tail (drive, &pc)); + idetape_create_space_cmd(&pc,-(mt_count+count),IDETAPE_SPACE_OVER_FILEMARK); + return (idetape_queue_pc_tail(drive, &pc)); case MTBSFM: if (!tape->capabilities.sprev) return (-EIO); - retval = idetape_space_over_filemarks (drive, MTBSF, mt_count+count); + retval = idetape_space_over_filemarks(drive, MTBSF, mt_count+count); if (retval) return (retval); - return (idetape_space_over_filemarks (drive, MTFSF, 1)); + return (idetape_space_over_filemarks(drive, MTFSF, 1)); default: - printk (KERN_ERR "ide-tape: MTIO operation %d not supported\n",mt_op); + printk(KERN_ERR "ide-tape: MTIO operation %d not " + "supported\n", mt_op); return (-EIO); } } @@ -4562,7 +4799,7 @@ size_t count, loff_t *ppos) { struct inode *inode = file->f_dentry->d_inode; - ide_drive_t *drive = get_drive_ptr (inode->i_rdev); + ide_drive_t *drive = get_drive_ptr(inode->i_rdev); idetape_tape_t *tape = drive->driver_data; ssize_t bytes_read,temp, actually_read = 0, rc; @@ -4571,17 +4808,21 @@ return -ENXIO; } if (tape->onstream && (count != tape->tape_block_size)) { - printk(KERN_ERR "ide-tape: %s: use %d bytes as block size (%Zd used)\n", tape->name, tape->tape_block_size, count); + printk(KERN_ERR "ide-tape: %s: use %d bytes as block size " + "(%Zd used)\n", tape->name, + tape->tape_block_size, count); return -EINVAL; } #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 3) - printk (KERN_INFO "ide-tape: Reached idetape_chrdev_read, count %Zd\n", count); + printk (KERN_INFO "ide-tape: Reached %s, count %Zd\n", + __FUNCTION__, count); #endif /* IDETAPE_DEBUG_LOG */ if (tape->chrdev_direction != idetape_direction_read) { - if (test_bit (IDETAPE_DETECT_BS, &tape->flags)) - if (count > tape->tape_block_size && (count % tape->tape_block_size) == 0) + if (test_bit(IDETAPE_DETECT_BS, &tape->flags)) + if (count > tape->tape_block_size && + (count % tape->tape_block_size) == 0) tape->user_bs_factor = count / tape->tape_block_size; } if ((rc = idetape_initiate_read(drive, tape->max_stages)) < 0) @@ -4589,42 +4830,45 @@ if (count == 0) return (0); if (tape->merge_stage_size) { - actually_read = IDE_MIN (tape->merge_stage_size, count); - idetape_copy_stage_to_user (tape, buf, tape->merge_stage, actually_read); + actually_read = IDE_MIN(tape->merge_stage_size, count); + idetape_copy_stage_to_user(tape, buf, tape->merge_stage, actually_read); buf += actually_read; tape->merge_stage_size -= actually_read; count -= actually_read; } while (count >= tape->stage_size) { - bytes_read = idetape_add_chrdev_read_request (drive, tape->capabilities.ctl); + bytes_read = idetape_add_chrdev_read_request(drive, tape->capabilities.ctl); if (bytes_read <= 0) goto finish; - idetape_copy_stage_to_user (tape, buf, tape->merge_stage, bytes_read); + idetape_copy_stage_to_user(tape, buf, tape->merge_stage, bytes_read); buf += bytes_read; count -= bytes_read; actually_read += bytes_read; } if (count) { - bytes_read=idetape_add_chrdev_read_request (drive, tape->capabilities.ctl); + bytes_read=idetape_add_chrdev_read_request(drive, tape->capabilities.ctl); if (bytes_read <= 0) goto finish; - temp = IDE_MIN (count, bytes_read); - idetape_copy_stage_to_user (tape, buf, tape->merge_stage, temp); + temp = IDE_MIN(count, bytes_read); + idetape_copy_stage_to_user(tape, buf, tape->merge_stage, temp); actually_read += temp; tape->merge_stage_size = bytes_read-temp; } finish: - if (!actually_read && test_bit (IDETAPE_FILEMARK, &tape->flags)) { + if (!actually_read && test_bit(IDETAPE_FILEMARK, &tape->flags)) { #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: %s: spacing over filemark\n", tape->name); + printk(KERN_INFO "ide-tape: %s: spacing over " + "filemark\n", tape->name); #endif idetape_space_over_filemarks (drive, MTFSF, 1); return 0; } - if (tape->onstream && !actually_read && test_and_clear_bit(IDETAPE_READ_ERROR, &tape->flags)) { - printk(KERN_ERR "ide-tape: %s: unrecovered read error on logical block number %d, skipping\n", - tape->name, tape->logical_blk_num); + if (tape->onstream && !actually_read && + test_and_clear_bit(IDETAPE_READ_ERROR, &tape->flags)) { + printk(KERN_ERR "ide-tape: %s: unrecovered read error on " + "logical block number %d, skipping\n", + tape->name, tape->logical_blk_num); tape->logical_blk_num++; return -EIO; } @@ -4649,21 +4893,25 @@ position = idetape_read_position(drive); #if ONSTREAM_DEBUG if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: current position (2) %d, lblk %d\n", position, tape->logical_blk_num); + printk(KERN_INFO "ide-tape: current position (2) %d, " + "lblk %d\n", position, tape->logical_blk_num); if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: current position (2) tape block %d\n", tape->last_frame_position); + printk(KERN_INFO "ide-tape: current position (2) tape " + "block %d\n", tape->last_frame_position); #endif idetape_position_tape(drive, last_mark_addr, 0, 0); - if (!idetape_queue_rw_tail (drive, IDETAPE_READ_RQ, 1, stage->bh)) { - printk(KERN_INFO "ide-tape: %s: couldn't read last marker\n", tape->name); - __idetape_kfree_stage (stage); + if (!idetape_queue_rw_tail(drive, IDETAPE_READ_RQ, 1, stage->bh)) { + printk(KERN_INFO "ide-tape: %s: couldn't read last marker\n", + tape->name); + __idetape_kfree_stage(stage); idetape_position_tape(drive, position, 0, 0); return; } aux = stage->aux; if (aux->frame_type != OS_FRAME_TYPE_MARKER) { - printk(KERN_INFO "ide-tape: %s: expected to find marker at addr %d\n", tape->name, last_mark_addr); - __idetape_kfree_stage (stage); + printk(KERN_INFO "ide-tape: %s: expected to find marker " + "at addr %d\n", tape->name, last_mark_addr); + __idetape_kfree_stage(stage); idetape_position_tape(drive, position, 0, 0); return; } @@ -4673,13 +4921,14 @@ #endif aux->next_mark_addr = htonl(next_mark_addr); idetape_position_tape(drive, last_mark_addr, 0, 0); - if (!idetape_queue_rw_tail (drive, IDETAPE_WRITE_RQ, 1, stage->bh)) { - printk(KERN_INFO "ide-tape: %s: couldn't write back marker frame at %d\n", tape->name, last_mark_addr); - __idetape_kfree_stage (stage); + if (!idetape_queue_rw_tail(drive, IDETAPE_WRITE_RQ, 1, stage->bh)) { + printk(KERN_INFO "ide-tape: %s: couldn't write back marker " + "frame at %d\n", tape->name, last_mark_addr); + __idetape_kfree_stage(stage); idetape_position_tape(drive, position, 0, 0); return; } - __idetape_kfree_stage (stage); + __idetape_kfree_stage(stage); idetape_flush_tape_buffers (drive); idetape_position_tape(drive, position, 0, 0); return; @@ -4702,18 +4951,20 @@ #if ONSTREAM_DEBUG printk(KERN_INFO "write_filler: positioning failed it returned %d\n", rc); #endif - if (rc != 0) - return; /* don't write fillers if we cannot position the tape. */ + if (rc != 0) + /* don't write fillers if we cannot position the tape. */ + return; strcpy(stage->bh->b_data, "Filler"); while (cnt--) { - if (!idetape_queue_rw_tail (drive, IDETAPE_WRITE_RQ, 1, stage->bh)) { - printk(KERN_INFO "ide-tape: %s: write_filler: couldn't write header frame\n", tape->name); - __idetape_kfree_stage (stage); + if (!idetape_queue_rw_tail(drive, IDETAPE_WRITE_RQ, 1, stage->bh)) { + printk(KERN_INFO "ide-tape: %s: write_filler: " + "couldn't write header frame\n", tape->name); + __idetape_kfree_stage(stage); return; } } - __idetape_kfree_stage (stage); + __idetape_kfree_stage(stage); } static void __idetape_write_header (ide_drive_t *drive, int block, int cnt) @@ -4741,14 +4992,14 @@ header.partition.eod_frame_addr = htonl(tape->eod_frame_addr); memcpy(stage->bh->b_data, &header, sizeof(header)); while (cnt--) { - if (!idetape_queue_rw_tail (drive, IDETAPE_WRITE_RQ, 1, stage->bh)) { + if (!idetape_queue_rw_tail(drive, IDETAPE_WRITE_RQ, 1, stage->bh)) { printk(KERN_INFO "ide-tape: %s: couldn't write header frame\n", tape->name); - __idetape_kfree_stage (stage); + __idetape_kfree_stage(stage); return; } } - __idetape_kfree_stage (stage); - idetape_flush_tape_buffers (drive); + __idetape_kfree_stage(stage); + idetape_flush_tape_buffers(drive); } static void idetape_write_header (ide_drive_t *drive, int locate_eod) @@ -4767,7 +5018,9 @@ if (locate_eod) { #if ONSTREAM_DEBUG if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: %s: locating back to eod frame addr %d\n", tape->name, tape->eod_frame_addr); + printk(KERN_INFO "ide-tape: %s: locating back to " + "eod frame addr %d\n", tape->name, + tape->eod_frame_addr); #endif idetape_position_tape(drive, tape->eod_frame_addr, 0, 0); } @@ -4777,7 +5030,7 @@ size_t count, loff_t *ppos) { struct inode *inode = file->f_dentry->d_inode; - ide_drive_t *drive = get_drive_ptr (inode->i_rdev); + ide_drive_t *drive = get_drive_ptr(inode->i_rdev); idetape_tape_t *tape = drive->driver_data; ssize_t retval, actually_written = 0; int position; @@ -4794,13 +5047,14 @@ if (tape->onstream) { if (count != tape->tape_block_size) { - printk(KERN_ERR "ide-tape: %s: chrdev_write: use %d bytes as block size (%Zd used)\n", - tape->name, tape->tape_block_size, count); + printk(KERN_ERR "ide-tape: %s: chrdev_write: " + "use %d bytes as block size (%Zd used)\n", + tape->name, tape->tape_block_size, count); return -EINVAL; } /* - * Check if we reach the end of the tape. Just assume the whole pipeline - * is filled with write requests! + * Check if we reach the end of the tape. Just assume the whole + * pipeline is filled with write requests! */ if (tape->first_frame_position + tape->nr_stages >= tape->capacity - OS_EW) { #if ONSTREAM_DEBUG @@ -4812,19 +5066,20 @@ } } - if (tape->chrdev_direction != idetape_direction_write) { /* Initialize write operation */ + /* Initialize write operation */ + if (tape->chrdev_direction != idetape_direction_write) { if (tape->chrdev_direction == idetape_direction_read) - idetape_discard_read_pipeline (drive, 1); + idetape_discard_read_pipeline(drive, 1); #if IDETAPE_DEBUG_BUGS if (tape->merge_stage || tape->merge_stage_size) { - printk (KERN_ERR "ide-tape: merge_stage_size should be 0 now\n"); + printk(KERN_ERR "ide-tape: merge_stage_size should be 0 now\n"); tape->merge_stage_size = 0; } #endif /* IDETAPE_DEBUG_BUGS */ - if ((tape->merge_stage = __idetape_kmalloc_stage (tape, 0, 0)) == NULL) + if ((tape->merge_stage = __idetape_kmalloc_stage(tape, 0, 0)) == NULL) return -ENOMEM; tape->chrdev_direction = idetape_direction_write; - idetape_init_merge_stage (tape); + idetape_init_merge_stage(tape); if (tape->onstream) { position = idetape_read_position(drive); @@ -4860,9 +5115,9 @@ * is switched from completion mode to buffer available * mode. */ - retval = idetape_queue_rw_tail (drive, IDETAPE_WRITE_RQ, 0, tape->merge_stage->bh); + retval = idetape_queue_rw_tail(drive, IDETAPE_WRITE_RQ, 0, tape->merge_stage->bh); if (retval < 0) { - kfree (tape->merge_stage); + kfree(tape->merge_stage); tape->merge_stage = NULL; tape->chrdev_direction = idetape_direction_none; return retval; @@ -4879,35 +5134,35 @@ if (tape->merge_stage_size) { #if IDETAPE_DEBUG_BUGS if (tape->merge_stage_size >= tape->stage_size) { - printk (KERN_ERR "ide-tape: bug: merge buffer too big\n"); + printk(KERN_ERR "ide-tape: bug: merge buffer too big\n"); tape->merge_stage_size = 0; } #endif /* IDETAPE_DEBUG_BUGS */ - actually_written = IDE_MIN (tape->stage_size - tape->merge_stage_size, count); - idetape_copy_stage_from_user (tape, tape->merge_stage, buf, actually_written); + actually_written = IDE_MIN(tape->stage_size - tape->merge_stage_size, count); + idetape_copy_stage_from_user(tape, tape->merge_stage, buf, actually_written); buf += actually_written; tape->merge_stage_size += actually_written; count -= actually_written; if (tape->merge_stage_size == tape->stage_size) { tape->merge_stage_size = 0; - retval = idetape_add_chrdev_write_request (drive, tape->capabilities.ctl); + retval = idetape_add_chrdev_write_request(drive, tape->capabilities.ctl); if (retval <= 0) return (retval); } } while (count >= tape->stage_size) { - idetape_copy_stage_from_user (tape, tape->merge_stage, buf, tape->stage_size); + idetape_copy_stage_from_user(tape, tape->merge_stage, buf, tape->stage_size); buf += tape->stage_size; count -= tape->stage_size; - retval = idetape_add_chrdev_write_request (drive, tape->capabilities.ctl); + retval = idetape_add_chrdev_write_request(drive, tape->capabilities.ctl); actually_written += tape->stage_size; if (retval <= 0) return (retval); } if (count) { - actually_written+=count; - idetape_copy_stage_from_user (tape, tape->merge_stage, buf, count); + actually_written += count; + idetape_copy_stage_from_user(tape, tape->merge_stage, buf, count); tape->merge_stage_size += count; } return (actually_written); @@ -4920,19 +5175,20 @@ idetape_pc_t pc; if (!tape->onstream) { - idetape_create_write_filemark_cmd(drive, &pc, 1); /* Write a filemark */ - if (idetape_queue_pc_tail (drive, &pc)) { - printk (KERN_ERR "ide-tape: Couldn't write a filemark\n"); + /* Write a filemark */ + idetape_create_write_filemark_cmd(drive, &pc, 1); + if (idetape_queue_pc_tail(drive, &pc)) { + printk(KERN_ERR "ide-tape: Couldn't write a filemark\n"); return -EIO; } } else if (!tape->raw) { last_mark_addr = idetape_read_position(drive); - tape->merge_stage = __idetape_kmalloc_stage (tape, 1, 0); + tape->merge_stage = __idetape_kmalloc_stage(tape, 1, 0); if (tape->merge_stage != NULL) { idetape_init_stage(drive, tape->merge_stage, OS_FRAME_TYPE_MARKER, tape->logical_blk_num); - idetape_pad_zeros (drive, tape->stage_size); + idetape_pad_zeros(drive, tape->stage_size); tape->logical_blk_num++; - __idetape_kfree_stage (tape->merge_stage); + __idetape_kfree_stage(tape->merge_stage); tape->merge_stage = NULL; } if (tape->filemark_cnt) @@ -4950,11 +5206,11 @@ if (!tape->onstream || tape->raw) return; - tape->merge_stage = __idetape_kmalloc_stage (tape, 1, 0); + tape->merge_stage = __idetape_kmalloc_stage(tape, 1, 0); if (tape->merge_stage != NULL) { tape->eod_frame_addr = idetape_read_position(drive); idetape_init_stage(drive, tape->merge_stage, OS_FRAME_TYPE_EOD, tape->logical_blk_num); - idetape_pad_zeros (drive, tape->stage_size); + idetape_pad_zeros(drive, tape->stage_size); __idetape_kfree_stage (tape->merge_stage); tape->merge_stage = NULL; } @@ -4989,7 +5245,9 @@ error: tape->speed_control = speed_control; tape->restart_speed_control_req = 1; - printk(KERN_INFO "ide-tape: %s: couldn't seek to logical block %d (at %d), %d retries\n", tape->name, logical_blk_num, tape->logical_blk_num, retries); + printk(KERN_INFO "ide-tape: %s: couldn't seek to logical block %d " + "(at %d), %d retries\n", tape->name, logical_blk_num, + tape->logical_blk_num, retries); return -EIO; ok: tape->speed_control = speed_control; @@ -5068,7 +5326,8 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 1) - printk (KERN_INFO "ide-tape: Handling MTIOCTOP ioctl: mt_op=%d, mt_count=%d\n",mt_op,mt_count); + printk(KERN_INFO "ide-tape: Handling MTIOCTOP " + "ioctl: mt_op=%d, mt_count=%d\n", mt_op, mt_count); #endif /* IDETAPE_DEBUG_LOG */ /* * Commands which need our pipelined read-ahead stages. @@ -5080,41 +5339,41 @@ case MTBSFM: if (!mt_count) return (0); - return (idetape_space_over_filemarks (drive,mt_op,mt_count)); + return (idetape_space_over_filemarks(drive,mt_op,mt_count)); default: break; } switch (mt_op) { case MTWEOF: - idetape_discard_read_pipeline (drive, 1); + idetape_discard_read_pipeline(drive, 1); for (i = 0; i < mt_count; i++) { retval = idetape_write_filemark(drive); if (retval) return retval; } return (0); case MTREW: - idetape_discard_read_pipeline (drive, 0); + idetape_discard_read_pipeline(drive, 0); if (idetape_rewind_tape(drive)) return -EIO; if (tape->onstream && !tape->raw) return idetape_position_tape(drive, OS_DATA_STARTFRAME1, 0, 0); return 0; case MTLOAD: - idetape_discard_read_pipeline (drive, 0); - idetape_create_load_unload_cmd (drive, &pc, IDETAPE_LU_LOAD_MASK); - return (idetape_queue_pc_tail (drive, &pc)); + idetape_discard_read_pipeline(drive, 0); + idetape_create_load_unload_cmd(drive, &pc, IDETAPE_LU_LOAD_MASK); + return (idetape_queue_pc_tail(drive, &pc)); case MTUNLOAD: case MTOFFL: - idetape_discard_read_pipeline (drive, 0); - idetape_create_load_unload_cmd (drive, &pc,!IDETAPE_LU_LOAD_MASK); - return (idetape_queue_pc_tail (drive, &pc)); + idetape_discard_read_pipeline(drive, 0); + idetape_create_load_unload_cmd(drive, &pc,!IDETAPE_LU_LOAD_MASK); + return (idetape_queue_pc_tail(drive, &pc)); case MTNOP: - idetape_discard_read_pipeline (drive, 0); - return (idetape_flush_tape_buffers (drive)); + idetape_discard_read_pipeline(drive, 0); + return (idetape_flush_tape_buffers(drive)); case MTRETEN: - idetape_discard_read_pipeline (drive, 0); - idetape_create_load_unload_cmd (drive, &pc,IDETAPE_LU_RETENSION_MASK | IDETAPE_LU_LOAD_MASK); - return (idetape_queue_pc_tail (drive, &pc)); + idetape_discard_read_pipeline(drive, 0); + idetape_create_load_unload_cmd(drive, &pc,IDETAPE_LU_RETENSION_MASK | IDETAPE_LU_LOAD_MASK); + return (idetape_queue_pc_tail(drive, &pc)); case MTEOM: if (tape->onstream) { #if ONSTREAM_DEBUG @@ -5128,8 +5387,8 @@ return -EIO; return 0; } - idetape_create_space_cmd (&pc, 0, IDETAPE_SPACE_TO_EOD); - return (idetape_queue_pc_tail (drive, &pc)); + idetape_create_space_cmd(&pc, 0, IDETAPE_SPACE_TO_EOD); + return (idetape_queue_pc_tail(drive, &pc)); case MTERASE: if (tape->onstream) { tape->eod_frame_addr = OS_DATA_STARTFRAME1; @@ -5137,7 +5396,7 @@ tape->first_mark_addr = tape->last_mark_addr = -1; idetape_position_tape(drive, tape->eod_frame_addr, 0, 0); idetape_write_eod(drive); - idetape_flush_tape_buffers (drive); + idetape_flush_tape_buffers(drive); idetape_write_header(drive, 0); /* * write filler frames to the unused frames... @@ -5145,13 +5404,13 @@ */ idetape_write_filler(drive, OS_DATA_STARTFRAME1 - 10, 10); idetape_write_filler(drive, OS_DATA_ENDFRAME1, 10); - idetape_flush_tape_buffers (drive); - (void) idetape_rewind_tape (drive); + idetape_flush_tape_buffers(drive); + (void) idetape_rewind_tape(drive); return 0; } - (void) idetape_rewind_tape (drive); - idetape_create_erase_cmd (&pc); - return (idetape_queue_pc_tail (drive, &pc)); + (void) idetape_rewind_tape(drive); + idetape_create_erase_cmd(&pc); + return (idetape_queue_pc_tail(drive, &pc)); case MTSETBLK: if (tape->onstream) { if (mt_count != tape->tape_block_size) { @@ -5164,21 +5423,21 @@ if (mt_count < tape->tape_block_size || mt_count % tape->tape_block_size) return -EIO; tape->user_bs_factor = mt_count / tape->tape_block_size; - clear_bit (IDETAPE_DETECT_BS, &tape->flags); + clear_bit(IDETAPE_DETECT_BS, &tape->flags); } else - set_bit (IDETAPE_DETECT_BS, &tape->flags); + set_bit(IDETAPE_DETECT_BS, &tape->flags); return 0; case MTSEEK: if (!tape->onstream || tape->raw) { - idetape_discard_read_pipeline (drive, 0); - return idetape_position_tape (drive, mt_count * tape->user_bs_factor, tape->partition, 0); + idetape_discard_read_pipeline(drive, 0); + return idetape_position_tape(drive, mt_count * tape->user_bs_factor, tape->partition, 0); } return idetape_seek_logical_blk(drive, mt_count); case MTSETPART: - idetape_discard_read_pipeline (drive, 0); + idetape_discard_read_pipeline(drive, 0); if (tape->onstream) return -EIO; - return (idetape_position_tape (drive, 0, mt_count, 0)); + return (idetape_position_tape(drive, 0, mt_count, 0)); case MTFSR: case MTBSR: if (tape->onstream) { @@ -5187,26 +5446,26 @@ if (mt_op == MTFSR) return idetape_seek_logical_blk(drive, tape->logical_blk_num + mt_count); else { - idetape_discard_read_pipeline (drive, 0); + idetape_discard_read_pipeline(drive, 0); return idetape_seek_logical_blk(drive, tape->logical_blk_num - mt_count); } } case MTLOCK: if (!idetape_create_prevent_cmd(drive, &pc, 1)) return 0; - retval = idetape_queue_pc_tail (drive, &pc); + retval = idetape_queue_pc_tail(drive, &pc); if (retval) return retval; tape->door_locked = DOOR_EXPLICITLY_LOCKED; return 0; case MTUNLOCK: if (!idetape_create_prevent_cmd(drive, &pc, 0)) return 0; - retval = idetape_queue_pc_tail (drive, &pc); + retval = idetape_queue_pc_tail(drive, &pc); if (retval) return retval; tape->door_locked = DOOR_UNLOCKED; return 0; default: - printk (KERN_ERR "ide-tape: MTIO operation %d not supported\n",mt_op); + printk(KERN_ERR "ide-tape: MTIO operation %d not supported\n",mt_op); return (-EIO); } } @@ -5236,7 +5495,7 @@ */ static int idetape_chrdev_ioctl (struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - ide_drive_t *drive = get_drive_ptr (inode->i_rdev); + ide_drive_t *drive = get_drive_ptr(inode->i_rdev); idetape_tape_t *tape = drive->driver_data; struct mtop mtop; struct mtget mtget; @@ -5245,30 +5504,30 @@ #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 3) - printk (KERN_INFO "ide-tape: Reached idetape_chrdev_ioctl, cmd=%u\n",cmd); + printk(KERN_INFO "ide-tape: Reached idetape_chrdev_ioctl, cmd=%u\n",cmd); #endif /* IDETAPE_DEBUG_LOG */ tape->restart_speed_control_req = 1; if (tape->chrdev_direction == idetape_direction_write) { - idetape_empty_write_pipeline (drive); - idetape_flush_tape_buffers (drive); + idetape_empty_write_pipeline(drive); + idetape_flush_tape_buffers(drive); } if (cmd == MTIOCGET || cmd == MTIOCPOS) { - block_offset = idetape_pipeline_size (drive) / (tape->tape_block_size * tape->user_bs_factor); + block_offset = idetape_pipeline_size(drive) / (tape->tape_block_size * tape->user_bs_factor); if ((position = idetape_read_position(drive)) < 0) return -EIO; } switch (cmd) { case MTIOCTOP: - if (copy_from_user ((char *) &mtop, (char *) arg, sizeof (struct mtop))) + if (copy_from_user((char *) &mtop, (char *) arg, sizeof (struct mtop))) return -EFAULT; - return (idetape_mtioctop (drive,mtop.mt_op,mtop.mt_count)); + return (idetape_mtioctop(drive,mtop.mt_op,mtop.mt_count)); case MTIOCGET: - memset (&mtget, 0, sizeof (struct mtget)); + memset(&mtget, 0, sizeof (struct mtget)); mtget.mt_type = MT_ISSCSI2; - if (!tape->onstream || tape->raw) + if (!tape->onstream || tape->raw) { mtget.mt_blkno = position / tape->user_bs_factor - block_offset; - else { + } else { if (!idetape_get_logical_blk(drive, -1, 10, 0)) mtget.mt_blkno = -1; else @@ -5297,8 +5556,8 @@ return 0; default: if (tape->chrdev_direction == idetape_direction_read) - idetape_discard_read_pipeline (drive, 1); - return (idetape_blkdev_ioctl (drive,inode,file,cmd,arg)); + idetape_discard_read_pipeline(drive, 1); + return (idetape_blkdev_ioctl(drive,inode,file,cmd,arg)); } } @@ -5318,7 +5577,7 @@ tape->wrt_pass_cntr = 0; tape->eod_frame_addr = OS_DATA_STARTFRAME1; tape->first_mark_addr = tape->last_mark_addr = -1; - stage = __idetape_kmalloc_stage (tape, 0, 0); + stage = __idetape_kmalloc_stage(tape, 0, 0); if (stage == NULL) return 0; #if ONSTREAM_DEBUG @@ -5326,16 +5585,17 @@ printk(KERN_INFO "ide-tape: %s: reading header\n", tape->name); #endif idetape_position_tape(drive, block, 0, 0); - if (!idetape_queue_rw_tail (drive, IDETAPE_READ_RQ, 1, stage->bh)) { - printk(KERN_INFO "ide-tape: %s: couldn't read header frame\n", tape->name); - __idetape_kfree_stage (stage); + if (!idetape_queue_rw_tail(drive, IDETAPE_READ_RQ, 1, stage->bh)) { + printk(KERN_INFO "ide-tape: %s: couldn't read header frame\n", + tape->name); + __idetape_kfree_stage(stage); return 0; } header = (os_header_t *) stage->bh->b_data; aux = stage->aux; if (strncmp(header->ident_str, "ADR_SEQ", 7) != 0) { printk(KERN_INFO "ide-tape: %s: invalid header identification string\n", tape->name); - __idetape_kfree_stage (stage); + __idetape_kfree_stage(stage); return 0; } if (header->major_rev != 1 || (header->minor_rev > OS_ADR_MINREV)) @@ -5354,17 +5614,21 @@ tape->linux_media = 1; tape->linux_media_version = tape->application_sig[3] - '0'; if (tape->linux_media_version != 3) - printk(KERN_INFO "ide-tape: %s: Linux media version %d detected (current 3)\n", - tape->name, tape->linux_media_version); + printk(KERN_INFO "ide-tape: %s: Linux media version " + "%d detected (current 3)\n", + tape->name, tape->linux_media_version); } else { - printk(KERN_INFO "ide-tape: %s: non Linux media detected (%s)\n", tape->name, tape->application_sig); + printk(KERN_INFO "ide-tape: %s: non Linux media detected " + "(%s)\n", tape->name, tape->application_sig); tape->linux_media = 0; } #if ONSTREAM_DEBUG if (tape->debug_level >= 2) - printk(KERN_INFO "ide-tape: %s: detected write pass counter %d, eod frame addr %d\n", tape->name, tape->wrt_pass_cntr, tape->eod_frame_addr); + printk(KERN_INFO "ide-tape: %s: detected write pass " + "counter %d, eod frame addr %d\n", tape->name, + tape->wrt_pass_cntr, tape->eod_frame_addr); #endif - __idetape_kfree_stage (stage); + __idetape_kfree_stage(stage); return 1; } @@ -5385,7 +5649,8 @@ for (block = 0xbae; block < 0xbb3; block++) /* 2990 - 2994 */ if (__idetape_analyze_headers(drive, block)) goto ok; - printk(KERN_ERR "ide-tape: %s: failed to find valid ADRL header\n", tape->name); + printk(KERN_ERR "ide-tape: %s: failed to find valid ADRL header\n", + tape->name); return 0; ok: if (position < OS_DATA_STARTFRAME1) @@ -5403,23 +5668,23 @@ ide_drive_t *drive; idetape_tape_t *tape; idetape_pc_t pc; - unsigned int minor=MINOR (inode->i_rdev); + unsigned int minor = MINOR(inode->i_rdev); #if IDETAPE_DEBUG_LOG printk (KERN_INFO "ide-tape: Reached idetape_chrdev_open\n"); #endif /* IDETAPE_DEBUG_LOG */ - if ((drive = get_drive_ptr (inode->i_rdev)) == NULL) + if ((drive = get_drive_ptr(inode->i_rdev)) == NULL) return -ENXIO; tape = drive->driver_data; - if (test_and_set_bit (IDETAPE_BUSY, &tape->flags)) + if (test_and_set_bit(IDETAPE_BUSY, &tape->flags)) return -EBUSY; MOD_INC_USE_COUNT; if (!tape->onstream) { idetape_read_position(drive); - if (!test_bit (IDETAPE_ADDRESS_VALID, &tape->flags)) - (void) idetape_rewind_tape (drive); + if (!test_bit(IDETAPE_ADDRESS_VALID, &tape->flags)) + (void) idetape_rewind_tape(drive); } else { if (minor & 64) { tape->tape_block_size = tape->stage_size = 32768 + 512; @@ -5438,12 +5703,12 @@ } idetape_read_position(drive); MOD_DEC_USE_COUNT; - clear_bit (IDETAPE_PIPELINE_ERROR, &tape->flags); + clear_bit(IDETAPE_PIPELINE_ERROR, &tape->flags); if (tape->chrdev_direction == idetape_direction_none) { MOD_INC_USE_COUNT; if (idetape_create_prevent_cmd(drive, &pc, 1)) { - if (!idetape_queue_pc_tail (drive, &pc)) { + if (!idetape_queue_pc_tail(drive, &pc)) { if (tape->door_locked != DOOR_EXPLICITLY_LOCKED) tape->door_locked = DOOR_LOCKED; } @@ -5458,22 +5723,22 @@ static void idetape_write_release (struct inode *inode) { - ide_drive_t *drive = get_drive_ptr (inode->i_rdev); + ide_drive_t *drive = get_drive_ptr(inode->i_rdev); idetape_tape_t *tape = drive->driver_data; - unsigned int minor=MINOR (inode->i_rdev); + unsigned int minor = MINOR(inode->i_rdev); - idetape_empty_write_pipeline (drive); - tape->merge_stage = __idetape_kmalloc_stage (tape, 1, 0); + idetape_empty_write_pipeline(drive); + tape->merge_stage = __idetape_kmalloc_stage(tape, 1, 0); if (tape->merge_stage != NULL) { - idetape_pad_zeros (drive, tape->tape_block_size * (tape->user_bs_factor - 1)); - __idetape_kfree_stage (tape->merge_stage); + idetape_pad_zeros(drive, tape->tape_block_size * (tape->user_bs_factor - 1)); + __idetape_kfree_stage(tape->merge_stage); tape->merge_stage = NULL; } idetape_write_filemark(drive); idetape_write_eod(drive); - idetape_flush_tape_buffers (drive); + idetape_flush_tape_buffers(drive); idetape_write_header(drive, minor >= 128); - idetape_flush_tape_buffers (drive); + idetape_flush_tape_buffers(drive); return; } @@ -5483,16 +5748,16 @@ */ static int idetape_chrdev_release (struct inode *inode, struct file *filp) { - ide_drive_t *drive = get_drive_ptr (inode->i_rdev); + ide_drive_t *drive = get_drive_ptr(inode->i_rdev); idetape_tape_t *tape; idetape_pc_t pc; - unsigned int minor=MINOR (inode->i_rdev); + unsigned int minor = MINOR(inode->i_rdev); lock_kernel(); tape = drive->driver_data; #if IDETAPE_DEBUG_LOG if (tape->debug_level >= 3) - printk (KERN_INFO "ide-tape: Reached idetape_chrdev_release\n"); + printk(KERN_INFO "ide-tape: Reached idetape_chrdev_release\n"); #endif /* IDETAPE_DEBUG_LOG */ if (tape->chrdev_direction == idetape_direction_write) { @@ -5500,25 +5765,25 @@ } if (tape->chrdev_direction == idetape_direction_read) { if (minor < 128) - idetape_discard_read_pipeline (drive, 1); + idetape_discard_read_pipeline(drive, 1); else - idetape_wait_for_pipeline (drive); + idetape_wait_for_pipeline(drive); } if (tape->cache_stage != NULL) { - __idetape_kfree_stage (tape->cache_stage); + __idetape_kfree_stage(tape->cache_stage); tape->cache_stage = NULL; } if (minor < 128) - (void) idetape_rewind_tape (drive); + (void) idetape_rewind_tape(drive); if (tape->chrdev_direction == idetape_direction_none) { if (tape->door_locked != DOOR_EXPLICITLY_LOCKED) { if (idetape_create_prevent_cmd(drive, &pc, 0)) - if (!idetape_queue_pc_tail (drive, &pc)) + if (!idetape_queue_pc_tail(drive, &pc)) tape->door_locked = DOOR_UNLOCKED; } MOD_DEC_USE_COUNT; } - clear_bit (IDETAPE_BUSY, &tape->flags); + clear_bit(IDETAPE_BUSY, &tape->flags); unlock_kernel(); return 0; } @@ -5545,107 +5810,107 @@ *((unsigned short *) &gcw) = id->config; #if IDETAPE_DEBUG_INFO - printk (KERN_INFO "ide-tape: Dumping ATAPI Identify Device tape parameters\n"); - printk (KERN_INFO "ide-tape: Protocol Type: "); + printk(KERN_INFO "ide-tape: Dumping ATAPI Identify Device tape parameters\n"); + printk(KERN_INFO "ide-tape: Protocol Type: "); switch (gcw.protocol) { - case 0: case 1: printk (KERN_INFO "ATA\n");break; - case 2: printk (KERN_INFO "ATAPI\n");break; - case 3: printk (KERN_INFO "Reserved (Unknown to ide-tape)\n");break; + case 0: case 1: printk(KERN_INFO "ATA\n");break; + case 2: printk(KERN_INFO "ATAPI\n");break; + case 3: printk(KERN_INFO "Reserved (Unknown to ide-tape)\n");break; } - printk (KERN_INFO "ide-tape: Device Type: %x - ",gcw.device_type); + printk(KERN_INFO "ide-tape: Device Type: %x - ",gcw.device_type); switch (gcw.device_type) { - case 0: printk (KERN_INFO "Direct-access Device\n");break; - case 1: printk (KERN_INFO "Streaming Tape Device\n");break; - case 2: case 3: case 4: printk (KERN_INFO "Reserved\n");break; - case 5: printk (KERN_INFO "CD-ROM Device\n");break; - case 6: printk (KERN_INFO "Reserved\n"); - case 7: printk (KERN_INFO "Optical memory Device\n");break; - case 0x1f: printk (KERN_INFO "Unknown or no Device type\n");break; - default: printk (KERN_INFO "Reserved\n"); + case 0: printk(KERN_INFO "Direct-access Device\n");break; + case 1: printk(KERN_INFO "Streaming Tape Device\n");break; + case 2: case 3: case 4: printk(KERN_INFO "Reserved\n");break; + case 5: printk(KERN_INFO "CD-ROM Device\n");break; + case 6: printk(KERN_INFO "Reserved\n"); + case 7: printk(KERN_INFO "Optical memory Device\n");break; + case 0x1f: printk(KERN_INFO "Unknown or no Device type\n");break; + default: printk(KERN_INFO "Reserved\n"); } - printk (KERN_INFO "ide-tape: Removable: %s",gcw.removable ? "Yes\n":"No\n"); - printk (KERN_INFO "ide-tape: Command Packet DRQ Type: "); + printk(KERN_INFO "ide-tape: Removable: %s",gcw.removable ? "Yes\n":"No\n"); + printk(KERN_INFO "ide-tape: Command Packet DRQ Type: "); switch (gcw.drq_type) { - case 0: printk (KERN_INFO "Microprocessor DRQ\n");break; - case 1: printk (KERN_INFO "Interrupt DRQ\n");break; - case 2: printk (KERN_INFO "Accelerated DRQ\n");break; - case 3: printk (KERN_INFO "Reserved\n");break; + case 0: printk(KERN_INFO "Microprocessor DRQ\n");break; + case 1: printk(KERN_INFO "Interrupt DRQ\n");break; + case 2: printk(KERN_INFO "Accelerated DRQ\n");break; + case 3: printk(KERN_INFO "Reserved\n");break; } - printk (KERN_INFO "ide-tape: Command Packet Size: "); + printk(KERN_INFO "ide-tape: Command Packet Size: "); switch (gcw.packet_size) { - case 0: printk (KERN_INFO "12 bytes\n");break; - case 1: printk (KERN_INFO "16 bytes\n");break; - default: printk (KERN_INFO "Reserved\n");break; - } - printk (KERN_INFO "ide-tape: Model: %.40s\n",id->model); - printk (KERN_INFO "ide-tape: Firmware Revision: %.8s\n",id->fw_rev); - printk (KERN_INFO "ide-tape: Serial Number: %.20s\n",id->serial_no); - printk (KERN_INFO "ide-tape: Write buffer size: %d bytes\n",id->buf_size*512); - printk (KERN_INFO "ide-tape: DMA: %s",id->capability & 0x01 ? "Yes\n":"No\n"); - printk (KERN_INFO "ide-tape: LBA: %s",id->capability & 0x02 ? "Yes\n":"No\n"); - printk (KERN_INFO "ide-tape: IORDY can be disabled: %s",id->capability & 0x04 ? "Yes\n":"No\n"); - printk (KERN_INFO "ide-tape: IORDY supported: %s",id->capability & 0x08 ? "Yes\n":"Unknown\n"); - printk (KERN_INFO "ide-tape: ATAPI overlap supported: %s",id->capability & 0x20 ? "Yes\n":"No\n"); - printk (KERN_INFO "ide-tape: PIO Cycle Timing Category: %d\n",id->tPIO); - printk (KERN_INFO "ide-tape: DMA Cycle Timing Category: %d\n",id->tDMA); - printk (KERN_INFO "ide-tape: Single Word DMA supported modes: "); + case 0: printk(KERN_INFO "12 bytes\n");break; + case 1: printk(KERN_INFO "16 bytes\n");break; + default: printk(KERN_INFO "Reserved\n");break; + } + printk(KERN_INFO "ide-tape: Model: %.40s\n",id->model); + printk(KERN_INFO "ide-tape: Firmware Revision: %.8s\n",id->fw_rev); + printk(KERN_INFO "ide-tape: Serial Number: %.20s\n",id->serial_no); + printk(KERN_INFO "ide-tape: Write buffer size: %d bytes\n",id->buf_size*512); + printk(KERN_INFO "ide-tape: DMA: %s",id->capability & 0x01 ? "Yes\n":"No\n"); + printk(KERN_INFO "ide-tape: LBA: %s",id->capability & 0x02 ? "Yes\n":"No\n"); + printk(KERN_INFO "ide-tape: IORDY can be disabled: %s",id->capability & 0x04 ? "Yes\n":"No\n"); + printk(KERN_INFO "ide-tape: IORDY supported: %s",id->capability & 0x08 ? "Yes\n":"Unknown\n"); + printk(KERN_INFO "ide-tape: ATAPI overlap supported: %s",id->capability & 0x20 ? "Yes\n":"No\n"); + printk(KERN_INFO "ide-tape: PIO Cycle Timing Category: %d\n",id->tPIO); + printk(KERN_INFO "ide-tape: DMA Cycle Timing Category: %d\n",id->tDMA); + printk(KERN_INFO "ide-tape: Single Word DMA supported modes: "); for (i=0,mask=1;i<8;i++,mask=mask << 1) { if (id->dma_1word & mask) - printk (KERN_INFO "%d ",i); + printk(KERN_INFO "%d ",i); if (id->dma_1word & (mask << 8)) - printk (KERN_INFO "(active) "); + printk(KERN_INFO "(active) "); } - printk (KERN_INFO "\n"); - printk (KERN_INFO "ide-tape: Multi Word DMA supported modes: "); + printk(KERN_INFO "\n"); + printk(KERN_INFO "ide-tape: Multi Word DMA supported modes: "); for (i=0,mask=1;i<8;i++,mask=mask << 1) { if (id->dma_mword & mask) - printk (KERN_INFO "%d ",i); + printk(KERN_INFO "%d ",i); if (id->dma_mword & (mask << 8)) - printk (KERN_INFO "(active) "); + printk(KERN_INFO "(active) "); } - printk (KERN_INFO "\n"); + printk(KERN_INFO "\n"); if (id->field_valid & 0x0002) { - printk (KERN_INFO "ide-tape: Enhanced PIO Modes: %s\n",id->eide_pio_modes & 1 ? "Mode 3":"None"); - printk (KERN_INFO "ide-tape: Minimum Multi-word DMA cycle per word: "); + printk(KERN_INFO "ide-tape: Enhanced PIO Modes: %s\n",id->eide_pio_modes & 1 ? "Mode 3":"None"); + printk(KERN_INFO "ide-tape: Minimum Multi-word DMA cycle per word: "); if (id->eide_dma_min == 0) - printk (KERN_INFO "Not supported\n"); + printk(KERN_INFO "Not supported\n"); else - printk (KERN_INFO "%d ns\n",id->eide_dma_min); + printk(KERN_INFO "%d ns\n",id->eide_dma_min); - printk (KERN_INFO "ide-tape: Manufacturer\'s Recommended Multi-word cycle: "); + printk(KERN_INFO "ide-tape: Manufacturer\'s Recommended Multi-word cycle: "); if (id->eide_dma_time == 0) - printk (KERN_INFO "Not supported\n"); + printk(KERN_INFO "Not supported\n"); else - printk (KERN_INFO "%d ns\n",id->eide_dma_time); + printk(KERN_INFO "%d ns\n",id->eide_dma_time); - printk (KERN_INFO "ide-tape: Minimum PIO cycle without IORDY: "); + printk(KERN_INFO "ide-tape: Minimum PIO cycle without IORDY: "); if (id->eide_pio == 0) - printk (KERN_INFO "Not supported\n"); + printk(KERN_INFO "Not supported\n"); else - printk (KERN_INFO "%d ns\n",id->eide_pio); + printk(KERN_INFO "%d ns\n",id->eide_pio); - printk (KERN_INFO "ide-tape: Minimum PIO cycle with IORDY: "); + printk(KERN_INFO "ide-tape: Minimum PIO cycle with IORDY: "); if (id->eide_pio_iordy == 0) - printk (KERN_INFO "Not supported\n"); + printk(KERN_INFO "Not supported\n"); else - printk (KERN_INFO "%d ns\n",id->eide_pio_iordy); + printk(KERN_INFO "%d ns\n",id->eide_pio_iordy); } else - printk (KERN_INFO "ide-tape: According to the device, fields 64-70 are not valid.\n"); + printk(KERN_INFO "ide-tape: According to the device, fields 64-70 are not valid.\n"); #endif /* IDETAPE_DEBUG_INFO */ /* Check that we can support this device */ if (gcw.protocol !=2 ) - printk (KERN_ERR "ide-tape: Protocol is not ATAPI\n"); + printk(KERN_ERR "ide-tape: Protocol is not ATAPI\n"); else if (gcw.device_type != 1) - printk (KERN_ERR "ide-tape: Device type is not set to tape\n"); + printk(KERN_ERR "ide-tape: Device type is not set to tape\n"); else if (!gcw.removable) - printk (KERN_ERR "ide-tape: The removable flag is not set\n"); + printk(KERN_ERR "ide-tape: The removable flag is not set\n"); else if (gcw.packet_size != 0) { - printk (KERN_ERR "ide-tape: Packet size is not 12 bytes long\n"); + printk(KERN_ERR "ide-tape: Packet size is not 12 bytes long\n"); if (gcw.packet_size == 1) - printk (KERN_ERR "ide-tape: Sorry, padding to 16 bytes is still not supported\n"); + printk(KERN_ERR "ide-tape: Sorry, padding to 16 bytes is still not supported\n"); } else return 1; return 0; @@ -5672,8 +5937,8 @@ pc.buffer[4 + 5] = vendor[3]; pc.buffer[4 + 6] = 0; pc.buffer[4 + 7] = 0; - if (idetape_queue_pc_tail (drive, &pc)) - printk (KERN_ERR "ide-tape: Couldn't set vendor name to %s\n", vendor); + if (idetape_queue_pc_tail(drive, &pc)) + printk(KERN_ERR "ide-tape: Couldn't set vendor name to %s\n", vendor); } @@ -5694,8 +5959,8 @@ pc.buffer[4 + 1] = 2; pc.buffer[4 + 2] = 4; pc.buffer[4 + 3] = retries; - if (idetape_queue_pc_tail (drive, &pc)) - printk (KERN_ERR "ide-tape: Couldn't set retries to %d\n", retries); + if (idetape_queue_pc_tail(drive, &pc)) + printk(KERN_ERR "ide-tape: Couldn't set retries to %d\n", retries); } #endif @@ -5711,9 +5976,9 @@ /* * Get the current block size from the block size mode page */ - idetape_create_mode_sense_cmd (&pc, IDETAPE_BLOCK_SIZE_PAGE); - if (idetape_queue_pc_tail (drive, &pc)) - printk (KERN_ERR "ide-tape: can't get tape block size mode page\n"); + idetape_create_mode_sense_cmd(&pc, IDETAPE_BLOCK_SIZE_PAGE); + if (idetape_queue_pc_tail(drive, &pc)) + printk(KERN_ERR "ide-tape: can't get tape block size mode page\n"); header = (idetape_mode_parameter_header_t *) pc.buffer; bs = (idetape_block_size_page_t *) (pc.buffer + sizeof(idetape_mode_parameter_header_t) + header->bdl); @@ -5733,8 +5998,8 @@ bs->record32 = 0; bs->record32_5 = 1; idetape_create_mode_select_cmd(&pc, sizeof(*header) + sizeof(*bs)); - if (idetape_queue_pc_tail (drive, &pc)) - printk (KERN_ERR "ide-tape: Couldn't set tape block size mode page\n"); + if (idetape_queue_pc_tail(drive, &pc)) + printk(KERN_ERR "ide-tape: Couldn't set tape block size mode page\n"); #if ONSTREAM_DEBUG /* @@ -5756,8 +6021,8 @@ idetape_inquiry_result_t *inquiry; idetape_create_inquiry_cmd(&pc); - if (idetape_queue_pc_tail (drive, &pc)) { - printk (KERN_ERR "ide-tape: %s: can't get INQUIRY results\n", tape->name); + if (idetape_queue_pc_tail(drive, &pc)) { + printk(KERN_ERR "ide-tape: %s: can't get INQUIRY results\n", tape->name); return; } inquiry = (idetape_inquiry_result_t *) pc.buffer; @@ -5809,9 +6074,9 @@ idetape_mode_parameter_header_t *header; onstream_tape_paramtr_page_t *prm; - idetape_create_mode_sense_cmd (&pc, IDETAPE_PARAMTR_PAGE); - if (idetape_queue_pc_tail (drive, &pc)) { - printk (KERN_ERR "ide-tape: Can't get tape parameters page - probably no tape inserted in onstream drive\n"); + idetape_create_mode_sense_cmd(&pc, IDETAPE_PARAMTR_PAGE); + if (idetape_queue_pc_tail(drive, &pc)) { + printk(KERN_ERR "ide-tape: Can't get tape parameters page - probably no tape inserted in onstream drive\n"); return; } header = (idetape_mode_parameter_header_t *) pc.buffer; @@ -5819,7 +6084,7 @@ tape->capacity = ntohs(prm->segtrk) * ntohs(prm->trks); if (debug) { - printk (KERN_INFO "ide-tape: %s <-> %s: Tape length %dMB (%d frames/track, %d tracks = %d blocks, density: %dKbpi)\n", + printk(KERN_INFO "ide-tape: %s <-> %s: Tape length %dMB (%d frames/track, %d tracks = %d blocks, density: %dKbpi)\n", drive->name, tape->name, tape->capacity/32, ntohs(prm->segtrk), ntohs(prm->trks), tape->capacity, prm->density); } @@ -5838,20 +6103,22 @@ idetape_mode_parameter_header_t *header; idetape_capabilities_page_t *capabilities; - idetape_create_mode_sense_cmd (&pc, IDETAPE_CAPABILITIES_PAGE); + idetape_create_mode_sense_cmd(&pc, IDETAPE_CAPABILITIES_PAGE); if (idetape_queue_pc_tail (drive, &pc)) { - printk (KERN_ERR "ide-tape: Can't get tape parameters - assuming some default values\n"); - tape->tape_block_size = 512; tape->capabilities.ctl = 52; - tape->capabilities.speed = 450; tape->capabilities.buffer_size = 6 * 52; + printk(KERN_ERR "ide-tape: Can't get tape parameters - assuming some default values\n"); + tape->tape_block_size = 512; + tape->capabilities.ctl = 52; + tape->capabilities.speed = 450; + tape->capabilities.buffer_size = 6 * 52; return; } header = (idetape_mode_parameter_header_t *) pc.buffer; capabilities = (idetape_capabilities_page_t *) (pc.buffer + sizeof(idetape_mode_parameter_header_t) + header->bdl); - capabilities->max_speed = ntohs (capabilities->max_speed); - capabilities->ctl = ntohs (capabilities->ctl); - capabilities->speed = ntohs (capabilities->speed); - capabilities->buffer_size = ntohs (capabilities->buffer_size); + capabilities->max_speed = ntohs(capabilities->max_speed); + capabilities->ctl = ntohs(capabilities->ctl); + capabilities->speed = ntohs(capabilities->speed); + capabilities->buffer_size = ntohs(capabilities->buffer_size); if (!capabilities->speed) { printk(KERN_INFO "ide-tape: %s: overriding capabilities->speed (assuming 650KB/sec)\n", drive->name); @@ -5871,33 +6138,33 @@ tape->tape_block_size = 32768; #if IDETAPE_DEBUG_INFO - printk (KERN_INFO "ide-tape: Dumping the results of the MODE SENSE packet command\n"); - printk (KERN_INFO "ide-tape: Mode Parameter Header:\n"); - printk (KERN_INFO "ide-tape: Mode Data Length - %d\n",header->mode_data_length); - printk (KERN_INFO "ide-tape: Medium Type - %d\n",header->medium_type); - printk (KERN_INFO "ide-tape: Device Specific Parameter - %d\n",header->dsp); - printk (KERN_INFO "ide-tape: Block Descriptor Length - %d\n",header->bdl); + printk(KERN_INFO "ide-tape: Dumping the results of the MODE SENSE packet command\n"); + printk(KERN_INFO "ide-tape: Mode Parameter Header:\n"); + printk(KERN_INFO "ide-tape: Mode Data Length - %d\n",header->mode_data_length); + printk(KERN_INFO "ide-tape: Medium Type - %d\n",header->medium_type); + printk(KERN_INFO "ide-tape: Device Specific Parameter - %d\n",header->dsp); + printk(KERN_INFO "ide-tape: Block Descriptor Length - %d\n",header->bdl); - printk (KERN_INFO "ide-tape: Capabilities and Mechanical Status Page:\n"); - printk (KERN_INFO "ide-tape: Page code - %d\n",capabilities->page_code); - printk (KERN_INFO "ide-tape: Page length - %d\n",capabilities->page_length); - printk (KERN_INFO "ide-tape: Read only - %s\n",capabilities->ro ? "Yes":"No"); - printk (KERN_INFO "ide-tape: Supports reverse space - %s\n",capabilities->sprev ? "Yes":"No"); - printk (KERN_INFO "ide-tape: Supports erase initiated formatting - %s\n",capabilities->efmt ? "Yes":"No"); - printk (KERN_INFO "ide-tape: Supports QFA two Partition format - %s\n",capabilities->qfa ? "Yes":"No"); - printk (KERN_INFO "ide-tape: Supports locking the medium - %s\n",capabilities->lock ? "Yes":"No"); - printk (KERN_INFO "ide-tape: The volume is currently locked - %s\n",capabilities->locked ? "Yes":"No"); - printk (KERN_INFO "ide-tape: The device defaults in the prevent state - %s\n",capabilities->prevent ? "Yes":"No"); - printk (KERN_INFO "ide-tape: Supports ejecting the medium - %s\n",capabilities->eject ? "Yes":"No"); - printk (KERN_INFO "ide-tape: Supports error correction - %s\n",capabilities->ecc ? "Yes":"No"); - printk (KERN_INFO "ide-tape: Supports data compression - %s\n",capabilities->cmprs ? "Yes":"No"); - printk (KERN_INFO "ide-tape: Supports 512 bytes block size - %s\n",capabilities->blk512 ? "Yes":"No"); - printk (KERN_INFO "ide-tape: Supports 1024 bytes block size - %s\n",capabilities->blk1024 ? "Yes":"No"); - printk (KERN_INFO "ide-tape: Supports 32768 bytes block size / Restricted byte count for PIO transfers - %s\n",capabilities->blk32768 ? "Yes":"No"); - printk (KERN_INFO "ide-tape: Maximum supported speed in KBps - %d\n",capabilities->max_speed); - printk (KERN_INFO "ide-tape: Continuous transfer limits in blocks - %d\n",capabilities->ctl); - printk (KERN_INFO "ide-tape: Current speed in KBps - %d\n",capabilities->speed); - printk (KERN_INFO "ide-tape: Buffer size - %d\n",capabilities->buffer_size*512); + printk(KERN_INFO "ide-tape: Capabilities and Mechanical Status Page:\n"); + printk(KERN_INFO "ide-tape: Page code - %d\n",capabilities->page_code); + printk(KERN_INFO "ide-tape: Page length - %d\n",capabilities->page_length); + printk(KERN_INFO "ide-tape: Read only - %s\n",capabilities->ro ? "Yes":"No"); + printk(KERN_INFO "ide-tape: Supports reverse space - %s\n",capabilities->sprev ? "Yes":"No"); + printk(KERN_INFO "ide-tape: Supports erase initiated formatting - %s\n",capabilities->efmt ? "Yes":"No"); + printk(KERN_INFO "ide-tape: Supports QFA two Partition format - %s\n",capabilities->qfa ? "Yes":"No"); + printk(KERN_INFO "ide-tape: Supports locking the medium - %s\n",capabilities->lock ? "Yes":"No"); + printk(KERN_INFO "ide-tape: The volume is currently locked - %s\n",capabilities->locked ? "Yes":"No"); + printk(KERN_INFO "ide-tape: The device defaults in the prevent state - %s\n",capabilities->prevent ? "Yes":"No"); + printk(KERN_INFO "ide-tape: Supports ejecting the medium - %s\n",capabilities->eject ? "Yes":"No"); + printk(KERN_INFO "ide-tape: Supports error correction - %s\n",capabilities->ecc ? "Yes":"No"); + printk(KERN_INFO "ide-tape: Supports data compression - %s\n",capabilities->cmprs ? "Yes":"No"); + printk(KERN_INFO "ide-tape: Supports 512 bytes block size - %s\n",capabilities->blk512 ? "Yes":"No"); + printk(KERN_INFO "ide-tape: Supports 1024 bytes block size - %s\n",capabilities->blk1024 ? "Yes":"No"); + printk(KERN_INFO "ide-tape: Supports 32768 bytes block size / Restricted byte count for PIO transfers - %s\n",capabilities->blk32768 ? "Yes":"No"); + printk(KERN_INFO "ide-tape: Maximum supported speed in KBps - %d\n",capabilities->max_speed); + printk(KERN_INFO "ide-tape: Continuous transfer limits in blocks - %d\n",capabilities->ctl); + printk(KERN_INFO "ide-tape: Current speed in KBps - %d\n",capabilities->speed); + printk(KERN_INFO "ide-tape: Buffer size - %d\n",capabilities->buffer_size*512); #endif /* IDETAPE_DEBUG_INFO */ } @@ -5913,9 +6180,9 @@ idetape_mode_parameter_header_t *header; idetape_parameter_block_descriptor_t *block_descrp; - idetape_create_mode_sense_cmd (&pc, IDETAPE_BLOCK_DESCRIPTOR); - if (idetape_queue_pc_tail (drive, &pc)) { - printk (KERN_ERR "ide-tape: Can't get block descriptor\n"); + idetape_create_mode_sense_cmd(&pc, IDETAPE_BLOCK_DESCRIPTOR); + if (idetape_queue_pc_tail(drive, &pc)) { + printk(KERN_ERR "ide-tape: Can't get block descriptor\n"); if (tape->tape_block_size == 0) { printk(KERN_WARNING "ide-tape: Cannot deal with zero block size, assume 32k\n"); tape->tape_block_size = 32768; @@ -5926,9 +6193,10 @@ block_descrp = (idetape_parameter_block_descriptor_t *) (pc.buffer + sizeof(idetape_mode_parameter_header_t)); tape->tape_block_size =( block_descrp->length[0]<<16) + (block_descrp->length[1]<<8) + block_descrp->length[2]; #if IDETAPE_DEBUG_INFO - printk (KERN_INFO "ide-tape: Adjusted block size - %d\n", tape->tape_block_size); + printk(KERN_INFO "ide-tape: Adjusted block size - %d\n", tape->tape_block_size); #endif /* IDETAPE_DEBUG_INFO */ } + static void idetape_add_settings (ide_drive_t *drive) { idetape_tape_t *tape = drive->driver_data; @@ -5984,29 +6252,24 @@ int stage_size; struct sysinfo si; - memset (tape, 0, sizeof (idetape_tape_t)); + memset(tape, 0, sizeof (idetape_tape_t)); spin_lock_init(&tape->spinlock); drive->driver_data = tape; - drive->ready_stat = 0; /* An ATAPI device ignores DRDY */ + /* An ATAPI device ignores DRDY */ + drive->ready_stat = 0; if (strstr(drive->id->model, "OnStream DI-")) tape->onstream = 1; - drive->dsc_overlap = 1; -#ifdef CONFIG_BLK_DEV_IDEPCI - if (!tape->onstream && HWIF(drive)->pci_dev != NULL) { - /* - * These two ide-pci host adapters appear to need DSC overlap disabled. - * This probably needs further analysis. - */ - if ((HWIF(drive)->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) || - (HWIF(drive)->pci_dev->device == PCI_DEVICE_ID_TTI_HPT343)) { - printk(KERN_INFO "ide-tape: %s: disabling DSC overlap\n", tape->name); - drive->dsc_overlap = 0; - } + drive->dsc_overlap = (HWIF(drive)->no_dsc) ? 0 : 1; + if (HWIF(drive)->no_dsc) { + printk(KERN_INFO "ide-tape: %s: disabling DSC overlap\n", + tape->name); + drive->dsc_overlap = 0; } -#endif /* CONFIG_BLK_DEV_IDEPCI */ tape->drive = drive; tape->minor = minor; - tape->name[0] = 'h'; tape->name[1] = 't'; tape->name[2] = '0' + minor; + tape->name[0] = 'h'; + tape->name[1] = 't'; + tape->name[2] = '0' + minor; tape->chrdev_direction = idetape_direction_none; tape->pc = tape->pc_stack; tape->max_insert_speed = 10000; @@ -6044,7 +6307,7 @@ * Select the "best" DSC read/write polling frequency * and pipeline size. */ - speed = IDE_MAX (tape->capabilities.speed, tape->capabilities.max_speed); + speed = IDE_MAX(tape->capabilities.speed, tape->capabilities.max_speed); tape->max_stages = speed * 1000 * 10 / tape->stage_size; @@ -6052,7 +6315,7 @@ * Limit memory use for pipeline to 10% of physical memory */ si_meminfo(&si); - if ( tape->max_stages * tape->stage_size > si.totalram * si.mem_unit / 10) + if (tape->max_stages * tape->stage_size > si.totalram * si.mem_unit / 10) tape->max_stages = si.totalram * si.mem_unit / (10 * tape->stage_size); tape->min_pipeline = tape->max_stages; tape->max_pipeline = tape->max_stages * 2; @@ -6070,11 +6333,15 @@ * Ensure that the number we got makes sense; limit * it within IDETAPE_DSC_RW_MIN and IDETAPE_DSC_RW_MAX. */ - tape->best_dsc_rw_frequency = IDE_MAX (IDE_MIN (t, IDETAPE_DSC_RW_MAX), IDETAPE_DSC_RW_MIN); - printk (KERN_INFO "ide-tape: %s <-> %s: %dKBps, %d*%dkB buffer, %dkB pipeline, %lums tDSC%s\n", - drive->name, tape->name, tape->capabilities.speed, (tape->capabilities.buffer_size * 512) / tape->stage_size, - tape->stage_size / 1024, tape->max_stages * tape->stage_size / 1024, - tape->best_dsc_rw_frequency * 1000 / HZ, drive->using_dma ? ", DMA":""); + tape->best_dsc_rw_frequency = IDE_MAX(IDE_MIN(t, IDETAPE_DSC_RW_MAX), IDETAPE_DSC_RW_MIN); + printk(KERN_INFO "ide-tape: %s <-> %s: %dKBps, %d*%dkB buffer, " + "%dkB pipeline, %lums tDSC%s\n", + drive->name, tape->name, tape->capabilities.speed, + (tape->capabilities.buffer_size * 512) / tape->stage_size, + tape->stage_size / 1024, + tape->max_stages * tape->stage_size / 1024, + tape->best_dsc_rw_frequency * 1000 / HZ, + drive->using_dma ? ", DMA":""); idetape_add_settings(drive); } @@ -6085,24 +6352,24 @@ int minor = tape->minor; unsigned long flags; - save_flags (flags); /* all CPUs (overkill?) */ - cli(); /* all CPUs (overkill?) */ - if (test_bit (IDETAPE_BUSY, &tape->flags) || tape->first_stage != NULL || tape->merge_stage_size || drive->usage) { - restore_flags(flags); /* all CPUs (overkill?) */ + spin_lock_irqsave(&io_request_lock, flags); + if (test_bit(IDETAPE_BUSY, &tape->flags) || drive->usage || + tape->first_stage != NULL || tape->merge_stage_size) { + spin_unlock_irqrestore(&io_request_lock, flags); return 1; } idetape_chrdevs[minor].drive = NULL; - restore_flags (flags); /* all CPUs (overkill?) */ + spin_unlock_irqrestore(&io_request_lock, flags); DRIVER(drive)->busy = 0; - (void) ide_unregister_subdriver (drive); + (void) ide_unregister_subdriver(drive); drive->driver_data = NULL; - devfs_unregister (tape->de_r); - devfs_unregister (tape->de_n); - kfree (tape); + devfs_unregister(tape->de_r); + devfs_unregister(tape->de_n); + kfree(tape); for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++) if (idetape_chrdevs[minor].drive != NULL) return 0; - devfs_unregister_chrdev (IDETAPE_MAJOR, "ht"); + devfs_unregister_chrdev(IDETAPE_MAJOR, "ht"); idetape_chrdev_present = 0; return 0; } @@ -6132,7 +6399,8 @@ #endif -int idetape_reinit(ide_drive_t *drive); +int idetape_init (void); +int idetape_attach(ide_drive_t *drive); /* * IDE subdriver functions, registered with ide.c @@ -6142,13 +6410,21 @@ version: IDETAPE_VERSION, media: ide_tape, busy: 1, +#ifdef CONFIG_IDEDMA_ONLYDISK + supports_dma: 0, +#else supports_dma: 1, +#endif supports_dsc_overlap: 1, cleanup: idetape_cleanup, standby: NULL, + suspend: NULL, + resume: NULL, flushcache: NULL, do_request: idetape_do_request, end_request: idetape_end_request, + sense: NULL, + error: NULL, ioctl: idetape_blkdev_ioctl, open: idetape_blkdev_open, release: idetape_blkdev_release, @@ -6156,13 +6432,14 @@ revalidate: NULL, pre_reset: idetape_pre_reset, capacity: NULL, + special: NULL, proc: idetape_proc, - reinit: idetape_reinit, + init: idetape_init, + attach: idetape_attach, ata_prebuilder: NULL, atapi_prebuilder: NULL, }; -int idetape_init (void); static ide_module_t idetape_module = { IDE_DRIVER_MODULE, idetape_init, @@ -6182,90 +6459,62 @@ release: idetape_chrdev_release, }; -int idetape_reinit (ide_drive_t *drive) +int idetape_attach (ide_drive_t *drive) { -#if 0 idetape_tape_t *tape; - int minor, failed = 0, supported = 0; -/* DRIVER(drive)->busy++; */ + int minor = 0, ret = 0; + MOD_INC_USE_COUNT; -#if ONSTREAM_DEBUG - printk(KERN_INFO "ide-tape: MOD_INC_USE_COUNT in idetape_init\n"); -#endif - if (!idetape_chrdev_present) - for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++ ) - idetape_chrdevs[minor].drive = NULL; - if ((drive = ide_scan_devices (ide_tape, idetape_driver.name, NULL, failed++)) == NULL) { - ide_register_module (&idetape_module); - MOD_DEC_USE_COUNT; -#if ONSTREAM_DEBUG - printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n"); -#endif - return 0; - } - if (!idetape_chrdev_present && - devfs_register_chrdev (IDETAPE_MAJOR, "ht", &idetape_fops)) { - printk (KERN_ERR "ide-tape: Failed to register character device interface\n"); - MOD_DEC_USE_COUNT; -#if ONSTREAM_DEBUG - printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n"); -#endif - return -EBUSY; - } - do { - if (!idetape_identify_device (drive, drive->id)) { - printk (KERN_ERR "ide-tape: %s: not supported by this version of ide-tape\n", drive->name); - continue; - } - if (drive->scsi) { - if (strstr(drive->id->model, "OnStream DI-30")) { - printk("ide-tape: ide-scsi emulation is not supported for %s.\n", drive->id->model); - } else { - printk("ide-tape: passing drive %s to ide-scsi emulation.\n", drive->name); - continue; - } - } - tape = (idetape_tape_t *) kmalloc (sizeof (idetape_tape_t), GFP_KERNEL); - if (tape == NULL) { - printk (KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name); - continue; - } - if (ide_register_subdriver (drive, &idetape_driver, IDE_SUBDRIVER_VERSION)) { - printk (KERN_ERR "ide-tape: %s: Failed to register the driver with ide.c\n", drive->name); - kfree (tape); - continue; - } - for (minor = 0; idetape_chrdevs[minor].drive != NULL; minor++); - idetape_setup (drive, tape, minor); - idetape_chrdevs[minor].drive = drive; - tape->de_r = - devfs_register (drive->de, "mt", DEVFS_FL_DEFAULT, + if (!idetape_identify_device(drive, drive->id)) { + printk(KERN_ERR "ide-tape: %s: not supported by this " + "version of ide-tape\n", drive->name); + ret = 1; + goto bye_game_over; + } + if (drive->scsi) { + if (strstr(drive->id->model, "OnStream DI-30")) { + printk("ide-tape: ide-scsi emulation is not " + "supported for %s.\n", drive->id->model); + } else { + printk("ide-tape: passing drive %s to ide-scsi " + "emulation.\n", drive->name); + ret = 1; + goto bye_game_over; + } + } + tape = (idetape_tape_t *) kmalloc (sizeof (idetape_tape_t), GFP_KERNEL); + if (tape == NULL) { + printk(KERN_ERR "ide-tape: %s: Can't allocate a " + "tape structure\n", drive->name); + ret = 1; + goto bye_game_over; + } + if (ide_register_subdriver(drive, + &idetape_driver, IDE_SUBDRIVER_VERSION)) { + printk(KERN_ERR "ide-tape: %s: Failed to register the " + "driver with ide.c\n", drive->name); + kfree(tape); + ret = 1; + goto bye_game_over; + } + for (minor = 0; idetape_chrdevs[minor].drive != NULL; minor++); + idetape_setup (drive, tape, minor); + idetape_chrdevs[minor].drive = drive; + tape->de_r = devfs_register(drive->de, "mt", DEVFS_FL_DEFAULT, HWIF(drive)->major, minor, S_IFCHR | S_IRUGO | S_IWUGO, &idetape_fops, NULL); - tape->de_n = - devfs_register (drive->de, "mtn", DEVFS_FL_DEFAULT, + tape->de_n = devfs_register(drive->de, "mtn", DEVFS_FL_DEFAULT, HWIF(drive)->major, minor + 128, S_IFCHR | S_IRUGO | S_IWUGO, &idetape_fops, NULL); - devfs_register_tape (tape->de_r); - supported++; failed--; - } while ((drive = ide_scan_devices (ide_tape, idetape_driver.name, NULL, failed++)) != NULL); - if (!idetape_chrdev_present && !supported) { - devfs_unregister_chrdev (IDETAPE_MAJOR, "ht"); - } else - idetape_chrdev_present = 1; - ide_register_module (&idetape_module); + devfs_register_tape(tape->de_r); + +bye_game_over: MOD_DEC_USE_COUNT; -#if ONSTREAM_DEBUG - printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n"); -#endif - return 0; -#else - return 1; -#endif + return ret; } MODULE_DESCRIPTION("ATAPI Streaming TAPE Driver"); @@ -6278,94 +6527,118 @@ for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++) { drive = idetape_chrdevs[minor].drive; - if (drive != NULL && idetape_cleanup (drive)) - printk (KERN_ERR "ide-tape: %s: cleanup_module() called while still busy\n", drive->name); + if (drive != NULL && idetape_cleanup(drive)) + printk(KERN_ERR "ide-tape: %s: cleanup_module() " + "called while still busy\n", drive->name); } +#ifdef CONFIG_PROC_FS + if (drive->proc) + ide_remove_proc_entries(drive->proc, idetape_proc); +#endif + ide_unregister_module(&idetape_module); } -/* - * idetape_init will register the driver for each tape. - */ int idetape_init (void) { +#ifdef CLASSIC_BUILTINS_METHOD ide_drive_t *drive; idetape_tape_t *tape; int minor, failed = 0, supported = 0; /* DRIVER(drive)->busy++; */ MOD_INC_USE_COUNT; #if ONSTREAM_DEBUG - printk(KERN_INFO "ide-tape: MOD_INC_USE_COUNT in idetape_init\n"); + printk(KERN_INFO "ide-tape: MOD_INC_USE_COUNT in idetape_init\n"); #endif if (!idetape_chrdev_present) for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++ ) idetape_chrdevs[minor].drive = NULL; - - if ((drive = ide_scan_devices (ide_tape, idetape_driver.name, NULL, failed++)) == NULL) { - ide_register_module (&idetape_module); + if ((drive = ide_scan_devices(ide_tape, idetape_driver.name, + NULL, failed++)) == NULL) { + ide_register_module(&idetape_module); MOD_DEC_USE_COUNT; #if ONSTREAM_DEBUG - printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n"); + printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in " + "idetape_init\n"); #endif return 0; } if (!idetape_chrdev_present && - devfs_register_chrdev (IDETAPE_MAJOR, "ht", &idetape_fops)) { - printk (KERN_ERR "ide-tape: Failed to register character device interface\n"); + devfs_register_chrdev(IDETAPE_MAJOR, "ht", &idetape_fops)) { + printk(KERN_ERR "ide-tape: Failed to register character " + "device interface\n"); MOD_DEC_USE_COUNT; #if ONSTREAM_DEBUG - printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n"); + printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in " + "idetape_init\n"); #endif return -EBUSY; } do { - if (!idetape_identify_device (drive, drive->id)) { - printk (KERN_ERR "ide-tape: %s: not supported by this version of ide-tape\n", drive->name); + if (!idetape_identify_device(drive, drive->id)) { + printk(KERN_ERR "ide-tape: %s: not supported by this " + "version of ide-tape\n", drive->name); continue; } if (drive->scsi) { if (strstr(drive->id->model, "OnStream DI-")) { - printk("ide-tape: ide-scsi emulation is not supported for %s.\n", drive->id->model); + printk("ide-tape: ide-scsi emulation is not " + "supported for %s.\n", + drive->id->model); } else { - printk("ide-tape: passing drive %s to ide-scsi emulation.\n", drive->name); + printk("ide-tape: passing drive %s to " + "ide-scsi emulation.\n", drive->name); continue; } } tape = (idetape_tape_t *) kmalloc (sizeof (idetape_tape_t), GFP_KERNEL); if (tape == NULL) { - printk (KERN_ERR "ide-tape: %s: Can't allocate a tape structure\n", drive->name); + printk(KERN_ERR "ide-tape: %s: Can't allocate a tape " + "structure\n", drive->name); continue; } - if (ide_register_subdriver (drive, &idetape_driver, IDE_SUBDRIVER_VERSION)) { - printk (KERN_ERR "ide-tape: %s: Failed to register the driver with ide.c\n", drive->name); - kfree (tape); + if (ide_register_subdriver(drive, + &idetape_driver, IDE_SUBDRIVER_VERSION)) { + printk(KERN_ERR "ide-tape: %s: Failed to register the " + "driver with ide.c\n", drive->name); + kfree(tape); continue; } for (minor = 0; idetape_chrdevs[minor].drive != NULL; minor++); - idetape_setup (drive, tape, minor); + idetape_setup(drive, tape, minor); idetape_chrdevs[minor].drive = drive; tape->de_r = - devfs_register (drive->de, "mt", DEVFS_FL_DEFAULT, + devfs_register(drive->de, "mt", DEVFS_FL_DEFAULT, HWIF(drive)->major, minor, S_IFCHR | S_IRUGO | S_IWUGO, &idetape_fops, NULL); tape->de_n = - devfs_register (drive->de, "mtn", DEVFS_FL_DEFAULT, + devfs_register(drive->de, "mtn", DEVFS_FL_DEFAULT, HWIF(drive)->major, minor + 128, S_IFCHR | S_IRUGO | S_IWUGO, &idetape_fops, NULL); - devfs_register_tape (tape->de_r); - supported++; failed--; - } while ((drive = ide_scan_devices (ide_tape, idetape_driver.name, NULL, failed++)) != NULL); + devfs_register_tape(tape->de_r); + supported++; + failed--; + } while ((drive = ide_scan_devices(ide_tape, + idetape_driver.name, NULL, failed++)) != NULL); if (!idetape_chrdev_present && !supported) { - devfs_unregister_chrdev (IDETAPE_MAJOR, "ht"); + devfs_unregister_chrdev(IDETAPE_MAJOR, "ht"); } else idetape_chrdev_present = 1; - ide_register_module (&idetape_module); +#else /* ! CLASSIC_BUILTINS_METHOD */ + int minor = 0; + + if (idetape_chrdev_present) + return 0; + idetape_chrdev_present = 1; + for (minor = 0; minor < MAX_HWIFS * MAX_DRIVES; minor++ ) + idetape_chrdevs[minor].drive = NULL; + devfs_register_chrdev(IDETAPE_MAJOR, "ht", &idetape_fops); + MOD_INC_USE_COUNT; +#endif /* CLASSIC_BUILTINS_METHOD */ + ide_register_module(&idetape_module); MOD_DEC_USE_COUNT; -#if ONSTREAM_DEBUG - printk(KERN_INFO "ide-tape: MOD_DEC_USE_COUNT in idetape_init\n"); -#endif return 0; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ide-taskfile.c linux.20pre5-ac2/drivers/ide/ide-taskfile.c --- linux.20pre5/drivers/ide/ide-taskfile.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ide-taskfile.c 2002-08-29 23:47:56.000000000 +0100 @@ -1,12 +1,29 @@ /* - * linux/drivers/ide/ide-taskfile.c Version 0.20 Oct 11, 2000 + * linux/drivers/ide/ide-taskfile.c Version 0.33 April 11, 2002 * - * Copyright (C) 2000 Michael Cornwell - * Copyright (C) 2000 Andre Hedrick + * Copyright (C) 2000-2002 Michael Cornwell + * Copyright (C) 2000-2002 Andre Hedrick + * Copyright (C) 2001-2002 Klaus Smolin + * IBM Storage Technology Division * - * May be copied or modified under the terms of the GNU General Public License + * The big the bad and the ugly. * - * IDE_DEBUG(__LINE__); + * Problems to be fixed because of BH interface or the lack therefore. + * + * Fill me in stupid !!! + * + * HOST: + * General refers to the Controller and Driver "pair". + * DATA HANDLER: + * Under the context of Linux it generally refers to an interrupt handler. + * However, it correctly describes the 'HOST' + * DATA BLOCK: + * The amount of data needed to be transfered as predefined in the + * setup of the device. + * STORAGE ATOMIC: + * The 'DATA BLOCK' associated to the 'DATA HANDLER', and can be as + * small as a single sector or as large as the entire command block + * request. */ #include @@ -34,27 +51,50 @@ #include #include -#ifdef CONFIG_IDE_TASKFILE_IO -# define __TASKFILE__IO -#else /* CONFIG_IDE_TASKFILE_IO */ -# undef __TASKFILE__IO -#endif /* CONFIG_IDE_TASKFILE_IO */ - #define DEBUG_TASKFILE 0 /* unset when fixed */ #if DEBUG_TASKFILE -#define DTF(x...) printk(##x) +#define DTF(x...) printk(x) #else #define DTF(x...) #endif +/* + * + */ +#define task_rq_offset(rq) \ + (((rq)->nr_sectors - (rq)->current_nr_sectors) * SECTOR_SIZE) + +/* + * for now, taskfile requests are special :/ + * + * However, upon the creation of the atapi version of packet_command + * data-phase ISR plus it own diagnostics and extensions for direct access + * (ioctl,read,write,rip,stream -- atapi), the kmap/kunmap for PIO will + * come localized. + */ +inline char *task_map_rq (struct request *rq, unsigned long *flags) +{ + if (rq->bh) + return ide_map_buffer(rq, flags); + return rq->buffer + task_rq_offset(rq); +} + +inline void task_unmap_rq (struct request *rq, char *buf, unsigned long *flags) +{ + if (rq->bh) + ide_unmap_buffer(buf, flags); +} + inline u32 task_read_24 (ide_drive_t *drive) { - return (IN_BYTE(IDE_HCYL_REG)<<16) | - (IN_BYTE(IDE_LCYL_REG)<<8) | - IN_BYTE(IDE_SECTOR_REG); + return (HWIF(drive)->INB(IDE_HCYL_REG)<<16) | + (HWIF(drive)->INB(IDE_LCYL_REG)<<8) | + HWIF(drive)->INB(IDE_SECTOR_REG); } +EXPORT_SYMBOL(task_read_24); + static void ata_bswap_data (void *buffer, int wcount) { u16 *p = buffer; @@ -65,381 +105,155 @@ } } -#if SUPPORT_VLB_SYNC -/* - * Some localbus EIDE interfaces require a special access sequence - * when using 32-bit I/O instructions to transfer data. We call this - * the "vlb_sync" sequence, which consists of three successive reads - * of the sector count register location, with interrupts disabled - * to ensure that the reads all happen together. - */ -static inline void task_vlb_sync (ide_ioreg_t port) { - (void) inb (port); - (void) inb (port); - (void) inb (port); -} -#endif /* SUPPORT_VLB_SYNC */ - -/* - * This is used for most PIO data transfers *from* the IDE interface - */ -void ata_input_data (ide_drive_t *drive, void *buffer, unsigned int wcount) -{ - byte io_32bit = drive->io_32bit; - - if (io_32bit) { -#if SUPPORT_VLB_SYNC - if (io_32bit & 2) { - unsigned long flags; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - task_vlb_sync(IDE_NSECTOR_REG); - insl(IDE_DATA_REG, buffer, wcount); - __restore_flags(flags); /* local CPU only */ - } else -#endif /* SUPPORT_VLB_SYNC */ - insl(IDE_DATA_REG, buffer, wcount); - } else { -#if SUPPORT_SLOW_DATA_PORTS - if (drive->slow) { - unsigned short *ptr = (unsigned short *) buffer; - while (wcount--) { - *ptr++ = inw_p(IDE_DATA_REG); - *ptr++ = inw_p(IDE_DATA_REG); - } - } else -#endif /* SUPPORT_SLOW_DATA_PORTS */ - insw(IDE_DATA_REG, buffer, wcount<<1); - } -} - -/* - * This is used for most PIO data transfers *to* the IDE interface - */ -void ata_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount) -{ - byte io_32bit = drive->io_32bit; - - if (io_32bit) { -#if SUPPORT_VLB_SYNC - if (io_32bit & 2) { - unsigned long flags; - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - task_vlb_sync(IDE_NSECTOR_REG); - outsl(IDE_DATA_REG, buffer, wcount); - __restore_flags(flags); /* local CPU only */ - } else -#endif /* SUPPORT_VLB_SYNC */ - outsl(IDE_DATA_REG, buffer, wcount); - } else { -#if SUPPORT_SLOW_DATA_PORTS - if (drive->slow) { - unsigned short *ptr = (unsigned short *) buffer; - while (wcount--) { - outw_p(*ptr++, IDE_DATA_REG); - outw_p(*ptr++, IDE_DATA_REG); - } - } else -#endif /* SUPPORT_SLOW_DATA_PORTS */ - outsw(IDE_DATA_REG, buffer, wcount<<1); - } -} - -static inline void taskfile_input_data (ide_drive_t *drive, void *buffer, unsigned int wcount) +void taskfile_input_data (ide_drive_t *drive, void *buffer, u32 wcount) { - ata_input_data(drive, buffer, wcount); + HWIF(drive)->ata_input_data(drive, buffer, wcount); if (drive->bswap) ata_bswap_data(buffer, wcount); } -static inline void taskfile_output_data (ide_drive_t *drive, void *buffer, unsigned int wcount) +EXPORT_SYMBOL(taskfile_input_data); + +void taskfile_output_data (ide_drive_t *drive, void *buffer, u32 wcount) { if (drive->bswap) { ata_bswap_data(buffer, wcount); - ata_output_data(drive, buffer, wcount); + HWIF(drive)->ata_output_data(drive, buffer, wcount); ata_bswap_data(buffer, wcount); } else { - ata_output_data(drive, buffer, wcount); + HWIF(drive)->ata_output_data(drive, buffer, wcount); } } -ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) -{ - task_struct_t *taskfile = (task_struct_t *) task->tfRegister; - hob_struct_t *hobfile = (hob_struct_t *) task->hobRegister; - struct hd_driveid *id = drive->id; - byte HIHI = (drive->addressing) ? 0xE0 : 0xEF; - - /* (ks/hs): Moved to start, do not use for multiple out commands */ - if (task->handler != task_mulout_intr) { - if (IDE_CONTROL_REG) - OUT_BYTE(drive->ctl, IDE_CONTROL_REG); /* clear nIEN */ - SELECT_MASK(HWIF(drive), drive, 0); - } - - if ((id->command_set_2 & 0x0400) && - (id->cfs_enable_2 & 0x0400) && - (drive->addressing == 1)) { - OUT_BYTE(hobfile->feature, IDE_FEATURE_REG); - OUT_BYTE(hobfile->sector_count, IDE_NSECTOR_REG); - OUT_BYTE(hobfile->sector_number, IDE_SECTOR_REG); - OUT_BYTE(hobfile->low_cylinder, IDE_LCYL_REG); - OUT_BYTE(hobfile->high_cylinder, IDE_HCYL_REG); - } - - OUT_BYTE(taskfile->feature, IDE_FEATURE_REG); - OUT_BYTE(taskfile->sector_count, IDE_NSECTOR_REG); - /* refers to number of sectors to transfer */ - OUT_BYTE(taskfile->sector_number, IDE_SECTOR_REG); - /* refers to sector offset or start sector */ - OUT_BYTE(taskfile->low_cylinder, IDE_LCYL_REG); - OUT_BYTE(taskfile->high_cylinder, IDE_HCYL_REG); - - OUT_BYTE((taskfile->device_head & HIHI) | drive->select.all, IDE_SELECT_REG); - if (task->handler != NULL) { -#if 0 - ide_set_handler (drive, task->handler, WAIT_CMD, NULL); - OUT_BYTE(taskfile->command, IDE_COMMAND_REG); - /* - * warning check for race between handler and prehandler for - * writing first block of data. however since we are well - * inside the boundaries of the seek, we should be okay. - */ - if (task->prehandler != NULL) { - return task->prehandler(drive, task->rq); - } -#else - ide_startstop_t startstop; - - ide_set_handler (drive, task->handler, WAIT_CMD, NULL); - OUT_BYTE(taskfile->command, IDE_COMMAND_REG); - - if (ide_wait_stat(&startstop, drive, DATA_READY, drive->bad_wstat, WAIT_DRQ)) { - printk(KERN_ERR "%s: no DRQ after issuing %s\n", - drive->name, - drive->mult_count ? "MULTWRITE" : "WRITE"); - return startstop; - } - /* (ks/hs): Fixed Multi Write */ - if ((taskfile->command != WIN_MULTWRITE) && - (taskfile->command != WIN_MULTWRITE_EXT)) { - struct request *rq = HWGROUP(drive)->rq; - /* For Write_sectors we need to stuff the first sector */ - taskfile_output_data(drive, rq->buffer, SECTOR_WORDS); - rq->current_nr_sectors--; - } else { - /* Stuff first sector(s) by implicitly calling the handler */ - if (!(drive_is_ready(drive))) { - /* FIXME: Replace hard-coded 100, error handling? */ - int i; - for (i=0; i<100; i++) { - if (drive_is_ready(drive)) - break; - } - } - return task->handler(drive); - } -#endif - } else { - /* for dma commands we down set the handler */ - if (drive->using_dma && !(HWIF(drive)->dmaproc(((taskfile->command == WIN_WRITEDMA) || (taskfile->command == WIN_WRITEDMA_EXT)) ? ide_dma_write : ide_dma_read, drive))); - } - - return ide_started; -} +EXPORT_SYMBOL(taskfile_output_data); -void do_taskfile (ide_drive_t *drive, struct hd_drive_task_hdr *taskfile, struct hd_drive_hob_hdr *hobfile, ide_handler_t *handler) +int taskfile_lib_get_identify (ide_drive_t *drive, u8 *buf) { - struct hd_driveid *id = drive->id; - byte HIHI = (drive->addressing) ? 0xE0 : 0xEF; - - /* (ks/hs): Moved to start, do not use for multiple out commands */ - if (*handler != task_mulout_intr) { - if (IDE_CONTROL_REG) - OUT_BYTE(drive->ctl, IDE_CONTROL_REG); /* clear nIEN */ - SELECT_MASK(HWIF(drive), drive, 0); - } - - if ((id->command_set_2 & 0x0400) && - (id->cfs_enable_2 & 0x0400) && - (drive->addressing == 1)) { - OUT_BYTE(hobfile->feature, IDE_FEATURE_REG); - OUT_BYTE(hobfile->sector_count, IDE_NSECTOR_REG); - OUT_BYTE(hobfile->sector_number, IDE_SECTOR_REG); - OUT_BYTE(hobfile->low_cylinder, IDE_LCYL_REG); - OUT_BYTE(hobfile->high_cylinder, IDE_HCYL_REG); - } + ide_task_t args; + memset(&args, 0, sizeof(ide_task_t)); + args.tfRegister[IDE_NSECTOR_OFFSET] = 0x01; + if (drive->media == ide_disk) + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_IDENTIFY; + else + args.tfRegister[IDE_COMMAND_OFFSET] = WIN_PIDENTIFY; + args.command_type = ide_cmd_type_parser(&args); + return ide_raw_taskfile(drive, &args, buf); +} - OUT_BYTE(taskfile->feature, IDE_FEATURE_REG); - OUT_BYTE(taskfile->sector_count, IDE_NSECTOR_REG); - /* refers to number of sectors to transfer */ - OUT_BYTE(taskfile->sector_number, IDE_SECTOR_REG); - /* refers to sector offset or start sector */ - OUT_BYTE(taskfile->low_cylinder, IDE_LCYL_REG); - OUT_BYTE(taskfile->high_cylinder, IDE_HCYL_REG); +EXPORT_SYMBOL(taskfile_lib_get_identify); - OUT_BYTE((taskfile->device_head & HIHI) | drive->select.all, IDE_SELECT_REG); - if (handler != NULL) { - ide_set_handler (drive, handler, WAIT_CMD, NULL); - OUT_BYTE(taskfile->command, IDE_COMMAND_REG); - } else { - /* for dma commands we down set the handler */ - if (drive->using_dma && !(HWIF(drive)->dmaproc(((taskfile->command == WIN_WRITEDMA) || (taskfile->command == WIN_WRITEDMA_EXT)) ? ide_dma_write : ide_dma_read, drive))); - } +#ifdef CONFIG_IDE_TASK_IOCTL_DEBUG +void debug_taskfile (ide_drive_t *drive, ide_task_t *args) +{ + printk(KERN_INFO "%s: ", drive->name); +// printk("TF.0=x%02x ", args->tfRegister[IDE_DATA_OFFSET]); + printk("TF.1=x%02x ", args->tfRegister[IDE_FEATURE_OFFSET]); + printk("TF.2=x%02x ", args->tfRegister[IDE_NSECTOR_OFFSET]); + printk("TF.3=x%02x ", args->tfRegister[IDE_SECTOR_OFFSET]); + printk("TF.4=x%02x ", args->tfRegister[IDE_LCYL_OFFSET]); + printk("TF.5=x%02x ", args->tfRegister[IDE_HCYL_OFFSET]); + printk("TF.6=x%02x ", args->tfRegister[IDE_SELECT_OFFSET]); + printk("TF.7=x%02x\n", args->tfRegister[IDE_COMMAND_OFFSET]); + printk(KERN_INFO "%s: ", drive->name); +// printk("HTF.0=x%02x ", args->hobRegister[IDE_DATA_OFFSET_HOB]); + printk("HTF.1=x%02x ", args->hobRegister[IDE_FEATURE_OFFSET_HOB]); + printk("HTF.2=x%02x ", args->hobRegister[IDE_NSECTOR_OFFSET_HOB]); + printk("HTF.3=x%02x ", args->hobRegister[IDE_SECTOR_OFFSET_HOB]); + printk("HTF.4=x%02x ", args->hobRegister[IDE_LCYL_OFFSET_HOB]); + printk("HTF.5=x%02x ", args->hobRegister[IDE_HCYL_OFFSET_HOB]); + printk("HTF.6=x%02x ", args->hobRegister[IDE_SELECT_OFFSET_HOB]); + printk("HTF.7=x%02x\n", args->hobRegister[IDE_CONTROL_OFFSET_HOB]); } +#endif /* CONFIG_IDE_TASK_IOCTL_DEBUG */ -#if 0 -ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task) +ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task) { - task_struct_t *taskfile = (task_struct_t *) task->tfRegister; - hob_struct_t *hobfile = (hob_struct_t *) task->hobRegister; - struct hd_driveid *id = drive->id; - - /* - * (KS) Check taskfile in/out flags. - * If set, then execute as it is defined. - * If not set, then define default settings. - * The default values are: - * write and read all taskfile registers (except data) - * write and read the hob registers (sector,nsector,lcyl,hcyl) - */ - if (task->tf_out_flags.all == 0) { - task->tf_out_flags.all = IDE_TASKFILE_STD_OUT_FLAGS; - if ((id->command_set_2 & 0x0400) && - (id->cfs_enable_2 & 0x0400) && - (drive->addressing == 1)) { - task->tf_out_flags.all != (IDE_HOB_STD_OUT_FLAGS << 8); - } - } - - if (task->tf_in_flags.all == 0) { - task->tf_in_flags.all = IDE_TASKFILE_STD_IN_FLAGS; - if ((id->command_set_2 & 0x0400) && - (id->cfs_enable_2 & 0x0400) && - (drive->addressing == 1)) { - task->tf_in_flags.all != (IDE_HOB_STD_IN_FLAGS << 8); - } - } - - if (IDE_CONTROL_REG) - OUT_BYTE(drive->ctl, IDE_CONTROL_REG); /* clear nIEN */ - SELECT_MASK(HWIF(drive), drive, 0); - - if (task->tf_out_flags.b.data) { - unsigned short data = taskfile->data + (hobfile->data << 8); - OUT_WORD (data, IDE_DATA_REG); - } - - /* (KS) send hob registers first */ - if (task->tf_out_flags.b.nsector_hob) - OUT_BYTE(hobfile->sector_count, IDE_NSECTOR_REG); - if (task->tf_out_flags.b.sector_hob) - OUT_BYTE(hobfile->sector_number, IDE_SECTOR_REG); - if (task->tf_out_flags.b.lcyl_hob) - OUT_BYTE(hobfile->low_cylinder, IDE_LCYL_REG); - if (task->tf_out_flags.b.hcyl_hob) - OUT_BYTE(hobfile->high_cylinder, IDE_HCYL_REG); + ide_hwif_t *hwif = HWIF(drive); + task_struct_t *taskfile = (task_struct_t *) task->tfRegister; + hob_struct_t *hobfile = (hob_struct_t *) task->hobRegister; + u8 HIHI = (drive->addressing == 1) ? 0xE0 : 0xEF; +#ifdef CONFIG_IDE_TASK_IOCTL_DEBUG + void debug_taskfile(drive, task); +#endif /* CONFIG_IDE_TASK_IOCTL_DEBUG */ - /* (KS) Send now the standard registers */ - if (task->tf_out_flags.b.error_feature) - OUT_BYTE(taskfile->feature, IDE_FEATURE_REG); - /* refers to number of sectors to transfer */ - if (task->tf_out_flags.b.nsector) - OUT_BYTE(taskfile->sector_count, IDE_NSECTOR_REG); - /* refers to sector offset or start sector */ - if (task->tf_out_flags.b.sector) - OUT_BYTE(taskfile->sector_number, IDE_SECTOR_REG); - if (task->tf_out_flags.b.lcyl) - OUT_BYTE(taskfile->low_cylinder, IDE_LCYL_REG); - if (task->tf_out_flags.b.hcyl) - OUT_BYTE(taskfile->high_cylinder, IDE_HCYL_REG); + /* ALL Command Block Executions SHALL clear nIEN, unless otherwise */ + if (IDE_CONTROL_REG) { + /* clear nIEN */ + hwif->OUTB(drive->ctl, IDE_CONTROL_REG); + } + SELECT_MASK(drive, 0); + + if (drive->addressing == 1) { + hwif->OUTB(hobfile->feature, IDE_FEATURE_REG); + hwif->OUTB(hobfile->sector_count, IDE_NSECTOR_REG); + hwif->OUTB(hobfile->sector_number, IDE_SECTOR_REG); + hwif->OUTB(hobfile->low_cylinder, IDE_LCYL_REG); + hwif->OUTB(hobfile->high_cylinder, IDE_HCYL_REG); + } + + hwif->OUTB(taskfile->feature, IDE_FEATURE_REG); + hwif->OUTB(taskfile->sector_count, IDE_NSECTOR_REG); + hwif->OUTB(taskfile->sector_number, IDE_SECTOR_REG); + hwif->OUTB(taskfile->low_cylinder, IDE_LCYL_REG); + hwif->OUTB(taskfile->high_cylinder, IDE_HCYL_REG); - /* - * (KS) Do not modify the specified taskfile. We want to have a - * universal pass through, so we must execute ALL specified values. - * - * (KS) The drive head register is mandatory. - * Don't care about the out flags ! - */ - OUT_BYTE(taskfile->device_head | drive->select.all, IDE_SELECT_REG); + hwif->OUTB((taskfile->device_head & HIHI) | drive->select.all, IDE_SELECT_REG); if (task->handler != NULL) { -#if 0 - ide_set_handler (drive, task->handler, WAIT_CMD, NULL); - OUT_BYTE(taskfile->command, IDE_COMMAND_REG); - /* - * warning check for race between handler and prehandler for - * writing first block of data. however since we are well - * inside the boundaries of the seek, we should be okay. - */ - if (task->prehandler != NULL) { + ide_set_handler(drive, task->handler, WAIT_CMD, NULL); + hwif->OUTB(taskfile->command, IDE_COMMAND_REG); + if (task->prehandler != NULL) return task->prehandler(drive, task->rq); - } -#else - ide_startstop_t startstop; - - ide_set_handler (drive, task->handler, WAIT_CMD, NULL); - - /* - * (KS) The drive command register is also mandatory. - * Don't care about the out flags ! - */ - OUT_BYTE(taskfile->command, IDE_COMMAND_REG); + return ide_started; + } + /* for dma commands we down set the handler */ + if (task->rq->cmd == READ) { + if (drive->using_dma && !(hwif->ide_dma_read(drive))); + } else if (task->rq->cmd == WRITE) { + if (drive->using_dma && !(hwif->ide_dma_write(drive))); + } else { + if (!(drive->using_dma) && (task->handler == NULL)) + return ide_stopped; - if (ide_wait_stat(&startstop, drive, DATA_READY, drive->bad_wstat, WAIT_DRQ)) { - printk(KERN_ERR "%s: no DRQ after issuing %s\n", - drive->name, - drive->mult_count ? "MULTWRITE" : "WRITE"); - return startstop; - } - /* (ks/hs): Fixed Multi Write */ - if ((taskfile->command != WIN_MULTWRITE) && - (taskfile->command != WIN_MULTWRITE_EXT)) { - struct request *rq = HWGROUP(drive)->rq; - /* For Write_sectors we need to stuff the first sector */ - taskfile_output_data(drive, rq->buffer, SECTOR_WORDS); - rq->current_nr_sectors--; - } else { - /* Stuff first sector(s) by implicitly calling the handler */ - if (!(drive_is_ready(drive))) { - /* FIXME: Replace hard-coded 100, error handling? */ - int i; - for (i=0; i<100; i++) { - if (drive_is_ready(drive)) - break; - } - } - return task->handler(drive); + switch(taskfile->command) { + case WIN_WRITEDMA_ONCE: + case WIN_WRITEDMA: + case WIN_WRITEDMA_EXT: + hwif->ide_dma_write(drive); + break; + case WIN_READDMA_ONCE: + case WIN_READDMA: + case WIN_READDMA_EXT: + case WIN_IDENTIFY_DMA: + hwif->ide_dma_read(drive); + break; + default: + if (task->handler == NULL) + return ide_stopped; } -#endif - } else { - /* for dma commands we down set the handler */ - if (drive->using_dma && !(HWIF(drive)->dmaproc(((taskfile->command == WIN_WRITEDMA) || (taskfile->command == WIN_WRITEDMA_EXT)) ? ide_dma_write : ide_dma_read, drive))); } - return ide_started; } -#endif -#if 0 +EXPORT_SYMBOL(do_rw_taskfile); + /* * Error reporting, in human readable form (luxurious, but a memory hog). */ -byte taskfile_dump_status (ide_drive_t *drive, const char *msg, byte stat) +u8 taskfile_dump_status (ide_drive_t *drive, const char *msg, u8 stat) { + ide_hwif_t *hwif = HWIF(drive); unsigned long flags; - byte err = 0; + u8 err = 0; - __save_flags (flags); /* local CPU only */ - ide__sti(); /* local CPU only */ + local_irq_set(flags); printk("%s: %s: status=0x%02x", drive->name, msg, stat); #if FANCY_STATUS_DUMPS printk(" { "); - if (stat & BUSY_STAT) + if (stat & BUSY_STAT) { printk("Busy "); - else { + } else { if (stat & READY_STAT) printk("DriveReady "); if (stat & WRERR_STAT) printk("DeviceFault "); if (stat & SEEK_STAT) printk("SeekComplete "); @@ -452,61 +266,66 @@ #endif /* FANCY_STATUS_DUMPS */ printk("\n"); if ((stat & (BUSY_STAT|ERR_STAT)) == ERR_STAT) { - err = GET_ERR(); + err = hwif->INB(IDE_ERROR_REG); printk("%s: %s: error=0x%02x", drive->name, msg, err); #if FANCY_STATUS_DUMPS - if (drive->media == ide_disk) { - printk(" { "); - if (err & ABRT_ERR) printk("DriveStatusError "); - if (err & ICRC_ERR) printk("%s", (err & ABRT_ERR) ? "BadCRC " : "BadSector "); - if (err & ECC_ERR) printk("UncorrectableError "); - if (err & ID_ERR) printk("SectorIdNotFound "); - if (err & TRK0_ERR) printk("TrackZeroNotFound "); - if (err & MARK_ERR) printk("AddrMarkNotFound "); - printk("}"); - if ((err & (BBD_ERR | ABRT_ERR)) == BBD_ERR || (err & (ECC_ERR|ID_ERR|MARK_ERR))) { - if ((drive->id->command_set_2 & 0x0400) && - (drive->id->cfs_enable_2 & 0x0400) && - (drive->addressing == 1)) { - __u64 sectors = 0; - u32 low = 0, high = 0; - low = task_read_24(drive); - OUT_BYTE(0x80, IDE_CONTROL_REG); - high = task_read_24(drive); - sectors = ((__u64)high << 24) | low; - printk(", LBAsect=%lld", sectors); + if (drive->media == ide_disk) + goto media_out; + + printk(" { "); + if (err & ABRT_ERR) printk("DriveStatusError "); + if (err & ICRC_ERR) printk("Bad%s", (err & ABRT_ERR) ? "CRC " : "Sector "); + if (err & ECC_ERR) printk("UncorrectableError "); + if (err & ID_ERR) printk("SectorIdNotFound "); + if (err & TRK0_ERR) printk("TrackZeroNotFound "); + if (err & MARK_ERR) printk("AddrMarkNotFound "); + printk("}"); + if ((err & (BBD_ERR | ABRT_ERR)) == BBD_ERR || + (err & (ECC_ERR|ID_ERR|MARK_ERR))) { + if (drive->addressing == 1) { + u64 sectors = 0; + u32 high = 0; + u32 low = task_read_24(drive); + hwif->OUTB(0x80, IDE_CONTROL_REG); + high = task_read_24(drive); + sectors = ((u64)high << 24) | low; + printk(", LBAsect=%lld", sectors); + } else { + u8 cur = hwif->INB(IDE_SELECT_REG); + u8 low = hwif->INB(IDE_LCYL_REG); + u8 high = hwif->INB(IDE_HCYL_REG); + u8 sect = hwif->INB(IDE_SECTOR_REG); + /* using LBA? */ + if (cur & 0x40) { + printk(", LBAsect=%d", (u32) + ((cur&0xf)<<24)|(high<<16)| + (low<<8)|sect); } else { - byte cur = IN_BYTE(IDE_SELECT_REG); - if (cur & 0x40) { /* using LBA? */ - printk(", LBAsect=%ld", (unsigned long) - ((cur&0xf)<<24) - |(IN_BYTE(IDE_HCYL_REG)<<16) - |(IN_BYTE(IDE_LCYL_REG)<<8) - | IN_BYTE(IDE_SECTOR_REG)); - } else { - printk(", CHS=%d/%d/%d", - (IN_BYTE(IDE_HCYL_REG)<<8) + - IN_BYTE(IDE_LCYL_REG), - cur & 0xf, - IN_BYTE(IDE_SECTOR_REG)); - } + printk(", CHS=%d/%d/%d", + ((high<<8) + low), + (cur & 0xf), sect); } - if (HWGROUP(drive)->rq) - printk(", sector=%llu", (__u64) HWGROUP(drive)->rq->sector); } + if (HWGROUP(drive)->rq) + printk(", sector=%lu", + HWGROUP(drive)->rq->sector); } +media_out: #endif /* FANCY_STATUS_DUMPS */ printk("\n"); } - __restore_flags (flags); /* local CPU only */ + local_irq_restore(flags); return err; } +EXPORT_SYMBOL(taskfile_dump_status); + /* * Clean up after success/failure of an explicit taskfile operation. */ -void ide_end_taskfile (ide_drive_t *drive, byte stat, byte err) +void ide_end_taskfile (ide_drive_t *drive, u8 stat, u8 err) { + ide_hwif_t *hwif = HWIF(drive); unsigned long flags; struct request *rq; ide_task_t *args; @@ -519,28 +338,39 @@ command = args->tfRegister[IDE_COMMAND_OFFSET]; - rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); + if (rq->errors == 0) + rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT); + if (args->tf_in_flags.b.data) { + u16 data = hwif->INW(IDE_DATA_REG); + args->tfRegister[IDE_DATA_OFFSET] = (data) & 0xFF; + args->hobRegister[IDE_DATA_OFFSET_HOB] = (data >> 8) & 0xFF; + } args->tfRegister[IDE_ERROR_OFFSET] = err; - args->tfRegister[IDE_NSECTOR_OFFSET] = IN_BYTE(IDE_NSECTOR_REG); - args->tfRegister[IDE_SECTOR_OFFSET] = IN_BYTE(IDE_SECTOR_REG); - args->tfRegister[IDE_LCYL_OFFSET] = IN_BYTE(IDE_LCYL_REG); - args->tfRegister[IDE_HCYL_OFFSET] = IN_BYTE(IDE_HCYL_REG); - args->tfRegister[IDE_SELECT_OFFSET] = IN_BYTE(IDE_SELECT_REG); + args->tfRegister[IDE_NSECTOR_OFFSET] = hwif->INB(IDE_NSECTOR_REG); + args->tfRegister[IDE_SECTOR_OFFSET] = hwif->INB(IDE_SECTOR_REG); + args->tfRegister[IDE_LCYL_OFFSET] = hwif->INB(IDE_LCYL_REG); + args->tfRegister[IDE_HCYL_OFFSET] = hwif->INB(IDE_HCYL_REG); + args->tfRegister[IDE_SELECT_OFFSET] = hwif->INB(IDE_SELECT_REG); args->tfRegister[IDE_STATUS_OFFSET] = stat; if ((drive->id->command_set_2 & 0x0400) && (drive->id->cfs_enable_2 & 0x0400) && (drive->addressing == 1)) { - OUT_BYTE(drive->ctl|0x80, IDE_CONTROL_REG_HOB); - args->hobRegister[IDE_FEATURE_OFFSET_HOB] = IN_BYTE(IDE_FEATURE_REG); - args->hobRegister[IDE_NSECTOR_OFFSET_HOB] = IN_BYTE(IDE_NSECTOR_REG); - args->hobRegister[IDE_SECTOR_OFFSET_HOB] = IN_BYTE(IDE_SECTOR_REG); - args->hobRegister[IDE_LCYL_OFFSET_HOB] = IN_BYTE(IDE_LCYL_REG); - args->hobRegister[IDE_HCYL_OFFSET_HOB] = IN_BYTE(IDE_HCYL_REG); + hwif->OUTB(drive->ctl|0x80, IDE_CONTROL_REG_HOB); + args->hobRegister[IDE_FEATURE_OFFSET_HOB] = hwif->INB(IDE_FEATURE_REG); + args->hobRegister[IDE_NSECTOR_OFFSET_HOB] = hwif->INB(IDE_NSECTOR_REG); + args->hobRegister[IDE_SECTOR_OFFSET_HOB] = hwif->INB(IDE_SECTOR_REG); + args->hobRegister[IDE_LCYL_OFFSET_HOB] = hwif->INB(IDE_LCYL_REG); + args->hobRegister[IDE_HCYL_OFFSET_HOB] = hwif->INB(IDE_HCYL_REG); } +#if 0 /* taskfile_settings_update(drive, args, command); */ + if (args->posthandler != NULL) + args->posthandler(drive, args); +#endif + spin_lock_irqsave(&io_request_lock, flags); blkdev_dequeue_request(rq); HWGROUP(drive)->rq = NULL; @@ -548,6 +378,8 @@ spin_unlock_irqrestore(&io_request_lock, flags); } +EXPORT_SYMBOL(ide_end_taskfile); + /* * try_to_flush_leftover_data() is invoked in response to a drive * unexpectedly having its DRQ_STAT bit set. As an alternative to @@ -565,53 +397,68 @@ u32 buffer[16]; unsigned int wcount = (i > 16) ? 16 : i; i -= wcount; - taskfile_input_data (drive, buffer, wcount); + taskfile_input_data(drive, buffer, wcount); } } +EXPORT_SYMBOL(task_try_to_flush_leftover_data); + /* * taskfile_error() takes action based on the error returned by the drive. */ -ide_startstop_t taskfile_error (ide_drive_t *drive, const char *msg, byte stat) +ide_startstop_t taskfile_error (ide_drive_t *drive, const char *msg, u8 stat) { + ide_hwif_t *hwif; struct request *rq; - byte err; + u8 err; err = taskfile_dump_status(drive, msg, stat); if (drive == NULL || (rq = HWGROUP(drive)->rq) == NULL) return ide_stopped; + + hwif = HWIF(drive); /* retry only "normal" I/O: */ if (rq->cmd == IDE_DRIVE_TASKFILE) { rq->errors = 1; ide_end_taskfile(drive, stat, err); return ide_stopped; } - if (stat & BUSY_STAT || ((stat & WRERR_STAT) && !drive->nowerr)) { /* other bits are useless when BUSY */ + if (stat & BUSY_STAT || ((stat & WRERR_STAT) && !drive->nowerr)) { + /* other bits are useless when BUSY */ rq->errors |= ERROR_RESET; } else { - if (drive->media == ide_disk && (stat & ERR_STAT)) { + if (drive->media != ide_disk) + goto media_out; + if (stat & ERR_STAT) { /* err has different meaning on cdrom and tape */ if (err == ABRT_ERR) { - if (drive->select.b.lba && IN_BYTE(IDE_COMMAND_REG) == WIN_SPECIFY) - return ide_stopped; /* some newer drives don't support WIN_SPECIFY */ - } else if ((err & (ABRT_ERR | ICRC_ERR)) == (ABRT_ERR | ICRC_ERR)) { - drive->crc_count++; /* UDMA crc error -- just retry the operation */ - } else if (err & (BBD_ERR | ECC_ERR)) /* retries won't help these */ + if (drive->select.b.lba && + (hwif->INB(IDE_COMMAND_REG) == WIN_SPECIFY)) + /* some newer drives don't + * support WIN_SPECIFY + */ + return ide_stopped; + } else if ((err & BAD_CRC) == BAD_CRC) { + /* UDMA crc error -- just retry the operation */ + drive->crc_count++; + } else if (err & (BBD_ERR | ECC_ERR)) { + /* retries won't help these */ rq->errors = ERROR_MAX; - else if (err & TRK0_ERR) /* help it find track zero */ - rq->errors |= ERROR_RECAL; + } else if (err & TRK0_ERR) { + /* help it find track zero */ + rq->errors |= ERROR_RECAL; + } } +media_out: if ((stat & DRQ_STAT) && rq->cmd != WRITE) task_try_to_flush_leftover_data(drive); } - if (GET_STAT() & (BUSY_STAT|DRQ_STAT)) - OUT_BYTE(WIN_IDLEIMMEDIATE,IDE_COMMAND_REG); /* force an abort */ - + if (hwif->INB(IDE_STATUS_REG) & (BUSY_STAT|DRQ_STAT)) { + /* force an abort */ + hwif->OUTB(WIN_IDLEIMMEDIATE, IDE_COMMAND_REG); + } if (rq->errors >= ERROR_MAX) { - if (drive->driver != NULL) - DRIVER(drive)->end_request(0, HWGROUP(drive)); - else - ide_end_request(0, HWGROUP(drive)); + DRIVER(drive)->end_request(drive, 0); } else { if ((rq->errors & ERROR_RESET) == ERROR_RESET) { ++rq->errors; @@ -623,20 +470,18 @@ } return ide_stopped; } -#endif -/* - * Handler for special commands without a data phase from ide-disk - */ +EXPORT_SYMBOL(taskfile_error); /* * set_multmode_intr() is invoked on completion of a WIN_SETMULT cmd. */ ide_startstop_t set_multmode_intr (ide_drive_t *drive) { - byte stat; + ide_hwif_t *hwif = HWIF(drive); + u8 stat; - if (OK_STAT(stat=GET_STAT(),READY_STAT,BAD_STAT)) { + if (OK_STAT(stat = hwif->INB(IDE_STATUS_REG),READY_STAT,BAD_STAT)) { drive->mult_count = drive->mult_req; } else { drive->mult_req = drive->mult_count = 0; @@ -646,282 +491,373 @@ return ide_stopped; } +EXPORT_SYMBOL(set_multmode_intr); + /* * set_geometry_intr() is invoked on completion of a WIN_SPECIFY cmd. */ ide_startstop_t set_geometry_intr (ide_drive_t *drive) { - byte stat; + ide_hwif_t *hwif = HWIF(drive); + int retries = 5; + u8 stat; - if (OK_STAT(stat=GET_STAT(),READY_STAT,BAD_STAT)) + while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && retries--) + udelay(10); + + if (OK_STAT(stat, READY_STAT, BAD_STAT)) return ide_stopped; if (stat & (ERR_STAT|DRQ_STAT)) - return ide_error(drive, "set_geometry_intr", stat); + return DRIVER(drive)->error(drive, "set_geometry_intr", stat); + if (HWGROUP(drive)->handler != NULL) + BUG(); ide_set_handler(drive, &set_geometry_intr, WAIT_CMD, NULL); return ide_started; } +EXPORT_SYMBOL(set_geometry_intr); + /* * recal_intr() is invoked on completion of a WIN_RESTORE (recalibrate) cmd. */ ide_startstop_t recal_intr (ide_drive_t *drive) { - byte stat = GET_STAT(); + ide_hwif_t *hwif = HWIF(drive); + u8 stat; - if (!OK_STAT(stat,READY_STAT,BAD_STAT)) - return ide_error(drive, "recal_intr", stat); + if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG), READY_STAT, BAD_STAT)) + return DRIVER(drive)->error(drive, "recal_intr", stat); return ide_stopped; } +EXPORT_SYMBOL(recal_intr); + /* * Handler for commands without a data phase */ ide_startstop_t task_no_data_intr (ide_drive_t *drive) { ide_task_t *args = HWGROUP(drive)->rq->special; - byte stat = GET_STAT(); - - ide__sti(); /* local CPU only */ - - if (!OK_STAT(stat, READY_STAT, BAD_STAT)) - return ide_error(drive, "task_no_data_intr", stat); /* calls ide_end_drive_cmd */ + ide_hwif_t *hwif = HWIF(drive); + u8 stat; + local_irq_enable(); + if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),READY_STAT,BAD_STAT)) { + DTF("%s: command opcode 0x%02x\n", drive->name, + args->tfRegister[IDE_COMMAND_OFFSET]); + return DRIVER(drive)->error(drive, "task_no_data_intr", stat); + /* calls ide_end_drive_cmd */ + } if (args) - ide_end_drive_cmd (drive, stat, GET_ERR()); + ide_end_drive_cmd(drive, stat, hwif->INB(IDE_ERROR_REG)); return ide_stopped; } +EXPORT_SYMBOL(task_no_data_intr); + /* - * Handler for command with PIO data-in phase + * Handler for command with PIO data-in phase, READ + */ +/* + * FIXME before 2.4 enable ... + * DATA integrity issue upon error. */ ide_startstop_t task_in_intr (ide_drive_t *drive) { - byte stat = GET_STAT(); - byte io_32bit = drive->io_32bit; struct request *rq = HWGROUP(drive)->rq; + ide_hwif_t *hwif = HWIF(drive); char *pBuf = NULL; + u8 stat; + unsigned long flags; - if (!OK_STAT(stat,DATA_READY,BAD_R_STAT)) { + if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),DATA_READY,BAD_R_STAT)) { if (stat & (ERR_STAT|DRQ_STAT)) { - return ide_error(drive, "task_in_intr", stat); +#if 0 + DTF("%s: attempting to recover last " \ + "sector counter status=0x%02x\n", + drive->name, stat); + /* + * Expect a BUG BOMB if we attempt to rewind the + * offset in the BH aka PAGE in the current BLOCK + * segment. This is different than the HOST segment. + */ +#endif + if (!rq->bh) + rq->current_nr_sectors++; + return DRIVER(drive)->error(drive, "task_in_intr", stat); } if (!(stat & BUSY_STAT)) { DTF("task_in_intr to Soon wait for next interrupt\n"); - ide_set_handler(drive, &task_in_intr, WAIT_CMD, NULL); + if (HWGROUP(drive)->handler == NULL) + ide_set_handler(drive, &task_in_intr, WAIT_CMD, NULL); return ide_started; } } - DTF("stat: %02x\n", stat); - pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE); - DTF("Read: %p, rq->current_nr_sectors: %d\n", pBuf, (int) rq->current_nr_sectors); - - drive->io_32bit = 0; - taskfile_input_data(drive, pBuf, SECTOR_WORDS); - drive->io_32bit = io_32bit; - - if (--rq->current_nr_sectors <= 0) { - /* (hs): swapped next 2 lines */ - DTF("Request Ended stat: %02x\n", GET_STAT()); - ide_end_request(1, HWGROUP(drive)); - } else { - ide_set_handler(drive, &task_in_intr, WAIT_CMD, NULL); - return ide_started; - } - return ide_stopped; -} +#if 0 -#undef ALTSTAT_SCREW_UP + /* + * Holding point for a brain dump of a thought :-/ + */ -#ifdef ALTSTAT_SCREW_UP -/* - * (ks/hs): Poll Alternate Status Register to ensure - * that drive is not busy. - */ -byte altstat_multi_busy (ide_drive_t *drive, byte stat, const char *msg) -{ - int i; + if (!OK_STAT(stat,DRIVE_READY,drive->bad_wstat)) { + DTF("%s: READ attempting to recover last " \ + "sector counter status=0x%02x\n", + drive->name, stat); + rq->current_nr_sectors++; + return DRIVER(drive)->error(drive, "task_in_intr", stat); + } + if (!rq->current_nr_sectors) + if (!DRIVER(drive)->end_request(drive, 1)) + return ide_stopped; + + if (--rq->current_nr_sectors <= 0) + if (!DRIVER(drive)->end_request(drive, 1)) + return ide_stopped; +#endif - DTF("multi%s: ASR = %x\n", msg, stat); - if (stat & BUSY_STAT) { - /* (ks/hs): FIXME: Replace hard-coded 100, error handling? */ - for (i=0; i<100; i++) { - stat = GET_ALTSTAT(); - if ((stat & BUSY_STAT) == 0) - break; - } - } + pBuf = task_map_rq(rq, &flags); + DTF("Read: %p, rq->current_nr_sectors: %d, stat: %02x\n", + pBuf, (int) rq->current_nr_sectors, stat); + taskfile_input_data(drive, pBuf, SECTOR_WORDS); + task_unmap_rq(rq, pBuf, &flags); + /* + * FIXME :: We really can not legally get a new page/bh + * regardless, if this is the end of our segment. + * BH walking or segment can only be updated after we have a good + * hwif->INB(IDE_STATUS_REG); return. + */ + if (--rq->current_nr_sectors <= 0) + if (!DRIVER(drive)->end_request(drive, 1)) + return ide_stopped; /* - * (ks/hs): Read Status AFTER Alternate Status Register + * ERM, it is techincally legal to leave/exit here but it makes + * a mess of the code ... */ - return(GET_STAT()); + if (HWGROUP(drive)->handler == NULL) + ide_set_handler(drive, &task_in_intr, WAIT_CMD, NULL); + return ide_started; } -/* - * (ks/hs): Poll Alternate status register to wait for drive - * to become ready for next transfer - */ -byte altstat_multi_poll (ide_drive_t *drive, byte stat, const char *msg) -{ - /* (ks/hs): FIXME: Error handling, time-out? */ - while (stat & BUSY_STAT) - stat = GET_ALTSTAT(); - DTF("multi%s: nsect=1, ASR = %x\n", msg, stat); - return(GET_STAT()); /* (ks/hs): Clear pending IRQ */ -} -#endif /* ALTSTAT_SCREW_UP */ +EXPORT_SYMBOL(task_in_intr); /* * Handler for command with Read Multiple */ ide_startstop_t task_mulin_intr (ide_drive_t *drive) { - unsigned int msect, nsect; - -#ifdef ALTSTAT_SCREW_UP - byte stat = altstat_multi_busy(drive, GET_ALTSTAT(), "read"); -#else - byte stat = GET_STAT(); -#endif /* ALTSTAT_SCREW_UP */ - - byte io_32bit = drive->io_32bit; + ide_hwif_t *hwif = HWIF(drive); struct request *rq = HWGROUP(drive)->rq; char *pBuf = NULL; + unsigned int msect = drive->mult_count; + unsigned int nsect; + unsigned long flags; + u8 stat; - if (!OK_STAT(stat,DATA_READY,BAD_R_STAT)) { + if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG),DATA_READY,BAD_R_STAT)) { if (stat & (ERR_STAT|DRQ_STAT)) { - return ide_error(drive, "task_mulin_intr", stat); + if (!rq->bh) { + rq->current_nr_sectors += drive->mult_count; + /* + * NOTE: could rewind beyond beginning :-/ + */ + } else { + printk("%s: MULTI-READ assume all data " \ + "transfered is bad status=0x%02x\n", + drive->name, stat); + } + return DRIVER(drive)->error(drive, "task_mulin_intr", stat); } /* no data yet, so wait for another interrupt */ - ide_set_handler(drive, &task_mulin_intr, WAIT_CMD, NULL); + if (HWGROUP(drive)->handler == NULL) + ide_set_handler(drive, &task_mulin_intr, WAIT_CMD, NULL); return ide_started; } - /* (ks/hs): Fixed Multi-Sector transfer */ - msect = drive->mult_count; - -#ifdef ALTSTAT_SCREW_UP - /* - * Screw the request we do not support bad data-phase setups! - * Either read and learn the ATA standard or crash yourself! - */ - if (!msect) { + do { + nsect = rq->current_nr_sectors; + if (nsect > msect) + nsect = msect; + pBuf = task_map_rq(rq, &flags); + DTF("Multiread: %p, nsect: %d, msect: %d, " \ + " rq->current_nr_sectors: %d\n", + pBuf, nsect, msect, rq->current_nr_sectors); + taskfile_input_data(drive, pBuf, nsect * SECTOR_WORDS); + task_unmap_rq(rq, pBuf, &flags); + rq->errors = 0; + rq->current_nr_sectors -= nsect; + msect -= nsect; /* - * (ks/hs): Drive supports multi-sector transfer, - * drive->mult_count was not set + * FIXME :: We really can not legally get a new page/bh + * regardless, if this is the end of our segment. + * BH walking or segment can only be updated after we have a + * good hwif->INB(IDE_STATUS_REG); return. */ - nsect = 1; - while (rq->current_nr_sectors) { - pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE); - DTF("Multiread: %p, nsect: %d, rq->current_nr_sectors: %ld\n", pBuf, nsect, rq->current_nr_sectors); - drive->io_32bit = 0; - taskfile_input_data(drive, pBuf, nsect * SECTOR_WORDS); - drive->io_32bit = io_32bit; - rq->errors = 0; - rq->current_nr_sectors -= nsect; - stat = altstat_multi_poll(drive, GET_ALTSTAT(), "read"); + if (!rq->current_nr_sectors) { + if (!DRIVER(drive)->end_request(drive, 1)) + return ide_stopped; } - ide_end_request(1, HWGROUP(drive)); - return ide_stopped; - } -#endif /* ALTSTAT_SCREW_UP */ - - nsect = (rq->current_nr_sectors > msect) ? msect : rq->current_nr_sectors; - pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE); - - DTF("Multiread: %p, nsect: %d , rq->current_nr_sectors: %ld\n", - pBuf, nsect, rq->current_nr_sectors); - drive->io_32bit = 0; - taskfile_input_data(drive, pBuf, nsect * SECTOR_WORDS); - drive->io_32bit = io_32bit; - rq->errors = 0; - rq->current_nr_sectors -= nsect; - if (rq->current_nr_sectors != 0) { + } while (msect); + if (HWGROUP(drive)->handler == NULL) ide_set_handler(drive, &task_mulin_intr, WAIT_CMD, NULL); - return ide_started; - } - ide_end_request(1, HWGROUP(drive)); - return ide_stopped; + return ide_started; } +EXPORT_SYMBOL(task_mulin_intr); + +/* + * VERIFY ME before 2.4 ... unexpected race is possible based on details + * RMK with 74LS245/373/374 TTL buffer logic because of passthrough. + */ ide_startstop_t pre_task_out_intr (ide_drive_t *drive, struct request *rq) { - ide_task_t *args = rq->special; + char *pBuf = NULL; + unsigned long flags; ide_startstop_t startstop; - if (ide_wait_stat(&startstop, drive, DATA_READY, drive->bad_wstat, WAIT_DRQ)) { - printk(KERN_ERR "%s: no DRQ after issuing %s\n", drive->name, drive->mult_count ? "MULTWRITE" : "WRITE"); + if (ide_wait_stat(&startstop, drive, DATA_READY, + drive->bad_wstat, WAIT_DRQ)) { + printk(KERN_ERR "%s: no DRQ after issuing WRITE%s\n", + drive->name, + drive->addressing ? "_EXT" : ""); return startstop; } - - /* (ks/hs): Fixed Multi Write */ - if ((args->tfRegister[IDE_COMMAND_OFFSET] != WIN_MULTWRITE) && - (args->tfRegister[IDE_COMMAND_OFFSET] != WIN_MULTWRITE_EXT)) { - /* For Write_sectors we need to stuff the first sector */ - taskfile_output_data(drive, rq->buffer, SECTOR_WORDS); - rq->current_nr_sectors--; - return ide_started; - } else { - /* - * (ks/hs): Stuff the first sector(s) - * by implicitly calling the handler - */ - if (!(drive_is_ready(drive))) { - int i; - /* - * (ks/hs): FIXME: Replace hard-coded - * 100, error handling? - */ - for (i=0; i<100; i++) { - if (drive_is_ready(drive)) - break; - } - } - return args->handler(drive); - } + /* For Write_sectors we need to stuff the first sector */ + pBuf = task_map_rq(rq, &flags); + taskfile_output_data(drive, pBuf, SECTOR_WORDS); + rq->current_nr_sectors--; + task_unmap_rq(rq, pBuf, &flags); return ide_started; } +EXPORT_SYMBOL(pre_task_out_intr); + /* - * Handler for command with PIO data-out phase + * Handler for command with PIO data-out phase WRITE + * + * WOOHOO this is a CORRECT STATE DIAGRAM NOW, */ ide_startstop_t task_out_intr (ide_drive_t *drive) { - byte stat = GET_STAT(); - byte io_32bit = drive->io_32bit; + ide_hwif_t *hwif = HWIF(drive); struct request *rq = HWGROUP(drive)->rq; char *pBuf = NULL; + unsigned long flags; + u8 stat; - if (!rq->current_nr_sectors) { - ide_end_request(1, HWGROUP(drive)); - return ide_stopped; - } - - if (!OK_STAT(stat,DRIVE_READY,drive->bad_wstat)) { - return ide_error(drive, "task_out_intr", stat); + if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG), DRIVE_READY, drive->bad_wstat)) { + DTF("%s: WRITE attempting to recover last " \ + "sector counter status=0x%02x\n", + drive->name, stat); + rq->current_nr_sectors++; + return DRIVER(drive)->error(drive, "task_out_intr", stat); } + /* + * Safe to update request for partial completions. + * We have a good STATUS CHECK!!! + */ + if (!rq->current_nr_sectors) + if (!DRIVER(drive)->end_request(drive, 1)) + return ide_stopped; if ((rq->current_nr_sectors==1) ^ (stat & DRQ_STAT)) { rq = HWGROUP(drive)->rq; - pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE); - DTF("write: %p, rq->current_nr_sectors: %d\n", pBuf, (int) rq->current_nr_sectors); - drive->io_32bit = 0; + pBuf = task_map_rq(rq, &flags); + DTF("write: %p, rq->current_nr_sectors: %d\n", + pBuf, (int) rq->current_nr_sectors); taskfile_output_data(drive, pBuf, SECTOR_WORDS); - drive->io_32bit = io_32bit; + task_unmap_rq(rq, pBuf, &flags); rq->errors = 0; rq->current_nr_sectors--; } - - if (rq->current_nr_sectors <= 0) { - ide_end_request(1, HWGROUP(drive)); - } else { + if (HWGROUP(drive)->handler == NULL) ide_set_handler(drive, &task_out_intr, WAIT_CMD, NULL); - return ide_started; + return ide_started; +} + +EXPORT_SYMBOL(task_out_intr); + +#undef ALTERNATE_STATE_DIAGRAM_MULTI_OUT + +ide_startstop_t pre_task_mulout_intr (ide_drive_t *drive, struct request *rq) +{ +#ifdef ALTERNATE_STATE_DIAGRAM_MULTI_OUT + ide_hwif_t *hwif = HWIF(drive); + char *pBuf = NULL; + unsigned int nsect = 0, msect = drive->mult_count; + u8 stat; + unsigned long flags; +#endif /* ALTERNATE_STATE_DIAGRAM_MULTI_OUT */ + + ide_task_t *args = rq->special; + ide_startstop_t startstop; + +#if 0 + /* + * assign private copy for multi-write + */ + memcpy(&HWGROUP(drive)->wrq, rq, sizeof(struct request)); +#endif + + if (ide_wait_stat(&startstop, drive, DATA_READY, + drive->bad_wstat, WAIT_DRQ)) { + printk(KERN_ERR "%s: no DRQ after issuing %s\n", + drive->name, + drive->addressing ? "MULTWRITE_EXT" : "MULTWRITE"); + return startstop; } - return ide_stopped; +#ifdef ALTERNATE_STATE_DIAGRAM_MULTI_OUT + + do { + nsect = rq->current_nr_sectors; + if (nsect > msect) + nsect = msect; + pBuf = task_map_rq(rq, &flags); + DTF("Pre-Multiwrite: %p, nsect: %d, msect: %d, " \ + "rq->current_nr_sectors: %ld\n", + pBuf, nsect, msect, rq->current_nr_sectors); + msect -= nsect; + taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS); + task_unmap_rq(rq, pBuf, &flags); + rq->current_nr_sectors -= nsect; + if (!rq->current_nr_sectors) { + if (!DRIVER(drive)->end_request(drive, 1)) + if (!rq->bh) { + stat = hwif->INB(IDE_STATUS_REG); + return ide_stopped; + } + } + } while (msect); + rq->errors = 0; + return ide_started; +#else /* ! ALTERNATE_STATE_DIAGRAM_MULTI_OUT */ + +#if 0 + if (wait_for_ready(drive, 100)) + IDE_DEBUG(__LINE__); //BUG(); +#else + if (!(drive_is_ready(drive))) { + int i; + for (i=0; i<100; i++) { + if (drive_is_ready(drive)) + break; + } + } +#endif + /* + * WARNING :: if the drive as not acked good status we may not + * move the DATA-TRANSFER T-Bar as BSY != 0. + */ + return args->handler(drive); +#endif /* ALTERNATE_STATE_DIAGRAM_MULTI_OUT */ } +EXPORT_SYMBOL(pre_task_mulout_intr); + +/* + * FIXME before enabling in 2.4 ... DATA integrity issue upon error. + */ /* * Handler for command write multiple * Called directly from execute_drive_cmd for the first bunch of sectors, @@ -929,93 +865,119 @@ */ ide_startstop_t task_mulout_intr (ide_drive_t *drive) { - unsigned int msect, nsect; - -#ifdef ALTSTAT_SCREW_UP - byte stat = altstat_multi_busy(drive, GET_ALTSTAT(), "write"); -#else - byte stat = GET_STAT(); -#endif /* ALTSTAT_SCREW_UP */ - - byte io_32bit = drive->io_32bit; - struct request *rq = HWGROUP(drive)->rq; - ide_hwgroup_t *hwgroup = HWGROUP(drive); - char *pBuf = NULL; + ide_hwif_t *hwif = HWIF(drive); + u8 stat = hwif->INB(IDE_STATUS_REG); + struct request *rq = HWGROUP(drive)->rq; + char *pBuf = NULL; + ide_startstop_t startstop = ide_stopped; + unsigned int msect = drive->mult_count; + unsigned int nsect; + unsigned long flags; /* * (ks/hs): Handle last IRQ on multi-sector transfer, - * occurs after all data was sent + * occurs after all data was sent in this chunk */ if (rq->current_nr_sectors == 0) { - if (stat & (ERR_STAT|DRQ_STAT)) - return ide_error(drive, "task_mulout_intr", stat); - ide_end_request(1, HWGROUP(drive)); - return ide_stopped; + if (stat & (ERR_STAT|DRQ_STAT)) { + if (!rq->bh) { + rq->current_nr_sectors += drive->mult_count; + /* + * NOTE: could rewind beyond beginning :-/ + */ + } else { + printk("%s: MULTI-WRITE assume all data " \ + "transfered is bad status=0x%02x\n", + drive->name, stat); + } + return DRIVER(drive)->error(drive, "task_mulout_intr", stat); + } + if (!rq->bh) + DRIVER(drive)->end_request(drive, 1); + return startstop; } - + /* + * DON'T be lazy code the above and below togather !!! + */ if (!OK_STAT(stat,DATA_READY,BAD_R_STAT)) { if (stat & (ERR_STAT|DRQ_STAT)) { - return ide_error(drive, "task_mulout_intr", stat); + if (!rq->bh) { + rq->current_nr_sectors += drive->mult_count; + /* + * NOTE: could rewind beyond beginning :-/ + */ + } else { + printk("%s: MULTI-WRITE assume all data " \ + "transfered is bad status=0x%02x\n", + drive->name, stat); + } + return DRIVER(drive)->error(drive, "task_mulout_intr", stat); } /* no data yet, so wait for another interrupt */ - if (hwgroup->handler == NULL) + if (HWGROUP(drive)->handler == NULL) ide_set_handler(drive, &task_mulout_intr, WAIT_CMD, NULL); return ide_started; } - /* (ks/hs): See task_mulin_intr */ - msect = drive->mult_count; - -#ifdef ALTSTAT_SCREW_UP - /* - * Screw the request we do not support bad data-phase setups! - * Either read and learn the ATA standard or crash yourself! - */ - if (!msect) { - nsect = 1; - while (rq->current_nr_sectors) { - pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE); - DTF("Multiwrite: %p, nsect: %d, rq->current_nr_sectors: %ld\n", pBuf, nsect, rq->current_nr_sectors); - drive->io_32bit = 0; - taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS); - drive->io_32bit = io_32bit; - rq->errors = 0; - rq->current_nr_sectors -= nsect; - stat = altstat_multi_poll(drive, GET_ALTSTAT(), "write"); +#ifndef ALTERNATE_STATE_DIAGRAM_MULTI_OUT + if (HWGROUP(drive)->handler != NULL) { + unsigned long lflags; + spin_lock_irqsave(&io_request_lock, lflags); + HWGROUP(drive)->handler = NULL; + del_timer(&HWGROUP(drive)->timer); + spin_unlock_irqrestore(&io_request_lock, lflags); + } +#endif /* ALTERNATE_STATE_DIAGRAM_MULTI_OUT */ + + do { + nsect = rq->current_nr_sectors; + if (nsect > msect) + nsect = msect; + pBuf = task_map_rq(rq, &flags); + DTF("Multiwrite: %p, nsect: %d, msect: %d, " \ + "rq->current_nr_sectors: %ld\n", + pBuf, nsect, msect, rq->current_nr_sectors); + msect -= nsect; + taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS); + task_unmap_rq(rq, pBuf, &flags); + rq->current_nr_sectors -= nsect; + /* + * FIXME :: We really can not legally get a new page/bh + * regardless, if this is the end of our segment. + * BH walking or segment can only be updated after we + * have a good hwif->INB(IDE_STATUS_REG); return. + */ + if (!rq->current_nr_sectors) { + if (!DRIVER(drive)->end_request(drive, 1)) + if (!rq->bh) + return ide_stopped; } - ide_end_request(1, HWGROUP(drive)); - return ide_stopped; - } -#endif /* ALTSTAT_SCREW_UP */ - - nsect = (rq->current_nr_sectors > msect) ? msect : rq->current_nr_sectors; - pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE); - DTF("Multiwrite: %p, nsect: %d , rq->current_nr_sectors: %ld\n", - pBuf, nsect, rq->current_nr_sectors); - drive->io_32bit = 0; - taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS); - drive->io_32bit = io_32bit; + } while (msect); rq->errors = 0; - rq->current_nr_sectors -= nsect; - if (hwgroup->handler == NULL) + if (HWGROUP(drive)->handler == NULL) ide_set_handler(drive, &task_mulout_intr, WAIT_CMD, NULL); return ide_started; } +EXPORT_SYMBOL(task_mulout_intr); + /* Called by internal to feature out type of command being called */ +//ide_pre_handler_t * ide_pre_handler_parser (task_struct_t *taskfile, hob_struct_t *hobfile) ide_pre_handler_t * ide_pre_handler_parser (struct hd_drive_task_hdr *taskfile, struct hd_drive_hob_hdr *hobfile) { switch(taskfile->command) { /* IDE_DRIVE_TASK_RAW_WRITE */ case CFA_WRITE_MULTI_WO_ERASE: + // case WIN_WRITE_LONG: + // case WIN_WRITE_LONG_ONCE: case WIN_MULTWRITE: case WIN_MULTWRITE_EXT: -// case WIN_WRITEDMA: -// case WIN_WRITEDMA_QUEUED: -// case WIN_WRITEDMA_EXT: -// case WIN_WRITEDMA_QUEUED_EXT: + return &pre_task_mulout_intr; + /* IDE_DRIVE_TASK_OUT */ case WIN_WRITE: + // case WIN_WRITE_ONCE: + case WIN_WRITE_EXT: case WIN_WRITE_VERIFY: case WIN_WRITE_BUFFER: case CFA_WRITE_SECT_WO_ERASE: @@ -1025,13 +987,22 @@ case WIN_SMART: if (taskfile->feature == SMART_WRITE_LOG_SECTOR) return &pre_task_out_intr; + case WIN_WRITEDMA: + // case WIN_WRITEDMA_ONCE: + case WIN_WRITEDMA_QUEUED: + case WIN_WRITEDMA_EXT: + case WIN_WRITEDMA_QUEUED_EXT: + /* IDE_DRIVE_TASK_OUT */ default: break; } return(NULL); } +EXPORT_SYMBOL(ide_pre_handler_parser); + /* Called by internal to feature out type of command being called */ +//ide_handler_t * ide_handler_parser (task_struct_t *taskfile, hob_struct_t *hobfile) ide_handler_t * ide_handler_parser (struct hd_drive_task_hdr *taskfile, struct hd_drive_hob_hdr *hobfile) { switch(taskfile->command) { @@ -1040,6 +1011,7 @@ case CFA_TRANSLATE_SECTOR: case WIN_READ_BUFFER: case WIN_READ: + // case WIN_READ_ONCE: case WIN_READ_EXT: return &task_in_intr; case WIN_SECURITY_DISABLE: @@ -1051,11 +1023,16 @@ case WIN_WRITE_BUFFER: case WIN_WRITE_VERIFY: case WIN_WRITE: + // case WIN_WRITE_ONCE: case WIN_WRITE_EXT: return &task_out_intr; + // case WIN_READ_LONG: + // case WIN_READ_LONG_ONCE: case WIN_MULTREAD: case WIN_MULTREAD_EXT: return &task_mulin_intr; + // case WIN_WRITE_LONG: + // case WIN_WRITE_LONG_ONCE: case CFA_WRITE_MULTI_WO_ERASE: case WIN_MULTWRITE: case WIN_MULTWRITE_EXT: @@ -1074,13 +1051,16 @@ case CFA_REQ_EXT_ERROR_CODE: case CFA_ERASE_SECTORS: case WIN_VERIFY: + // case WIN_VERIFY_ONCE: case WIN_VERIFY_EXT: case WIN_SEEK: return &task_no_data_intr; case WIN_SPECIFY: return &set_geometry_intr; - case WIN_RESTORE: + case WIN_RECAL: + // case WIN_RESTORE: return &recal_intr; + case WIN_NOP: case WIN_DIAGNOSE: case WIN_FLUSH_CACHE: case WIN_FLUSH_CACHE_EXT: @@ -1111,11 +1091,13 @@ return &task_no_data_intr; #ifdef CONFIG_BLK_DEV_IDEDMA case WIN_READDMA: + // case WIN_READDMA_ONCE: case WIN_IDENTIFY_DMA: case WIN_READDMA_QUEUED: case WIN_READDMA_EXT: case WIN_READDMA_QUEUED_EXT: case WIN_WRITEDMA: + // case WIN_WRITEDMA_ONCE: case WIN_WRITEDMA_QUEUED: case WIN_WRITEDMA_EXT: case WIN_WRITEDMA_QUEUED_EXT: @@ -1130,14 +1112,31 @@ } } +EXPORT_SYMBOL(ide_handler_parser); + +ide_post_handler_t * ide_post_handler_parser (struct hd_drive_task_hdr *taskfile, struct hd_drive_hob_hdr *hobfile) +{ + switch(taskfile->command) { + case WIN_SPECIFY: /* set_geometry_intr */ + case WIN_RESTORE: /* recal_intr */ + case WIN_SETMULT: /* set_multmode_intr */ + default: + return(NULL); + } +} + +EXPORT_SYMBOL(ide_post_handler_parser); + /* Called by ioctl to feature out type of command being called */ int ide_cmd_type_parser (ide_task_t *args) { - struct hd_drive_task_hdr *taskfile = (struct hd_drive_task_hdr *) args->tfRegister; - struct hd_drive_hob_hdr *hobfile = (struct hd_drive_hob_hdr *) args->hobRegister; - args->prehandler = ide_pre_handler_parser(taskfile, hobfile); - args->handler = ide_handler_parser(taskfile, hobfile); + task_struct_t *taskfile = (task_struct_t *) args->tfRegister; + hob_struct_t *hobfile = (hob_struct_t *) args->hobRegister; + + args->prehandler = ide_pre_handler_parser(taskfile, hobfile); + args->handler = ide_handler_parser(taskfile, hobfile); + args->posthandler = ide_post_handler_parser(taskfile, hobfile); switch(args->tfRegister[IDE_COMMAND_OFFSET]) { case WIN_IDENTIFY: @@ -1145,18 +1144,28 @@ return IDE_DRIVE_TASK_IN; case CFA_TRANSLATE_SECTOR: case WIN_READ: + // case WIN_READ_ONCE: + case WIN_READ_EXT: case WIN_READ_BUFFER: return IDE_DRIVE_TASK_IN; case WIN_WRITE: + // case WIN_WRITE_ONCE: + case WIN_WRITE_EXT: case WIN_WRITE_VERIFY: case WIN_WRITE_BUFFER: case CFA_WRITE_SECT_WO_ERASE: case WIN_DOWNLOAD_MICROCODE: return IDE_DRIVE_TASK_RAW_WRITE; + // case WIN_READ_LONG: + // case WIN_READ_LONG_ONCE: case WIN_MULTREAD: + case WIN_MULTREAD_EXT: return IDE_DRIVE_TASK_IN; + // case WIN_WRITE_LONG: + // case WIN_WRITE_LONG_ONCE: case CFA_WRITE_MULTI_WO_ERASE: case WIN_MULTWRITE: + case WIN_MULTWRITE_EXT: return IDE_DRIVE_TASK_RAW_WRITE; case WIN_SECURITY_DISABLE: case WIN_SECURITY_ERASE_UNIT: @@ -1178,12 +1187,14 @@ } #ifdef CONFIG_BLK_DEV_IDEDMA case WIN_READDMA: + // case WIN_READDMA_ONCE: case WIN_IDENTIFY_DMA: case WIN_READDMA_QUEUED: case WIN_READDMA_EXT: case WIN_READDMA_QUEUED_EXT: return IDE_DRIVE_TASK_IN; case WIN_WRITEDMA: + // case WIN_WRITEDMA_ONCE: case WIN_WRITEDMA_QUEUED: case WIN_WRITEDMA_EXT: case WIN_WRITEDMA_QUEUED_EXT: @@ -1191,20 +1202,32 @@ #endif case WIN_SETFEATURES: switch(args->tfRegister[IDE_FEATURE_OFFSET]) { + case SETFEATURES_EN_8BIT: + case SETFEATURES_EN_WCACHE: + return IDE_DRIVE_TASK_NO_DATA; case SETFEATURES_XFER: return IDE_DRIVE_TASK_SET_XFER; case SETFEATURES_DIS_DEFECT: case SETFEATURES_EN_APM: case SETFEATURES_DIS_MSN: + case SETFEATURES_DIS_RETRY: + case SETFEATURES_EN_AAM: + case SETFEATURES_RW_LONG: + case SETFEATURES_SET_CACHE: + case SETFEATURES_DIS_RLA: case SETFEATURES_EN_RI: case SETFEATURES_EN_SI: case SETFEATURES_DIS_RPOD: case SETFEATURES_DIS_WCACHE: case SETFEATURES_EN_DEFECT: case SETFEATURES_DIS_APM: + case SETFEATURES_EN_ECC: case SETFEATURES_EN_MSN: + case SETFEATURES_EN_RETRY: case SETFEATURES_EN_RLA: case SETFEATURES_PREFETCH: + case SETFEATURES_4B_RW_LONG: + case SETFEATURES_DIS_AAM: case SETFEATURES_EN_RPOD: case SETFEATURES_DIS_RI: case SETFEATURES_DIS_SI: @@ -1215,6 +1238,7 @@ case CFA_REQ_EXT_ERROR_CODE: case CFA_ERASE_SECTORS: case WIN_VERIFY: + // case WIN_VERIFY_ONCE: case WIN_VERIFY_EXT: case WIN_SEEK: case WIN_SPECIFY: @@ -1253,6 +1277,8 @@ } } +EXPORT_SYMBOL(ide_cmd_type_parser); + /* * This function is intended to be used prior to invoking ide_do_drive_cmd(). */ @@ -1262,127 +1288,158 @@ rq->cmd = IDE_DRIVE_TASK_NO_DATA; } -/* - * This is kept for internal use only !!! - * This is an internal call and nobody in user-space has a damn - * reason to call this taskfile. - * - * ide_raw_taskfile is the one that user-space executes. - */ -int ide_wait_taskfile (ide_drive_t *drive, struct hd_drive_task_hdr *taskfile, struct hd_drive_hob_hdr *hobfile, byte *buf) -{ - struct request rq; - ide_task_t args; +EXPORT_SYMBOL(ide_init_drive_taskfile); - memset(&args, 0, sizeof(ide_task_t)); +#if 1 - args.tfRegister[IDE_DATA_OFFSET] = taskfile->data; - args.tfRegister[IDE_FEATURE_OFFSET] = taskfile->feature; - args.tfRegister[IDE_NSECTOR_OFFSET] = taskfile->sector_count; - args.tfRegister[IDE_SECTOR_OFFSET] = taskfile->sector_number; - args.tfRegister[IDE_LCYL_OFFSET] = taskfile->low_cylinder; - args.tfRegister[IDE_HCYL_OFFSET] = taskfile->high_cylinder; - args.tfRegister[IDE_SELECT_OFFSET] = taskfile->device_head; - args.tfRegister[IDE_COMMAND_OFFSET] = taskfile->command; - - args.hobRegister[IDE_DATA_OFFSET_HOB] = hobfile->data; - args.hobRegister[IDE_FEATURE_OFFSET_HOB] = hobfile->feature; - args.hobRegister[IDE_NSECTOR_OFFSET_HOB] = hobfile->sector_count; - args.hobRegister[IDE_SECTOR_OFFSET_HOB] = hobfile->sector_number; - args.hobRegister[IDE_LCYL_OFFSET_HOB] = hobfile->low_cylinder; - args.hobRegister[IDE_HCYL_OFFSET_HOB] = hobfile->high_cylinder; - args.hobRegister[IDE_SELECT_OFFSET_HOB] = hobfile->device_head; - args.hobRegister[IDE_CONTROL_OFFSET_HOB] = hobfile->control; +int ide_diag_taskfile (ide_drive_t *drive, ide_task_t *args, unsigned long data_size, u8 *buf) +{ + struct request rq; ide_init_drive_taskfile(&rq); - /* This is kept for internal use only !!! */ - args.command_type = ide_cmd_type_parser (&args); - if (args.command_type != IDE_DRIVE_TASK_NO_DATA) - rq.current_nr_sectors = rq.nr_sectors = (hobfile->sector_count << 8) | taskfile->sector_count; - rq.cmd = IDE_DRIVE_TASKFILE; rq.buffer = buf; - rq.special = &args; + + /* + * (ks) We transfer currently only whole sectors. + * This is suffient for now. But, it would be great, + * if we would find a solution to transfer any size. + * To support special commands like READ LONG. + */ + if (args->command_type != IDE_DRIVE_TASK_NO_DATA) { + if (data_size == 0) + rq.current_nr_sectors = rq.nr_sectors = (args->hobRegister[IDE_NSECTOR_OFFSET_HOB] << 8) | args->tfRegister[IDE_NSECTOR_OFFSET]; + /* rq.hard_cur_sectors */ + else + rq.current_nr_sectors = rq.nr_sectors = data_size / SECTOR_SIZE; + /* rq.hard_cur_sectors */ + } + + if (args->tf_out_flags.all == 0) { + /* + * clean up kernel settings for driver sanity, regardless. + * except for discrete diag services. + */ + args->posthandler = ide_post_handler_parser( + (struct hd_drive_task_hdr *) args->tfRegister, + (struct hd_drive_hob_hdr *) args->hobRegister); + + } + rq.special = args; return ide_do_drive_cmd(drive, &rq, ide_wait); } -int ide_raw_taskfile (ide_drive_t *drive, ide_task_t *args, byte *buf) +#else + +int ide_diag_taskfile (ide_drive_t *drive, ide_task_t *args, unsigned long data_size, u8 *buf) { - struct request rq; - ide_init_drive_taskfile(&rq); - rq.cmd = IDE_DRIVE_TASKFILE; - rq.buffer = buf; + struct request *rq; + unsigned long flags; + ide_hwgroup_t *hwgroup = HWGROUP(drive); + unsigned int major = HWIF(drive)->major; + struct list_head *queue_head = &drive->queue.queue_head; + DECLARE_COMPLETION(wait); - if (args->command_type != IDE_DRIVE_TASK_NO_DATA) - rq.current_nr_sectors = rq.nr_sectors = (args->hobRegister[IDE_NSECTOR_OFFSET_HOB] << 8) | args->tfRegister[IDE_NSECTOR_OFFSET]; + if (HWIF(drive)->chipset == ide_pdc4030 && buf != NULL) + return -ENOSYS; /* special drive cmds not supported */ - rq.special = args; - return ide_do_drive_cmd(drive, &rq, ide_wait); + memset(rq, 0, sizeof(*rq)); + rq->cmd = IDE_DRIVE_TASKFILE; + rq->buffer = buf; + + /* + * (ks) We transfer currently only whole sectors. + * This is suffient for now. But, it would be great, + * if we would find a solution to transfer any size. + * To support special commands like READ LONG. + */ + if (args->command_type != IDE_DRIVE_TASK_NO_DATA) { + if (data_size == 0) { + ata_nsector_t nsector; + nsector.b.low = args->hobRegister[IDE_NSECTOR_OFFSET_HOB]; + nsector.b.high = args->tfRegister[IDE_NSECTOR_OFFSET]; + rq.nr_sectors = nsector.all; + } else { + rq.nr_sectors = data_size / SECTOR_SIZE; + } + rq.current_nr_sectors = rq.nr_sectors; + // rq.hard_cur_sectors = rq.nr_sectors; + } + + if (args->tf_out_flags.all == 0) { + /* + * clean up kernel settings for driver sanity, regardless. + * except for discrete diag services. + */ + args->posthandler = ide_post_handler_parser( + (struct hd_drive_task_hdr *) args->tfRegister, + (struct hd_drive_hob_hdr *) args->hobRegister); + } + rq->special = args; + rq->errors = 0; + rq->rq_status = RQ_ACTIVE; + rq->rq_dev = MKDEV(major,(drive->select.b.unit)<waiting = &wait; + + spin_lock_irqsave(&io_request_lock, flags); + queue_head = queue_head->prev; + list_add(&rq->queue, queue_head); + ide_do_request(hwgroup, 0); + spin_unlock_irqrestore(&io_request_lock, flags); + + wait_for_completion(&wait); /* wait for it to be serviced */ + return rq->errors ? -EIO : 0; /* return -EIO if errors */ } +#endif + +EXPORT_SYMBOL(ide_diag_taskfile); + +int ide_raw_taskfile (ide_drive_t *drive, ide_task_t *args, u8 *buf) +{ + return ide_diag_taskfile(drive, args, 0, buf); +} +EXPORT_SYMBOL(ide_raw_taskfile); + #ifdef CONFIG_IDE_TASK_IOCTL_DEBUG char * ide_ioctl_verbose (unsigned int cmd) { return("unknown"); } -char * ide_task_cmd_verbose (byte task) +char * ide_task_cmd_verbose (u8 task) { return("unknown"); } #endif /* CONFIG_IDE_TASK_IOCTL_DEBUG */ -/* - * The taskfile glue table - * - * reqtask.data_phase reqtask.req_cmd - * args.command_type args.handler - * - * TASKFILE_P_OUT_DMAQ ?? ?? - * TASKFILE_P_IN_DMAQ ?? ?? - * TASKFILE_P_OUT_DMA ?? ?? - * TASKFILE_P_IN_DMA ?? ?? - * TASKFILE_P_OUT ?? ?? - * TASKFILE_P_IN ?? ?? - * - * TASKFILE_OUT_DMAQ IDE_DRIVE_TASK_RAW_WRITE NULL - * TASKFILE_IN_DMAQ IDE_DRIVE_TASK_IN NULL - * - * TASKFILE_OUT_DMA IDE_DRIVE_TASK_RAW_WRITE NULL - * TASKFILE_IN_DMA IDE_DRIVE_TASK_IN NULL - * - * TASKFILE_IN_OUT ?? ?? - * - * TASKFILE_MULTI_OUT IDE_DRIVE_TASK_RAW_WRITE task_mulout_intr - * TASKFILE_MULTI_IN IDE_DRIVE_TASK_IN task_mulin_intr - * - * TASKFILE_OUT IDE_DRIVE_TASK_RAW_WRITE task_out_intr - * TASKFILE_OUT IDE_DRIVE_TASK_OUT task_out_intr - * - * TASKFILE_IN IDE_DRIVE_TASK_IN task_in_intr - * TASKFILE_NO_DATA IDE_DRIVE_TASK_NO_DATA task_no_data_intr - * - * IDE_DRIVE_TASK_SET_XFER task_no_data_intr - * IDE_DRIVE_TASK_INVALID - * - */ - #define MAX_DMA (256*SECTOR_WORDS) +ide_startstop_t flagged_taskfile(ide_drive_t *, ide_task_t *); +ide_startstop_t flagged_task_no_data_intr(ide_drive_t *); +ide_startstop_t flagged_task_in_intr(ide_drive_t *); +ide_startstop_t flagged_task_mulin_intr(ide_drive_t *); +ide_startstop_t flagged_pre_task_out_intr(ide_drive_t *, struct request *); +ide_startstop_t flagged_task_out_intr(ide_drive_t *); +ide_startstop_t flagged_pre_task_mulout_intr(ide_drive_t *, struct request *); +ide_startstop_t flagged_task_mulout_intr(ide_drive_t *); + int ide_taskfile_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { ide_task_request_t *req_task; ide_task_t args; - - byte *outbuf = NULL; - byte *inbuf = NULL; + u8 *outbuf = NULL; + u8 *inbuf = NULL; task_ioreg_t *argsptr = args.tfRegister; task_ioreg_t *hobsptr = args.hobRegister; int err = 0; int tasksize = sizeof(struct ide_task_request_s); int taskin = 0; int taskout = 0; + u8 io_32bit = drive->io_32bit; + +// printk("IDE Taskfile ...\n"); req_task = kmalloc(tasksize, GFP_KERNEL); if (req_task == NULL) return -ENOMEM; @@ -1423,8 +1480,7 @@ } } - memset(argsptr, 0, HDIO_DRIVE_TASK_HDR_SIZE); - memset(hobsptr, 0, HDIO_DRIVE_HOB_HDR_SIZE); + memset(&args, 0, sizeof(ide_task_t)); memcpy(argsptr, req_task->io_ports, HDIO_DRIVE_TASK_HDR_SIZE); memcpy(hobsptr, req_task->hob_ports, HDIO_DRIVE_HOB_HDR_SIZE); @@ -1440,64 +1496,61 @@ ide_task_cmd_verbose(args.tfRegister[IDE_COMMAND_OFFSET])); #endif /* CONFIG_IDE_TASK_IOCTL_DEBUG */ + drive->io_32bit = 0; switch(req_task->data_phase) { case TASKFILE_OUT_DMAQ: case TASKFILE_OUT_DMA: - args.prehandler = NULL; - args.handler = NULL; - args.posthandler = NULL; - err = ide_raw_taskfile(drive, &args, outbuf); + err = ide_diag_taskfile(drive, &args, taskout, outbuf); break; case TASKFILE_IN_DMAQ: case TASKFILE_IN_DMA: - args.prehandler = NULL; - args.handler = NULL; - args.posthandler = NULL; - err = ide_raw_taskfile(drive, &args, inbuf); + err = ide_diag_taskfile(drive, &args, taskin, inbuf); break; case TASKFILE_IN_OUT: #if 0 args.prehandler = &pre_task_out_intr; args.handler = &task_out_intr; args.posthandler = NULL; - err = ide_raw_taskfile(drive, &args, outbuf); + err = ide_diag_taskfile(drive, &args, taskout, outbuf); args.prehandler = NULL; args.handler = &task_in_intr; args.posthandler = NULL; - err = ide_raw_taskfile(drive, &args, inbuf); + err = ide_diag_taskfile(drive, &args, taskin, inbuf); break; #else err = -EFAULT; goto abort; #endif case TASKFILE_MULTI_OUT: - if (drive->mult_count) { - args.prehandler = &pre_task_out_intr; - args.handler = &task_mulout_intr; - args.posthandler = NULL; - err = ide_raw_taskfile(drive, &args, outbuf); - } else { + if (!drive->mult_count) { /* (hs): give up if multcount is not set */ printk("%s: %s Multimode Write " \ "multcount is not set\n", - drive->name, __FUNCTION__); + drive->name, __FUNCTION__); err = -EPERM; goto abort; } + if (args.tf_out_flags.all != 0) { + args.prehandler = &flagged_pre_task_mulout_intr; + args.handler = &flagged_task_mulout_intr; + } else { + args.prehandler = &pre_task_mulout_intr; + args.handler = &task_mulout_intr; + } + err = ide_diag_taskfile(drive, &args, taskout, outbuf); break; case TASKFILE_OUT: - args.prehandler = &pre_task_out_intr; - args.handler = &task_out_intr; - args.posthandler = NULL; - err = ide_raw_taskfile(drive, &args, outbuf); + if (args.tf_out_flags.all != 0) { + args.prehandler = &flagged_pre_task_out_intr; + args.handler = &flagged_task_out_intr; + } else { + args.prehandler = &pre_task_out_intr; + args.handler = &task_out_intr; + } + err = ide_diag_taskfile(drive, &args, taskout, outbuf); break; case TASKFILE_MULTI_IN: - if (drive->mult_count) { - args.prehandler = NULL; - args.handler = &task_mulin_intr; - args.posthandler = NULL; - err = ide_raw_taskfile(drive, &args, inbuf); - } else { + if (!drive->mult_count) { /* (hs): give up if multcount is not set */ printk("%s: %s Multimode Read failure " \ "multcount is not set\n", @@ -1505,23 +1558,30 @@ err = -EPERM; goto abort; } + if (args.tf_out_flags.all != 0) { + args.handler = &flagged_task_mulin_intr; + } else { + args.handler = &task_mulin_intr; + } + err = ide_diag_taskfile(drive, &args, taskin, inbuf); break; case TASKFILE_IN: - args.prehandler = NULL; - args.handler = &task_in_intr; - args.posthandler = NULL; - err = ide_raw_taskfile(drive, &args, inbuf); + if (args.tf_out_flags.all != 0) { + args.handler = &flagged_task_in_intr; + } else { + args.handler = &task_in_intr; + } + err = ide_diag_taskfile(drive, &args, taskin, inbuf); break; case TASKFILE_NO_DATA: - args.prehandler = NULL; - args.handler = &task_no_data_intr; - args.posthandler = NULL; - err = ide_raw_taskfile(drive, &args, NULL); + if (args.tf_out_flags.all != 0) { + args.handler = &flagged_task_no_data_intr; + } else { + args.handler = &task_no_data_intr; + } + err = ide_diag_taskfile(drive, &args, 0, NULL); break; default: - args.prehandler = NULL; - args.handler = NULL; - args.posthandler = NULL; err = -EFAULT; goto abort; } @@ -1555,153 +1615,596 @@ kfree(outbuf); if (inbuf != NULL) kfree(inbuf); - return err; -} -EXPORT_SYMBOL(task_read_24); -EXPORT_SYMBOL(do_rw_taskfile); -EXPORT_SYMBOL(do_taskfile); -// EXPORT_SYMBOL(flagged_taskfile); +// printk("IDE Taskfile ioctl ended. rc = %i\n", err); -//EXPORT_SYMBOL(ide_end_taskfile); - -EXPORT_SYMBOL(set_multmode_intr); -EXPORT_SYMBOL(set_geometry_intr); -EXPORT_SYMBOL(recal_intr); + drive->io_32bit = io_32bit; -EXPORT_SYMBOL(task_no_data_intr); -EXPORT_SYMBOL(task_in_intr); -EXPORT_SYMBOL(task_mulin_intr); -EXPORT_SYMBOL(pre_task_out_intr); -EXPORT_SYMBOL(task_out_intr); -EXPORT_SYMBOL(task_mulout_intr); + return err; +} -EXPORT_SYMBOL(ide_init_drive_taskfile); -EXPORT_SYMBOL(ide_wait_taskfile); -EXPORT_SYMBOL(ide_raw_taskfile); -EXPORT_SYMBOL(ide_pre_handler_parser); -EXPORT_SYMBOL(ide_handler_parser); -EXPORT_SYMBOL(ide_cmd_type_parser); EXPORT_SYMBOL(ide_taskfile_ioctl); -#ifdef CONFIG_PKT_TASK_IOCTL - -#if 0 +int ide_wait_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors, u8 *buf) { + struct request rq; + u8 buffer[4]; -{ /* start cdrom */ + if (!buf) + buf = buffer; + memset(buf, 0, 4 + SECTOR_WORDS * 4 * sectors); + ide_init_drive_cmd(&rq); + rq.buffer = buf; + *buf++ = cmd; + *buf++ = nsect; + *buf++ = feature; + *buf++ = sectors; + return ide_do_drive_cmd(drive, &rq, ide_wait); +} - struct cdrom_info *info = drive->driver_data; +EXPORT_SYMBOL(ide_wait_cmd); - if (info->dma) { - if (info->cmd == READ) { - info->dma = !HWIF(drive)->dmaproc(ide_dma_read, drive); - } else if (info->cmd == WRITE) { - info->dma = !HWIF(drive)->dmaproc(ide_dma_write, drive); - } else { - printk("ide-cd: DMA set, but not allowed\n"); - } +/* + * FIXME : this needs to map into at taskfile. + */ +int ide_cmd_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +{ +#if 1 + int err = 0; + u8 args[4], *argbuf = args; + u8 xfer_rate = 0; + int argsize = 4; + ide_task_t tfargs; + + if (NULL == (void *) arg) { + struct request rq; + ide_init_drive_cmd(&rq); + return ide_do_drive_cmd(drive, &rq, ide_wait); } - /* Set up the controller registers. */ - OUT_BYTE (info->dma, IDE_FEATURE_REG); - OUT_BYTE (0, IDE_NSECTOR_REG); - OUT_BYTE (0, IDE_SECTOR_REG); + if (copy_from_user(args, (void *)arg, 4)) + return -EFAULT; - OUT_BYTE (xferlen & 0xff, IDE_LCYL_REG); - OUT_BYTE (xferlen >> 8 , IDE_HCYL_REG); - if (IDE_CONTROL_REG) - OUT_BYTE (drive->ctl, IDE_CONTROL_REG); + memset(&tfargs, 0, sizeof(ide_task_t)); + tfargs.tfRegister[IDE_FEATURE_OFFSET] = args[2]; + tfargs.tfRegister[IDE_NSECTOR_OFFSET] = args[3]; + tfargs.tfRegister[IDE_SECTOR_OFFSET] = args[1]; + tfargs.tfRegister[IDE_LCYL_OFFSET] = 0x00; + tfargs.tfRegister[IDE_HCYL_OFFSET] = 0x00; + tfargs.tfRegister[IDE_SELECT_OFFSET] = 0x00; + tfargs.tfRegister[IDE_COMMAND_OFFSET] = args[0]; + + if (args[3]) { + argsize = 4 + (SECTOR_WORDS * 4 * args[3]); + argbuf = kmalloc(argsize, GFP_KERNEL); + if (argbuf == NULL) + return -ENOMEM; + memcpy(argbuf, args, 4); + } + if (set_transfer(drive, &tfargs)) { + xfer_rate = args[1]; + if (ide_ata66_check(drive, &tfargs)) + goto abort; + } - if (info->dma) - (void) (HWIF(drive)->dmaproc(ide_dma_begin, drive)); + err = ide_wait_cmd(drive, args[0], args[1], args[2], args[3], argbuf); - if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt) { - ide_set_handler (drive, handler, WAIT_CMD, cdrom_timer_expiry); - OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); /* packet command */ - return ide_started; - } else { - OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); /* packet command */ - return (*handler) (drive); + if (!err && xfer_rate) { + /* active-retuning-calls future */ + if ((HWIF(drive)->speedproc) != NULL) + HWIF(drive)->speedproc(drive, xfer_rate); + ide_driveid_update(drive); } +abort: + if (copy_to_user((void *)arg, argbuf, argsize)) + err = -EFAULT; + if (argsize > 4) + kfree(argbuf); + return err; -} /* end cdrom */ +#else -{ /* start floppy */ + int err = 0; + u8 args[4], *argbuf = args; + u8 xfer_rate = 0; + int argsize = 0; + ide_task_t tfargs; + + if (NULL == (void *) arg) { + struct request rq; + ide_init_drive_cmd(&rq); + return ide_do_drive_cmd(drive, &rq, ide_wait); + } - idefloppy_floppy_t *floppy = drive->driver_data; - idefloppy_bcount_reg_t bcount; - int dma_ok = 0; + if (copy_from_user(args, (void *)arg, 4)) + return -EFAULT; - floppy->pc=pc; /* Set the current packet command */ + memset(&tfargs, 0, sizeof(ide_task_t)); + tfargs.tfRegister[IDE_FEATURE_OFFSET] = args[2]; + tfargs.tfRegister[IDE_NSECTOR_OFFSET] = args[3]; + tfargs.tfRegister[IDE_SECTOR_OFFSET] = args[1]; + tfargs.tfRegister[IDE_LCYL_OFFSET] = 0x00; + tfargs.tfRegister[IDE_HCYL_OFFSET] = 0x00; + tfargs.tfRegister[IDE_SELECT_OFFSET] = 0x00; + tfargs.tfRegister[IDE_COMMAND_OFFSET] = args[0]; + + if (args[3]) { + argsize = (SECTOR_WORDS * 4 * args[3]); + argbuf = kmalloc(argsize, GFP_KERNEL); + if (argbuf == NULL) + return -ENOMEM; + } + + if (set_transfer(drive, &tfargs)) { + xfer_rate = args[1]; + if (ide_ata66_check(drive, &tfargs)) + goto abort; + } - pc->retries++; - pc->actually_transferred=0; /* We haven't transferred any data yet */ - pc->current_position=pc->buffer; - bcount.all = IDE_MIN(pc->request_transfer, 63 * 1024); + tfargs.command_type = ide_cmd_type_parser(&tfargs); + err = ide_raw_taskfile(drive, &tfargs, argbuf); -#ifdef CONFIG_BLK_DEV_IDEDMA - if (test_and_clear_bit (PC_DMA_ERROR, &pc->flags)) { - (void) HWIF(drive)->dmaproc(ide_dma_off, drive); + if (!err && xfer_rate) { + /* active-retuning-calls future */ + if ((HWIF(drive)->speedproc) != NULL) + HWIF(drive)->speedproc(drive, xfer_rate); + ide_driveid_update(drive); } - if (test_bit (PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma) - dma_ok=!HWIF(drive)->dmaproc(test_bit (PC_WRITING, &pc->flags) ? ide_dma_write : ide_dma_read, drive); -#endif /* CONFIG_BLK_DEV_IDEDMA */ +abort: + args[0] = tfargs.tfRegister[IDE_COMMAND_OFFSET]; + args[1] = tfargs.tfRegister[IDE_FEATURE_OFFSET]; + args[2] = tfargs.tfRegister[IDE_NSECTOR_OFFSET]; + args[3] = 0; + + if (copy_to_user((void *)arg, argbuf, 4)) + err = -EFAULT; + if (argbuf != NULL) { + if (copy_to_user((void *)arg, argbuf + 4, argsize)) + err = -EFAULT; + kfree(argbuf); + } + return err; + +#endif +} + +EXPORT_SYMBOL(ide_cmd_ioctl); +int ide_wait_cmd_task (ide_drive_t *drive, u8 *buf) +{ + struct request rq; + + ide_init_drive_cmd(&rq); + rq.cmd = IDE_DRIVE_TASK; + rq.buffer = buf; + return ide_do_drive_cmd(drive, &rq, ide_wait); +} + +EXPORT_SYMBOL(ide_wait_cmd_task); + +/* + * FIXME : this needs to map into at taskfile. + */ +int ide_task_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +{ + int err = 0; + u8 args[7], *argbuf = args; + int argsize = 7; + + if (copy_from_user(args, (void *)arg, 7)) + return -EFAULT; + err = ide_wait_cmd_task(drive, argbuf); + if (copy_to_user((void *)arg, argbuf, argsize)) + err = -EFAULT; + return err; +} + +EXPORT_SYMBOL(ide_task_ioctl); + +/* + * NOTICE: This is additions from IBM to provide a discrete interface, + * for selective taskregister access operations. Nice JOB Klaus!!! + * Glad to be able to work and co-develop this with you and IBM. + */ +ide_startstop_t flagged_taskfile (ide_drive_t *drive, ide_task_t *task) +{ + ide_hwif_t *hwif = HWIF(drive); + task_struct_t *taskfile = (task_struct_t *) task->tfRegister; + hob_struct_t *hobfile = (hob_struct_t *) task->hobRegister; +#if DEBUG_TASKFILE + u8 status; +#endif + + +#ifdef CONFIG_IDE_TASK_IOCTL_DEBUG + void debug_taskfile(drive, task); +#endif /* CONFIG_IDE_TASK_IOCTL_DEBUG */ + + /* + * (ks) Check taskfile in/out flags. + * If set, then execute as it is defined. + * If not set, then define default settings. + * The default values are: + * write and read all taskfile registers (except data) + * write and read the hob registers (sector,nsector,lcyl,hcyl) + */ + if (task->tf_out_flags.all == 0) { + task->tf_out_flags.all = IDE_TASKFILE_STD_OUT_FLAGS; + if (drive->addressing == 1) + task->tf_out_flags.all |= (IDE_HOB_STD_OUT_FLAGS << 8); + } + + if (task->tf_in_flags.all == 0) { + task->tf_in_flags.all = IDE_TASKFILE_STD_IN_FLAGS; + if (drive->addressing == 1) + task->tf_in_flags.all |= (IDE_HOB_STD_IN_FLAGS << 8); + } + + /* ALL Command Block Executions SHALL clear nIEN, unless otherwise */ if (IDE_CONTROL_REG) - OUT_BYTE (drive->ctl,IDE_CONTROL_REG); - OUT_BYTE (dma_ok ? 1:0,IDE_FEATURE_REG); /* Use PIO/DMA */ - OUT_BYTE (bcount.b.high,IDE_BCOUNTH_REG); - OUT_BYTE (bcount.b.low,IDE_BCOUNTL_REG); - OUT_BYTE (drive->select.all,IDE_SELECT_REG); + /* clear nIEN */ + hwif->OUTB(drive->ctl, IDE_CONTROL_REG); + SELECT_MASK(drive, 0); -#ifdef CONFIG_BLK_DEV_IDEDMA - if (dma_ok) { /* Begin DMA, if necessary */ - set_bit (PC_DMA_IN_PROGRESS, &pc->flags); - (void) (HWIF(drive)->dmaproc(ide_dma_begin, drive)); +#if DEBUG_TASKFILE + status = hwif->INB(IDE_STATUS_REG); + if (status & 0x80) { + printk("flagged_taskfile -> Bad status. Status = %02x. wait 100 usec ...\n", status); + udelay(100); + status = hwif->INB(IDE_STATUS_REG); + printk("flagged_taskfile -> Status = %02x\n", status); } -#endif /* CONFIG_BLK_DEV_IDEDMA */ +#endif -} /* end floppy */ + if (task->tf_out_flags.b.data) { + u16 data = taskfile->data + (hobfile->data << 8); + hwif->OUTW(data, IDE_DATA_REG); + } -{ /* start tape */ + /* (ks) send hob registers first */ + if (task->tf_out_flags.b.nsector_hob) + hwif->OUTB(hobfile->sector_count, IDE_NSECTOR_REG); + if (task->tf_out_flags.b.sector_hob) + hwif->OUTB(hobfile->sector_number, IDE_SECTOR_REG); + if (task->tf_out_flags.b.lcyl_hob) + hwif->OUTB(hobfile->low_cylinder, IDE_LCYL_REG); + if (task->tf_out_flags.b.hcyl_hob) + hwif->OUTB(hobfile->high_cylinder, IDE_HCYL_REG); - idetape_tape_t *tape = drive->driver_data; + /* (ks) Send now the standard registers */ + if (task->tf_out_flags.b.error_feature) + hwif->OUTB(taskfile->feature, IDE_FEATURE_REG); + /* refers to number of sectors to transfer */ + if (task->tf_out_flags.b.nsector) + hwif->OUTB(taskfile->sector_count, IDE_NSECTOR_REG); + /* refers to sector offset or start sector */ + if (task->tf_out_flags.b.sector) + hwif->OUTB(taskfile->sector_number, IDE_SECTOR_REG); + if (task->tf_out_flags.b.lcyl) + hwif->OUTB(taskfile->low_cylinder, IDE_LCYL_REG); + if (task->tf_out_flags.b.hcyl) + hwif->OUTB(taskfile->high_cylinder, IDE_HCYL_REG); -#ifdef CONFIG_BLK_DEV_IDEDMA - if (test_and_clear_bit (PC_DMA_ERROR, &pc->flags)) { - printk (KERN_WARNING "ide-tape: DMA disabled, reverting to PIO\n"); - (void) HWIF(drive)->dmaproc(ide_dma_off, drive); - } - if (test_bit (PC_DMA_RECOMMENDED, &pc->flags) && drive->using_dma) - dma_ok=!HWIF(drive)->dmaproc(test_bit (PC_WRITING, &pc->flags) ? ide_dma_write : ide_dma_read, drive); -#endif /* CONFIG_BLK_DEV_IDEDMA */ + /* + * (ks) In the flagged taskfile approch, we will used all specified + * registers and the register value will not be changed. Except the + * select bit (master/slave) in the drive_head register. We must make + * sure that the desired drive is selected. + */ + hwif->OUTB(taskfile->device_head | drive->select.all, IDE_SELECT_REG); + switch(task->data_phase) { - if (IDE_CONTROL_REG) - OUT_BYTE (drive->ctl,IDE_CONTROL_REG); - OUT_BYTE (dma_ok ? 1:0,IDE_FEATURE_REG); /* Use PIO/DMA */ - OUT_BYTE (bcount.b.high,IDE_BCOUNTH_REG); - OUT_BYTE (bcount.b.low,IDE_BCOUNTL_REG); - OUT_BYTE (drive->select.all,IDE_SELECT_REG); -#ifdef CONFIG_BLK_DEV_IDEDMA - if (dma_ok) { /* Begin DMA, if necessary */ - set_bit (PC_DMA_IN_PROGRESS, &pc->flags); - (void) (HWIF(drive)->dmaproc(ide_dma_begin, drive)); - } -#endif /* CONFIG_BLK_DEV_IDEDMA */ - if (test_bit(IDETAPE_DRQ_INTERRUPT, &tape->flags)) { - ide_set_handler(drive, &idetape_transfer_pc, IDETAPE_WAIT_CMD, NULL); - OUT_BYTE(WIN_PACKETCMD, IDE_COMMAND_REG); + case TASKFILE_OUT_DMAQ: + case TASKFILE_OUT_DMA: + hwif->ide_dma_write(drive); + break; + + case TASKFILE_IN_DMAQ: + case TASKFILE_IN_DMA: + hwif->ide_dma_read(drive); + break; + + default: + if (task->handler == NULL) + return ide_stopped; + + ide_set_handler(drive, task->handler, WAIT_WORSTCASE, NULL); + /* Issue the command */ + hwif->OUTB(taskfile->command, IDE_COMMAND_REG); + if (task->prehandler != NULL) + return task->prehandler(drive, HWGROUP(drive)->rq); + } + + return ide_started; +} + +EXPORT_SYMBOL(flagged_taskfile); + +ide_startstop_t flagged_task_no_data_intr (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 stat; + + local_irq_enable(); + + if (!OK_STAT(stat = hwif->INB(IDE_STATUS_REG), READY_STAT, BAD_STAT)) { + if (stat & ERR_STAT) { + return DRIVER(drive)->error(drive, "flagged_task_no_data_intr", stat); + } + /* + * (ks) Unexpected ATA data phase detected. + * This should not happen. But, it can ! + * I am not sure, which function is best to clean up + * this situation. I choose: ide_error(...) + */ + return DRIVER(drive)->error(drive, "flagged_task_no_data_intr (unexpected phase)", stat); + } + + ide_end_drive_cmd(drive, stat, hwif->INB(IDE_ERROR_REG)); + + return ide_stopped; +} + +/* + * Handler for command with PIO data-in phase + */ +ide_startstop_t flagged_task_in_intr (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 stat = hwif->INB(IDE_STATUS_REG); + struct request *rq = HWGROUP(drive)->rq; + char *pBuf = NULL; + int retries = 5; + + if (rq->current_nr_sectors == 0) + return DRIVER(drive)->error(drive, "flagged_task_in_intr (no data requested)", stat); + + if (!OK_STAT(stat, DATA_READY, BAD_R_STAT)) { + if (stat & ERR_STAT) { + return DRIVER(drive)->error(drive, "flagged_task_in_intr", stat); + } + /* + * (ks) Unexpected ATA data phase detected. + * This should not happen. But, it can ! + * I am not sure, which function is best to clean up + * this situation. I choose: ide_error(...) + */ + return DRIVER(drive)->error(drive, "flagged_task_in_intr (unexpected data phase)", stat); + } + + pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE); + DTF("Read - rq->current_nr_sectors: %d, status: %02x\n", (int) rq->current_nr_sectors, stat); + + taskfile_input_data(drive, pBuf, SECTOR_WORDS); + + if (--rq->current_nr_sectors != 0) { + /* + * (ks) We don't know which command was executed. + * So, we wait the 'WORSTCASE' value. + */ + ide_set_handler(drive, &flagged_task_in_intr, WAIT_WORSTCASE, NULL); + return ide_started; + } + /* + * (ks) Last sector was transfered, wait until drive is ready. + * This can take up to 10 usec. We willl wait max 50 us. + */ + while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && retries--) + udelay(10); + ide_end_drive_cmd (drive, stat, hwif->INB(IDE_ERROR_REG)); + + return ide_stopped; +} + +ide_startstop_t flagged_task_mulin_intr (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 stat = hwif->INB(IDE_STATUS_REG); + struct request *rq = HWGROUP(drive)->rq; + char *pBuf = NULL; + int retries = 5; + unsigned int msect, nsect; + + if (rq->current_nr_sectors == 0) + return DRIVER(drive)->error(drive, "flagged_task_mulin_intr (no data requested)", stat); + + msect = drive->mult_count; + if (msect == 0) + return DRIVER(drive)->error(drive, "flagged_task_mulin_intr (multimode not set)", stat); + + if (!OK_STAT(stat, DATA_READY, BAD_R_STAT)) { + if (stat & ERR_STAT) { + return DRIVER(drive)->error(drive, "flagged_task_mulin_intr", stat); + } + /* + * (ks) Unexpected ATA data phase detected. + * This should not happen. But, it can ! + * I am not sure, which function is best to clean up + * this situation. I choose: ide_error(...) + */ + return DRIVER(drive)->error(drive, "flagged_task_mulin_intr (unexpected data phase)", stat); + } + + nsect = (rq->current_nr_sectors > msect) ? msect : rq->current_nr_sectors; + pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE); + + DTF("Multiread: %p, nsect: %d , rq->current_nr_sectors: %ld\n", + pBuf, nsect, rq->current_nr_sectors); + + taskfile_input_data(drive, pBuf, nsect * SECTOR_WORDS); + + rq->current_nr_sectors -= nsect; + if (rq->current_nr_sectors != 0) { + /* + * (ks) We don't know which command was executed. + * So, we wait the 'WORSTCASE' value. + */ + ide_set_handler(drive, &flagged_task_mulin_intr, WAIT_WORSTCASE, NULL); return ide_started; - } else { - OUT_BYTE(WIN_PACKETCMD, IDE_COMMAND_REG); - return idetape_transfer_pc(drive); } -} /* end tape */ + /* + * (ks) Last sector was transfered, wait until drive is ready. + * This can take up to 10 usec. We willl wait max 50 us. + */ + while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && retries--) + udelay(10); + ide_end_drive_cmd (drive, stat, hwif->INB(IDE_ERROR_REG)); + return ide_stopped; } -#endif + +/* + * Pre handler for command with PIO data-out phase + */ +ide_startstop_t flagged_pre_task_out_intr (ide_drive_t *drive, struct request *rq) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 stat = hwif->INB(IDE_STATUS_REG); + ide_startstop_t startstop; + + if (!rq->current_nr_sectors) { + return DRIVER(drive)->error(drive, "flagged_pre_task_out_intr (write data not specified)", stat); + } + + if (ide_wait_stat(&startstop, drive, DATA_READY, + BAD_W_STAT, WAIT_DRQ)) { + printk(KERN_ERR "%s: No DRQ bit after issuing write command.\n", drive->name); + return startstop; + } + + taskfile_output_data(drive, rq->buffer, SECTOR_WORDS); + --rq->current_nr_sectors; + + return ide_started; +} + +ide_startstop_t flagged_task_out_intr (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 stat = hwif->INB(IDE_STATUS_REG); + struct request *rq = HWGROUP(drive)->rq; + char *pBuf = NULL; + + if (!OK_STAT(stat, DRIVE_READY, BAD_W_STAT)) + return DRIVER(drive)->error(drive, "flagged_task_out_intr", stat); + + if (!rq->current_nr_sectors) { + ide_end_drive_cmd (drive, stat, hwif->INB(IDE_ERROR_REG)); + return ide_stopped; + } + + if (!OK_STAT(stat, DATA_READY, BAD_W_STAT)) { + /* + * (ks) Unexpected ATA data phase detected. + * This should not happen. But, it can ! + * I am not sure, which function is best to clean up + * this situation. I choose: ide_error(...) + */ + return DRIVER(drive)->error(drive, "flagged_task_out_intr (unexpected data phase)", stat); + } + + pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE); + DTF("Write - rq->current_nr_sectors: %d, status: %02x\n", + (int) rq->current_nr_sectors, stat); + + taskfile_output_data(drive, pBuf, SECTOR_WORDS); + --rq->current_nr_sectors; + + /* + * (ks) We don't know which command was executed. + * So, we wait the 'WORSTCASE' value. + */ + ide_set_handler(drive, &flagged_task_out_intr, WAIT_WORSTCASE, NULL); + + return ide_started; +} + +ide_startstop_t flagged_pre_task_mulout_intr (ide_drive_t *drive, struct request *rq) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 stat = hwif->INB(IDE_STATUS_REG); + char *pBuf = NULL; + ide_startstop_t startstop; + unsigned int msect, nsect; + + if (!rq->current_nr_sectors) + return DRIVER(drive)->error(drive, "flagged_pre_task_mulout_intr (write data not specified)", stat); + + msect = drive->mult_count; + if (msect == 0) + return DRIVER(drive)->error(drive, "flagged_pre_task_mulout_intr (multimode not set)", stat); + + if (ide_wait_stat(&startstop, drive, DATA_READY, + BAD_W_STAT, WAIT_DRQ)) { + printk(KERN_ERR "%s: No DRQ bit after issuing write command.\n", drive->name); + return startstop; + } + + nsect = (rq->current_nr_sectors > msect) ? msect : rq->current_nr_sectors; + pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE); + DTF("Multiwrite: %p, nsect: %d , rq->current_nr_sectors: %ld\n", + pBuf, nsect, rq->current_nr_sectors); + + taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS); + + rq->current_nr_sectors -= nsect; + + return ide_started; +} + +ide_startstop_t flagged_task_mulout_intr (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 stat = hwif->INB(IDE_STATUS_REG); + struct request *rq = HWGROUP(drive)->rq; + char *pBuf = NULL; + unsigned int msect, nsect; + + msect = drive->mult_count; + if (msect == 0) + return DRIVER(drive)->error(drive, "flagged_task_mulout_intr (multimode not set)", stat); + + if (!OK_STAT(stat, DRIVE_READY, BAD_W_STAT)) + return DRIVER(drive)->error(drive, "flagged_task_mulout_intr", stat); + + if (!rq->current_nr_sectors) { + ide_end_drive_cmd (drive, stat, hwif->INB(IDE_ERROR_REG)); + return ide_stopped; + } + + if (!OK_STAT(stat, DATA_READY, BAD_W_STAT)) { + /* + * (ks) Unexpected ATA data phase detected. + * This should not happen. But, it can ! + * I am not sure, which function is best to clean up + * this situation. I choose: ide_error(...) + */ + return DRIVER(drive)->error(drive, "flagged_task_mulout_intr (unexpected data phase)", stat); + } + + nsect = (rq->current_nr_sectors > msect) ? msect : rq->current_nr_sectors; + pBuf = rq->buffer + ((rq->nr_sectors - rq->current_nr_sectors) * SECTOR_SIZE); + DTF("Multiwrite: %p, nsect: %d , rq->current_nr_sectors: %ld\n", + pBuf, nsect, rq->current_nr_sectors); + + taskfile_output_data(drive, pBuf, nsect * SECTOR_WORDS); + rq->current_nr_sectors -= nsect; + + /* + * (ks) We don't know which command was executed. + * So, we wait the 'WORSTCASE' value. + */ + ide_set_handler(drive, &flagged_task_mulout_intr, WAIT_WORSTCASE, NULL); + + return ide_started; +} + +/* + * Beginning of Taskfile OPCODE Library and feature sets. + */ + +#ifdef CONFIG_PKT_TASK_IOCTL int pkt_taskfile_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/it8172.c linux.20pre5-ac2/drivers/ide/it8172.c --- linux.20pre5/drivers/ide/it8172.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/it8172.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,286 +0,0 @@ -/* - * - * BRIEF MODULE DESCRIPTION - * IT8172 IDE controller support - * - * Copyright 2000 MontaVista Software Inc. - * Author: MontaVista Software, Inc. - * stevel@mvista.com or source@mvista.com - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN - * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF - * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "ide_modes.h" - -/* - * Prototypes - */ -static void it8172_tune_drive (ide_drive_t *drive, byte pio); -#if defined(CONFIG_BLK_DEV_IDEDMA) && defined(CONFIG_IT8172_TUNING) -static byte it8172_dma_2_pio (byte xfer_rate); -static int it8172_tune_chipset (ide_drive_t *drive, byte speed); -static int it8172_config_chipset_for_dma (ide_drive_t *drive); -static int it8172_dmaproc(ide_dma_action_t func, ide_drive_t *drive); -#endif -unsigned int __init pci_init_it8172 (struct pci_dev *dev, const char *name); -void __init ide_init_it8172 (ide_hwif_t *hwif); - - -static void it8172_tune_drive (ide_drive_t *drive, byte pio) -{ - unsigned long flags; - u16 drive_enables; - u32 drive_timing; - int is_slave = (&HWIF(drive)->drives[1] == drive); - - pio = ide_get_best_pio_mode(drive, pio, 4, NULL); - pci_read_config_word(HWIF(drive)->pci_dev, 0x40, &drive_enables); - pci_read_config_dword(HWIF(drive)->pci_dev, 0x44, &drive_timing); - - /* - * FIX! The DIOR/DIOW pulse width and recovery times in port 0x44 - * are being left at the default values of 8 PCI clocks (242 nsec - * for a 33 MHz clock). These can be safely shortened at higher - * PIO modes. The DIOR/DIOW pulse width and recovery times only - * apply to PIO modes, not to the DMA modes. - */ - - /* - * Enable port 0x44. The IT8172G spec is confused; it calls - * this register the "Slave IDE Timing Register", but in fact, - * it controls timing for both master and slave drives. - */ - drive_enables |= 0x4000; - - if (is_slave) { - drive_enables &= 0xc006; - if (pio > 1) - /* enable prefetch and IORDY sample-point */ - drive_enables |= 0x0060; - } else { - drive_enables &= 0xc060; - if (pio > 1) - /* enable prefetch and IORDY sample-point */ - drive_enables |= 0x0006; - } - - save_flags(flags); - cli(); - pci_write_config_word(HWIF(drive)->pci_dev, 0x40, drive_enables); - restore_flags(flags); -} - -#if defined(CONFIG_BLK_DEV_IDEDMA) && defined(CONFIG_IT8172_TUNING) -/* - * - */ -static byte it8172_dma_2_pio (byte xfer_rate) -{ - switch(xfer_rate) { - case XFER_UDMA_5: - case XFER_UDMA_4: - case XFER_UDMA_3: - case XFER_UDMA_2: - case XFER_UDMA_1: - case XFER_UDMA_0: - case XFER_MW_DMA_2: - case XFER_PIO_4: - return 4; - case XFER_MW_DMA_1: - case XFER_PIO_3: - return 3; - case XFER_SW_DMA_2: - case XFER_PIO_2: - return 2; - case XFER_MW_DMA_0: - case XFER_SW_DMA_1: - case XFER_SW_DMA_0: - case XFER_PIO_1: - case XFER_PIO_0: - case XFER_PIO_SLOW: - default: - return 0; - } -} - -static int it8172_tune_chipset (ide_drive_t *drive, byte speed) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - int a_speed = 3 << (drive->dn * 4); - int u_flag = 1 << drive->dn; - int u_speed = 0; - int err = 0; - byte reg48, reg4a; - - pci_read_config_byte(dev, 0x48, ®48); - pci_read_config_byte(dev, 0x4a, ®4a); - - /* - * Setting the DMA cycle time to 2 or 3 PCI clocks (60 and 91 nsec - * at 33 MHz PCI clock) seems to cause BadCRC errors during DMA - * transfers on some drives, even though both numbers meet the minimum - * ATAPI-4 spec of 73 and 54 nsec for UDMA 1 and 2 respectively. - * So the faster times are just commented out here. The good news is - * that the slower cycle time has very little affect on transfer - * performance. - */ - - switch(speed) { - case XFER_UDMA_4: - case XFER_UDMA_2: //u_speed = 2 << (drive->dn * 4); break; - case XFER_UDMA_5: - case XFER_UDMA_3: - case XFER_UDMA_1: //u_speed = 1 << (drive->dn * 4); break; - case XFER_UDMA_0: u_speed = 0 << (drive->dn * 4); break; - case XFER_MW_DMA_2: - case XFER_MW_DMA_1: - case XFER_MW_DMA_0: - case XFER_SW_DMA_2: break; - default: return -1; - } - - if (speed >= XFER_UDMA_0) { - pci_write_config_byte(dev, 0x48, reg48 | u_flag); - reg4a &= ~a_speed; - pci_write_config_byte(dev, 0x4a, reg4a | u_speed); - } else { - pci_write_config_byte(dev, 0x48, reg48 & ~u_flag); - pci_write_config_byte(dev, 0x4a, reg4a & ~a_speed); - } - - it8172_tune_drive(drive, it8172_dma_2_pio(speed)); - - if (!drive->init_speed) - drive->init_speed = speed; - err = ide_config_drive_speed(drive, speed); - drive->current_speed = speed; - return err; -} - -static int it8172_config_chipset_for_dma (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - byte speed; - - if (id->dma_ultra & 0x0010) { - speed = XFER_UDMA_2; - } else if (id->dma_ultra & 0x0008) { - speed = XFER_UDMA_1; - } else if (id->dma_ultra & 0x0004) { - speed = XFER_UDMA_2; - } else if (id->dma_ultra & 0x0002) { - speed = XFER_UDMA_1; - } else if (id->dma_ultra & 0x0001) { - speed = XFER_UDMA_0; - } else if (id->dma_mword & 0x0004) { - speed = XFER_MW_DMA_2; - } else if (id->dma_mword & 0x0002) { - speed = XFER_MW_DMA_1; - } else if (id->dma_mword & 0x0001) { - speed = XFER_MW_DMA_0; - } else if (id->dma_1word & 0x0004) { - speed = XFER_SW_DMA_2; - } else { - speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 4, NULL); - } - - (void) it8172_tune_chipset(drive, speed); - - return ((int)((id->dma_ultra >> 11) & 7) ? ide_dma_on : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ((id->dma_1word >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); -} - -static int it8172_dmaproc(ide_dma_action_t func, ide_drive_t *drive) -{ - switch (func) { - case ide_dma_check: - return ide_dmaproc((ide_dma_action_t)it8172_config_chipset_for_dma(drive), - drive); - default : - break; - } - /* Other cases are done by generic IDE-DMA code. */ - return ide_dmaproc(func, drive); -} - -#endif /* defined(CONFIG_BLK_DEV_IDEDMA) && (CONFIG_IT8172_TUNING) */ - - -unsigned int __init pci_init_it8172 (struct pci_dev *dev, const char *name) -{ - unsigned char progif; - - /* - * Place both IDE interfaces into PCI "native" mode - */ - (void)pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); - (void)pci_write_config_byte(dev, PCI_CLASS_PROG, progif | 0x05); - - return IT8172_IDE_IRQ; -} - - -void __init ide_init_it8172 (ide_hwif_t *hwif) -{ - struct pci_dev* dev = hwif->pci_dev; - unsigned long cmdBase, ctrlBase; - - hwif->tuneproc = &it8172_tune_drive; - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - - if (!hwif->dma_base) - return; - -#ifndef CONFIG_BLK_DEV_IDEDMA - hwif->autodma = 0; -#else /* CONFIG_BLK_DEV_IDEDMA */ -#ifdef CONFIG_IT8172_TUNING - hwif->autodma = 1; - hwif->dmaproc = &it8172_dmaproc; - hwif->speedproc = &it8172_tune_chipset; -#endif /* CONFIG_IT8172_TUNING */ -#endif /* !CONFIG_BLK_DEV_IDEDMA */ - - cmdBase = dev->resource[0].start; - ctrlBase = dev->resource[1].start; - - ide_init_hwif_ports(&hwif->hw, cmdBase, ctrlBase | 2, NULL); - memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); - hwif->noprobe = 0; -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/ali14xx.c linux.20pre5-ac2/drivers/ide/legacy/ali14xx.c --- linux.20pre5/drivers/ide/legacy/ali14xx.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/ali14xx.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,304 @@ +/* + * linux/drivers/ide/ali14xx.c Version 0.03 Feb 09, 1996 + * + * Copyright (C) 1996 Linus Torvalds & author (see below) + */ + +/* + * ALI M14xx chipset EIDE controller + * + * Works for ALI M1439/1443/1445/1487/1489 chipsets. + * + * Adapted from code developed by derekn@vw.ece.cmu.edu. -ml + * Derek's notes follow: + * + * I think the code should be pretty understandable, + * but I'll be happy to (try to) answer questions. + * + * The critical part is in the setupDrive function. The initRegisters + * function doesn't seem to be necessary, but the DOS driver does it, so + * I threw it in. + * + * I've only tested this on my system, which only has one disk. I posted + * it to comp.sys.linux.hardware, so maybe some other people will try it + * out. + * + * Derek Noonburg (derekn@ece.cmu.edu) + * 95-sep-26 + * + * Update 96-jul-13: + * + * I've since upgraded to two disks and a CD-ROM, with no trouble, and + * I've also heard from several others who have used it successfully. + * This driver appears to work with both the 1443/1445 and the 1487/1489 + * chipsets. I've added support for PIO mode 4 for the 1487. This + * seems to work just fine on the 1443 also, although I'm not sure it's + * advertised as supporting mode 4. (I've been running a WDC AC21200 in + * mode 4 for a while now with no trouble.) -Derek + */ + +#undef REALLY_SLOW_IO /* most systems can safely undef this */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef CONFIG_BLK_DEV_ALI14XX_MODULE +# define _IDE_C +# include "ide_modes.h" +# undef _IDE_C +#else +# include "ide_modes.h" +#endif /* CONFIG_BLK_DEV_ALI14XX_MODULE */ + +/* port addresses for auto-detection */ +#define ALI_NUM_PORTS 4 +static int ports[ALI_NUM_PORTS] __initdata = {0x074, 0x0f4, 0x034, 0x0e4}; + +/* register initialization data */ +typedef struct { u8 reg, data; } RegInitializer; + +static RegInitializer initData[] __initdata = { + {0x01, 0x0f}, {0x02, 0x00}, {0x03, 0x00}, {0x04, 0x00}, + {0x05, 0x00}, {0x06, 0x00}, {0x07, 0x2b}, {0x0a, 0x0f}, + {0x25, 0x00}, {0x26, 0x00}, {0x27, 0x00}, {0x28, 0x00}, + {0x29, 0x00}, {0x2a, 0x00}, {0x2f, 0x00}, {0x2b, 0x00}, + {0x2c, 0x00}, {0x2d, 0x00}, {0x2e, 0x00}, {0x30, 0x00}, + {0x31, 0x00}, {0x32, 0x00}, {0x33, 0x00}, {0x34, 0xff}, + {0x35, 0x03}, {0x00, 0x00} +}; + +#define ALI_MAX_PIO 4 + +/* timing parameter registers for each drive */ +static struct { u8 reg1, reg2, reg3, reg4; } regTab[4] = { + {0x03, 0x26, 0x04, 0x27}, /* drive 0 */ + {0x05, 0x28, 0x06, 0x29}, /* drive 1 */ + {0x2b, 0x30, 0x2c, 0x31}, /* drive 2 */ + {0x2d, 0x32, 0x2e, 0x33}, /* drive 3 */ +}; + +static int basePort; /* base port address */ +static int regPort; /* port for register number */ +static int dataPort; /* port for register data */ +static u8 regOn; /* output to base port to access registers */ +static u8 regOff; /* output to base port to close registers */ + +/*------------------------------------------------------------------------*/ + +/* + * Read a controller register. + */ +static inline u8 inReg (u8 reg) +{ + outb_p(reg, regPort); + return inb(dataPort); +} + +/* + * Write a controller register. + */ +static void outReg (u8 data, u8 reg) +{ + outb_p(reg, regPort); + outb_p(data, dataPort); +} + +/* + * Set PIO mode for the specified drive. + * This function computes timing parameters + * and sets controller registers accordingly. + */ +static void ali14xx_tune_drive (ide_drive_t *drive, u8 pio) +{ + int driveNum; + int time1, time2; + u8 param1, param2, param3, param4; + unsigned long flags; + ide_pio_data_t d; + int bus_speed = system_bus_clock(); + + pio = ide_get_best_pio_mode(drive, pio, ALI_MAX_PIO, &d); + + /* calculate timing, according to PIO mode */ + time1 = d.cycle_time; + time2 = ide_pio_timings[pio].active_time; + param3 = param1 = (time2 * bus_speed + 999) / 1000; + param4 = param2 = (time1 * bus_speed + 999) / 1000 - param1; + if (pio < 3) { + param3 += 8; + param4 += 8; + } + printk(KERN_DEBUG "%s: PIO mode%d, t1=%dns, t2=%dns, cycles = %d+%d, %d+%d\n", + drive->name, pio, time1, time2, param1, param2, param3, param4); + + /* stuff timing parameters into controller registers */ + driveNum = (HWIF(drive)->index << 1) + drive->select.b.unit; + spin_lock_irqsave(&io_request_lock, flags); + outb_p(regOn, basePort); + outReg(param1, regTab[driveNum].reg1); + outReg(param2, regTab[driveNum].reg2); + outReg(param3, regTab[driveNum].reg3); + outReg(param4, regTab[driveNum].reg4); + outb_p(regOff, basePort); + spin_unlock_irqrestore(&io_request_lock, flags); +} + +/* + * Auto-detect the IDE controller port. + */ +static int __init findPort (void) +{ + int i; + u8 t; + unsigned long flags; + + local_irq_save(flags); + for (i = 0; i < ALI_NUM_PORTS; ++i) { + basePort = ports[i]; + regOff = inb(basePort); + for (regOn = 0x30; regOn <= 0x33; ++regOn) { + outb_p(regOn, basePort); + if (inb(basePort) == regOn) { + regPort = basePort + 4; + dataPort = basePort + 8; + t = inReg(0) & 0xf0; + outb_p(regOff, basePort); + local_irq_restore(flags); + if (t != 0x50) + return 0; + return 1; /* success */ + } + } + outb_p(regOff, basePort); + } + local_irq_restore(flags); + return 0; +} + +/* + * Initialize controller registers with default values. + */ +static int __init initRegisters (void) { + RegInitializer *p; + u8 t; + unsigned long flags; + + local_irq_save(flags); + outb_p(regOn, basePort); + for (p = initData; p->reg != 0; ++p) + outReg(p->data, p->reg); + outb_p(0x01, regPort); + t = inb(regPort) & 0x01; + outb_p(regOff, basePort); + local_irq_restore(flags); + return t; +} + +int __init probe_ali14xx (void) +{ + /* auto-detect IDE controller port */ + if (!findPort()) { + printk(KERN_ERR "ali14xx: not found.\n"); + return 1; + } + + printk(KERN_DEBUG "ali14xx: base= 0x%03x, regOn = 0x%02x.\n", basePort, regOn); + ide_hwifs[0].chipset = ide_ali14xx; + ide_hwifs[1].chipset = ide_ali14xx; + ide_hwifs[0].tuneproc = &ali14xx_tune_drive; + ide_hwifs[1].tuneproc = &ali14xx_tune_drive; + ide_hwifs[0].mate = &ide_hwifs[1]; + ide_hwifs[1].mate = &ide_hwifs[0]; + ide_hwifs[1].channel = 1; + + /* initialize controller registers */ + if (!initRegisters()) { + printk(KERN_ERR "ali14xx: Chip initialization failed.\n"); + return 1; + } + +#ifndef HWIF_PROBE_CLASSIC_METHOD + probe_hwif_init(&ide_hwifs[0]); + probe_hwif_init(&ide_hwifs[1]); +#endif /* HWIF_PROBE_CLASSIC_METHOD */ + + return 0; +} + +void __init ali14xx_release (void) +{ + if (ide_hwifs[0].chipset != ide_ali14xx && + ide_hwifs[1].chipset != ide_ali14xx) + return; + + ide_hwifs[0].chipset = ide_unknown; + ide_hwifs[1].chipset = ide_unknown; + ide_hwifs[0].tuneproc = NULL; + ide_hwifs[1].tuneproc = NULL; + ide_hwifs[0].mate = NULL; + ide_hwifs[1].mate = NULL; +} + +#ifndef MODULE +/* + * init_ali14xx: + * + * called by ide.c when parsing command line + */ + +void __init init_ali14xx (void) +{ + /* auto-detect IDE controller port */ + if (findPort()) + if (probe_ali14xx()) + goto no_detect; + return; + +no_detect: + printk(KERN_ERR "ali14xx: not found.\n"); + ali14xx_release(); +} + +#else + +MODULE_AUTHOR("see local file"); +MODULE_DESCRIPTION("support of ALI 14XX IDE chipsets"); +MODULE_LICENSE("GPL"); + +int __init ali14xx_mod_init(void) +{ + /* auto-detect IDE controller port */ + if (findPort()) + if (probe_ali14xx()) { + ali14xx_release(); + return -ENODEV; + } + + if (ide_hwifs[0].chipset != ide_ali14xx && + ide_hwifs[1].chipset != ide_ali14xx) { + ali14xx_release(); + return -ENODEV; + } + return 0; +} +module_init(ali14xx_mod_init); + +void __init ali14xx_mod_exit(void) +{ + ali14xx_release(); +} +module_exit(ali14xx_mod_exit); +#endif + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/buddha.c linux.20pre5-ac2/drivers/ide/legacy/buddha.c --- linux.20pre5/drivers/ide/legacy/buddha.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/buddha.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,233 @@ +/* + * linux/drivers/ide/buddha.c -- Amiga Buddha, Catweasel and X-Surf IDE Driver + * + * Copyright (C) 1997, 2001 by Geert Uytterhoeven and others + * + * This driver was written based on the specifications in README.buddha and + * the X-Surf info from Inside_XSurf.txt available at + * http://www.jschoenfeld.com + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + * + * TODO: + * - test it :-) + * - tune the timings using the speed-register + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + + /* + * The Buddha has 2 IDE interfaces, the Catweasel has 3, X-Surf has 2 + */ + +#define BUDDHA_NUM_HWIFS 2 +#define CATWEASEL_NUM_HWIFS 3 +#define XSURF_NUM_HWIFS 2 + + /* + * Bases of the IDE interfaces (relative to the board address) + */ + +#define BUDDHA_BASE1 0x800 +#define BUDDHA_BASE2 0xa00 +#define BUDDHA_BASE3 0xc00 + +#define XSURF_BASE1 0xb000 /* 2.5" Interface */ +#define XSURF_BASE2 0xd000 /* 3.5" Interface */ + +static u_int buddha_bases[CATWEASEL_NUM_HWIFS] __initdata = { + BUDDHA_BASE1, BUDDHA_BASE2, BUDDHA_BASE3 +}; + +static u_int xsurf_bases[XSURF_NUM_HWIFS] __initdata = { + XSURF_BASE1, XSURF_BASE2 +}; + + + /* + * Offsets from one of the above bases + */ + +#define BUDDHA_DATA 0x00 +#define BUDDHA_ERROR 0x06 /* see err-bits */ +#define BUDDHA_NSECTOR 0x0a /* nr of sectors to read/write */ +#define BUDDHA_SECTOR 0x0e /* starting sector */ +#define BUDDHA_LCYL 0x12 /* starting cylinder */ +#define BUDDHA_HCYL 0x16 /* high byte of starting cyl */ +#define BUDDHA_SELECT 0x1a /* 101dhhhh , d=drive, hhhh=head */ +#define BUDDHA_STATUS 0x1e /* see status-bits */ +#define BUDDHA_CONTROL 0x11a +#define XSURF_CONTROL -1 /* X-Surf has no CS1* (Control/AltStat) */ + +static int buddha_offsets[IDE_NR_PORTS] __initdata = { + BUDDHA_DATA, BUDDHA_ERROR, BUDDHA_NSECTOR, BUDDHA_SECTOR, BUDDHA_LCYL, + BUDDHA_HCYL, BUDDHA_SELECT, BUDDHA_STATUS, BUDDHA_CONTROL, -1 +}; + +static int xsurf_offsets[IDE_NR_PORTS] __initdata = { + BUDDHA_DATA, BUDDHA_ERROR, BUDDHA_NSECTOR, BUDDHA_SECTOR, BUDDHA_LCYL, + BUDDHA_HCYL, BUDDHA_SELECT, BUDDHA_STATUS, XSURF_CONTROL, -1 +}; + + /* + * Other registers + */ + +#define BUDDHA_IRQ1 0xf00 /* MSB = 1, Harddisk is source of */ +#define BUDDHA_IRQ2 0xf40 /* interrupt */ +#define BUDDHA_IRQ3 0xf80 + +#define XSURF_IRQ1 0x7e +#define XSURF_IRQ2 0x7e + +static int buddha_irqports[CATWEASEL_NUM_HWIFS] __initdata = { + BUDDHA_IRQ1, BUDDHA_IRQ2, BUDDHA_IRQ3 +}; + +static int xsurf_irqports[XSURF_NUM_HWIFS] __initdata = { + XSURF_IRQ1, XSURF_IRQ2 +}; + +#define BUDDHA_IRQ_MR 0xfc0 /* master interrupt enable */ + + + /* + * Board information + */ + +typedef enum BuddhaType_Enum { + BOARD_BUDDHA, BOARD_CATWEASEL, BOARD_XSURF +} BuddhaType; + + + /* + * Check and acknowledge the interrupt status + */ + +static int buddha_ack_intr(ide_hwif_t *hwif) +{ + unsigned char ch; + + ch = z_readb(hwif->io_ports[IDE_IRQ_OFFSET]); + if (!(ch & 0x80)) + return 0; + return 1; +} + +static int xsurf_ack_intr(ide_hwif_t *hwif) +{ + unsigned char ch; + + ch = z_readb(hwif->io_ports[IDE_IRQ_OFFSET]); + /* X-Surf needs a 0 written to IRQ register to ensure ISA bit A11 stays at 0 */ + z_writeb(0, hwif->io_ports[IDE_IRQ_OFFSET]); + if (!(ch & 0x80)) + return 0; + return 1; +} + + /* + * Probe for a Buddha or Catweasel IDE interface + */ + +void __init buddha_init(void) +{ + hw_regs_t hw; + int i, index; + + struct zorro_dev *z = NULL; + u_long buddha_board = 0; + BuddhaType type; + int buddha_num_hwifs; + + while ((z = zorro_find_device(ZORRO_WILDCARD, z))) { + unsigned long board; + if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_BUDDHA) { + buddha_num_hwifs = BUDDHA_NUM_HWIFS; + type=BOARD_BUDDHA; + } else if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_CATWEASEL) { + buddha_num_hwifs = CATWEASEL_NUM_HWIFS; + type=BOARD_CATWEASEL; + } else if (z->id == ZORRO_PROD_INDIVIDUAL_COMPUTERS_X_SURF) { + buddha_num_hwifs = XSURF_NUM_HWIFS; + type=BOARD_XSURF; + } else + continue; + + board = z->resource.start; + +/* + * FIXME: we now have selectable mmio v/s iomio transports. + */ + + if(type != BOARD_XSURF) { + if (!request_mem_region(board+BUDDHA_BASE1, 0x800, "IDE")) + continue; + } else { + if (!request_mem_region(board+XSURF_BASE1, 0x1000, "IDE")) + continue; + if (!request_mem_region(board+XSURF_BASE2, 0x1000, "IDE")) + goto fail_base2; + if (!request_mem_region(board+XSURF_IRQ1, 0x8, "IDE")) { + release_mem_region(board+XSURF_BASE2, 0x1000); +fail_base2: + release_mem_region(board+XSURF_BASE1, 0x1000); + continue; + } + } + buddha_board = ZTWO_VADDR(board); + + /* write to BUDDHA_IRQ_MR to enable the board IRQ */ + /* X-Surf doesn't have this. IRQs are always on */ + if (type != BOARD_XSURF) + z_writeb(0, buddha_board+BUDDHA_IRQ_MR); + + for(i=0;i +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef CONFIG_BLK_DEV_DTC2278_MODULE +# define _IDE_C +# include "ide_modes.h" +# undef _IDE_C +#else +# include "ide_modes.h" +#endif /* CONFIG_BLK_DEV_DTC2278_MODULE */ + +/* + * Changing this #undef to #define may solve start up problems in some systems. + */ +#undef ALWAYS_SET_DTC2278_PIO_MODE + +/* + * From: andy@cercle.cts.com (Dyan Wile) + * + * Below is a patch for DTC-2278 - alike software-programmable controllers + * The code enables the secondary IDE controller and the PIO4 (3?) timings on + * the primary (EIDE). You may probably have to enable the 32-bit support to + * get the full speed. You better get the disk interrupts disabled ( hdparm -u0 + * /dev/hd.. ) for the drives connected to the EIDE interface. (I get my + * filesystem corrupted with -u1, but under heavy disk load only :-) + * + * This card is now forced to use the "serialize" feature, + * and irq-unmasking is disallowed. If io_32bit is enabled, + * it must be done for BOTH drives on each interface. + * + * This code was written for the DTC2278E, but might work with any of these: + * + * DTC2278S has only a single IDE interface. + * DTC2278D has two IDE interfaces and is otherwise identical to the S version. + * DTC2278E also has serial ports and a printer port + * DTC2278EB: has onboard BIOS, and "works like a charm" -- Kent Bradford + * + * There may be a fourth controller type. The S and D versions use the + * Winbond chip, and I think the E version does also. + * + */ + +static void sub22 (char b, char c) +{ + int i; + + for(i = 0; i < 3; ++i) { + inb(0x3f6); + outb_p(b,0xb0); + inb(0x3f6); + outb_p(c,0xb4); + inb(0x3f6); + if(inb(0xb4) == c) { + outb_p(7,0xb0); + inb(0x3f6); + return; /* success */ + } + } +} + +static void tune_dtc2278 (ide_drive_t *drive, u8 pio) +{ + unsigned long flags; + + pio = ide_get_best_pio_mode(drive, pio, 4, NULL); + + if (pio >= 3) { + spin_lock_irqsave(&io_request_lock, flags); + /* + * This enables PIO mode4 (3?) on the first interface + */ + sub22(1,0xc3); + sub22(0,0xa0); + spin_unlock_irqrestore(&io_request_lock, flags); + } else { + /* we don't know how to set it back again.. */ + } + + /* + * 32bit I/O has to be enabled for *both* drives at the same time. + */ + drive->io_32bit = 1; + HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1; +} + +void __init probe_dtc2278 (void) +{ + unsigned long flags; + + local_irq_save(flags); + /* + * This enables the second interface + */ + outb_p(4,0xb0); + inb(0x3f6); + outb_p(0x20,0xb4); + inb(0x3f6); +#ifdef ALWAYS_SET_DTC2278_PIO_MODE + /* + * This enables PIO mode4 (3?) on the first interface + * and may solve start-up problems for some people. + */ + sub22(1,0xc3); + sub22(0,0xa0); +#endif + local_irq_restore(flags); + + ide_hwifs[0].serialized = 1; + ide_hwifs[1].serialized = 1; + ide_hwifs[0].chipset = ide_dtc2278; + ide_hwifs[1].chipset = ide_dtc2278; + ide_hwifs[0].tuneproc = &tune_dtc2278; + ide_hwifs[0].drives[0].no_unmask = 1; + ide_hwifs[0].drives[1].no_unmask = 1; + ide_hwifs[1].drives[0].no_unmask = 1; + ide_hwifs[1].drives[1].no_unmask = 1; + ide_hwifs[0].mate = &ide_hwifs[1]; + ide_hwifs[1].mate = &ide_hwifs[0]; + ide_hwifs[1].channel = 1; + +#ifndef HWIF_PROBE_CLASSIC_METHOD + probe_hwif_init(&ide_hwifs[0]); + probe_hwif_init(&ide_hwifs[1]); +#endif /* HWIF_PROBE_CLASSIC_METHOD */ + +} + +void __init dtc2278_release (void) +{ + if (ide_hwifs[0].chipset != ide_dtc2278 && + ide_hwifs[1].chipset != ide_dtc2278) + return; + + ide_hwifs[0].serialized = 0; + ide_hwifs[1].serialized = 0; + ide_hwifs[0].chipset = ide_unknown; + ide_hwifs[1].chipset = ide_unknown; + ide_hwifs[0].tuneproc = NULL; + ide_hwifs[0].drives[0].no_unmask = 0; + ide_hwifs[0].drives[1].no_unmask = 0; + ide_hwifs[1].drives[0].no_unmask = 0; + ide_hwifs[1].drives[1].no_unmask = 0; + ide_hwifs[0].mate = NULL; + ide_hwifs[1].mate = NULL; +} + +#ifndef MODULE +/* + * init_dtc2278: + * + * called by ide.c when parsing command line + */ + +void __init init_dtc2278 (void) +{ + probe_dtc2278(); +} + +#else + +MODULE_AUTHOR("See Local File"); +MODULE_DESCRIPTION("support of DTC-2278 VLB IDE chipsets"); +MODULE_LICENSE("GPL"); + +int __init dtc2278_mod_init(void) +{ + probe_dtc2278(); + if (ide_hwifs[0].chipset != ide_dtc2278 && + ide_hwifs[1].chipset != ide_dtc2278) { + dtc2278_release(); + return -ENODEV; + } + return 0; +} +module_init(dtc2278_mod_init); + +void __init dtc2278_mod_exit(void) +{ + dtc2278_release(); +} +module_exit(dtc2278_mod_exit); +#endif + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/falconide.c linux.20pre5-ac2/drivers/ide/legacy/falconide.c --- linux.20pre5/drivers/ide/legacy/falconide.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/falconide.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,70 @@ +/* + * linux/drivers/ide/falconide.c -- Atari Falcon IDE Driver + * + * Created 12 Jul 1997 by Geert Uytterhoeven + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + + + /* + * Base of the IDE interface + */ + +#define ATA_HD_BASE 0xfff00000 + + /* + * Offsets from the above base + */ + +#define ATA_HD_DATA 0x00 +#define ATA_HD_ERROR 0x05 /* see err-bits */ +#define ATA_HD_NSECTOR 0x09 /* nr of sectors to read/write */ +#define ATA_HD_SECTOR 0x0d /* starting sector */ +#define ATA_HD_LCYL 0x11 /* starting cylinder */ +#define ATA_HD_HCYL 0x15 /* high byte of starting cyl */ +#define ATA_HD_SELECT 0x19 /* 101dhhhh , d=drive, hhhh=head */ +#define ATA_HD_STATUS 0x1d /* see status-bits */ +#define ATA_HD_CONTROL 0x39 + +static int falconide_offsets[IDE_NR_PORTS] __initdata = { + ATA_HD_DATA, ATA_HD_ERROR, ATA_HD_NSECTOR, ATA_HD_SECTOR, ATA_HD_LCYL, + ATA_HD_HCYL, ATA_HD_SELECT, ATA_HD_STATUS, ATA_HD_CONTROL, -1 +}; + + + /* + * Probe for a Falcon IDE interface + */ + +void __init falconide_init(void) +{ + if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) { + hw_regs_t hw; + int index; + + ide_setup_ports(&hw, (ide_ioreg_t)ATA_HD_BASE, falconide_offsets, + 0, 0, NULL, +// falconide_iops, + IRQ_MFP_IDE); + index = ide_register_hw(&hw, NULL); + + if (index != -1) + printk("ide%d: Falcon IDE interface\n", index); + } +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/gayle.c linux.20pre5-ac2/drivers/ide/legacy/gayle.c --- linux.20pre5/drivers/ide/legacy/gayle.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/gayle.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,187 @@ +/* + * linux/drivers/ide/gayle.c -- Amiga Gayle IDE Driver + * + * Created 9 Jul 1997 by Geert Uytterhoeven + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + + + /* + * Bases of the IDE interfaces + */ + +#define GAYLE_BASE_4000 0xdd2020 /* A4000/A4000T */ +#define GAYLE_BASE_1200 0xda0000 /* A1200/A600 */ + + /* + * Offsets from one of the above bases + */ + +#define GAYLE_DATA 0x00 +#define GAYLE_ERROR 0x06 /* see err-bits */ +#define GAYLE_NSECTOR 0x0a /* nr of sectors to read/write */ +#define GAYLE_SECTOR 0x0e /* starting sector */ +#define GAYLE_LCYL 0x12 /* starting cylinder */ +#define GAYLE_HCYL 0x16 /* high byte of starting cyl */ +#define GAYLE_SELECT 0x1a /* 101dhhhh , d=drive, hhhh=head */ +#define GAYLE_STATUS 0x1e /* see status-bits */ +#define GAYLE_CONTROL 0x101a + +static int gayle_offsets[IDE_NR_PORTS] __initdata = { + GAYLE_DATA, GAYLE_ERROR, GAYLE_NSECTOR, GAYLE_SECTOR, GAYLE_LCYL, + GAYLE_HCYL, GAYLE_SELECT, GAYLE_STATUS, -1, -1 +}; + + + /* + * These are at different offsets from the base + */ + +#define GAYLE_IRQ_4000 0xdd3020 /* MSB = 1, Harddisk is source of */ +#define GAYLE_IRQ_1200 0xda9000 /* interrupt */ + + + /* + * Offset of the secondary port for IDE doublers + * Note that GAYLE_CONTROL is NOT available then! + */ + +#define GAYLE_NEXT_PORT 0x1000 + +#ifndef CONFIG_BLK_DEV_IDEDOUBLER +#define GAYLE_NUM_HWIFS 1 +#define GAYLE_NUM_PROBE_HWIFS GAYLE_NUM_HWIFS +#define GAYLE_HAS_CONTROL_REG 1 +#define GAYLE_IDEREG_SIZE 0x2000 +#else /* CONFIG_BLK_DEV_IDEDOUBLER */ +#define GAYLE_NUM_HWIFS 2 +#define GAYLE_NUM_PROBE_HWIFS (ide_doubler ? GAYLE_NUM_HWIFS : \ + GAYLE_NUM_HWIFS-1) +#define GAYLE_HAS_CONTROL_REG (!ide_doubler) +#define GAYLE_IDEREG_SIZE (ide_doubler ? 0x1000 : 0x2000) +int ide_doubler = 0; /* support IDE doublers? */ +#endif /* CONFIG_BLK_DEV_IDEDOUBLER */ + + + /* + * Check and acknowledge the interrupt status + */ + +static int gayle_ack_intr_a4000(ide_hwif_t *hwif) +{ + unsigned char ch; + + ch = z_readb(hwif->io_ports[IDE_IRQ_OFFSET]); + if (!(ch & GAYLE_IRQ_IDE)) + return 0; + return 1; +} + +static int gayle_ack_intr_a1200(ide_hwif_t *hwif) +{ + unsigned char ch; + + ch = z_readb(hwif->io_ports[IDE_IRQ_OFFSET]); + if (!(ch & GAYLE_IRQ_IDE)) + return 0; + (void)z_readb(hwif->io_ports[IDE_STATUS_OFFSET]); + z_writeb(0x7c, hwif->io_ports[IDE_IRQ_OFFSET]); + return 1; +} + + /* + * Probe for a Gayle IDE interface (and optionally for an IDE doubler) + */ + +void __init gayle_init(void) +{ + int a4000, i; + + if (!MACH_IS_AMIGA) + return; + + if (!(a4000 = AMIGAHW_PRESENT(A4000_IDE)) && !AMIGAHW_PRESENT(A1200_IDE)) + return; + + for (i = 0; i < GAYLE_NUM_PROBE_HWIFS; i++) { + ide_ioreg_t base, ctrlport, irqport; + ide_ack_intr_t *ack_intr; + hw_regs_t hw; + int index; + unsigned long phys_base, res_start, res_n; + + if (a4000) { + phys_base = GAYLE_BASE_4000; + irqport = (ide_ioreg_t)ZTWO_VADDR(GAYLE_IRQ_4000); + ack_intr = gayle_ack_intr_a4000; + } else { + phys_base = GAYLE_BASE_1200; + irqport = (ide_ioreg_t)ZTWO_VADDR(GAYLE_IRQ_1200); + ack_intr = gayle_ack_intr_a1200; + } +/* + * FIXME: we now have selectable modes between mmio v/s iomio + */ + + phys_base += i*GAYLE_NEXT_PORT; + + res_start = ((unsigned long)phys_base) & ~(GAYLE_NEXT_PORT-1); + res_n = GAYLE_IDEREG_SIZE; + + if (!request_mem_region(res_start, res_n, "IDE")) + continue; + + base = (ide_ioreg_t)ZTWO_VADDR(phys_base); + ctrlport = GAYLE_HAS_CONTROL_REG ? (base + GAYLE_CONTROL) : 0; + + ide_setup_ports(&hw, base, gayle_offsets, + ctrlport, irqport, ack_intr, +// gaule_iops, + IRQ_AMIGA_PORTS); + + index = ide_register_hw(&hw, NULL); + if (index != -1) { + switch (i) { + case 0: + printk("ide%d: Gayle IDE interface (A%d style)\n", index, + a4000 ? 4000 : 1200); + break; +#ifdef CONFIG_BLK_DEV_IDEDOUBLER + case 1: + printk("ide%d: IDE doubler\n", index); + break; +#endif /* CONFIG_BLK_DEV_IDEDOUBLER */ + } + } else + release_mem_region(res_start, res_n); + +#if 1 /* TESTING */ + if (i == 1) { + volatile u_short *addr = (u_short *)base; + u_short data; + printk("+++ Probing for IDE doubler... "); + *addr = 0xffff; + data = *addr; + printk("probe returned 0x%02x (PLEASE REPORT THIS!!)\n", data); + } +#endif /* TESTING */ + } +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/hd.c linux.20pre5-ac2/drivers/ide/legacy/hd.c --- linux.20pre5/drivers/ide/legacy/hd.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/hd.c 2002-09-01 17:58:20.000000000 +0100 @@ -0,0 +1,925 @@ +/* + * linux/drivers/ide/hd.c + * + * Copyright (C) 1991, 1992 Linus Torvalds + */ + +/* + * This is the low-level hd interrupt support. It traverses the + * request-list, using interrupts to jump between functions. As + * all the functions are called within interrupts, we may not + * sleep. Special care is recommended. + * + * modified by Drew Eckhardt to check nr of hd's from the CMOS. + * + * Thanks to Branko Lankester, lankeste@fwi.uva.nl, who found a bug + * in the early extended-partition checks and added DM partitions + * + * IRQ-unmask, drive-id, multiple-mode, support for ">16 heads", + * and general streamlining by Mark Lord. + * + * Removed 99% of above. Use Mark's ide driver for those options. + * This is now a lightweight ST-506 driver. (Paul Gortmaker) + * + * Modified 1995 Russell King for ARM processor. + * + * Bugfix: max_sectors must be <= 255 or the wheels tend to come + * off in a hurry once you queue things up - Paul G. 02/2001 + */ + +/* Uncomment the following if you want verbose error reports. */ +/* #define VERBOSE_ERRORS */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include /* CMOS defines */ +#include +#include +#include + +#define REALLY_SLOW_IO +#include +#include +#include + +#define MAJOR_NR HD_MAJOR +#include + +#ifdef __arm__ +#undef HD_IRQ +#endif +#include +#ifdef __arm__ +#define HD_IRQ IRQ_HARDDISK +#endif + +static int revalidate_hddisk(kdev_t, int); + +#define HD_DELAY 0 + +#define MAX_ERRORS 16 /* Max read/write errors/sector */ +#define RESET_FREQ 8 /* Reset controller every 8th retry */ +#define RECAL_FREQ 4 /* Recalibrate every 4th retry */ +#define MAX_HD 2 + +#define STAT_OK (READY_STAT|SEEK_STAT) +#define OK_STATUS(s) (((s)&(STAT_OK|(BUSY_STAT|WRERR_STAT|ERR_STAT)))==STAT_OK) + +static void recal_intr(void); +static void bad_rw_intr(void); + +static char recalibrate[MAX_HD]; +static char special_op[MAX_HD]; +static int access_count[MAX_HD]; +static char busy[MAX_HD]; +static DECLARE_WAIT_QUEUE_HEAD(busy_wait); + +static int reset; +static int hd_error; + +#define SUBSECTOR(block) (CURRENT->current_nr_sectors > 0) + +/* + * This struct defines the HD's and their types. + */ +struct hd_i_struct { + unsigned int head,sect,cyl,wpcom,lzone,ctl; +}; + +#ifdef HD_TYPE +static struct hd_i_struct hd_info[] = { HD_TYPE }; +static int NR_HD = ((sizeof (hd_info))/(sizeof (struct hd_i_struct))); +#else +static struct hd_i_struct hd_info[MAX_HD]; +static int NR_HD; +#endif + +static struct hd_struct hd[MAX_HD<<6]; +static int hd_sizes[MAX_HD<<6]; +static int hd_blocksizes[MAX_HD<<6]; +static int hd_hardsectsizes[MAX_HD<<6]; +static int hd_maxsect[MAX_HD<<6]; + +static struct timer_list device_timer; + +#define SET_TIMER \ + do { \ + mod_timer(&device_timer, jiffies + TIMEOUT_VALUE); \ + } while (0) + +#define CLEAR_TIMER del_timer(&device_timer); + +#undef SET_INTR + +#define SET_INTR(x) \ +if ((DEVICE_INTR = (x)) != NULL) \ + SET_TIMER; \ +else \ + CLEAR_TIMER; + + +#if (HD_DELAY > 0) +unsigned long last_req; + +unsigned long read_timer(void) +{ + unsigned long t, flags; + int i; + + spin_lock_irqsave(&io_request_lock, flags); + t = jiffies * 11932; + outb_p(0, 0x43); + i = inb_p(0x40); + i |= inb(0x40) << 8; + spin_unlock_irqrestore(&io_request_lock, flags); + return(t - i); +} +#endif + +void __init hd_setup(char *str, int *ints) +{ + int hdind = 0; + + if (ints[0] != 3) + return; + if (hd_info[0].head != 0) + hdind=1; + hd_info[hdind].head = ints[2]; + hd_info[hdind].sect = ints[3]; + hd_info[hdind].cyl = ints[1]; + hd_info[hdind].wpcom = 0; + hd_info[hdind].lzone = ints[1]; + hd_info[hdind].ctl = (ints[2] > 8 ? 8 : 0); + NR_HD = hdind+1; +} + +static void dump_status (const char *msg, unsigned int stat) +{ + unsigned long flags; + char devc; + + devc = !QUEUE_EMPTY ? 'a' + DEVICE_NR(CURRENT->rq_dev) : '?'; + save_flags (flags); + sti(); +#ifdef VERBOSE_ERRORS + printk("hd%c: %s: status=0x%02x { ", devc, msg, stat & 0xff); + if (stat & BUSY_STAT) printk("Busy "); + if (stat & READY_STAT) printk("DriveReady "); + if (stat & WRERR_STAT) printk("WriteFault "); + if (stat & SEEK_STAT) printk("SeekComplete "); + if (stat & DRQ_STAT) printk("DataRequest "); + if (stat & ECC_STAT) printk("CorrectedError "); + if (stat & INDEX_STAT) printk("Index "); + if (stat & ERR_STAT) printk("Error "); + printk("}\n"); + if ((stat & ERR_STAT) == 0) { + hd_error = 0; + } else { + hd_error = inb(HD_ERROR); + printk("hd%c: %s: error=0x%02x { ", devc, msg, hd_error & 0xff); + if (hd_error & BBD_ERR) printk("BadSector "); + if (hd_error & ECC_ERR) printk("UncorrectableError "); + if (hd_error & ID_ERR) printk("SectorIdNotFound "); + if (hd_error & ABRT_ERR) printk("DriveStatusError "); + if (hd_error & TRK0_ERR) printk("TrackZeroNotFound "); + if (hd_error & MARK_ERR) printk("AddrMarkNotFound "); + printk("}"); + if (hd_error & (BBD_ERR|ECC_ERR|ID_ERR|MARK_ERR)) { + printk(", CHS=%d/%d/%d", + (inb(HD_HCYL)<<8) + inb(HD_LCYL), + inb(HD_CURRENT) & 0xf, inb(HD_SECTOR)); + if (!QUEUE_EMPTY) + printk(", sector=%ld", CURRENT->sector); + } + printk("\n"); + } +#else + printk("hd%c: %s: status=0x%02x.\n", devc, msg, stat & 0xff); + if ((stat & ERR_STAT) == 0) { + hd_error = 0; + } else { + hd_error = inb(HD_ERROR); + printk("hd%c: %s: error=0x%02x.\n", devc, msg, hd_error & 0xff); + } +#endif /* verbose errors */ + restore_flags (flags); +} + +void check_status(void) +{ + int i = inb_p(HD_STATUS); + + if (!OK_STATUS(i)) { + dump_status("check_status", i); + bad_rw_intr(); + } +} + +static int controller_busy(void) +{ + int retries = 100000; + unsigned char status; + + do { + status = inb_p(HD_STATUS); + } while ((status & BUSY_STAT) && --retries); + return status; +} + +static int status_ok(void) +{ + unsigned char status = inb_p(HD_STATUS); + + if (status & BUSY_STAT) + return 1; /* Ancient, but does it make sense??? */ + if (status & WRERR_STAT) + return 0; + if (!(status & READY_STAT)) + return 0; + if (!(status & SEEK_STAT)) + return 0; + return 1; +} + +static int controller_ready(unsigned int drive, unsigned int head) +{ + int retry = 100; + + do { + if (controller_busy() & BUSY_STAT) + return 0; + outb_p(0xA0 | (drive<<4) | head, HD_CURRENT); + if (status_ok()) + return 1; + } while (--retry); + return 0; +} + +static void hd_out(unsigned int drive,unsigned int nsect,unsigned int sect, + unsigned int head,unsigned int cyl,unsigned int cmd, + void (*intr_addr)(void)) +{ + unsigned short port; + +#if (HD_DELAY > 0) + while (read_timer() - last_req < HD_DELAY) + /* nothing */; +#endif + if (reset) + return; + if (!controller_ready(drive, head)) { + reset = 1; + return; + } + SET_INTR(intr_addr); + outb_p(hd_info[drive].ctl,HD_CMD); + port=HD_DATA; + outb_p(hd_info[drive].wpcom>>2,++port); + outb_p(nsect,++port); + outb_p(sect,++port); + outb_p(cyl,++port); + outb_p(cyl>>8,++port); + outb_p(0xA0|(drive<<4)|head,++port); + outb_p(cmd,++port); +} + +static void hd_request (void); + +static int drive_busy(void) +{ + unsigned int i; + unsigned char c; + + for (i = 0; i < 500000 ; i++) { + c = inb_p(HD_STATUS); + if ((c & (BUSY_STAT | READY_STAT | SEEK_STAT)) == STAT_OK) + return 0; + } + dump_status("reset timed out", c); + return 1; +} + +static void reset_controller(void) +{ + int i; + + outb_p(4,HD_CMD); + for(i = 0; i < 1000; i++) barrier(); + outb_p(hd_info[0].ctl & 0x0f,HD_CMD); + for(i = 0; i < 1000; i++) barrier(); + if (drive_busy()) + printk("hd: controller still busy\n"); + else if ((hd_error = inb(HD_ERROR)) != 1) + printk("hd: controller reset failed: %02x\n",hd_error); +} + +static void reset_hd(void) +{ + static int i; + +repeat: + if (reset) { + reset = 0; + i = -1; + reset_controller(); + } else { + check_status(); + if (reset) + goto repeat; + } + if (++i < NR_HD) { + special_op[i] = recalibrate[i] = 1; + hd_out(i,hd_info[i].sect,hd_info[i].sect,hd_info[i].head-1, + hd_info[i].cyl,WIN_SPECIFY,&reset_hd); + if (reset) + goto repeat; + } else + hd_request(); +} + +void do_reset_hd(void) +{ + DEVICE_INTR = NULL; + reset = 1; + reset_hd(); +} + +/* + * Ok, don't know what to do with the unexpected interrupts: on some machines + * doing a reset and a retry seems to result in an eternal loop. Right now I + * ignore it, and just set the timeout. + * + * On laptops (and "green" PCs), an unexpected interrupt occurs whenever the + * drive enters "idle", "standby", or "sleep" mode, so if the status looks + * "good", we just ignore the interrupt completely. + */ +void unexpected_hd_interrupt(void) +{ + unsigned int stat = inb_p(HD_STATUS); + + if (stat & (BUSY_STAT|DRQ_STAT|ECC_STAT|ERR_STAT)) { + dump_status ("unexpected interrupt", stat); + SET_TIMER; + } +} + +/* + * bad_rw_intr() now tries to be a bit smarter and does things + * according to the error returned by the controller. + * -Mika Liljeberg (liljeber@cs.Helsinki.FI) + */ +static void bad_rw_intr(void) +{ + int dev; + + if (QUEUE_EMPTY) + return; + dev = DEVICE_NR(CURRENT->rq_dev); + if (++CURRENT->errors >= MAX_ERRORS || (hd_error & BBD_ERR)) { + end_request(0); + special_op[dev] = recalibrate[dev] = 1; + } else if (CURRENT->errors % RESET_FREQ == 0) + reset = 1; + else if ((hd_error & TRK0_ERR) || CURRENT->errors % RECAL_FREQ == 0) + special_op[dev] = recalibrate[dev] = 1; + /* Otherwise just retry */ +} + +static inline int wait_DRQ(void) +{ + int retries = 100000, stat; + + while (--retries > 0) + if ((stat = inb_p(HD_STATUS)) & DRQ_STAT) + return 0; + dump_status("wait_DRQ", stat); + return -1; +} + +static void read_intr(void) +{ + int i, retries = 100000; + + do { + i = (unsigned) inb_p(HD_STATUS); + if (i & BUSY_STAT) + continue; + if (!OK_STATUS(i)) + break; + if (i & DRQ_STAT) + goto ok_to_read; + } while (--retries > 0); + dump_status("read_intr", i); + bad_rw_intr(); + hd_request(); + return; +ok_to_read: + insw(HD_DATA,CURRENT->buffer,256); + CURRENT->sector++; + CURRENT->buffer += 512; + CURRENT->errors = 0; + i = --CURRENT->nr_sectors; + --CURRENT->current_nr_sectors; +#ifdef DEBUG + printk("hd%c: read: sector %ld, remaining = %ld, buffer=0x%08lx\n", + dev+'a', CURRENT->sector, CURRENT->nr_sectors, + (unsigned long) CURRENT->buffer+512)); +#endif + if (CURRENT->current_nr_sectors <= 0) + end_request(1); + if (i > 0) { + SET_INTR(&read_intr); + return; + } + (void) inb_p(HD_STATUS); +#if (HD_DELAY > 0) + last_req = read_timer(); +#endif + if (!QUEUE_EMPTY) + hd_request(); + return; +} + +static void write_intr(void) +{ + int i; + int retries = 100000; + + do { + i = (unsigned) inb_p(HD_STATUS); + if (i & BUSY_STAT) + continue; + if (!OK_STATUS(i)) + break; + if ((CURRENT->nr_sectors <= 1) || (i & DRQ_STAT)) + goto ok_to_write; + } while (--retries > 0); + dump_status("write_intr", i); + bad_rw_intr(); + hd_request(); + return; +ok_to_write: + CURRENT->sector++; + i = --CURRENT->nr_sectors; + --CURRENT->current_nr_sectors; + CURRENT->buffer += 512; + if (!i || (CURRENT->bh && !SUBSECTOR(i))) + end_request(1); + if (i > 0) { + SET_INTR(&write_intr); + outsw(HD_DATA,CURRENT->buffer,256); + sti(); + } else { +#if (HD_DELAY > 0) + last_req = read_timer(); +#endif + hd_request(); + } + return; +} + +static void recal_intr(void) +{ + check_status(); +#if (HD_DELAY > 0) + last_req = read_timer(); +#endif + hd_request(); +} + +/* + * This is another of the error-routines I don't know what to do with. The + * best idea seems to just set reset, and start all over again. + */ +static void hd_times_out(unsigned long dummy) +{ + unsigned int dev; + + DEVICE_INTR = NULL; + if (QUEUE_EMPTY) + return; + disable_irq(HD_IRQ); + sti(); + reset = 1; + dev = DEVICE_NR(CURRENT->rq_dev); + printk("hd%c: timeout\n", dev+'a'); + if (++CURRENT->errors >= MAX_ERRORS) { +#ifdef DEBUG + printk("hd%c: too many errors\n", dev+'a'); +#endif + end_request(0); + } + cli(); + hd_request(); + enable_irq(HD_IRQ); +} + +int do_special_op (unsigned int dev) +{ + if (recalibrate[dev]) { + recalibrate[dev] = 0; + hd_out(dev,hd_info[dev].sect,0,0,0,WIN_RESTORE,&recal_intr); + return reset; + } + if (hd_info[dev].head > 16) { + printk ("hd%c: cannot handle device with more than 16 heads - giving up\n", dev+'a'); + end_request(0); + } + special_op[dev] = 0; + return 1; +} + +/* + * The driver enables interrupts as much as possible. In order to do this, + * (a) the device-interrupt is disabled before entering hd_request(), + * and (b) the timeout-interrupt is disabled before the sti(). + * + * Interrupts are still masked (by default) whenever we are exchanging + * data/cmds with a drive, because some drives seem to have very poor + * tolerance for latency during I/O. The IDE driver has support to unmask + * interrupts for non-broken hardware, so use that driver if required. + */ +static void hd_request(void) +{ + unsigned int dev, block, nsect, sec, track, head, cyl; + + if (!QUEUE_EMPTY && CURRENT->rq_status == RQ_INACTIVE) return; + if (DEVICE_INTR) + return; +repeat: + del_timer(&device_timer); + sti(); + INIT_REQUEST; + if (reset) { + cli(); + reset_hd(); + return; + } + dev = MINOR(CURRENT->rq_dev); + block = CURRENT->sector; + nsect = CURRENT->nr_sectors; + if (dev >= (NR_HD<<6) || block >= hd[dev].nr_sects || ((block+nsect) > hd[dev].nr_sects)) { +#ifdef DEBUG + if (dev >= (NR_HD<<6)) + printk("hd: bad minor number: device=%s\n", + kdevname(CURRENT->rq_dev)); + else + printk("hd%c: bad access: block=%d, count=%d\n", + (MINOR(CURRENT->rq_dev)>>6)+'a', block, nsect); +#endif + end_request(0); + goto repeat; + } + block += hd[dev].start_sect; + dev >>= 6; + if (special_op[dev]) { + if (do_special_op(dev)) + goto repeat; + return; + } + sec = block % hd_info[dev].sect + 1; + track = block / hd_info[dev].sect; + head = track % hd_info[dev].head; + cyl = track / hd_info[dev].head; +#ifdef DEBUG + printk("hd%c: %sing: CHS=%d/%d/%d, sectors=%d, buffer=0x%08lx\n", + dev+'a', (CURRENT->cmd == READ)?"read":"writ", + cyl, head, sec, nsect, (unsigned long) CURRENT->buffer); +#endif + if (CURRENT->cmd == READ) { + hd_out(dev,nsect,sec,head,cyl,WIN_READ,&read_intr); + if (reset) + goto repeat; + return; + } + if (CURRENT->cmd == WRITE) { + hd_out(dev,nsect,sec,head,cyl,WIN_WRITE,&write_intr); + if (reset) + goto repeat; + if (wait_DRQ()) { + bad_rw_intr(); + goto repeat; + } + outsw(HD_DATA,CURRENT->buffer,256); + return; + } + panic("unknown hd-command"); +} + +static void do_hd_request (request_queue_t * q) +{ + disable_irq(HD_IRQ); + hd_request(); + enable_irq(HD_IRQ); +} + +static int hd_ioctl(struct inode * inode, struct file * file, + unsigned int cmd, unsigned long arg) +{ + struct hd_geometry *loc = (struct hd_geometry *) arg; + int dev; + + if ((!inode) || !(inode->i_rdev)) + return -EINVAL; + dev = DEVICE_NR(inode->i_rdev); + if (dev >= NR_HD) + return -EINVAL; + switch (cmd) { + case HDIO_GETGEO: + { + struct hd_geometry g; + if (!loc) return -EINVAL; + g.heads = hd_info[dev].head; + g.sectors = hd_info[dev].sect; + g.cylinders = hd_info[dev].cyl; + g.start = hd[MINOR(inode->i_rdev)].start_sect; + return copy_to_user(loc, &g, sizeof g) ? -EFAULT : 0; + } + + case BLKGETSIZE: /* Return device size */ + return put_user(hd[MINOR(inode->i_rdev)].nr_sects, + (unsigned long *) arg); + case BLKGETSIZE64: + return put_user((u64)hd[MINOR(inode->i_rdev)].nr_sects << 9, + (u64 *) arg); + + case BLKRRPART: /* Re-read partition tables */ + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + return revalidate_hddisk(inode->i_rdev, 1); + + case BLKROSET: + case BLKROGET: + case BLKRASET: + case BLKRAGET: + case BLKFLSBUF: + case BLKPG: + return blk_ioctl(inode->i_rdev, cmd, arg); + + default: + return -EINVAL; + } +} + +static int hd_open(struct inode * inode, struct file * filp) +{ + int target; + target = DEVICE_NR(inode->i_rdev); + + if (target >= NR_HD) + return -ENODEV; + while (busy[target]) + sleep_on(&busy_wait); + access_count[target]++; + return 0; +} + +/* + * Releasing a block device means we sync() it, so that it can safely + * be forgotten about... + */ +static int hd_release(struct inode * inode, struct file * file) +{ + int target = DEVICE_NR(inode->i_rdev); + access_count[target]--; + return 0; +} + +extern struct block_device_operations hd_fops; + +static struct gendisk hd_gendisk = { + major: MAJOR_NR, + major_name: "hd", + minor_shift: 6, + max_p: 1 << 6, + part: hd, + sizes: hd_sizes, + fops: &hd_fops, +}; + +static void hd_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + void (*handler)(void) = DEVICE_INTR; + + DEVICE_INTR = NULL; + del_timer(&device_timer); + if (!handler) + handler = unexpected_hd_interrupt; + handler(); + sti(); +} + +static struct block_device_operations hd_fops = { + open: hd_open, + release: hd_release, + ioctl: hd_ioctl, +}; + +/* + * This is the hard disk IRQ description. The SA_INTERRUPT in sa_flags + * means we run the IRQ-handler with interrupts disabled: this is bad for + * interrupt latency, but anything else has led to problems on some + * machines. + * + * We enable interrupts in some of the routines after making sure it's + * safe. + */ +static void __init hd_geninit(void) +{ + int drive; + + for(drive=0; drive < (MAX_HD << 6); drive++) { + hd_blocksizes[drive] = 1024; + hd_hardsectsizes[drive] = 512; + hd_maxsect[drive]=255; + } + blksize_size[MAJOR_NR] = hd_blocksizes; + hardsect_size[MAJOR_NR] = hd_hardsectsizes; + max_sectors[MAJOR_NR] = hd_maxsect; + +#ifdef __i386__ + if (!NR_HD) { + extern struct drive_info drive_info; + unsigned char *BIOS = (unsigned char *) &drive_info; + unsigned long flags; + int cmos_disks; + + for (drive=0 ; drive<2 ; drive++) { + hd_info[drive].cyl = *(unsigned short *) BIOS; + hd_info[drive].head = *(2+BIOS); + hd_info[drive].wpcom = *(unsigned short *) (5+BIOS); + hd_info[drive].ctl = *(8+BIOS); + hd_info[drive].lzone = *(unsigned short *) (12+BIOS); + hd_info[drive].sect = *(14+BIOS); +#ifdef does_not_work_for_everybody_with_scsi_but_helps_ibm_vp + if (hd_info[drive].cyl && NR_HD == drive) + NR_HD++; +#endif + BIOS += 16; + } + + /* + We query CMOS about hard disks : it could be that + we have a SCSI/ESDI/etc controller that is BIOS + compatible with ST-506, and thus showing up in our + BIOS table, but not register compatible, and therefore + not present in CMOS. + + Furthermore, we will assume that our ST-506 drives + are the primary drives in the system, and + the ones reflected as drive 1 or 2. + + The first drive is stored in the high nibble of CMOS + byte 0x12, the second in the low nibble. This will be + either a 4 bit drive type or 0xf indicating use byte 0x19 + for an 8 bit type, drive 1, 0x1a for drive 2 in CMOS. + + Needless to say, a non-zero value means we have + an AT controller hard disk for that drive. + + Currently the rtc_lock is a bit academic since this + driver is non-modular, but someday... ? Paul G. + */ + + spin_lock_irqsave(&rtc_lock, flags); + cmos_disks = CMOS_READ(0x12); + spin_unlock_irqrestore(&rtc_lock, flags); + + if (cmos_disks & 0xf0) { + if (cmos_disks & 0x0f) + NR_HD = 2; + else + NR_HD = 1; + } + } +#endif /* __i386__ */ +#ifdef __arm__ + if (!NR_HD) { + /* We don't know anything about the drive. This means + * that you *MUST* specify the drive parameters to the + * kernel yourself. + */ + printk("hd: no drives specified - use hd=cyl,head,sectors" + " on kernel command line\n"); + } +#endif + + for (drive=0 ; drive < NR_HD ; drive++) { + hd[drive<<6].nr_sects = hd_info[drive].head * + hd_info[drive].sect * hd_info[drive].cyl; + printk ("hd%c: %ldMB, CHS=%d/%d/%d\n", drive+'a', + hd[drive<<6].nr_sects / 2048, hd_info[drive].cyl, + hd_info[drive].head, hd_info[drive].sect); + } + if (!NR_HD) + return; + + if (request_irq(HD_IRQ, hd_interrupt, SA_INTERRUPT, "hd", NULL)) { + printk("hd: unable to get IRQ%d for the hard disk driver\n", + HD_IRQ); + NR_HD = 0; + return; + } + request_region(HD_DATA, 8, "hd"); + request_region(HD_CMD, 1, "hd(cmd)"); + + hd_gendisk.nr_real = NR_HD; + + for(drive=0; drive < NR_HD; drive++) + register_disk(&hd_gendisk, MKDEV(MAJOR_NR,drive<<6), 1<<6, + &hd_fops, hd_info[drive].head * hd_info[drive].sect * + hd_info[drive].cyl); +} + +int __init hd_init(void) +{ + if (devfs_register_blkdev(MAJOR_NR,"hd",&hd_fops)) { + printk("hd: unable to get major %d for hard disk\n",MAJOR_NR); + return -1; + } + blk_init_queue(BLK_DEFAULT_QUEUE(MAJOR_NR), DEVICE_REQUEST); + read_ahead[MAJOR_NR] = 8; /* 8 sector (4kB) read-ahead */ + add_gendisk(&hd_gendisk); + init_timer(&device_timer); + device_timer.function = hd_times_out; + hd_geninit(); + return 0; +} + +#define DEVICE_BUSY busy[target] +#define USAGE access_count[target] +#define CAPACITY (hd_info[target].head*hd_info[target].sect*hd_info[target].cyl) +/* We assume that the BIOS parameters do not change, so the disk capacity + will not change */ +#undef MAYBE_REINIT +#define GENDISK_STRUCT hd_gendisk + +/* + * This routine is called to flush all partitions and partition tables + * for a changed disk, and then re-read the new partition table. + * If we are revalidating a disk because of a media change, then we + * enter with usage == 0. If we are using an ioctl, we automatically have + * usage == 1 (we need an open channel to use an ioctl :-), so this + * is our limit. + */ +static int revalidate_hddisk(kdev_t dev, int maxusage) +{ + int target; + struct gendisk * gdev; + int max_p; + int start; + int i; + long flags; + + target = DEVICE_NR(dev); + gdev = &GENDISK_STRUCT; + + spin_lock_irqsave(&io_request_lock, flags); + if (DEVICE_BUSY || USAGE > maxusage) { + spin_unlock_irqrestore(&io_request_lock, flags); + return -EBUSY; + } + DEVICE_BUSY = 1; + spin_unlock_irqrestore(&io_request_lock, flags); + + max_p = gdev->max_p; + start = target << gdev->minor_shift; + + for (i=max_p - 1; i >=0 ; i--) { + int minor = start + i; + invalidate_device(MKDEV(MAJOR_NR, minor), 1); + gdev->part[minor].start_sect = 0; + gdev->part[minor].nr_sects = 0; + } + +#ifdef MAYBE_REINIT + MAYBE_REINIT; +#endif + + grok_partitions(gdev, target, 1<<6, CAPACITY); + + DEVICE_BUSY = 0; + wake_up(&busy_wait); + return 0; +} + +static int parse_hd_setup (char *line) { + int ints[6]; + + (void) get_options(line, ARRAY_SIZE(ints), ints); + hd_setup(NULL, ints); + + return 1; +} +__setup("hd=", parse_hd_setup); + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/ht6560b.c linux.20pre5-ac2/drivers/ide/legacy/ht6560b.c --- linux.20pre5/drivers/ide/legacy/ht6560b.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/ht6560b.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,430 @@ +/* + * linux/drivers/ide/ht6560b.c Version 0.07 Feb 1, 2000 + * + * Copyright (C) 1995-2000 Linus Torvalds & author (see below) + */ + +/* + * + * Version 0.01 Initial version hacked out of ide.c + * + * Version 0.02 Added support for PIO modes, auto-tune + * + * Version 0.03 Some cleanups + * + * Version 0.05 PIO mode cycle timings auto-tune using bus-speed + * + * Version 0.06 Prefetch mode now defaults no OFF. To set + * prefetch mode OFF/ON use "hdparm -p8/-p9". + * Unmask irq is disabled when prefetch mode + * is enabled. + * + * Version 0.07 Trying to fix CD-ROM detection problem. + * "Prefetch" mode bit OFF for ide disks and + * ON for anything else. + * + * + * HT-6560B EIDE-controller support + * To activate controller support use kernel parameter "ide0=ht6560b". + * Use hdparm utility to enable PIO mode support. + * + * Author: Mikko Ala-Fossi + * Jan Evert van Grootheest + * + * Try: http://www.maf.iki.fi/~maf/ht6560b/ + */ + +#define HT6560B_VERSION "v0.07" + +#undef REALLY_SLOW_IO /* most systems can safely undef this */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef CONFIG_BLK_DEV_HT6560B_MODULE +# define _IDE_C +# include "ide_modes.h" +# undef _IDE_C +#else +# include "ide_modes.h" +#endif /* CONFIG_BLK_DEV_HT6560B_MODULE */ + +/* #define DEBUG */ /* remove comments for DEBUG messages */ + +/* + * The special i/o-port that HT-6560B uses to configuration: + * bit0 (0x01): "1" selects secondary interface + * bit2 (0x04): "1" enables FIFO function + * bit5 (0x20): "1" enables prefetched data read function (???) + * + * The special i/o-port that HT-6560A uses to configuration: + * bit0 (0x01): "1" selects secondary interface + * bit1 (0x02): "1" enables prefetched data read function + * bit2 (0x04): "0" enables multi-master system (?) + * bit3 (0x08): "1" 3 cycle time, "0" 2 cycle time (?) + */ +#define HT_CONFIG_PORT 0x3e6 +#define HT_CONFIG(drivea) (u8)(((drivea)->drive_data & 0xff00) >> 8) +/* + * FIFO + PREFETCH (both a/b-model) + */ +#define HT_CONFIG_DEFAULT 0x1c /* no prefetch */ +/* #define HT_CONFIG_DEFAULT 0x3c */ /* with prefetch */ +#define HT_SECONDARY_IF 0x01 +#define HT_PREFETCH_MODE 0x20 + +/* + * ht6560b Timing values: + * + * I reviewed some assembler source listings of htide drivers and found + * out how they setup those cycle time interfacing values, as they at Holtek + * call them. IDESETUP.COM that is supplied with the drivers figures out + * optimal values and fetches those values to drivers. I found out that + * they use IDE_SELECT_REG to fetch timings to the ide board right after + * interface switching. After that it was quite easy to add code to + * ht6560b.c. + * + * IDESETUP.COM gave me values 0x24, 0x45, 0xaa, 0xff that worked fine + * for hda and hdc. But hdb needed higher values to work, so I guess + * that sometimes it is necessary to give higher value than IDESETUP + * gives. [see cmd640.c for an extreme example of this. -ml] + * + * Perhaps I should explain something about these timing values: + * The higher nibble of value is the Recovery Time (rt) and the lower nibble + * of the value is the Active Time (at). Minimum value 2 is the fastest and + * the maximum value 15 is the slowest. Default values should be 15 for both. + * So 0x24 means 2 for rt and 4 for at. Each of the drives should have + * both values, and IDESETUP gives automatically rt=15 st=15 for CDROMs or + * similar. If value is too small there will be all sorts of failures. + * + * Timing byte consists of + * High nibble: Recovery Cycle Time (rt) + * The valid values range from 2 to 15. The default is 15. + * + * Low nibble: Active Cycle Time (at) + * The valid values range from 2 to 15. The default is 15. + * + * You can obtain optimized timing values by running Holtek IDESETUP.COM + * for DOS. DOS drivers get their timing values from command line, where + * the first value is the Recovery Time and the second value is the + * Active Time for each drive. Smaller value gives higher speed. + * In case of failures you should probably fall back to a higher value. + */ +#define HT_TIMING(drivea) (u8)((drivea)->drive_data & 0x00ff) +#define HT_TIMING_DEFAULT 0xff + +/* + * This routine handles interface switching for the peculiar hardware design + * on the F.G.I./Holtek HT-6560B VLB IDE interface. + * The HT-6560B can only enable one IDE port at a time, and requires a + * silly sequence (below) whenever we switch between primary and secondary. + */ + +/* + * This routine is invoked from ide.c to prepare for access to a given drive. + */ +static void ht6560b_selectproc (ide_drive_t *drive) +{ + unsigned long flags; + static u8 current_select = 0; + static u8 current_timing = 0; + u8 select, timing; + + local_irq_save(flags); + + select = HT_CONFIG(drive); + timing = HT_TIMING(drive); + + if (select != current_select || timing != current_timing) { + current_select = select; + current_timing = timing; + if (drive->media != ide_disk || !drive->present) + select |= HT_PREFETCH_MODE; + (void) HWIF(drive)->INB(HT_CONFIG_PORT); + (void) HWIF(drive)->INB(HT_CONFIG_PORT); + (void) HWIF(drive)->INB(HT_CONFIG_PORT); + (void) HWIF(drive)->INB(HT_CONFIG_PORT); + HWIF(drive)->OUTB(select, HT_CONFIG_PORT); + /* + * Set timing for this drive: + */ + HWIF(drive)->OUTB(timing, IDE_SELECT_REG); + (void) HWIF(drive)->INB(IDE_STATUS_REG); +#ifdef DEBUG + printk("ht6560b: %s: select=%#x timing=%#x\n", + drive->name, select, timing); +#endif + } + local_irq_restore(flags); +} + +/* + * Autodetection and initialization of ht6560b + */ +static int __init try_to_init_ht6560b(void) +{ + u8 orig_value; + int i; + + /* Autodetect ht6560b */ + if ((orig_value = inb(HT_CONFIG_PORT)) == 0xff) + return 0; + + for (i=3;i>0;i--) { + outb(0x00, HT_CONFIG_PORT); + if (!( (~inb(HT_CONFIG_PORT)) & 0x3f )) { + outb(orig_value, HT_CONFIG_PORT); + return 0; + } + } + outb(0x00, HT_CONFIG_PORT); + if ((~inb(HT_CONFIG_PORT))& 0x3f) { + outb(orig_value, HT_CONFIG_PORT); + return 0; + } + /* + * Ht6560b autodetected + */ + outb(HT_CONFIG_DEFAULT, HT_CONFIG_PORT); + outb(HT_TIMING_DEFAULT, 0x1f6); /* IDE_SELECT_REG */ + (void) inb(0x1f7); /* IDE_STATUS_REG */ + + printk("\nht6560b " HT6560B_VERSION + ": chipset detected and initialized" +#ifdef DEBUG + " with debug enabled" +#endif + ); + return 1; +} + +static u8 ht_pio2timings(ide_drive_t *drive, u8 pio) +{ + int active_time, recovery_time; + int active_cycles, recovery_cycles; + ide_pio_data_t d; + int bus_speed = system_bus_clock(); + + if (pio) { + pio = ide_get_best_pio_mode(drive, pio, 5, &d); + + /* + * Just like opti621.c we try to calculate the + * actual cycle time for recovery and activity + * according system bus speed. + */ + active_time = ide_pio_timings[pio].active_time; + recovery_time = d.cycle_time + - active_time + - ide_pio_timings[pio].setup_time; + /* + * Cycle times should be Vesa bus cycles + */ + active_cycles = (active_time * bus_speed + 999) / 1000; + recovery_cycles = (recovery_time * bus_speed + 999) / 1000; + /* + * Upper and lower limits + */ + if (active_cycles < 2) active_cycles = 2; + if (recovery_cycles < 2) recovery_cycles = 2; + if (active_cycles > 15) active_cycles = 15; + if (recovery_cycles > 15) recovery_cycles = 0; /* 0==16 */ + +#ifdef DEBUG + printk("ht6560b: drive %s setting pio=%d recovery=%d (%dns) active=%d (%dns)\n", drive->name, pio, recovery_cycles, recovery_time, active_cycles, active_time); +#endif + + return (u8)((recovery_cycles << 4) | active_cycles); + } else { + +#ifdef DEBUG + printk("ht6560b: drive %s setting pio=0\n", drive->name); +#endif + + return HT_TIMING_DEFAULT; /* default setting */ + } +} + +/* + * Enable/Disable so called prefetch mode + */ +static void ht_set_prefetch(ide_drive_t *drive, u8 state) +{ + unsigned long flags; + int t = HT_PREFETCH_MODE << 8; + + spin_lock_irqsave(&io_request_lock, flags); + + /* + * Prefetch mode and unmask irq seems to conflict + */ + if (state) { + drive->drive_data |= t; /* enable prefetch mode */ + drive->no_unmask = 1; + drive->unmask = 0; + } else { + drive->drive_data &= ~t; /* disable prefetch mode */ + drive->no_unmask = 0; + } + + spin_unlock_irqrestore(&io_request_lock, flags); + +#ifdef DEBUG + printk("ht6560b: drive %s prefetch mode %sabled\n", drive->name, (state ? "en" : "dis")); +#endif +} + +static void tune_ht6560b (ide_drive_t *drive, u8 pio) +{ + unsigned long flags; + u8 timing; + + switch (pio) { + case 8: /* set prefetch off */ + case 9: /* set prefetch on */ + ht_set_prefetch(drive, pio & 1); + return; + } + + timing = ht_pio2timings(drive, pio); + + spin_lock_irqsave(&io_request_lock, flags); + + drive->drive_data &= 0xff00; + drive->drive_data |= timing; + + spin_unlock_irqrestore(&io_request_lock, flags); + +#ifdef DEBUG + printk("ht6560b: drive %s tuned to pio mode %#x timing=%#x\n", drive->name, pio, timing); +#endif +} + +void __init probe_ht6560b (void) +{ + int t; + + request_region(HT_CONFIG_PORT, 1, ide_hwifs[0].name); + ide_hwifs[0].chipset = ide_ht6560b; + ide_hwifs[1].chipset = ide_ht6560b; + ide_hwifs[0].selectproc = &ht6560b_selectproc; + ide_hwifs[1].selectproc = &ht6560b_selectproc; + ide_hwifs[0].tuneproc = &tune_ht6560b; + ide_hwifs[1].tuneproc = &tune_ht6560b; + ide_hwifs[0].serialized = 1; /* is this needed? */ + ide_hwifs[1].serialized = 1; /* is this needed? */ + ide_hwifs[0].mate = &ide_hwifs[1]; + ide_hwifs[1].mate = &ide_hwifs[0]; + ide_hwifs[1].channel = 1; + + /* + * Setting default configurations for drives + */ + t = (HT_CONFIG_DEFAULT << 8); + t |= HT_TIMING_DEFAULT; + ide_hwifs[0].drives[0].drive_data = t; + ide_hwifs[0].drives[1].drive_data = t; + t |= (HT_SECONDARY_IF << 8); + ide_hwifs[1].drives[0].drive_data = t; + ide_hwifs[1].drives[1].drive_data = t; + +#ifndef HWIF_PROBE_CLASSIC_METHOD + probe_hwif_init(&ide_hwifs[0]); + probe_hwif_init(&ide_hwifs[1]); +#endif /* HWIF_PROBE_CLASSIC_METHOD */ + +} + +void __init ht6560b_release (void) +{ + if (ide_hwifs[0].chipset != ide_ht6560b && + ide_hwifs[1].chipset != ide_ht6560b) + return; + + ide_hwifs[0].chipset = ide_unknown; + ide_hwifs[1].chipset = ide_unknown; + ide_hwifs[0].tuneproc = NULL; + ide_hwifs[1].tuneproc = NULL; + ide_hwifs[0].selectproc = NULL; + ide_hwifs[1].selectproc = NULL; + ide_hwifs[0].serialized = 0; + ide_hwifs[1].serialized = 0; + ide_hwifs[0].mate = NULL; + ide_hwifs[1].mate = NULL; + + ide_hwifs[0].drives[0].drive_data = 0; + ide_hwifs[0].drives[1].drive_data = 0; + ide_hwifs[1].drives[0].drive_data = 0; + ide_hwifs[1].drives[1].drive_data = 0; + release_region(HT_CONFIG_PORT, 1); +} + +#ifndef MODULE +/* + * init_ht6560b: + * + * called by ide.c when parsing command line + */ + +void __init init_ht6560b (void) +{ + if (check_region(HT_CONFIG_PORT,1)) { + printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n", + __FUNCTION__); + return; + } + if (!try_to_init_ht6560b()) { + printk(KERN_NOTICE "%s: HBA not found\n", __FUNCTION__); + return; + } + probe_ht6560b(); +} + +#else + +MODULE_AUTHOR("See Local File"); +MODULE_DESCRIPTION("HT-6560B EIDE-controller support"); +MODULE_LICENSE("GPL"); + +int __init ht6560b_mod_init(void) +{ + if (check_region(HT_CONFIG_PORT,1)) { + printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n", + __FUNCTION__); + return -ENODEV; + } + + if (!try_to_init_ht6560b()) { + printk(KERN_NOTICE "%s: HBA not found\n", __FUNCTION__); + return -ENODEV; + } + + probe_ht6560b(); + if (ide_hwifs[0].chipset != ide_ht6560b && + ide_hwifs[1].chipset != ide_ht6560b) { + ht6560b_release(); + return -ENODEV; + } + return 0; +} +module_init(ht6560b_mod_init); + +void __init ht6560b_mod_exit(void) +{ + ht6560b_release(); +} +module_exit(ht6560b_mod_exit); +#endif + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/ide-cs.c linux.20pre5-ac2/drivers/ide/legacy/ide-cs.c --- linux.20pre5/drivers/ide/legacy/ide-cs.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/ide-cs.c 2002-09-01 17:58:47.000000000 +0100 @@ -0,0 +1,492 @@ +/*====================================================================== + + A driver for PCMCIA IDE/ATA disk cards + + ide_cs.c 1.26 1999/11/16 02:10:49 + + The contents of this file are subject to the Mozilla Public + License Version 1.1 (the "License"); you may not use this file + except in compliance with the License. You may obtain a copy of + the License at http://www.mozilla.org/MPL/ + + Software distributed under the License is distributed on an "AS + IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + implied. See the License for the specific language governing + rights and limitations under the License. + + The initial developer of the original code is David A. Hinds + . Portions created by David A. Hinds + are Copyright (C) 1999 David A. Hinds. All Rights Reserved. + + Alternatively, the contents of this file may be used under the + terms of the GNU General Public License version 2 (the "GPL"), in which + case the provisions of the GPL are applicable instead of the + above. If you wish to allow the use of your version of this file + only under the terms of the GPL and not to allow others to use + your version of this file under the MPL, indicate your decision + by deleting the provisions above and replace them with the notice + and other provisions required by the GPL. If you do not delete + the provisions above, a recipient may use your version of this + file under either the MPL or the GPL. + +======================================================================*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#ifdef PCMCIA_DEBUG +static int pc_debug = PCMCIA_DEBUG; +MODULE_PARM(pc_debug, "i"); +#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args) +static char *version = +"ide_cs.c 1.26 1999/11/16 02:10:49 (David Hinds)"; +#else +#define DEBUG(n, args...) +#endif + +/*====================================================================*/ + +/* Parameters that can be set with 'insmod' */ + +/* Bit map of interrupts to choose from */ +static u_int irq_mask = 0xdeb8; +static int irq_list[4] = { -1 }; + +MODULE_PARM(irq_mask, "i"); +MODULE_PARM(irq_list, "1-4i"); + +MODULE_LICENSE("GPL"); + + +/*====================================================================*/ + +static const char ide_major[] = { + IDE0_MAJOR, IDE1_MAJOR, IDE2_MAJOR, IDE3_MAJOR, +#ifdef IDE4_MAJOR + IDE4_MAJOR, IDE5_MAJOR +#endif +}; + +typedef struct ide_info_t { + dev_link_t link; + int ndev; + dev_node_t node; + int hd; +} ide_info_t; + +static void ide_config(dev_link_t *link); +static void ide_release(u_long arg); +static int ide_event(event_t event, int priority, + event_callback_args_t *args); + +static dev_info_t dev_info = "ide-cs"; + +static dev_link_t *ide_attach(void); +static void ide_detach(dev_link_t *); + +static dev_link_t *dev_list = NULL; + +/*====================================================================*/ + +static void cs_error(client_handle_t handle, int func, int ret) +{ + error_info_t err = { func, ret }; + CardServices(ReportError, handle, &err); +} + +/*====================================================================== + + ide_attach() creates an "instance" of the driver, allocating + local data structures for one device. The device is registered + with Card Services. + +======================================================================*/ + +static dev_link_t *ide_attach(void) +{ + ide_info_t *info; + dev_link_t *link; + client_reg_t client_reg; + int i, ret; + + DEBUG(0, "ide_attach()\n"); + + /* Create new ide device */ + info = kmalloc(sizeof(*info), GFP_KERNEL); + if (!info) return NULL; + memset(info, 0, sizeof(*info)); + link = &info->link; link->priv = info; + + link->release.function = &ide_release; + link->release.data = (u_long)link; + link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; + link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; + link->io.IOAddrLines = 3; + link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; + link->irq.IRQInfo1 = IRQ_INFO2_VALID|IRQ_LEVEL_ID; + if (irq_list[0] == -1) + link->irq.IRQInfo2 = irq_mask; + else + for (i = 0; i < 4; i++) + link->irq.IRQInfo2 |= 1 << irq_list[i]; + link->conf.Attributes = CONF_ENABLE_IRQ; + link->conf.Vcc = 50; + link->conf.IntType = INT_MEMORY_AND_IO; + + /* Register with Card Services */ + link->next = dev_list; + dev_list = link; + client_reg.dev_info = &dev_info; + client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; + client_reg.EventMask = + CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | + CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | + CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME; + client_reg.event_handler = &ide_event; + client_reg.Version = 0x0210; + client_reg.event_callback_args.client_data = link; + ret = CardServices(RegisterClient, &link->handle, &client_reg); + if (ret != CS_SUCCESS) { + cs_error(link->handle, RegisterClient, ret); + ide_detach(link); + return NULL; + } + + return link; +} /* ide_attach */ + +/*====================================================================== + + This deletes a driver "instance". The device is de-registered + with Card Services. If it has been released, all local data + structures are freed. Otherwise, the structures will be freed + when the device is released. + +======================================================================*/ + +static void ide_detach(dev_link_t *link) +{ + dev_link_t **linkp; + int ret; + + DEBUG(0, "ide_detach(0x%p)\n", link); + + /* Locate device structure */ + for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) + if (*linkp == link) break; + if (*linkp == NULL) + return; + + del_timer(&link->release); + if (link->state & DEV_CONFIG) + ide_release((u_long)link); + + if (link->handle) { + ret = CardServices(DeregisterClient, link->handle); + if (ret != CS_SUCCESS) + cs_error(link->handle, DeregisterClient, ret); + } + + /* Unlink, free device structure */ + *linkp = link->next; + kfree(link->priv); + +} /* ide_detach */ + +/*====================================================================== + + ide_config() is scheduled to run after a CARD_INSERTION event + is received, to configure the PCMCIA socket, and to make the + ide device available to the system. + +======================================================================*/ + +#define CS_CHECK(fn, args...) \ +while ((last_ret=CardServices(last_fn=(fn), args))!=0) goto cs_failed + +#define CFG_CHECK(fn, args...) \ +if (CardServices(fn, args) != 0) goto next_entry + +int idecs_register (int arg1, int arg2, int irq) +{ + hw_regs_t hw; + ide_init_hwif_ports(&hw, (ide_ioreg_t) arg1, (ide_ioreg_t) arg2, NULL); + hw.irq = irq; + hw.chipset = ide_pci; /* this enables IRQ sharing w/ PCI irqs */ + return ide_register_hw(&hw, NULL); +} + +void ide_config(dev_link_t *link) +{ + client_handle_t handle = link->handle; + ide_info_t *info = link->priv; + tuple_t tuple; + u_short buf[128]; + cisparse_t parse; + config_info_t conf; + cistpl_cftable_entry_t *cfg = &parse.cftable_entry; + cistpl_cftable_entry_t dflt = { 0 }; + int i, pass, last_ret, last_fn, hd=-1, io_base, ctl_base; + + DEBUG(0, "ide_config(0x%p)\n", link); + + tuple.TupleData = (cisdata_t *)buf; + tuple.TupleOffset = 0; tuple.TupleDataMax = 255; + tuple.Attributes = 0; + tuple.DesiredTuple = CISTPL_CONFIG; + CS_CHECK(GetFirstTuple, handle, &tuple); + CS_CHECK(GetTupleData, handle, &tuple); + CS_CHECK(ParseTuple, handle, &tuple, &parse); + link->conf.ConfigBase = parse.config.base; + link->conf.Present = parse.config.rmask[0]; + + /* Configure card */ + link->state |= DEV_CONFIG; + + /* Not sure if this is right... look up the current Vcc */ + CS_CHECK(GetConfigurationInfo, handle, &conf); + link->conf.Vcc = conf.Vcc; + + pass = io_base = ctl_base = 0; + tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; + tuple.Attributes = 0; + CS_CHECK(GetFirstTuple, handle, &tuple); + while (1) { + CFG_CHECK(GetTupleData, handle, &tuple); + CFG_CHECK(ParseTuple, handle, &tuple, &parse); + + /* Check for matching Vcc, unless we're desperate */ + if (!pass) { + if (cfg->vcc.present & (1<vcc.param[CISTPL_POWER_VNOM]/10000) + goto next_entry; + } else if (dflt.vcc.present & (1<vpp1.present & (1<conf.Vpp1 = link->conf.Vpp2 = + cfg->vpp1.param[CISTPL_POWER_VNOM]/10000; + else if (dflt.vpp1.present & (1<conf.Vpp1 = link->conf.Vpp2 = + dflt.vpp1.param[CISTPL_POWER_VNOM]/10000; + + if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { + cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt.io; + link->conf.ConfigIndex = cfg->index; + link->io.BasePort1 = io->win[0].base; + link->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; + if (!(io->flags & CISTPL_IO_16BIT)) + link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; + if (io->nwin == 2) { + link->io.NumPorts1 = 8; + link->io.BasePort2 = io->win[1].base; + link->io.NumPorts2 = 1; + CFG_CHECK(RequestIO, link->handle, &link->io); + io_base = link->io.BasePort1; + ctl_base = link->io.BasePort2; + } else if ((io->nwin == 1) && (io->win[0].len >= 16)) { + link->io.NumPorts1 = io->win[0].len; + link->io.NumPorts2 = 0; + CFG_CHECK(RequestIO, link->handle, &link->io); + io_base = link->io.BasePort1; + ctl_base = link->io.BasePort1+0x0e; + } else goto next_entry; + /* If we've got this far, we're done */ + break; + } + + next_entry: + if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; + if (pass) { + CS_CHECK(GetNextTuple, handle, &tuple); + } else if (CardServices(GetNextTuple, handle, &tuple) != 0) { + CS_CHECK(GetFirstTuple, handle, &tuple); + memset(&dflt, 0, sizeof(dflt)); + pass++; + } + } + + CS_CHECK(RequestIRQ, handle, &link->irq); + CS_CHECK(RequestConfiguration, handle, &link->conf); + + /* deal with brain dead IDE resource management */ + release_region(link->io.BasePort1, link->io.NumPorts1); + if (link->io.NumPorts2) + release_region(link->io.BasePort2, link->io.NumPorts2); + + /* retry registration in case device is still spinning up */ + for (i = 0; i < 10; i++) { + if (ctl_base) + outb(0x02, ctl_base); /* Set nIEN = disable device interrupts */ + hd = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ); + if (hd >= 0) break; + if (link->io.NumPorts1 == 0x20) { + if (ctl_base) + outb(0x02, ctl_base+0x10); + hd = idecs_register(io_base+0x10, ctl_base+0x10, + link->irq.AssignedIRQ); + if (hd >= 0) { + io_base += 0x10; ctl_base += 0x10; + break; + } + } + __set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(HZ/10); + } + + if (hd < 0) { + printk(KERN_NOTICE "ide_cs: ide_register() at 0x%03x & 0x%03x" + ", irq %u failed\n", io_base, ctl_base, + link->irq.AssignedIRQ); + goto failed; + } + + MOD_INC_USE_COUNT; + info->ndev = 1; + sprintf(info->node.dev_name, "hd%c", 'a'+(hd*2)); + info->node.major = ide_major[hd]; + info->node.minor = 0; + info->hd = hd; + link->dev = &info->node; + printk(KERN_INFO "ide_cs: %s: Vcc = %d.%d, Vpp = %d.%d\n", + info->node.dev_name, link->conf.Vcc/10, link->conf.Vcc%10, + link->conf.Vpp1/10, link->conf.Vpp1%10); + + link->state &= ~DEV_CONFIG_PENDING; + return; + +cs_failed: + cs_error(link->handle, last_fn, last_ret); +failed: + ide_release((u_long)link); + +} /* ide_config */ + +/*====================================================================== + + After a card is removed, ide_release() will unregister the net + device, and release the PCMCIA configuration. If the device is + still open, this will be postponed until it is closed. + +======================================================================*/ + +void ide_release(u_long arg) +{ + dev_link_t *link = (dev_link_t *)arg; + ide_info_t *info = link->priv; + + DEBUG(0, "ide_release(0x%p)\n", link); + + if (info->ndev) { + ide_unregister(info->hd); + MOD_DEC_USE_COUNT; + } + + request_region(link->io.BasePort1, link->io.NumPorts1,"ide-cs"); + if (link->io.NumPorts2) + request_region(link->io.BasePort2, link->io.NumPorts2,"ide-cs"); + + info->ndev = 0; + link->dev = NULL; + + CardServices(ReleaseConfiguration, link->handle); + CardServices(ReleaseIO, link->handle, &link->io); + CardServices(ReleaseIRQ, link->handle, &link->irq); + + link->state &= ~DEV_CONFIG; + +} /* ide_release */ + +/*====================================================================== + + The card status event handler. Mostly, this schedules other + stuff to run after an event is received. A CARD_REMOVAL event + also sets some flags to discourage the ide drivers from + talking to the ports. + +======================================================================*/ + +int ide_event(event_t event, int priority, + event_callback_args_t *args) +{ + dev_link_t *link = args->client_data; + + DEBUG(1, "ide_event(0x%06x)\n", event); + + switch (event) { + case CS_EVENT_CARD_REMOVAL: + link->state &= ~DEV_PRESENT; + if (link->state & DEV_CONFIG) + mod_timer(&link->release, jiffies + HZ/20); + break; + case CS_EVENT_CARD_INSERTION: + link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; + ide_config(link); + break; + case CS_EVENT_PM_SUSPEND: + link->state |= DEV_SUSPEND; + /* Fall through... */ + case CS_EVENT_RESET_PHYSICAL: + if (link->state & DEV_CONFIG) + CardServices(ReleaseConfiguration, link->handle); + break; + case CS_EVENT_PM_RESUME: + link->state &= ~DEV_SUSPEND; + /* Fall through... */ + case CS_EVENT_CARD_RESET: + if (DEV_OK(link)) + CardServices(RequestConfiguration, link->handle, &link->conf); + break; + } + return 0; +} /* ide_event */ + +/*====================================================================*/ + +static int __init init_ide_cs(void) +{ + servinfo_t serv; + DEBUG(0, "%s\n", version); + CardServices(GetCardServicesInfo, &serv); + if (serv.Revision != CS_RELEASE_CODE) { + printk(KERN_NOTICE "ide_cs: Card Services release " + "does not match!\n"); + return -1; + } + register_pccard_driver(&dev_info, &ide_attach, &ide_detach); + return 0; +} + +static void __exit exit_ide_cs(void) +{ + DEBUG(0, "ide_cs: unloading\n"); + unregister_pccard_driver(&dev_info); + while (dev_list != NULL) + ide_detach(dev_list); +} + +module_init(init_ide_cs); +module_exit(exit_ide_cs); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/macide.c linux.20pre5-ac2/drivers/ide/legacy/macide.c --- linux.20pre5/drivers/ide/legacy/macide.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/macide.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,153 @@ +/* + * linux/drivers/ide/macide.c -- Macintosh IDE Driver + * + * Copyright (C) 1998 by Michael Schmitz + * + * This driver was written based on information obtained from the MacOS IDE + * driver binary by Mikael Forselius + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define IDE_BASE 0x50F1A000 /* Base address of IDE controller */ + +/* + * Generic IDE registers as offsets from the base + * These match MkLinux so they should be correct. + */ + +#define IDE_DATA 0x00 +#define IDE_ERROR 0x04 /* see err-bits */ +#define IDE_NSECTOR 0x08 /* nr of sectors to read/write */ +#define IDE_SECTOR 0x0c /* starting sector */ +#define IDE_LCYL 0x10 /* starting cylinder */ +#define IDE_HCYL 0x14 /* high byte of starting cyl */ +#define IDE_SELECT 0x18 /* 101dhhhh , d=drive, hhhh=head */ +#define IDE_STATUS 0x1c /* see status-bits */ +#define IDE_CONTROL 0x38 /* control/altstatus */ + +/* + * Mac-specific registers + */ + +/* + * this register is odd; it doesn't seem to do much and it's + * not word-aligned like virtually every other hardware register + * on the Mac... + */ + +#define IDE_IFR 0x101 /* (0x101) IDE interrupt flags on Quadra: + * + * Bit 0+1: some interrupt flags + * Bit 2+3: some interrupt enable + * Bit 4: ?? + * Bit 5: IDE interrupt flag (any hwif) + * Bit 6: maybe IDE interrupt enable (any hwif) ?? + * Bit 7: Any interrupt condition + */ + +volatile unsigned char *ide_ifr = (unsigned char *) (IDE_BASE + IDE_IFR); + +static int macide_offsets[IDE_NR_PORTS] = { + IDE_DATA, IDE_ERROR, IDE_NSECTOR, IDE_SECTOR, IDE_LCYL, + IDE_HCYL, IDE_SELECT, IDE_STATUS, IDE_CONTROL +}; + +int macide_ack_intr(ide_hwif_t* hwif) +{ + if (*ide_ifr & 0x20) { + *ide_ifr &= ~0x20; + return 1; + } + return 0; +} + +#ifdef CONFIG_BLK_DEV_MAC_MEDIABAY +static void macide_mediabay_interrupt(int irq, void *dev_id, struct pt_regs *regs) +{ + int state = baboon->mb_status & 0x04; + + printk(KERN_INFO "macide: media bay %s detected\n", state? "removal":"insertion"); +} +#endif + +/* + * Probe for a Macintosh IDE interface + */ + +void macide_init(void) +{ + hw_regs_t hw; + int index = -1; + + switch (macintosh_config->ide_type) { + case MAC_IDE_QUADRA: + ide_setup_ports(&hw, (ide_ioreg_t)IDE_BASE, macide_offsets, + 0, 0, macide_ack_intr, +// quadra_ide_iops, + IRQ_NUBUS_F); + index = ide_register_hw(&hw, NULL); + break; + case MAC_IDE_PB: + ide_setup_ports(&hw, (ide_ioreg_t)IDE_BASE, macide_offsets, + 0, 0, macide_ack_intr, +// macide_pb_iops, + IRQ_NUBUS_C); + index = ide_register_hw(&hw, NULL); + break; + case MAC_IDE_BABOON: + ide_setup_ports(&hw, (ide_ioreg_t)BABOON_BASE, macide_offsets, + 0, 0, NULL, +// macide_baboon_iops, + IRQ_BABOON_1); + index = ide_register_hw(&hw, NULL); + if (index == -1) break; + if (macintosh_config->ident == MAC_MODEL_PB190) { + + /* Fix breakage in ide-disk.c: drive capacity */ + /* is not initialized for drives without a */ + /* hardware ID, and we can't get that without */ + /* probing the drive which freezes a 190. */ + + ide_drive_t *drive = &ide_hwifs[index].drives[0]; + drive->capacity = drive->cyl*drive->head*drive->sect; + +#ifdef CONFIG_BLK_DEV_MAC_MEDIABAY + request_irq(IRQ_BABOON_2, macide_mediabay_interrupt, + IRQ_FLG_FAST, "mediabay", + macide_mediabay_interrupt); +#endif + } + break; + + default: + return; + } + + if (index != -1) { + if (macintosh_config->ide_type == MAC_IDE_QUADRA) + printk(KERN_INFO "ide%d: Macintosh Quadra IDE interface\n", index); + else if (macintosh_config->ide_type == MAC_IDE_PB) + printk(KERN_INFO "ide%d: Macintosh Powerbook IDE interface\n", index); + else if (macintosh_config->ide_type == MAC_IDE_BABOON) + printk(KERN_INFO "ide%d: Macintosh Powerbook Baboon IDE interface\n", index); + else + printk(KERN_INFO "ide%d: Unknown Macintosh IDE interface\n", index); + } +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/Makefile linux.20pre5-ac2/drivers/ide/legacy/Makefile --- linux.20pre5/drivers/ide/legacy/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/Makefile 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,26 @@ + +O_TARGET := idedriver-legacy.o + +obj-y := +obj-m := + +obj-$(CONFIG_BLK_DEV_ALI14XX) += ali14xx.o +obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o +obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o +obj-$(CONFIG_BLK_DEV_PDC4030) += pdc4030.o +obj-$(CONFIG_BLK_DEV_QD65XX) += qd65xx.o +obj-$(CONFIG_BLK_DEV_UMC8672) += umc8672.o + +obj-$(CONFIG_BLK_DEV_BUDDHA) += buddha.o +obj-$(CONFIG_BLK_DEV_FALCON_IDE) += falconide.o +obj-$(CONFIG_BLK_DEV_GAYLE) += gayle.o +obj-$(CONFIG_BLK_DEV_MAC_IDE) += macide.o +obj-$(CONFIG_BLK_DEV_Q40IDE) += q40ide.o + +obj-$(CONFIG_BLK_DEV_IDECS) += ide-cs.o + +obj-$(CONFIG_BLK_DEV_HD) += hd.o + +EXTRA_CFLAGS := -I../ + +include $(TOPDIR)/Rules.make diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/pdc4030.c linux.20pre5-ac2/drivers/ide/legacy/pdc4030.c --- linux.20pre5/drivers/ide/legacy/pdc4030.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/pdc4030.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,858 @@ +/* -*- linux-c -*- + * linux/drivers/ide/pdc4030.c Version 0.90 May 27, 1999 + * + * Copyright (C) 1995-2002 Linus Torvalds & authors (see below) + */ + +/* + * Principal Author/Maintainer: Peter Denison + * + * This file provides support for the second port and cache of Promise + * IDE interfaces, e.g. DC4030VL, DC4030VL-1 and DC4030VL-2. + * + * Thanks are due to Mark Lord for advice and patiently answering stupid + * questions, and all those mugs^H^H^H^Hbrave souls who've tested this, + * especially Andre Hedrick. + * + * Version 0.01 Initial version, #include'd in ide.c rather than + * compiled separately. + * Reads use Promise commands, writes as before. Drives + * on second channel are read-only. + * Version 0.02 Writes working on second channel, reads on both + * channels. Writes fail under high load. Suspect + * transfers of >127 sectors don't work. + * Version 0.03 Brought into line with ide.c version 5.27. + * Other minor changes. + * Version 0.04 Updated for ide.c version 5.30 + * Changed initialization strategy + * Version 0.05 Kernel integration. -ml + * Version 0.06 Ooops. Add hwgroup to direct call of ide_intr() -ml + * Version 0.07 Added support for DC4030 variants + * Secondary interface autodetection + * Version 0.08 Renamed to pdc4030.c + * Version 0.09 Obsolete - never released - did manual write request + * splitting before max_sectors[major][minor] available. + * Version 0.10 Updated for 2.1 series of kernels + * Version 0.11 Updated for 2.3 series of kernels + * Autodetection code added. + * + * Version 0.90 Transition to BETA code. No lost/unexpected interrupts + */ + +/* + * Once you've compiled it in, you'll have to also enable the interface + * setup routine from the kernel command line, as in + * + * 'linux ide0=dc4030' or 'linux ide1=dc4030' + * + * It should now work as a second controller also ('ide1=dc4030') but only + * if you DON'T have BIOS V4.44, which has a bug. If you have this version + * and EPROM programming facilities, you need to fix 4 bytes: + * 2496: 81 81 + * 2497: 3E 3E + * 2498: 22 98 * + * 2499: 06 05 * + * 249A: F0 F0 + * 249B: 01 01 + * ... + * 24A7: 81 81 + * 24A8: 3E 3E + * 24A9: 22 98 * + * 24AA: 06 05 * + * 24AB: 70 70 + * 24AC: 01 01 + * + * As of January 1999, Promise Technology Inc. have finally supplied me with + * some technical information which has shed a glimmer of light on some of the + * problems I was having, especially with writes. + * + * There are still potential problems with the robustness and efficiency of + * this driver because I still don't understand what the card is doing with + * interrupts, however, it has been stable for a while with no reports of ill + * effects. + */ + +#define DEBUG_READ +#define DEBUG_WRITE +#define __PROMISE_4030 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "pdc4030.h" + +/* + * promise_selectproc() is invoked by ide.c + * in preparation for access to the specified drive. + */ +static void promise_selectproc (ide_drive_t *drive) +{ + unsigned int number; + + number = (HWIF(drive)->channel << 1) + drive->select.b.unit; + HWIF(drive)->OUTB(number, IDE_FEATURE_REG); +} + +/* + * pdc4030_cmd handles the set of vendor specific commands that are initiated + * by command F0. They all have the same success/failure notification - + * 'P' (=0x50) on success, 'p' (=0x70) on failure. + */ +int pdc4030_cmd(ide_drive_t *drive, u8 cmd) +{ + u32 timeout; + u8 status_val; + + promise_selectproc(drive); /* redundant? */ + HWIF(drive)->OUTB(0xF3, IDE_SECTOR_REG); + HWIF(drive)->OUTB(cmd, IDE_SELECT_REG); + HWIF(drive)->OUTB(PROMISE_EXTENDED_COMMAND, IDE_COMMAND_REG); + timeout = HZ * 10; + timeout += jiffies; + do { + if(time_after(jiffies, timeout)) { + return 2; /* device timed out */ + } + /* Delays at least 10ms to give interface a chance */ + mdelay(10); + status_val = HWIF(drive)->INB(IDE_SECTOR_REG); + } while (status_val != 0x50 && status_val != 0x70); + + if(status_val == 0x50) + return 0; /* device returned success */ + else + return 1; /* device returned failure */ +} + +/* + * pdc4030_identify sends a vendor-specific IDENTIFY command to the drive + */ +int pdc4030_identify(ide_drive_t *drive) +{ + return pdc4030_cmd(drive, PROMISE_IDENTIFY); +} + +int enable_promise_support; + +/* + * setup_pdc4030() + * Completes the setup of a Promise DC4030 controller card, once found. + */ +int __init setup_pdc4030(ide_hwif_t *hwif) +{ + ide_drive_t *drive; + ide_hwif_t *hwif2; + struct dc_ident ident; + int i; + ide_startstop_t startstop; + + if (!hwif) return 0; + + drive = &hwif->drives[0]; + hwif2 = &ide_hwifs[hwif->index+1]; + if (hwif->chipset == ide_pdc4030) /* we've already been found ! */ + return 1; + + if (hwif->INB(IDE_NSECTOR_REG) == 0xFF || + hwif->INB(IDE_SECTOR_REG) == 0xFF) { + return 0; + } + if (IDE_CONTROL_REG) + hwif->OUTB(0x08, IDE_CONTROL_REG); + if (pdc4030_cmd(drive,PROMISE_GET_CONFIG)) { + return 0; + } + if (ide_wait_stat(&startstop, drive,DATA_READY,BAD_W_STAT,WAIT_DRQ)) { + printk(KERN_INFO + "%s: Failed Promise read config!\n",hwif->name); + return 0; + } + hwif->ata_input_data(drive, &ident, SECTOR_WORDS); + if (ident.id[1] != 'P' || ident.id[0] != 'T') { + return 0; + } + printk(KERN_INFO "%s: Promise caching controller, ",hwif->name); + switch(ident.type) { + case 0x43: printk("DC4030VL-2, "); break; + case 0x41: printk("DC4030VL-1, "); break; + case 0x40: printk("DC4030VL, "); break; + default: + printk("unknown - type 0x%02x - please report!\n" + ,ident.type); + printk("Please e-mail the following data to " + "promise@pnd-pc.demon.co.uk along with\n" + "a description of your card and drives:\n"); + for (i=0; i < 0x90; i++) { + printk("%02x ", ((unsigned char *)&ident)[i]); + if ((i & 0x0f) == 0x0f) printk("\n"); + } + return 0; + } + printk("%dKB cache, ",(int)ident.cache_mem); + switch(ident.irq) { + case 0x00: hwif->irq = 14; break; + case 0x01: hwif->irq = 12; break; + default: hwif->irq = 15; break; + } + printk("on IRQ %d\n",hwif->irq); + + /* + * Once found and identified, we set up the next hwif in the array + * (hwif2 = ide_hwifs[hwif->index+1]) with the same io ports, irq + * and other settings as the main hwif. This gives us two "mated" + * hwifs pointing to the Promise card. + * + * We also have to shift the default values for the remaining + * interfaces "up by one" to make room for the second interface on the + * same set of values. + */ + + hwif->chipset = hwif2->chipset = ide_pdc4030; + hwif->mate = hwif2; + hwif2->mate = hwif; + hwif2->channel = 1; + hwif->rqsize = hwif2->rqsize = 127; + hwif->addressing = hwif2->addressing = 1; + hwif->selectproc = hwif2->selectproc = &promise_selectproc; + hwif->serialized = hwif2->serialized = 1; + /* DC4030 hosted drives need their own identify... */ + hwif->identify = hwif2->identify = &pdc4030_identify; + + /* Shift the remaining interfaces up by one */ + for (i=MAX_HWIFS-1 ; i > hwif->index+1 ; i--) { + ide_hwif_t *h = &ide_hwifs[i]; + +#ifdef DEBUG + printk(KERN_DEBUG "pdc4030: Shifting i/f %d values to i/f %d\n",i-1,i); +#endif /* DEBUG */ + ide_init_hwif_ports(&h->hw, (h-1)->io_ports[IDE_DATA_OFFSET], 0, NULL); + memcpy(h->io_ports, h->hw.io_ports, sizeof(h->io_ports)); + h->noprobe = (h-1)->noprobe; + } + ide_init_hwif_ports(&hwif2->hw, hwif->io_ports[IDE_DATA_OFFSET], 0, NULL); + memcpy(hwif2->io_ports, hwif->hw.io_ports, sizeof(hwif2->io_ports)); + hwif2->irq = hwif->irq; + hwif2->hw.irq = hwif->hw.irq = hwif->irq; + for (i=0; i<2 ; i++) { + hwif->drives[i].io_32bit = 3; + hwif2->drives[i].io_32bit = 3; + hwif->drives[i].keep_settings = 1; + hwif2->drives[i].keep_settings = 1; + if (!ident.current_tm[i].cyl) + hwif->drives[i].noprobe = 1; + if (!ident.current_tm[i+2].cyl) + hwif2->drives[i].noprobe = 1; + } +#ifndef HWIF_PROBE_CLASSIC_METHOD + probe_hwif_init(&ide_hwifs[hwif->index]); + probe_hwif_init(&ide_hwifs[hwif2->index]); +#endif /* HWIF_PROBE_CLASSIC_METHOD */ + + return 1; +} + +/* + * detect_pdc4030() + * Tests for the presence of a DC4030 Promise card on this interface + * Returns: 1 if found, 0 if not found + */ +int __init detect_pdc4030(ide_hwif_t *hwif) +{ + ide_drive_t *drive = &hwif->drives[0]; + + if (IDE_DATA_REG == 0) { /* Skip test for non-existent interface */ + return 0; + } + hwif->OUTB(0xF3, IDE_SECTOR_REG); + hwif->OUTB(0x14, IDE_SELECT_REG); + hwif->OUTB(PROMISE_EXTENDED_COMMAND, IDE_COMMAND_REG); + + ide_delay_50ms(); + + if (hwif->INB(IDE_ERROR_REG) == 'P' && + hwif->INB(IDE_NSECTOR_REG) == 'T' && + hwif->INB(IDE_SECTOR_REG) == 'I') { + return 1; + } else { + return 0; + } +} + + +#ifndef MODULE +void __init ide_probe_for_pdc4030(void) +#else +int ide_probe_for_pdc4030(void) +#endif +{ + unsigned int index; + ide_hwif_t *hwif; + +#ifndef MODULE + if (enable_promise_support == 0) + return; +#endif + + for (index = 0; index < MAX_HWIFS; index++) { + hwif = &ide_hwifs[index]; + if (hwif->chipset == ide_unknown && detect_pdc4030(hwif)) { +#ifndef MODULE + setup_pdc4030(hwif); +#else + return setup_pdc4030(hwif); +#endif + } + } +#ifdef MODULE + return 0; +#endif +} + +void __init release_pdc4030(ide_hwif_t *hwif, ide_hwif_t *mate) +{ + hwif->chipset = ide_unknown; + hwif->selectproc = NULL; + hwif->serialized = 0; + hwif->drives[0].io_32bit = 0; + hwif->drives[1].io_32bit = 0; + hwif->drives[0].keep_settings = 0; + hwif->drives[1].keep_settings = 0; + hwif->drives[0].noprobe = 0; + hwif->drives[1].noprobe = 0; + + if (mate != NULL) { + mate->chipset = ide_unknown; + mate->selectproc = NULL; + mate->serialized = 0; + mate->drives[0].io_32bit = 0; + mate->drives[1].io_32bit = 0; + mate->drives[0].keep_settings = 0; + mate->drives[1].keep_settings = 0; + mate->drives[0].noprobe = 0; + mate->drives[1].noprobe = 0; + } +} + +#ifndef MODULE +/* + * init_pdc4030: + * + * called by ide.c when parsing command line + */ + +void __init init_pdc4030(void) +{ + enable_promise_support = 1; +} + +#else + +MODULE_AUTHOR("Peter Denison"); +MODULE_DESCRIPTION("Support of Promise 4030 VLB series IDE chipsets"); +MODULE_LICENSE("GPL"); + +int __init pdc4030_mod_init(void) +{ + if (enable_promise_support == 0) + enable_promise_support = 1; + + if (!ide_probe_for_pdc4030()) + return -ENODEV; + return 0; +} +module_init(pdc4030_mod_init); + +void __init pdc4030_mod_exit(void) +{ + unsigned int index; + ide_hwif_t *hwif; + + if (enable_promise_support == 0) + return; + + for (index = 0; index < MAX_HWIFS; index++) { + hwif = &ide_hwifs[index]; + if (hwif->chipset == ide_pdc4030) { + ide_hwif_t *mate = &ide_hwifs[hwif->index+1]; + if (mate->chipset == ide_pdc4030) + release_pdc4030(hwif, mate); + else + release_pdc4030(hwif, NULL); + } + } + enable_promise_support = 0; +} +module_exit(pdc4030_mod_exit); +#endif + +/* + * promise_read_intr() is the handler for disk read/multread interrupts + */ +static ide_startstop_t promise_read_intr (ide_drive_t *drive) +{ + int total_remaining; + unsigned int sectors_left, sectors_avail, nsect; + struct request *rq; + ata_status_t status; +#ifdef CONFIG_IDE_TASKFILE_IO + unsigned long flags; + char *to; +#endif /* CONFIG_IDE_TASKFILE_IO */ + + status.all = HWIF(drive)->INB(IDE_STATUS_REG); + if (!OK_STAT(status.all, DATA_READY, BAD_R_STAT)) + return DRIVER(drive)->error(drive, + "promise_read_intr", status.all); + +read_again: + do { + sectors_left = HWIF(drive)->INB(IDE_NSECTOR_REG); + HWIF(drive)->INB(IDE_SECTOR_REG); + } while (HWIF(drive)->INB(IDE_NSECTOR_REG) != sectors_left); + rq = HWGROUP(drive)->rq; + sectors_avail = rq->nr_sectors - sectors_left; + if (!sectors_avail) + goto read_again; + +read_next: + rq = HWGROUP(drive)->rq; + nsect = rq->current_nr_sectors; + if (nsect > sectors_avail) + nsect = sectors_avail; + sectors_avail -= nsect; +#ifdef CONFIG_IDE_TASKFILE_IO + to = ide_map_buffer(rq, &flags); + HWIF(drive)->ata_input_data(drive, to, nsect * SECTOR_WORDS); +#else /* !CONFIG_IDE_TASKFILE_IO */ + HWIF(drive)->ata_input_data(drive, rq->buffer, nsect * SECTOR_WORDS); +#endif /* CONFIG_IDE_TASKFILE_IO */ + +#ifdef DEBUG_READ + printk(KERN_DEBUG "%s: promise_read: sectors(%ld-%ld), " + "buf=0x%08lx, rem=%ld\n", drive->name, rq->sector, + rq->sector+nsect-1, +#ifdef CONFIG_IDE_TASKFILE_IO + (unsigned long) to, +#else /* !CONFIG_IDE_TASKFILE_IO */ + (unsigned long) rq->buffer, +#endif /* CONFIG_IDE_TASKFILE_IO */ + rq->nr_sectors-nsect); +#endif /* DEBUG_READ */ + +#ifdef CONFIG_IDE_TASKFILE_IO + ide_unmap_buffer(to, &flags); +#else /* !CONFIG_IDE_TASKFILE_IO */ + rq->buffer += nsect<<9; +#endif /* CONFIG_IDE_TASKFILE_IO */ + rq->sector += nsect; + rq->errors = 0; + rq->nr_sectors -= nsect; + total_remaining = rq->nr_sectors; + if ((rq->current_nr_sectors -= nsect) <= 0) { + DRIVER(drive)->end_request(drive, 1); + } +/* + * Now the data has been read in, do the following: + * + * if there are still sectors left in the request, + * if we know there are still sectors available from the interface, + * go back and read the next bit of the request. + * else if DRQ is asserted, there are more sectors available, so + * go back and find out how many, then read them in. + * else if BUSY is asserted, we are going to get an interrupt, so + * set the handler for the interrupt and just return + */ + if (total_remaining > 0) { + if (sectors_avail) + goto read_next; + status.all = HWIF(drive)->INB(IDE_STATUS_REG); + if (status.b.drq) + goto read_again; + if (status.b.bsy) { + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, + &promise_read_intr, + WAIT_CMD, + NULL); +#ifdef DEBUG_READ + printk(KERN_DEBUG "%s: promise_read: waiting for" + "interrupt\n", drive->name); +#endif /* DEBUG_READ */ + return ide_started; + } + printk(KERN_ERR "%s: Eeek! promise_read_intr: sectors left " + "!DRQ !BUSY\n", drive->name); + return DRIVER(drive)->error(drive, + "promise read intr", status.all); + } + return ide_stopped; +} + +/* + * promise_complete_pollfunc() + * This is the polling function for waiting (nicely!) until drive stops + * being busy. It is invoked at the end of a write, after the previous poll + * has finished. + * + * Once not busy, the end request is called. + */ +static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive) +{ + ide_hwgroup_t *hwgroup = HWGROUP(drive); + struct request *rq = hwgroup->rq; + int i; + + if ((HWIF(drive)->INB(IDE_STATUS_REG)) & BUSY_STAT) { + if (time_before(jiffies, hwgroup->poll_timeout)) { + if (hwgroup->handler != NULL) + BUG(); + ide_set_handler(drive, + &promise_complete_pollfunc, + HZ/100, + NULL); + return ide_started; /* continue polling... */ + } + hwgroup->poll_timeout = 0; + printk(KERN_ERR "%s: completion timeout - still busy!\n", + drive->name); + return DRIVER(drive)->error(drive, "busy timeout", + HWIF(drive)->INB(IDE_STATUS_REG)); + } + + hwgroup->poll_timeout = 0; +#ifdef DEBUG_WRITE + printk(KERN_DEBUG "%s: Write complete - end_request\n", drive->name); +#endif /* DEBUG_WRITE */ + for (i = rq->nr_sectors; i > 0; ) { + i -= rq->current_nr_sectors; + DRIVER(drive)->end_request(drive, 1); + } + return ide_stopped; +} + +/* + * promise_multwrite() transfers a block of up to mcount sectors of data + * to a drive as part of a disk multiple-sector write operation. + * + * Returns 0 on success. + * + * Note that we may be called from two contexts - the do_rw_disk context + * and IRQ context. The IRQ can happen any time after we've output the + * full "mcount" number of sectors, so we must make sure we update the + * state _before_ we output the final part of the data! + */ +int promise_multwrite (ide_drive_t *drive, unsigned int mcount) +{ + ide_hwgroup_t *hwgroup = HWGROUP(drive); + struct request *rq = &hwgroup->wrq; + + do { + char *buffer; + int nsect = rq->current_nr_sectors; +#ifdef CONFIG_IDE_TASKFILE_IO + unsigned long flags; +#endif /* CONFIG_IDE_TASKFILE_IO */ + + if (nsect > mcount) + nsect = mcount; + mcount -= nsect; +#ifdef CONFIG_IDE_TASKFILE_IO + buffer = ide_map_buffer(rq, &flags); + rq->sector += nsect; +#else /* !CONFIG_IDE_TASKFILE_IO */ + buffer = rq->buffer; + + rq->sector += nsect; + rq->buffer += nsect << 9; +#endif /* CONFIG_IDE_TASKFILE_IO */ + rq->nr_sectors -= nsect; + rq->current_nr_sectors -= nsect; + + /* Do we move to the next bh after this? */ + if (!rq->current_nr_sectors) { + struct buffer_head *bh = rq->bh->b_reqnext; + + /* end early early we ran out of requests */ + if (!bh) { + mcount = 0; + } else { + rq->bh = bh; + rq->current_nr_sectors = bh->b_size >> 9; + rq->hard_cur_sectors = rq->current_nr_sectors; + rq->buffer = bh->b_data; + } + } + + /* + * Ok, we're all setup for the interrupt + * re-entering us on the last transfer. + */ + taskfile_output_data(drive, buffer, nsect<<7); +#ifdef CONFIG_IDE_TASKFILE_IO + ide_unmap_buffer(buffer, &flags); +#endif /* CONFIG_IDE_TASKFILE_IO */ + } while (mcount); + + return 0; +} + +/* + * promise_write_pollfunc() is the handler for disk write completion polling. + */ +static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive) +{ + ide_hwgroup_t *hwgroup = HWGROUP(drive); + + if (HWIF(drive)->INB(IDE_NSECTOR_REG) != 0) { + if (time_before(jiffies, hwgroup->poll_timeout)) { + if (hwgroup->handler != NULL) + BUG(); + ide_set_handler(drive, + &promise_write_pollfunc, + HZ/100, + NULL); + return ide_started; /* continue polling... */ + } + hwgroup->poll_timeout = 0; + printk(KERN_ERR "%s: write timed-out!\n",drive->name); + return DRIVER(drive)->error(drive, "write timeout", + HWIF(drive)->INB(IDE_STATUS_REG)); + } + + /* + * Now write out last 4 sectors and poll for not BUSY + */ + promise_multwrite(drive, 4); + hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; + if (hwgroup->handler != NULL) + BUG(); + ide_set_handler(drive, &promise_complete_pollfunc, HZ/100, NULL); +#ifdef DEBUG_WRITE + printk(KERN_DEBUG "%s: Done last 4 sectors - status = %02x\n", + drive->name, HWIF(drive)->INB(IDE_STATUS_REG)); +#endif /* DEBUG_WRITE */ + return ide_started; +} + +/* + * promise_write() transfers a block of one or more sectors of data to a + * drive as part of a disk write operation. All but 4 sectors are transferred + * in the first attempt, then the interface is polled (nicely!) for completion + * before the final 4 sectors are transferred. There is no interrupt generated + * on writes (at least on the DC4030VL-2), we just have to poll for NOT BUSY. + */ +static ide_startstop_t promise_write (ide_drive_t *drive) +{ + ide_hwgroup_t *hwgroup = HWGROUP(drive); + struct request *rq = &hwgroup->wrq; + +#ifdef DEBUG_WRITE + printk(KERN_DEBUG "%s: promise_write: sectors(%ld-%ld), " + "buffer=%p\n", drive->name, rq->sector, + rq->sector + rq->nr_sectors - 1, rq->buffer); +#endif /* DEBUG_WRITE */ + + /* + * If there are more than 4 sectors to transfer, do n-4 then go into + * the polling strategy as defined above. + */ + if (rq->nr_sectors > 4) { + if (promise_multwrite(drive, rq->nr_sectors - 4)) + return ide_stopped; + hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; + if (hwgroup->handler != NULL) /* paranoia check */ + BUG(); + ide_set_handler (drive, &promise_write_pollfunc, HZ/100, NULL); + return ide_started; + } else { + /* + * There are 4 or fewer sectors to transfer, do them all in one go + * and wait for NOT BUSY. + */ + if (promise_multwrite(drive, rq->nr_sectors)) + return ide_stopped; + hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; + if (hwgroup->handler != NULL) + BUG(); + ide_set_handler(drive, + &promise_complete_pollfunc, + HZ/100, + NULL); + +#ifdef DEBUG_WRITE + printk(KERN_DEBUG "%s: promise_write: <= 4 sectors, " + "status = %02x\n", drive->name, + HWIF(drive)->INB(IDE_STATUS_REG)); +#endif /* DEBUG_WRITE */ + return ide_started; + } +} + +/* + * do_pdc4030_io() is called from promise_rw_disk, having had the block number + * already set up. It issues a READ or WRITE command to the Promise + * controller, assuming LBA has been used to set up the block number. + */ +#ifndef CONFIG_IDE_TASKFILE_IO +ide_startstop_t do_pdc4030_io (ide_drive_t *drive, struct request *rq) +{ +#else /* CONFIG_IDE_TASKFILE_IO */ +ide_startstop_t do_pdc4030_io (ide_drive_t *drive, ide_task_t *task) +{ + struct request *rq = HWGROUP(drive)->rq; + task_struct_t *taskfile = (task_struct_t *) task->tfRegister; +#endif /* CONFIG_IDE_TASKFILE_IO */ + ide_startstop_t startstop; + unsigned long timeout; + u8 stat = 0; + +#ifdef CONFIG_IDE_TASKFILE_IO + if (IDE_CONTROL_REG) + HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG); /* clear nIEN */ + SELECT_MASK(drive, 0); + HWIF(drive)->OUTB(taskfile->feature, IDE_FEATURE_REG); + HWIF(drive)->OUTB(taskfile->sector_count, IDE_NSECTOR_REG); + /* refers to number of sectors to transfer */ + HWIF(drive)->OUTB(taskfile->sector_number, IDE_SECTOR_REG); + /* refers to sector offset or start sector */ + HWIF(drive)->OUTB(taskfile->low_cylinder, IDE_LCYL_REG); + HWIF(drive)->OUTB(taskfile->high_cylinder, IDE_HCYL_REG); + HWIF(drive)->OUTB(taskfile->device_head, IDE_SELECT_REG); + HWIF(drive)->OUTB(taskfile->command, IDE_COMMAND_REG); +#endif /* CONFIG_IDE_TASKFILE_IO */ + + switch(rq->cmd) { + case READ: +#ifndef CONFIG_IDE_TASKFILE_IO + HWIF(drive)->OUTB(PROMISE_READ, IDE_COMMAND_REG); +#endif /* CONFIG_IDE_TASKFILE_IO */ +/* + * The card's behaviour is odd at this point. If the data is + * available, DRQ will be true, and no interrupt will be + * generated by the card. If this is the case, we need to call the + * "interrupt" handler (promise_read_intr) directly. Otherwise, if + * an interrupt is going to occur, bit0 of the SELECT register will + * be high, so we can set the handler the just return and be interrupted. + * If neither of these is the case, we wait for up to 50ms (badly I'm + * afraid!) until one of them is. + */ + timeout = jiffies + HZ/20; /* 50ms wait */ + do { + stat = HWIF(drive)->INB(IDE_STATUS_REG); + if (stat & DRQ_STAT) { + udelay(1); + return promise_read_intr(drive); + } + if (HWIF(drive)->INB(IDE_SELECT_REG) & 0x01) { +#ifdef DEBUG_READ + printk(KERN_DEBUG "%s: read: waiting for " + "interrupt\n", drive->name); +#endif /* DEBUG_READ */ + ide_set_handler(drive, + &promise_read_intr, + WAIT_CMD, + NULL); + return ide_started; + } + udelay(1); + } while (time_before(jiffies, timeout)); + + printk(KERN_ERR "%s: reading: No DRQ and not " + "waiting - Odd!\n", drive->name); + return ide_stopped; + case WRITE: +#ifndef CONFIG_IDE_TASKFILE_IO + HWIF(drive)->OUTB(PROMISE_WRITE, IDE_COMMAND_REG); +#endif /* CONFIG_IDE_TASKFILE_IO */ + if (ide_wait_stat(&startstop, drive, DATA_READY, + drive->bad_wstat, WAIT_DRQ)) { + printk(KERN_ERR "%s: no DRQ after issuing " + "PROMISE_WRITE\n", drive->name); + return startstop; + } + if (!drive->unmask) + local_irq_disable(); + HWGROUP(drive)->wrq = *rq; /* scratchpad */ + return promise_write(drive); + default: + printk("KERN_WARNING %s: bad command: %d\n", + drive->name, rq->cmd); + DRIVER(drive)->end_request(drive, 0); + return ide_stopped; + } +} + +ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block) +{ + /* The four drives on the two logical (one physical) interfaces + are distinguished by writing the drive number (0-3) to the + Feature register. + FIXME: Is promise_selectproc now redundant?? + */ + int drive_number = (HWIF(drive)->channel << 1) + drive->select.b.unit; +#ifndef CONFIG_IDE_TASKFILE_IO + ide_hwif_t *hwif = HWIF(drive); + + BUG_ON(rq->nr_sectors > 127); + + if (IDE_CONTROL_REG) + hwif->OUTB(drive->ctl, IDE_CONTROL_REG); + +#ifdef DEBUG + printk("%s: %sing: LBAsect=%ld, sectors=%ld, " + "buffer=0x%08lx\n", drive->name, + (rq->cmd==READ)?"read":"writ", block, + rq->nr_sectors, (unsigned long) rq->buffer); +#endif + hwif->OUTB(drive_number, IDE_FEATURE_REG); + hwif->OUTB(rq->nr_sectors, IDE_NSECTOR_REG); + hwif->OUTB(block,IDE_SECTOR_REG); + hwif->OUTB(block>>=8,IDE_LCYL_REG); + hwif->OUTB(block>>=8,IDE_HCYL_REG); + hwif->OUTB(((block>>8)&0x0f)|drive->select.all,IDE_SELECT_REG); + + return do_pdc4030_io(drive, rq); + +#else /* CONFIG_IDE_TASKFILE_IO */ + + struct hd_drive_task_hdr taskfile; + ide_task_t args; + + memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); + + taskfile.feature = drive_number; + taskfile.sector_count = rq->nr_sectors; + taskfile.sector_number = block; + taskfile.low_cylinder = (block>>=8); + taskfile.high_cylinder = (block>>=8); + taskfile.device_head = ((block>>8)&0x0f)|drive->select.all; + taskfile.command = (rq->cmd==READ)?PROMISE_READ:PROMISE_WRITE; + + memcpy(args.tfRegister, &taskfile, sizeof(struct hd_drive_task_hdr)); + memset(args.hobRegister, 0, sizeof(struct hd_drive_hob_hdr)); + /* We can't call ide_cmd_type_parser here, since it won't understand + our command, but that doesn't matter, since we don't use the + generic interrupt handlers either. Setup the bits of args that we + do need. + */ + args.handler = NULL; + args.rq = (struct request *) rq; + rq->special = (ide_task_t *)&args; + + return do_pdc4030_io(drive, &args); +#endif /* CONFIG_IDE_TASKFILE_IO */ +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/pdc4030.h linux.20pre5-ac2/drivers/ide/legacy/pdc4030.h --- linux.20pre5/drivers/ide/legacy/pdc4030.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/pdc4030.h 2002-09-02 14:22:35.000000000 +0100 @@ -0,0 +1,70 @@ +/* + * linux/drivers/ide/pdc4030.h + * + * Copyright (C) 1995-1998 Linus Torvalds & authors + */ + +/* + * Principal author: Peter Denison + */ + +#ifndef IDE_PROMISE_H +#define IDE_PROMISE_H + +#include + +#ifndef CONFIG_BLK_DEV_PDC4030 +# ifdef _IDE_DISK + +# define IS_PDC4030_DRIVE (0) /* auto-NULLs out pdc4030 code */ + +ide_startstop_t promise_rw_disk(ide_drive_t *, struct request *, unsigned long); + +ide_startstop_t promise_rw_disk(ide_drive_t *drive, struct request *rq, unsigned long block) +{ + return ide_stopped; +} +# endif /* _IDE_DISK */ +#else /* CONFIG_BLK_DEV_PDC4030 */ +# ifdef _IDE_DISK +# define IS_PDC4030_DRIVE (HWIF(drive)->chipset == ide_pdc4030) + +ide_startstop_t promise_rw_disk(ide_drive_t *, struct request *, unsigned long); + +# endif /* _IDE_DISK */ +#endif /* CONFIG_BLK_DEV_PDC4030 */ + +#ifdef __PROMISE_4030 +#define PROMISE_EXTENDED_COMMAND 0xF0 +#define PROMISE_READ 0xF2 +#define PROMISE_WRITE 0xF3 +/* Extended commands - main command code = 0xf0 */ +#define PROMISE_GET_CONFIG 0x10 +#define PROMISE_IDENTIFY 0x20 + +struct translation_mode { + u16 cyl; + u8 head; + u8 sect; +}; + +struct dc_ident { + u8 type; + u8 unknown1; + u8 hw_revision; + u8 firmware_major; + u8 firmware_minor; + u8 bios_address; + u8 irq; + u8 unknown2; + u16 cache_mem; + u16 unknown3; + u8 id[2]; + u16 info; + struct translation_mode current_tm[4]; + u8 pad[SECTOR_WORDS*4 - 32]; +}; + +#endif /* __PROMISE_4030 */ + +#endif /* IDE_PROMISE_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/q40ide.c linux.20pre5-ac2/drivers/ide/legacy/q40ide.c --- linux.20pre5/drivers/ide/legacy/q40ide.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/q40ide.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,93 @@ +/* + * linux/drivers/ide/q40ide.c -- Q40 I/O port IDE Driver + * + * (c) Richard Zidlicky + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + * + * + */ + +#include +#include +#include +#include +#include + +#include + + /* + * Bases of the IDE interfaces + */ + +#define Q40IDE_NUM_HWIFS 2 + +#define PCIDE_BASE1 0x1f0 +#define PCIDE_BASE2 0x170 +#define PCIDE_BASE3 0x1e8 +#define PCIDE_BASE4 0x168 +#define PCIDE_BASE5 0x1e0 +#define PCIDE_BASE6 0x160 + +static const q40ide_ioreg_t pcide_bases[Q40IDE_NUM_HWIFS] = { + PCIDE_BASE1, PCIDE_BASE2, /* PCIDE_BASE3, PCIDE_BASE4 , PCIDE_BASE5, + PCIDE_BASE6 */ +}; + + + /* + * Offsets from one of the above bases + */ + + +/* HD_DATA was redefined in asm-m68k/ide.h */ +#undef HD_DATA +#define HD_DATA 0x1f0 + + +#define PCIDE_REG(x) ((q40ide_ioreg_t)(HD_##x-PCIDE_BASE1)) + +static const int pcide_offsets[IDE_NR_PORTS] = { + PCIDE_REG(DATA), PCIDE_REG(ERROR), PCIDE_REG(NSECTOR), PCIDE_REG(SECTOR), + PCIDE_REG(LCYL), PCIDE_REG(HCYL), PCIDE_REG(CURRENT), PCIDE_REG(STATUS), + PCIDE_REG(CMD) +}; + +static int q40ide_default_irq(q40ide_ioreg_t base) +{ + switch (base) { + case 0x1f0: return 14; + case 0x170: return 15; + case 0x1e8: return 11; + default: + return 0; + } +} + + + + /* + * Probe for Q40 IDE interfaces + */ + +void q40ide_init(void) +{ + int i; + + if (!MACH_IS_Q40) + return ; + + for (i = 0; i < Q40IDE_NUM_HWIFS; i++) { + hw_regs_t hw; + + ide_setup_ports(&hw,(ide_ioreg_t) pcide_bases[i], (int *)pcide_offsets, + pcide_bases[i]+0x206, + 0, NULL, +// pcide_iops, + q40ide_default_irq(pcide_bases[i])); + ide_register_hw(&hw, NULL); + } +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/qd65xx.c linux.20pre5-ac2/drivers/ide/legacy/qd65xx.c --- linux.20pre5/drivers/ide/legacy/qd65xx.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/qd65xx.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,523 @@ +/* + * linux/drivers/ide/qd65xx.c Version 0.07 Sep 30, 2001 + * + * Copyright (C) 1996-2001 Linus Torvalds & author (see below) + */ + +/* + * Version 0.03 Cleaned auto-tune, added probe + * Version 0.04 Added second channel tuning + * Version 0.05 Enhanced tuning ; added qd6500 support + * Version 0.06 Added dos driver's list + * Version 0.07 Second channel bug fix + * + * QDI QD6500/QD6580 EIDE controller fast support + * + * Please set local bus speed using kernel parameter idebus + * for example, "idebus=33" stands for 33Mhz VLbus + * To activate controller support, use "ide0=qd65xx" + * To enable tuning, use "ide0=autotune" + * To enable second channel tuning (qd6580 only), use "ide1=autotune" + */ + +/* + * Rewritten from the work of Colten Edwards by + * Samuel Thibault + */ + +#undef REALLY_SLOW_IO /* most systems can safely undef this */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef CONFIG_BLK_DEV_QD65XX_MODULE +# define _IDE_C +# include "ide_modes.h" +# undef _IDE_C +#else +# include "ide_modes.h" +#endif /* CONFIG_BLK_DEV_QD65XX_MODULE */ + +#include "qd65xx.h" + +/* + * I/O ports are 0x30-0x31 (and 0x32-0x33 for qd6580) + * or 0xb0-0xb1 (and 0xb2-0xb3 for qd6580) + * -- qd6500 is a single IDE interface + * -- qd6580 is a dual IDE interface + * + * More research on qd6580 being done by willmore@cig.mot.com (David) + * More Information given by Petr Soucek (petr@ryston.cz) + * http://www.ryston.cz/petr/vlb + */ + +/* + * base: Timer1 + * + * + * base+0x01: Config (R/O) + * + * bit 0: ide baseport: 1 = 0x1f0 ; 0 = 0x170 (only useful for qd6500) + * bit 1: qd65xx baseport: 1 = 0xb0 ; 0 = 0x30 + * bit 2: ID3: bus speed: 1 = <=33MHz ; 0 = >33MHz + * bit 3: qd6500: 1 = disabled, 0 = enabled + * qd6580: 1 + * upper nibble: + * qd6500: 1100 + * qd6580: either 1010 or 0101 + * + * + * base+0x02: Timer2 (qd6580 only) + * + * + * base+0x03: Control (qd6580 only) + * + * bits 0-3 must always be set 1 + * bit 4 must be set 1, but is set 0 by dos driver while measuring vlb clock + * bit 0 : 1 = Only primary port enabled : channel 0 for hda, channel 1 for hdb + * 0 = Primary and Secondary ports enabled : channel 0 for hda & hdb + * channel 1 for hdc & hdd + * bit 1 : 1 = only disks on primary port + * 0 = disks & ATAPI devices on primary port + * bit 2-4 : always 0 + * bit 5 : status, but of what ? + * bit 6 : always set 1 by dos driver + * bit 7 : set 1 for non-ATAPI devices on primary port + * (maybe read-ahead and post-write buffer ?) + */ + +static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer */ + +static void qd_write_reg (u8 content, u8 reg) +{ + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + outb(content,reg); + spin_unlock_irqrestore(&io_request_lock, flags); +} + +u8 __init qd_read_reg (u8 reg) +{ + unsigned long flags; + u8 read; + + spin_lock_irqsave(&io_request_lock, flags); + read = inb(reg); + spin_unlock_irqrestore(&io_request_lock, flags); + return read; +} + +/* + * qd_select: + * + * This routine is invoked from ide.c to prepare for access to a given drive. + */ + +static void qd_select (ide_drive_t *drive) +{ + u8 index = (( (QD_TIMREG(drive)) & 0x80 ) >> 7) | + (QD_TIMREG(drive) & 0x02); + + if (timings[index] != QD_TIMING(drive)) + qd_write_reg(timings[index] = QD_TIMING(drive), QD_TIMREG(drive)); +} + +/* + * qd6500_compute_timing + * + * computes the timing value where + * lower nibble represents active time, in count of VLB clocks + * upper nibble represents recovery time, in count of VLB clocks + */ + +static u8 qd6500_compute_timing (ide_hwif_t *hwif, int active_time, int recovery_time) +{ + u8 active_cycle,recovery_cycle; + + if (system_bus_clock()<=33) { + active_cycle = 9 - IDE_IN(active_time * system_bus_clock() / 1000 + 1, 2, 9); + recovery_cycle = 15 - IDE_IN(recovery_time * system_bus_clock() / 1000 + 1, 0, 15); + } else { + active_cycle = 8 - IDE_IN(active_time * system_bus_clock() / 1000 + 1, 1, 8); + recovery_cycle = 18 - IDE_IN(recovery_time * system_bus_clock() / 1000 + 1, 3, 18); + } + + return((recovery_cycle<<4) | 0x08 | active_cycle); +} + +/* + * qd6580_compute_timing + * + * idem for qd6580 + */ + +static u8 qd6580_compute_timing (int active_time, int recovery_time) +{ + u8 active_cycle = 17 - IDE_IN(active_time * system_bus_clock() / 1000 + 1, 2, 17); + u8 recovery_cycle = 15 - IDE_IN(recovery_time * system_bus_clock() / 1000 + 1, 2, 15); + + return((recovery_cycle<<4) | active_cycle); +} + +/* + * qd_find_disk_type + * + * tries to find timing from dos driver's table + */ + +static int qd_find_disk_type (ide_drive_t *drive, + int *active_time, int *recovery_time) +{ + struct qd65xx_timing_s *p; + char model[40]; + + if (!*drive->id->model) return 0; + + strncpy(model,drive->id->model,40); + ide_fixstring(model,40,1); /* byte-swap */ + + for (p = qd65xx_timing ; p->offset != -1 ; p++) { + if (!strncmp(p->model, model+p->offset, 4)) { + printk(KERN_DEBUG "%s: listed !\n", drive->name); + *active_time = p->active; + *recovery_time = p->recovery; + return 1; + } + } + return 0; +} + +/* + * qd_timing_ok: + * + * check whether timings don't conflict + */ + +static int qd_timing_ok (ide_drive_t drives[]) +{ + return (IDE_IMPLY(drives[0].present && drives[1].present, + IDE_IMPLY(QD_TIMREG(drives) == QD_TIMREG(drives+1), + QD_TIMING(drives) == QD_TIMING(drives+1)))); + /* if same timing register, must be same timing */ +} + +/* + * qd_set_timing: + * + * records the timing, and enables selectproc as needed + */ + +static void qd_set_timing (ide_drive_t *drive, u8 timing) +{ + ide_hwif_t *hwif = HWIF(drive); + + drive->drive_data &= 0xff00; + drive->drive_data |= timing; + if (qd_timing_ok(hwif->drives)) { + qd_select(drive); /* selects once */ + hwif->selectproc = NULL; + } else + hwif->selectproc = &qd_select; + + printk(KERN_DEBUG "%s: %#x\n", drive->name, timing); +} + +/* + * qd6500_tune_drive + */ + +static void qd6500_tune_drive (ide_drive_t *drive, u8 pio) +{ + int active_time = 175; + int recovery_time = 415; /* worst case values from the dos driver */ + + if (drive->id && !qd_find_disk_type(drive, &active_time, &recovery_time) + && drive->id->tPIO && (drive->id->field_valid & 0x02) + && drive->id->eide_pio >= 240) { + + printk(KERN_INFO "%s: PIO mode%d\n", drive->name, + drive->id->tPIO); + active_time = 110; + recovery_time = drive->id->eide_pio - 120; + } + + qd_set_timing(drive, qd6500_compute_timing(HWIF(drive), active_time, recovery_time)); +} + +/* + * qd6580_tune_drive + */ + +static void qd6580_tune_drive (ide_drive_t *drive, u8 pio) +{ + ide_pio_data_t d; + int base = HWIF(drive)->select_data; + int active_time = 175; + int recovery_time = 415; /* worst case values from the dos driver */ + + if (drive->id && !qd_find_disk_type(drive, &active_time, &recovery_time)) { + pio = ide_get_best_pio_mode(drive, pio, 255, &d); + pio = IDE_MIN(pio,4); + + switch (pio) { + case 0: break; + case 3: + if (d.cycle_time >= 110) { + active_time = 86; + recovery_time = d.cycle_time - 102; + } else + printk(KERN_WARNING "%s: Strange recovery time !\n",drive->name); + break; + case 4: + if (d.cycle_time >= 69) { + active_time = 70; + recovery_time = d.cycle_time - 61; + } else + printk(KERN_WARNING "%s: Strange recovery time !\n",drive->name); + break; + default: + if (d.cycle_time >= 180) { + active_time = 110; + recovery_time = d.cycle_time - 120; + } else { + active_time = ide_pio_timings[pio].active_time; + recovery_time = d.cycle_time + -active_time; + } + } + printk(KERN_INFO "%s: PIO mode%d\n", drive->name,pio); + } + + if (!HWIF(drive)->channel && drive->media != ide_disk) { + qd_write_reg(0x5f, QD_CONTROL_PORT); + printk(KERN_WARNING "%s: ATAPI: disabled read-ahead FIFO " + "and post-write buffer on %s.\n", + drive->name, HWIF(drive)->name); + } + + qd_set_timing(drive, qd6580_compute_timing(active_time, recovery_time)); +} + +/* + * qd_testreg + * + * tests if the given port is a register + */ + +static int __init qd_testreg(int port) +{ + u8 savereg; + u8 readreg; + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + savereg = inb_p(port); + outb_p(QD_TESTVAL, port); /* safe value */ + readreg = inb_p(port); + outb(savereg, port); + spin_unlock_irqrestore(&io_request_lock, flags); + + if (savereg == QD_TESTVAL) { + printk(KERN_ERR "Outch ! the probe for qd65xx isn't reliable !\n"); + printk(KERN_ERR "Please contact maintainers to tell about your hardware\n"); + printk(KERN_ERR "Assuming qd65xx is not present.\n"); + return 1; + } + + return (readreg != QD_TESTVAL); +} + +/* + * qd_setup: + * + * called to setup an ata channel : adjusts attributes & links for tuning + */ + +void __init qd_setup (int unit, int base, int config, unsigned int data0, unsigned int data1, void (*tuneproc) (ide_drive_t *, u8 pio)) +{ + ide_hwif_t *hwif = &ide_hwifs[unit]; + + hwif->chipset = ide_qd65xx; + hwif->channel = unit; + hwif->select_data = base; + hwif->config_data = config; + hwif->drives[0].drive_data = data0; + hwif->drives[1].drive_data = data1; + hwif->drives[0].io_32bit = + hwif->drives[1].io_32bit = 1; + hwif->tuneproc = tuneproc; +#ifndef HWIF_PROBE_CLASSIC_METHOD + probe_hwif_init(hwif); +#endif /* HWIF_PROBE_CLASSIC_METHOD */ +} + +/* + * qd_unsetup: + * + * called to unsetup an ata channel : back to default values, unlinks tuning + */ +void __init qd_unsetup (int unit) +{ + ide_hwif_t *hwif = &ide_hwifs[unit]; + u8 config = hwif->config_data; + int base = hwif->select_data; + void *tuneproc = (void *) hwif->tuneproc; + + if (!(hwif->chipset == ide_qd65xx)) return; + + printk(KERN_NOTICE "%s: back to defaults\n", hwif->name); + + hwif->selectproc = NULL; + hwif->tuneproc = NULL; + + if (tuneproc == (void *) qd6500_tune_drive) { + // will do it for both + qd_write_reg(QD6500_DEF_DATA, QD_TIMREG(&hwif->drives[0])); + } else if (tuneproc == (void *) qd6580_tune_drive) { + if (QD_CONTROL(hwif) & QD_CONTR_SEC_DISABLED) { + qd_write_reg(QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0])); + qd_write_reg(QD6580_DEF_DATA2, QD_TIMREG(&hwif->drives[1])); + } else { + qd_write_reg(unit?QD6580_DEF_DATA2:QD6580_DEF_DATA, QD_TIMREG(&hwif->drives[0])); + } + } else { + printk(KERN_WARNING "Unknown qd65xx tuning fonction !\n"); + printk(KERN_WARNING "keeping settings !\n"); + } +} + +/* + * qd_probe: + * + * looks at the specified baseport, and if qd found, registers & initialises it + * return 1 if another qd may be probed + */ + +int __init qd_probe (int base) +{ + u8 config; + u8 unit; + + config = qd_read_reg(QD_CONFIG_PORT); + + if (! ((config & QD_CONFIG_BASEPORT) >> 1 == (base == 0xb0)) ) + return 1; + + unit = ! (config & QD_CONFIG_IDE_BASEPORT); + + if ((config & 0xf0) == QD_CONFIG_QD6500) { + + if (qd_testreg(base)) return 1; /* bad register */ + + /* qd6500 found */ + + printk(KERN_NOTICE "%s: qd6500 at %#x\n", + ide_hwifs[unit].name, base); + + printk(KERN_DEBUG "qd6500: config=%#x, ID3=%u\n", + config, QD_ID3); + + if (config & QD_CONFIG_DISABLED) { + printk(KERN_WARNING "qd6500 is disabled !\n"); + return 1; + } + + qd_setup(unit, base, config, QD6500_DEF_DATA, + QD6500_DEF_DATA, &qd6500_tune_drive); + return 1; + } + + if (((config & 0xf0) == QD_CONFIG_QD6580_A) || + ((config & 0xf0) == QD_CONFIG_QD6580_B)) { + + u8 control; + + if (qd_testreg(base) || qd_testreg(base+0x02)) return 1; + /* bad registers */ + + /* qd6580 found */ + + control = qd_read_reg(QD_CONTROL_PORT); + + printk(KERN_NOTICE "qd6580 at %#x\n", base); + printk(KERN_DEBUG "qd6580: config=%#x, control=%#x, ID3=%u\n", + config, control, QD_ID3); + + if (control & QD_CONTR_SEC_DISABLED) { + /* secondary disabled */ + printk(KERN_INFO "%s: qd6580: single IDE board\n", + ide_hwifs[unit].name); + qd_setup(unit, base, config | (control << 8), + QD6580_DEF_DATA, QD6580_DEF_DATA2, + &qd6580_tune_drive); + qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); + + return 1; + } else { + /* secondary enabled */ + printk(KERN_INFO "%s&%s: qd6580: dual IDE board\n", + ide_hwifs[0].name,ide_hwifs[1].name); + + qd_setup(0, base, config | (control << 8), + QD6580_DEF_DATA, QD6580_DEF_DATA, + &qd6580_tune_drive); + qd_setup(1, base, config | (control << 8), + QD6580_DEF_DATA2, QD6580_DEF_DATA2, + &qd6580_tune_drive); + qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); + + return 0; /* no other qd65xx possible */ + } + } + /* no qd65xx found */ + return 1; +} + +#ifndef MODULE +/* + * init_qd65xx: + * + * called by ide.c when parsing command line + */ + +void __init init_qd65xx (void) +{ + if (qd_probe(0x30)) qd_probe(0xb0); +} + +#else + +MODULE_AUTHOR("Samuel Thibault"); +MODULE_DESCRIPTION("support of qd65xx vlb ide chipset"); +MODULE_LICENSE("GPL"); + +int __init qd65xx_mod_init(void) +{ + if (qd_probe(0x30)) qd_probe(0xb0); + if (ide_hwifs[0].chipset != ide_qd65xx && + ide_hwifs[1].chipset != ide_qd65xx) + return -ENODEV; + return 0; +} +module_init(qd65xx_mod_init); + +void __init qd65xx_mod_exit(void) +{ + qd_unsetup(0); + qd_unsetup(1); +} +module_exit(qd65xx_mod_exit); +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/qd65xx.h linux.20pre5-ac2/drivers/ide/legacy/qd65xx.h --- linux.20pre5/drivers/ide/legacy/qd65xx.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/qd65xx.h 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,140 @@ +/* + * linux/drivers/ide/qd65xx.h + * + * Copyright (c) 2000 Linus Torvalds & authors + */ + +/* + * Authors: Petr Soucek + * Samuel Thibault + */ + +/* truncates a in [b,c] */ +#define IDE_IN(a,b,c) ( ((a)<(b)) ? (b) : ( (a)>(c) ? (c) : (a)) ) + +#define IDE_IMPLY(a,b) ((!(a)) || (b)) + +#define QD_TIM1_PORT (base) +#define QD_CONFIG_PORT (base+0x01) +#define QD_TIM2_PORT (base+0x02) +#define QD_CONTROL_PORT (base+0x03) + +#define QD_CONFIG_IDE_BASEPORT 0x01 +#define QD_CONFIG_BASEPORT 0x02 +#define QD_CONFIG_ID3 0x04 +#define QD_CONFIG_DISABLED 0x08 +#define QD_CONFIG_QD6500 0xc0 +#define QD_CONFIG_QD6580_A 0xa0 +#define QD_CONFIG_QD6580_B 0x50 + +#define QD_CONTR_SEC_DISABLED 0x01 + +#define QD_ID3 ((config & QD_CONFIG_ID3)!=0) + +#define QD_CONFIG(hwif) ((hwif)->config_data & 0x00ff) +#define QD_CONTROL(hwif) (((hwif)->config_data & 0xff00) >> 8) + +#define QD_TIMING(drive) (byte)(((drive)->drive_data) & 0x00ff) +#define QD_TIMREG(drive) (byte)((((drive)->drive_data) & 0xff00) >> 8) + +#define QD6500_DEF_DATA ((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0c : 0x08)) +#define QD6580_DEF_DATA ((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0a : 0x00)) +#define QD6580_DEF_DATA2 ((QD_TIM2_PORT<<8) | (QD_ID3 ? 0x0a : 0x00)) +#define QD_DEF_CONTR (0x40 | ((control & 0x02) ? 0x9f : 0x1f)) + +#define QD_TESTVAL 0x19 /* safe value */ + +/* Drive specific timing taken from DOS driver v3.7 */ + +struct qd65xx_timing_s { + char offset; /* ofset from the beginning of Model Number" */ + char model[4]; /* 4 chars from Model number, no conversion */ + short active; /* active time */ + short recovery; /* recovery time */ +} qd65xx_timing [] = { + { 30, "2040", 110, 225 }, /* Conner CP30204 */ + { 30, "2045", 135, 225 }, /* Conner CP30254 */ + { 30, "1040", 155, 325 }, /* Conner CP30104 */ + { 30, "1047", 135, 265 }, /* Conner CP30174 */ + { 30, "5344", 135, 225 }, /* Conner CP3544 */ + { 30, "01 4", 175, 405 }, /* Conner CP-3104 */ + { 27, "C030", 175, 375 }, /* Conner CP3000 */ + { 8, "PL42", 110, 295 }, /* Quantum LP240 */ + { 8, "PL21", 110, 315 }, /* Quantum LP120 */ + { 8, "PL25", 175, 385 }, /* Quantum LP52 */ + { 4, "PA24", 110, 285 }, /* WD Piranha SP4200 */ + { 6, "2200", 110, 260 }, /* WD Caviar AC2200 */ + { 6, "3204", 110, 235 }, /* WD Caviar AC2340 */ + { 6, "1202", 110, 265 }, /* WD Caviar AC2120 */ + { 0, "DS3-", 135, 315 }, /* Teac SD340 */ + { 8, "KM32", 175, 355 }, /* Toshiba MK234 */ + { 2, "53A1", 175, 355 }, /* Seagate ST351A */ + { 2, "4108", 175, 295 }, /* Seagate ST1480A */ + { 2, "1344", 175, 335 }, /* Seagate ST3144A */ + { 6, "7 12", 110, 225 }, /* Maxtor 7213A */ + { 30, "02F4", 145, 295 }, /* Conner 3204F */ + { 2, "1302", 175, 335 }, /* Seagate ST3120A */ + { 2, "2334", 145, 265 }, /* Seagate ST3243A */ + { 2, "2338", 145, 275 }, /* Seagate ST3283A */ + { 2, "3309", 145, 275 }, /* Seagate ST3390A */ + { 2, "5305", 145, 275 }, /* Seagate ST3550A */ + { 2, "4100", 175, 295 }, /* Seagate ST1400A */ + { 2, "4110", 175, 295 }, /* Seagate ST1401A */ + { 2, "6300", 135, 265 }, /* Seagate ST3600A */ + { 2, "5300", 135, 265 }, /* Seagate ST3500A */ + { 6, "7 31", 135, 225 }, /* Maxtor 7131 AT */ + { 6, "7 43", 115, 265 }, /* Maxtor 7345 AT */ + { 6, "7 42", 110, 255 }, /* Maxtor 7245 AT */ + { 6, "3 04", 135, 265 }, /* Maxtor 340 AT */ + { 6, "61 0", 135, 285 }, /* WD AC160 */ + { 6, "1107", 135, 235 }, /* WD AC1170 */ + { 6, "2101", 110, 220 }, /* WD AC1210 */ + { 6, "4202", 135, 245 }, /* WD AC2420 */ + { 6, "41 0", 175, 355 }, /* WD Caviar 140 */ + { 6, "82 0", 175, 355 }, /* WD Caviar 280 */ + { 8, "PL01", 175, 375 }, /* Quantum LP105 */ + { 8, "PL25", 110, 295 }, /* Quantum LP525 */ + { 10, "4S 2", 175, 385 }, /* Quantum ELS42 */ + { 10, "8S 5", 175, 385 }, /* Quantum ELS85 */ + { 10, "1S72", 175, 385 }, /* Quantum ELS127 */ + { 10, "1S07", 175, 385 }, /* Quantum ELS170 */ + { 8, "ZE42", 135, 295 }, /* Quantum EZ240 */ + { 8, "ZE21", 175, 385 }, /* Quantum EZ127 */ + { 8, "ZE58", 175, 385 }, /* Quantum EZ85 */ + { 8, "ZE24", 175, 385 }, /* Quantum EZ42 */ + { 27, "C036", 155, 325 }, /* Conner CP30064 */ + { 27, "C038", 155, 325 }, /* Conner CP30084 */ + { 6, "2205", 110, 255 }, /* WDC AC2250 */ + { 2, " CHA", 140, 415 }, /* WDC AH series; WDC AH260, WDC */ + { 2, " CLA", 140, 415 }, /* WDC AL series: WDC AL2120, 2170, */ + { 4, "UC41", 140, 415 }, /* WDC CU140 */ + { 6, "1207", 130, 275 }, /* WDC AC2170 */ + { 6, "2107", 130, 275 }, /* WDC AC1270 */ + { 6, "5204", 130, 275 }, /* WDC AC2540 */ + { 30, "3004", 110, 235 }, /* Conner CP30340 */ + { 30, "0345", 135, 255 }, /* Conner CP30544 */ + { 12, "12A3", 175, 320 }, /* MAXTOR LXT-213A */ + { 12, "43A0", 145, 240 }, /* MAXTOR LXT-340A */ + { 6, "7 21", 180, 290 }, /* Maxtor 7120 AT */ + { 6, "7 71", 135, 240 }, /* Maxtor 7170 AT */ + { 12, "45\0000", 110, 205 }, /* MAXTOR MXT-540 */ + { 8, "PL11", 180, 290 }, /* QUANTUM LP110A */ + { 8, "OG21", 150, 275 }, /* QUANTUM GO120 */ + { 12, "42A5", 175, 320 }, /* MAXTOR LXT-245A */ + { 2, "2309", 175, 295 }, /* ST3290A */ + { 2, "3358", 180, 310 }, /* ST3385A */ + { 2, "6355", 180, 310 }, /* ST3655A */ + { 2, "1900", 175, 270 }, /* ST9100A */ + { 2, "1954", 175, 270 }, /* ST9145A */ + { 2, "1909", 175, 270 }, /* ST9190AG */ + { 2, "2953", 175, 270 }, /* ST9235A */ + { 2, "1359", 175, 270 }, /* ST3195A */ + { 24, "3R11", 175, 290 }, /* ALPS ELECTRIC Co.,LTD, DR311C */ + { 0, "2M26", 175, 215 }, /* M262XT-0Ah */ + { 4, "2253", 175, 300 }, /* HP C2235A */ + { 4, "-32A", 145, 245 }, /* H3133-A2 */ + { 30, "0326", 150, 270 }, /* Samsung Electronics 120MB */ + { 30, "3044", 110, 195 }, /* Conner CFA340A */ + { 30, "43A0", 110, 195 }, /* Conner CFA340A */ + { -1, " ", 175, 415 } /* unknown disk name */ +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/legacy/umc8672.c linux.20pre5-ac2/drivers/ide/legacy/umc8672.c --- linux.20pre5/drivers/ide/legacy/umc8672.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/legacy/umc8672.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,237 @@ +/* + * linux/drivers/ide/umc8672.c Version 0.05 Jul 31, 1996 + * + * Copyright (C) 1995-1996 Linus Torvalds & author (see below) + */ + +/* + * Principal Author/Maintainer: PODIEN@hml2.atlas.de (Wolfram Podien) + * + * This file provides support for the advanced features + * of the UMC 8672 IDE interface. + * + * Version 0.01 Initial version, hacked out of ide.c, + * and #include'd rather than compiled separately. + * This will get cleaned up in a subsequent release. + * + * Version 0.02 now configs/compiles separate from ide.c -ml + * Version 0.03 enhanced auto-tune, fix display bug + * Version 0.05 replace sti() with restore_flags() -ml + * add detection of possible race condition -ml + */ + +/* + * VLB Controller Support from + * Wolfram Podien + * Rohoefe 3 + * D28832 Achim + * Germany + * + * To enable UMC8672 support there must a lilo line like + * append="ide0=umc8672"... + * To set the speed according to the abilities of the hardware there must be a + * line like + * #define UMC_DRIVE0 11 + * in the beginning of the driver, which sets the speed of drive 0 to 11 (there + * are some lines present). 0 - 11 are allowed speed values. These values are + * the results from the DOS speed test program supplied from UMC. 11 is the + * highest speed (about PIO mode 3) + */ +#define REALLY_SLOW_IO /* some systems can safely undef this */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef CONFIG_BLK_DEV_UMC8672_MODULE +# define _IDE_C +# include "ide_modes.h" +# undef _IDE_C +#else +# include "ide_modes.h" +#endif /* CONFIG_BLK_DEV_UMC8672_MODULE */ + +/* + * Default speeds. These can be changed with "auto-tune" and/or hdparm. + */ +#define UMC_DRIVE0 1 /* DOS measured drive speeds */ +#define UMC_DRIVE1 1 /* 0 to 11 allowed */ +#define UMC_DRIVE2 1 /* 11 = Fastest Speed */ +#define UMC_DRIVE3 1 /* In case of crash reduce speed */ + +static u8 current_speeds[4] = {UMC_DRIVE0, UMC_DRIVE1, UMC_DRIVE2, UMC_DRIVE3}; +static const u8 pio_to_umc [5] = {0,3,7,10,11}; /* rough guesses */ + +/* 0 1 2 3 4 5 6 7 8 9 10 11 */ +static const u8 speedtab [3][12] = { + {0xf, 0xb, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + {0x3, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, + {0xff,0xcb,0xc0,0x58,0x36,0x33,0x23,0x22,0x21,0x11,0x10,0x0}}; + +static void out_umc (char port,char wert) +{ + outb_p(port,0x108); + outb_p(wert,0x109); +} + +static inline u8 in_umc (char port) +{ + outb_p(port,0x108); + return inb_p(0x109); +} + +static void umc_set_speeds (u8 speeds[]) +{ + int i, tmp; + + outb_p(0x5A,0x108); /* enable umc */ + + out_umc (0xd7,(speedtab[0][speeds[2]] | (speedtab[0][speeds[3]]<<4))); + out_umc (0xd6,(speedtab[0][speeds[0]] | (speedtab[0][speeds[1]]<<4))); + tmp = 0; + for (i = 3; i >= 0; i--) { + tmp = (tmp << 2) | speedtab[1][speeds[i]]; + } + out_umc (0xdc,tmp); + for (i = 0;i < 4; i++) { + out_umc (0xd0+i,speedtab[2][speeds[i]]); + out_umc (0xd8+i,speedtab[2][speeds[i]]); + } + outb_p(0xa5,0x108); /* disable umc */ + + printk ("umc8672: drive speeds [0 to 11]: %d %d %d %d\n", + speeds[0], speeds[1], speeds[2], speeds[3]); +} + +static void tune_umc (ide_drive_t *drive, u8 pio) +{ + unsigned long flags; + ide_hwgroup_t *hwgroup = ide_hwifs[HWIF(drive)->index^1].hwgroup; + + pio = ide_get_best_pio_mode(drive, pio, 4, NULL); + printk("%s: setting umc8672 to PIO mode%d (speed %d)\n", + drive->name, pio, pio_to_umc[pio]); + spin_lock_irqsave(&io_request_lock, flags); + if (hwgroup && hwgroup->handler != NULL) { + printk(KERN_ERR "umc8672: other interface is busy: exiting tune_umc()\n"); + } else { + current_speeds[drive->name[2] - 'a'] = pio_to_umc[pio]; + umc_set_speeds (current_speeds); + } + spin_unlock_irqrestore(&io_request_lock, flags); +} + +int __init probe_umc8672 (void) +{ + unsigned long flags; + + local_irq_save(flags); + if (check_region(0x108, 2)) { + local_irq_restore(flags); + printk(KERN_ERR "umc8672: ports 0x108-0x109 already in use.\n"); + return 1; + } + outb_p(0x5A,0x108); /* enable umc */ + if (in_umc (0xd5) != 0xa0) { + local_irq_restore(flags); + printk(KERN_ERR "umc8672: not found\n"); + return 1; + } + outb_p(0xa5,0x108); /* disable umc */ + + umc_set_speeds (current_speeds); + local_irq_restore(flags); + + request_region(0x108, 2, "umc8672"); + ide_hwifs[0].chipset = ide_umc8672; + ide_hwifs[1].chipset = ide_umc8672; + ide_hwifs[0].tuneproc = &tune_umc; + ide_hwifs[1].tuneproc = &tune_umc; + ide_hwifs[0].mate = &ide_hwifs[1]; + ide_hwifs[1].mate = &ide_hwifs[0]; + ide_hwifs[1].channel = 1; + +#ifndef HWIF_PROBE_CLASSIC_METHOD + probe_hwif_init(&ide_hwifs[0]); + probe_hwif_init(&ide_hwifs[1]); +#endif /* HWIF_PROBE_CLASSIC_METHOD */ + + return 0; +} + +void __init umc8672_release (void) +{ + unsigned long flags; + + local_irq_save(flags); + if (ide_hwifs[0].chipset != ide_umc8672 && + ide_hwifs[1].chipset != ide_umc8672) { + local_irq_restore(flags); + return; + } + + ide_hwifs[0].chipset = ide_unknown; + ide_hwifs[1].chipset = ide_unknown; + ide_hwifs[0].tuneproc = NULL; + ide_hwifs[1].tuneproc = NULL; + ide_hwifs[0].mate = NULL; + ide_hwifs[1].mate = NULL; + ide_hwifs[0].channel = 0; + ide_hwifs[1].channel = 0; + + outb_p(0xa5,0x108); /* disable umc */ + + release_region(0x108, 2); + local_irq_restore(flags); +} + +#ifndef MODULE +/* + * init_umc8672: + * + * called by ide.c when parsing command line + */ + +void __init init_umc8672 (void) +{ + if (probe_umc8672()) + printk(KERN_ERR "init_umc8672: umc8672 controller not found.\n"); +} + +#else + +MODULE_AUTHOR("Wolfram Podien"); +MODULE_DESCRIPTION("Support for UMC 8672 IDE chipset"); +MODULE_LICENSE("GPL"); + +int __init umc8672_mod_init(void) +{ + if (probe_umc8672()) + return -ENODEV; + if (ide_hwifs[0].chipset != ide_umc8672 && + ide_hwifs[1].chipset != ide_umc8672) { + umc8672_release(); + return -ENODEV; + } + return 0; +} +module_init(umc8672_mod_init); + +void __init umc8672_mod_exit(void) +{ + umc8672_release(); +} +module_exit(umc8672_mod_exit); +#endif + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/macide.c linux.20pre5-ac2/drivers/ide/macide.c --- linux.20pre5/drivers/ide/macide.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/macide.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,147 +0,0 @@ -/* - * linux/drivers/ide/macide.c -- Macintosh IDE Driver - * - * Copyright (C) 1998 by Michael Schmitz - * - * This driver was written based on information obtained from the MacOS IDE - * driver binary by Mikael Forselius - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#define IDE_BASE 0x50F1A000 /* Base address of IDE controller */ - -/* - * Generic IDE registers as offsets from the base - * These match MkLinux so they should be correct. - */ - -#define IDE_DATA 0x00 -#define IDE_ERROR 0x04 /* see err-bits */ -#define IDE_NSECTOR 0x08 /* nr of sectors to read/write */ -#define IDE_SECTOR 0x0c /* starting sector */ -#define IDE_LCYL 0x10 /* starting cylinder */ -#define IDE_HCYL 0x14 /* high byte of starting cyl */ -#define IDE_SELECT 0x18 /* 101dhhhh , d=drive, hhhh=head */ -#define IDE_STATUS 0x1c /* see status-bits */ -#define IDE_CONTROL 0x38 /* control/altstatus */ - -/* - * Mac-specific registers - */ - -/* - * this register is odd; it doesn't seem to do much and it's - * not word-aligned like virtually every other hardware register - * on the Mac... - */ - -#define IDE_IFR 0x101 /* (0x101) IDE interrupt flags on Quadra: - * - * Bit 0+1: some interrupt flags - * Bit 2+3: some interrupt enable - * Bit 4: ?? - * Bit 5: IDE interrupt flag (any hwif) - * Bit 6: maybe IDE interrupt enable (any hwif) ?? - * Bit 7: Any interrupt condition - */ - -volatile unsigned char *ide_ifr = (unsigned char *) (IDE_BASE + IDE_IFR); - -static int macide_offsets[IDE_NR_PORTS] = { - IDE_DATA, IDE_ERROR, IDE_NSECTOR, IDE_SECTOR, IDE_LCYL, - IDE_HCYL, IDE_SELECT, IDE_STATUS, IDE_CONTROL -}; - -int macide_ack_intr(ide_hwif_t* hwif) -{ - if (*ide_ifr & 0x20) { - *ide_ifr &= ~0x20; - return 1; - } - return 0; -} - -#ifdef CONFIG_BLK_DEV_MAC_MEDIABAY -static void macide_mediabay_interrupt(int irq, void *dev_id, struct pt_regs *regs) -{ - int state = baboon->mb_status & 0x04; - - printk("macide: media bay %s detected\n", state? "removal":"insertion"); -} -#endif - -/* - * Probe for a Macintosh IDE interface - */ - -void macide_init(void) -{ - hw_regs_t hw; - int index = -1; - - switch (macintosh_config->ide_type) { - case MAC_IDE_QUADRA: - ide_setup_ports(&hw, (ide_ioreg_t)IDE_BASE, macide_offsets, - 0, 0, macide_ack_intr, IRQ_NUBUS_F); - index = ide_register_hw(&hw, NULL); - break; - case MAC_IDE_PB: - ide_setup_ports(&hw, (ide_ioreg_t)IDE_BASE, macide_offsets, - 0, 0, macide_ack_intr, IRQ_NUBUS_C); - index = ide_register_hw(&hw, NULL); - break; - case MAC_IDE_BABOON: - ide_setup_ports(&hw, (ide_ioreg_t)BABOON_BASE, macide_offsets, - 0, 0, NULL, IRQ_BABOON_1); - index = ide_register_hw(&hw, NULL); - if (index == -1) break; - if (macintosh_config->ident == MAC_MODEL_PB190) { - - /* Fix breakage in ide-disk.c: drive capacity */ - /* is not initialized for drives without a */ - /* hardware ID, and we cna't get that without */ - /* probing the drive which freezes a 190. */ - - ide_drive_t *drive = &ide_hwifs[index].drives[0]; - drive->capacity = drive->cyl*drive->head*drive->sect; - -#ifdef CONFIG_BLK_DEV_MAC_MEDIABAY - request_irq(IRQ_BABOON_2, macide_mediabay_interrupt, - IRQ_FLG_FAST, "mediabay", - macide_mediabay_interrupt); -#endif - } - break; - - default: - return; - } - - if (index != -1) { - if (macintosh_config->ide_type == MAC_IDE_QUADRA) - printk("ide%d: Macintosh Quadra IDE interface\n", index); - else if (macintosh_config->ide_type == MAC_IDE_PB) - printk("ide%d: Macintosh Powerbook IDE interface\n", index); - else if (macintosh_config->ide_type == MAC_IDE_BABOON) - printk("ide%d: Macintosh Powerbook Baboon IDE interface\n", index); - else - printk("ide%d: Unknown Macintosh IDE interface\n", index); - } -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/Makefile linux.20pre5-ac2/drivers/ide/Makefile --- linux.20pre5/drivers/ide/Makefile 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/Makefile 2002-09-02 15:09:58.000000000 +0100 @@ -10,80 +10,37 @@ O_TARGET := idedriver.o -export-objs := ide.o ide-features.o ide-probe.o ide-taskfile.o ataraid.o -list-multi := ide-mod.o ide-probe-mod.o +export-objs := ide-iops.o ide-taskfile.o ide-proc.o ide.o ide-probe.o ide-dma.o ide-lib.o setup-pci.o + +all-subdirs := arm legacy pci ppc raid +mod-subdirs := arm legacy pci ppc raid obj-y := obj-m := ide-obj-y := -obj-$(CONFIG_BLK_DEV_HD) += hd.o -obj-$(CONFIG_BLK_DEV_IDE) += ide-mod.o ide-probe-mod.o -obj-$(CONFIG_BLK_DEV_IDECS) += ide-cs.o -obj-$(CONFIG_BLK_DEV_IDEDISK) += ide-disk.o -obj-$(CONFIG_BLK_DEV_IDECD) += ide-cd.o -obj-$(CONFIG_BLK_DEV_IDETAPE) += ide-tape.o -obj-$(CONFIG_BLK_DEV_IDEFLOPPY) += ide-floppy.o - -obj-$(CONFIG_BLK_DEV_IT8172) += it8172.o - -ide-obj-$(CONFIG_BLK_DEV_AEC62XX) += aec62xx.o -ide-obj-$(CONFIG_BLK_DEV_ALI14XX) += ali14xx.o -ide-obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o -ide-obj-$(CONFIG_BLK_DEV_AMD74XX) += amd74xx.o -ide-obj-$(CONFIG_BLK_DEV_BUDDHA) += buddha.o -ide-obj-$(CONFIG_BLK_DEV_CMD640) += cmd640.o -ide-obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o -ide-obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o -ide-obj-$(CONFIG_BLK_DEV_CY82C693) += cy82c693.o -ide-obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o -ide-obj-$(CONFIG_BLK_DEV_FALCON_IDE) += falconide.o -ide-obj-$(CONFIG_BLK_DEV_GAYLE) += gayle.o -ide-obj-$(CONFIG_BLK_DEV_Q40IDE) += q40ide.o -ide-obj-$(CONFIG_BLK_DEV_HPT34X) += hpt34x.o -ide-obj-$(CONFIG_BLK_DEV_HPT366) += hpt366.o -ide-obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o -ide-obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o -ide-obj-$(CONFIG_BLK_DEV_ADMA) += ide-adma.o -ide-obj-$(CONFIG_BLK_DEV_IDEDMA_PCI) += ide-dma.o -ide-obj-$(CONFIG_BLK_DEV_IDEPCI) += ide-pci.o -ide-obj-$(CONFIG_BLK_DEV_ISAPNP) += ide-pnp.o -ide-obj-$(CONFIG_BLK_DEV_IDE_PMAC) += ide-pmac.o -ide-obj-$(CONFIG_BLK_DEV_IDE_SWARM) += ide-swarm.o -ide-obj-$(CONFIG_BLK_DEV_MAC_IDE) += macide.o -ide-obj-$(CONFIG_BLK_DEV_NS87415) += ns87415.o -ide-obj-$(CONFIG_BLK_DEV_OPTI621) += opti621.o -ide-obj-$(CONFIG_BLK_DEV_SVWKS) += serverworks.o -ide-obj-$(CONFIG_BLK_DEV_PDC202XX) += pdc202xx.o -ide-obj-$(CONFIG_BLK_DEV_PDC4030) += pdc4030.o -ide-obj-$(CONFIG_BLK_DEV_PDC_ADMA) += pdcadma.o -ide-obj-$(CONFIG_BLK_DEV_PIIX) += piix.o -ide-obj-$(CONFIG_BLK_DEV_QD65XX) += qd65xx.o -ide-obj-$(CONFIG_BLK_DEV_IDE_RAPIDE) += rapide.o -ide-obj-$(CONFIG_BLK_DEV_RZ1000) += rz1000.o -ide-obj-$(CONFIG_BLK_DEV_SIS5513) += sis5513.o -ide-obj-$(CONFIG_BLK_DEV_SLC90E66) += slc90e66.o -ide-obj-$(CONFIG_BLK_DEV_SL82C105) += sl82c105.o -ide-obj-$(CONFIG_BLK_DEV_TRM290) += trm290.o -ide-obj-$(CONFIG_BLK_DEV_UMC8672) += umc8672.o -ide-obj-$(CONFIG_BLK_DEV_VIA82CXXX) += via82cxxx.o -ide-obj-$(CONFIG_BLK_DEV_MPC8xx_IDE) += ide-m8xx.o - -# The virtualised raid layers MUST come after the ide itself or bad stuff -# will happen. -obj-$(CONFIG_BLK_DEV_ATARAID) += ataraid.o -obj-$(CONFIG_BLK_DEV_ATARAID_PDC) += pdcraid.o -obj-$(CONFIG_BLK_DEV_ATARAID_HPT) += hptraid.o - -ide-obj-$(CONFIG_PROC_FS) += ide-proc.o +subdir-$(CONFIG_BLK_DEV_IDE) += legacy ppc arm raid pci -ide-mod-objs := ide.o ide-features.o ide-taskfile.o $(ide-obj-y) -ide-probe-mod-objs := ide-probe.o ide-geometry.o +obj-$(CONFIG_BLK_DEV_IDE) += ide-probe.o ide-geometry.o ide-iops.o ide-taskfile.o ide.o ide-lib.o +obj-$(CONFIG_BLK_DEV_IDEDISK) += ide-disk.o +obj-$(CONFIG_BLK_DEV_IDECD) += ide-cd.o +obj-$(CONFIG_BLK_DEV_IDETAPE) += ide-tape.o +obj-$(CONFIG_BLK_DEV_IDEFLOPPY) += ide-floppy.o + +obj-$(CONFIG_BLK_DEV_IDEDMA_PCI) += ide-dma.o +obj-$(CONFIG_BLK_DEV_ISAPNP) += ide-pnp.o + +obj-$(CONFIG_PROC_FS) += ide-proc.o + +obj-$(CONFIG_BLK_DEV_IDEPCI) += setup-pci.o + +ifeq ($(CONFIG_BLK_DEV_IDE),y) + obj-y += pci/idedriver-pci.o + obj-y += legacy/idedriver-legacy.o + obj-y += ppc/idedriver-ppc.o + obj-y += arm/idedriver-arm.o +# RAID must be last + obj-y += raid/idedriver-raid.o +endif include $(TOPDIR)/Rules.make - -ide-mod.o: $(ide-mod-objs) - $(LD) -r -o $@ $(ide-mod-objs) - -ide-probe-mod.o: $(ide-probe-mod-objs) - $(LD) -r -o $@ $(ide-probe-mod-objs) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ns87415.c linux.20pre5-ac2/drivers/ide/ns87415.c --- linux.20pre5/drivers/ide/ns87415.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ns87415.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,193 +0,0 @@ -/* - * linux/drivers/ide/ns87415.c Version 1.01 Mar. 18, 2000 - * - * Copyright (C) 1997-1998 Mark Lord - * Copyright (C) 1998 Eddie C. Dost - * Copyright (C) 1999-2000 Andre Hedrick - * - * Inspired by an earlier effort from David S. Miller - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -static unsigned int ns87415_count = 0, ns87415_control[MAX_HWIFS] = { 0 }; - -/* - * This routine either enables/disables (according to drive->present) - * the IRQ associated with the port (HWIF(drive)), - * and selects either PIO or DMA handshaking for the next I/O operation. - */ -static void ns87415_prepare_drive (ide_drive_t *drive, unsigned int use_dma) -{ - ide_hwif_t *hwif = HWIF(drive); - unsigned int bit, other, new, *old = (unsigned int *) hwif->select_data; - struct pci_dev *dev = hwif->pci_dev; - unsigned long flags; - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - new = *old; - - /* Adjust IRQ enable bit */ - bit = 1 << (8 + hwif->channel); - new = drive->present ? (new & ~bit) : (new | bit); - - /* Select PIO or DMA, DMA may only be selected for one drive/channel. */ - bit = 1 << (20 + drive->select.b.unit + (hwif->channel << 1)); - other = 1 << (20 + (1 - drive->select.b.unit) + (hwif->channel << 1)); - new = use_dma ? ((new & ~other) | bit) : (new & ~bit); - - if (new != *old) { - unsigned char stat; - - /* - * Don't change DMA engine settings while Write Buffers - * are busy. - */ - (void) pci_read_config_byte(dev, 0x43, &stat); - while (stat & 0x03) { - udelay(1); - (void) pci_read_config_byte(dev, 0x43, &stat); - } - - *old = new; - (void) pci_write_config_dword(dev, 0x40, new); - - /* - * And let things settle... - */ - udelay(10); - } - - __restore_flags(flags); /* local CPU only */ -} - -static void ns87415_selectproc (ide_drive_t *drive) -{ - ns87415_prepare_drive (drive, drive->using_dma); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -static int ns87415_dmaproc(ide_dma_action_t func, ide_drive_t *drive) -{ - ide_hwif_t *hwif = HWIF(drive); - byte dma_stat; - - switch (func) { - case ide_dma_end: /* returns 1 on error, 0 otherwise */ - drive->waiting_for_dma = 0; - dma_stat = inb(hwif->dma_base+2); - outb(inb(hwif->dma_base)&~1, hwif->dma_base); /* stop DMA */ - outb(inb(hwif->dma_base)|6, hwif->dma_base); /* from ERRATA: clear the INTR & ERROR bits */ - ide_destroy_dmatable(drive); /* and free any DMA resources */ - return (dma_stat & 7) != 4; /* verify good DMA status */ - case ide_dma_write: - case ide_dma_read: - ns87415_prepare_drive(drive, 1); /* select DMA xfer */ - if (!ide_dmaproc(func, drive)) /* use standard DMA stuff */ - return 0; - ns87415_prepare_drive(drive, 0); /* DMA failed: select PIO xfer */ - return 1; - case ide_dma_check: - if (drive->media != ide_disk) - return ide_dmaproc(ide_dma_off_quietly, drive); - /* Fallthrough... */ - default: - return ide_dmaproc(func, drive); /* use standard DMA stuff */ - } -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -void __init ide_init_ns87415 (ide_hwif_t *hwif) -{ - struct pci_dev *dev = hwif->pci_dev; - unsigned int ctrl, using_inta; - byte progif; -#ifdef __sparc_v9__ - int timeout; - byte stat; -#endif - - /* Set a good latency timer and cache line size value. */ - (void) pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64); -#ifdef __sparc_v9__ - (void) pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 0x10); -#endif - - /* - * We cannot probe for IRQ: both ports share common IRQ on INTA. - * Also, leave IRQ masked during drive probing, to prevent infinite - * interrupts from a potentially floating INTA.. - * - * IRQs get unmasked in selectproc when drive is first used. - */ - (void) pci_read_config_dword(dev, 0x40, &ctrl); - (void) pci_read_config_byte(dev, 0x09, &progif); - /* is irq in "native" mode? */ - using_inta = progif & (1 << (hwif->channel << 1)); - if (!using_inta) - using_inta = ctrl & (1 << (4 + hwif->channel)); - if (hwif->mate) { - hwif->select_data = hwif->mate->select_data; - } else { - hwif->select_data = (unsigned long) - &ns87415_control[ns87415_count++]; - ctrl |= (1 << 8) | (1 << 9); /* mask both IRQs */ - if (using_inta) - ctrl &= ~(1 << 6); /* unmask INTA */ - *((unsigned int *)hwif->select_data) = ctrl; - (void) pci_write_config_dword(dev, 0x40, ctrl); - - /* - * Set prefetch size to 512 bytes for both ports, - * but don't turn on/off prefetching here. - */ - pci_write_config_byte(dev, 0x55, 0xee); - -#ifdef __sparc_v9__ - /* - * XXX: Reset the device, if we don't it will not respond - * to SELECT_DRIVE() properly during first probe_hwif(). - */ - timeout = 10000; - outb(12, hwif->io_ports[IDE_CONTROL_OFFSET]); - udelay(10); - outb(8, hwif->io_ports[IDE_CONTROL_OFFSET]); - do { - udelay(50); - stat = inb(hwif->io_ports[IDE_STATUS_OFFSET]); - if (stat == 0xff) - break; - } while ((stat & BUSY_STAT) && --timeout); -#endif - } - - if (hwif->dma_base) - outb(0x60, hwif->dma_base + 2); - - if (!using_inta) - hwif->irq = hwif->channel ? 15 : 14; /* legacy mode */ - else if (!hwif->irq && hwif->mate && hwif->mate->irq) - hwif->irq = hwif->mate->irq; /* share IRQ with mate */ - -#ifdef CONFIG_BLK_DEV_IDEDMA - if (hwif->dma_base) - hwif->dmaproc = &ns87415_dmaproc; -#endif /* CONFIG_BLK_DEV_IDEDMA */ - - hwif->selectproc = &ns87415_selectproc; -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/opti621.c linux.20pre5-ac2/drivers/ide/opti621.c --- linux.20pre5/drivers/ide/opti621.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/opti621.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,316 +0,0 @@ -/* - * linux/drivers/ide/opti621.c Version 0.6 Jan 02, 1999 - * - * Copyright (C) 1996-1998 Linus Torvalds & authors (see below) - */ - -/* - * Authors: - * Jaromir Koutek , - * Jan Harkes , - * Mark Lord - * Some parts of code are from ali14xx.c and from rz1000.c. - * - * OPTi is trademark of OPTi, Octek is trademark of Octek. - * - * I used docs from OPTi databook, from ftp.opti.com, file 9123-0002.ps - * and disassembled/traced setupvic.exe (DOS program). - * It increases kernel code about 2 kB. - * I don't have this card no more, but I hope I can get some in case - * of needed development. - * My card is Octek PIDE 1.01 (on card) or OPTiViC (program). - * It has a place for a secondary connector in circuit, but nothing - * is there. Also BIOS says no address for - * secondary controller (see bellow in ide_init_opti621). - * I've only tested this on my system, which only has one disk. - * It's Western Digital WDAC2850, with PIO mode 3. The PCI bus - * is at 20 MHz (I have DX2/80, I tried PCI at 40, but I got random - * lockups). I tried the OCTEK double speed CD-ROM and - * it does not work! But I can't boot DOS also, so it's probably - * hardware fault. I have connected Conner 80MB, the Seagate 850MB (no - * problems) and Seagate 1GB (as slave, WD as master). My experiences - * with the third, 1GB drive: I got 3MB/s (hdparm), but sometimes - * it slows to about 100kB/s! I don't know why and I have - * not this drive now, so I can't try it again. - * I write this driver because I lost the paper ("manual") with - * settings of jumpers on the card and I have to boot Linux with - * Loadlin except LILO, cause I have to run the setupvic.exe program - * already or I get disk errors (my test: rpm -Vf - * /usr/X11R6/bin/XF86_SVGA - or any big file). - * Some numbers from hdparm -t /dev/hda: - * Timing buffer-cache reads: 32 MB in 3.02 seconds =10.60 MB/sec - * Timing buffered disk reads: 16 MB in 5.52 seconds = 2.90 MB/sec - * I have 4 Megs/s before, but I don't know why (maybe changes - * in hdparm test). - * After release of 0.1, I got some successful reports, so it might work. - * - * The main problem with OPTi is that some timings for master - * and slave must be the same. For example, if you have master - * PIO 3 and slave PIO 0, driver have to set some timings of - * master for PIO 0. Second problem is that opti621_tune_drive - * got only one drive to set, but have to set both drives. - * This is solved in compute_pios. If you don't set - * the second drive, compute_pios use ide_get_best_pio_mode - * for autoselect mode (you can change it to PIO 0, if you want). - * If you then set the second drive to another PIO, the old value - * (automatically selected) will be overrided by yours. - * There is a 25/33MHz switch in configuration - * register, but driver is written for use at any frequency which get - * (use idebus=xx to select PCI bus speed). - * Use ide0=autotune for automatical tune of the PIO modes. - * If you get strange results, do not use this and set PIO manually - * by hdparm. - * - * Version 0.1, Nov 8, 1996 - * by Jaromir Koutek, for 2.1.8. - * Initial version of driver. - * - * Version 0.2 - * Number 0.2 skipped. - * - * Version 0.3, Nov 29, 1997 - * by Mark Lord (probably), for 2.1.68 - * Updates for use with new IDE block driver. - * - * Version 0.4, Dec 14, 1997 - * by Jan Harkes - * Fixed some errors and cleaned the code. - * - * Version 0.5, Jan 2, 1998 - * by Jaromir Koutek - * Updates for use with (again) new IDE block driver. - * Update of documentation. - * - * Version 0.6, Jan 2, 1999 - * by Jaromir Koutek - * Reversed to version 0.3 of the driver, because - * 0.5 doesn't work. - */ - -#undef REALLY_SLOW_IO /* most systems can safely undef this */ -#define OPTI621_DEBUG /* define for debug messages */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "ide_modes.h" - -#define OPTI621_MAX_PIO 3 -/* In fact, I do not have any PIO 4 drive - * (address: 25 ns, data: 70 ns, recovery: 35 ns), - * but OPTi 82C621 is programmable and it can do (minimal values): - * on 40MHz PCI bus (pulse 25 ns): - * address: 25 ns, data: 25 ns, recovery: 50 ns; - * on 20MHz PCI bus (pulse 50 ns): - * address: 50 ns, data: 50 ns, recovery: 100 ns. - */ - -/* #define READ_PREFETCH 0 */ -/* Uncommnent for disable read prefetch. - * There is some readprefetch capatibility in hdparm, - * but when I type hdparm -P 1 /dev/hda, I got errors - * and till reset drive is inaccessible. - * This (hw) read prefetch is safe on my drive. - */ - -#ifndef READ_PREFETCH -#define READ_PREFETCH 0x40 /* read prefetch is enabled */ -#endif /* else read prefetch is disabled */ - -#define READ_REG 0 /* index of Read cycle timing register */ -#define WRITE_REG 1 /* index of Write cycle timing register */ -#define CNTRL_REG 3 /* index of Control register */ -#define STRAP_REG 5 /* index of Strap register */ -#define MISC_REG 6 /* index of Miscellaneous register */ - -int reg_base; - -#define PIO_NOT_EXIST 254 -#define PIO_DONT_KNOW 255 - -/* there are stored pio numbers from other calls of opti621_tune_drive */ - -static void compute_pios(ide_drive_t *drive, byte pio) -/* Store values into drive->drive_data - * second_contr - 0 for primary controller, 1 for secondary - * slave_drive - 0 -> pio is for master, 1 -> pio is for slave - * pio - PIO mode for selected drive (for other we don't know) - */ -{ - int d; - ide_hwif_t *hwif = HWIF(drive); - - drive->drive_data = ide_get_best_pio_mode(drive, pio, OPTI621_MAX_PIO, NULL); - for (d = 0; d < 2; ++d) { - drive = &hwif->drives[d]; - if (drive->present) { - if (drive->drive_data == PIO_DONT_KNOW) - drive->drive_data = ide_get_best_pio_mode(drive, 255, OPTI621_MAX_PIO, NULL); -#ifdef OPTI621_DEBUG - printk("%s: Selected PIO mode %d\n", drive->name, drive->drive_data); -#endif - } else { - drive->drive_data = PIO_NOT_EXIST; - } - } -} - -int cmpt_clk(int time, int bus_speed) -/* Returns (rounded up) time in clocks for time in ns, - * with bus_speed in MHz. - * Example: bus_speed = 40 MHz, time = 80 ns - * 1000/40 = 25 ns (clk value), - * 80/25 = 3.2, rounded up to 4 (I hope ;-)). - * Use idebus=xx to select right frequency. - */ -{ - return ((time*bus_speed+999)/1000); -} - -static void write_reg(byte value, int reg) -/* Write value to register reg, base of register - * is at reg_base (0x1f0 primary, 0x170 secondary, - * if not changed by PCI configuration). - * This is from setupvic.exe program. - */ -{ - inw(reg_base+1); - inw(reg_base+1); - outb(3, reg_base+2); - outb(value, reg_base+reg); - outb(0x83, reg_base+2); -} - -static byte read_reg(int reg) -/* Read value from register reg, base of register - * is at reg_base (0x1f0 primary, 0x170 secondary, - * if not changed by PCI configuration). - * This is from setupvic.exe program. - */ -{ - byte ret; - inw(reg_base+1); - inw(reg_base+1); - outb(3, reg_base+2); - ret=inb(reg_base+reg); - outb(0x83, reg_base+2); - return ret; -} - -typedef struct pio_clocks_s { - int address_time; /* Address setup (clocks) */ - int data_time; /* Active/data pulse (clocks) */ - int recovery_time; /* Recovery time (clocks) */ -} pio_clocks_t; - -static void compute_clocks(int pio, pio_clocks_t *clks) -{ - if (pio != PIO_NOT_EXIST) { - int adr_setup, data_pls; - int bus_speed = system_bus_clock(); - - adr_setup = ide_pio_timings[pio].setup_time; - data_pls = ide_pio_timings[pio].active_time; - clks->address_time = cmpt_clk(adr_setup, bus_speed); - clks->data_time = cmpt_clk(data_pls, bus_speed); - clks->recovery_time = cmpt_clk(ide_pio_timings[pio].cycle_time - - adr_setup-data_pls, bus_speed); - if (clks->address_time<1) clks->address_time = 1; - if (clks->address_time>4) clks->address_time = 4; - if (clks->data_time<1) clks->data_time = 1; - if (clks->data_time>16) clks->data_time = 16; - if (clks->recovery_time<2) clks->recovery_time = 2; - if (clks->recovery_time>17) clks->recovery_time = 17; - } else { - clks->address_time = 1; - clks->data_time = 1; - clks->recovery_time = 2; - /* minimal values */ - } - -} - -/* Main tune procedure, called from tuneproc. */ -static void opti621_tune_drive (ide_drive_t *drive, byte pio) -{ - /* primary and secondary drives share some registers, - * so we have to program both drives - */ - unsigned long flags; - byte pio1, pio2; - pio_clocks_t first, second; - int ax, drdy; - byte cycle1, cycle2, misc; - ide_hwif_t *hwif = HWIF(drive); - - /* sets drive->drive_data for both drives */ - compute_pios(drive, pio); - pio1 = hwif->drives[0].drive_data; - pio2 = hwif->drives[1].drive_data; - - compute_clocks(pio1, &first); - compute_clocks(pio2, &second); - - /* ax = max(a1,a2) */ - ax = (first.address_time < second.address_time) ? second.address_time : first.address_time; - - drdy = 2; /* DRDY is default 2 (by OPTi Databook) */ - - cycle1 = ((first.data_time-1)<<4) | (first.recovery_time-2); - cycle2 = ((second.data_time-1)<<4) | (second.recovery_time-2); - misc = READ_PREFETCH | ((ax-1)<<4) | ((drdy-2)<<1); - -#ifdef OPTI621_DEBUG - printk("%s: master: address: %d, data: %d, recovery: %d, drdy: %d [clk]\n", - hwif->name, ax, first.data_time, first.recovery_time, drdy); - printk("%s: slave: address: %d, data: %d, recovery: %d, drdy: %d [clk]\n", - hwif->name, ax, second.data_time, second.recovery_time, drdy); -#endif - - save_flags(flags); /* all CPUs */ - cli(); /* all CPUs */ - - reg_base = hwif->io_ports[IDE_DATA_OFFSET]; - outb(0xc0, reg_base+CNTRL_REG); /* allow Register-B */ - outb(0xff, reg_base+5); /* hmm, setupvic.exe does this ;-) */ - inb(reg_base+CNTRL_REG); /* if reads 0xff, adapter not exist? */ - read_reg(CNTRL_REG); /* if reads 0xc0, no interface exist? */ - read_reg(STRAP_REG); /* read version, probably 0 */ - - /* program primary drive */ - write_reg(0, MISC_REG); /* select Index-0 for Register-A */ - write_reg(cycle1, READ_REG); /* set read cycle timings */ - write_reg(cycle1, WRITE_REG); /* set write cycle timings */ - - /* program secondary drive */ - write_reg(1, MISC_REG); /* select Index-1 for Register-B */ - write_reg(cycle2, READ_REG); /* set read cycle timings */ - write_reg(cycle2, WRITE_REG); /* set write cycle timings */ - - write_reg(0x85, CNTRL_REG); /* use Register-A for drive 0 */ - /* use Register-B for drive 1 */ - - write_reg(misc, MISC_REG); /* set address setup, DRDY timings, */ - /* and read prefetch for both drives */ - - restore_flags(flags); /* all CPUs */ -} - -/* - * ide_init_opti621() is called once for each hwif found at boot. - */ -void __init ide_init_opti621 (ide_hwif_t *hwif) -{ - hwif->drives[0].drive_data = PIO_DONT_KNOW; - hwif->drives[1].drive_data = PIO_DONT_KNOW; - hwif->tuneproc = &opti621_tune_drive; -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/adma100.c linux.20pre5-ac2/drivers/ide/pci/adma100.c --- linux.20pre5/drivers/ide/pci/adma100.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/adma100.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,30 @@ +/* + * linux/drivers/ide/adma100.c -- basic support for Pacific Digital ADMA-100 boards + * + * Created 09 Apr 2002 by Mark Lord + * + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file COPYING in the main directory of this archive for + * more details. + */ + +#include +#include +#include +#include +#include +#include +#include + +void __init ide_init_adma100 (ide_hwif_t *hwif) +{ + u32 phy_admctl = pci_resource_start(hwif->pci_dev, 4) + 0x80 + (hwif->channel * 0x20); + void *v_admctl; + + hwif->autodma = 0; // not compatible with normal IDE DMA transfers + hwif->dma_base = 0; // disable DMA completely + hwif->io_ports[IDE_CONTROL_OFFSET] += 4; // chip needs offset of 6 instead of 2 + v_admctl = ioremap_nocache(phy_admctl, 1024); // map config regs, so we can turn on drive IRQs + *((unsigned short *)v_admctl) &= 3; // enable aIEN; preserve PIO mode + iounmap(v_admctl); // all done; unmap config regs +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/adma100.h linux.20pre5-ac2/drivers/ide/pci/adma100.h --- linux.20pre5/drivers/ide/pci/adma100.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/adma100.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,36 @@ +#ifndef ADMA_100_H +#define ADMA_100_H + +#include +#include +#include + +extern void init_setup_pdcadma(struct pci_dev *, ide_pci_device_t *); +extern unsigned int init_chipset_pdcadma(struct pci_dev *, const char *); +extern void init_hwif_pdcadma(ide_hwif_t *); +extern void init_dma_pdcadma(ide_hwif_t *, unsigned long); + +static ide_pci_device_t pdcadma_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_PDC, + device: PCI_DEVICE_ID_PDC_1841, + name: "ADMA100", + init_setup: init_setup_pdcadma, + init_chipset: init_chipset_pdcadma, + init_iops: NULL, + init_hwif: init_hwif_pdcadma, + init_dma: init_dma_pdcadma, + channels: 2, + autodma: NODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0 + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +} + +#endif /* ADMA_100_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/aec62xx.c linux.20pre5-ac2/drivers/ide/pci/aec62xx.c --- linux.20pre5/drivers/ide/pci/aec62xx.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/aec62xx.c 2002-09-01 18:00:09.000000000 +0100 @@ -0,0 +1,589 @@ +/* + * linux/drivers/ide/aec62xx.c Version 0.11 March 27, 2002 + * + * Copyright (C) 1999-2002 Andre Hedrick + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ide_modes.h" +#include "aec62xx.h" + +#if defined(DISPLAY_AEC62XX_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 aec62xx_proc = 0; + +#define AEC_MAX_DEVS 5 + +static struct pci_dev *aec_devs[AEC_MAX_DEVS]; +static int n_aec_devs; + +#undef DEBUG_AEC_REGS + +static int aec62xx_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + char *chipset_nums[] = {"error", "error", "error", "error", + "error", "error", "850UF", "860", + "860R", "865", "865R", "error" }; +// char *modes_33[] = {}; +// char *modes_34[] = {}; + int i; + + for (i = 0; i < n_aec_devs; i++) { + struct pci_dev *dev = aec_devs[i]; + u32 iobase = pci_resource_start(dev, 4); + u8 c0 = 0, c1 = 0, art = 0; +#ifdef DEBUG_AEC_REGS + u8 uart = 0; +#endif /* DEBUG_AEC_REGS */ + + c0 = IN_BYTE(iobase + 0x02); + c1 = IN_BYTE(iobase + 0x0a); + + p += sprintf(p, "\nController: %d\n", i); + p += sprintf(p, "Chipset: AEC%s\n", chipset_nums[dev->device]); + + p += sprintf(p, "--------------- Primary Channel " + "---------------- Secondary Channel " + "-------------\n"); + (void) pci_read_config_byte(dev, 0x4a, &art); + p += sprintf(p, " %sabled ", + (art&0x02)?" en":"dis"); + p += sprintf(p, " %sabled\n", + (art&0x04)?" en":"dis"); + p += sprintf(p, "--------------- drive0 --------- drive1 " + "-------- drive0 ---------- drive1 ------\n"); + p += sprintf(p, "DMA enabled: %s %s ", + (c0&0x20)?"yes":"no ",(c0&0x40)?"yes":"no "); + p += sprintf(p, " %s %s\n", + (c1&0x20)?"yes":"no ",(c1&0x40)?"yes":"no "); + + if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) { + (void) pci_read_config_byte(dev, 0x54, &art); + p += sprintf(p, "DMA Mode: %s(%s)", + (c0&0x20)?((art&0x03)?"UDMA":" DMA"):" PIO", + (art&0x02)?"2":(art&0x01)?"1":"0"); + p += sprintf(p, " %s(%s)", + (c0&0x40)?((art&0x0c)?"UDMA":" DMA"):" PIO", + (art&0x08)?"2":(art&0x04)?"1":"0"); + p += sprintf(p, " %s(%s)", + (c1&0x20)?((art&0x30)?"UDMA":" DMA"):" PIO", + (art&0x20)?"2":(art&0x10)?"1":"0"); + p += sprintf(p, " %s(%s)\n", + (c1&0x40)?((art&0xc0)?"UDMA":" DMA"):" PIO", + (art&0x80)?"2":(art&0x40)?"1":"0"); +#ifdef DEBUG_AEC_REGS + (void) pci_read_config_byte(dev, 0x40, &art); + p += sprintf(p, "Active: 0x%02x", art); + (void) pci_read_config_byte(dev, 0x42, &art); + p += sprintf(p, " 0x%02x", art); + (void) pci_read_config_byte(dev, 0x44, &art); + p += sprintf(p, " 0x%02x", art); + (void) pci_read_config_byte(dev, 0x46, &art); + p += sprintf(p, " 0x%02x\n", art); + (void) pci_read_config_byte(dev, 0x41, &art); + p += sprintf(p, "Recovery: 0x%02x", art); + (void) pci_read_config_byte(dev, 0x43, &art); + p += sprintf(p, " 0x%02x", art); + (void) pci_read_config_byte(dev, 0x45, &art); + p += sprintf(p, " 0x%02x", art); + (void) pci_read_config_byte(dev, 0x47, &art); + p += sprintf(p, " 0x%02x\n", art); +#endif /* DEBUG_AEC_REGS */ + } else { + /* + * case PCI_DEVICE_ID_ARTOP_ATP860: + * case PCI_DEVICE_ID_ARTOP_ATP860R: + * case PCI_DEVICE_ID_ARTOP_ATP865: + * case PCI_DEVICE_ID_ARTOP_ATP865R: + */ + (void) pci_read_config_byte(dev, 0x44, &art); + p += sprintf(p, "DMA Mode: %s(%s)", + (c0&0x20)?((art&0x07)?"UDMA":" DMA"):" PIO", + ((art&0x07)==0x07)?"6": + ((art&0x06)==0x06)?"5": + ((art&0x05)==0x05)?"4": + ((art&0x04)==0x04)?"3": + ((art&0x03)==0x03)?"2": + ((art&0x02)==0x02)?"1": + ((art&0x01)==0x01)?"0":"?"); + p += sprintf(p, " %s(%s)", + (c0&0x40)?((art&0x70)?"UDMA":" DMA"):" PIO", + ((art&0x70)==0x70)?"6": + ((art&0x60)==0x60)?"5": + ((art&0x50)==0x50)?"4": + ((art&0x40)==0x40)?"3": + ((art&0x30)==0x30)?"2": + ((art&0x20)==0x20)?"1": + ((art&0x10)==0x10)?"0":"?"); + (void) pci_read_config_byte(dev, 0x45, &art); + p += sprintf(p, " %s(%s)", + (c1&0x20)?((art&0x07)?"UDMA":" DMA"):" PIO", + ((art&0x07)==0x07)?"6": + ((art&0x06)==0x06)?"5": + ((art&0x05)==0x05)?"4": + ((art&0x04)==0x04)?"3": + ((art&0x03)==0x03)?"2": + ((art&0x02)==0x02)?"1": + ((art&0x01)==0x01)?"0":"?"); + p += sprintf(p, " %s(%s)\n", + (c1&0x40)?((art&0x70)?"UDMA":" DMA"):" PIO", + ((art&0x70)==0x70)?"6": + ((art&0x60)==0x60)?"5": + ((art&0x50)==0x50)?"4": + ((art&0x40)==0x40)?"3": + ((art&0x30)==0x30)?"2": + ((art&0x20)==0x20)?"1": + ((art&0x10)==0x10)?"0":"?"); +#ifdef DEBUG_AEC_REGS + (void) pci_read_config_byte(dev, 0x40, &art); + p += sprintf(p, "Active: 0x%02x", HIGH_4(art)); + (void) pci_read_config_byte(dev, 0x41, &art); + p += sprintf(p, " 0x%02x", HIGH_4(art)); + (void) pci_read_config_byte(dev, 0x42, &art); + p += sprintf(p, " 0x%02x", HIGH_4(art)); + (void) pci_read_config_byte(dev, 0x43, &art); + p += sprintf(p, " 0x%02x\n", HIGH_4(art)); + (void) pci_read_config_byte(dev, 0x40, &art); + p += sprintf(p, "Recovery: 0x%02x", LOW_4(art)); + (void) pci_read_config_byte(dev, 0x41, &art); + p += sprintf(p, " 0x%02x", LOW_4(art)); + (void) pci_read_config_byte(dev, 0x42, &art); + p += sprintf(p, " 0x%02x", LOW_4(art)); + (void) pci_read_config_byte(dev, 0x43, &art); + p += sprintf(p, " 0x%02x\n", LOW_4(art)); + (void) pci_read_config_byte(dev, 0x49, &uart); + p += sprintf(p, "reg49h = 0x%02x ", uart); + (void) pci_read_config_byte(dev, 0x4a, &uart); + p += sprintf(p, "reg4ah = 0x%02x\n", uart); +#endif /* DEBUG_AEC_REGS */ + } + } + return p-buffer;/* => must be less than 4k! */ +} +#endif /* defined(DISPLAY_AEC62xx_TIMINGS) && defined(CONFIG_PROC_FS) */ + +/* + * TO DO: active tuning and correction of cards without a bios. + */ +static u8 pci_bus_clock_list (u8 speed, struct chipset_bus_clock_list_entry * chipset_table) +{ + for ( ; chipset_table->xfer_speed ; chipset_table++) + if (chipset_table->xfer_speed == speed) { + return chipset_table->chipset_settings; + } + return chipset_table->chipset_settings; +} + +static u8 pci_bus_clock_list_ultra (u8 speed, struct chipset_bus_clock_list_entry * chipset_table) +{ + for ( ; chipset_table->xfer_speed ; chipset_table++) + if (chipset_table->xfer_speed == speed) { + return chipset_table->ultra_settings; + } + return chipset_table->ultra_settings; +} + +static u8 aec62xx_ratemask (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 mode; + + switch(hwif->pci_dev->device) { + case PCI_DEVICE_ID_ARTOP_ATP865: + case PCI_DEVICE_ID_ARTOP_ATP865R: +#if 0 + mode = (hwif->INB(hwif->dma_master) & 0x10) ? 4 : 3; +#else + mode = (hwif->INB(((hwif->channel) ? + hwif->mate->dma_status : + hwif->dma_status)) & 0x10) ? 4 : 3; +#endif + break; + case PCI_DEVICE_ID_ARTOP_ATP860: + case PCI_DEVICE_ID_ARTOP_ATP860R: + mode = 2; + break; + case PCI_DEVICE_ID_ARTOP_ATP850UF: + default: + return 1; + } + + if (!eighty_ninty_three(drive)) + mode = min(mode, (u8)1); + return mode; +} + +static u8 aec62xx_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + /* AEC's ratemask is between 0-4 and capped at UDMA133 */ + return min(speed, speed_max[aec62xx_ratemask(drive)]); +#else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static int aec6210_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u16 d_conf = 0; + u8 ultra = 0, speed = aec62xx_ratefilter(drive, xferspeed); +// u8 ultra = 0, speed = speed_ratefilter(drive, xferspeed); + u8 ultra_conf = 0, tmp0 = 0; + u8 tmp1 = 0, tmp2 = 0; + unsigned long flags; + + local_irq_save(flags); + pci_read_config_word(dev, 0x40|(2*drive->dn), &d_conf); + tmp0 = pci_bus_clock_list(speed, BUSCLOCK(dev)); + SPLIT_BYTE(tmp0,tmp1,tmp2); + MAKE_WORD(d_conf,tmp1,tmp2); + pci_write_config_word(dev, 0x40|(2*drive->dn), d_conf); + + tmp1 = 0x00; + tmp2 = 0x00; + pci_read_config_byte(dev, 0x54, &ultra); + tmp1 = ((0x00 << (2*drive->dn)) | (ultra & ~(3 << (2*drive->dn)))); + ultra_conf = pci_bus_clock_list_ultra(speed, BUSCLOCK(dev)); + tmp2 = ((ultra_conf << (2*drive->dn)) | (tmp1 & ~(3 << (2*drive->dn)))); + pci_write_config_byte(dev, 0x54, tmp2); + local_irq_restore(flags); + return(ide_config_drive_speed(drive, speed)); +} + +static int aec6260_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 tmp1 = 0, unit = (drive->select.b.unit & 0x01); + u8 tmp2 = 0, ultra_pci = hwif->channel ? 0x45 : 0x44; + u8 ultra = 0, speed = aec62xx_ratefilter(drive, xferspeed); +// u8 ultra = 0, speed = speed_ratefilter(drive, xferspeed); + u8 drive_conf = 0, ultra_conf = 0; + unsigned long flags; + + local_irq_save(flags); + pci_read_config_byte(dev, 0x40|drive->dn, &drive_conf); + drive_conf = pci_bus_clock_list(speed, BUSCLOCK(dev)); + pci_write_config_byte(dev, 0x40|drive->dn, drive_conf); + + pci_read_config_byte(dev, ultra_pci, &ultra); + tmp1 = ((0x00 << (4*unit)) | (ultra & ~(7 << (4*unit)))); + ultra_conf = pci_bus_clock_list_ultra(speed, BUSCLOCK(dev)); + tmp2 = ((ultra_conf << (4*unit)) | (tmp1 & ~(7 << (4*unit)))); + pci_write_config_byte(dev, ultra_pci, tmp2); + local_irq_restore(flags); + return(ide_config_drive_speed(drive, speed)); +} + +static int aec62xx_tune_chipset (ide_drive_t *drive, u8 speed) +{ + switch (HWIF(drive)->pci_dev->device) { + case PCI_DEVICE_ID_ARTOP_ATP865: + case PCI_DEVICE_ID_ARTOP_ATP865R: + case PCI_DEVICE_ID_ARTOP_ATP860: + case PCI_DEVICE_ID_ARTOP_ATP860R: + return ((int) aec6260_tune_chipset(drive, speed)); + case PCI_DEVICE_ID_ARTOP_ATP850UF: + return ((int) aec6210_tune_chipset(drive, speed)); + default: + return -1; + } +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +static int config_chipset_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + u8 speed = 0, mode = aec62xx_ratemask(drive); + + if (drive->media != ide_disk) + return 0; + + switch(mode) { + case 0x04: + if (id->dma_ultra & 0x0040) + { speed = XFER_UDMA_6; break; } + case 0x03: + if (id->dma_ultra & 0x0020) + { speed = XFER_UDMA_5; break; } + case 0x02: + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_4; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_3; break; } + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_mword & 0x0001) + { speed = XFER_MW_DMA_0; break; } + if (id->dma_1word & 0x0004) + { speed = XFER_SW_DMA_2; break; } + if (id->dma_1word & 0x0002) + { speed = XFER_SW_DMA_1; break; } + if (id->dma_1word & 0x0001) + { speed = XFER_SW_DMA_0; break; } + default: + return 0; + } + + (void) aec62xx_tune_chipset(drive, speed); + + return ((int) ((((id->dma_ultra >> 8) & 0x7F) || + ((id->dma_mword >> 8) & 0x07) || + ((id->dma_1word >> 8) & 0x07)) ? 1 : 0)); +} + +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +static void aec62xx_tune_drive (ide_drive_t *drive, u8 pio) +{ + u8 speed = 0; + u8 new_pio = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL); + + switch(pio) { + case 5: speed = new_pio; break; + case 4: speed = XFER_PIO_4; break; + case 3: speed = XFER_PIO_3; break; + case 2: speed = XFER_PIO_2; break; + case 1: speed = XFER_PIO_1; break; + default: speed = XFER_PIO_0; break; + } + (void) aec62xx_tune_chipset(drive, speed); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + if (id && (id->capability & 1) && drive->autodma) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + if (id->field_valid & 4) { + if (id->dma_ultra & 0x007F) { + /* Force if Capable UltraDMA */ + int dma = config_chipset_for_dma(drive); + if ((id->field_valid & 2) && !dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + (id->dma_1word & 0x0007)) { + /* Force if Capable regular DMA modes */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + aec62xx_tune_drive(drive, 5); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} + +static int aec62xx_irq_timeout (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + + switch(dev->device) { + case PCI_DEVICE_ID_ARTOP_ATP860: + case PCI_DEVICE_ID_ARTOP_ATP860R: + case PCI_DEVICE_ID_ARTOP_ATP865: + case PCI_DEVICE_ID_ARTOP_ATP865R: + printk(" AEC62XX time out "); +#if 0 + { + int i = 0; + u8 reg49h = 0; + pci_read_config_byte(HWIF(drive)->pci_dev, 0x49, ®49h); + for (i=0;i<256;i++) + pci_write_config_byte(HWIF(drive)->pci_dev, 0x49, reg49h|0x10); + pci_write_config_byte(HWIF(drive)->pci_dev, 0x49, reg49h & ~0x10); + } + return 0; +#endif + default: + break; + } +#if 0 + { + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 tmp1 = 0, tmp2 = 0, mode6 = 0; + + pci_read_config_byte(dev, 0x44, &tmp1); + pci_read_config_byte(dev, 0x45, &tmp2); + printk(" AEC6280 r44=%x r45=%x ",tmp1,tmp2); + mode6 = HWIF(drive)->INB(((hwif->channel) ? + hwif->mate->dma_status : + hwif->dma_status)); + printk(" AEC6280 133=%x ", (mode6 & 0x10)); + } +#endif + return 0; +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +static unsigned int __init init_chipset_aec62xx (struct pci_dev *dev, const char *name) +{ + int bus_speed = system_bus_clock(); + + if (dev->resource[PCI_ROM_RESOURCE].start) { + pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); + printk("%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start); + } + +#if defined(DISPLAY_AEC62XX_TIMINGS) && defined(CONFIG_PROC_FS) + aec_devs[n_aec_devs++] = dev; + + if (!aec62xx_proc) { + aec62xx_proc = 1; + ide_pci_register_host_proc(&aec62xx_procs[0]); + } +#endif /* DISPLAY_AEC62XX_TIMINGS && CONFIG_PROC_FS */ + + if (bus_speed <= 33) + pci_set_drvdata(dev, (void *) aec6xxx_33_base); + else + pci_set_drvdata(dev, (void *) aec6xxx_34_base); + + return dev->irq; +} + +static void __init init_hwif_aec62xx (ide_hwif_t *hwif) +{ + hwif->autodma = 0; + hwif->tuneproc = &aec62xx_tune_drive; + hwif->speedproc = &aec62xx_tune_chipset; + hwif->ratemask = &aec62xx_ratemask; + hwif->ratefilter = &aec62xx_ratefilter; + + if (hwif->pci_dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) { + hwif->serialized = hwif->channel; + hwif->no_dsc = 1; + } + + if (hwif->mate) + hwif->mate->serialized = hwif->serialized; + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + hwif->ide_dma_check = &aec62xx_config_drive_xfer_rate; + hwif->ide_dma_lostirq = &aec62xx_irq_timeout; + hwif->ide_dma_timeout = &aec62xx_irq_timeout; + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static void __init init_dma_aec62xx (ide_hwif_t *hwif, unsigned long dmabase) +{ + struct pci_dev *dev = hwif->pci_dev; + + if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) { + u8 reg54h = 0; + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + pci_read_config_byte(dev, 0x54, ®54h); + pci_write_config_byte(dev, 0x54, reg54h & ~(hwif->channel ? 0xF0 : 0x0F)); + spin_unlock_irqrestore(&io_request_lock, flags); + } else { + u8 ata66 = 0; + pci_read_config_byte(hwif->pci_dev, 0x49, &ata66); + if (!(hwif->udma_four)) + hwif->udma_four = (ata66&(hwif->channel?0x02:0x01))?0:1; + } + + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_aec62xx (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +static void __init init_setup_aec6x80 (struct pci_dev *dev, ide_pci_device_t *d) +{ + u32 bar4reg = pci_resource_start(dev, 4); + + if (IN_BYTE(bar4reg+2) & 0x10) { + strcpy(d->name, "AEC6880"); + if (dev->device == PCI_DEVICE_ID_ARTOP_ATP865R) + strcpy(d->name, "AEC6880R"); + } else { + strcpy(d->name, "AEC6280"); + if (dev->device == PCI_DEVICE_ID_ARTOP_ATP865R) + strcpy(d->name, "AEC6280R"); + } + + ide_setup_pci_device(dev, d); +} + +int __init aec62xx_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_ARTOP) + return 0; + + for (d = aec62xx_chipsets; + d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/aec62xx.h linux.20pre5-ac2/drivers/ide/pci/aec62xx.h --- linux.20pre5/drivers/ide/pci/aec62xx.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/aec62xx.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,180 @@ +#ifndef AEC62XX_H +#define AEC62XX_H + +#include +#include +#include + +#define DISPLAY_AEC62XX_TIMINGS + +struct chipset_bus_clock_list_entry { + byte xfer_speed; + byte chipset_settings; + byte ultra_settings; +}; + +struct chipset_bus_clock_list_entry aec6xxx_33_base [] = { +#ifdef CONFIG_BLK_DEV_IDEDMA + { XFER_UDMA_6, 0x31, 0x07 }, + { XFER_UDMA_5, 0x31, 0x06 }, + { XFER_UDMA_4, 0x31, 0x05 }, + { XFER_UDMA_3, 0x31, 0x04 }, + { XFER_UDMA_2, 0x31, 0x03 }, + { XFER_UDMA_1, 0x31, 0x02 }, + { XFER_UDMA_0, 0x31, 0x01 }, + + { XFER_MW_DMA_2, 0x31, 0x00 }, + { XFER_MW_DMA_1, 0x31, 0x00 }, + { XFER_MW_DMA_0, 0x0a, 0x00 }, +#endif /* CONFIG_BLK_DEV_IDEDMA */ + { XFER_PIO_4, 0x31, 0x00 }, + { XFER_PIO_3, 0x33, 0x00 }, + { XFER_PIO_2, 0x08, 0x00 }, + { XFER_PIO_1, 0x0a, 0x00 }, + { XFER_PIO_0, 0x00, 0x00 }, + { 0, 0x00, 0x00 } +}; + +struct chipset_bus_clock_list_entry aec6xxx_34_base [] = { +#ifdef CONFIG_BLK_DEV_IDEDMA + { XFER_UDMA_6, 0x41, 0x06 }, + { XFER_UDMA_5, 0x41, 0x05 }, + { XFER_UDMA_4, 0x41, 0x04 }, + { XFER_UDMA_3, 0x41, 0x03 }, + { XFER_UDMA_2, 0x41, 0x02 }, + { XFER_UDMA_1, 0x41, 0x01 }, + { XFER_UDMA_0, 0x41, 0x01 }, + + { XFER_MW_DMA_2, 0x41, 0x00 }, + { XFER_MW_DMA_1, 0x42, 0x00 }, + { XFER_MW_DMA_0, 0x7a, 0x00 }, +#endif /* CONFIG_BLK_DEV_IDEDMA */ + { XFER_PIO_4, 0x41, 0x00 }, + { XFER_PIO_3, 0x43, 0x00 }, + { XFER_PIO_2, 0x78, 0x00 }, + { XFER_PIO_1, 0x7a, 0x00 }, + { XFER_PIO_0, 0x70, 0x00 }, + { 0, 0x00, 0x00 } +}; + + +#ifndef HIGH_4 +#define HIGH_4(H) ((H)=(H>>4)) +#endif +#ifndef LOW_4 +#define LOW_4(L) ((L)=(L-((L>>4)<<4))) +#endif +#ifndef SPLIT_BYTE +#define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4))) +#endif +#ifndef MAKE_WORD +#define MAKE_WORD(W,HB,LB) ((W)=((HB<<8)+LB)) +#endif + +#define BUSCLOCK(D) \ + ((struct chipset_bus_clock_list_entry *) pci_get_drvdata((D))) + +#if defined(DISPLAY_AEC62XX_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 aec62xx_proc; + +static int aec62xx_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t aec62xx_procs[] __initdata = { + { + name: "aec62xx", + set: 1, + get_info: aec62xx_get_info, + parent: NULL, + }, +}; +#endif /* DISPLAY_AEC62XX_TIMINGS && CONFIG_PROC_FS */ + +static void init_setup_aec6x80(struct pci_dev *, ide_pci_device_t *); +static void init_setup_aec62xx(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_aec62xx(struct pci_dev *, const char *); +static void init_hwif_aec62xx(ide_hwif_t *); +static void init_dma_aec62xx(ide_hwif_t *, unsigned long); + +static ide_pci_device_t aec62xx_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_ARTOP, + device: PCI_DEVICE_ID_ARTOP_ATP850UF, + name: "AEC6210", + init_setup: init_setup_aec62xx, + init_chipset: init_chipset_aec62xx, + init_iops: NULL, + init_hwif: init_hwif_aec62xx, + init_dma: init_dma_aec62xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, + bootable: OFF_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_ARTOP, + device: PCI_DEVICE_ID_ARTOP_ATP860, + name: "AEC6260", + init_setup: init_setup_aec62xx, + init_chipset: init_chipset_aec62xx, + init_iops: NULL, + init_hwif: init_hwif_aec62xx, + init_dma: init_dma_aec62xx, + channels: 2, + autodma: NOAUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_ARTOP, + device: PCI_DEVICE_ID_ARTOP_ATP860R, + name: "AEC6260R", + init_setup: init_setup_aec62xx, + init_chipset: init_chipset_aec62xx, + init_iops: NULL, + init_hwif: init_hwif_aec62xx, + init_dma: init_dma_aec62xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, + bootable: NEVER_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_ARTOP, + device: PCI_DEVICE_ID_ARTOP_ATP865, + name: "AEC6X80", + init_setup: init_setup_aec6x80, + init_chipset: init_chipset_aec62xx, + init_iops: NULL, + init_hwif: init_hwif_aec62xx, + init_dma: init_dma_aec62xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_ARTOP, + device: PCI_DEVICE_ID_ARTOP_ATP865R, + name: "AEC6X80R", + init_setup: init_setup_aec6x80, + init_chipset: init_chipset_aec62xx, + init_iops: NULL, + init_hwif: init_hwif_aec62xx, + init_dma: init_dma_aec62xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, + bootable: OFF_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* AEC62XX_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/alim15x3.c linux.20pre5-ac2/drivers/ide/pci/alim15x3.c --- linux.20pre5/drivers/ide/pci/alim15x3.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/alim15x3.c 2002-09-01 18:00:23.000000000 +0100 @@ -0,0 +1,938 @@ +/* + * linux/drivers/ide/alim15x3.c Version 0.15 2002/08/19 + * + * Copyright (C) 1998-2000 Michel Aubry, Maintainer + * Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer + * Copyright (C) 1999-2000 CJ, cjtsai@ali.com.tw, Maintainer + * + * Copyright (C) 1998-2000 Andre Hedrick (andre@linux-ide.org) + * May be copied or modified under the terms of the GNU General Public License + * Copyright (C) 2002 Alan Cox + * + * (U)DMA capable version of ali 1533/1543(C), 1535(D) + * + ********************************************************************** + * 9/7/99 --Parts from the above author are included and need to be + * converted into standard interface, once I finish the thought. + * + * Recent changes + * Don't use LBA48 mode on ALi <= 0xC4 + * Don't poke 0x79 with a non ALi northbridge + * Don't flip undefined bits on newer chipsets (fix Fujitsu laptop hang) + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ide_modes.h" +#include "alim15x3.h" + +/* + * ALi devices are not plug in. Otherwise these static values would + * need to go. They ought to go away anyway + */ + +static u8 m5229_revision; +static u8 chip_is_1543c_e; +static struct pci_dev *isa_dev; + +#if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 ali_proc = 0; + +static struct pci_dev *bmide_dev; + +static char *fifo[4] = { + "FIFO Off", + "FIFO On ", + "DMA mode", + "PIO mode" }; + +static char *udmaT[8] = { + "1.5T", + " 2T", + "2.5T", + " 3T", + "3.5T", + " 4T", + " 6T", + " 8T" +}; + +static char *channel_status[8] = { + "OK ", + "busy ", + "DRQ ", + "DRQ busy ", + "error ", + "error busy ", + "error DRQ ", + "error DRQ busy" +}; + +/** + * ali_get_info - generate proc file for ALi IDE + * @buffer: buffer to fill + * @addr: address of user start in buffer + * @offset: offset into 'file' + * @count: buffer count + * + * Walks the Ali devices and outputs summary data on the tuning and + * anything else that will help with debugging + */ + +static int ali_get_info (char *buffer, char **addr, off_t offset, int count) +{ + u32 bibma; + u8 reg53h, reg5xh, reg5yh, reg5xh1, reg5yh1, c0, c1, rev, tmp; + char *q, *p = buffer; + + /* fetch rev. */ + pci_read_config_byte(bmide_dev, 0x08, &rev); + if (rev >= 0xc1) /* M1543C or newer */ + udmaT[7] = " ???"; + else + fifo[3] = " ??? "; + + /* first fetch bibma: */ + pci_read_config_dword(bmide_dev, 0x20, &bibma); + bibma = (bibma & 0xfff0) ; + /* + * at that point bibma+0x2 et bibma+0xa are byte + * registers to investigate: + */ + c0 = IN_BYTE((unsigned short)bibma + 0x02); + c1 = IN_BYTE((unsigned short)bibma + 0x0a); + + p += sprintf(p, + "\n Ali M15x3 Chipset.\n"); + p += sprintf(p, + " ------------------\n"); + pci_read_config_byte(bmide_dev, 0x78, ®53h); + p += sprintf(p, "PCI Clock: %d.\n", reg53h); + + pci_read_config_byte(bmide_dev, 0x53, ®53h); + p += sprintf(p, + "CD_ROM FIFO:%s, CD_ROM DMA:%s\n", + (reg53h & 0x02) ? "Yes" : "No ", + (reg53h & 0x01) ? "Yes" : "No " ); + pci_read_config_byte(bmide_dev, 0x74, ®53h); + p += sprintf(p, + "FIFO Status: contains %d Words, runs%s%s\n\n", + (reg53h & 0x3f), + (reg53h & 0x40) ? " OVERWR" : "", + (reg53h & 0x80) ? " OVERRD." : "." ); + + p += sprintf(p, + "-------------------primary channel" + "-------------------secondary channel" + "---------\n\n"); + + pci_read_config_byte(bmide_dev, 0x09, ®53h); + p += sprintf(p, + "channel status: %s" + " %s\n", + (reg53h & 0x20) ? "On " : "Off", + (reg53h & 0x10) ? "On " : "Off" ); + + p += sprintf(p, + "both channels togth: %s" + " %s\n", + (c0&0x80) ? "No " : "Yes", + (c1&0x80) ? "No " : "Yes" ); + + pci_read_config_byte(bmide_dev, 0x76, ®53h); + p += sprintf(p, + "Channel state: %s %s\n", + channel_status[reg53h & 0x07], + channel_status[(reg53h & 0x70) >> 4] ); + + pci_read_config_byte(bmide_dev, 0x58, ®5xh); + pci_read_config_byte(bmide_dev, 0x5c, ®5yh); + p += sprintf(p, + "Add. Setup Timing: %dT" + " %dT\n", + (reg5xh & 0x07) ? (reg5xh & 0x07) : 8, + (reg5yh & 0x07) ? (reg5yh & 0x07) : 8 ); + + pci_read_config_byte(bmide_dev, 0x59, ®5xh); + pci_read_config_byte(bmide_dev, 0x5d, ®5yh); + p += sprintf(p, + "Command Act. Count: %dT" + " %dT\n" + "Command Rec. Count: %dT" + " %dT\n\n", + (reg5xh & 0x70) ? ((reg5xh & 0x70) >> 4) : 8, + (reg5yh & 0x70) ? ((reg5yh & 0x70) >> 4) : 8, + (reg5xh & 0x0f) ? (reg5xh & 0x0f) : 16, + (reg5yh & 0x0f) ? (reg5yh & 0x0f) : 16 ); + + p += sprintf(p, + "----------------drive0-----------drive1" + "------------drive0-----------drive1------\n\n"); + p += sprintf(p, + "DMA enabled: %s %s" + " %s %s\n", + (c0&0x20) ? "Yes" : "No ", + (c0&0x40) ? "Yes" : "No ", + (c1&0x20) ? "Yes" : "No ", + (c1&0x40) ? "Yes" : "No " ); + + pci_read_config_byte(bmide_dev, 0x54, ®5xh); + pci_read_config_byte(bmide_dev, 0x55, ®5yh); + q = "FIFO threshold: %2d Words %2d Words" + " %2d Words %2d Words\n"; + if (rev < 0xc1) { + if ((rev == 0x20) && + (pci_read_config_byte(bmide_dev, 0x4f, &tmp), (tmp &= 0x20))) { + p += sprintf(p, q, 8, 8, 8, 8); + } else { + p += sprintf(p, q, + (reg5xh & 0x03) + 12, + ((reg5xh & 0x30)>>4) + 12, + (reg5yh & 0x03) + 12, + ((reg5yh & 0x30)>>4) + 12 ); + } + } else { + int t1 = (tmp = (reg5xh & 0x03)) ? (tmp << 3) : 4; + int t2 = (tmp = ((reg5xh & 0x30)>>4)) ? (tmp << 3) : 4; + int t3 = (tmp = (reg5yh & 0x03)) ? (tmp << 3) : 4; + int t4 = (tmp = ((reg5yh & 0x30)>>4)) ? (tmp << 3) : 4; + p += sprintf(p, q, t1, t2, t3, t4); + } + +#if 0 + p += sprintf(p, + "FIFO threshold: %2d Words %2d Words" + " %2d Words %2d Words\n", + (reg5xh & 0x03) + 12, + ((reg5xh & 0x30)>>4) + 12, + (reg5yh & 0x03) + 12, + ((reg5yh & 0x30)>>4) + 12 ); +#endif + + p += sprintf(p, + "FIFO mode: %s %s %s %s\n", + fifo[((reg5xh & 0x0c) >> 2)], + fifo[((reg5xh & 0xc0) >> 6)], + fifo[((reg5yh & 0x0c) >> 2)], + fifo[((reg5yh & 0xc0) >> 6)] ); + + pci_read_config_byte(bmide_dev, 0x5a, ®5xh); + pci_read_config_byte(bmide_dev, 0x5b, ®5xh1); + pci_read_config_byte(bmide_dev, 0x5e, ®5yh); + pci_read_config_byte(bmide_dev, 0x5f, ®5yh1); + + p += sprintf(p,/* + "------------------drive0-----------drive1" + "------------drive0-----------drive1------\n")*/ + "Dt RW act. Cnt %2dT %2dT" + " %2dT %2dT\n" + "Dt RW rec. Cnt %2dT %2dT" + " %2dT %2dT\n\n", + (reg5xh & 0x70) ? ((reg5xh & 0x70) >> 4) : 8, + (reg5xh1 & 0x70) ? ((reg5xh1 & 0x70) >> 4) : 8, + (reg5yh & 0x70) ? ((reg5yh & 0x70) >> 4) : 8, + (reg5yh1 & 0x70) ? ((reg5yh1 & 0x70) >> 4) : 8, + (reg5xh & 0x0f) ? (reg5xh & 0x0f) : 16, + (reg5xh1 & 0x0f) ? (reg5xh1 & 0x0f) : 16, + (reg5yh & 0x0f) ? (reg5yh & 0x0f) : 16, + (reg5yh1 & 0x0f) ? (reg5yh1 & 0x0f) : 16 ); + + p += sprintf(p, + "-----------------------------------UDMA Timings" + "--------------------------------\n\n"); + + pci_read_config_byte(bmide_dev, 0x56, ®5xh); + pci_read_config_byte(bmide_dev, 0x57, ®5yh); + p += sprintf(p, + "UDMA: %s %s" + " %s %s\n" + "UDMA timings: %s %s" + " %s %s\n\n", + (reg5xh & 0x08) ? "OK" : "No", + (reg5xh & 0x80) ? "OK" : "No", + (reg5yh & 0x08) ? "OK" : "No", + (reg5yh & 0x80) ? "OK" : "No", + udmaT[(reg5xh & 0x07)], + udmaT[(reg5xh & 0x70) >> 4], + udmaT[reg5yh & 0x07], + udmaT[(reg5yh & 0x70) >> 4] ); + + return p-buffer; /* => must be less than 4k! */ +} +#endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */ + +/** + * ali15x3_tune_drive - set up a drive + * @drive: drive to tune + * @pio: unused + * + * Select the best PIO timing for the drive in question. Then + * program the controller for this drive set up + */ + +static void ali15x3_tune_drive (ide_drive_t *drive, u8 pio) +{ + ide_pio_data_t d; + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + int s_time, a_time, c_time; + u8 s_clc, a_clc, r_clc; + unsigned long flags; + int bus_speed = system_bus_clock(); + int port = hwif->channel ? 0x5c : 0x58; + int portFIFO = hwif->channel ? 0x55 : 0x54; + u8 cd_dma_fifo = 0; + + pio = ide_get_best_pio_mode(drive, pio, 5, &d); + s_time = ide_pio_timings[pio].setup_time; + a_time = ide_pio_timings[pio].active_time; + if ((s_clc = (s_time * bus_speed + 999) / 1000) >= 8) + s_clc = 0; + if ((a_clc = (a_time * bus_speed + 999) / 1000) >= 8) + a_clc = 0; + c_time = ide_pio_timings[pio].cycle_time; + +#if 0 + if ((r_clc = ((c_time - s_time - a_time) * bus_speed + 999) / 1000) >= 16) + r_clc = 0; +#endif + + if (!(r_clc = (c_time * bus_speed + 999) / 1000 - a_clc - s_clc)) { + r_clc = 1; + } else { + if (r_clc >= 16) + r_clc = 0; + } + local_irq_save(flags); + + /* + * PIO mode => ATA FIFO on, ATAPI FIFO off + */ + pci_read_config_byte(dev, portFIFO, &cd_dma_fifo); + if (drive->media==ide_disk) { + if (hwif->channel) { + pci_write_config_byte(dev, portFIFO, (cd_dma_fifo & 0x0F) | 0x50); + } else { + pci_write_config_byte(dev, portFIFO, (cd_dma_fifo & 0xF0) | 0x05); + } + } else { + if (hwif->channel) { + pci_write_config_byte(dev, portFIFO, cd_dma_fifo & 0x0F); + } else { + pci_write_config_byte(dev, portFIFO, cd_dma_fifo & 0xF0); + } + } + + pci_write_config_byte(dev, port, s_clc); + pci_write_config_byte(dev, port+drive->select.b.unit+2, (a_clc << 4) | r_clc); + local_irq_restore(flags); + + /* + * setup active rec + * { 70, 165, 365 }, PIO Mode 0 + * { 50, 125, 208 }, PIO Mode 1 + * { 30, 100, 110 }, PIO Mode 2 + * { 30, 80, 70 }, PIO Mode 3 with IORDY + * { 25, 70, 25 }, PIO Mode 4 with IORDY ns + * { 20, 50, 30 } PIO Mode 5 with IORDY (nonstandard) + */ + +} + +/** + * ali15x3_can_ultra - check for ultra DMA support + * @drive: drive to do the check + * + * Check the drive and controller revisions. Return 0 if UDMA is + * not available, or 1 if UDMA can be used. The actual rules for + * the ALi are + * No UDMA on revisions <= 0x20 + * Disk only for revisions < 0xC2 + * Not WDC drives for revisions < 0xC2 + * + * FIXME: WDC ifdef needs to die + */ + +static u8 ali15x3_can_ultra (ide_drive_t *drive) +{ +#ifndef CONFIG_WDC_ALI15X3 + struct hd_driveid *id = drive->id; +#endif /* CONFIG_WDC_ALI15X3 */ + + if (m5229_revision <= 0x20) { + return 0; + } else if ((m5229_revision < 0xC2) && +#ifndef CONFIG_WDC_ALI15X3 + ((chip_is_1543c_e && strstr(id->model, "WDC ")) || + (drive->media!=ide_disk))) { +#else /* CONFIG_WDC_ALI15X3 */ + (drive->media!=ide_disk)) { +#endif /* CONFIG_WDC_ALI15X3 */ + return 0; + } else { + return 1; + } +} + +/** + * ali15x3_ratemask - generate DMA mode list + * @drive: drive to compute against + * + * Generate a list of the available DMA modes for the drive. + * FIXME: this function contains lots of bogus masking we can dump + * + * Return the highest available mode (UDMA33, UDMA66, UDMA100,..) + */ + +static u8 ali15x3_ratemask (ide_drive_t *drive) +{ + u8 mode = 0, can_ultra = ali15x3_can_ultra(drive); + + if (m5229_revision >= 0xC4 && can_ultra) { + mode = 3; + } else if (m5229_revision >= 0xC2 && can_ultra) { + mode = 2; + } else if (can_ultra) { + return 1; + } else { + return 0; + } + + /* + * If the drive sees no suitable cable then UDMA 33 + * is the highest permitted mode + */ + + if (!eighty_ninty_three(drive) && (mode)) + mode = min(mode, (u8)1); + return mode; +} + +/** + * ali15x3_ratefilter - return the best available speed + * @drive: drive to compute against + * @speed: desired speed + * + * Compute the best speed equal or below the requested speed that + * can be used for this drive and controller set up + * + * FIXME: bogus while loops should be assignments! + * FIXME: blk_dev_idedma should die (its now runtime anyway) + */ +static u8 ali15x3_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 top_speed[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + return min(speed, top_speed[ali15x3_ratemask(drive)]); +#else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +/** + * ali15x3_tune_chipset - set up chiset for new speed + * @drive: drive to configure for + * @xferspeed: desired speed + * + * Configure the hardware for the desired IDE transfer mode. + * We also do the needed drive configuration through helpers + */ + +static int ali15x3_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 speed = ali15x3_ratefilter(drive, xferspeed); + u8 unit = (drive->select.b.unit & 0x01); + u8 tmpbyte = 0x00; + int m5229_udma = (hwif->channel) ? 0x57 : 0x56; + + if (speed < XFER_UDMA_0) { + u8 ultra_enable = (unit) ? 0x7f : 0xf7; + /* + * clear "ultra enable" bit + */ + pci_read_config_byte(dev, m5229_udma, &tmpbyte); + tmpbyte &= ultra_enable; + pci_write_config_byte(dev, m5229_udma, tmpbyte); + + if (speed < XFER_SW_DMA_0) + ali15x3_tune_drive(drive, speed); +#ifdef CONFIG_BLK_DEV_IDEDMA + } else { + pci_read_config_byte(dev, m5229_udma, &tmpbyte); + tmpbyte &= (0x0f << ((1-unit) << 2)); + /* + * enable ultra dma and set timing + */ + tmpbyte |= ((0x08 | ((4-speed)&0x07)) << (unit << 2)); + pci_write_config_byte(dev, m5229_udma, tmpbyte); + if (speed >= XFER_UDMA_3) { + pci_read_config_byte(dev, 0x4b, &tmpbyte); + tmpbyte |= 1; + pci_write_config_byte(dev, 0x4b, tmpbyte); + } +#endif /* CONFIG_BLK_DEV_IDEDMA */ + } + return (ide_config_drive_speed(drive, speed)); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA + +/** + * config_chipset_for_dma - set up DMA mode + * @drive: drive to configure for + * + * Place a drive into DMA mode and tune the chipset for + * the selected speed. + * + * Returns true if DMA mode can be used + */ + +static int config_chipset_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + u8 speed = 0, mode = ali15x3_ratemask(drive); + + switch(mode) { + case 0x03: + if (id->dma_ultra & 0x0020) + { speed = XFER_UDMA_5; break; } + case 0x02: + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_4; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_3; break; } + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_mword & 0x0001) + { speed = XFER_MW_DMA_0; break; } + if (id->dma_1word & 0x0004) + { speed = XFER_SW_DMA_2; break; } + if (id->dma_1word & 0x0002) + { speed = XFER_SW_DMA_1; break; } + if (id->dma_1word & 0x0001) + { speed = XFER_SW_DMA_0; break; } + default: + return 0; + } + + (void) ali15x3_tune_chipset(drive, speed); + + return ((int) ((((id->dma_ultra >> 8) & 0x3F) || + ((id->dma_mword >> 8) & 0x07) || + ((id->dma_1word >> 8) & 0x07)) ? 1 : 0)); +} + +/** + * ali15x3_config_drive_for_dma - configure for DMA + * @drive: drive to configure + * + * Configure a drive for DMA operation. If DMA is not possible we + * drop the drive into PIO mode instead. + * + * FIXME: exactly what are we trying to return here + */ + +static int ali15x3_config_drive_for_dma(ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + if ((m5229_revision<=0x20) && (drive->media!=ide_disk)) + return HWIF(drive)->ide_dma_off_quietly(drive); + + drive->init_speed = 0; + + if ((id != NULL) && ((id->capability & 1) != 0) && drive->autodma) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + if ((id->field_valid & 4) && (m5229_revision >= 0xC2)) { + if (id->dma_ultra & 0x003F) { + /* Force if Capable UltraDMA */ + int dma = config_chipset_for_dma(drive); + if ((id->field_valid & 2) && !dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + (id->dma_1word & 0x0007)) { + /* Force if Capable regular DMA modes */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + HWIF(drive)->tuneproc(drive, 5); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} + +/** + * ali15x3_dma_write - do a DMA IDE write + * @drive: drive to issue write for + * + * Returns 1 if the DMA write cannot be performed, zero on + * success. + */ + +static int ali15x3_dma_write (ide_drive_t *drive) +{ + if ((m5229_revision < 0xC2) && (drive->media != ide_disk)) + return 1; /* try PIO instead of DMA */ + return __ide_dma_write(drive); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +/** + * init_chipset_ali15x3 - Initialise an ALi IDE controller + * @dev: PCI device + * @name: Name of the controller + * + * This function initializes the ALI IDE controller and where + * appropriate also sets up the 1533 southbridge. + */ + +static unsigned int __init init_chipset_ali15x3 (struct pci_dev *dev, const char *name) +{ + unsigned long flags; + u8 tmpbyte; + struct pci_dev *north = pci_find_slot(0, PCI_DEVFN(0,0)); + + pci_read_config_byte(dev, PCI_REVISION_ID, &m5229_revision); + + isa_dev = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); + +#if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) + if (!ali_proc) { + ali_proc = 1; + bmide_dev = dev; + ide_pci_register_host_proc(&ali_procs[0]); + } +#endif /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */ + + local_irq_save(flags); + + if (m5229_revision < 0xC2) { + /* + * revision 0x20 (1543-E, 1543-F) + * revision 0xC0, 0xC1 (1543C-C, 1543C-D, 1543C-E) + * clear CD-ROM DMA write bit, m5229, 0x4b, bit 7 + */ + pci_read_config_byte(dev, 0x4b, &tmpbyte); + /* + * clear bit 7 + */ + pci_write_config_byte(dev, 0x4b, tmpbyte & 0x7F); + local_irq_restore(flags); + return 0; + } + + /* + * 1543C-B?, 1535, 1535D, 1553 + * Note 1: not all "motherboard" support this detection + * Note 2: if no udma 66 device, the detection may "error". + * but in this case, we will not set the device to + * ultra 66, the detection result is not important + */ + + /* + * enable "Cable Detection", m5229, 0x4b, bit3 + */ + pci_read_config_byte(dev, 0x4b, &tmpbyte); + pci_write_config_byte(dev, 0x4b, tmpbyte | 0x08); + + /* + * We should only tune the 1533 enable if we are using an ALi + * North bridge + */ + if (north->vendor != PCI_VENDOR_ID_AL) { + local_irq_restore(flags); + return 0; + } + + /* + * set south-bridge's enable bit, m1533, 0x79 + */ + + pci_read_config_byte(isa_dev, 0x79, &tmpbyte); + if (m5229_revision == 0xC2) { + /* + * 1543C-B0 (m1533, 0x79, bit 2) + */ + pci_write_config_byte(isa_dev, 0x79, tmpbyte | 0x04); + } else if (m5229_revision >= 0xC3) { + /* + * 1553/1535 (m1533, 0x79, bit 1) + */ + pci_write_config_byte(isa_dev, 0x79, tmpbyte | 0x02); + } + + local_irq_restore(flags); + return 0; +} + +/** + * ata66_ali15x3 - check for UDMA 66 support + * @hwif: IDE interface + * + * This checks if the controller and the cable are capable + * of UDMA66 transfers. It doesn't check the drives. + * But see note 2 below! + * + * FIXME: frobs bits that are not defined on newer ALi devicea + */ + +static unsigned int __init ata66_ali15x3 (ide_hwif_t *hwif) +{ + struct pci_dev *dev = hwif->pci_dev; + unsigned int ata66 = 0; + u8 cable_80_pin[2] = { 0, 0 }; + + unsigned long flags; + u8 tmpbyte; + + local_irq_save(flags); + + if (m5229_revision >= 0xC2) { + /* + * Ultra66 cable detection (from Host View) + * m5229, 0x4a, bit0: primary, bit1: secondary 80 pin + */ + pci_read_config_byte(dev, 0x4a, &tmpbyte); + /* + * 0x4a, bit0 is 0 => primary channel + * has 80-pin (from host view) + */ + if (!(tmpbyte & 0x01)) cable_80_pin[0] = 1; + /* + * 0x4a, bit1 is 0 => secondary channel + * has 80-pin (from host view) + */ + if (!(tmpbyte & 0x02)) cable_80_pin[1] = 1; + /* + * Allow ata66 if cable of current channel has 80 pins + */ + ata66 = (hwif->channel)?cable_80_pin[1]:cable_80_pin[0]; + } else { + /* + * check m1533, 0x5e, bit 1~4 == 1001 => & 00011110 = 00010010 + */ + pci_read_config_byte(isa_dev, 0x5e, &tmpbyte); + chip_is_1543c_e = ((tmpbyte & 0x1e) == 0x12) ? 1: 0; + } + + /* + * CD_ROM DMA on (m5229, 0x53, bit0) + * Enable this bit even if we want to use PIO + * PIO FIFO off (m5229, 0x53, bit1) + * The hardware will use 0x54h and 0x55h to control PIO FIFO + * (Not on later devices it seems) + * + * 0x53 changes meaning on later revs - we must no touch + * bit 1 on them. Need to check if 0x20 is the right break + */ + + pci_read_config_byte(dev, 0x53, &tmpbyte); + + if(m5229_revision <= 0x20) + tmpbyte = (tmpbyte & (~0x02)) | 0x01; + else + tmpbyte |= 0x01; + + pci_write_config_byte(dev, 0x53, tmpbyte); + + local_irq_restore(flags); + + return(ata66); +} + +/** + * init_hwif_common_ali15x3 - Set up ALI IDE hardware + * @hwif: IDE interface + * + * Initialize the IDE structure side of the ALi 15x3 driver. + */ + +static void __init init_hwif_common_ali15x3 (ide_hwif_t *hwif) +{ + hwif->autodma = 0; + hwif->tuneproc = &ali15x3_tune_drive; + hwif->speedproc = &ali15x3_tune_chipset; + + hwif->ratemask = &ali15x3_ratemask; + hwif->ratefilter = &ali15x3_ratefilter; + + /* Don't use LBA48 on ALi devices before rev 0xC5 */ + hwif->addressing = (m5229_revision <= 0xC4) ? 1 : 0; + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + if (m5229_revision >= 0x20) { + /* + * M1543C or newer for DMAing + */ + hwif->ide_dma_check = &ali15x3_config_drive_for_dma; + hwif->ide_dma_write = &ali15x3_dma_write; + if (!noautodma) + hwif->autodma = 1; + if (!(hwif->udma_four)) + hwif->udma_four = ata66_ali15x3(hwif); + } + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +/** + * init_hwif_ali15x3 - Initialize the ALI IDE x86 stuff + * @hwif: interface to configure + * + * Obtain the IRQ tables for an ALi based IDE solution on the PC + * class platforms. This part of the code isn't applicable to the + * Sparc systems + */ + +static void __init init_hwif_ali15x3 (ide_hwif_t *hwif) +{ + u8 ideic, inmir; + u8 irq_routing_table[] = { -1, 9, 3, 10, 4, 5, 7, 6, + 1, 11, 0, 12, 0, 14, 0, 15 }; + + hwif->irq = hwif->channel ? 15 : 14; + + if (isa_dev) { + /* + * read IDE interface control + */ + pci_read_config_byte(isa_dev, 0x58, &ideic); + + /* bit0, bit1 */ + ideic = ideic & 0x03; + + /* get IRQ for IDE Controller */ + if ((hwif->channel && ideic == 0x03) || + (!hwif->channel && !ideic)) { + /* + * get SIRQ1 routing table + */ + pci_read_config_byte(isa_dev, 0x44, &inmir); + inmir = inmir & 0x0f; + hwif->irq = irq_routing_table[inmir]; + } else if (hwif->channel && !(ideic & 0x01)) { + /* + * get SIRQ2 routing table + */ + pci_read_config_byte(isa_dev, 0x75, &inmir); + inmir = inmir & 0x0f; + hwif->irq = irq_routing_table[inmir]; + } + } + + init_hwif_common_ali15x3(hwif); +} + +/** + * init_dma_ali15x3 - set up DMA on ALi15x3 + * @hwif: IDE interface + * @dmabase: DMA interface base PCI address + * + * Set up the DMA functionality on the ALi 15x3. For the ALi + * controllers this is generic so we can let the generic code do + * the actual work. + */ + +static void __init init_dma_ali15x3 (ide_hwif_t *hwif, unsigned long dmabase) +{ + if (m5229_revision < 0x20) + return; + if (!(hwif->channel)) + hwif->OUTB(hwif->INB(dmabase+2) & 0x60, dmabase+2); + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + + +/** + * init_setup_ali15x3 - set up an ALi15x3 IDE controller + * @dev: PCI device to set up + * @d: IDE PCI structures + * + * Perform the actual set up for the ALi15x3. + */ + +static void __init init_setup_ali15x3 (struct pci_dev *dev, ide_pci_device_t *d) +{ +#if defined(CONFIG_SPARC64) + d->init_hwif = init_hwif_common_ali15x3; +#endif /* CONFIG_SPARC64 */ + ide_setup_pci_device(dev, d); +} + +/** + * ali15x3_scan_pcidev - check for ali pci ide + * @dev: device found by IDE ordered scan + * + * If the device is a known ALi IDE controller we set it up and + * then return 1. If we do not know it, or set up fails we return 0 + * and it will be offered to other drivers or taken generic + */ + +int __init ali15x3_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_AL) + return 0; + + for (d = ali15x3_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/alim15x3.h linux.20pre5-ac2/drivers/ide/pci/alim15x3.h --- linux.20pre5/drivers/ide/pci/alim15x3.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/alim15x3.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,57 @@ +#ifndef ALI15X3_H +#define ALI15X3_H + +#include +#include +#include + +#define DISPLAY_ALI_TIMINGS + +#if defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 ali_proc; + +static int ali_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t ali_procs[] __initdata = { + { + name: "ali", + set: 1, + get_info: ali_get_info, + parent: NULL, + }, +}; +#endif /* DISPLAY_ALI_TIMINGS && CONFIG_PROC_FS */ + +static void init_setup_ali15x3(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_ali15x3(struct pci_dev *, const char *); +static void init_hwif_common_ali15x3(ide_hwif_t *); +static void init_hwif_ali15x3(ide_hwif_t *); +static void init_dma_ali15x3(ide_hwif_t *, unsigned long); + +static ide_pci_device_t ali15x3_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_AL, + device: PCI_DEVICE_ID_AL_M5229, + name: "ALI15X3", + init_setup: init_setup_ali15x3, + init_chipset: init_chipset_ali15x3, + init_iops: NULL, + init_hwif: init_hwif_ali15x3, + init_dma: init_dma_ali15x3, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0 + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* ALI15X3 */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/amd74xx.c linux.20pre5-ac2/drivers/ide/pci/amd74xx.c --- linux.20pre5/drivers/ide/pci/amd74xx.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/amd74xx.c 2002-09-01 18:00:38.000000000 +0100 @@ -0,0 +1,473 @@ +/* + * linux/drivers/ide/amd74xx.c Version 0.05 June 9, 2000 + * + * Copyright (C) 1999-2000 Andre Hedrick + * May be copied or modified under the terms of the GNU General Public License + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "ide_modes.h" +#include "amd74xx.h" + +#if defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 amd74xx_proc = 0; + +static struct pci_dev *bmide_dev; + +static int amd74xx_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + u32 bibma = pci_resource_start(bmide_dev, 4); + u8 c0 = 0, c1 = 0; + + /* + * at that point bibma+0x2 et bibma+0xa are byte registers + * to investigate: + */ + c0 = IN_BYTE((unsigned short)bibma + 0x02); + c1 = IN_BYTE((unsigned short)bibma + 0x0a); + + p += sprintf(p, "\n " + "AMD %04X VIPER Chipset.\n", bmide_dev->device); + p += sprintf(p, "--------------- Primary Channel " + "---------------- Secondary Channel " + "-------------\n"); + p += sprintf(p, " %sabled " + " %sabled\n", + (c0&0x80) ? "dis" : " en", + (c1&0x80) ? "dis" : " en"); + p += sprintf(p, "--------------- drive0 --------- drive1 " + "-------- drive0 ---------- drive1 ------\n"); + p += sprintf(p, "DMA enabled: %s %s " + " %s %s\n", + (c0&0x20) ? "yes" : "no ", (c0&0x40) ? "yes" : "no ", + (c1&0x20) ? "yes" : "no ", (c1&0x40) ? "yes" : "no " ); + p += sprintf(p, "UDMA\n"); + p += sprintf(p, "DMA\n"); + p += sprintf(p, "PIO\n"); + + return p-buffer; /* => must be less than 4k! */ +} +#endif /* defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static int amd74xx_mode5_check (struct pci_dev *dev) +{ + switch(dev->device) { + case PCI_DEVICE_ID_AMD_VIPER_7411: + case PCI_DEVICE_ID_AMD_VIPER_7441: + case PCI_DEVICE_ID_AMD_8111_IDE: + return 1; + default: + return 0; + } +} + +static unsigned int amd74xx_swdma_check (struct pci_dev *dev) +{ + unsigned int class_rev; + + if (amd74xx_mode5_check(dev)) + return 1; + + pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xff; + return ((int) (class_rev >= 7) ? 1 : 0); +} + +static int amd74xx_swdma_error (ide_drive_t *drive) +{ + printk("%s: single-word DMA not support (revision < C4)\n", drive->name); + return 0; +} + +static u8 amd74xx_ratemask (ide_drive_t *drive) +{ + u8 mode; + + switch(HWIF(drive)->pci_dev->device) { + case PCI_DEVICE_ID_AMD_8111_IDE: + case PCI_DEVICE_ID_AMD_VIPER_7441: + case PCI_DEVICE_ID_AMD_VIPER_7411: + mode = 3; + break; + case PCI_DEVICE_ID_AMD_VIPER_7409: + mode = 2; + break; + case PCI_DEVICE_ID_AMD_COBRA_7401: + return 1; + default: + return 0; + } + + if (!eighty_ninty_three(drive)) + mode = min(mode, (u8)1); + + return mode; +} + +static u8 amd74xx_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + /* AMD's ratemask is between 0-3 and capped at UDMA100 */ + return min(speed, speed_max[amd74xx_ratemask(drive)]); +#else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +/* + * Here is where all the hard work goes to program the chipset. + */ +static int amd74xx_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + u8 drive_pci[] = { 0x53, 0x52, 0x51, 0x50 }; + u8 drive_pci2[] = { 0x4b, 0x4a, 0x49, 0x48 }; + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 speed = amd74xx_ratefilter(drive, xferspeed); + u8 ultra_timing = 0x00; + u8 dma_pio_timing = 0x00; + u8 pio_timing = 0x00; + + pci_read_config_byte(dev, drive_pci[drive->dn], &ultra_timing); + pci_read_config_byte(dev, drive_pci2[drive->dn], &dma_pio_timing); + pci_read_config_byte(dev, 0x4c, &pio_timing); + + ultra_timing &= ~0xC7; + dma_pio_timing &= ~0xFF; + pio_timing &= ~(0x03 << drive->dn); + + switch(speed) { +#ifdef CONFIG_BLK_DEV_IDEDMA + case XFER_UDMA_7: + case XFER_UDMA_6: + speed = XFER_UDMA_5; + case XFER_UDMA_5: + ultra_timing |= 0x46; + dma_pio_timing |= 0x20; + break; + case XFER_UDMA_4: + ultra_timing |= 0x45; + dma_pio_timing |= 0x20; + break; + case XFER_UDMA_3: + ultra_timing |= 0x44; + dma_pio_timing |= 0x20; + break; + case XFER_UDMA_2: + ultra_timing |= 0x40; + dma_pio_timing |= 0x20; + break; + case XFER_UDMA_1: + ultra_timing |= 0x41; + dma_pio_timing |= 0x20; + break; + case XFER_UDMA_0: + ultra_timing |= 0x42; + dma_pio_timing |= 0x20; + break; + case XFER_MW_DMA_2: + dma_pio_timing |= 0x20; + break; + case XFER_MW_DMA_1: + dma_pio_timing |= 0x21; + break; + case XFER_MW_DMA_0: + dma_pio_timing |= 0x77; + break; + case XFER_SW_DMA_2: + if (!amd74xx_swdma_check(dev)) + return amd74xx_swdma_error(drive); + dma_pio_timing |= 0x42; + break; + case XFER_SW_DMA_1: + if (!amd74xx_swdma_check(dev)) + return amd74xx_swdma_error(drive); + dma_pio_timing |= 0x65; + break; + case XFER_SW_DMA_0: + if (!amd74xx_swdma_check(dev)) + return amd74xx_swdma_error(drive); + dma_pio_timing |= 0xA8; + break; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + case XFER_PIO_4: + dma_pio_timing |= 0x20; + break; + case XFER_PIO_3: + dma_pio_timing |= 0x22; + break; + case XFER_PIO_2: + dma_pio_timing |= 0x42; + break; + case XFER_PIO_1: + dma_pio_timing |= 0x65; + break; + case XFER_PIO_0: + default: + dma_pio_timing |= 0xA8; + break; + } + + pio_timing |= (0x03 << drive->dn); + +#ifdef CONFIG_BLK_DEV_IDEDMA + pci_write_config_byte(dev, drive_pci[drive->dn], ultra_timing); +#endif /* CONFIG_BLK_DEV_IDEDMA */ + pci_write_config_byte(dev, drive_pci2[drive->dn], dma_pio_timing); + pci_write_config_byte(dev, 0x4c, pio_timing); + + return (ide_config_drive_speed(drive, speed)); +} + +static void amd74xx_tune_drive (ide_drive_t *drive, u8 pio) +{ + pio = ide_get_best_pio_mode(drive, pio, 5, NULL); + (void) amd74xx_tune_chipset(drive, (XFER_PIO_0 + pio)); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +/* + * This allows the configuration of ide_pci chipset registers + * for cards that learn about the drive's UDMA, DMA, PIO capabilities + * after the drive is reported by the OS. + */ +static int config_chipset_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + u8 speed = 0, mode = amd74xx_ratemask(drive); + u8 swdma = amd74xx_swdma_check(HWIF(drive)->pci_dev); + +// amd74xx_tune_drive(drive, 5); + + switch(mode) { + case 0x04: + if (id->dma_ultra & 0x0040) + { speed = XFER_UDMA_6; break; } + case 0x03: + if (id->dma_ultra & 0x0020) + { speed = XFER_UDMA_5; break; } + case 0x02: + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_4; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_3; break; } + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_mword & 0x0001) + { speed = XFER_MW_DMA_0; break; } + if ((id->dma_1word & 0x0004) && (swdma)) + { speed = XFER_SW_DMA_2; break; } + if ((id->dma_1word & 0x0002) && (swdma)) + { speed = XFER_SW_DMA_1; break; } + if ((id->dma_1word & 0x0001) && (swdma)) + { speed = XFER_SW_DMA_0; break; } + default: + return 0; + } + + (void) amd74xx_tune_chipset(drive, speed); + + return ((int) ((((id->dma_ultra >> 8) & 0x3F) || + ((id->dma_mword >> 8) & 0x07) || + (((id->dma_1word >> 8) & 0x07) && (swdma))) ? 1 : 0)); +} + +static int amd74xx_config_drive_xfer_rate (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + drive->init_speed = 0; + + if (id && (id->capability & 1) && drive->autodma) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + if (id->field_valid & 4) { + if (id->dma_ultra & 0x003F) { + /* Force if Capable UltraDMA */ + int dma = config_chipset_for_dma(drive); + if ((id->field_valid & 2) && dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + ((id->dma_1word & 0x0007) && + (amd74xx_swdma_check(HWIF(drive)->pci_dev)))) { + /* Force if Capable regular DMA modes */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } + + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + amd74xx_tune_drive(drive, 5); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +static unsigned int __init init_chipset_amd74xx (struct pci_dev *dev, const char *name) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + if (!amd74xx_swdma_check(dev)) + printk("%s: disabling single-word DMA support (revision < C4)\n", name); +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +#if defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) + if (!amd74xx_proc) { + amd74xx_proc = 1; + bmide_dev = dev; + ide_pci_register_host_proc(&amd74xx_procs[0]); + } +#endif /* DISPLAY_VIPER_TIMINGS && CONFIG_PROC_FS */ + + return 0; +} + +static unsigned int __init ata66_amd74xx (ide_hwif_t *hwif) +{ + struct pci_dev *dev = hwif->pci_dev; + u8 cable_80_pin[2] = { 0, 0 }; + u8 ata66 = 0; + u8 tmpbyte; + + /* + * Ultra66 cable detection (from Host View) + * 7411, 7441, 0x42, bit0: primary, bit2: secondary 80 pin + */ + pci_read_config_byte(dev, 0x42, &tmpbyte); + + /* + * 0x42, bit0 is 1 => primary channel + * has 80-pin (from host view) + */ + if (tmpbyte & 0x01) cable_80_pin[0] = 1; + + /* + * 0x42, bit2 is 1 => secondary channel + * has 80-pin (from host view) + */ + if (tmpbyte & 0x04) cable_80_pin[1] = 1; + + switch(dev->device) { + case PCI_DEVICE_ID_AMD_COBRA_7401: + cable_80_pin[hwif->channel] = 0; + return 0; + case PCI_DEVICE_ID_AMD_8111_IDE: + case PCI_DEVICE_ID_AMD_VIPER_7441: + case PCI_DEVICE_ID_AMD_VIPER_7411: + ata66 = (hwif->channel) ? + cable_80_pin[1] : + cable_80_pin[0]; + default: + break; + } +#ifdef CONFIG_AMD74XX_OVERRIDE + return(1); +#else + return (unsigned int) ata66; +#endif /* CONFIG_AMD74XX_OVERRIDE */ +} + +static void __init init_hwif_amd74xx (ide_hwif_t *hwif) +{ + hwif->autodma = 0; + hwif->tuneproc = &amd74xx_tune_drive; + hwif->speedproc = &amd74xx_tune_chipset; + hwif->ratemask = &amd74xx_ratemask; + hwif->ratefilter = &amd74xx_ratefilter; + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + if (!(hwif->udma_four)) + hwif->udma_four = ata66_amd74xx(hwif); + hwif->ide_dma_check = &amd74xx_config_drive_xfer_rate; + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static void __init init_dma_amd74xx (ide_hwif_t *hwif, unsigned long dmabase) +{ + if (!(hwif->channel)) + hwif->OUTB(hwif->INB(dmabase+2) & 0x60, dmabase+2); + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_amd74xx (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init amd74xx_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_AMD) + return 0; + + for (d = amd74xx_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/amd74xx.h linux.20pre5-ac2/drivers/ide/pci/amd74xx.h --- linux.20pre5/drivers/ide/pci/amd74xx.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/amd74xx.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,112 @@ +#ifndef AMD74XX_H +#define AMD74XX_H + +#include +#include +#include + +#define DISPLAY_VIPER_TIMINGS + +#if defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 amd74xx_proc; + +static int amd74xx_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t amd74xx_procs[] __initdata = { + { + name: "amd74xx", + set: 1, + get_info: amd74xx_get_info, + parent: NULL, + }, +}; +#endif /* defined(DISPLAY_VIPER_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static void init_setup_amd74xx(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_amd74xx(struct pci_dev *, const char *); +static void init_hwif_amd74xx(ide_hwif_t *); +static void init_dma_amd74xx(ide_hwif_t *, unsigned long); + +static ide_pci_device_t amd74xx_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_AMD, + device: PCI_DEVICE_ID_AMD_COBRA_7401, + name: "AMD7401", + init_setup: init_setup_amd74xx, + init_chipset: init_chipset_amd74xx, + init_iops: NULL, + init_hwif: init_hwif_amd74xx, + init_dma: init_dma_amd74xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, + bootable: ON_BOARD, + extra: 0 + },{ + vendor: PCI_VENDOR_ID_AMD, + device: PCI_DEVICE_ID_AMD_VIPER_7409, + name: "AMD7409", + init_setup: init_setup_amd74xx, + init_chipset: init_chipset_amd74xx, + init_iops: NULL, + init_hwif: init_hwif_amd74xx, + init_dma: init_dma_amd74xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, + bootable: ON_BOARD, + extra: 0 + },{ + vendor: PCI_VENDOR_ID_AMD, + device: PCI_DEVICE_ID_AMD_VIPER_7411, + name: "AMD7411", + init_setup: init_setup_amd74xx, + init_chipset: init_chipset_amd74xx, + init_iops: NULL, + init_hwif: init_hwif_amd74xx, + init_dma: init_dma_amd74xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, + bootable: ON_BOARD, + extra: 0 + },{ + vendor: PCI_VENDOR_ID_AMD, + device: PCI_DEVICE_ID_AMD_OPUS_7441, + name: "AMD7441", + init_setup: init_setup_amd74xx, + init_chipset: init_chipset_amd74xx, + init_iops: NULL, + init_hwif: init_hwif_amd74xx, + init_dma: init_dma_amd74xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, + bootable: ON_BOARD, + extra: 0 + },{ + vendor: PCI_VENDOR_ID_AMD, + device: PCI_DEVICE_ID_AMD_8111_IDE, + name: "AMD8111", + init_setup: init_setup_amd74xx, + init_chipset: init_chipset_amd74xx, + init_iops: NULL, + init_hwif: init_hwif_amd74xx, + init_dma: init_dma_amd74xx, + autodma: AUTODMA, + channels: 2, + enablebits: {{0x40,0x01,0x01}, {0x40,0x02,0x02}}, + bootable: ON_BOARD, + extra: 0 + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* AMD74XX_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/cmd640.c linux.20pre5-ac2/drivers/ide/pci/cmd640.c --- linux.20pre5/drivers/ide/pci/cmd640.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/cmd640.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,886 @@ +/* + * linux/drivers/ide/cmd640.c Version 1.02 Sep 01, 1996 + * + * Copyright (C) 1995-1996 Linus Torvalds & authors (see below) + */ + +/* + * Original authors: abramov@cecmow.enet.dec.com (Igor Abramov) + * mlord@pobox.com (Mark Lord) + * + * See linux/MAINTAINERS for address of current maintainer. + * + * This file provides support for the advanced features and bugs + * of IDE interfaces using the CMD Technologies 0640 IDE interface chip. + * + * These chips are basically fucked by design, and getting this driver + * to work on every motherboard design that uses this screwed chip seems + * bloody well impossible. However, we're still trying. + * + * Version 0.97 worked for everybody. + * + * User feedback is essential. Many thanks to the beta test team: + * + * A.Hartgers@stud.tue.nl, JZDQC@CUNYVM.CUNY.edu, abramov@cecmow.enet.dec.com, + * bardj@utopia.ppp.sn.no, bart@gaga.tue.nl, bbol001@cs.auckland.ac.nz, + * chrisc@dbass.demon.co.uk, dalecki@namu26.Num.Math.Uni-Goettingen.de, + * derekn@vw.ece.cmu.edu, florian@btp2x3.phy.uni-bayreuth.de, + * flynn@dei.unipd.it, gadio@netvision.net.il, godzilla@futuris.net, + * j@pobox.com, jkemp1@mises.uni-paderborn.de, jtoppe@hiwaay.net, + * kerouac@ssnet.com, meskes@informatik.rwth-aachen.de, hzoli@cs.elte.hu, + * peter@udgaard.isgtec.com, phil@tazenda.demon.co.uk, roadcapw@cfw.com, + * s0033las@sun10.vsz.bme.hu, schaffer@tam.cornell.edu, sjd@slip.net, + * steve@ei.org, ulrpeg@bigcomm.gun.de, ism@tardis.ed.ac.uk, mack@cray.com + * liug@mama.indstate.edu, and others. + * + * Version 0.01 Initial version, hacked out of ide.c, + * and #include'd rather than compiled separately. + * This will get cleaned up in a subsequent release. + * + * Version 0.02 Fixes for vlb initialization code, enable prefetch + * for versions 'B' and 'C' of chip by default, + * some code cleanup. + * + * Version 0.03 Added reset of secondary interface, + * and black list for devices which are not compatible + * with prefetch mode. Separate function for setting + * prefetch is added, possibly it will be called some + * day from ioctl processing code. + * + * Version 0.04 Now configs/compiles separate from ide.c + * + * Version 0.05 Major rewrite of interface timing code. + * Added new function cmd640_set_mode to set PIO mode + * from ioctl call. New drives added to black list. + * + * Version 0.06 More code cleanup. Prefetch is enabled only for + * detected hard drives, not included in prefetch + * black list. + * + * Version 0.07 Changed to more conservative drive tuning policy. + * Unknown drives, which report PIO < 4 are set to + * (reported_PIO - 1) if it is supported, or to PIO0. + * List of known drives extended by info provided by + * CMD at their ftp site. + * + * Version 0.08 Added autotune/noautotune support. + * + * Version 0.09 Try to be smarter about 2nd port enabling. + * Version 0.10 Be nice and don't reset 2nd port. + * Version 0.11 Try to handle more weird situations. + * + * Version 0.12 Lots of bug fixes from Laszlo Peter + * irq unmasking disabled for reliability. + * try to be even smarter about the second port. + * tidy up source code formatting. + * Version 0.13 permit irq unmasking again. + * Version 0.90 massive code cleanup, some bugs fixed. + * defaults all drives to PIO mode0, prefetch off. + * autotune is OFF by default, with compile time flag. + * prefetch can be turned OFF/ON using "hdparm -p8/-p9" + * (requires hdparm-3.1 or newer) + * Version 0.91 first release to linux-kernel list. + * Version 0.92 move initial reg dump to separate callable function + * change "readahead" to "prefetch" to avoid confusion + * Version 0.95 respect original BIOS timings unless autotuning. + * tons of code cleanup and rearrangement. + * added CONFIG_BLK_DEV_CMD640_ENHANCED option + * prevent use of unmask when prefetch is on + * Version 0.96 prevent use of io_32bit when prefetch is off + * Version 0.97 fix VLB secondary interface for sjd@slip.net + * other minor tune-ups: 0.96 was very good. + * Version 0.98 ignore PCI version when disabled by BIOS + * Version 0.99 display setup/active/recovery clocks with PIO mode + * Version 1.00 Mmm.. cannot depend on PCMD_ENA in all systems + * Version 1.01 slow/fast devsel can be selected with "hdparm -p6/-p7" + * ("fast" is necessary for 32bit I/O in some systems) + * Version 1.02 fix bug that resulted in slow "setup times" + * (patch courtesy of Zoltan Hidvegi) + */ + +#undef REALLY_SLOW_IO /* most systems can safely undef this */ +#define CMD640_PREFETCH_MASKS 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ide_modes.h" + +/* + * This flag is set in ide.c by the parameter: ide0=cmd640_vlb + */ +int cmd640_vlb = 0; + +/* + * CMD640 specific registers definition. + */ + +#define VID 0x00 +#define DID 0x02 +#define PCMD 0x04 +#define PCMD_ENA 0x01 +#define PSTTS 0x06 +#define REVID 0x08 +#define PROGIF 0x09 +#define SUBCL 0x0a +#define BASCL 0x0b +#define BaseA0 0x10 +#define BaseA1 0x14 +#define BaseA2 0x18 +#define BaseA3 0x1c +#define INTLINE 0x3c +#define INPINE 0x3d + +#define CFR 0x50 +#define CFR_DEVREV 0x03 +#define CFR_IDE01INTR 0x04 +#define CFR_DEVID 0x18 +#define CFR_AT_VESA_078h 0x20 +#define CFR_DSA1 0x40 +#define CFR_DSA0 0x80 + +#define CNTRL 0x51 +#define CNTRL_DIS_RA0 0x40 +#define CNTRL_DIS_RA1 0x80 +#define CNTRL_ENA_2ND 0x08 + +#define CMDTIM 0x52 +#define ARTTIM0 0x53 +#define DRWTIM0 0x54 +#define ARTTIM1 0x55 +#define DRWTIM1 0x56 +#define ARTTIM23 0x57 +#define ARTTIM23_DIS_RA2 0x04 +#define ARTTIM23_DIS_RA3 0x08 +#define DRWTIM23 0x58 +#define BRST 0x59 + +/* + * Registers and masks for easy access by drive index: + */ +static u8 prefetch_regs[4] = {CNTRL, CNTRL, ARTTIM23, ARTTIM23}; +static u8 prefetch_masks[4] = {CNTRL_DIS_RA0, CNTRL_DIS_RA1, ARTTIM23_DIS_RA2, ARTTIM23_DIS_RA3}; + +#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED + +static u8 arttim_regs[4] = {ARTTIM0, ARTTIM1, ARTTIM23, ARTTIM23}; +static u8 drwtim_regs[4] = {DRWTIM0, DRWTIM1, DRWTIM23, DRWTIM23}; + +/* + * Current cmd640 timing values for each drive. + * The defaults for each are the slowest possible timings. + */ +static u8 setup_counts[4] = {4, 4, 4, 4}; /* Address setup count (in clocks) */ +static u8 active_counts[4] = {16, 16, 16, 16}; /* Active count (encoded) */ +static u8 recovery_counts[4] = {16, 16, 16, 16}; /* Recovery count (encoded) */ + +#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ + +/* + * These are initialized to point at the devices we control + */ +static ide_hwif_t *cmd_hwif0, *cmd_hwif1; +static ide_drive_t *cmd_drives[4]; + +/* + * Interface to access cmd640x registers + */ +static unsigned int cmd640_key; +static void (*put_cmd640_reg)(u16 reg, u8 val); +static u8 (*get_cmd640_reg)(u16 reg); + +/* + * This is read from the CFR reg, and is used in several places. + */ +static unsigned int cmd640_chip_version; + +/* + * The CMD640x chip does not support DWORD config write cycles, but some + * of the BIOSes use them to implement the config services. + * Therefore, we must use direct IO instead. + */ + +/* PCI method 1 access */ + +static void put_cmd640_reg_pci1 (u16 reg, u8 val) +{ + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + outb_p((reg & 0xfc) | cmd640_key, 0xcf8); + outb_p(val, (reg & 3) | 0xcfc); + spin_unlock_irqrestore(&io_request_lock, flags); +} + +static u8 get_cmd640_reg_pci1 (u16 reg) +{ + u8 b; + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + outb_p((reg & 0xfc) | cmd640_key, 0xcf8); + b = inb_p((reg & 3) | 0xcfc); + spin_unlock_irqrestore(&io_request_lock, flags); + return b; +} + +/* PCI method 2 access (from CMD datasheet) */ + +static void put_cmd640_reg_pci2 (u16 reg, u8 val) +{ + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + outb_p(0x10, 0xcf8); + outb_p(val, cmd640_key + reg); + outb_p(0, 0xcf8); + spin_unlock_irqrestore(&io_request_lock, flags); +} + +static u8 get_cmd640_reg_pci2 (u16 reg) +{ + u8 b; + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + outb_p(0x10, 0xcf8); + b = inb_p(cmd640_key + reg); + outb_p(0, 0xcf8); + spin_unlock_irqrestore(&io_request_lock, flags); + return b; +} + +/* VLB access */ + +static void put_cmd640_reg_vlb (u16 reg, u8 val) +{ + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + outb_p(reg, cmd640_key); + outb_p(val, cmd640_key + 4); + spin_unlock_irqrestore(&io_request_lock, flags); +} + +static u8 get_cmd640_reg_vlb (u16 reg) +{ + u8 b; + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + outb_p(reg, cmd640_key); + b = inb_p(cmd640_key + 4); + spin_unlock_irqrestore(&io_request_lock, flags); + return b; +} + +static int __init match_pci_cmd640_device (void) +{ + const u8 ven_dev[4] = {0x95, 0x10, 0x40, 0x06}; + unsigned int i; + for (i = 0; i < 4; i++) { + if (get_cmd640_reg(i) != ven_dev[i]) + return 0; + } +#ifdef STUPIDLY_TRUST_BROKEN_PCMD_ENA_BIT + if ((get_cmd640_reg(PCMD) & PCMD_ENA) == 0) { + printk("ide: cmd640 on PCI disabled by BIOS\n"); + return 0; + } +#endif /* STUPIDLY_TRUST_BROKEN_PCMD_ENA_BIT */ + return 1; /* success */ +} + +/* + * Probe for CMD640x -- pci method 1 + */ +static int __init probe_for_cmd640_pci1 (void) +{ + get_cmd640_reg = get_cmd640_reg_pci1; + put_cmd640_reg = put_cmd640_reg_pci1; + for (cmd640_key = 0x80000000; + cmd640_key <= 0x8000f800; + cmd640_key += 0x800) { + if (match_pci_cmd640_device()) + return 1; /* success */ + } + return 0; +} + +/* + * Probe for CMD640x -- pci method 2 + */ +static int __init probe_for_cmd640_pci2 (void) +{ + get_cmd640_reg = get_cmd640_reg_pci2; + put_cmd640_reg = put_cmd640_reg_pci2; + for (cmd640_key = 0xc000; cmd640_key <= 0xcf00; cmd640_key += 0x100) { + if (match_pci_cmd640_device()) + return 1; /* success */ + } + return 0; +} + +/* + * Probe for CMD640x -- vlb + */ +static int __init probe_for_cmd640_vlb (void) +{ + u8 b; + + get_cmd640_reg = get_cmd640_reg_vlb; + put_cmd640_reg = put_cmd640_reg_vlb; + cmd640_key = 0x178; + b = get_cmd640_reg(CFR); + if (b == 0xff || b == 0x00 || (b & CFR_AT_VESA_078h)) { + cmd640_key = 0x78; + b = get_cmd640_reg(CFR); + if (b == 0xff || b == 0x00 || !(b & CFR_AT_VESA_078h)) + return 0; + } + return 1; /* success */ +} + +/* + * Returns 1 if an IDE interface/drive exists at 0x170, + * Returns 0 otherwise. + */ +static int __init secondary_port_responding (void) +{ + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + + outb_p(0x0a, 0x170 + IDE_SELECT_OFFSET); /* select drive0 */ + udelay(100); + if ((inb_p(0x170 + IDE_SELECT_OFFSET) & 0x1f) != 0x0a) { + outb_p(0x1a, 0x170 + IDE_SELECT_OFFSET); /* select drive1 */ + udelay(100); + if ((inb_p(0x170 + IDE_SELECT_OFFSET) & 0x1f) != 0x1a) { + spin_unlock_irqrestore(&io_request_lock, flags); + return 0; /* nothing responded */ + } + } + spin_unlock_irqrestore(&io_request_lock, flags); + return 1; /* success */ +} + +#ifdef CMD640_DUMP_REGS +/* + * Dump out all cmd640 registers. May be called from ide.c + */ +static void cmd640_dump_regs (void) +{ + unsigned int reg = cmd640_vlb ? 0x50 : 0x00; + + /* Dump current state of chip registers */ + printk("ide: cmd640 internal register dump:"); + for (; reg <= 0x59; reg++) { + if (!(reg & 0x0f)) + printk("\n%04x:", reg); + printk(" %02x", get_cmd640_reg(reg)); + } + printk("\n"); +} +#endif + +/* + * Check whether prefetch is on for a drive, + * and initialize the unmask flags for safe operation. + */ +static void __init check_prefetch (unsigned int index) +{ + ide_drive_t *drive = cmd_drives[index]; + u8 b = get_cmd640_reg(prefetch_regs[index]); + + if (b & prefetch_masks[index]) { /* is prefetch off? */ + drive->no_unmask = 0; + drive->no_io_32bit = 1; + drive->io_32bit = 0; + } else { +#if CMD640_PREFETCH_MASKS + drive->no_unmask = 1; + drive->unmask = 0; +#endif + drive->no_io_32bit = 0; + } +} + +/* + * Figure out which devices we control + */ +static void __init setup_device_ptrs (void) +{ + unsigned int i; + + cmd_hwif0 = &ide_hwifs[0]; /* default, if not found below */ + cmd_hwif1 = &ide_hwifs[1]; /* default, if not found below */ + for (i = 0; i < MAX_HWIFS; i++) { + ide_hwif_t *hwif = &ide_hwifs[i]; + if (hwif->chipset == ide_unknown || hwif->chipset == ide_generic) { + if (hwif->io_ports[IDE_DATA_OFFSET] == 0x1f0) + cmd_hwif0 = hwif; + else if (hwif->io_ports[IDE_DATA_OFFSET] == 0x170) + cmd_hwif1 = hwif; + } + } + cmd_drives[0] = &cmd_hwif0->drives[0]; + cmd_drives[1] = &cmd_hwif0->drives[1]; + cmd_drives[2] = &cmd_hwif1->drives[0]; + cmd_drives[3] = &cmd_hwif1->drives[1]; +} + +#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED + +/* + * Sets prefetch mode for a drive. + */ +static void set_prefetch_mode (unsigned int index, int mode) +{ + ide_drive_t *drive = cmd_drives[index]; + int reg = prefetch_regs[index]; + u8 b; + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + b = get_cmd640_reg(reg); + if (mode) { /* want prefetch on? */ +#if CMD640_PREFETCH_MASKS + drive->no_unmask = 1; + drive->unmask = 0; +#endif + drive->no_io_32bit = 0; + b &= ~prefetch_masks[index]; /* enable prefetch */ + } else { + drive->no_unmask = 0; + drive->no_io_32bit = 1; + drive->io_32bit = 0; + b |= prefetch_masks[index]; /* disable prefetch */ + } + put_cmd640_reg(reg, b); + spin_unlock_irqrestore(&io_request_lock, flags); +} + +/* + * Dump out current drive clocks settings + */ +static void display_clocks (unsigned int index) +{ + u8 active_count, recovery_count; + + active_count = active_counts[index]; + if (active_count == 1) + ++active_count; + recovery_count = recovery_counts[index]; + if (active_count > 3 && recovery_count == 1) + ++recovery_count; + if (cmd640_chip_version > 1) + recovery_count += 1; /* cmd640b uses (count + 1)*/ + printk(", clocks=%d/%d/%d\n", setup_counts[index], active_count, recovery_count); +} + +/* + * Pack active and recovery counts into single byte representation + * used by controller + */ +inline static u8 pack_nibbles (u8 upper, u8 lower) +{ + return ((upper & 0x0f) << 4) | (lower & 0x0f); +} + +/* + * This routine retrieves the initial drive timings from the chipset. + */ +static void __init retrieve_drive_counts (unsigned int index) +{ + u8 b; + + /* + * Get the internal setup timing, and convert to clock count + */ + b = get_cmd640_reg(arttim_regs[index]) & ~0x3f; + switch (b) { + case 0x00: b = 4; break; + case 0x80: b = 3; break; + case 0x40: b = 2; break; + default: b = 5; break; + } + setup_counts[index] = b; + + /* + * Get the active/recovery counts + */ + b = get_cmd640_reg(drwtim_regs[index]); + active_counts[index] = (b >> 4) ? (b >> 4) : 0x10; + recovery_counts[index] = (b & 0x0f) ? (b & 0x0f) : 0x10; +} + + +/* + * This routine writes the prepared setup/active/recovery counts + * for a drive into the cmd640 chipset registers to active them. + */ +static void program_drive_counts (unsigned int index) +{ + unsigned long flags; + u8 setup_count = setup_counts[index]; + u8 active_count = active_counts[index]; + u8 recovery_count = recovery_counts[index]; + + /* + * Set up address setup count and drive read/write timing registers. + * Primary interface has individual count/timing registers for + * each drive. Secondary interface has one common set of registers, + * so we merge the timings, using the slowest value for each timing. + */ + if (index > 1) { + unsigned int mate; + if (cmd_drives[mate = index ^ 1]->present) { + if (setup_count < setup_counts[mate]) + setup_count = setup_counts[mate]; + if (active_count < active_counts[mate]) + active_count = active_counts[mate]; + if (recovery_count < recovery_counts[mate]) + recovery_count = recovery_counts[mate]; + } + } + + /* + * Convert setup_count to internal chipset representation + */ + switch (setup_count) { + case 4: setup_count = 0x00; break; + case 3: setup_count = 0x80; break; + case 1: + case 2: setup_count = 0x40; break; + default: setup_count = 0xc0; /* case 5 */ + } + + /* + * Now that everything is ready, program the new timings + */ + spin_lock_irqsave(&io_request_lock, flags); + /* + * Program the address_setup clocks into ARTTIM reg, + * and then the active/recovery counts into the DRWTIM reg + * (this converts counts of 16 into counts of zero -- okay). + */ + setup_count |= get_cmd640_reg(arttim_regs[index]) & 0x3f; + put_cmd640_reg(arttim_regs[index], setup_count); + put_cmd640_reg(drwtim_regs[index], pack_nibbles(active_count, recovery_count)); + spin_unlock_irqrestore(&io_request_lock, flags); +} + +/* + * Set a specific pio_mode for a drive + */ +static void cmd640_set_mode (unsigned int index, u8 pio_mode, unsigned int cycle_time) +{ + int setup_time, active_time, recovery_time, clock_time; + u8 setup_count, active_count, recovery_count, recovery_count2, cycle_count; + int bus_speed = system_bus_clock(); + + if (pio_mode > 5) + pio_mode = 5; + setup_time = ide_pio_timings[pio_mode].setup_time; + active_time = ide_pio_timings[pio_mode].active_time; + recovery_time = cycle_time - (setup_time + active_time); + clock_time = 1000 / bus_speed; + cycle_count = (cycle_time + clock_time - 1) / clock_time; + + setup_count = (setup_time + clock_time - 1) / clock_time; + + active_count = (active_time + clock_time - 1) / clock_time; + if (active_count < 2) + active_count = 2; /* minimum allowed by cmd640 */ + + recovery_count = (recovery_time + clock_time - 1) / clock_time; + recovery_count2 = cycle_count - (setup_count + active_count); + if (recovery_count2 > recovery_count) + recovery_count = recovery_count2; + if (recovery_count < 2) + recovery_count = 2; /* minimum allowed by cmd640 */ + if (recovery_count > 17) { + active_count += recovery_count - 17; + recovery_count = 17; + } + if (active_count > 16) + active_count = 16; /* maximum allowed by cmd640 */ + if (cmd640_chip_version > 1) + recovery_count -= 1; /* cmd640b uses (count + 1)*/ + if (recovery_count > 16) + recovery_count = 16; /* maximum allowed by cmd640 */ + + setup_counts[index] = setup_count; + active_counts[index] = active_count; + recovery_counts[index] = recovery_count; + + /* + * In a perfect world, we might set the drive pio mode here + * (using WIN_SETFEATURE) before continuing. + * + * But we do not, because: + * 1) this is the wrong place to do it (proper is do_special() in ide.c) + * 2) in practice this is rarely, if ever, necessary + */ + program_drive_counts (index); +} + +/* + * Drive PIO mode selection: + */ +static void cmd640_tune_drive (ide_drive_t *drive, u8 mode_wanted) +{ + u8 b; + ide_pio_data_t d; + unsigned int index = 0; + + while (drive != cmd_drives[index]) { + if (++index > 3) { + printk("%s: bad news in cmd640_tune_drive\n", drive->name); + return; + } + } + switch (mode_wanted) { + case 6: /* set fast-devsel off */ + case 7: /* set fast-devsel on */ + mode_wanted &= 1; + b = get_cmd640_reg(CNTRL) & ~0x27; + if (mode_wanted) + b |= 0x27; + put_cmd640_reg(CNTRL, b); + printk("%s: %sabled cmd640 fast host timing (devsel)\n", drive->name, mode_wanted ? "en" : "dis"); + return; + + case 8: /* set prefetch off */ + case 9: /* set prefetch on */ + mode_wanted &= 1; + set_prefetch_mode(index, mode_wanted); + printk("%s: %sabled cmd640 prefetch\n", drive->name, mode_wanted ? "en" : "dis"); + return; + } + + (void) ide_get_best_pio_mode (drive, mode_wanted, 5, &d); + cmd640_set_mode (index, d.pio_mode, d.cycle_time); + + printk ("%s: selected cmd640 PIO mode%d (%dns)%s", + drive->name, + d.pio_mode, + d.cycle_time, + d.overridden ? " (overriding vendor mode)" : ""); + display_clocks(index); + return; +} + +#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ + +static int pci_conf1(void) +{ + u32 tmp; + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + outb(0x01, 0xCFB); + tmp = inl(0xCF8); + outl(0x80000000, 0xCF8); + if (inl(0xCF8) == 0x80000000) { + outl(tmp, 0xCF8); + spin_unlock_irqrestore(&io_request_lock, flags); + return 1; + } + outl(tmp, 0xCF8); + spin_unlock_irqrestore(&io_request_lock, flags); + return 0; +} + +static int pci_conf2(void) +{ + unsigned long flags; + + spin_lock_irqsave(&io_request_lock, flags); + outb(0x00, 0xCFB); + outb(0x00, 0xCF8); + outb(0x00, 0xCFA); + if (inb(0xCF8) == 0x00 && inb(0xCF8) == 0x00) { + spin_unlock_irqrestore(&io_request_lock, flags); + return 1; + } + spin_unlock_irqrestore(&io_request_lock, flags); + return 0; +} + +/* + * Probe for a cmd640 chipset, and initialize it if found. Called from ide.c + */ +int __init ide_probe_for_cmd640x (void) +{ +#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED + int second_port_toggled = 0; +#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ + int second_port_cmd640 = 0; + const char *bus_type, *port2; + unsigned int index; + u8 b, cfr; + + if (cmd640_vlb && probe_for_cmd640_vlb()) { + bus_type = "VLB"; + } else { + cmd640_vlb = 0; + /* Find out what kind of PCI probing is supported otherwise + Justin Gibbs will sulk.. */ + if (pci_conf1() && probe_for_cmd640_pci1()) + bus_type = "PCI (type1)"; + else if (pci_conf2() && probe_for_cmd640_pci2()) + bus_type = "PCI (type2)"; + else + return 0; + } + /* + * Undocumented magic (there is no 0x5b reg in specs) + */ + put_cmd640_reg(0x5b, 0xbd); + if (get_cmd640_reg(0x5b) != 0xbd) { + printk("ide: cmd640 init failed: wrong value in reg 0x5b\n"); + return 0; + } + put_cmd640_reg(0x5b, 0); + +#ifdef CMD640_DUMP_REGS + CMD640_DUMP_REGS; +#endif + + /* + * Documented magic begins here + */ + cfr = get_cmd640_reg(CFR); + cmd640_chip_version = cfr & CFR_DEVREV; + if (cmd640_chip_version == 0) { + printk ("ide: bad cmd640 revision: %d\n", cmd640_chip_version); + return 0; + } + + /* + * Initialize data for primary port + */ + setup_device_ptrs (); + printk("%s: buggy cmd640%c interface on %s, config=0x%02x\n", + cmd_hwif0->name, 'a' + cmd640_chip_version - 1, bus_type, cfr); + cmd_hwif0->chipset = ide_cmd640; +#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED + cmd_hwif0->tuneproc = &cmd640_tune_drive; +#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ + + /* + * Ensure compatibility by always using the slowest timings + * for access to the drive's command register block, + * and reset the prefetch burstsize to default (512 bytes). + * + * Maybe we need a way to NOT do these on *some* systems? + */ + put_cmd640_reg(CMDTIM, 0); + put_cmd640_reg(BRST, 0x40); + + /* + * Try to enable the secondary interface, if not already enabled + */ + if (cmd_hwif1->noprobe) { + port2 = "not probed"; + } else { + b = get_cmd640_reg(CNTRL); + if (secondary_port_responding()) { + if ((b & CNTRL_ENA_2ND)) { + second_port_cmd640 = 1; + port2 = "okay"; + } else if (cmd640_vlb) { + second_port_cmd640 = 1; + port2 = "alive"; + } else + port2 = "not cmd640"; + } else { + put_cmd640_reg(CNTRL, b ^ CNTRL_ENA_2ND); /* toggle the bit */ + if (secondary_port_responding()) { + second_port_cmd640 = 1; +#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED + second_port_toggled = 1; +#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ + port2 = "enabled"; + } else { + put_cmd640_reg(CNTRL, b); /* restore original setting */ + port2 = "not responding"; + } + } + } + + /* + * Initialize data for secondary cmd640 port, if enabled + */ + if (second_port_cmd640) { + cmd_hwif0->serialized = 1; + cmd_hwif1->serialized = 1; + cmd_hwif1->chipset = ide_cmd640; + cmd_hwif0->mate = cmd_hwif1; + cmd_hwif1->mate = cmd_hwif0; + cmd_hwif1->channel = 1; +#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED + cmd_hwif1->tuneproc = &cmd640_tune_drive; +#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ + } + printk("%s: %sserialized, secondary interface %s\n", cmd_hwif1->name, + cmd_hwif0->serialized ? "" : "not ", port2); + + /* + * Establish initial timings/prefetch for all drives. + * Do not unnecessarily disturb any prior BIOS setup of these. + */ + for (index = 0; index < (2 + (second_port_cmd640 << 1)); index++) { + ide_drive_t *drive = cmd_drives[index]; +#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED + if (drive->autotune || ((index > 1) && second_port_toggled)) { + /* + * Reset timing to the slowest speed and turn off prefetch. + * This way, the drive identify code has a better chance. + */ + setup_counts [index] = 4; /* max possible */ + active_counts [index] = 16; /* max possible */ + recovery_counts [index] = 16; /* max possible */ + program_drive_counts (index); + set_prefetch_mode (index, 0); + printk("cmd640: drive%d timings/prefetch cleared\n", index); + } else { + /* + * Record timings/prefetch without changing them. + * This preserves any prior BIOS setup. + */ + retrieve_drive_counts (index); + check_prefetch (index); + printk("cmd640: drive%d timings/prefetch(%s) preserved", + index, drive->no_io_32bit ? "off" : "on"); + display_clocks(index); + } +#else + /* + * Set the drive unmask flags to match the prefetch setting + */ + check_prefetch (index); + printk("cmd640: drive%d timings/prefetch(%s) preserved\n", + index, drive->no_io_32bit ? "off" : "on"); +#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ + } + +#ifdef CMD640_DUMP_REGS + CMD640_DUMP_REGS; +#endif + return 1; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/cmd640.h linux.20pre5-ac2/drivers/ide/pci/cmd640.h --- linux.20pre5/drivers/ide/pci/cmd640.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/cmd640.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,32 @@ +#ifndef CMD640_H +#define CMD640_H + +#include +#include +#include + +#define IDE_IGNORE ((void *)-1) + +static ide_pci_device_t cmd640_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_CMD, + device: PCI_DEVICE_ID_CMD_640, + name: "CMD640", + init_setup: NULL, + init_chipset: NULL, + init_iops: NULL, + init_hwif: IDE_IGNORE, + init_dma: NULL, + channels: 2, + autodma: NODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0 + },{ + vendor: 0, + device: 0, + bootable: EOL, + } +} + +#endif /* CMD640_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/cmd64x.c linux.20pre5-ac2/drivers/ide/pci/cmd64x.c --- linux.20pre5/drivers/ide/pci/cmd64x.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/cmd64x.c 2002-09-01 18:00:50.000000000 +0100 @@ -0,0 +1,842 @@ +/* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 + * + * linux/drivers/ide/cmd64x.c Version 1.22 June 9, 2000 + * + * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. + * Note, this driver is not used at all on other systems because + * there the "BIOS" has done all of the following already. + * Due to massive hardware bugs, UltraDMA is only supported + * on the 646U2 and not on the 646U. + * + * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) + * Copyright (C) 1998 David S. Miller (davem@redhat.com) + * + * Copyright (C) 1999-2002 Andre Hedrick + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ide_modes.h" +#include "cmd64x.h" + +#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 cmd64x_proc = 0; + +#define CMD_MAX_DEVS 5 + +static struct pci_dev *cmd_devs[CMD_MAX_DEVS]; +static int n_cmd_devs; + +#undef DEBUG_CMD_REGS + +static char * print_cmd64x_get_info (char *buf, struct pci_dev *dev, int index) +{ + char *p = buf; + + u8 reg53 = 0, reg54 = 0, reg55 = 0, reg56 = 0; /* primary */ + u8 reg57 = 0, reg58 = 0, reg5b; /* secondary */ + u8 reg72 = 0, reg73 = 0; /* primary */ + u8 reg7a = 0, reg7b = 0; /* secondary */ + u8 reg50 = 0, reg71 = 0; /* extra */ +#ifdef DEBUG_CMD_REGS + u8 hi_byte = 0, lo_byte = 0; +#endif /* DEBUG_CMD_REGS */ + + p += sprintf(p, "\nController: %d\n", index); + p += sprintf(p, "CMD%x Chipset.\n", dev->device); + (void) pci_read_config_byte(dev, CFR, ®50); + (void) pci_read_config_byte(dev, ARTTIM0, ®53); + (void) pci_read_config_byte(dev, DRWTIM0, ®54); + (void) pci_read_config_byte(dev, ARTTIM1, ®55); + (void) pci_read_config_byte(dev, DRWTIM1, ®56); + (void) pci_read_config_byte(dev, ARTTIM2, ®57); + (void) pci_read_config_byte(dev, DRWTIM2, ®58); + (void) pci_read_config_byte(dev, DRWTIM3, ®5b); + (void) pci_read_config_byte(dev, MRDMODE, ®71); + (void) pci_read_config_byte(dev, BMIDESR0, ®72); + (void) pci_read_config_byte(dev, UDIDETCR0, ®73); + (void) pci_read_config_byte(dev, BMIDESR1, ®7a); + (void) pci_read_config_byte(dev, UDIDETCR1, ®7b); + + p += sprintf(p, "--------------- Primary Channel " + "---------------- Secondary Channel " + "-------------\n"); + p += sprintf(p, " %sabled " + " %sabled\n", + (reg72&0x80)?"dis":" en", + (reg7a&0x80)?"dis":" en"); + p += sprintf(p, "--------------- drive0 " + "--------- drive1 -------- drive0 " + "---------- drive1 ------\n"); + p += sprintf(p, "DMA enabled: %s %s" + " %s %s\n", + (reg72&0x20)?"yes":"no ", (reg72&0x40)?"yes":"no ", + (reg7a&0x20)?"yes":"no ", (reg7a&0x40)?"yes":"no "); + + p += sprintf(p, "DMA Mode: %s(%s) %s(%s)", + (reg72&0x20)?((reg73&0x01)?"UDMA":" DMA"):" PIO", + (reg72&0x20)?( + ((reg73&0x30)==0x30)?(((reg73&0x35)==0x35)?"3":"0"): + ((reg73&0x20)==0x20)?(((reg73&0x25)==0x25)?"3":"1"): + ((reg73&0x10)==0x10)?(((reg73&0x15)==0x15)?"4":"2"): + ((reg73&0x00)==0x00)?(((reg73&0x05)==0x05)?"5":"2"): + "X"):"?", + (reg72&0x40)?((reg73&0x02)?"UDMA":" DMA"):" PIO", + (reg72&0x40)?( + ((reg73&0xC0)==0xC0)?(((reg73&0xC5)==0xC5)?"3":"0"): + ((reg73&0x80)==0x80)?(((reg73&0x85)==0x85)?"3":"1"): + ((reg73&0x40)==0x40)?(((reg73&0x4A)==0x4A)?"4":"2"): + ((reg73&0x00)==0x00)?(((reg73&0x0A)==0x0A)?"5":"2"): + "X"):"?"); + p += sprintf(p, " %s(%s) %s(%s)\n", + (reg7a&0x20)?((reg7b&0x01)?"UDMA":" DMA"):" PIO", + (reg7a&0x20)?( + ((reg7b&0x30)==0x30)?(((reg7b&0x35)==0x35)?"3":"0"): + ((reg7b&0x20)==0x20)?(((reg7b&0x25)==0x25)?"3":"1"): + ((reg7b&0x10)==0x10)?(((reg7b&0x15)==0x15)?"4":"2"): + ((reg7b&0x00)==0x00)?(((reg7b&0x05)==0x05)?"5":"2"): + "X"):"?", + (reg7a&0x40)?((reg7b&0x02)?"UDMA":" DMA"):" PIO", + (reg7a&0x40)?( + ((reg7b&0xC0)==0xC0)?(((reg7b&0xC5)==0xC5)?"3":"0"): + ((reg7b&0x80)==0x80)?(((reg7b&0x85)==0x85)?"3":"1"): + ((reg7b&0x40)==0x40)?(((reg7b&0x4A)==0x4A)?"4":"2"): + ((reg7b&0x00)==0x00)?(((reg7b&0x0A)==0x0A)?"5":"2"): + "X"):"?" ); + p += sprintf(p, "PIO Mode: %s %s" + " %s %s\n", + "?", "?", "?", "?"); + p += sprintf(p, " %s %s\n", + (reg50 & CFR_INTR_CH0) ? "interrupting" : "polling ", + (reg57 & ARTTIM23_INTR_CH1) ? "interrupting" : "polling"); + p += sprintf(p, " %s %s\n", + (reg71 & MRDMODE_INTR_CH0) ? "pending" : "clear ", + (reg71 & MRDMODE_INTR_CH1) ? "pending" : "clear"); + p += sprintf(p, " %s %s\n", + (reg71 & MRDMODE_BLK_CH0) ? "blocked" : "enabled", + (reg71 & MRDMODE_BLK_CH1) ? "blocked" : "enabled"); + +#ifdef DEBUG_CMD_REGS + SPLIT_BYTE(reg50, hi_byte, lo_byte); + p += sprintf(p, "CFR = 0x%02x, HI = 0x%02x, " + "LOW = 0x%02x\n", reg50, hi_byte, lo_byte); + SPLIT_BYTE(reg57, hi_byte, lo_byte); + p += sprintf(p, "ARTTIM23 = 0x%02x, HI = 0x%02x, " + "LOW = 0x%02x\n", reg57, hi_byte, lo_byte); + SPLIT_BYTE(reg71, hi_byte, lo_byte); + p += sprintf(p, "MRDMODE = 0x%02x, HI = 0x%02x, " + "LOW = 0x%02x\n", reg71, hi_byte, lo_byte); +#endif /* DEBUG_CMD_REGS */ + + return (char *)p; +} + +static int cmd64x_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + int i; + + p += sprintf(p, "\n"); + for (i = 0; i < n_cmd_devs; i++) { + struct pci_dev *dev = cmd_devs[i]; + p = print_cmd64x_get_info(p, dev, i); + } + return p-buffer; /* => must be less than 4k! */ +} + +#endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */ + +/* + * Registers and masks for easy access by drive index: + */ +#if 0 +static u8 prefetch_regs[4] = {CNTRL, CNTRL, ARTTIM23, ARTTIM23}; +static u8 prefetch_masks[4] = {CNTRL_DIS_RA0, CNTRL_DIS_RA1, ARTTIM23_DIS_RA2, ARTTIM23_DIS_RA3}; +#endif + +/* + * This routine writes the prepared setup/active/recovery counts + * for a drive into the cmd646 chipset registers to active them. + */ +static void program_drive_counts (ide_drive_t *drive, int setup_count, int active_count, int recovery_count) +{ + unsigned long flags; + struct pci_dev *dev = HWIF(drive)->pci_dev; + ide_drive_t *drives = HWIF(drive)->drives; + u8 temp_b; + static const u8 setup_counts[] = {0x40, 0x40, 0x40, 0x80, 0, 0xc0}; + static const u8 recovery_counts[] = + {15, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0}; + static const u8 arttim_regs[2][2] = { + { ARTTIM0, ARTTIM1 }, + { ARTTIM23, ARTTIM23 } + }; + static const u8 drwtim_regs[2][2] = { + { DRWTIM0, DRWTIM1 }, + { DRWTIM2, DRWTIM3 } + }; + int channel = (int) HWIF(drive)->channel; + int slave = (drives != drive); /* Is this really the best way to determine this?? */ + + cmdprintk("program_drive_count parameters = s(%d),a(%d),r(%d),p(%d)\n", + setup_count, active_count, recovery_count, drive->present); + /* + * Set up address setup count registers. + * Primary interface has individual count/timing registers for + * each drive. Secondary interface has one common set of registers, + * for address setup so we merge these timings, using the slowest + * value. + */ + if (channel) { + drive->drive_data = setup_count; + setup_count = IDE_MAX(drives[0].drive_data, + drives[1].drive_data); + cmdprintk("Secondary interface, setup_count = %d\n", + setup_count); + } + + /* + * Convert values to internal chipset representation + */ + setup_count = (setup_count > 5) ? 0xc0 : (int) setup_counts[setup_count]; + active_count &= 0xf; /* Remember, max value is 16 */ + recovery_count = (int) recovery_counts[recovery_count]; + + cmdprintk("Final values = %d,%d,%d\n", + setup_count, active_count, recovery_count); + + /* + * Now that everything is ready, program the new timings + */ + local_irq_save(flags); + /* + * Program the address_setup clocks into ARTTIM reg, + * and then the active/recovery counts into the DRWTIM reg + */ + (void) pci_read_config_byte(dev, arttim_regs[channel][slave], &temp_b); + (void) pci_write_config_byte(dev, arttim_regs[channel][slave], + ((u8) setup_count) | (temp_b & 0x3f)); + (void) pci_write_config_byte(dev, drwtim_regs[channel][slave], + (u8) ((active_count << 4) | recovery_count)); + cmdprintk ("Write %x to %x\n", + ((u8) setup_count) | (temp_b & 0x3f), + arttim_regs[channel][slave]); + cmdprintk ("Write %x to %x\n", + (u8) ((active_count << 4) | recovery_count), + drwtim_regs[channel][slave]); + local_irq_restore(flags); +} + +/* + * Attempts to set the interface PIO mode. + * The preferred method of selecting PIO modes (e.g. mode 4) is + * "echo 'piomode:4' > /proc/ide/hdx/settings". Special cases are + * 8: prefetch off, 9: prefetch on, 255: auto-select best mode. + * Called with 255 at boot time. + */ + +static void cmd64x_tuneproc (ide_drive_t *drive, u8 mode_wanted) +{ + int setup_time, active_time, recovery_time; + int clock_time, pio_mode, cycle_time; + u8 recovery_count2, cycle_count; + int setup_count, active_count, recovery_count; + int bus_speed = system_bus_clock(); + /*byte b;*/ + ide_pio_data_t d; + + switch (mode_wanted) { + case 8: /* set prefetch off */ + case 9: /* set prefetch on */ + mode_wanted &= 1; + /*set_prefetch_mode(index, mode_wanted);*/ + cmdprintk("%s: %sabled cmd640 prefetch\n", + drive->name, mode_wanted ? "en" : "dis"); + return; + } + + mode_wanted = ide_get_best_pio_mode (drive, mode_wanted, 5, &d); + pio_mode = d.pio_mode; + cycle_time = d.cycle_time; + + /* + * I copied all this complicated stuff from cmd640.c and made a few + * minor changes. For now I am just going to pray that it is correct. + */ + if (pio_mode > 5) + pio_mode = 5; + setup_time = ide_pio_timings[pio_mode].setup_time; + active_time = ide_pio_timings[pio_mode].active_time; + recovery_time = cycle_time - (setup_time + active_time); + clock_time = 1000 / bus_speed; + cycle_count = (cycle_time + clock_time - 1) / clock_time; + + setup_count = (setup_time + clock_time - 1) / clock_time; + + active_count = (active_time + clock_time - 1) / clock_time; + + recovery_count = (recovery_time + clock_time - 1) / clock_time; + recovery_count2 = cycle_count - (setup_count + active_count); + if (recovery_count2 > recovery_count) + recovery_count = recovery_count2; + if (recovery_count > 16) { + active_count += recovery_count - 16; + recovery_count = 16; + } + if (active_count > 16) + active_count = 16; /* maximum allowed by cmd646 */ + + /* + * In a perfect world, we might set the drive pio mode here + * (using WIN_SETFEATURE) before continuing. + * + * But we do not, because: + * 1) this is the wrong place to do it + * (proper is do_special() in ide.c) + * 2) in practice this is rarely, if ever, necessary + */ + program_drive_counts (drive, setup_count, active_count, recovery_count); + + cmdprintk("%s: selected cmd646 PIO mode%d : %d (%dns)%s, " + "clocks=%d/%d/%d\n", + drive->name, pio_mode, mode_wanted, cycle_time, + d.overridden ? " (overriding vendor mode)" : "", + setup_count, active_count, recovery_count); +} + +static u8 cmd64x_ratemask (ide_drive_t *drive) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + u8 mode = 0; + + switch(dev->device) { + case PCI_DEVICE_ID_CMD_649: + mode = 3; + break; + case PCI_DEVICE_ID_CMD_648: + mode = 2; + break; + case PCI_DEVICE_ID_CMD_643: + return 0; + + case PCI_DEVICE_ID_CMD_646: + { + unsigned int class_rev = 0; + pci_read_config_dword(dev, + PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xff; + /* + * UltraDMA only supported on PCI646U and PCI646U2, which + * correspond to revisions 0x03, 0x05 and 0x07 respectively. + * Actually, although the CMD tech support people won't + * tell me the details, the 0x03 revision cannot support + * UDMA correctly without hardware modifications, and even + * then it only works with Quantum disks due to some + * hold time assumptions in the 646U part which are fixed + * in the 646U2. + * + * So we only do UltraDMA on revision 0x05 and 0x07 chipsets. + */ + switch(class_rev) { + case 0x07: + case 0x05: + return 1; + case 0x03: + case 0x01: + default: + return 0; + } + } + } + if (!eighty_ninty_three(drive)) + mode = min(mode, (u8)1); + return mode; +} + +static u8 cmd64x_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + /* CMD64X ratemask is between 0-3 and is capped at UDMA100 */ + return min(speed, speed_max[cmd64x_ratemask(drive)]); +#else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static void config_cmd64x_chipset_for_pio (ide_drive_t *drive, u8 set_speed) +{ + u8 speed = 0x00; + u8 set_pio = ide_get_best_pio_mode(drive, 4, 5, NULL); + + cmd64x_tuneproc(drive, set_pio); + speed = XFER_PIO_0 + set_pio; + if (set_speed) + (void) ide_config_drive_speed(drive, speed); +} + +static void config_chipset_for_pio (ide_drive_t *drive, u8 set_speed) +{ + config_cmd64x_chipset_for_pio(drive, set_speed); +} + +static int cmd64x_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + + u8 unit = (drive->select.b.unit & 0x01); + u8 regU = 0, pciU = (hwif->channel) ? UDIDETCR1 : UDIDETCR0; + u8 regD = 0, pciD = (hwif->channel) ? BMIDESR1 : BMIDESR0; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + + u8 speed = cmd64x_ratefilter(drive, xferspeed); + +#ifdef CONFIG_BLK_DEV_IDEDMA + if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0)) + return 1; + + (void) pci_read_config_byte(dev, pciD, ®D); + (void) pci_read_config_byte(dev, pciU, ®U); + regD &= ~(unit ? 0x40 : 0x20); + regU &= ~(unit ? 0xCA : 0x35); + (void) pci_write_config_byte(dev, pciD, regD); + (void) pci_write_config_byte(dev, pciU, regU); + (void) pci_read_config_byte(dev, pciD, ®D); + (void) pci_read_config_byte(dev, pciU, ®U); +#endif /* CONFIG_BLK_DEV_IDEDMA */ + + switch(speed) { +#ifdef CONFIG_BLK_DEV_IDEDMA + case XFER_UDMA_5: regU |= (unit ? 0x0A : 0x05); break; + case XFER_UDMA_4: regU |= (unit ? 0x4A : 0x15); break; + case XFER_UDMA_3: regU |= (unit ? 0x8A : 0x25); break; + case XFER_UDMA_2: regU |= (unit ? 0x42 : 0x11); break; + case XFER_UDMA_1: regU |= (unit ? 0x82 : 0x21); break; + case XFER_UDMA_0: regU |= (unit ? 0xC2 : 0x31); break; + case XFER_MW_DMA_2: regD |= (unit ? 0x40 : 0x10); break; + case XFER_MW_DMA_1: regD |= (unit ? 0x80 : 0x20); break; + case XFER_MW_DMA_0: regD |= (unit ? 0xC0 : 0x30); break; + case XFER_SW_DMA_2: regD |= (unit ? 0x40 : 0x10); break; + case XFER_SW_DMA_1: regD |= (unit ? 0x80 : 0x20); break; + case XFER_SW_DMA_0: regD |= (unit ? 0xC0 : 0x30); break; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + case XFER_PIO_4: cmd64x_tuneproc(drive, 4); break; + case XFER_PIO_3: cmd64x_tuneproc(drive, 3); break; + case XFER_PIO_2: cmd64x_tuneproc(drive, 2); break; + case XFER_PIO_1: cmd64x_tuneproc(drive, 1); break; + case XFER_PIO_0: cmd64x_tuneproc(drive, 0); break; + + default: + return 1; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + (void) pci_write_config_byte(dev, pciU, regU); + regD |= (unit ? 0x40 : 0x20); + (void) pci_write_config_byte(dev, pciD, regD); +#endif /* CONFIG_BLK_DEV_IDEDMA */ + + return (ide_config_drive_speed(drive, speed)); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +static int config_chipset_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + ide_hwif_t *hwif = HWIF(drive); + u8 speed = 0, set_pio = 0, mode = cmd64x_ratemask(drive); + + if (drive->media != ide_disk) { + cmdprintk("CMD64X: drive->media != ide_disk at double check," + " inital check failed!!\n"); + return 0; + } + + switch(mode) { + case 0x04: + case 0x03: + if (id->dma_ultra & 0x0020) + { speed = XFER_UDMA_5; break; } + case 0x02: + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_4; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_3; break; } + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_mword & 0x0001) + { speed = XFER_MW_DMA_0; break; } + if (id->dma_1word & 0x0004) + { speed = XFER_SW_DMA_2; break; } + if (id->dma_1word & 0x0002) + { speed = XFER_SW_DMA_1; break; } + if (id->dma_1word & 0x0001) + { speed = XFER_SW_DMA_0; break; } + default: + { set_pio = 1; break; } + } + + if (!drive->init_speed) + drive->init_speed = speed; + + config_chipset_for_pio(drive, set_pio); + + if (set_pio) + return 0; + + if (hwif->speedproc(drive, speed)) + return 0; + + return ((int) ((((id->dma_ultra >> 8) & 0x3F) || + ((id->dma_mword >> 8) & 0x07) || + ((id->dma_1word >> 8) & 0x07)) ? 1 : 0)); +} + +static int cmd64x_config_drive_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + if ((id != NULL) && ((id->capability & 1) != 0) && + drive->autodma && (drive->media == ide_disk)) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + if ((id->field_valid & 4) && cmd64x_ratemask(drive)) { + if (id->dma_ultra & 0x003F) { + /* Force if Capable UltraDMA */ + int dma = config_chipset_for_dma(drive); + if ((id->field_valid & 2) && !dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + (id->dma_1word & 0x0007)) { + /* Force if Capable regular DMA modes */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + config_chipset_for_pio(drive, 1); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} + +static int cmd64x_alt_dma_status (struct pci_dev *dev) +{ + switch(dev->device) { + case PCI_DEVICE_ID_CMD_648: + case PCI_DEVICE_ID_CMD_649: + return 1; + default: + break; + } + return 0; +} + +static int cmd64x_ide_dma_end (ide_drive_t *drive) +{ + u8 dma_stat = 0, dma_cmd = 0; + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + + drive->waiting_for_dma = 0; + /* read DMA command state */ + dma_cmd = hwif->INB(hwif->dma_command); + /* stop DMA */ + hwif->OUTB((dma_cmd & ~1), hwif->dma_command); + /* get DMA status */ + dma_stat = hwif->INB(hwif->dma_status); + /* clear the INTR & ERROR bits */ + hwif->OUTB(dma_stat|6, hwif->dma_status); + if (cmd64x_alt_dma_status(dev)) { + u8 dma_intr = 0; + u8 dma_mask = (hwif->channel) ? ARTTIM23_INTR_CH1 : + CFR_INTR_CH0; + u8 dma_reg = (hwif->channel) ? ARTTIM2 : CFR; + (void) pci_read_config_byte(dev, dma_reg, &dma_intr); + /* clear the INTR bit */ + (void) pci_write_config_byte(dev, dma_reg, dma_intr|dma_mask); + } + /* purge DMA mappings */ + ide_destroy_dmatable(drive); + /* verify good DMA status */ + return (dma_stat & 7) != 4; +} + +static int cmd64x_ide_dma_test_irq (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 dma_alt_stat = 0, mask = (hwif->channel) ? MRDMODE_INTR_CH1 : + MRDMODE_INTR_CH0; + u8 dma_stat = hwif->INB(hwif->dma_status); + + (void) pci_read_config_byte(dev, MRDMODE, &dma_alt_stat); +#ifdef DEBUG + printk("%s: dma_stat: 0x%02x dma_alt_stat: " + "0x%02x mask: 0x%02x\n", drive->name, + dma_stat, dma_alt_stat, mask); +#endif + if (!(dma_alt_stat & mask)) + return 0; + + /* return 1 if INTR asserted */ + if ((dma_stat & 4) == 4) + return 1; + + return 0; +} + +/* + * ASUS P55T2P4D with CMD646 chipset revision 0x01 requires the old + * event order for DMA transfers. + */ + +static int cmd646_1_ide_dma_end (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 dma_stat = 0, dma_cmd = 0; + + drive->waiting_for_dma = 0; + /* get DMA status */ + dma_stat = hwif->INB(hwif->dma_status); + /* read DMA command state */ + dma_cmd = hwif->INB(hwif->dma_command); + /* stop DMA */ + hwif->OUTB((dma_cmd & ~1), hwif->dma_command); + /* clear the INTR & ERROR bits */ + hwif->OUTB(dma_stat|6, hwif->dma_status); + /* and free any DMA resources */ + ide_destroy_dmatable(drive); + /* verify good DMA status */ + return (dma_stat & 7) != 4; +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +static unsigned int __init init_chipset_cmd64x (struct pci_dev *dev, const char *name) +{ + u32 class_rev = 0; + u8 mrdmode = 0; + + pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xff; + +#ifdef __i386__ + if (dev->resource[PCI_ROM_RESOURCE].start) { + pci_write_config_byte(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); + printk("%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start); + } +#endif + + switch(dev->device) { + case PCI_DEVICE_ID_CMD_643: + break; + case PCI_DEVICE_ID_CMD_646: + printk("%s: chipset revision 0x%02X, ", name, class_rev); + switch(class_rev) { + case 0x07: + case 0x05: + printk("UltraDMA Capable"); + break; + case 0x03: + printk("MultiWord DMA Force Limited"); + break; + case 0x01: + default: + printk("MultiWord DMA Limited, IRQ workaround enabled"); + break; + } + printk("\n"); + break; + case PCI_DEVICE_ID_CMD_648: + case PCI_DEVICE_ID_CMD_649: + break; + default: + break; + } + + /* Set a good latency timer and cache line size value. */ + (void) pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64); +#ifdef __sparc_v9__ + (void) pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 0x10); +#endif + + + /* Setup interrupts. */ + (void) pci_read_config_byte(dev, MRDMODE, &mrdmode); + mrdmode &= ~(0x30); + (void) pci_write_config_byte(dev, MRDMODE, mrdmode); + + /* Use MEMORY READ LINE for reads. + * NOTE: Although not mentioned in the PCI0646U specs, + * these bits are write only and won't be read + * back as set or not. The PCI0646U2 specs clarify + * this point. + */ + (void) pci_write_config_byte(dev, MRDMODE, mrdmode | 0x02); + + /* Set reasonable active/recovery/address-setup values. */ + (void) pci_write_config_byte(dev, ARTTIM0, 0x40); + (void) pci_write_config_byte(dev, DRWTIM0, 0x3f); + (void) pci_write_config_byte(dev, ARTTIM1, 0x40); + (void) pci_write_config_byte(dev, DRWTIM1, 0x3f); +#ifdef __i386__ + (void) pci_write_config_byte(dev, ARTTIM23, 0x1c); +#else + (void) pci_write_config_byte(dev, ARTTIM23, 0x5c); +#endif + (void) pci_write_config_byte(dev, DRWTIM23, 0x3f); + (void) pci_write_config_byte(dev, DRWTIM3, 0x3f); +#ifdef CONFIG_PPC + (void) pci_write_config_byte(dev, UDIDETCR0, 0xf0); +#endif /* CONFIG_PPC */ + +#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) + + cmd_devs[n_cmd_devs++] = dev; + + if (!cmd64x_proc) { + cmd64x_proc = 1; + ide_pci_register_host_proc(&cmd64x_procs[0]); + } +#endif /* DISPLAY_CMD64X_TIMINGS && CONFIG_PROC_FS */ + + return 0; +} + +static unsigned int __init ata66_cmd64x (ide_hwif_t *hwif) +{ + u8 ata66 = 0, mask = (hwif->channel) ? 0x02 : 0x01; + + switch(hwif->pci_dev->device) { + case PCI_DEVICE_ID_CMD_643: + case PCI_DEVICE_ID_CMD_646: + return ata66; + default: + break; + } + pci_read_config_byte(hwif->pci_dev, BMIDECSR, &ata66); + return (ata66 & mask) ? 1 : 0; +} + +static void __init init_hwif_cmd64x (ide_hwif_t *hwif) +{ + struct pci_dev *dev = hwif->pci_dev; + unsigned int class_rev; + + hwif->autodma = 0; + pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xff; + + hwif->tuneproc = &cmd64x_tuneproc; + hwif->speedproc = &cmd64x_tune_chipset; + hwif->ratemask = &cmd64x_ratemask; + hwif->ratefilter = &cmd64x_ratefilter; + + + if (hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + hwif->ide_dma_check = &cmd64x_config_drive_for_dma; + if (!(hwif->udma_four)) + hwif->udma_four = ata66_cmd64x(hwif); + + if (dev->device == PCI_DEVICE_ID_CMD_646) { + hwif->chipset = ide_cmd646; + if (class_rev == 0x01) { + hwif->ide_dma_end = &cmd646_1_ide_dma_end; + } else { + hwif->ide_dma_end = &cmd64x_ide_dma_end; + hwif->ide_dma_test_irq = &cmd64x_ide_dma_test_irq; + } + } else { + hwif->ide_dma_end = &cmd64x_ide_dma_end; + hwif->ide_dma_test_irq = &cmd64x_ide_dma_test_irq; + } + + + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +/** + * FIXME: not required ? + */ + +static void __init init_dma_cmd64x (ide_hwif_t *hwif, unsigned long dmabase) +{ + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +/** + * FIXME: not required either ? + */ + +static void __init init_setup_cmd64x (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init cmd64x_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_CMD) + return 0; + + for (d = cmd64x_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/cmd64x.h linux.20pre5-ac2/drivers/ide/pci/cmd64x.h --- linux.20pre5/drivers/ide/pci/cmd64x.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/cmd64x.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,152 @@ +#ifndef CMD64X_H +#define CMD64X_H + +#include +#include +#include + +#define DISPLAY_CMD64X_TIMINGS + +#define CMD_DEBUG 0 + +#if CMD_DEBUG +#define cmdprintk(x...) printk(x) +#else +#define cmdprintk(x...) +#endif + +#ifndef SPLIT_BYTE +#define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4))) +#endif + +/* + * CMD64x specific registers definition. + */ +#define CFR 0x50 +#define CFR_INTR_CH0 0x02 +#define CNTRL 0x51 +#define CNTRL_DIS_RA0 0x40 +#define CNTRL_DIS_RA1 0x80 +#define CNTRL_ENA_2ND 0x08 + +#define CMDTIM 0x52 +#define ARTTIM0 0x53 +#define DRWTIM0 0x54 +#define ARTTIM1 0x55 +#define DRWTIM1 0x56 +#define ARTTIM23 0x57 +#define ARTTIM23_DIS_RA2 0x04 +#define ARTTIM23_DIS_RA3 0x08 +#define ARTTIM23_INTR_CH1 0x10 +#define ARTTIM2 0x57 +#define ARTTIM3 0x57 +#define DRWTIM23 0x58 +#define DRWTIM2 0x58 +#define BRST 0x59 +#define DRWTIM3 0x5b + +#define BMIDECR0 0x70 +#define MRDMODE 0x71 +#define MRDMODE_INTR_CH0 0x04 +#define MRDMODE_INTR_CH1 0x08 +#define MRDMODE_BLK_CH0 0x10 +#define MRDMODE_BLK_CH1 0x20 +#define BMIDESR0 0x72 +#define UDIDETCR0 0x73 +#define DTPR0 0x74 +#define BMIDECR1 0x78 +#define BMIDECSR 0x79 +#define BMIDESR1 0x7A +#define UDIDETCR1 0x7B +#define DTPR1 0x7C + +#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 cmd64x_proc; + +static char * print_cmd64x_get_info(char *, struct pci_dev *, int); +static int cmd64x_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t cmd64x_procs[] __initdata = { + { + name: "cmd64x", + set: 1, + get_info: cmd64x_get_info, + parent: NULL, + }, +}; +#endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static void init_setup_cmd64x(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_cmd64x(struct pci_dev *, const char *); +static void init_hwif_cmd64x(ide_hwif_t *); +static void init_dma_cmd64x(ide_hwif_t *, unsigned long); + +static ide_pci_device_t cmd64x_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_CMD, + device: PCI_DEVICE_ID_CMD_643, + name: "CMD643", + init_setup: init_setup_cmd64x, + init_chipset: init_chipset_cmd64x, + init_iops: NULL, + init_hwif: init_hwif_cmd64x, + init_dma: init_dma_cmd64x, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_CMD, + device: PCI_DEVICE_ID_CMD_646, + name: "CMD646", + init_setup: init_setup_cmd64x, + init_chipset: init_chipset_cmd64x, + init_iops: NULL, + init_hwif: init_hwif_cmd64x, + init_dma: init_dma_cmd64x, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x51,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_CMD, + device: PCI_DEVICE_ID_CMD_648, + name: "CMD648", + init_setup: init_setup_cmd64x, + init_chipset: init_chipset_cmd64x, + init_iops: NULL, + init_hwif: init_hwif_cmd64x, + init_dma: init_dma_cmd64x, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_CMD, + device: PCI_DEVICE_ID_CMD_649, + name: "CMD649", + init_setup: init_setup_cmd64x, + init_chipset: init_chipset_cmd64x, + init_iops: NULL, + init_hwif: init_hwif_cmd64x, + init_dma: init_dma_cmd64x, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 2, + bootable: EOL, + } +}; + +#endif /* CMD64X_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/cs5530.c linux.20pre5-ac2/drivers/ide/pci/cs5530.c --- linux.20pre5/drivers/ide/pci/cs5530.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/cs5530.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,459 @@ +/* + * linux/drivers/ide/cs5530.c Version 0.6 Mar. 18, 2000 + * + * Copyright (C) 2000 Andre Hedrick + * Ditto of GNU General Public License. + * + * Copyright (C) 2000 Mark Lord + * May be copied or modified under the terms of the GNU General Public License + * + * Development of this chipset driver was funded + * by the nice folks at National Semiconductor. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ide_modes.h" + +#include "cs5530.h" +#include "ide-noise.h" + +static u8 cs5530_proc = 0; + +#if defined(DISPLAY_CS5530_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static struct pci_dev *bmide_dev; + +static int cs5530_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + u32 bibma = pci_resource_start(bmide_dev, 4); + u8 c0 = 0, c1 = 0; + + /* + * at that point bibma+0x2 et bibma+0xa are byte registers + * to investigate: + */ + + c0 = inb_p((u16)bibma + 0x02); + c1 = inb_p((u16)bibma + 0x0a); + + p += sprintf(p, "\n " + "Cyrix 5530 Chipset.\n"); + p += sprintf(p, "--------------- Primary Channel " + "---------------- Secondary Channel " + "-------------\n"); + p += sprintf(p, " %sabled " + " %sabled\n", + (c0&0x80) ? "dis" : " en", + (c1&0x80) ? "dis" : " en"); + p += sprintf(p, "--------------- drive0 --------- drive1 " + "-------- drive0 ---------- drive1 ------\n"); + p += sprintf(p, "DMA enabled: %s %s " + " %s %s\n", + (c0&0x20) ? "yes" : "no ", + (c0&0x40) ? "yes" : "no ", + (c1&0x20) ? "yes" : "no ", + (c1&0x40) ? "yes" : "no " ); + + p += sprintf(p, "UDMA\n"); + p += sprintf(p, "DMA\n"); + p += sprintf(p, "PIO\n"); + + return p-buffer; +} +#endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */ + +/** + * cs5530_xfer_set_mode - set a new transfer mode at the drive + * @drive: drive to tune + * @mode: new mode + * + * Logging wrapper to the IDE driver speed configuration. This can + * probably go away now. + */ + +static int cs5530_set_xfer_mode (ide_drive_t *drive, u8 mode) +{ + printk(KERN_DEBUG "%s: cs5530_set_xfer_mode(%s)\n", + drive->name, ide_xfer_verbose(mode)); + return (ide_config_drive_speed(drive, mode)); +} + +/* + * Here are the standard PIO mode 0-4 timings for each "format". + * Format-0 uses fast data reg timings, with slower command reg timings. + * Format-1 uses fast timings for all registers, but won't work with all drives. + */ +static unsigned int cs5530_pio_timings[2][5] = { + {0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010}, + {0xd1329172, 0x71212171, 0x30200080, 0x20102010, 0x00100010} +}; + +/* + * After chip reset, the PIO timings are set to 0x0000e132, which is not valid. + */ +#define CS5530_BAD_PIO(timings) (((timings)&~0x80000000)==0x0000e132) +#define CS5530_BASEREG(hwif) (((hwif)->dma_base & ~0xf) + ((hwif)->channel ? 0x30 : 0x20)) + +/** + * cs5530_tuneproc - select/set PIO modes + * + * cs5530_tuneproc() handles selection/setting of PIO modes + * for both the chipset and drive. + * + * The ide_init_cs5530() routine guarantees that all drives + * will have valid default PIO timings set up before we get here. + */ + +static void cs5530_tuneproc (ide_drive_t *drive, u8 pio) /* pio=255 means "autotune" */ +{ + ide_hwif_t *hwif = HWIF(drive); + unsigned int format, basereg = CS5530_BASEREG(hwif); + static u8 modes[5] = { XFER_PIO_0, XFER_PIO_1, XFER_PIO_2, XFER_PIO_3, XFER_PIO_4}; + + pio = ide_get_best_pio_mode(drive, pio, 4, NULL); + if (!cs5530_set_xfer_mode(drive, modes[pio])) { + format = (hwif->INL(basereg+4) >> 31) & 1; + hwif->OUTL(cs5530_pio_timings[format][pio], + basereg+(drive->select.b.unit<<3)); + } +} + +#ifdef CONFIG_BLK_DEV_IDEDMA + +/** + * cs5530_config_dma - select/set DMA and UDMA modes + * @drive: drive to tune + * + * cs5530_config_dma() handles selection/setting of DMA/UDMA modes + * for both the chipset and drive. The CS5530 has limitations about + * mixing DMA/UDMA on the same cable. + */ + +static int cs5530_config_dma (ide_drive_t *drive) +{ + int udma_ok = 1, mode = 0; + ide_hwif_t *hwif = HWIF(drive); + int unit = drive->select.b.unit; + ide_drive_t *mate = &hwif->drives[unit^1]; + struct hd_driveid *id = drive->id; + unsigned int basereg, reg, timings; + + /* + * Default to DMA-off in case we run into trouble here. + */ + hwif->ide_dma_off_quietly(drive); + /* turn off DMA while we fiddle */ + hwif->ide_dma_host_off(drive); + /* clear DMA_capable bit */ + + /* + * The CS5530 specifies that two drives sharing a cable cannot + * mix UDMA/MDMA. It has to be one or the other, for the pair, + * though different timings can still be chosen for each drive. + * We could set the appropriate timing bits on the fly, + * but that might be a bit confusing. So, for now we statically + * handle this requirement by looking at our mate drive to see + * what it is capable of, before choosing a mode for our own drive. + * + * Note: This relies on the fact we never fail from UDMA to MWDMA_2 + * but instead drop to PIO + */ + if (mate->present) { + struct hd_driveid *mateid = mate->id; + if (mateid && (mateid->capability & 1) && + !hwif->ide_dma_bad_drive(mate)) { + if ((mateid->field_valid & 4) && + (mateid->dma_ultra & 7)) + udma_ok = 1; + else if ((mateid->field_valid & 2) && + (mateid->dma_mword & 7)) + udma_ok = 0; + else + udma_ok = 1; + } + } + + /* + * Now see what the current drive is capable of, + * selecting UDMA only if the mate said it was ok. + */ + if (id && (id->capability & 1) && drive->autodma && + !hwif->ide_dma_bad_drive(drive)) { + if (udma_ok && (id->field_valid & 4) && (id->dma_ultra & 7)) { + if (id->dma_ultra & 4) + mode = XFER_UDMA_2; + else if (id->dma_ultra & 2) + mode = XFER_UDMA_1; + else if (id->dma_ultra & 1) + mode = XFER_UDMA_0; + } + if (!mode && (id->field_valid & 2) && (id->dma_mword & 7)) { + if (id->dma_mword & 4) + mode = XFER_MW_DMA_2; + else if (id->dma_mword & 2) + mode = XFER_MW_DMA_1; + else if (id->dma_mword & 1) + mode = XFER_MW_DMA_0; + } + } + + /* + * Tell the drive to switch to the new mode; abort on failure. + */ + if (!mode || cs5530_set_xfer_mode(drive, mode)) + return 1; /* failure */ + + /* + * Now tune the chipset to match the drive: + */ + switch (mode) { + case XFER_UDMA_0: timings = 0x00921250; break; + case XFER_UDMA_1: timings = 0x00911140; break; + case XFER_UDMA_2: timings = 0x00911030; break; + case XFER_MW_DMA_0: timings = 0x00077771; break; + case XFER_MW_DMA_1: timings = 0x00012121; break; + case XFER_MW_DMA_2: timings = 0x00002020; break; + default: + printk(KERN_ERR "%s: cs5530_config_dma: huh? mode=%02x\n", + drive->name, mode); + return 1; /* failure */ + } + basereg = CS5530_BASEREG(hwif); + reg = hwif->INL(basereg+4); /* get drive0 config register */ + timings |= reg & 0x80000000; /* preserve PIO format bit */ + if (unit == 0) { /* are we configuring drive0? */ + hwif->OUTL(timings, basereg+4); /* write drive0 config register */ + } else { + if (timings & 0x00100000) + reg |= 0x00100000; /* enable UDMA timings for both drives */ + else + reg &= ~0x00100000; /* disable UDMA timings for both drives */ + hwif->OUTL(reg, basereg+4); /* write drive0 config register */ + hwif->OUTL(timings, basereg+12); /* write drive1 config register */ + } + (void) hwif->ide_dma_host_on(drive); + /* set DMA_capable bit */ + + /* + * Finally, turn DMA on in software, and exit. + */ + return hwif->ide_dma_on(drive); /* success */ +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +/** + * init_chipset_5530 - set up 5530 bridge + * @dev: PCI device + * @name: device name + * + * Initialize the cs5530 bridge for reliable IDE DMA operation. + */ + +static unsigned int __init init_chipset_cs5530 (struct pci_dev *dev, const char *name) +{ + struct pci_dev *master_0 = NULL, *cs5530_0 = NULL; + unsigned long flags; + +#if defined(DISPLAY_CS5530_TIMINGS) && defined(CONFIG_PROC_FS) + if (!cs5530_proc) { + cs5530_proc = 1; + bmide_dev = dev; + ide_pci_register_host_proc(&cs5530_procs[0]); + } +#endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */ + + pci_for_each_dev (dev) { + if (dev->vendor == PCI_VENDOR_ID_CYRIX) { + switch (dev->device) { + case PCI_DEVICE_ID_CYRIX_PCI_MASTER: + master_0 = dev; + break; + case PCI_DEVICE_ID_CYRIX_5530_LEGACY: + cs5530_0 = dev; + break; + } + } + } + if (!master_0) { + printk(KERN_ERR "%s: unable to locate PCI MASTER function\n", name); + return 0; + } + if (!cs5530_0) { + printk(KERN_ERR "%s: unable to locate CS5530 LEGACY function\n", name); + return 0; + } + + spin_lock_irqsave(&io_request_lock, flags); + /* all CPUs (there should only be one CPU with this chipset) */ + + /* + * Enable BusMaster and MemoryWriteAndInvalidate for the cs5530: + * --> OR 0x14 into 16-bit PCI COMMAND reg of function 0 of the cs5530 + */ + + pci_set_master(cs5530_0); + pci_set_mwi(cs5530_0); + + /* + * Set PCI CacheLineSize to 16-bytes: + * --> Write 0x04 into 8-bit PCI CACHELINESIZE reg of function 0 of the cs5530 + */ + + pci_write_config_byte(cs5530_0, PCI_CACHE_LINE_SIZE, 0x04); + + /* + * Disable trapping of UDMA register accesses (Win98 hack): + * --> Write 0x5006 into 16-bit reg at offset 0xd0 of function 0 of the cs5530 + */ + + pci_write_config_word(cs5530_0, 0xd0, 0x5006); + + /* + * Bit-1 at 0x40 enables MemoryWriteAndInvalidate on internal X-bus: + * The other settings are what is necessary to get the register + * into a sane state for IDE DMA operation. + */ + + pci_write_config_byte(master_0, 0x40, 0x1e); + + /* + * Set max PCI burst size (16-bytes seems to work best): + * 16bytes: set bit-1 at 0x41 (reg value of 0x16) + * all others: clear bit-1 at 0x41, and do: + * 128bytes: OR 0x00 at 0x41 + * 256bytes: OR 0x04 at 0x41 + * 512bytes: OR 0x08 at 0x41 + * 1024bytes: OR 0x0c at 0x41 + */ + + pci_write_config_byte(master_0, 0x41, 0x14); + + /* + * These settings are necessary to get the chip + * into a sane state for IDE DMA operation. + */ + + pci_write_config_byte(master_0, 0x42, 0x00); + pci_write_config_byte(master_0, 0x43, 0xc1); + + spin_unlock_irqrestore(&io_request_lock, flags); + + return 0; +} + +/** + * init_hwif_cs5530 - initialise an IDE channel + * @hwif: IDE to initialize + * + * This gets invoked by the IDE driver once for each channel. It + * performs channel-specific pre-initialization before drive probing. + */ + +static void __init init_hwif_cs5530 (ide_hwif_t *hwif) +{ + unsigned int basereg, d0_timings; + hwif->autodma = 0; + + if (hwif->mate) + hwif->serialized = hwif->mate->serialized = 1; + + hwif->tuneproc = &cs5530_tuneproc; + basereg = CS5530_BASEREG(hwif); + d0_timings = hwif->INL(basereg+0); + if (CS5530_BAD_PIO(d0_timings)) { + /* PIO timings not initialized? */ + hwif->OUTL(cs5530_pio_timings[(d0_timings>>31)&1][0], basereg+0); + if (!hwif->drives[0].autotune) + hwif->drives[0].autotune = 1; + /* needs autotuning later */ + } + if (CS5530_BAD_PIO(hwif->INL(basereg+8))) { + /* PIO timings not initialized? */ + hwif->OUTL(cs5530_pio_timings[(d0_timings>>31)&1][0], basereg+8); + if (!hwif->drives[1].autotune) + hwif->drives[1].autotune = 1; + /* needs autotuning later */ + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + hwif->ide_dma_check = &cs5530_config_dma; + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +/** + * init_dma_cs5530 - set up for DMA + * @hwif: interface + * @dmabase: DMA base address + * + * FIXME: this can go away + */ + +static void __init init_dma_cs5530 (ide_hwif_t *hwif, unsigned long dmabase) +{ + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +/** + * init_setup_cs5530 - set up a CS5530 IDE + * @dev: PCI device + * @d: PCI ide device info + * + * FIXME: this function can go away too + */ + +static void __init init_setup_cs5530 (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + + +/** + * cs5530_scan_pcidev - set up any CS5530 device + * @dev: pci device to check + * + * Check if the device is a 5530 IDE controller. If it is then + * claim and set up the interface. Return 1 if we claimed the + * interface or zero if it is not ours + */ + +int __init cs5530_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_CYRIX) + return 0; + + for (d = cs5530_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/cs5530.h linux.20pre5-ac2/drivers/ide/pci/cs5530.h --- linux.20pre5/drivers/ide/pci/cs5530.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/cs5530.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,56 @@ +#ifndef CS5530_H +#define CS5530_H + +#include +#include +#include + +#define DISPLAY_CS5530_TIMINGS + +#if defined(DISPLAY_CS5530_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 cs5530_proc; + +static int cs5530_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t cs5530_procs[] __initdata = { + { + name: "cs5530", + set: 1, + get_info: cs5530_get_info, + parent: NULL, + }, +}; +#endif /* DISPLAY_CS5530_TIMINGS && CONFIG_PROC_FS */ + +static void init_setup_cs5530(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_cs5530(struct pci_dev *, const char *); +static void init_hwif_cs5530(ide_hwif_t *); +static void init_dma_cs5530(ide_hwif_t *, unsigned long); + +static ide_pci_device_t cs5530_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_CYRIX, + device: PCI_DEVICE_ID_CYRIX_5530_IDE, + name: "CS5530", + init_setup: init_setup_cs5530, + init_chipset: init_chipset_cs5530, + init_iops: NULL, + init_hwif: init_hwif_cs5530, + init_dma: init_dma_cs5530, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* CS5530_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/cy82c693.c linux.20pre5-ac2/drivers/ide/pci/cy82c693.c --- linux.20pre5/drivers/ide/pci/cy82c693.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/cy82c693.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,439 @@ +/* + * linux/drivers/ide/cy82c693.c Version 0.34 Dec. 13, 1999 + * + * Copyright (C) 1998-2000 Andreas S. Krebs (akrebs@altavista.net), Maintainer + * Copyright (C) 1998-2002 Andre Hedrick , Integrater + * + * CYPRESS CY82C693 chipset IDE controller + * + * The CY82C693 chipset is used on Digital's PC-Alpha 164SX boards. + * Writting the driver was quite simple, since most of the job is + * done by the generic pci-ide support. + * The hard part was finding the CY82C693's datasheet on Cypress's + * web page :-(. But Altavista solved this problem :-). + * + * + * Notes: + * - I recently got a 16.8G IBM DTTA, so I was able to test it with + * a large and fast disk - the results look great, so I'd say the + * driver is working fine :-) + * hdparm -t reports 8.17 MB/sec at about 6% CPU usage for the DTTA + * - this is my first linux driver, so there's probably a lot of room + * for optimizations and bug fixing, so feel free to do it. + * - use idebus=xx parameter to set PCI bus speed - needed to calc + * timings for PIO modes (default will be 40) + * - if using PIO mode it's a good idea to set the PIO mode and + * 32-bit I/O support (if possible), e.g. hdparm -p2 -c1 /dev/hda + * - I had some problems with my IBM DHEA with PIO modes < 2 + * (lost interrupts) ????? + * - first tests with DMA look okay, they seem to work, but there is a + * problem with sound - the BusMaster IDE TimeOut should fixed this + * + * + * History: + * AMH@1999-08-24: v0.34 init_cy82c693_chip moved to pci_init_cy82c693 + * ASK@1999-01-23: v0.33 made a few minor code clean ups + * removed DMA clock speed setting by default + * added boot message + * ASK@1998-11-01: v0.32 added support to set BusMaster IDE TimeOut + * added support to set DMA Controller Clock Speed + * ASK@1998-10-31: v0.31 fixed problem with setting to high DMA modes + * on some drives. + * ASK@1998-10-29: v0.3 added support to set DMA modes + * ASK@1998-10-28: v0.2 added support to set PIO modes + * ASK@1998-10-27: v0.1 first version - chipset detection + * + */ + +#include +#include +#include +#include +#include +#include + +#include + +#include "ide_modes.h" +#include "cy82c693.h" + +/* + * calc clocks using bus_speed + * returns (rounded up) time in bus clocks for time in ns + */ +static int calc_clk (int time, int bus_speed) +{ + int clocks; + + clocks = (time*bus_speed+999)/1000 -1; + + if (clocks < 0) + clocks = 0; + + if (clocks > 0x0F) + clocks = 0x0F; + + return clocks; +} + +/* + * compute the values for the clock registers for PIO + * mode and pci_clk [MHz] speed + * + * NOTE: for mode 0,1 and 2 drives 8-bit IDE command control registers are used + * for mode 3 and 4 drives 8 and 16-bit timings are the same + * + */ +static void compute_clocks (u8 pio, pio_clocks_t *p_pclk) +{ + int clk1, clk2; + int bus_speed = system_bus_clock(); /* get speed of PCI bus */ + + /* we don't check against CY82C693's min and max speed, + * so you can play with the idebus=xx parameter + */ + + if (pio > CY82C693_MAX_PIO) + pio = CY82C693_MAX_PIO; + + /* let's calc the address setup time clocks */ + p_pclk->address_time = (u8)calc_clk(ide_pio_timings[pio].setup_time, bus_speed); + + /* let's calc the active and recovery time clocks */ + clk1 = calc_clk(ide_pio_timings[pio].active_time, bus_speed); + + /* calc recovery timing */ + clk2 = ide_pio_timings[pio].cycle_time - + ide_pio_timings[pio].active_time - + ide_pio_timings[pio].setup_time; + + clk2 = calc_clk(clk2, bus_speed); + + clk1 = (clk1<<4)|clk2; /* combine active and recovery clocks */ + + /* note: we use the same values for 16bit IOR and IOW + * those are all the same, since I don't have other + * timings than those from ide_modes.h + */ + + p_pclk->time_16r = (u8)clk1; + p_pclk->time_16w = (u8)clk1; + + /* what are good values for 8bit ?? */ + p_pclk->time_8 = (u8)clk1; +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +/* + * set DMA mode a specific channel for CY82C693 + */ +static void cy82c693_dma_enable (ide_drive_t *drive, int mode, int single) +{ + u8 index = 0, data = 0; + + if (mode>2) /* make sure we set a valid mode */ + mode = 2; + + if (mode > drive->id->tDMA) /* to be absolutly sure we have a valid mode */ + mode = drive->id->tDMA; + + index = (HWIF(drive)->channel==0) ? CY82_INDEX_CHANNEL0 : CY82_INDEX_CHANNEL1; + +#if CY82C693_DEBUG_LOGS + /* for debug let's show the previous values */ + + HWIF(drive)->OUTB(index, CY82_INDEX_PORT); + data = HWIF(drive)->INB(CY82_DATA_PORT); + + printk (KERN_INFO "%s (ch=%d, dev=%d): DMA mode is %d (single=%d)\n", + drive->name, HWIF(drive)->channel, drive->select.b.unit, + (data&0x3), ((data>>2)&1)); +#endif /* CY82C693_DEBUG_LOGS */ + + data = (u8)mode|(u8)(single<<2); + + HWIF(drive)->OUTB(index, CY82_INDEX_PORT); + HWIF(drive)->OUTB(data, CY82_DATA_PORT); + +#if CY82C693_DEBUG_INFO + printk(KERN_INFO "%s (ch=%d, dev=%d): set DMA mode to %d (single=%d)\n", + drive->name, HWIF(drive)->channel, drive->select.b.unit, + mode, single); +#endif /* CY82C693_DEBUG_INFO */ + + /* + * note: below we set the value for Bus Master IDE TimeOut Register + * I'm not absolutly sure what this does, but it solved my problem + * with IDE DMA and sound, so I now can play sound and work with + * my IDE driver at the same time :-) + * + * If you know the correct (best) value for this register please + * let me know - ASK + */ + + data = BUSMASTER_TIMEOUT; + HWIF(drive)->OUTB(CY82_INDEX_TIMEOUT, CY82_INDEX_PORT); + HWIF(drive)->OUTB(data, CY82_DATA_PORT); + +#if CY82C693_DEBUG_INFO + printk (KERN_INFO "%s: Set IDE Bus Master TimeOut Register to 0x%X\n", + drive->name, data); +#endif /* CY82C693_DEBUG_INFO */ +} + +/* + * used to set DMA mode for CY82C693 (single and multi modes) + */ +int cy82c693_ide_dma_on (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + +#if CY82C693_DEBUG_INFO + printk (KERN_INFO "dma_on: %s\n", drive->name); +#endif /* CY82C693_DEBUG_INFO */ + + if (id != NULL) { + /* Enable DMA on any drive that has DMA + * (multi or single) enabled + */ + if (id->field_valid & 2) { /* regular DMA */ + int mmode, smode; + + mmode = id->dma_mword & (id->dma_mword >> 8); + smode = id->dma_1word & (id->dma_1word >> 8); + + if (mmode != 0) { + /* enable multi */ + cy82c693_dma_enable(drive, (mmode >> 1), 0); + } else if (smode != 0) { + /* enable single */ + cy82c693_dma_enable(drive, (smode >> 1), 1); + } + } + } + return __ide_dma_on(drive); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +/* + * tune ide drive - set PIO mode + */ +static void cy82c693_tune_drive (ide_drive_t *drive, u8 pio) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + pio_clocks_t pclk; + unsigned int addrCtrl; + + /* select primary or secondary channel */ + if (hwif->index > 0) { /* drive is on the secondary channel */ + dev = pci_find_slot(dev->bus->number, dev->devfn+1); + if (!dev) { + printk(KERN_ERR "%s: tune_drive: " + "Cannot find secondary interface!\n", + drive->name); + return; + } + } + +#if CY82C693_DEBUG_LOGS + /* for debug let's show the register values */ + + if (drive->select.b.unit == 0) { + /* + * get master drive registers + * address setup control register + * is 32 bit !!! + */ + pci_read_config_dword(dev, CY82_IDE_ADDRSETUP, &addrCtrl); + addrCtrl &= 0x0F; + + /* now let's get the remaining registers */ + pci_read_config_byte(dev, CY82_IDE_MASTER_IOR, &pclk.time_16r); + pci_read_config_byte(dev, CY82_IDE_MASTER_IOW, &pclk.time_16w); + pci_read_config_byte(dev, CY82_IDE_MASTER_8BIT, &pclk.time_8); + } else { + /* + * set slave drive registers + * address setup control register + * is 32 bit !!! + */ + pci_read_config_dword(dev, CY82_IDE_ADDRSETUP, &addrCtrl); + + addrCtrl &= 0xF0; + addrCtrl >>= 4; + + /* now let's get the remaining registers */ + pci_read_config_byte(dev, CY82_IDE_SLAVE_IOR, &pclk.time_16r); + pci_read_config_byte(dev, CY82_IDE_SLAVE_IOW, &pclk.time_16w); + pci_read_config_byte(dev, CY82_IDE_SLAVE_8BIT, &pclk.time_8); + } + + printk(KERN_INFO "%s (ch=%d, dev=%d): PIO timing is " + "(addr=0x%X, ior=0x%X, iow=0x%X, 8bit=0x%X)\n", + drive->name, hwif->channel, drive->select.b.unit, + addrCtrl, pclk.time_16r, pclk.time_16w, pclk.time_8); +#endif /* CY82C693_DEBUG_LOGS */ + + /* first let's calc the pio modes */ + pio = ide_get_best_pio_mode(drive, pio, CY82C693_MAX_PIO, NULL); + +#if CY82C693_DEBUG_INFO + printk (KERN_INFO "%s: Selected PIO mode %d\n", drive->name, pio); +#endif /* CY82C693_DEBUG_INFO */ + + /* let's calc the values for this PIO mode */ + compute_clocks(pio, &pclk); + + /* now let's write the clocks registers */ + if (drive->select.b.unit == 0) { + /* + * set master drive + * address setup control register + * is 32 bit !!! + */ + pci_read_config_dword(dev, CY82_IDE_ADDRSETUP, &addrCtrl); + + addrCtrl &= (~0xF); + addrCtrl |= (unsigned int)pclk.address_time; + pci_write_config_dword(dev, CY82_IDE_ADDRSETUP, addrCtrl); + + /* now let's set the remaining registers */ + pci_write_config_byte(dev, CY82_IDE_MASTER_IOR, pclk.time_16r); + pci_write_config_byte(dev, CY82_IDE_MASTER_IOW, pclk.time_16w); + pci_write_config_byte(dev, CY82_IDE_MASTER_8BIT, pclk.time_8); + + addrCtrl &= 0xF; + } else { + /* + * set slave drive + * address setup control register + * is 32 bit !!! + */ + pci_read_config_dword(dev, CY82_IDE_ADDRSETUP, &addrCtrl); + + addrCtrl &= (~0xF0); + addrCtrl |= ((unsigned int)pclk.address_time<<4); + pci_write_config_dword(dev, CY82_IDE_ADDRSETUP, addrCtrl); + + /* now let's set the remaining registers */ + pci_write_config_byte(dev, CY82_IDE_SLAVE_IOR, pclk.time_16r); + pci_write_config_byte(dev, CY82_IDE_SLAVE_IOW, pclk.time_16w); + pci_write_config_byte(dev, CY82_IDE_SLAVE_8BIT, pclk.time_8); + + addrCtrl >>= 4; + addrCtrl &= 0xF; + } + +#if CY82C693_DEBUG_INFO + printk(KERN_INFO "%s (ch=%d, dev=%d): set PIO timing to " + "(addr=0x%X, ior=0x%X, iow=0x%X, 8bit=0x%X)\n", + drive->name, hwif->channel, drive->select.b.unit, + addrCtrl, pclk.time_16r, pclk.time_16w, pclk.time_8); +#endif /* CY82C693_DEBUG_INFO */ +} + +/* + * this function is called during init and is used to setup the cy82c693 chip + */ +unsigned int __init init_chipset_cy82c693(struct pci_dev *dev, const char *name) +{ +#ifdef CY82C693_SETDMA_CLOCK + u8 data = 0; +#endif /* CY82C693_SETDMA_CLOCK */ + + /* write info about this verion of the driver */ + printk(KERN_INFO CY82_VERSION "\n"); + +#ifdef CY82C693_SETDMA_CLOCK + /* okay let's set the DMA clock speed */ + + outb(CY82_INDEX_CTRLREG1, CY82_INDEX_PORT); + data = inb(CY82_DATA_PORT); + +#if CY82C693_DEBUG_INFO + printk(KERN_INFO "%s: Peripheral Configuration Register: 0x%X\n", + name, data); +#endif /* CY82C693_DEBUG_INFO */ + + /* + * for some reason sometimes the DMA controller + * speed is set to ATCLK/2 ???? - we fix this here + * + * note: i don't know what causes this strange behaviour, + * but even changing the dma speed doesn't solve it :-( + * the ide performance is still only half the normal speed + * + * if anybody knows what goes wrong with my machine, please + * let me know - ASK + */ + + data |= 0x03; + + outb(CY82_INDEX_CTRLREG1, CY82_INDEX_PORT); + outb(data, CY82_DATA_PORT); + +#if CY82C693_DEBUG_INFO + printk (KERN_INFO "%s: New Peripheral Configuration Register: 0x%X\n", + name, data); +#endif /* CY82C693_DEBUG_INFO */ + +#endif /* CY82C693_SETDMA_CLOCK */ + return 0; +} + +/* + * the init function - called for each ide channel once + */ +void __init init_hwif_cy82c693(ide_hwif_t *hwif) +{ + hwif->chipset = ide_cy82c693; + hwif->tuneproc = &cy82c693_tune_drive; + hwif->autodma = 0; + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + hwif->ide_dma_on = &cy82c693_ide_dma_on; + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +void __init init_dma_cy82c693 (ide_hwif_t *hwif, unsigned long dmabase) +{ + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +void __init init_setup_cy82c693 (struct pci_dev *dev, ide_pci_device_t *d) +{ + if ((!(PCI_FUNC(dev->devfn) & 1) || + (!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE)))) + return; /* CY82C693 is more than only a IDE controller */ + ide_setup_pci_device(dev, d); +} + +int __init cy82c693_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_CONTAQ) + return 0; + + for (d = cy82c693_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/cy82c693.h linux.20pre5-ac2/drivers/ide/pci/cy82c693.h --- linux.20pre5/drivers/ide/pci/cy82c693.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/cy82c693.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,95 @@ +#ifndef CY82C693_H +#define CY82C693_H + +#include +#include +#include + +/* the current version */ +#define CY82_VERSION "CY82C693U driver v0.34 99-13-12 Andreas S. Krebs (akrebs@altavista.net)" + +/* + * The following are used to debug the driver. + */ +#define CY82C693_DEBUG_LOGS 0 +#define CY82C693_DEBUG_INFO 0 + +/* define CY82C693_SETDMA_CLOCK to set DMA Controller Clock Speed to ATCLK */ +#undef CY82C693_SETDMA_CLOCK + +/* + * NOTE: the value for busmaster timeout is tricky and I got it by + * trial and error! By using a to low value will cause DMA timeouts + * and drop IDE performance, and by using a to high value will cause + * audio playback to scatter. + * If you know a better value or how to calc it, please let me know. + */ + +/* twice the value written in cy82c693ub datasheet */ +#define BUSMASTER_TIMEOUT 0x50 +/* + * the value above was tested on my machine and it seems to work okay + */ + +/* here are the offset definitions for the registers */ +#define CY82_IDE_CMDREG 0x04 +#define CY82_IDE_ADDRSETUP 0x48 +#define CY82_IDE_MASTER_IOR 0x4C +#define CY82_IDE_MASTER_IOW 0x4D +#define CY82_IDE_SLAVE_IOR 0x4E +#define CY82_IDE_SLAVE_IOW 0x4F +#define CY82_IDE_MASTER_8BIT 0x50 +#define CY82_IDE_SLAVE_8BIT 0x51 + +#define CY82_INDEX_PORT 0x22 +#define CY82_DATA_PORT 0x23 + +#define CY82_INDEX_CTRLREG1 0x01 +#define CY82_INDEX_CHANNEL0 0x30 +#define CY82_INDEX_CHANNEL1 0x31 +#define CY82_INDEX_TIMEOUT 0x32 + +/* the max PIO mode - from datasheet */ +#define CY82C693_MAX_PIO 4 + +/* the min and max PCI bus speed in MHz - from datasheet */ +#define CY82C963_MIN_BUS_SPEED 25 +#define CY82C963_MAX_BUS_SPEED 33 + +/* the struct for the PIO mode timings */ +typedef struct pio_clocks_s { + u8 address_time; /* Address setup (clocks) */ + u8 time_16r; /* clocks for 16bit IOR (0xF0=Active/data, 0x0F=Recovery) */ + u8 time_16w; /* clocks for 16bit IOW (0xF0=Active/data, 0x0F=Recovery) */ + u8 time_8; /* clocks for 8bit (0xF0=Active/data, 0x0F=Recovery) */ +} pio_clocks_t; + +extern void init_setup_cy82c693(struct pci_dev *, ide_pci_device_t *); +extern unsigned int init_chipset_cy82c693(struct pci_dev *, const char *); +extern void init_hwif_cy82c693(ide_hwif_t *); +extern void init_dma_cy82c693(ide_hwif_t *, unsigned long); + +static ide_pci_device_t cy82c693_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_CONTAQ, + device: PCI_DEVICE_ID_CONTAQ_82C693, + name: "CY82C693", + init_setup: init_setup_cy82c693, + init_chipset: init_chipset_cy82c693, + init_iops: NULL, + init_hwif: init_hwif_cy82c693, + init_dma: init_dma_cy82c693, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* CY82C693_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/generic.c linux.20pre5-ac2/drivers/ide/pci/generic.c --- linux.20pre5/drivers/ide/pci/generic.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/generic.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,94 @@ +/* + * linux/drivers/ide/pci-orphan.c Version 0.01 December 8, 1997 + * + * Copyright (C) 2001-2002 Andre Hedrick + */ + + +#undef REALLY_SLOW_IO /* most systems can safely undef this */ + +#include /* for CONFIG_BLK_DEV_IDEPCI */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "generic.h" + +static unsigned int __init init_chipset_generic (struct pci_dev *dev, const char *name) +{ + return 0; +} + +static void __init init_hwif_generic (ide_hwif_t *hwif) +{ + switch(hwif->pci_dev->device) { + case PCI_DEVICE_ID_UMC_UM8673F: + case PCI_DEVICE_ID_UMC_UM8886A: + case PCI_DEVICE_ID_UMC_UM8886BF: + hwif->irq = hwif->channel ? 15 : 14; + break; + default: + break; + } +} + +static void init_dma_generic (ide_hwif_t *hwif, unsigned long dmabase) +{ + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_generic (struct pci_dev *dev, ide_pci_device_t *d) +{ + if ((d->vendor == PCI_VENDOR_ID_UMC) && + (d->device == PCI_DEVICE_ID_UMC_UM8886A) && + (!(PCI_FUNC(dev->devfn) & 1))) + return; /* UM8886A/BF pair */ + + if ((d->vendor == PCI_VENDOR_ID_OPTI) && + (d->device == PCI_DEVICE_ID_OPTI_82C558) && + (!(PCI_FUNC(dev->devfn) & 1))) + return; + + ide_setup_pci_device(dev, d); +} + +static void __init init_setup_unknown (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init generic_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + for (d = generic_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + + if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) { + ide_pci_device_t *unknown = unknown_chipset; +// unknown->vendor = dev->vendor; +// unknown->device = dev->device; + init_setup_unknown(dev, unknown); + return 1; + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/generic.h linux.20pre5-ac2/drivers/ide/pci/generic.h --- linux.20pre5/drivers/ide/pci/generic.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/generic.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,172 @@ +#ifndef IDE_GENERIC_H +#define IDE_GENERIC_H + +#include +#include +#include + +static void init_setup_generic(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_generic(struct pci_dev *, const char *); +static void init_hwif_generic(ide_hwif_t *); +static void init_dma_generic(ide_hwif_t *, unsigned long); + +static ide_pci_device_t generic_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_NS, + device: PCI_DEVICE_ID_NS_87410, + name: "NS87410", + init_setup: init_setup_generic, + init_chipset: init_chipset_generic, + init_iops: NULL, + init_hwif: init_hwif_generic, + init_dma: init_dma_generic, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x43,0x08,0x08}, {0x47,0x08,0x08}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_PCTECH, + device: PCI_DEVICE_ID_PCTECH_SAMURAI_IDE, + name: "SAMURAI", + init_setup: init_setup_generic, + init_chipset: init_chipset_generic, + init_iops: NULL, + init_hwif: init_hwif_generic, + init_dma: init_dma_generic, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_HOLTEK, + device: PCI_DEVICE_ID_HOLTEK_6565, + name: "HT6565", + init_setup: init_setup_generic, + init_chipset: init_chipset_generic, + init_iops: NULL, + init_hwif: init_hwif_generic, + init_dma: init_dma_generic, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_UMC, + device: PCI_DEVICE_ID_UMC_UM8673F, + name: "UM8673F", + init_setup: init_setup_generic, + init_chipset: init_chipset_generic, + init_iops: NULL, + init_hwif: init_hwif_generic, + init_dma: init_dma_generic, + channels: 2, + autodma: NODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_UMC, + device: PCI_DEVICE_ID_UMC_UM8886A, + name: "UM8886A", + init_setup: init_setup_generic, + init_chipset: init_chipset_generic, + init_iops: NULL, + init_hwif: init_hwif_generic, + init_dma: init_dma_generic, + channels: 2, + autodma: NODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_UMC, + device: PCI_DEVICE_ID_UMC_UM8886BF, + name: "UM8886BF", + init_setup: init_setup_generic, + init_chipset: init_chipset_generic, + init_iops: NULL, + init_hwif: init_hwif_generic, + init_dma: init_dma_generic, + channels: 2, + autodma: NODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_HINT, + device: PCI_DEVICE_ID_HINT_VXPROII_IDE, + name: "HINT_IDE", + init_setup: init_setup_generic, + init_chipset: init_chipset_generic, + init_iops: NULL, + init_hwif: init_hwif_generic, + init_dma: init_dma_generic, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_VIA, + device: PCI_DEVICE_ID_VIA_82C561, + name: "VIA_IDE", + init_setup: init_setup_generic, + init_chipset: init_chipset_generic, + init_iops: NULL, + init_hwif: init_hwif_generic, + init_dma: init_dma_generic, + channels: 2, + autodma: NOAUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_OPTI, + device: PCI_DEVICE_ID_OPTI_82C558, + name: "OPTI621V", + init_setup: init_setup_generic, + init_chipset: init_chipset_generic, + init_iops: NULL, + init_hwif: init_hwif_generic, + init_dma: init_dma_generic, + channels: 2, + autodma: NOAUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +static ide_pci_device_t unknown_chipset[] __initdata = { + { + vendor: 0, + device: 0, + name: "PCI_IDE", + init_setup: init_setup_generic, + init_chipset: init_chipset_generic, + init_iops: NULL, + init_hwif: init_hwif_generic, + init_dma: init_dma_generic, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } + +}; + +#endif /* IDE_GENERIC_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/hpt34x.c linux.20pre5-ac2/drivers/ide/pci/hpt34x.c --- linux.20pre5/drivers/ide/pci/hpt34x.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/hpt34x.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,406 @@ +/* + * linux/drivers/ide/hpt34x.c Version 0.31 June. 9, 2000 + * + * Copyright (C) 1998-2000 Andre Hedrick + * May be copied or modified under the terms of the GNU General Public License + * + * + * 00:12.0 Unknown mass storage controller: + * Triones Technologies, Inc. + * Unknown device 0003 (rev 01) + * + * hde: UDMA 2 (0x0000 0x0002) (0x0000 0x0010) + * hdf: UDMA 2 (0x0002 0x0012) (0x0010 0x0030) + * hde: DMA 2 (0x0000 0x0002) (0x0000 0x0010) + * hdf: DMA 2 (0x0002 0x0012) (0x0010 0x0030) + * hdg: DMA 1 (0x0012 0x0052) (0x0030 0x0070) + * hdh: DMA 1 (0x0052 0x0252) (0x0070 0x00f0) + * + * ide-pci.c reference + * + * Since there are two cards that report almost identically, + * the only discernable difference is the values reported in pcicmd. + * Booting-BIOS card or HPT363 :: pcicmd == 0x07 + * Non-bootable card or HPT343 :: pcicmd == 0x05 + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "ide_modes.h" +#include "hpt34x.h" +#include "ide-noise.h" + +static u8 hpt34x_proc = 0; + +#if defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +#define HPT34X_MAX_DEVS 8 +static struct pci_dev *hpt34x_devs[HPT34X_MAX_DEVS]; +static int n_hpt34x_devs; + +static int hpt34x_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + int i; + + p += sprintf(p, "\n " + "HPT34X Chipset.\n"); + for (i = 0; i < n_hpt34x_devs; i++) { + struct pci_dev *dev = hpt34x_devs[i]; + u32 bibma = pci_resource_start(dev, 4); + u8 c0 = 0, c1 = 0; + + /* + * at that point bibma+0x2 et bibma+0xa are byte registers + * to investigate: + */ + c0 = inb_p((u16)bibma + 0x02); + c1 = inb_p((u16)bibma + 0x0a); + p += sprintf(p, "\nController: %d\n", i); + p += sprintf(p, "--------------- Primary Channel " + "---------------- Secondary Channel " + "-------------\n"); + p += sprintf(p, " %sabled " + " %sabled\n", + (c0&0x80) ? "dis" : " en", + (c1&0x80) ? "dis" : " en"); + p += sprintf(p, "--------------- drive0 --------- drive1 " + "-------- drive0 ---------- drive1 ------\n"); + p += sprintf(p, "DMA enabled: %s %s" + " %s %s\n", + (c0&0x20) ? "yes" : "no ", + (c0&0x40) ? "yes" : "no ", + (c1&0x20) ? "yes" : "no ", + (c1&0x40) ? "yes" : "no " ); + + p += sprintf(p, "UDMA\n"); + p += sprintf(p, "DMA\n"); + p += sprintf(p, "PIO\n"); + } + p += sprintf(p, "\n"); + + return p-buffer; /* => must be less than 4k! */ +} +#endif /* defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static u8 hpt34x_ratemask (ide_drive_t *drive) +{ + return 1; +} + +static u8 hpt34x_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA +# ifdef CONFIG_HPT34X_AUTODMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + /* AEC's ratemask is between 0-1 and capped at UDMA33 */ + return min(speed, speed_max[hpt34x_ratemask(drive)]); +# else /* !CONFIG_HPT34X_AUTODMA */ + return min(speed, (u8) XFER_PIO_4); +# endif /* CONFIG_HPT34X_AUTODMA */ +#else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static void hpt34x_clear_chipset (ide_drive_t *drive) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + u32 reg1 = 0, tmp1 = 0, reg2 = 0, tmp2 = 0; + + pci_read_config_dword(dev, 0x44, ®1); + pci_read_config_dword(dev, 0x48, ®2); + tmp1 = ((0x00 << (3*drive->dn)) | (reg1 & ~(7 << (3*drive->dn)))); + tmp2 = (reg2 & ~(0x11 << drive->dn)); + pci_write_config_dword(dev, 0x44, tmp1); + pci_write_config_dword(dev, 0x48, tmp2); +} + +static int hpt34x_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + u8 speed = hpt34x_ratefilter(drive, xferspeed); + u32 reg1= 0, tmp1 = 0, reg2 = 0, tmp2 = 0; + u8 hi_speed, lo_speed; + + SPLIT_BYTE(speed, hi_speed, lo_speed); + + if (hi_speed & 7) { + hi_speed = (hi_speed & 4) ? 0x01 : 0x10; + } else { + lo_speed <<= 5; + lo_speed >>= 5; + } + + pci_read_config_dword(dev, 0x44, ®1); + pci_read_config_dword(dev, 0x48, ®2); + tmp1 = ((lo_speed << (3*drive->dn)) | (reg1 & ~(7 << (3*drive->dn)))); + tmp2 = ((hi_speed << drive->dn) | reg2); + pci_write_config_dword(dev, 0x44, tmp1); + pci_write_config_dword(dev, 0x48, tmp2); + +#if HPT343_DEBUG_DRIVE_INFO + printk("%s: %s drive%d (0x%04x 0x%04x) (0x%04x 0x%04x)" \ + " (0x%02x 0x%02x)\n", + drive->name, ide_xfer_verbose(speed), + drive->dn, reg1, tmp1, reg2, tmp2, + hi_speed, lo_speed); +#endif /* HPT343_DEBUG_DRIVE_INFO */ + + return(ide_config_drive_speed(drive, speed)); +} + +static void hpt34x_tune_drive (ide_drive_t *drive, u8 pio) +{ + u8 speed; + pio = ide_get_best_pio_mode(drive, pio, 5, NULL); + + switch(pio) { + case 4: speed = XFER_PIO_4; break; + case 3: speed = XFER_PIO_3; break; + case 2: speed = XFER_PIO_2; break; + case 1: speed = XFER_PIO_1; break; + default: speed = XFER_PIO_0; break; + } + hpt34x_clear_chipset(drive); + (void) hpt34x_tune_chipset(drive, speed); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +/* + * This allows the configuration of ide_pci chipset registers + * for cards that learn about the drive's UDMA, DMA, PIO capabilities + * after the drive is reported by the OS. Initally for designed for + * HPT343 UDMA chipset by HighPoint|Triones Technologies, Inc. + */ +static int config_chipset_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + u8 mode = hpt34x_ratemask(drive); + u8 speed = 0x00; + + if (drive->media != ide_disk) + return 0; + + switch(mode) { + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_mword & 0x0001) + { speed = XFER_MW_DMA_0; break; } + if (id->dma_1word & 0x0004) + { speed = XFER_SW_DMA_2; break; } + if (id->dma_1word & 0x0002) + { speed = XFER_SW_DMA_1; break; } + if (id->dma_1word & 0x0001) + { speed = XFER_SW_DMA_0; break; } + default: + return 0; + } + + hpt34x_clear_chipset(drive); + (void) hpt34x_tune_chipset(drive, speed); + + return ((int) ((((id->dma_ultra >> 8) & 0x07) || + ((id->dma_mword >> 8) & 0x07) || + ((id->dma_1word >> 8) & 0x07)) ? 1 : 0)); +} + +static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + drive->init_speed = 0; + + if (id && (id->capability & 1) && drive->autodma) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + if (id->field_valid & 4) { + if (id->dma_ultra & 0x0007) { + /* Force if Capable UltraDMA */ + int dma = config_chipset_for_dma(drive); + if ((id->field_valid & 2) && dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + (id->dma_1word & 0x0007)) { + /* Force if Capable regular DMA modes */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + hpt34x_tune_drive(drive, 255); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + +#ifndef CONFIG_HPT34X_AUTODMA + return HWIF(drive)->ide_dma_off_quietly(drive); +#endif /* CONFIG_HPT34X_AUTODMA */ + return HWIF(drive)->ide_dma_on(drive); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +/* + * If the BIOS does not set the IO base addaress to XX00, 343 will fail. + */ +#define HPT34X_PCI_INIT_REG 0x80 + +static unsigned int __init init_chipset_hpt34x (struct pci_dev *dev, const char *name) +{ + int i = 0; + unsigned long hpt34xIoBase = pci_resource_start(dev, 4); + unsigned long hpt_addr[4] = { 0x20, 0x34, 0x28, 0x3c }; + unsigned long hpt_addr_len[4] = { 8, 4, 8, 4 }; + u16 cmd; + unsigned long flags; + + local_irq_save(flags); + + pci_write_config_byte(dev, HPT34X_PCI_INIT_REG, 0x00); + pci_read_config_word(dev, PCI_COMMAND, &cmd); + + if (cmd & PCI_COMMAND_MEMORY) { + if (pci_resource_start(dev, PCI_ROM_RESOURCE)) { + pci_write_config_byte(dev, PCI_ROM_ADDRESS, + dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); + printk(KERN_INFO "HPT345: ROM enabled at 0x%08lx\n", + dev->resource[PCI_ROM_RESOURCE].start); + } + pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0xF0); + } else { + pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x20); + } + + /* + * Since 20-23 can be assigned and are R/W, we correct them. + */ + pci_write_config_word(dev, PCI_COMMAND, cmd & ~PCI_COMMAND_IO); + for(i=0; i<4; i++) { + dev->resource[i].start = (hpt34xIoBase + hpt_addr[i]); + dev->resource[i].end = dev->resource[i].start + hpt_addr_len[i]; + dev->resource[i].flags = IORESOURCE_IO; + pci_write_config_dword(dev, + (PCI_BASE_ADDRESS_0 + (i * 4)), + dev->resource[i].start); + } + pci_write_config_word(dev, PCI_COMMAND, cmd); + + local_irq_restore(flags); + +#if defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) + hpt34x_devs[n_hpt34x_devs++] = dev; + + if (!hpt34x_proc) { + hpt34x_proc = 1; + ide_pci_register_host_proc(&hpt34x_procs[0]); + } +#endif /* DISPLAY_HPT34X_TIMINGS && CONFIG_PROC_FS */ + + return dev->irq; +} + +static void __init init_hwif_hpt34x (ide_hwif_t *hwif) +{ + u16 pcicmd = 0; + hwif->tuneproc = &hpt34x_tune_drive; + hwif->speedproc = &hpt34x_tune_chipset; + hwif->ratemask = &hpt34x_ratemask; + hwif->ratefilter = &hpt34x_ratefilter; + hwif->autodma = 0; + hwif->no_dsc = 1; + + pci_read_config_word(hwif->pci_dev, PCI_COMMAND, &pcicmd); + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + hwif->ide_dma_check = &hpt34x_config_drive_xfer_rate; + if (!noautodma) + hwif->autodma = (pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static void __init init_dma_hpt34x (ide_hwif_t *hwif, unsigned long dmabase) +{ + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_hpt34x (struct pci_dev *dev, ide_pci_device_t *d) +{ + char *chipset_names[] = {"HPT343", "HPT345"}; + u16 pcicmd = 0; + + pci_read_config_word(dev, PCI_COMMAND, &pcicmd); + + strcpy(d->name, chipset_names[(pcicmd & PCI_COMMAND_MEMORY) ? 1 : 0]); + d->bootable = (pcicmd & PCI_COMMAND_MEMORY) ? OFF_BOARD : NEVER_BOARD; + + ide_setup_pci_device(dev, d); +} + +int __init hpt34x_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_TTI) + return 0; + + for (d = hpt34x_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/hpt34x.h linux.20pre5-ac2/drivers/ide/pci/hpt34x.h --- linux.20pre5/drivers/ide/pci/hpt34x.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/hpt34x.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,62 @@ +#ifndef HPT34X_H +#define HPT34X_H + +#include +#include +#include + +#define HPT343_DEBUG_DRIVE_INFO 0 + +#ifndef SPLIT_BYTE +#define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4))) +#endif + +#undef DISPLAY_HPT34X_TIMINGS + +#if defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 hpt34x_proc; + +static int hpt34x_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t hpt34x_procs[] __initdata = { + { + name: "hpt34x", + set: 1, + get_info: hpt34x_get_info, + parent: NULL, + }, +}; +#endif /* defined(DISPLAY_HPT34X_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static void init_setup_hpt34x(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_hpt34x(struct pci_dev *, const char *); +static void init_hwif_hpt34x(ide_hwif_t *); +static void init_dma_hpt34x(ide_hwif_t *, unsigned long); + +static ide_pci_device_t hpt34x_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_TTI, + device: PCI_DEVICE_ID_TTI_HPT343, + name: "HPT34X", + init_setup: init_setup_hpt34x, + init_chipset: init_chipset_hpt34x, + init_iops: NULL, + init_hwif: init_hwif_hpt34x, + init_dma: init_dma_hpt34x, + channels: 2, + autodma: NOAUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: NEVER_BOARD, + extra: 16 + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* HPT34X_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/hpt366.c linux.20pre5-ac2/drivers/ide/pci/hpt366.c --- linux.20pre5/drivers/ide/pci/hpt366.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/hpt366.c 2002-09-01 18:01:20.000000000 +0100 @@ -0,0 +1,1221 @@ +/* + * linux/drivers/ide/hpt366.c Version 0.33 April 17, 2002 + * + * Copyright (C) 1999-2002 Andre Hedrick + * Portions Copyright (C) 2001 Sun Microsystems, Inc. + * + * Thanks to HighPoint Technologies for their assistance, and hardware. + * Special Thanks to Jon Burchmore in SanDiego for the deep pockets, his + * donation of an ABit BP6 mainboard, processor, and memory acellerated + * development and support. + * + * Note that final HPT370 support was done by force extraction of GPL. + * + * - add function for getting/setting power status of drive + * - the HPT370's state machine can get confused. reset it before each dma + * xfer to prevent that from happening. + * - reset state engine whenever we get an error. + * - check for busmaster state at end of dma. + * - use new highpoint timings. + * - detect bus speed using highpoint register. + * - use pll if we don't have a clock table. added a 66MHz table that's + * just 2x the 33MHz table. + * - removed turnaround. NOTE: we never want to switch between pll and + * pci clocks as the chip can glitch in those cases. the highpoint + * approved workaround slows everything down too much to be useful. in + * addition, we would have to serialize access to each chip. + * Adrian Sun + * + * add drive timings for 66MHz PCI bus, + * fix ATA Cable signal detection, fix incorrect /proc info + * add /proc display for per-drive PIO/DMA/UDMA mode and + * per-channel ATA-33/66 Cable detect. + * Duncan Laurie + * + * fixup /proc output for multiple controllers + * Tim Hockin + * + * On hpt366: + * Reset the hpt366 on error, reset on dma + * Fix disabling Fast Interrupt hpt366. + * Mike Waychison + */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include + +#include "ide_modes.h" +#include "hpt366.h" + +#if defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include +#endif /* defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static unsigned int hpt_revision(struct pci_dev *dev); +static unsigned int hpt_minimum_revision(struct pci_dev *dev, int revision); + +#if defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) + +static u8 hpt366_proc = 0; +static struct pci_dev *hpt_devs[HPT366_MAX_DEVS]; +static int n_hpt_devs; + +static int hpt366_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + char *chipset_nums[] = {"366", "366", "368", + "370", "370A", "372", + "302", "371", "374" }; + int i; + + p += sprintf(p, "\n " + "HighPoint HPT366/368/370/372/374\n"); + for (i = 0; i < n_hpt_devs; i++) { + struct pci_dev *dev = hpt_devs[i]; + unsigned long iobase = dev->resource[4].start; + u32 class_rev = hpt_revision(dev); + u8 c0, c1; + + p += sprintf(p, "\nController: %d\n", i); + p += sprintf(p, "Chipset: HPT%s\n", chipset_nums[class_rev]); + p += sprintf(p, "--------------- Primary Channel " + "--------------- Secondary Channel " + "--------------\n"); + + /* get the bus master status registers */ + c0 = IN_BYTE(iobase + 0x2); + c1 = IN_BYTE(iobase + 0xa); + p += sprintf(p, "Enabled: %s" + " %s\n", + (c0 & 0x80) ? "no" : "yes", + (c1 & 0x80) ? "no" : "yes"); + + if (hpt_minimum_revision(dev, 3)) { + u8 cbl; + cbl = IN_BYTE(iobase + 0x7b); + OUT_BYTE(cbl | 1, iobase + 0x7b); + OUT_BYTE(cbl & ~1, iobase + 0x7b); + cbl = IN_BYTE(iobase + 0x7a); + p += sprintf(p, "Cable: ATA-%d" + " ATA-%d\n", + (cbl & 0x02) ? 33 : 66, + (cbl & 0x01) ? 33 : 66); + p += sprintf(p, "\n"); + } + + p += sprintf(p, "--------------- drive0 --------- drive1 " + "------- drive0 ---------- drive1 -------\n"); + p += sprintf(p, "DMA capable: %s %s" + " %s %s\n", + (c0 & 0x20) ? "yes" : "no ", + (c0 & 0x40) ? "yes" : "no ", + (c1 & 0x20) ? "yes" : "no ", + (c1 & 0x40) ? "yes" : "no "); + + { + u8 c2, c3; + /* older revs don't have these registers mapped + * into io space */ + pci_read_config_byte(dev, 0x43, &c0); + pci_read_config_byte(dev, 0x47, &c1); + pci_read_config_byte(dev, 0x4b, &c2); + pci_read_config_byte(dev, 0x4f, &c3); + + p += sprintf(p, "Mode: %s %s" + " %s %s\n", + (c0 & 0x10) ? "UDMA" : (c0 & 0x20) ? "DMA " : + (c0 & 0x80) ? "PIO " : "off ", + (c1 & 0x10) ? "UDMA" : (c1 & 0x20) ? "DMA " : + (c1 & 0x80) ? "PIO " : "off ", + (c2 & 0x10) ? "UDMA" : (c2 & 0x20) ? "DMA " : + (c2 & 0x80) ? "PIO " : "off ", + (c3 & 0x10) ? "UDMA" : (c3 & 0x20) ? "DMA " : + (c3 & 0x80) ? "PIO " : "off "); + } + } + p += sprintf(p, "\n"); + + return p-buffer;/* => must be less than 4k! */ +} +#endif /* defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static u32 hpt_revision (struct pci_dev *dev) +{ + u32 class_rev; + pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xff; + + switch(dev->device) { + case PCI_DEVICE_ID_TTI_HPT374: + class_rev = PCI_DEVICE_ID_TTI_HPT374; break; + case PCI_DEVICE_ID_TTI_HPT371: + class_rev = PCI_DEVICE_ID_TTI_HPT371; break; + case PCI_DEVICE_ID_TTI_HPT302: + class_rev = PCI_DEVICE_ID_TTI_HPT302; break; + case PCI_DEVICE_ID_TTI_HPT372: + class_rev = PCI_DEVICE_ID_TTI_HPT372; break; + default: + break; + } + return class_rev; +} + +static u32 hpt_minimum_revision (struct pci_dev *dev, int revision) +{ + unsigned int class_rev = hpt_revision(dev); + revision--; + return ((int) (class_rev > revision) ? 1 : 0); +} + +static int check_in_drive_lists(ide_drive_t *drive, const char **list); + +static u8 hpt3xx_ratemask (ide_drive_t *drive) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + u8 mode = 0; + + if (hpt_minimum_revision(dev, 8)) { /* HPT374 */ + mode = (HPT374_ALLOW_ATA133_6) ? 4 : 3; + } else if (hpt_minimum_revision(dev, 7)) { /* HPT371 */ + mode = (HPT371_ALLOW_ATA133_6) ? 4 : 3; + } else if (hpt_minimum_revision(dev, 6)) { /* HPT302 */ + mode = (HPT302_ALLOW_ATA133_6) ? 4 : 3; + } else if (hpt_minimum_revision(dev, 5)) { /* HPT372 */ + mode = (HPT372_ALLOW_ATA133_6) ? 4 : 3; + } else if (hpt_minimum_revision(dev, 4)) { /* HPT370A */ + mode = (HPT370_ALLOW_ATA100_5) ? 3 : 2; + } else if (hpt_minimum_revision(dev, 3)) { /* HPT370 */ + mode = (HPT370_ALLOW_ATA100_5) ? 3 : 2; + mode = (check_in_drive_lists(drive, bad_ata33)) ? 0 : mode; + } else { /* HPT366 and HPT368 */ + mode = (check_in_drive_lists(drive, bad_ata33)) ? 0 : 2; + } + if (!eighty_ninty_three(drive) && (mode)) + mode = min(mode, (u8)1); + return mode; +} + +static u8 hpt3xx_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + struct pci_dev *dev = HWIF(drive)->pci_dev; + u8 mode = hpt3xx_ratemask(drive); + + if (drive->media != ide_disk) + return min(speed, (u8)XFER_PIO_4); + + switch(mode) { + case 0x04: + speed = min(speed, (u8)XFER_UDMA_6); + break; + case 0x03: + speed = min(speed, (u8)XFER_UDMA_5); + if (hpt_minimum_revision(dev, 5)) + break; + if (check_in_drive_lists(drive, bad_ata100_5)) + speed = min(speed, (u8)XFER_UDMA_4); + break; + case 0x02: + speed = min(speed, (u8)XFER_UDMA_4); + /* + * CHECK ME, Does this need to be set to 5 ?? + */ + if (hpt_minimum_revision(dev, 3)) + break; + if ((check_in_drive_lists(drive, bad_ata66_4)) || + (!(HPT366_ALLOW_ATA66_4))) + speed = min(speed, (u8)XFER_UDMA_3); + if ((check_in_drive_lists(drive, bad_ata66_3)) || + (!(HPT366_ALLOW_ATA66_3))) + speed = min(speed, (u8)XFER_UDMA_2); + break; + case 0x01: + speed = min(speed, (u8)XFER_UDMA_2); + /* + * CHECK ME, Does this need to be set to 5 ?? + */ + if (hpt_minimum_revision(dev, 3)) + break; + if (check_in_drive_lists(drive, bad_ata33)) + speed = min(speed, (u8)XFER_MW_DMA_2); + break; + case 0x00: + default: + speed = min(speed, (u8)XFER_MW_DMA_2); + break; + } + return speed; +#else + return min(speed, (u8)XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static int check_in_drive_lists (ide_drive_t *drive, const char **list) +{ + struct hd_driveid *id = drive->id; + + if (quirk_drives == list) { + while (*list) + if (strstr(id->model, *list++)) + return 1; + } else { + while (*list) + if (!strcmp(*list++,id->model)) + return 1; + } + return 0; +} + +static unsigned int pci_bus_clock_list (u8 speed, struct chipset_bus_clock_list_entry * chipset_table) +{ + for ( ; chipset_table->xfer_speed ; chipset_table++) + if (chipset_table->xfer_speed == speed) + return chipset_table->chipset_settings; + return chipset_table->chipset_settings; +} + +static void hpt366_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + u8 speed = hpt3xx_ratefilter(drive, xferspeed); +// u8 speed = speed_ratefilter(drive, xferspeed); + u8 regtime = (drive->select.b.unit & 0x01) ? 0x44 : 0x40; + u8 regfast = (HWIF(drive)->channel) ? 0x55 : 0x51; + u8 drive_fast = 0; + u32 reg1 = 0, reg2 = 0; + + /* + * Disable the "fast interrupt" prediction. + */ + pci_read_config_byte(dev, regfast, &drive_fast); +#if 0 + if (drive_fast & 0x02) + pci_write_config_byte(dev, regfast, drive_fast & ~0x20); +#else + if (drive_fast & 0x80) + pci_write_config_byte(dev, regfast, drive_fast & ~0x80); +#endif + + reg2 = pci_bus_clock_list(speed, + (struct chipset_bus_clock_list_entry *) dev->driver_data); + /* + * Disable on-chip PIO FIFO/buffer + * (to avoid problems handling I/O errors later) + */ + pci_read_config_dword(dev, regtime, ®1); + if (speed >= XFER_MW_DMA_0) { + reg2 = (reg2 & ~0xc0000000) | (reg1 & 0xc0000000); + } else { + reg2 = (reg2 & ~0x30070000) | (reg1 & 0x30070000); + } + reg2 &= ~0x80000000; + + pci_write_config_dword(dev, regtime, reg2); +} + +static void hpt368_tune_chipset (ide_drive_t *drive, u8 speed) +{ + hpt366_tune_chipset(drive, speed); +} + +static void hpt370_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + u8 speed = hpt3xx_ratefilter(drive, xferspeed); +// u8 speed = speed_ratefilter(drive, xferspeed); + u8 regfast = (HWIF(drive)->channel) ? 0x55 : 0x51; + u8 drive_pci = 0x40 + (drive->dn * 4); + u8 new_fast = 0, drive_fast = 0; + u32 list_conf = 0, drive_conf = 0; + u32 conf_mask = (speed >= XFER_MW_DMA_0) ? 0xc0000000 : 0x30070000; + + /* + * Disable the "fast interrupt" prediction. + * don't holdoff on interrupts. (== 0x01 despite what the docs say) + */ + pci_read_config_byte(dev, regfast, &drive_fast); + new_fast = drive_fast; + if (new_fast & 0x02) + new_fast &= ~0x02; + +#ifdef HPT_DELAY_INTERRUPT + if (new_fast & 0x01) + new_fast &= ~0x01; +#else + if ((new_fast & 0x01) == 0) + new_fast |= 0x01; +#endif + if (new_fast != drive_fast) + pci_write_config_byte(dev, regfast, new_fast); + + list_conf = pci_bus_clock_list(speed, + (struct chipset_bus_clock_list_entry *) + dev->driver_data); + + pci_read_config_dword(dev, drive_pci, &drive_conf); + list_conf = (list_conf & ~conf_mask) | (drive_conf & conf_mask); + + if (speed < XFER_MW_DMA_0) { + list_conf &= ~0x80000000; /* Disable on-chip PIO FIFO/buffer */ + } + + pci_write_config_dword(dev, drive_pci, list_conf); +} + +static void hpt372_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + u8 speed = hpt3xx_ratefilter(drive, xferspeed); +// u8 speed = speed_ratefilter(drive, xferspeed); + u8 regfast = (HWIF(drive)->channel) ? 0x55 : 0x51; + u8 drive_fast = 0, drive_pci = 0x40 + (drive->dn * 4); + u32 list_conf = 0, drive_conf = 0; + u32 conf_mask = (speed >= XFER_MW_DMA_0) ? 0xc0000000 : 0x30070000; + + /* + * Disable the "fast interrupt" prediction. + * don't holdoff on interrupts. (== 0x01 despite what the docs say) + */ + pci_read_config_byte(dev, regfast, &drive_fast); + drive_fast &= ~0x07; + pci_write_config_byte(dev, regfast, drive_fast); + + list_conf = pci_bus_clock_list(speed, + (struct chipset_bus_clock_list_entry *) + dev->driver_data); + pci_read_config_dword(dev, drive_pci, &drive_conf); + list_conf = (list_conf & ~conf_mask) | (drive_conf & conf_mask); + if (speed < XFER_MW_DMA_0) + list_conf &= ~0x80000000; /* Disable on-chip PIO FIFO/buffer */ + pci_write_config_dword(dev, drive_pci, list_conf); +} + +static void hpt374_tune_chipset (ide_drive_t *drive, u8 speed) +{ + hpt372_tune_chipset(drive, speed); +} + +static int hpt3xx_tune_chipset (ide_drive_t *drive, u8 speed) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + + if (hpt_minimum_revision(dev, 8)) + hpt374_tune_chipset(drive, speed); +#if 0 + else if (hpt_minimum_revision(dev, 7)) + hpt371_tune_chipset(drive, speed); + else if (hpt_minimum_revision(dev, 6)) + hpt302_tune_chipset(drive, speed); +#endif + else if (hpt_minimum_revision(dev, 5)) + hpt372_tune_chipset(drive, speed); + else if (hpt_minimum_revision(dev, 3)) + hpt370_tune_chipset(drive, speed); + else if (hpt_minimum_revision(dev, 2)) + hpt368_tune_chipset(drive, speed); + else + hpt366_tune_chipset(drive, speed); + + return ((int) ide_config_drive_speed(drive, speed)); +} + +static void hpt3xx_tune_drive (ide_drive_t *drive, u8 pio) +{ + pio = ide_get_best_pio_mode(drive, pio, 5, NULL); + (void) hpt3xx_tune_chipset(drive, (XFER_PIO_0 + pio)); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +/* + * This allows the configuration of ide_pci chipset registers + * for cards that learn about the drive's UDMA, DMA, PIO capabilities + * after the drive is reported by the OS. Initally for designed for + * HPT366 UDMA chipset by HighPoint|Triones Technologies, Inc. + * + * check_in_drive_lists(drive, bad_ata66_4) + * check_in_drive_lists(drive, bad_ata66_3) + * check_in_drive_lists(drive, bad_ata33) + * + */ +static int config_chipset_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + u8 speed = 0, mode = hpt3xx_ratemask(drive); + + if (drive->media != ide_disk) + return 0; + + switch(mode) { +// switch(hpt3xx_ratemask(drive)) { + case 0x04: + if (id->dma_ultra & 0x0040) + { speed = XFER_UDMA_6; break; } + case 0x03: + if (id->dma_ultra & 0x0020) + { speed = XFER_UDMA_5; break; } + case 0x02: + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_4; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_3; break; } + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_mword & 0x0001) + { speed = XFER_MW_DMA_0; break; } + default: + return 0; + } + + (void) hpt3xx_tune_chipset(drive, speed); + + return ((int) ((((id->dma_ultra >> 8) & 0x7F) || + ((id->dma_mword >> 8) & 0x07) || + ((id->dma_1word >> 8) & 0x07)) ? 1 : 0)); +} + +static int hpt3xx_quirkproc (ide_drive_t *drive) +{ + return ((int) check_in_drive_lists(drive, quirk_drives)); +} + +static void hpt3xx_intrproc (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + + if (drive->quirk_list) + return; + /* drives in the quirk_list may not like intr setups/cleanups */ + hwif->OUTB(drive->ctl|2, IDE_CONTROL_REG); +} + +static void hpt3xx_maskproc (ide_drive_t *drive, int mask) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + + if (drive->quirk_list) { + if (hpt_minimum_revision(dev,3)) { + u8 reg5a = 0; + pci_read_config_byte(dev, 0x5a, ®5a); + if (((reg5a & 0x10) >> 4) != mask) + pci_write_config_byte(dev, 0x5a, mask ? (reg5a | 0x10) : (reg5a & ~0x10)); + } else { + if (mask) { + disable_irq(HWIF(drive)->irq); + } else { + enable_irq(HWIF(drive)->irq); + } + } + } else { + if (IDE_CONTROL_REG) + HWIF(drive)->OUTB(mask ? (drive->ctl | 2) : + (drive->ctl & ~2), + IDE_CONTROL_REG); + } +} + +static int hpt366_config_drive_xfer_rate (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + drive->init_speed = 0; + + if (id && (id->capability & 1) && drive->autodma) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + if (id->field_valid & 4) { + if (id->dma_ultra & 0x007F) { + /* Force if Capable UltraDMA */ + int dma = config_chipset_for_dma(drive); + if ((id->field_valid & 2) && !dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if (id->dma_mword & 0x0007) { + /* Force if Capable regular DMA modes */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + hpt3xx_tune_drive(drive, 5); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} + +/* + * This is specific to the HPT366 UDMA bios chipset + * by HighPoint|Triones Technologies, Inc. + */ +static int hpt366_ide_dma_lostirq (ide_drive_t *drive) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + u8 reg50h = 0, reg52h = 0, reg5ah = 0; + + pci_read_config_byte(dev, 0x50, ®50h); + pci_read_config_byte(dev, 0x52, ®52h); + pci_read_config_byte(dev, 0x5a, ®5ah); + printk("%s: (%s) reg50h=0x%02x, reg52h=0x%02x, reg5ah=0x%02x\n", + drive->name, __FUNCTION__, reg50h, reg52h, reg5ah); + if (reg5ah & 0x10) + pci_write_config_byte(dev, 0x5a, reg5ah & ~0x10); +#if 0 + /* how about we flush and reset, mmmkay? */ + pci_write_config_byte(dev, 0x51, 0x1F); + /* fall through to a reset */ + case ide_dma_begin: + case ide_dma_end: + /* reset the chips state over and over.. */ + pci_write_config_byte(dev, 0x51, 0x13); +#endif + return __ide_dma_lostirq(drive); +} + +static void hpt370_clear_engine (ide_drive_t *drive) +{ + u8 regstate = HWIF(drive)->channel ? 0x54 : 0x50; + pci_write_config_byte(HWIF(drive)->pci_dev, regstate, 0x37); + udelay(10); +} + +static int hpt370_ide_dma_begin (ide_drive_t *drive) +{ +#ifdef HPT_RESET_STATE_ENGINE + hpt370_clear_engine(drive); +#endif + return __ide_dma_begin(drive); +} + +static int hpt370_ide_dma_end (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 dma_stat = hwif->INB(hwif->dma_status); + + if (dma_stat & 0x01) { + /* wait a little */ + udelay(20); + dma_stat = hwif->INB(hwif->dma_status); + } + if ((dma_stat & 0x01) != 0) + /* fallthrough */ + (void) HWIF(drive)->ide_dma_timeout(drive); + + return __ide_dma_end(drive); +} + +static void hpt370_lostirq_timeout (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 bfifo = 0, reginfo = hwif->channel ? 0x56 : 0x52; + u8 dma_stat = 0, dma_cmd = 0; + + pci_read_config_byte(HWIF(drive)->pci_dev, reginfo, &bfifo); + printk("%s: %d bytes in FIFO\n", drive->name, bfifo); + hpt370_clear_engine(drive); + /* get dma command mode */ + dma_cmd = hwif->INB(hwif->dma_command); + /* stop dma */ + hwif->OUTB(dma_cmd & ~0x1, hwif->dma_command); + dma_stat = hwif->INB(hwif->dma_status); + /* clear errors */ + hwif->OUTB(dma_stat | 0x6, hwif->dma_status); +} + +static int hpt370_ide_dma_timeout (ide_drive_t *drive) +{ + hpt370_lostirq_timeout(drive); + hpt370_clear_engine(drive); + return __ide_dma_timeout(drive); +} + +static int hpt370_ide_dma_lostirq (ide_drive_t *drive) +{ + hpt370_lostirq_timeout(drive); + hpt370_clear_engine(drive); + return __ide_dma_lostirq(drive); +} + +static int hpt374_ide_dma_end (ide_drive_t *drive) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + ide_hwif_t *hwif = HWIF(drive); + u8 msc_stat = 0, mscreg = hwif->channel ? 0x54 : 0x50; + u8 bwsr_stat = 0, bwsr_mask = hwif->channel ? 0x02 : 0x01; + + pci_read_config_byte(dev, 0x6a, &bwsr_stat); + pci_read_config_byte(dev, mscreg, &msc_stat); + if ((bwsr_stat & bwsr_mask) == bwsr_mask) + pci_write_config_byte(dev, mscreg, msc_stat|0x30); + return __ide_dma_end(drive); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +/* + * Since SUN Cobalt is attempting to do this operation, I should disclose + * this has been a long time ago Thu Jul 27 16:40:57 2000 was the patch date + * HOTSWAP ATA Infrastructure. + */ + +static void hpt3xx_reset (ide_drive_t *drive) +{ +#if 0 + u32 high_16 = pci_resource_start(HWIF(drive)->pci_dev, 4); + u8 reset = (HWIF(drive)->channel) ? 0x80 : 0x40; + u8 reg59h = 0; + + pci_read_config_byte(HWIF(drive)->pci_dev, 0x59, ®59h); + pci_write_config_byte(HWIF(drive)->pci_dev, 0x59, reg59h|reset); + pci_write_config_byte(HWIF(drive)->pci_dev, 0x59, reg59h); +#endif +} + +static int hpt3xx_tristate (ide_drive_t * drive, int state) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 reg59h = 0, reset = (hwif->channel) ? 0x80 : 0x40; + u8 regXXh = 0, state_reg= (hwif->channel) ? 0x57 : 0x53; + + if (!hwif) + return -EINVAL; + +// hwif->bus_state = state; + + pci_read_config_byte(dev, 0x59, ®59h); + pci_read_config_byte(dev, state_reg, ®XXh); + + if (state) { + (void) ide_do_reset(drive); + pci_write_config_byte(dev, state_reg, regXXh|0x80); + pci_write_config_byte(dev, 0x59, reg59h|reset); + } else { + pci_write_config_byte(dev, 0x59, reg59h & ~(reset)); + pci_write_config_byte(dev, state_reg, regXXh & ~(0x80)); + (void) ide_do_reset(drive); + } + return 0; +} + +/* + * set/get power state for a drive. + * turning the power off does the following things: + * 1) soft-reset the drive + * 2) tri-states the ide bus + * + * when we turn things back on, we need to re-initialize things. + */ +#define TRISTATE_BIT 0x8000 +static int hpt370_busproc(ide_drive_t * drive, int state) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 tristate = 0, resetmask = 0, bus_reg = 0; + u16 tri_reg; + + if (!hwif) + return -EINVAL; + + hwif->bus_state = state; + + if (hwif->channel) { + /* secondary channel */ + tristate = 0x56; + resetmask = 0x80; + } else { + /* primary channel */ + tristate = 0x52; + resetmask = 0x40; + } + + /* grab status */ + pci_read_config_word(dev, tristate, &tri_reg); + pci_read_config_byte(dev, 0x59, &bus_reg); + + /* set the state. we don't set it if we don't need to do so. + * make sure that the drive knows that it has failed if it's off */ + switch (state) { + case BUSSTATE_ON: + hwif->drives[0].failures = 0; + hwif->drives[1].failures = 0; + if ((bus_reg & resetmask) == 0) + return 0; + tri_reg &= ~TRISTATE_BIT; + bus_reg &= ~resetmask; + break; + case BUSSTATE_OFF: + hwif->drives[0].failures = hwif->drives[0].max_failures + 1; + hwif->drives[1].failures = hwif->drives[1].max_failures + 1; + if ((tri_reg & TRISTATE_BIT) == 0 && (bus_reg & resetmask)) + return 0; + tri_reg &= ~TRISTATE_BIT; + bus_reg |= resetmask; + break; + case BUSSTATE_TRISTATE: + hwif->drives[0].failures = hwif->drives[0].max_failures + 1; + hwif->drives[1].failures = hwif->drives[1].max_failures + 1; + if ((tri_reg & TRISTATE_BIT) && (bus_reg & resetmask)) + return 0; + tri_reg |= TRISTATE_BIT; + bus_reg |= resetmask; + break; + } + pci_write_config_byte(dev, 0x59, bus_reg); + pci_write_config_word(dev, tristate, tri_reg); + + return 0; +} + +static int __init init_hpt37x(struct pci_dev *dev) +{ + int adjust, i; + u16 freq; + u32 pll; + u8 reg5bh; + +#if 1 + u8 reg5ah = 0; + pci_read_config_byte(dev, 0x5a, ®5ah); + /* interrupt force enable */ + pci_write_config_byte(dev, 0x5a, (reg5ah & ~0x10)); +#endif + + /* + * default to pci clock. make sure MA15/16 are set to output + * to prevent drives having problems with 40-pin cables. + */ + pci_write_config_byte(dev, 0x5b, 0x23); + + /* + * set up the PLL. we need to adjust it so that it's stable. + * freq = Tpll * 192 / Tpci + */ + pci_read_config_word(dev, 0x78, &freq); + freq &= 0x1FF; + if (freq < 0x9c) { + pll = F_LOW_PCI_33; + if (hpt_minimum_revision(dev,8)) + pci_set_drvdata(dev, (void *) thirty_three_base_hpt374); + else if (hpt_minimum_revision(dev,5)) + pci_set_drvdata(dev, (void *) thirty_three_base_hpt372); + else if (hpt_minimum_revision(dev,4)) + pci_set_drvdata(dev, (void *) thirty_three_base_hpt370a); + else + pci_set_drvdata(dev, (void *) thirty_three_base_hpt370); + printk("HPT37X: using 33MHz PCI clock\n"); + } else if (freq < 0xb0) { + pll = F_LOW_PCI_40; + } else if (freq < 0xc8) { + pll = F_LOW_PCI_50; + if (hpt_minimum_revision(dev,8)) + return -EOPNOTSUPP; + else if (hpt_minimum_revision(dev,5)) + pci_set_drvdata(dev, (void *) fifty_base_hpt372); + else if (hpt_minimum_revision(dev,4)) + pci_set_drvdata(dev, (void *) fifty_base_hpt370a); + else + pci_set_drvdata(dev, (void *) fifty_base_hpt370a); + printk("HPT37X: using 50MHz PCI clock\n"); + } else { + pll = F_LOW_PCI_66; + if (hpt_minimum_revision(dev,8)) + return -EOPNOTSUPP; + else if (hpt_minimum_revision(dev,5)) + pci_set_drvdata(dev, (void *) sixty_six_base_hpt372); + else if (hpt_minimum_revision(dev,4)) + pci_set_drvdata(dev, (void *) sixty_six_base_hpt370a); + else + pci_set_drvdata(dev, (void *) sixty_six_base_hpt370); + printk("HPT37X: using 66MHz PCI clock\n"); + } + + /* + * only try the pll if we don't have a table for the clock + * speed that we're running at. NOTE: the internal PLL will + * result in slow reads when using a 33MHz PCI clock. we also + * don't like to use the PLL because it will cause glitches + * on PRST/SRST when the HPT state engine gets reset. + */ + if (dev->driver_data) + goto init_hpt37X_done; + + /* + * adjust PLL based upon PCI clock, enable it, and wait for + * stabilization. + */ + adjust = 0; + freq = (pll < F_LOW_PCI_50) ? 2 : 4; + while (adjust++ < 6) { + pci_write_config_dword(dev, 0x5c, (freq + pll) << 16 | + pll | 0x100); + + /* wait for clock stabilization */ + for (i = 0; i < 0x50000; i++) { + pci_read_config_byte(dev, 0x5b, ®5bh); + if (reg5bh & 0x80) { + /* spin looking for the clock to destabilize */ + for (i = 0; i < 0x1000; ++i) { + pci_read_config_byte(dev, 0x5b, + ®5bh); + if ((reg5bh & 0x80) == 0) + goto pll_recal; + } + pci_read_config_dword(dev, 0x5c, &pll); + pci_write_config_dword(dev, 0x5c, + pll & ~0x100); + pci_write_config_byte(dev, 0x5b, 0x21); + if (hpt_minimum_revision(dev,8)) + return -EOPNOTSUPP; + else if (hpt_minimum_revision(dev,5)) + pci_set_drvdata(dev, (void *) fifty_base_hpt372); + else if (hpt_minimum_revision(dev,4)) + pci_set_drvdata(dev, (void *) fifty_base_hpt370a); + else + pci_set_drvdata(dev, (void *) fifty_base_hpt370a); + printk("HPT37X: using 50MHz internal PLL\n"); + goto init_hpt37X_done; + } + } +pll_recal: + if (adjust & 1) + pll -= (adjust >> 1); + else + pll += (adjust >> 1); + } + +init_hpt37X_done: + /* reset state engine */ + pci_write_config_byte(dev, 0x50, 0x37); + pci_write_config_byte(dev, 0x54, 0x37); + udelay(100); + return 0; +} + +static int __init init_hpt366 (struct pci_dev *dev) +{ + u32 reg1 = 0; + u8 drive_fast = 0; + + /* + * Disable the "fast interrupt" prediction. + */ + pci_read_config_byte(dev, 0x51, &drive_fast); + if (drive_fast & 0x80) + pci_write_config_byte(dev, 0x51, drive_fast & ~0x80); + pci_read_config_dword(dev, 0x40, ®1); + + /* detect bus speed by looking at control reg timing: */ + switch((reg1 >> 8) & 7) { + case 5: + pci_set_drvdata(dev, (void *) forty_base_hpt366); + break; + case 9: + pci_set_drvdata(dev, (void *) twenty_five_base_hpt366); + break; + case 7: + default: + pci_set_drvdata(dev, (void *) thirty_three_base_hpt366); + break; + } + + if (!dev->driver_data) + { + printk(KERN_ERR "hpt366: unknown bus timing.\n"); + return -EOPNOTSUPP; + } + return 0; +} + +static unsigned int __init init_chipset_hpt366 (struct pci_dev *dev, const char *name) +{ + int ret = 0; + u8 test = 0; + + if (dev->resource[PCI_ROM_RESOURCE].start) + pci_write_config_byte(dev, PCI_ROM_ADDRESS, + dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); + + pci_read_config_byte(dev, PCI_CACHE_LINE_SIZE, &test); + if (test != (L1_CACHE_BYTES / 4)) + pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, + (L1_CACHE_BYTES / 4)); + + pci_read_config_byte(dev, PCI_LATENCY_TIMER, &test); + if (test != 0x78) + pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x78); + + pci_read_config_byte(dev, PCI_MIN_GNT, &test); + if (test != 0x08) + pci_write_config_byte(dev, PCI_MIN_GNT, 0x08); + + pci_read_config_byte(dev, PCI_MAX_LAT, &test); + if (test != 0x08) + pci_write_config_byte(dev, PCI_MAX_LAT, 0x08); + + if (hpt_minimum_revision(dev, 3)) { + ret = init_hpt37x(dev); + } else { + ret =init_hpt366(dev); + } + if(ret) + return ret; + +#if defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) + hpt_devs[n_hpt_devs++] = dev; + + if (!hpt366_proc) { + hpt366_proc = 1; + ide_pci_register_host_proc(&hpt366_procs[0]); + } +#endif /* DISPLAY_HPT366_TIMINGS && CONFIG_PROC_FS */ + + return dev->irq; +} + +static void __init init_hwif_hpt366 (ide_hwif_t *hwif) +{ + struct pci_dev *dev = hwif->pci_dev; + u8 ata66 = 0, regmask = (hwif->channel) ? 0x01 : 0x02; + + hwif->tuneproc = &hpt3xx_tune_drive; + hwif->speedproc = &hpt3xx_tune_chipset; + hwif->quirkproc = &hpt3xx_quirkproc; + hwif->intrproc = &hpt3xx_intrproc; + hwif->maskproc = &hpt3xx_maskproc; + + pci_read_config_byte(hwif->pci_dev, 0x5a, &ata66); + +#ifdef DEBUG + printk("HPT366: reg5ah=0x%02x ATA-%s Cable Port%d\n", + ata66, (ata66 & regmask) ? "33" : "66", + PCI_FUNC(hwif->pci_dev->devfn)); +#endif /* DEBUG */ + +#ifdef HPT_SERIALIZE_IO + /* serialize access to this device */ + if (hwif->mate) + hwif->serialized = hwif->mate->serialized = 1; +#endif + + if (hpt_minimum_revision(dev,3)) { + u8 reg5ah = 0; + pci_write_config_byte(dev, 0x5a, reg5ah & ~0x10); + /* + * set up ioctl for power status. + * note: power affects both + * drives on each channel + */ + hwif->resetproc = &hpt3xx_reset; + hwif->busproc = &hpt370_busproc; +// hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + } else if (hpt_minimum_revision(dev,2)) { + hwif->resetproc = &hpt3xx_reset; + hwif->busproc = &hpt3xx_tristate; + } else { + hwif->resetproc = &hpt3xx_reset; + hwif->busproc = &hpt3xx_tristate; + } + + hwif->ratemask = &hpt3xx_ratemask; + hwif->ratefilter = &hpt3xx_ratefilter; + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + if (!(hwif->udma_four)) + hwif->udma_four = ((ata66 & regmask) ? 0 : 1); + hwif->ide_dma_check = &hpt366_config_drive_xfer_rate; + + if (hpt_minimum_revision(dev,8)) + hwif->ide_dma_end = &hpt374_ide_dma_end; + else if (hpt_minimum_revision(dev,5)) + hwif->ide_dma_end = &hpt374_ide_dma_end; + else if (hpt_minimum_revision(dev,3)) { + hwif->ide_dma_begin = &hpt370_ide_dma_begin; + hwif->ide_dma_end = &hpt370_ide_dma_end; + hwif->ide_dma_timeout = &hpt370_ide_dma_timeout; + hwif->ide_dma_lostirq = &hpt370_ide_dma_lostirq; + } else if (hpt_minimum_revision(dev,2)) + hwif->ide_dma_lostirq = &hpt366_ide_dma_lostirq; + else + hwif->ide_dma_lostirq = &hpt366_ide_dma_lostirq; + + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static void __init init_dma_hpt366 (ide_hwif_t *hwif, unsigned long dmabase) +{ + u8 masterdma = 0, slavedma = 0; + u8 dma_new = 0, dma_old = 0; + u8 primary = hwif->channel ? 0x4b : 0x43; + u8 secondary = hwif->channel ? 0x4f : 0x47; + unsigned long flags; + + if (!dmabase) + return; + + dma_old = hwif->INB(dmabase+2); + + local_irq_save(flags); + + dma_new = dma_old; + pci_read_config_byte(hwif->pci_dev, primary, &masterdma); + pci_read_config_byte(hwif->pci_dev, secondary, &slavedma); + + if (masterdma & 0x30) dma_new |= 0x20; + if (slavedma & 0x30) dma_new |= 0x40; + if (dma_new != dma_old) + hwif->OUTB(dma_new, dmabase+2); + + local_irq_restore(flags); + + ide_setup_dma(hwif, dmabase, 8); +} + +static void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); +static void ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_hpt374 (struct pci_dev *dev, ide_pci_device_t *d) +{ + struct pci_dev *findev = NULL; + + if (PCI_FUNC(dev->devfn) & 1) + return; + + pci_for_each_dev(findev) { + if ((findev->vendor == dev->vendor) && + (findev->device == dev->device) && + ((findev->devfn - dev->devfn) == 1) && + (PCI_FUNC(findev->devfn) & 1)) { + u8 irq = 0, irq2 = 0; + pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); + pci_read_config_byte(findev, PCI_INTERRUPT_LINE, &irq2); + if (irq != irq2) { + pci_write_config_byte(findev, + PCI_INTERRUPT_LINE, irq); + findev->irq = dev->irq; + printk("%s: pci-config space interrupt " + "fixed.\n", d->name); + } + ide_setup_pci_devices(dev, findev, d); + return; + } + } + ide_setup_pci_device(dev, d); +} + +static void __init init_setup_hpt37x (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +static void __init init_setup_hpt366 (struct pci_dev *dev, ide_pci_device_t *d) +{ + struct pci_dev *findev = NULL; + u8 pin1 = 0, pin2 = 0; + unsigned int class_rev; + char *chipset_names[] = {"HPT366", "HPT366", "HPT368", + "HPT370", "HPT370A", "HPT372"}; + + if (PCI_FUNC(dev->devfn) & 1) + return; + + pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xff; + + strcpy(d->name, chipset_names[class_rev]); + + switch(class_rev) { + case 5: + case 4: + case 3: ide_setup_pci_device(dev, d); + return; + default: break; + } + + d->channels = 1; + + pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin1); + pci_for_each_dev(findev) { + if ((findev->vendor == dev->vendor) && + (findev->device == dev->device) && + ((findev->devfn - dev->devfn) == 1) && + (PCI_FUNC(findev->devfn) & 1)) { + pci_read_config_byte(findev, PCI_INTERRUPT_PIN, &pin2); + if ((pin1 != pin2) && (dev->irq == findev->irq)) { + d->bootable = ON_BOARD; + printk("%s: onboard version of chipset, " + "pin1=%d pin2=%d\n", d->name, + pin1, pin2); + } + ide_setup_pci_devices(dev, findev, d); + return; + } + } + ide_setup_pci_device(dev, d); +} + +int __init hpt366_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_TTI) + return 0; + if (dev->device == PCI_DEVICE_ID_TTI_HPT343) + return 0; + + for (d = hpt366_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/hpt366.h linux.20pre5-ac2/drivers/ide/pci/hpt366.h --- linux.20pre5/drivers/ide/pci/hpt366.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/hpt366.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,523 @@ +#ifndef HPT366_H +#define HPT366_H + +#include +#include +#include + +#define DISPLAY_HPT366_TIMINGS + +/* various tuning parameters */ +#define HPT_RESET_STATE_ENGINE +#undef HPT_DELAY_INTERRUPT +#undef HPT_SERIALIZE_IO + +const char *quirk_drives[] = { + "QUANTUM FIREBALLlct08 08", + "QUANTUM FIREBALLP KA6.4", + "QUANTUM FIREBALLP LM20.4", + "QUANTUM FIREBALLP LM20.5", + NULL +}; + +const char *bad_ata100_5[] = { + "IBM-DTLA-307075", + "IBM-DTLA-307060", + "IBM-DTLA-307045", + "IBM-DTLA-307030", + "IBM-DTLA-307020", + "IBM-DTLA-307015", + "IBM-DTLA-305040", + "IBM-DTLA-305030", + "IBM-DTLA-305020", + "IC35L010AVER07-0", + "IC35L020AVER07-0", + "IC35L030AVER07-0", + "IC35L040AVER07-0", + "IC35L060AVER07-0", + "WDC AC310200R", + NULL +}; + +const char *bad_ata66_4[] = { + "IBM-DTLA-307075", + "IBM-DTLA-307060", + "IBM-DTLA-307045", + "IBM-DTLA-307030", + "IBM-DTLA-307020", + "IBM-DTLA-307015", + "IBM-DTLA-305040", + "IBM-DTLA-305030", + "IBM-DTLA-305020", + "IC35L010AVER07-0", + "IC35L020AVER07-0", + "IC35L030AVER07-0", + "IC35L040AVER07-0", + "IC35L060AVER07-0", + "WDC AC310200R", + NULL +}; + +const char *bad_ata66_3[] = { + "WDC AC310200R", + NULL +}; + +const char *bad_ata33[] = { + "Maxtor 92720U8", "Maxtor 92040U6", "Maxtor 91360U4", "Maxtor 91020U3", "Maxtor 90845U3", "Maxtor 90650U2", + "Maxtor 91360D8", "Maxtor 91190D7", "Maxtor 91020D6", "Maxtor 90845D5", "Maxtor 90680D4", "Maxtor 90510D3", "Maxtor 90340D2", + "Maxtor 91152D8", "Maxtor 91008D7", "Maxtor 90845D6", "Maxtor 90840D6", "Maxtor 90720D5", "Maxtor 90648D5", "Maxtor 90576D4", + "Maxtor 90510D4", + "Maxtor 90432D3", "Maxtor 90288D2", "Maxtor 90256D2", + "Maxtor 91000D8", "Maxtor 90910D8", "Maxtor 90875D7", "Maxtor 90840D7", "Maxtor 90750D6", "Maxtor 90625D5", "Maxtor 90500D4", + "Maxtor 91728D8", "Maxtor 91512D7", "Maxtor 91303D6", "Maxtor 91080D5", "Maxtor 90845D4", "Maxtor 90680D4", "Maxtor 90648D3", "Maxtor 90432D2", + NULL +}; + +struct chipset_bus_clock_list_entry { + byte xfer_speed; + unsigned int chipset_settings; +}; + +/* key for bus clock timings + * bit + * 0:3 data_high_time. inactive time of DIOW_/DIOR_ for PIO and MW + * DMA. cycles = value + 1 + * 4:8 data_low_time. active time of DIOW_/DIOR_ for PIO and MW + * DMA. cycles = value + 1 + * 9:12 cmd_high_time. inactive time of DIOW_/DIOR_ during task file + * register access. + * 13:17 cmd_low_time. active time of DIOW_/DIOR_ during task file + * register access. + * 18:21 udma_cycle_time. clock freq and clock cycles for UDMA xfer. + * during task file register access. + * 22:24 pre_high_time. time to initialize 1st cycle for PIO and MW DMA + * xfer. + * 25:27 cmd_pre_high_time. time to initialize 1st PIO cycle for task + * register access. + * 28 UDMA enable + * 29 DMA enable + * 30 PIO_MST enable. if set, the chip is in bus master mode during + * PIO. + * 31 FIFO enable. + */ +struct chipset_bus_clock_list_entry forty_base_hpt366[] = { + { XFER_UDMA_4, 0x900fd943 }, + { XFER_UDMA_3, 0x900ad943 }, + { XFER_UDMA_2, 0x900bd943 }, + { XFER_UDMA_1, 0x9008d943 }, + { XFER_UDMA_0, 0x9008d943 }, + + { XFER_MW_DMA_2, 0xa008d943 }, + { XFER_MW_DMA_1, 0xa010d955 }, + { XFER_MW_DMA_0, 0xa010d9fc }, + + { XFER_PIO_4, 0xc008d963 }, + { XFER_PIO_3, 0xc010d974 }, + { XFER_PIO_2, 0xc010d997 }, + { XFER_PIO_1, 0xc010d9c7 }, + { XFER_PIO_0, 0xc018d9d9 }, + { 0, 0x0120d9d9 } +}; + +struct chipset_bus_clock_list_entry thirty_three_base_hpt366[] = { + { XFER_UDMA_4, 0x90c9a731 }, + { XFER_UDMA_3, 0x90cfa731 }, + { XFER_UDMA_2, 0x90caa731 }, + { XFER_UDMA_1, 0x90cba731 }, + { XFER_UDMA_0, 0x90c8a731 }, + + { XFER_MW_DMA_2, 0xa0c8a731 }, + { XFER_MW_DMA_1, 0xa0c8a732 }, /* 0xa0c8a733 */ + { XFER_MW_DMA_0, 0xa0c8a797 }, + + { XFER_PIO_4, 0xc0c8a731 }, + { XFER_PIO_3, 0xc0c8a742 }, + { XFER_PIO_2, 0xc0d0a753 }, + { XFER_PIO_1, 0xc0d0a7a3 }, /* 0xc0d0a793 */ + { XFER_PIO_0, 0xc0d0a7aa }, /* 0xc0d0a7a7 */ + { 0, 0x0120a7a7 } +}; + +struct chipset_bus_clock_list_entry twenty_five_base_hpt366[] = { + + { XFER_UDMA_4, 0x90c98521 }, + { XFER_UDMA_3, 0x90cf8521 }, + { XFER_UDMA_2, 0x90cf8521 }, + { XFER_UDMA_1, 0x90cb8521 }, + { XFER_UDMA_0, 0x90cb8521 }, + + { XFER_MW_DMA_2, 0xa0ca8521 }, + { XFER_MW_DMA_1, 0xa0ca8532 }, + { XFER_MW_DMA_0, 0xa0ca8575 }, + + { XFER_PIO_4, 0xc0ca8521 }, + { XFER_PIO_3, 0xc0ca8532 }, + { XFER_PIO_2, 0xc0ca8542 }, + { XFER_PIO_1, 0xc0d08572 }, + { XFER_PIO_0, 0xc0d08585 }, + { 0, 0x01208585 } +}; + +/* from highpoint documentation. these are old values */ +struct chipset_bus_clock_list_entry thirty_three_base_hpt370[] = { +/* { XFER_UDMA_5, 0x1A85F442, 0x16454e31 }, */ + { XFER_UDMA_5, 0x16454e31 }, + { XFER_UDMA_4, 0x16454e31 }, + { XFER_UDMA_3, 0x166d4e31 }, + { XFER_UDMA_2, 0x16494e31 }, + { XFER_UDMA_1, 0x164d4e31 }, + { XFER_UDMA_0, 0x16514e31 }, + + { XFER_MW_DMA_2, 0x26514e21 }, + { XFER_MW_DMA_1, 0x26514e33 }, + { XFER_MW_DMA_0, 0x26514e97 }, + + { XFER_PIO_4, 0x06514e21 }, + { XFER_PIO_3, 0x06514e22 }, + { XFER_PIO_2, 0x06514e33 }, + { XFER_PIO_1, 0x06914e43 }, + { XFER_PIO_0, 0x06914e57 }, + { 0, 0x06514e57 } +}; + +struct chipset_bus_clock_list_entry sixty_six_base_hpt370[] = { + { XFER_UDMA_5, 0x14846231 }, + { XFER_UDMA_4, 0x14886231 }, + { XFER_UDMA_3, 0x148c6231 }, + { XFER_UDMA_2, 0x148c6231 }, + { XFER_UDMA_1, 0x14906231 }, + { XFER_UDMA_0, 0x14986231 }, + + { XFER_MW_DMA_2, 0x26514e21 }, + { XFER_MW_DMA_1, 0x26514e33 }, + { XFER_MW_DMA_0, 0x26514e97 }, + + { XFER_PIO_4, 0x06514e21 }, + { XFER_PIO_3, 0x06514e22 }, + { XFER_PIO_2, 0x06514e33 }, + { XFER_PIO_1, 0x06914e43 }, + { XFER_PIO_0, 0x06914e57 }, + { 0, 0x06514e57 } +}; + +/* these are the current (4 sep 2001) timings from highpoint */ +struct chipset_bus_clock_list_entry thirty_three_base_hpt370a[] = { + { XFER_UDMA_5, 0x12446231 }, + { XFER_UDMA_4, 0x12446231 }, + { XFER_UDMA_3, 0x126c6231 }, + { XFER_UDMA_2, 0x12486231 }, + { XFER_UDMA_1, 0x124c6233 }, + { XFER_UDMA_0, 0x12506297 }, + + { XFER_MW_DMA_2, 0x22406c31 }, + { XFER_MW_DMA_1, 0x22406c33 }, + { XFER_MW_DMA_0, 0x22406c97 }, + + { XFER_PIO_4, 0x06414e31 }, + { XFER_PIO_3, 0x06414e42 }, + { XFER_PIO_2, 0x06414e53 }, + { XFER_PIO_1, 0x06814e93 }, + { XFER_PIO_0, 0x06814ea7 }, + { 0, 0x06814ea7 } +}; + +/* 2x 33MHz timings */ +struct chipset_bus_clock_list_entry sixty_six_base_hpt370a[] = { + { XFER_UDMA_5, 0x1488e673 }, + { XFER_UDMA_4, 0x1488e673 }, + { XFER_UDMA_3, 0x1498e673 }, + { XFER_UDMA_2, 0x1490e673 }, + { XFER_UDMA_1, 0x1498e677 }, + { XFER_UDMA_0, 0x14a0e73f }, + + { XFER_MW_DMA_2, 0x2480fa73 }, + { XFER_MW_DMA_1, 0x2480fa77 }, + { XFER_MW_DMA_0, 0x2480fb3f }, + + { XFER_PIO_4, 0x0c82be73 }, + { XFER_PIO_3, 0x0c82be95 }, + { XFER_PIO_2, 0x0c82beb7 }, + { XFER_PIO_1, 0x0d02bf37 }, + { XFER_PIO_0, 0x0d02bf5f }, + { 0, 0x0d02bf5f } +}; + +struct chipset_bus_clock_list_entry fifty_base_hpt370a[] = { + { XFER_UDMA_5, 0x12848242 }, + { XFER_UDMA_4, 0x12ac8242 }, + { XFER_UDMA_3, 0x128c8242 }, + { XFER_UDMA_2, 0x120c8242 }, + { XFER_UDMA_1, 0x12148254 }, + { XFER_UDMA_0, 0x121882ea }, + + { XFER_MW_DMA_2, 0x22808242 }, + { XFER_MW_DMA_1, 0x22808254 }, + { XFER_MW_DMA_0, 0x228082ea }, + + { XFER_PIO_4, 0x0a81f442 }, + { XFER_PIO_3, 0x0a81f443 }, + { XFER_PIO_2, 0x0a81f454 }, + { XFER_PIO_1, 0x0ac1f465 }, + { XFER_PIO_0, 0x0ac1f48a }, + { 0, 0x0ac1f48a } +}; + +struct chipset_bus_clock_list_entry thirty_three_base_hpt372[] = { + { XFER_UDMA_6, 0x1c81dc62 }, + { XFER_UDMA_5, 0x1c6ddc62 }, + { XFER_UDMA_4, 0x1c8ddc62 }, + { XFER_UDMA_3, 0x1c8edc62 }, /* checkme */ + { XFER_UDMA_2, 0x1c91dc62 }, + { XFER_UDMA_1, 0x1c9adc62 }, /* checkme */ + { XFER_UDMA_0, 0x1c82dc62 }, /* checkme */ + + { XFER_MW_DMA_2, 0x2c829262 }, + { XFER_MW_DMA_1, 0x2c829266 }, /* checkme */ + { XFER_MW_DMA_0, 0x2c82922e }, /* checkme */ + + { XFER_PIO_4, 0x0c829c62 }, + { XFER_PIO_3, 0x0c829c84 }, + { XFER_PIO_2, 0x0c829ca6 }, + { XFER_PIO_1, 0x0d029d26 }, + { XFER_PIO_0, 0x0d029d5e }, + { 0, 0x0d029d5e } +}; + +struct chipset_bus_clock_list_entry fifty_base_hpt372[] = { + { XFER_UDMA_5, 0x12848242 }, + { XFER_UDMA_4, 0x12ac8242 }, + { XFER_UDMA_3, 0x128c8242 }, + { XFER_UDMA_2, 0x120c8242 }, + { XFER_UDMA_1, 0x12148254 }, + { XFER_UDMA_0, 0x121882ea }, + + { XFER_MW_DMA_2, 0x22808242 }, + { XFER_MW_DMA_1, 0x22808254 }, + { XFER_MW_DMA_0, 0x228082ea }, + + { XFER_PIO_4, 0x0a81f442 }, + { XFER_PIO_3, 0x0a81f443 }, + { XFER_PIO_2, 0x0a81f454 }, + { XFER_PIO_1, 0x0ac1f465 }, + { XFER_PIO_0, 0x0ac1f48a }, + { 0, 0x0a81f443 } +}; + +struct chipset_bus_clock_list_entry sixty_six_base_hpt372[] = { + { XFER_UDMA_6, 0x1c869c62 }, + { XFER_UDMA_5, 0x1cae9c62 }, + { XFER_UDMA_4, 0x1c8a9c62 }, + { XFER_UDMA_3, 0x1c8e9c62 }, + { XFER_UDMA_2, 0x1c929c62 }, + { XFER_UDMA_1, 0x1c9a9c62 }, + { XFER_UDMA_0, 0x1c829c62 }, + + { XFER_MW_DMA_2, 0x2c829c62 }, + { XFER_MW_DMA_1, 0x2c829c66 }, + { XFER_MW_DMA_0, 0x2c829d2e }, + + { XFER_PIO_4, 0x0c829c62 }, + { XFER_PIO_3, 0x0c829c84 }, + { XFER_PIO_2, 0x0c829ca6 }, + { XFER_PIO_1, 0x0d029d26 }, + { XFER_PIO_0, 0x0d029d5e }, + { 0, 0x0d029d26 } +}; + +struct chipset_bus_clock_list_entry thirty_three_base_hpt374[] = { + { XFER_UDMA_6, 0x12808242 }, + { XFER_UDMA_5, 0x12848242 }, + { XFER_UDMA_4, 0x12ac8242 }, + { XFER_UDMA_3, 0x128c8242 }, + { XFER_UDMA_2, 0x120c8242 }, + { XFER_UDMA_1, 0x12148254 }, + { XFER_UDMA_0, 0x121882ea }, + + { XFER_MW_DMA_2, 0x22808242 }, + { XFER_MW_DMA_1, 0x22808254 }, + { XFER_MW_DMA_0, 0x228082ea }, + + { XFER_PIO_4, 0x0a81f442 }, + { XFER_PIO_3, 0x0a81f443 }, + { XFER_PIO_2, 0x0a81f454 }, + { XFER_PIO_1, 0x0ac1f465 }, + { XFER_PIO_0, 0x0ac1f48a }, + { 0, 0x06814e93 } +}; + +#if 0 +struct chipset_bus_clock_list_entry fifty_base_hpt374[] = { + { XFER_UDMA_6, }, + { XFER_UDMA_5, }, + { XFER_UDMA_4, }, + { XFER_UDMA_3, }, + { XFER_UDMA_2, }, + { XFER_UDMA_1, }, + { XFER_UDMA_0, }, + { XFER_MW_DMA_2, }, + { XFER_MW_DMA_1, }, + { XFER_MW_DMA_0, }, + { XFER_PIO_4, }, + { XFER_PIO_3, }, + { XFER_PIO_2, }, + { XFER_PIO_1, }, + { XFER_PIO_0, }, + { 0, } +}; +#endif +#if 0 +struct chipset_bus_clock_list_entry sixty_six_base_hpt374[] = { + { XFER_UDMA_6, 0x12406231 }, /* checkme */ + { XFER_UDMA_5, 0x12446231 }, + 0x14846231 + { XFER_UDMA_4, 0x16814ea7 }, + 0x14886231 + { XFER_UDMA_3, 0x16814ea7 }, + 0x148c6231 + { XFER_UDMA_2, 0x16814ea7 }, + 0x148c6231 + { XFER_UDMA_1, 0x16814ea7 }, + 0x14906231 + { XFER_UDMA_0, 0x16814ea7 }, + 0x14986231 + { XFER_MW_DMA_2, 0x16814ea7 }, + 0x26514e21 + { XFER_MW_DMA_1, 0x16814ea7 }, + 0x26514e97 + { XFER_MW_DMA_0, 0x16814ea7 }, + 0x26514e97 + { XFER_PIO_4, 0x06814ea7 }, + 0x06514e21 + { XFER_PIO_3, 0x06814ea7 }, + 0x06514e22 + { XFER_PIO_2, 0x06814ea7 }, + 0x06514e33 + { XFER_PIO_1, 0x06814ea7 }, + 0x06914e43 + { XFER_PIO_0, 0x06814ea7 }, + 0x06914e57 + { 0, 0x06814ea7 } +}; +#endif + +#define HPT366_DEBUG_DRIVE_INFO 0 +#define HPT374_ALLOW_ATA133_6 0 +#define HPT371_ALLOW_ATA133_6 0 +#define HPT302_ALLOW_ATA133_6 0 +#define HPT372_ALLOW_ATA133_6 1 +#define HPT370_ALLOW_ATA100_5 1 +#define HPT366_ALLOW_ATA66_4 1 +#define HPT366_ALLOW_ATA66_3 1 +#define HPT366_MAX_DEVS 8 + +#define F_LOW_PCI_33 0x23 +#define F_LOW_PCI_40 0x29 +#define F_LOW_PCI_50 0x2d +#define F_LOW_PCI_66 0x42 + +#if defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 hpt366_proc; + +static int hpt366_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t hpt366_procs[] __initdata = { + { + name: "hpt366", + set: 1, + get_info: hpt366_get_info, + parent: NULL, + }, +}; +#endif /* defined(DISPLAY_HPT366_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static void init_setup_hpt366(struct pci_dev *, ide_pci_device_t *); +static void init_setup_hpt37x(struct pci_dev *, ide_pci_device_t *); +static void init_setup_hpt374(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_hpt366(struct pci_dev *, const char *); +static void init_hwif_hpt366(ide_hwif_t *); +static void init_dma_hpt366(ide_hwif_t *, unsigned long); + +static ide_pci_device_t hpt366_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_TTI, + device: PCI_DEVICE_ID_TTI_HPT366, + name: "HPT366", + init_setup: init_setup_hpt366, + init_chipset: init_chipset_hpt366, + init_iops: NULL, + init_hwif: init_hwif_hpt366, + init_dma: init_dma_hpt366, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 240 + },{ + vendor: PCI_VENDOR_ID_TTI, + device: PCI_DEVICE_ID_TTI_HPT372, + name: "HPT372A", + init_setup: init_setup_hpt37x, + init_chipset: init_chipset_hpt366, + init_iops: NULL, + init_hwif: init_hwif_hpt366, + init_dma: init_dma_hpt366, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0 + },{ + vendor: PCI_VENDOR_ID_TTI, + device: PCI_DEVICE_ID_TTI_HPT302, + name: "HPT302", + init_setup: init_setup_hpt37x, + init_chipset: init_chipset_hpt366, + init_iops: NULL, + init_hwif: init_hwif_hpt366, + init_dma: init_dma_hpt366, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0 + },{ + vendor: PCI_VENDOR_ID_TTI, + device: PCI_DEVICE_ID_TTI_HPT371, + name: "HPT371", + init_setup: init_setup_hpt37x, + init_chipset: init_chipset_hpt366, + init_iops: NULL, + init_hwif: init_hwif_hpt366, + init_dma: init_dma_hpt366, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0 + },{ + vendor: PCI_VENDOR_ID_TTI, + device: PCI_DEVICE_ID_TTI_HPT374, + name: "HPT374", + init_setup: init_setup_hpt374, + init_chipset: init_chipset_hpt366, + init_iops: NULL, + init_hwif: init_hwif_hpt366, + init_dma: init_dma_hpt366, + channels: 2, /* 4 */ + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0 + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* HPT366_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/it8172.c linux.20pre5-ac2/drivers/ide/pci/it8172.c --- linux.20pre5/drivers/ide/pci/it8172.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/it8172.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,362 @@ +/* + * + * BRIEF MODULE DESCRIPTION + * IT8172 IDE controller support + * + * Copyright 2000 MontaVista Software Inc. + * Author: MontaVista Software, Inc. + * stevel@mvista.com or source@mvista.com + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "ide_modes.h" +#include "it8172.h" + +/* + * Prototypes + */ +static u8 it8172_ratemask (ide_drive_t *drive) +{ + return 1; +} + +static u8 it8172_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + /* it8172's ratemask is between 0-1 and capped at UDMA33 */ + return min(speed, speed_max[it8172_ratemask(drive)]); + #else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static void it8172_tune_drive (ide_drive_t *drive, u8 pio) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + int is_slave = (hwif->drives[1] == drive); + unsigned long flags; + u16 drive_enables; + u32 drive_timing; + + pio = ide_get_best_pio_mode(drive, pio, 4, NULL); + spin_lock_irqsave(&io_request_lock, flags); + pci_read_config_word(dev, 0x40, &drive_enables); + pci_read_config_dword(dev, 0x44, &drive_timing); + + /* + * FIX! The DIOR/DIOW pulse width and recovery times in port 0x44 + * are being left at the default values of 8 PCI clocks (242 nsec + * for a 33 MHz clock). These can be safely shortened at higher + * PIO modes. The DIOR/DIOW pulse width and recovery times only + * apply to PIO modes, not to the DMA modes. + */ + + /* + * Enable port 0x44. The IT8172G spec is confused; it calls + * this register the "Slave IDE Timing Register", but in fact, + * it controls timing for both master and slave drives. + */ + drive_enables |= 0x4000; + + if (is_slave) { + drive_enables &= 0xc006; + if (pio > 1) + /* enable prefetch and IORDY sample-point */ + drive_enables |= 0x0060; + } else { + drive_enables &= 0xc060; + if (pio > 1) + /* enable prefetch and IORDY sample-point */ + drive_enables |= 0x0006; + } + + pci_write_config_word(dev, 0x40, drive_enables); + spin_unlock_irqrestore(&io_request_lock, flags) +} + +static u8 it8172_dma_2_pio (u8 xfer_rate) +{ + switch(xfer_rate) { + case XFER_UDMA_5: + case XFER_UDMA_4: + case XFER_UDMA_3: + case XFER_UDMA_2: + case XFER_UDMA_1: + case XFER_UDMA_0: + case XFER_MW_DMA_2: + case XFER_PIO_4: + return 4; + case XFER_MW_DMA_1: + case XFER_PIO_3: + return 3; + case XFER_SW_DMA_2: + case XFER_PIO_2: + return 2; + case XFER_MW_DMA_0: + case XFER_SW_DMA_1: + case XFER_SW_DMA_0: + case XFER_PIO_1: + case XFER_PIO_0: + case XFER_PIO_SLOW: + default: + return 0; + } +} + +static int it8172_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 speed = it8172_ratefilter(drive, xferspeed); + int a_speed = 3 << (drive->dn * 4); + int u_flag = 1 << drive->dn; + int u_speed = 0; + u8 reg48, reg4a; + + pci_read_config_byte(dev, 0x48, ®48); + pci_read_config_byte(dev, 0x4a, ®4a); + + /* + * Setting the DMA cycle time to 2 or 3 PCI clocks (60 and 91 nsec + * at 33 MHz PCI clock) seems to cause BadCRC errors during DMA + * transfers on some drives, even though both numbers meet the minimum + * ATAPI-4 spec of 73 and 54 nsec for UDMA 1 and 2 respectively. + * So the faster times are just commented out here. The good news is + * that the slower cycle time has very little affect on transfer + * performance. + */ + + switch(speed) { +#ifdef CONFIG_BLK_DEV_IDEDMA + case XFER_UDMA_4: + case XFER_UDMA_2: //u_speed = 2 << (drive->dn * 4); break; + case XFER_UDMA_5: + case XFER_UDMA_3: + case XFER_UDMA_1: //u_speed = 1 << (drive->dn * 4); break; + case XFER_UDMA_0: u_speed = 0 << (drive->dn * 4); break; + case XFER_MW_DMA_2: + case XFER_MW_DMA_1: + case XFER_MW_DMA_0: + case XFER_SW_DMA_2: break; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + case XFER_PIO_4: + case XFER_PIO_3: + case XFER_PIO_2: + case XFER_PIO_0: break; + default: return -1; + } + + if (speed >= XFER_UDMA_0) { + pci_write_config_byte(dev, 0x48, reg48 | u_flag); + reg4a &= ~a_speed; + pci_write_config_byte(dev, 0x4a, reg4a | u_speed); + } else { + pci_write_config_byte(dev, 0x48, reg48 & ~u_flag); + pci_write_config_byte(dev, 0x4a, reg4a & ~a_speed); + } + + it8172_tune_drive(drive, it8172_dma_2_pio(speed)); + return (ide_config_drive_speed(drive, speed)); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +static int it8172_config_chipset_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + u8 mode = it8172_ratemask(drive); + u8 speed = 0, tspeed = 0; + + switch(mode) { + case 0x01: + if (id->dma_ultra & 0x0040) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0020) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_1word & 0x0004) + { speed = XFER_SW_DMA_2; break; } + default: + tspeed = ide_get_best_pio_mode(drive, 255, 4, NULL); + speed = it8172_dma_2_pio(XFER_PIO_0 + tspeed); + break; + } + + (void) it8172_tune_chipset(drive, speed); + + return ((int) ((((id->dma_ultra >> 8) & 0x07) || + ((id->dma_mword >> 8) & 0x06) || + ((id->dma_1word >> 8) & 0x04)) ? 1 : 0)); +} + +static int it8172_config_drive_xfer_rate (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + drive->init_speed = 0; + + if (id && (id->capability & 1) && drive->autodma) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + if (id->field_valid & 4) { + if (id->dma_ultra & 0x0007) { + /* Force if Capable UltraDMA */ + int dma = it8172_config_chipset_for_dma(drive); + if ((id->field_valid & 2) && !dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + (id->dma_1word & 0x0007)) { + /* Force if Capable regular DMA modes */ + if (!it8172_config_chipset_for_dma(drive)) + goto no_dma_set; + } + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!it8172_config_chipset_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + it8172_tune_drive(drive, 5); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +static unsigned int __init init_chipset_it8172 (struct pci_dev *dev, const char *name) +{ + unsigned char progif; + + /* + * Place both IDE interfaces into PCI "native" mode + */ + pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); + pci_write_config_byte(dev, PCI_CLASS_PROG, progif | 0x05); + + return IT8172_IDE_IRQ; +} + + +static void __init init_hwif_it8172 (ide_hwif_t *hwif) +{ + struct pci_dev* dev = hwif->pci_dev; + unsigned long cmdBase, ctrlBase; + + hwif->autodma = 0; + hwif->tuneproc = &it8172_tune_drive; + hwif->speedproc = &it8172_tune_chipset; + hwif->ratemask = &it8172_ratemask; + hwif->ratefilter = &it8172_ratefilter; + + cmdBase = dev->resource[0].start; + ctrlBase = dev->resource[1].start; + + ide_init_hwif_ports(&hwif->hw, cmdBase, ctrlBase | 2, NULL); + memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); + hwif->noprobe = 0; + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + hwif->ide_dma_check = &it8172_config_drive_xfer_rate; + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* !CONFIG_BLK_DEV_IDEDMA */ +} + +static void __init init_dma_it8172 (ide_hwif_t *hwif, unsigned long dmabase) +{ + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_it8172 (struct pci_dev *dev, ide_pci_device_t *d) +{ + if ((!(PCI_FUNC(dev->devfn) & 1) || + (!((dev->class >> 8) == PCI_CLASS_STORAGE_IDE)))) + return; /* IT8172 is more than only a IDE controller */ + ide_setup_pci_device(dev, d); +} + +static int __init it8172_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_ITE) + return 0; + + for (d = it8172_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/it8172.h linux.20pre5-ac2/drivers/ide/pci/it8172.h --- linux.20pre5/drivers/ide/pci/it8172.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/it8172.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,45 @@ +#ifndef ITE8172G_H +#define ITE8172G_H + +#include +#include +#include + +static u8 it8172_ratemask(ide_drive_t *drive); +static u8 it8172_ratefilter(ide_drive_t *drive, u8 speed); +static void it8172_tune_drive(ide_drive_t *drive, u8 pio); +static u8 it8172_dma_2_pio(u8 xfer_rate); +static int it8172_tune_chipset(ide_drive_t *drive, u8 xferspeed); +#ifdef CONFIG_BLK_DEV_IDEDMA +static int it8172_config_chipset_for_dma(ide_drive_t *drive); +#endif + +static void init_setup_it8172(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_it8172(struct pci_dev *, const char *); +static void init_hwif_it8172(ide_hwif_t *); +static void init_dma_it8172(ide_hwif_t *, unsigned long); + +static ide_pci_device_t it8172_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_ITE, + device: PCI_DEVICE_ID_ITE_IT8172G, + name: "IT8172G", + init_setup: init_setup_it8172, + init_chipset: init_chipset_it8172, + init_iops: NULL, + init_hwif: init_hwif_it8172, + init_dma: init_dma_it8172, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x40,0x00,0x01}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* ITE8172G_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/Makefile linux.20pre5-ac2/drivers/ide/pci/Makefile --- linux.20pre5/drivers/ide/pci/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/Makefile 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,40 @@ + +O_TARGET := idedriver-pci.o + +obj-y := +obj-m := + +obj-$(CONFIG_BLK_DEV_ADMA100) += adma100.o +obj-$(CONFIG_BLK_DEV_AEC62XX) += aec62xx.o +obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o +obj-$(CONFIG_BLK_DEV_AMD74XX) += amd74xx.o +obj-$(CONFIG_BLK_DEV_CMD640) += cmd640.o +obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o +obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o +obj-$(CONFIG_BLK_DEV_CY82C693) += cy82c693.o +obj-$(CONFIG_BLK_DEV_GENERIC) += generic.o +obj-$(CONFIG_BLK_DEV_HPT34X) += hpt34x.o +obj-$(CONFIG_BLK_DEV_HPT366) += hpt366.o +#obj-$(CONFIG_BLK_DEV_HPT37X) += hpt37x.o +obj-$(CONFIG_BLK_DEV_IDE_ICSIDE) += icside.o +obj-$(CONFIG_BLK_DEV_IT8172) += it8172.o +obj-$(CONFIG_BLK_DEV_NS87415) += ns87415.o +obj-$(CONFIG_BLK_DEV_NFORCE) += nvidia.o +obj-$(CONFIG_BLK_DEV_OPTI621) += opti621.o +obj-$(CONFIG_BLK_DEV_PDC202XX) += pdc202xx.o +#obj-$(CONFIG_BLK_DEV_PDC202XX_OLD) += pdc202xx_old.o +#obj-$(CONFIG_BLK_DEV_PDC202XX_NEW) += pdc202xx_new.o +obj-$(CONFIG_BLK_DEV_PDC_ADMA) += pdcadma.o ide-adma.o +obj-$(CONFIG_BLK_DEV_PIIX) += piix.o +obj-$(CONFIG_BLK_DEV_RZ1000) += rz1000.o +obj-$(CONFIG_BLK_DEV_SVWKS) += serverworks.o +obj-$(CONFIG_BLK_DEV_SIIMAGE) += siimage.o +obj-$(CONFIG_BLK_DEV_SIS5513) += sis5513.o +obj-$(CONFIG_BLK_DEV_SL82C105) += sl82c105.o +obj-$(CONFIG_BLK_DEV_SLC90E66) += slc90e66.o +obj-$(CONFIG_BLK_DEV_TRM290) += trm290.o +obj-$(CONFIG_BLK_DEV_VIA82CXXX) += via82cxxx.o + +EXTRA_CFLAGS := -I../ + +include $(TOPDIR)/Rules.make diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/ns87415.c linux.20pre5-ac2/drivers/ide/pci/ns87415.c --- linux.20pre5/drivers/ide/pci/ns87415.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/ns87415.c 2002-09-01 18:01:39.000000000 +0100 @@ -0,0 +1,254 @@ +/* + * linux/drivers/ide/ns87415.c Version 1.01 Mar. 18, 2000 + * + * Copyright (C) 1997-1998 Mark Lord + * Copyright (C) 1998 Eddie C. Dost + * Copyright (C) 1999-2000 Andre Hedrick + * + * Inspired by an earlier effort from David S. Miller + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ns87415.h" + +static unsigned int ns87415_count = 0, ns87415_control[MAX_HWIFS] = { 0 }; + +/* + * This routine either enables/disables (according to drive->present) + * the IRQ associated with the port (HWIF(drive)), + * and selects either PIO or DMA handshaking for the next I/O operation. + */ +static void ns87415_prepare_drive (ide_drive_t *drive, unsigned int use_dma) +{ + ide_hwif_t *hwif = HWIF(drive); + unsigned int bit, other, new, *old = (unsigned int *) hwif->select_data; + struct pci_dev *dev = hwif->pci_dev; + unsigned long flags; + + local_irq_save(flags); + new = *old; + + /* Adjust IRQ enable bit */ + bit = 1 << (8 + hwif->channel); + new = drive->present ? (new & ~bit) : (new | bit); + + /* Select PIO or DMA, DMA may only be selected for one drive/channel. */ + bit = 1 << (20 + drive->select.b.unit + (hwif->channel << 1)); + other = 1 << (20 + (1 - drive->select.b.unit) + (hwif->channel << 1)); + new = use_dma ? ((new & ~other) | bit) : (new & ~bit); + + if (new != *old) { + unsigned char stat; + + /* + * Don't change DMA engine settings while Write Buffers + * are busy. + */ + (void) pci_read_config_byte(dev, 0x43, &stat); + while (stat & 0x03) { + udelay(1); + (void) pci_read_config_byte(dev, 0x43, &stat); + } + + *old = new; + (void) pci_write_config_dword(dev, 0x40, new); + + /* + * And let things settle... + */ + udelay(10); + } + + local_irq_restore(flags); +} + +static void ns87415_selectproc (ide_drive_t *drive) +{ + ns87415_prepare_drive (drive, drive->using_dma); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +static int ns87415_ide_dma_end (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 dma_stat = 0, dma_cmd = 0; + + drive->waiting_for_dma = 0; + dma_stat = hwif->INB(hwif->dma_status); + /* get dma command mode */ + dma_cmd = hwif->INB(hwif->dma_command); + /* stop DMA */ + hwif->OUTB(dma_cmd & ~1, hwif->dma_command); + /* from ERRATA: clear the INTR & ERROR bits */ + dma_cmd = hwif->INB(hwif->dma_command); + hwif->OUTB(dma_cmd|6, hwif->dma_command); + /* and free any DMA resources */ + ide_destroy_dmatable(drive); + /* verify good DMA status */ + return (dma_stat & 7) != 4; +} + +static int ns87415_ide_dma_read (ide_drive_t *drive) +{ + /* select DMA xfer */ + ns87415_prepare_drive(drive, 1); + if (!(__ide_dma_read(drive))) + return 0; + /* DMA failed: select PIO xfer */ + ns87415_prepare_drive(drive, 0); + return 1; +} + +static int ns87415_ide_dma_write (ide_drive_t *drive) +{ + /* select DMA xfer */ + ns87415_prepare_drive(drive, 1); + if (!(__ide_dma_write(drive))) + return 0; + /* DMA failed: select PIO xfer */ + ns87415_prepare_drive(drive, 0); + return 1; +} + +static int ns87415_ide_dma_check (ide_drive_t *drive) +{ + if (drive->media != ide_disk) + return HWIF(drive)->ide_dma_off_quietly(drive); + return __ide_dma_check(drive); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +static void __init init_hwif_ns87415 (ide_hwif_t *hwif) +{ + struct pci_dev *dev = hwif->pci_dev; + unsigned int ctrl, using_inta; + u8 progif; +#ifdef __sparc_v9__ + int timeout; + u8 stat; +#endif + + hwif->autodma = 0; + hwif->selectproc = &ns87415_selectproc; + + /* Set a good latency timer and cache line size value. */ + (void) pci_write_config_byte(dev, PCI_LATENCY_TIMER, 64); +#ifdef __sparc_v9__ + (void) pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, 0x10); +#endif + + /* + * We cannot probe for IRQ: both ports share common IRQ on INTA. + * Also, leave IRQ masked during drive probing, to prevent infinite + * interrupts from a potentially floating INTA.. + * + * IRQs get unmasked in selectproc when drive is first used. + */ + (void) pci_read_config_dword(dev, 0x40, &ctrl); + (void) pci_read_config_byte(dev, 0x09, &progif); + /* is irq in "native" mode? */ + using_inta = progif & (1 << (hwif->channel << 1)); + if (!using_inta) + using_inta = ctrl & (1 << (4 + hwif->channel)); + if (hwif->mate) { + hwif->select_data = hwif->mate->select_data; + } else { + hwif->select_data = (unsigned long) + &ns87415_control[ns87415_count++]; + ctrl |= (1 << 8) | (1 << 9); /* mask both IRQs */ + if (using_inta) + ctrl &= ~(1 << 6); /* unmask INTA */ + *((unsigned int *)hwif->select_data) = ctrl; + (void) pci_write_config_dword(dev, 0x40, ctrl); + + /* + * Set prefetch size to 512 bytes for both ports, + * but don't turn on/off prefetching here. + */ + pci_write_config_byte(dev, 0x55, 0xee); + +#ifdef __sparc_v9__ + /* + * XXX: Reset the device, if we don't it will not respond + * to SELECT_DRIVE() properly during first probe_hwif(). + */ + timeout = 10000; + hwif->OUTB(12, hwif->io_ports[IDE_CONTROL_OFFSET]); + udelay(10); + hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]); + do { + udelay(50); + stat = hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]); + if (stat == 0xff) + break; + } while ((stat & BUSY_STAT) && --timeout); +#endif + } + + if (!using_inta) + hwif->irq = hwif->channel ? 15 : 14; /* legacy mode */ + else if (!hwif->irq && hwif->mate && hwif->mate->irq) + hwif->irq = hwif->mate->irq; /* share IRQ with mate */ + + if (!hwif->dma_base) + return; + +#ifdef CONFIG_BLK_DEV_IDEDMA + hwif->OUTB(0x60, hwif->dma_status); + hwif->ide_dma_read = &ns87415_ide_dma_read; + hwif->ide_dma_write = &ns87415_ide_dma_write; + hwif->ide_dma_check = &ns87415_ide_dma_check; + hwif->ide_dma_end = &ns87415_ide_dma_end; + + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->autodma; + hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static void __init init_dma_ns87415 (ide_hwif_t *hwif, unsigned long dmabase) +{ + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_ns87415 (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init ns87415_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_NS) + return 0; + + for (d = ns87415_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/ns87415.h linux.20pre5-ac2/drivers/ide/pci/ns87415.h --- linux.20pre5/drivers/ide/pci/ns87415.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/ns87415.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,35 @@ +#ifndef NS87415_H +#define NS87415_H + +#include +#include +#include + +static void init_setup_ns87415(struct pci_dev *, ide_pci_device_t *); +static void init_hwif_ns87415(ide_hwif_t *); +static void init_dma_ns87415(ide_hwif_t *, unsigned long); + +static ide_pci_device_t ns87415_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_NS, + device: PCI_DEVICE_ID_NS_87415, + name: "NS87415", + init_setup: init_setup_ns87415, + init_chipset: NULL, + init_iops: NULL, + init_hwif: init_hwif_ns87415, + init_dma: init_dma_ns87415, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* NS87415_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/nvidia.c linux.20pre5-ac2/drivers/ide/pci/nvidia.c --- linux.20pre5/drivers/ide/pci/nvidia.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/nvidia.c 2002-09-01 18:02:01.000000000 +0100 @@ -0,0 +1,415 @@ +/* + * linux/drivers/ide/nvidia.c Version 0.01 + * + * Copyright (C) 2002-2002 Andre Hedrick + * May be copied or modified under the terms of the GNU General Public License + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "ide_modes.h" +#include "nvidia.h" + +#if defined(DISPLAY_NFORCE_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 nforce_proc = 0; +static struct pci_dev *bmide_dev; + +static int nforce_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + u32 bibma = pci_resource_start(bmide_dev, 4); + u8 c0 = 0, c1 = 0; + + /* + * at that point bibma+0x2 et bibma+0xa are byte registers + * to investigate: + */ + c0 = IN_BYTE((unsigned short)bibma + 0x02); + c1 = IN_BYTE((unsigned short)bibma + 0x0a); + + p += sprintf(p, "\n " + "nVidia %04X Chipset.\n", bmide_dev->device); + p += sprintf(p, "--------------- Primary Channel " + "---------------- Secondary Channel " + "-------------\n"); + p += sprintf(p, " %sabled " + " %sabled\n", + (c0&0x80) ? "dis" : " en", + (c1&0x80) ? "dis" : " en"); + p += sprintf(p, "--------------- drive0 --------- drive1 " + "-------- drive0 ---------- drive1 ------\n"); + p += sprintf(p, "DMA enabled: %s %s " + " %s %s\n", + (c0&0x20) ? "yes" : "no ", (c0&0x40) ? "yes" : "no ", + (c1&0x20) ? "yes" : "no ", (c1&0x40) ? "yes" : "no " ); + p += sprintf(p, "UDMA\n"); + p += sprintf(p, "DMA\n"); + p += sprintf(p, "PIO\n"); + + return p-buffer; /* => must be less than 4k! */ +} +#endif /* defined(DISPLAY_NFORCE_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static u8 nforce_ratemask (ide_drive_t *drive) +{ + u8 mode; + + switch(HWIF(drive)->pci_dev->device) { + case PCI_DEVICE_ID_NVIDIA_NFORCE_IDE: { mode = 3; break; } + default: + return 0; + } + if (!eighty_ninty_three(drive)) + mode = min(mode, (u8)1); + return mode; +} + +static u8 nforce_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + /* nVidia's ratemask is between 0-3 and capped at UDMA100 */ + return min(speed, speed_max[nforce_ratemask(drive)]); +#else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +/* + * Here is where all the hard work goes to program the chipset. + */ +static int nforce_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 speed = nforce_ratefilter(drive, xferspeed); + u8 drive_pci = 0x00; + u8 drive_pci2 = 0x00; + u8 ultra_timing = 0, dma_pio_timing = 0, pio_timing = 0; + + switch (drive->dn) { + case 0: drive_pci = 0x63; drive_pci2 = 0x5b; break; + case 1: drive_pci = 0x62; drive_pci2 = 0x5a; break; + case 2: drive_pci = 0x61; drive_pci2 = 0x59; break; + case 3: drive_pci = 0x60; drive_pci2 = 0x58; break; + default: + return -1; + } + + pci_read_config_byte(dev, drive_pci, &ultra_timing); + pci_read_config_byte(dev, drive_pci2, &dma_pio_timing); + pci_read_config_byte(dev, 0x5c, &pio_timing); + + ultra_timing &= ~0xC7; + dma_pio_timing &= ~0xFF; + pio_timing &= ~(0x03 << drive->dn); + + switch(speed) { +#ifdef CONFIG_BLK_DEV_IDEDMA + case XFER_UDMA_7: + case XFER_UDMA_6: + speed = XFER_UDMA_5; + case XFER_UDMA_5: + ultra_timing |= 0x46; + dma_pio_timing |= 0x20; + break; + case XFER_UDMA_4: + ultra_timing |= 0x45; + dma_pio_timing |= 0x20; + break; + case XFER_UDMA_3: + ultra_timing |= 0x44; + dma_pio_timing |= 0x20; + break; + case XFER_UDMA_2: + ultra_timing |= 0x40; + dma_pio_timing |= 0x20; + break; + case XFER_UDMA_1: + ultra_timing |= 0x41; + dma_pio_timing |= 0x20; + break; + case XFER_UDMA_0: + ultra_timing |= 0x42; + dma_pio_timing |= 0x20; + break; + case XFER_MW_DMA_2: + dma_pio_timing |= 0x20; + break; + case XFER_MW_DMA_1: + dma_pio_timing |= 0x21; + break; + case XFER_MW_DMA_0: + dma_pio_timing |= 0x77; + break; + case XFER_SW_DMA_2: + dma_pio_timing |= 0x42; + break; + case XFER_SW_DMA_1: + dma_pio_timing |= 0x65; + break; + case XFER_SW_DMA_0: + dma_pio_timing |= 0xA8; + break; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + case XFER_PIO_4: + dma_pio_timing |= 0x20; + break; + case XFER_PIO_3: + dma_pio_timing |= 0x22; + break; + case XFER_PIO_2: + dma_pio_timing |= 0x42; + break; + case XFER_PIO_1: + dma_pio_timing |= 0x65; + break; + case XFER_PIO_0: + default: + dma_pio_timing |= 0xA8; + break; + } + + pio_timing |= (0x03 << drive->dn); + +#ifdef CONFIG_BLK_DEV_IDEDMA + pci_write_config_byte(dev, drive_pci, ultra_timing); +#endif /* CONFIG_BLK_DEV_IDEDMA */ + pci_write_config_byte(dev, drive_pci2, dma_pio_timing); + pci_write_config_byte(dev, 0x5c, pio_timing); + + return (ide_config_drive_speed(drive, speed)); +} + +static void nforce_tune_drive (ide_drive_t *drive, u8 pio) +{ + pio = ide_get_best_pio_mode(drive, pio, 5, NULL); + (void) nforce_tune_chipset(drive, (XFER_PIO_0 + pio)); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +/* + * This allows the configuration of ide_pci chipset registers + * for cards that learn about the drive's UDMA, DMA, PIO capabilities + * after the drive is reported by the OS. + */ +static int config_chipset_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + u8 speed = 0, mode = nforce_ratemask(drive); + + nforce_tune_drive(drive, 5); + + switch(mode) { + case 0x04: + if (id->dma_ultra & 0x0040) + { speed = XFER_UDMA_6; break; } + case 0x03: + if (id->dma_ultra & 0x0020) + { speed = XFER_UDMA_5; break; } + case 0x02: + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_4; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_3; break; } + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_mword & 0x0001) + { speed = XFER_MW_DMA_0; break; } + if (id->dma_1word & 0x0004) + { speed = XFER_SW_DMA_2; break; } + if (id->dma_1word & 0x0002) + { speed = XFER_SW_DMA_1; break; } + if (id->dma_1word & 0x0001) + { speed = XFER_SW_DMA_0; break; } + default: + return 0; + } + + (void) nforce_tune_chipset(drive, speed); + + return ((int) ((((id->dma_ultra >> 8) & 0x3F) || + ((id->dma_mword >> 8) & 0x07) || + ((id->dma_1word >> 8) & 0x07)) ? 1 : 0)); +} + +static int nforce_config_drive_xfer_rate (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + drive->init_speed = 0; + + if (id && (id->capability & 1) && drive->autodma) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + if (id->field_valid & 4) { + if (id->dma_ultra & 0x003F) { + /* Force if Capable UltraDMA */ + int dma = config_chipset_for_dma(drive); + if ((id->field_valid & 2) && !dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + (id->dma_1word & 0x007)) { + /* Force if Capable regular DMA modes */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } + + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + nforce_tune_drive(drive, 5); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +unsigned int __init init_chipset_nforce (struct pci_dev *dev, const char *name) +{ +#if defined(DISPLAY_NFORCE_TIMINGS) && defined(CONFIG_PROC_FS) + if (!nforce_proc) { + nforce_proc = 1; + bmide_dev = dev; + ide_pci_register_host_proc(&nforce_procs[0]); + } +#endif /* DISPLAY_NFORCE_TIMINGS && CONFIG_PROC_FS */ + return 0; +} + +static unsigned int __init ata66_nforce (ide_hwif_t *hwif) +{ + struct pci_dev *dev = hwif->pci_dev; + u8 cable_80_pin[2] = { 0, 0 }; + u8 ata66 = 0; + u8 tmpbyte; + + /* + * Ultra66 cable detection (from Host View) + * 7411, 7441, 0x52, bit0: primary, bit2: secondary 80 pin + */ + pci_read_config_byte(dev, 0x52, &tmpbyte); + + /* + * 0x52, bit0 is 1 => primary channel + * has 80-pin (from host view) + */ + if (tmpbyte & 0x01) cable_80_pin[0] = 1; + + /* + * 0x52, bit2 is 1 => secondary channel + * has 80-pin (from host view) + */ + if (tmpbyte & 0x04) cable_80_pin[1] = 1; + + switch(dev->device) { + case PCI_DEVICE_ID_NVIDIA_NFORCE_IDE: + ata66 = (hwif->channel) ? + cable_80_pin[1] : + cable_80_pin[0]; + default: + break; + } + return (unsigned int) ata66; +} + +static void __init init_hwif_nforce (ide_hwif_t *hwif) +{ + hwif->tuneproc = &nforce_tune_drive; + hwif->speedproc = &nforce_tune_chipset; + hwif->ratemask = &nforce_ratemask; + hwif->ratefilter = &nforce_ratefilter; + hwif->autodma = 0; + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + if (!(hwif->udma_four)) + hwif->udma_four = ata66_nforce(hwif); + hwif->ide_dma_check = &nforce_config_drive_xfer_rate; + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +/* FIXME - not needed */ +static void __init init_dma_nforce (ide_hwif_t *hwif, unsigned long dmabase) +{ + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +/* FIXME - not needed */ +static void __init init_setup_nforce (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init nforce_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_NVIDIA) + return 0; + + for (d = nvidia_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/nvidia.h linux.20pre5-ac2/drivers/ide/pci/nvidia.h --- linux.20pre5/drivers/ide/pci/nvidia.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/nvidia.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,56 @@ +#ifndef NFORCE_H +#define NFORCE_H + +#include +#include +#include + +#define DISPLAY_NFORCE_TIMINGS + +#if defined(DISPLAY_NFORCE_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 nforce_proc; + +static int nforce_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t nforce_procs[] __initdata = { + { + name: "nforce", + set: 1, + get_info: nforce_get_info, + parent: NULL, + }, +}; +#endif /* defined(DISPLAY_NFORCE_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static void init_setup_nforce(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_nforce(struct pci_dev *, const char *); +static void init_hwif_nforce(ide_hwif_t *); +static void init_dma_nforce(ide_hwif_t *, unsigned long); + +static ide_pci_device_t nvidia_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_NVIDIA, + device: PCI_DEVICE_ID_NVIDIA_NFORCE_IDE, + name: "NFORCE", + init_setup: init_setup_nforce, + init_chipset: init_chipset_nforce, + init_iops: NULL, + init_hwif: init_hwif_nforce, + init_dma: init_dma_nforce, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x50,0x01,0x01}, {0x50,0x02,0x02}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* NFORCE_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/opti621.c linux.20pre5-ac2/drivers/ide/pci/opti621.c --- linux.20pre5/drivers/ide/pci/opti621.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/opti621.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,375 @@ +/* + * linux/drivers/ide/opti621.c Version 0.6 Jan 02, 1999 + * + * Copyright (C) 1996-1998 Linus Torvalds & authors (see below) + */ + +/* + * Authors: + * Jaromir Koutek , + * Jan Harkes , + * Mark Lord + * Some parts of code are from ali14xx.c and from rz1000.c. + * + * OPTi is trademark of OPTi, Octek is trademark of Octek. + * + * I used docs from OPTi databook, from ftp.opti.com, file 9123-0002.ps + * and disassembled/traced setupvic.exe (DOS program). + * It increases kernel code about 2 kB. + * I don't have this card no more, but I hope I can get some in case + * of needed development. + * My card is Octek PIDE 1.01 (on card) or OPTiViC (program). + * It has a place for a secondary connector in circuit, but nothing + * is there. Also BIOS says no address for + * secondary controller (see bellow in ide_init_opti621). + * I've only tested this on my system, which only has one disk. + * It's Western Digital WDAC2850, with PIO mode 3. The PCI bus + * is at 20 MHz (I have DX2/80, I tried PCI at 40, but I got random + * lockups). I tried the OCTEK double speed CD-ROM and + * it does not work! But I can't boot DOS also, so it's probably + * hardware fault. I have connected Conner 80MB, the Seagate 850MB (no + * problems) and Seagate 1GB (as slave, WD as master). My experiences + * with the third, 1GB drive: I got 3MB/s (hdparm), but sometimes + * it slows to about 100kB/s! I don't know why and I have + * not this drive now, so I can't try it again. + * I write this driver because I lost the paper ("manual") with + * settings of jumpers on the card and I have to boot Linux with + * Loadlin except LILO, cause I have to run the setupvic.exe program + * already or I get disk errors (my test: rpm -Vf + * /usr/X11R6/bin/XF86_SVGA - or any big file). + * Some numbers from hdparm -t /dev/hda: + * Timing buffer-cache reads: 32 MB in 3.02 seconds =10.60 MB/sec + * Timing buffered disk reads: 16 MB in 5.52 seconds = 2.90 MB/sec + * I have 4 Megs/s before, but I don't know why (maybe changes + * in hdparm test). + * After release of 0.1, I got some successful reports, so it might work. + * + * The main problem with OPTi is that some timings for master + * and slave must be the same. For example, if you have master + * PIO 3 and slave PIO 0, driver have to set some timings of + * master for PIO 0. Second problem is that opti621_tune_drive + * got only one drive to set, but have to set both drives. + * This is solved in compute_pios. If you don't set + * the second drive, compute_pios use ide_get_best_pio_mode + * for autoselect mode (you can change it to PIO 0, if you want). + * If you then set the second drive to another PIO, the old value + * (automatically selected) will be overrided by yours. + * There is a 25/33MHz switch in configuration + * register, but driver is written for use at any frequency which get + * (use idebus=xx to select PCI bus speed). + * Use ide0=autotune for automatical tune of the PIO modes. + * If you get strange results, do not use this and set PIO manually + * by hdparm. + * + * Version 0.1, Nov 8, 1996 + * by Jaromir Koutek, for 2.1.8. + * Initial version of driver. + * + * Version 0.2 + * Number 0.2 skipped. + * + * Version 0.3, Nov 29, 1997 + * by Mark Lord (probably), for 2.1.68 + * Updates for use with new IDE block driver. + * + * Version 0.4, Dec 14, 1997 + * by Jan Harkes + * Fixed some errors and cleaned the code. + * + * Version 0.5, Jan 2, 1998 + * by Jaromir Koutek + * Updates for use with (again) new IDE block driver. + * Update of documentation. + * + * Version 0.6, Jan 2, 1999 + * by Jaromir Koutek + * Reversed to version 0.3 of the driver, because + * 0.5 doesn't work. + */ + +#undef REALLY_SLOW_IO /* most systems can safely undef this */ +#define OPTI621_DEBUG /* define for debug messages */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ide_modes.h" +#include "opti621.h" + +#define OPTI621_MAX_PIO 3 +/* In fact, I do not have any PIO 4 drive + * (address: 25 ns, data: 70 ns, recovery: 35 ns), + * but OPTi 82C621 is programmable and it can do (minimal values): + * on 40MHz PCI bus (pulse 25 ns): + * address: 25 ns, data: 25 ns, recovery: 50 ns; + * on 20MHz PCI bus (pulse 50 ns): + * address: 50 ns, data: 50 ns, recovery: 100 ns. + */ + +/* #define READ_PREFETCH 0 */ +/* Uncommnent for disable read prefetch. + * There is some readprefetch capatibility in hdparm, + * but when I type hdparm -P 1 /dev/hda, I got errors + * and till reset drive is inaccessible. + * This (hw) read prefetch is safe on my drive. + */ + +#ifndef READ_PREFETCH +#define READ_PREFETCH 0x40 /* read prefetch is enabled */ +#endif /* else read prefetch is disabled */ + +#define READ_REG 0 /* index of Read cycle timing register */ +#define WRITE_REG 1 /* index of Write cycle timing register */ +#define CNTRL_REG 3 /* index of Control register */ +#define STRAP_REG 5 /* index of Strap register */ +#define MISC_REG 6 /* index of Miscellaneous register */ + +static int reg_base; + +#define PIO_NOT_EXIST 254 +#define PIO_DONT_KNOW 255 + +/* there are stored pio numbers from other calls of opti621_tune_drive */ +static void compute_pios(ide_drive_t *drive, u8 pio) +/* Store values into drive->drive_data + * second_contr - 0 for primary controller, 1 for secondary + * slave_drive - 0 -> pio is for master, 1 -> pio is for slave + * pio - PIO mode for selected drive (for other we don't know) + */ +{ + int d; + ide_hwif_t *hwif = HWIF(drive); + + drive->drive_data = ide_get_best_pio_mode(drive, pio, OPTI621_MAX_PIO, NULL); + for (d = 0; d < 2; ++d) { + drive = &hwif->drives[d]; + if (drive->present) { + if (drive->drive_data == PIO_DONT_KNOW) + drive->drive_data = ide_get_best_pio_mode(drive, 255, OPTI621_MAX_PIO, NULL); +#ifdef OPTI621_DEBUG + printk("%s: Selected PIO mode %d\n", + drive->name, drive->drive_data); +#endif + } else { + drive->drive_data = PIO_NOT_EXIST; + } + } +} + +static int cmpt_clk(int time, int bus_speed) +/* Returns (rounded up) time in clocks for time in ns, + * with bus_speed in MHz. + * Example: bus_speed = 40 MHz, time = 80 ns + * 1000/40 = 25 ns (clk value), + * 80/25 = 3.2, rounded up to 4 (I hope ;-)). + * Use idebus=xx to select right frequency. + */ +{ + return ((time*bus_speed+999)/1000); +} + +static void write_reg(ide_hwif_t *hwif, u8 value, int reg) +/* Write value to register reg, base of register + * is at reg_base (0x1f0 primary, 0x170 secondary, + * if not changed by PCI configuration). + * This is from setupvic.exe program. + */ +{ + hwif->INW(reg_base+1); + hwif->INW(reg_base+1); + hwif->OUTB(3, reg_base+2); + hwif->OUTB(value, reg_base+reg); + hwif->OUTB(0x83, reg_base+2); +} + +static u8 read_reg(ide_hwif_t *hwif, int reg) +/* Read value from register reg, base of register + * is at reg_base (0x1f0 primary, 0x170 secondary, + * if not changed by PCI configuration). + * This is from setupvic.exe program. + */ +{ + u8 ret = 0; + + hwif->INW(reg_base+1); + hwif->INW(reg_base+1); + hwif->OUTB(3, reg_base+2); + ret = hwif->INB(reg_base+reg); + hwif->OUTB(0x83, reg_base+2); + return ret; +} + +typedef struct pio_clocks_s { + int address_time; /* Address setup (clocks) */ + int data_time; /* Active/data pulse (clocks) */ + int recovery_time; /* Recovery time (clocks) */ +} pio_clocks_t; + +static void compute_clocks(int pio, pio_clocks_t *clks) +{ + if (pio != PIO_NOT_EXIST) { + int adr_setup, data_pls; + int bus_speed = system_bus_clock(); + + adr_setup = ide_pio_timings[pio].setup_time; + data_pls = ide_pio_timings[pio].active_time; + clks->address_time = cmpt_clk(adr_setup, bus_speed); + clks->data_time = cmpt_clk(data_pls, bus_speed); + clks->recovery_time = cmpt_clk(ide_pio_timings[pio].cycle_time + - adr_setup-data_pls, bus_speed); + if (clks->address_time<1) clks->address_time = 1; + if (clks->address_time>4) clks->address_time = 4; + if (clks->data_time<1) clks->data_time = 1; + if (clks->data_time>16) clks->data_time = 16; + if (clks->recovery_time<2) clks->recovery_time = 2; + if (clks->recovery_time>17) clks->recovery_time = 17; + } else { + clks->address_time = 1; + clks->data_time = 1; + clks->recovery_time = 2; + /* minimal values */ + } + +} + +/* Main tune procedure, called from tuneproc. */ +static void opti621_tune_drive (ide_drive_t *drive, u8 pio) +{ + /* primary and secondary drives share some registers, + * so we have to program both drives + */ + unsigned long flags; + u8 pio1 = 0, pio2 = 0; + pio_clocks_t first, second; + int ax, drdy; + u8 cycle1, cycle2, misc; + ide_hwif_t *hwif = HWIF(drive); + + /* sets drive->drive_data for both drives */ + compute_pios(drive, pio); + pio1 = hwif->drives[0].drive_data; + pio2 = hwif->drives[1].drive_data; + + compute_clocks(pio1, &first); + compute_clocks(pio2, &second); + + /* ax = max(a1,a2) */ + ax = (first.address_time < second.address_time) ? second.address_time : first.address_time; + + drdy = 2; /* DRDY is default 2 (by OPTi Databook) */ + + cycle1 = ((first.data_time-1)<<4) | (first.recovery_time-2); + cycle2 = ((second.data_time-1)<<4) | (second.recovery_time-2); + misc = READ_PREFETCH | ((ax-1)<<4) | ((drdy-2)<<1); + +#ifdef OPTI621_DEBUG + printk("%s: master: address: %d, data: %d, " + "recovery: %d, drdy: %d [clk]\n", + hwif->name, ax, first.data_time, + first.recovery_time, drdy); + printk("%s: slave: address: %d, data: %d, " + "recovery: %d, drdy: %d [clk]\n", + hwif->name, ax, second.data_time, + second.recovery_time, drdy); +#endif + + spin_lock_irqsave(&io_request_lock, flags); + + reg_base = hwif->io_ports[IDE_DATA_OFFSET]; + + /* allow Register-B */ + hwif->OUTB(0xc0, reg_base+CNTRL_REG); + /* hmm, setupvic.exe does this ;-) */ + hwif->OUTB(0xff, reg_base+5); + /* if reads 0xff, adapter not exist? */ + (void) hwif->INB(reg_base+CNTRL_REG); + /* if reads 0xc0, no interface exist? */ + read_reg(hwif, CNTRL_REG); + /* read version, probably 0 */ + read_reg(hwif, STRAP_REG); + + /* program primary drive */ + /* select Index-0 for Register-A */ + write_reg(hwif, 0, MISC_REG); + /* set read cycle timings */ + write_reg(hwif, cycle1, READ_REG); + /* set write cycle timings */ + write_reg(hwif, cycle1, WRITE_REG); + + /* program secondary drive */ + /* select Index-1 for Register-B */ + write_reg(hwif, 1, MISC_REG); + /* set read cycle timings */ + write_reg(hwif, cycle2, READ_REG); + /* set write cycle timings */ + write_reg(hwif, cycle2, WRITE_REG); + + /* use Register-A for drive 0 */ + /* use Register-B for drive 1 */ + write_reg(hwif, 0x85, CNTRL_REG); + + /* set address setup, DRDY timings, */ + /* and read prefetch for both drives */ + write_reg(hwif, misc, MISC_REG); + + spin_unlock_irqrestore(&io_request_lock, flags); +} + +/* + * init_hwif_opti621() is called once for each hwif found at boot. + */ +static void __init init_hwif_opti621 (ide_hwif_t *hwif) +{ + hwif->autodma = 0; + hwif->drives[0].drive_data = PIO_DONT_KNOW; + hwif->drives[1].drive_data = PIO_DONT_KNOW; + hwif->tuneproc = &opti621_tune_drive; + +#ifdef CONFIG_BLK_DEV_IDEDMA + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +} + +static void __init init_dma_opti621 (ide_hwif_t *hwif, unsigned long dmabase) +{ + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_opti621 (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init opti621_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_OPTI) + return 0; + + for (d = opti621_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/opti621.h linux.20pre5-ac2/drivers/ide/pci/opti621.h --- linux.20pre5/drivers/ide/pci/opti621.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/opti621.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,49 @@ +#ifndef OPTI621_H +#define OPTI621_H + +#include +#include +#include + +static void init_setup_opti621(struct pci_dev *, ide_pci_device_t *); +static void init_hwif_opti621(ide_hwif_t *); +static void init_dma_opti621(ide_hwif_t *, unsigned long); + +static ide_pci_device_t opti621_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_OPTI, + device: PCI_DEVICE_ID_OPTI_82C621, + name: "OPTI621", + init_setup: init_setup_opti621, + init_chipset: NULL, + init_iops: NULL, + init_hwif: init_hwif_opti621, + init_dma: init_dma_opti621, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_OPTI, + device: PCI_DEVICE_ID_OPTI_82C825, + name: "OPTI621X", + init_setup: init_setup_opti621, + init_chipset: NULL, + init_iops: NULL, + init_hwif: init_hwif_opti621, + init_dma: init_dma_opti621, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x45,0x80,0x00}, {0x40,0x08,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* OPTI621_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/pdc202xx.c linux.20pre5-ac2/drivers/ide/pci/pdc202xx.c --- linux.20pre5/drivers/ide/pci/pdc202xx.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/pdc202xx.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,1192 @@ +/* + * linux/drivers/ide/pdc202xx.c Version 0.35 Mar. 30, 2002 + * + * Copyright (C) 1998-2002 Andre Hedrick + * + * Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this + * compiled into the kernel if you have more than one card installed. + * Note that BIOS v1.29 is reported to fix the problem. Since this is + * safe chipset tuning, including this support is harmless + * + * Promise Ultra66 cards with BIOS v1.11 this + * compiled into the kernel if you have more than one card installed. + * + * Promise Ultra100 cards. + * + * The latest chipset code will support the following :: + * Three Ultra33 controllers and 12 drives. + * 8 are UDMA supported and 4 are limited to DMA mode 2 multi-word. + * The 8/4 ratio is a BIOS code limit by promise. + * + * UNLESS you enable "CONFIG_PDC202XX_BURST" + * + */ + +/* + * Portions Copyright (C) 1999 Promise Technology, Inc. + * Author: Frank Tiernan (frankt@promise.com) + * Released under terms of General Public License + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "ide_modes.h" + +#include "pdc202xx.h" +#include "ide-noise.h" + +static u8 pdc202xx_proc = 0; + +#if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +#define PDC202_MAX_DEVS 5 + +static struct pci_dev *pdc202_devs[PDC202_MAX_DEVS]; +static int n_pdc202_devs; + +static char * pdc202xx_info (char *buf, struct pci_dev *dev) +{ + char *p = buf; + + u32 bibma = pci_resource_start(dev, 4); + u32 reg60h = 0, reg64h = 0, reg68h = 0, reg6ch = 0; + u16 reg50h = 0, pmask = (1<<10), smask = (1<<11); + u8 hi = 0, lo = 0; + + /* + * at that point bibma+0x2 et bibma+0xa are byte registers + * to investigate: + */ + u8 c0 = inb_p((u16)bibma + 0x02); + u8 c1 = inb_p((u16)bibma + 0x0a); + + u8 sc11 = inb_p((u16)bibma + 0x11); + u8 sc1a = inb_p((u16)bibma + 0x1a); + u8 sc1b = inb_p((u16)bibma + 0x1b); + u8 sc1c = inb_p((u16)bibma + 0x1c); + u8 sc1d = inb_p((u16)bibma + 0x1d); + u8 sc1e = inb_p((u16)bibma + 0x1e); + u8 sc1f = inb_p((u16)bibma + 0x1f); + + pci_read_config_word(dev, 0x50, ®50h); + pci_read_config_dword(dev, 0x60, ®60h); + pci_read_config_dword(dev, 0x64, ®64h); + pci_read_config_dword(dev, 0x68, ®68h); + pci_read_config_dword(dev, 0x6c, ®6ch); + + p += sprintf(p, "\n "); + switch(dev->device) { + case PCI_DEVICE_ID_PROMISE_20267: + p += sprintf(p, "Ultra100"); break; + case PCI_DEVICE_ID_PROMISE_20265: + p += sprintf(p, "Ultra100 on M/B"); break; + case PCI_DEVICE_ID_PROMISE_20263: + p += sprintf(p, "FastTrak 66"); break; + case PCI_DEVICE_ID_PROMISE_20262: + p += sprintf(p, "Ultra66"); break; + case PCI_DEVICE_ID_PROMISE_20246: + p += sprintf(p, "Ultra33"); + reg50h |= 0x0c00; + break; + default: + p += sprintf(p, "Ultra Series"); break; + } + p += sprintf(p, " Chipset.\n"); + + p += sprintf(p, "------------------------------- General Status " + "---------------------------------\n"); + p += sprintf(p, "Burst Mode : %sabled\n", + (sc1f & 0x01) ? "en" : "dis"); + p += sprintf(p, "Host Mode : %s\n", + (sc1f & 0x08) ? "Tri-Stated" : "Normal"); + p += sprintf(p, "Bus Clocking : %s\n", + ((sc1f & 0xC0) == 0xC0) ? "100 External" : + ((sc1f & 0x80) == 0x80) ? "66 External" : + ((sc1f & 0x40) == 0x40) ? "33 External" : "33 PCI Internal"); + p += sprintf(p, "IO pad select : %s mA\n", + ((sc1c & 0x03) == 0x03) ? "10" : + ((sc1c & 0x02) == 0x02) ? "8" : + ((sc1c & 0x01) == 0x01) ? "6" : + ((sc1c & 0x00) == 0x00) ? "4" : "??"); + SPLIT_BYTE(sc1e, hi, lo); + p += sprintf(p, "Status Polling Period : %d\n", hi); + p += sprintf(p, "Interrupt Check Status Polling Delay : %d\n", lo); + p += sprintf(p, "--------------- Primary Channel " + "---------------- Secondary Channel " + "-------------\n"); + p += sprintf(p, " %s %s\n", + (c0&0x80)?"disabled":"enabled ", + (c1&0x80)?"disabled":"enabled "); + p += sprintf(p, "66 Clocking %s %s\n", + (sc11&0x02)?"enabled ":"disabled", + (sc11&0x08)?"enabled ":"disabled"); + p += sprintf(p, " Mode %s Mode %s\n", + (sc1a & 0x01) ? "MASTER" : "PCI ", + (sc1b & 0x01) ? "MASTER" : "PCI "); + p += sprintf(p, " %s %s\n", + (sc1d & 0x08) ? "Error " : + ((sc1d & 0x05) == 0x05) ? "Not My INTR " : + (sc1d & 0x04) ? "Interrupting" : + (sc1d & 0x02) ? "FIFO Full " : + (sc1d & 0x01) ? "FIFO Empty " : "????????????", + (sc1d & 0x80) ? "Error " : + ((sc1d & 0x50) == 0x50) ? "Not My INTR " : + (sc1d & 0x40) ? "Interrupting" : + (sc1d & 0x20) ? "FIFO Full " : + (sc1d & 0x10) ? "FIFO Empty " : "????????????"); + p += sprintf(p, "--------------- drive0 --------- drive1 " + "-------- drive0 ---------- drive1 ------\n"); + p += sprintf(p, "DMA enabled: %s %s " + " %s %s\n", + (c0&0x20)?"yes":"no ", (c0&0x40)?"yes":"no ", + (c1&0x20)?"yes":"no ", (c1&0x40)?"yes":"no "); + p += sprintf(p, "DMA Mode: %s %s " + " %s %s\n", + pdc202xx_ultra_verbose(reg60h, (reg50h & pmask)), + pdc202xx_ultra_verbose(reg64h, (reg50h & pmask)), + pdc202xx_ultra_verbose(reg68h, (reg50h & smask)), + pdc202xx_ultra_verbose(reg6ch, (reg50h & smask))); + p += sprintf(p, "PIO Mode: %s %s " + " %s %s\n", + pdc202xx_pio_verbose(reg60h), + pdc202xx_pio_verbose(reg64h), + pdc202xx_pio_verbose(reg68h), + pdc202xx_pio_verbose(reg6ch)); +#if 0 + p += sprintf(p, "--------------- Can ATAPI DMA ---------------\n"); +#endif + return (char *)p; +} + +static char * pdc202xx_info_new (char *buf, struct pci_dev *dev) +{ + char *p = buf; +// u32 bibma = pci_resource_start(dev, 4); + +// u32 reg60h = 0, reg64h = 0, reg68h = 0, reg6ch = 0; +// u16 reg50h = 0, word88 = 0; +// int udmasel[4]={0,0,0,0}, piosel[4]={0,0,0,0}, i=0, hd=0; + + p += sprintf(p, "\n "); + switch(dev->device) { + case PCI_DEVICE_ID_PROMISE_20277: + p += sprintf(p, "SBFastTrak 133 Lite"); break; + case PCI_DEVICE_ID_PROMISE_20276: + p += sprintf(p, "MBFastTrak 133 Lite"); break; + case PCI_DEVICE_ID_PROMISE_20275: + p += sprintf(p, "MBUltra133"); break; + case PCI_DEVICE_ID_PROMISE_20271: + p += sprintf(p, "FastTrak TX2000"); break; + case PCI_DEVICE_ID_PROMISE_20270: + p += sprintf(p, "FastTrak LP/TX2/TX4"); break; + case PCI_DEVICE_ID_PROMISE_20269: + p += sprintf(p, "Ultra133 TX2"); break; + case PCI_DEVICE_ID_PROMISE_20268: + p += sprintf(p, "Ultra100 TX2"); break; + default: + p += sprintf(p, "Ultra series"); break; + break; + } + p += sprintf(p, " Chipset.\n"); + return (char *)p; +} + +static int pdc202xx_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + int i; + + for (i = 0; i < n_pdc202_devs; i++) { + struct pci_dev *dev = pdc202_devs[i]; + + switch(dev->device) { + case PCI_DEVICE_ID_PROMISE_20277: + case PCI_DEVICE_ID_PROMISE_20276: + case PCI_DEVICE_ID_PROMISE_20275: + case PCI_DEVICE_ID_PROMISE_20271: + case PCI_DEVICE_ID_PROMISE_20269: + case PCI_DEVICE_ID_PROMISE_20268: + case PCI_DEVICE_ID_PROMISE_20270: + p = pdc202xx_info_new(buffer, dev); + break; + default: + p = pdc202xx_info(buffer, dev); + break; + } + } + return p-buffer; /* => must be less than 4k! */ +} +#endif /* defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS) */ + + +static u8 pdc202xx_ratemask (ide_drive_t *drive) +{ + u8 mode; + + switch(HWIF(drive)->pci_dev->device) { + case PCI_DEVICE_ID_PROMISE_20277: + case PCI_DEVICE_ID_PROMISE_20276: + case PCI_DEVICE_ID_PROMISE_20275: + case PCI_DEVICE_ID_PROMISE_20271: + case PCI_DEVICE_ID_PROMISE_20269: + mode = 4; + break; + case PCI_DEVICE_ID_PROMISE_20270: + case PCI_DEVICE_ID_PROMISE_20268: + mode = 3; + break; + case PCI_DEVICE_ID_PROMISE_20267: + case PCI_DEVICE_ID_PROMISE_20265: + mode = 3; + break; + case PCI_DEVICE_ID_PROMISE_20263: + case PCI_DEVICE_ID_PROMISE_20262: + mode = 2; + break; + case PCI_DEVICE_ID_PROMISE_20246: + return 1; + default: + return 0; + } + if (!eighty_ninty_three(drive)) + mode = min(mode, (u8)1); + return mode; +} + +static u8 pdc202xx_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + /* Promise's ratemask is between 0-4 and capped at UDMA133 */ + return min(speed, speed_max[pdc202xx_ratemask(drive)]); +#else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static int check_in_drive_lists (ide_drive_t *drive, const char **list) +{ + struct hd_driveid *id = drive->id; + + if (pdc_quirk_drives == list) { + while (*list) { + if (strstr(id->model, *list++)) { + return 2; + } + } + } else { + while (*list) { + if (!strcmp(*list++,id->model)) { + return 1; + } + } + } + return 0; +} + +static int pdc202xx_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 drive_pci = 0x60 + (drive->dn << 2); + u8 speed = pdc202xx_ratefilter(drive, xferspeed); + + u32 drive_conf; + u8 AP, BP, CP, DP; + u8 TA = 0, TB = 0, TC = 0; + + if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0)) + return -1; + + pci_read_config_dword(dev, drive_pci, &drive_conf); + pci_read_config_byte(dev, (drive_pci), &AP); + pci_read_config_byte(dev, (drive_pci)|0x01, &BP); + pci_read_config_byte(dev, (drive_pci)|0x02, &CP); + pci_read_config_byte(dev, (drive_pci)|0x03, &DP); + + if (speed < XFER_SW_DMA_0) { + if ((AP & 0x0F) || (BP & 0x07)) { + /* clear PIO modes of lower 8421 bits of A Register */ + pci_write_config_byte(dev, (drive_pci), AP &~0x0F); + pci_read_config_byte(dev, (drive_pci), &AP); + + /* clear PIO modes of lower 421 bits of B Register */ + pci_write_config_byte(dev, (drive_pci)|0x01, BP &~0x07); + pci_read_config_byte(dev, (drive_pci)|0x01, &BP); + + pci_read_config_byte(dev, (drive_pci), &AP); + pci_read_config_byte(dev, (drive_pci)|0x01, &BP); + } +#ifdef CONFIG_BLK_DEV_IDEDMA + } else { + if ((BP & 0xF0) && (CP & 0x0F)) { + /* clear DMA modes of upper 842 bits of B Register */ + /* clear PIO forced mode upper 1 bit of B Register */ + pci_write_config_byte(dev, (drive_pci)|0x01, BP &~0xF0); + pci_read_config_byte(dev, (drive_pci)|0x01, &BP); + + /* clear DMA modes of lower 8421 bits of C Register */ + pci_write_config_byte(dev, (drive_pci)|0x02, CP &~0x0F); + pci_read_config_byte(dev, (drive_pci)|0x02, &CP); + } +#endif /* CONFIG_BLK_DEV_IDEDMA */ + } + + pci_read_config_byte(dev, (drive_pci), &AP); + pci_read_config_byte(dev, (drive_pci)|0x01, &BP); + pci_read_config_byte(dev, (drive_pci)|0x02, &CP); + + switch(speed) { +#ifdef CONFIG_BLK_DEV_IDEDMA + case XFER_UDMA_6: speed = XFER_UDMA_5; + case XFER_UDMA_5: + case XFER_UDMA_4: TB = 0x20; TC = 0x01; break; + case XFER_UDMA_2: TB = 0x20; TC = 0x01; break; + case XFER_UDMA_3: + case XFER_UDMA_1: TB = 0x40; TC = 0x02; break; + case XFER_UDMA_0: + case XFER_MW_DMA_2: TB = 0x60; TC = 0x03; break; + case XFER_MW_DMA_1: TB = 0x60; TC = 0x04; break; + case XFER_MW_DMA_0: + case XFER_SW_DMA_2: TB = 0x60; TC = 0x05; break; + case XFER_SW_DMA_1: TB = 0x80; TC = 0x06; break; + case XFER_SW_DMA_0: TB = 0xC0; TC = 0x0B; break; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + case XFER_PIO_4: TA = 0x01; TB = 0x04; break; + case XFER_PIO_3: TA = 0x02; TB = 0x06; break; + case XFER_PIO_2: TA = 0x03; TB = 0x08; break; + case XFER_PIO_1: TA = 0x05; TB = 0x0C; break; + case XFER_PIO_0: + default: TA = 0x09; TB = 0x13; break; + } + + if (speed < XFER_SW_DMA_0) { + pci_write_config_byte(dev, (drive_pci), AP|TA); + pci_write_config_byte(dev, (drive_pci)|0x01, BP|TB); +#ifdef CONFIG_BLK_DEV_IDEDMA + } else { + pci_write_config_byte(dev, (drive_pci)|0x01, BP|TB); + pci_write_config_byte(dev, (drive_pci)|0x02, CP|TC); +#endif /* CONFIG_BLK_DEV_IDEDMA */ + } + +#if PDC202XX_DECODE_REGISTER_INFO + pci_read_config_byte(dev, (drive_pci), &AP); + pci_read_config_byte(dev, (drive_pci)|0x01, &BP); + pci_read_config_byte(dev, (drive_pci)|0x02, &CP); + pci_read_config_byte(dev, (drive_pci)|0x03, &DP); + + decode_registers(REG_A, AP); + decode_registers(REG_B, BP); + decode_registers(REG_C, CP); + decode_registers(REG_D, DP); +#endif /* PDC202XX_DECODE_REGISTER_INFO */ +#if PDC202XX_DEBUG_DRIVE_INFO + printk("%s: %s drive%d 0x%08x ", + drive->name, ide_xfer_verbose(speed), + drive->dn, drive_conf); + pci_read_config_dword(dev, drive_pci, &drive_conf); + printk("0x%08x\n", drive_conf); +#endif /* PDC202XX_DEBUG_DRIVE_INFO */ + + return (ide_config_drive_speed(drive, speed)); +} + +static int pdc202xx_new_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + ide_hwif_t *hwif = HWIF(drive); +#ifdef CONFIG_BLK_DEV_IDEDMA + u32 indexreg = hwif->dma_vendor1; + u32 datareg = hwif->dma_vendor3; +#else + struct pci_dev *dev = hwif->pci_dev; + u32 high_16 = pci_resource_start(dev, 4); + u32 indexreg = high_16 + (hwif->channel ? 0x09 : 0x01); + u32 datareg = (indexreg + 2); +#endif /* CONFIG_BLK_DEV_IDEDMA */ + u8 thold = 0x10; + u8 adj = (drive->dn%2) ? 0x08 : 0x00; + u8 speed = pdc202xx_ratefilter(drive, xferspeed); + +#ifdef CONFIG_BLK_DEV_IDEDMA + if (speed == XFER_UDMA_2) { + hwif->OUTB((thold + adj), indexreg); + hwif->OUTB((hwif->INB(datareg) & 0x7f), datareg); + } +#endif /* CONFIG_BLK_DEV_IDEDMA */ + + switch (speed) { +#ifdef CONFIG_BLK_DEV_IDEDMA + case XFER_UDMA_7: + speed = XFER_UDMA_6; + case XFER_UDMA_6: set_ultra(0x1a, 0x01, 0xcb); break; + case XFER_UDMA_5: set_ultra(0x1a, 0x02, 0xcb); break; + case XFER_UDMA_4: set_ultra(0x1a, 0x03, 0xcd); break; + case XFER_UDMA_3: set_ultra(0x1a, 0x05, 0xcd); break; + case XFER_UDMA_2: set_ultra(0x2a, 0x07, 0xcd); break; + case XFER_UDMA_1: set_ultra(0x3a, 0x0a, 0xd0); break; + case XFER_UDMA_0: set_ultra(0x4a, 0x0f, 0xd5); break; + case XFER_MW_DMA_2: set_ata2(0x69, 0x25); break; + case XFER_MW_DMA_1: set_ata2(0x6b, 0x27); break; + case XFER_MW_DMA_0: set_ata2(0xdf, 0x5f); break; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + case XFER_PIO_4: set_pio(0x23, 0x09, 0x25); break; + case XFER_PIO_3: set_pio(0x27, 0x0d, 0x35); break; + case XFER_PIO_2: set_pio(0x23, 0x26, 0x64); break; + case XFER_PIO_1: set_pio(0x46, 0x29, 0xa4); break; + case XFER_PIO_0: set_pio(0xfb, 0x2b, 0xac); break; + default: + ; + } + + return (ide_config_drive_speed(drive, speed)); +} + +/* 0 1 2 3 4 5 6 7 8 + * 960, 480, 390, 300, 240, 180, 120, 90, 60 + * 180, 150, 120, 90, 60 + * DMA_Speed + * 180, 120, 90, 90, 90, 60, 30 + * 11, 5, 4, 3, 2, 1, 0 + */ +static int config_chipset_for_pio (ide_drive_t *drive, u8 pio) +{ + u8 speed = 0; + + pio = (pio == 5) ? 4 : pio; + speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, pio, NULL); + + return ((int) pdc202xx_tune_chipset(drive, speed)); +} + +static void pdc202xx_tune_drive (ide_drive_t *drive, u8 pio) +{ + (void) config_chipset_for_pio(drive, pio); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA + +static u8 pdc202xx_new_cable_detect (ide_hwif_t *hwif) +{ + hwif->OUTB(0x0b, hwif->dma_vendor1); + return (!(hwif->INB(hwif->dma_vendor3) & 0x04)); +} + +static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif) +{ + u16 CIS = 0, mask = (hwif->channel) ? (1<<11) : (1<<10); + pci_read_config_word(hwif->pci_dev, 0x50, &CIS); + return ((u8)(!(CIS & mask))); +} + +static int config_chipset_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + u8 mode = pdc202xx_ratemask(drive); + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u32 high_16 = pci_resource_start(dev, 4); + u32 indexreg = hwif->dma_vendor1; + u32 datareg = hwif->dma_vendor3; + u8 iordy = 0x13; + u8 adj = (drive->dn%2) ? 0x08 : 0x00; + u8 cable = 0; + u8 jumpbit = 0; + unsigned int drive_conf; + u8 drive_pci = 0; + u8 test1, test2, speed = -1; + u8 AP; + u8 CLKSPD = 0; + u8 udma_66 = (eighty_ninty_three(drive)) ? 1 : 0; + u8 udma_100 = 0; + u8 udma_133 = 0; + u8 mask = hwif->channel ? 0x08 : 0x02; + + u8 ultra_66 = ((id->dma_ultra & 0x0010) || + (id->dma_ultra & 0x0008)) ? 1 : 0; + + switch(dev->device) { + case PCI_DEVICE_ID_PROMISE_20277: + case PCI_DEVICE_ID_PROMISE_20276: + case PCI_DEVICE_ID_PROMISE_20275: + case PCI_DEVICE_ID_PROMISE_20271: + case PCI_DEVICE_ID_PROMISE_20269: + udma_133 = (udma_66) ? 1 : 0; + udma_100 = (udma_66) ? 1 : 0; + case PCI_DEVICE_ID_PROMISE_20270: + case PCI_DEVICE_ID_PROMISE_20268: + cable = pdc202xx_new_cable_detect(hwif); + jumpbit = 1; + break; + case PCI_DEVICE_ID_PROMISE_20267: + case PCI_DEVICE_ID_PROMISE_20265: + udma_100 = (udma_66) ? 1 : 0; + case PCI_DEVICE_ID_PROMISE_20263: + case PCI_DEVICE_ID_PROMISE_20262: + cable = pdc202xx_old_cable_detect(hwif); + jumpbit = 0; + break; + default: + cable = 1; jumpbit = 0; + break; + } + + if (!jumpbit) + CLKSPD = hwif->INB(high_16 + 0x11); + /* + * Set the control register to use the 66Mhz system + * clock for UDMA 3/4 mode operation. If one drive on + * a channel is U66 capable but the other isn't we + * fall back to U33 mode. The BIOS INT 13 hooks turn + * the clock on then off for each read/write issued. I don't + * do that here because it would require modifying the + * kernel, seperating the fop routines from the kernel or + * somehow hooking the fops calls. It may also be possible to + * leave the 66Mhz clock on and readjust the timing + * parameters. + */ + + if ((ultra_66) && (cable)) { +#if 1 + printk("ULTRA 66/100/133: %s channel of Ultra 66/100/133 " + "requires an 80-pin cable for Ultra66 operation.\n", + hwif->channel ? "Secondary" : "Primary"); + printk(" Switching to Ultra33 mode.\n"); +#endif /* DEBUG */ + /* Primary : zero out second bit */ + /* Secondary : zero out fourth bit */ + if (!jumpbit) + hwif->OUTB(CLKSPD & ~mask, (high_16 + 0x11)); + printk("Warning: %s channel requires an 80-pin cable for operation.\n", hwif->channel ? "Secondary":"Primary"); + printk("%s reduced to Ultra33 mode.\n", drive->name); + udma_66 = 0; + } else { + if (ultra_66) { + /* + * check to make sure drive on same channel + * is u66 capable + */ + if (hwif->drives[!(drive->dn%2)].id) { + if (hwif->drives[!(drive->dn%2)].id->dma_ultra & 0x0078) { + if (!jumpbit) + hwif->OUTB(CLKSPD | mask, (high_16 + 0x11)); + } else { + if (!jumpbit) + hwif->OUTB(CLKSPD & ~mask, (high_16 + 0x11)); + } + } else { /* udma4 drive by itself */ + if (!jumpbit) + hwif->OUTB(CLKSPD | mask, (high_16 + 0x11)); + } + } + } + + if (jumpbit) { + if (drive->media != ide_disk) + return 0; + if (id->capability & 4) { /* IORDY_EN & PREFETCH_EN */ + hwif->OUTB((iordy + adj), indexreg); + hwif->OUTB((hwif->INB(datareg)|0x03), datareg); + } + goto jumpbit_is_set; + } + + drive_pci = 0x60 + (drive->dn << 2); + pci_read_config_dword(dev, drive_pci, &drive_conf); + if ((drive_conf != 0x004ff304) && (drive_conf != 0x004ff3c4)) + goto chipset_is_set; + + pci_read_config_byte(dev, drive_pci, &test1); + if (!(test1 & SYNC_ERRDY_EN)) { + if (drive->select.b.unit & 0x01) { + pci_read_config_byte(dev, drive_pci - 4, &test2); + if ((test2 & SYNC_ERRDY_EN) && + !(test1 & SYNC_ERRDY_EN)) { + pci_write_config_byte(dev, drive_pci, + test1|SYNC_ERRDY_EN); + } + } else { + pci_write_config_byte(dev, drive_pci, + test1|SYNC_ERRDY_EN); + } + } + +chipset_is_set: + + if (drive->media != ide_disk) { + hwif->tuneproc(drive, 5); + return 0; + } + + pci_read_config_byte(dev, (drive_pci), &AP); + if (id->capability & 4) /* IORDY_EN */ + pci_write_config_byte(dev, (drive_pci), AP|IORDY_EN); + pci_read_config_byte(dev, (drive_pci), &AP); + if (drive->media == ide_disk) /* PREFETCH_EN */ + pci_write_config_byte(dev, (drive_pci), AP|PREFETCH_EN); + +jumpbit_is_set: + + switch(mode) { + case 0x04: + if (id->dma_ultra & 0x0040) + { speed = XFER_UDMA_6; break; } + case 0x03: + if (id->dma_ultra & 0x0020) + { speed = XFER_UDMA_5; break; } + case 0x02: + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_4; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_3; break; } + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_mword & 0x0001) + { speed = XFER_MW_DMA_0; break; } + if ((id->dma_1word & 0x0004) && (!jumpbit)) + { speed = XFER_SW_DMA_2; break; } + if ((id->dma_1word & 0x0002) && (!jumpbit)) + { speed = XFER_SW_DMA_1; break; } + if ((id->dma_1word & 0x0001) && (!jumpbit)) + { speed = XFER_SW_DMA_0; break; } + default: + + /* restore original pci-config space */ + if (!jumpbit) + pci_write_config_dword(dev, drive_pci, drive_conf); + hwif->tuneproc(drive, 5); + return 0; + } + + (void) hwif->speedproc(drive, speed); + + return ((int) ((((id->dma_ultra >> 8) & 0x7F) || + ((id->dma_mword >> 8) & 0x07) || + (((id->dma_1word >> 8) & 0x07) && + (!jumpbit))) ? 1 : 0)); +} + +static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + drive->init_speed = 0; + + if (id && (id->capability & 1) && drive->autodma) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + if (id->field_valid & 4) { + if (id->dma_ultra & 0x007F) { + /* Force if Capable UltraDMA */ + int dma = config_chipset_for_dma(drive); + if ((id->field_valid & 2) && !dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + (id->dma_1word & 0x0007)) { + /* Force if Capable regular DMA modes */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + goto no_dma_set; + /* Consult the list of known "good" drives */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + HWIF(drive)->tuneproc(drive, 5); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} + +static int pdc202xx_quirkproc (ide_drive_t *drive) +{ + return ((int) check_in_drive_lists(drive, pdc_quirk_drives)); +} + +static int pdc202xx_old_ide_dma_begin(ide_drive_t *drive) +{ + if (drive->addressing == 1) { + struct request *rq = HWGROUP(drive)->rq; + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u32 high_16 = pci_resource_start(dev, 4); + u32 atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20); + u32 word_count = 0; + u8 clock = hwif->INB(high_16 + 0x11); + + hwif->OUTB(clock|(hwif->channel ? 0x08 : 0x02), high_16+0x11); + word_count = (rq->nr_sectors << 8); + word_count = (rq->cmd == READ) ? word_count | 0x05000000 : + word_count | 0x06000000; + hwif->OUTL(word_count, atapi_reg); + } + return __ide_dma_begin(drive); +} + +static int pdc202xx_old_ide_dma_end(ide_drive_t *drive) +{ + if (drive->addressing == 1) { + ide_hwif_t *hwif = HWIF(drive); + u32 high_16 = pci_resource_start(hwif->pci_dev, 4); + u32 atapi_reg = high_16 + (hwif->channel ? 0x24 : 0x20); + u8 clock = 0; + + hwif->OUTL(0, atapi_reg); /* zero out extra */ + clock = hwif->INB(high_16 + 0x11); + hwif->OUTB(clock & ~(hwif->channel ? 0x08:0x02), high_16+0x11); + } + return __ide_dma_end(drive); +} + +static int pdc202xx_old_ide_dma_test_irq(ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + unsigned long high_16 = pci_resource_start(dev, 4); + u8 dma_stat = hwif->INB(hwif->dma_status); + u8 sc1d = hwif->INB((high_16 + 0x001d)); + + if (hwif->channel) { + if ((sc1d & 0x50) == 0x50) + goto somebody_else; + else if ((sc1d & 0x40) == 0x40) + return (dma_stat & 4) == 4; + } else { + if ((sc1d & 0x05) == 0x05) + goto somebody_else; + else if ((sc1d & 0x04) == 0x04) + return (dma_stat & 4) == 4; + } +somebody_else: + return (dma_stat & 4) == 4; /* return 1 if INTR asserted */ +} + +static int pdc202xx_ide_dma_lostirq(ide_drive_t *drive) +{ + if (HWIF(drive)->resetproc != NULL) + HWIF(drive)->resetproc(drive); + return __ide_dma_lostirq(drive); +} + +static int pdc202xx_ide_dma_timeout(ide_drive_t *drive) +{ + if (HWIF(drive)->resetproc != NULL) + HWIF(drive)->resetproc(drive); + return __ide_dma_timeout(drive); +} + +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +static void pdc202xx_new_reset (ide_drive_t *drive) +{ + /* + * Deleted this because it is redundant from the caller. + */ + printk("PDC202XX: %s channel reset.\n", + HWIF(drive)->channel ? "Secondary" : "Primary"); +} + +static void pdc202xx_reset_host (ide_hwif_t *hwif) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + unsigned long high_16 = hwif->dma_base - (8*(hwif->channel)); +#else /* !CONFIG_BLK_DEV_IDEDMA */ + struct pci_dev *dev = hwif->pci_dev; + unsigned long high_16 = pci_resource_start(dev, 4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ + u8 udma_speed_flag = hwif->INB(high_16|0x001f); + + hwif->OUTB((udma_speed_flag | 0x10), (high_16|0x001f)); + mdelay(100); + hwif->OUTB((udma_speed_flag & ~0x10), (high_16|0x001f)); + mdelay(2000); /* 2 seconds ?! */ + + printk("PDC202XX: %s channel reset.\n", + hwif->channel ? "Secondary" : "Primary"); +} + +void pdc202xx_reset (ide_drive_t *drive) +{ + pdc202xx_reset_host(HWIF(drive)); + HWIF(drive)->tuneproc(drive, 5); +} + +/* + * Since SUN Cobalt is attempting to do this operation, I should disclose + * this has been a long time ago Thu Jul 27 16:40:57 2000 was the patch date + * HOTSWAP ATA Infrastructure. + */ +static int pdc202xx_tristate (ide_drive_t * drive, int state) +{ + ide_hwif_t *hwif = HWIF(drive); +#ifdef CONFIG_BLK_DEV_IDEDMA + unsigned long high_16 = hwif->dma_base - (8*(hwif->channel)); +#else /* !CONFIG_BLK_DEV_IDEDMA */ + struct pci_dev *dev = hwif->pci_dev; + unsigned long high_16 = pci_resource_start(dev, 4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ + u8 sc1f = hwif->INB(high_16|0x001f); + + if (!hwif) + return -EINVAL; + +// hwif->bus_state = state; + + if (state) { + hwif->OUTB(sc1f | 0x08, (high_16|0x001f)); + } else { + hwif->OUTB(sc1f & ~0x08, (high_16|0x001f)); + } + return 0; +} + +static unsigned int __init init_chipset_pdc202xx (struct pci_dev *dev, const char *name) +{ + if (dev->resource[PCI_ROM_RESOURCE].start) { + pci_write_config_dword(dev, PCI_ROM_ADDRESS, + dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); + printk("%s: ROM enabled at 0x%08lx\n", + name, dev->resource[PCI_ROM_RESOURCE].start); + } + +#if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS) + pdc202_devs[n_pdc202_devs++] = dev; + + if (!pdc202xx_proc) { + pdc202xx_proc = 1; + ide_pci_register_host_proc(&pdc202xx_procs[0]); + } +#endif /* DISPLAY_PDC202XX_TIMINGS && CONFIG_PROC_FS */ + + switch (dev->device) { + case PCI_DEVICE_ID_PROMISE_20277: + case PCI_DEVICE_ID_PROMISE_20276: + case PCI_DEVICE_ID_PROMISE_20275: + case PCI_DEVICE_ID_PROMISE_20271: + case PCI_DEVICE_ID_PROMISE_20269: + case PCI_DEVICE_ID_PROMISE_20270: + case PCI_DEVICE_ID_PROMISE_20268: + break; + case PCI_DEVICE_ID_PROMISE_20267: + case PCI_DEVICE_ID_PROMISE_20265: + case PCI_DEVICE_ID_PROMISE_20263: + case PCI_DEVICE_ID_PROMISE_20262: + /* + * software reset - this is required because the bios + * will set UDMA timing on if the hdd supports it. The + * user may want to turn udma off. A bug in the pdc20262 + * is that it cannot handle a downgrade in timing from + * UDMA to DMA. Disk accesses after issuing a set + * feature command will result in errors. A software + * reset leaves the timing registers intact, + * but resets the drives. + */ + default: + break; + } + return dev->irq; +} + +static void __init init_hwif_pdc202xx (ide_hwif_t *hwif) +{ + u8 newchip = 0; + + hwif->tuneproc = &pdc202xx_tune_drive; + hwif->quirkproc = &pdc202xx_quirkproc; + hwif->ratemask = &pdc202xx_ratemask; + hwif->ratefilter = &pdc202xx_ratefilter; + hwif->autodma = 0; + + switch(hwif->pci_dev->device) { + case PCI_DEVICE_ID_PROMISE_20277: + case PCI_DEVICE_ID_PROMISE_20276: + case PCI_DEVICE_ID_PROMISE_20275: + case PCI_DEVICE_ID_PROMISE_20271: + case PCI_DEVICE_ID_PROMISE_20269: + case PCI_DEVICE_ID_PROMISE_20268: + case PCI_DEVICE_ID_PROMISE_20270: + hwif->speedproc = &pdc202xx_new_tune_chipset; + hwif->resetproc = &pdc202xx_new_reset; + newchip = 1; + break; + case PCI_DEVICE_ID_PROMISE_20267: + case PCI_DEVICE_ID_PROMISE_20265: + hwif->addressing = (hwif->channel) ? 0 : 1; + case PCI_DEVICE_ID_PROMISE_20263: + case PCI_DEVICE_ID_PROMISE_20262: + hwif->busproc = &pdc202xx_tristate; + hwif->resetproc = &pdc202xx_reset; + case PCI_DEVICE_ID_PROMISE_20246: + hwif->speedproc = &pdc202xx_tune_chipset; + default: + break; + } + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + + hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; + hwif->ide_dma_lostirq = &pdc202xx_ide_dma_lostirq; + hwif->ide_dma_timeout = &pdc202xx_ide_dma_timeout; + + if (newchip) { + hwif->OUTB(0x0b, hwif->dma_vendor1); + if (!(hwif->udma_four)) + hwif->udma_four = (!(hwif->INB(hwif->dma_vendor3) & 0x04)); + } else { + if (!hwif->pci_dev->device == PCI_DEVICE_ID_PROMISE_20246) { + u16 mask = (hwif->channel) ? (1<<11) : (1<<10); + u16 CIS = 0; + hwif->ide_dma_begin = &pdc202xx_old_ide_dma_begin; + hwif->ide_dma_end = &pdc202xx_old_ide_dma_end; + pci_read_config_word(hwif->pci_dev, 0x50, &CIS); + if (!(hwif->udma_four)) + hwif->udma_four = (!(CIS & mask)); + } + hwif->ide_dma_test_irq = &pdc202xx_old_ide_dma_test_irq; + } + + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static void __init init_dma_pdc202xx (ide_hwif_t *hwif, unsigned long dmabase) +{ + u8 udma_speed_flag = 0, primary_mode = 0, secondary_mode = 0; + + switch (hwif->pci_dev->device) { + case PCI_DEVICE_ID_PROMISE_20277: + case PCI_DEVICE_ID_PROMISE_20276: + case PCI_DEVICE_ID_PROMISE_20275: + case PCI_DEVICE_ID_PROMISE_20271: + case PCI_DEVICE_ID_PROMISE_20269: + case PCI_DEVICE_ID_PROMISE_20270: + case PCI_DEVICE_ID_PROMISE_20268: + break; + default: + if (hwif->channel) + break; + udma_speed_flag = hwif->INB((dmabase|0x1f)); + primary_mode = hwif->INB((dmabase|0x1a)); + secondary_mode = hwif->INB((dmabase|0x1b)); + printk("%s: (U)DMA Burst Bit %sABLED " \ + "Primary %s Mode " \ + "Secondary %s Mode.\n", hwif->cds->name, + (udma_speed_flag & 1) ? "EN" : "DIS", + (primary_mode & 1) ? "MASTER" : "PCI", + (secondary_mode & 1) ? "MASTER" : "PCI" ); + +#ifdef CONFIG_PDC202XX_BURST + if (!(udma_speed_flag & 1)) { + printk("%s: FORCING BURST BIT 0x%02x->0x%02x ", + hwif->cds->name, udma_speed_flag, + (udma_speed_flag|1)); + hwif->OUTB(udma_speed_flag|1,(dmabase|0x1f)); + printk("%sACTIVE\n", + (hwif->INB(dmabase|0x1f)&1) ? "":"IN"); + } +#endif /* CONFIG_PDC202XX_BURST */ +#ifdef CONFIG_PDC202XX_MASTER + if (!(primary_mode & 1)) { + printk("%s: FORCING PRIMARY MODE BIT " + "0x%02x -> 0x%02x ", hwif->cds->name, + primary_mode, (primary_mode|1)); + hwif->OUTB(primary_mode|1, (dmabase|0x1a)); + printk("%s\n", + (hwif->INB((dmabase|0x1a)) & 1) ? "MASTER" : "PCI"); + } + + if (!(secondary_mode & 1)) { + printk("%s: FORCING SECONDARY MODE BIT " + "0x%02x -> 0x%02x ", hwif->cds->name, + secondary_mode, (secondary_mode|1)); + hwif->OUTB(secondary_mode|1, (dmabase|0x1b)); + printk("%s\n", + (hwif->INB((dmabase|0x1b)) & 1) ? "MASTER" : "PCI"); + } +#endif /* CONFIG_PDC202XX_MASTER */ + + break; + } + + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); +extern void ide_setup_pci_devices(struct pci_dev *, struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_pdc202ata4 (struct pci_dev *dev, ide_pci_device_t *d) +{ + if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) { + u8 irq = 0, irq2 = 0; + pci_read_config_byte(dev, PCI_INTERRUPT_LINE, &irq); + /* 0xbc */ + pci_read_config_byte(dev, (PCI_INTERRUPT_LINE)|0x80, &irq2); + if (irq != irq2) { + pci_write_config_byte(dev, + (PCI_INTERRUPT_LINE)|0x80, irq); /* 0xbc */ + printk("%s: pci-config space interrupt " + "mirror fixed.\n", d->name); + } + } + +#if 0 + if (dev->device == PCI_DEVICE_ID_PROMISE_20262) + if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || + (tmp & e->mask) != e->val)) + + if (d->enablebits[0].reg != d->enablebits[1].reg) { + d->enablebits[0].reg = d->enablebits[1].reg; + d->enablebits[0].mask = d->enablebits[1].mask; + d->enablebits[0].val = d->enablebits[1].val; + } +#endif + + ide_setup_pci_device(dev, d); +} + +static void __init init_setup_pdc20265 (struct pci_dev *dev, ide_pci_device_t *d) +{ + if ((dev->bus->self) && + (dev->bus->self->vendor == PCI_VENDOR_ID_INTEL) && + ((dev->bus->self->device == PCI_DEVICE_ID_INTEL_I960) || + (dev->bus->self->device == PCI_DEVICE_ID_INTEL_I960RM))) { + printk(KERN_INFO "ide: Skipping Promise PDC20265 " + "attached to I2O RAID controller.\n"); + return; + } + +#if 0 + { + u8 pri = 0, sec = 0; + + if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || + (tmp & e->mask) != e->val)) + + if (d->enablebits[0].reg != d->enablebits[1].reg) { + d->enablebits[0].reg = d->enablebits[1].reg; + d->enablebits[0].mask = d->enablebits[1].mask; + d->enablebits[0].val = d->enablebits[1].val; + } + } +#endif + + ide_setup_pci_device(dev, d); +} + +static void __init init_setup_pdc202xx (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +static void __init init_setup_pdc20270 (struct pci_dev *dev, ide_pci_device_t *d) +{ + struct pci_dev *findev; + + if ((dev->bus->self && + dev->bus->self->vendor == PCI_VENDOR_ID_DEC) && + (dev->bus->self->device == PCI_DEVICE_ID_DEC_21150)) { + if (PCI_SLOT(dev->devfn) & 2) { + return; + } + d->extra = 0; + pci_for_each_dev(findev) { + if ((findev->vendor == dev->vendor) && + (findev->device == dev->device) && + (PCI_SLOT(findev->devfn) & 2)) { + u8 irq = 0, irq2 = 0; + pci_read_config_byte(dev, + PCI_INTERRUPT_LINE, &irq); + pci_read_config_byte(findev, + PCI_INTERRUPT_LINE, &irq2); + if (irq != irq2) { + findev->irq = dev->irq; + pci_write_config_byte(findev, + PCI_INTERRUPT_LINE, irq); + } + ide_setup_pci_devices(dev, findev, d); + return; + } + } + } + ide_setup_pci_device(dev, d); +} + +static void __init init_setup_pdc20276 (struct pci_dev *dev, ide_pci_device_t *d) +{ + if ((dev->bus->self) && + (dev->bus->self->vendor == PCI_VENDOR_ID_INTEL) && + ((dev->bus->self->device == PCI_DEVICE_ID_INTEL_I960) || + (dev->bus->self->device == PCI_DEVICE_ID_INTEL_I960RM))) { + printk(KERN_INFO "ide: Skipping Promise PDC20276 " + "attached to I2O RAID controller.\n"); + return; + } + ide_setup_pci_device(dev, d); +} + +int __init pdc202xx_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_PROMISE) + return 0; + + for (d = pdc202xx_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/pdc202xx.h linux.20pre5-ac2/drivers/ide/pci/pdc202xx.h --- linux.20pre5/drivers/ide/pci/pdc202xx.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/pdc202xx.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,434 @@ +#ifndef PDC202XX_H +#define PDC202XX_H + +#include +#include +#include + +#define DISPLAY_PDC202XX_TIMINGS + +#ifndef SPLIT_BYTE +#define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4))) +#endif + +#define PDC202XX_DEBUG_DRIVE_INFO 0 +#define PDC202XX_DECODE_REGISTER_INFO 0 + +const char *pdc_quirk_drives[] = { + "QUANTUM FIREBALLlct08 08", + "QUANTUM FIREBALLP KA6.4", + "QUANTUM FIREBALLP KA9.1", + "QUANTUM FIREBALLP LM20.4", + "QUANTUM FIREBALLP KX13.6", + "QUANTUM FIREBALLP KX20.5", + "QUANTUM FIREBALLP KX27.3", + "QUANTUM FIREBALLP LM20.5", + NULL +}; + +static inline u8 *pdc202xx_pio_verbose (u32 drive_pci) +{ + if ((drive_pci & 0x000ff000) == 0x000ff000) return("NOTSET"); + if ((drive_pci & 0x00000401) == 0x00000401) return("PIO 4"); + if ((drive_pci & 0x00000602) == 0x00000602) return("PIO 3"); + if ((drive_pci & 0x00000803) == 0x00000803) return("PIO 2"); + if ((drive_pci & 0x00000C05) == 0x00000C05) return("PIO 1"); + if ((drive_pci & 0x00001309) == 0x00001309) return("PIO 0"); + return("PIO ?"); +} + +static inline u8 *pdc202xx_dma_verbose (u32 drive_pci) +{ + if ((drive_pci & 0x00036000) == 0x00036000) return("MWDMA 2"); + if ((drive_pci & 0x00046000) == 0x00046000) return("MWDMA 1"); + if ((drive_pci & 0x00056000) == 0x00056000) return("MWDMA 0"); + if ((drive_pci & 0x00056000) == 0x00056000) return("SWDMA 2"); + if ((drive_pci & 0x00068000) == 0x00068000) return("SWDMA 1"); + if ((drive_pci & 0x000BC000) == 0x000BC000) return("SWDMA 0"); + return("PIO---"); +} + +static inline u8 *pdc202xx_ultra_verbose (u32 drive_pci, u16 slow_cable) +{ + if ((drive_pci & 0x000ff000) == 0x000ff000) + return("NOTSET"); + if ((drive_pci & 0x00012000) == 0x00012000) + return((slow_cable) ? "UDMA 2" : "UDMA 4"); + if ((drive_pci & 0x00024000) == 0x00024000) + return((slow_cable) ? "UDMA 1" : "UDMA 3"); + if ((drive_pci & 0x00036000) == 0x00036000) + return("UDMA 0"); + return(pdc202xx_dma_verbose(drive_pci)); +} + +/* A Register */ +#define SYNC_ERRDY_EN 0xC0 + +#define SYNC_IN 0x80 /* control bit, different for master vs. slave drives */ +#define ERRDY_EN 0x40 /* control bit, different for master vs. slave drives */ +#define IORDY_EN 0x20 /* PIO: IOREADY */ +#define PREFETCH_EN 0x10 /* PIO: PREFETCH */ + +#define PA3 0x08 /* PIO"A" timing */ +#define PA2 0x04 /* PIO"A" timing */ +#define PA1 0x02 /* PIO"A" timing */ +#define PA0 0x01 /* PIO"A" timing */ + +/* B Register */ + +#define MB2 0x80 /* DMA"B" timing */ +#define MB1 0x40 /* DMA"B" timing */ +#define MB0 0x20 /* DMA"B" timing */ + +#define PB4 0x10 /* PIO_FORCE 1:0 */ + +#define PB3 0x08 /* PIO"B" timing */ /* PIO flow Control mode */ +#define PB2 0x04 /* PIO"B" timing */ /* PIO 4 */ +#define PB1 0x02 /* PIO"B" timing */ /* PIO 3 half */ +#define PB0 0x01 /* PIO"B" timing */ /* PIO 3 other half */ + +/* C Register */ +#define IORDYp_NO_SPEED 0x4F +#define SPEED_DIS 0x0F + +#define DMARQp 0x80 +#define IORDYp 0x40 +#define DMAR_EN 0x20 +#define DMAW_EN 0x10 + +#define MC3 0x08 /* DMA"C" timing */ +#define MC2 0x04 /* DMA"C" timing */ +#define MC1 0x02 /* DMA"C" timing */ +#define MC0 0x01 /* DMA"C" timing */ + +#if PDC202XX_DECODE_REGISTER_INFO + +#define REG_A 0x01 +#define REG_B 0x02 +#define REG_C 0x04 +#define REG_D 0x08 + +static void decode_registers (u8 registers, u8 value) +{ + u8 bit = 0, bit1 = 0, bit2 = 0; + + switch(registers) { + case REG_A: + bit2 = 0; + printk("A Register "); + if (value & 0x80) printk("SYNC_IN "); + if (value & 0x40) printk("ERRDY_EN "); + if (value & 0x20) printk("IORDY_EN "); + if (value & 0x10) printk("PREFETCH_EN "); + if (value & 0x08) { printk("PA3 ");bit2 |= 0x08; } + if (value & 0x04) { printk("PA2 ");bit2 |= 0x04; } + if (value & 0x02) { printk("PA1 ");bit2 |= 0x02; } + if (value & 0x01) { printk("PA0 ");bit2 |= 0x01; } + printk("PIO(A) = %d ", bit2); + break; + case REG_B: + bit1 = 0;bit2 = 0; + printk("B Register "); + if (value & 0x80) { printk("MB2 ");bit1 |= 0x80; } + if (value & 0x40) { printk("MB1 ");bit1 |= 0x40; } + if (value & 0x20) { printk("MB0 ");bit1 |= 0x20; } + printk("DMA(B) = %d ", bit1 >> 5); + if (value & 0x10) printk("PIO_FORCED/PB4 "); + if (value & 0x08) { printk("PB3 ");bit2 |= 0x08; } + if (value & 0x04) { printk("PB2 ");bit2 |= 0x04; } + if (value & 0x02) { printk("PB1 ");bit2 |= 0x02; } + if (value & 0x01) { printk("PB0 ");bit2 |= 0x01; } + printk("PIO(B) = %d ", bit2); + break; + case REG_C: + bit2 = 0; + printk("C Register "); + if (value & 0x80) printk("DMARQp "); + if (value & 0x40) printk("IORDYp "); + if (value & 0x20) printk("DMAR_EN "); + if (value & 0x10) printk("DMAW_EN "); + + if (value & 0x08) { printk("MC3 ");bit2 |= 0x08; } + if (value & 0x04) { printk("MC2 ");bit2 |= 0x04; } + if (value & 0x02) { printk("MC1 ");bit2 |= 0x02; } + if (value & 0x01) { printk("MC0 ");bit2 |= 0x01; } + printk("DMA(C) = %d ", bit2); + break; + case REG_D: + printk("D Register "); + break; + default: + return; + } + printk("\n %s ", (registers & REG_D) ? "DP" : + (registers & REG_C) ? "CP" : + (registers & REG_B) ? "BP" : + (registers & REG_A) ? "AP" : "ERROR"); + for (bit=128;bit>0;bit/=2) + printk("%s", (value & bit) ? "1" : "0"); + printk("\n"); +} + +#endif /* PDC202XX_DECODE_REGISTER_INFO */ + +#define set_2regs(a, b) \ + do { \ + hwif->OUTB((a + adj), indexreg); \ + hwif->OUTB(b, datareg); \ + } while(0) + +#define set_ultra(a, b, c) \ + do { \ + set_2regs(0x10,(a)); \ + set_2regs(0x11,(b)); \ + set_2regs(0x12,(c)); \ + } while(0) + +#define set_ata2(a, b) \ + do { \ + set_2regs(0x0e,(a)); \ + set_2regs(0x0f,(b)); \ + } while(0) + +#define set_pio(a, b, c) \ + do { \ + set_2regs(0x0c,(a)); \ + set_2regs(0x0d,(b)); \ + set_2regs(0x13,(c)); \ + } while(0) + +#define DISPLAY_PDC202XX_TIMINGS + +#if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 pdc202xx_proc; + +static int pdc202xx_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t pdc202xx_procs[] __initdata = { + { + name: "pdc202xx", + set: 1, + get_info: pdc202xx_get_info, + parent: NULL, + }, +}; +#endif /* DISPLAY_PDC202XX_TIMINGS && CONFIG_PROC_FS */ + + +static void init_setup_pdc202ata4(struct pci_dev *dev, ide_pci_device_t *d); +static void init_setup_pdc20265(struct pci_dev *, ide_pci_device_t *); +static void init_setup_pdc202xx(struct pci_dev *, ide_pci_device_t *); +static void init_setup_pdc20270(struct pci_dev *, ide_pci_device_t *); +static void init_setup_pdc20276(struct pci_dev *dev, ide_pci_device_t *d); +static unsigned int init_chipset_pdc202xx(struct pci_dev *, const char *); +static void init_hwif_pdc202xx(ide_hwif_t *); +static void init_dma_pdc202xx(ide_hwif_t *, unsigned long); + +static ide_pci_device_t pdc202xx_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_PROMISE, + device: PCI_DEVICE_ID_PROMISE_20246, + name: "PDC20246", + init_setup: init_setup_pdc202ata4, + init_chipset: init_chipset_pdc202xx, + init_iops: NULL, + init_hwif: init_hwif_pdc202xx, + init_dma: init_dma_pdc202xx, + channels: 2, + autodma: AUTODMA, +#ifdef CONFIG_PDC202XX_FORCE + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, +#else /* !CONFIG_PDC202XX_FORCE */ + enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, +#endif + bootable: OFF_BOARD, + extra: 16, + },{ + vendor: PCI_VENDOR_ID_PROMISE, + device: PCI_DEVICE_ID_PROMISE_20262, + name: "PDC20262", + init_setup: init_setup_pdc202ata4, + init_chipset: init_chipset_pdc202xx, + init_iops: NULL, + init_hwif: init_hwif_pdc202xx, + init_dma: init_dma_pdc202xx, + channels: 2, + autodma: AUTODMA, +#ifdef CONFIG_PDC202XX_FORCE + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, +#else /* !CONFIG_PDC202XX_FORCE */ + enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, +#endif + bootable: OFF_BOARD, + extra: 48, + },{ + vendor: PCI_VENDOR_ID_PROMISE, + device: PCI_DEVICE_ID_PROMISE_20263, + name: "PDC20263", + init_setup: init_setup_pdc202ata4, + init_chipset: init_chipset_pdc202xx, + init_iops: NULL, + init_hwif: init_hwif_pdc202xx, + init_dma: init_dma_pdc202xx, + channels: 2, + autodma: AUTODMA, +#ifdef CONFIG_PDC202XX_FORCE + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, +#else /* !CONFIG_PDC202XX_FORCE */ + enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, +#endif + bootable: OFF_BOARD, + extra: 48, + },{ + vendor: PCI_VENDOR_ID_PROMISE, + device: PCI_DEVICE_ID_PROMISE_20265, + name: "PDC20265", + init_setup: init_setup_pdc20265, + init_chipset: init_chipset_pdc202xx, + init_hwif: init_hwif_pdc202xx, + init_dma: init_dma_pdc202xx, + channels: 2, + autodma: AUTODMA, +#ifdef CONFIG_PDC202XX_FORCE + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, +#else /* !CONFIG_PDC202XX_FORCE */ + enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, +#endif + bootable: OFF_BOARD, + extra: 48, + },{ + vendor: PCI_VENDOR_ID_PROMISE, + device: PCI_DEVICE_ID_PROMISE_20267, + name: "PDC20267", + init_setup: init_setup_pdc202xx, + init_chipset: init_chipset_pdc202xx, + init_iops: NULL, + init_hwif: init_hwif_pdc202xx, + init_dma: init_dma_pdc202xx, + channels: 2, + autodma: AUTODMA, +#ifdef CONFIG_PDC202XX_FORCE + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, +#else /* !CONFIG_PDC202XX_FORCE */ + enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, +#endif + bootable: OFF_BOARD, + extra: 48, + },{ + vendor: PCI_VENDOR_ID_PROMISE, + device: PCI_DEVICE_ID_PROMISE_20268, + name: "PDC20268", + init_setup: init_setup_pdc202xx, + init_chipset: init_chipset_pdc202xx, + init_iops: NULL, + init_hwif: init_hwif_pdc202xx, + init_dma: init_dma_pdc202xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_PROMISE, + device: PCI_DEVICE_ID_PROMISE_20269, + name: "PDC20269", + init_setup: init_setup_pdc202xx, + init_chipset: init_chipset_pdc202xx, + init_iops: NULL, + init_hwif: init_hwif_pdc202xx, + init_dma: init_dma_pdc202xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_PROMISE, + device: PCI_DEVICE_ID_PROMISE_20270, + name: "PDC20270", + init_setup: init_setup_pdc20270, + init_chipset: init_chipset_pdc202xx, + init_iops: NULL, + init_hwif: init_hwif_pdc202xx, + init_dma: init_dma_pdc202xx, + channels: 2, + autodma: AUTODMA, +#ifdef CONFIG_PDC202XX_FORCE + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, +#else /* !CONFIG_PDC202XX_FORCE */ + enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, +#endif + bootable: OFF_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_PROMISE, + device: PCI_DEVICE_ID_PROMISE_20271, + name: "PDC20271", + init_setup: init_setup_pdc202xx, + init_chipset: init_chipset_pdc202xx, + init_iops: NULL, + init_hwif: init_hwif_pdc202xx, + init_dma: init_dma_pdc202xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_PROMISE, + device: PCI_DEVICE_ID_PROMISE_20275, + name: "PDC20275", + init_setup: init_setup_pdc202xx, + init_chipset: init_chipset_pdc202xx, + init_iops: NULL, + init_hwif: init_hwif_pdc202xx, + init_dma: init_dma_pdc202xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_PROMISE, + device: PCI_DEVICE_ID_PROMISE_20276, + name: "PDC20276", + init_setup: init_setup_pdc20276, + init_chipset: init_chipset_pdc202xx, + init_iops: NULL, + init_hwif: init_hwif_pdc202xx, + init_dma: init_dma_pdc202xx, + channels: 2, + autodma: AUTODMA, +#ifdef CONFIG_PDC202XX_FORCE + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, +#else /* !CONFIG_PDC202XX_FORCE */ + enablebits: {{0x50,0x02,0x02}, {0x50,0x04,0x04}}, +#endif + bootable: OFF_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_PROMISE, + device: PCI_DEVICE_ID_PROMISE_20277, + name: "PDC20277", + init_setup: init_setup_pdc202xx, + init_chipset: init_chipset_pdc202xx, + init_iops: NULL, + init_hwif: init_hwif_pdc202xx, + init_dma: init_dma_pdc202xx, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* PDC202XX_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/pdcadma.c linux.20pre5-ac2/drivers/ide/pci/pdcadma.c --- linux.20pre5/drivers/ide/pci/pdcadma.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/pdcadma.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,139 @@ +/* + * linux/drivers/ide/pdcadma.c Version 0.01 June 21, 2001 + * + * Copyright (C) 1999-2000 Andre Hedrick + * May be copied or modified under the terms of the GNU General Public License + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "ide_modes.h" +#include "pdcadma.h" + +static u8 pdcadma_proc = 0; + +#if defined(DISPLAY_PDCADMA_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static struct pci_dev *bmide_dev; + +static int pdcadma_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + u32 bibma = pci_resource_start(bmide_dev, 4); + + p += sprintf(p, "\n " + "PDC ADMA %04X Chipset.\n", bmide_dev->device); + p += sprintf(p, "UDMA\n"); + p += sprintf(p, "PIO\n"); + + return p-buffer; /* => must be less than 4k! */ +} +#endif /* defined(DISPLAY_PDCADMA_TIMINGS) && defined(CONFIG_PROC_FS) */ + +#ifdef CONFIG_BLK_DEV_IDEDMA +/* + * pdcadma_dma functions() initiates/aborts (U)DMA read/write + * operations on a drive. + */ +#if 0 + int (*ide_dma_read)(ide_drive_t *drive); + int (*ide_dma_write)(ide_drive_t *drive); + int (*ide_dma_begin)(ide_drive_t *drive); + int (*ide_dma_end)(ide_drive_t *drive); + int (*ide_dma_check)(ide_drive_t *drive); + int (*ide_dma_on)(ide_drive_t *drive); + int (*ide_dma_off)(ide_drive_t *drive); + int (*ide_dma_off_quietly)(ide_drive_t *drive); + int (*ide_dma_test_irq)(ide_drive_t *drive); + int (*ide_dma_host_on)(ide_drive_t *drive); + int (*ide_dma_host_off)(ide_drive_t *drive); + int (*ide_dma_bad_drive)(ide_drive_t *drive); + int (*ide_dma_good_drive)(ide_drive_t *drive); + int (*ide_dma_count)(ide_drive_t *drive); + int (*ide_dma_verbose)(ide_drive_t *drive); + int (*ide_dma_retune)(ide_drive_t *drive); + int (*ide_dma_lostirq)(ide_drive_t *drive); + int (*ide_dma_timeout)(ide_drive_t *drive); + +#endif + +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +static unsigned int __init init_chipset_pdcadma (struct pci_dev *dev, const char *name) +{ +#if defined(DISPLAY_PDCADMA_TIMINGS) && defined(CONFIG_PROC_FS) + if (!pdcadma_proc) { + pdcadma_proc = 1; + bmide_dev = dev; + ide_pci_register_host_proc(&pdcadma_procs[0]); + } +#endif /* DISPLAY_PDCADMA_TIMINGS && CONFIG_PROC_FS */ + return 0; +} + +static void __init init_hwif_pdcadma (ide_hwif_t *hwif) +{ + hwif->autodma = 0; + hwif->dma_base = 0; + +// hwif->tuneproc = &pdcadma_tune_drive; +// hwif->speedproc = &pdcadma_tune_chipset; + +// if (hwif->dma_base) { +// hwif->autodma = 1; +// } + + hwif->udma_four = 1; +} + +static void __init init_dma_pdcadma (ide_hwif_t *hwif, unsigned long dmabase) +{ +#if 0 + ide_setup_dma(hwif, dmabase, 8); +#endif +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_pdcadma (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init pdcadma_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_PDC) + return 0; + + for (d = pdcadma_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/pdcadma.h linux.20pre5-ac2/drivers/ide/pci/pdcadma.h --- linux.20pre5/drivers/ide/pci/pdcadma.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/pdcadma.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,56 @@ +#ifndef PDC_ADMA_H +#define PDC_ADMA_H + +#include +#include +#include + +#undef DISPLAY_PDCADMA_TIMINGS + +#if defined(DISPLAY_PDCADMA_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 pdcadma_proc; + +static int pdcadma_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t pdcadma_procs[] __initdata = { + { + name: "pdcadma", + set: 1, + get_info: pdcadma_get_info, + parent: NULL, + }, +}; +#endif /* defined(DISPLAY_PDCADMA_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static void init_setup_pdcadma(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_pdcadma(struct pci_dev *, const char *); +static void init_hwif_pdcadma(ide_hwif_t *); +static void init_dma_pdcadma(ide_hwif_t *, unsigned long); + +static ide_pci_device_t pdcadma_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_PDC, + device: PCI_DEVICE_ID_PDC_1841, + name: "PDCADMA", + init_setup: init_setup_pdcadma, + init_chipset: init_chipset_pdcadma, + init_iops: NULL, + init_hwif: init_hwif_pdcadma, + init_dma: init_dma_pdcadma, + channels: 2, + autodma: NODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: OFF_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* PDC_ADMA_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/piix.c linux.20pre5-ac2/drivers/ide/pci/piix.c --- linux.20pre5/drivers/ide/pci/piix.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/piix.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,727 @@ +/* + * linux/drivers/ide/piix.c Version 0.40 August 18, 2002 + * + * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer + * Copyright (C) 1998-2000 Andre Hedrick + * May be copied or modified under the terms of the GNU General Public License + * + * PIO mode setting function for Intel chipsets. + * For use instead of BIOS settings. + * + * 40-41 + * 42-43 + * + * 41 + * 43 + * + * | PIO 0 | c0 | 80 | 0 | piix_tune_drive(drive, 0); + * | PIO 2 | SW2 | d0 | 90 | 4 | piix_tune_drive(drive, 2); + * | PIO 3 | MW1 | e1 | a1 | 9 | piix_tune_drive(drive, 3); + * | PIO 4 | MW2 | e3 | a3 | b | piix_tune_drive(drive, 4); + * + * sitre = word40 & 0x4000; primary + * sitre = word42 & 0x4000; secondary + * + * 44 8421|8421 hdd|hdb + * + * 48 8421 hdd|hdc|hdb|hda udma enabled + * + * 0001 hda + * 0010 hdb + * 0100 hdc + * 1000 hdd + * + * 4a 84|21 hdb|hda + * 4b 84|21 hdd|hdc + * + * ata-33/82371AB + * ata-33/82371EB + * ata-33/82801AB ata-66/82801AA + * 00|00 udma 0 00|00 reserved + * 01|01 udma 1 01|01 udma 3 + * 10|10 udma 2 10|10 udma 4 + * 11|11 reserved 11|11 reserved + * + * 54 8421|8421 ata66 drive|ata66 enable + * + * pci_read_config_word(HWIF(drive)->pci_dev, 0x40, ®40); + * pci_read_config_word(HWIF(drive)->pci_dev, 0x42, ®42); + * pci_read_config_word(HWIF(drive)->pci_dev, 0x44, ®44); + * pci_read_config_word(HWIF(drive)->pci_dev, 0x48, ®48); + * pci_read_config_word(HWIF(drive)->pci_dev, 0x4a, ®4a); + * pci_read_config_word(HWIF(drive)->pci_dev, 0x54, ®54); + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ide_modes.h" +#include "piix.h" + +static u8 piix_proc = 0; + +#if defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +/* + * FIXME: some systems have dual PIIX4 controllers, and we need + * to handle this properly in the /proc file. + */ +static struct pci_dev *bmide_dev; + +/** + * piix_get_info - fill in /proc for PIIX ide + * @buffer: buffer to fill + * @addr: address of user start in buffer + * @offset: offset into 'file' + * @count: buffer count + * + * Walks the PIIX devices and outputs summary data on the tuning and + * anything else that will help with debugging + */ + +static int piix_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + u32 bibma = pci_resource_start(bmide_dev, 4); + u16 reg40 = 0, psitre = 0, reg42 = 0, ssitre = 0; + u8 c0 = 0, c1 = 0; + u8 reg44 = 0, reg48 = 0, reg4a = 0, reg4b = 0, reg54 = 0, reg55 = 0; + + p += sprintf(p, "\n "); + switch(bmide_dev->device) { + case PCI_DEVICE_ID_INTEL_82801BA_8: + case PCI_DEVICE_ID_INTEL_82801BA_9: + case PCI_DEVICE_ID_INTEL_82801CA_10: + case PCI_DEVICE_ID_INTEL_82801CA_11: + case PCI_DEVICE_ID_INTEL_82801DB_11: + case PCI_DEVICE_ID_INTEL_82801E_11: + p += sprintf(p, "Intel PIIX4 Ultra 100 Chipset.\n"); + break; + case PCI_DEVICE_ID_INTEL_82372FB_1: + case PCI_DEVICE_ID_INTEL_82801AA_1: + p += sprintf(p, "Intel PIIX4 Ultra 66 Chipset.\n"); + break; + case PCI_DEVICE_ID_INTEL_82451NX: + case PCI_DEVICE_ID_INTEL_82801AB_1: + case PCI_DEVICE_ID_INTEL_82443MX_1: + case PCI_DEVICE_ID_INTEL_82371AB: + p += sprintf(p, "Intel PIIX4 Ultra 33 Chipset.\n"); + break; + case PCI_DEVICE_ID_INTEL_82371SB_1: + p += sprintf(p, "Intel PIIX3 Chipset.\n"); + break; + case PCI_DEVICE_ID_INTEL_82371MX: + p += sprintf(p, "Intel MPIIX Chipset.\n"); + return p-buffer; /* => must be less than 4k! */ + case PCI_DEVICE_ID_INTEL_82371FB_1: + case PCI_DEVICE_ID_INTEL_82371FB_0: + default: + p += sprintf(p, "Intel PIIX Chipset.\n"); + break; + } + + pci_read_config_word(bmide_dev, 0x40, ®40); + pci_read_config_word(bmide_dev, 0x42, ®42); + pci_read_config_byte(bmide_dev, 0x44, ®44); + pci_read_config_byte(bmide_dev, 0x48, ®48); + pci_read_config_byte(bmide_dev, 0x4a, ®4a); + pci_read_config_byte(bmide_dev, 0x4b, ®4b); + pci_read_config_byte(bmide_dev, 0x54, ®54); + pci_read_config_byte(bmide_dev, 0x55, ®55); + + psitre = (reg40 & 0x4000) ? 1 : 0; + ssitre = (reg42 & 0x4000) ? 1 : 0; + + /* + * at that point bibma+0x2 et bibma+0xa are byte registers + * to investigate: + */ + c0 = IN_BYTE((unsigned short)bibma + 0x02); + c1 = IN_BYTE((unsigned short)bibma + 0x0a); + + p += sprintf(p, "--------------- Primary Channel " + "---------------- Secondary Channel " + "-------------\n"); + p += sprintf(p, " %sabled " + " %sabled\n", + (c0&0x80) ? "dis" : " en", + (c1&0x80) ? "dis" : " en"); + p += sprintf(p, "--------------- drive0 --------- drive1 " + "-------- drive0 ---------- drive1 ------\n"); + p += sprintf(p, "DMA enabled: %s %s " + " %s %s\n", + (c0&0x20) ? "yes" : "no ", + (c0&0x40) ? "yes" : "no ", + (c1&0x20) ? "yes" : "no ", + (c1&0x40) ? "yes" : "no " ); + p += sprintf(p, "UDMA enabled: %s %s " + " %s %s\n", + (reg48&0x01) ? "yes" : "no ", + (reg48&0x02) ? "yes" : "no ", + (reg48&0x04) ? "yes" : "no ", + (reg48&0x08) ? "yes" : "no " ); + p += sprintf(p, "UDMA enabled: %s %s " + " %s %s\n", + ((reg54&0x11) && (reg55&0x10) && (reg4a&0x01)) ? "5" : + ((reg54&0x11) && (reg4a&0x02)) ? "4" : + ((reg54&0x11) && (reg4a&0x01)) ? "3" : + (reg4a&0x02) ? "2" : + (reg4a&0x01) ? "1" : + (reg4a&0x00) ? "0" : "X", + ((reg54&0x22) && (reg55&0x20) && (reg4a&0x10)) ? "5" : + ((reg54&0x22) && (reg4a&0x20)) ? "4" : + ((reg54&0x22) && (reg4a&0x10)) ? "3" : + (reg4a&0x20) ? "2" : + (reg4a&0x10) ? "1" : + (reg4a&0x00) ? "0" : "X", + ((reg54&0x44) && (reg55&0x40) && (reg4b&0x03)) ? "5" : + ((reg54&0x44) && (reg4b&0x02)) ? "4" : + ((reg54&0x44) && (reg4b&0x01)) ? "3" : + (reg4b&0x02) ? "2" : + (reg4b&0x01) ? "1" : + (reg4b&0x00) ? "0" : "X", + ((reg54&0x88) && (reg55&0x80) && (reg4b&0x30)) ? "5" : + ((reg54&0x88) && (reg4b&0x20)) ? "4" : + ((reg54&0x88) && (reg4b&0x10)) ? "3" : + (reg4b&0x20) ? "2" : + (reg4b&0x10) ? "1" : + (reg4b&0x00) ? "0" : "X"); + + p += sprintf(p, "UDMA\n"); + p += sprintf(p, "DMA\n"); + p += sprintf(p, "PIO\n"); + +/* + * FIXME.... Add configuration junk data....blah blah...... + */ + + return p-buffer; /* => must be less than 4k! */ +} +#endif /* defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS) */ + +/** + * piix_ratemask - compute rate mask for PIIX IDE + * @drive: IDE drive to compute for + * + * Returns the available modes for the PIIX IDE controller. + * FIXME: same bogus masking as the other drivers + */ + +static u8 piix_ratemask (ide_drive_t *drive) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + u8 mode; + + switch(dev->device) { + /* UDMA 100 capable */ + case PCI_DEVICE_ID_INTEL_82801BA_8: + case PCI_DEVICE_ID_INTEL_82801BA_9: + case PCI_DEVICE_ID_INTEL_82801CA_10: + case PCI_DEVICE_ID_INTEL_82801CA_11: + case PCI_DEVICE_ID_INTEL_82801E_11: + case PCI_DEVICE_ID_INTEL_82801DB_11: + mode = 3; + break; + /* UDMA 66 capable */ + case PCI_DEVICE_ID_INTEL_82801AA_1: + case PCI_DEVICE_ID_INTEL_82372FB_1: + mode = 2; + break; + /* UDMA 33 capable */ + case PCI_DEVICE_ID_INTEL_82371AB: + case PCI_DEVICE_ID_INTEL_82443MX_1: + case PCI_DEVICE_ID_INTEL_82451NX: + case PCI_DEVICE_ID_INTEL_82801AB_1: + return 1; + /* Non UDMA capable (MWDMA2) */ + case PCI_DEVICE_ID_INTEL_82371SB_1: + case PCI_DEVICE_ID_INTEL_82371FB_1: + case PCI_DEVICE_ID_INTEL_82371FB_0: + case PCI_DEVICE_ID_INTEL_82371MX: + default: + return 0; + } + + /* + * If we are UDMA66 capable fall back to UDMA33 + * if the drive cannot see an 80pin cable. + */ + if (!eighty_ninty_three(drive)) + mode = min(mode, (u8)1); + return mode; +} + +/** + * piix_ratefilter - find suitable rates for PIIX IDE + * @drive: drive to select IDE mode for + * @speed: desired speed + * + * Return a suitable speed equal or below the requested speed for + * the interface operation + */ + +static u8 piix_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + /* PIIX ratemask is between 0-3 right now but UDMA133 might + appear in future */ + return min(speed, speed_max[piix_ratemask(drive)]); +#else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +/** + * piix_dma_2_pio - return the PIO mode matching DMA + * @xfer_rate: transfer speed + * + * Returns the nearest equivalent PIO timing for the PIO or DMA + * mode requested by the controller. + */ + +static u8 piix_dma_2_pio (u8 xfer_rate) { + switch(xfer_rate) { + case XFER_UDMA_5: + case XFER_UDMA_4: + case XFER_UDMA_3: + case XFER_UDMA_2: + case XFER_UDMA_1: + case XFER_UDMA_0: + case XFER_MW_DMA_2: + case XFER_PIO_4: + return 4; + case XFER_MW_DMA_1: + case XFER_PIO_3: + return 3; + case XFER_SW_DMA_2: + case XFER_PIO_2: + return 2; + case XFER_MW_DMA_0: + case XFER_SW_DMA_1: + case XFER_SW_DMA_0: + case XFER_PIO_1: + case XFER_PIO_0: + case XFER_PIO_SLOW: + default: + return 0; + } +} + +/** + * piix_tune_drive - tune a drive attached to a PIIX + * @drive: drive to tune + * @pio: desired PIO mode + * + * Set the interface PIO mode based upon the settings done by AMI BIOS + * (might be useful if drive is not registered in CMOS for any reason). + */ +static void piix_tune_drive (ide_drive_t *drive, u8 pio) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + int is_slave = (&hwif->drives[1] == drive); + int master_port = hwif->channel ? 0x42 : 0x40; + int slave_port = 0x44; + unsigned long flags; + u16 master_data; + u8 slave_data; + /* ISP RTC */ + u8 timings[][2] = { { 0, 0 }, + { 0, 0 }, + { 1, 0 }, + { 2, 1 }, + { 2, 3 }, }; + + pio = ide_get_best_pio_mode(drive, pio, 5, NULL); + spin_lock_irqsave(&io_request_lock, flags); + pci_read_config_word(dev, master_port, &master_data); + if (is_slave) { + master_data = master_data | 0x4000; + if (pio > 1) + /* enable PPE, IE and TIME */ + master_data = master_data | 0x0070; + pci_read_config_byte(dev, slave_port, &slave_data); + slave_data = slave_data & (hwif->channel ? 0x0f : 0xf0); + slave_data = slave_data | (((timings[pio][0] << 2) | timings[pio][1]) << (hwif->channel ? 4 : 0)); + } else { + master_data = master_data & 0xccf8; + if (pio > 1) + /* enable PPE, IE and TIME */ + master_data = master_data | 0x0007; + master_data = master_data | (timings[pio][0] << 12) | (timings[pio][1] << 8); + } + pci_write_config_word(dev, master_port, master_data); + if (is_slave) + pci_write_config_byte(dev, slave_port, slave_data); + spin_unlock_irqrestore(&io_request_lock, flags); +} + +/** + * piix_tune_chipset - tune a PIIX interface + * @drive: IDE drive to tune + * @xferspeed: speed to configure + * + * Set a PIIX interface channel to the desired speeds. This involves + * requires the right timing data into the PIIX configuration space + * then setting the drive parameters appropriately + */ + +static int piix_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 maslave = hwif->channel ? 0x42 : 0x40; + u8 speed = piix_ratefilter(drive, xferspeed); + int a_speed = 3 << (drive->dn * 4); + int u_flag = 1 << drive->dn; + int v_flag = 0x01 << drive->dn; + int w_flag = 0x10 << drive->dn; + int u_speed = 0; + int sitre; + u16 reg4042, reg44, reg48, reg4a, reg54; + u8 reg55; + + pci_read_config_word(dev, maslave, ®4042); + sitre = (reg4042 & 0x4000) ? 1 : 0; + pci_read_config_word(dev, 0x44, ®44); + pci_read_config_word(dev, 0x48, ®48); + pci_read_config_word(dev, 0x4a, ®4a); + pci_read_config_word(dev, 0x54, ®54); + pci_read_config_byte(dev, 0x55, ®55); + + switch(speed) { +#ifdef CONFIG_BLK_DEV_IDEDMA + case XFER_UDMA_4: + case XFER_UDMA_2: u_speed = 2 << (drive->dn * 4); break; + case XFER_UDMA_5: + case XFER_UDMA_3: + case XFER_UDMA_1: u_speed = 1 << (drive->dn * 4); break; + case XFER_UDMA_0: u_speed = 0 << (drive->dn * 4); break; + case XFER_MW_DMA_2: + case XFER_MW_DMA_1: + case XFER_SW_DMA_2: break; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + case XFER_PIO_4: + case XFER_PIO_3: + case XFER_PIO_2: + case XFER_PIO_0: break; + default: return -1; + } + + if (speed >= XFER_UDMA_0) { + if (!(reg48 & u_flag)) + pci_write_config_word(dev, 0x48, reg48|u_flag); + if (speed == XFER_UDMA_5) { + pci_write_config_byte(dev, 0x55, (u8) reg55|w_flag); + } else { + pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); + } + if (!(reg4a & u_speed)) { + pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); + pci_write_config_word(dev, 0x4a, reg4a|u_speed); + } + if (speed > XFER_UDMA_2) { + if (!(reg54 & v_flag)) { + pci_write_config_word(dev, 0x54, reg54|v_flag); + } + } else { + pci_write_config_word(dev, 0x54, reg54 & ~v_flag); + } + } else { + if (reg48 & u_flag) + pci_write_config_word(dev, 0x48, reg48 & ~u_flag); + if (reg4a & a_speed) + pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); + if (reg54 & v_flag) + pci_write_config_word(dev, 0x54, reg54 & ~v_flag); + if (reg55 & w_flag) + pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); + } + + piix_tune_drive(drive, piix_dma_2_pio(speed)); + return (ide_config_drive_speed(drive, speed)); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA + +/** + * piix_config_drive_for_dma - configure drive for DMA + * @drive: IDE drive to configure + * + * Set up a PIIX interface channel for the best available speed. + * We prefer UDMA if it is available and then MWDMA. If DMA is + * not available we switch to PIO and return 0. + */ + +static int piix_config_drive_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + u8 mode = piix_ratemask(drive); + u8 speed = 0, tspeed = 0; + + switch(mode) { + case 0x03: + if (id->dma_ultra & 0x0040) + { speed = XFER_UDMA_5; break; } + if (id->dma_ultra & 0x0020) + { speed = XFER_UDMA_5; break; } + case 0x02: + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_4; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_3; break; } + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_1word & 0x0004) + { speed = XFER_SW_DMA_2; break; } + default: + tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL); + speed = piix_dma_2_pio(XFER_PIO_0 + tspeed); + break; + } + + (void) piix_tune_chipset(drive, speed); + + return ((int) ((((id->dma_ultra >> 8) & 0x3F) || + ((id->dma_mword >> 8) & 0x06) || + ((id->dma_1word >> 8) & 0x04)) ? 1 : 0)); +} + +/** + * piix_config_drive_xfer_rate - set up an IDE device + * @drive: IDE drive to configure + * + * Set up the PIIX interface for the best available speed on this + * interface, preferring DMA to PIO. + */ + +static int piix_config_drive_xfer_rate (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + drive->init_speed = 0; + + if (id && (id->capability & 1) && HWIF(drive)->autodma) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + if (id->field_valid & 4) { + if (id->dma_ultra & 0x003F) { + /* Force if Capable UltraDMA */ + int dma = piix_config_drive_for_dma(drive); + if ((id->field_valid & 2) && !dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + (id->dma_1word & 0x0007)) { + /* Force if Capable regular DMA modes */ + if (!piix_config_drive_for_dma(drive)) + goto no_dma_set; + } + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!piix_config_drive_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + piix_tune_drive(drive, 255); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +/** + * init_chipset_piix - set up the PIIX chipset + * @dev: PCI device to set up + * @name: Name of the device + * + * Initialize the PCI device as required. For the PIIX this turns + * out to be nice and simple + */ + +static unsigned int __init init_chipset_piix (struct pci_dev *dev, const char *name) +{ + switch(dev->device) { + case PCI_DEVICE_ID_INTEL_82801AA_1: + case PCI_DEVICE_ID_INTEL_82801AB_1: + case PCI_DEVICE_ID_INTEL_82801BA_8: + case PCI_DEVICE_ID_INTEL_82801BA_9: + case PCI_DEVICE_ID_INTEL_82801CA_10: + case PCI_DEVICE_ID_INTEL_82801CA_11: + case PCI_DEVICE_ID_INTEL_82801DB_11: + case PCI_DEVICE_ID_INTEL_82801E_11: + { + unsigned int extra = 0; + pci_read_config_dword(dev, 0x54, &extra); + pci_write_config_dword(dev, 0x54, extra|0x400); + } + default: + break; + } + +#if defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS) + if (!piix_proc) { + piix_proc = 1; + bmide_dev = dev; + ide_pci_register_host_proc(&piix_procs[0]); + } +#endif /* DISPLAY_PIIX_TIMINGS && CONFIG_PROC_FS */ + return 0; +} + +/** + * init_hwif_piix - fill in the hwif for the PIIX + * @hwif: IDE interface + * + * Set up the ide_hwif_t for the PIIX interface according to the + * capabilities of the hardware. + */ + +static void __init init_hwif_piix (ide_hwif_t *hwif) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + u8 reg54h = 0, reg55h = 0, ata66 = 0; + u8 mask = hwif->channel ? 0xc0 : 0x30; +#endif /* !CONFIG_BLK_DEV_IDEDMA */ + +#ifndef CONFIG_IA64 + if (!hwif->irq) + hwif->irq = hwif->channel ? 15 : 14; +#endif /* CONFIG_IA64 */ + + if (hwif->pci_dev->device == PCI_DEVICE_ID_INTEL_82371MX) { + /* This is a painful system best to let it self tune for now */ + return; + } + + hwif->autodma = 0; + hwif->tuneproc = &piix_tune_drive; + hwif->speedproc = &piix_tune_chipset; + hwif->ratemask = &piix_ratemask; + hwif->ratefilter = &piix_ratefilter; + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + switch(hwif->pci_dev->device) { + case PCI_DEVICE_ID_INTEL_82371AB: + case PCI_DEVICE_ID_INTEL_82443MX_1: + case PCI_DEVICE_ID_INTEL_82451NX: + case PCI_DEVICE_ID_INTEL_82801AB_1: + case PCI_DEVICE_ID_INTEL_82371SB_1: + case PCI_DEVICE_ID_INTEL_82371FB_1: + case PCI_DEVICE_ID_INTEL_82371FB_0: + case PCI_DEVICE_ID_INTEL_82371MX: + break; + default: + pci_read_config_byte(hwif->pci_dev, 0x54, ®54h); + pci_read_config_byte(hwif->pci_dev, 0x55, ®55h); + ata66 = (reg54h & mask) ? 1 : 0; + break; + } + + if (!(hwif->udma_four)) + hwif->udma_four = ata66; + hwif->ide_dma_check = &piix_config_drive_xfer_rate; + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* !CONFIG_BLK_DEV_IDEDMA */ +} + +/** + * init_dma_piix - set up the PIIX DMA + * @hwif: IDE interface + * @dmabase: DMA PCI base + * + * Set up the DMA on the PIIX controller, providing a DMA base is + * available. The PIIX follows the normal specs so we do nothing + * magical here. + */ + +static void __init init_dma_piix (ide_hwif_t *hwif, unsigned long dmabase) +{ + if (dmabase) + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +/** + * init_setup_piix - callback for IDE initialize + * @dev: PIIX PCI device + * @d: IDE pci info + * + * Enable the xp fixup for the PIIX controller and then perform + * a standard ide PCI setup + */ + +static void __init init_setup_piix (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +/** + * piix_scan_pcidev - Check for and initialize PIIX IDE + * @dev: PCI device to check + * + * Checks if the passed device is an Intel PIIX device. If so the + * hardware is initialized and we return 1 to claim the device. If not + * we return 0. + */ + +int __init piix_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_INTEL) + return 0; + + for (d = piix_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/piix.h linux.20pre5-ac2/drivers/ide/pci/piix.h --- linux.20pre5/drivers/ide/pci/piix.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/piix.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,269 @@ +#ifndef PIIX_H +#define PIIX_H + +#include +#include +#include + +#define PIIX_DEBUG_DRIVE_INFO 0 + +#define DISPLAY_PIIX_TIMINGS + +#if defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 piix_proc; + +static int piix_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t piix_procs[] __initdata = { + { + name: "piix", + set: 1, + get_info: piix_get_info, + parent: NULL, + }, +}; +#endif /* defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static void init_setup_piix(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_piix(struct pci_dev *, const char *); +static void init_hwif_piix(ide_hwif_t *); +static void init_dma_piix(ide_hwif_t *, unsigned long); + +static ide_pci_device_t piix_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82371FB_0, + name: "PIIXa", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82371FB_1, + name: "PIIXb", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82371MX, + name: "MPIIX", + init_setup: init_setup_piix, + init_chipset: NULL, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: NULL, + channels: 2, + autodma: NODMA, + enablebits: {{0x6D,0x80,0x80}, {0x6F,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82371SB_1, + name: "PIIX3", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82371AB, + name: "PIIX4", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82801AB_1, + name: "ICH0", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82443MX_1, + name: "PIIX4", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82801AA_1, + name: "ICH", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82372FB_1, + name: "PIIX4", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82451NX, + name: "PIIX4", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: NOAUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82801BA_9, + name: "ICH2", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82801BA_8, + name: "ICH2M", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82801CA_10, + name: "ICH3M", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82801CA_11, + name: "ICH3", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82801DB_11, + name: "ICH4", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_INTEL, + device: PCI_DEVICE_ID_INTEL_82801E_11, + name: "C-ICH", + init_setup: init_setup_piix, + init_chipset: init_chipset_piix, + init_iops: NULL, + init_hwif: init_hwif_piix, + init_dma: init_dma_piix, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + init_setup: NULL, + bootable: EOL, + } +}; + +#endif /* PIIX_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/rz1000.c linux.20pre5-ac2/drivers/ide/pci/rz1000.c --- linux.20pre5/drivers/ide/pci/rz1000.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/rz1000.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,80 @@ +/* + * linux/drivers/ide/rz1000.c Version 0.05 December 8, 1997 + * + * Copyright (C) 1995-1998 Linus Torvalds & author (see below) + */ + +/* + * Principal Author: mlord@pobox.com (Mark Lord) + * + * See linux/MAINTAINERS for address of current maintainer. + * + * This file provides support for disabling the buggy read-ahead + * mode of the RZ1000 IDE chipset, commonly used on Intel motherboards. + * + * Dunno if this fixes both ports, or only the primary port (?). + */ + +#undef REALLY_SLOW_IO /* most systems can safely undef this */ + +#include /* for CONFIG_BLK_DEV_IDEPCI */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "rz1000.h" + +static void __init init_hwif_rz1000 (ide_hwif_t *hwif) +{ + u16 reg; + struct pci_dev *dev = hwif->pci_dev; + + hwif->chipset = ide_rz1000; + if (!pci_read_config_word (dev, 0x40, ®) && + !pci_write_config_word(dev, 0x40, reg & 0xdfff)) { + printk("%s: disabled chipset read-ahead " + "(buggy RZ1000/RZ1001)\n", hwif->name); + } else { + hwif->serialized = 1; + hwif->drives[0].no_unmask = 1; + hwif->drives[1].no_unmask = 1; + printk("%s: serialized, disabled unmasking " + "(buggy RZ1000/RZ1001)\n", hwif->name); + } +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_rz1000 (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init rz1000_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_PCTECH) + return 0; + + for (d = rz1000_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/rz1000.h linux.20pre5-ac2/drivers/ide/pci/rz1000.h --- linux.20pre5/drivers/ide/pci/rz1000.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/rz1000.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,48 @@ +#ifndef RZ100X_H +#define RZ100X_H + +#include +#include +#include + +static void init_setup_rz1000(struct pci_dev *, ide_pci_device_t *); +static void init_hwif_rz1000(ide_hwif_t *); + +static ide_pci_device_t rz1000_chipsets[] __initdata = { +{ + vendor: PCI_VENDOR_ID_PCTECH, + device: PCI_DEVICE_ID_PCTECH_RZ1000, + name: "RZ1000", + init_setup: init_setup_rz1000, + init_chipset: NULL, + init_iops: NULL, + init_hwif: init_hwif_rz1000, + init_dma: NULL, + channels: 2, + autodma: NODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_PCTECH, + device: PCI_DEVICE_ID_PCTECH_RZ1001, + name: "RZ1001", + init_setup: init_setup_rz1000, + init_chipset: NULL, + init_iops: NULL, + init_hwif: init_hwif_rz1000, + init_dma: NULL, + channels: 2, + autodma: NODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* RZ100X_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/serverworks.c linux.20pre5-ac2/drivers/ide/pci/serverworks.c --- linux.20pre5/drivers/ide/pci/serverworks.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/serverworks.c 2002-09-01 18:02:39.000000000 +0100 @@ -0,0 +1,834 @@ +/* + * linux/drivers/ide/serverworks.c Version 0.6 05 April 2002 + * + * Copyright (C) 1998-2000 Michel Aubry + * Copyright (C) 1998-2000 Andrzej Krzysztofowicz + * Copyright (C) 1998-2000 Andre Hedrick + * Portions copyright (c) 2001 Sun Microsystems + * + * + * RCC/ServerWorks IDE driver for Linux + * + * OSB4: `Open South Bridge' IDE Interface (fn 1) + * supports UDMA mode 2 (33 MB/s) + * + * CSB5: `Champion South Bridge' IDE Interface (fn 1) + * all revisions support UDMA mode 4 (66 MB/s) + * revision A2.0 and up support UDMA mode 5 (100 MB/s) + * + * *** The CSB5 does not provide ANY register *** + * *** to detect 80-conductor cable presence. *** + * + * CSB6: `Champion South Bridge' IDE Interface (optional: third channel) + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ide_modes.h" +#include "serverworks.h" + +static u8 svwks_revision = 0; +static struct pci_dev *isa_dev; + +#if defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 svwks_proc = 0; +#define SVWKS_MAX_DEVS 2 +static struct pci_dev *svwks_devs[SVWKS_MAX_DEVS]; +static int n_svwks_devs; + +static int svwks_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + int i; + + p += sprintf(p, "\n " + "ServerWorks OSB4/CSB5/CSB6\n"); + + for (i = 0; i < n_svwks_devs; i++) { + struct pci_dev *dev = svwks_devs[i]; + u32 bibma = pci_resource_start(dev, 4); + u32 reg40, reg44; + u16 reg48, reg56; + u8 reg54, c0=0, c1=0; + + pci_read_config_dword(dev, 0x40, ®40); + pci_read_config_dword(dev, 0x44, ®44); + pci_read_config_word(dev, 0x48, ®48); + pci_read_config_byte(dev, 0x54, ®54); + pci_read_config_word(dev, 0x56, ®56); + + /* + * at that point bibma+0x2 et bibma+0xa are byte registers + * to investigate: + */ + c0 = inb_p((unsigned short)bibma + 0x02); + c1 = inb_p((unsigned short)bibma + 0x0a); + + p += sprintf(p, "\n ServerWorks "); + switch(dev->device) { + case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2: + case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE: + p += sprintf(p, "CSB6 "); + break; + case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: + p += sprintf(p, "CSB5 "); + break; + case PCI_DEVICE_ID_SERVERWORKS_OSB4IDE: + p += sprintf(p, "OSB4 "); + break; + default: + p += sprintf(p, "%04x ", dev->device); + break; + } + p += sprintf(p, "Chipset (rev %02x)\n", svwks_revision); + + p += sprintf(p, "------------------------------- " + "General Status " + "---------------------------------\n"); + p += sprintf(p, "--------------- Primary Channel " + "---------------- Secondary Channel " + "-------------\n"); + p += sprintf(p, " %sabled" + " %sabled\n", + (c0&0x80) ? "dis" : " en", + (c1&0x80) ? "dis" : " en"); + p += sprintf(p, "--------------- drive0 --------- drive1 " + "-------- drive0 ---------- drive1 ------\n"); + p += sprintf(p, "DMA enabled: %s %s" + " %s %s\n", + (c0&0x20) ? "yes" : "no ", + (c0&0x40) ? "yes" : "no ", + (c1&0x20) ? "yes" : "no ", + (c1&0x40) ? "yes" : "no " ); + p += sprintf(p, "UDMA enabled: %s %s" + " %s %s\n", + (reg54 & 0x01) ? "yes" : "no ", + (reg54 & 0x02) ? "yes" : "no ", + (reg54 & 0x04) ? "yes" : "no ", + (reg54 & 0x08) ? "yes" : "no " ); + p += sprintf(p, "UDMA enabled: %s %s" + " %s %s\n", + ((reg56&0x0005)==0x0005)?"5": + ((reg56&0x0004)==0x0004)?"4": + ((reg56&0x0003)==0x0003)?"3": + ((reg56&0x0002)==0x0002)?"2": + ((reg56&0x0001)==0x0001)?"1": + ((reg56&0x000F))?"?":"0", + ((reg56&0x0050)==0x0050)?"5": + ((reg56&0x0040)==0x0040)?"4": + ((reg56&0x0030)==0x0030)?"3": + ((reg56&0x0020)==0x0020)?"2": + ((reg56&0x0010)==0x0010)?"1": + ((reg56&0x00F0))?"?":"0", + ((reg56&0x0500)==0x0500)?"5": + ((reg56&0x0400)==0x0400)?"4": + ((reg56&0x0300)==0x0300)?"3": + ((reg56&0x0200)==0x0200)?"2": + ((reg56&0x0100)==0x0100)?"1": + ((reg56&0x0F00))?"?":"0", + ((reg56&0x5000)==0x5000)?"5": + ((reg56&0x4000)==0x4000)?"4": + ((reg56&0x3000)==0x3000)?"3": + ((reg56&0x2000)==0x2000)?"2": + ((reg56&0x1000)==0x1000)?"1": + ((reg56&0xF000))?"?":"0"); + p += sprintf(p, "DMA enabled: %s %s" + " %s %s\n", + ((reg44&0x00002000)==0x00002000)?"2": + ((reg44&0x00002100)==0x00002100)?"1": + ((reg44&0x00007700)==0x00007700)?"0": + ((reg44&0x0000FF00)==0x0000FF00)?"X":"?", + ((reg44&0x00000020)==0x00000020)?"2": + ((reg44&0x00000021)==0x00000021)?"1": + ((reg44&0x00000077)==0x00000077)?"0": + ((reg44&0x000000FF)==0x000000FF)?"X":"?", + ((reg44&0x20000000)==0x20000000)?"2": + ((reg44&0x21000000)==0x21000000)?"1": + ((reg44&0x77000000)==0x77000000)?"0": + ((reg44&0xFF000000)==0xFF000000)?"X":"?", + ((reg44&0x00200000)==0x00200000)?"2": + ((reg44&0x00210000)==0x00210000)?"1": + ((reg44&0x00770000)==0x00770000)?"0": + ((reg44&0x00FF0000)==0x00FF0000)?"X":"?"); + + p += sprintf(p, "PIO enabled: %s %s" + " %s %s\n", + ((reg40&0x00002000)==0x00002000)?"4": + ((reg40&0x00002200)==0x00002200)?"3": + ((reg40&0x00003400)==0x00003400)?"2": + ((reg40&0x00004700)==0x00004700)?"1": + ((reg40&0x00005D00)==0x00005D00)?"0":"?", + ((reg40&0x00000020)==0x00000020)?"4": + ((reg40&0x00000022)==0x00000022)?"3": + ((reg40&0x00000034)==0x00000034)?"2": + ((reg40&0x00000047)==0x00000047)?"1": + ((reg40&0x0000005D)==0x0000005D)?"0":"?", + ((reg40&0x20000000)==0x20000000)?"4": + ((reg40&0x22000000)==0x22000000)?"3": + ((reg40&0x34000000)==0x34000000)?"2": + ((reg40&0x47000000)==0x47000000)?"1": + ((reg40&0x5D000000)==0x5D000000)?"0":"?", + ((reg40&0x00200000)==0x00200000)?"4": + ((reg40&0x00220000)==0x00220000)?"3": + ((reg40&0x00340000)==0x00340000)?"2": + ((reg40&0x00470000)==0x00470000)?"1": + ((reg40&0x005D0000)==0x005D0000)?"0":"?"); + + } + p += sprintf(p, "\n"); + + return p-buffer; /* => must be less than 4k! */ +} +#endif /* defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static u8 svwks_ratemask (ide_drive_t *drive) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + u8 mode; + + if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { + u32 reg = 0; + if (isa_dev) + pci_read_config_dword(isa_dev, 0x64, ®); + + /* + * Don't enable UDMA on disk devices for the moment + */ + if(drive->media == ide_disk) + return 0; + /* Check the OSB4 DMA33 enable bit */ + return ((reg & 0x00004000) == 0x00004000) ? 1 : 0; + } else if (svwks_revision < SVWKS_CSB5_REVISION_NEW) { + return 1; + } else if (svwks_revision >= SVWKS_CSB5_REVISION_NEW) { + u8 btr = 0; + pci_read_config_byte(dev, 0x5A, &btr); + mode = btr; + if (!eighty_ninty_three(drive)) + mode = min(mode, (u8)1); + } + if (((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) || + (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) && + (!(PCI_FUNC(dev->devfn) & 1))) + mode = 2; + return mode; +} + +static u8 svwks_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + /* ServerWorks's ratemask is between 0-3 and capped at UDMA100 */ + return min(speed, speed_max[svwks_ratemask(drive)]); +#else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static u8 svwks_csb_check (struct pci_dev *dev) +{ + switch (dev->device) { + case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: + case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE: + case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2: + return 1; + default: + break; + } + return 0; +} +static int svwks_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + u8 udma_modes[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 }; + u8 dma_modes[] = { 0x77, 0x21, 0x20 }; + u8 pio_modes[] = { 0x5d, 0x47, 0x34, 0x22, 0x20 }; + u8 drive_pci[] = { 0x41, 0x40, 0x43, 0x42 }; + u8 drive_pci2[] = { 0x45, 0x44, 0x47, 0x46 }; + + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 speed = svwks_ratefilter(drive, xferspeed); + u8 pio = ide_get_best_pio_mode(drive, 255, 5, NULL); + u8 unit = (drive->select.b.unit & 0x01); + u8 csb5 = svwks_csb_check(dev); + u8 ultra_enable = 0, ultra_timing = 0; + u8 dma_timing = 0, pio_timing = 0; + u16 csb5_pio = 0; + + pci_read_config_byte(dev, drive_pci[drive->dn], &pio_timing); + pci_read_config_byte(dev, drive_pci2[drive->dn], &dma_timing); + pci_read_config_byte(dev, (0x56|hwif->channel), &ultra_timing); + pci_read_config_word(dev, 0x4A, &csb5_pio); + pci_read_config_byte(dev, 0x54, &ultra_enable); + + /* Per Specified Design by OEM, and ASIC Architect */ + if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) || + (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) { + if (!drive->init_speed) { + u8 dma_stat = hwif->INB(hwif->dma_status); + +dma_pio: + if (((ultra_enable << (7-drive->dn) & 0x80) == 0x80) && + ((dma_stat & (1<<(5+unit))) == (1<<(5+unit)))) { + drive->current_speed = drive->init_speed = XFER_UDMA_0 + udma_modes[(ultra_timing >> (4*unit)) & ~(0xF0)]; + return 0; + } else if ((dma_timing) && + ((dma_stat&(1<<(5+unit)))==(1<<(5+unit)))) { + u8 dmaspeed = dma_timing; + + dma_timing &= ~0xFF; + if ((dmaspeed & 0x20) == 0x20) + dmaspeed = XFER_MW_DMA_2; + else if ((dmaspeed & 0x21) == 0x21) + dmaspeed = XFER_MW_DMA_1; + else if ((dmaspeed & 0x77) == 0x77) + dmaspeed = XFER_MW_DMA_0; + else + goto dma_pio; + drive->current_speed = drive->init_speed = dmaspeed; + return 0; + } else if (pio_timing) { + u8 piospeed = pio_timing; + + pio_timing &= ~0xFF; + if ((piospeed & 0x20) == 0x20) + piospeed = XFER_PIO_4; + else if ((piospeed & 0x22) == 0x22) + piospeed = XFER_PIO_3; + else if ((piospeed & 0x34) == 0x34) + piospeed = XFER_PIO_2; + else if ((piospeed & 0x47) == 0x47) + piospeed = XFER_PIO_1; + else if ((piospeed & 0x5d) == 0x5d) + piospeed = XFER_PIO_0; + else + goto oem_setup_failed; + drive->current_speed = drive->init_speed = piospeed; + return 0; + } + } + } + +oem_setup_failed: + + pio_timing &= ~0xFF; + dma_timing &= ~0xFF; + ultra_timing &= ~(0x0F << (4*unit)); + ultra_enable &= ~(0x01 << drive->dn); + csb5_pio &= ~(0x0F << (4*drive->dn)); + + switch(speed) { + case XFER_PIO_4: + case XFER_PIO_3: + case XFER_PIO_2: + case XFER_PIO_1: + case XFER_PIO_0: + pio_timing |= pio_modes[speed - XFER_PIO_0]; + csb5_pio |= ((speed - XFER_PIO_0) << (4*drive->dn)); + break; + +#ifdef CONFIG_BLK_DEV_IDEDMA + case XFER_MW_DMA_2: + case XFER_MW_DMA_1: + case XFER_MW_DMA_0: + pio_timing |= pio_modes[pio]; + csb5_pio |= (pio << (4*drive->dn)); + dma_timing |= dma_modes[speed - XFER_MW_DMA_0]; + break; + + case XFER_UDMA_5: + case XFER_UDMA_4: + case XFER_UDMA_3: + case XFER_UDMA_2: + case XFER_UDMA_1: + case XFER_UDMA_0: + pio_timing |= pio_modes[pio]; + csb5_pio |= (pio << (4*drive->dn)); + dma_timing |= dma_modes[2]; + ultra_timing |= ((udma_modes[speed - XFER_UDMA_0]) << (4*unit)); + ultra_enable |= (0x01 << drive->dn); +#endif + default: + break; + } + + pci_write_config_byte(dev, drive_pci[drive->dn], pio_timing); + if (csb5) + pci_write_config_word(dev, 0x4A, csb5_pio); + +#ifdef CONFIG_BLK_DEV_IDEDMA + pci_write_config_byte(dev, drive_pci2[drive->dn], dma_timing); + pci_write_config_byte(dev, (0x56|hwif->channel), ultra_timing); + pci_write_config_byte(dev, 0x54, ultra_enable); +#endif /* CONFIG_BLK_DEV_IDEDMA */ + + return (ide_config_drive_speed(drive, speed)); +} + +static void config_chipset_for_pio (ide_drive_t *drive) +{ + u16 eide_pio_timing[6] = {960, 480, 240, 180, 120, 90}; + u16 xfer_pio = drive->id->eide_pio_modes; + u8 timing, speed, pio; + + pio = ide_get_best_pio_mode(drive, 255, 5, NULL); + + if (xfer_pio > 4) + xfer_pio = 0; + + if (drive->id->eide_pio_iordy > 0) + for (xfer_pio = 5; + xfer_pio>0 && + drive->id->eide_pio_iordy>eide_pio_timing[xfer_pio]; + xfer_pio--); + else + xfer_pio = (drive->id->eide_pio_modes & 4) ? 0x05 : + (drive->id->eide_pio_modes & 2) ? 0x04 : + (drive->id->eide_pio_modes & 1) ? 0x03 : + (drive->id->tPIO & 2) ? 0x02 : + (drive->id->tPIO & 1) ? 0x01 : xfer_pio; + + timing = (xfer_pio >= pio) ? xfer_pio : pio; + + switch(timing) { + case 4: speed = XFER_PIO_4;break; + case 3: speed = XFER_PIO_3;break; + case 2: speed = XFER_PIO_2;break; + case 1: speed = XFER_PIO_1;break; + default: + speed = (!drive->id->tPIO) ? XFER_PIO_0 : XFER_PIO_SLOW; + break; + } + (void) svwks_tune_chipset(drive, speed); + drive->current_speed = speed; +} + +static void svwks_tune_drive (ide_drive_t *drive, u8 pio) +{ + (void) svwks_tune_chipset(drive, (XFER_PIO_0 + pio)); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +#undef CAN_SW_DMA +static int config_chipset_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + u8 speed = 0, mode = svwks_ratemask(drive); + + if (HWIF(drive)->pci_dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) + mode = 0x05; + + switch(mode) { + case 0x04: + if (id->dma_ultra & 0x0040) + { speed = XFER_UDMA_6; break; } + case 0x03: + if (id->dma_ultra & 0x0020) + { speed = XFER_UDMA_5; break; } + case 0x02: + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_4; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_3; break; } + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x05: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_mword & 0x0001) + { speed = XFER_MW_DMA_0; break; } +#ifdef CAN_SW_DMA + if (id->dma_1word & 0x0004) + { speed = XFER_SW_DMA_2; break; } + if (id->dma_1word & 0x0002) + { speed = XFER_SW_DMA_1; break; } + if (id->dma_1word & 0x0001) + { speed = XFER_SW_DMA_0; break; } +#endif /* CAN_SW_DMA */ + default: + speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL); + break; + } + + (void) svwks_tune_chipset(drive, speed); + return ((int) ((((id->dma_ultra >> 8) & 0x3F) || +#ifdef CAN_SW_DMA + ((id->dma_mword >> 8) & 0x07) || + ((id->dma_1word >> 8) & 0x07)) ? 1 : 0)); +#else /* !CAN_SW_DMA */ + ((id->dma_mword >> 8) & 0x07)) ? 1 : 0)); +#endif /* CAN_SW_DMA */ +} + +static int svwks_config_drive_xfer_rate (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + drive->init_speed = 0; + + if (id && (id->capability & 1) && drive->autodma) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + if (id->field_valid & 4) { + if (id->dma_ultra & 0x003F) { + /* Force if Capable UltraDMA */ + int dma = config_chipset_for_dma(drive); + if ((id->field_valid & 2) && !dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + (id->dma_1word & 0x0007)) { + /* Force if Capable regular DMA modes */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } else { + goto no_dma_set; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + config_chipset_for_pio(drive); + // HWIF(drive)->tuneproc(drive, 5); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} + +static int svwks_ide_dma_end (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 dma_stat = hwif->INB(hwif->dma_status); + + if ((dma_stat & 1) && drive->media == ide_disk) + { + printk(KERN_CRIT "Serverworks OSB4 in impossible state.\n"); + printk(KERN_CRIT "Disable UDMA or if you are using Seagate then try switching disk types\n"); + printk(KERN_CRIT "on this controller. Please report this event to osb4-bug@ide.cabal.tm\n"); + /* Panic might sys_sync -> death by corrupt disk */ + printk(KERN_CRIT "OSB4: continuing might cause disk corruption.\n"); + while(1) + cpu_relax(); + } + return __ide_dma_end(drive); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +static unsigned int __init init_chipset_svwks (struct pci_dev *dev, const char *name) +{ + unsigned int reg; + u8 btr; + + /* save revision id to determine DMA capability */ + pci_read_config_byte(dev, PCI_REVISION_ID, &svwks_revision); + + /* force Master Latency Timer value to 64 PCICLKs */ + pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x40); + + /* OSB4 : South Bridge and IDE */ + if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { + isa_dev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS, + PCI_DEVICE_ID_SERVERWORKS_OSB4, NULL); + if (isa_dev) { + pci_read_config_dword(isa_dev, 0x64, ®); + reg &= ~0x00002000; /* disable 600ns interrupt mask */ + if(!(reg & 0x00004000)) + printk(KERN_DEBUG "%s: UDMA not BIOS enabled.\n", name); + reg |= 0x00004000; /* enable UDMA/33 support */ + pci_write_config_dword(isa_dev, 0x64, reg); + } + } + + /* setup CSB5/CSB6 : South Bridge and IDE option RAID */ + else if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) || + (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) || + (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) { +// u32 pioreg = 0, dmareg = 0; + + /* Third Channel Test */ + if (!(PCI_FUNC(dev->devfn) & 1)) { +#if 1 + struct pci_dev * findev = NULL; + u32 reg4c = 0; + findev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS, + PCI_DEVICE_ID_SERVERWORKS_CSB5, NULL); + if (findev) { + pci_read_config_dword(findev, 0x4C, ®4c); + reg4c &= ~0x000007FF; + reg4c |= 0x00000040; + reg4c |= 0x00000020; + pci_write_config_dword(findev, 0x4C, reg4c); + } +#endif + outb_p(0x06, 0x0c00); + dev->irq = inb_p(0x0c01); +#if 0 + /* WE need to figure out how to get the correct one */ + printk("%s: interrupt %d\n", name, dev->irq); + if (dev->irq != 0x0B) + dev->irq = 0x0B; +#endif +#if 0 + printk("%s: device class (0x%04x)\n", + name, dev->class); +#else + if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) { + dev->class &= ~0x000F0F00; + // dev->class |= ~0x00000400; + dev->class |= ~0x00010100; + /**/ + } +#endif + } else { + struct pci_dev * findev = NULL; + u8 reg41 = 0; + + findev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS, + PCI_DEVICE_ID_SERVERWORKS_CSB6, NULL); + if (findev) { + pci_read_config_byte(findev, 0x41, ®41); + reg41 &= ~0x40; + pci_write_config_byte(findev, 0x41, reg41); + } + /* + * This is a device pin issue on CSB6. + * Since there will be a future raid mode, + * early versions of the chipset require the + * interrupt pin to be set, and it is a compatablity + * mode issue. + */ + dev->irq = 0; + } +// pci_read_config_dword(dev, 0x40, &pioreg) +// pci_write_config_dword(dev, 0x40, 0x99999999); +// pci_read_config_dword(dev, 0x44, &dmareg); +// pci_write_config_dword(dev, 0x44, 0xFFFFFFFF); + /* setup the UDMA Control register + * + * 1. clear bit 6 to enable DMA + * 2. enable DMA modes with bits 0-1 + * 00 : legacy + * 01 : udma2 + * 10 : udma2/udma4 + * 11 : udma2/udma4/udma5 + */ + pci_read_config_byte(dev, 0x5A, &btr); + btr &= ~0x40; + if (!(PCI_FUNC(dev->devfn) & 1)) + btr |= 0x2; + else + btr |= (svwks_revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2; + pci_write_config_byte(dev, 0x5A, btr); + } + + +#if defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS) + svwks_devs[n_svwks_devs++] = dev; + + if (!svwks_proc) { + svwks_proc = 1; + ide_pci_register_host_proc(&svwks_procs[0]); + } +#endif /* DISPLAY_SVWKS_TIMINGS && CONFIG_PROC_FS */ + + return (dev->irq) ? dev->irq : 0; +} + +static unsigned int __init ata66_svwks_svwks (ide_hwif_t *hwif) +{ +// struct pci_dev *dev = hwif->pci_dev; +// return 0; + return 1; +} + +/* On Dell PowerEdge servers with a CSB5/CSB6, the top two bits + * of the subsystem device ID indicate presence of an 80-pin cable. + * Bit 15 clear = secondary IDE channel does not have 80-pin cable. + * Bit 15 set = secondary IDE channel has 80-pin cable. + * Bit 14 clear = primary IDE channel does not have 80-pin cable. + * Bit 14 set = primary IDE channel has 80-pin cable. + */ +static unsigned int __init ata66_svwks_dell (ide_hwif_t *hwif) +{ + struct pci_dev *dev = hwif->pci_dev; + if (dev->subsystem_vendor == PCI_VENDOR_ID_DELL && + dev->vendor == PCI_VENDOR_ID_SERVERWORKS && + (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE || + dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE)) + return ((1 << (hwif->channel + 14)) & + dev->subsystem_device) ? 1 : 0; + return 0; +} + +/* Sun Cobalt Alpine hardware avoids the 80-pin cable + * detect issue by attaching the drives directly to the board. + * This check follows the Dell precedent (how scary is that?!) + * + * WARNING: this only works on Alpine hardware! + */ +static unsigned int __init ata66_svwks_cobalt (ide_hwif_t *hwif) +{ + struct pci_dev *dev = hwif->pci_dev; + if (dev->subsystem_vendor == PCI_VENDOR_ID_SUN && + dev->vendor == PCI_VENDOR_ID_SERVERWORKS && + dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) + return ((1 << (hwif->channel + 14)) & + dev->subsystem_device) ? 1 : 0; + return 0; +} + +static unsigned int __init ata66_svwks (ide_hwif_t *hwif) +{ + struct pci_dev *dev = hwif->pci_dev; + + /* Per Specified Design by OEM, and ASIC Architect */ + if ((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) || + (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) + return 1; + + /* Server Works */ + if (dev->subsystem_vendor == PCI_VENDOR_ID_SERVERWORKS) + return ata66_svwks_svwks (hwif); + + /* Dell PowerEdge */ + if (dev->subsystem_vendor == PCI_VENDOR_ID_DELL) + return ata66_svwks_dell (hwif); + + /* Cobalt Alpine */ + if (dev->subsystem_vendor == PCI_VENDOR_ID_SUN) + return ata66_svwks_cobalt (hwif); + + return 0; +} + +static void __init init_hwif_svwks (ide_hwif_t *hwif) +{ + u8 dma_stat = 0; + + if (!hwif->irq) + hwif->irq = hwif->channel ? 15 : 14; + + hwif->tuneproc = &svwks_tune_drive; + hwif->speedproc = &svwks_tune_chipset; + hwif->ratemask = &svwks_ratemask; + hwif->ratefilter = &svwks_ratefilter; + hwif->autodma = 0; + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + hwif->ide_dma_check = &svwks_config_drive_xfer_rate; + if (hwif->pci_dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) + hwif->ide_dma_end = &svwks_ide_dma_end; + else if (!(hwif->udma_four)) + hwif->udma_four = ata66_svwks(hwif); + if (!noautodma) + hwif->autodma = 1; + + dma_stat = hwif->INB(hwif->dma_status); + hwif->drives[0].autodma = (dma_stat & 0x20); + hwif->drives[1].autodma = (dma_stat & 0x40); + hwif->drives[0].autotune = (!(dma_stat & 0x20)); + hwif->drives[1].autotune = (!(dma_stat & 0x40)); +// hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* !CONFIG_BLK_DEV_IDEDMA */ +} + +/* + * We allow the BM-DMA driver to only work on enabled interfaces. + */ +static void __init init_dma_svwks (ide_hwif_t *hwif, unsigned long dmabase) +{ + struct pci_dev *dev = hwif->pci_dev; + + if (((dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) || + (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) && + (!(PCI_FUNC(dev->devfn) & 1)) && (hwif->channel)) + return; + + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_svwks (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +static void __init init_setup_csb6 (struct pci_dev *dev, ide_pci_device_t *d) +{ + if (!(PCI_FUNC(dev->devfn) & 1)) { + d->bootable = NEVER_BOARD; + if (dev->resource[0].start == 0x01f1) + d->bootable = ON_BOARD; + } else { + if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE) + return; + } +#if 0 + if ((IDE_PCI_DEVID_EQ(d->devid, DEVID_CSB6) && + (!(PCI_FUNC(dev->devfn) & 1))) + d->autodma = AUTODMA; +#endif + + d->channels = (((d->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE) || + (d->device == PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2)) && + (!(PCI_FUNC(dev->devfn) & 1))) ? 1 : 2; + + ide_setup_pci_device(dev, d); +} + +int __init serverworks_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_SERVERWORKS) + return 0; + + for (d = serverworks_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/serverworks.h linux.20pre5-ac2/drivers/ide/pci/serverworks.h --- linux.20pre5/drivers/ide/pci/serverworks.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/serverworks.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,105 @@ + +#ifndef SERVERWORKS_H +#define SERVERWORKS_H + +#include +#include +#include + +#undef SVWKS_DEBUG_DRIVE_INFO + +#define SVWKS_CSB5_REVISION_NEW 0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */ +#define SVWKS_CSB6_REVISION 0xa0 /* min PCI_REVISION_ID for UDMA4 (A1.0) */ + +#define DISPLAY_SVWKS_TIMINGS 1 + +#if defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 svwks_proc; + +static int svwks_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t svwks_procs[] __initdata = { +{ + name: "svwks", + set: 1, + get_info: svwks_get_info, + parent: NULL, + }, +}; +#endif /* defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static void init_setup_svwks(struct pci_dev *, ide_pci_device_t *); +static void init_setup_csb6(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_svwks(struct pci_dev *, const char *); +static void init_hwif_svwks(ide_hwif_t *); +static void init_dma_svwks(ide_hwif_t *, unsigned long); + +static ide_pci_device_t serverworks_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_SERVERWORKS, + device: PCI_DEVICE_ID_SERVERWORKS_OSB4IDE, + name: "SvrWks OSB4", + init_setup: init_setup_svwks, + init_chipset: init_chipset_svwks, + init_iops: NULL, + init_hwif: init_hwif_svwks, + init_dma: NULL, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_SERVERWORKS, + device: PCI_DEVICE_ID_SERVERWORKS_CSB5IDE, + name: "SvrWks CSB5", + init_setup: init_setup_svwks, + init_chipset: init_chipset_svwks, + init_iops: NULL, + init_hwif: init_hwif_svwks, + init_dma: init_dma_svwks, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_SERVERWORKS, + device: PCI_DEVICE_ID_SERVERWORKS_CSB6IDE, + name: "SvrWks CSB6", + init_setup: init_setup_csb6, + init_chipset: init_chipset_svwks, + init_iops: NULL, + init_hwif: init_hwif_svwks, + init_dma: init_dma_svwks, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_SERVERWORKS, + device: PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2, + name: "SvrWks CSB6", + init_setup: init_setup_csb6, + init_chipset: init_chipset_svwks, + init_iops: NULL, + init_hwif: init_hwif_svwks, + init_dma: init_dma_svwks, + channels: 1, /* 2 */ + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* SERVERWORKS_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/siimage.c linux.20pre5-ac2/drivers/ide/pci/siimage.c --- linux.20pre5/drivers/ide/pci/siimage.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/siimage.c 2002-09-01 18:02:52.000000000 +0100 @@ -0,0 +1,914 @@ +/* + * linux/drivers/ide/siimage.c Version 1.00 May 9, 2002 + * + * Copyright (C) 2001-2002 Andre Hedrick + */ + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ide_modes.h" +#include "siimage.h" + +#if defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 siimage_proc = 0; +#define SIIMAGE_MAX_DEVS 5 +static struct pci_dev *siimage_devs[SIIMAGE_MAX_DEVS]; +static int n_siimage_devs; + +static char * print_siimage_get_info (char *buf, struct pci_dev *dev, int index) +{ + char *p = buf; + u8 mmio = (dev->driver_data != NULL) ? 1 : 0; + u32 bmdma = (mmio) ? ((u32) dev->driver_data) : + (pci_resource_start(dev, 4)); + + p += sprintf(p, "\nController: %d\n", index); + p += sprintf(p, "SiI%x Chipset.\n", dev->device); + if (mmio) + p += sprintf(p, "MMIO Base 0x%08x\n", bmdma); + p += sprintf(p, "%s-DMA Base 0x%08x\n", (mmio)?"MMIO":"BM", bmdma); + p += sprintf(p, "%s-DMA Base 0x%08x\n", (mmio)?"MMIO":"BM", bmdma+8); + + p += sprintf(p, "--------------- Primary Channel " + "---------------- Secondary Channel " + "-------------\n"); + p += sprintf(p, "--------------- drive0 --------- drive1 " + "-------- drive0 ---------- drive1 ------\n"); + p += sprintf(p, "PIO Mode: %s %s" + " %s %s\n", + "?", "?", "?", "?"); + return (char *)p; +} + +static int siimage_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + u16 i; + + p += sprintf(p, "\n"); + for (i = 0; i < n_siimage_devs; i++) { + struct pci_dev *dev = siimage_devs[i]; + p = print_siimage_get_info(p, dev, i); + } + return p-buffer; /* => must be less than 4k! */ +} + +#endif /* defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static byte siimage_ratemask (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 mode = 0, scsc = 0; + + if (hwif->mmio) + scsc = hwif->INB(HWIFADDR(0x4A)); + else + pci_read_config_byte(hwif->pci_dev, 0x8A, &scsc); + + switch(hwif->pci_dev->device) { + case PCI_DEVICE_ID_SII_3112: + return 4; + case PCI_DEVICE_ID_SII_680: + if ((scsc & 0x10) == 0x10) /* 133 */ + mode = 4; + else if ((scsc & 0x30) == 0x00) /* 100 */ + mode = 3; + else if ((scsc & 0x20) == 0x20) /* 66 eek */ + BUG(); // mode = 2; + break; + default: return 0; + } + if (!eighty_ninty_three(drive)) + mode = min(mode, (u8)1); + return mode; +} + +static byte siimage_ratefilter (ide_drive_t *drive, byte speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + /* SiI's ratemask is between 0-4 and capped at UDMA133 */ + return min(speed, speed_max[siimage_ratemask(drive)]); +#else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static byte siimage_taskfile_timing (ide_hwif_t *hwif) +{ + u16 timing = 0x328a; + + if (hwif->mmio) + timing = hwif->INW(SELADDR(2)); + else + pci_read_config_word(hwif->pci_dev, SELREG(2), &timing); + + switch (timing) { + case 0x10c1: return 4; + case 0x10c3: return 3; + case 0x1281: return 2; + case 0x2283: return 1; + case 0x328a: + default: return 0; + } +} + +static void siimage_tuneproc (ide_drive_t *drive, byte mode_wanted) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u16 speedt = 0; + u8 unit = drive->select.b.unit; + + if (hwif->mmio) + speedt = hwif->INW(SELADDR(0x04|(unit<mmio) + hwif->OUTW(speedt, SELADDR(0x04|(unit< channel_timings)) + set_pio = channel_timings; + + siimage_tuneproc(drive, set_pio); + speed = XFER_PIO_0 + set_pio; + if (set_speed) + (void) ide_config_drive_speed(drive, speed); +} + +static void config_chipset_for_pio (ide_drive_t *drive, byte set_speed) +{ + config_siimage_chipset_for_pio(drive, set_speed); +} + +static int siimage_tune_chipset (ide_drive_t *drive, byte xferspeed) +{ + u8 ultra6[] = { 0x0F, 0x0B, 0x07, 0x05, 0x03, 0x02, 0x01 }; + u8 ultra5[] = { 0x0C, 0x07, 0x05, 0x04, 0x02, 0x01 }; + u16 dma[] = { 0x2208, 0x10C2, 0x10C1 }; + + ide_hwif_t *hwif = HWIF(drive); + u16 ultra = 0, multi = 0; + u8 mode = 0, unit = drive->select.b.unit; + u8 scsc = 0, speed = siimage_ratefilter(drive, xferspeed); + u8 addr_mask = ((hwif->channel) ? + ((hwif->mmio) ? 0xF4 : 0x84) : + ((hwif->mmio) ? 0xB4 : 0x80)); + + if (hwif->mmio) { + scsc = hwif->INB(HWIFADDR(0x4A)); + mode = hwif->INB(HWIFADDR(addr_mask)); + multi = hwif->INW(SELADDR(0x08|(unit<INW(SELADDR(0x0C|(unit<pci_dev, HWIFADDR(0x8A), &scsc); + pci_read_config_byte(hwif->pci_dev, addr_mask, &mode); + pci_read_config_word(hwif->pci_dev, + SELREG(0x08|(unit<pci_dev, + SELREG(0x0C|(unit<pci_dev->device == PCI_DEVICE_ID_SII_3112) ? 1 : scsc; + + switch(speed) { + case XFER_PIO_4: + case XFER_PIO_3: + case XFER_PIO_2: + case XFER_PIO_1: + case XFER_PIO_0: + siimage_tuneproc(drive, (speed - XFER_PIO_0)); + mode |= ((unit) ? 0x10 : 0x01); + break; +#ifdef CONFIG_BLK_DEV_IDEDMA + case XFER_MW_DMA_2: + case XFER_MW_DMA_1: + case XFER_MW_DMA_0: + multi = dma[speed - XFER_MW_DMA_0]; + mode |= ((unit) ? 0x20 : 0x02); + config_siimage_chipset_for_pio(drive, 0); + break; + case XFER_UDMA_6: + case XFER_UDMA_5: + case XFER_UDMA_4: + case XFER_UDMA_3: + case XFER_UDMA_2: + case XFER_UDMA_1: + case XFER_UDMA_0: + multi = dma[2]; + ultra |= ((scsc) ? (ultra5[speed - XFER_UDMA_0]) : + (ultra6[speed - XFER_UDMA_0])); + mode |= ((unit) ? 0x30 : 0x03); + config_siimage_chipset_for_pio(drive, 0); + break; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + default: + return 1; + } + + if (hwif->mmio) { + hwif->OUTB(mode, HWIFADDR(addr_mask)); + hwif->OUTW(multi, SELADDR(0x08|(unit<OUTW(ultra, SELADDR(0x0C|(unit<pci_dev, addr_mask, mode); + pci_write_config_word(hwif->pci_dev, + SELREG(0x08|(unit<pci_dev, + SELREG(0x0C|(unit<id; + ide_hwif_t *hwif = HWIF(drive); + u8 speed = 0, set_pio = 0, mode = siimage_ratemask(drive); + + if (drive->media != ide_disk) { + siiprintk("SiI%x: drive->media != ide_disk at double check," + " inital check failed!!\n", + hwif->pci_dev->device); + return 0; + } + + switch(mode) { + case 0x04: + if (id->dma_ultra & 0x0040) + { speed = XFER_UDMA_6; break; } + case 0x03: + if (id->dma_ultra & 0x0020) + { speed = XFER_UDMA_5; break; } + case 0x02: + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_4; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_3; break; } + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_mword & 0x0001) + { speed = XFER_MW_DMA_0; break; } + if (id->dma_1word & 0x0004) + { speed = XFER_SW_DMA_2; break; } + if (id->dma_1word & 0x0002) + { speed = XFER_SW_DMA_1; break; } + if (id->dma_1word & 0x0001) + { speed = XFER_SW_DMA_0; break; } + default: + { set_pio = 1; break; } + } + + if (!drive->init_speed) + drive->init_speed = speed; + + config_chipset_for_pio(drive, set_pio); + + if (set_pio) + return 0; + + if (hwif->speedproc(drive, speed)) + return 0; + + return ((int) ((((id->dma_ultra >> 8) & 0x7F) || + ((id->dma_mword >> 8) & 0x07) || + ((id->dma_1word >> 8) & 0x07)) ? 1 : 0)); +} + +static int siimage_config_drive_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + if ((id != NULL) && ((id->capability & 1) != 0) && + drive->autodma && (drive->media == ide_disk)) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + + if ((id->field_valid & 4) && siimage_ratemask(drive)) { + if (id->dma_ultra & 0x007F) { + /* Force if Capable UltraDMA */ + int dma = config_chipset_for_dma(drive); + if ((id->field_valid & 2) && !dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + (id->dma_1word & 0x0007)) { + /* Force if Capable regular DMA modes */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + config_chipset_for_pio(drive, 1); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} + +/* returns 1 if dma irq issued, 0 otherwise */ +static int siimage_io_ide_dma_test_irq (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 dma_altstat = 0; + + /* return 1 if INTR asserted */ + if ((hwif->INB(hwif->dma_status) & 4) == 4) + return 1; + + /* return 1 if Device INTR asserted */ + if ((pci_read_config_byte(hwif->pci_dev, SELREG(1), &dma_altstat)), + ((dma_altstat & 8) == 8)) + return 0; //return 1; + + return 0; +} + +static int siimage_mmio_ide_dma_count (ide_drive_t *drive) +{ +#ifdef SIIMAGE_VIRTUAL_DMAPIO + struct request *rq = HWGROUP(drive)->rq; + ide_hwif_t *hwif = HWIF(drive); + u32 count = (rq->nr_sectors * SECTOR_SIZE); + u32 rcount = 0; + + hwif->OUTL(count, SELADDR(0x1C)); + rcount = hwif->INL(SELADDR(0x1C)); + + printk("\n%s: count = %d, rcount = %d, nr_sectors = %lu\n", + drive->name, count, rcount, rq->nr_sectors); + +#endif /* SIIMAGE_VIRTUAL_DMAPIO */ + return __ide_dma_count(drive); +} + +/* returns 1 if dma irq issued, 0 otherwise */ +static int siimage_mmio_ide_dma_test_irq (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + + if (SATA_ERROR_REG) { + u32 ext_stat = hwif->INL(HWIFADDR(0x10)); + u8 watchdog = 0; + if (ext_stat & ((hwif->channel) ? 0x40 : 0x10)) { + u32 sata_error = hwif->INL(SATA_ERROR_REG); + hwif->OUTL(sata_error, SATA_ERROR_REG); + watchdog = (sata_error & 0x00680000) ? 1 : 0; +#if 1 + printk("%s: sata_error = 0x%08x, " + "watchdog = %d, %s\n", + drive->name, sata_error, watchdog, + __FUNCTION__); +#endif + + } else { + watchdog = (ext_stat & 0x8000) ? 1 : 0; + } + ext_stat >>= 16; + + if (!(ext_stat & 0x0404) && !watchdog) + return 0; + } + + /* return 1 if INTR asserted */ + if ((hwif->INB(hwif->dma_status) & 0x04) == 0x04) + return 1; + + /* return 1 if Device INTR asserted */ + if ((hwif->INB(SELADDR(1)) & 8) == 8) + return 0; //return 1; + + return 0; +} + +static int siimage_mmio_ide_dma_verbose (ide_drive_t *drive) +{ + int temp = __ide_dma_verbose(drive); +#if 0 + drive->using_dma = 0; +#endif + return temp; +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +static int siimage_busproc (ide_drive_t * drive, int state) +{ + ide_hwif_t *hwif = HWIF(drive); + u32 stat_config = 0; + + if (hwif->mmio) { + stat_config = hwif->INL(SELADDR(0)); + } else + pci_read_config_dword(hwif->pci_dev, SELREG(0), &stat_config); + + switch (state) { + case BUSSTATE_ON: + hwif->drives[0].failures = 0; + hwif->drives[1].failures = 0; + break; + case BUSSTATE_OFF: + hwif->drives[0].failures = hwif->drives[0].max_failures + 1; + hwif->drives[1].failures = hwif->drives[1].max_failures + 1; + break; + case BUSSTATE_TRISTATE: + hwif->drives[0].failures = hwif->drives[0].max_failures + 1; + hwif->drives[1].failures = hwif->drives[1].max_failures + 1; + break; + default: + return 0; + } + hwif->bus_state = state; + return 0; +} + +static int siimage_reset_poll (ide_drive_t *drive) +{ + if (SATA_STATUS_REG) { + ide_hwif_t *hwif = HWIF(drive); + + if ((hwif->INL(SATA_STATUS_REG) & 0x03) != 0x03) { + printk("%s: reset phy dead, status=0x%08x\n", + hwif->name, hwif->INL(SATA_STATUS_REG)); + HWGROUP(drive)->poll_timeout = 0; +#if 0 + drive->failures++; + return ide_stopped; +#else + return ide_started; +#endif + return 1; + } + return 0; + } else { + return 0; + } +} + +static void siimage_pre_reset (ide_drive_t *drive) +{ + if (drive->media != ide_disk) + return; + + if (HWIF(drive)->pci_dev->device == PCI_DEVICE_ID_SII_3112) { + drive->special.b.set_geometry = 0; + drive->special.b.recalibrate = 0; + } +} + +static void siimage_reset (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u8 reset = 0; + + if (hwif->mmio) { + reset = hwif->INB(SELADDR(0)); + hwif->OUTB((reset|0x03), SELADDR(0)); + udelay(25); + hwif->OUTB(reset, SELADDR(0)); + (void) hwif->INB(SELADDR(0)); + } else { + pci_read_config_byte(hwif->pci_dev, SELREG(0), &reset); + pci_write_config_byte(hwif->pci_dev, SELREG(0), reset|0x03); + udelay(25); + pci_write_config_byte(hwif->pci_dev, SELREG(0), reset); + pci_read_config_byte(hwif->pci_dev, SELREG(0), &reset); + } + + if (SATA_STATUS_REG) { + u32 sata_stat = hwif->INL(SATA_STATUS_REG); + printk("%s: reset phy, status=0x%08x, %s\n", + hwif->name, sata_stat, __FUNCTION__); + if (!(sata_stat)) { + printk("%s: reset phy dead, status=0x%08x\n", + hwif->name, sata_stat); + drive->failures++; + } + } + +} + +static void proc_reports_siimage (struct pci_dev *dev, u8 clocking, const char *name) +{ + if (dev->device == PCI_DEVICE_ID_SII_3112) + goto sata_skip; + + printk("%s: BASE CLOCK ", name); + clocking &= ~0x0C; + switch(clocking) { + case 0x03: printk("DISABLED !\n"); break; + case 0x02: printk("== 2X PCI \n"); break; + case 0x01: printk("== 133 \n"); break; + case 0x00: printk("== 100 \n"); break; + default: + BUG(); + } + +sata_skip: + +#if defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS) + siimage_devs[n_siimage_devs++] = dev; + + if (!siimage_proc) { + siimage_proc = 1; + ide_pci_register_host_proc(&siimage_procs[0]); + } +#endif /* DISPLAY_SIIMAGE_TIMINGS && CONFIG_PROC_FS */ +} + +#ifdef CONFIG_TRY_MMIO_SIIMAGE +static unsigned int setup_mmio_siimage (struct pci_dev *dev, const char *name) +{ + u32 bar5 = pci_resource_start(dev, 5); + u32 end5 = pci_resource_end(dev, 5); + u8 tmpbyte = 0; + u32 addr; + void *ioaddr; + + ioaddr = ioremap_nocache(bar5, (end5 - bar5)); + + if (ioaddr == NULL) + return 0; + + pci_set_master(dev); + addr = (u32) ioaddr; + pci_set_drvdata(dev, (void *) addr); + + if (dev->device == PCI_DEVICE_ID_SII_3112) { + sii_outl(0, DEVADDR(0x148)); + sii_outl(0, DEVADDR(0x1C8)); + } + + sii_outb(0, DEVADDR(0xB4)); + sii_outb(0, DEVADDR(0xF4)); + tmpbyte = sii_inb(DEVADDR(0x4A)); + + switch(tmpbyte) { + case 0x01: + sii_outb(tmpbyte|0x10, DEVADDR(0x4A)); + tmpbyte = sii_inb(DEVADDR(0x4A)); + case 0x31: + /* if clocking is disabled */ + /* 133 clock attempt to force it on */ + sii_outb(tmpbyte & ~0x20, DEVADDR(0x4A)); + tmpbyte = sii_inb(DEVADDR(0x4A)); + case 0x11: + case 0x21: + break; + default: + tmpbyte &= ~0x30; + tmpbyte |= 0x20; + sii_outb(tmpbyte, DEVADDR(0x4A)); + break; + } + + sii_outb(0x72, DEVADDR(0xA1)); + sii_outw(0x328A, DEVADDR(0xA2)); + sii_outl(0x62DD62DD, DEVADDR(0xA4)); + sii_outl(0x43924392, DEVADDR(0xA8)); + sii_outl(0x40094009, DEVADDR(0xAC)); + sii_outb(0x72, DEVADDR(0xE1)); + sii_outw(0x328A, DEVADDR(0xE2)); + sii_outl(0x62DD62DD, DEVADDR(0xE4)); + sii_outl(0x43924392, DEVADDR(0xE8)); + sii_outl(0x40094009, DEVADDR(0xEC)); + + if (dev->device == PCI_DEVICE_ID_SII_3112) { + sii_outl(0xFFFF0000, DEVADDR(0x108)); + sii_outl(0xFFFF0000, DEVADDR(0x188)); + sii_outl(0x00680000, DEVADDR(0x148)); + sii_outl(0x00680000, DEVADDR(0x1C8)); + } + + tmpbyte = sii_inb(DEVADDR(0x4A)); + + proc_reports_siimage(dev, (tmpbyte>>=4), name); + return 1; +} +#endif /* CONFIG_TRY_MMIO_SIIMAGE */ + +static unsigned int __init init_chipset_siimage (struct pci_dev *dev, const char *name) +{ + u32 class_rev = 0; + u8 tmpbyte = 0; +#ifdef CONFIG_TRY_MMIO_SIIMAGE + u8 BA5_EN = 0; +#endif /* CONFIG_TRY_MMIO_SIIMAGE */ + + pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xff; + pci_write_config_byte(dev, PCI_CACHE_LINE_SIZE, (class_rev) ? 1 : 255); + +#ifdef CONFIG_TRY_MMIO_SIIMAGE + pci_read_config_byte(dev, 0x8A, &BA5_EN); + if ((BA5_EN & 0x01) || (pci_resource_start(dev, 5))) { + if (setup_mmio_siimage(dev, name)) { + return 0; + } + } +#endif /* CONFIG_TRY_MMIO_SIIMAGE */ + + pci_write_config_byte(dev, 0x80, 0x00); + pci_write_config_byte(dev, 0x84, 0x00); + pci_read_config_byte(dev, 0x8A, &tmpbyte); + switch(tmpbyte) { + case 0x00: + case 0x01: + /* 133 clock attempt to force it on */ + pci_write_config_byte(dev, 0x8A, tmpbyte|0x10); + pci_read_config_byte(dev, 0x8A, &tmpbyte); + case 0x30: + case 0x31: + /* if clocking is disabled */ + /* 133 clock attempt to force it on */ + pci_write_config_byte(dev, 0x8A, tmpbyte & ~0x20); + pci_read_config_byte(dev, 0x8A, &tmpbyte); + case 0x10: + case 0x11: + case 0x20: + case 0x21: + break; + default: + tmpbyte &= ~0x30; + tmpbyte |= 0x20; + pci_write_config_byte(dev, 0x8A, tmpbyte); + break; + } + + pci_read_config_byte(dev, 0x8A, &tmpbyte); + pci_write_config_byte(dev, 0xA1, 0x72); + pci_write_config_word(dev, 0xA2, 0x328A); + pci_write_config_dword(dev, 0xA4, 0x62DD62DD); + pci_write_config_dword(dev, 0xA8, 0x43924392); + pci_write_config_dword(dev, 0xAC, 0x40094009); + pci_write_config_byte(dev, 0xB1, 0x72); + pci_write_config_word(dev, 0xB2, 0x328A); + pci_write_config_dword(dev, 0xB4, 0x62DD62DD); + pci_write_config_dword(dev, 0xB8, 0x43924392); + pci_write_config_dword(dev, 0xBC, 0x40094009); + + pci_read_config_byte(dev, 0x8A, &tmpbyte); + proc_reports_siimage(dev, (tmpbyte>>=4), name); + return 0; +} + +static void __init init_mmio_iops_siimage (ide_hwif_t *hwif) +{ + struct pci_dev *dev = hwif->pci_dev; + u32 addr = (u32) pci_get_drvdata(hwif->pci_dev); + u8 ch = hwif->channel; +// u16 i = 0; + hw_regs_t hw; + + hwif->OUTB = hwif->OUTBP = sii_outb; + hwif->OUTW = hwif->OUTWP = sii_outw; + hwif->OUTL = hwif->OUTLP = sii_outl; + hwif->OUTSW = hwif->OUTSWP = sii_outsw; + hwif->OUTSL = hwif->OUTSLP = sii_outsl; + hwif->INB = hwif->INBP = sii_inb; + hwif->INW = hwif->INWP = sii_inw; + hwif->INL = hwif->INLP = sii_inl; + hwif->INSW = hwif->INSWP = sii_insw; + hwif->INSL = hwif->INSLP = sii_insl; + + memset(&hw, 0, sizeof(hw_regs_t)); + +#if 1 +#ifdef SIIMAGE_BUFFERED_TASKFILE + hw.io_ports[IDE_DATA_OFFSET] = DEVADDR((ch) ? 0xD0 : 0x90); + hw.io_ports[IDE_ERROR_OFFSET] = DEVADDR((ch) ? 0xD1 : 0x91); + hw.io_ports[IDE_NSECTOR_OFFSET] = DEVADDR((ch) ? 0xD2 : 0x92); + hw.io_ports[IDE_SECTOR_OFFSET] = DEVADDR((ch) ? 0xD3 : 0x93); + hw.io_ports[IDE_LCYL_OFFSET] = DEVADDR((ch) ? 0xD4 : 0x94); + hw.io_ports[IDE_HCYL_OFFSET] = DEVADDR((ch) ? 0xD5 : 0x95); + hw.io_ports[IDE_SELECT_OFFSET] = DEVADDR((ch) ? 0xD6 : 0x96); + hw.io_ports[IDE_STATUS_OFFSET] = DEVADDR((ch) ? 0xD7 : 0x97); + hw.io_ports[IDE_CONTROL_OFFSET] = DEVADDR((ch) ? 0xDA : 0x9A); +#else /* ! SIIMAGE_BUFFERED_TASKFILE */ + hw.io_ports[IDE_DATA_OFFSET] = DEVADDR((ch) ? 0xC0 : 0x80); + hw.io_ports[IDE_ERROR_OFFSET] = DEVADDR((ch) ? 0xC1 : 0x81); + hw.io_ports[IDE_NSECTOR_OFFSET] = DEVADDR((ch) ? 0xC2 : 0x82); + hw.io_ports[IDE_SECTOR_OFFSET] = DEVADDR((ch) ? 0xC3 : 0x83); + hw.io_ports[IDE_LCYL_OFFSET] = DEVADDR((ch) ? 0xC4 : 0x84); + hw.io_ports[IDE_HCYL_OFFSET] = DEVADDR((ch) ? 0xC5 : 0x85); + hw.io_ports[IDE_SELECT_OFFSET] = DEVADDR((ch) ? 0xC6 : 0x86); + hw.io_ports[IDE_STATUS_OFFSET] = DEVADDR((ch) ? 0xC7 : 0x87); + hw.io_ports[IDE_CONTROL_OFFSET] = DEVADDR((ch) ? 0xCA : 0x8A); +#endif /* SIIMAGE_BUFFERED_TASKFILE */ +#else +#ifdef SIIMAGE_BUFFERED_TASKFILE + for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) + hw.io_ports[i] = DEVADDR((ch) ? 0xD0 : 0x90)|(i); + hw.io_ports[IDE_CONTROL_OFFSET] = DEVADDR((ch) ? 0xDA : 0x9A); +#else /* ! SIIMAGE_BUFFERED_TASKFILE */ + for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) + hw.io_ports[i] = DEVADDR((ch) ? 0xC0 : 0x80)|(i); + hw.io_ports[IDE_CONTROL_OFFSET] = DEVADDR((ch) ? 0xCA : 0x8A); +#endif /* SIIMAGE_BUFFERED_TASKFILE */ +#endif + +#if 0 + printk("%s: ", hwif->name); + for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) + printk("0x%08x ", DEVADDR((ch) ? 0xC0 : 0x80)|(i)); + printk("0x%08x ", DEVADDR((ch) ? 0xCA : 0x8A)|(i)); +#endif + + hw.io_ports[IDE_IRQ_OFFSET] = 0; + + if (dev->device == PCI_DEVICE_ID_SII_3112) { + hw.sata_scr[SATA_STATUS_OFFSET] = DEVADDR((ch) ? 0x184 : 0x104); + hw.sata_scr[SATA_ERROR_OFFSET] = DEVADDR((ch) ? 0x188 : 0x108); + hw.sata_scr[SATA_CONTROL_OFFSET]= DEVADDR((ch) ? 0x180 : 0x100); + hw.sata_misc[SATA_MISC_OFFSET] = DEVADDR((ch) ? 0x1C0 : 0x140); + hw.sata_misc[SATA_PHY_OFFSET] = DEVADDR((ch) ? 0x1C4 : 0x144); + hw.sata_misc[SATA_IEN_OFFSET] = DEVADDR((ch) ? 0x1C8 : 0x148); + } + + hw.priv = (void *) addr; +// hw.priv = pci_get_drvdata(hwif->pci_dev); + hw.irq = hwif->pci_dev->irq; +// hw.iops = siimage_iops; + + memcpy(&hwif->hw, &hw, sizeof(hw)); + memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->hw.io_ports)); + + if (hwif->pci_dev->device == PCI_DEVICE_ID_SII_3112) { + memcpy(hwif->sata_scr, hwif->hw.sata_scr, sizeof(hwif->hw.sata_scr)); + memcpy(hwif->sata_misc, hwif->hw.sata_misc, sizeof(hwif->hw.sata_misc)); + } + +#ifdef SIIMAGE_BUFFERED_TASKFILE + hwif->addressing = 1; +#endif /* SIIMAGE_BUFFERED_TASKFILE */ + hwif->irq = hw.irq; +// hwif->hwif_data = (void *) dev->driver_data; + hwif->hwif_data = pci_get_drvdata(hwif->pci_dev); + +#ifdef SIIMAGE_LARGE_DMA + hwif->dma_base = DEVADDR((ch) ? 0x18 : 0x10); + hwif->dma_base2 = DEVADDR((ch) ? 0x08 : 0x00); + hwif->dma_prdtable = (hwif->dma_base2 + 4); +#else /* ! SIIMAGE_LARGE_DMA */ + hwif->dma_base = DEVADDR((ch) ? 0x08 : 0x00); + hwif->dma_base2 = DEVADDR((ch) ? 0x18 : 0x10); +#endif /* SIIMAGE_LARGE_DMA */ + hwif->mmio = 1; +} + +static void __init init_iops_siimage (ide_hwif_t *hwif) +{ + struct pci_dev *dev = hwif->pci_dev; + u32 class_rev = 0; + + pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xff; + + hwif->rqsize = 128; + if ((dev->device == PCI_DEVICE_ID_SII_3112) && (!(class_rev))) + hwif->rqsize = 16; + + if (dev->driver_data == NULL) + return; + init_mmio_iops_siimage(hwif); +} + +static unsigned int __init ata66_siimage (ide_hwif_t *hwif) +{ + if (hwif->pci_dev->driver_data == NULL) { + u8 ata66 = 0; + pci_read_config_byte(hwif->pci_dev, SELREG(0), &ata66); + return (ata66 & 0x01) ? 1 : 0; + } +#ifndef CONFIG_TRY_MMIO_SIIMAGE + if (hwif->mmio) BUG(); +#endif /* CONFIG_TRY_MMIO_SIIMAGE */ + + return (hwif->INB(SELADDR(0)) & 0x01) ? 1 : 0; +} + +static void __init init_hwif_siimage (ide_hwif_t *hwif) +{ + hwif->autodma = 0; + hwif->busproc = &siimage_busproc; + hwif->resetproc = &siimage_reset; + hwif->speedproc = &siimage_tune_chipset; + hwif->tuneproc = &siimage_tuneproc; + hwif->ratemask = &siimage_ratemask; + hwif->ratefilter = &siimage_ratefilter; + hwif->reset_poll = &siimage_reset_poll; + hwif->pre_reset = &siimage_pre_reset; + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + hwif->ide_dma_check = &siimage_config_drive_for_dma; + if (!(hwif->udma_four)) + hwif->udma_four = ata66_siimage(hwif); + + if (hwif->mmio) { + hwif->ide_dma_count = &siimage_mmio_ide_dma_count; + hwif->ide_dma_test_irq = &siimage_mmio_ide_dma_test_irq; + hwif->ide_dma_verbose = &siimage_mmio_ide_dma_verbose; + } else { + hwif->ide_dma_test_irq = & siimage_io_ide_dma_test_irq; + } + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static void __init init_dma_siimage (ide_hwif_t *hwif, unsigned long dmabase) +{ + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_siimage (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init siimage_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_CMD) + return 0; + + for (d = siimage_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/siimage.h linux.20pre5-ac2/drivers/ide/pci/siimage.h --- linux.20pre5/drivers/ide/pci/siimage.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/siimage.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,153 @@ +#ifndef SIIMAGE_H +#define SIIMAGE_H + +#include +#include +#include + +#include + +#define DISPLAY_SIIMAGE_TIMINGS + +#define CONFIG_TRY_MMIO_SIIMAGE +//#undef CONFIG_TRY_MMIO_SIIMAGE +#undef SIIMAGE_VIRTUAL_DMAPIO +#undef SIIMAGE_BUFFERED_TASKFILE +#undef SIIMAGE_LARGE_DMA + +#if 0 +typedef struct ide_io_ops_s siimage_iops { + +} +#endif + +#define SII_DEBUG 0 + +#if SII_DEBUG +#define siiprintk(x...) printk(x) +#else +#define siiprintk(x...) +#endif + +#define ADJREG(B,R) ((B)|(R)|((hwif->channel)<<(4+(2*(hwif->mmio))))) +#define SELREG(R) ADJREG((0xA0),(R)) +#define SELADDR(R) ((((u32)hwif->hwif_data)*(hwif->mmio))|SELREG((R))) +#define HWIFADDR(R) ((((u32)hwif->hwif_data)*(hwif->mmio))|(R)) +#define DEVADDR(R) (((u32) pci_get_drvdata(dev))|(R)) + + +inline u8 sii_inb (u32 port) +{ + return (u8) readb(port); +} + +inline u16 sii_inw (u32 port) +{ + return (u16) readw(port); +} + +inline void sii_insw (u32 port, void *addr, u32 count) +{ + while (count--) { *(u16 *)addr = readw(port); addr += 2; } +} + +inline u32 sii_inl (u32 port) +{ + return (u32) readl(port); +} + +inline void sii_insl (u32 port, void *addr, u32 count) +{ + sii_insw(port, addr, (count)<<1); +// while (count--) { *(u32 *)addr = readl(port); addr += 4; } +} + +inline void sii_outb (u8 addr, u32 port) +{ + writeb(addr, port); +} + +inline void sii_outw (u16 addr, u32 port) +{ + writew(addr, port); +} + +inline void sii_outsw (u32 port, void *addr, u32 count) +{ + while (count--) { writew(*(u16 *)addr, port); addr += 2; } +} + +inline void sii_outl (u32 addr, u32 port) +{ + writel(addr, port); +} + +inline void sii_outsl (u32 port, void *addr, u32 count) +{ + sii_outsw(port, addr, (count)<<1); +// while (count--) { writel(*(u32 *)addr, port); addr += 4; } +} + +#if defined(DISPLAY_SIIMAGE_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static char * print_siimage_get_info(char *, struct pci_dev *, int); +static int siimage_get_info(char *, char **, off_t, int); + +static u8 siimage_proc; + +static ide_pci_host_proc_t siimage_procs[] __initdata = { + { + name: "siimage", + set: 1, + get_info: siimage_get_info, + parent: NULL, + }, +}; +#endif /* DISPLAY_SIIMAGE_TIMINGS && CONFIG_PROC_FS */ + +static void init_setup_siimage(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_siimage(struct pci_dev *, const char *); +static void init_iops_siimage(ide_hwif_t *); +static void init_hwif_siimage(ide_hwif_t *); +static void init_dma_siimage(ide_hwif_t *, unsigned long); + +static ide_pci_device_t siimage_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_CMD, + device: PCI_DEVICE_ID_SII_680, + name: "SiI680", + init_setup: init_setup_siimage, + init_chipset: init_chipset_siimage, + init_iops: init_iops_siimage, + init_hwif: init_hwif_siimage, + init_dma: init_dma_siimage, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_CMD, + device: PCI_DEVICE_ID_SII_3112, + name: "SiI3112 Serial ATA", + init_setup: init_setup_siimage, + init_chipset: init_chipset_siimage, + init_iops: init_iops_siimage, + init_hwif: init_hwif_siimage, + init_dma: init_dma_siimage, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* SIIMAGE_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/sis5513.c linux.20pre5-ac2/drivers/ide/pci/sis5513.c --- linux.20pre5/drivers/ide/pci/sis5513.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/sis5513.c 2002-09-01 18:03:02.000000000 +0100 @@ -0,0 +1,1122 @@ +/* + * linux/drivers/ide/sis5513.c Version 0.14 July 24, 2002 + * + * Copyright (C) 1999-2000 Andre Hedrick + * Copyright (C) 2002 Lionel Bouton , Maintainer + * May be copied or modified under the terms of the GNU General Public License + * + * + * Thanks : + * + * SiS Taiwan : for direct support and hardware. + * Daniela Engert : for initial ATA100 advices and numerous others. + * John Fremlin, Manfred Spraul : + * for checking code correctness, providing patches. + * + * + * Original tests and design on the SiS620/5513 chipset. + * ATA100 tests and design on the SiS735/5513 chipset. + * ATA16/33 support from specs + * ATA133 support for SiS961/962 by L.C. Chang + */ + +/* + * TODO: + * - Get ridden of SisHostChipInfo[] completness dependancy. + * - Study drivers/ide/ide-timing.h. + * - Are there pre-ATA_16 SiS5513 chips ? -> tune init code for them + * or remove ATA_00 define + * - More checks in the config registers (force values instead of + * relying on the BIOS setting them correctly). + * - Further optimisations ? + * . for example ATA66+ regs 0x48 & 0x4A + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include + +#include "ide_modes.h" +#include "sis5513.h" + +/* When DEBUG is defined it outputs initial PCI config register + values and changes made to them by the driver */ +// #define DEBUG +/* When BROKEN_LEVEL is defined it limits the DMA mode + at boot time to its value */ +// #define BROKEN_LEVEL XFER_SW_DMA_0 + +/* Miscellaneaous flags */ +#define SIS5513_LATENCY 0x01 + +/* registers layout and init values are chipset family dependant */ +/* 1/ define families */ +#define ATA_00 0x00 +#define ATA_16 0x01 +#define ATA_33 0x02 +#define ATA_66 0x03 +#define ATA_100a 0x04 // SiS730 is ATA100 with ATA66 layout +#define ATA_100 0x05 +#define ATA_133a 0x06 // SiS961b with 133 support +#define ATA_133 0x07 // SiS962 +/* 2/ variable holding the controller chipset family value */ +static u8 chipset_family; + + +/* + * Debug code: following IDE config registers' changes + */ +#ifdef DEBUG +/* Copy of IDE Config registers fewer will be used + * Some odd chipsets hang if unused registers are accessed + * -> We only access them in #DEBUG code (then we'll see if SiS did + * it right from day one) */ +static u8 ide_regs_copy[0xff]; + +/* Read config registers, print differences from previous read */ +static void sis5513_load_verify_registers(struct pci_dev* dev, char* info) { + int i; + u8 reg_val; + u8 changed=0; + + printk("SIS5513: %s, changed registers:\n", info); + for(i=0; i<=0xff; i++) { + pci_read_config_byte(dev, i, ®_val); + if (reg_val != ide_regs_copy[i]) { + printk("%02x: %02x -> %02x\n", + i, ide_regs_copy[i], reg_val); + ide_regs_copy[i]=reg_val; + changed=1; + } + } + + if (!changed) { + printk("none\n"); + } +} + +/* Load config registers, no printing */ +static void sis5513_load_registers(struct pci_dev* dev) { + int i; + + for(i=0; i<=0xff; i++) { + pci_read_config_byte(dev, i, &(ide_regs_copy[i])); + } +} + +/* Print config space registers a la "lspci -vxxx" */ +static void sis5513_print_registers(struct pci_dev* dev, char* marker) { + int i,j; + + sis5513_load_registers(dev); + printk("SIS5513 %s\n", marker); + + for(i=0; i<=0xf; i++) { + printk("SIS5513 dump: %d" "0:", i); + for(j=0; j<=0xf; j++) { + printk(" %02x", ide_regs_copy[(i<<16)+j]); + } + printk("\n"); + } +} +#endif + + +/* + * Devices supported + */ +static const struct { + const char *name; + u16 host_id; + u8 chipset_family; + u8 flags; +} SiSHostChipInfo[] = { + { "SiS752", PCI_DEVICE_ID_SI_752, ATA_133, 0 }, + { "SiS751", PCI_DEVICE_ID_SI_751, ATA_133, 0 }, + { "SiS750", PCI_DEVICE_ID_SI_750, ATA_133, 0 }, + { "SiS748", PCI_DEVICE_ID_SI_748, ATA_133, 0 }, + { "SiS746", PCI_DEVICE_ID_SI_746, ATA_133, 0 }, + { "SiS745", PCI_DEVICE_ID_SI_745, ATA_133, 0 }, + { "SiS740", PCI_DEVICE_ID_SI_740, ATA_100, 0 }, + { "SiS735", PCI_DEVICE_ID_SI_735, ATA_100, SIS5513_LATENCY }, + { "SiS730", PCI_DEVICE_ID_SI_730, ATA_100a, SIS5513_LATENCY }, + { "SiS652", PCI_DEVICE_ID_SI_652, ATA_133, 0 }, + { "SiS651", PCI_DEVICE_ID_SI_651, ATA_133, 0 }, + { "SiS650", PCI_DEVICE_ID_SI_650, ATA_133, 0 }, + { "SiS648", PCI_DEVICE_ID_SI_648, ATA_133, 0 }, + { "SiS646", PCI_DEVICE_ID_SI_646, ATA_133, 0 }, + { "SiS645", PCI_DEVICE_ID_SI_645, ATA_133, 0 }, + { "SiS635", PCI_DEVICE_ID_SI_635, ATA_100, SIS5513_LATENCY }, + { "SiS640", PCI_DEVICE_ID_SI_640, ATA_66, SIS5513_LATENCY }, + { "SiS630", PCI_DEVICE_ID_SI_630, ATA_66, SIS5513_LATENCY }, + { "SiS620", PCI_DEVICE_ID_SI_620, ATA_66, SIS5513_LATENCY }, + { "SiS550", PCI_DEVICE_ID_SI_550, ATA_100a, 0}, + { "SiS540", PCI_DEVICE_ID_SI_540, ATA_66, 0}, + { "SiS530", PCI_DEVICE_ID_SI_530, ATA_66, 0}, + { "SiS5600", PCI_DEVICE_ID_SI_5600, ATA_33, 0}, + { "SiS5598", PCI_DEVICE_ID_SI_5598, ATA_33, 0}, + { "SiS5597", PCI_DEVICE_ID_SI_5597, ATA_33, 0}, + { "SiS5591", PCI_DEVICE_ID_SI_5591, ATA_33, 0}, + { "SiS5513", PCI_DEVICE_ID_SI_5513, ATA_16, 0}, + { "SiS5511", PCI_DEVICE_ID_SI_5511, ATA_16, 0}, +}; + +/* Cycle time bits and values vary accross chip dma capabilities + These three arrays hold the register layout and the values to set. + Indexed by chipset_family and (dma_mode - XFER_UDMA_0) */ + +/* {ATA_00, ATA_16, ATA_33, ATA_66, ATA_100a, ATA_100, ATA_133} */ +static u8 cycle_time_offset[] = {0,0,5,4,4,0,0}; +static u8 cycle_time_range[] = {0,0,2,3,3,4,4}; +static u8 cycle_time_value[][XFER_UDMA_6 - XFER_UDMA_0 + 1] = { + {0,0,0,0,0,0,0}, /* no udma */ + {0,0,0,0,0,0,0}, /* no udma */ + {3,2,1,0,0,0,0}, /* ATA_33 */ + {7,5,3,2,1,0,0}, /* ATA_66 */ + {7,5,3,2,1,0,0}, /* ATA_100a (730 specific), differences are on cycle_time range and offset */ + {11,7,5,4,2,1,0}, /* ATA_100 */ + {15,10,7,5,3,2,1}, /* ATA_133a (earliest 691 southbridges) */ + {15,10,7,5,3,2,1}, /* ATA_133 */ +}; +/* CRC Valid Setup Time vary accross IDE clock setting 33/66/100/133 + See SiS962 data sheet for more detail */ +static u8 cvs_time_value[][XFER_UDMA_6 - XFER_UDMA_0 + 1] = { + {0,0,0,0,0,0,0}, /* no udma */ + {0,0,0,0,0,0,0}, /* no udma */ + {2,1,1,0,0,0,0}, + {4,3,2,1,0,0,0}, + {4,3,2,1,0,0,0}, + {6,4,3,1,1,1,0}, + {9,6,4,2,2,2,2}, + {9,6,4,2,2,2,2}, +}; +/* Initialize time, Active time, Recovery time vary accross + IDE clock settings. These 3 arrays hold the register value + for PIO0/1/2/3/4 and DMA0/1/2 mode in order */ +static u8 ini_time_value[][8] = { + {0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0}, + {2,1,0,0,0,1,0,0}, + {4,3,1,1,1,3,1,1}, + {4,3,1,1,1,3,1,1}, + {6,4,2,2,2,4,2,2}, + {9,6,3,3,3,6,3,3}, + {9,6,3,3,3,6,3,3}, +}; +static u8 act_time_value[][8] = { + {0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0}, + {9,9,9,2,2,7,2,2}, + {19,19,19,5,4,14,5,4}, + {19,19,19,5,4,14,5,4}, + {28,28,28,7,6,21,7,6}, + {38,38,38,10,9,28,10,9}, + {38,38,38,10,9,28,10,9}, +}; +static u8 rco_time_value[][8] = { + {0,0,0,0,0,0,0,0}, + {0,0,0,0,0,0,0,0}, + {9,2,0,2,0,7,1,1}, + {19,5,1,5,2,16,3,2}, + {19,5,1,5,2,16,3,2}, + {30,9,3,9,4,25,6,4}, + {40,12,4,12,5,34,12,5}, + {40,12,4,12,5,34,12,5}, +}; + +static struct pci_dev *host_dev = NULL; + +/* + * Printing configuration + */ +#if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 sis_proc = 0; + +static struct pci_dev *bmide_dev; + +static char* cable_type[] = { + "80 pins", + "40 pins" +}; + +static char* recovery_time[] ={ + "12 PCICLK", "1 PCICLK", + "2 PCICLK", "3 PCICLK", + "4 PCICLK", "5 PCICLCK", + "6 PCICLK", "7 PCICLCK", + "8 PCICLK", "9 PCICLCK", + "10 PCICLK", "11 PCICLK", + "13 PCICLK", "14 PCICLK", + "15 PCICLK", "15 PCICLK" +}; + +static char* active_time[] = { + "8 PCICLK", "1 PCICLCK", + "2 PCICLK", "3 PCICLK", + "4 PCICLK", "5 PCICLK", + "6 PCICLK", "12 PCICLK" +}; + +static char* cycle_time[] = { + "Reserved", "2 CLK", + "3 CLK", "4 CLK", + "5 CLK", "6 CLK", + "7 CLK", "8 CLK", + "9 CLK", "10 CLK", + "11 CLK", "12 CLK", + "13 CLK", "14 CLK", + "15 CLK", "16 CLK" +}; + +static char* chipset_capability[] = { + "ATA", "ATA 16", + "ATA 33", "ATA 66", + "ATA 100", "ATA 100", + "ATA 133", "ATA 133" +}; + +/* Generic add master or slave info function */ +static char* get_drives_info (char *buffer, u8 pos) +{ + u8 reg00, reg01, reg10, reg11; /* timing registers */ + char* p = buffer; + +/* Postwrite/Prefetch */ + if (chipset_family < ATA_133) { + pci_read_config_byte(bmide_dev, 0x4b, ®00); + p += sprintf(p, "Drive %d: Postwrite %s \t \t Postwrite %s\n", + pos, (reg00 & (0x10 << pos)) ? "Enabled" : "Disabled", + (reg00 & (0x40 << pos)) ? "Enabled" : "Disabled"); + p += sprintf(p, " Prefetch %s \t \t Prefetch %s\n", + (reg00 & (0x01 << pos)) ? "Enabled" : "Disabled", + (reg00 & (0x04 << pos)) ? "Enabled" : "Disabled"); + pci_read_config_byte(bmide_dev, 0x40+2*pos, ®00); + pci_read_config_byte(bmide_dev, 0x41+2*pos, ®01); + pci_read_config_byte(bmide_dev, 0x44+2*pos, ®10); + pci_read_config_byte(bmide_dev, 0x45+2*pos, ®11); + } + + +/* UDMA */ + if (chipset_family >= ATA_33) { + p += sprintf(p, " UDMA %s \t \t \t UDMA %s\n", + (reg01 & 0x80) ? "Enabled" : "Disabled", + (reg11 & 0x80) ? "Enabled" : "Disabled"); + + p += sprintf(p, " UDMA Cycle Time "); + switch(chipset_family) { + case ATA_33: p += sprintf(p, cycle_time[(reg01 & 0x60) >> 5]); break; + case ATA_66: + case ATA_100a: p += sprintf(p, cycle_time[(reg01 & 0x70) >> 4]); break; + case ATA_100: + case ATA_133a: p += sprintf(p, cycle_time[reg01 & 0x0F]); break; + case ATA_133: + default: p += sprintf(p, "133+ ?"); break; + } + p += sprintf(p, " \t UDMA Cycle Time "); + switch(chipset_family) { + case ATA_33: p += sprintf(p, cycle_time[(reg11 & 0x60) >> 5]); break; + case ATA_66: + case ATA_100a: p += sprintf(p, cycle_time[(reg11 & 0x70) >> 4]); break; + case ATA_100: + case ATA_133a: p += sprintf(p, cycle_time[reg11 & 0x0F]); break; + case ATA_133: + default: p += sprintf(p, "133+ ?"); break; + } + p += sprintf(p, "\n"); + } + +/* Data Active */ + p += sprintf(p, " Data Active Time "); + switch(chipset_family) { + case ATA_00: + case ATA_16: /* confirmed */ + case ATA_33: + case ATA_66: + case ATA_100a: p += sprintf(p, active_time[reg01 & 0x07]); break; + case ATA_100: + case ATA_133a: p += sprintf(p, active_time[(reg00 & 0x70) >> 4]); break; + case ATA_133: + default: p += sprintf(p, "133+ ?"); break; + } + p += sprintf(p, " \t Data Active Time "); + switch(chipset_family) { + case ATA_00: + case ATA_16: + case ATA_33: + case ATA_66: + case ATA_100a: p += sprintf(p, active_time[reg11 & 0x07]); break; + case ATA_100: + case ATA_133a: p += sprintf(p, active_time[(reg10 & 0x70) >> 4]); break; + case ATA_133: + default: p += sprintf(p, "133+ ?"); break; + } + p += sprintf(p, "\n"); + +/* Data Recovery */ + /* warning: may need (reg&0x07) for pre ATA66 chips */ + if (chipset_family < ATA_133) { + p += sprintf(p, " Data Recovery Time %s \t Data Recovery Time %s\n", + recovery_time[reg00 & 0x0f], recovery_time[reg10 & 0x0f]); + } + + return p; +} + +static char* get_masters_info(char* buffer) +{ + return get_drives_info(buffer, 0); +} + +static char* get_slaves_info(char* buffer) +{ + return get_drives_info(buffer, 1); +} + +/* Main get_info, called on /proc/ide/sis reads */ +static int sis_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + u8 reg; + u16 reg2, reg3; + + p += sprintf(p, "\nSiS 5513 "); + switch(chipset_family) { + case ATA_00: p += sprintf(p, "Unknown???"); break; + case ATA_16: p += sprintf(p, "DMA 16"); break; + case ATA_33: p += sprintf(p, "Ultra 33"); break; + case ATA_66: p += sprintf(p, "Ultra 66"); break; + case ATA_100a: + case ATA_100: p += sprintf(p, "Ultra 100"); break; + case ATA_133a: + case ATA_133: p += sprintf(p, "Ultra 133"); break; + default: p+= sprintf(p, "Unknown???"); break; + } + p += sprintf(p, " chipset\n"); + p += sprintf(p, "--------------- Primary Channel " + "---------------- Secondary Channel " + "-------------\n"); + +/* Status */ + pci_read_config_byte(bmide_dev, 0x4a, ®); + if (chipset_family == ATA_133) { + pci_read_config_word(bmide_dev, 0x50, ®2); + pci_read_config_word(bmide_dev, 0x52, ®3); + } + p += sprintf(p, "Channel Status: "); + if (chipset_family < ATA_66) { + p += sprintf(p, "%s \t \t \t \t %s\n", + (reg & 0x04) ? "On" : "Off", + (reg & 0x02) ? "On" : "Off"); + } else if (chipset_family < ATA_133) { + p += sprintf(p, "%s \t \t \t \t %s \n", + (reg & 0x02) ? "On" : "Off", + (reg & 0x04) ? "On" : "Off"); + } else { /* ATA_133 */ + p += sprintf(p, "%s \t \t \t \t %s \n", + (reg2 & 0x02) ? "On" : "Off", + (reg3 & 0x02) ? "On" : "Off"); + } + +/* Operation Mode */ + pci_read_config_byte(bmide_dev, 0x09, ®); + p += sprintf(p, "Operation Mode: %s \t \t \t %s \n", + (reg & 0x01) ? "Native" : "Compatible", + (reg & 0x04) ? "Native" : "Compatible"); + +/* 80-pin cable ? */ + if (chipset_family >= ATA_133) { + p += sprintf(p, "Cable Type: %s \t \t \t %s\n", + (reg2 & 0x01) ? cable_type[1] : cable_type[0], + (reg3 & 0x01) ? cable_type[1] : cable_type[0]); + } else if (chipset_family > ATA_33) { + pci_read_config_byte(bmide_dev, 0x48, ®); + p += sprintf(p, "Cable Type: %s \t \t \t %s\n", + (reg & 0x10) ? cable_type[1] : cable_type[0], + (reg & 0x20) ? cable_type[1] : cable_type[0]); + } + +/* Prefetch Count */ + if (chipset_family < ATA_133) { + pci_read_config_word(bmide_dev, 0x4c, ®2); + pci_read_config_word(bmide_dev, 0x4e, ®3); + p += sprintf(p, "Prefetch Count: %d \t \t \t \t %d\n", + reg2, reg3); + } + + p = get_masters_info(p); + p = get_slaves_info(p); + + return p-buffer; +} +#endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static u8 sis5513_ratemask (ide_drive_t *drive) +{ +#if 0 + u8 rates[] = { 0, 0, 1, 2, 3, 3, 4, 4 }; + u8 mode = rates[chipset_family]; +#else + u8 mode; + + switch(chipset_family) { + case ATA_133: + case ATA_133a: + mode = 4; + break; + case ATA_100: + case ATA_100a: + mode = 3; + break; + case ATA_66: + mode = 2; + break; + case ATA_33: + return 1; + case ATA_16: + case ATA_00: + default: + return 0; + } +#endif + if (!eighty_ninty_three(drive)) + mode = min(mode, (u8)1); + return mode; +} + +static u8 sis5513_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + /* SIS's ratemask is between 0-4 and capped at UDMA133 */ + return min(speed, speed_max[sis5513_ratemask(drive)]); +#else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +/* + * Configuration functions + */ +/* Enables per-drive prefetch and postwrite */ +static void config_drive_art_rwp (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + + u8 reg4bh = 0; + u8 rw_prefetch = (0x11 << drive->dn); + +#ifdef DEBUG + printk("SIS5513: config_drive_art_rwp, drive %d\n", drive->dn); + sis5513_load_verify_registers(dev, "config_drive_art_rwp start"); +#endif + + if (drive->media != ide_disk) + return; + pci_read_config_byte(dev, 0x4b, ®4bh); + + if ((reg4bh & rw_prefetch) != rw_prefetch) + pci_write_config_byte(dev, 0x4b, reg4bh|rw_prefetch); +#ifdef DEBUG + sis5513_load_verify_registers(dev, "config_drive_art_rwp end"); +#endif +} + + +/* Set per-drive active and recovery time */ +static void config_art_rwp_pio (ide_drive_t *drive, u8 pio) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + + u8 timing, drive_pci, test1, test2; + + u16 eide_pio_timing[6] = {600, 390, 240, 180, 120, 90}; + u16 xfer_pio = drive->id->eide_pio_modes; + +#ifdef DEBUG + sis5513_load_verify_registers(dev, "config_drive_art_rwp_pio start"); +#endif + + config_drive_art_rwp(drive); + pio = ide_get_best_pio_mode(drive, 255, pio, NULL); + + if (xfer_pio> 4) + xfer_pio = 0; + + if (drive->id->eide_pio_iordy > 0) { + for (xfer_pio = 5; + (xfer_pio > 0) && + (drive->id->eide_pio_iordy > eide_pio_timing[xfer_pio]); + xfer_pio--); + } else { + xfer_pio = (drive->id->eide_pio_modes & 4) ? 0x05 : + (drive->id->eide_pio_modes & 2) ? 0x04 : + (drive->id->eide_pio_modes & 1) ? 0x03 : xfer_pio; + } + + timing = (xfer_pio >= pio) ? xfer_pio : pio; + +#ifdef DEBUG + printk("SIS5513: config_drive_art_rwp_pio, " + "drive %d, pio %d, timing %d\n", + drive->dn, pio, timing); +#endif + + /* In pre ATA_133 case, drives sit at 0x40 + 4*drive->dn */ + drive_pci = 0x40; + /* In SiS962 case drives sit at (0x40 or 0x70) + 8*drive->dn) */ + if (chipset_family >= ATA_133) { + u32 reg54h; + pci_read_config_dword(dev, 0x54, ®54h); + if (reg54h & 0x40000000) drive_pci = 0x70; +#if 0 + drive_pci |= ((drive->dn)*0x4); +#else + switch(drive->dn) { + case 0: drive_pci += 0x0; break; + case 1: drive_pci += 0x4; break; + case 2: drive_pci += 0x8; break; + case 3: drive_pci += 0xc; break; + default: return; + } +#endif + } else { +#if 0 + drive_pci |= ((drive->dn)*0x2); +#else + switch(drive->dn) { + case 0: drive_pci += 0x0; break; + case 1: drive_pci += 0x2; break; + case 2: drive_pci += 0x4; break; + case 3: drive_pci += 0x6; break; + default: return; + } +#endif + } + + /* register layout changed with newer ATA100 chips */ + if (chipset_family < ATA_100) { + pci_read_config_byte(dev, drive_pci, &test1); + pci_read_config_byte(dev, drive_pci+1, &test2); + + /* Clear active and recovery timings */ + test1 &= ~0x0F; + test2 &= ~0x07; + + switch(timing) { + case 4: test1 |= 0x01; test2 |= 0x03; break; + case 3: test1 |= 0x03; test2 |= 0x03; break; + case 2: test1 |= 0x04; test2 |= 0x04; break; + case 1: test1 |= 0x07; test2 |= 0x06; break; + default: break; + } + pci_write_config_byte(dev, drive_pci, test1); + pci_write_config_byte(dev, drive_pci+1, test2); + } else if (chipset_family < ATA_133) { + switch(timing) { /* active recovery + v v */ + case 4: test1 = 0x30|0x01; break; + case 3: test1 = 0x30|0x03; break; + case 2: test1 = 0x40|0x04; break; + case 1: test1 = 0x60|0x07; break; + default: break; + } + pci_write_config_byte(dev, drive_pci, test1); + } else { /* ATA_133 */ + u32 test3; + pci_read_config_dword(dev, drive_pci, &test3); + test3 &= 0xc0c00fff; + if (test3 & 0x08) { + test3 |= (unsigned long)ini_time_value[ATA_133-ATA_00][timing] << 12; + test3 |= (unsigned long)act_time_value[ATA_133-ATA_00][timing] << 16; + test3 |= (unsigned long)rco_time_value[ATA_133-ATA_00][timing] << 24; + } else { + test3 |= (unsigned long)ini_time_value[ATA_100-ATA_00][timing] << 12; + test3 |= (unsigned long)act_time_value[ATA_100-ATA_00][timing] << 16; + test3 |= (unsigned long)rco_time_value[ATA_100-ATA_00][timing] << 24; + } + pci_write_config_dword(dev, drive_pci, test3); + } + +#ifdef DEBUG + sis5513_load_verify_registers(dev, "config_drive_art_rwp_pio start"); +#endif +} + +static int config_chipset_for_pio (ide_drive_t *drive, u8 pio) +{ +#if 0 + config_art_rwp_pio(drive, pio); + return ide_config_drive_speed(drive, (XFER_PIO_0 + pio)); +#else + u8 speed; + + switch(pio) { + case 4: speed = XFER_PIO_4; break; + case 3: speed = XFER_PIO_3; break; + case 2: speed = XFER_PIO_2; break; + case 1: speed = XFER_PIO_1; break; + default: speed = XFER_PIO_0; break; + } + + config_art_rwp_pio(drive, pio); + return ide_config_drive_speed(drive, speed); +#endif +} + +static int sis5513_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + + u8 drive_pci, reg; + u32 regdw; + +#ifdef DEBUG + sis5513_load_verify_registers(dev, "sis5513_tune_chipset start"); + printk("SIS5513: sis5513_tune_chipset, drive %d, speed %d\n", + drive->dn, speed); +#endif + +#ifdef BROKEN_LEVEL +#ifdef DEBUG + printk("SIS5513: BROKEN_LEVEL activated, speed=%d -> speed=%d\n", xferspeed, BROKEN_LEVEL); +#endif + if (xferspeed > BROKEN_LEVEL) xferspeed = BROKEN_LEVEL; +#endif + + u8 speed = sis5513_ratefilter(drive, xferspeed); + + /* See config_art_rwp_pio for drive pci config registers */ + drive_pci = 0x40; + if (chipset_family >= ATA_133) { + u32 reg54h; + pci_read_config_dword(dev, 0x54, ®54h); + if (reg54h & 0x40000000) drive_pci = 0x70; + switch(drive->dn) { + case 0: drive_pci += 0x0; break; + case 1: drive_pci += 0x4; break; + case 2: drive_pci += 0x8; break; + case 3: drive_pci += 0xc; break; + default: return 0;; + } + pci_read_config_dword(dev, (unsigned long)drive_pci, ®dw); + /* Disable UDMA bit for non UDMA modes on UDMA chips */ + if (speed < XFER_UDMA_0) { + regdw &= 0xfffffffb; + pci_write_config_dword(dev, (unsigned long)drive_pci, regdw); + } + + } else { + switch(drive->dn) { + case 0: drive_pci += 0x0; break; + case 1: drive_pci += 0x2; break; + case 2: drive_pci += 0x4; break; + case 3: drive_pci += 0x6; break; + default: return 0; + } + pci_read_config_byte(dev, drive_pci+1, ®); + /* Disable UDMA bit for non UDMA modes on UDMA chips */ + if ((speed < XFER_UDMA_0) && (chipset_family > ATA_16)) { + reg &= 0x7F; + pci_write_config_byte(dev, drive_pci+1, reg); + } + } + + /* Config chip for mode */ + switch(speed) { +#ifdef CONFIG_BLK_DEV_IDEDMA + case XFER_UDMA_6: + case XFER_UDMA_5: + case XFER_UDMA_4: + case XFER_UDMA_3: + case XFER_UDMA_2: + case XFER_UDMA_1: + case XFER_UDMA_0: + if (chipset_family >= ATA_133) { + regdw |= 0x04; + regdw &= 0xfffff00f; + /* check if ATA133 enable */ + if (regdw & 0x08) { + regdw |= (unsigned long)cycle_time_value[ATA_133-ATA_00][speed-XFER_UDMA_0] << 4; + regdw |= (unsigned long)cvs_time_value[ATA_133-ATA_00][speed-XFER_UDMA_0] << 8; + } else { + /* if ATA133 disable, we should not set speed above UDMA5 */ + if (speed > XFER_UDMA_5) + speed = XFER_UDMA_5; + regdw |= (unsigned long)cycle_time_value[ATA_100-ATA_00][speed-XFER_UDMA_0] << 4; + regdw |= (unsigned long)cvs_time_value[ATA_100-ATA_00][speed-XFER_UDMA_0] << 8; + } + pci_write_config_dword(dev, (unsigned long)drive_pci, regdw); + } else { + /* Force the UDMA bit on if we want to use UDMA */ + reg |= 0x80; + /* clean reg cycle time bits */ + reg &= ~((0xFF >> (8 - cycle_time_range[chipset_family])) + << cycle_time_offset[chipset_family]); + /* set reg cycle time bits */ + reg |= cycle_time_value[chipset_family-ATA_00][speed-XFER_UDMA_0] + << cycle_time_offset[chipset_family]; + pci_write_config_byte(dev, drive_pci+1, reg); + } + break; + case XFER_MW_DMA_2: + case XFER_MW_DMA_1: + case XFER_MW_DMA_0: + case XFER_SW_DMA_2: + case XFER_SW_DMA_1: + case XFER_SW_DMA_0: + break; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + case XFER_PIO_4: return((int) config_chipset_for_pio(drive, 4)); + case XFER_PIO_3: return((int) config_chipset_for_pio(drive, 3)); + case XFER_PIO_2: return((int) config_chipset_for_pio(drive, 2)); + case XFER_PIO_1: return((int) config_chipset_for_pio(drive, 1)); + case XFER_PIO_0: + default: return((int) config_chipset_for_pio(drive, 0)); + } +#ifdef DEBUG + sis5513_load_verify_registers(dev, "sis5513_tune_chipset end"); +#endif + return ((int) ide_config_drive_speed(drive, speed)); +} + +static void sis5513_tune_drive (ide_drive_t *drive, u8 pio) +{ + (void) config_chipset_for_pio(drive, pio); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +/* + * ((id->hw_config & 0x4000|0x2000) && (HWIF(drive)->udma_four)) + */ +static int config_chipset_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + u8 speed = 0, mode = sis5513_ratemask(drive); + +#ifdef DEBUG + printk("SIS5513: config_chipset_for_dma, drive %d, ultra %x, udma_66 %x\n", + drive->dn, id->dma_ultra); +#endif + + switch(mode) { + case 0x04: + if (id->dma_ultra & 0x0040) + { speed = XFER_UDMA_6; break; } + case 0x03: + if (id->dma_ultra & 0x0020) + { speed = XFER_UDMA_5; break; } + case 0x02: + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_4; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_3; break; } + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_mword & 0x0001) + { speed = XFER_MW_DMA_0; break; } + if (id->dma_1word & 0x0004) + { speed = XFER_SW_DMA_2; break; } + if (id->dma_1word & 0x0002) + { speed = XFER_SW_DMA_1; break; } + if (id->dma_1word & 0x0001) + { speed = XFER_SW_DMA_0; break; } + default: + return 0; + } + sis5513_tune_chipset(drive, speed); + + return ((int) ((((id->dma_ultra >> 8) & 0x7F) || + ((id->dma_mword >> 8) & 0x07) || + ((id->dma_1word >> 8) & 0x07)) ? 1 : 0)); +} + +static int sis5513_config_drive_xfer_rate (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + drive->init_speed = 0; + + if (id && (id->capability & 1) && drive->autodma) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + if (id->field_valid & 4) { + if (id->dma_ultra & 0x007F) { + /* Force if Capable UltraDMA */ + int dma = config_chipset_for_dma(drive); + if ((id->field_valid & 2) && !dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + (id->dma_1word & 0x0007)) { + /* Force if Capable regular DMA modes */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!config_chipset_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + sis5513_tune_drive(drive, 5); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} + +/* initiates/aborts (U)DMA read/write operations on a drive. */ +static int sis5513_config_xfer_rate (ide_drive_t *drive) +{ + config_drive_art_rwp(drive); + config_art_rwp_pio(drive, 5); + return sis5513_config_drive_xfer_rate(drive); +} + +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +/* Chip detection and general config */ +static unsigned int __init init_chipset_sis5513 (struct pci_dev *dev, const char *name) +{ + struct pci_dev *host; + int i = 0; + + /* Find the chip */ + for (i = 0; i < ARRAY_SIZE(SiSHostChipInfo) && !host_dev; i++) { + host = pci_find_device (PCI_VENDOR_ID_SI, + SiSHostChipInfo[i].host_id, + NULL); + if (!host) + continue; + + host_dev = host; + chipset_family = SiSHostChipInfo[i].chipset_family; + + /* check 100/133 chipset family */ + if (chipset_family == ATA_133) { + u32 reg54h; + u16 reg02h; + pci_read_config_dword(dev, 0x54, ®54h); + pci_write_config_dword(dev, 0x54, (reg54h & 0x7fffffff)); + pci_read_config_word(dev, 0x02, ®02h); + pci_write_config_dword(dev, 0x54, reg54h); + /* devid 5518 here means SiS962 or later + which supports ATA133 */ + if (reg02h != 0x5518) { + u8 reg49h; + unsigned long sbrev; + /* SiS961 family */ + + /* + * FIXME !!! GAK!!!!!!!!!! PCI DIRECT POKING + */ + OUT_LONG(0x80001008, 0x0cf8); + sbrev = IN_LONG(0x0cfc); + + pci_read_config_byte(dev, 0x49, ®49h); + if (((sbrev & 0xff) == 0x10) && (reg49h & 0x80)) + chipset_family = ATA_133a; + else + chipset_family = ATA_100; + } + } + printk(SiSHostChipInfo[i].name); + printk(" %s controller", chipset_capability[chipset_family]); + printk("\n"); + +#ifdef DEBUG + sis5513_print_registers(dev, "pci_init_sis5513 start"); +#endif + + if (SiSHostChipInfo[i].flags & SIS5513_LATENCY) { + u8 latency = (chipset_family == ATA_100)? 0x80 : 0x10; /* Lacking specs */ + pci_write_config_byte(dev, PCI_LATENCY_TIMER, latency); + } + } + + /* Make general config ops here + 1/ tell IDE channels to operate in Compabitility mode only + 2/ tell old chips to allow per drive IDE timings */ + if (host_dev) { + u8 reg; + u16 regw; + switch(chipset_family) { + case ATA_133: + /* SiS962 operation mode */ + pci_read_config_word(dev, 0x50, ®w); + if (regw & 0x08) + pci_write_config_word(dev, 0x50, regw&0xfff7); + pci_read_config_word(dev, 0x52, ®w); + if (regw & 0x08) + pci_write_config_word(dev, 0x52, regw&0xfff7); + break; + case ATA_133a: + case ATA_100: + /* Set compatibility bit */ + pci_read_config_byte(dev, 0x49, ®); + if (!(reg & 0x01)) { + pci_write_config_byte(dev, 0x49, reg|0x01); + } + break; + case ATA_100a: + case ATA_66: + /* On ATA_66 chips the bit was elsewhere */ + pci_read_config_byte(dev, 0x52, ®); + if (!(reg & 0x04)) { + pci_write_config_byte(dev, 0x52, reg|0x04); + } + break; + case ATA_33: + /* On ATA_33 we didn't have a single bit to set */ + pci_read_config_byte(dev, 0x09, ®); + if ((reg & 0x0f) != 0x00) { + pci_write_config_byte(dev, 0x09, reg&0xf0); + } + case ATA_16: + /* force per drive recovery and active timings + needed on ATA_33 and below chips */ + pci_read_config_byte(dev, 0x52, ®); + if (!(reg & 0x08)) { + pci_write_config_byte(dev, 0x52, reg|0x08); + } + break; + case ATA_00: + default: break; + } + +#if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) + if (!sis_proc) { + sis_proc = 1; + bmide_dev = dev; + ide_pci_register_host_proc(&sis_procs[0]); + } +#endif + } +#ifdef DEBUG + sis5513_load_verify_registers(dev, "pci_init_sis5513 end"); +#endif + return 0; +} + +static unsigned int __init ata66_sis5513 (ide_hwif_t *hwif) +{ + u8 ata66 = 0; + + if (chipset_family >= ATA_133) { + u16 regw = 0; + u16 reg_addr = hwif->channel ? 0x52: 0x50; + pci_read_config_word(hwif->pci_dev, reg_addr, ®w); + ata66 = (regw & 0x8000) ? 0 : 1; + } else if (chipset_family >= ATA_66) { + u8 reg48h = 0; + u8 mask = hwif->channel ? 0x20 : 0x10; + pci_read_config_byte(hwif->pci_dev, 0x48, ®48h); + ata66 = (reg48h & mask) ? 0 : 1; + } + return ata66; +} + +static void __init init_hwif_sis5513 (ide_hwif_t *hwif) +{ + if (!hwif->irq) + hwif->irq = hwif->channel ? 15 : 14; + + hwif->tuneproc = &sis5513_tune_drive; + hwif->speedproc = &sis5513_tune_chipset; + hwif->ratemask = &sis5513_ratemask; + hwif->ratefilter = &sis5513_ratefilter; + hwif->autodma = 0; + + if (!(hwif->dma_base)) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + if (!host_dev) + return; + + if (!(hwif->udma_four)) + hwif->udma_four = ata66_sis5513(hwif); + + if (chipset_family > ATA_16) { + hwif->ide_dma_check = &sis5513_config_xfer_rate; + if (!noautodma) + hwif->autodma = 1; + } + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif + return; +} + +static void __init init_dma_sis5513 (ide_hwif_t *hwif, unsigned long dmabase) +{ + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_sis5513 (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init sis5513_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_SI) + return 0; + + for (d = sis5513_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/sis5513.h linux.20pre5-ac2/drivers/ide/pci/sis5513.h --- linux.20pre5/drivers/ide/pci/sis5513.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/sis5513.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,56 @@ +#ifndef SIS5513_H +#define SIS5513_H + +#include +#include +#include + +#define DISPLAY_SIS_TIMINGS + +#if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 sis_proc; + +static int sis_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t sis_procs[] __initdata = { +{ + name: "sis", + set: 1, + get_info: sis_get_info, + parent: NULL, + }, +}; +#endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static void init_setup_sis5513(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_sis5513(struct pci_dev *, const char *); +static void init_hwif_sis5513(ide_hwif_t *); +static void init_dma_sis5513(ide_hwif_t *, unsigned long); + +static ide_pci_device_t sis5513_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_SI, + device: PCI_DEVICE_ID_SI_5513, + name: "SIS5513", + init_setup: init_setup_sis5513, + init_chipset: init_chipset_sis5513, + init_iops: NULL, + init_hwif: init_hwif_sis5513, + init_dma: init_dma_sis5513, + channels: 2, + autodma: NOAUTODMA, + enablebits: {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, + bootable: ON_BOARD, + extra: 0 + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* SIS5513_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/sl82c105.c linux.20pre5-ac2/drivers/ide/pci/sl82c105.c --- linux.20pre5/drivers/ide/pci/sl82c105.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/sl82c105.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,300 @@ +/* + * linux/drivers/ide/sl82c105.c + * + * SL82C105/Winbond 553 IDE driver + * + * Maintainer unknown. + * + * Drive tuning added from Rebel.com's kernel sources + * -- Russell King (15/11/98) linux@arm.linux.org.uk + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "ide_modes.h" +#include "sl82c105.h" +#include "ide-noise.h" + +/* + * Convert a PIO mode and cycle time to the required on/off + * times for the interface. This has protection against run-away + * timings. + */ +static unsigned int get_timing_sl82c105(ide_pio_data_t *p) +{ + unsigned int cmd_on; + unsigned int cmd_off; + + cmd_on = (ide_pio_timings[p->pio_mode].active_time + 29) / 30; + cmd_off = (p->cycle_time - 30 * cmd_on + 29) / 30; + + if (cmd_on > 32) + cmd_on = 32; + if (cmd_on == 0) + cmd_on = 1; + + if (cmd_off > 32) + cmd_off = 32; + if (cmd_off == 0) + cmd_off = 1; + + return (cmd_on - 1) << 8 | (cmd_off - 1) | (p->use_iordy ? 0x40 : 0x00); +} + +/* + * Configure the drive and chipset for PIO + */ +static void config_for_pio(ide_drive_t *drive, int pio, int report) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + ide_pio_data_t p; + u16 drv_ctrl = 0x909; + unsigned int xfer_mode, reg; + + reg = (hwif->channel ? 0x4c : 0x44) + (drive->select.b.unit ? 4 : 0); + + pio = ide_get_best_pio_mode(drive, pio, 5, &p); + + xfer_mode = XFER_PIO_0 + pio; + + if (ide_config_drive_speed(drive, xfer_mode) == 0) + drv_ctrl = get_timing_sl82c105(&p); + + if (drive->using_dma == 0) { + /* + * If we are actually using MW DMA, then we can not + * reprogram the interface drive control register. + */ + pci_write_config_word(dev, reg, drv_ctrl); + pci_read_config_word(dev, reg, &drv_ctrl); + + if (report) { + printk("%s: selected %s (%dns) (%04X)\n", drive->name, + ide_xfer_verbose(xfer_mode), p.cycle_time, drv_ctrl); + } + } +} + +/* + * Configure the drive and the chipset for DMA + */ +static int config_for_dma (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u16 drv_ctrl = 0x909; + unsigned int reg; + + reg = (hwif->channel ? 0x4c : 0x44) + (drive->select.b.unit ? 4 : 0); + + if (ide_config_drive_speed(drive, XFER_MW_DMA_2) == 0) + drv_ctrl = 0x0240; + + pci_write_config_word(dev, reg, drv_ctrl); + + return 0; +} + +/* + * Check to see if the drive and + * chipset is capable of DMA mode + */ + +static int sl82c105_check_drive (ide_drive_t *drive) +{ + do { + struct hd_driveid *id = drive->id; + + if (!drive->autodma) + break; + + if (!id || !(id->capability & 1)) + break; + + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + break; + + if (id->field_valid & 2) { + if (id->dma_mword & 7 || id->dma_1word & 7) + return HWIF(drive)->ide_dma_on(drive); + } + + if (HWIF(drive)->ide_dma_good_drive(drive)) + return HWIF(drive)->ide_dma_on(drive); + } while (0); + + return HWIF(drive)->ide_dma_off_quietly(drive); +} + +static int sl82c105_ide_dma_on (ide_drive_t *drive) +{ + if (config_for_dma(drive)) { + config_for_pio(drive, 4, 0); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return __ide_dma_on(drive); +} + +static int sl82c105_ide_dma_off (ide_drive_t *drive) +{ + config_for_pio(drive, 4, 0); + return __ide_dma_off(drive); +} + +static int sl82c105_ide_dma_off_quietly (ide_drive_t *drive) +{ + config_for_pio(drive, 4, 0); + return __ide_dma_off_quietly(drive); +} + +/* + * We only deal with PIO mode here - DMA mode 'using_dma' is not + * initialised at the point that this function is called. + */ +static void tune_sl82c105(ide_drive_t *drive, u8 pio) +{ + config_for_pio(drive, pio, 1); + + /* + * We support 32-bit I/O on this interface, and it + * doesn't have problems with interrupts. + */ + drive->io_32bit = 1; + drive->unmask = 1; +} + +/* + * Return the revision of the Winbond bridge + * which this function is part of. + */ +static unsigned int sl82c105_bridge_revision(struct pci_dev *dev) +{ + struct pci_dev *bridge; + u8 rev; + + bridge = pci_find_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553, NULL); + + /* + * If we are part of a Winbond 553 + */ + if (!bridge || bridge->class >> 8 != PCI_CLASS_BRIDGE_ISA) + return -1; + + if (bridge->bus != dev->bus || + PCI_SLOT(bridge->devfn) != PCI_SLOT(dev->devfn)) + return -1; + + /* + * We need to find function 0's revision, not function 1 + */ + pci_read_config_byte(bridge, PCI_REVISION_ID, &rev); + + return rev; +} + +/* + * Enable the PCI device + */ +static unsigned int __init init_chipset_sl82c105(struct pci_dev *dev, const char *msg) +{ + u8 ctrl_stat; + + /* + * Enable the ports + */ + pci_read_config_byte(dev, 0x40, &ctrl_stat); + pci_write_config_byte(dev, 0x40, ctrl_stat | 0x33); + + return dev->irq; +} + +static void __init dma_init_sl82c105(ide_hwif_t *hwif, unsigned long dma_base) +{ + unsigned int rev; + u8 dma_state; + + hwif->autodma = 0; + + if (!dma_base) + return; + + dma_state = hwif->INB(dma_base + 2); + rev = sl82c105_bridge_revision(hwif->pci_dev); + if (rev <= 5) { + hwif->drives[0].autotune = 1; + hwif->drives[1].autotune = 1; + printk(" %s: Winbond 553 bridge revision %d, BM-DMA disabled\n", + hwif->name, rev); + dma_state &= ~0x60; + } else { + dma_state |= 0x60; + if (!noautodma) + hwif->autodma = 1; + } + hwif->OUTB(dma_state, dma_base + 2); + + ide_setup_dma(hwif, dma_base, 8); +} + +/* + * Initialise the chip + */ + +static void __init init_hwif_sl82c105(ide_hwif_t *hwif) +{ + hwif->tuneproc = tune_sl82c105; + + if (!hwif->dma_base) + return; + +#ifdef CONFIG_BLK_DEV_IDEDMA + hwif->ide_dma_check = &sl82c105_check_drive; + hwif->ide_dma_on = &sl82c105_ide_dma_on; + hwif->ide_dma_off = &sl82c105_ide_dma_off; + hwif->ide_dma_off_quietly = &sl82c105_ide_dma_off_quietly; + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_sl82c105 (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init sl82c105_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_WINBOND) + return 0; + + for (d = sl82c105_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/sl82c105.h linux.20pre5-ac2/drivers/ide/pci/sl82c105.h --- linux.20pre5/drivers/ide/pci/sl82c105.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/sl82c105.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,36 @@ +#ifndef W82C105_H +#define W82C105_H + +#include +#include +#include + +static void init_setup_sl82c105(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_sl82c105(struct pci_dev *, const char *); +static void init_hwif_sl82c105(ide_hwif_t *); +static void init_dma_sl82c105(ide_hwif_t *, unsigned long); + +static ide_pci_device_t sl82c105_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_WINBOND, + device: PCI_DEVICE_ID_WINBOND_82C105, + name: "W82C105", + init_setup: init_setup_sl82c105, + init_chipset: init_chipset_sl82c105, + init_iops: NULL, + init_hwif: init_hwif_sl82c105, + init_dma: init_dma_sl82c105, + channels: 2, + autodma: NOAUTODMA, + enablebits: {{0x40,0x01,0x01}, {0x40,0x10,0x10}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* W82C105_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/slc90e66.c linux.20pre5-ac2/drivers/ide/pci/slc90e66.c --- linux.20pre5/drivers/ide/pci/slc90e66.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/slc90e66.c 2002-09-01 18:03:15.000000000 +0100 @@ -0,0 +1,424 @@ +/* + * linux/drivers/ide/slc90e66.c Version 0.10 October 4, 2000 + * + * Copyright (C) 2000-2002 Andre Hedrick + * + * This a look-a-like variation of the ICH0 PIIX4 Ultra-66, + * but this keeps the ISA-Bridge and slots alive. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ide_modes.h" +#include "slc90e66.h" + +#if defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 slc90e66_proc = 0; +static struct pci_dev *bmide_dev; + +static int slc90e66_get_info (char *buffer, char **addr, off_t offset, int count) +{ + char *p = buffer; + u32 bibma = pci_resource_start(bmide_dev, 4); + u16 reg40 = 0, psitre = 0, reg42 = 0, ssitre = 0; + u8 c0 = 0, c1 = 0; + u8 reg44 = 0, reg47 = 0, reg48 = 0, reg4a = 0, reg4b = 0; + + pci_read_config_word(bmide_dev, 0x40, ®40); + pci_read_config_word(bmide_dev, 0x42, ®42); + pci_read_config_byte(bmide_dev, 0x44, ®44); + pci_read_config_byte(bmide_dev, 0x47, ®47); + pci_read_config_byte(bmide_dev, 0x48, ®48); + pci_read_config_byte(bmide_dev, 0x4a, ®4a); + pci_read_config_byte(bmide_dev, 0x4b, ®4b); + + psitre = (reg40 & 0x4000) ? 1 : 0; + ssitre = (reg42 & 0x4000) ? 1 : 0; + + /* + * at that point bibma+0x2 et bibma+0xa are byte registers + * to investigate: + */ + c0 = inb_p(bibma + 0x02); + c1 = inb_p(bibma + 0x0a); + + p += sprintf(p, " SLC90E66 Chipset.\n"); + p += sprintf(p, "--------------- Primary Channel " + "---------------- Secondary Channel " + "-------------\n"); + p += sprintf(p, " %sabled " + " %sabled\n", + (c0&0x80) ? "dis" : " en", + (c1&0x80) ? "dis" : " en"); + p += sprintf(p, "--------------- drive0 --------- drive1 " + "-------- drive0 ---------- drive1 ------\n"); + p += sprintf(p, "DMA enabled: %s %s " + " %s %s\n", + (c0&0x20) ? "yes" : "no ", + (c0&0x40) ? "yes" : "no ", + (c1&0x20) ? "yes" : "no ", + (c1&0x40) ? "yes" : "no " ); + p += sprintf(p, "UDMA enabled: %s %s " + " %s %s\n", + (reg48&0x01) ? "yes" : "no ", + (reg48&0x02) ? "yes" : "no ", + (reg48&0x04) ? "yes" : "no ", + (reg48&0x08) ? "yes" : "no " ); + p += sprintf(p, "UDMA enabled: %s %s " + " %s %s\n", + ((reg4a&0x04)==0x04) ? "4" : + ((reg4a&0x03)==0x03) ? "3" : + (reg4a&0x02) ? "2" : + (reg4a&0x01) ? "1" : + (reg4a&0x00) ? "0" : "X", + ((reg4a&0x40)==0x40) ? "4" : + ((reg4a&0x30)==0x30) ? "3" : + (reg4a&0x20) ? "2" : + (reg4a&0x10) ? "1" : + (reg4a&0x00) ? "0" : "X", + ((reg4b&0x04)==0x04) ? "4" : + ((reg4b&0x03)==0x03) ? "3" : + (reg4b&0x02) ? "2" : + (reg4b&0x01) ? "1" : + (reg4b&0x00) ? "0" : "X", + ((reg4b&0x40)==0x40) ? "4" : + ((reg4b&0x30)==0x30) ? "3" : + (reg4b&0x20) ? "2" : + (reg4b&0x10) ? "1" : + (reg4b&0x00) ? "0" : "X"); + + p += sprintf(p, "UDMA\n"); + p += sprintf(p, "DMA\n"); + p += sprintf(p, "PIO\n"); + +/* + * FIXME.... Add configuration junk data....blah blah...... + */ + + return p-buffer; /* => must be less than 4k! */ +} +#endif /* defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static u8 slc90e66_ratemask (ide_drive_t *drive) +{ + u8 mode = 2; + + if (!eighty_ninty_three(drive)) + mode = min(mode, (u8)1); + return mode; +} + +static u8 slc90e66_ratefilter (ide_drive_t *drive, u8 speed) +{ +#ifdef CONFIG_BLK_DEV_IDEDMA + static u8 speed_max[] = { + XFER_MW_DMA_2, XFER_UDMA_2, XFER_UDMA_4, + XFER_UDMA_5, XFER_UDMA_6 + }; + /* EFAR's ratemask is between 0-2 and capped at UDMA66 */ + return min(speed, speed_max[slc90e66_ratemask(drive)]); +#else + return min(speed, XFER_PIO_4); +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +static u8 slc90e66_dma_2_pio (u8 xfer_rate) { + switch(xfer_rate) { + case XFER_UDMA_4: + case XFER_UDMA_3: + case XFER_UDMA_2: + case XFER_UDMA_1: + case XFER_UDMA_0: + case XFER_MW_DMA_2: + case XFER_PIO_4: + return 4; + case XFER_MW_DMA_1: + case XFER_PIO_3: + return 3; + case XFER_SW_DMA_2: + case XFER_PIO_2: + return 2; + case XFER_MW_DMA_0: + case XFER_SW_DMA_1: + case XFER_SW_DMA_0: + case XFER_PIO_1: + case XFER_PIO_0: + case XFER_PIO_SLOW: + default: + return 0; + } +} + +/* + * Based on settings done by AMI BIOS + * (might be useful if drive is not registered in CMOS for any reason). + */ +static void slc90e66_tune_drive (ide_drive_t *drive, u8 pio) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + int is_slave = (&hwif->drives[1] == drive); + int master_port = hwif->channel ? 0x42 : 0x40; + int slave_port = 0x44; + unsigned long flags; + u16 master_data; + u8 slave_data; + /* ISP RTC */ + u8 timings[][2] = { { 0, 0 }, + { 0, 0 }, + { 1, 0 }, + { 2, 1 }, + { 2, 3 }, }; + + pio = ide_get_best_pio_mode(drive, pio, 5, NULL); + spin_lock_irqsave(&io_request_lock, flags); + pci_read_config_word(dev, master_port, &master_data); + if (is_slave) { + master_data = master_data | 0x4000; + if (pio > 1) + /* enable PPE, IE and TIME */ + master_data = master_data | 0x0070; + pci_read_config_byte(dev, slave_port, &slave_data); + slave_data = slave_data & (hwif->channel ? 0x0f : 0xf0); + slave_data = slave_data | (((timings[pio][0] << 2) | timings[pio][1]) << (hwif->channel ? 4 : 0)); + } else { + master_data = master_data & 0xccf8; + if (pio > 1) + /* enable PPE, IE and TIME */ + master_data = master_data | 0x0007; + master_data = master_data | (timings[pio][0] << 12) | (timings[pio][1] << 8); + } + pci_write_config_word(dev, master_port, master_data); + if (is_slave) + pci_write_config_byte(dev, slave_port, slave_data); + spin_unlock_irqrestore(&io_request_lock, flags); +} + +static int slc90e66_tune_chipset (ide_drive_t *drive, u8 xferspeed) +{ + ide_hwif_t *hwif = HWIF(drive); + struct pci_dev *dev = hwif->pci_dev; + u8 maslave = hwif->channel ? 0x42 : 0x40; + u8 speed = slc90e66_ratefilter(drive, xferspeed); + int a_speed = 7 << (drive->dn * 4); + int u_flag = 1 << drive->dn; + int u_speed = 0; + int sitre; + u16 reg4042, reg44, reg48, reg4a; + + pci_read_config_word(dev, maslave, ®4042); + sitre = (reg4042 & 0x4000) ? 1 : 0; + pci_read_config_word(dev, 0x44, ®44); + pci_read_config_word(dev, 0x48, ®48); + pci_read_config_word(dev, 0x4a, ®4a); + + switch(speed) { +#ifdef CONFIG_BLK_DEV_IDEDMA + case XFER_UDMA_4: u_speed = 4 << (drive->dn * 4); break; + case XFER_UDMA_3: u_speed = 3 << (drive->dn * 4); break; + case XFER_UDMA_2: u_speed = 2 << (drive->dn * 4); break; + case XFER_UDMA_1: u_speed = 1 << (drive->dn * 4); break; + case XFER_UDMA_0: u_speed = 0 << (drive->dn * 4); break; + case XFER_MW_DMA_2: + case XFER_MW_DMA_1: + case XFER_SW_DMA_2: break; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + case XFER_PIO_4: + case XFER_PIO_3: + case XFER_PIO_2: + case XFER_PIO_0: break; + default: return -1; + } + + if (speed >= XFER_UDMA_0) { + if (!(reg48 & u_flag)) + pci_write_config_word(dev, 0x48, reg48|u_flag); + if ((reg4a & u_speed) != u_speed) { + pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); + pci_read_config_word(dev, 0x4a, ®4a); + pci_write_config_word(dev, 0x4a, reg4a|u_speed); + } + } else { + if (reg48 & u_flag) + pci_write_config_word(dev, 0x48, reg48 & ~u_flag); + if (reg4a & a_speed) + pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); + } + + slc90e66_tune_drive(drive, slc90e66_dma_2_pio(speed)); + return (ide_config_drive_speed(drive, speed)); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +static int slc90e66_config_drive_for_dma (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + u8 mode = slc90e66_ratemask(drive); + u8 speed = 0, tspeed = 0; + + switch(mode) { + case 0x02: + if (id->dma_ultra & 0x0010) + { speed = XFER_UDMA_4; break; } + if (id->dma_ultra & 0x0008) + { speed = XFER_UDMA_3; break; } + case 0x01: + if (id->dma_ultra & 0x0004) + { speed = XFER_UDMA_2; break; } + if (id->dma_ultra & 0x0002) + { speed = XFER_UDMA_1; break; } + if (id->dma_ultra & 0x0001) + { speed = XFER_UDMA_0; break; } + case 0x00: + if (id->dma_mword & 0x0004) + { speed = XFER_MW_DMA_2; break; } + if (id->dma_mword & 0x0002) + { speed = XFER_MW_DMA_1; break; } + if (id->dma_1word & 0x0004) + { speed = XFER_SW_DMA_2; break; } + default: + tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL); + speed = slc90e66_dma_2_pio(XFER_PIO_0 + tspeed); + break; + } + + (void) slc90e66_tune_chipset(drive, speed); + + return ((int) ((((id->dma_ultra >> 8) & 0x1F) || + ((id->dma_mword >> 8) & 0x06) || + ((id->dma_1word >> 8) & 0x04)) ? 1 : 0)); +} + +static int slc90e66_config_drive_xfer_rate (ide_drive_t *drive) +{ + struct hd_driveid *id = drive->id; + + drive->init_speed = 0; + + if (id && (id->capability & 1) && drive->autodma) { + /* Consult the list of known "bad" drives */ + if (HWIF(drive)->ide_dma_bad_drive(drive)) + goto fast_ata_pio; + + if (id->field_valid & 4) { + if (id->dma_ultra & 0x001F) { + /* Force if Capable UltraDMA */ + int dma = slc90e66_config_drive_for_dma(drive); + if ((id->field_valid & 2) && !dma) + goto try_dma_modes; + } + } else if (id->field_valid & 2) { +try_dma_modes: + if ((id->dma_mword & 0x0007) || + (id->dma_1word & 0x0007)) { + /* Force if Capable regular DMA modes */ + if (!slc90e66_config_drive_for_dma(drive)) + goto no_dma_set; + } + } else if (HWIF(drive)->ide_dma_good_drive(drive) && + (id->eide_dma_time < 150)) { + /* Consult the list of known "good" drives */ + if (!slc90e66_config_drive_for_dma(drive)) + goto no_dma_set; + } else { + goto fast_ata_pio; + } + } else if ((id->capability & 8) || (id->field_valid & 2)) { +fast_ata_pio: +no_dma_set: + slc90e66_tune_drive(drive, 5); + return HWIF(drive)->ide_dma_off_quietly(drive); + } + return HWIF(drive)->ide_dma_on(drive); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +static unsigned int __init init_chipset_slc90e66 (struct pci_dev *dev, const char *name) +{ +#if defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) + if (!slc90e66_proc) { + slc90e66_proc = 1; + bmide_dev = dev; + ide_pci_register_host_proc(&slc90e66_procs[0]); + } +#endif /* DISPLAY_SLC90E66_TIMINGS && CONFIG_PROC_FS */ + return 0; +} + +static void __init init_hwif_slc90e66 (ide_hwif_t *hwif) +{ + u8 reg47 = 0; + u8 mask = hwif->channel ? 0x01 : 0x02; /* bit0:Primary */ + + if (!hwif->irq) + hwif->irq = hwif->channel ? 15 : 14; + + hwif->autodma = 0; + hwif->speedproc = &slc90e66_tune_chipset; + hwif->tuneproc = &slc90e66_tune_drive; + hwif->ratemask = &slc90e66_ratemask; + hwif->ratefilter = &slc90e66_ratefilter; + + pci_read_config_byte(hwif->pci_dev, 0x47, ®47); + + if (!hwif->dma_base) { + hwif->drives[0].autotune = hwif->drives[1].autotune = 1; + return; + } + +#ifdef CONFIG_BLK_DEV_IDEDMA + if (!(hwif->udma_four)) + /* bit[0(1)]: 0:80, 1:40 */ + hwif->udma_four = (reg47 & mask) ? 0 : 1; + + hwif->ide_dma_check = &slc90e66_config_drive_xfer_rate; + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* !CONFIG_BLK_DEV_IDEDMA */ +} + +static void __init init_dma_slc90e66 (ide_hwif_t *hwif, unsigned long dmabase) +{ + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +static void __init init_setup_slc90e66 (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init slc90e66_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_EFAR) + return 0; + + for (d = slc90e66_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/slc90e66.h linux.20pre5-ac2/drivers/ide/pci/slc90e66.h --- linux.20pre5/drivers/ide/pci/slc90e66.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/slc90e66.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,58 @@ +#ifndef SLC90E66_H +#define SLC90E66_H + +#include +#include +#include + +#define DISPLAY_SLC90E66_TIMINGS + +#define SLC90E66_DEBUG_DRIVE_INFO 0 + +#if defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 slc90e66_proc; + +static int slc90e66_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t slc90e66_procs[] __initdata = { + { + name: "slc90e66", + set: 1, + get_info: slc90e66_get_info, + parent: NULL, + }, +}; +#endif /* defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) */ + +static void init_setup_slc90e66(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_slc90e66(struct pci_dev *, const char *); +static void init_hwif_slc90e66(ide_hwif_t *); +static void init_dma_slc90e66(ide_hwif_t *, unsigned long); + +static ide_pci_device_t slc90e66_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_EFAR, + device: PCI_DEVICE_ID_EFAR_SLC90E66_1, + name: "SLC90E66", + init_setup: init_setup_slc90e66, + init_chipset: init_chipset_slc90e66, + init_iops: NULL, + init_hwif: init_hwif_slc90e66, + init_dma: init_dma_slc90e66, + channels: 2, + autodma: AUTODMA, + enablebits: {{0x41,0x80,0x80}, {0x43,0x80,0x80}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* SLC90E66_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/trm290.c linux.20pre5-ac2/drivers/ide/pci/trm290.c --- linux.20pre5/drivers/ide/pci/trm290.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/trm290.c 2002-09-01 18:03:24.000000000 +0100 @@ -0,0 +1,421 @@ +/* + * linux/drivers/ide/trm290.c Version 1.02 Mar. 18, 2000 + * + * Copyright (c) 1997-1998 Mark Lord + * May be copied or modified under the terms of the GNU General Public License + */ + +/* + * This module provides support for the bus-master IDE DMA function + * of the Tekram TRM290 chip, used on a variety of PCI IDE add-on boards, + * including a "Precision Instruments" board. The TRM290 pre-dates + * the sff-8038 standard (ide-dma.c) by a few months, and differs + * significantly enough to warrant separate routines for some functions, + * while re-using others from ide-dma.c. + * + * EXPERIMENTAL! It works for me (a sample of one). + * + * Works reliably for me in DMA mode (READs only), + * DMA WRITEs are disabled by default (see #define below); + * + * DMA is not enabled automatically for this chipset, + * but can be turned on manually (with "hdparm -d1") at run time. + * + * I need volunteers with "spare" drives for further testing + * and development, and maybe to help figure out the peculiarities. + * Even knowing the registers (below), some things behave strangely. + */ + +#define TRM290_NO_DMA_WRITES /* DMA writes seem unreliable sometimes */ + +/* + * TRM-290 PCI-IDE2 Bus Master Chip + * ================================ + * The configuration registers are addressed in normal I/O port space + * and are used as follows: + * + * trm290_base depends on jumper settings, and is probed for by ide-dma.c + * + * trm290_base+2 when WRITTEN: chiptest register (byte, write-only) + * bit7 must always be written as "1" + * bits6-2 undefined + * bit1 1=legacy_compatible_mode, 0=native_pci_mode + * bit0 1=test_mode, 0=normal(default) + * + * trm290_base+2 when READ: status register (byte, read-only) + * bits7-2 undefined + * bit1 channel0 busmaster interrupt status 0=none, 1=asserted + * bit0 channel0 interrupt status 0=none, 1=asserted + * + * trm290_base+3 Interrupt mask register + * bits7-5 undefined + * bit4 legacy_header: 1=present, 0=absent + * bit3 channel1 busmaster interrupt status 0=none, 1=asserted (read only) + * bit2 channel1 interrupt status 0=none, 1=asserted (read only) + * bit1 channel1 interrupt mask: 1=masked, 0=unmasked(default) + * bit0 channel0 interrupt mask: 1=masked, 0=unmasked(default) + * + * trm290_base+1 "CPR" Config Pointer Register (byte) + * bit7 1=autoincrement CPR bits 2-0 after each access of CDR + * bit6 1=min. 1 wait-state posted write cycle (default), 0=0 wait-state + * bit5 0=enabled master burst access (default), 1=disable (write only) + * bit4 PCI DEVSEL# timing select: 1=medium(default), 0=fast + * bit3 0=primary IDE channel, 1=secondary IDE channel + * bits2-0 register index for accesses through CDR port + * + * trm290_base+0 "CDR" Config Data Register (word) + * two sets of seven config registers, + * selected by CPR bit 3 (channel) and CPR bits 2-0 (index 0 to 6), + * each index defined below: + * + * Index-0 Base address register for command block (word) + * defaults: 0x1f0 for primary, 0x170 for secondary + * + * Index-1 general config register (byte) + * bit7 1=DMA enable, 0=DMA disable + * bit6 1=activate IDE_RESET, 0=no action (default) + * bit5 1=enable IORDY, 0=disable IORDY (default) + * bit4 0=16-bit data port(default), 1=8-bit (XT) data port + * bit3 interrupt polarity: 1=active_low, 0=active_high(default) + * bit2 power-saving-mode(?): 1=enable, 0=disable(default) (write only) + * bit1 bus_master_mode(?): 1=enable, 0=disable(default) + * bit0 enable_io_ports: 1=enable(default), 0=disable + * + * Index-2 read-ahead counter preload bits 0-7 (byte, write only) + * bits7-0 bits7-0 of readahead count + * + * Index-3 read-ahead config register (byte, write only) + * bit7 1=enable_readahead, 0=disable_readahead(default) + * bit6 1=clear_FIFO, 0=no_action + * bit5 undefined + * bit4 mode4 timing control: 1=enable, 0=disable(default) + * bit3 undefined + * bit2 undefined + * bits1-0 bits9-8 of read-ahead count + * + * Index-4 base address register for control block (word) + * defaults: 0x3f6 for primary, 0x376 for secondary + * + * Index-5 data port timings (shared by both drives) (byte) + * standard PCI "clk" (clock) counts, default value = 0xf5 + * + * bits7-6 setup time: 00=1clk, 01=2clk, 10=3clk, 11=4clk + * bits5-3 hold time: 000=1clk, 001=2clk, 010=3clk, + * 011=4clk, 100=5clk, 101=6clk, + * 110=8clk, 111=12clk + * bits2-0 active time: 000=2clk, 001=3clk, 010=4clk, + * 011=5clk, 100=6clk, 101=8clk, + * 110=12clk, 111=16clk + * + * Index-6 command/control port timings (shared by both drives) (byte) + * same layout as Index-5, default value = 0xde + * + * Suggested CDR programming for PIO mode0 (600ns): + * 0x01f0,0x21,0xff,0x80,0x03f6,0xf5,0xde ; primary + * 0x0170,0x21,0xff,0x80,0x0376,0xf5,0xde ; secondary + * + * Suggested CDR programming for PIO mode3 (180ns): + * 0x01f0,0x21,0xff,0x80,0x03f6,0x09,0xde ; primary + * 0x0170,0x21,0xff,0x80,0x0376,0x09,0xde ; secondary + * + * Suggested CDR programming for PIO mode4 (120ns): + * 0x01f0,0x21,0xff,0x80,0x03f6,0x00,0xde ; primary + * 0x0170,0x21,0xff,0x80,0x0376,0x00,0xde ; secondary + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "trm290.h" + +static void trm290_prepare_drive (ide_drive_t *drive, unsigned int use_dma) +{ + ide_hwif_t *hwif = HWIF(drive); + u16 reg = 0; + unsigned long flags; + + /* select PIO or DMA */ + reg = use_dma ? (0x21 | 0x82) : (0x21 & ~0x82); + + local_irq_save(flags); + + if (reg != hwif->select_data) { + hwif->select_data = reg; + /* set PIO/DMA */ + hwif->OUTB(0x51|(hwif->channel<<3), hwif->config_data+1); + hwif->OUTW(reg & 0xff, hwif->config_data); + } + + /* enable IRQ if not probing */ + if (drive->present) { + reg = hwif->INW(hwif->config_data + 3); + reg &= 0x13; + reg &= ~(1 << hwif->channel); + hwif->OUTW(reg, hwif->config_data+3); + } + + local_irq_restore(flags); +} + +static void trm290_selectproc (ide_drive_t *drive) +{ + trm290_prepare_drive(drive, drive->using_dma); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +static int trm290_ide_dma_write (ide_drive_t *drive /*, struct request *rq */) +{ + ide_hwif_t *hwif = HWIF(drive); + struct request *rq = HWGROUP(drive)->rq; +// ide_task_t *args = rq->special; + task_ioreg_t command = WIN_NOP; + unsigned int count, reading = 2, writing = 0; + + reading = 0; + writing = 1; +#ifdef TRM290_NO_DMA_WRITES + /* always use PIO for writes */ + trm290_prepare_drive(drive, 0); /* select PIO xfer */ + return 1; +#endif + if (!(count = ide_build_dmatable(drive, rq))) { + /* try PIO instead of DMA */ + trm290_prepare_drive(drive, 0); /* select PIO xfer */ + return 1; + } + /* select DMA xfer */ + trm290_prepare_drive(drive, 1); + hwif->OUTL(hwif->dmatable_dma|reading|writing, hwif->dma_command); + drive->waiting_for_dma = 1; + /* start DMA */ + hwif->OUTW((count * 2) - 1, hwif->dma_status); + if (drive->media != ide_disk) + return 0; + if (HWGROUP(drive)->handler != NULL) /* paranoia check */ + BUG(); + ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); + /* + * FIX ME to use only ACB ide_task_t args Struct + */ +#if 0 + { + ide_task_t *args = rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#else + command = /* (lba48) ? WIN_READDMA_EXT : */ WIN_READDMA; + if (rq->cmd == IDE_DRIVE_TASKFILE) { + ide_task_t *args = rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#endif + /* issue cmd to drive */ + hwif->OUTB(command, IDE_COMMAND_REG); + return HWIF(drive)->ide_dma_count(drive); +} + +static int trm290_ide_dma_read (ide_drive_t *drive /*, struct request *rq */) +{ + ide_hwif_t *hwif = HWIF(drive); + struct request *rq = HWGROUP(drive)->rq; +// ide_task_t *args = rq->special; + task_ioreg_t command = WIN_NOP; + unsigned int count, reading = 2, writing = 0; + + if (!(count = ide_build_dmatable(drive, rq))) { + /* try PIO instead of DMA */ + trm290_prepare_drive(drive, 0); /* select PIO xfer */ + return 1; + } + /* select DMA xfer */ + trm290_prepare_drive(drive, 1); + hwif->OUTL(hwif->dmatable_dma|reading|writing, hwif->dma_command); + drive->waiting_for_dma = 1; + /* start DMA */ + hwif->OUTW((count * 2) - 1, hwif->dma_status); + if (drive->media != ide_disk) + return 0; + if (HWGROUP(drive)->handler != NULL) /* paranoia check */ + BUG(); + ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); + /* + * FIX ME to use only ACB ide_task_t args Struct + */ +#if 0 + { + ide_task_t *args = rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#else + command = /* (lba48) ? WIN_WRITEDMA_EXT : */ WIN_WRITEDMA; + if (rq->cmd == IDE_DRIVE_TASKFILE) { + ide_task_t *args = rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#endif + /* issue cmd to drive */ + hwif->OUTB(command, IDE_COMMAND_REG); + return HWIF(drive)->ide_dma_count(drive); +} + +static int trm290_ide_dma_begin (ide_drive_t *drive) +{ + return 0; +} + +static int trm290_ide_dma_end (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u16 status = 0;; + + drive->waiting_for_dma = 0; + /* purge DMA mappings */ + ide_destroy_dmatable(drive); + status = hwif->INW(hwif->dma_status); + return (status != 0x00ff); +} + +static int trm290_ide_dma_test_irq (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + u16 status = 0; + + status = hwif->INW(hwif->dma_status); + return (status == 0x00ff); +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +/* + * Invoked from ide-dma.c at boot time. + */ +void __init init_hwif_trm290 (ide_hwif_t *hwif) +{ + unsigned int cfgbase = 0; + unsigned long flags; + u8 reg = 0; + struct pci_dev *dev = hwif->pci_dev; + + hwif->addressing = 1; + hwif->chipset = ide_trm290; + cfgbase = pci_resource_start(dev, 4); + if ((dev->class & 5) && cfgbase) { + hwif->config_data = cfgbase; + printk(KERN_INFO "TRM290: chip config base at 0x%04lx\n", + hwif->config_data); + } else { + hwif->config_data = 0x3df0; + printk(KERN_INFO "TRM290: using default config base at 0x%04lx\n", + hwif->config_data); + } + + local_irq_save(flags); + /* put config reg into first byte of hwif->select_data */ + hwif->OUTB(0x51|(hwif->channel<<3), hwif->config_data+1); + /* select PIO as default */ + hwif->select_data = 0x21; + hwif->OUTB(hwif->select_data, hwif->config_data); + /* get IRQ info */ + reg = hwif->INB(hwif->config_data+3); + /* mask IRQs for both ports */ + reg = (reg & 0x10) | 0x03; + hwif->OUTB(reg, hwif->config_data+3); + local_irq_restore(flags); + + if ((reg & 0x10)) + /* legacy mode */ + hwif->irq = hwif->channel ? 15 : 14; + else if (!hwif->irq && hwif->mate && hwif->mate->irq) + /* sharing IRQ with mate */ + hwif->irq = hwif->mate->irq; + + ide_setup_dma(hwif, (hwif->config_data + 4) ^ (hwif->channel ? 0x0080 : 0x0000), 3); + +#ifdef CONFIG_BLK_DEV_IDEDMA + hwif->ide_dma_write = &trm290_ide_dma_write; + hwif->ide_dma_read = &trm290_ide_dma_read; + hwif->ide_dma_begin = &trm290_ide_dma_begin; + hwif->ide_dma_end = &trm290_ide_dma_end; + hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq; +#endif /* CONFIG_BLK_DEV_IDEDMA */ + + hwif->selectproc = &trm290_selectproc; + hwif->autodma = 0; /* play it safe for now */ + hwif->drives[0].autodma = hwif->autodma; + hwif->drives[1].autodma = hwif->autodma; +#if 1 + { + /* + * My trm290-based card doesn't seem to work with all possible values + * for the control basereg, so this kludge ensures that we use only + * values that are known to work. Ugh. -ml + */ + u16 new, old, compat = hwif->channel ? 0x374 : 0x3f4; + static u16 next_offset = 0; + u8 old_mask; + + hwif->OUTB(0x54|(hwif->channel<<3), hwif->config_data+1); + old = hwif->INW(hwif->config_data); + old &= ~1; + old_mask = hwif->INB(old+2); + if (old != compat && old_mask == 0xff) { + /* leave lower 10 bits untouched */ + compat += (next_offset += 0x400); +# if 1 + if (check_region(compat + 2, 1)) + printk(KERN_ERR "%s: check_region failure at 0x%04x\n", + hwif->name, (compat + 2)); + /* + * The region check is not needed; however......... + * Since this is the checked in ide-probe.c, + * this is only an assignment. + */ +# endif + hwif->io_ports[IDE_CONTROL_OFFSET] = compat + 2; + hwif->OUTW(compat|1, hwif->config_data); + new = hwif->INW(hwif->config_data); + printk(KERN_INFO "%s: control basereg workaround: " + "old=0x%04x, new=0x%04x\n", + hwif->name, old, new & ~1); + } + } +#endif +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +void __init init_setup_trm290 (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +int __init trm290_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_TEKRAM) + return 0; + + for (d = trm290_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/trm290.h linux.20pre5-ac2/drivers/ide/pci/trm290.h --- linux.20pre5/drivers/ide/pci/trm290.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/trm290.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,34 @@ +#ifndef TRM290_H +#define TRM290_H + +#include +#include +#include + +extern void init_setup_trm290(struct pci_dev *, ide_pci_device_t *); +extern void init_hwif_trm290(ide_hwif_t *); + +static ide_pci_device_t trm290_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_TEKRAM, + device: PCI_DEVICE_ID_TEKRAM_DC290, + name: "TRM290", + init_setup: init_setup_trm290, + init_chipset: NULL, + init_iops: NULL, + init_hwif: init_hwif_trm290, + init_dma: NULL, + channels: 2, + autodma: NOAUTODMA, + enablebits: {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* TRM290_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/via82cxxx.c linux.20pre5-ac2/drivers/ide/pci/via82cxxx.c --- linux.20pre5/drivers/ide/pci/via82cxxx.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/via82cxxx.c 2002-09-01 18:03:33.000000000 +0100 @@ -0,0 +1,664 @@ +/* + * $Id: via82cxxx.c,v 3.35-ac1 2002/08/19 Alan Exp $ + * + * Copyright (c) 2000-2001 Vojtech Pavlik + * + * Based on the work of: + * Michel Aubry + * Jeff Garzik + * Andre Hedrick + */ + +/* + * Version 3.35 + * + * VIA IDE driver for Linux. Supported southbridges: + * + * vt82c576, vt82c586, vt82c586a, vt82c586b, vt82c596a, vt82c596b, + * vt82c686, vt82c686a, vt82c686b, vt8231, vt8233, vt8233c, vt8233a, + * vt8235 + * + * Copyright (c) 2000-2002 Vojtech Pavlik + * + * Based on the work of: + * Michel Aubry + * Jeff Garzik + * Andre Hedrick + */ + +/* + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 as published by + * the Free Software Foundation. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ide-timing.h" +#include "via82cxxx.h" + +#define VIA_IDE_ENABLE 0x40 +#define VIA_IDE_CONFIG 0x41 +#define VIA_FIFO_CONFIG 0x43 +#define VIA_MISC_1 0x44 +#define VIA_MISC_2 0x45 +#define VIA_MISC_3 0x46 +#define VIA_DRIVE_TIMING 0x48 +#define VIA_8BIT_TIMING 0x4e +#define VIA_ADDRESS_SETUP 0x4c +#define VIA_UDMA_TIMING 0x50 + +#define VIA_UDMA 0x007 +#define VIA_UDMA_NONE 0x000 +#define VIA_UDMA_33 0x001 +#define VIA_UDMA_66 0x002 +#define VIA_UDMA_100 0x003 +#define VIA_UDMA_133 0x004 +#define VIA_BAD_PREQ 0x010 /* Crashes if PREQ# till DDACK# set */ +#define VIA_BAD_CLK66 0x020 /* 66 MHz clock doesn't work correctly */ +#define VIA_SET_FIFO 0x040 /* Needs to have FIFO split set */ +#define VIA_NO_UNMASK 0x080 /* Doesn't work with IRQ unmasking on */ +#define VIA_BAD_ID 0x100 /* Has wrong vendor ID (0x1107) */ + +/* + * VIA SouthBridge chips. + */ + +static struct via_isa_bridge { + char *name; + u16 id; + u8 rev_min; + u8 rev_max; + u16 flags; +} via_isa_bridges[] = { +#ifdef FUTURE_BRIDGES + { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 }, +#endif + { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 }, + { "vt8233a", PCI_DEVICE_ID_VIA_8233A, 0x00, 0x2f, VIA_UDMA_133 }, + { "vt8233c", PCI_DEVICE_ID_VIA_8233C_0, 0x00, 0x2f, VIA_UDMA_100 }, + { "vt8233", PCI_DEVICE_ID_VIA_8233_0, 0x00, 0x2f, VIA_UDMA_100 }, + { "vt8231", PCI_DEVICE_ID_VIA_8231, 0x00, 0x2f, VIA_UDMA_100 }, + { "vt82c686b", PCI_DEVICE_ID_VIA_82C686, 0x40, 0x4f, VIA_UDMA_100 }, + { "vt82c686a", PCI_DEVICE_ID_VIA_82C686, 0x10, 0x2f, VIA_UDMA_66 }, + { "vt82c686", PCI_DEVICE_ID_VIA_82C686, 0x00, 0x0f, VIA_UDMA_33 | VIA_BAD_CLK66 }, + { "vt82c596b", PCI_DEVICE_ID_VIA_82C596, 0x10, 0x2f, VIA_UDMA_66 }, + { "vt82c596a", PCI_DEVICE_ID_VIA_82C596, 0x00, 0x0f, VIA_UDMA_33 | VIA_BAD_CLK66 }, + { "vt82c586b", PCI_DEVICE_ID_VIA_82C586_0, 0x47, 0x4f, VIA_UDMA_33 | VIA_SET_FIFO }, + { "vt82c586b", PCI_DEVICE_ID_VIA_82C586_0, 0x40, 0x46, VIA_UDMA_33 | VIA_SET_FIFO | VIA_BAD_PREQ }, + { "vt82c586b", PCI_DEVICE_ID_VIA_82C586_0, 0x30, 0x3f, VIA_UDMA_33 | VIA_SET_FIFO }, + { "vt82c586a", PCI_DEVICE_ID_VIA_82C586_0, 0x20, 0x2f, VIA_UDMA_33 | VIA_SET_FIFO }, + { "vt82c586", PCI_DEVICE_ID_VIA_82C586_0, 0x00, 0x0f, VIA_UDMA_NONE | VIA_SET_FIFO }, + { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK }, + { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK | VIA_BAD_ID }, + { NULL } +}; + +static struct via_isa_bridge *via_config; +static unsigned char via_enabled; +static unsigned int via_80w; +static unsigned int via_clock; +static char *via_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100", "UDMA133" }; + +/* + * VIA /proc entry. + */ + +#if defined(DISPLAY_VIA_TIMINGS) && defined(CONFIG_PROC_FS) + +#include +#include + +static u8 via_proc = 0; +static unsigned long via_base; +static struct pci_dev *bmide_dev, *isa_dev; + +static char *via_control3[] = { "No limit", "64", "128", "192" }; + +#define via_print(format, arg...) p += sprintf(p, format "\n" , ## arg) +#define via_print_drive(name, format, arg...)\ + p += sprintf(p, name); for (i = 0; i < 4; i++) p += sprintf(p, format, ## arg); p += sprintf(p, "\n"); + + +/** + * via_get_info - generate via /proc file + * @buffer: buffer for data + * @addr: set to start of data to use + * @offset: current file offset + * @count: size of read + * + * Fills in buffer with the debugging/configuration information for + * the VIA chipset tuning and attached drives + */ + +static int via_get_info(char *buffer, char **addr, off_t offset, int count) +{ + int speed[4], cycle[4], setup[4], active[4], recover[4], den[4], + uen[4], udma[4], umul[4], active8b[4], recover8b[4]; + struct pci_dev *dev = bmide_dev; + unsigned int v, u, i; + u16 c, w; + u8 t, x; + char *p = buffer; + + via_print("----------VIA BusMastering IDE Configuration" + "----------------"); + + via_print("Driver Version: 3.35-ac"); + via_print("South Bridge: VIA %s", + via_config->name); + + pci_read_config_byte(isa_dev, PCI_REVISION_ID, &t); + pci_read_config_byte(dev, PCI_REVISION_ID, &x); + via_print("Revision: ISA %#x IDE %#x", t, x); + via_print("Highest DMA rate: %s", + via_dma[via_config->flags & VIA_UDMA]); + + via_print("BM-DMA base: %#x", via_base); + via_print("PCI clock: %d.%dMHz", + via_clock / 1000, via_clock / 100 % 10); + + pci_read_config_byte(dev, VIA_MISC_1, &t); + via_print("Master Read Cycle IRDY: %dws", + (t & 64) >> 6); + via_print("Master Write Cycle IRDY: %dws", + (t & 32) >> 5); + via_print("BM IDE Status Register Read Retry: %s", + (t & 8) ? "yes" : "no"); + + pci_read_config_byte(dev, VIA_MISC_3, &t); + via_print("Max DRDY Pulse Width: %s%s", + via_control3[(t & 0x03)], (t & 0x03) ? " PCI clocks" : ""); + + via_print("-----------------------Primary IDE" + "-------Secondary IDE------"); + via_print("Read DMA FIFO flush: %10s%20s", + (t & 0x80) ? "yes" : "no", (t & 0x40) ? "yes" : "no"); + via_print("End Sector FIFO flush: %10s%20s", + (t & 0x20) ? "yes" : "no", (t & 0x10) ? "yes" : "no"); + + pci_read_config_byte(dev, VIA_IDE_CONFIG, &t); + via_print("Prefetch Buffer: %10s%20s", + (t & 0x80) ? "yes" : "no", (t & 0x20) ? "yes" : "no"); + via_print("Post Write Buffer: %10s%20s", + (t & 0x40) ? "yes" : "no", (t & 0x10) ? "yes" : "no"); + + pci_read_config_byte(dev, VIA_IDE_ENABLE, &t); + via_print("Enabled: %10s%20s", + (t & 0x02) ? "yes" : "no", (t & 0x01) ? "yes" : "no"); + + c = IN_BYTE(via_base + 0x02) | (IN_BYTE(via_base + 0x0a) << 8); + via_print("Simplex only: %10s%20s", + (c & 0x80) ? "yes" : "no", (c & 0x8000) ? "yes" : "no"); + + via_print("Cable Type: %10s%20s", + (via_80w & 1) ? "80w" : "40w", (via_80w & 2) ? "80w" : "40w"); + + via_print("-------------------drive0----drive1" + "----drive2----drive3-----"); + + pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &t); + pci_read_config_dword(dev, VIA_DRIVE_TIMING, &v); + pci_read_config_word(dev, VIA_8BIT_TIMING, &w); + + if (via_config->flags & VIA_UDMA) + pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); + else u = 0; + + for (i = 0; i < 4; i++) { + + setup[i] = ((t >> ((3 - i) << 1)) & 0x3) + 1; + recover8b[i] = ((w >> ((1 - (i >> 1)) << 3)) & 0xf) + 1; + active8b[i] = ((w >> (((1 - (i >> 1)) << 3) + 4)) & 0xf) + 1; + active[i] = ((v >> (((3 - i) << 3) + 4)) & 0xf) + 1; + recover[i] = ((v >> ((3 - i) << 3)) & 0xf) + 1; + udma[i] = ((u >> ((3 - i) << 3)) & 0x7) + 2; + umul[i] = ((u >> (((3 - i) & 2) << 3)) & 0x8) ? 1 : 2; + uen[i] = ((u >> ((3 - i) << 3)) & 0x20); + den[i] = (c & ((i & 1) ? 0x40 : 0x20) << ((i & 2) << 2)); + + speed[i] = 2 * via_clock / (active[i] + recover[i]); + cycle[i] = 1000000 * (active[i] + recover[i]) / via_clock; + + if (!uen[i] || !den[i]) + continue; + + switch (via_config->flags & VIA_UDMA) { + + case VIA_UDMA_33: + speed[i] = 2 * via_clock / udma[i]; + cycle[i] = 1000000 * udma[i] / via_clock; + break; + + case VIA_UDMA_66: + speed[i] = 4 * via_clock / (udma[i] * umul[i]); + cycle[i] = 500000 * (udma[i] * umul[i]) / via_clock; + break; + + case VIA_UDMA_100: + speed[i] = 6 * via_clock / udma[i]; + cycle[i] = 333333 * udma[i] / via_clock; + break; + + case VIA_UDMA_133: + speed[i] = 8 * via_clock / udma[i]; + cycle[i] = 250000 * udma[i] / via_clock; + break; + } + } + + via_print_drive("Transfer Mode: ", "%10s", + den[i] ? (uen[i] ? "UDMA" : "DMA") : "PIO"); + + via_print_drive("Address Setup: ", "%8dns", + 1000000 * setup[i] / via_clock); + via_print_drive("Cmd Active: ", "%8dns", + 1000000 * active8b[i] / via_clock); + via_print_drive("Cmd Recovery: ", "%8dns", + 1000000 * recover8b[i] / via_clock); + via_print_drive("Data Active: ", "%8dns", + 1000000 * active[i] / via_clock); + via_print_drive("Data Recovery: ", "%8dns", + 1000000 * recover[i] / via_clock); + via_print_drive("Cycle Time: ", "%8dns", + cycle[i]); + via_print_drive("Transfer Rate: ", "%4d.%dMB/s", + speed[i] / 1000, speed[i] / 100 % 10); + + /* hoping it is less than 4K... */ + return p - buffer; +} + +#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */ + +/** + * via_set_speed - write timing registers + * @dev: PCI device + * @dn: device + * @timing: IDE timing data to use + * + * via_set_speed writes timing values to the chipset registers + */ + +static void via_set_speed(struct pci_dev *dev, u8 dn, struct ide_timing *timing) +{ + u8 t; + + pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &t); + t = (t & ~(3 << ((3 - dn) << 1))) | ((FIT(timing->setup, 1, 4) - 1) << ((3 - dn) << 1)); + pci_write_config_byte(dev, VIA_ADDRESS_SETUP, t); + + pci_write_config_byte(dev, VIA_8BIT_TIMING + (1 - (dn >> 1)), + ((FIT(timing->act8b, 1, 16) - 1) << 4) | (FIT(timing->rec8b, 1, 16) - 1)); + + pci_write_config_byte(dev, VIA_DRIVE_TIMING + (3 - dn), + ((FIT(timing->active, 1, 16) - 1) << 4) | (FIT(timing->recover, 1, 16) - 1)); + + switch (via_config->flags & VIA_UDMA) { + case VIA_UDMA_33: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break; + case VIA_UDMA_66: t = timing->udma ? (0xe8 | (FIT(timing->udma, 2, 9) - 2)) : 0x0f; break; + case VIA_UDMA_100: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 9) - 2)) : 0x07; break; + case VIA_UDMA_133: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 9) - 2)) : 0x07; break; + default: return; + } + + pci_write_config_byte(dev, VIA_UDMA_TIMING + (3 - dn), t); +} + +/** + * via_set_drive - configure transfer mode + * @drive: Drive to set up + * @speed: desired speed + * + * via_set_drive() computes timing values configures the drive and + * the chipset to a desired transfer mode. It also can be called + * by upper layers. + */ + +static int via_set_drive(ide_drive_t *drive, u8 speed) +{ + ide_drive_t *peer = HWIF(drive)->drives + (~drive->dn & 1); + struct ide_timing t, p; + unsigned int T, UT; + + if (speed != XFER_PIO_SLOW && speed != drive->current_speed) + if (ide_config_drive_speed(drive, speed)) + printk(KERN_WARNING "ide%d: Drive %d didn't " + "accept speed setting. Oh, well.\n", + drive->dn >> 1, drive->dn & 1); + + T = 1000000000 / via_clock; + + switch (via_config->flags & VIA_UDMA) { + case VIA_UDMA_33: UT = T; break; + case VIA_UDMA_66: UT = T/2; break; + case VIA_UDMA_100: UT = T/3; break; + case VIA_UDMA_133: UT = T/4; break; + default: UT = T; + } + + ide_timing_compute(drive, speed, &t, T, UT); + + if (peer->present) { + ide_timing_compute(peer, peer->current_speed, &p, T, UT); + ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT); + } + + via_set_speed(HWIF(drive)->pci_dev, drive->dn, &t); + + if (!drive->init_speed) + drive->init_speed = speed; + drive->current_speed = speed; + + return 0; +} + +/** + * via82cxxx_tune_drive - PIO setup + * @drive: drive to set up + * @pio: mode to use (255 for 'best possible') + * + * A callback from the upper layers for PIO-only tuning. + */ + +static void via82cxxx_tune_drive(ide_drive_t *drive, u8 pio) +{ + if (!((via_enabled >> HWIF(drive)->channel) & 1)) + return; + + if (pio == 255) { + via_set_drive(drive, + ide_find_best_mode(drive, XFER_PIO | XFER_EPIO)); + return; + } + + via_set_drive(drive, XFER_PIO_0 + MIN(pio, 5)); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA + +/** + * via82cxxx_ide_dma_check - set up for DMA if possible + * @drive: IDE drive to set up + * + * Set up the drive for the highest supported speed considering the + * driver, controller and cable + */ + +static int via82cxxx_ide_dma_check (ide_drive_t *drive) +{ + u16 w80 = HWIF(drive)->udma_four; + + u16 speed = ide_find_best_mode(drive, + XFER_PIO | XFER_EPIO | XFER_SWDMA | XFER_MWDMA | + (via_config->flags & VIA_UDMA ? XFER_UDMA : 0) | + (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_66 ? XFER_UDMA_66 : 0) | + (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_100 ? XFER_UDMA_100 : 0) | + (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_133 ? XFER_UDMA_133 : 0)); + + via_set_drive(drive, speed); + + if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) + return HWIF(drive)->ide_dma_on(drive); + return HWIF(drive)->ide_dma_off_quietly(drive); +} + +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +/** + * init_chipset_via82cxxx - initialization handler + * @dev: PCI device + * @name: Name of interface + * + * The initialization callback. Here we determine the IDE chip type + * and initialize its drive independent registers. + */ + +static unsigned int __init init_chipset_via82cxxx(struct pci_dev *dev, const char *name) +{ + struct pci_dev *isa = NULL; + u8 t, v; + unsigned int u; + int i; + + /* + * Find the ISA bridge to see how good the IDE is. + */ + + for (via_config = via_isa_bridges; via_config->id; via_config++) + if ((isa = pci_find_device(PCI_VENDOR_ID_VIA + + !!(via_config->flags & VIA_BAD_ID), + via_config->id, NULL))) { + + pci_read_config_byte(isa, PCI_REVISION_ID, &t); + if (t >= via_config->rev_min && + t <= via_config->rev_max) + break; + } + + if (!via_config->id) { + printk(KERN_WARNING "VP_IDE: Unknown VIA SouthBridge, disabling DMA.\n"); + return -ENODEV; + } + + /* + * Check 80-wire cable presence and setup Clk66. + */ + + switch (via_config->flags & VIA_UDMA) { + + case VIA_UDMA_66: + /* Enable Clk66 */ + pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); + pci_write_config_dword(dev, VIA_UDMA_TIMING, u|0x80008); + for (i = 24; i >= 0; i -= 8) + if (((u >> (i & 16)) & 8) && + ((u >> i) & 0x20) && + (((u >> i) & 7) < 2)) { + /* + * 2x PCI clock and + * UDMA w/ < 3T/cycle + */ + via_80w |= (1 << (1 - (i >> 4))); + } + break; + + case VIA_UDMA_100: + pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); + for (i = 24; i >= 0; i -= 8) + if (((u >> i) & 0x10) || + (((u >> i) & 0x20) && + (((u >> i) & 7) < 4))) { + /* BIOS 80-wire bit or + * UDMA w/ < 60ns/cycle + */ + via_80w |= (1 << (1 - (i >> 4))); + } + break; + + case VIA_UDMA_133: + pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); + for (i = 24; i >= 0; i -= 8) + if (((u >> i) & 0x10) || + (((u >> i) & 0x20) && + (((u >> i) & 7) < 8))) { + /* BIOS 80-wire bit or + * UDMA w/ < 60ns/cycle + */ + via_80w |= (1 << (1 - (i >> 4))); + } + break; + + } + + /* Disable Clk66 */ + if (via_config->flags & VIA_BAD_CLK66) { + /* Would cause trouble on 596a and 686 */ + pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); + pci_write_config_dword(dev, VIA_UDMA_TIMING, u & ~0x80008); + } + + /* + * Check whether interfaces are enabled. + */ + + pci_read_config_byte(dev, VIA_IDE_ENABLE, &v); + via_enabled = ((v & 1) ? 2 : 0) | ((v & 2) ? 1 : 0); + + /* + * Set up FIFO sizes and thresholds. + */ + + pci_read_config_byte(dev, VIA_FIFO_CONFIG, &t); + + /* Disable PREQ# till DDACK# */ + if (via_config->flags & VIA_BAD_PREQ) { + /* Would crash on 586b rev 41 */ + t &= 0x7f; + } + + /* Fix FIFO split between channels */ + if (via_config->flags & VIA_SET_FIFO) { + t &= (t & 0x9f); + switch (via_enabled) { + case 1: t |= 0x00; break; /* 16 on primary */ + case 2: t |= 0x60; break; /* 16 on secondary */ + case 3: t |= 0x20; break; /* 8 pri 8 sec */ + } + } + + pci_write_config_byte(dev, VIA_FIFO_CONFIG, t); + + /* + * Determine system bus clock. + */ + + via_clock = system_bus_clock() * 1000; + + switch (via_clock) { + case 33000: via_clock = 33333; break; + case 37000: via_clock = 37500; break; + case 41000: via_clock = 41666; break; + } + + if (via_clock < 20000 || via_clock > 50000) { + printk(KERN_WARNING "VP_IDE: User given PCI clock speed " + "impossible (%d), using 33 MHz instead.\n", via_clock); + printk(KERN_WARNING "VP_IDE: Use ide0=ata66 if you want " + "to assume 80-wire cable.\n"); + via_clock = 33333; + } + + /* + * Print the boot message. + */ + + pci_read_config_byte(isa, PCI_REVISION_ID, &t); + printk(KERN_INFO "VP_IDE: VIA %s (rev %02x) IDE %s " + "controller on pci%s\n", + via_config->name, t, + via_dma[via_config->flags & VIA_UDMA], + dev->slot_name); + + /* + * Setup /proc/ide/via entry. + */ + +#if defined(DISPLAY_VIA_TIMINGS) && defined(CONFIG_PROC_FS) + if (!via_proc) { + via_base = pci_resource_start(dev, 4); + bmide_dev = dev; + isa_dev = isa; + ide_pci_register_host_proc(&via_procs[0]); + via_proc = 1; + } +#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */ + return 0; +} + +static void __init init_hwif_via82cxxx(ide_hwif_t *hwif) +{ + int i; + + hwif->tuneproc = &via82cxxx_tune_drive; + hwif->speedproc = &via_set_drive; + hwif->autodma = 0; + + for (i = 0; i < 2; i++) { + hwif->drives[i].io_32bit = 1; + hwif->drives[i].unmask = (via_config->flags & VIA_NO_UNMASK) ? 0 : 1; + hwif->drives[i].autotune = 1; + hwif->drives[i].dn = hwif->channel * 2 + i; + } + + if (!hwif->dma_base) + return; + +#ifdef CONFIG_BLK_DEV_IDEDMA + if (!(hwif->udma_four)) + hwif->udma_four = ((via_enabled & via_80w) >> hwif->channel) & 1; + hwif->ide_dma_check = &via82cxxx_ide_dma_check; + if (!noautodma) + hwif->autodma = 1; + hwif->drives[0].autodma = hwif->drives[1].autodma = hwif->autodma; +#endif /* CONFIG_BLK_DEV_IDEDMA */ +} + +/** + * init_dma_via82cxxx - set up for IDE DMA + * @hwif: IDE interface + * @dmabase: DMA base address + * + * We allow the BM-DMA driver to only work on enabled interfaces. + */ + +static void __init init_dma_via82cxxx(ide_hwif_t *hwif, unsigned long dmabase) +{ + if ((via_enabled >> hwif->channel) & 1) + ide_setup_dma(hwif, dmabase, 8); +} + +extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); + +/* + * FIXME: should not be needed + */ + +static void __init init_setup_via82cxxx (struct pci_dev *dev, ide_pci_device_t *d) +{ + ide_setup_pci_device(dev, d); +} + +/** + * via82cxxx_scan_pcidev - set up any via devices + * @dev: PCI device we are offered + * + * Any controller we are offered that we can configure we set up + * and return 1. Anything we cannot drive we return 0 + */ + +int __init via82cxxx_scan_pcidev (struct pci_dev *dev) +{ + ide_pci_device_t *d; + + if (dev->vendor != PCI_VENDOR_ID_VIA) + return 0; + + for (d = via82cxxx_chipsets; d && d->vendor && d->device; ++d) { + if (((d->vendor == dev->vendor) && + (d->device == dev->device)) && + (d->init_setup)) { + d->init_setup(dev, d); + return 1; + } + } + return 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pci/via82cxxx.h linux.20pre5-ac2/drivers/ide/pci/via82cxxx.h --- linux.20pre5/drivers/ide/pci/via82cxxx.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pci/via82cxxx.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,70 @@ +#ifndef VIA82CXXX_H +#define VIA82CXXX_H + +#include +#include +#include + +#define DISPLAY_VIA_TIMINGS + +#if defined(DISPLAY_VIA_TIMINGS) && defined(CONFIG_PROC_FS) +#include +#include + +static u8 via_proc; + +static int via_get_info(char *, char **, off_t, int); + +static ide_pci_host_proc_t via_procs[] __initdata = { + { + name: "via", + set: 1, + get_info: via_get_info, + parent: NULL, + }, +}; +#endif /* DISPLAY_VIA_TIMINGS && CONFIG_PROC_FS */ + +static void init_setup_via82cxxx(struct pci_dev *, ide_pci_device_t *); +static unsigned int init_chipset_via82cxxx(struct pci_dev *, const char *); +static void init_hwif_via82cxxx(ide_hwif_t *); +static void init_dma_via82cxxx(ide_hwif_t *, unsigned long); + +static ide_pci_device_t via82cxxx_chipsets[] __initdata = { + { + vendor: PCI_VENDOR_ID_VIA, + device: PCI_DEVICE_ID_VIA_82C576_1, + name: "VP_IDE", + init_setup: init_setup_via82cxxx, + init_chipset: init_chipset_via82cxxx, + init_iops: NULL, + init_hwif: init_hwif_via82cxxx, + init_dma: init_dma_via82cxxx, + channels: 2, + autodma: NOAUTODMA, + enablebits: {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: PCI_VENDOR_ID_VIA, + device: PCI_DEVICE_ID_VIA_82C586_1, + name: "VP_IDE", + init_setup: init_setup_via82cxxx, + init_chipset: init_chipset_via82cxxx, + init_iops: NULL, + init_hwif: init_hwif_via82cxxx, + init_dma: init_dma_via82cxxx, + channels: 2, + autodma: NOAUTODMA, + enablebits: {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, + bootable: ON_BOARD, + extra: 0, + },{ + vendor: 0, + device: 0, + channels: 0, + bootable: EOL, + } +}; + +#endif /* VIA82CXXX_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pdc202xx.c linux.20pre5-ac2/drivers/ide/pdc202xx.c --- linux.20pre5/drivers/ide/pdc202xx.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pdc202xx.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,1188 +0,0 @@ -/* - * linux/drivers/ide/pdc202xx.c Version 0.32 Feb. 27, 2002 - * - * Copyright (C) 1998-2000 Andre Hedrick - * May be copied or modified under the terms of the GNU General Public License - * - * Promise Ultra66 cards with BIOS v1.11 this - * compiled into the kernel if you have more than one card installed. - * - * Promise Ultra100 cards with BIOS v2.01 this - * compiled into the kernel if you have more than one card installed. - * - * Promise Ultra100TX2 with BIOS v2.10 & Ultra133TX2 with BIOS v2.20 - * support 8 hard drives on UDMA mode. - * - * Linux kernel will misunderstand FastTrak ATA-RAID series as Ultra - * IDE Controller, UNLESS you enable "CONFIG_PDC202XX_FORCE" - * That's you can use FastTrak ATA-RAID controllers as IDE controllers. - * - * History : - * 05/22/01 v1.20 b1 - * (1) support PDC20268 - * (2) fix cable judge function - * 08/22/01 v1.20 b2 - * (1) support ATA-133 PDC20269/75 - * (2) support UDMA Mode 6 - * (3) fix proc report information - * (4) set ATA133 timing - * (5) fix ultra dma bit 14 selectable - * (6) support 32bit LBA - * 09/11/01 v1.20 b3 - * (1) fix eighty_ninty_three() - * (2) fix offset address 0x1c~0x1f - * 10/30/01 v1.20 b4 - * (1) fix 48bit LBA HOB bit - * (2) force rescan drive under PIO modes if need - * 11/02/01 v1.20.0.5 - * (1) could be patched with ext3 filesystem code - * 11/06/01 v1.20.0.6 - * (1) fix LBA48 drive running without Promise controllers - * (2) fix LBA48 drive running under PIO modes - * 01/28/02 v1.20.0.6 - * (1) release for linux IDE Group kernel 2.4.18 - * (2) add version and controller info to proc - * 05/23/02 v1.20.0.7 - * (1) disable PDC20262 running with 48bit - * (2) Add quirk drive lists for PDC20265/67 - * - * Copyright (C) 1999-2002 Promise Technology, Inc. - * Author: Frank Tiernan - * PROMISE pdc202xx IDE Controller driver MAINTAINERS - * Released under terms of General Public License - */ - -#define VERSION "1.20.0.7" -#define VERDATE "2002-05-23" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "ide_modes.h" - -#define PDC202XX_DEBUG_DRIVE_INFO 0 -#define PDC202XX_DECODE_REGISTER_INFO 0 - -#define DISPLAY_PDC202XX_TIMINGS - -#ifndef SPLIT_BYTE -#define SPLIT_BYTE(B,H,L) ((H)=(B>>4), (L)=(B-((B>>4)<<4))) -#endif - -#if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static int pdc202xx_get_info(char *, char **, off_t, int); -extern int (*pdc202xx_display_info)(char *, char **, off_t, int); /* ide-proc.c */ -extern char *ide_media_verbose(ide_drive_t *); -static struct pci_dev *bmide_dev; -static struct hd_driveid *id[4]; -static int speed_rate[4]; - -static char * pdc202xx_info (char *buf, struct pci_dev *dev) -{ - char *p = buf; - - u32 bibma = pci_resource_start(dev, 4); - u32 reg60h = 0, reg64h = 0, reg68h = 0, reg6ch = 0; - u16 reg50h = 0; - u16 word88 = 0; - int udmasel[4] = {0,0,0,0}, piosel[4] = {0,0,0,0}; - int i = 0, hd = 0; - - /* - * at that point bibma+0x2 et bibma+0xa are byte registers - * to investigate: - */ - u8 c0 = inb_p((unsigned short)bibma + 0x02); - u8 c1 = inb_p((unsigned short)bibma + 0x0a); - - u8 sc11 = inb_p((unsigned short)bibma + 0x11); - u8 sc1a = inb_p((unsigned short)bibma + 0x1a); - u8 sc1b = inb_p((unsigned short)bibma + 0x1b); - /* u8 sc1c = inb_p((unsigned short)bibma + 0x1c); - u8 sc1d = inb_p((unsigned short)bibma + 0x1d); - u8 sc1e = inb_p((unsigned short)bibma + 0x1e); - u8 sc1f = inb_p((unsigned short)bibma + 0x1f); */ - - pci_read_config_word(dev, 0x50, ®50h); - pci_read_config_dword(dev, 0x60, ®60h); - pci_read_config_dword(dev, 0x64, ®64h); - pci_read_config_dword(dev, 0x68, ®68h); - pci_read_config_dword(dev, 0x6c, ®6ch); - - p+=sprintf(p, "\nPROMISE Ultra series driver Ver %s %s Adapter: ", VERSION, VERDATE); - switch(dev->device) { - case PCI_DEVICE_ID_PROMISE_20275: - p += sprintf(p, "MBUltra133\n"); - break; - case PCI_DEVICE_ID_PROMISE_20269: - p += sprintf(p, "Ultra133 TX2\n"); - break; - case PCI_DEVICE_ID_PROMISE_20268: - p += sprintf(p, "Ultra100 TX2\n"); - break; - case PCI_DEVICE_ID_PROMISE_20267: - p += sprintf(p, "Ultra100\n"); - break; - case PCI_DEVICE_ID_PROMISE_20265: - p += sprintf(p, "Ultra100 on M/B\n"); - break; - case PCI_DEVICE_ID_PROMISE_20262: - p += sprintf(p, "Ultra66\n"); - break; - case PCI_DEVICE_ID_PROMISE_20246: - p += sprintf(p, "Ultra33\n"); - reg50h |= 0x0c00; - break; - default: - p += sprintf(p, "Ultra Series\n"); - break; - } - - p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n"); - p += sprintf(p, " %s %s\n", - (c0&0x80)?"disabled":"enabled ", - (c1&0x80)?"disabled":"enabled "); - p += sprintf(p, "66 Clocking %s %s\n", - (sc11&0x02)?"enabled ":"disabled", - (sc11&0x08)?"enabled ":"disabled"); - p += sprintf(p, "Mode %s %s\n", - (sc1a & 0x01) ? "MASTER" : "PCI ", - (sc1b & 0x01) ? "MASTER" : "PCI "); - p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n"); - p += sprintf(p, "DMA enabled: %s %s %s %s\n", - (id[0]!=NULL && (c0&0x20))?"yes":"no ",(id[1]!=NULL && (c0&0x40))?"yes":"no ", - (id[2]!=NULL && (c1&0x20))?"yes":"no ",(id[3]!=NULL && (c1&0x40))?"yes":"no "); - for( hd = 0; hd < 4 ; hd++) { - if (id[hd] == NULL) - continue; - word88 = id[hd]->dma_ultra; - for ( i = 7 ; i >= 0 ; i--) - if (word88 >> (i+8)) { - udmasel[hd] = i; /* get select UDMA mode */ - break; - } - piosel[hd] = (id[hd]->eide_pio_modes >= 0x02) ? 4 : 3; - } - p += sprintf(p, "UDMA Mode: %d %d %d %d\n", - udmasel[0], udmasel[1], udmasel[2], udmasel[3]); - p += sprintf(p, "PIO Mode: %d %d %d %d\n", - piosel[0], piosel[1], piosel[2], piosel[3]); -#if 0 - p += sprintf(p, "--------------- Can ATAPI DMA ---------------\n"); -#endif - return (char *)p; -} - -static int pdc202xx_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - - p = pdc202xx_info(buffer, bmide_dev); - return p-buffer; /* => must be less than 4k! */ -} -#endif /* defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS) */ - -byte pdc202xx_proc = 0; - -const char *pdc_quirk_drives[] = { - "QUANTUM FIREBALLlct08 08", - "QUANTUM FIREBALLP KA6.4", - "QUANTUM FIREBALLP KA9.1", - "QUANTUM FIREBALLP LM20.4", - "QUANTUM FIREBALLP KX13.6", - "QUANTUM FIREBALLP KX20.5", - "QUANTUM FIREBALLP KX27.3", - "QUANTUM FIREBALLP LM20.5", - NULL -}; - -extern char *ide_xfer_verbose (byte xfer_rate); - -/* A Register */ -#define SYNC_ERRDY_EN 0xC0 - -#define SYNC_IN 0x80 /* control bit, different for master vs. slave drives */ -#define ERRDY_EN 0x40 /* control bit, different for master vs. slave drives */ -#define IORDY_EN 0x20 /* PIO: IOREADY */ -#define PREFETCH_EN 0x10 /* PIO: PREFETCH */ - -#define PA3 0x08 /* PIO"A" timing */ -#define PA2 0x04 /* PIO"A" timing */ -#define PA1 0x02 /* PIO"A" timing */ -#define PA0 0x01 /* PIO"A" timing */ - -/* B Register */ - -#define MB2 0x80 /* DMA"B" timing */ -#define MB1 0x40 /* DMA"B" timing */ -#define MB0 0x20 /* DMA"B" timing */ - -#define PB4 0x10 /* PIO_FORCE 1:0 */ - -#define PB3 0x08 /* PIO"B" timing */ /* PIO flow Control mode */ -#define PB2 0x04 /* PIO"B" timing */ /* PIO 4 */ -#define PB1 0x02 /* PIO"B" timing */ /* PIO 3 half */ -#define PB0 0x01 /* PIO"B" timing */ /* PIO 3 other half */ - -/* C Register */ -#define IORDYp_NO_SPEED 0x4F -#define SPEED_DIS 0x0F - -#define DMARQp 0x80 -#define IORDYp 0x40 -#define DMAR_EN 0x20 -#define DMAW_EN 0x10 - -#define MC3 0x08 /* DMA"C" timing */ -#define MC2 0x04 /* DMA"C" timing */ -#define MC1 0x02 /* DMA"C" timing */ -#define MC0 0x01 /* DMA"C" timing */ - -#if PDC202XX_DECODE_REGISTER_INFO - -#define REG_A 0x01 -#define REG_B 0x02 -#define REG_C 0x04 -#define REG_D 0x08 - -static void decode_registers (byte registers, byte value) -{ - byte bit = 0, bit1 = 0, bit2 = 0; - - switch(registers) { - case REG_A: - bit2 = 0; - printk("A Register "); - if (value & 0x80) printk("SYNC_IN "); - if (value & 0x40) printk("ERRDY_EN "); - if (value & 0x20) printk("IORDY_EN "); - if (value & 0x10) printk("PREFETCH_EN "); - if (value & 0x08) { printk("PA3 ");bit2 |= 0x08; } - if (value & 0x04) { printk("PA2 ");bit2 |= 0x04; } - if (value & 0x02) { printk("PA1 ");bit2 |= 0x02; } - if (value & 0x01) { printk("PA0 ");bit2 |= 0x01; } - printk("PIO(A) = %d ", bit2); - break; - case REG_B: - bit1 = 0;bit2 = 0; - printk("B Register "); - if (value & 0x80) { printk("MB2 ");bit1 |= 0x80; } - if (value & 0x40) { printk("MB1 ");bit1 |= 0x40; } - if (value & 0x20) { printk("MB0 ");bit1 |= 0x20; } - printk("DMA(B) = %d ", bit1 >> 5); - if (value & 0x10) printk("PIO_FORCED/PB4 "); - if (value & 0x08) { printk("PB3 ");bit2 |= 0x08; } - if (value & 0x04) { printk("PB2 ");bit2 |= 0x04; } - if (value & 0x02) { printk("PB1 ");bit2 |= 0x02; } - if (value & 0x01) { printk("PB0 ");bit2 |= 0x01; } - printk("PIO(B) = %d ", bit2); - break; - case REG_C: - bit2 = 0; - printk("C Register "); - if (value & 0x80) printk("DMARQp "); - if (value & 0x40) printk("IORDYp "); - if (value & 0x20) printk("DMAR_EN "); - if (value & 0x10) printk("DMAW_EN "); - - if (value & 0x08) { printk("MC3 ");bit2 |= 0x08; } - if (value & 0x04) { printk("MC2 ");bit2 |= 0x04; } - if (value & 0x02) { printk("MC1 ");bit2 |= 0x02; } - if (value & 0x01) { printk("MC0 ");bit2 |= 0x01; } - printk("DMA(C) = %d ", bit2); - break; - case REG_D: - printk("D Register "); - break; - default: - return; - } - printk("\n %s ", (registers & REG_D) ? "DP" : - (registers & REG_C) ? "CP" : - (registers & REG_B) ? "BP" : - (registers & REG_A) ? "AP" : "ERROR"); - for (bit=128;bit>0;bit/=2) - printk("%s", (value & bit) ? "1" : "0"); - printk("\n"); -} - -#endif /* PDC202XX_DECODE_REGISTER_INFO */ - -static int check_in_drive_lists (ide_drive_t *drive, const char **list) -{ - struct hd_driveid *id = drive->id; - - if (pdc_quirk_drives == list) { - while (*list) { - if (strstr(id->model, *list++)) { - return 2; - } - } - } else { - while (*list) { - if (!strcmp(*list++,id->model)) { - return 1; - } - } - } - return 0; -} - -static int pdc202xx_tune_chipset (ide_drive_t *drive, byte speed) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - - unsigned int drive_conf; - int err = 0, i = 0, j = hwif->channel ? 2 : 0 ; - byte drive_pci, AP, BP, CP, DP; - byte TA = 0, TB = 0, TC = 0; - - switch (drive->dn) { - case 0: drive_pci = 0x60; break; - case 1: drive_pci = 0x64; break; - case 2: drive_pci = 0x68; break; - case 3: drive_pci = 0x6c; break; - default: return -1; - } - - if ((drive->media != ide_disk) && (speed < XFER_SW_DMA_0)) return -1; - - pci_read_config_dword(dev, drive_pci, &drive_conf); - pci_read_config_byte(dev, (drive_pci), &AP); - pci_read_config_byte(dev, (drive_pci)|0x01, &BP); - pci_read_config_byte(dev, (drive_pci)|0x02, &CP); - pci_read_config_byte(dev, (drive_pci)|0x03, &DP); - -#ifdef CONFIG_BLK_DEV_IDEDMA - if (speed >= XFER_SW_DMA_0) { - if ((BP & 0xF0) && (CP & 0x0F)) { - /* clear DMA modes of upper 842 bits of B Register */ - /* clear PIO forced mode upper 1 bit of B Register */ - pci_write_config_byte(dev, (drive_pci)|0x01, BP & ~0xF0); - pci_read_config_byte(dev, (drive_pci)|0x01, &BP); - - /* clear DMA modes of lower 8421 bits of C Register */ - pci_write_config_byte(dev, (drive_pci)|0x02, CP & ~0x0F); - pci_read_config_byte(dev, (drive_pci)|0x02, &CP); - } - } else { -#else - { -#endif /* CONFIG_BLK_DEV_IDEDMA */ - if ((AP & 0x0F) || (BP & 0x07)) { - /* clear PIO modes of lower 8421 bits of A Register */ - pci_write_config_byte(dev, (drive_pci), AP & ~0x0F); - pci_read_config_byte(dev, (drive_pci), &AP); - - /* clear PIO modes of lower 421 bits of B Register */ - pci_write_config_byte(dev, (drive_pci)|0x01, BP & ~0x07); - pci_read_config_byte(dev, (drive_pci)|0x01, &BP); - - pci_read_config_byte(dev, (drive_pci), &AP); - pci_read_config_byte(dev, (drive_pci)|0x01, &BP); - } - } - - pci_read_config_byte(dev, (drive_pci), &AP); - pci_read_config_byte(dev, (drive_pci)|0x01, &BP); - pci_read_config_byte(dev, (drive_pci)|0x02, &CP); - - for ( i = 0; i < 2; i++) - if (hwif->drives[i].present) - id[i+j] = hwif->drives[i].id; /* get identify structs */ - - switch(speed) { -#ifdef CONFIG_BLK_DEV_IDEDMA - /* case XFER_UDMA_6: */ - case XFER_UDMA_5: - case XFER_UDMA_4: TB = 0x20; TC = 0x01; break; /* speed 8 == UDMA mode 4 */ - case XFER_UDMA_3: TB = 0x40; TC = 0x02; break; /* speed 7 == UDMA mode 3 */ - case XFER_UDMA_2: TB = 0x20; TC = 0x01; break; /* speed 6 == UDMA mode 2 */ - case XFER_UDMA_1: TB = 0x40; TC = 0x02; break; /* speed 5 == UDMA mode 1 */ - case XFER_UDMA_0: TB = 0x60; TC = 0x03; break; /* speed 4 == UDMA mode 0 */ - case XFER_MW_DMA_2: TB = 0x60; TC = 0x03; break; /* speed 4 == MDMA mode 2 */ - case XFER_MW_DMA_1: TB = 0x60; TC = 0x04; break; /* speed 3 == MDMA mode 1 */ - case XFER_MW_DMA_0: TB = 0x60; TC = 0x05; break; /* speed 2 == MDMA mode 0 */ - case XFER_SW_DMA_2: TB = 0x60; TC = 0x05; break; /* speed 0 == SDMA mode 2 */ - case XFER_SW_DMA_1: TB = 0x80; TC = 0x06; break; /* speed 1 == SDMA mode 1 */ - case XFER_SW_DMA_0: TB = 0xC0; TC = 0x0B; break; /* speed 0 == SDMA mode 0 */ -#endif /* CONFIG_BLK_DEV_IDEDMA */ - case XFER_PIO_4: TA = 0x01; TB = 0x04; break; - case XFER_PIO_3: TA = 0x02; TB = 0x06; break; - case XFER_PIO_2: TA = 0x03; TB = 0x08; break; - case XFER_PIO_1: TA = 0x05; TB = 0x0C; break; - case XFER_PIO_0: - default: TA = 0x09; TB = 0x13; break; - } - -#ifdef CONFIG_BLK_DEV_IDEDMA - if (speed >= XFER_SW_DMA_0) { - pci_write_config_byte(dev, (drive_pci)|0x01, BP|TB); - pci_write_config_byte(dev, (drive_pci)|0x02, CP|TC); - } else { -#else - { -#endif /* CONFIG_BLK_DEV_IDEDMA */ - pci_write_config_byte(dev, (drive_pci), AP|TA); - pci_write_config_byte(dev, (drive_pci)|0x01, BP|TB); - } - -#if PDC202XX_DECODE_REGISTER_INFO - pci_read_config_byte(dev, (drive_pci), &AP); - pci_read_config_byte(dev, (drive_pci)|0x01, &BP); - pci_read_config_byte(dev, (drive_pci)|0x02, &CP); - pci_read_config_byte(dev, (drive_pci)|0x03, &DP); - - decode_registers(REG_A, AP); - decode_registers(REG_B, BP); - decode_registers(REG_C, CP); - decode_registers(REG_D, DP); -#endif /* PDC202XX_DECODE_REGISTER_INFO */ - - if (!drive->init_speed) - drive->init_speed = speed; - err = ide_config_drive_speed(drive, speed); - drive->current_speed = speed; - -#if PDC202XX_DEBUG_DRIVE_INFO - printk("%s: %s drive%d 0x%08x ", - drive->name, ide_xfer_verbose(speed), - drive->dn, drive_conf); - pci_read_config_dword(dev, drive_pci, &drive_conf); - printk("0x%08x\n", drive_conf); -#endif /* PDC202XX_DEBUG_DRIVE_INFO */ - return err; -} - -static int pdc202xx_new_tune_chipset (ide_drive_t *drive, byte speed) -{ - ide_hwif_t *hwif = HWIF(drive); -#ifdef CONFIG_BLK_DEV_IDEDMA - unsigned long indexreg = (hwif->dma_base + 1); - unsigned long datareg = (hwif->dma_base + 3); -#else - struct pci_dev *dev = hwif->pci_dev; - unsigned long high_16 = pci_resource_start(dev, 4); - unsigned long indexreg = high_16 + (hwif->channel ? 0x09 : 0x01); - unsigned long datareg = (indexreg + 2); -#endif /* CONFIG_BLK_DEV_IDEDMA */ - byte thold = 0x10; - byte adj = (drive->dn%2) ? 0x08 : 0x00; - int set_speed = 0, i=0, j=hwif->channel ? 2:0; - int err; - - /* Setting tHOLD bit to 0 if using UDMA mode 2 */ - if (speed == XFER_UDMA_2) { - OUT_BYTE((thold + adj), indexreg); - OUT_BYTE((IN_BYTE(datareg) & 0x7f), datareg); - } - - /* We need to set ATA133 timing if ATA133 drives exist */ - if (speed>=XFER_UDMA_6) - set_speed=1; - - if (!drive->init_speed) - drive->init_speed = speed; -#if PDC202XX_DEBUG_DRIVE_INFO - printk("%s: Before set_feature = %s, word88 = %#x\n", - drive->name, ide_xfer_verbose(speed), drive->id->dma_ultra ); -#endif /* PDC202XX_DEBUG_DRIVE_INFO */ - err = ide_config_drive_speed(drive, speed); - drive->current_speed = speed; - for ( i = 0 ; i < 2 ; i++) - if (hwif->drives[i].present) { - id[i+j] = hwif->drives[i].id; /* get identify structs */ - speed_rate[i+j] = speed; /* get current speed */ - } - if (set_speed) { - for (i=0; i<4; i++) { - if (id[i]==NULL) - continue; - switch(speed_rate[i]) { -#ifdef CONFIG_BLK_DEV_IDEDMA - case XFER_UDMA_6: - OUT_BYTE((0x10 + adj), indexreg); - OUT_BYTE(0x1a, datareg); - OUT_BYTE((0x11 + adj), indexreg); - OUT_BYTE(0x01, datareg); - OUT_BYTE((0x12 + adj), indexreg); - OUT_BYTE(0xcb, datareg); - break; - case XFER_UDMA_5: - OUT_BYTE((0x10 + adj), indexreg); - OUT_BYTE(0x1a, datareg); - OUT_BYTE((0x11 + adj), indexreg); - OUT_BYTE(0x02, datareg); - OUT_BYTE((0x12 + adj), indexreg); - OUT_BYTE(0xcb, datareg); - break; - case XFER_UDMA_4: - OUT_BYTE((0x10 + adj), indexreg); - OUT_BYTE(0x1a, datareg); - OUT_BYTE((0x11 + adj), indexreg); - OUT_BYTE(0x03, datareg); - OUT_BYTE((0x12 + adj), indexreg); - OUT_BYTE(0xcd, datareg); - break; - case XFER_UDMA_3: - OUT_BYTE((0x10 + adj), indexreg); - OUT_BYTE(0x1a, datareg); - OUT_BYTE((0x11 + adj), indexreg); - OUT_BYTE(0x05, datareg); - OUT_BYTE((0x12 + adj), indexreg); - OUT_BYTE(0xcd, datareg); - break; - case XFER_UDMA_2: - OUT_BYTE((0x10 + adj), indexreg); - OUT_BYTE(0x2a, datareg); - OUT_BYTE((0x11 + adj), indexreg); - OUT_BYTE(0x07, datareg); - OUT_BYTE((0x12 + adj), indexreg); - OUT_BYTE(0xcd, datareg); - break; - case XFER_UDMA_1: - OUT_BYTE((0x10 + adj), indexreg); - OUT_BYTE(0x3a, datareg); - OUT_BYTE((0x11 + adj), indexreg); - OUT_BYTE(0x0a, datareg); - OUT_BYTE((0x12 + adj), indexreg); - OUT_BYTE(0xd0, datareg); - break; - case XFER_UDMA_0: - OUT_BYTE((0x10 + adj), indexreg); - OUT_BYTE(0x4a, datareg); - OUT_BYTE((0x11 + adj), indexreg); - OUT_BYTE(0x0f, datareg); - OUT_BYTE((0x12 + adj), indexreg); - OUT_BYTE(0xd5, datareg); - break; - case XFER_MW_DMA_2: - OUT_BYTE((0x0e + adj), indexreg); - OUT_BYTE(0x69, datareg); - OUT_BYTE((0x0f + adj), indexreg); - OUT_BYTE(0x25, datareg); - break; - case XFER_MW_DMA_1: - OUT_BYTE((0x0e + adj), indexreg); - OUT_BYTE(0x6b, datareg); - OUT_BYTE((0x0f+ adj), indexreg); - OUT_BYTE(0x27, datareg); - break; - case XFER_MW_DMA_0: - OUT_BYTE((0x0e + adj), indexreg); - OUT_BYTE(0xdf, datareg); - OUT_BYTE((0x0f + adj), indexreg); - OUT_BYTE(0x5f, datareg); - break; -#endif /* CONFIG_BLK_DEV_IDEDMA */ - case XFER_PIO_4: - OUT_BYTE((0x0c + adj), indexreg); - OUT_BYTE(0x23, datareg); - OUT_BYTE((0x0d + adj), indexreg); - OUT_BYTE(0x09, datareg); - OUT_BYTE((0x13 + adj), indexreg); - OUT_BYTE(0x25, datareg); - break; - case XFER_PIO_3: - OUT_BYTE((0x0c + adj), indexreg); - OUT_BYTE(0x27, datareg); - OUT_BYTE((0x0d + adj), indexreg); - OUT_BYTE(0x0d, datareg); - OUT_BYTE((0x13 + adj), indexreg); - OUT_BYTE(0x35, datareg); - break; - case XFER_PIO_2: - OUT_BYTE((0x0c + adj), indexreg); - OUT_BYTE(0x23, datareg); - OUT_BYTE((0x0d + adj), indexreg); - OUT_BYTE(0x26, datareg); - OUT_BYTE((0x13 + adj), indexreg); - OUT_BYTE(0x64, datareg); - break; - case XFER_PIO_1: - OUT_BYTE((0x0c + adj), indexreg); - OUT_BYTE(0x46, datareg); - OUT_BYTE((0x0d + adj), indexreg); - OUT_BYTE(0x29, datareg); - OUT_BYTE((0x13 + adj), indexreg); - OUT_BYTE(0xa4, datareg); - break; - case XFER_PIO_0: - OUT_BYTE((0x0c + adj), indexreg); - OUT_BYTE(0xfb, datareg); - OUT_BYTE((0x0d + adj), indexreg); - OUT_BYTE(0x2b, datareg); - OUT_BYTE((0x13 + adj), indexreg); - OUT_BYTE(0xac, datareg); - break; - default: - } - } - } - return err; -} - -/* 0 1 2 3 4 5 6 7 8 - * 960, 480, 390, 300, 240, 180, 120, 90, 60 - * 180, 150, 120, 90, 60 - * DMA_Speed - * 180, 120, 90, 90, 90, 60, 30 - * 11, 5, 4, 3, 2, 1, 0 - */ -static int config_chipset_for_pio (ide_drive_t *drive, byte pio) -{ - byte speed = 0x00; - - pio = (pio == 5) ? 4 : pio; - speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, pio, NULL); - - return ((int) pdc202xx_tune_chipset(drive, speed)); -} - -static void pdc202xx_tune_drive (ide_drive_t *drive, byte pio) -{ - (void) config_chipset_for_pio(drive, pio); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -static int config_chipset_for_dma (ide_drive_t *drive, byte ultra) -{ - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - unsigned long high_16 = pci_resource_start(dev, 4); - unsigned long dma_base = hwif->dma_base; - unsigned long indexreg = dma_base + 1; - unsigned long datareg = dma_base + 3; - byte iordy = 0x13; - byte adj = (drive->dn%2) ? 0x08 : 0x00; - byte cable = 0; - byte new_chip = 0; - byte unit = (drive->select.b.unit & 0x01); - unsigned int drive_conf; - byte drive_pci = 0; - byte test1, test2, speed = -1; - byte AP; - unsigned short EP; - byte CLKSPD = 0; - byte clockreg = high_16 + 0x11; - byte udma_33 = ultra; - byte udma_66 = ((eighty_ninty_three(drive)) && udma_33) ? 1 : 0; - byte udma_100 = 0; - byte udma_133 = 0; - byte mask = hwif->channel ? 0x08 : 0x02; - unsigned short c_mask = hwif->channel ? (1<<11) : (1<<10); - - byte ultra_66 = ((id->dma_ultra & 0x0010) || - (id->dma_ultra & 0x0008)) ? 1 : 0; - byte ultra_100 = ((id->dma_ultra & 0x0020) || - (ultra_66)) ? 1 : 0; - byte ultra_133 = ((id->dma_ultra & 0x0040) || - (ultra_100)) ? 1 : 0; - - switch(dev->device) { - case PCI_DEVICE_ID_PROMISE_20276: - case PCI_DEVICE_ID_PROMISE_20275: - case PCI_DEVICE_ID_PROMISE_20269: - udma_133 = (udma_66) ? 1 : 0; - udma_100 = (udma_66) ? 1 : 0; - OUT_BYTE(0x0b, (hwif->dma_base + 1)); - cable = ((IN_BYTE((hwif->dma_base + 3)) & 0x04)); - new_chip = 1; - break; - case PCI_DEVICE_ID_PROMISE_20268: - case PCI_DEVICE_ID_PROMISE_20270: - udma_100 = (udma_66) ? 1 : 0; - OUT_BYTE(0x0b, (hwif->dma_base + 1)); - cable = ((IN_BYTE((hwif->dma_base + 3)) & 0x04)); - new_chip = 1; - break; - case PCI_DEVICE_ID_PROMISE_20267: - case PCI_DEVICE_ID_PROMISE_20265: - udma_100 = (udma_66) ? 1 : 0; - pci_read_config_word(dev, 0x50, &EP); - cable = (EP & c_mask); - new_chip = 0; - CLKSPD = IN_BYTE(clockreg); - break; - case PCI_DEVICE_ID_PROMISE_20262: - pci_read_config_word(dev, 0x50, &EP); - cable = (EP & c_mask); - new_chip = 0; - CLKSPD = IN_BYTE(clockreg); - break; - default: - udma_100 = 0; udma_133 = 0; cable = 0; new_chip = 1; - break; - } - - /* - * Set the control register to use the 66Mhz system - * clock for UDMA 3/4 mode operation. If one drive on - * a channel is U66 capable but the other isn't we - * fall back to U33 mode. The BIOS INT 13 hooks turn - * the clock on then off for each read/write issued. I don't - * do that here because it would require modifying the - * kernel, seperating the fop routines from the kernel or - * somehow hooking the fops calls. It may also be possible to - * leave the 66Mhz clock on and readjust the timing - * parameters. - */ - - if (((ultra_66) || (ultra_100) || (ultra_133)) && (cable)) { -#ifdef DEBUG - printk("ULTRA66: %s channel of Ultra 66 requires an 80-pin cable for Ultra66 operation.\n", hwif->channel ? "Secondary" : "Primary"); - printk(" Switching to Ultra33 mode.\n"); -#endif /* DEBUG */ - /* Primary : zero out second bit */ - /* Secondary : zero out fourth bit */ - //if (!new_chip) - OUT_BYTE(CLKSPD & ~mask, clockreg); - printk("Warning: %s channel requires an 80-pin cable for operation.\n", hwif->channel ? "Secondary":"Primary"); - printk("%s reduced to Ultra33 mode.\n", drive->name); - udma_66 = 0; udma_100 = 0; udma_133 = 0; - } else { - if ((ultra_66) || (ultra_100) || (ultra_133)) { - /* - * check to make sure drive on same channel - * is u66 capable - */ - if (hwif->drives[!(drive->dn%2)].id) { - if ((hwif->drives[!(drive->dn%2)].id->dma_ultra & 0x0040) || - (hwif->drives[!(drive->dn%2)].id->dma_ultra -& 0x0020) || - (hwif->drives[!(drive->dn%2)].id->dma_ultra & 0x0010) || - (hwif->drives[!(drive->dn%2)].id->dma_ultra & 0x0008)) { - OUT_BYTE(CLKSPD | mask, clockreg); - } else { - OUT_BYTE(CLKSPD & ~mask, clockreg); - } - } else { /* udma4 drive by itself */ - OUT_BYTE(CLKSPD | mask, clockreg); - } - } - } - - if (new_chip) goto chipset_is_set; - - switch(drive->dn) { - case 0: drive_pci = 0x60; - pci_read_config_dword(dev, drive_pci, &drive_conf); - if ((drive_conf != 0x004ff304) && (drive_conf != 0x004ff3c4)) - goto chipset_is_set; - pci_read_config_byte(dev, (drive_pci), &test1); - if (!(test1 & SYNC_ERRDY_EN)) - pci_write_config_byte(dev, (drive_pci), test1|SYNC_ERRDY_EN); - break; - case 1: drive_pci = 0x64; - pci_read_config_dword(dev, drive_pci, &drive_conf); - if ((drive_conf != 0x004ff304) && (drive_conf != 0x004ff3c4)) - goto chipset_is_set; - pci_read_config_byte(dev, 0x60, &test1); - pci_read_config_byte(dev, (drive_pci), &test2); - if ((test1 & SYNC_ERRDY_EN) && !(test2 & SYNC_ERRDY_EN)) - pci_write_config_byte(dev, (drive_pci), test2|SYNC_ERRDY_EN); - break; - case 2: drive_pci = 0x68; - pci_read_config_dword(dev, drive_pci, &drive_conf); - if ((drive_conf != 0x004ff304) && (drive_conf != 0x004ff3c4)) - goto chipset_is_set; - pci_read_config_byte(dev, (drive_pci), &test1); - if (!(test1 & SYNC_ERRDY_EN)) - pci_write_config_byte(dev, (drive_pci), test1|SYNC_ERRDY_EN); - break; - case 3: drive_pci = 0x6c; - pci_read_config_dword(dev, drive_pci, &drive_conf); - if ((drive_conf != 0x004ff304) && (drive_conf != 0x004ff3c4)) - goto chipset_is_set; - pci_read_config_byte(dev, 0x68, &test1); - pci_read_config_byte(dev, (drive_pci), &test2); - if ((test1 & SYNC_ERRDY_EN) && !(test2 & SYNC_ERRDY_EN)) - pci_write_config_byte(dev, (drive_pci), test2|SYNC_ERRDY_EN); - break; - default: - return ide_dma_off; - } - -chipset_is_set: - - if (drive->media != ide_disk) - return ide_dma_off_quietly; - - if (new_chip) { - if (id->capability & 4) { /* IORDY_EN & PREFETCH_EN */ - OUT_BYTE((iordy + adj), indexreg); - OUT_BYTE((IN_BYTE(datareg)|0x03), datareg); - } - } - else { - pci_read_config_byte(dev, (drive_pci), &AP); - if (id->capability & 4) /* IORDY_EN */ - pci_write_config_byte(dev, (drive_pci), AP|IORDY_EN); - pci_read_config_byte(dev, (drive_pci), &AP); - if (drive->media == ide_disk) /* PREFETCH_EN */ - pci_write_config_byte(dev, (drive_pci), AP|PREFETCH_EN); - } - - if ((id->dma_ultra & 0x0040)&&(udma_133)) speed = XFER_UDMA_6; - else if ((id->dma_ultra & 0x0020)&&(udma_100)) speed = XFER_UDMA_5; - else if ((id->dma_ultra & 0x0010)&&(udma_66)) speed = XFER_UDMA_4; - else if ((id->dma_ultra & 0x0008)&&(udma_66)) speed = XFER_UDMA_3; - else if ((id->dma_ultra & 0x0004)&&(udma_33)) speed = XFER_UDMA_2; - else if ((id->dma_ultra & 0x0002)&&(udma_33)) speed = XFER_UDMA_1; - else if ((id->dma_ultra & 0x0001)&&(udma_33)) speed = XFER_UDMA_0; - else if (id->dma_mword & 0x0004) speed = XFER_MW_DMA_2; - else if (id->dma_mword & 0x0002) speed = XFER_MW_DMA_1; - else if (id->dma_mword & 0x0001) speed = XFER_MW_DMA_0; - else if ((id->dma_1word & 0x0004)&&(!new_chip)) speed = XFER_SW_DMA_2; - else if ((id->dma_1word & 0x0002)&&(!new_chip)) speed = XFER_SW_DMA_1; - else if ((id->dma_1word & 0x0001)&&(!new_chip)) speed = XFER_SW_DMA_0; - else { - /* restore original pci-config space */ - if (!new_chip) - pci_write_config_dword(dev, drive_pci, drive_conf); - return ide_dma_off_quietly; - } - - outb(inb(dma_base+2) & ~(1<<(5+unit)), dma_base+2); - (void) hwif->speedproc(drive, speed); - - return ((int) ((id->dma_ultra >> 14) & 3) ? ide_dma_on : - ((id->dma_ultra >> 11) & 7) ? ide_dma_on : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ((id->dma_1word >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); -} - -static int config_drive_xfer_rate (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - ide_dma_action_t dma_func = ide_dma_off_quietly; - - if (id && (id->capability & 1) && hwif->autodma) { - /* Consult the list of known "bad" drives */ - if (ide_dmaproc(ide_dma_bad_drive, drive)) { - dma_func = ide_dma_off; - goto fast_ata_pio; - } - dma_func = ide_dma_off_quietly; - if (id->field_valid & 4) { - if (id->dma_ultra & 0x007F) { - /* Force if Capable UltraDMA */ - dma_func = config_chipset_for_dma(drive, 1); - if ((id->field_valid & 2) && - (dma_func != ide_dma_on)) - goto try_dma_modes; - } - } else if (id->field_valid & 2) { -try_dma_modes: - if ((id->dma_mword & 0x0007) || - (id->dma_1word & 0x0007)) { - /* Force if Capable regular DMA modes */ - dma_func = config_chipset_for_dma(drive, 0); - if (dma_func != ide_dma_on) - goto no_dma_set; - } - } else if (ide_dmaproc(ide_dma_good_drive, drive)) { - if (id->eide_dma_time > 150) { - goto no_dma_set; - } - /* Consult the list of known "good" drives */ - dma_func = config_chipset_for_dma(drive, 0); - if (dma_func != ide_dma_on) - goto no_dma_set; - } else { - goto fast_ata_pio; - } - } else if ((id->capability & 8) || (id->field_valid & 2)) { -fast_ata_pio: - dma_func = ide_dma_off_quietly; -no_dma_set: - (void) config_chipset_for_pio(drive, 5); - } - - return HWIF(drive)->dmaproc(dma_func, drive); -} - -int pdc202xx_quirkproc (ide_drive_t *drive) -{ - return ((int) check_in_drive_lists(drive, pdc_quirk_drives)); -} - -/* - * pdc202xx_dmaproc() initiates/aborts (U)DMA read/write operations on a drive. - */ -int pdc202xx_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - byte dma_stat = 0; - byte sc1d = 0; - byte newchip = 0; - byte clock = 0; - byte hardware48fix = 0; - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - unsigned long high_16 = pci_resource_start(dev, 4); - unsigned long dma_base = hwif->dma_base; - unsigned long atapi_port= hwif->channel ? high_16+0x24 : high_16+0x20; - - switch (dev->device) { - case PCI_DEVICE_ID_PROMISE_20276: - case PCI_DEVICE_ID_PROMISE_20275: - case PCI_DEVICE_ID_PROMISE_20269: - case PCI_DEVICE_ID_PROMISE_20268: - case PCI_DEVICE_ID_PROMISE_20270: - newchip = 1; - break; - case PCI_DEVICE_ID_PROMISE_20267: - case PCI_DEVICE_ID_PROMISE_20265: - hardware48fix = 1; - clock = IN_BYTE(high_16 + 0x11); - default: - break; - } - - switch (func) { - case ide_dma_check: - return config_drive_xfer_rate(drive); - case ide_dma_begin: - /* Note that this is done *after* the cmd has - * been issued to the drive, as per the BM-IDE spec. - * The Promise Ultra33 doesn't work correctly when - * we do this part before issuing the drive cmd. - */ - /* Enable ATAPI UDMA port for 48bit data on PDC20267 */ - if ((drive->addressing) && (hardware48fix)) { - struct request *rq = HWGROUP(drive)->rq; - unsigned long word_count = 0; - unsigned long hankval = 0; - byte clockreg = high_16 + 0x11; - - OUT_BYTE(clock|(hwif->channel ? 0x08:0x02), clockreg); - word_count = (rq->nr_sectors << 8); - hankval = (rq->cmd == READ) ? 0x05<<24 : 0x06<<24; - hankval = hankval | word_count ; - outl(hankval, atapi_port); - } - break; - case ide_dma_end: - /* Disable ATAPI UDMA port for 48bit data on PDC20267 */ - if ((drive->addressing) && (hardware48fix)) { - unsigned long hankval = 0; - byte clockreg = high_16 + 0x11; - - outl(hankval, atapi_port); /* zero out extra */ - clock = IN_BYTE(clockreg); - OUT_BYTE(clock & ~(hwif->channel ? 0x08:0x02), clockreg); - } - break; - case ide_dma_test_irq: /* returns 1 if dma irq issued, 0 otherwise */ - dma_stat = IN_BYTE(dma_base+2); - if (newchip) - return (dma_stat & 4) == 4; - - sc1d = IN_BYTE(high_16 + 0x001d); - if (HWIF(drive)->channel) { - if ((sc1d & 0x50) == 0x50) goto somebody_else; - else if ((sc1d & 0x40) == 0x40) - return (dma_stat & 4) == 4; - } else { - if ((sc1d & 0x05) == 0x05) goto somebody_else; - else if ((sc1d & 0x04) == 0x04) - return (dma_stat & 4) == 4; - } -somebody_else: - return (dma_stat & 4) == 4; /* return 1 if INTR asserted */ - case ide_dma_lostirq: - case ide_dma_timeout: - if (HWIF(drive)->resetproc != NULL) - HWIF(drive)->resetproc(drive); - default: - break; - } - return ide_dmaproc(func, drive); /* use standard DMA stuff */ -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -void pdc202xx_reset (ide_drive_t *drive) -{ - OUT_BYTE(0x04,IDE_CONTROL_REG); - mdelay(1000); - OUT_BYTE(0x00,IDE_CONTROL_REG); - mdelay(1000); - printk("PDC202XX: %s channel reset.\n", - HWIF(drive)->channel ? "Secondary" : "Primary"); -} - -/* - * Since SUN Cobalt is attempting to do this operation, I should disclose - * this has been a long time ago Thu Jul 27 16:40:57 2000 was the patch date - * HOTSWAP ATA Infrastructure. - */ -static int pdc202xx_tristate (ide_drive_t * drive, int state) -{ -#if 0 - ide_hwif_t *hwif = HWIF(drive); - unsigned long high_16 = pci_resource_start(hwif->pci_dev, 4); - byte sc1f = inb(high_16 + 0x001f); - - if (!hwif) - return -EINVAL; - -// hwif->bus_state = state; - - if (state) { - outb(sc1f | 0x08, high_16 + 0x001f); - } else { - outb(sc1f & ~0x08, high_16 + 0x001f); - } -#endif - return 0; -} - -unsigned int __init pci_init_pdc202xx (struct pci_dev *dev, const char *name) -{ - unsigned long high_16 = pci_resource_start(dev, 4); - byte udma_speed_flag = IN_BYTE(high_16 + 0x001f); - byte primary_mode = IN_BYTE(high_16 + 0x001a); - byte secondary_mode = IN_BYTE(high_16 + 0x001b); - - OUT_BYTE(udma_speed_flag | 0x10, high_16 + 0x001f); - mdelay(100); - OUT_BYTE(udma_speed_flag & ~0x10, high_16 + 0x001f); - mdelay(2000); /* 2 seconds ?! */ - - if (dev->resource[PCI_ROM_RESOURCE].start) { - pci_write_config_dword(dev, PCI_ROM_ADDRESS, dev->resource[PCI_ROM_RESOURCE].start | PCI_ROM_ADDRESS_ENABLE); - printk("%s: ROM enabled at 0x%08lx\n", name, dev->resource[PCI_ROM_RESOURCE].start); - } - - printk("%s: (U)DMA Burst Bit %sABLED " \ - "Primary %s Mode " \ - "Secondary %s Mode.\n", - name, - (udma_speed_flag & 1) ? "EN" : "DIS", - (primary_mode & 1) ? "MASTER" : "PCI", - (secondary_mode & 1) ? "MASTER" : "PCI" ); - -#ifdef CONFIG_PDC202XX_BURST - if (!(udma_speed_flag & 1)) { - printk("%s: FORCING BURST BIT 0x%02x -> 0x%02x ", name, udma_speed_flag, (udma_speed_flag|1)); - OUT_BYTE(udma_speed_flag|1, high_16 + 0x001f); - printk("%sCTIVE\n", (IN_BYTE(high_16 + 0x001f) & 1) ? "A" : "INA"); - } -#endif /* CONFIG_PDC202XX_BURST */ - -#ifdef CONFIG_PDC202XX_MASTER - if (!(primary_mode & 1)) { - printk("%s: FORCING PRIMARY MODE BIT 0x%02x -> 0x%02x ", - name, primary_mode, (primary_mode|1)); - OUT_BYTE(primary_mode|1, high_16 + 0x001a); - printk("%s\n", (IN_BYTE(high_16 + 0x001a) & 1) ? "MASTER" : "PCI"); - } - - if (!(secondary_mode & 1)) { - printk("%s: FORCING SECONDARY MODE BIT 0x%02x -> 0x%02x ", - name, secondary_mode, (secondary_mode|1)); - OUT_BYTE(secondary_mode|1, high_16 + 0x001b); - printk("%s\n", (IN_BYTE(high_16 + 0x001b) & 1) ? "MASTER" : "PCI"); - } -#endif /* CONFIG_PDC202XX_MASTER */ - -#if defined(DISPLAY_PDC202XX_TIMINGS) && defined(CONFIG_PROC_FS) - if (!pdc202xx_proc) { - pdc202xx_proc = 1; - bmide_dev = dev; - pdc202xx_display_info = &pdc202xx_get_info; - } -#endif /* DISPLAY_PDC202XX_TIMINGS && CONFIG_PROC_FS */ - return dev->irq; -} - -unsigned int __init ata66_pdc202xx (ide_hwif_t *hwif) -{ - unsigned short mask = (hwif->channel) ? (1<<11) : (1<<10); - unsigned short CIS; - - switch(hwif->pci_dev->device) { - case PCI_DEVICE_ID_PROMISE_20276: - case PCI_DEVICE_ID_PROMISE_20275: - case PCI_DEVICE_ID_PROMISE_20269: - case PCI_DEVICE_ID_PROMISE_20268: - case PCI_DEVICE_ID_PROMISE_20270: - OUT_BYTE(0x0b, (hwif->dma_base + 1)); - return (!(IN_BYTE((hwif->dma_base + 3)) & 0x04)); - /* check 80pin cable */ - default: - pci_read_config_word(hwif->pci_dev, 0x50, &CIS); - return (!(CIS & mask)); - /* check 80pin cable */ - } -} - -void __init ide_init_pdc202xx (ide_hwif_t *hwif) -{ - hwif->tuneproc = &pdc202xx_tune_drive; - hwif->quirkproc = &pdc202xx_quirkproc; - hwif->resetproc = &pdc202xx_reset; - - switch(hwif->pci_dev->device) { - case PCI_DEVICE_ID_PROMISE_20276: - case PCI_DEVICE_ID_PROMISE_20275: - case PCI_DEVICE_ID_PROMISE_20269: - case PCI_DEVICE_ID_PROMISE_20268: - case PCI_DEVICE_ID_PROMISE_20270: - hwif->speedproc = &pdc202xx_new_tune_chipset; - break; - case PCI_DEVICE_ID_PROMISE_20267: - case PCI_DEVICE_ID_PROMISE_20265: - case PCI_DEVICE_ID_PROMISE_20262: - hwif->busproc = &pdc202xx_tristate; - case PCI_DEVICE_ID_PROMISE_20246: - hwif->speedproc = &pdc202xx_tune_chipset; - default: - break; - } - -#undef CONFIG_PDC202XX_32_UNMASK -#ifdef CONFIG_PDC202XX_32_UNMASK - hwif->drives[0].io_32bit = 1; - hwif->drives[1].io_32bit = 1; - hwif->drives[0].unmask = 1; - hwif->drives[1].unmask = 1; -#endif /* CONFIG_PDC202XX_32_UNMASK */ - -#ifdef CONFIG_BLK_DEV_IDEDMA - if (hwif->dma_base) { - hwif->dmaproc = &pdc202xx_dmaproc; - if (!noautodma) - hwif->autodma = 1; - } else { - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - hwif->autodma = 0; - } -#else /* !CONFIG_BLK_DEV_IDEDMA */ - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - hwif->autodma = 0; -#endif /* CONFIG_BLK_DEV_IDEDMA */ -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pdc4030.c linux.20pre5-ac2/drivers/ide/pdc4030.c --- linux.20pre5/drivers/ide/pdc4030.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pdc4030.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,578 +0,0 @@ -/* -*- linux-c -*- - * linux/drivers/ide/pdc4030.c Version 0.90 May 27, 1999 - * - * Copyright (C) 1995-1999 Linus Torvalds & authors (see below) - */ - -/* - * Principal Author/Maintainer: peterd@pnd-pc.demon.co.uk - * - * This file provides support for the second port and cache of Promise - * IDE interfaces, e.g. DC4030VL, DC4030VL-1 and DC4030VL-2. - * - * Thanks are due to Mark Lord for advice and patiently answering stupid - * questions, and all those mugs^H^H^H^Hbrave souls who've tested this, - * especially Andre Hedrick. - * - * Version 0.01 Initial version, #include'd in ide.c rather than - * compiled separately. - * Reads use Promise commands, writes as before. Drives - * on second channel are read-only. - * Version 0.02 Writes working on second channel, reads on both - * channels. Writes fail under high load. Suspect - * transfers of >127 sectors don't work. - * Version 0.03 Brought into line with ide.c version 5.27. - * Other minor changes. - * Version 0.04 Updated for ide.c version 5.30 - * Changed initialization strategy - * Version 0.05 Kernel integration. -ml - * Version 0.06 Ooops. Add hwgroup to direct call of ide_intr() -ml - * Version 0.07 Added support for DC4030 variants - * Secondary interface autodetection - * Version 0.08 Renamed to pdc4030.c - * Version 0.09 Obsolete - never released - did manual write request - * splitting before max_sectors[major][minor] available. - * Version 0.10 Updated for 2.1 series of kernels - * Version 0.11 Updated for 2.3 series of kernels - * Autodetection code added. - * - * Version 0.90 Transition to BETA code. No lost/unexpected interrupts - */ - -/* - * Once you've compiled it in, you'll have to also enable the interface - * setup routine from the kernel command line, as in - * - * 'linux ide0=dc4030' or 'linux ide1=dc4030' - * - * It should now work as a second controller also ('ide1=dc4030') but only - * if you DON'T have BIOS V4.44, which has a bug. If you have this version - * and EPROM programming facilities, you need to fix 4 bytes: - * 2496: 81 81 - * 2497: 3E 3E - * 2498: 22 98 * - * 2499: 06 05 * - * 249A: F0 F0 - * 249B: 01 01 - * ... - * 24A7: 81 81 - * 24A8: 3E 3E - * 24A9: 22 98 * - * 24AA: 06 05 * - * 24AB: 70 70 - * 24AC: 01 01 - * - * As of January 1999, Promise Technology Inc. have finally supplied me with - * some technical information which has shed a glimmer of light on some of the - * problems I was having, especially with writes. - * - * There are still problems with the robustness and efficiency of this driver - * because I still don't understand what the card is doing with interrupts. - */ - -#define DEBUG_READ -#define DEBUG_WRITE - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "pdc4030.h" - -#ifdef CONFIG_IDE_TASKFILE_IO -# define __TASKFILE__IO -#else /* CONFIG_IDE_TASKFILE_IO */ -# undef __TASKFILE__IO -#endif /* CONFIG_IDE_TASKFILE_IO */ - -/* - * promise_selectproc() is invoked by ide.c - * in preparation for access to the specified drive. - */ -static void promise_selectproc (ide_drive_t *drive) -{ - unsigned int number; - - number = (HWIF(drive)->channel << 1) + drive->select.b.unit; - OUT_BYTE(number,IDE_FEATURE_REG); -} - -/* - * pdc4030_cmd handles the set of vendor specific commands that are initiated - * by command F0. They all have the same success/failure notification - - * 'P' (=0x50) on success, 'p' (=0x70) on failure. - */ -int pdc4030_cmd(ide_drive_t *drive, byte cmd) -{ - unsigned long timeout, timer; - byte status_val; - - promise_selectproc(drive); /* redundant? */ - OUT_BYTE(0xF3,IDE_SECTOR_REG); - OUT_BYTE(cmd,IDE_SELECT_REG); - OUT_BYTE(PROMISE_EXTENDED_COMMAND,IDE_COMMAND_REG); - timeout = HZ * 10; - timeout += jiffies; - do { - if(time_after(jiffies, timeout)) { - return 2; /* device timed out */ - } - /* This is out of delay_10ms() */ - /* Delays at least 10ms to give interface a chance */ - timer = jiffies + (HZ + 99)/100 + 1; - while (time_after(timer, jiffies)); - status_val = IN_BYTE(IDE_SECTOR_REG); - } while (status_val != 0x50 && status_val != 0x70); - - if(status_val == 0x50) - return 0; /* device returned success */ - else - return 1; /* device returned failure */ -} - -/* - * pdc4030_identify sends a vendor-specific IDENTIFY command to the drive - */ -int pdc4030_identify(ide_drive_t *drive) -{ - return pdc4030_cmd(drive, PROMISE_IDENTIFY); -} - -int enable_promise_support = 0; - -void __init init_pdc4030 (void) -{ - enable_promise_support = 1; -} - -/* - * setup_pdc4030() - * Completes the setup of a Promise DC4030 controller card, once found. - */ -int __init setup_pdc4030 (ide_hwif_t *hwif) -{ - ide_drive_t *drive; - ide_hwif_t *hwif2; - struct dc_ident ident; - int i; - ide_startstop_t startstop; - - if (!hwif) return 0; - - drive = &hwif->drives[0]; - hwif2 = &ide_hwifs[hwif->index+1]; - if (hwif->chipset == ide_pdc4030) /* we've already been found ! */ - return 1; - - if (IN_BYTE(IDE_NSECTOR_REG) == 0xFF || IN_BYTE(IDE_SECTOR_REG) == 0xFF) { - return 0; - } - if (IDE_CONTROL_REG) - OUT_BYTE(0x08,IDE_CONTROL_REG); - if (pdc4030_cmd(drive,PROMISE_GET_CONFIG)) { - return 0; - } - if (ide_wait_stat(&startstop, drive,DATA_READY,BAD_W_STAT,WAIT_DRQ)) { - printk(KERN_INFO - "%s: Failed Promise read config!\n",hwif->name); - return 0; - } - ide_input_data(drive,&ident,SECTOR_WORDS); - if (ident.id[1] != 'P' || ident.id[0] != 'T') { - return 0; - } - printk(KERN_INFO "%s: Promise caching controller, ",hwif->name); - switch(ident.type) { - case 0x43: printk("DC4030VL-2, "); break; - case 0x41: printk("DC4030VL-1, "); break; - case 0x40: printk("DC4030VL, "); break; - default: - printk("unknown - type 0x%02x - please report!\n" - ,ident.type); - printk("Please e-mail the following data to " - "promise@pnd-pc.demon.co.uk along with\n" - "a description of your card and drives:\n"); - for (i=0; i < 0x90; i++) { - printk("%02x ", ((unsigned char *)&ident)[i]); - if ((i & 0x0f) == 0x0f) printk("\n"); - } - return 0; - } - printk("%dKB cache, ",(int)ident.cache_mem); - switch(ident.irq) { - case 0x00: hwif->irq = 14; break; - case 0x01: hwif->irq = 12; break; - default: hwif->irq = 15; break; - } - printk("on IRQ %d\n",hwif->irq); - - /* - * Once found and identified, we set up the next hwif in the array - * (hwif2 = ide_hwifs[hwif->index+1]) with the same io ports, irq - * and other settings as the main hwif. This gives us two "mated" - * hwifs pointing to the Promise card. - * - * We also have to shift the default values for the remaining - * interfaces "up by one" to make room for the second interface on the - * same set of values. - */ - - hwif->chipset = hwif2->chipset = ide_pdc4030; - hwif->mate = hwif2; - hwif2->mate = hwif; - hwif2->channel = 1; - hwif->selectproc = hwif2->selectproc = &promise_selectproc; - hwif->serialized = hwif2->serialized = 1; - -/* Shift the remaining interfaces down by one */ - for (i=MAX_HWIFS-1 ; i > hwif->index+1 ; i--) { - ide_hwif_t *h = &ide_hwifs[i]; - -#ifdef DEBUG - printk(KERN_DEBUG "Shifting i/f %d values to i/f %d\n",i-1,i); -#endif - ide_init_hwif_ports(&h->hw, (h-1)->io_ports[IDE_DATA_OFFSET], 0, NULL); - memcpy(h->io_ports, h->hw.io_ports, sizeof(h->io_ports)); - h->noprobe = (h-1)->noprobe; - } - ide_init_hwif_ports(&hwif2->hw, hwif->io_ports[IDE_DATA_OFFSET], 0, NULL); - memcpy(hwif2->io_ports, hwif->hw.io_ports, sizeof(hwif2->io_ports)); - hwif2->irq = hwif->irq; - hwif2->hw.irq = hwif->hw.irq = hwif->irq; - for (i=0; i<2 ; i++) { - hwif->drives[i].io_32bit = 3; - hwif2->drives[i].io_32bit = 3; - hwif->drives[i].keep_settings = 1; - hwif2->drives[i].keep_settings = 1; - if (!ident.current_tm[i].cyl) - hwif->drives[i].noprobe = 1; - if (!ident.current_tm[i+2].cyl) - hwif2->drives[i].noprobe = 1; - } - return 1; -} - -/* - * detect_pdc4030() - * Tests for the presence of a DC4030 Promise card on this interface - * Returns: 1 if found, 0 if not found - */ -int __init detect_pdc4030(ide_hwif_t *hwif) -{ - ide_drive_t *drive = &hwif->drives[0]; - - if (IDE_DATA_REG == 0) { /* Skip test for non-existent interface */ - return 0; - } - OUT_BYTE(0xF3, IDE_SECTOR_REG); - OUT_BYTE(0x14, IDE_SELECT_REG); - OUT_BYTE(PROMISE_EXTENDED_COMMAND, IDE_COMMAND_REG); - - ide_delay_50ms(); - - if (IN_BYTE(IDE_ERROR_REG) == 'P' && - IN_BYTE(IDE_NSECTOR_REG) == 'T' && - IN_BYTE(IDE_SECTOR_REG) == 'I') { - return 1; - } else { - return 0; - } -} - -void __init ide_probe_for_pdc4030(void) -{ - unsigned int index; - ide_hwif_t *hwif; - - if (enable_promise_support == 0) - return; - for (index = 0; index < MAX_HWIFS; index++) { - hwif = &ide_hwifs[index]; - if (hwif->chipset == ide_unknown && detect_pdc4030(hwif)) { - setup_pdc4030(hwif); - } - } -} - -/* - * promise_read_intr() is the handler for disk read/multread interrupts - */ -static ide_startstop_t promise_read_intr (ide_drive_t *drive) -{ - byte stat; - int total_remaining; - unsigned int sectors_left, sectors_avail, nsect; - struct request *rq; - - if (!OK_STAT(stat=GET_STAT(),DATA_READY,BAD_R_STAT)) { - return ide_error(drive, "promise_read_intr", stat); - } - -read_again: - do { - sectors_left = IN_BYTE(IDE_NSECTOR_REG); - IN_BYTE(IDE_SECTOR_REG); - } while (IN_BYTE(IDE_NSECTOR_REG) != sectors_left); - rq = HWGROUP(drive)->rq; - sectors_avail = rq->nr_sectors - sectors_left; - if (!sectors_avail) - goto read_again; - -read_next: - rq = HWGROUP(drive)->rq; - nsect = rq->current_nr_sectors; - if (nsect > sectors_avail) - nsect = sectors_avail; - sectors_avail -= nsect; - ide_input_data(drive, rq->buffer, nsect * SECTOR_WORDS); -#ifdef DEBUG_READ - printk(KERN_DEBUG "%s: promise_read: sectors(%ld-%ld), " - "buf=0x%08lx, rem=%ld\n", drive->name, rq->sector, - rq->sector+nsect-1, (unsigned long) rq->buffer, - rq->nr_sectors-nsect); -#endif - rq->sector += nsect; - rq->buffer += nsect<<9; - rq->errors = 0; - rq->nr_sectors -= nsect; - total_remaining = rq->nr_sectors; - if ((rq->current_nr_sectors -= nsect) <= 0) { - ide_end_request(1, HWGROUP(drive)); - } -/* - * Now the data has been read in, do the following: - * - * if there are still sectors left in the request, - * if we know there are still sectors available from the interface, - * go back and read the next bit of the request. - * else if DRQ is asserted, there are more sectors available, so - * go back and find out how many, then read them in. - * else if BUSY is asserted, we are going to get an interrupt, so - * set the handler for the interrupt and just return - */ - if (total_remaining > 0) { - if (sectors_avail) - goto read_next; - stat = GET_STAT(); - if (stat & DRQ_STAT) - goto read_again; - if (stat & BUSY_STAT) { - ide_set_handler (drive, &promise_read_intr, WAIT_CMD, NULL); -#ifdef DEBUG_READ - printk(KERN_DEBUG "%s: promise_read: waiting for" - "interrupt\n", drive->name); -#endif - return ide_started; - } - printk(KERN_ERR "%s: Eeek! promise_read_intr: sectors left " - "!DRQ !BUSY\n", drive->name); - return ide_error(drive, "promise read intr", stat); - } - return ide_stopped; -} - -/* - * promise_complete_pollfunc() - * This is the polling function for waiting (nicely!) until drive stops - * being busy. It is invoked at the end of a write, after the previous poll - * has finished. - * - * Once not busy, the end request is called. - */ -static ide_startstop_t promise_complete_pollfunc(ide_drive_t *drive) -{ - ide_hwgroup_t *hwgroup = HWGROUP(drive); - struct request *rq = hwgroup->rq; - int i; - - if (GET_STAT() & BUSY_STAT) { - if (time_before(jiffies, hwgroup->poll_timeout)) { - ide_set_handler(drive, &promise_complete_pollfunc, HZ/100, NULL); - return ide_started; /* continue polling... */ - } - hwgroup->poll_timeout = 0; - printk(KERN_ERR "%s: completion timeout - still busy!\n", - drive->name); - return ide_error(drive, "busy timeout", GET_STAT()); - } - - hwgroup->poll_timeout = 0; -#ifdef DEBUG_WRITE - printk(KERN_DEBUG "%s: Write complete - end_request\n", drive->name); -#endif - for (i = rq->nr_sectors; i > 0; ) { - i -= rq->current_nr_sectors; - ide_end_request(1, hwgroup); - } - return ide_stopped; -} - -/* - * promise_write_pollfunc() is the handler for disk write completion polling. - */ -static ide_startstop_t promise_write_pollfunc (ide_drive_t *drive) -{ - ide_hwgroup_t *hwgroup = HWGROUP(drive); - - if (IN_BYTE(IDE_NSECTOR_REG) != 0) { - if (time_before(jiffies, hwgroup->poll_timeout)) { - ide_set_handler (drive, &promise_write_pollfunc, HZ/100, NULL); - return ide_started; /* continue polling... */ - } - hwgroup->poll_timeout = 0; - printk(KERN_ERR "%s: write timed-out!\n",drive->name); - return ide_error (drive, "write timeout", GET_STAT()); - } - - /* - * Now write out last 4 sectors and poll for not BUSY - */ - ide_multwrite(drive, 4); - hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; - ide_set_handler(drive, &promise_complete_pollfunc, HZ/100, NULL); -#ifdef DEBUG_WRITE - printk(KERN_DEBUG "%s: Done last 4 sectors - status = %02x\n", - drive->name, GET_STAT()); -#endif - return ide_started; -} - -/* - * promise_write() transfers a block of one or more sectors of data to a - * drive as part of a disk write operation. All but 4 sectors are transferred - * in the first attempt, then the interface is polled (nicely!) for completion - * before the final 4 sectors are transferred. There is no interrupt generated - * on writes (at least on the DC4030VL-2), we just have to poll for NOT BUSY. - */ -static ide_startstop_t promise_write (ide_drive_t *drive) -{ - ide_hwgroup_t *hwgroup = HWGROUP(drive); - struct request *rq = &hwgroup->wrq; - -#ifdef DEBUG_WRITE - printk(KERN_DEBUG "%s: promise_write: sectors(%ld-%ld), " - "buffer=%p\n", drive->name, rq->sector, - rq->sector + rq->nr_sectors - 1, rq->buffer); -#endif - - /* - * If there are more than 4 sectors to transfer, do n-4 then go into - * the polling strategy as defined above. - */ - if (rq->nr_sectors > 4) { - if (ide_multwrite(drive, rq->nr_sectors - 4)) - return ide_stopped; - hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; - ide_set_handler (drive, &promise_write_pollfunc, HZ/100, NULL); - return ide_started; - } else { - /* - * There are 4 or fewer sectors to transfer, do them all in one go - * and wait for NOT BUSY. - */ - if (ide_multwrite(drive, rq->nr_sectors)) - return ide_stopped; - hwgroup->poll_timeout = jiffies + WAIT_WORSTCASE; - ide_set_handler(drive, &promise_complete_pollfunc, HZ/100, NULL); -#ifdef DEBUG_WRITE - printk(KERN_DEBUG "%s: promise_write: <= 4 sectors, " - "status = %02x\n", drive->name, GET_STAT()); -#endif - return ide_started; - } -} - -/* - * do_pdc4030_io() is called from do_rw_disk, having had the block number - * already set up. It issues a READ or WRITE command to the Promise - * controller, assuming LBA has been used to set up the block number. - */ -ide_startstop_t do_pdc4030_io (ide_drive_t *drive, struct request *rq) -{ - ide_startstop_t startstop; - unsigned long timeout; - byte stat; - - switch(rq->cmd) { - case READ: -#ifndef __TASKFILE__IO - OUT_BYTE(PROMISE_READ, IDE_COMMAND_REG); -#endif -/* - * The card's behaviour is odd at this point. If the data is - * available, DRQ will be true, and no interrupt will be - * generated by the card. If this is the case, we need to call the - * "interrupt" handler (promise_read_intr) directly. Otherwise, if - * an interrupt is going to occur, bit0 of the SELECT register will - * be high, so we can set the handler the just return and be interrupted. - * If neither of these is the case, we wait for up to 50ms (badly I'm - * afraid!) until one of them is. - */ - timeout = jiffies + HZ/20; /* 50ms wait */ - do { - stat=GET_STAT(); - if (stat & DRQ_STAT) { - udelay(1); - return promise_read_intr(drive); - } - if (IN_BYTE(IDE_SELECT_REG) & 0x01) { -#ifdef DEBUG_READ - printk(KERN_DEBUG "%s: read: waiting for interrupt\n", drive->name); -#endif - ide_set_handler(drive, &promise_read_intr, WAIT_CMD, NULL); - return ide_started; - } - udelay(1); - } while (time_before(jiffies, timeout)); - - printk(KERN_ERR "%s: reading: No DRQ and not waiting - Odd!\n", drive->name); - return ide_stopped; - case WRITE: -#ifndef __TASKFILE__IO - OUT_BYTE(PROMISE_WRITE, IDE_COMMAND_REG); -#endif - if (ide_wait_stat(&startstop, drive, DATA_READY, drive->bad_wstat, WAIT_DRQ)) { - printk(KERN_ERR "%s: no DRQ after issuing PROMISE_WRITE\n", drive->name); - return startstop; - } - if (!drive->unmask) - __cli(); /* local CPU only */ - HWGROUP(drive)->wrq = *rq; /* scratchpad */ - return promise_write(drive); - default: - printk("KERN_WARNING %s: bad command: %d\n", drive->name, rq->cmd); - ide_end_request(0, HWGROUP(drive)); - return ide_stopped; - } -} - -#ifdef __TASKFILE__IO - -ide_startstop_t promise_rw_disk (ide_drive_t *drive, struct request *rq, unsigned long block) -{ - struct hd_drive_task_hdr taskfile; - - memset(&taskfile, 0, sizeof(struct hd_drive_task_hdr)); - - taskfile.sector_count = rq->nr_sectors; - taskfile.sector_number = block; - taskfile.low_cylinder = (block>>=8); - taskfile.high_cylinder = (block>>=8); - taskfile.device_head = ((block>>8)&0x0f)|drive->select.all; - taskfile.command = (rq->cmd==READ)?PROMISE_READ:PROMISE_WRITE; - - do_taskfile(drive, &taskfile, NULL, NULL); - return do_pdc4030_io(drive, rq); -} -#endif - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pdc4030.h linux.20pre5-ac2/drivers/ide/pdc4030.h --- linux.20pre5/drivers/ide/pdc4030.h 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pdc4030.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,44 +0,0 @@ -/* - * linux/drivers/ide/pdc4030.h - * - * Copyright (C) 1995-1998 Linus Torvalds & authors - */ - -/* - * Principal author: Peter Denison - */ - -#ifndef IDE_PROMISE_H -#define IDE_PROMISE_H - -#define PROMISE_EXTENDED_COMMAND 0xF0 -#define PROMISE_READ 0xF2 -#define PROMISE_WRITE 0xF3 -/* Extended commands - main command code = 0xf0 */ -#define PROMISE_GET_CONFIG 0x10 -#define PROMISE_IDENTIFY 0x20 - -struct translation_mode { - u16 cyl; - u8 head; - u8 sect; -}; - -struct dc_ident { - u8 type; - u8 unknown1; - u8 hw_revision; - u8 firmware_major; - u8 firmware_minor; - u8 bios_address; - u8 irq; - u8 unknown2; - u16 cache_mem; - u16 unknown3; - u8 id[2]; - u16 info; - struct translation_mode current_tm[4]; - u8 pad[SECTOR_WORDS*4 - 32]; -}; - -#endif /* IDE_PROMISE_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pdcraid.c linux.20pre5-ac2/drivers/ide/pdcraid.c --- linux.20pre5/drivers/ide/pdcraid.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pdcraid.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,646 +0,0 @@ -/* - pdcraid.c Copyright (C) 2001 Red Hat, Inc. All rights reserved. - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - - You should have received a copy of the GNU General Public License - (for example /usr/src/linux/COPYING); if not, write to the Free - Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - - Authors: Arjan van de Ven - - Based on work done by Søren Schmidt for FreeBSD - -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "ataraid.h" - -static int pdcraid_open(struct inode * inode, struct file * filp); -static int pdcraid_release(struct inode * inode, struct file * filp); -static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); -static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head * bh); -static int pdcraid1_make_request (request_queue_t *q, int rw, struct buffer_head * bh); - -struct disk_dev { - int major; - int minor; - int device; -}; - -static struct disk_dev devlist[]= { - {IDE0_MAJOR, 0, -1 }, - {IDE0_MAJOR, 64, -1 }, - {IDE1_MAJOR, 0, -1 }, - {IDE1_MAJOR, 64, -1 }, - {IDE2_MAJOR, 0, -1 }, - {IDE2_MAJOR, 64, -1 }, - {IDE3_MAJOR, 0, -1 }, - {IDE3_MAJOR, 64, -1 }, - {IDE4_MAJOR, 0, -1 }, - {IDE4_MAJOR, 64, -1 }, - {IDE5_MAJOR, 0, -1 }, - {IDE5_MAJOR, 64, -1 }, - {IDE6_MAJOR, 0, -1 }, - {IDE6_MAJOR, 64, -1 }, -}; - - -struct pdcdisk { - kdev_t device; - unsigned long sectors; - struct block_device *bdev; - unsigned long last_pos; -}; - -struct pdcraid { - unsigned int stride; - unsigned int disks; - unsigned long sectors; - struct geom geom; - - struct pdcdisk disk[8]; - - unsigned long cutoff[8]; - unsigned int cutoff_disks[8]; -}; - -static struct raid_device_operations pdcraid0_ops = { - open: pdcraid_open, - release: pdcraid_release, - ioctl: pdcraid_ioctl, - make_request: pdcraid0_make_request -}; - -static struct raid_device_operations pdcraid1_ops = { - open: pdcraid_open, - release: pdcraid_release, - ioctl: pdcraid_ioctl, - make_request: pdcraid1_make_request -}; - -static struct pdcraid raid[16]; - - -static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) -{ - unsigned int minor; - unsigned long sectors; - - if (!inode || !inode->i_rdev) - return -EINVAL; - - minor = MINOR(inode->i_rdev)>>SHIFT; - - switch (cmd) { - - case BLKGETSIZE: /* Return device size */ - if (!arg) return -EINVAL; - sectors = ataraid_gendisk.part[MINOR(inode->i_rdev)].nr_sects; - if (MINOR(inode->i_rdev)&15) - return put_user(sectors, (unsigned long *) arg); - return put_user(raid[minor].sectors , (unsigned long *) arg); - break; - - - case HDIO_GETGEO: - { - struct hd_geometry *loc = (struct hd_geometry *) arg; - unsigned short bios_cyl = raid[minor].geom.cylinders; /* truncate */ - - if (!loc) return -EINVAL; - if (put_user(raid[minor].geom.heads, (byte *) &loc->heads)) return -EFAULT; - if (put_user(raid[minor].geom.sectors, (byte *) &loc->sectors)) return -EFAULT; - if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT; - if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect, - (unsigned long *) &loc->start)) return -EFAULT; - return 0; - } - - case HDIO_GETGEO_BIG: - { - struct hd_big_geometry *loc = (struct hd_big_geometry *) arg; - if (!loc) return -EINVAL; - if (put_user(raid[minor].geom.heads, (byte *) &loc->heads)) return -EFAULT; - if (put_user(raid[minor].geom.sectors, (byte *) &loc->sectors)) return -EFAULT; - if (put_user(raid[minor].geom.cylinders, (unsigned int *) &loc->cylinders)) return -EFAULT; - if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect, - (unsigned long *) &loc->start)) return -EFAULT; - return 0; - } - - - case BLKROSET: - case BLKROGET: - case BLKSSZGET: - return blk_ioctl(inode->i_rdev, cmd, arg); - - default: - printk("Invalid ioctl \n"); - return -EINVAL; - }; - - return 0; -} - - -unsigned long partition_map_normal(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride) -{ - return block + partition_off; -} - -unsigned long partition_map_linux(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride) -{ - unsigned long newblock; - - newblock = stride - (partition_off%stride); if (newblock == stride) newblock = 0; - newblock += block; - newblock = newblock % partition_size; - newblock += partition_off; - - return newblock; -} - -static int funky_remap[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; - -unsigned long partition_map_linux_raid0_4disk(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride) -{ - unsigned long newblock,temp,temp2; - - newblock = stride - (partition_off%stride); if (newblock == stride) newblock = 0; - - if (block < (partition_size / (8*stride))*8*stride ) { - temp = block % stride; - temp2 = block / stride; - temp2 = ((temp2>>3)<<3)|(funky_remap[temp2&7]); - block = temp2*stride+temp; - } - - - newblock += block; - newblock = newblock % partition_size; - newblock += partition_off; - - return newblock; -} - - - -static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head * bh) -{ - unsigned long rsect; - unsigned long rsect_left,rsect_accum = 0; - unsigned long block; - unsigned int disk=0,real_disk=0; - int i; - int device; - struct pdcraid *thisraid; - - rsect = bh->b_rsector; - - /* Ok. We need to modify this sector number to a new disk + new sector number. - * If there are disks of different sizes, this gets tricky. - * Example with 3 disks (1Gb, 4Gb and 5 GB): - * The first 3 Gb of the "RAID" are evenly spread over the 3 disks. - * Then things get interesting. The next 2Gb (RAID view) are spread across disk 2 and 3 - * and the last 1Gb is disk 3 only. - * - * the way this is solved is like this: We have a list of "cutoff" points where everytime - * a disk falls out of the "higher" count, we mark the max sector. So once we pass a cutoff - * point, we have to divide by one less. - */ - - device = (bh->b_rdev >> SHIFT)&MAJOR_MASK; - thisraid = &raid[device]; - if (thisraid->stride==0) - thisraid->stride=1; - - /* Partitions need adding of the start sector of the partition to the requested sector */ - - rsect = partition_map_normal(rsect, ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect, ataraid_gendisk.part[MINOR(bh->b_rdev)].nr_sects, thisraid->stride); - - /* Woops we need to split the request to avoid crossing a stride barrier */ - if ((rsect/thisraid->stride) != ((rsect+(bh->b_size/512)-1)/thisraid->stride)) { - return -1; - } - - rsect_left = rsect; - - for (i=0;i<8;i++) { - if (thisraid->cutoff_disks[i]==0) - break; - if (rsect > thisraid->cutoff[i]) { - /* we're in the wrong area so far */ - rsect_left -= thisraid->cutoff[i]; - rsect_accum += thisraid->cutoff[i]/thisraid->cutoff_disks[i]; - } else { - block = rsect_left / thisraid->stride; - disk = block % thisraid->cutoff_disks[i]; - block = (block / thisraid->cutoff_disks[i]) * thisraid->stride; - rsect = rsect_accum + (rsect_left % thisraid->stride) + block; - break; - } - } - - for (i=0;i<8;i++) { - if ((disk==0) && (thisraid->disk[i].sectors > rsect_accum)) { - real_disk = i; - break; - } - if ((disk>0) && (thisraid->disk[i].sectors >= rsect_accum)) { - disk--; - } - - } - disk = real_disk; - - - /* - * The new BH_Lock semantics in ll_rw_blk.c guarantee that this - * is the only IO operation happening on this bh. - */ - bh->b_rdev = thisraid->disk[disk].device; - bh->b_rsector = rsect; - - /* - * Let the main block layer submit the IO and resolve recursion: - */ - return 1; -} - -static int pdcraid1_write_request(request_queue_t *q, int rw, struct buffer_head * bh) -{ - struct buffer_head *bh1; - struct ataraid_bh_private *private; - int device; - int i; - - device = (bh->b_rdev >> SHIFT)&MAJOR_MASK; - private = ataraid_get_private(); - if (private==NULL) - BUG(); - - private->parent = bh; - - atomic_set(&private->count,raid[device].disks); - - - for (i = 0; i< raid[device].disks; i++) { - bh1=ataraid_get_bhead(); - /* If this ever fails we're doomed */ - if (!bh1) - BUG(); - - /* dupe the bufferhead and update the parts that need to be different */ - memcpy(bh1, bh, sizeof(*bh)); - - bh1->b_end_io = ataraid_end_request; - bh1->b_private = private; - bh1->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; /* partition offset */ - bh1->b_rdev = raid[device].disk[i].device; - - /* update the last known head position for the drive */ - raid[device].disk[i].last_pos = bh1->b_rsector+(bh1->b_size>>9); - - generic_make_request(rw,bh1); - } - return 0; -} - -static int pdcraid1_read_request (request_queue_t *q, int rw, struct buffer_head * bh) -{ - int device; - int dist; - int bestsofar,bestdist,i; - static int previous; - - /* Reads are simple in principle. Pick a disk and go. - Initially I cheat by just picking the one which the last known - head position is closest by. - Later on, online/offline checking and performance needs adding */ - - device = (bh->b_rdev >> SHIFT)&MAJOR_MASK; - bh->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; - - bestsofar = 0; - bestdist = raid[device].disk[0].last_pos - bh->b_rsector; - if (bestdist<0) - bestdist=-bestdist; - if (bestdist>4095) - bestdist=4095; - - for (i=1 ; ib_rsector; - if (dist<0) - dist = -dist; - if (dist>4095) - dist=4095; - - if (bestdist==dist) { /* it's a tie; try to do some read balancing */ - if ((previous>bestsofar)&&(previous<=i)) - bestsofar = i; - previous = (previous + 1) % raid[device].disks; - } else if (bestdist>dist) { - bestdist = dist; - bestsofar = i; - } - - } - - bh->b_rdev = raid[device].disk[bestsofar].device; - raid[device].disk[bestsofar].last_pos = bh->b_rsector+(bh->b_size>>9); - - /* - * Let the main block layer submit the IO and resolve recursion: - */ - - return 1; -} - - -static int pdcraid1_make_request (request_queue_t *q, int rw, struct buffer_head * bh) -{ - /* Read and Write are totally different cases; split them totally here */ - if (rw==READA) - rw = READ; - - if (rw==READ) - return pdcraid1_read_request(q,rw,bh); - else - return pdcraid1_write_request(q,rw,bh); -} - -#include "pdcraid.h" - -static unsigned long calc_pdcblock_offset (int major,int minor) -{ - unsigned long lba = 0; - kdev_t dev; - ide_drive_t *ideinfo; - - dev = MKDEV(major,minor); - ideinfo = get_info_ptr (dev); - if (ideinfo==NULL) - return 0; - - - /* first sector of the last cluster */ - if (ideinfo->head==0) - return 0; - if (ideinfo->sect==0) - return 0; - lba = (ideinfo->capacity / (ideinfo->head*ideinfo->sect)); - lba = lba * (ideinfo->head*ideinfo->sect); - lba = lba - ideinfo->sect; - - return lba; -} - - -static int read_disk_sb (int major, int minor, unsigned char *buffer,int bufsize) -{ - int ret = -EINVAL; - struct buffer_head *bh = NULL; - kdev_t dev = MKDEV(major,minor); - unsigned long sb_offset; - - if (blksize_size[major]==NULL) /* device doesn't exist */ - return -EINVAL; - - - /* - * Calculate the position of the superblock, - * it's at first sector of the last cylinder - */ - sb_offset = calc_pdcblock_offset(major,minor)/8; - /* The /8 transforms sectors into 4Kb blocks */ - - if (sb_offset==0) - return -1; - - set_blocksize (dev, 4096); - - bh = bread (dev, sb_offset, 4096); - - if (bh) { - memcpy (buffer, bh->b_data, bufsize); - } else { - printk(KERN_ERR "pdcraid: Error reading superblock.\n"); - goto abort; - } - ret = 0; -abort: - if (bh) - brelse (bh); - return ret; -} - -static unsigned int calc_sb_csum (unsigned int* ptr) -{ - unsigned int sum; - int count; - - sum = 0; - for (count=0;count<511;count++) - sum += *ptr++; - - return sum; -} - -static int cookie = 0; - -static void __init probedisk(int devindex,int device, int raidlevel) -{ - int i; - int major, minor; - struct promise_raid_conf *prom; - static unsigned char block[4096]; - struct block_device *bdev; - - if (devlist[devindex].device!=-1) /* already assigned to another array */ - return; - - major = devlist[devindex].major; - minor = devlist[devindex].minor; - - if (read_disk_sb(major,minor,(unsigned char*)&block,sizeof(block))) - return; - - prom = (struct promise_raid_conf*)&block[512]; - - /* the checksums must match */ - if (prom->checksum != calc_sb_csum((unsigned int*)prom)) - return; - if (prom->raid.type!=raidlevel) /* different raidlevel */ - return; - - if ((cookie!=0) && (cookie != prom->raid.magic_1)) /* different array */ - return; - - cookie = prom->raid.magic_1; - - /* This looks evil. But basically, we have to search for our adapternumber - in the arraydefinition, both of which are in the superblock */ - for (i=0;(iraid.total_disks)&&(i<8);i++) { - if ( (prom->raid.disk[i].channel== prom->raid.channel) && - (prom->raid.disk[i].device == prom->raid.device) ) { - - bdev = bdget(MKDEV(major,minor)); - if (bdev && blkdev_get(bdev, FMODE_READ|FMODE_WRITE, 0, BDEV_RAW) == 0) { - raid[device].disk[i].bdev = bdev; - } - raid[device].disk[i].device = MKDEV(major,minor); - raid[device].disk[i].sectors = prom->raid.disk_secs; - raid[device].stride = (1<raid.raid0_shift); - raid[device].disks = prom->raid.total_disks; - raid[device].sectors = prom->raid.total_secs; - raid[device].geom.heads = prom->raid.heads+1; - raid[device].geom.sectors = prom->raid.sectors; - raid[device].geom.cylinders = prom->raid.cylinders+1; - devlist[devindex].device=device; - } - } - -} - -static void __init fill_cutoff(int device) -{ - int i,j; - unsigned long smallest; - unsigned long bar; - int count; - - bar = 0; - for (i=0;i<8;i++) { - smallest = ~0; - for (j=0;j<8;j++) - if ((raid[device].disk[j].sectors < smallest) && (raid[device].disk[j].sectors>bar)) - smallest = raid[device].disk[j].sectors; - count = 0; - for (j=0;j<8;j++) - if (raid[device].disk[j].sectors >= smallest) - count++; - - smallest = smallest * count; - bar = smallest; - raid[device].cutoff[i] = smallest; - raid[device].cutoff_disks[i] = count; - } -} - -static __init int pdcraid_init_one(int device,int raidlevel) -{ - int i, count; - - for (i=0; i<14; i++) - probedisk(i, device, raidlevel); - - if (raidlevel==0) - fill_cutoff(device); - - /* Initialize the gendisk structure */ - - ataraid_register_disk(device,raid[device].sectors); - - count=0; - - for (i=0;i<8;i++) { - if (raid[device].disk[i].device!=0) { - printk(KERN_INFO "Drive %i is %li Mb (%i / %i) \n", - i,raid[device].disk[i].sectors/2048,MAJOR(raid[device].disk[i].device),MINOR(raid[device].disk[i].device)); - count++; - } - } - if (count) { - printk(KERN_INFO "Raid%i array consists of %i drives. \n",raidlevel,count); - return 0; - } else { - return -ENODEV; - } -} - -static __init int pdcraid_init(void) -{ - int retval, device, count = 0; - - do { - cookie = 0; - device=ataraid_get_device(&pdcraid0_ops); - if (device<0) - break; - retval = pdcraid_init_one(device,0); - if (retval) { - ataraid_release_device(device); - break; - } else { - count++; - } - } while (1); - - do { - - cookie = 0; - device=ataraid_get_device(&pdcraid1_ops); - if (device<0) - break; - retval = pdcraid_init_one(device,1); - if (retval) { - ataraid_release_device(device); - break; - } else { - count++; - } - } while (1); - - if (count) { - printk(KERN_INFO "Promise Fasttrak(tm) Softwareraid driver for linux version 0.03beta\n"); - return 0; - } - printk(KERN_DEBUG "Promise Fasttrak(tm) Softwareraid driver 0.03beta: No raid array found\n"); - return -ENODEV; -} - -static void __exit pdcraid_exit (void) -{ - int i,device; - for (device = 0; device<16; device++) { - for (i=0;i<8;i++) { - struct block_device *bdev = raid[device].disk[i].bdev; - raid[device].disk[i].bdev = NULL; - if (bdev) - blkdev_put(bdev, BDEV_RAW); - } - if (raid[device].sectors) - ataraid_release_device(device); - } -} - -static int pdcraid_open(struct inode * inode, struct file * filp) -{ - MOD_INC_USE_COUNT; - return 0; -} -static int pdcraid_release(struct inode * inode, struct file * filp) -{ - MOD_DEC_USE_COUNT; - return 0; -} - -module_init(pdcraid_init); -module_exit(pdcraid_exit); -MODULE_LICENSE("GPL"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/pdcraid.h linux.20pre5-ac2/drivers/ide/pdcraid.h --- linux.20pre5/drivers/ide/pdcraid.h 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/pdcraid.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,47 +0,0 @@ -struct promise_raid_conf { - char promise_id[24]; - - u32 dummy_0; - u32 magic_0; - u32 dummy_1; - u32 magic_1; - u16 dummy_2; - u8 filler1[470]; - struct { - u32 flags; /* 0x200 */ - u8 dummy_0; - u8 disk_number; - u8 channel; - u8 device; - u32 magic_0; - u32 dummy_1; - u32 dummy_2; /* 0x210 */ - u32 disk_secs; - u32 dummy_3; - u16 dummy_4; - u8 status; - u8 type; - u8 total_disks; /* 0x220 */ - u8 raid0_shift; - u8 raid0_disks; - u8 array_number; - u32 total_secs; - u16 cylinders; - u8 heads; - u8 sectors; - u32 magic_1; - u32 dummy_5; /* 0x230 */ - struct { - u16 dummy_0; - u8 channel; - u8 device; - u32 magic_0; - u32 disk_number; - } disk[8]; - } raid; - u32 filler2[346]; - u32 checksum; -}; - -#define PR_MAGIC "Promise Technology, Inc." - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/piix.c linux.20pre5-ac2/drivers/ide/piix.c --- linux.20pre5/drivers/ide/piix.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/piix.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,542 +0,0 @@ -/* - * linux/drivers/ide/piix.c Version 0.32 June 9, 2000 - * - * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer - * Copyright (C) 1998-2000 Andre Hedrick - * May be copied or modified under the terms of the GNU General Public License - * - * PIO mode setting function for Intel chipsets. - * For use instead of BIOS settings. - * - * 40-41 - * 42-43 - * - * 41 - * 43 - * - * | PIO 0 | c0 | 80 | 0 | piix_tune_drive(drive, 0); - * | PIO 2 | SW2 | d0 | 90 | 4 | piix_tune_drive(drive, 2); - * | PIO 3 | MW1 | e1 | a1 | 9 | piix_tune_drive(drive, 3); - * | PIO 4 | MW2 | e3 | a3 | b | piix_tune_drive(drive, 4); - * - * sitre = word40 & 0x4000; primary - * sitre = word42 & 0x4000; secondary - * - * 44 8421|8421 hdd|hdb - * - * 48 8421 hdd|hdc|hdb|hda udma enabled - * - * 0001 hda - * 0010 hdb - * 0100 hdc - * 1000 hdd - * - * 4a 84|21 hdb|hda - * 4b 84|21 hdd|hdc - * - * ata-33/82371AB - * ata-33/82371EB - * ata-33/82801AB ata-66/82801AA - * 00|00 udma 0 00|00 reserved - * 01|01 udma 1 01|01 udma 3 - * 10|10 udma 2 10|10 udma 4 - * 11|11 reserved 11|11 reserved - * - * 54 8421|8421 ata66 drive|ata66 enable - * - * pci_read_config_word(HWIF(drive)->pci_dev, 0x40, ®40); - * pci_read_config_word(HWIF(drive)->pci_dev, 0x42, ®42); - * pci_read_config_word(HWIF(drive)->pci_dev, 0x44, ®44); - * pci_read_config_word(HWIF(drive)->pci_dev, 0x48, ®48); - * pci_read_config_word(HWIF(drive)->pci_dev, 0x4a, ®4a); - * pci_read_config_word(HWIF(drive)->pci_dev, 0x54, ®54); - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "ide_modes.h" - -#define PIIX_DEBUG_DRIVE_INFO 0 - -#define DISPLAY_PIIX_TIMINGS - -#if defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static int piix_get_info(char *, char **, off_t, int); -extern int (*piix_display_info)(char *, char **, off_t, int); /* ide-proc.c */ -extern char *ide_media_verbose(ide_drive_t *); -static struct pci_dev *bmide_dev; - -static int piix_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - u32 bibma = pci_resource_start(bmide_dev, 4); - u16 reg40 = 0, psitre = 0, reg42 = 0, ssitre = 0; - u8 c0 = 0, c1 = 0; - u8 reg44 = 0, reg48 = 0, reg4a = 0, reg4b = 0, reg54 = 0, reg55 = 0; - - switch(bmide_dev->device) { - case PCI_DEVICE_ID_INTEL_82801BA_8: - case PCI_DEVICE_ID_INTEL_82801BA_9: - case PCI_DEVICE_ID_INTEL_82801CA_10: - case PCI_DEVICE_ID_INTEL_82801CA_11: - case PCI_DEVICE_ID_INTEL_82801DB_11: - case PCI_DEVICE_ID_INTEL_82801E_11: - p += sprintf(p, "\n Intel PIIX4 Ultra 100 Chipset.\n"); - break; - case PCI_DEVICE_ID_INTEL_82372FB_1: - case PCI_DEVICE_ID_INTEL_82801AA_1: - p += sprintf(p, "\n Intel PIIX4 Ultra 66 Chipset.\n"); - break; - case PCI_DEVICE_ID_INTEL_82451NX: - case PCI_DEVICE_ID_INTEL_82801AB_1: - case PCI_DEVICE_ID_INTEL_82443MX_1: - case PCI_DEVICE_ID_INTEL_82371AB: - p += sprintf(p, "\n Intel PIIX4 Ultra 33 Chipset.\n"); - break; - case PCI_DEVICE_ID_INTEL_82371SB_1: - p += sprintf(p, "\n Intel PIIX3 Chipset.\n"); - break; - case PCI_DEVICE_ID_INTEL_82371MX: - p += sprintf(p, "\n Intel MPIIX Chipset.\n"); - return p-buffer; /* => must be less than 4k! */ - case PCI_DEVICE_ID_INTEL_82371FB_1: - case PCI_DEVICE_ID_INTEL_82371FB_0: - default: - p += sprintf(p, "\n Intel PIIX Chipset.\n"); - break; - } - - pci_read_config_word(bmide_dev, 0x40, ®40); - pci_read_config_word(bmide_dev, 0x42, ®42); - pci_read_config_byte(bmide_dev, 0x44, ®44); - pci_read_config_byte(bmide_dev, 0x48, ®48); - pci_read_config_byte(bmide_dev, 0x4a, ®4a); - pci_read_config_byte(bmide_dev, 0x4b, ®4b); - pci_read_config_byte(bmide_dev, 0x54, ®54); - pci_read_config_byte(bmide_dev, 0x55, ®55); - - psitre = (reg40 & 0x4000) ? 1 : 0; - ssitre = (reg42 & 0x4000) ? 1 : 0; - - /* - * at that point bibma+0x2 et bibma+0xa are byte registers - * to investigate: - */ - c0 = inb_p((unsigned short)bibma + 0x02); - c1 = inb_p((unsigned short)bibma + 0x0a); - - p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n"); - p += sprintf(p, " %sabled %sabled\n", - (c0&0x80) ? "dis" : " en", - (c1&0x80) ? "dis" : " en"); - p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n"); - p += sprintf(p, "DMA enabled: %s %s %s %s\n", - (c0&0x20) ? "yes" : "no ", - (c0&0x40) ? "yes" : "no ", - (c1&0x20) ? "yes" : "no ", - (c1&0x40) ? "yes" : "no " ); - p += sprintf(p, "UDMA enabled: %s %s %s %s\n", - (reg48&0x01) ? "yes" : "no ", - (reg48&0x02) ? "yes" : "no ", - (reg48&0x04) ? "yes" : "no ", - (reg48&0x08) ? "yes" : "no " ); - p += sprintf(p, "UDMA enabled: %s %s %s %s\n", - ((reg54&0x11) && (reg55&0x10) && (reg4a&0x01)) ? "5" : - ((reg54&0x11) && (reg4a&0x02)) ? "4" : - ((reg54&0x11) && (reg4a&0x01)) ? "3" : - (reg4a&0x02) ? "2" : - (reg4a&0x01) ? "1" : - (reg4a&0x00) ? "0" : "X", - ((reg54&0x22) && (reg55&0x20) && (reg4a&0x10)) ? "5" : - ((reg54&0x22) && (reg4a&0x20)) ? "4" : - ((reg54&0x22) && (reg4a&0x10)) ? "3" : - (reg4a&0x20) ? "2" : - (reg4a&0x10) ? "1" : - (reg4a&0x00) ? "0" : "X", - ((reg54&0x44) && (reg55&0x40) && (reg4b&0x03)) ? "5" : - ((reg54&0x44) && (reg4b&0x02)) ? "4" : - ((reg54&0x44) && (reg4b&0x01)) ? "3" : - (reg4b&0x02) ? "2" : - (reg4b&0x01) ? "1" : - (reg4b&0x00) ? "0" : "X", - ((reg54&0x88) && (reg55&0x80) && (reg4b&0x30)) ? "5" : - ((reg54&0x88) && (reg4b&0x20)) ? "4" : - ((reg54&0x88) && (reg4b&0x10)) ? "3" : - (reg4b&0x20) ? "2" : - (reg4b&0x10) ? "1" : - (reg4b&0x00) ? "0" : "X"); - - p += sprintf(p, "UDMA\n"); - p += sprintf(p, "DMA\n"); - p += sprintf(p, "PIO\n"); - -/* - * FIXME.... Add configuration junk data....blah blah...... - */ - - return p-buffer; /* => must be less than 4k! */ -} -#endif /* defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS) */ - -/* - * Used to set Fifo configuration via kernel command line: - */ - -byte piix_proc = 0; - -extern char *ide_xfer_verbose (byte xfer_rate); - -#if defined(CONFIG_BLK_DEV_IDEDMA) && defined(CONFIG_PIIX_TUNING) -/* - * - */ -static byte piix_dma_2_pio (byte xfer_rate) { - switch(xfer_rate) { - case XFER_UDMA_5: - case XFER_UDMA_4: - case XFER_UDMA_3: - case XFER_UDMA_2: - case XFER_UDMA_1: - case XFER_UDMA_0: - case XFER_MW_DMA_2: - case XFER_PIO_4: - return 4; - case XFER_MW_DMA_1: - case XFER_PIO_3: - return 3; - case XFER_SW_DMA_2: - case XFER_PIO_2: - return 2; - case XFER_MW_DMA_0: - case XFER_SW_DMA_1: - case XFER_SW_DMA_0: - case XFER_PIO_1: - case XFER_PIO_0: - case XFER_PIO_SLOW: - default: - return 0; - } -} -#endif /* defined(CONFIG_BLK_DEV_IDEDMA) && (CONFIG_PIIX_TUNING) */ - -/* - * Based on settings done by AMI BIOS - * (might be useful if drive is not registered in CMOS for any reason). - */ -static void piix_tune_drive (ide_drive_t *drive, byte pio) -{ - unsigned long flags; - u16 master_data; - byte slave_data; - int is_slave = (&HWIF(drive)->drives[1] == drive); - int master_port = HWIF(drive)->index ? 0x42 : 0x40; - int slave_port = 0x44; - /* ISP RTC */ - byte timings[][2] = { { 0, 0 }, - { 0, 0 }, - { 1, 0 }, - { 2, 1 }, - { 2, 3 }, }; - - pio = ide_get_best_pio_mode(drive, pio, 5, NULL); - pci_read_config_word(HWIF(drive)->pci_dev, master_port, &master_data); - if (is_slave) { - master_data = master_data | 0x4000; - if (pio > 1) - /* enable PPE, IE and TIME */ - master_data = master_data | 0x0070; - pci_read_config_byte(HWIF(drive)->pci_dev, slave_port, &slave_data); - slave_data = slave_data & (HWIF(drive)->index ? 0x0f : 0xf0); - slave_data = slave_data | (((timings[pio][0] << 2) | timings[pio][1]) - << (HWIF(drive)->index ? 4 : 0)); - } else { - master_data = master_data & 0xccf8; - if (pio > 1) - /* enable PPE, IE and TIME */ - master_data = master_data | 0x0007; - master_data = master_data | (timings[pio][0] << 12) | - (timings[pio][1] << 8); - } - save_flags(flags); - cli(); - pci_write_config_word(HWIF(drive)->pci_dev, master_port, master_data); - if (is_slave) - pci_write_config_byte(HWIF(drive)->pci_dev, slave_port, slave_data); - restore_flags(flags); -} - -#if defined(CONFIG_BLK_DEV_IDEDMA) && defined(CONFIG_PIIX_TUNING) -static int piix_tune_chipset (ide_drive_t *drive, byte speed) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - byte maslave = hwif->channel ? 0x42 : 0x40; - int a_speed = 3 << (drive->dn * 4); - int u_flag = 1 << drive->dn; - int v_flag = 0x01 << drive->dn; - int w_flag = 0x10 << drive->dn; - int u_speed = 0; - int err = 0; - int sitre; - short reg4042, reg44, reg48, reg4a, reg54; - byte reg55; - - pci_read_config_word(dev, maslave, ®4042); - sitre = (reg4042 & 0x4000) ? 1 : 0; - pci_read_config_word(dev, 0x44, ®44); - pci_read_config_word(dev, 0x48, ®48); - pci_read_config_word(dev, 0x4a, ®4a); - pci_read_config_word(dev, 0x54, ®54); - pci_read_config_byte(dev, 0x55, ®55); - - switch(speed) { - case XFER_UDMA_4: - case XFER_UDMA_2: u_speed = 2 << (drive->dn * 4); break; - case XFER_UDMA_5: - case XFER_UDMA_3: - case XFER_UDMA_1: u_speed = 1 << (drive->dn * 4); break; - case XFER_UDMA_0: u_speed = 0 << (drive->dn * 4); break; - case XFER_MW_DMA_2: - case XFER_MW_DMA_1: - case XFER_SW_DMA_2: break; - default: return -1; - } - - if (speed >= XFER_UDMA_0) { - if (!(reg48 & u_flag)) - pci_write_config_word(dev, 0x48, reg48|u_flag); - if (speed == XFER_UDMA_5) { - pci_write_config_byte(dev, 0x55, (byte) reg55|w_flag); - } else { - pci_write_config_byte(dev, 0x55, (byte) reg55 & ~w_flag); - } - if (!(reg4a & u_speed)) { - pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); - pci_write_config_word(dev, 0x4a, reg4a|u_speed); - } - if (speed > XFER_UDMA_2) { - if (!(reg54 & v_flag)) { - pci_write_config_word(dev, 0x54, reg54|v_flag); - } - } else { - pci_write_config_word(dev, 0x54, reg54 & ~v_flag); - } - } - if (speed < XFER_UDMA_0) { - if (reg48 & u_flag) - pci_write_config_word(dev, 0x48, reg48 & ~u_flag); - if (reg4a & a_speed) - pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); - if (reg54 & v_flag) - pci_write_config_word(dev, 0x54, reg54 & ~v_flag); - if (reg55 & w_flag) - pci_write_config_byte(dev, 0x55, (byte) reg55 & ~w_flag); - } - - piix_tune_drive(drive, piix_dma_2_pio(speed)); - -#if PIIX_DEBUG_DRIVE_INFO - printk("%s: %s drive%d\n", drive->name, ide_xfer_verbose(speed), drive->dn); -#endif /* PIIX_DEBUG_DRIVE_INFO */ - if (!drive->init_speed) - drive->init_speed = speed; - err = ide_config_drive_speed(drive, speed); - drive->current_speed = speed; - return err; -} - -static int piix_config_drive_for_dma (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - byte speed; - - byte udma_66 = eighty_ninty_three(drive); - int ultra100 = ((dev->device == PCI_DEVICE_ID_INTEL_82801BA_8) || - (dev->device == PCI_DEVICE_ID_INTEL_82801BA_9) || - (dev->device == PCI_DEVICE_ID_INTEL_82801CA_10) || - (dev->device == PCI_DEVICE_ID_INTEL_82801CA_11) || - (dev->device == PCI_DEVICE_ID_INTEL_82801DB_11) || - (dev->device == PCI_DEVICE_ID_INTEL_82801E_11)) ? 1 : 0; - int ultra66 = ((ultra100) || - (dev->device == PCI_DEVICE_ID_INTEL_82801AA_1) || - (dev->device == PCI_DEVICE_ID_INTEL_82372FB_1)) ? 1 : 0; - int ultra = ((ultra66) || - (dev->device == PCI_DEVICE_ID_INTEL_82371AB) || - (dev->device == PCI_DEVICE_ID_INTEL_82443MX_1) || - (dev->device == PCI_DEVICE_ID_INTEL_82451NX) || - (dev->device == PCI_DEVICE_ID_INTEL_82801AB_1)) ? 1 : 0; - - if ((id->dma_ultra & 0x0020) && (udma_66) && (ultra100)) { - speed = XFER_UDMA_5; - } else if ((id->dma_ultra & 0x0010) && (ultra)) { - speed = ((udma_66) && (ultra66)) ? XFER_UDMA_4 : XFER_UDMA_2; - } else if ((id->dma_ultra & 0x0008) && (ultra)) { - speed = ((udma_66) && (ultra66)) ? XFER_UDMA_3 : XFER_UDMA_1; - } else if ((id->dma_ultra & 0x0004) && (ultra)) { - speed = XFER_UDMA_2; - } else if ((id->dma_ultra & 0x0002) && (ultra)) { - speed = XFER_UDMA_1; - } else if ((id->dma_ultra & 0x0001) && (ultra)) { - speed = XFER_UDMA_0; - } else if (id->dma_mword & 0x0004) { - speed = XFER_MW_DMA_2; - } else if (id->dma_mword & 0x0002) { - speed = XFER_MW_DMA_1; - } else if (id->dma_1word & 0x0004) { - speed = XFER_SW_DMA_2; - } else { - speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL); - } - - (void) piix_tune_chipset(drive, speed); - - return ((int) ((id->dma_ultra >> 11) & 7) ? ide_dma_on : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ((id->dma_1word >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); -} - -static void config_chipset_for_pio (ide_drive_t *drive) -{ - piix_tune_drive(drive, ide_get_best_pio_mode(drive, 255, 5, NULL)); -} - -static int config_drive_xfer_rate (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - ide_dma_action_t dma_func = ide_dma_on; - - if (id && (id->capability & 1) && HWIF(drive)->autodma) { - /* Consult the list of known "bad" drives */ - if (ide_dmaproc(ide_dma_bad_drive, drive)) { - dma_func = ide_dma_off; - goto fast_ata_pio; - } - dma_func = ide_dma_off_quietly; - if (id->field_valid & 4) { - if (id->dma_ultra & 0x003F) { - /* Force if Capable UltraDMA */ - dma_func = piix_config_drive_for_dma(drive); - if ((id->field_valid & 2) && - (dma_func != ide_dma_on)) - goto try_dma_modes; - } - } else if (id->field_valid & 2) { -try_dma_modes: - if ((id->dma_mword & 0x0007) || - (id->dma_1word & 0x007)) { - /* Force if Capable regular DMA modes */ - dma_func = piix_config_drive_for_dma(drive); - if (dma_func != ide_dma_on) - goto no_dma_set; - } - } else if (ide_dmaproc(ide_dma_good_drive, drive)) { - if (id->eide_dma_time > 150) { - goto no_dma_set; - } - /* Consult the list of known "good" drives */ - dma_func = piix_config_drive_for_dma(drive); - if (dma_func != ide_dma_on) - goto no_dma_set; - } else { - goto fast_ata_pio; - } - } else if ((id->capability & 8) || (id->field_valid & 2)) { -fast_ata_pio: - dma_func = ide_dma_off_quietly; -no_dma_set: - config_chipset_for_pio(drive); - } - return HWIF(drive)->dmaproc(dma_func, drive); -} - -static int piix_dmaproc(ide_dma_action_t func, ide_drive_t *drive) -{ - switch (func) { - case ide_dma_check: - return config_drive_xfer_rate(drive); - default : - break; - } - /* Other cases are done by generic IDE-DMA code. */ - return ide_dmaproc(func, drive); -} -#endif /* defined(CONFIG_BLK_DEV_IDEDMA) && (CONFIG_PIIX_TUNING) */ - -unsigned int __init pci_init_piix (struct pci_dev *dev, const char *name) -{ -#if defined(DISPLAY_PIIX_TIMINGS) && defined(CONFIG_PROC_FS) - if (!piix_proc) { - piix_proc = 1; - bmide_dev = dev; - piix_display_info = &piix_get_info; - } -#endif /* DISPLAY_PIIX_TIMINGS && CONFIG_PROC_FS */ - return 0; -} - -/* - * Sheesh, someone at Intel needs to go read the ATA-4/5 T13 standards. - * It does not specify device detection, but channel!!! - * You determine later if bit 13 of word93 is set... - */ -unsigned int __init ata66_piix (ide_hwif_t *hwif) -{ - byte reg54h = 0, reg55h = 0, ata66 = 0; - byte mask = hwif->channel ? 0xc0 : 0x30; - - pci_read_config_byte(hwif->pci_dev, 0x54, ®54h); - pci_read_config_byte(hwif->pci_dev, 0x55, ®55h); - - ata66 = (reg54h & mask) ? 1 : 0; - - return ata66; -} - -void __init ide_init_piix (ide_hwif_t *hwif) -{ -#ifndef CONFIG_IA64 - if (!hwif->irq) - hwif->irq = hwif->channel ? 15 : 14; -#endif /* CONFIG_IA64 */ - - if (hwif->pci_dev->device == PCI_DEVICE_ID_INTEL_82371MX) { - /* This is a painful system best to let it self tune for now */ - return; - } - - hwif->tuneproc = &piix_tune_drive; - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - - if (!hwif->dma_base) - return; - -#ifndef CONFIG_BLK_DEV_IDEDMA - hwif->autodma = 0; -#else /* CONFIG_BLK_DEV_IDEDMA */ -#ifdef CONFIG_PIIX_TUNING - if (!noautodma) - hwif->autodma = 1; - hwif->dmaproc = &piix_dmaproc; - hwif->speedproc = &piix_tune_chipset; -#endif /* CONFIG_PIIX_TUNING */ -#endif /* !CONFIG_BLK_DEV_IDEDMA */ -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ppc/Makefile linux.20pre5-ac2/drivers/ide/ppc/Makefile --- linux.20pre5/drivers/ide/ppc/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ppc/Makefile 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,13 @@ + +O_TARGET := idedriver-ppc.o + +obj-y := +obj-m := + +obj-$(CONFIG_BLK_DEV_MPC8xx_IDE) += mpc8xx.o +obj-$(CONFIG_BLK_DEV_IDE_PMAC) += pmac.o +obj-$(CONFIG_BLK_DEV_IDE_SWARM) += swarm.o + +EXTRA_CFLAGS := -I../ + +include $(TOPDIR)/Rules.make diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ppc/mpc8xx.c linux.20pre5-ac2/drivers/ide/ppc/mpc8xx.c --- linux.20pre5/drivers/ide/ppc/mpc8xx.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ppc/mpc8xx.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,857 @@ +/* + * linux/drivers/ide/ide-m8xx.c + * + * Copyright (C) 2000, 2001 Wolfgang Denk, wd@denx.de + * Modified for direct IDE interface + * by Thomas Lange, thomas@corelatus.com + * Modified for direct IDE interface on 8xx without using the PCMCIA + * controller + * by Steven.Scholz@imc-berlin.de + * Moved out of arch/ppc/kernel/m8xx_setup.c, other minor cleanups + * by Mathew Locke + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ide_modes.h" +static int identify (volatile u8 *p); +static void print_fixed (volatile u8 *p); +static void print_funcid (int func); +static int check_ide_device (unsigned long base); + +static void ide_interrupt_ack (void *dev); +static void m8xx_ide_tuneproc(ide_drive_t *drive, u8 pio); + +typedef struct ide_ioport_desc { + unsigned long base_off; /* Offset to PCMCIA memory */ + ide_ioreg_t reg_off[IDE_NR_PORTS]; /* controller register offsets */ + int irq; /* IRQ */ +} ide_ioport_desc_t; + +ide_ioport_desc_t ioport_dsc[MAX_HWIFS] = { +#ifdef IDE0_BASE_OFFSET + { IDE0_BASE_OFFSET, + { + IDE0_DATA_REG_OFFSET, + IDE0_ERROR_REG_OFFSET, + IDE0_NSECTOR_REG_OFFSET, + IDE0_SECTOR_REG_OFFSET, + IDE0_LCYL_REG_OFFSET, + IDE0_HCYL_REG_OFFSET, + IDE0_SELECT_REG_OFFSET, + IDE0_STATUS_REG_OFFSET, + IDE0_CONTROL_REG_OFFSET, + IDE0_IRQ_REG_OFFSET, + }, + IDE0_INTERRUPT, + }, +#ifdef IDE1_BASE_OFFSET + { IDE1_BASE_OFFSET, + { + IDE1_DATA_REG_OFFSET, + IDE1_ERROR_REG_OFFSET, + IDE1_NSECTOR_REG_OFFSET, + IDE1_SECTOR_REG_OFFSET, + IDE1_LCYL_REG_OFFSET, + IDE1_HCYL_REG_OFFSET, + IDE1_SELECT_REG_OFFSET, + IDE1_STATUS_REG_OFFSET, + IDE1_CONTROL_REG_OFFSET, + IDE1_IRQ_REG_OFFSET, + }, + IDE1_INTERRUPT, + }, +#endif /* IDE1_BASE_OFFSET */ +#endif /* IDE0_BASE_OFFSET */ +}; + +ide_pio_timings_t ide_pio_clocks[6]; +int hold_time[6] = {30, 20, 15, 10, 10, 10 }; /* PIO Mode 5 with IORDY (nonstandard) */ + +/* + * Warning: only 1 (ONE) PCMCIA slot supported here, + * which must be correctly initialized by the firmware (PPCBoot). + */ +static int _slot_ = -1; /* will be read from PCMCIA registers */ + +/* Make clock cycles and always round up */ +#define PCMCIA_MK_CLKS( t, T ) (( (t) * ((T)/1000000) + 999U ) / 1000U ) + + + +/* + * IDE stuff. + */ +static int +m8xx_ide_default_irq(ide_ioreg_t base) +{ +#ifdef CONFIG_BLK_DEV_MPC8xx_IDE + if (base >= MAX_HWIFS) + return 0; + + printk("[%d] m8xx_ide_default_irq %d\n",__LINE__,ioport_dsc[base].irq); + + return (ioport_dsc[base].irq); +#else + return 9; +#endif +} + +static ide_ioreg_t +m8xx_ide_default_io_base(int index) +{ + return index; +} + +#define M8XX_PCMCIA_CD2(slot) (0x10000000 >> (slot << 4)) +#define M8XX_PCMCIA_CD1(slot) (0x08000000 >> (slot << 4)) + +/* + * The TQM850L hardware has two pins swapped! Grrrrgh! + */ +#ifdef CONFIG_TQM850L +#define __MY_PCMCIA_GCRX_CXRESET PCMCIA_GCRX_CXOE +#define __MY_PCMCIA_GCRX_CXOE PCMCIA_GCRX_CXRESET +#else +#define __MY_PCMCIA_GCRX_CXRESET PCMCIA_GCRX_CXRESET +#define __MY_PCMCIA_GCRX_CXOE PCMCIA_GCRX_CXOE +#endif + +#if defined(CONFIG_BLK_DEV_MPC8xx_IDE) && defined(CONFIG_IDE_8xx_PCCARD) +#define PCMCIA_SCHLVL IDE0_INTERRUPT /* Status Change Interrupt Level */ +static int pcmcia_schlvl = PCMCIA_SCHLVL; +#endif + +/* + * See include/linux/ide.h for definition of hw_regs_t (p, base) + */ + +/* + * m8xx_ide_init_hwif_ports for a direct IDE interface _using_ + */ +#if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) +static void +m8xx_ide_init_hwif_ports(hw_regs_t *hw, ide_ioreg_t data_port, + ide_ioreg_t ctrl_port, int *irq) +{ + ide_ioreg_t *p = hw->io_ports; + int i; + + typedef struct { + ulong br; + ulong or; + } pcmcia_win_t; + volatile pcmcia_win_t *win; + volatile pcmconf8xx_t *pcmp; + + uint *pgcrx; + u32 pcmcia_phy_base; + u32 pcmcia_phy_end; + static unsigned long pcmcia_base = 0; + unsigned long base; + + *p = 0; + if (irq) + *irq = 0; + + pcmp = (pcmconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_pcmcia)); + + if (!pcmcia_base) { + /* + * Read out PCMCIA registers. Since the reset values + * are undefined, we sure hope that they have been + * set up by firmware + */ + + /* Scan all registers for valid settings */ + pcmcia_phy_base = 0xFFFFFFFF; + pcmcia_phy_end = 0; + /* br0 is start of brX and orX regs */ + win = (pcmcia_win_t *) \ + (&(((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pbr0)); + for (i = 0; i < 8; i++) { + if (win->or & 1) { /* This bank is marked as valid */ + if (win->br < pcmcia_phy_base) { + pcmcia_phy_base = win->br; + } + if ((win->br + PCMCIA_MEM_SIZE) > pcmcia_phy_end) { + pcmcia_phy_end = win->br + PCMCIA_MEM_SIZE; + } + /* Check which slot that has been defined */ + _slot_ = (win->or >> 2) & 1; + + } /* Valid bank */ + win++; + } /* for */ + + printk ("PCMCIA slot %c: phys mem %08x...%08x (size %08x)\n", + 'A' + _slot_, + pcmcia_phy_base, pcmcia_phy_end, + pcmcia_phy_end - pcmcia_phy_base); + + pcmcia_base=(unsigned long)ioremap(pcmcia_phy_base, + pcmcia_phy_end-pcmcia_phy_base); + +#ifdef DEBUG + printk ("PCMCIA virt base: %08lx\n", pcmcia_base); +#endif + /* Compute clock cycles for PIO timings */ + for (i=0; i<6; ++i) { + bd_t *binfo = (bd_t *)__res; + + hold_time[i] = + PCMCIA_MK_CLKS (hold_time[i], + binfo->bi_busfreq); + ide_pio_clocks[i].setup_time = + PCMCIA_MK_CLKS (ide_pio_timings[i].setup_time, + binfo->bi_busfreq); + ide_pio_clocks[i].active_time = + PCMCIA_MK_CLKS (ide_pio_timings[i].active_time, + binfo->bi_busfreq); + ide_pio_clocks[i].cycle_time = + PCMCIA_MK_CLKS (ide_pio_timings[i].cycle_time, + binfo->bi_busfreq); +#if 0 + printk ("PIO mode %d timings: %d/%d/%d => %d/%d/%d\n", + i, + ide_pio_clocks[i].setup_time, + ide_pio_clocks[i].active_time, + ide_pio_clocks[i].hold_time, + ide_pio_clocks[i].cycle_time, + ide_pio_timings[i].setup_time, + ide_pio_timings[i].active_time, + ide_pio_timings[i].hold_time, + ide_pio_timings[i].cycle_time); +#endif + } + } + + if (data_port >= MAX_HWIFS) + return; + + if (_slot_ == -1) { + printk ("PCMCIA slot has not been defined! Using A as default\n"); + _slot_ = 0; + } + +#ifdef CONFIG_IDE_8xx_PCCARD + +#ifdef DEBUG + printk ("PIPR = 0x%08X slot %c ==> mask = 0x%X\n", + pcmp->pcmc_pipr, + 'A' + _slot_, + M8XX_PCMCIA_CD1(_slot_) | M8XX_PCMCIA_CD2(_slot_) ); +#endif /* DEBUG */ + + if (pcmp->pcmc_pipr & (M8XX_PCMCIA_CD1(_slot_)|M8XX_PCMCIA_CD2(_slot_))) { + printk ("No card in slot %c: PIPR=%08x\n", + 'A' + _slot_, (u32) pcmp->pcmc_pipr); + return; /* No card in slot */ + } + + check_ide_device (pcmcia_base); + +#endif /* CONFIG_IDE_8xx_PCCARD */ + + base = pcmcia_base + ioport_dsc[data_port].base_off; +#ifdef DEBUG + printk ("base: %08x + %08x = %08x\n", + pcmcia_base, ioport_dsc[data_port].base_off, base); +#endif + + for (i = 0; i < IDE_NR_PORTS; ++i) { +#ifdef DEBUG + printk ("port[%d]: %08x + %08x = %08x\n", + i, + base, + ioport_dsc[data_port].reg_off[i], + i, base + ioport_dsc[data_port].reg_off[i]); +#endif + *p++ = base + ioport_dsc[data_port].reg_off[i]; + } + + if (irq) { +#ifdef CONFIG_IDE_8xx_PCCARD + unsigned int reg; + + *irq = ioport_dsc[data_port].irq; + if (_slot_) + pgcrx = &((immap_t *) IMAP_ADDR)->im_pcmcia.pcmc_pgcrb; + else + pgcrx = &((immap_t *) IMAP_ADDR)->im_pcmcia.pcmc_pgcra; + + reg = *pgcrx; + reg |= mk_int_int_mask (pcmcia_schlvl) << 24; + reg |= mk_int_int_mask (pcmcia_schlvl) << 16; + *pgcrx = reg; +#else /* direct connected IDE drive, i.e. external IRQ, not the PCMCIA irq */ + *irq = ioport_dsc[data_port].irq; +#endif /* CONFIG_IDE_8xx_PCCARD */ + } + + /* register routine to tune PIO mode */ + ide_hwifs[data_port].tuneproc = m8xx_ide_tuneproc; + + hw->ack_intr = (ide_ack_intr_t *) ide_interrupt_ack; + /* Enable Harddisk Interrupt, + * and make it edge sensitive + */ + /* (11-18) Set edge detect for irq, no wakeup from low power mode */ + ((immap_t *)IMAP_ADDR)->im_siu_conf.sc_siel |= + (0x80000000 >> ioport_dsc[data_port].irq); + +#ifdef CONFIG_IDE_8xx_PCCARD + /* Make sure we dont get garbage irq */ + ((immap_t *) IMAP_ADDR)->im_pcmcia.pcmc_pscr = 0xFFFF; + + /* Enable falling edge irq */ + pcmp->pcmc_per = 0x100000 >> (16 * _slot_); +#endif /* CONFIG_IDE_8xx_PCCARD */ +} /* m8xx_ide_init_hwif_ports() using 8xx internal PCMCIA interface */ +#endif /* CONFIG_IDE_8xx_PCCARD || CONFIG_IDE_8xx_DIRECT */ + +/* + * m8xx_ide_init_hwif_ports for a direct IDE interface _not_ using + * MPC8xx's internal PCMCIA interface + */ +#if defined(CONFIG_IDE_EXT_DIRECT) +void m8xx_ide_init_hwif_ports (hw_regs_t *hw, + ide_ioreg_t data_port, ide_ioreg_t ctrl_port, int *irq) +{ + ide_ioreg_t *p = hw->io_ports; + int i; + + u32 ide_phy_base; + u32 ide_phy_end; + static unsigned long ide_base = 0; + unsigned long base; + + *p = 0; + if (irq) + *irq = 0; + + if (!ide_base) { + + /* TODO: + * - add code to read ORx, BRx + */ + ide_phy_base = CFG_ATA_BASE_ADDR; + ide_phy_end = CFG_ATA_BASE_ADDR + 0x200; + + printk ("IDE phys mem : %08x...%08x (size %08x)\n", + ide_phy_base, ide_phy_end, + ide_phy_end - ide_phy_base); + + ide_base=(unsigned long)ioremap(ide_phy_base, + ide_phy_end-ide_phy_base); + +#ifdef DEBUG + printk ("IDE virt base: %08lx\n", ide_base); +#endif + } + + if (data_port >= MAX_HWIFS) + return; + + base = ide_base + ioport_dsc[data_port].base_off; +#ifdef DEBUG + printk ("base: %08x + %08x = %08x\n", + ide_base, ioport_dsc[data_port].base_off, base); +#endif + + for (i = 0; i < IDE_NR_PORTS; ++i) { +#ifdef DEBUG + printk ("port[%d]: %08x + %08x = %08x\n", + i, + base, + ioport_dsc[data_port].reg_off[i], + i, base + ioport_dsc[data_port].reg_off[i]); +#endif + *p++ = base + ioport_dsc[data_port].reg_off[i]; + } + + if (irq) { + /* direct connected IDE drive, i.e. external IRQ */ + *irq = ioport_dsc[data_port].irq; + } + + /* register routine to tune PIO mode */ + ide_hwifs[data_port].tuneproc = m8xx_ide_tuneproc; + + hw->ack_intr = (ide_ack_intr_t *) ide_interrupt_ack; + /* Enable Harddisk Interrupt, + * and make it edge sensitive + */ + /* (11-18) Set edge detect for irq, no wakeup from low power mode */ + ((immap_t *) IMAP_ADDR)->im_siu_conf.sc_siel |= + (0x80000000 >> ioport_dsc[data_port].irq); +} /* m8xx_ide_init_hwif_ports() for CONFIG_IDE_8xx_DIRECT */ + +#endif /* CONFIG_IDE_8xx_DIRECT */ + + +/* -------------------------------------------------------------------- */ + + +/* PCMCIA Timing */ +#ifndef PCMCIA_SHT +#define PCMCIA_SHT(t) ((t & 0x0F)<<16) /* Strobe Hold Time */ +#define PCMCIA_SST(t) ((t & 0x0F)<<12) /* Strobe Setup Time */ +#define PCMCIA_SL(t) ((t==32) ? 0 : ((t & 0x1F)<<7)) /* Strobe Length */ +#endif + + +/* Calculate PIO timings */ +static void +m8xx_ide_tuneproc(ide_drive_t *drive, u8 pio) +{ + ide_pio_data_t d; +#if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) + volatile pcmconf8xx_t *pcmp; + ulong timing, mask, reg; +#endif + + pio = ide_get_best_pio_mode(drive, pio, 4, &d); + +#if 1 + printk("%s[%d] %s: best PIO mode: %d\n", + __FILE__,__LINE__,__FUNCTION__, pio); +#endif + +#if defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_DIRECT) + pcmp = (pcmconf8xx_t *)(&(((immap_t *)IMAP_ADDR)->im_pcmcia)); + + mask = ~(PCMCIA_SHT(0xFF) | PCMCIA_SST(0xFF) | PCMCIA_SL(0xFF)); + + timing = PCMCIA_SHT(hold_time[pio] ) + | PCMCIA_SST(ide_pio_clocks[pio].setup_time ) + | PCMCIA_SL (ide_pio_clocks[pio].active_time) + ; + +#if 1 + printk ("Setting timing bits 0x%08lx in PCMCIA controller\n", timing); +#endif + if ((reg = pcmp->pcmc_por0 & mask) != 0) + pcmp->pcmc_por0 = reg | timing; + + if ((reg = pcmp->pcmc_por1 & mask) != 0) + pcmp->pcmc_por1 = reg | timing; + + if ((reg = pcmp->pcmc_por2 & mask) != 0) + pcmp->pcmc_por2 = reg | timing; + + if ((reg = pcmp->pcmc_por3 & mask) != 0) + pcmp->pcmc_por3 = reg | timing; + + if ((reg = pcmp->pcmc_por4 & mask) != 0) + pcmp->pcmc_por4 = reg | timing; + + if ((reg = pcmp->pcmc_por5 & mask) != 0) + pcmp->pcmc_por5 = reg | timing; + + if ((reg = pcmp->pcmc_por6 & mask) != 0) + pcmp->pcmc_por6 = reg | timing; + + if ((reg = pcmp->pcmc_por7 & mask) != 0) + pcmp->pcmc_por7 = reg | timing; + +#elif defined(CONFIG_IDE_EXT_DIRECT) + + printk("%s[%d] %s: not implemented yet!\n", + __FILE__,__LINE__,__FUNCTION__); +#endif /* defined(CONFIG_IDE_8xx_PCCARD) || defined(CONFIG_IDE_8xx_PCMCIA */ +} + +static void +ide_interrupt_ack (void *dev) +{ +#ifdef CONFIG_IDE_8xx_PCCARD + u_int pscr, pipr; + +#if (PCMCIA_SOCKETS_NO == 2) + u_int _slot_; +#endif + + /* get interrupt sources */ + + pscr = ((volatile immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr; + pipr = ((volatile immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pipr; + + /* + * report only if both card detect signals are the same + * not too nice done, + * we depend on that CD2 is the bit to the left of CD1... + */ + + if(_slot_==-1){ + printk("PCMCIA slot has not been defined! Using A as default\n"); + _slot_=0; + } + + if(((pipr & M8XX_PCMCIA_CD2(_slot_)) >> 1) ^ + (pipr & M8XX_PCMCIA_CD1(_slot_)) ) { + printk ("card detect interrupt\n"); + } + /* clear the interrupt sources */ + ((immap_t *)IMAP_ADDR)->im_pcmcia.pcmc_pscr = pscr; + +#else /* ! CONFIG_IDE_8xx_PCCARD */ + /* + * Only CONFIG_IDE_8xx_PCCARD is using the interrupt of the + * MPC8xx's PCMCIA controller, so there is nothing to be done here + * for CONFIG_IDE_8xx_DIRECT and CONFIG_IDE_EXT_DIRECT. + * The interrupt is handled somewhere else. -- Steven + */ +#endif /* CONFIG_IDE_8xx_PCCARD */ +} + + + +/* + * CIS Tupel codes + */ +#define CISTPL_NULL 0x00 +#define CISTPL_DEVICE 0x01 +#define CISTPL_LONGLINK_CB 0x02 +#define CISTPL_INDIRECT 0x03 +#define CISTPL_CONFIG_CB 0x04 +#define CISTPL_CFTABLE_ENTRY_CB 0x05 +#define CISTPL_LONGLINK_MFC 0x06 +#define CISTPL_BAR 0x07 +#define CISTPL_PWR_MGMNT 0x08 +#define CISTPL_EXTDEVICE 0x09 +#define CISTPL_CHECKSUM 0x10 +#define CISTPL_LONGLINK_A 0x11 +#define CISTPL_LONGLINK_C 0x12 +#define CISTPL_LINKTARGET 0x13 +#define CISTPL_NO_LINK 0x14 +#define CISTPL_VERS_1 0x15 +#define CISTPL_ALTSTR 0x16 +#define CISTPL_DEVICE_A 0x17 +#define CISTPL_JEDEC_C 0x18 +#define CISTPL_JEDEC_A 0x19 +#define CISTPL_CONFIG 0x1a +#define CISTPL_CFTABLE_ENTRY 0x1b +#define CISTPL_DEVICE_OC 0x1c +#define CISTPL_DEVICE_OA 0x1d +#define CISTPL_DEVICE_GEO 0x1e +#define CISTPL_DEVICE_GEO_A 0x1f +#define CISTPL_MANFID 0x20 +#define CISTPL_FUNCID 0x21 +#define CISTPL_FUNCE 0x22 +#define CISTPL_SWIL 0x23 +#define CISTPL_END 0xff + +/* + * CIS Function ID codes + */ +#define CISTPL_FUNCID_MULTI 0x00 +#define CISTPL_FUNCID_MEMORY 0x01 +#define CISTPL_FUNCID_SERIAL 0x02 +#define CISTPL_FUNCID_PARALLEL 0x03 +#define CISTPL_FUNCID_FIXED 0x04 +#define CISTPL_FUNCID_VIDEO 0x05 +#define CISTPL_FUNCID_NETWORK 0x06 +#define CISTPL_FUNCID_AIMS 0x07 +#define CISTPL_FUNCID_SCSI 0x08 + +/* + * Fixed Disk FUNCE codes + */ +#define CISTPL_IDE_INTERFACE 0x01 + +#define CISTPL_FUNCE_IDE_IFACE 0x01 +#define CISTPL_FUNCE_IDE_MASTER 0x02 +#define CISTPL_FUNCE_IDE_SLAVE 0x03 + +/* First feature byte */ +#define CISTPL_IDE_SILICON 0x04 +#define CISTPL_IDE_UNIQUE 0x08 +#define CISTPL_IDE_DUAL 0x10 + +/* Second feature byte */ +#define CISTPL_IDE_HAS_SLEEP 0x01 +#define CISTPL_IDE_HAS_STANDBY 0x02 +#define CISTPL_IDE_HAS_IDLE 0x04 +#define CISTPL_IDE_LOW_POWER 0x08 +#define CISTPL_IDE_REG_INHIBIT 0x10 +#define CISTPL_IDE_HAS_INDEX 0x20 +#define CISTPL_IDE_IOIS16 0x40 + + +/* -------------------------------------------------------------------- */ + + +#define MAX_TUPEL_SZ 512 +#define MAX_FEATURES 4 + +static int check_ide_device (unsigned long base) +{ + volatile u8 *ident = NULL; + volatile u8 *feature_p[MAX_FEATURES]; + volatile u8 *p, *start; + int n_features = 0; + u8 func_id = ~0; + u8 code, len; + unsigned short config_base = 0; + int found = 0; + int i; + +#ifdef DEBUG + printk ("PCMCIA MEM: %08lX\n", base); +#endif + start = p = (volatile u8 *) base; + + while ((p - start) < MAX_TUPEL_SZ) { + + code = *p; p += 2; + + if (code == 0xFF) { /* End of chain */ + break; + } + + len = *p; p += 2; +#ifdef DEBUG_PCMCIA + { volatile u8 *q = p; + printk ("\nTuple code %02x length %d\n\tData:", + code, len); + + for (i = 0; i < len; ++i) { + printk (" %02x", *q); + q+= 2; + } + } +#endif /* DEBUG_PCMCIA */ + switch (code) { + case CISTPL_VERS_1: + ident = p + 4; + break; + case CISTPL_FUNCID: + func_id = *p; + break; + case CISTPL_FUNCE: + if (n_features < MAX_FEATURES) + feature_p[n_features++] = p; + break; + case CISTPL_CONFIG: + config_base = (*(p+6) << 8) + (*(p+4)); + default: + break; + } + p += 2 * len; + } + + found = identify (ident); + + if (func_id != ((u8)~0)) { + print_funcid (func_id); + + if (func_id == CISTPL_FUNCID_FIXED) + found = 1; + else + return (1); /* no disk drive */ + } + + for (i=0; i id_str) { + if (*t == ' ') + *t = '\0'; + else + break; + } + printk ("Card ID: %s\n", id_str); + + for (card=known_cards; *card; ++card) { + if (strcmp(*card, id_str) == 0) { /* found! */ + return (1); + } + } + + return (0); /* don't know */ +} + +void m8xx_ide_init(void) +{ + ppc_ide_md.default_irq = m8xx_ide_default_irq; + ppc_ide_md.default_io_base = m8xx_ide_default_io_base; + ppc_ide_md.ide_init_hwif = m8xx_ide_init_hwif_ports; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ppc/pmac.c linux.20pre5-ac2/drivers/ide/ppc/pmac.c --- linux.20pre5/drivers/ide/ppc/pmac.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ppc/pmac.c 2002-09-01 18:07:16.000000000 +0100 @@ -0,0 +1,1783 @@ +/* + * linux/drivers/ide/ide-pmac.c + * + * Support for IDE interfaces on PowerMacs. + * These IDE interfaces are memory-mapped and have a DBDMA channel + * for doing DMA. + * + * Copyright (C) 1998-2001 Paul Mackerras & Ben. Herrenschmidt + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version + * 2 of the License, or (at your option) any later version. + * + * Some code taken from drivers/ide/ide-dma.c: + * + * Copyright (c) 1995-1998 Mark Lord + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef CONFIG_PMAC_PBOOK +#include +#include +#endif +#include "ide_modes.h" + +extern void ide_do_request(ide_hwgroup_t *hwgroup, int masked_irq); + +#define IDE_PMAC_DEBUG + +#define DMA_WAIT_TIMEOUT 500 + +typedef struct pmac_ide_hwif { + ide_ioreg_t regbase; + int irq; + int kind; + int aapl_bus_id; + struct device_node* node; + u32 timings[2]; + int index; +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC + /* Those fields are duplicating what is in hwif. We currently + * can't use the hwif ones because of some assumptions that are + * beeing done by the generic code about the kind of dma controller + * and format of the dma table. This will have to be fixed though. + */ + volatile struct dbdma_regs* dma_regs; + struct dbdma_cmd* dma_table_cpu; + dma_addr_t dma_table_dma; + struct scatterlist* sg_table; + int sg_nents; + int sg_dma_direction; +#endif + +} pmac_ide_hwif_t; + +static pmac_ide_hwif_t pmac_ide[MAX_HWIFS] __pmacdata; +static int pmac_ide_count; + +enum { + controller_ohare, /* OHare based */ + controller_heathrow, /* Heathrow/Paddington */ + controller_kl_ata3, /* KeyLargo ATA-3 */ + controller_kl_ata4, /* KeyLargo ATA-4 */ + controller_kl_ata4_80 /* KeyLargo ATA-4 with 80 conductor cable */ +}; + +/* + * Extra registers, both 32-bit little-endian + */ +#define IDE_TIMING_CONFIG 0x200 +#define IDE_INTERRUPT 0x300 + +/* + * Timing configuration register definitions + */ + +/* Number of IDE_SYSCLK_NS ticks, argument is in nanoseconds */ +#define SYSCLK_TICKS(t) (((t) + IDE_SYSCLK_NS - 1) / IDE_SYSCLK_NS) +#define SYSCLK_TICKS_66(t) (((t) + IDE_SYSCLK_66_NS - 1) / IDE_SYSCLK_66_NS) +#define IDE_SYSCLK_NS 30 /* 33Mhz cell */ +#define IDE_SYSCLK_66_NS 15 /* 66Mhz cell */ + +/* 66Mhz cell, found in KeyLargo. Can do ultra mode 0 to 2 on + * 40 connector cable and to 4 on 80 connector one. + * Clock unit is 15ns (66Mhz) + * + * 3 Values can be programmed: + * - Write data setup, which appears to match the cycle time. They + * also call it DIOW setup. + * - Ready to pause time (from spec) + * - Address setup. That one is weird. I don't see where exactly + * it fits in UDMA cycles, I got it's name from an obscure piece + * of commented out code in Darwin. They leave it to 0, we do as + * well, despite a comment that would lead to think it has a + * min value of 45ns. + * Apple also add 60ns to the write data setup (or cycle time ?) on + * reads. I can't explain that, I tried it and it broke everything + * here. + */ +#define TR_66_UDMA_MASK 0xfff00000 +#define TR_66_UDMA_EN 0x00100000 /* Enable Ultra mode for DMA */ +#define TR_66_UDMA_ADDRSETUP_MASK 0xe0000000 /* Address setup */ +#define TR_66_UDMA_ADDRSETUP_SHIFT 29 +#define TR_66_UDMA_RDY2PAUS_MASK 0x1e000000 /* Ready 2 pause time */ +#define TR_66_UDMA_RDY2PAUS_SHIFT 25 +#define TR_66_UDMA_WRDATASETUP_MASK 0x01e00000 /* Write data setup time */ +#define TR_66_UDMA_WRDATASETUP_SHIFT 21 +#define TR_66_MDMA_MASK 0x000ffc00 +#define TR_66_MDMA_RECOVERY_MASK 0x000f8000 +#define TR_66_MDMA_RECOVERY_SHIFT 15 +#define TR_66_MDMA_ACCESS_MASK 0x00007c00 +#define TR_66_MDMA_ACCESS_SHIFT 10 +#define TR_66_PIO_MASK 0x000003ff +#define TR_66_PIO_RECOVERY_MASK 0x000003e0 +#define TR_66_PIO_RECOVERY_SHIFT 5 +#define TR_66_PIO_ACCESS_MASK 0x0000001f +#define TR_66_PIO_ACCESS_SHIFT 0 + +/* 33Mhz cell, found in OHare, Heathrow (& Paddington) and KeyLargo + * Can do pio & mdma modes, clock unit is 30ns (33Mhz) + * + * The access time and recovery time can be programmed. Some older + * Darwin code base limit OHare to 150ns cycle time. I decided to do + * the same here fore safety against broken old hardware ;) + * The HalfTick bit, when set, adds half a clock (15ns) to the access + * time and removes one from recovery. It's not supported on KeyLargo + * implementation afaik. The E bit appears to be set for PIO mode 0 and + * is used to reach long timings used in this mode. + */ +#define TR_33_MDMA_MASK 0x003ff800 +#define TR_33_MDMA_RECOVERY_MASK 0x001f0000 +#define TR_33_MDMA_RECOVERY_SHIFT 16 +#define TR_33_MDMA_ACCESS_MASK 0x0000f800 +#define TR_33_MDMA_ACCESS_SHIFT 11 +#define TR_33_MDMA_HALFTICK 0x00200000 +#define TR_33_PIO_MASK 0x000007ff +#define TR_33_PIO_E 0x00000400 +#define TR_33_PIO_RECOVERY_MASK 0x000003e0 +#define TR_33_PIO_RECOVERY_SHIFT 5 +#define TR_33_PIO_ACCESS_MASK 0x0000001f +#define TR_33_PIO_ACCESS_SHIFT 0 + +/* + * Interrupt register definitions + */ +#define IDE_INTR_DMA 0x80000000 +#define IDE_INTR_DEVICE 0x40000000 + +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC + +/* Rounded Multiword DMA timings + * + * I gave up finding a generic formula for all controller + * types and instead, built tables based on timing values + * used by Apple in Darwin's implementation. + */ +struct mdma_timings_t { + int accessTime; + int recoveryTime; + int cycleTime; +}; + +struct mdma_timings_t mdma_timings_33[] __pmacdata = +{ + { 240, 240, 480 }, + { 180, 180, 360 }, + { 135, 135, 270 }, + { 120, 120, 240 }, + { 105, 105, 210 }, + { 90, 90, 180 }, + { 75, 75, 150 }, + { 75, 45, 120 }, + { 0, 0, 0 } +}; + +struct mdma_timings_t mdma_timings_33k[] __pmacdata = +{ + { 240, 240, 480 }, + { 180, 180, 360 }, + { 150, 150, 300 }, + { 120, 120, 240 }, + { 90, 120, 210 }, + { 90, 90, 180 }, + { 90, 60, 150 }, + { 90, 30, 120 }, + { 0, 0, 0 } +}; + +struct mdma_timings_t mdma_timings_66[] __pmacdata = +{ + { 240, 240, 480 }, + { 180, 180, 360 }, + { 135, 135, 270 }, + { 120, 120, 240 }, + { 105, 105, 210 }, + { 90, 90, 180 }, + { 90, 75, 165 }, + { 75, 45, 120 }, + { 0, 0, 0 } +}; + +/* Ultra DMA timings (rounded) */ +struct { + int addrSetup; /* ??? */ + int rdy2pause; + int wrDataSetup; +} udma_timings[] __pmacdata = +{ + { 0, 180, 120 }, /* Mode 0 */ + { 0, 150, 90 }, /* 1 */ + { 0, 120, 60 }, /* 2 */ + { 0, 90, 45 }, /* 3 */ + { 0, 90, 30 } /* 4 */ +}; + +/* allow up to 256 DBDMA commands per xfer */ +#define MAX_DCMDS 256 + +/* Wait 2s for disk to answer on IDE bus after + * enable operation. + * NOTE: There is at least one case I know of a disk that needs about 10sec + * before anwering on the bus. I beleive we could add a kernel command + * line arg to override this delay for such cases. + */ +#define IDE_WAKEUP_DELAY_MS 2000 + +static void pmac_ide_setup_dma(struct device_node *np, int ix); +static int pmac_ide_build_dmatable(ide_drive_t *drive, int wr); +static int pmac_ide_tune_chipset(ide_drive_t *drive, u8 speed); +static void pmac_ide_tuneproc(ide_drive_t *drive, u8 pio); +static void pmac_ide_selectproc(ide_drive_t *drive); +static int pmac_ide_dma_begin (ide_drive_t *drive); + +#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ + +#ifdef CONFIG_PMAC_PBOOK +static int idepmac_notify_sleep(struct pmu_sleep_notifier *self, int when); +struct pmu_sleep_notifier idepmac_sleep_notifier = { + idepmac_notify_sleep, SLEEP_LEVEL_BLOCK, +}; +#endif /* CONFIG_PMAC_PBOOK */ + +/* + * N.B. this can't be an initfunc, because the media-bay task can + * call ide_[un]register at any time. + */ +void __pmac +pmac_ide_init_hwif_ports(hw_regs_t *hw, + ide_ioreg_t data_port, ide_ioreg_t ctrl_port, + int *irq) +{ + int i, ix; + + if (data_port == 0) + return; + + for (ix = 0; ix < MAX_HWIFS; ++ix) + if (data_port == pmac_ide[ix].regbase) + break; + + if (ix >= MAX_HWIFS) { + /* Probably a PCI interface... */ + for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; ++i) + hw->io_ports[i] = data_port + i - IDE_DATA_OFFSET; + hw->io_ports[IDE_CONTROL_OFFSET] = ctrl_port; + return; + } + + for (i = 0; i < 8; ++i) + hw->io_ports[i] = data_port + i * 0x10; + hw->io_ports[8] = data_port + 0x160; + + if (irq != NULL) + *irq = pmac_ide[ix].irq; +} + +/* Setup timings for the selected drive (master/slave). I still need to verify if this + * is enough, I beleive selectproc will be called whenever an IDE command is started, + * but... */ +static void __pmac +pmac_ide_selectproc(ide_drive_t *drive) +{ + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; + + if (pmif == NULL) + return; + + if (drive->select.b.unit & 0x01) + writel(pmif->timings[1], + (unsigned *)(IDE_DATA_REG+IDE_TIMING_CONFIG)); + else + writel(pmif->timings[0], + (unsigned *)(IDE_DATA_REG+IDE_TIMING_CONFIG)); + (void)readl((unsigned *)(IDE_DATA_REG+IDE_TIMING_CONFIG)); +} + + +static int __pmac +pmac_ide_do_setfeature(ide_drive_t *drive, u8 command) +{ + ide_hwif_t *hwif = HWIF(drive); + int result = 1; + + disable_irq(hwif->irq); /* disable_irq_nosync ?? */ + udelay(1); + SELECT_DRIVE(drive); + SELECT_MASK(drive, 0); + udelay(1); + /* Get rid of pending error state */ + (void) hwif->INB(IDE_STATUS_REG); + /* Timeout bumped for some powerbooks */ + if (wait_for_ready(drive, 2000)) { + /* Timeout bumped for some powerbooks */ + printk(KERN_ERR "pmac_ide_do_setfeature disk not ready " + "before SET_FEATURE!\n"); + goto out; + } + udelay(10); + hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG); + hwif->OUTB(command, IDE_NSECTOR_REG); + hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG); + hwif->OUTB(WIN_SETFEATURES, IDE_COMMAND_REG); + udelay(1); + /* Timeout bumped for some powerbooks */ + result = wait_for_ready(drive, 2000); + hwif->OUTB(drive->ctl, IDE_CONTROL_REG); + if (result) + printk(KERN_ERR "pmac_ide_do_setfeature disk not ready " + "after SET_FEATURE !\n"); +out: + SELECT_MASK(drive, 0); + if (result == 0) { + drive->id->dma_ultra &= ~0xFF00; + drive->id->dma_mword &= ~0x0F00; + drive->id->dma_1word &= ~0x0F00; + switch(command) { + case XFER_UDMA_7: + drive->id->dma_ultra |= 0x8080; break; + case XFER_UDMA_6: + drive->id->dma_ultra |= 0x4040; break; + case XFER_UDMA_5: + drive->id->dma_ultra |= 0x2020; break; + case XFER_UDMA_4: + drive->id->dma_ultra |= 0x1010; break; + case XFER_UDMA_3: + drive->id->dma_ultra |= 0x0808; break; + case XFER_UDMA_2: + drive->id->dma_ultra |= 0x0404; break; + case XFER_UDMA_1: + drive->id->dma_ultra |= 0x0202; break; + case XFER_UDMA_0: + drive->id->dma_ultra |= 0x0101; break; + case XFER_MW_DMA_2: + drive->id->dma_mword |= 0x0404; break; + case XFER_MW_DMA_1: + drive->id->dma_mword |= 0x0202; break; + case XFER_MW_DMA_0: + drive->id->dma_mword |= 0x0101; break; + case XFER_SW_DMA_2: + drive->id->dma_1word |= 0x0404; break; + case XFER_SW_DMA_1: + drive->id->dma_1word |= 0x0202; break; + case XFER_SW_DMA_0: + drive->id->dma_1word |= 0x0101; break; + default: break; + } + } + enable_irq(hwif->irq); + return result; +} + +/* Calculate PIO timings */ +static void __pmac +pmac_ide_tuneproc(ide_drive_t *drive, u8 pio) +{ + ide_pio_data_t d; + u32 *timings; + unsigned accessTicks, recTicks; + unsigned accessTime, recTime; + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; + + if (pmif == NULL) + return; + + pio = ide_get_best_pio_mode(drive, pio, 4, &d); + accessTicks = SYSCLK_TICKS(ide_pio_timings[pio].active_time); + if (drive->select.b.unit & 0x01) + timings = &pmif->timings[1]; + else + timings = &pmif->timings[0]; + + recTime = d.cycle_time - ide_pio_timings[pio].active_time + - ide_pio_timings[pio].setup_time; + recTime = max(recTime, 150U); + accessTime = ide_pio_timings[pio].active_time; + accessTime = max(accessTime, 150U); + if (pmif->kind == controller_kl_ata4 || + pmif->kind == controller_kl_ata4_80) { + /* 66Mhz cell */ + accessTicks = SYSCLK_TICKS_66(accessTime); + accessTicks = min(accessTicks, 0x1fU); + recTicks = SYSCLK_TICKS_66(recTime); + recTicks = min(recTicks, 0x1fU); + *timings = ((*timings) & ~TR_66_PIO_MASK) | + (accessTicks << TR_66_PIO_ACCESS_SHIFT) | + (recTicks << TR_66_PIO_RECOVERY_SHIFT); + } else { + /* 33Mhz cell */ + int ebit = 0; + accessTicks = SYSCLK_TICKS(accessTime); + accessTicks = min(accessTicks, 0x1fU); + accessTicks = max(accessTicks, 4U); + recTicks = SYSCLK_TICKS(recTime); + recTicks = min(recTicks, 0x1fU); + recTicks = max(recTicks, 5U) - 4; + if (recTicks > 9) { + recTicks--; /* guess, but it's only for PIO0, so... */ + ebit = 1; + } + *timings = ((*timings) & ~TR_33_PIO_MASK) | + (accessTicks << TR_33_PIO_ACCESS_SHIFT) | + (recTicks << TR_33_PIO_RECOVERY_SHIFT); + if (ebit) + *timings |= TR_33_PIO_E; + } + +#ifdef IDE_PMAC_DEBUG + printk(KERN_ERR "ide_pmac: Set PIO timing for mode %d, reg: 0x%08x\n", + pio, *timings); +#endif + + if (drive->select.all == HWIF(drive)->INB(IDE_SELECT_REG)) + pmac_ide_selectproc(drive); +} + +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC +static int __pmac +set_timings_udma(u32 *timings, u8 speed) +{ + unsigned rdyToPauseTicks, wrDataSetupTicks, addrTicks; + + rdyToPauseTicks = SYSCLK_TICKS_66(udma_timings[speed & 0xf].rdy2pause); + wrDataSetupTicks = SYSCLK_TICKS_66(udma_timings[speed & 0xf].wrDataSetup); + addrTicks = SYSCLK_TICKS_66(udma_timings[speed & 0xf].addrSetup); + + *timings = ((*timings) & ~(TR_66_UDMA_MASK | TR_66_MDMA_MASK)) | + (wrDataSetupTicks << TR_66_UDMA_WRDATASETUP_SHIFT) | + (rdyToPauseTicks << TR_66_UDMA_RDY2PAUS_SHIFT) | + (addrTicks < cycleTime) + cycleTime = drive_cycle_time; + /* OHare limits according to some old Apple sources */ + if ((intf_type == controller_ohare) && (cycleTime < 150)) + cycleTime = 150; + /* Get the proper timing array for this controller */ + switch(intf_type) { + case controller_kl_ata4: + case controller_kl_ata4_80: + tm = mdma_timings_66; + break; + case controller_kl_ata3: + tm = mdma_timings_33k; + break; + default: + tm = mdma_timings_33; + break; + } + /* Lookup matching access & recovery times */ + i = -1; + for (;;) { + if (tm[i+1].cycleTime < cycleTime) + break; + i++; + } + if (i < 0) + return -1; + cycleTime = tm[i].cycleTime; + accessTime = tm[i].accessTime; + recTime = tm[i].recoveryTime; + +#ifdef IDE_PMAC_DEBUG + printk(KERN_ERR "ide_pmac: MDMA, cycleTime: %d, accessTime: %d, recTime: %d\n", + cycleTime, accessTime, recTime); +#endif + if (intf_type == controller_kl_ata4 || intf_type == controller_kl_ata4_80) { + /* 66Mhz cell */ + accessTicks = SYSCLK_TICKS_66(accessTime); + accessTicks = min(accessTicks, 0x1fU); + accessTicks = max(accessTicks, 0x1U); + recTicks = SYSCLK_TICKS_66(recTime); + recTicks = min(recTicks, 0x1fU); + recTicks = max(recTicks, 0x3U); + /* Clear out mdma bits and disable udma */ + *timings = ((*timings) & ~(TR_66_MDMA_MASK | TR_66_UDMA_MASK)) | + (accessTicks << TR_66_MDMA_ACCESS_SHIFT) | + (recTicks << TR_66_MDMA_RECOVERY_SHIFT); + } else if (intf_type == controller_kl_ata3) { + /* 33Mhz cell on KeyLargo */ + accessTicks = SYSCLK_TICKS(accessTime); + accessTicks = max(accessTicks, 1U); + accessTicks = min(accessTicks, 0x1fU); + accessTime = accessTicks * IDE_SYSCLK_NS; + recTicks = SYSCLK_TICKS(recTime); + recTicks = max(recTicks, 1U); + recTicks = min(recTicks, 0x1fU); + *timings = ((*timings) & ~TR_33_MDMA_MASK) | + (accessTicks << TR_33_MDMA_ACCESS_SHIFT) | + (recTicks << TR_33_MDMA_RECOVERY_SHIFT); + } else { + /* 33Mhz cell on others */ + int halfTick = 0; + int origAccessTime = accessTime; + int origRecTime = recTime; + + accessTicks = SYSCLK_TICKS(accessTime); + accessTicks = max(accessTicks, 1U); + accessTicks = min(accessTicks, 0x1fU); + accessTime = accessTicks * IDE_SYSCLK_NS; + recTicks = SYSCLK_TICKS(recTime); + recTicks = max(recTicks, 2U) - 1; + recTicks = min(recTicks, 0x1fU); + recTime = (recTicks + 1) * IDE_SYSCLK_NS; + if ((accessTicks > 1) && + ((accessTime - IDE_SYSCLK_NS/2) >= origAccessTime) && + ((recTime - IDE_SYSCLK_NS/2) >= origRecTime)) { + halfTick = 1; + accessTicks--; + } + *timings = ((*timings) & ~TR_33_MDMA_MASK) | + (accessTicks << TR_33_MDMA_ACCESS_SHIFT) | + (recTicks << TR_33_MDMA_RECOVERY_SHIFT); + if (halfTick) + *timings |= TR_33_MDMA_HALFTICK; + } +#ifdef IDE_PMAC_DEBUG + printk(KERN_ERR "ide_pmac: Set MDMA timing for mode %d, reg: 0x%08x\n", + speed & 0xf, *timings); +#endif + return 0; +} +#endif /* #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC */ + +/* You may notice we don't use this function on normal operation, + * our, normal mdma function is supposed to be more precise + */ +static int __pmac +pmac_ide_tune_chipset (ide_drive_t *drive, u8 speed) +{ + int unit = (drive->select.b.unit & 0x01); + int ret = 0; + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; + u32 *timings; + + if (pmif == NULL) + return 1; + + timings = &pmif->timings[unit]; + + switch(speed) { +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC + case XFER_UDMA_4: + case XFER_UDMA_3: + if (pmif->kind != controller_kl_ata4_80) + return 1; + case XFER_UDMA_2: + case XFER_UDMA_1: + case XFER_UDMA_0: + if (pmif->kind != controller_kl_ata4 && + pmif->kind != controller_kl_ata4_80) + return 1; + ret = set_timings_udma(timings, speed); + break; + case XFER_MW_DMA_2: + case XFER_MW_DMA_1: + case XFER_MW_DMA_0: + ret = set_timings_mdma(pmif->kind, timings, speed, 0); + break; + case XFER_SW_DMA_2: + case XFER_SW_DMA_1: + case XFER_SW_DMA_0: + return 1; +#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ + case XFER_PIO_4: + case XFER_PIO_3: + case XFER_PIO_2: + case XFER_PIO_1: + case XFER_PIO_0: + pmac_ide_tuneproc(drive, speed & 0x07); + break; + default: + ret = 1; + } + if (ret) + return ret; + + ret = pmac_ide_do_setfeature(drive, speed); + if (ret) + return ret; + + pmac_ide_selectproc(drive); + drive->current_speed = speed; + + return 0; +} + +static void __pmac +sanitize_timings(pmac_ide_hwif_t *pmif) +{ + unsigned value; + + switch(pmif->kind) { + case controller_kl_ata4: + case controller_kl_ata4_80: + value = 0x0008438c; + break; + case controller_kl_ata3: + value = 0x00084526; + break; + case controller_heathrow: + case controller_ohare: + default: + value = 0x00074526; + break; + } + pmif->timings[0] = pmif->timings[1] = value; +} + +ide_ioreg_t __pmac +pmac_ide_get_base(int index) +{ + return pmac_ide[index].regbase; +} + +int __pmac +pmac_ide_check_base(ide_ioreg_t base) +{ + int ix; + + for (ix = 0; ix < MAX_HWIFS; ++ix) + if (base == pmac_ide[ix].regbase) + return ix; + return -1; +} + +int __pmac +pmac_ide_get_irq(ide_ioreg_t base) +{ + int ix; + + for (ix = 0; ix < MAX_HWIFS; ++ix) + if (base == pmac_ide[ix].regbase) + return pmac_ide[ix].irq; + return 0; +} + +static int ide_majors[] __pmacdata = { 3, 22, 33, 34, 56, 57 }; + +kdev_t __init +pmac_find_ide_boot(char *bootdevice, int n) +{ + int i; + + /* + * Look through the list of IDE interfaces for this one. + */ + for (i = 0; i < pmac_ide_count; ++i) { + char *name; + if (!pmac_ide[i].node || !pmac_ide[i].node->full_name) + continue; + name = pmac_ide[i].node->full_name; + if (memcmp(name, bootdevice, n) == 0 && name[n] == 0) { + /* XXX should cope with the 2nd drive as well... */ + return MKDEV(ide_majors[i], 0); + } + } + + return 0; +} + +void __init +pmac_ide_probe(void) +{ + struct device_node *np; + int i; + struct device_node *atas; + struct device_node *p, **pp, *removables, **rp; + unsigned long base; + int irq, big_delay; + ide_hwif_t *hwif; + + if (_machine != _MACH_Pmac) + return; + pp = &atas; + rp = &removables; + p = find_devices("ATA"); + if (p == NULL) + p = find_devices("IDE"); + if (p == NULL) + p = find_type_devices("ide"); + if (p == NULL) + p = find_type_devices("ata"); + /* Move removable devices such as the media-bay CDROM + on the PB3400 to the end of the list. */ + for (; p != NULL; p = p->next) { + if (p->parent && p->parent->type + && strcasecmp(p->parent->type, "media-bay") == 0) { + *rp = p; + rp = &p->next; + } else { + *pp = p; + pp = &p->next; + } + } + *rp = NULL; + *pp = removables; + big_delay = 0; + + for (i = 0, np = atas; i < MAX_HWIFS && np != NULL; np = np->next) { + struct device_node *tp; + struct pmac_ide_hwif* pmif; + int *bidp; + int in_bay = 0; + u8 pbus, pid; + struct pci_dev *pdev = NULL; + + /* + * If this node is not under a mac-io or dbdma node, + * leave it to the generic PCI driver. + */ + for (tp = np->parent; tp != 0; tp = tp->parent) + if (tp->type && (strcmp(tp->type, "mac-io") == 0 + || strcmp(tp->type, "dbdma") == 0)) + break; + if (tp == 0) + continue; + + if (np->n_addrs == 0) { + printk(KERN_WARNING "ide: no address for device %s\n", + np->full_name); + continue; + } + + /* We need to find the pci_dev of the mac-io holding the + * IDE interface + */ + if (pci_device_from_OF_node(tp, &pbus, &pid) == 0) + pdev = pci_find_slot(pbus, pid); + if (pdev == NULL) + printk(KERN_WARNING "ide: no PCI host for device %s, DMA disabled\n", + np->full_name); + + /* + * If this slot is taken (e.g. by ide-pci.c) try the next one. + */ + while (i < MAX_HWIFS + && ide_hwifs[i].io_ports[IDE_DATA_OFFSET] != 0) + ++i; + if (i >= MAX_HWIFS) + break; + pmif = &pmac_ide[i]; + + /* + * Some older OFs have bogus sizes, causing request_OF_resource + * to fail. We fix them up here + */ + if (np->addrs[0].size > 0x1000) + np->addrs[0].size = 0x1000; + if (np->n_addrs > 1 && np->addrs[1].size > 0x100) + np->addrs[1].size = 0x100; + + if (request_OF_resource(np, 0, " (mac-io IDE IO)") == NULL) { + printk(KERN_ERR "ide-pmac(%s): can't request IO resource !\n", np->name); + continue; + } + + base = (unsigned long) ioremap(np->addrs[0].address, 0x400); + + /* XXX This is bogus. Should be fixed in the registry by checking + the kind of host interrupt controller, a bit like gatwick + fixes in irq.c + */ + if (np->n_intrs == 0) { + printk(KERN_WARNING "ide: no intrs for device %s, using 13\n", + np->full_name); + irq = 13; + } else { + irq = np->intrs[0].line; + } + pmif->regbase = base; + pmif->irq = irq; + pmif->node = np; + pmif->index = i; + if (device_is_compatible(np, "keylargo-ata")) { + if (strcmp(np->name, "ata-4") == 0) + pmif->kind = controller_kl_ata4; + else + pmif->kind = controller_kl_ata3; + } else if (device_is_compatible(np, "heathrow-ata")) + pmif->kind = controller_heathrow; + else + pmif->kind = controller_ohare; + + bidp = (int *)get_property(np, "AAPL,bus-id", NULL); + pmif->aapl_bus_id = bidp ? *bidp : 0; + + if (pmif->kind == controller_kl_ata4) { + char* cable = get_property(np, "cable-type", NULL); + if (cable && !strncmp(cable, "80-", 3)) + pmif->kind = controller_kl_ata4_80; + } + + /* Make sure we have sane timings */ + sanitize_timings(pmif); + + if (np->parent && np->parent->name + && strcasecmp(np->parent->name, "media-bay") == 0) { +#ifdef CONFIG_PMAC_PBOOK + media_bay_set_ide_infos(np->parent,base,irq,i); +#endif /* CONFIG_PMAC_PBOOK */ + in_bay = 1; + if (!bidp) + pmif->aapl_bus_id = 1; + } else if (pmif->kind == controller_ohare) { + /* The code below is having trouble on some ohare machines + * (timing related ?). Until I can put my hand on one of these + * units, I keep the old way + */ + ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, 0, 1); + } else { + /* This is necessary to enable IDE when net-booting */ + printk(KERN_INFO "pmac_ide: enabling IDE bus ID %d\n", + pmif->aapl_bus_id); + ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 1); + ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 1); + mdelay(10); + ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 0); + big_delay = 1; + } + + hwif = &ide_hwifs[i]; + /* Setup MMIO ops */ + default_hwif_mmiops(hwif); + /* Tell common code _not_ to mess with resources */ + hwif->mmio = 2; + hwif->hwif_data = pmif; + pmac_ide_init_hwif_ports(&hwif->hw, base, 0, &hwif->irq); + memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); + hwif->chipset = ide_pmac; + hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET] || in_bay; + hwif->udma_four = (pmif->kind == controller_kl_ata4_80); + hwif->pci_dev = pdev; + hwif->drives[0].unmask = 1; + hwif->drives[1].unmask = 1; + hwif->tuneproc = pmac_ide_tuneproc; + hwif->selectproc = pmac_ide_selectproc; + hwif->speedproc = pmac_ide_tune_chipset; +#ifdef CONFIG_PMAC_PBOOK + if (in_bay && check_media_bay_by_base(base, MB_CD) == 0) + hwif->noprobe = 0; +#endif /* CONFIG_PMAC_PBOOK */ + +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC + if (np->n_addrs >= 2) { + /* has a DBDMA controller channel */ + pmac_ide_setup_dma(np, i); + } + hwif->atapi_dma = 1; + hwif->ultra_mask = 0x1f; + hwif->mwdma_mask = 0x07; + hwif->swdma_mask = 0x07; + +#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ + + ++i; + } + pmac_ide_count = i; + if (big_delay) + mdelay(IDE_WAKEUP_DELAY_MS); + +#ifdef CONFIG_PMAC_PBOOK + pmu_register_sleep_notifier(&idepmac_sleep_notifier); +#endif /* CONFIG_PMAC_PBOOK */ +} + +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC + +static int +pmac_ide_build_sglist(ide_hwif_t *hwif, struct request *rq) +{ + pmac_ide_hwif_t *pmif = (pmac_ide_hwif_t *)hwif->hwif_data; + struct buffer_head *bh; + struct scatterlist *sg = pmif->sg_table; + int nents = 0; + + if (hwif->sg_dma_active) + BUG(); + + if (rq->cmd == READ) + pmif->sg_dma_direction = PCI_DMA_FROMDEVICE; + else + pmif->sg_dma_direction = PCI_DMA_TODEVICE; + bh = rq->bh; + do { + unsigned char *virt_addr = bh->b_data; + unsigned int size = bh->b_size; + + if (nents >= MAX_DCMDS) + return 0; + + while ((bh = bh->b_reqnext) != NULL) { + if ((virt_addr + size) != (unsigned char *) bh->b_data) + break; + size += bh->b_size; + } + memset(&sg[nents], 0, sizeof(*sg)); + sg[nents].address = virt_addr; + sg[nents].length = size; + nents++; + } while (bh != NULL); + + return pci_map_sg(hwif->pci_dev, sg, nents, pmif->sg_dma_direction); +} + +static int +pmac_ide_raw_build_sglist(ide_hwif_t *hwif, struct request *rq) +{ + pmac_ide_hwif_t *pmif = (pmac_ide_hwif_t *)hwif->hwif_data; + struct scatterlist *sg = hwif->sg_table; + int nents = 0; + ide_task_t *args = rq->special; + unsigned char *virt_addr = rq->buffer; + int sector_count = rq->nr_sectors; + + if (args->command_type == IDE_DRIVE_TASK_RAW_WRITE) + pmif->sg_dma_direction = PCI_DMA_TODEVICE; + else + pmif->sg_dma_direction = PCI_DMA_FROMDEVICE; + + if (sector_count > 128) { + memset(&sg[nents], 0, sizeof(*sg)); + sg[nents].address = virt_addr; + sg[nents].length = 128 * SECTOR_SIZE; + nents++; + virt_addr = virt_addr + (128 * SECTOR_SIZE); + sector_count -= 128; + } + memset(&sg[nents], 0, sizeof(*sg)); + sg[nents].address = virt_addr; + sg[nents].length = sector_count * SECTOR_SIZE; + nents++; + + return pci_map_sg(hwif->pci_dev, sg, nents, pmif->sg_dma_direction); +} + +/* + * pmac_ide_build_dmatable builds the DBDMA command list + * for a transfer and sets the DBDMA channel to point to it. + */ +static int +pmac_ide_build_dmatable(ide_drive_t *drive, int wr) +{ + struct dbdma_cmd *table; + int i, count = 0; + struct request *rq = HWGROUP(drive)->rq; + ide_hwif_t *hwif = HWIF(drive); + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; + volatile struct dbdma_regs *dma = pmif->dma_regs; + struct scatterlist *sg; + + /* DMA table is already aligned */ + table = (struct dbdma_cmd *) pmif->dma_table_cpu; + + /* Make sure DMA controller is stopped (necessary ?) */ + writel((RUN|PAUSE|FLUSH|WAKE|DEAD) << 16, &dma->control); + while (readl(&dma->status) & RUN) + udelay(1); + + /* Build sglist */ + if (rq->cmd == IDE_DRIVE_TASKFILE) + pmif->sg_nents = i = pmac_ide_raw_build_sglist(hwif, rq); + else + pmif->sg_nents = i = pmac_ide_build_sglist(hwif, rq); + if (!i) + return 0; + + /* Build DBDMA commands list */ + sg = pmif->sg_table; + while (i && sg_dma_len(sg)) { + u32 cur_addr; + u32 cur_len; + + cur_addr = sg_dma_address(sg); + cur_len = sg_dma_len(sg); + + while (cur_len) { + unsigned int tc = (cur_len < 0xfe00)? cur_len: 0xfe00; + + if (++count >= MAX_DCMDS) { + printk(KERN_WARNING "%s: DMA table too small\n", + drive->name); + return 0; /* revert to PIO for this request */ + } + st_le16(&table->command, wr? OUTPUT_MORE: INPUT_MORE); + st_le16(&table->req_count, tc); + st_le32(&table->phy_addr, cur_addr); + table->cmd_dep = 0; + table->xfer_status = 0; + table->res_count = 0; + cur_addr += tc; + cur_len -= tc; + ++table; + } + sg++; + i--; + } + + /* convert the last command to an input/output last command */ + if (count) + st_le16(&table[-1].command, wr? OUTPUT_LAST: INPUT_LAST); + else + printk(KERN_DEBUG "%s: empty DMA table?\n", drive->name); + + /* add the stop command to the end of the list */ + memset(table, 0, sizeof(struct dbdma_cmd)); + st_le16(&table->command, DBDMA_STOP); + mb(); + writel(pmif->dma_table_dma, &dma->cmdptr); + return 1; +} + +/* Teardown mappings after DMA has completed. */ +static void +pmac_ide_destroy_dmatable (ide_drive_t *drive) +{ + struct pci_dev *dev = HWIF(drive)->pci_dev; + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; + struct scatterlist *sg = pmif->sg_table; + int nents = pmif->sg_nents; + + if (nents) { + pci_unmap_sg(dev, sg, nents, pmif->sg_dma_direction); + pmif->sg_nents = 0; + } +} + +static __inline__ unsigned char +dma_bits_to_command(unsigned char bits) +{ + if(bits & 0x04) + return XFER_MW_DMA_2; + if(bits & 0x02) + return XFER_MW_DMA_1; + if(bits & 0x01) + return XFER_MW_DMA_0; + return 0; +} + +static __inline__ unsigned char +udma_bits_to_command(unsigned char bits, int high_speed) +{ + if (high_speed) { + if(bits & 0x10) + return XFER_UDMA_4; + if(bits & 0x08) + return XFER_UDMA_3; + } + if(bits & 0x04) + return XFER_UDMA_2; + if(bits & 0x02) + return XFER_UDMA_1; + if(bits & 0x01) + return XFER_UDMA_0; + return 0; +} + +/* Calculate MultiWord DMA timings */ +static int __pmac +pmac_ide_mdma_enable(ide_drive_t *drive) +{ + u8 bits = drive->id->dma_mword & 0x07; + u8 feature = dma_bits_to_command(bits); + u32 *timings; + int drive_cycle_time; + struct hd_driveid *id = drive->id; + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; + int ret; + + /* Set feature on drive */ + printk(KERN_INFO "%s: Enabling MultiWord DMA %d\n", drive->name, feature & 0xf); + ret = pmac_ide_do_setfeature(drive, feature); + if (ret) { + printk(KERN_WARNING "%s: Failed !\n", drive->name); + return 0; + } + + if (!drive->init_speed) + drive->init_speed = feature; + + /* which drive is it ? */ + if (drive->select.b.unit & 0x01) + timings = &pmif->timings[1]; + else + timings = &pmif->timings[0]; + + /* Check if drive provide explicit cycle time */ + if ((id->field_valid & 2) && (id->eide_dma_time)) + drive_cycle_time = id->eide_dma_time; + else + drive_cycle_time = 0; + + /* Calculate controller timings */ + set_timings_mdma(pmif->kind, timings, feature, drive_cycle_time); + + drive->current_speed = feature; + return 1; +} + +/* Calculate Ultra DMA timings */ +static int __pmac +pmac_ide_udma_enable(ide_drive_t *drive, int high_speed) +{ + u8 bits = drive->id->dma_ultra & 0x1f; + u8 feature = udma_bits_to_command(bits, high_speed); + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; + u32 *timings; + int ret; + + /* Set feature on drive */ + printk(KERN_INFO "%s: Enabling Ultra DMA %d\n", drive->name, feature & 0xf); + ret = pmac_ide_do_setfeature(drive, feature); + if (ret) { + printk(KERN_WARNING "%s: Failed !\n", drive->name); + return 0; + } + + if (!drive->init_speed) + drive->init_speed = feature; + + /* which drive is it ? */ + if (drive->select.b.unit & 0x01) + timings = &pmif->timings[1]; + else + timings = &pmif->timings[0]; + + set_timings_udma(timings, feature); + + drive->current_speed = feature; + return 1; +} + +int pmac_ide_dma_check(ide_drive_t *drive) +{ + int ata4, udma; + struct hd_driveid *id = drive->id; + ide_hwif_t *hwif = HWIF(drive); + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; + int enable = 1; + + drive->using_dma = 0; + + if (pmif == NULL) + return 0; + + if (drive->media == ide_floppy) + enable = 0; + if (((id->capability & 1) == 0) && + !HWIF(drive)->ide_dma_good_drive(drive)) + enable = 0; + if (HWIF(drive)->ide_dma_bad_drive(drive)) + enable = 0; + udma = 0; + ata4 = (pmif->kind == controller_kl_ata4 || + pmif->kind == controller_kl_ata4_80); + + if(enable) { + if (ata4 && (drive->media == ide_disk) && + (id->field_valid & 0x0004) && (id->dma_ultra & 0x1f)) { + /* UltraDMA modes. */ + drive->using_dma = pmac_ide_udma_enable(drive, + pmif->kind == controller_kl_ata4_80); + } + if (!drive->using_dma && (id->dma_mword & 0x0007)) { + /* Normal MultiWord DMA modes. */ + drive->using_dma = pmac_ide_mdma_enable(drive); + } + hwif->OUTB(0, IDE_CONTROL_REG); + /* Apply settings to controller */ + pmac_ide_selectproc(drive); + } + return 0; +} + +static int +pmac_ide_dma_read (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; + struct request *rq = HWGROUP(drive)->rq; +// ide_task_t *args = rq->special; + u8 unit = (drive->select.b.unit & 0x01); + u8 ata4; + u8 lba48 = (drive->addressing == 1) ? 1 : 0; + task_ioreg_t command = WIN_NOP; + + if (pmif == NULL) + return 1; + + ata4 = (pmif->kind == controller_kl_ata4 || + pmif->kind == controller_kl_ata4_80); + + if (!pmac_ide_build_dmatable(drive, 0)) + return 1; + /* Apple adds 60ns to wrDataSetup on reads */ + if (ata4 && (pmif->timings[unit] & TR_66_UDMA_EN)) { + writel(pmif->timings[unit]+0x00800000UL, + (unsigned *)(IDE_DATA_REG+IDE_TIMING_CONFIG)); + (void)readl((unsigned *)(IDE_DATA_REG + IDE_TIMING_CONFIG)); + } + drive->waiting_for_dma = 1; + if (drive->media != ide_disk) + return 0; + if (HWGROUP(drive)->handler != NULL) /* paranoia check */ + BUG(); + ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); + /* + * FIX ME to use only ACB ide_task_t args Struct + */ +#if 0 + { + ide_task_t *args = rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#else + command = (lba48) ? WIN_READDMA_EXT : WIN_READDMA; + if (rq->cmd == IDE_DRIVE_TASKFILE) { + ide_task_t *args = rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#endif + /* issue cmd to drive */ + hwif->OUTB(command, IDE_COMMAND_REG); + + return pmac_ide_dma_begin(drive); +} + +static int +pmac_ide_dma_write (ide_drive_t *drive) +{ + ide_hwif_t *hwif = HWIF(drive); + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)hwif->hwif_data; + struct request *rq = HWGROUP(drive)->rq; +// ide_task_t *args = rq->special; + u8 unit = (drive->select.b.unit & 0x01); + u8 ata4; + u8 lba48 = (drive->addressing == 1) ? 1 : 0; + task_ioreg_t command = WIN_NOP; + + if (pmif == NULL) + return 1; + + ata4 = (pmif->kind == controller_kl_ata4 || + pmif->kind == controller_kl_ata4_80); + + if (!pmac_ide_build_dmatable(drive, 1)) + return 1; + /* Apple adds 60ns to wrDataSetup on reads */ + if (ata4 && (pmif->timings[unit] & TR_66_UDMA_EN)) { + writel(pmif->timings[unit], + (unsigned *)(IDE_DATA_REG+IDE_TIMING_CONFIG)); + (void)readl((unsigned *)(IDE_DATA_REG + IDE_TIMING_CONFIG)); + } + drive->waiting_for_dma = 1; + if (drive->media != ide_disk) + return 0; + if (HWGROUP(drive)->handler != NULL) /* paranoia check */ + BUG(); + ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); + /* + * FIX ME to use only ACB ide_task_t args Struct + */ +#if 0 + { + ide_task_t *args = rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#else + command = (lba48) ? WIN_WRITEDMA_EXT : WIN_WRITEDMA; + if (rq->cmd == IDE_DRIVE_TASKFILE) { + ide_task_t *args = rq->special; + command = args->tfRegister[IDE_COMMAND_OFFSET]; + } +#endif + /* issue cmd to drive */ + hwif->OUTB(command, IDE_COMMAND_REG); + + return pmac_ide_dma_begin(drive); +} + +static int +pmac_ide_dma_count (ide_drive_t *drive) +{ + return HWIF(drive)->ide_dma_begin(drive); +} + +static int +pmac_ide_dma_begin (ide_drive_t *drive) +{ + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; + volatile struct dbdma_regs *dma; + + if (pmif == NULL) + return 1; + dma = pmif->dma_regs; + + writel((RUN << 16) | RUN, &dma->control); + /* Make sure it gets to the controller right now */ + (void)readl(&dma->control); + return 0; +} + +static int +pmac_ide_dma_end (ide_drive_t *drive) +{ + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; + volatile struct dbdma_regs *dma; + u32 dstat; + + if (pmif == NULL) + return 0; + dma = pmif->dma_regs; + + drive->waiting_for_dma = 0; + dstat = readl(&dma->status); + writel(((RUN|WAKE|DEAD) << 16), &dma->control); + pmac_ide_destroy_dmatable(drive); + /* verify good dma status */ + return (dstat & (RUN|DEAD|ACTIVE)) != RUN; +} + +static int +pmac_ide_dma_test_irq (ide_drive_t *drive) +{ + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; + volatile struct dbdma_regs *dma; + unsigned long status; + + if (pmif == NULL) + return 0; + dma = pmif->dma_regs; + + /* We have to things to deal with here: + * + * - The dbdma won't stop if the command was started + * but completed with an error without transfering all + * datas. This happens when bad blocks are met during + * a multi-block transfer. + * + * - The dbdma fifo hasn't yet finished flushing to + * to system memory when the disk interrupt occurs. + * + * The trick here is to increment drive->waiting_for_dma, + * and return as if no interrupt occured. If the counter + * reach a certain timeout value, we then return 1. If + * we really got the interrupt, it will happen right away + * again. + * Apple's solution here may be more elegant. They issue + * a DMA channel interrupt (a separate irq line) via a DBDMA + * NOP command just before the STOP, and wait for both the + * disk and DBDMA interrupts to have completed. + */ + + /* If ACTIVE is cleared, the STOP command have passed and + * transfer is complete. + */ + status = readl(&dma->status); + if (!(status & ACTIVE)) + return 1; + if (!drive->waiting_for_dma) + printk(KERN_WARNING "ide%d, ide_dma_test_irq \ + called while not waiting\n", pmif->index); + + /* If dbdma didn't execute the STOP command yet, the + * active bit is still set */ + drive->waiting_for_dma++; + if (drive->waiting_for_dma >= DMA_WAIT_TIMEOUT) { + printk(KERN_WARNING "ide%d, timeout waiting \ + for dbdma command stop\n", pmif->index); + return 1; + } + udelay(1); + return 0; +} + +static int +pmac_ide_dma_host_off (ide_drive_t *drive) +{ + return 0; +} + +static int +pmac_ide_dma_host_on (ide_drive_t *drive) +{ + return 0; +} + +static int +pmac_ide_dma_lostirq (ide_drive_t *drive) +{ + pmac_ide_hwif_t* pmif = (pmac_ide_hwif_t *)HWIF(drive)->hwif_data; + volatile struct dbdma_regs *dma; + unsigned long status; + + if (pmif == NULL) + return 0; + dma = pmif->dma_regs; + + status = readl(&dma->status); + printk(KERN_ERR "ide-pmac lost interrupt, dma status: %lx\n", status); + return 0; +} + +static void __init +pmac_ide_setup_dma(struct device_node *np, int ix) +{ + struct pmac_ide_hwif *pmif = &pmac_ide[ix]; + + if (request_OF_resource(np, 1, " (mac-io IDE DMA)") == NULL) { + printk(KERN_ERR "ide-pmac(%s): can't request DMA resource !\n", np->name); + return; + } + + pmif->dma_regs = + (volatile struct dbdma_regs*)ioremap(np->addrs[1].address, 0x200); + + /* + * Allocate space for the DBDMA commands. + * The +2 is +1 for the stop command and +1 to allow for + * aligning the start address to a multiple of 16 bytes. + */ + pmif->dma_table_cpu = (struct dbdma_cmd*)pci_alloc_consistent( + ide_hwifs[ix].pci_dev, + (MAX_DCMDS + 2) * sizeof(struct dbdma_cmd), + &pmif->dma_table_dma); + if (pmif->dma_table_cpu == NULL) { + printk(KERN_ERR "%s: unable to allocate DMA command list\n", + ide_hwifs[ix].name); + return; + } + + pmif->sg_table = kmalloc(sizeof(struct scatterlist) * MAX_DCMDS, + GFP_KERNEL); + if (pmif->sg_table == NULL) { + pci_free_consistent( ide_hwifs[ix].pci_dev, + (MAX_DCMDS + 2) * sizeof(struct dbdma_cmd), + pmif->dma_table_cpu, pmif->dma_table_dma); + return; + } + ide_hwifs[ix].ide_dma_off = &__ide_dma_off; + ide_hwifs[ix].ide_dma_off_quietly = &__ide_dma_off_quietly; + ide_hwifs[ix].ide_dma_on = &__ide_dma_on; + ide_hwifs[ix].ide_dma_check = &pmac_ide_dma_check; + ide_hwifs[ix].ide_dma_read = &pmac_ide_dma_read; + ide_hwifs[ix].ide_dma_write = &pmac_ide_dma_write; + ide_hwifs[ix].ide_dma_count = &pmac_ide_dma_count; + ide_hwifs[ix].ide_dma_begin = &pmac_ide_dma_begin; + ide_hwifs[ix].ide_dma_end = &pmac_ide_dma_end; + ide_hwifs[ix].ide_dma_test_irq = &pmac_ide_dma_test_irq; + ide_hwifs[ix].ide_dma_host_off = &pmac_ide_dma_host_off; + ide_hwifs[ix].ide_dma_host_on = &pmac_ide_dma_host_on; + ide_hwifs[ix].ide_dma_good_drive = &__ide_dma_good_drive; + ide_hwifs[ix].ide_dma_bad_drive = &__ide_dma_bad_drive; + ide_hwifs[ix].ide_dma_verbose = &__ide_dma_verbose; + ide_hwifs[ix].ide_dma_timeout = &__ide_dma_timeout; + ide_hwifs[ix].ide_dma_retune = &__ide_dma_retune; + ide_hwifs[ix].ide_dma_lostirq = &pmac_ide_dma_lostirq; + +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC_AUTO + if (!noautodma) + ide_hwifs[ix].autodma = 1; +#endif + ide_hwifs[ix].drives[0].autodma = ide_hwifs[ix].autodma; + ide_hwifs[ix].drives[1].autodma = ide_hwifs[ix].autodma; +} + +#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ + +static void __pmac +idepmac_sleep_device(ide_drive_t *drive, unsigned base) +{ + ide_hwif_t *hwif = HWIF(drive); + int j; + + /* FIXME: We only handle the master IDE disk, we shoud + * try to fix CD-ROMs here + */ + switch (drive->media) { + case ide_disk: + /* Spin down the drive */ + hwif->OUTB(drive->select.all, base+0x60); + (void) hwif->INB(base+0x60); + udelay(100); + hwif->OUTB(0x0, base+0x30); + hwif->OUTB(0x0, base+0x20); + hwif->OUTB(0x0, base+0x40); + hwif->OUTB(0x0, base+0x50); + hwif->OUTB(0xe0, base+0x70); + hwif->OUTB(0x2, base+0x160); + for (j = 0; j < 10; j++) { + u8 status; + mdelay(100); + status = hwif->INB(base+0x70); + if (!(status & BUSY_STAT) && (status & DRQ_STAT)) + break; + } + break; + case ide_cdrom: + // todo + break; + case ide_floppy: + // todo + break; + } +} + +#ifdef CONFIG_PMAC_PBOOK +static void __pmac +idepmac_wake_device(ide_drive_t *drive, int used_dma) +{ + /* We force the IDE subdriver to check for a media change + * This must be done first or we may lost the condition + * + * Problem: This can schedule. I moved the block device + * wakeup almost late by priority because of that. + */ + if (DRIVER(drive) && DRIVER(drive)->media_change) + DRIVER(drive)->media_change(drive); + + /* We kick the VFS too (see fix in ide.c revalidate) */ + check_disk_change(MKDEV(HWIF(drive)->major, (drive->select.b.unit) << PARTN_BITS)); + +#ifdef CONFIG_BLK_DEV_IDEDMA_PMAC + /* We re-enable DMA on the drive if it was active. */ + /* This doesn't work with the CD-ROM in the media-bay, probably + * because of a pending unit attention. The problem if that if I + * clear the error, the filesystem dies. + */ + if (used_dma && !ide_spin_wait_hwgroup(drive)) { + /* Lock HW group */ + HWGROUP(drive)->busy = 1; + pmac_ide_dma_check(drive); + HWGROUP(drive)->busy = 0; + if (!list_empty(&drive->queue.queue_head)) + ide_do_request(HWGROUP(drive), 0); + spin_unlock_irq(&io_request_lock); + } +#endif /* CONFIG_BLK_DEV_IDEDMA_PMAC */ +} + +static void __pmac +idepmac_sleep_interface(pmac_ide_hwif_t *pmif, unsigned base, int mediabay) +{ + struct device_node* np = pmif->node; + + /* We clear the timings */ + pmif->timings[0] = 0; + pmif->timings[1] = 0; + + /* The media bay will handle itself just fine */ + if (mediabay) + return; + + /* Disable the bus */ + ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 0); +} + +static void __pmac +idepmac_wake_interface(pmac_ide_hwif_t *pmif, unsigned long base, int mediabay) +{ + struct device_node* np = pmif->node; + + if (!mediabay) { + /* Revive IDE disk and controller */ + ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 1); + ppc_md.feature_call(PMAC_FTR_IDE_ENABLE, np, pmif->aapl_bus_id, 1); + mdelay(10); + ppc_md.feature_call(PMAC_FTR_IDE_RESET, np, pmif->aapl_bus_id, 0); + } +} + +static void +idepmac_sleep_drive(ide_drive_t *drive, unsigned long base) +{ + int unlock = 0; + + /* Wait for HW group to complete operations */ + if (ide_spin_wait_hwgroup(drive)) { + // What can we do here ? Wake drive we had already + // put to sleep and return an error ? + } else { + unlock = 1; + /* Lock HW group */ + HWGROUP(drive)->busy = 1; + /* Stop the device */ + idepmac_sleep_device(drive, base); + } + if (unlock) + spin_unlock_irq(&io_request_lock); +} + +static void +idepmac_wake_drive(ide_drive_t *drive, unsigned long base) +{ + ide_hwif_t *hwif = HWIF(drive); + unsigned long flags; + int j; + + /* Reset timings */ + pmac_ide_selectproc(drive); + mdelay(10); + + /* Wait up to 20 seconds for the drive to be ready */ + for (j = 0; j < 200; j++) { + u8 status = 0; + mdelay(100); + hwif->OUTB(drive->select.all, base + 0x60); + if ((hwif->INB(base + 0x60)) != drive->select.all) + continue; + status = hwif->INB(base + 0x70); + if (!(status & BUSY_STAT)) + break; + } + + /* We resume processing on the HW group */ + spin_lock_irqsave(&io_request_lock, flags); + HWGROUP(drive)->busy = 0; + if (!list_empty(&drive->queue.queue_head)) + ide_do_request(HWGROUP(drive), 0); + spin_unlock_irqrestore(&io_request_lock, flags); +} + +/* Note: We support only master drives for now. This will have to be + * improved if we want to handle sleep on the iMacDV where the CD-ROM + * is a slave + */ +static int __pmac +idepmac_notify_sleep(struct pmu_sleep_notifier *self, int when) +{ + int i, ret; + unsigned long base; + int big_delay; + + switch (when) { + case PBOOK_SLEEP_REQUEST: + break; + case PBOOK_SLEEP_REJECT: + break; + case PBOOK_SLEEP_NOW: + for (i = 0; i < pmac_ide_count; ++i) { + ide_hwif_t *hwif; + int dn; + + if ((base = pmac_ide[i].regbase) == 0) + continue; + + hwif = &ide_hwifs[i]; + for (dn=0; dndrives[dn].present) + continue; + idepmac_sleep_drive(&hwif->drives[dn], base); + } + /* Disable irq during sleep */ + disable_irq(pmac_ide[i].irq); + + /* Check if this is a media bay with an IDE device or not + * a media bay. + */ + ret = check_media_bay_by_base(base, MB_CD); + if ((ret == 0) || (ret == -ENODEV)) + idepmac_sleep_interface(&pmac_ide[i], base, (ret == 0)); + } + break; + case PBOOK_WAKE: + big_delay = 0; + for (i = 0; i < pmac_ide_count; ++i) { + + if ((base = pmac_ide[i].regbase) == 0) + continue; + + /* Make sure we have sane timings */ + sanitize_timings(&pmac_ide[i]); + + /* Check if this is a media bay with an IDE device or not + * a media bay + */ + ret = check_media_bay_by_base(base, MB_CD); + if ((ret == 0) || (ret == -ENODEV)) { + idepmac_wake_interface(&pmac_ide[i], base, (ret == 0)); + big_delay = 1; + } + + } + /* Let hardware get up to speed */ + if (big_delay) + mdelay(IDE_WAKEUP_DELAY_MS); + + for (i = 0; i < pmac_ide_count; ++i) { + ide_hwif_t *hwif; + int used_dma, dn; + int irq_on = 0; + + if ((base = pmac_ide[i].regbase) == 0) + continue; + + hwif = &ide_hwifs[i]; + for (dn=0; dndrives[dn]; + if (!drive->present) + continue; + /* We don't have re-configured DMA yet */ + used_dma = drive->using_dma; + drive->using_dma = 0; + idepmac_wake_drive(drive, base); + if (!irq_on) { + enable_irq(pmac_ide[i].irq); + irq_on = 1; + } + idepmac_wake_device(drive, used_dma); + } + if (!irq_on) + enable_irq(pmac_ide[i].irq); + } + break; + } + return PBOOK_SLEEP_OK; +} +#endif /* CONFIG_PMAC_PBOOK */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/ppc/swarm.c linux.20pre5-ac2/drivers/ide/ppc/swarm.c --- linux.20pre5/drivers/ide/ppc/swarm.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/ppc/swarm.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2001 Broadcom Corporation + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* Derived loosely from ide-pmac.c, so: + * + * Copyright (C) 1998 Paul Mackerras. + * Copyright (C) 1995-1998 Mark Lord + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define __IDE_SWARM_C + +#include + +void __init swarm_ide_probe(void) +{ + int i; + ide_hwif_t *hwif; + /* + * Find the first untaken slot in hwifs + */ + for (i = 0; i < MAX_HWIFS; i++) { + if (!ide_hwifs[i].io_ports[IDE_DATA_OFFSET]) { + break; + } + } + if (i == MAX_HWIFS) { + printk("No space for SWARM onboard IDE driver in ide_hwifs[]. Not enabled.\n"); + return; + } + + /* Set up our stuff */ + hwif = &ide_hwifs[i]; + hwif->hw.io_ports[IDE_DATA_OFFSET] = SWARM_IDE_REG(0x1f0); + hwif->hw.io_ports[IDE_ERROR_OFFSET] = SWARM_IDE_REG(0x1f1); + hwif->hw.io_ports[IDE_NSECTOR_OFFSET] = SWARM_IDE_REG(0x1f2); + hwif->hw.io_ports[IDE_SECTOR_OFFSET] = SWARM_IDE_REG(0x1f3); + hwif->hw.io_ports[IDE_LCYL_OFFSET] = SWARM_IDE_REG(0x1f4); + hwif->hw.io_ports[IDE_HCYL_OFFSET] = SWARM_IDE_REG(0x1f5); + hwif->hw.io_ports[IDE_SELECT_OFFSET] = SWARM_IDE_REG(0x1f6); + hwif->hw.io_ports[IDE_STATUS_OFFSET] = SWARM_IDE_REG(0x1f7); + hwif->hw.io_ports[IDE_CONTROL_OFFSET] = SWARM_IDE_REG(0x3f6); + hwif->hw.io_ports[IDE_IRQ_OFFSET] = SWARM_IDE_REG(0x3f7); +// hwif->hw->ack_intr = swarm_ide_ack_intr; + hwif->hw.irq = SWARM_IDE_INT; +#if 0 + hwif->iops = swarm_iops; +#else + hwif->OUTB = hwif->OUTBP = swarm_outb; + hwif->OUTW = hwif->OUTWP = swarm_outw; + hwif->OUTL = hwif->OUTLP = swarm_outl; + hwif->OUTSW = hwif->OUTSWP = swarm_outsw; + hwif->OUTSL = hwif->OUTSLP = swarm_outsl; + hwif->INB = hwif->INBP = swarm_inb; + hwif->INW = hwif->INWP = swarm_inw; + hwif->INL = hwif->INLP = swarm_inl; + hwif->INSW = hwif->INSWP = swarm_insw; + hwif->INSL = hwif->INSLP = swarm_insl; +#endif +#if 0 + hwif->pioops = swarm_pio_ops; +#else + hwif->ata_input_data = swarm_ata_input_data; + hwif->ata_output_data = swarm_ata_output_data; + hwif->atapi_input_bytes = swarm_atapi_input_bytes; + hwif->atapi_output_bytes = swarm_atapi_output_bytes; +#endif + memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); + hwif->irq = hwif->hw.irq; + printk("SWARM onboard IDE configured as device %i\n", i); + +#ifndef HWIF_PROBE_CLASSIC_METHOD + probe_hwif_init(hwif->index); +#endif /* HWIF_PROBE_CLASSIC_METHOD */ + +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/q40ide.c linux.20pre5-ac2/drivers/ide/q40ide.c --- linux.20pre5/drivers/ide/q40ide.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/q40ide.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,91 +0,0 @@ -/* - * linux/drivers/ide/q40ide.c -- Q40 I/O port IDE Driver - * - * (c) Richard Zidlicky - * - * This file is subject to the terms and conditions of the GNU General Public - * License. See the file COPYING in the main directory of this archive for - * more details. - * - * - */ - -#include -#include -#include -#include -#include - -#include - - /* - * Bases of the IDE interfaces - */ - -#define Q40IDE_NUM_HWIFS 2 - -#define PCIDE_BASE1 0x1f0 -#define PCIDE_BASE2 0x170 -#define PCIDE_BASE3 0x1e8 -#define PCIDE_BASE4 0x168 -#define PCIDE_BASE5 0x1e0 -#define PCIDE_BASE6 0x160 - -static const q40ide_ioreg_t pcide_bases[Q40IDE_NUM_HWIFS] = { - PCIDE_BASE1, PCIDE_BASE2, /* PCIDE_BASE3, PCIDE_BASE4 , PCIDE_BASE5, - PCIDE_BASE6 */ -}; - - - /* - * Offsets from one of the above bases - */ - - -/* HD_DATA was redefined in asm-m68k/ide.h */ -#undef HD_DATA -#define HD_DATA 0x1f0 - - -#define PCIDE_REG(x) ((q40ide_ioreg_t)(HD_##x-PCIDE_BASE1)) - -static const int pcide_offsets[IDE_NR_PORTS] = { - PCIDE_REG(DATA), PCIDE_REG(ERROR), PCIDE_REG(NSECTOR), PCIDE_REG(SECTOR), - PCIDE_REG(LCYL), PCIDE_REG(HCYL), PCIDE_REG(CURRENT), PCIDE_REG(STATUS), - PCIDE_REG(CMD) -}; - -static int q40ide_default_irq(q40ide_ioreg_t base) -{ - switch (base) { - case 0x1f0: return 14; - case 0x170: return 15; - case 0x1e8: return 11; - default: - return 0; - } -} - - - - /* - * Probe for Q40 IDE interfaces - */ - -void q40ide_init(void) -{ - int i; - - if (!MACH_IS_Q40) - return ; - - for (i = 0; i < Q40IDE_NUM_HWIFS; i++) { - hw_regs_t hw; - - ide_setup_ports(&hw,(ide_ioreg_t) pcide_bases[i], (int *)pcide_offsets, - pcide_bases[i]+0x206, - 0, NULL, q40ide_default_irq(pcide_bases[i])); - ide_register_hw(&hw, NULL); - } -} - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/qd65xx.c linux.20pre5-ac2/drivers/ide/qd65xx.c --- linux.20pre5/drivers/ide/qd65xx.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/qd65xx.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,456 +0,0 @@ -/* - * linux/drivers/ide/qd65xx.c Version 0.07 Sep 30, 2001 - * - * Copyright (C) 1996-2001 Linus Torvalds & author (see below) - */ - -/* - * Version 0.03 Cleaned auto-tune, added probe - * Version 0.04 Added second channel tuning - * Version 0.05 Enhanced tuning ; added qd6500 support - * Version 0.06 Added dos driver's list - * Version 0.07 Second channel bug fix - * - * QDI QD6500/QD6580 EIDE controller fast support - * - * Please set local bus speed using kernel parameter idebus - * for example, "idebus=33" stands for 33Mhz VLbus - * To activate controller support, use "ide0=qd65xx" - * To enable tuning, use "ide0=autotune" - * To enable second channel tuning (qd6580 only), use "ide1=autotune" - */ - -/* - * Rewritten from the work of Colten Edwards by - * Samuel Thibault - */ - -#undef REALLY_SLOW_IO /* most systems can safely undef this */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ide_modes.h" -#include "qd65xx.h" - -/* - * I/O ports are 0x30-0x31 (and 0x32-0x33 for qd6580) - * or 0xb0-0xb1 (and 0xb2-0xb3 for qd6580) - * -- qd6500 is a single IDE interface - * -- qd6580 is a dual IDE interface - * - * More research on qd6580 being done by willmore@cig.mot.com (David) - * More Information given by Petr Soucek (petr@ryston.cz) - * http://www.ryston.cz/petr/vlb - */ - -/* - * base: Timer1 - * - * - * base+0x01: Config (R/O) - * - * bit 0: ide baseport: 1 = 0x1f0 ; 0 = 0x170 (only useful for qd6500) - * bit 1: qd65xx baseport: 1 = 0xb0 ; 0 = 0x30 - * bit 2: ID3: bus speed: 1 = <=33MHz ; 0 = >33MHz - * bit 3: qd6500: 1 = disabled, 0 = enabled - * qd6580: 1 - * upper nibble: - * qd6500: 1100 - * qd6580: either 1010 or 0101 - * - * - * base+0x02: Timer2 (qd6580 only) - * - * - * base+0x03: Control (qd6580 only) - * - * bits 0-3 must always be set 1 - * bit 4 must be set 1, but is set 0 by dos driver while measuring vlb clock - * bit 0 : 1 = Only primary port enabled : channel 0 for hda, channel 1 for hdb - * 0 = Primary and Secondary ports enabled : channel 0 for hda & hdb - * channel 1 for hdc & hdd - * bit 1 : 1 = only disks on primary port - * 0 = disks & ATAPI devices on primary port - * bit 2-4 : always 0 - * bit 5 : status, but of what ? - * bit 6 : always set 1 by dos driver - * bit 7 : set 1 for non-ATAPI devices on primary port - * (maybe read-ahead and post-write buffer ?) - */ - -static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer */ - -static void qd_write_reg (byte content, byte reg) -{ - unsigned long flags; - - save_flags(flags); /* all CPUs */ - cli(); /* all CPUs */ - outb(content,reg); - restore_flags(flags); /* all CPUs */ -} - -byte __init qd_read_reg (byte reg) -{ - unsigned long flags; - byte read; - - save_flags(flags); /* all CPUs */ - cli(); /* all CPUs */ - read = inb(reg); - restore_flags(flags); /* all CPUs */ - return read; -} - -/* - * qd_select: - * - * This routine is invoked from ide.c to prepare for access to a given drive. - */ - -static void qd_select (ide_drive_t *drive) -{ - byte index = (( (QD_TIMREG(drive)) & 0x80 ) >> 7) | - (QD_TIMREG(drive) & 0x02); - - if (timings[index] != QD_TIMING(drive)) - qd_write_reg(timings[index] = QD_TIMING(drive), QD_TIMREG(drive)); -} - -/* - * qd6500_compute_timing - * - * computes the timing value where - * lower nibble represents active time, in count of VLB clocks - * upper nibble represents recovery time, in count of VLB clocks - */ - -static byte qd6500_compute_timing (ide_hwif_t *hwif, int active_time, int recovery_time) -{ - byte active_cycle,recovery_cycle; - - if (ide_system_bus_speed()<=33) { - active_cycle = 9 - IDE_IN(active_time * ide_system_bus_speed() / 1000 + 1, 2, 9); - recovery_cycle = 15 - IDE_IN(recovery_time * ide_system_bus_speed() / 1000 + 1, 0, 15); - } else { - active_cycle = 8 - IDE_IN(active_time * ide_system_bus_speed() / 1000 + 1, 1, 8); - recovery_cycle = 18 - IDE_IN(recovery_time * ide_system_bus_speed() / 1000 + 1, 3, 18); - } - - return((recovery_cycle<<4) | 0x08 | active_cycle); -} - -/* - * qd6580_compute_timing - * - * idem for qd6580 - */ - -static byte qd6580_compute_timing (int active_time, int recovery_time) -{ - byte active_cycle = 17-IDE_IN(active_time * ide_system_bus_speed() / 1000 + 1, 2, 17); - byte recovery_cycle = 15-IDE_IN(recovery_time * ide_system_bus_speed() / 1000 + 1, 2, 15); - - return((recovery_cycle<<4) | active_cycle); -} - -/* - * qd_find_disk_type - * - * tries to find timing from dos driver's table - */ - -static int qd_find_disk_type (ide_drive_t *drive, - int *active_time, int *recovery_time) -{ - struct qd65xx_timing_s *p; - char model[40]; - - if (!*drive->id->model) return 0; - - strncpy(model,drive->id->model,40); - ide_fixstring(model,40,1); /* byte-swap */ - - for (p = qd65xx_timing ; p->offset != -1 ; p++) { - if (!strncmp(p->model, model+p->offset,4)) { - printk(KERN_DEBUG "%s: listed !\n",drive->name); - *active_time = p->active; - *recovery_time = p->recovery; - return 1; - } - } - return 0; -} - -/* - * qd_timing_ok: - * - * check whether timings don't conflict - */ - -static int qd_timing_ok (ide_drive_t drives[]) -{ - return (IDE_IMPLY(drives[0].present && drives[1].present, - IDE_IMPLY(QD_TIMREG(drives) == QD_TIMREG(drives+1), - QD_TIMING(drives) == QD_TIMING(drives+1)))); - /* if same timing register, must be same timing */ -} - -/* - * qd_set_timing: - * - * records the timing, and enables selectproc as needed - */ - -static void qd_set_timing (ide_drive_t *drive, byte timing) -{ - ide_hwif_t *hwif = HWIF(drive); - - drive->drive_data &= 0xff00; - drive->drive_data |= timing; - if (qd_timing_ok(hwif->drives)) { - qd_select(drive); /* selects once */ - hwif->selectproc = NULL; - } else - hwif->selectproc = &qd_select; - - printk(KERN_DEBUG "%s: %#x\n",drive->name,timing); -} - -/* - * qd6500_tune_drive - */ - -static void qd6500_tune_drive (ide_drive_t *drive, byte pio) -{ - int active_time = 175; - int recovery_time = 415; /* worst case values from the dos driver */ - - if (drive->id && !qd_find_disk_type(drive,&active_time,&recovery_time) - && drive->id->tPIO && (drive->id->field_valid & 0x02) - && drive->id->eide_pio >= 240) { - - printk(KERN_INFO "%s: PIO mode%d\n", drive->name, - drive->id->tPIO); - active_time = 110; - recovery_time = drive->id->eide_pio - 120; - } - - qd_set_timing(drive,qd6500_compute_timing(HWIF(drive),active_time,recovery_time)); -} - -/* - * qd6580_tune_drive - */ - -static void qd6580_tune_drive (ide_drive_t *drive, byte pio) -{ - ide_pio_data_t d; - int base = HWIF(drive)->select_data; - int active_time = 175; - int recovery_time = 415; /* worst case values from the dos driver */ - - if (drive->id && !qd_find_disk_type(drive,&active_time,&recovery_time)) { - pio = ide_get_best_pio_mode(drive, pio, 255, &d); - pio = IDE_MIN(pio,4); - - switch (pio) { - case 0: break; - case 3: - if (d.cycle_time >= 110) { - active_time = 86; - recovery_time = d.cycle_time-102; - } else - printk(KERN_WARNING "%s: Strange recovery time !\n",drive->name); - break; - case 4: - if (d.cycle_time >= 69) { - active_time = 70; - recovery_time = d.cycle_time-61; - } else - printk(KERN_WARNING "%s: Strange recovery time !\n",drive->name); - break; - default: - if (d.cycle_time >= 180) { - active_time = 110; - recovery_time = d.cycle_time - 120; - } else { - active_time = ide_pio_timings[pio].active_time; - recovery_time = d.cycle_time - -active_time; - } - } - printk(KERN_INFO "%s: PIO mode%d\n",drive->name,pio); - } - - if (!HWIF(drive)->channel && drive->media != ide_disk) { - qd_write_reg(0x5f,QD_CONTROL_PORT); - printk(KERN_WARNING "%s: ATAPI: disabled read-ahead FIFO and post-write buffer on %s.\n",drive->name,HWIF(drive)->name); - } - - qd_set_timing(drive,qd6580_compute_timing(active_time,recovery_time)); -} - -/* - * qd_testreg - * - * tests if the given port is a register - */ - -static int __init qd_testreg(int port) -{ - byte savereg; - byte readreg; - unsigned long flags; - - save_flags(flags); /* all CPUs */ - cli(); /* all CPUs */ - savereg = inb_p(port); - outb_p(QD_TESTVAL,port); /* safe value */ - readreg = inb_p(port); - outb(savereg,port); - restore_flags(flags); /* all CPUs */ - - if (savereg == QD_TESTVAL) { - printk(KERN_ERR "Outch ! the probe for qd65xx isn't reliable !\n"); - printk(KERN_ERR "Please contact maintainers to tell about your hardware\n"); - printk(KERN_ERR "Assuming qd65xx is not present.\n"); - return 1; - } - - return (readreg != QD_TESTVAL); -} - -/* - * probe: - * - * looks at the specified baseport, and if qd found, registers & initialises it - * return 1 if another qd may be probed - */ - -int __init probe (int base) -{ - byte config; - byte index; - - config = qd_read_reg(QD_CONFIG_PORT); - - if (! ((config & QD_CONFIG_BASEPORT) >> 1 == (base == 0xb0)) ) return 1; - - index = ! (config & QD_CONFIG_IDE_BASEPORT); - - if ((config & 0xf0) == QD_CONFIG_QD6500) { - ide_hwif_t *hwif = &ide_hwifs[index]; - - if (qd_testreg(base)) return 1; /* bad register */ - - /* qd6500 found */ - - printk(KERN_NOTICE "%s: qd6500 at %#x\n", - ide_hwifs[index].name, base); - - printk(KERN_DEBUG "qd6500: config=%#x, ID3=%u\n", - config, QD_ID3); - - if (config & QD_CONFIG_DISABLED) { - printk(KERN_WARNING "qd6500 is disabled !\n"); - return 1; - } - - hwif->chipset = ide_qd65xx; - hwif->select_data = base; - hwif->config_data = config; - hwif->drives[0].drive_data = - hwif->drives[1].drive_data = QD6500_DEF_DATA; - hwif->drives[0].io_32bit = - hwif->drives[1].io_32bit = 1; - hwif->tuneproc = &qd6500_tune_drive; - return 1; - } - - if (((config & 0xf0) == QD_CONFIG_QD6580_A) || ((config & 0xf0) == QD_CONFIG_QD6580_B)) { - - byte control; - - if (qd_testreg(base) || qd_testreg(base+0x02)) return 1; - /* bad registers */ - - /* qd6580 found */ - - control = qd_read_reg(QD_CONTROL_PORT); - - printk(KERN_NOTICE "qd6580 at %#x\n", base); - printk(KERN_DEBUG "qd6580: config=%#x, control=%#x, ID3=%u\n", - config, control, QD_ID3); - - if (control & QD_CONTR_SEC_DISABLED) { - ide_hwif_t *hwif = &ide_hwifs[index]; - - /* secondary disabled */ - printk(KERN_INFO "%s: qd6580: single IDE board\n", - ide_hwifs[index].name); - - hwif->chipset = ide_qd65xx; - hwif->select_data = base; - hwif->config_data = config | (control <<8); - hwif->drives[0].drive_data = - hwif->drives[1].drive_data = QD6580_DEF_DATA; - hwif->drives[0].io_32bit = - hwif->drives[1].io_32bit = 1; - hwif->tuneproc = &qd6580_tune_drive; - - qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); - - return 1; - } else { - int i,j; - /* secondary enabled */ - printk(KERN_INFO "%s&%s: qd6580: dual IDE board\n", - ide_hwifs[0].name,ide_hwifs[1].name); - - for (i=0;i<2;i++) { - - ide_hwifs[i].chipset = ide_qd65xx; - ide_hwifs[i].mate = &ide_hwifs[i^1]; - ide_hwifs[i].channel = i; - - ide_hwifs[i].select_data = base; - ide_hwifs[i].config_data = config | (control <<8); - ide_hwifs[i].tuneproc = &qd6580_tune_drive; - - for (j=0;j<2;j++) { - ide_hwifs[i].drives[j].drive_data = - i?QD6580_DEF_DATA2:QD6580_DEF_DATA; - ide_hwifs[i].drives[j].io_32bit = 1; - } - } - - qd_write_reg(QD_DEF_CONTR,QD_CONTROL_PORT); - - return 0; /* no other qd65xx possible */ - } - } - /* no qd65xx found */ - return 1; -} - -/* - * init_qd65xx: - * - * called at the very beginning of initialization ; should just probe and link - */ - -void __init init_qd65xx (void) -{ - if (probe(0x30)) probe(0xb0); -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/qd65xx.h linux.20pre5-ac2/drivers/ide/qd65xx.h --- linux.20pre5/drivers/ide/qd65xx.h 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/qd65xx.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,140 +0,0 @@ -/* - * linux/drivers/ide/qd65xx.h - * - * Copyright (c) 2000 Linus Torvalds & authors - */ - -/* - * Authors: Petr Soucek - * Samuel Thibault - */ - -/* truncates a in [b,c] */ -#define IDE_IN(a,b,c) ( ((a)<(b)) ? (b) : ( (a)>(c) ? (c) : (a)) ) - -#define IDE_IMPLY(a,b) ((!(a)) || (b)) - -#define QD_TIM1_PORT (base) -#define QD_CONFIG_PORT (base+0x01) -#define QD_TIM2_PORT (base+0x02) -#define QD_CONTROL_PORT (base+0x03) - -#define QD_CONFIG_IDE_BASEPORT 0x01 -#define QD_CONFIG_BASEPORT 0x02 -#define QD_CONFIG_ID3 0x04 -#define QD_CONFIG_DISABLED 0x08 -#define QD_CONFIG_QD6500 0xc0 -#define QD_CONFIG_QD6580_A 0xa0 -#define QD_CONFIG_QD6580_B 0x50 - -#define QD_CONTR_SEC_DISABLED 0x01 - -#define QD_ID3 ((config & QD_CONFIG_ID3)!=0) - -#define QD_CONFIG(hwif) ((hwif)->config_data & 0x00ff) -#define QD_CONTROL(hwif) (((hwif)->config_data & 0xff00) >> 8) - -#define QD_TIMING(drive) (byte)(((drive)->drive_data) & 0x00ff) -#define QD_TIMREG(drive) (byte)((((drive)->drive_data) & 0xff00) >> 8) - -#define QD6500_DEF_DATA ((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0c : 0x08)) -#define QD6580_DEF_DATA ((QD_TIM1_PORT<<8) | (QD_ID3 ? 0x0a : 0x00)) -#define QD6580_DEF_DATA2 ((QD_TIM2_PORT<<8) | (QD_ID3 ? 0x0a : 0x00)) -#define QD_DEF_CONTR (0x40 | ((control & 0x02) ? 0x9f : 0x1f)) - -#define QD_TESTVAL 0x19 /* safe value */ - -/* Drive specific timing taken from DOS driver v3.7 */ - -struct qd65xx_timing_s { - char offset; /* ofset from the beginning of Model Number" */ - char model[4]; /* 4 chars from Model number, no conversion */ - short active; /* active time */ - short recovery; /* recovery time */ -} qd65xx_timing [] = { - { 30, "2040", 110, 225 }, /* Conner CP30204 */ - { 30, "2045", 135, 225 }, /* Conner CP30254 */ - { 30, "1040", 155, 325 }, /* Conner CP30104 */ - { 30, "1047", 135, 265 }, /* Conner CP30174 */ - { 30, "5344", 135, 225 }, /* Conner CP3544 */ - { 30, "01 4", 175, 405 }, /* Conner CP-3104 */ - { 27, "C030", 175, 375 }, /* Conner CP3000 */ - { 8, "PL42", 110, 295 }, /* Quantum LP240 */ - { 8, "PL21", 110, 315 }, /* Quantum LP120 */ - { 8, "PL25", 175, 385 }, /* Quantum LP52 */ - { 4, "PA24", 110, 285 }, /* WD Piranha SP4200 */ - { 6, "2200", 110, 260 }, /* WD Caviar AC2200 */ - { 6, "3204", 110, 235 }, /* WD Caviar AC2340 */ - { 6, "1202", 110, 265 }, /* WD Caviar AC2120 */ - { 0, "DS3-", 135, 315 }, /* Teac SD340 */ - { 8, "KM32", 175, 355 }, /* Toshiba MK234 */ - { 2, "53A1", 175, 355 }, /* Seagate ST351A */ - { 2, "4108", 175, 295 }, /* Seagate ST1480A */ - { 2, "1344", 175, 335 }, /* Seagate ST3144A */ - { 6, "7 12", 110, 225 }, /* Maxtor 7213A */ - { 30, "02F4", 145, 295 }, /* Conner 3204F */ - { 2, "1302", 175, 335 }, /* Seagate ST3120A */ - { 2, "2334", 145, 265 }, /* Seagate ST3243A */ - { 2, "2338", 145, 275 }, /* Seagate ST3283A */ - { 2, "3309", 145, 275 }, /* Seagate ST3390A */ - { 2, "5305", 145, 275 }, /* Seagate ST3550A */ - { 2, "4100", 175, 295 }, /* Seagate ST1400A */ - { 2, "4110", 175, 295 }, /* Seagate ST1401A */ - { 2, "6300", 135, 265 }, /* Seagate ST3600A */ - { 2, "5300", 135, 265 }, /* Seagate ST3500A */ - { 6, "7 31", 135, 225 }, /* Maxtor 7131 AT */ - { 6, "7 43", 115, 265 }, /* Maxtor 7345 AT */ - { 6, "7 42", 110, 255 }, /* Maxtor 7245 AT */ - { 6, "3 04", 135, 265 }, /* Maxtor 340 AT */ - { 6, "61 0", 135, 285 }, /* WD AC160 */ - { 6, "1107", 135, 235 }, /* WD AC1170 */ - { 6, "2101", 110, 220 }, /* WD AC1210 */ - { 6, "4202", 135, 245 }, /* WD AC2420 */ - { 6, "41 0", 175, 355 }, /* WD Caviar 140 */ - { 6, "82 0", 175, 355 }, /* WD Caviar 280 */ - { 8, "PL01", 175, 375 }, /* Quantum LP105 */ - { 8, "PL25", 110, 295 }, /* Quantum LP525 */ - { 10, "4S 2", 175, 385 }, /* Quantum ELS42 */ - { 10, "8S 5", 175, 385 }, /* Quantum ELS85 */ - { 10, "1S72", 175, 385 }, /* Quantum ELS127 */ - { 10, "1S07", 175, 385 }, /* Quantum ELS170 */ - { 8, "ZE42", 135, 295 }, /* Quantum EZ240 */ - { 8, "ZE21", 175, 385 }, /* Quantum EZ127 */ - { 8, "ZE58", 175, 385 }, /* Quantum EZ85 */ - { 8, "ZE24", 175, 385 }, /* Quantum EZ42 */ - { 27, "C036", 155, 325 }, /* Conner CP30064 */ - { 27, "C038", 155, 325 }, /* Conner CP30084 */ - { 6, "2205", 110, 255 }, /* WDC AC2250 */ - { 2, " CHA", 140, 415 }, /* WDC AH series; WDC AH260, WDC */ - { 2, " CLA", 140, 415 }, /* WDC AL series: WDC AL2120, 2170, */ - { 4, "UC41", 140, 415 }, /* WDC CU140 */ - { 6, "1207", 130, 275 }, /* WDC AC2170 */ - { 6, "2107", 130, 275 }, /* WDC AC1270 */ - { 6, "5204", 130, 275 }, /* WDC AC2540 */ - { 30, "3004", 110, 235 }, /* Conner CP30340 */ - { 30, "0345", 135, 255 }, /* Conner CP30544 */ - { 12, "12A3", 175, 320 }, /* MAXTOR LXT-213A */ - { 12, "43A0", 145, 240 }, /* MAXTOR LXT-340A */ - { 6, "7 21", 180, 290 }, /* Maxtor 7120 AT */ - { 6, "7 71", 135, 240 }, /* Maxtor 7170 AT */ - { 12, "45\0000", 110, 205 }, /* MAXTOR MXT-540 */ - { 8, "PL11", 180, 290 }, /* QUANTUM LP110A */ - { 8, "OG21", 150, 275 }, /* QUANTUM GO120 */ - { 12, "42A5", 175, 320 }, /* MAXTOR LXT-245A */ - { 2, "2309", 175, 295 }, /* ST3290A */ - { 2, "3358", 180, 310 }, /* ST3385A */ - { 2, "6355", 180, 310 }, /* ST3655A */ - { 2, "1900", 175, 270 }, /* ST9100A */ - { 2, "1954", 175, 270 }, /* ST9145A */ - { 2, "1909", 175, 270 }, /* ST9190AG */ - { 2, "2953", 175, 270 }, /* ST9235A */ - { 2, "1359", 175, 270 }, /* ST3195A */ - { 24, "3R11", 175, 290 }, /* ALPS ELECTRIC Co.,LTD, DR311C */ - { 0, "2M26", 175, 215 }, /* M262XT-0Ah */ - { 4, "2253", 175, 300 }, /* HP C2235A */ - { 4, "-32A", 145, 245 }, /* H3133-A2 */ - { 30, "0326", 150, 270 }, /* Samsung Electronics 120MB */ - { 30, "3044", 110, 195 }, /* Conner CFA340A */ - { 30, "43A0", 110, 195 }, /* Conner CFA340A */ - { -1, " ", 175, 415 } /* unknown disk name */ -}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/raid/ataraid.c linux.20pre5-ac2/drivers/ide/raid/ataraid.c --- linux.20pre5/drivers/ide/raid/ataraid.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/raid/ataraid.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,317 @@ +/* + ataraid.c Copyright (C) 2001 Red Hat, Inc. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + You should have received a copy of the GNU General Public License + (for example /usr/src/linux/COPYING); if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Authors: Arjan van de Ven + + +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "ataraid.h" + + +static int ataraid_hardsect_size[256]; +static int ataraid_blksize_size[256]; + +static struct raid_device_operations* ataraid_ops[16]; + +static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); +static int ataraid_open(struct inode * inode, struct file * filp); +static int ataraid_release(struct inode * inode, struct file * filp); +static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head * bh); + + +struct gendisk ataraid_gendisk; +static int ataraid_gendisk_sizes[256]; +static int ataraid_readahead[256]; + +static struct block_device_operations ataraid_fops = { + owner: THIS_MODULE, + open: ataraid_open, + release: ataraid_release, + ioctl: ataraid_ioctl, +}; + + + +static DECLARE_MUTEX(ataraid_sem); + +/* Bitmap for the devices currently in use */ +static unsigned int ataraiduse; + + +/* stub fops functions */ + +static int ataraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +{ + int minor; + minor = MINOR(inode->i_rdev)>>SHIFT; + + if ((ataraid_ops[minor])&&(ataraid_ops[minor]->ioctl)) + return (ataraid_ops[minor]->ioctl)(inode,file,cmd,arg); + return -EINVAL; +} + +static int ataraid_open(struct inode * inode, struct file * filp) +{ + int minor; + minor = MINOR(inode->i_rdev)>>SHIFT; + + if ((ataraid_ops[minor])&&(ataraid_ops[minor]->open)) + return (ataraid_ops[minor]->open)(inode,filp); + return -EINVAL; +} + + +static int ataraid_release(struct inode * inode, struct file * filp) +{ + int minor; + minor = MINOR(inode->i_rdev)>>SHIFT; + + if ((ataraid_ops[minor])&&(ataraid_ops[minor]->release)) + return (ataraid_ops[minor]->release)(inode,filp); + return -EINVAL; +} + +static int ataraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh) +{ + int minor; + int retval; + minor = MINOR(bh->b_rdev)>>SHIFT; + + if ((ataraid_ops[minor])&&(ataraid_ops[minor]->make_request)) { + + retval= (ataraid_ops[minor]->make_request)(q,rw,bh); + if (retval == -1) { + ataraid_split_request(q,rw,bh); + return 0; + } else + return retval; + } + return -EINVAL; +} + +struct buffer_head *ataraid_get_bhead(void) +{ + void *ptr = NULL; + while (!ptr) { + ptr=kmalloc(sizeof(struct buffer_head),GFP_NOIO); + if (!ptr) { + __set_current_state(TASK_RUNNING); + yield(); + } + } + return ptr; +} + +EXPORT_SYMBOL(ataraid_get_bhead); + +struct ataraid_bh_private *ataraid_get_private(void) +{ + void *ptr = NULL; + while (!ptr) { + ptr=kmalloc(sizeof(struct ataraid_bh_private),GFP_NOIO); + if (!ptr) { + __set_current_state(TASK_RUNNING); + yield(); + } + } + return ptr; +} + +EXPORT_SYMBOL(ataraid_get_private); + +void ataraid_end_request(struct buffer_head *bh, int uptodate) +{ + struct ataraid_bh_private *private = bh->b_private; + + if (private==NULL) + BUG(); + + if (atomic_dec_and_test(&private->count)) { + private->parent->b_end_io(private->parent,uptodate); + private->parent = NULL; + kfree(private); + } + kfree(bh); +} + +EXPORT_SYMBOL(ataraid_end_request); + +static void ataraid_split_request(request_queue_t *q, int rw, struct buffer_head * bh) +{ + struct buffer_head *bh1,*bh2; + struct ataraid_bh_private *private; + bh1=ataraid_get_bhead(); + bh2=ataraid_get_bhead(); + + /* If either of those ever fails we're doomed */ + if ((!bh1)||(!bh2)) + BUG(); + private = ataraid_get_private(); + if (private==NULL) + BUG(); + + memcpy(bh1, bh, sizeof(*bh)); + memcpy(bh2, bh, sizeof(*bh)); + + bh1->b_end_io = ataraid_end_request; + bh2->b_end_io = ataraid_end_request; + + bh2->b_rsector += bh->b_size >> 10; + bh1->b_size /= 2; + bh2->b_size /= 2; + private->parent = bh; + + bh1->b_private = private; + bh2->b_private = private; + atomic_set(&private->count,2); + + bh2->b_data += bh->b_size/2; + + generic_make_request(rw,bh1); + generic_make_request(rw,bh2); +} + + + + +/* device register / release functions */ + + +int ataraid_get_device(struct raid_device_operations *fops) +{ + int bit; + down(&ataraid_sem); + if (ataraiduse==~0U) { + up(&ataraid_sem); + return -ENODEV; + } + bit=ffz(ataraiduse); + ataraiduse |= 1< + + +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define ATAMAJOR 114 +#define SHIFT 4 +#define MINOR_MASK 15 +#define MAJOR_MASK 15 + + +/* raid_device_operations is a light struct block_device_operations with an + added method for make_request */ +struct raid_device_operations { + int (*open) (struct inode *, struct file *); + int (*release) (struct inode *, struct file *); + int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long); + int (*make_request) (request_queue_t *q, int rw, struct buffer_head * bh); +}; + + +struct geom { + unsigned char heads; + unsigned int cylinders; + unsigned char sectors; +}; + +/* structure for the splitting of bufferheads */ + +struct ataraid_bh_private { + struct buffer_head *parent; + atomic_t count; +}; + +extern struct gendisk ataraid_gendisk; + +extern int ataraid_get_device(struct raid_device_operations *fops); +extern void ataraid_release_device(int device); +extern int get_blocksize(kdev_t dev); +extern void ataraid_register_disk(int device,long size); +extern struct buffer_head *ataraid_get_bhead(void); +extern struct ataraid_bh_private *ataraid_get_private(void); +extern void ataraid_end_request(struct buffer_head *bh, int uptodate); + + + + + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/raid/hptraid.c linux.20pre5-ac2/drivers/ide/raid/hptraid.c --- linux.20pre5/drivers/ide/raid/hptraid.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/raid/hptraid.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,436 @@ +/* + hptraid.c Copyright (C) 2001 Red Hat, Inc. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + You should have received a copy of the GNU General Public License + (for example /usr/src/linux/COPYING); if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Authors: Arjan van de Ven + + Based on work + Copyleft (C) 2001 by Wilfried Weissmann + Copyright (C) 1994-96 Marc ZYNGIER + Based on work done by Søren Schmidt for FreeBSD + + +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "ataraid.h" + +static int hptraid_open(struct inode * inode, struct file * filp); +static int hptraid_release(struct inode * inode, struct file * filp); +static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); +static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh); + + + +struct hptdisk { + kdev_t device; + unsigned long sectors; + struct block_device *bdev; +}; + +struct hptraid { + unsigned int stride; + unsigned int disks; + unsigned long sectors; + struct geom geom; + + struct hptdisk disk[8]; + + unsigned long cutoff[8]; + unsigned int cutoff_disks[8]; +}; + +static struct raid_device_operations hptraid_ops = { + open: hptraid_open, + release: hptraid_release, + ioctl: hptraid_ioctl, + make_request: hptraid_make_request +}; + +static struct hptraid raid[16]; + +static int hptraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +{ + unsigned int minor; + unsigned char val; + unsigned long sectors; + + if (!inode || !inode->i_rdev) + return -EINVAL; + + minor = MINOR(inode->i_rdev)>>SHIFT; + + switch (cmd) { + case BLKGETSIZE: /* Return device size */ + if (!arg) return -EINVAL; + sectors = ataraid_gendisk.part[MINOR(inode->i_rdev)].nr_sects; + if (MINOR(inode->i_rdev)&15) + return put_user(sectors, (unsigned long *) arg); + return put_user(raid[minor].sectors , (unsigned long *) arg); + break; + + + case HDIO_GETGEO: + { + struct hd_geometry *loc = (struct hd_geometry *) arg; + unsigned short bios_cyl; + + if (!loc) return -EINVAL; + val = 255; + if (put_user(val, (byte *) &loc->heads)) return -EFAULT; + val=63; + if (put_user(val, (byte *) &loc->sectors)) return -EFAULT; + bios_cyl = raid[minor].sectors/63/255; + if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT; + if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect, + (unsigned long *) &loc->start)) return -EFAULT; + return 0; + } + + case HDIO_GETGEO_BIG: + { + struct hd_big_geometry *loc = (struct hd_big_geometry *) arg; + unsigned int bios_cyl; + if (!loc) return -EINVAL; + val = 255; + if (put_user(val, (byte *) &loc->heads)) return -EFAULT; + val = 63; + if (put_user(val, (byte *) &loc->sectors)) return -EFAULT; + bios_cyl = raid[minor].sectors/63/255; + if (put_user(bios_cyl, (unsigned int *) &loc->cylinders)) return -EFAULT; + if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect, + (unsigned long *) &loc->start)) return -EFAULT; + return 0; + } + + default: + return blk_ioctl(inode->i_rdev, cmd, arg); + }; + + return 0; +} + + +static int hptraid_make_request (request_queue_t *q, int rw, struct buffer_head * bh) +{ + unsigned long rsect; + unsigned long rsect_left,rsect_accum = 0; + unsigned long block; + unsigned int disk=0,real_disk=0; + int i; + int device; + struct hptraid *thisraid; + + rsect = bh->b_rsector; + + /* Ok. We need to modify this sector number to a new disk + new sector number. + * If there are disks of different sizes, this gets tricky. + * Example with 3 disks (1Gb, 4Gb and 5 GB): + * The first 3 Gb of the "RAID" are evenly spread over the 3 disks. + * Then things get interesting. The next 2Gb (RAID view) are spread across disk 2 and 3 + * and the last 1Gb is disk 3 only. + * + * the way this is solved is like this: We have a list of "cutoff" points where everytime + * a disk falls out of the "higher" count, we mark the max sector. So once we pass a cutoff + * point, we have to divide by one less. + */ + + device = (bh->b_rdev >> SHIFT)&MAJOR_MASK; + thisraid = &raid[device]; + if (thisraid->stride==0) + thisraid->stride=1; + + /* Partitions need adding of the start sector of the partition to the requested sector */ + + rsect += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; + + /* Woops we need to split the request to avoid crossing a stride barrier */ + if ((rsect/thisraid->stride) != ((rsect+(bh->b_size/512)-1)/thisraid->stride)) { + return -1; + } + + rsect_left = rsect; + + for (i=0;i<8;i++) { + if (thisraid->cutoff_disks[i]==0) + break; + if (rsect > thisraid->cutoff[i]) { + /* we're in the wrong area so far */ + rsect_left -= thisraid->cutoff[i]; + rsect_accum += thisraid->cutoff[i]/thisraid->cutoff_disks[i]; + } else { + block = rsect_left / thisraid->stride; + disk = block % thisraid->cutoff_disks[i]; + block = (block / thisraid->cutoff_disks[i]) * thisraid->stride; + rsect = rsect_accum + (rsect_left % thisraid->stride) + block; + break; + } + } + + for (i=0;i<8;i++) { + if ((disk==0) && (thisraid->disk[i].sectors > rsect_accum)) { + real_disk = i; + break; + } + if ((disk>0) && (thisraid->disk[i].sectors >= rsect_accum)) { + disk--; + } + + } + disk = real_disk; + + /* All but the first disk have a 10 sector offset */ + if (i>0) + rsect+=10; + + + /* + * The new BH_Lock semantics in ll_rw_blk.c guarantee that this + * is the only IO operation happening on this bh. + */ + + bh->b_rdev = thisraid->disk[disk].device; + bh->b_rsector = rsect; + + /* + * Let the main block layer submit the IO and resolve recursion: + */ + return 1; +} + + +#include "hptraid.h" + +static int read_disk_sb (int major, int minor, unsigned char *buffer,int bufsize) +{ + int ret = -EINVAL; + struct buffer_head *bh = NULL; + kdev_t dev = MKDEV(major,minor); + + if (blksize_size[major]==NULL) /* device doesn't exist */ + return -EINVAL; + + + /* Superblock is at 4096+412 bytes */ + set_blocksize (dev, 4096); + bh = bread (dev, 1, 4096); + + + if (bh) { + memcpy (buffer, bh->b_data, bufsize); + } else { + printk(KERN_ERR "hptraid: Error reading superblock.\n"); + goto abort; + } + ret = 0; +abort: + if (bh) + brelse (bh); + return ret; +} + +static unsigned long maxsectors (int major,int minor) +{ + unsigned long lba = 0; + kdev_t dev; + ide_drive_t *ideinfo; + + dev = MKDEV(major,minor); + ideinfo = get_info_ptr (dev); + if (ideinfo==NULL) + return 0; + + + /* first sector of the last cluster */ + if (ideinfo->head==0) + return 0; + if (ideinfo->sect==0) + return 0; + lba = (ideinfo->capacity); + + return lba; +} + +static void __init probedisk(int major, int minor,int device) +{ + int i; + struct highpoint_raid_conf *prom; + static unsigned char block[4096]; + struct block_device *bdev; + + if (maxsectors(major,minor)==0) + return; + + if (read_disk_sb(major,minor,(unsigned char*)&block,sizeof(block))) + return; + + prom = (struct highpoint_raid_conf*)&block[512]; + + if (prom->magic!= 0x5a7816f0) + return; + if (prom->type) { + printk(KERN_INFO "hptraid: only RAID0 is supported currently\n"); + return; + } + + i = prom->disk_number; + if (i<0) + return; + if (i>8) + return; + + bdev = bdget(MKDEV(major,minor)); + if (bdev && blkdev_get(bdev,FMODE_READ|FMODE_WRITE,0,BDEV_RAW) == 0) { + int j=0; + struct gendisk *gd; + raid[device].disk[i].bdev = bdev; + /* This is supposed to prevent others from stealing our underlying disks */ + /* now blank the /proc/partitions table for the wrong partition table, + so that scripts don't accidentally mount it and crash the kernel */ + /* XXX: the 0 is an utter hack --hch */ + gd=get_gendisk(MKDEV(major, 0)); + if (gd!=NULL) { + for (j=1+(minor<minor_shift);j<((minor+1)<minor_shift);j++) + gd->part[j].nr_sects=0; + } + } + raid[device].disk[i].device = MKDEV(major,minor); + raid[device].disk[i].sectors = maxsectors(major,minor); + raid[device].stride = (1<raid0_shift); + raid[device].disks = prom->raid_disks; + raid[device].sectors = prom->total_secs; + +} + +static void __init fill_cutoff(int device) +{ + int i,j; + unsigned long smallest; + unsigned long bar; + int count; + + bar = 0; + for (i=0;i<8;i++) { + smallest = ~0; + for (j=0;j<8;j++) + if ((raid[device].disk[j].sectors < smallest) && (raid[device].disk[j].sectors>bar)) + smallest = raid[device].disk[j].sectors; + count = 0; + for (j=0;j<8;j++) + if (raid[device].disk[j].sectors >= smallest) + count++; + + smallest = smallest * count; + bar = smallest; + raid[device].cutoff[i] = smallest; + raid[device].cutoff_disks[i] = count; + + } +} + + +static __init int hptraid_init_one(int device) +{ + int i,count; + + probedisk(IDE0_MAJOR, 0, device); + probedisk(IDE0_MAJOR, 64, device); + probedisk(IDE1_MAJOR, 0, device); + probedisk(IDE1_MAJOR, 64, device); + probedisk(IDE2_MAJOR, 0, device); + probedisk(IDE2_MAJOR, 64, device); + probedisk(IDE3_MAJOR, 0, device); + probedisk(IDE3_MAJOR, 64, device); + probedisk(IDE4_MAJOR, 0, device); + probedisk(IDE4_MAJOR, 64, device); + probedisk(IDE5_MAJOR, 0, device); + probedisk(IDE5_MAJOR, 64, device); + + fill_cutoff(device); + + /* Initialize the gendisk structure */ + + ataraid_register_disk(device,raid[device].sectors); + + count=0; + printk(KERN_INFO "Highpoint HPT370 Softwareraid driver for linux version 0.01\n"); + + for (i=0;i<8;i++) { + if (raid[device].disk[i].device!=0) { + printk(KERN_INFO "Drive %i is %li Mb \n", + i,raid[device].disk[i].sectors/2048); + count++; + } + } + if (count) { + printk(KERN_INFO "Raid array consists of %i drives. \n",count); + return 0; + } else { + printk(KERN_INFO "No raid array found\n"); + return -ENODEV; + } + +} + +static __init int hptraid_init(void) +{ + int retval,device; + + device=ataraid_get_device(&hptraid_ops); + if (device<0) + return -ENODEV; + retval = hptraid_init_one(device); + if (retval) + ataraid_release_device(device); + return retval; +} + +static void __exit hptraid_exit (void) +{ + int i,device; + for (device = 0; device<16; device++) { + for (i=0;i<8;i++) { + struct block_device *bdev = raid[device].disk[i].bdev; + raid[device].disk[i].bdev = NULL; + if (bdev) + blkdev_put(bdev, BDEV_RAW); + } + if (raid[device].sectors) + ataraid_release_device(device); + } +} + +static int hptraid_open(struct inode * inode, struct file * filp) +{ + MOD_INC_USE_COUNT; + return 0; +} +static int hptraid_release(struct inode * inode, struct file * filp) +{ + MOD_DEC_USE_COUNT; + return 0; +} + +module_init(hptraid_init); +module_exit(hptraid_exit); +MODULE_LICENSE("GPL"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/raid/hptraid.h linux.20pre5-ac2/drivers/ide/raid/hptraid.h --- linux.20pre5/drivers/ide/raid/hptraid.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/raid/hptraid.h 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 2000,2001 Søren Schmidt + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification, immediately at the beginning of the file. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR `AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +struct highpoint_raid_conf +{ + int8_t filler1[32]; + u_int32_t magic; +#define HPT_MAGIC_OK 0x5a7816f0 +#define HPT_MAGIC_BAD 0x5a7816fd + + u_int32_t magic_0; + u_int32_t magic_1; + u_int32_t order; +#define HPT_O_MIRROR 0x01 +#define HPT_O_STRIPE 0x02 +#define HPT_O_OK 0x04 + + u_int8_t raid_disks; + u_int8_t raid0_shift; + u_int8_t type; +#define HPT_T_RAID_0 0x00 +#define HPT_T_RAID_1 0x01 +#define HPT_T_RAID_01_RAID_0 0x02 +#define HPT_T_SPAN 0x03 +#define HPT_T_RAID_3 0x04 +#define HPT_T_RAID_5 0x05 +#define HPT_T_SINGLEDISK 0x06 +#define HPT_T_RAID_01_RAID_1 0x07 + + u_int8_t disk_number; + u_int32_t total_secs; + u_int32_t disk_mode; + u_int32_t boot_mode; + u_int8_t boot_disk; + u_int8_t boot_protect; + u_int8_t error_log_entries; + u_int8_t error_log_index; + struct + { + u_int32_t timestamp; + u_int8_t reason; +#define HPT_R_REMOVED 0xfe +#define HPT_R_BROKEN 0xff + + u_int8_t disk; + u_int8_t status; + u_int8_t sectors; + u_int32_t lba; + } errorlog[32]; + u_int8_t filler[60]; +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/raid/Makefile linux.20pre5-ac2/drivers/ide/raid/Makefile --- linux.20pre5/drivers/ide/raid/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/raid/Makefile 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,18 @@ + +O_TARGET := idedriver-raid.o + +obj-y := +obj-m := + +export-objs := ataraid.o + +# The virtualised raid layers MUST come after the ide itself or bad stuff +# will happen. + +obj-$(CONFIG_BLK_DEV_ATARAID) += ataraid.o +obj-$(CONFIG_BLK_DEV_ATARAID_PDC) += pdcraid.o +obj-$(CONFIG_BLK_DEV_ATARAID_HPT) += hptraid.o + +EXTRA_CFLAGS := -I../ + +include $(TOPDIR)/Rules.make diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/raid/pdcraid.c linux.20pre5-ac2/drivers/ide/raid/pdcraid.c --- linux.20pre5/drivers/ide/raid/pdcraid.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/raid/pdcraid.c 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,646 @@ +/* + pdcraid.c Copyright (C) 2001 Red Hat, Inc. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + You should have received a copy of the GNU General Public License + (for example /usr/src/linux/COPYING); if not, write to the Free + Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + + Authors: Arjan van de Ven + + Based on work done by Søren Schmidt for FreeBSD + +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "ataraid.h" + +static int pdcraid_open(struct inode * inode, struct file * filp); +static int pdcraid_release(struct inode * inode, struct file * filp); +static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); +static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head * bh); +static int pdcraid1_make_request (request_queue_t *q, int rw, struct buffer_head * bh); + +struct disk_dev { + int major; + int minor; + int device; +}; + +static struct disk_dev devlist[]= { + {IDE0_MAJOR, 0, -1 }, + {IDE0_MAJOR, 64, -1 }, + {IDE1_MAJOR, 0, -1 }, + {IDE1_MAJOR, 64, -1 }, + {IDE2_MAJOR, 0, -1 }, + {IDE2_MAJOR, 64, -1 }, + {IDE3_MAJOR, 0, -1 }, + {IDE3_MAJOR, 64, -1 }, + {IDE4_MAJOR, 0, -1 }, + {IDE4_MAJOR, 64, -1 }, + {IDE5_MAJOR, 0, -1 }, + {IDE5_MAJOR, 64, -1 }, + {IDE6_MAJOR, 0, -1 }, + {IDE6_MAJOR, 64, -1 }, +}; + + +struct pdcdisk { + kdev_t device; + unsigned long sectors; + struct block_device *bdev; + unsigned long last_pos; +}; + +struct pdcraid { + unsigned int stride; + unsigned int disks; + unsigned long sectors; + struct geom geom; + + struct pdcdisk disk[8]; + + unsigned long cutoff[8]; + unsigned int cutoff_disks[8]; +}; + +static struct raid_device_operations pdcraid0_ops = { + open: pdcraid_open, + release: pdcraid_release, + ioctl: pdcraid_ioctl, + make_request: pdcraid0_make_request +}; + +static struct raid_device_operations pdcraid1_ops = { + open: pdcraid_open, + release: pdcraid_release, + ioctl: pdcraid_ioctl, + make_request: pdcraid1_make_request +}; + +static struct pdcraid raid[16]; + + +static int pdcraid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +{ + unsigned int minor; + unsigned long sectors; + + if (!inode || !inode->i_rdev) + return -EINVAL; + + minor = MINOR(inode->i_rdev)>>SHIFT; + + switch (cmd) { + + case BLKGETSIZE: /* Return device size */ + if (!arg) return -EINVAL; + sectors = ataraid_gendisk.part[MINOR(inode->i_rdev)].nr_sects; + if (MINOR(inode->i_rdev)&15) + return put_user(sectors, (unsigned long *) arg); + return put_user(raid[minor].sectors , (unsigned long *) arg); + break; + + + case HDIO_GETGEO: + { + struct hd_geometry *loc = (struct hd_geometry *) arg; + unsigned short bios_cyl = raid[minor].geom.cylinders; /* truncate */ + + if (!loc) return -EINVAL; + if (put_user(raid[minor].geom.heads, (byte *) &loc->heads)) return -EFAULT; + if (put_user(raid[minor].geom.sectors, (byte *) &loc->sectors)) return -EFAULT; + if (put_user(bios_cyl, (unsigned short *) &loc->cylinders)) return -EFAULT; + if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect, + (unsigned long *) &loc->start)) return -EFAULT; + return 0; + } + + case HDIO_GETGEO_BIG: + { + struct hd_big_geometry *loc = (struct hd_big_geometry *) arg; + if (!loc) return -EINVAL; + if (put_user(raid[minor].geom.heads, (byte *) &loc->heads)) return -EFAULT; + if (put_user(raid[minor].geom.sectors, (byte *) &loc->sectors)) return -EFAULT; + if (put_user(raid[minor].geom.cylinders, (unsigned int *) &loc->cylinders)) return -EFAULT; + if (put_user((unsigned)ataraid_gendisk.part[MINOR(inode->i_rdev)].start_sect, + (unsigned long *) &loc->start)) return -EFAULT; + return 0; + } + + + case BLKROSET: + case BLKROGET: + case BLKSSZGET: + return blk_ioctl(inode->i_rdev, cmd, arg); + + default: + printk("Invalid ioctl \n"); + return -EINVAL; + }; + + return 0; +} + + +unsigned long partition_map_normal(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride) +{ + return block + partition_off; +} + +unsigned long partition_map_linux(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride) +{ + unsigned long newblock; + + newblock = stride - (partition_off%stride); if (newblock == stride) newblock = 0; + newblock += block; + newblock = newblock % partition_size; + newblock += partition_off; + + return newblock; +} + +static int funky_remap[8] = { 0, 1, 2, 3, 4, 5, 6, 7 }; + +unsigned long partition_map_linux_raid0_4disk(unsigned long block, unsigned long partition_off, unsigned long partition_size, int stride) +{ + unsigned long newblock,temp,temp2; + + newblock = stride - (partition_off%stride); if (newblock == stride) newblock = 0; + + if (block < (partition_size / (8*stride))*8*stride ) { + temp = block % stride; + temp2 = block / stride; + temp2 = ((temp2>>3)<<3)|(funky_remap[temp2&7]); + block = temp2*stride+temp; + } + + + newblock += block; + newblock = newblock % partition_size; + newblock += partition_off; + + return newblock; +} + + + +static int pdcraid0_make_request (request_queue_t *q, int rw, struct buffer_head * bh) +{ + unsigned long rsect; + unsigned long rsect_left,rsect_accum = 0; + unsigned long block; + unsigned int disk=0,real_disk=0; + int i; + int device; + struct pdcraid *thisraid; + + rsect = bh->b_rsector; + + /* Ok. We need to modify this sector number to a new disk + new sector number. + * If there are disks of different sizes, this gets tricky. + * Example with 3 disks (1Gb, 4Gb and 5 GB): + * The first 3 Gb of the "RAID" are evenly spread over the 3 disks. + * Then things get interesting. The next 2Gb (RAID view) are spread across disk 2 and 3 + * and the last 1Gb is disk 3 only. + * + * the way this is solved is like this: We have a list of "cutoff" points where everytime + * a disk falls out of the "higher" count, we mark the max sector. So once we pass a cutoff + * point, we have to divide by one less. + */ + + device = (bh->b_rdev >> SHIFT)&MAJOR_MASK; + thisraid = &raid[device]; + if (thisraid->stride==0) + thisraid->stride=1; + + /* Partitions need adding of the start sector of the partition to the requested sector */ + + rsect = partition_map_normal(rsect, ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect, ataraid_gendisk.part[MINOR(bh->b_rdev)].nr_sects, thisraid->stride); + + /* Woops we need to split the request to avoid crossing a stride barrier */ + if ((rsect/thisraid->stride) != ((rsect+(bh->b_size/512)-1)/thisraid->stride)) { + return -1; + } + + rsect_left = rsect; + + for (i=0;i<8;i++) { + if (thisraid->cutoff_disks[i]==0) + break; + if (rsect > thisraid->cutoff[i]) { + /* we're in the wrong area so far */ + rsect_left -= thisraid->cutoff[i]; + rsect_accum += thisraid->cutoff[i]/thisraid->cutoff_disks[i]; + } else { + block = rsect_left / thisraid->stride; + disk = block % thisraid->cutoff_disks[i]; + block = (block / thisraid->cutoff_disks[i]) * thisraid->stride; + rsect = rsect_accum + (rsect_left % thisraid->stride) + block; + break; + } + } + + for (i=0;i<8;i++) { + if ((disk==0) && (thisraid->disk[i].sectors > rsect_accum)) { + real_disk = i; + break; + } + if ((disk>0) && (thisraid->disk[i].sectors >= rsect_accum)) { + disk--; + } + + } + disk = real_disk; + + + /* + * The new BH_Lock semantics in ll_rw_blk.c guarantee that this + * is the only IO operation happening on this bh. + */ + bh->b_rdev = thisraid->disk[disk].device; + bh->b_rsector = rsect; + + /* + * Let the main block layer submit the IO and resolve recursion: + */ + return 1; +} + +static int pdcraid1_write_request(request_queue_t *q, int rw, struct buffer_head * bh) +{ + struct buffer_head *bh1; + struct ataraid_bh_private *private; + int device; + int i; + + device = (bh->b_rdev >> SHIFT)&MAJOR_MASK; + private = ataraid_get_private(); + if (private==NULL) + BUG(); + + private->parent = bh; + + atomic_set(&private->count,raid[device].disks); + + + for (i = 0; i< raid[device].disks; i++) { + bh1=ataraid_get_bhead(); + /* If this ever fails we're doomed */ + if (!bh1) + BUG(); + + /* dupe the bufferhead and update the parts that need to be different */ + memcpy(bh1, bh, sizeof(*bh)); + + bh1->b_end_io = ataraid_end_request; + bh1->b_private = private; + bh1->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; /* partition offset */ + bh1->b_rdev = raid[device].disk[i].device; + + /* update the last known head position for the drive */ + raid[device].disk[i].last_pos = bh1->b_rsector+(bh1->b_size>>9); + + generic_make_request(rw,bh1); + } + return 0; +} + +static int pdcraid1_read_request (request_queue_t *q, int rw, struct buffer_head * bh) +{ + int device; + int dist; + int bestsofar,bestdist,i; + static int previous; + + /* Reads are simple in principle. Pick a disk and go. + Initially I cheat by just picking the one which the last known + head position is closest by. + Later on, online/offline checking and performance needs adding */ + + device = (bh->b_rdev >> SHIFT)&MAJOR_MASK; + bh->b_rsector += ataraid_gendisk.part[MINOR(bh->b_rdev)].start_sect; + + bestsofar = 0; + bestdist = raid[device].disk[0].last_pos - bh->b_rsector; + if (bestdist<0) + bestdist=-bestdist; + if (bestdist>4095) + bestdist=4095; + + for (i=1 ; ib_rsector; + if (dist<0) + dist = -dist; + if (dist>4095) + dist=4095; + + if (bestdist==dist) { /* it's a tie; try to do some read balancing */ + if ((previous>bestsofar)&&(previous<=i)) + bestsofar = i; + previous = (previous + 1) % raid[device].disks; + } else if (bestdist>dist) { + bestdist = dist; + bestsofar = i; + } + + } + + bh->b_rdev = raid[device].disk[bestsofar].device; + raid[device].disk[bestsofar].last_pos = bh->b_rsector+(bh->b_size>>9); + + /* + * Let the main block layer submit the IO and resolve recursion: + */ + + return 1; +} + + +static int pdcraid1_make_request (request_queue_t *q, int rw, struct buffer_head * bh) +{ + /* Read and Write are totally different cases; split them totally here */ + if (rw==READA) + rw = READ; + + if (rw==READ) + return pdcraid1_read_request(q,rw,bh); + else + return pdcraid1_write_request(q,rw,bh); +} + +#include "pdcraid.h" + +static unsigned long calc_pdcblock_offset (int major,int minor) +{ + unsigned long lba = 0; + kdev_t dev; + ide_drive_t *ideinfo; + + dev = MKDEV(major,minor); + ideinfo = get_info_ptr (dev); + if (ideinfo==NULL) + return 0; + + + /* first sector of the last cluster */ + if (ideinfo->head==0) + return 0; + if (ideinfo->sect==0) + return 0; + lba = (ideinfo->capacity / (ideinfo->head*ideinfo->sect)); + lba = lba * (ideinfo->head*ideinfo->sect); + lba = lba - ideinfo->sect; + + return lba; +} + + +static int read_disk_sb (int major, int minor, unsigned char *buffer,int bufsize) +{ + int ret = -EINVAL; + struct buffer_head *bh = NULL; + kdev_t dev = MKDEV(major,minor); + unsigned long sb_offset; + + if (blksize_size[major]==NULL) /* device doesn't exist */ + return -EINVAL; + + + /* + * Calculate the position of the superblock, + * it's at first sector of the last cylinder + */ + sb_offset = calc_pdcblock_offset(major,minor)/8; + /* The /8 transforms sectors into 4Kb blocks */ + + if (sb_offset==0) + return -1; + + set_blocksize (dev, 4096); + + bh = bread (dev, sb_offset, 4096); + + if (bh) { + memcpy (buffer, bh->b_data, bufsize); + } else { + printk(KERN_ERR "pdcraid: Error reading superblock.\n"); + goto abort; + } + ret = 0; +abort: + if (bh) + brelse (bh); + return ret; +} + +static unsigned int calc_sb_csum (unsigned int* ptr) +{ + unsigned int sum; + int count; + + sum = 0; + for (count=0;count<511;count++) + sum += *ptr++; + + return sum; +} + +static int cookie = 0; + +static void __init probedisk(int devindex,int device, int raidlevel) +{ + int i; + int major, minor; + struct promise_raid_conf *prom; + static unsigned char block[4096]; + struct block_device *bdev; + + if (devlist[devindex].device!=-1) /* already assigned to another array */ + return; + + major = devlist[devindex].major; + minor = devlist[devindex].minor; + + if (read_disk_sb(major,minor,(unsigned char*)&block,sizeof(block))) + return; + + prom = (struct promise_raid_conf*)&block[512]; + + /* the checksums must match */ + if (prom->checksum != calc_sb_csum((unsigned int*)prom)) + return; + if (prom->raid.type!=raidlevel) /* different raidlevel */ + return; + + if ((cookie!=0) && (cookie != prom->raid.magic_1)) /* different array */ + return; + + cookie = prom->raid.magic_1; + + /* This looks evil. But basically, we have to search for our adapternumber + in the arraydefinition, both of which are in the superblock */ + for (i=0;(iraid.total_disks)&&(i<8);i++) { + if ( (prom->raid.disk[i].channel== prom->raid.channel) && + (prom->raid.disk[i].device == prom->raid.device) ) { + + bdev = bdget(MKDEV(major,minor)); + if (bdev && blkdev_get(bdev, FMODE_READ|FMODE_WRITE, 0, BDEV_RAW) == 0) { + raid[device].disk[i].bdev = bdev; + } + raid[device].disk[i].device = MKDEV(major,minor); + raid[device].disk[i].sectors = prom->raid.disk_secs; + raid[device].stride = (1<raid.raid0_shift); + raid[device].disks = prom->raid.total_disks; + raid[device].sectors = prom->raid.total_secs; + raid[device].geom.heads = prom->raid.heads+1; + raid[device].geom.sectors = prom->raid.sectors; + raid[device].geom.cylinders = prom->raid.cylinders+1; + devlist[devindex].device=device; + } + } + +} + +static void __init fill_cutoff(int device) +{ + int i,j; + unsigned long smallest; + unsigned long bar; + int count; + + bar = 0; + for (i=0;i<8;i++) { + smallest = ~0; + for (j=0;j<8;j++) + if ((raid[device].disk[j].sectors < smallest) && (raid[device].disk[j].sectors>bar)) + smallest = raid[device].disk[j].sectors; + count = 0; + for (j=0;j<8;j++) + if (raid[device].disk[j].sectors >= smallest) + count++; + + smallest = smallest * count; + bar = smallest; + raid[device].cutoff[i] = smallest; + raid[device].cutoff_disks[i] = count; + } +} + +static __init int pdcraid_init_one(int device,int raidlevel) +{ + int i, count; + + for (i=0; i<14; i++) + probedisk(i, device, raidlevel); + + if (raidlevel==0) + fill_cutoff(device); + + /* Initialize the gendisk structure */ + + ataraid_register_disk(device,raid[device].sectors); + + count=0; + + for (i=0;i<8;i++) { + if (raid[device].disk[i].device!=0) { + printk(KERN_INFO "Drive %i is %li Mb (%i / %i) \n", + i,raid[device].disk[i].sectors/2048,MAJOR(raid[device].disk[i].device),MINOR(raid[device].disk[i].device)); + count++; + } + } + if (count) { + printk(KERN_INFO "Raid%i array consists of %i drives. \n",raidlevel,count); + return 0; + } else { + return -ENODEV; + } +} + +static __init int pdcraid_init(void) +{ + int retval, device, count = 0; + + do { + cookie = 0; + device=ataraid_get_device(&pdcraid0_ops); + if (device<0) + break; + retval = pdcraid_init_one(device,0); + if (retval) { + ataraid_release_device(device); + break; + } else { + count++; + } + } while (1); + + do { + + cookie = 0; + device=ataraid_get_device(&pdcraid1_ops); + if (device<0) + break; + retval = pdcraid_init_one(device,1); + if (retval) { + ataraid_release_device(device); + break; + } else { + count++; + } + } while (1); + + if (count) { + printk(KERN_INFO "Promise Fasttrak(tm) Softwareraid driver for linux version 0.03beta\n"); + return 0; + } + printk(KERN_DEBUG "Promise Fasttrak(tm) Softwareraid driver 0.03beta: No raid array found\n"); + return -ENODEV; +} + +static void __exit pdcraid_exit (void) +{ + int i,device; + for (device = 0; device<16; device++) { + for (i=0;i<8;i++) { + struct block_device *bdev = raid[device].disk[i].bdev; + raid[device].disk[i].bdev = NULL; + if (bdev) + blkdev_put(bdev, BDEV_RAW); + } + if (raid[device].sectors) + ataraid_release_device(device); + } +} + +static int pdcraid_open(struct inode * inode, struct file * filp) +{ + MOD_INC_USE_COUNT; + return 0; +} +static int pdcraid_release(struct inode * inode, struct file * filp) +{ + MOD_DEC_USE_COUNT; + return 0; +} + +module_init(pdcraid_init); +module_exit(pdcraid_exit); +MODULE_LICENSE("GPL"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/raid/pdcraid.h linux.20pre5-ac2/drivers/ide/raid/pdcraid.h --- linux.20pre5/drivers/ide/raid/pdcraid.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/raid/pdcraid.h 2002-08-29 23:47:56.000000000 +0100 @@ -0,0 +1,47 @@ +struct promise_raid_conf { + char promise_id[24]; + + u32 dummy_0; + u32 magic_0; + u32 dummy_1; + u32 magic_1; + u16 dummy_2; + u8 filler1[470]; + struct { + u32 flags; /* 0x200 */ + u8 dummy_0; + u8 disk_number; + u8 channel; + u8 device; + u32 magic_0; + u32 dummy_1; + u32 dummy_2; /* 0x210 */ + u32 disk_secs; + u32 dummy_3; + u16 dummy_4; + u8 status; + u8 type; + u8 total_disks; /* 0x220 */ + u8 raid0_shift; + u8 raid0_disks; + u8 array_number; + u32 total_secs; + u16 cylinders; + u8 heads; + u8 sectors; + u32 magic_1; + u32 dummy_5; /* 0x230 */ + struct { + u16 dummy_0; + u8 channel; + u8 device; + u32 magic_0; + u32 disk_number; + } disk[8]; + } raid; + u32 filler2[346]; + u32 checksum; +}; + +#define PR_MAGIC "Promise Technology, Inc." + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/rapide.c linux.20pre5-ac2/drivers/ide/rapide.c --- linux.20pre5/drivers/ide/rapide.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/rapide.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,94 +0,0 @@ -/* - * linux/drivers/ide/rapide.c - * - * Copyright (c) 1996-1998 Russell King. - * - * Changelog: - * 08-06-1996 RMK Created - * 13-04-1998 RMK Added manufacturer and product IDs - */ - -#include -#include -#include -#include -#include -#include - -#include - -static card_ids __init rapide_cids[] = { - { MANU_YELLOWSTONE, PROD_YELLOWSTONE_RAPIDE32 }, - { 0xffff, 0xffff } -}; - -static struct expansion_card *ec[MAX_ECARDS]; -static int result[MAX_ECARDS]; - -static inline int rapide_register(struct expansion_card *ec) -{ - unsigned long port = ecard_address (ec, ECARD_MEMC, 0); - hw_regs_t hw; - - int i; - - memset(&hw, 0, sizeof(hw)); - - for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { - hw.io_ports[i] = (ide_ioreg_t)port; - port += 1 << 4; - } - hw.io_ports[IDE_CONTROL_OFFSET] = port + 0x206; - hw.irq = ec->irq; - - return ide_register_hw(&hw, NULL); -} - -int __init rapide_init(void) -{ - int i; - - for (i = 0; i < MAX_ECARDS; i++) - ec[i] = NULL; - - ecard_startfind(); - - for (i = 0; ; i++) { - if ((ec[i] = ecard_find(0, rapide_cids)) == NULL) - break; - - ecard_claim(ec[i]); - result[i] = rapide_register(ec[i]); - } - for (i = 0; i < MAX_ECARDS; i++) - if (ec[i] && result[i] < 0) { - ecard_release(ec[i]); - ec[i] = NULL; - } - return 0; -} - -#ifdef MODULE -MODULE_LICENSE("GPL"); - -int init_module (void) -{ - return rapide_init(); -} - -void cleanup_module (void) -{ - int i; - - for (i = 0; i < MAX_ECARDS; i++) - if (ec[i]) { - unsigned long port; - port = ecard_address(ec[i], ECARD_MEMC, 0); - - ide_unregister_port(port, ec[i]->irq, 16); - ecard_release(ec[i]); - ec[i] = NULL; - } -} -#endif - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/rz1000.c linux.20pre5-ac2/drivers/ide/rz1000.c --- linux.20pre5/drivers/ide/rz1000.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/rz1000.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,97 +0,0 @@ -/* - * linux/drivers/ide/rz1000.c Version 0.05 December 8, 1997 - * - * Copyright (C) 1995-1998 Linus Torvalds & author (see below) - */ - -/* - * Principal Author: mlord@pobox.com (Mark Lord) - * - * See linux/MAINTAINERS for address of current maintainer. - * - * This file provides support for disabling the buggy read-ahead - * mode of the RZ1000 IDE chipset, commonly used on Intel motherboards. - * - * Dunno if this fixes both ports, or only the primary port (?). - */ - -#undef REALLY_SLOW_IO /* most systems can safely undef this */ - -#include /* for CONFIG_BLK_DEV_IDEPCI */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#ifdef CONFIG_BLK_DEV_IDEPCI - -void __init ide_init_rz1000 (ide_hwif_t *hwif) /* called from ide-pci.c */ -{ - unsigned short reg; - struct pci_dev *dev = hwif->pci_dev; - - hwif->chipset = ide_rz1000; - if (!pci_read_config_word (dev, 0x40, ®) - && !pci_write_config_word(dev, 0x40, reg & 0xdfff)) - { - printk("%s: disabled chipset read-ahead (buggy RZ1000/RZ1001)\n", hwif->name); - } else { - hwif->serialized = 1; - hwif->drives[0].no_unmask = 1; - hwif->drives[1].no_unmask = 1; - printk("%s: serialized, disabled unmasking (buggy RZ1000/RZ1001)\n", hwif->name); - } -} - -#else - -static void __init init_rz1000 (struct pci_dev *dev, const char *name) -{ - unsigned short reg, h; - - if (!pci_read_config_word (dev, PCI_COMMAND, ®) && !(reg & PCI_COMMAND_IO)) { - printk("%s: buggy IDE controller disabled (BIOS)\n", name); - return; - } - if (!pci_read_config_word (dev, 0x40, ®) - && !pci_write_config_word(dev, 0x40, reg & 0xdfff)) - { - printk("IDE: disabled chipset read-ahead (buggy %s)\n", name); - } else { - for (h = 0; h < MAX_HWIFS; ++h) { - ide_hwif_t *hwif = &ide_hwifs[h]; - if ((hwif->io_ports[IDE_DATA_OFFSET] == 0x1f0 || hwif->io_ports[IDE_DATA_OFFSET] == 0x170) - && (hwif->chipset == ide_unknown || hwif->chipset == ide_generic)) - { - hwif->chipset = ide_rz1000; - hwif->serialized = 1; - hwif->drives[0].no_unmask = 1; - hwif->drives[1].no_unmask = 1; - if (hwif->io_ports[IDE_DATA_OFFSET] == 0x170) - hwif->channel = 1; - printk("%s: serialized, disabled unmasking (buggy %s)\n", hwif->name, name); - } - } - } -} - -void __init ide_probe_for_rz100x (void) /* called from ide.c */ -{ - struct pci_dev *dev = NULL; - - while ((dev = pci_find_device(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000, dev))!=NULL) - init_rz1000 (dev, "RZ1000"); - while ((dev = pci_find_device(PCI_VENDOR_ID_PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001, dev))!=NULL) - init_rz1000 (dev, "RZ1001"); -} - -#endif /* CONFIG_BLK_DEV_IDEPCI */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/serverworks.c linux.20pre5-ac2/drivers/ide/serverworks.c --- linux.20pre5/drivers/ide/serverworks.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/serverworks.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,675 +0,0 @@ -/* - * linux/drivers/ide/serverworks.c Version 0.3 26 Oct 2001 - * - * May be copied or modified under the terms of the GNU General Public License - * - * Copyright (C) 1998-2000 Michel Aubry - * Copyright (C) 1998-2000 Andrzej Krzysztofowicz - * Copyright (C) 1998-2000 Andre Hedrick - * Portions copyright (c) 2001 Sun Microsystems - * - * - * RCC/ServerWorks IDE driver for Linux - * - * OSB4: `Open South Bridge' IDE Interface (fn 1) - * supports UDMA mode 2 (33 MB/s) - * - * CSB5: `Champion South Bridge' IDE Interface (fn 1) - * all revisions support UDMA mode 4 (66 MB/s) - * revision A2.0 and up support UDMA mode 5 (100 MB/s) - * - * *** The CSB5 does not provide ANY register *** - * *** to detect 80-conductor cable presence. *** - * - * - * here's the default lspci: - * - * 00:0f.1 IDE interface: ServerWorks: Unknown device 0211 (prog-if 8a [Master SecP PriP]) - * Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- - * Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- SERR- TAbort- SERR- -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "ide_modes.h" - -#define DISPLAY_SVWKS_TIMINGS 1 -#undef SVWKS_DEBUG_DRIVE_INFO - -#if defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static struct pci_dev *bmide_dev; -static byte svwks_revision = 0; - -static int svwks_get_info(char *, char **, off_t, int); -extern int (*svwks_display_info)(char *, char **, off_t, int); /* ide-proc.c */ -extern char *ide_media_verbose(ide_drive_t *); - -static int svwks_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - u32 bibma = pci_resource_start(bmide_dev, 4); - u32 reg40, reg44; - u16 reg48, reg56; - u8 reg54, c0=0, c1=0; - - pci_read_config_dword(bmide_dev, 0x40, ®40); - pci_read_config_dword(bmide_dev, 0x44, ®44); - pci_read_config_word(bmide_dev, 0x48, ®48); - pci_read_config_byte(bmide_dev, 0x54, ®54); - pci_read_config_word(bmide_dev, 0x56, ®56); - - /* - * at that point bibma+0x2 et bibma+0xa are byte registers - * to investigate: - */ - c0 = inb_p((unsigned short)bibma + 0x02); - c1 = inb_p((unsigned short)bibma + 0x0a); - - switch(bmide_dev->device) { - case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: - p += sprintf(p, "\n " - "ServerWorks CSB5 Chipset (rev %02x)\n", - svwks_revision); - break; - case PCI_DEVICE_ID_SERVERWORKS_OSB4IDE: - p += sprintf(p, "\n " - "ServerWorks OSB4 Chipset (rev %02x)\n", - svwks_revision); - break; - default: - p += sprintf(p, "\n " - "ServerWorks %04x Chipset (rev %02x)\n", - bmide_dev->device, svwks_revision); - break; - } - - p += sprintf(p, "------------------------------- General Status ---------------------------------\n"); - p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n"); - p += sprintf(p, " %sabled %sabled\n", - (c0&0x80) ? "dis" : " en", - (c1&0x80) ? "dis" : " en"); - p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n"); - p += sprintf(p, "DMA enabled: %s %s %s %s\n", - (c0&0x20) ? "yes" : "no ", - (c0&0x40) ? "yes" : "no ", - (c1&0x20) ? "yes" : "no ", - (c1&0x40) ? "yes" : "no " ); - p += sprintf(p, "UDMA enabled: %s %s %s %s\n", - (reg54 & 0x01) ? "yes" : "no ", - (reg54 & 0x02) ? "yes" : "no ", - (reg54 & 0x04) ? "yes" : "no ", - (reg54 & 0x08) ? "yes" : "no " ); - p += sprintf(p, "UDMA enabled: %s %s %s %s\n", - ((reg56&0x0005)==0x0005)?"5": - ((reg56&0x0004)==0x0004)?"4": - ((reg56&0x0003)==0x0003)?"3": - ((reg56&0x0002)==0x0002)?"2": - ((reg56&0x0001)==0x0001)?"1": - ((reg56&0x000F))?"?":"0", - ((reg56&0x0050)==0x0050)?"5": - ((reg56&0x0040)==0x0040)?"4": - ((reg56&0x0030)==0x0030)?"3": - ((reg56&0x0020)==0x0020)?"2": - ((reg56&0x0010)==0x0010)?"1": - ((reg56&0x00F0))?"?":"0", - ((reg56&0x0500)==0x0500)?"5": - ((reg56&0x0400)==0x0400)?"4": - ((reg56&0x0300)==0x0300)?"3": - ((reg56&0x0200)==0x0200)?"2": - ((reg56&0x0100)==0x0100)?"1": - ((reg56&0x0F00))?"?":"0", - ((reg56&0x5000)==0x5000)?"5": - ((reg56&0x4000)==0x4000)?"4": - ((reg56&0x3000)==0x3000)?"3": - ((reg56&0x2000)==0x2000)?"2": - ((reg56&0x1000)==0x1000)?"1": - ((reg56&0xF000))?"?":"0"); - p += sprintf(p, "DMA enabled: %s %s %s %s\n", - ((reg44&0x00002000)==0x00002000)?"2": - ((reg44&0x00002100)==0x00002100)?"1": - ((reg44&0x00007700)==0x00007700)?"0": - ((reg44&0x0000FF00)==0x0000FF00)?"X":"?", - ((reg44&0x00000020)==0x00000020)?"2": - ((reg44&0x00000021)==0x00000021)?"1": - ((reg44&0x00000077)==0x00000077)?"0": - ((reg44&0x000000FF)==0x000000FF)?"X":"?", - ((reg44&0x20000000)==0x20000000)?"2": - ((reg44&0x21000000)==0x21000000)?"1": - ((reg44&0x77000000)==0x77000000)?"0": - ((reg44&0xFF000000)==0xFF000000)?"X":"?", - ((reg44&0x00200000)==0x00200000)?"2": - ((reg44&0x00210000)==0x00210000)?"1": - ((reg44&0x00770000)==0x00770000)?"0": - ((reg44&0x00FF0000)==0x00FF0000)?"X":"?"); - - p += sprintf(p, "PIO enabled: %s %s %s %s\n", - ((reg40&0x00002000)==0x00002000)?"4": - ((reg40&0x00002200)==0x00002200)?"3": - ((reg40&0x00003400)==0x00003400)?"2": - ((reg40&0x00004700)==0x00004700)?"1": - ((reg40&0x00005D00)==0x00005D00)?"0":"?", - ((reg40&0x00000020)==0x00000020)?"4": - ((reg40&0x00000022)==0x00000022)?"3": - ((reg40&0x00000034)==0x00000034)?"2": - ((reg40&0x00000047)==0x00000047)?"1": - ((reg40&0x0000005D)==0x0000005D)?"0":"?", - ((reg40&0x20000000)==0x20000000)?"4": - ((reg40&0x22000000)==0x22000000)?"3": - ((reg40&0x34000000)==0x34000000)?"2": - ((reg40&0x47000000)==0x47000000)?"1": - ((reg40&0x5D000000)==0x5D000000)?"0":"?", - ((reg40&0x00200000)==0x00200000)?"4": - ((reg40&0x00220000)==0x00220000)?"3": - ((reg40&0x00340000)==0x00340000)?"2": - ((reg40&0x00470000)==0x00470000)?"1": - ((reg40&0x005D0000)==0x005D0000)?"0":"?"); - return p-buffer; /* => must be less than 4k! */ -} -#endif /* defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS) */ - -#define SVWKS_CSB5_REVISION_NEW 0x92 /* min PCI_REVISION_ID for UDMA5 (A2.0) */ - -byte svwks_proc = 0; - -extern char *ide_xfer_verbose (byte xfer_rate); - -static struct pci_dev *isa_dev; - -static int svwks_tune_chipset (ide_drive_t *drive, byte speed) -{ - byte udma_modes[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05 }; - byte dma_modes[] = { 0x77, 0x21, 0x20 }; - byte pio_modes[] = { 0x5d, 0x47, 0x34, 0x22, 0x20 }; - - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - byte unit = (drive->select.b.unit & 0x01); - byte csb5 = (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) ? 1 : 0; - -#ifdef CONFIG_BLK_DEV_IDEDMA - unsigned long dma_base = hwif->dma_base; -#endif /* CONFIG_BLK_DEV_IDEDMA */ - int err; - - byte drive_pci = 0x00; - byte drive_pci2 = 0x00; - byte drive_pci3 = hwif->channel ? 0x57 : 0x56; - - byte ultra_enable = 0x00; - byte ultra_timing = 0x00; - byte dma_timing = 0x00; - byte pio_timing = 0x00; - unsigned short csb5_pio = 0x00; - - byte pio = ide_get_best_pio_mode(drive, 255, 5, NULL); - - switch (drive->dn) { - case 0: drive_pci = 0x41; drive_pci2 = 0x45; break; - case 1: drive_pci = 0x40; drive_pci2 = 0x44; break; - case 2: drive_pci = 0x43; drive_pci2 = 0x47; break; - case 3: drive_pci = 0x42; drive_pci2 = 0x46; break; - default: - return -1; - } - - pci_read_config_byte(dev, drive_pci, &pio_timing); - pci_read_config_byte(dev, drive_pci2, &dma_timing); - pci_read_config_byte(dev, drive_pci3, &ultra_timing); - pci_read_config_word(dev, 0x4A, &csb5_pio); - pci_read_config_byte(dev, 0x54, &ultra_enable); - -#ifdef DEBUG - printk("%s: UDMA 0x%02x DMAPIO 0x%02x PIO 0x%02x ", - drive->name, ultra_timing, dma_timing, pio_timing); -#endif - - pio_timing &= ~0xFF; - dma_timing &= ~0xFF; - ultra_timing &= ~(0x0F << (4*unit)); - ultra_enable &= ~(0x01 << drive->dn); - csb5_pio &= ~(0x0F << (4*drive->dn)); - - switch(speed) { - case XFER_PIO_4: - case XFER_PIO_3: - case XFER_PIO_2: - case XFER_PIO_1: - case XFER_PIO_0: - pio_timing |= pio_modes[speed - XFER_PIO_0]; - csb5_pio |= ((speed - XFER_PIO_0) << (4*drive->dn)); - break; - -#ifdef CONFIG_BLK_DEV_IDEDMA - case XFER_MW_DMA_2: - case XFER_MW_DMA_1: - case XFER_MW_DMA_0: - pio_timing |= pio_modes[pio]; - csb5_pio |= (pio << (4*drive->dn)); - dma_timing |= dma_modes[speed - XFER_MW_DMA_0]; - break; - - case XFER_UDMA_5: - case XFER_UDMA_4: - case XFER_UDMA_3: - case XFER_UDMA_2: - case XFER_UDMA_1: - case XFER_UDMA_0: - pio_timing |= pio_modes[pio]; - csb5_pio |= (pio << (4*drive->dn)); - dma_timing |= dma_modes[2]; - ultra_timing |= ((udma_modes[speed - XFER_UDMA_0]) << (4*unit)); - ultra_enable |= (0x01 << drive->dn); -#endif - default: - break; - } - -#ifdef DEBUG - printk("%s: UDMA 0x%02x DMAPIO 0x%02x PIO 0x%02x ", - drive->name, ultra_timing, dma_timing, pio_timing); -#endif - -#if SVWKS_DEBUG_DRIVE_INFO - printk("%s: %s drive%d\n", drive->name, ide_xfer_verbose(speed), drive->dn); -#endif /* SVWKS_DEBUG_DRIVE_INFO */ - - if (!drive->init_speed) - drive->init_speed = speed; - - pci_write_config_byte(dev, drive_pci, pio_timing); - if (csb5) - pci_write_config_word(dev, 0x4A, csb5_pio); - -#ifdef CONFIG_BLK_DEV_IDEDMA - pci_write_config_byte(dev, drive_pci2, dma_timing); - pci_write_config_byte(dev, drive_pci3, ultra_timing); - pci_write_config_byte(dev, 0x54, ultra_enable); - - if (speed > XFER_PIO_4) - outb(inb(dma_base+2)|(1<<(5+unit)), dma_base+2); - else - outb(inb(dma_base+2) & ~(1<<(5+unit)), dma_base+2); -#endif /* CONFIG_BLK_DEV_IDEDMA */ - - err = ide_config_drive_speed(drive, speed); - drive->current_speed = speed; - return err; -} - -static void config_chipset_for_pio (ide_drive_t *drive) -{ - unsigned short eide_pio_timing[6] = {960, 480, 240, 180, 120, 90}; - unsigned short xfer_pio = drive->id->eide_pio_modes; - byte timing, speed, pio; - - pio = ide_get_best_pio_mode(drive, 255, 5, NULL); - - if (xfer_pio> 4) - xfer_pio = 0; - - if (drive->id->eide_pio_iordy > 0) - for (xfer_pio = 5; - xfer_pio>0 && - drive->id->eide_pio_iordy>eide_pio_timing[xfer_pio]; - xfer_pio--); - else - xfer_pio = (drive->id->eide_pio_modes & 4) ? 0x05 : - (drive->id->eide_pio_modes & 2) ? 0x04 : - (drive->id->eide_pio_modes & 1) ? 0x03 : - (drive->id->tPIO & 2) ? 0x02 : - (drive->id->tPIO & 1) ? 0x01 : xfer_pio; - - timing = (xfer_pio >= pio) ? xfer_pio : pio; - - switch(timing) { - case 4: speed = XFER_PIO_4;break; - case 3: speed = XFER_PIO_3;break; - case 2: speed = XFER_PIO_2;break; - case 1: speed = XFER_PIO_1;break; - default: - speed = (!drive->id->tPIO) ? XFER_PIO_0 : XFER_PIO_SLOW; - break; - } - (void) svwks_tune_chipset(drive, speed); - drive->current_speed = speed; -} - -static void svwks_tune_drive (ide_drive_t *drive, byte pio) -{ - byte speed; - switch(pio) { - case 4: speed = XFER_PIO_4;break; - case 3: speed = XFER_PIO_3;break; - case 2: speed = XFER_PIO_2;break; - case 1: speed = XFER_PIO_1;break; - default: speed = XFER_PIO_0;break; - } - (void) svwks_tune_chipset(drive, speed); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -static int config_chipset_for_dma (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - struct pci_dev *dev = HWIF(drive)->pci_dev; - byte udma_66 = eighty_ninty_three(drive); - int ultra66 = (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) ? 1 : 0; - int ultra100 = (ultra66 && svwks_revision >= SVWKS_CSB5_REVISION_NEW) ? 1 : 0; - byte speed; - - if ((id->dma_ultra & 0x0020) && (udma_66) && (ultra100)) { - speed = XFER_UDMA_5; - } else if (id->dma_ultra & 0x0010) { - speed = ((udma_66) && (ultra66)) ? XFER_UDMA_4 : XFER_UDMA_2; - } else if (id->dma_ultra & 0x0008) { - speed = ((udma_66) && (ultra66)) ? XFER_UDMA_3 : XFER_UDMA_1; - } else if (id->dma_ultra & 0x0004) { - speed = XFER_UDMA_2; - } else if (id->dma_ultra & 0x0002) { - speed = XFER_UDMA_1; - } else if (id->dma_ultra & 0x0001) { - speed = XFER_UDMA_0; - } else if (id->dma_mword & 0x0004) { - speed = XFER_MW_DMA_2; - } else if (id->dma_mword & 0x0002) { - speed = XFER_MW_DMA_1; - } else if (id->dma_1word & 0x0004) { - speed = XFER_SW_DMA_2; - } else { - speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL); - } - - (void) svwks_tune_chipset(drive, speed); - - return ((int) ((id->dma_ultra >> 11) & 7) ? ide_dma_on : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ((id->dma_1word >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); -} - -static int config_drive_xfer_rate (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - ide_dma_action_t dma_func = ide_dma_on; - - if (id && (id->capability & 1) && HWIF(drive)->autodma) { - /* Consult the list of known "bad" drives */ - if (ide_dmaproc(ide_dma_bad_drive, drive)) { - dma_func = ide_dma_off; - goto fast_ata_pio; - } - dma_func = ide_dma_off_quietly; - if (id->field_valid & 4) { - if (id->dma_ultra & 0x003F) { - /* Force if Capable UltraDMA */ - dma_func = config_chipset_for_dma(drive); - if ((id->field_valid & 2) && - (dma_func != ide_dma_on)) - goto try_dma_modes; - } - } else if (id->field_valid & 2) { -try_dma_modes: - if ((id->dma_mword & 0x0007) || - (id->dma_1word & 0x007)) { - /* Force if Capable regular DMA modes */ - dma_func = config_chipset_for_dma(drive); - if (dma_func != ide_dma_on) - goto no_dma_set; - } - } else if (ide_dmaproc(ide_dma_good_drive, drive)) { - if (id->eide_dma_time > 150) { - goto no_dma_set; - } - /* Consult the list of known "good" drives */ - dma_func = config_chipset_for_dma(drive); - if (dma_func != ide_dma_on) - goto no_dma_set; - } else { - goto fast_ata_pio; - } - } else if ((id->capability & 8) || (id->field_valid & 2)) { -fast_ata_pio: - dma_func = ide_dma_off_quietly; -no_dma_set: - config_chipset_for_pio(drive); - } - return HWIF(drive)->dmaproc(dma_func, drive); -} - -static int svwks_dmaproc(ide_dma_action_t func, ide_drive_t *drive) -{ - switch (func) { - case ide_dma_check: - return config_drive_xfer_rate(drive); - case ide_dma_end: - { - ide_hwif_t *hwif = HWIF(drive); - unsigned long dma_base = hwif->dma_base; - - if(inb(dma_base+0x02)&1) - { -#if 0 - int i; - printk(KERN_ERR "Curious - OSB4 thinks the DMA is still running.\n"); - for(i=0;i<10;i++) - { - if(!(inb(dma_base+0x02)&1)) - { - printk(KERN_ERR "OSB4 now finished.\n"); - break; - } - udelay(5); - } -#endif - printk(KERN_CRIT "Serverworks OSB4 in impossible state.\n"); - printk(KERN_CRIT "Disable UDMA or if you are using Seagate then try switching disk types\n"); - printk(KERN_CRIT "on this controller. Please report this event to osb4-bug@ide.cabal.tm\n"); -#if 0 - /* Panic might sys_sync -> death by corrupt disk */ - panic("OSB4: continuing might cause disk corruption.\n"); -#else - printk(KERN_CRIT "OSB4: continuing might cause disk corruption.\n"); - while(1) - cpu_relax(); -#endif - } - /* and drop through */ - } - default: - break; - } - /* Other cases are done by generic IDE-DMA code. */ - return ide_dmaproc(func, drive); -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -unsigned int __init pci_init_svwks (struct pci_dev *dev, const char *name) -{ - unsigned int reg; - byte btr; - - /* save revision id to determine DMA capability */ - pci_read_config_byte(dev, PCI_REVISION_ID, &svwks_revision); - - /* force Master Latency Timer value to 64 PCICLKs */ - pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x40); - - /* OSB4 : South Bridge and IDE */ - if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { - isa_dev = pci_find_device(PCI_VENDOR_ID_SERVERWORKS, - PCI_DEVICE_ID_SERVERWORKS_OSB4, NULL); - if (isa_dev) { - pci_read_config_dword(isa_dev, 0x64, ®); - reg &= ~0x00002000; /* disable 600ns interrupt mask */ - reg |= 0x00004000; /* enable UDMA/33 support */ - pci_write_config_dword(isa_dev, 0x64, reg); - } - } - - /* setup CSB5 : South Bridge and IDE */ - else if (dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) { - /* setup the UDMA Control register - * - * 1. clear bit 6 to enable DMA - * 2. enable DMA modes with bits 0-1 - * 00 : legacy - * 01 : udma2 - * 10 : udma2/udma4 - * 11 : udma2/udma4/udma5 - */ - pci_read_config_byte(dev, 0x5A, &btr); - btr &= ~0x40; - btr |= (svwks_revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2; - pci_write_config_byte(dev, 0x5A, btr); - } - -#if defined(DISPLAY_SVWKS_TIMINGS) && defined(CONFIG_PROC_FS) - if (!svwks_proc) { - svwks_proc = 1; - bmide_dev = dev; - svwks_display_info = &svwks_get_info; - } -#endif /* DISPLAY_SVWKS_TIMINGS && CONFIG_PROC_FS */ - return 0; -} - -/* On Dell PowerEdge servers with a CSB5, the top two bits of the subsystem - * device ID indicate presence of an 80-pin cable. - * Bit 15 clear = secondary IDE channel does not have 80-pin cable. - * Bit 15 set = secondary IDE channel has 80-pin cable. - * Bit 14 clear = primary IDE channel does not have 80-pin cable. - * Bit 14 set = primary IDE channel has 80-pin cable. - */ -static unsigned int __init ata66_svwks_dell (ide_hwif_t *hwif) -{ - struct pci_dev *dev = hwif->pci_dev; - if (dev->subsystem_vendor == PCI_VENDOR_ID_DELL && - dev->vendor == PCI_VENDOR_ID_SERVERWORKS && - dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) - return ((1 << (hwif->channel + 14)) & - dev->subsystem_device) ? 1 : 0; - return 0; -} - -/* Sun Cobalt Alpine hardware avoids the 80-pin cable - * detect issue by attaching the drives directly to the board. - * This check follows the Dell precedent (how scary is that?!) - * - * WARNING: this only works on Alpine hardware! - */ -static unsigned int __init ata66_svwks_cobalt (ide_hwif_t *hwif) -{ - struct pci_dev *dev = hwif->pci_dev; - if (dev->subsystem_vendor == PCI_VENDOR_ID_SUN && - dev->vendor == PCI_VENDOR_ID_SERVERWORKS && - dev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE) - return ((1 << (hwif->channel + 14)) & - dev->subsystem_device) ? 1 : 0; - return 0; -} - -unsigned int __init ata66_svwks (ide_hwif_t *hwif) -{ - struct pci_dev *dev = hwif->pci_dev; - - /* Dell PowerEdge */ - if (dev->subsystem_vendor == PCI_VENDOR_ID_DELL) - return ata66_svwks_dell (hwif); - - /* Cobalt Alpine */ - if (dev->subsystem_vendor == PCI_VENDOR_ID_SUN) - return ata66_svwks_cobalt (hwif); - - return 0; -} - -void __init ide_init_svwks (ide_hwif_t *hwif) -{ - if (!hwif->irq) - hwif->irq = hwif->channel ? 15 : 14; - - hwif->tuneproc = &svwks_tune_drive; - hwif->speedproc = &svwks_tune_chipset; - -#ifndef CONFIG_BLK_DEV_IDEDMA - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - hwif->autodma = 0; -#else /* CONFIG_BLK_DEV_IDEDMA */ - if (hwif->dma_base) { -#ifdef CONFIG_IDEDMA_AUTO - if (!noautodma) - hwif->autodma = 1; -#endif - hwif->dmaproc = &svwks_dmaproc; - } else { - hwif->autodma = 0; - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - } -#endif /* !CONFIG_BLK_DEV_IDEDMA */ -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/setup-pci.c linux.20pre5-ac2/drivers/ide/setup-pci.c --- linux.20pre5/drivers/ide/setup-pci.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/setup-pci.c 2002-09-01 17:55:48.000000000 +0100 @@ -0,0 +1,955 @@ +/* + * linux/drivers/ide/setup-pci.c Version 1.10 2002/08/19 + * + * Copyright (c) 1998-2000 Andre Hedrick + * + * Copyright (c) 1995-1998 Mark Lord + * May be copied or modified under the terms of the GNU General Public License + * + * Recent Changes + * Split the set up function into multiple functions + * Use pci_set_master + * Fix misreporting of I/O v MMIO problems + */ + +/* + * This module provides support for automatic detection and + * configuration of all PCI IDE interfaces present in a system. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +/** + * ide_match_hwif - match a PCI IDE against an ide_hwif + * @io_base: I/O base of device + * @bootable: set if its bootable + * @name: name of device + * + * Match a PCI IDE port against an entry in ide_hwifs[], + * based on io_base port if possible. Return the matching hwif, + * or a new hwif. If we find an error (clashing, out of devices, etc) + * return NULL + */ + +static ide_hwif_t *ide_match_hwif(unsigned long io_base, u8 bootable, const char *name) +{ + int h; + ide_hwif_t *hwif; + + /* + * Look for a hwif with matching io_base specified using + * parameters to ide_setup(). + */ + for (h = 0; h < MAX_HWIFS; ++h) { + hwif = &ide_hwifs[h]; + if (hwif->io_ports[IDE_DATA_OFFSET] == io_base) { + if (hwif->chipset == ide_generic) + return hwif; /* a perfect match */ + } + } + /* + * Look for a hwif with matching io_base default value. + * If chipset is "ide_unknown", then claim that hwif slot. + * Otherwise, some other chipset has already claimed it.. :( + */ + for (h = 0; h < MAX_HWIFS; ++h) { + hwif = &ide_hwifs[h]; + if (hwif->io_ports[IDE_DATA_OFFSET] == io_base) { + if (hwif->chipset == ide_unknown) + return hwif; /* match */ + printk(KERN_ERR "%s: port 0x%04lx already claimed by %s\n", + name, io_base, hwif->name); + return NULL; /* already claimed */ + } + } + /* + * Okay, there is no hwif matching our io_base, + * so we'll just claim an unassigned slot. + * Give preference to claiming other slots before claiming ide0/ide1, + * just in case there's another interface yet-to-be-scanned + * which uses ports 1f0/170 (the ide0/ide1 defaults). + * + * Unless there is a bootable card that does not use the standard + * ports 1f0/170 (the ide0/ide1 defaults). The (bootable) flag. + */ + if (bootable) { + for (h = 0; h < MAX_HWIFS; ++h) { + hwif = &ide_hwifs[h]; + if (hwif->chipset == ide_unknown) + return hwif; /* pick an unused entry */ + } + } else { + for (h = 2; h < MAX_HWIFS; ++h) { + hwif = ide_hwifs + h; + if (hwif->chipset == ide_unknown) + return hwif; /* pick an unused entry */ + } + } + for (h = 0; h < 2; ++h) { + hwif = ide_hwifs + h; + if (hwif->chipset == ide_unknown) + return hwif; /* pick an unused entry */ + } + printk(KERN_ERR "%s: too many IDE interfaces, no room in table\n", name); + return NULL; +} + +/** + * ide_setup_pci_baseregs - place a PCI IDE controller native + * @dev: PCI device of interface to switch native + * @name: Name of interface + * + * We attempt to place the PCI interface into PCI native mode. If + * we succeed the BARs are ok and the controller is in PCI mode. + * Returns 0 on success or an errno code. + * + * FIXME: if we program the interface and then fail to set the BARS + * we don't switch it back to legacy mode. Do we actually care ?? + */ + +static int ide_setup_pci_baseregs (struct pci_dev *dev, const char *name) +{ + u8 progif = 0; + + /* + * Place both IDE interfaces into PCI "native" mode: + */ + if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) || + (progif & 5) != 5) { + if ((progif & 0xa) != 0xa) { + printk(KERN_INFO "%s: device not capable of full " + "native PCI mode\n", name); + return -EOPNOTSUPP; + } + printk("%s: placing both ports into native PCI mode\n", name); + (void) pci_write_config_byte(dev, PCI_CLASS_PROG, progif|5); + if (pci_read_config_byte(dev, PCI_CLASS_PROG, &progif) || + (progif & 5) != 5) { + printk(KERN_ERR "%s: rewrite of PROGIF failed, wanted " + "0x%04x, got 0x%04x\n", + name, progif|5, progif); + return -EOPNOTSUPP; + } + } + +#if 0 + /* + * At this point we have enabled the device, but may previously + * have done a BAR4 enable alone. We should be prepared to assign + * resources here. + */ + + /* + * Setup base registers for IDE command/control + * spaces for each interface: + */ + for (reg = 0; reg < 4; reg++) { + struct resource *res = dev->resource + reg; + if ((res->flags & IORESOURCE_IO) == 0) + continue; + if (!res->start) { + if(pci_assign_resource(dev, reg)) + { + printk(KERN_ERR "%s: Missing I/O address #%d\n", name, reg); + return -ENXIO; + } + } + } +#endif + return 0; +} + +#ifdef CONFIG_BLK_DEV_IDEDMA +#ifdef CONFIG_BLK_DEV_IDEDMA_FORCED +/* + * Long lost data from 2.0.34 that is now in 2.0.39 + * + * This was used in ./drivers/block/triton.c to do DMA Base address setup + * when PnP failed. Oh the things we forget. I believe this was part + * of SFF-8038i that has been withdrawn from public access... :-(( + */ +#define DEFAULT_BMIBA 0xe800 /* in case BIOS did not init it */ +#define DEFAULT_BMCRBA 0xcc00 /* VIA's default value */ +#define DEFAULT_BMALIBA 0xd400 /* ALI's default value */ +#endif /* CONFIG_BLK_DEV_IDEDMA_FORCED */ + +/** + * ide_get_or_set_dma_base - setup BMIBA + * @hwif: Interface + * + * Fetch the DMA Bus-Master-I/O-Base-Address (BMIBA) from PCI space: + * If need be we set up the DMA base. Where a device has a partner that + * is already in DMA mode we check and enforce IDE simplex rules. + * + * FIXME: currently we are sometimes enforicng simplex when it is not + * needed. We fail the safe way but why is it occurring ?? + */ + +static unsigned long __init ide_get_or_set_dma_base (ide_hwif_t *hwif) +{ + unsigned long dma_base = 0; + struct pci_dev *dev = hwif->pci_dev; + +#ifdef CONFIG_BLK_DEV_IDEDMA_FORCED + int second_chance = 0; + +second_chance_to_dma: +#endif /* CONFIG_BLK_DEV_IDEDMA_FORCED */ + + if ((hwif->mmio) && (hwif->dma_base)) + return hwif->dma_base; + + if (hwif->mate && hwif->mate->dma_base) { + dma_base = hwif->mate->dma_base - (hwif->channel ? 0 : 8); + } else { + dma_base = (hwif->mmio) ? + ((unsigned long) hwif->hwif_data) : + (pci_resource_start(dev, 4)); + if (!dma_base) { + printk(KERN_ERR "%s: dma_base is invalid (0x%04lx)\n", + hwif->cds->name, dma_base); + dma_base = 0; + } + } + +#ifdef CONFIG_BLK_DEV_IDEDMA_FORCED + /* FIXME - should use pci_assign_resource surely */ + if ((!dma_base) && (!second_chance)) { + unsigned long set_bmiba = 0; + second_chance++; + switch(dev->vendor) { + case PCI_VENDOR_ID_AL: + set_bmiba = DEFAULT_BMALIBA; break; + case PCI_VENDOR_ID_VIA: + set_bmiba = DEFAULT_BMCRBA; break; + case PCI_VENDOR_ID_INTEL: + set_bmiba = DEFAULT_BMIBA; break; + default: + return dma_base; + } + pci_write_config_dword(dev, 0x20, set_bmiba|1); + goto second_chance_to_dma; + } +#endif /* CONFIG_BLK_DEV_IDEDMA_FORCED */ + + if (dma_base) { + u8 simplex_stat = 0; + dma_base += hwif->channel ? 8 : 0; + + switch(dev->device) { + case PCI_DEVICE_ID_AL_M5219: + case PCI_DEVICE_ID_AMD_VIPER_7409: + case PCI_DEVICE_ID_CMD_643: + case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: + simplex_stat = hwif->INB(dma_base + 2); + hwif->OUTB((simplex_stat&0x60),(dma_base + 2)); + simplex_stat = hwif->INB(dma_base + 2); + if (simplex_stat & 0x80) { + printk(KERN_INFO "%s: simplex device: " + "DMA forced\n", + hwif->cds->name); + } + break; + default: + /* + * If the device claims "simplex" DMA, + * this means only one of the two interfaces + * can be trusted with DMA at any point in time. + * So we should enable DMA only on one of the + * two interfaces. + */ + simplex_stat = hwif->INB(dma_base + 2); + if (simplex_stat & 0x80) { + /* simplex device? */ + + /* Don't enable DMA on a simplex channel with no drives */ + if (!hwif->drives[0].present && !hwif->drives[1].present) + { + printk(KERN_INFO "%s: simplex device with no drives: DMA disabled\n", + hwif->cds->name); + dma_base = 0; + } + /* If our other channel has DMA then we cannot */ + else if(hwif->mate && hwif->mate->dma_base) + { + printk(KERN_INFO "%s: simplex device: " + "DMA disabled\n", + hwif->cds->name); + dma_base = 0; + } + } + } + } + return dma_base; +} +#endif /* CONFIG_BLK_DEV_IDEDMA */ + +static void ide_setup_pci_noise (struct pci_dev *dev, ide_pci_device_t *d) +{ + if ((d->vendor != dev->vendor) && (d->device != dev->device)) { + printk(KERN_INFO "%s: unknown IDE controller at PCI slot " + "%s, VID=%04x, DID=%04x\n", + d->name, dev->slot_name, dev->vendor, dev->device); + } else { + printk(KERN_INFO "%s: IDE controller at PCI slot %s\n", + d->name, dev->slot_name); + } +} + +/** + * ide_pci_enable - do PCI enables + * @dev: PCI device + * @d: IDE pci device data + * + * Enable the IDE PCI device. We attempt to enable the device in full + * but if that fails then we only need BAR4 so we will enable that. + * + * Returns zero on success or an error code + */ + +static int ide_pci_enable(struct pci_dev *dev, ide_pci_device_t *d) +{ + + if (pci_enable_device(dev)) { + if (pci_enable_device_bars(dev, 1 << 4)) + { + printk(KERN_WARNING "%s: (ide_setup_pci_device:) " + "Could not enable device.\n", d->name); + return -EBUSY; + } + else + printk(KERN_WARNING "%s: Not fully BIOS configured!\n", d->name); + } + /* FIXME: Temporary - until we put in the hotplug interface logic + Check that the bits we want are not in use by someone else */ + if (pci_request_region(dev, 4, "ide_tmp")) + return -EBUSY; + pci_release_region(dev, 4); + + return 0; +} + +/** + * ide_pci_configure - configure an unconfigured device + * @dev: PCI device + * @d: IDE pci device data + * + * Enable and configure the PCI device we have been passed. + * Returns zero on success or an error code. + */ + +static int ide_pci_configure(struct pci_dev *dev, ide_pci_device_t *d) +{ + u16 pcicmd = 0; + /* + * PnP BIOS was *supposed* to have setup this device, but we + * can do it ourselves, so long as the BIOS has assigned an IRQ + * (or possibly the device is using a "legacy header" for IRQs). + * Maybe the user deliberately *disabled* the device, + * but we'll eventually ignore it again if no drives respond. + */ + if (ide_setup_pci_baseregs(dev, d->name) || pci_write_config_word(dev, PCI_COMMAND, pcicmd|PCI_COMMAND_IO)) + { + printk(KERN_INFO "%s: device disabled (BIOS)\n", d->name); + return -ENODEV; + } + if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd)) { + printk(KERN_ERR "%s: error accessing PCI regs\n", d->name); + return -EIO; + } + if (!(pcicmd & PCI_COMMAND_IO)) { + printk(KERN_ERR "%s: unable to enable IDE controller\n", d->name); + return -ENXIO; + } + return 0; +} + +/** + * ide_pci_check_iomem - check a register is I/O + * @dev: pci device + * @d: ide_pci_device + * @bar: bar number + * + * Checks if a BAR is configured and points to MMIO space. If so + * print an error and return an error code. Otherwise return 0 + */ + +static int ide_pci_check_iomem(struct pci_dev *dev, ide_pci_device_t *d, int bar) +{ + ulong flags = pci_resource_flags(dev, bar); + + /* Unconfigured ? */ + if(pci_resource_len(dev, bar) == 0) + return 0; + + /* I/O space */ + if(flags & PCI_BASE_ADDRESS_IO_MASK) + return 0; + + /* Bad */ + printk(KERN_ERR "%s: IO baseregs (BIOS) are reported " + "as MEM, report to " + ".\n", d->name); + return -EINVAL; +} + + +/** + * ide_hwif_configure - configure an IDE interface + * @dev: PCI device holding interface + * @d: IDE pci data + * @mate: Paired interface if any + * + * Perform the initial set up for the hardware interface structure. This + * is done per interface port rather than per PCI device. There may be + * more than one port per device. + * + * Returns the new hardware interface structure, or NULL on a failure + */ + +static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, ide_pci_device_t *d, ide_hwif_t *mate, int port, int irq) +{ + unsigned long ctl = 0, base = 0; + ide_hwif_t *hwif; + + if ((dev->class >> 8) != PCI_CLASS_STORAGE_IDE || + ((dev->class & ~(0xfa))) || + (dev->class & (port ? 4 : 1)) != 0) + { + /* Possibly we should fail if these checks report true */ + ide_pci_check_iomem(dev, d, 2*port); + ide_pci_check_iomem(dev, d, 2*port+1); + + ctl = pci_resource_start(dev, 2*port+1); + base = pci_resource_start(dev, 2*port); + if ((ctl && !base) || (base && !ctl)) { + printk(KERN_ERR "%s: inconsistent baseregs (BIOS) " + "for port %d, skipping\n", d->name, port); + return NULL; + } + } + if (!ctl) + { + /* Use default values */ + ctl = port ? 0x374 : 0x3f4; + base = port ? 0x170 : 0x1f0; + } + if ((hwif = ide_match_hwif(base, d->bootable, d->name)) == NULL) + return NULL; /* no room in ide_hwifs[] */ + if (hwif->io_ports[IDE_DATA_OFFSET] != base) { +fixup_address: + ide_init_hwif_ports(&hwif->hw, base, (ctl | 2), NULL); + memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports)); + hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET]; + } else if (hwif->io_ports[IDE_CONTROL_OFFSET] != (ctl | 2)) { + goto fixup_address; + } + hwif->chipset = ide_pci; + hwif->pci_dev = dev; + hwif->cds = (struct ide_pci_device_s *) d; + hwif->channel = port; + + if (!hwif->irq) + hwif->irq = irq; + if (mate) { + hwif->mate = mate; + mate->mate = hwif; + } + return hwif; +} + +/** + * ide_hwif_setup_dma - configure DMA interface + * @dev: PCI device + * @d: IDE pci data + * @hwif: Hardware interface we are configuring + * + * Set up the DMA base for the interface. Enable the master bits as + * neccessary and attempt to bring the device DMA into a ready to use + * state + */ + +static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwif_t *hwif) +{ + u16 pcicmd; + pci_read_config_word(dev, PCI_COMMAND, &pcicmd); + + if ((d->autodma == AUTODMA) || + ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE && + (dev->class & 0x80))) { + u32 dma_base = ide_get_or_set_dma_base(hwif); + if (dma_base && !(pcicmd & PCI_COMMAND_MASTER)) { + /* + * Set up BM-DMA capability + * (PnP BIOS should have done this) + */ + if ((d->device != PCI_DEVICE_ID_CYRIX_5530_IDE) + && (d->vendor != PCI_VENDOR_ID_CYRIX)) { + /* + * default DMA off if we had to + * configure it here + */ + hwif->autodma = 0; + } + pci_set_master(dev); + if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd) || !(pcicmd & PCI_COMMAND_MASTER)) { + printk(KERN_ERR "%s: %s error updating PCICMD\n", + hwif->name, d->name); + dma_base = 0; + } + } + if (dma_base) { + if (d->init_dma) { + d->init_dma(hwif, dma_base); + } else { + ide_setup_dma(hwif, dma_base, 8); + } + } else { + printk(KERN_INFO "%s: %s Bus-Master DMA disabled " + "(BIOS)\n", hwif->name, d->name); + } + } +} + +/** + * ide_setup_pci_controller - set up IDE PCI + * @dev: PCI device + * @d: IDE PCI data + * @noisy: verbose flag + * @config: returned as 1 if we configured the hardware + * + * Set up the PCI and controller side of the IDE interface. This brings + * up the PCI side of the device, checks that the device is enabled + * and enables it if need be + */ + +static int ide_setup_pci_controller(struct pci_dev *dev, ide_pci_device_t *d, int noisy, int *config) +{ + int ret = 0; + u32 class_rev; + u16 pcicmd; + + if (!noautodma) + ret = 1; + + if (noisy) + ide_setup_pci_noise(dev, d); + + if (ide_pci_enable(dev, d)) + return -EBUSY; + + if (pci_read_config_word(dev, PCI_COMMAND, &pcicmd)) { + printk(KERN_ERR "%s: error accessing PCI regs\n", d->name); + return -EIO; + } + if (!(pcicmd & PCI_COMMAND_IO)) { /* is device disabled? */ + if (ide_pci_configure(dev, d)) + return -ENODEV; + /* default DMA off if we had to configure it here */ + ret = 0; + *config = 1; + printk(KERN_INFO "%s: device enabled (Linux)\n", d->name); + } + + pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev); + class_rev &= 0xff; + if (noisy) + printk(KERN_INFO "%s: chipset revision %d\n", d->name, class_rev); + return ret; +} + +/* + * ide_setup_pci_device() looks at the primary/secondary interfaces + * on a PCI IDE device and, if they are enabled, prepares the IDE driver + * for use with them. This generic code works for most PCI chipsets. + * + * One thing that is not standardized is the location of the + * primary/secondary interface "enable/disable" bits. For chipsets that + * we "know" about, this information is in the ide_pci_device_t struct; + * for all other chipsets, we just assume both interfaces are enabled. + */ +static ata_index_t do_ide_setup_pci_device (struct pci_dev *dev, ide_pci_device_t *d, u8 noisy) +{ + u32 port, at_least_one_hwif_enabled = 0, autodma = 0; + int pciirq = 0; + int tried_config = 0; + ata_index_t index; + u8 tmp = 0; + ide_hwif_t *hwif, *mate = NULL; + static int secondpdc = 0; + + index.all = 0xf0f0; + + if((autodma = ide_setup_pci_controller(dev, d, noisy, &tried_config)) < 0) + return index; + + /* + * Can we trust the reported IRQ? + */ + pciirq = dev->irq; + + if ((dev->class & ~(0xfa)) != ((PCI_CLASS_STORAGE_IDE << 8) | 5)) { + if (noisy) + printk(KERN_INFO "%s: not 100%% native mode: " + "will probe irqs later\n", d->name); + /* + * This allows offboard ide-pci cards the enable a BIOS, + * verify interrupt settings of split-mirror pci-config + * space, place chipset into init-mode, and/or preserve + * an interrupt if the card is not native ide support. + */ + pciirq = (d->init_chipset) ? d->init_chipset(dev, d->name) : 0; + } else if (tried_config) { + if (noisy) + printk(KERN_INFO "%s: will probe irqs later\n", d->name); + pciirq = 0; + } else if (!pciirq) { + if (noisy) + printk(KERN_WARNING "%s: bad irq (%d): will probe later\n", + d->name, pciirq); + pciirq = 0; + } else { + if (d->init_chipset) + { + if(d->init_chipset(dev, d->name) < 0) + return index; + } + if (noisy) +#ifdef __sparc__ + printk(KERN_INFO "%s: 100%% native mode on irq %s\n", + d->name, __irq_itoa(pciirq)); +#else + printk(KERN_INFO "%s: 100%% native mode on irq %d\n", + d->name, pciirq); +#endif + } + + if(pciirq < 0) /* Error not an IRQ */ + return index; + + /* + * Set up the IDE ports + */ + + for (port = 0; port <= 1; ++port) { + ide_pci_enablebit_t *e = &(d->enablebits[port]); + + /* + * If this is a Promise FakeRaid controller, + * the 2nd controller will be marked as + * disabled while it is actually there and enabled + * by the bios for raid purposes. + * Skip the normal "is it enabled" test for those. + */ + if (((d->vendor == PCI_VENDOR_ID_PROMISE) && + ((d->device == PCI_DEVICE_ID_PROMISE_20262) || + (d->device == PCI_DEVICE_ID_PROMISE_20265))) && + (secondpdc++==1) && (port==1)) + goto controller_ok; + + if (e->reg && (pci_read_config_byte(dev, e->reg, &tmp) || + (tmp & e->mask) != e->val)) + continue; /* port not enabled */ +controller_ok: + + if (d->channels <= port) + return index; + + if ((hwif = ide_hwif_configure(dev, d, mate, port, pciirq)) == NULL) + continue; + + if (hwif->channel) { + index.b.high = hwif->index; + } else { + index.b.low = hwif->index; + } + + + if (d->init_iops) + d->init_iops(hwif); + +#ifdef CONFIG_BLK_DEV_IDEDMA + if (d->autodma == NODMA) + goto bypass_legacy_dma; + if (d->autodma == NOAUTODMA) + autodma = 0; + if (autodma) + hwif->autodma = 1; + ide_hwif_setup_dma(dev, d, hwif); +bypass_legacy_dma: +#endif /* CONFIG_BLK_DEV_IDEDMA */ + if (d->init_hwif) + /* Call chipset-specific routine + * for each enabled hwif + */ + d->init_hwif(hwif); + + mate = hwif; + at_least_one_hwif_enabled = 1; + } + if (!at_least_one_hwif_enabled) + printk(KERN_INFO "%s: neither IDE port enabled (BIOS)\n", d->name); + return index; +} + +void ide_setup_pci_device (struct pci_dev *dev, ide_pci_device_t *d) +{ +#ifdef HWIF_PROBE_CLASSIC_METHOD + (void) do_ide_setup_pci_device(dev, d, 1); +#else /* HWIF_PROBE_CLASSIC_METHOD */ + ata_index_t index_list = do_ide_setup_pci_device(dev, d, 1); + + if ((index_list.b.low & 0xf0) != 0xf0) + probe_hwif_init(&ide_hwifs[index_list.b.low]); + if ((index_list.b.high & 0xf0) != 0xf0) + probe_hwif_init(&ide_hwifs[index_list.b.high]); +#endif /* HWIF_PROBE_CLASSIC_METHOD */ +} + +void ide_setup_pci_devices (struct pci_dev *dev, struct pci_dev *dev2, ide_pci_device_t *d) +{ +#ifdef HWIF_PROBE_CLASSIC_METHOD + (void) do_ide_setup_pci_device(dev, d, 1); + (void) do_ide_setup_pci_device(dev2, d, 1); +#else /* HWIF_PROBE_CLASSIC_METHOD */ + ata_index_t index_list = do_ide_setup_pci_device(dev, d, 1); + ata_index_t index_list2 = do_ide_setup_pci_device(dev2, d, 0); + + if ((index_list.b.low & 0xf0) != 0xf0) + probe_hwif_init(&ide_hwifs[index_list.b.low]); + if ((index_list.b.high & 0xf0) != 0xf0) + probe_hwif_init(&ide_hwifs[index_list.b.high]); + if ((index_list2.b.low & 0xf0) != 0xf0) + probe_hwif_init(&ide_hwifs[index_list2.b.low]); + if ((index_list2.b.high & 0xf0) != 0xf0) + probe_hwif_init(&ide_hwifs[index_list2.b.high]); +#endif /* HWIF_PROBE_CLASSIC_METHOD */ +} + +/* + * ide_scan_pcibus() gets invoked at boot time from ide.c. + * It finds all PCI IDE controllers and calls ide_setup_pci_device for them. + */ +void __init ide_scan_pcidev (struct pci_dev *dev) +{ +#if 0 + printk(" PCI slot %s, VID=%04x, DID=%04x\n", + dev->slot_name, dev->vendor, dev->device); +#endif + + if ((dev->vendor == PCI_VENDOR_ID_CMD) && + (dev->device == PCI_DEVICE_ID_CMD_640)) { + return; +#ifdef CONFIG_BLK_DEV_ALI15X3 + }{ + extern int ali15x3_scan_pcidev(struct pci_dev *dev); + if (ali15x3_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_ALI15X3 */ +#ifdef CONFIG_BLK_DEV_AMD74XX + }{ + extern int amd74xx_scan_pcidev(struct pci_dev *dev); + if (amd74xx_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_AMD74XX */ +#ifdef CONFIG_BLK_DEV_CS5530 + }{ + extern int cs5530_scan_pcidev(struct pci_dev *dev); + if (cs5530_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_CS5530 */ +#ifdef CONFIG_BLK_DEV_CY82C693 + }{ + extern int cy82c693_scan_pcidev(struct pci_dev *dev); + if (cy82c693_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_CY82C693 */ +#ifdef CONFIG_BLK_DEV_IT8172 + }{ + extern int it8172_scan_pcidev(struct pci_dev *dev); + if (it8172_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_IT8172 */ +#ifdef CONFIG_BLK_DEV_NFORCE + }{ + extern int nforce_scan_pcidev(struct pci_dev *dev); + if (nforce_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_NFORCE */ +#ifdef CONFIG_BLK_DEV_NS87415 + }{ + extern int ns87415_scan_pcidev(struct pci_dev *dev); + if (ns87415_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_NS87415 */ +#ifdef CONFIG_BLK_DEV_OPTI621 + }{ + extern int opti621_scan_pcidev(struct pci_dev *dev); + if (opti621_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_OPTI621 */ +#ifdef CONFIG_BLK_DEV_PIIX + }{ + extern int piix_scan_pcidev(struct pci_dev *dev); + if (piix_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_PIIX */ +#ifdef CONFIG_BLK_DEV_RZ1000 + }{ + extern int rz1000_scan_pcidev(struct pci_dev *dev); + if (rz1000_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_RZ1000 */ +#ifdef CONFIG_BLK_DEV_SVWKS + }{ + extern int serverworks_scan_pcidev(struct pci_dev *dev); + if (serverworks_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_SVWKS */ +#ifdef CONFIG_BLK_DEV_SIS5513 + }{ + extern int sis5513_scan_pcidev(struct pci_dev *dev); + if (sis5513_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_SIS5513 */ +#ifdef CONFIG_BLK_DEV_SLC90E66 + }{ + extern int slc90e66_scan_pcidev(struct pci_dev *dev); + if (slc90e66_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_SLC90E66 */ +#ifdef CONFIG_BLK_DEV_VIA82CXXX + }{ + extern int via82cxxx_scan_pcidev(struct pci_dev *dev); + if (via82cxxx_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_VIA82CXXX */ + +#ifdef CONFIG_BLK_DEV_AEC62XX + }{ + extern int aec62xx_scan_pcidev(struct pci_dev *dev); + if (aec62xx_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_AEC62XX */ +#ifdef CONFIG_BLK_DEV_CMD64X + }{ + extern int cmd64x_scan_pcidev(struct pci_dev *dev); + if (cmd64x_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_CMD64X */ +#ifdef CONFIG_BLK_DEV_HPT34X + }{ + extern int hpt34x_scan_pcidev(struct pci_dev *dev); + if (hpt34x_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_HPT34X */ +#ifdef CONFIG_BLK_DEV_HPT366 + }{ + extern int hpt366_scan_pcidev(struct pci_dev *dev); + if (hpt366_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_HPT366 */ +#ifdef CONFIG_BLK_DEV_PDC202XX + }{ + extern int pdc202xx_scan_pcidev(struct pci_dev *dev); + if (pdc202xx_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_PDC202XX */ +#ifdef CONFIG_BLK_DEV_PDC_ADMA + }{ + extern int pdcadma_scan_pcidev(struct pci_dev *dev); + if (pdcadma_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_PDC_ADMA */ +#ifdef CONFIG_BLK_DEV_SIIMAGE + }{ + extern int siimage_scan_pcidev(struct pci_dev *dev); + if (siimage_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_SIIMAGE */ +#ifdef CONFIG_BLK_DEV_SL82C105 + }{ + extern int sl82c105_scan_pcidev(struct pci_dev *dev); + if (sl82c105_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_SL82C105 */ +#ifdef CONFIG_BLK_DEV_TRM290 + }{ + extern int trm290_scan_pcidev(struct pci_dev *dev); + if (trm290_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_TRM290 */ +#ifdef CONFIG_BLK_DEV_GENERIC + }{ + extern int generic_scan_pcidev(struct pci_dev *dev); + if (generic_scan_pcidev(dev)) return; +#endif /* CONFIG_BLK_DEV_GENERIC */ + } +} + + +/* + * Module interfaces - not yet functional. + */ + +static int pre_init = 1; /* Before first ordered IDE scan */ +static LIST_HEAD(ide_pci_drivers); + +/* + * ide_register_pci_driver - attach IDE driver + * @driver: pci driver + * + * Registers a driver with the IDE layer. The IDE layer arranges that + * boot time setup is done in the expected device order and then + * hands the controllers off to the core PCI code to do the rest of + * the work. + * + * The driver_data of the driver table must point to an ide_pci_device_t + * describing the interface. + * + * Returns are the same as for pci_register_driver + */ + +int ide_register_pci_driver(struct pci_driver *driver) +{ + if(!pre_init) + return pci_register_driver(driver); + list_add_tail(&driver->node, &ide_pci_drivers); + return 0; +} + +EXPORT_SYMBOL(ide_register_pci_driver); + +/** + * ide_unregister_pci_driver - unregister an IDE driver + * @driver: driver to remove + * + * Unregister a currently installed IDE driver. Returns are the same + * as for pci_unregister_driver + */ + +void ide_unregister_pci_driver(struct pci_driver *driver) +{ + if(!pre_init) + pci_unregister_driver(driver); + else + list_del(&driver->node); +} + +EXPORT_SYMBOL(ide_unregister_pci_driver); + +/** + * ide_scan_pcibus - perform the initial IDE driver scan + * @scan_direction: set for reverse order scanning + * + * Perform the initial bus rather than driver ordered scan of the + * PCI drivers. After this all IDE pci handling becomes standard + * module ordering not traditionally ordered. + */ + +void __init ide_scan_pcibus (int scan_direction) +{ + struct pci_dev *dev; + + pre_init = 0; + if (!scan_direction) { + pci_for_each_dev(dev) { + ide_scan_pcidev(dev); + } + } else { + pci_for_each_dev_reverse(dev) { + ide_scan_pcidev(dev); + } + } + /* FIXME: now add the drivers list to the real pci probe list */ +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/sis5513.c linux.20pre5-ac2/drivers/ide/sis5513.c --- linux.20pre5/drivers/ide/sis5513.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/sis5513.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,861 +0,0 @@ -/* - * linux/drivers/ide/sis5513.c Version 0.13 March 6, 2002 - * - * Copyright (C) 1999-2000 Andre Hedrick - * Copyright (C) 2002 Lionel Bouton , Maintainer - * May be copied or modified under the terms of the GNU General Public License - * - * - * Thanks : - * - * SiS Taiwan : for direct support and hardware. - * Daniela Engert : for initial ATA100 advices and numerous others. - * John Fremlin, Manfred Spraul : - * for checking code correctness, providing patches. - * - * - * Original tests and design on the SiS620/5513 chipset. - * ATA100 tests and design on the SiS735/5513 chipset. - * ATA16/33 design from specs - */ - -/* - * TODO: - * - Get ridden of SisHostChipInfo[] completness dependancy. - * - Get ATA-133 datasheets, implement ATA-133 init code. - * - Study drivers/ide/ide-timing.h. - * - Are there pre-ATA_16 SiS5513 chips ? -> tune init code for them - * or remove ATA_00 define - * - More checks in the config registers (force values instead of - * relying on the BIOS setting them correctly). - * - Further optimisations ? - * . for example ATA66+ regs 0x48 & 0x4A - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#include -#include - -#include "ide_modes.h" - -/* When DEBUG is defined it outputs initial PCI config register - values and changes made to them by the driver */ -// #define DEBUG -/* When BROKEN_LEVEL is defined it limits the DMA mode - at boot time to its value */ -// #define BROKEN_LEVEL XFER_SW_DMA_0 -#define DISPLAY_SIS_TIMINGS - -/* Miscellaneaous flags */ -#define SIS5513_LATENCY 0x01 - -/* registers layout and init values are chipset family dependant */ -/* 1/ define families */ -#define ATA_00 0x00 -#define ATA_16 0x01 -#define ATA_33 0x02 -#define ATA_66 0x03 -#define ATA_100a 0x04 // SiS730 is ATA100 with ATA66 layout -#define ATA_100 0x05 -#define ATA_133 0x06 -/* 2/ variable holding the controller chipset family value */ -static unsigned char chipset_family; - - -/* - * Debug code: following IDE config registers' changes - */ -#ifdef DEBUG -/* Copy of IDE Config registers 0x00 -> 0x57 - Fewer might be used depending on the actual chipset */ -static unsigned char ide_regs_copy[0x58]; - -static byte sis5513_max_config_register(void) { - switch(chipset_family) { - case ATA_00: - case ATA_16: return 0x4f; - case ATA_33: return 0x52; - case ATA_66: - case ATA_100a: - case ATA_100: - case ATA_133: - default: return 0x57; - } -} - -/* Read config registers, print differences from previous read */ -static void sis5513_load_verify_registers(struct pci_dev* dev, char* info) { - int i; - byte reg_val; - byte changed=0; - byte max = sis5513_max_config_register(); - - printk("SIS5513: %s, changed registers:\n", info); - for(i=0; i<=max; i++) { - pci_read_config_byte(dev, i, ®_val); - if (reg_val != ide_regs_copy[i]) { - printk("%0#x: %0#x -> %0#x\n", - i, ide_regs_copy[i], reg_val); - ide_regs_copy[i]=reg_val; - changed=1; - } - } - - if (!changed) { - printk("none\n"); - } -} - -/* Load config registers, no printing */ -static void sis5513_load_registers(struct pci_dev* dev) { - int i; - byte max = sis5513_max_config_register(); - - for(i=0; i<=max; i++) { - pci_read_config_byte(dev, i, &(ide_regs_copy[i])); - } -} - -/* Print a register */ -static void sis5513_print_register(int reg) { - printk(" %0#x:%0#x", reg, ide_regs_copy[reg]); -} - -/* Print valuable registers */ -static void sis5513_print_registers(struct pci_dev* dev, char* marker) { - int i; - byte max = sis5513_max_config_register(); - - sis5513_load_registers(dev); - printk("SIS5513 %s\n", marker); - printk("SIS5513 dump:"); - for(i=0x00; i<0x40; i++) { - if ((i % 0x10)==0) printk("\n "); - sis5513_print_register(i); - } - for(; i<49; i++) { - sis5513_print_register(i); - } - printk("\n "); - - for(; i<=max; i++) { - sis5513_print_register(i); - } - printk("\n"); -} -#endif - - -/* - * Devices supported - */ -static const struct { - const char *name; - unsigned short host_id; - unsigned char chipset_family; - unsigned char flags; -} SiSHostChipInfo[] = { -// { "SiS750", PCI_DEVICE_ID_SI_750, ATA_100, SIS5513_LATENCY }, -// { "SiS745", PCI_DEVICE_ID_SI_745, ATA_100, SIS5513_LATENCY }, - { "SiS740", PCI_DEVICE_ID_SI_740, ATA_100, SIS5513_LATENCY }, - { "SiS735", PCI_DEVICE_ID_SI_735, ATA_100, SIS5513_LATENCY }, - { "SiS730", PCI_DEVICE_ID_SI_730, ATA_100a, SIS5513_LATENCY }, -// { "SiS650", PCI_DEVICE_ID_SI_650, ATA_100, SIS5513_LATENCY }, -// { "SiS645", PCI_DEVICE_ID_SI_645, ATA_100, SIS5513_LATENCY }, - { "SiS635", PCI_DEVICE_ID_SI_635, ATA_100, SIS5513_LATENCY }, - { "SiS640", PCI_DEVICE_ID_SI_640, ATA_66, SIS5513_LATENCY }, - { "SiS630", PCI_DEVICE_ID_SI_630, ATA_66, SIS5513_LATENCY }, - { "SiS620", PCI_DEVICE_ID_SI_620, ATA_66, SIS5513_LATENCY }, - { "SiS540", PCI_DEVICE_ID_SI_540, ATA_66, 0}, - { "SiS530", PCI_DEVICE_ID_SI_530, ATA_66, 0}, - { "SiS5600", PCI_DEVICE_ID_SI_5600, ATA_33, 0}, - { "SiS5598", PCI_DEVICE_ID_SI_5598, ATA_33, 0}, - { "SiS5597", PCI_DEVICE_ID_SI_5597, ATA_33, 0}, - { "SiS5591", PCI_DEVICE_ID_SI_5591, ATA_33, 0}, - { "SiS5513", PCI_DEVICE_ID_SI_5513, ATA_16, 0}, - { "SiS5511", PCI_DEVICE_ID_SI_5511, ATA_16, 0}, -}; - -/* Cycle time bits and values vary accross chip dma capabilities - These three arrays hold the register layout and the values to set. - Indexed by chipset_family and (dma_mode - XFER_UDMA_0) */ -static byte cycle_time_offset[] = {0,0,5,4,4,0,0}; -static byte cycle_time_range[] = {0,0,2,3,3,4,4}; -static byte cycle_time_value[][XFER_UDMA_5 - XFER_UDMA_0 + 1] = { - {0,0,0,0,0,0}, /* no udma */ - {0,0,0,0,0,0}, /* no udma */ - {3,2,1,0,0,0}, - {7,5,3,2,1,0}, - {7,5,3,2,1,0}, - {11,7,5,4,2,1}, - {0,0,0,0,0,0} /* not yet known, ask SiS */ -}; - -static struct pci_dev *host_dev = NULL; - - -/* - * Printing configuration - */ -#if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static int sis_get_info(char *, char **, off_t, int); -extern int (*sis_display_info)(char *, char **, off_t, int); /* ide-proc.c */ -static struct pci_dev *bmide_dev; - -static char* cable_type[] = { - "80 pins", - "40 pins" -}; - -static char* recovery_time[] ={ - "12 PCICLK", "1 PCICLK", - "2 PCICLK", "3 PCICLK", - "4 PCICLK", "5 PCICLCK", - "6 PCICLK", "7 PCICLCK", - "8 PCICLK", "9 PCICLCK", - "10 PCICLK", "11 PCICLK", - "13 PCICLK", "14 PCICLK", - "15 PCICLK", "15 PCICLK" -}; - -static char* active_time[] = { - "8 PCICLK", "1 PCICLCK", - "2 PCICLK", "3 PCICLK", - "4 PCICLK", "5 PCICLK", - "6 PCICLK", "12 PCICLK" -}; - -static char* cycle_time[] = { - "Reserved", "2 CLK", - "3 CLK", "4 CLK", - "5 CLK", "6 CLK", - "7 CLK", "8 CLK", - "9 CLK", "10 CLK", - "11 CLK", "12 CLK", - "Reserved", "Reserved", - "Reserved", "Reserved" -}; - -/* Generic add master or slave info function */ -static char* get_drives_info (char *buffer, byte pos) -{ - byte reg00, reg01, reg10, reg11; /* timing registers */ - char* p = buffer; - -/* Postwrite/Prefetch */ - pci_read_config_byte(bmide_dev, 0x4b, ®00); - p += sprintf(p, "Drive %d: Postwrite %s \t \t Postwrite %s\n", - pos, (reg00 & (0x10 << pos)) ? "Enabled" : "Disabled", - (reg00 & (0x40 << pos)) ? "Enabled" : "Disabled"); - p += sprintf(p, " Prefetch %s \t \t Prefetch %s\n", - (reg00 & (0x01 << pos)) ? "Enabled" : "Disabled", - (reg00 & (0x04 << pos)) ? "Enabled" : "Disabled"); - - pci_read_config_byte(bmide_dev, 0x40+2*pos, ®00); - pci_read_config_byte(bmide_dev, 0x41+2*pos, ®01); - pci_read_config_byte(bmide_dev, 0x44+2*pos, ®10); - pci_read_config_byte(bmide_dev, 0x45+2*pos, ®11); - -/* UDMA */ - if (chipset_family >= ATA_33) { - p += sprintf(p, " UDMA %s \t \t \t UDMA %s\n", - (reg01 & 0x80) ? "Enabled" : "Disabled", - (reg11 & 0x80) ? "Enabled" : "Disabled"); - - p += sprintf(p, " UDMA Cycle Time "); - switch(chipset_family) { - case ATA_33: p += sprintf(p, cycle_time[(reg01 & 0x60) >> 5]); break; - case ATA_66: - case ATA_100a: p += sprintf(p, cycle_time[(reg01 & 0x70) >> 4]); break; - case ATA_100: p += sprintf(p, cycle_time[reg01 & 0x0F]); break; - case ATA_133: - default: p += sprintf(p, "133+ ?"); break; - } - p += sprintf(p, " \t UDMA Cycle Time "); - switch(chipset_family) { - case ATA_33: p += sprintf(p, cycle_time[(reg11 & 0x60) >> 5]); break; - case ATA_66: - case ATA_100a: p += sprintf(p, cycle_time[(reg11 & 0x70) >> 4]); break; - case ATA_100: p += sprintf(p, cycle_time[reg11 & 0x0F]); break; - case ATA_133: - default: p += sprintf(p, "133+ ?"); break; - } - p += sprintf(p, "\n"); - } - -/* Data Active */ - p += sprintf(p, " Data Active Time "); - switch(chipset_family) { - case ATA_00: - case ATA_16: /* confirmed */ - case ATA_33: - case ATA_66: - case ATA_100a: p += sprintf(p, active_time[reg01 & 0x07]); break; - case ATA_100: p += sprintf(p, active_time[(reg00 & 0x70) >> 4]); break; - case ATA_133: - default: p += sprintf(p, "133+ ?"); break; - } - p += sprintf(p, " \t Data Active Time "); - switch(chipset_family) { - case ATA_00: - case ATA_16: - case ATA_33: - case ATA_66: - case ATA_100a: p += sprintf(p, active_time[reg11 & 0x07]); break; - case ATA_100: p += sprintf(p, active_time[(reg10 & 0x70) >> 4]); break; - case ATA_133: - default: p += sprintf(p, "133+ ?"); break; - } - p += sprintf(p, "\n"); - -/* Data Recovery */ - /* warning: may need (reg&0x07) for pre ATA66 chips */ - p += sprintf(p, " Data Recovery Time %s \t Data Recovery Time %s\n", - recovery_time[reg00 & 0x0f], recovery_time[reg10 & 0x0f]); - - return p; -} - -static char* get_masters_info(char* buffer) -{ - return get_drives_info(buffer, 0); -} - -static char* get_slaves_info(char* buffer) -{ - return get_drives_info(buffer, 1); -} - -/* Main get_info, called on /proc/ide/sis reads */ -static int sis_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - byte reg; - u16 reg2, reg3; - - p += sprintf(p, "\nSiS 5513 "); - switch(chipset_family) { - case ATA_00: p += sprintf(p, "Unknown???"); break; - case ATA_16: p += sprintf(p, "DMA 16"); break; - case ATA_33: p += sprintf(p, "Ultra 33"); break; - case ATA_66: p += sprintf(p, "Ultra 66"); break; - case ATA_100a: - case ATA_100: p += sprintf(p, "Ultra 100"); break; - case ATA_133: - default: p+= sprintf(p, "Ultra 133+"); break; - } - p += sprintf(p, " chipset\n"); - p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n"); - -/* Status */ - pci_read_config_byte(bmide_dev, 0x4a, ®); - p += sprintf(p, "Channel Status: "); - if (chipset_family < ATA_66) { - p += sprintf(p, "%s \t \t \t \t %s\n", - (reg & 0x04) ? "On" : "Off", - (reg & 0x02) ? "On" : "Off"); - } else { - p += sprintf(p, "%s \t \t \t \t %s \n", - (reg & 0x02) ? "On" : "Off", - (reg & 0x04) ? "On" : "Off"); - } - -/* Operation Mode */ - pci_read_config_byte(bmide_dev, 0x09, ®); - p += sprintf(p, "Operation Mode: %s \t \t \t %s \n", - (reg & 0x01) ? "Native" : "Compatible", - (reg & 0x04) ? "Native" : "Compatible"); - -/* 80-pin cable ? */ - if (chipset_family > ATA_33) { - pci_read_config_byte(bmide_dev, 0x48, ®); - p += sprintf(p, "Cable Type: %s \t \t \t %s\n", - (reg & 0x10) ? cable_type[1] : cable_type[0], - (reg & 0x20) ? cable_type[1] : cable_type[0]); - } - -/* Prefetch Count */ - pci_read_config_word(bmide_dev, 0x4c, ®2); - pci_read_config_word(bmide_dev, 0x4e, ®3); - p += sprintf(p, "Prefetch Count: %d \t \t \t \t %d\n", - reg2, reg3); - - p = get_masters_info(p); - p = get_slaves_info(p); - - return p-buffer; -} -#endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) */ - - -byte sis_proc = 0; -extern char *ide_xfer_verbose (byte xfer_rate); - - -/* - * Configuration functions - */ -/* Enables per-drive prefetch and postwrite */ -static void config_drive_art_rwp (ide_drive_t *drive) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - - byte reg4bh = 0; - byte rw_prefetch = (0x11 << drive->dn); - -#ifdef DEBUG - printk("SIS5513: config_drive_art_rwp, drive %d\n", drive->dn); - sis5513_load_verify_registers(dev, "config_drive_art_rwp start"); -#endif - - if (drive->media != ide_disk) - return; - pci_read_config_byte(dev, 0x4b, ®4bh); - - if ((reg4bh & rw_prefetch) != rw_prefetch) - pci_write_config_byte(dev, 0x4b, reg4bh|rw_prefetch); -#ifdef DEBUG - sis5513_load_verify_registers(dev, "config_drive_art_rwp end"); -#endif -} - - -/* Set per-drive active and recovery time */ -static void config_art_rwp_pio (ide_drive_t *drive, byte pio) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - - byte timing, drive_pci, test1, test2; - - unsigned short eide_pio_timing[6] = {600, 390, 240, 180, 120, 90}; - unsigned short xfer_pio = drive->id->eide_pio_modes; - -#ifdef DEBUG - sis5513_load_verify_registers(dev, "config_drive_art_rwp_pio start"); -#endif - - config_drive_art_rwp(drive); - pio = ide_get_best_pio_mode(drive, 255, pio, NULL); - - if (xfer_pio> 4) - xfer_pio = 0; - - if (drive->id->eide_pio_iordy > 0) { - for (xfer_pio = 5; - (xfer_pio > 0) && - (drive->id->eide_pio_iordy > eide_pio_timing[xfer_pio]); - xfer_pio--); - } else { - xfer_pio = (drive->id->eide_pio_modes & 4) ? 0x05 : - (drive->id->eide_pio_modes & 2) ? 0x04 : - (drive->id->eide_pio_modes & 1) ? 0x03 : xfer_pio; - } - - timing = (xfer_pio >= pio) ? xfer_pio : pio; - -#ifdef DEBUG - printk("SIS5513: config_drive_art_rwp_pio, drive %d, pio %d, timing %d\n", - drive->dn, pio, timing); -#endif - - switch(drive->dn) { - case 0: drive_pci = 0x40; break; - case 1: drive_pci = 0x42; break; - case 2: drive_pci = 0x44; break; - case 3: drive_pci = 0x46; break; - default: return; - } - - /* register layout changed with newer ATA100 chips */ - if (chipset_family < ATA_100) { - pci_read_config_byte(dev, drive_pci, &test1); - pci_read_config_byte(dev, drive_pci+1, &test2); - - /* Clear active and recovery timings */ - test1 &= ~0x0F; - test2 &= ~0x07; - - switch(timing) { - case 4: test1 |= 0x01; test2 |= 0x03; break; - case 3: test1 |= 0x03; test2 |= 0x03; break; - case 2: test1 |= 0x04; test2 |= 0x04; break; - case 1: test1 |= 0x07; test2 |= 0x06; break; - default: break; - } - pci_write_config_byte(dev, drive_pci, test1); - pci_write_config_byte(dev, drive_pci+1, test2); - } else { - switch(timing) { /* active recovery - v v */ - case 4: test1 = 0x30|0x01; break; - case 3: test1 = 0x30|0x03; break; - case 2: test1 = 0x40|0x04; break; - case 1: test1 = 0x60|0x07; break; - default: break; - } - pci_write_config_byte(dev, drive_pci, test1); - } - -#ifdef DEBUG - sis5513_load_verify_registers(dev, "config_drive_art_rwp_pio start"); -#endif -} - -static int config_chipset_for_pio (ide_drive_t *drive, byte pio) -{ - byte speed; - - switch(pio) { - case 4: speed = XFER_PIO_4; break; - case 3: speed = XFER_PIO_3; break; - case 2: speed = XFER_PIO_2; break; - case 1: speed = XFER_PIO_1; break; - default: speed = XFER_PIO_0; break; - } - - config_art_rwp_pio(drive, pio); - drive->current_speed = speed; - return ide_config_drive_speed(drive, speed); -} - -static int sis5513_tune_chipset (ide_drive_t *drive, byte speed) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - - byte drive_pci, reg; - -#ifdef DEBUG - sis5513_load_verify_registers(dev, "sis5513_tune_chipset start"); - printk("SIS5513: sis5513_tune_chipset, drive %d, speed %d\n", - drive->dn, speed); -#endif - switch(drive->dn) { - case 0: drive_pci = 0x40; break; - case 1: drive_pci = 0x42; break; - case 2: drive_pci = 0x44; break; - case 3: drive_pci = 0x46; break; - default: return ide_dma_off; - } - -#ifdef BROKEN_LEVEL -#ifdef DEBUG - printk("SIS5513: BROKEN_LEVEL activated, speed=%d -> speed=%d\n", speed, BROKEN_LEVEL); -#endif - if (speed > BROKEN_LEVEL) speed = BROKEN_LEVEL; -#endif - - pci_read_config_byte(dev, drive_pci+1, ®); - /* Disable UDMA bit for non UDMA modes on UDMA chips */ - if ((speed < XFER_UDMA_0) && (chipset_family > ATA_16)) { - reg &= 0x7F; - pci_write_config_byte(dev, drive_pci+1, reg); - } - - /* Config chip for mode */ - switch(speed) { -#ifdef CONFIG_BLK_DEV_IDEDMA - case XFER_UDMA_5: - case XFER_UDMA_4: - case XFER_UDMA_3: - case XFER_UDMA_2: - case XFER_UDMA_1: - case XFER_UDMA_0: - /* Force the UDMA bit on if we want to use UDMA */ - reg |= 0x80; - /* clean reg cycle time bits */ - reg &= ~((0xFF >> (8 - cycle_time_range[chipset_family])) - << cycle_time_offset[chipset_family]); - /* set reg cycle time bits */ - reg |= cycle_time_value[chipset_family-ATA_00][speed-XFER_UDMA_0] - << cycle_time_offset[chipset_family]; - pci_write_config_byte(dev, drive_pci+1, reg); - break; - case XFER_MW_DMA_2: - case XFER_MW_DMA_1: - case XFER_MW_DMA_0: - case XFER_SW_DMA_2: - case XFER_SW_DMA_1: - case XFER_SW_DMA_0: - break; -#endif /* CONFIG_BLK_DEV_IDEDMA */ - case XFER_PIO_4: return((int) config_chipset_for_pio(drive, 4)); - case XFER_PIO_3: return((int) config_chipset_for_pio(drive, 3)); - case XFER_PIO_2: return((int) config_chipset_for_pio(drive, 2)); - case XFER_PIO_1: return((int) config_chipset_for_pio(drive, 1)); - case XFER_PIO_0: - default: return((int) config_chipset_for_pio(drive, 0)); - } - drive->current_speed = speed; -#ifdef DEBUG - sis5513_load_verify_registers(dev, "sis5513_tune_chipset end"); -#endif - return ((int) ide_config_drive_speed(drive, speed)); -} - -static void sis5513_tune_drive (ide_drive_t *drive, byte pio) -{ - (void) config_chipset_for_pio(drive, pio); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -/* - * ((id->hw_config & 0x4000|0x2000) && (HWIF(drive)->udma_four)) - */ -static int config_chipset_for_dma (ide_drive_t *drive, byte ultra) -{ - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - - byte speed = 0; - - byte unit = (drive->select.b.unit & 0x01); - byte udma_66 = eighty_ninty_three(drive); - -#ifdef DEBUG - printk("SIS5513: config_chipset_for_dma, drive %d, ultra %d\n", - drive->dn, ultra); -#endif - - if ((id->dma_ultra & 0x0020) && ultra && udma_66 && (chipset_family >= ATA_100a)) - speed = XFER_UDMA_5; - else if ((id->dma_ultra & 0x0010) && ultra && udma_66 && (chipset_family >= ATA_66)) - speed = XFER_UDMA_4; - else if ((id->dma_ultra & 0x0008) && ultra && udma_66 && (chipset_family >= ATA_66)) - speed = XFER_UDMA_3; - else if ((id->dma_ultra & 0x0004) && ultra && (chipset_family >= ATA_33)) - speed = XFER_UDMA_2; - else if ((id->dma_ultra & 0x0002) && ultra && (chipset_family >= ATA_33)) - speed = XFER_UDMA_1; - else if ((id->dma_ultra & 0x0001) && ultra && (chipset_family >= ATA_33)) - speed = XFER_UDMA_0; - else if (id->dma_mword & 0x0004) - speed = XFER_MW_DMA_2; - else if (id->dma_mword & 0x0002) - speed = XFER_MW_DMA_1; - else if (id->dma_mword & 0x0001) - speed = XFER_MW_DMA_0; - else if (id->dma_1word & 0x0004) - speed = XFER_SW_DMA_2; - else if (id->dma_1word & 0x0002) - speed = XFER_SW_DMA_1; - else if (id->dma_1word & 0x0001) - speed = XFER_SW_DMA_0; - else - return ((int) ide_dma_off_quietly); - - outb(inb(hwif->dma_base+2)|(1<<(5+unit)), hwif->dma_base+2); - - sis5513_tune_chipset(drive, speed); - - return ((int) ((id->dma_ultra >> 11) & 7) ? ide_dma_on : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ((id->dma_1word >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); -} - -static int config_drive_xfer_rate (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - ide_dma_action_t dma_func = ide_dma_off_quietly; - - (void) config_chipset_for_pio(drive, 5); - - if (id && (id->capability & 1) && HWIF(drive)->autodma) { - /* Consult the list of known "bad" drives */ - if (ide_dmaproc(ide_dma_bad_drive, drive)) { - dma_func = ide_dma_off; - goto fast_ata_pio; - } - dma_func = ide_dma_off_quietly; - if (id->field_valid & 4) { - if (id->dma_ultra & 0x003F) { - /* Force if Capable UltraDMA */ - dma_func = config_chipset_for_dma(drive, 1); - if ((id->field_valid & 2) && - (dma_func != ide_dma_on)) - goto try_dma_modes; - } - } else if (id->field_valid & 2) { -try_dma_modes: - if ((id->dma_mword & 0x0007) || - (id->dma_1word & 0x0007)) { - /* Force if Capable regular DMA modes */ - dma_func = config_chipset_for_dma(drive, 0); - if (dma_func != ide_dma_on) - goto no_dma_set; - } - } else if ((ide_dmaproc(ide_dma_good_drive, drive)) && - (id->eide_dma_time > 150)) { - /* Consult the list of known "good" drives */ - dma_func = config_chipset_for_dma(drive, 0); - if (dma_func != ide_dma_on) - goto no_dma_set; - } else { - goto fast_ata_pio; - } - } else if ((id->capability & 8) || (id->field_valid & 2)) { -fast_ata_pio: - dma_func = ide_dma_off_quietly; -no_dma_set: - (void) config_chipset_for_pio(drive, 5); - } - - return HWIF(drive)->dmaproc(dma_func, drive); -} - -/* initiates/aborts (U)DMA read/write operations on a drive. */ -int sis5513_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - switch (func) { - case ide_dma_check: - config_drive_art_rwp(drive); - config_art_rwp_pio(drive, 5); - return config_drive_xfer_rate(drive); - default: - break; - } - return ide_dmaproc(func, drive); /* use standard DMA stuff */ -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -/* Chip detection and general config */ -unsigned int __init pci_init_sis5513 (struct pci_dev *dev, const char *name) -{ - struct pci_dev *host; - int i = 0; - - /* Find the chip */ - for (i = 0; i < ARRAY_SIZE(SiSHostChipInfo) && !host_dev; i++) { - host = pci_find_device (PCI_VENDOR_ID_SI, - SiSHostChipInfo[i].host_id, - NULL); - if (!host) - continue; - - host_dev = host; - chipset_family = SiSHostChipInfo[i].chipset_family; - printk(SiSHostChipInfo[i].name); - printk("\n"); - -#ifdef DEBUG - sis5513_print_registers(dev, "pci_init_sis5513 start"); -#endif - - if (SiSHostChipInfo[i].flags & SIS5513_LATENCY) { - byte latency = (chipset_family == ATA_100)? 0x80 : 0x10; /* Lacking specs */ - pci_write_config_byte(dev, PCI_LATENCY_TIMER, latency); - } - } - - /* Make general config ops here - 1/ tell IDE channels to operate in Compabitility mode only - 2/ tell old chips to allow per drive IDE timings */ - if (host_dev) { - byte reg; - switch(chipset_family) { - case ATA_133: - case ATA_100: - /* Set compatibility bit */ - pci_read_config_byte(dev, 0x49, ®); - if (!(reg & 0x01)) { - pci_write_config_byte(dev, 0x49, reg|0x01); - } - break; - case ATA_100a: - case ATA_66: - /* On ATA_66 chips the bit was elsewhere */ - pci_read_config_byte(dev, 0x52, ®); - if (!(reg & 0x04)) { - pci_write_config_byte(dev, 0x52, reg|0x04); - } - break; - case ATA_33: - /* On ATA_33 we didn't have a single bit to set */ - pci_read_config_byte(dev, 0x09, ®); - if ((reg & 0x0f) != 0x00) { - pci_write_config_byte(dev, 0x09, reg&0xf0); - } - case ATA_16: - /* force per drive recovery and active timings - needed on ATA_33 and below chips */ - pci_read_config_byte(dev, 0x52, ®); - if (!(reg & 0x08)) { - pci_write_config_byte(dev, 0x52, reg|0x08); - } - break; - case ATA_00: - default: break; - } - -#if defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) - if (!sis_proc) { - sis_proc = 1; - bmide_dev = dev; - sis_display_info = &sis_get_info; - } -#endif - } -#ifdef DEBUG - sis5513_load_verify_registers(dev, "pci_init_sis5513 end"); -#endif - return 0; -} - -unsigned int __init ata66_sis5513 (ide_hwif_t *hwif) -{ - byte reg48h = 0, ata66 = 0; - byte mask = hwif->channel ? 0x20 : 0x10; - pci_read_config_byte(hwif->pci_dev, 0x48, ®48h); - - if (chipset_family >= ATA_66) { - ata66 = (reg48h & mask) ? 0 : 1; - } - return ata66; -} - -void __init ide_init_sis5513 (ide_hwif_t *hwif) -{ - - hwif->irq = hwif->channel ? 15 : 14; - - hwif->tuneproc = &sis5513_tune_drive; - hwif->speedproc = &sis5513_tune_chipset; - - if (!(hwif->dma_base)) - return; - - if (host_dev) { -#ifdef CONFIG_BLK_DEV_IDEDMA - if (chipset_family > ATA_16) { - hwif->autodma = noautodma ? 0 : 1; - hwif->dmaproc = &sis5513_dmaproc; - } else { -#endif - hwif->autodma = 0; -#ifdef CONFIG_BLK_DEV_IDEDMA - } -#endif - } - return; -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/sl82c105.c linux.20pre5-ac2/drivers/ide/sl82c105.c --- linux.20pre5/drivers/ide/sl82c105.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/sl82c105.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,274 +0,0 @@ -/* - * linux/drivers/ide/sl82c105.c - * - * SL82C105/Winbond 553 IDE driver - * - * Maintainer unknown. - * - * Drive tuning added from Rebel.com's kernel sources - * -- Russell King (15/11/98) linux@arm.linux.org.uk - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "ide_modes.h" - -extern char *ide_xfer_verbose (byte xfer_rate); - -/* - * Convert a PIO mode and cycle time to the required on/off - * times for the interface. This has protection against run-away - * timings. - */ -static unsigned int get_timing_sl82c105(ide_pio_data_t *p) -{ - unsigned int cmd_on; - unsigned int cmd_off; - - cmd_on = (ide_pio_timings[p->pio_mode].active_time + 29) / 30; - cmd_off = (p->cycle_time - 30 * cmd_on + 29) / 30; - - if (cmd_on > 32) - cmd_on = 32; - if (cmd_on == 0) - cmd_on = 1; - - if (cmd_off > 32) - cmd_off = 32; - if (cmd_off == 0) - cmd_off = 1; - - return (cmd_on - 1) << 8 | (cmd_off - 1) | (p->use_iordy ? 0x40 : 0x00); -} - -/* - * Configure the drive and chipset for PIO - */ -static void config_for_pio(ide_drive_t *drive, int pio, int report) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - ide_pio_data_t p; - unsigned short drv_ctrl = 0x909; - unsigned int xfer_mode, reg; - - reg = (hwif->channel ? 0x4c : 0x44) + (drive->select.b.unit ? 4 : 0); - - pio = ide_get_best_pio_mode(drive, pio, 5, &p); - - switch (pio) { - default: - case 0: xfer_mode = XFER_PIO_0; break; - case 1: xfer_mode = XFER_PIO_1; break; - case 2: xfer_mode = XFER_PIO_2; break; - case 3: xfer_mode = XFER_PIO_3; break; - case 4: xfer_mode = XFER_PIO_4; break; - } - - if (ide_config_drive_speed(drive, xfer_mode) == 0) - drv_ctrl = get_timing_sl82c105(&p); - - if (drive->using_dma == 0) { - /* - * If we are actually using MW DMA, then we can not - * reprogram the interface drive control register. - */ - pci_write_config_word(dev, reg, drv_ctrl); - pci_read_config_word(dev, reg, &drv_ctrl); - - if (report) { - printk("%s: selected %s (%dns) (%04X)\n", drive->name, - ide_xfer_verbose(xfer_mode), p.cycle_time, drv_ctrl); - } - } -} - -/* - * Configure the drive and the chipset for DMA - */ -static int config_for_dma(ide_drive_t *drive) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - unsigned short drv_ctrl = 0x909; - unsigned int reg; - - reg = (hwif->channel ? 0x4c : 0x44) + (drive->select.b.unit ? 4 : 0); - - if (ide_config_drive_speed(drive, XFER_MW_DMA_2) == 0) - drv_ctrl = 0x0240; - - pci_write_config_word(dev, reg, drv_ctrl); - - return 0; -} - -/* - * Check to see if the drive and - * chipset is capable of DMA mode - */ -static int sl82c105_check_drive(ide_drive_t *drive) -{ - ide_dma_action_t dma_func = ide_dma_off_quietly; - - do { - struct hd_driveid *id = drive->id; - ide_hwif_t *hwif = HWIF(drive); - - if (!hwif->autodma) - break; - - if (!id || !(id->capability & 1)) - break; - - /* Consult the list of known "bad" drives */ - if (ide_dmaproc(ide_dma_bad_drive, drive)) { - dma_func = ide_dma_off; - break; - } - - if (id->field_valid & 2) { - if (id->dma_mword & 7 || id->dma_1word & 7) - dma_func = ide_dma_on; - break; - } - - if (ide_dmaproc(ide_dma_good_drive, drive)) { - dma_func = ide_dma_on; - break; - } - } while (0); - - return HWIF(drive)->dmaproc(dma_func, drive); -} - -/* - * Our own dmaproc, only to intercept ide_dma_check - */ -static int sl82c105_dmaproc(ide_dma_action_t func, ide_drive_t *drive) -{ - switch (func) { - case ide_dma_check: - return sl82c105_check_drive(drive); - case ide_dma_on: - if (config_for_dma(drive)) - func = ide_dma_off; - /* fall through */ - case ide_dma_off_quietly: - case ide_dma_off: - config_for_pio(drive, 4, 0); - break; - default: - break; - } - return ide_dmaproc(func, drive); -} - -/* - * We only deal with PIO mode here - DMA mode 'using_dma' is not - * initialised at the point that this function is called. - */ -static void tune_sl82c105(ide_drive_t *drive, byte pio) -{ - config_for_pio(drive, pio, 1); - - /* - * We support 32-bit I/O on this interface, and it - * doesn't have problems with interrupts. - */ - drive->io_32bit = 1; - drive->unmask = 1; -} - -/* - * Return the revision of the Winbond bridge - * which this function is part of. - */ -static unsigned int sl82c105_bridge_revision(struct pci_dev *dev) -{ - struct pci_dev *bridge; - unsigned char rev; - - bridge = pci_find_device(PCI_VENDOR_ID_WINBOND, PCI_DEVICE_ID_WINBOND_83C553, NULL); - - /* - * If we are part of a Winbond 553 - */ - if (!bridge || bridge->class >> 8 != PCI_CLASS_BRIDGE_ISA) - return -1; - - if (bridge->bus != dev->bus || - PCI_SLOT(bridge->devfn) != PCI_SLOT(dev->devfn)) - return -1; - - /* - * We need to find function 0's revision, not function 1 - */ - pci_read_config_byte(bridge, PCI_REVISION_ID, &rev); - - return rev; -} - -/* - * Enable the PCI device - */ -unsigned int __init pci_init_sl82c105(struct pci_dev *dev, const char *msg) -{ - unsigned char ctrl_stat; - - /* - * Enable the ports - */ - pci_read_config_byte(dev, 0x40, &ctrl_stat); - pci_write_config_byte(dev, 0x40, ctrl_stat | 0x33); - - return dev->irq; -} - -void __init dma_init_sl82c105(ide_hwif_t *hwif, unsigned long dma_base) -{ - unsigned int rev; - byte dma_state; - - dma_state = inb(dma_base + 2); - rev = sl82c105_bridge_revision(hwif->pci_dev); - if (rev <= 5) { - hwif->autodma = 0; - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - printk(" %s: Winbond 553 bridge revision %d, BM-DMA disabled\n", - hwif->name, rev); - dma_state &= ~0x60; - } else { - dma_state |= 0x60; - hwif->autodma = 1; - } - outb(dma_state, dma_base + 2); - - hwif->dmaproc = NULL; - ide_setup_dma(hwif, dma_base, 8); - if (hwif->dmaproc) - hwif->dmaproc = sl82c105_dmaproc; -} - -/* - * Initialise the chip - */ -void __init ide_init_sl82c105(ide_hwif_t *hwif) -{ - hwif->tuneproc = tune_sl82c105; -} - diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/slc90e66.c linux.20pre5-ac2/drivers/ide/slc90e66.c --- linux.20pre5/drivers/ide/slc90e66.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/slc90e66.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,396 +0,0 @@ -/* - * linux/drivers/ide/slc90e66.c Version 0.10 October 4, 2000 - * - * Copyright (C) 2000 Andre Hedrick - * May be copied or modified under the terms of the GNU General Public License - * - * 00:07.1 IDE interface: EFAR Microsystems: - * Unknown device 9130 (prog-if 8a [Master SecP PriP]) - * Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- - * VGASnoop- ParErr- Stepping- SERR- FastB2B- - * Status: Cap- 66Mhz- UDF- FastB2B- ParErr- DEVSEL=medium - * >TAbort- SERR- -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "ide_modes.h" - -#define SLC90E66_DEBUG_DRIVE_INFO 0 - -#define DISPLAY_SLC90E66_TIMINGS - -#if defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) -#include -#include - -static int slc90e66_get_info(char *, char **, off_t, int); -extern int (*slc90e66_display_info)(char *, char **, off_t, int); /* ide-proc.c */ -extern char *ide_media_verbose(ide_drive_t *); -static struct pci_dev *bmide_dev; - -static int slc90e66_get_info (char *buffer, char **addr, off_t offset, int count) -{ - char *p = buffer; - u32 bibma = pci_resource_start(bmide_dev, 4); - u16 reg40 = 0, psitre = 0, reg42 = 0, ssitre = 0; - u8 c0 = 0, c1 = 0; - u8 reg44 = 0, reg47 = 0, reg48 = 0, reg4a = 0, reg4b = 0; - - pci_read_config_word(bmide_dev, 0x40, ®40); - pci_read_config_word(bmide_dev, 0x42, ®42); - pci_read_config_byte(bmide_dev, 0x44, ®44); - pci_read_config_byte(bmide_dev, 0x47, ®47); - pci_read_config_byte(bmide_dev, 0x48, ®48); - pci_read_config_byte(bmide_dev, 0x4a, ®4a); - pci_read_config_byte(bmide_dev, 0x4b, ®4b); - - psitre = (reg40 & 0x4000) ? 1 : 0; - ssitre = (reg42 & 0x4000) ? 1 : 0; - - /* - * at that point bibma+0x2 et bibma+0xa are byte registers - * to investigate: - */ -#ifdef __mips__ /* only for mips? */ - c0 = inb_p(bibma + 0x02); - c1 = inb_p(bibma + 0x0a); -#else - c0 = inb_p((unsigned short)bibma + 0x02); - c1 = inb_p((unsigned short)bibma + 0x0a); -#endif - - p += sprintf(p, " SLC90E66 Chipset.\n"); - p += sprintf(p, "--------------- Primary Channel ---------------- Secondary Channel -------------\n"); - p += sprintf(p, " %sabled %sabled\n", - (c0&0x80) ? "dis" : " en", - (c1&0x80) ? "dis" : " en"); - p += sprintf(p, "--------------- drive0 --------- drive1 -------- drive0 ---------- drive1 ------\n"); - p += sprintf(p, "DMA enabled: %s %s %s %s\n", - (c0&0x20) ? "yes" : "no ", - (c0&0x40) ? "yes" : "no ", - (c1&0x20) ? "yes" : "no ", - (c1&0x40) ? "yes" : "no " ); - p += sprintf(p, "UDMA enabled: %s %s %s %s\n", - (reg48&0x01) ? "yes" : "no ", - (reg48&0x02) ? "yes" : "no ", - (reg48&0x04) ? "yes" : "no ", - (reg48&0x08) ? "yes" : "no " ); - p += sprintf(p, "UDMA enabled: %s %s %s %s\n", - ((reg4a&0x04)==0x04) ? "4" : - ((reg4a&0x03)==0x03) ? "3" : - (reg4a&0x02) ? "2" : - (reg4a&0x01) ? "1" : - (reg4a&0x00) ? "0" : "X", - ((reg4a&0x40)==0x40) ? "4" : - ((reg4a&0x30)==0x30) ? "3" : - (reg4a&0x20) ? "2" : - (reg4a&0x10) ? "1" : - (reg4a&0x00) ? "0" : "X", - ((reg4b&0x04)==0x04) ? "4" : - ((reg4b&0x03)==0x03) ? "3" : - (reg4b&0x02) ? "2" : - (reg4b&0x01) ? "1" : - (reg4b&0x00) ? "0" : "X", - ((reg4b&0x40)==0x40) ? "4" : - ((reg4b&0x30)==0x30) ? "3" : - (reg4b&0x20) ? "2" : - (reg4b&0x10) ? "1" : - (reg4b&0x00) ? "0" : "X"); - - p += sprintf(p, "UDMA\n"); - p += sprintf(p, "DMA\n"); - p += sprintf(p, "PIO\n"); - -/* - * FIXME.... Add configuration junk data....blah blah...... - */ - - return p-buffer; /* => must be less than 4k! */ -} -#endif /* defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) */ - -/* - * Used to set Fifo configuration via kernel command line: - */ - -byte slc90e66_proc = 0; - -extern char *ide_xfer_verbose (byte xfer_rate); - -#ifdef CONFIG_BLK_DEV_IDEDMA -/* - * - */ -static byte slc90e66_dma_2_pio (byte xfer_rate) { - switch(xfer_rate) { - case XFER_UDMA_4: - case XFER_UDMA_3: - case XFER_UDMA_2: - case XFER_UDMA_1: - case XFER_UDMA_0: - case XFER_MW_DMA_2: - case XFER_PIO_4: - return 4; - case XFER_MW_DMA_1: - case XFER_PIO_3: - return 3; - case XFER_SW_DMA_2: - case XFER_PIO_2: - return 2; - case XFER_MW_DMA_0: - case XFER_SW_DMA_1: - case XFER_SW_DMA_0: - case XFER_PIO_1: - case XFER_PIO_0: - case XFER_PIO_SLOW: - default: - return 0; - } -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -/* - * Based on settings done by AMI BIOS - * (might be useful if drive is not registered in CMOS for any reason). - */ -static void slc90e66_tune_drive (ide_drive_t *drive, byte pio) -{ - unsigned long flags; - u16 master_data; - byte slave_data; - int is_slave = (&HWIF(drive)->drives[1] == drive); - int master_port = HWIF(drive)->index ? 0x42 : 0x40; - int slave_port = 0x44; - /* ISP RTC */ - byte timings[][2] = { { 0, 0 }, - { 0, 0 }, - { 1, 0 }, - { 2, 1 }, - { 2, 3 }, }; - - pio = ide_get_best_pio_mode(drive, pio, 5, NULL); - pci_read_config_word(HWIF(drive)->pci_dev, master_port, &master_data); - if (is_slave) { - master_data = master_data | 0x4000; - if (pio > 1) - /* enable PPE, IE and TIME */ - master_data = master_data | 0x0070; - pci_read_config_byte(HWIF(drive)->pci_dev, slave_port, &slave_data); - slave_data = slave_data & (HWIF(drive)->index ? 0x0f : 0xf0); - slave_data = slave_data | ((timings[pio][0] << 2) | (timings[pio][1] - << (HWIF(drive)->index ? 4 : 0))); - } else { - master_data = master_data & 0xccf8; - if (pio > 1) - /* enable PPE, IE and TIME */ - master_data = master_data | 0x0007; - master_data = master_data | (timings[pio][0] << 12) | - (timings[pio][1] << 8); - } - save_flags(flags); - cli(); - pci_write_config_word(HWIF(drive)->pci_dev, master_port, master_data); - if (is_slave) - pci_write_config_byte(HWIF(drive)->pci_dev, slave_port, slave_data); - restore_flags(flags); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -static int slc90e66_tune_chipset (ide_drive_t *drive, byte speed) -{ - ide_hwif_t *hwif = HWIF(drive); - struct pci_dev *dev = hwif->pci_dev; - byte maslave = hwif->channel ? 0x42 : 0x40; - int a_speed = 7 << (drive->dn * 4); - int u_flag = 1 << drive->dn; - int u_speed = 0; - int err = 0; - int sitre; - short reg4042, reg44, reg48, reg4a; - - pci_read_config_word(dev, maslave, ®4042); - sitre = (reg4042 & 0x4000) ? 1 : 0; - pci_read_config_word(dev, 0x44, ®44); - pci_read_config_word(dev, 0x48, ®48); - pci_read_config_word(dev, 0x4a, ®4a); - - switch(speed) { - case XFER_UDMA_4: u_speed = 4 << (drive->dn * 4); break; - case XFER_UDMA_3: u_speed = 3 << (drive->dn * 4); break; - case XFER_UDMA_2: u_speed = 2 << (drive->dn * 4); break; - case XFER_UDMA_1: u_speed = 1 << (drive->dn * 4); break; - case XFER_UDMA_0: u_speed = 0 << (drive->dn * 4); break; - case XFER_MW_DMA_2: - case XFER_MW_DMA_1: - case XFER_SW_DMA_2: break; -#if 0 /* allow PIO modes */ - default: return -1; -#endif - } - - if (speed >= XFER_UDMA_0) { - if (!(reg48 & u_flag)) - pci_write_config_word(dev, 0x48, reg48|u_flag); - if ((reg4a & u_speed) != u_speed) { - pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); - pci_read_config_word(dev, 0x4a, ®4a); - pci_write_config_word(dev, 0x4a, reg4a|u_speed); - } - } - if (speed < XFER_UDMA_0) { - if (reg48 & u_flag) - pci_write_config_word(dev, 0x48, reg48 & ~u_flag); - if (reg4a & a_speed) - pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); - } - - slc90e66_tune_drive(drive, slc90e66_dma_2_pio(speed)); - -#if SLC90E66_DEBUG_DRIVE_INFO - printk("%s: %s drive%d\n", drive->name, ide_xfer_verbose(speed), drive->dn); -#endif /* SLC90E66_DEBUG_DRIVE_INFO */ - if (!drive->init_speed) - drive->init_speed = speed; - err = ide_config_drive_speed(drive, speed); - drive->current_speed = speed; - return err; -} - -static int slc90e66_config_drive_for_dma (ide_drive_t *drive) -{ - struct hd_driveid *id = drive->id; - int ultra = 1; - byte speed = 0; - byte udma_66 = eighty_ninty_three(drive); - -#if 1 /* allow PIO modes */ - if (!HWIF(drive)->autodma) { - speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL); - (void) slc90e66_tune_chipset(drive, speed); - return ((int) ide_dma_off_quietly); - } -#endif - if ((id->dma_ultra & 0x0010) && (ultra)) { - speed = (udma_66) ? XFER_UDMA_4 : XFER_UDMA_2; - } else if ((id->dma_ultra & 0x0008) && (ultra)) { - speed = (udma_66) ? XFER_UDMA_3 : XFER_UDMA_1; - } else if ((id->dma_ultra & 0x0004) && (ultra)) { - speed = XFER_UDMA_2; - } else if ((id->dma_ultra & 0x0002) && (ultra)) { - speed = XFER_UDMA_1; - } else if ((id->dma_ultra & 0x0001) && (ultra)) { - speed = XFER_UDMA_0; - } else if (id->dma_mword & 0x0004) { - speed = XFER_MW_DMA_2; - } else if (id->dma_mword & 0x0002) { - speed = XFER_MW_DMA_1; - } else if (id->dma_1word & 0x0004) { - speed = XFER_SW_DMA_2; - } else { - speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL); - } - - (void) slc90e66_tune_chipset(drive, speed); - - return ((int) ((id->dma_ultra >> 11) & 7) ? ide_dma_on : - ((id->dma_ultra >> 8) & 7) ? ide_dma_on : - ((id->dma_mword >> 8) & 7) ? ide_dma_on : - ((id->dma_1word >> 8) & 7) ? ide_dma_on : - ide_dma_off_quietly); -} - -static int slc90e66_dmaproc(ide_dma_action_t func, ide_drive_t *drive) -{ - switch (func) { - case ide_dma_check: - return ide_dmaproc((ide_dma_action_t) slc90e66_config_drive_for_dma(drive), drive); - default : - break; - } - /* Other cases are done by generic IDE-DMA code. */ - return ide_dmaproc(func, drive); -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -unsigned int __init pci_init_slc90e66 (struct pci_dev *dev, const char *name) -{ -#if defined(DISPLAY_SLC90E66_TIMINGS) && defined(CONFIG_PROC_FS) - if (!slc90e66_proc) { - slc90e66_proc = 1; - bmide_dev = dev; - slc90e66_display_info = &slc90e66_get_info; - } -#endif /* DISPLAY_SLC90E66_TIMINGS && CONFIG_PROC_FS */ - return 0; -} - -unsigned int __init ata66_slc90e66 (ide_hwif_t *hwif) -{ -#if 1 - byte reg47 = 0, ata66 = 0; - byte mask = hwif->channel ? 0x01 : 0x02; /* bit0:Primary */ - - pci_read_config_byte(hwif->pci_dev, 0x47, ®47); - - ata66 = (reg47 & mask) ? 0 : 1; /* bit[0(1)]: 0:80, 1:40 */ -#else - byte ata66 = 0; -#endif - return ata66; -} - -void __init ide_init_slc90e66 (ide_hwif_t *hwif) -{ - if (!hwif->irq) - hwif->irq = hwif->channel ? 15 : 14; - - hwif->tuneproc = &slc90e66_tune_drive; - hwif->drives[0].autotune = 1; - hwif->drives[1].autotune = 1; - - if (!hwif->dma_base) - return; - - hwif->autodma = 0; -#ifdef CONFIG_BLK_DEV_IDEDMA - if (!noautodma) - hwif->autodma = 1; - hwif->dmaproc = &slc90e66_dmaproc; - hwif->speedproc = &slc90e66_tune_chipset; -#endif /* !CONFIG_BLK_DEV_IDEDMA */ -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/trm290.c linux.20pre5-ac2/drivers/ide/trm290.c --- linux.20pre5/drivers/ide/trm290.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/trm290.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,289 +0,0 @@ -/* - * linux/drivers/ide/trm290.c Version 1.02 Mar. 18, 2000 - * - * Copyright (c) 1997-1998 Mark Lord - * May be copied or modified under the terms of the GNU General Public License - */ - -/* - * This module provides support for the bus-master IDE DMA function - * of the Tekram TRM290 chip, used on a variety of PCI IDE add-on boards, - * including a "Precision Instruments" board. The TRM290 pre-dates - * the sff-8038 standard (ide-dma.c) by a few months, and differs - * significantly enough to warrant separate routines for some functions, - * while re-using others from ide-dma.c. - * - * EXPERIMENTAL! It works for me (a sample of one). - * - * Works reliably for me in DMA mode (READs only), - * DMA WRITEs are disabled by default (see #define below); - * - * DMA is not enabled automatically for this chipset, - * but can be turned on manually (with "hdparm -d1") at run time. - * - * I need volunteers with "spare" drives for further testing - * and development, and maybe to help figure out the peculiarities. - * Even knowing the registers (below), some things behave strangely. - */ - -#define TRM290_NO_DMA_WRITES /* DMA writes seem unreliable sometimes */ - -/* - * TRM-290 PCI-IDE2 Bus Master Chip - * ================================ - * The configuration registers are addressed in normal I/O port space - * and are used as follows: - * - * trm290_base depends on jumper settings, and is probed for by ide-dma.c - * - * trm290_base+2 when WRITTEN: chiptest register (byte, write-only) - * bit7 must always be written as "1" - * bits6-2 undefined - * bit1 1=legacy_compatible_mode, 0=native_pci_mode - * bit0 1=test_mode, 0=normal(default) - * - * trm290_base+2 when READ: status register (byte, read-only) - * bits7-2 undefined - * bit1 channel0 busmaster interrupt status 0=none, 1=asserted - * bit0 channel0 interrupt status 0=none, 1=asserted - * - * trm290_base+3 Interrupt mask register - * bits7-5 undefined - * bit4 legacy_header: 1=present, 0=absent - * bit3 channel1 busmaster interrupt status 0=none, 1=asserted (read only) - * bit2 channel1 interrupt status 0=none, 1=asserted (read only) - * bit1 channel1 interrupt mask: 1=masked, 0=unmasked(default) - * bit0 channel0 interrupt mask: 1=masked, 0=unmasked(default) - * - * trm290_base+1 "CPR" Config Pointer Register (byte) - * bit7 1=autoincrement CPR bits 2-0 after each access of CDR - * bit6 1=min. 1 wait-state posted write cycle (default), 0=0 wait-state - * bit5 0=enabled master burst access (default), 1=disable (write only) - * bit4 PCI DEVSEL# timing select: 1=medium(default), 0=fast - * bit3 0=primary IDE channel, 1=secondary IDE channel - * bits2-0 register index for accesses through CDR port - * - * trm290_base+0 "CDR" Config Data Register (word) - * two sets of seven config registers, - * selected by CPR bit 3 (channel) and CPR bits 2-0 (index 0 to 6), - * each index defined below: - * - * Index-0 Base address register for command block (word) - * defaults: 0x1f0 for primary, 0x170 for secondary - * - * Index-1 general config register (byte) - * bit7 1=DMA enable, 0=DMA disable - * bit6 1=activate IDE_RESET, 0=no action (default) - * bit5 1=enable IORDY, 0=disable IORDY (default) - * bit4 0=16-bit data port(default), 1=8-bit (XT) data port - * bit3 interrupt polarity: 1=active_low, 0=active_high(default) - * bit2 power-saving-mode(?): 1=enable, 0=disable(default) (write only) - * bit1 bus_master_mode(?): 1=enable, 0=disable(default) - * bit0 enable_io_ports: 1=enable(default), 0=disable - * - * Index-2 read-ahead counter preload bits 0-7 (byte, write only) - * bits7-0 bits7-0 of readahead count - * - * Index-3 read-ahead config register (byte, write only) - * bit7 1=enable_readahead, 0=disable_readahead(default) - * bit6 1=clear_FIFO, 0=no_action - * bit5 undefined - * bit4 mode4 timing control: 1=enable, 0=disable(default) - * bit3 undefined - * bit2 undefined - * bits1-0 bits9-8 of read-ahead count - * - * Index-4 base address register for control block (word) - * defaults: 0x3f6 for primary, 0x376 for secondary - * - * Index-5 data port timings (shared by both drives) (byte) - * standard PCI "clk" (clock) counts, default value = 0xf5 - * - * bits7-6 setup time: 00=1clk, 01=2clk, 10=3clk, 11=4clk - * bits5-3 hold time: 000=1clk, 001=2clk, 010=3clk, - * 011=4clk, 100=5clk, 101=6clk, - * 110=8clk, 111=12clk - * bits2-0 active time: 000=2clk, 001=3clk, 010=4clk, - * 011=5clk, 100=6clk, 101=8clk, - * 110=12clk, 111=16clk - * - * Index-6 command/control port timings (shared by both drives) (byte) - * same layout as Index-5, default value = 0xde - * - * Suggested CDR programming for PIO mode0 (600ns): - * 0x01f0,0x21,0xff,0x80,0x03f6,0xf5,0xde ; primary - * 0x0170,0x21,0xff,0x80,0x0376,0xf5,0xde ; secondary - * - * Suggested CDR programming for PIO mode3 (180ns): - * 0x01f0,0x21,0xff,0x80,0x03f6,0x09,0xde ; primary - * 0x0170,0x21,0xff,0x80,0x0376,0x09,0xde ; secondary - * - * Suggested CDR programming for PIO mode4 (120ns): - * 0x01f0,0x21,0xff,0x80,0x03f6,0x00,0xde ; primary - * 0x0170,0x21,0xff,0x80,0x0376,0x00,0xde ; secondary - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -static void trm290_prepare_drive (ide_drive_t *drive, unsigned int use_dma) -{ - ide_hwif_t *hwif = HWIF(drive); - unsigned int reg; - unsigned long flags; - - /* select PIO or DMA */ - reg = use_dma ? (0x21 | 0x82) : (0x21 & ~0x82); - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - - if (reg != hwif->select_data) { - hwif->select_data = reg; - outb(0x51|(hwif->channel<<3), hwif->config_data+1); /* set PIO/DMA */ - outw(reg & 0xff, hwif->config_data); - } - - /* enable IRQ if not probing */ - if (drive->present) { - reg = inw(hwif->config_data+3) & 0x13; - reg &= ~(1 << hwif->channel); - outw(reg, hwif->config_data+3); - } - - __restore_flags(flags); /* local CPU only */ -} - -static void trm290_selectproc (ide_drive_t *drive) -{ - trm290_prepare_drive(drive, drive->using_dma); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA -static int trm290_dmaproc (ide_dma_action_t func, ide_drive_t *drive) -{ - ide_hwif_t *hwif = HWIF(drive); - unsigned int count, reading = 2, writing = 0; - - switch (func) { - case ide_dma_write: - reading = 0; - writing = 1; -#ifdef TRM290_NO_DMA_WRITES - break; /* always use PIO for writes */ -#endif - case ide_dma_read: - if (!(count = ide_build_dmatable(drive, func))) - break; /* try PIO instead of DMA */ - trm290_prepare_drive(drive, 1); /* select DMA xfer */ - outl(hwif->dmatable_dma|reading|writing, hwif->dma_base); - drive->waiting_for_dma = 1; - outw((count * 2) - 1, hwif->dma_base+2); /* start DMA */ - if (drive->media != ide_disk) - return 0; - ide_set_handler(drive, &ide_dma_intr, WAIT_CMD, NULL); - OUT_BYTE(reading ? WIN_READDMA : WIN_WRITEDMA, IDE_COMMAND_REG); - return 0; - case ide_dma_begin: - return 0; - case ide_dma_end: - drive->waiting_for_dma = 0; - ide_destroy_dmatable(drive); /* purge DMA mappings */ - return (inw(hwif->dma_base+2) != 0x00ff); - case ide_dma_test_irq: - return (inw(hwif->dma_base+2) == 0x00ff); - default: - return ide_dmaproc(func, drive); - } - trm290_prepare_drive(drive, 0); /* select PIO xfer */ - return 1; -} -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -/* - * Invoked from ide-dma.c at boot time. - */ -void __init ide_init_trm290 (ide_hwif_t *hwif) -{ - unsigned int cfgbase = 0; - unsigned long flags; - byte reg; - struct pci_dev *dev = hwif->pci_dev; - - hwif->chipset = ide_trm290; - cfgbase = pci_resource_start(dev, 4); - if ((dev->class & 5) && cfgbase) - { - hwif->config_data = cfgbase; - printk("TRM290: chip config base at 0x%04lx\n", hwif->config_data); - } else { - hwif->config_data = 0x3df0; - printk("TRM290: using default config base at 0x%04lx\n", hwif->config_data); - } - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - /* put config reg into first byte of hwif->select_data */ - outb(0x51|(hwif->channel<<3), hwif->config_data+1); - hwif->select_data = 0x21; /* select PIO as default */ - outb(hwif->select_data, hwif->config_data); - reg = inb(hwif->config_data+3); /* get IRQ info */ - reg = (reg & 0x10) | 0x03; /* mask IRQs for both ports */ - outb(reg, hwif->config_data+3); - __restore_flags(flags); /* local CPU only */ - - if ((reg & 0x10)) - hwif->irq = hwif->channel ? 15 : 14; /* legacy mode */ - else if (!hwif->irq && hwif->mate && hwif->mate->irq) - hwif->irq = hwif->mate->irq; /* sharing IRQ with mate */ - ide_setup_dma(hwif, (hwif->config_data + 4) ^ (hwif->channel ? 0x0080 : 0x0000), 3); - -#ifdef CONFIG_BLK_DEV_IDEDMA - hwif->dmaproc = &trm290_dmaproc; -#endif /* CONFIG_BLK_DEV_IDEDMA */ - - hwif->selectproc = &trm290_selectproc; - hwif->autodma = 0; /* play it safe for now */ -#if 1 - { - /* - * My trm290-based card doesn't seem to work with all possible values - * for the control basereg, so this kludge ensures that we use only - * values that are known to work. Ugh. -ml - */ - unsigned short old, compat = hwif->channel ? 0x374 : 0x3f4; - static unsigned short next_offset = 0; - - outb(0x54|(hwif->channel<<3), hwif->config_data+1); - old = inw(hwif->config_data) & ~1; - if (old != compat && inb(old+2) == 0xff) { - compat += (next_offset += 0x400); /* leave lower 10 bits untouched */ -#if 1 - if (ide_check_region(compat + 2, 1)) - printk("Aieee %s: ide_check_region failure at 0x%04x\n", hwif->name, (compat + 2)); - /* - * The region check is not needed; however......... - * Since this is the checked in ide-probe.c, - * this is only an assignment. - */ -#endif - hwif->io_ports[IDE_CONTROL_OFFSET] = compat + 2; - outw(compat|1, hwif->config_data); - printk("%s: control basereg workaround: old=0x%04x, new=0x%04x\n", hwif->name, old, inw(hwif->config_data) & ~1); - } - } -#endif -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/umc8672.c linux.20pre5-ac2/drivers/ide/umc8672.c --- linux.20pre5/drivers/ide/umc8672.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/umc8672.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,160 +0,0 @@ -/* - * linux/drivers/ide/umc8672.c Version 0.05 Jul 31, 1996 - * - * Copyright (C) 1995-1996 Linus Torvalds & author (see below) - */ - -/* - * Principal Author/Maintainer: PODIEN@hml2.atlas.de (Wolfram Podien) - * - * This file provides support for the advanced features - * of the UMC 8672 IDE interface. - * - * Version 0.01 Initial version, hacked out of ide.c, - * and #include'd rather than compiled separately. - * This will get cleaned up in a subsequent release. - * - * Version 0.02 now configs/compiles separate from ide.c -ml - * Version 0.03 enhanced auto-tune, fix display bug - * Version 0.05 replace sti() with restore_flags() -ml - * add detection of possible race condition -ml - */ - -/* - * VLB Controller Support from - * Wolfram Podien - * Rohoefe 3 - * D28832 Achim - * Germany - * - * To enable UMC8672 support there must a lilo line like - * append="ide0=umc8672"... - * To set the speed according to the abilities of the hardware there must be a - * line like - * #define UMC_DRIVE0 11 - * in the beginning of the driver, which sets the speed of drive 0 to 11 (there - * are some lines present). 0 - 11 are allowed speed values. These values are - * the results from the DOS speed test program supplied from UMC. 11 is the - * highest speed (about PIO mode 3) - */ -#define REALLY_SLOW_IO /* some systems can safely undef this */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include "ide_modes.h" - -/* - * Default speeds. These can be changed with "auto-tune" and/or hdparm. - */ -#define UMC_DRIVE0 1 /* DOS measured drive speeds */ -#define UMC_DRIVE1 1 /* 0 to 11 allowed */ -#define UMC_DRIVE2 1 /* 11 = Fastest Speed */ -#define UMC_DRIVE3 1 /* In case of crash reduce speed */ - -static byte current_speeds[4] = {UMC_DRIVE0, UMC_DRIVE1, UMC_DRIVE2, UMC_DRIVE3}; -static const byte pio_to_umc [5] = {0,3,7,10,11}; /* rough guesses */ - -/* 0 1 2 3 4 5 6 7 8 9 10 11 */ -static const byte speedtab [3][12] = { - {0xf, 0xb, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, - {0x3, 0x2, 0x2, 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1 }, - {0xff,0xcb,0xc0,0x58,0x36,0x33,0x23,0x22,0x21,0x11,0x10,0x0}}; - -static void out_umc (char port,char wert) -{ - outb_p (port,0x108); - outb_p (wert,0x109); -} - -static inline byte in_umc (char port) -{ - outb_p (port,0x108); - return inb_p (0x109); -} - -static void umc_set_speeds (byte speeds[]) -{ - int i, tmp; - - outb_p (0x5A,0x108); /* enable umc */ - - out_umc (0xd7,(speedtab[0][speeds[2]] | (speedtab[0][speeds[3]]<<4))); - out_umc (0xd6,(speedtab[0][speeds[0]] | (speedtab[0][speeds[1]]<<4))); - tmp = 0; - for (i = 3; i >= 0; i--) - { - tmp = (tmp << 2) | speedtab[1][speeds[i]]; - } - out_umc (0xdc,tmp); - for (i = 0;i < 4; i++) - { - out_umc (0xd0+i,speedtab[2][speeds[i]]); - out_umc (0xd8+i,speedtab[2][speeds[i]]); - } - outb_p (0xa5,0x108); /* disable umc */ - - printk ("umc8672: drive speeds [0 to 11]: %d %d %d %d\n", - speeds[0], speeds[1], speeds[2], speeds[3]); -} - -static void tune_umc (ide_drive_t *drive, byte pio) -{ - unsigned long flags; - ide_hwgroup_t *hwgroup = ide_hwifs[HWIF(drive)->index^1].hwgroup; - - pio = ide_get_best_pio_mode(drive, pio, 4, NULL); - printk("%s: setting umc8672 to PIO mode%d (speed %d)\n", drive->name, pio, pio_to_umc[pio]); - save_flags(flags); /* all CPUs */ - cli(); /* all CPUs */ - if (hwgroup && hwgroup->handler != NULL) { - printk("umc8672: other interface is busy: exiting tune_umc()\n"); - } else { - current_speeds[drive->name[2] - 'a'] = pio_to_umc[pio]; - umc_set_speeds (current_speeds); - } - restore_flags(flags); /* all CPUs */ -} - -void __init init_umc8672 (void) /* called from ide.c */ -{ - unsigned long flags; - - __save_flags(flags); /* local CPU only */ - __cli(); /* local CPU only */ - if (check_region(0x108, 2)) { - __restore_flags(flags); - printk("\numc8672: PORTS 0x108-0x109 ALREADY IN USE\n"); - return; - } - outb_p (0x5A,0x108); /* enable umc */ - if (in_umc (0xd5) != 0xa0) - { - __restore_flags(flags); /* local CPU only */ - printk ("umc8672: not found\n"); - return; - } - outb_p (0xa5,0x108); /* disable umc */ - - umc_set_speeds (current_speeds); - __restore_flags(flags); /* local CPU only */ - - request_region(0x108, 2, "umc8672"); - ide_hwifs[0].chipset = ide_umc8672; - ide_hwifs[1].chipset = ide_umc8672; - ide_hwifs[0].tuneproc = &tune_umc; - ide_hwifs[1].tuneproc = &tune_umc; - ide_hwifs[0].mate = &ide_hwifs[1]; - ide_hwifs[1].mate = &ide_hwifs[0]; - ide_hwifs[1].channel = 1; -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ide/via82cxxx.c linux.20pre5-ac2/drivers/ide/via82cxxx.c --- linux.20pre5/drivers/ide/via82cxxx.c 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/ide/via82cxxx.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,565 +0,0 @@ -/* - * $Id: via82cxxx.c,v 3.34 2002/02/12 11:26:11 vojtech Exp $ - * - * Copyright (c) 2000-2001 Vojtech Pavlik - * - * Based on the work of: - * Michel Aubry - * Jeff Garzik - * Andre Hedrick - */ - -/* - * VIA IDE driver for Linux. Supports - * - * vt82c576, vt82c586, vt82c586a, vt82c586b, vt82c596a, vt82c596b, - * vt82c686, vt82c686a, vt82c686b, vt8231, vt8233, vt8233c, vt8233a - * - * southbridges, which can be found in - * - * VIA Apollo Master, VP, VP2, VP2/97, VP3, VPX, VPX/97, MVP3, MVP4, P6, Pro, - * ProII, ProPlus, Pro133, Pro133+, Pro133A, Pro133A Dual, Pro133T, Pro133Z, - * PLE133, PLE133T, Pro266, Pro266T, ProP4X266, PM601, PM133, PN133, PL133T, - * PX266, PM266, KX133, KT133, KT133A, KT133E, KLE133, KT266, KX266, KM133, - * KM133A, KL133, KN133, KM266 - * PC-Chips VXPro, VXPro+, VXTwo, TXPro-III, TXPro-AGP, AGPPro, ViaGra, BXToo, - * BXTel, BXpert - * AMD 640, 640 AGP, 750 IronGate, 760, 760MP - * ETEQ 6618, 6628, 6629, 6638 - * Micron Samurai - * - * chipsets. Supports - * - * PIO 0-5, MWDMA 0-2, SWDMA 0-2 and UDMA 0-6 - * - * (this includes UDMA33, 66, 100 and 133) modes. UDMA66 and higher modes are - * autoenabled only in case the BIOS has detected a 80 wire cable. To ignore - * the BIOS data and assume the cable is present, use 'ide0=ata66' or - * 'ide1=ata66' on the kernel command line. - */ - -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Should you need to contact me, the author, you can do so either by - * e-mail - mail your message to , or by paper mail: - * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "ide-timing.h" - -#define VIA_IDE_ENABLE 0x40 -#define VIA_IDE_CONFIG 0x41 -#define VIA_FIFO_CONFIG 0x43 -#define VIA_MISC_1 0x44 -#define VIA_MISC_2 0x45 -#define VIA_MISC_3 0x46 -#define VIA_DRIVE_TIMING 0x48 -#define VIA_8BIT_TIMING 0x4e -#define VIA_ADDRESS_SETUP 0x4c -#define VIA_UDMA_TIMING 0x50 - -#define VIA_UDMA 0x007 -#define VIA_UDMA_NONE 0x000 -#define VIA_UDMA_33 0x001 -#define VIA_UDMA_66 0x002 -#define VIA_UDMA_100 0x003 -#define VIA_UDMA_133 0x004 -#define VIA_BAD_PREQ 0x010 /* Crashes if PREQ# till DDACK# set */ -#define VIA_BAD_CLK66 0x020 /* 66 MHz clock doesn't work correctly */ -#define VIA_SET_FIFO 0x040 /* Needs to have FIFO split set */ -#define VIA_NO_UNMASK 0x080 /* Doesn't work with IRQ unmasking on */ -#define VIA_BAD_ID 0x100 /* Has wrong vendor ID (0x1107) */ - -/* - * VIA SouthBridge chips. - */ - -static struct via_isa_bridge { - char *name; - unsigned short id; - unsigned char rev_min; - unsigned char rev_max; - unsigned short flags; -} via_isa_bridges[] = { -#ifdef FUTURE_BRIDGES - { "vt8237", PCI_DEVICE_ID_VIA_8237, 0x00, 0x2f, VIA_UDMA_133 }, - { "vt8235", PCI_DEVICE_ID_VIA_8235, 0x00, 0x2f, VIA_UDMA_133 }, -#endif - { "vt8233a", PCI_DEVICE_ID_VIA_8233A, 0x00, 0x2f, VIA_UDMA_133 }, - { "vt8233c", PCI_DEVICE_ID_VIA_8233C_0, 0x00, 0x2f, VIA_UDMA_100 }, - { "vt8233", PCI_DEVICE_ID_VIA_8233_0, 0x00, 0x2f, VIA_UDMA_100 }, - { "vt8231", PCI_DEVICE_ID_VIA_8231, 0x00, 0x2f, VIA_UDMA_100 }, - { "vt82c686b", PCI_DEVICE_ID_VIA_82C686, 0x40, 0x4f, VIA_UDMA_100 }, - { "vt82c686a", PCI_DEVICE_ID_VIA_82C686, 0x10, 0x2f, VIA_UDMA_66 }, - { "vt82c686", PCI_DEVICE_ID_VIA_82C686, 0x00, 0x0f, VIA_UDMA_33 | VIA_BAD_CLK66 }, - { "vt82c596b", PCI_DEVICE_ID_VIA_82C596, 0x10, 0x2f, VIA_UDMA_66 }, - { "vt82c596a", PCI_DEVICE_ID_VIA_82C596, 0x00, 0x0f, VIA_UDMA_33 | VIA_BAD_CLK66 }, - { "vt82c586b", PCI_DEVICE_ID_VIA_82C586_0, 0x47, 0x4f, VIA_UDMA_33 | VIA_SET_FIFO }, - { "vt82c586b", PCI_DEVICE_ID_VIA_82C586_0, 0x40, 0x46, VIA_UDMA_33 | VIA_SET_FIFO | VIA_BAD_PREQ }, - { "vt82c586b", PCI_DEVICE_ID_VIA_82C586_0, 0x30, 0x3f, VIA_UDMA_33 | VIA_SET_FIFO }, - { "vt82c586a", PCI_DEVICE_ID_VIA_82C586_0, 0x20, 0x2f, VIA_UDMA_33 | VIA_SET_FIFO }, - { "vt82c586", PCI_DEVICE_ID_VIA_82C586_0, 0x00, 0x0f, VIA_UDMA_NONE | VIA_SET_FIFO }, - { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK }, - { "vt82c576", PCI_DEVICE_ID_VIA_82C576, 0x00, 0x2f, VIA_UDMA_NONE | VIA_SET_FIFO | VIA_NO_UNMASK | VIA_BAD_ID }, - { NULL } -}; - -static struct via_isa_bridge *via_config; -static unsigned char via_enabled; -static unsigned int via_80w; -static unsigned int via_clock; -static char *via_dma[] = { "MWDMA16", "UDMA33", "UDMA66", "UDMA100", "UDMA133" }; - -/* - * VIA /proc entry. - */ - -#ifdef CONFIG_PROC_FS - -#include -#include - -int via_proc, via_base; -static struct pci_dev *bmide_dev, *isa_dev; -extern int (*via_display_info)(char *, char **, off_t, int); /* ide-proc.c */ - -static char *via_control3[] = { "No limit", "64", "128", "192" }; - -#define via_print(format, arg...) p += sprintf(p, format "\n" , ## arg) -#define via_print_drive(name, format, arg...)\ - p += sprintf(p, name); for (i = 0; i < 4; i++) p += sprintf(p, format, ## arg); p += sprintf(p, "\n"); - -static int via_get_info(char *buffer, char **addr, off_t offset, int count) -{ - int speed[4], cycle[4], setup[4], active[4], recover[4], den[4], - uen[4], udma[4], umul[4], active8b[4], recover8b[4]; - struct pci_dev *dev = bmide_dev; - unsigned int v, u, i; - unsigned short c, w; - unsigned char t, x; - char *p = buffer; - - via_print("----------VIA BusMastering IDE Configuration----------------"); - - via_print("Driver Version: 3.34"); - via_print("South Bridge: VIA %s", via_config->name); - - pci_read_config_byte(isa_dev, PCI_REVISION_ID, &t); - pci_read_config_byte(dev, PCI_REVISION_ID, &x); - via_print("Revision: ISA %#x IDE %#x", t, x); - via_print("Highest DMA rate: %s", via_dma[via_config->flags & VIA_UDMA]); - - via_print("BM-DMA base: %#x", via_base); - via_print("PCI clock: %d.%dMHz", via_clock / 1000, via_clock / 100 % 10); - - pci_read_config_byte(dev, VIA_MISC_1, &t); - via_print("Master Read Cycle IRDY: %dws", (t & 64) >> 6); - via_print("Master Write Cycle IRDY: %dws", (t & 32) >> 5); - via_print("BM IDE Status Register Read Retry: %s", (t & 8) ? "yes" : "no"); - - pci_read_config_byte(dev, VIA_MISC_3, &t); - via_print("Max DRDY Pulse Width: %s%s", via_control3[(t & 0x03)], (t & 0x03) ? " PCI clocks" : ""); - - via_print("-----------------------Primary IDE-------Secondary IDE------"); - via_print("Read DMA FIFO flush: %10s%20s", (t & 0x80) ? "yes" : "no", (t & 0x40) ? "yes" : "no"); - via_print("End Sector FIFO flush: %10s%20s", (t & 0x20) ? "yes" : "no", (t & 0x10) ? "yes" : "no"); - - pci_read_config_byte(dev, VIA_IDE_CONFIG, &t); - via_print("Prefetch Buffer: %10s%20s", (t & 0x80) ? "yes" : "no", (t & 0x20) ? "yes" : "no"); - via_print("Post Write Buffer: %10s%20s", (t & 0x40) ? "yes" : "no", (t & 0x10) ? "yes" : "no"); - - pci_read_config_byte(dev, VIA_IDE_ENABLE, &t); - via_print("Enabled: %10s%20s", (t & 0x02) ? "yes" : "no", (t & 0x01) ? "yes" : "no"); - - c = inb(via_base + 0x02) | (inb(via_base + 0x0a) << 8); - via_print("Simplex only: %10s%20s", (c & 0x80) ? "yes" : "no", (c & 0x8000) ? "yes" : "no"); - - via_print("Cable Type: %10s%20s", (via_80w & 1) ? "80w" : "40w", (via_80w & 2) ? "80w" : "40w"); - - via_print("-------------------drive0----drive1----drive2----drive3-----"); - - pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &t); - pci_read_config_dword(dev, VIA_DRIVE_TIMING, &v); - pci_read_config_word(dev, VIA_8BIT_TIMING, &w); - - if (via_config->flags & VIA_UDMA) - pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); - else u = 0; - - for (i = 0; i < 4; i++) { - - setup[i] = ((t >> ((3 - i) << 1)) & 0x3) + 1; - recover8b[i] = ((w >> ((1 - (i >> 1)) << 3)) & 0xf) + 1; - active8b[i] = ((w >> (((1 - (i >> 1)) << 3) + 4)) & 0xf) + 1; - active[i] = ((v >> (((3 - i) << 3) + 4)) & 0xf) + 1; - recover[i] = ((v >> ((3 - i) << 3)) & 0xf) + 1; - udma[i] = ((u >> ((3 - i) << 3)) & 0x7) + 2; - umul[i] = ((u >> (((3 - i) & 2) << 3)) & 0x8) ? 1 : 2; - uen[i] = ((u >> ((3 - i) << 3)) & 0x20); - den[i] = (c & ((i & 1) ? 0x40 : 0x20) << ((i & 2) << 2)); - - speed[i] = 2 * via_clock / (active[i] + recover[i]); - cycle[i] = 1000000 * (active[i] + recover[i]) / via_clock; - - if (!uen[i] || !den[i]) - continue; - - switch (via_config->flags & VIA_UDMA) { - - case VIA_UDMA_33: - speed[i] = 2 * via_clock / udma[i]; - cycle[i] = 1000000 * udma[i] / via_clock; - break; - - case VIA_UDMA_66: - speed[i] = 4 * via_clock / (udma[i] * umul[i]); - cycle[i] = 500000 * (udma[i] * umul[i]) / via_clock; - break; - - case VIA_UDMA_100: - speed[i] = 6 * via_clock / udma[i]; - cycle[i] = 333333 * udma[i] / via_clock; - break; - - case VIA_UDMA_133: - speed[i] = 8 * via_clock / udma[i]; - cycle[i] = 250000 * udma[i] / via_clock; - break; - } - } - - via_print_drive("Transfer Mode: ", "%10s", den[i] ? (uen[i] ? "UDMA" : "DMA") : "PIO"); - - via_print_drive("Address Setup: ", "%8dns", 1000000 * setup[i] / via_clock); - via_print_drive("Cmd Active: ", "%8dns", 1000000 * active8b[i] / via_clock); - via_print_drive("Cmd Recovery: ", "%8dns", 1000000 * recover8b[i] / via_clock); - via_print_drive("Data Active: ", "%8dns", 1000000 * active[i] / via_clock); - via_print_drive("Data Recovery: ", "%8dns", 1000000 * recover[i] / via_clock); - via_print_drive("Cycle Time: ", "%8dns", cycle[i]); - via_print_drive("Transfer Rate: ", "%4d.%dMB/s", speed[i] / 1000, speed[i] / 100 % 10); - - return p - buffer; /* hoping it is less than 4K... */ -} - -#endif - -/* - * via_set_speed() writes timing values to the chipset registers - */ - -static void via_set_speed(struct pci_dev *dev, unsigned char dn, struct ide_timing *timing) -{ - unsigned char t; - - pci_read_config_byte(dev, VIA_ADDRESS_SETUP, &t); - t = (t & ~(3 << ((3 - dn) << 1))) | ((FIT(timing->setup, 1, 4) - 1) << ((3 - dn) << 1)); - pci_write_config_byte(dev, VIA_ADDRESS_SETUP, t); - - pci_write_config_byte(dev, VIA_8BIT_TIMING + (1 - (dn >> 1)), - ((FIT(timing->act8b, 1, 16) - 1) << 4) | (FIT(timing->rec8b, 1, 16) - 1)); - - pci_write_config_byte(dev, VIA_DRIVE_TIMING + (3 - dn), - ((FIT(timing->active, 1, 16) - 1) << 4) | (FIT(timing->recover, 1, 16) - 1)); - - switch (via_config->flags & VIA_UDMA) { - case VIA_UDMA_33: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 5) - 2)) : 0x03; break; - case VIA_UDMA_66: t = timing->udma ? (0xe8 | (FIT(timing->udma, 2, 9) - 2)) : 0x0f; break; - case VIA_UDMA_100: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 9) - 2)) : 0x07; break; - case VIA_UDMA_133: t = timing->udma ? (0xe0 | (FIT(timing->udma, 2, 9) - 2)) : 0x07; break; - default: return; - } - - pci_write_config_byte(dev, VIA_UDMA_TIMING + (3 - dn), t); -} - -/* - * via_set_drive() computes timing values configures the drive and - * the chipset to a desired transfer mode. It also can be called - * by upper layers. - */ - -static int via_set_drive(ide_drive_t *drive, unsigned char speed) -{ - ide_drive_t *peer = HWIF(drive)->drives + (~drive->dn & 1); - struct ide_timing t, p; - unsigned int T, UT; - - if (speed != XFER_PIO_SLOW && speed != drive->current_speed) - if (ide_config_drive_speed(drive, speed)) - printk(KERN_WARNING "ide%d: Drive %d didn't accept speed setting. Oh, well.\n", - drive->dn >> 1, drive->dn & 1); - - T = 1000000000 / via_clock; - - switch (via_config->flags & VIA_UDMA) { - case VIA_UDMA_33: UT = T; break; - case VIA_UDMA_66: UT = T/2; break; - case VIA_UDMA_100: UT = T/3; break; - case VIA_UDMA_133: UT = T/4; break; - default: UT = T; - } - - ide_timing_compute(drive, speed, &t, T, UT); - - if (peer->present) { - ide_timing_compute(peer, peer->current_speed, &p, T, UT); - ide_timing_merge(&p, &t, &t, IDE_TIMING_8BIT); - } - - via_set_speed(HWIF(drive)->pci_dev, drive->dn, &t); - - if (!drive->init_speed) - drive->init_speed = speed; - drive->current_speed = speed; - - return 0; -} - -/* - * via82cxxx_tune_drive() is a callback from upper layers for - * PIO-only tuning. - */ - -static void via82cxxx_tune_drive(ide_drive_t *drive, unsigned char pio) -{ - if (!((via_enabled >> HWIF(drive)->channel) & 1)) - return; - - if (pio == 255) { - via_set_drive(drive, ide_find_best_mode(drive, XFER_PIO | XFER_EPIO)); - return; - } - - via_set_drive(drive, XFER_PIO_0 + MIN(pio, 5)); -} - -#ifdef CONFIG_BLK_DEV_IDEDMA - -/* - * via82cxxx_dmaproc() is a callback from upper layers that can do - * a lot, but we use it for DMA/PIO tuning only, delegating everything - * else to the default ide_dmaproc(). - */ - -int via82cxxx_dmaproc(ide_dma_action_t func, ide_drive_t *drive) -{ - - if (func == ide_dma_check) { - - short w80 = HWIF(drive)->udma_four; - - short speed = ide_find_best_mode(drive, - XFER_PIO | XFER_EPIO | XFER_SWDMA | XFER_MWDMA | - (via_config->flags & VIA_UDMA ? XFER_UDMA : 0) | - (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_66 ? XFER_UDMA_66 : 0) | - (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_100 ? XFER_UDMA_100 : 0) | - (w80 && (via_config->flags & VIA_UDMA) >= VIA_UDMA_133 ? XFER_UDMA_133 : 0)); - - via_set_drive(drive, speed); - - func = (HWIF(drive)->autodma && (speed & XFER_MODE) != XFER_PIO) - ? ide_dma_on : ide_dma_off_quietly; - } - - return ide_dmaproc(func, drive); -} - -#endif /* CONFIG_BLK_DEV_IDEDMA */ - -/* - * The initialization callback. Here we determine the IDE chip type - * and initialize its drive independent registers. - */ - -unsigned int __init pci_init_via82cxxx(struct pci_dev *dev, const char *name) -{ - struct pci_dev *isa = NULL; - unsigned char t, v; - unsigned int u; - int i; - -/* - * Find the ISA bridge to see how good the IDE is. - */ - - for (via_config = via_isa_bridges; via_config->id; via_config++) - if ((isa = pci_find_device(PCI_VENDOR_ID_VIA + - !!(via_config->flags & VIA_BAD_ID), via_config->id, NULL))) { - - pci_read_config_byte(isa, PCI_REVISION_ID, &t); - if (t >= via_config->rev_min && t <= via_config->rev_max) - break; - } - - if (!via_config->id) { - printk(KERN_WARNING "VP_IDE: Unknown VIA SouthBridge, contact Vojtech Pavlik \n"); - return -ENODEV; - } - -/* - * Check 80-wire cable presence and setup Clk66. - */ - - switch (via_config->flags & VIA_UDMA) { - - case VIA_UDMA_66: - pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); /* Enable Clk66 */ - pci_write_config_dword(dev, VIA_UDMA_TIMING, u | 0x80008); - for (i = 24; i >= 0; i -= 8) - if (((u >> (i & 16)) & 8) && ((u >> i) & 0x20) && (((u >> i) & 7) < 2)) - via_80w |= (1 << (1 - (i >> 4))); /* 2x PCI clock and UDMA w/ < 3T/cycle */ - break; - - case VIA_UDMA_100: - pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); - for (i = 24; i >= 0; i -= 8) - if (((u >> i) & 0x10) || (((u >> i) & 0x20) && (((u >> i) & 7) < 4))) - via_80w |= (1 << (1 - (i >> 4))); /* BIOS 80-wire bit or UDMA w/ < 60ns/cycle */ - break; - - case VIA_UDMA_133: - pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); - for (i = 24; i >= 0; i -= 8) - if (((u >> i) & 0x10) || (((u >> i) & 0x20) && (((u >> i) & 7) < 8))) - via_80w |= (1 << (1 - (i >> 4))); /* BIOS 80-wire bit or UDMA w/ < 60ns/cycle */ - break; - - } - - if (via_config->flags & VIA_BAD_CLK66) { /* Disable Clk66 */ - pci_read_config_dword(dev, VIA_UDMA_TIMING, &u); /* Would cause trouble on 596a and 686 */ - pci_write_config_dword(dev, VIA_UDMA_TIMING, u & ~0x80008); - } - -/* - * Check whether interfaces are enabled. - */ - - pci_read_config_byte(dev, VIA_IDE_ENABLE, &v); - via_enabled = ((v & 1) ? 2 : 0) | ((v & 2) ? 1 : 0); - -/* - * Set up FIFO sizes and thresholds. - */ - - pci_read_config_byte(dev, VIA_FIFO_CONFIG, &t); - - if (via_config->flags & VIA_BAD_PREQ) /* Disable PREQ# till DDACK# */ - t &= 0x7f; /* Would crash on 586b rev 41 */ - - if (via_config->flags & VIA_SET_FIFO) { /* Fix FIFO split between channels */ - t &= (t & 0x9f); - switch (via_enabled) { - case 1: t |= 0x00; break; /* 16 on primary */ - case 2: t |= 0x60; break; /* 16 on secondary */ - case 3: t |= 0x20; break; /* 8 pri 8 sec */ - } - } - - pci_write_config_byte(dev, VIA_FIFO_CONFIG, t); - -/* - * Determine system bus clock. - */ - - via_clock = system_bus_clock() * 1000; - - switch (via_clock) { - case 33000: via_clock = 33333; break; - case 37000: via_clock = 37500; break; - case 41000: via_clock = 41666; break; - } - - if (via_clock < 20000 || via_clock > 50000) { - printk(KERN_WARNING "VP_IDE: User given PCI clock speed impossible (%d), using 33 MHz instead.\n", via_clock); - printk(KERN_WARNING "VP_IDE: Use ide0=ata66 if you want to assume 80-wire cable.\n"); - via_clock = 33333; - } - -/* - * Print the boot message. - */ - - pci_read_config_byte(isa, PCI_REVISION_ID, &t); - printk(KERN_INFO "VP_IDE: VIA %s (rev %02x) IDE %s controller on pci%s\n", - via_config->name, t, via_dma[via_config->flags & VIA_UDMA], dev->slot_name); - -/* - * Setup /proc/ide/via entry. - */ - -#ifdef CONFIG_PROC_FS - if (!via_proc) { - via_base = pci_resource_start(dev, 4); - bmide_dev = dev; - isa_dev = isa; - via_display_info = &via_get_info; - via_proc = 1; - } -#endif - - return 0; -} - -unsigned int __init ata66_via82cxxx(ide_hwif_t *hwif) -{ - return ((via_enabled & via_80w) >> hwif->channel) & 1; -} - -void __init ide_init_via82cxxx(ide_hwif_t *hwif) -{ - int i; - - hwif->tuneproc = &via82cxxx_tune_drive; - hwif->speedproc = &via_set_drive; - hwif->autodma = 0; - - for (i = 0; i < 2; i++) { - hwif->drives[i].io_32bit = 1; - hwif->drives[i].unmask = (via_config->flags & VIA_NO_UNMASK) ? 0 : 1; - hwif->drives[i].autotune = 1; - hwif->drives[i].dn = hwif->channel * 2 + i; - } - -#ifdef CONFIG_BLK_DEV_IDEDMA - if (hwif->dma_base) { - hwif->dmaproc = &via82cxxx_dmaproc; -#ifdef CONFIG_IDEDMA_AUTO - if (!noautodma) - hwif->autodma = 1; -#endif - } -#endif /* CONFIG_BLK_DEV_IDEDMA */ -} - -/* - * We allow the BM-DMA driver to only work on enabled interfaces. - */ - -void __init ide_dmacapable_via82cxxx(ide_hwif_t *hwif, unsigned long dmabase) -{ - if ((via_enabled >> hwif->channel) & 1) - ide_setup_dma(hwif, dmabase, 8); -} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/ieee1394/video1394.c linux.20pre5-ac2/drivers/ieee1394/video1394.c --- linux.20pre5/drivers/ieee1394/video1394.c 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/ieee1394/video1394.c 2002-08-25 15:55:59.000000000 +0100 @@ -871,13 +871,13 @@ } ohci->ISO_channel_usage |= mask; - if (v.buf_size<=0) { + if (v.buf_size == 0 || v.buf_size > VIDEO1394_MAX_SIZE) { PRINT(KERN_ERR, ohci->id, "Invalid %d length buffer requested",v.buf_size); return -EFAULT; } - if (v.nb_buffers<=0) { + if (v.nb_buffers == 0 || v.nb_buffers > VIDEO1394_MAX_SIZE) { PRINT(KERN_ERR, ohci->id, "Invalid %d buffers requested",v.nb_buffers); return -EFAULT; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/isdn/hisax/st5481.h linux.20pre5-ac2/drivers/isdn/hisax/st5481.h --- linux.20pre5/drivers/isdn/hisax/st5481.h 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/isdn/hisax/st5481.h 2002-09-02 14:57:05.000000000 +0100 @@ -218,6 +218,19 @@ #define L1_EVENT_COUNT (EV_TIMER3 + 1) +#if (__GNUC__ > 2) + +#define ERR(format, arg...) \ +printk(KERN_ERR __FILE__ ": %s: " format "\n" , __FUNCTION__ , ## arg) + +#define WARN(format, arg...) \ +printk(KERN_WARNING __FILE__ ": %s: " format "\n" , __FUNCTION__ , ## arg) + +#define INFO(format, arg...) \ +printk(KERN_INFO __FILE__ ": %s: " format "\n" , __FUNCTION__ , ## arg) + +#else + #define ERR(format, arg...) \ printk(KERN_ERR __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg) @@ -227,6 +240,8 @@ #define INFO(format, arg...) \ printk(KERN_INFO __FILE__ ": " __FUNCTION__ ": " format "\n" , ## arg) +#endif + #include "st5481_hdlc.h" #include "fsm.h" #include "hisax_if.h" diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/Config.in linux.20pre5-ac2/drivers/md/Config.in --- linux.20pre5/drivers/md/Config.in 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/Config.in 2002-08-12 22:42:29.000000000 +0100 @@ -14,5 +14,8 @@ dep_tristate ' Multipath I/O support' CONFIG_MD_MULTIPATH $CONFIG_BLK_DEV_MD dep_tristate ' Logical volume manager (LVM) support' CONFIG_BLK_DEV_LVM $CONFIG_MD +if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + dep_tristate ' Device-mapper support (EXPERIMENTAL)' CONFIG_BLK_DEV_DM $CONFIG_MD +fi endmenu diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/dm.c linux.20pre5-ac2/drivers/md/dm.c --- linux.20pre5/drivers/md/dm.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/dm.c 2002-08-15 13:15:20.000000000 +0100 @@ -0,0 +1,1158 @@ +/* + * Copyright (C) 2001 Sistina Software (UK) Limited. + * + * This file is released under the GPL. + */ + +#include "dm.h" + +#include +#include + +/* we only need this for the lv_bmap struct definition, not happy */ +#include + +#define DEFAULT_READ_AHEAD 64 + +static const char *_name = DM_NAME; + +static int major = 0; +static int _major = 0; + +struct io_hook { + struct mapped_device *md; + struct target *target; + int rw; + + void (*end_io) (struct buffer_head * bh, int uptodate); + void *context; +}; + +static kmem_cache_t *_io_hook_cache; + +static struct mapped_device *_devs[MAX_DEVICES]; +static struct rw_semaphore _dev_locks[MAX_DEVICES]; + +/* + * This lock is only held by dm_create and dm_set_name to avoid + * race conditions where someone else may create a device with + * the same name. + */ +static spinlock_t _create_lock = SPIN_LOCK_UNLOCKED; + +/* block device arrays */ +static int _block_size[MAX_DEVICES]; +static int _blksize_size[MAX_DEVICES]; +static int _hardsect_size[MAX_DEVICES]; + +static devfs_handle_t _dev_dir; + +static int request(request_queue_t * q, int rw, struct buffer_head *bh); +static int dm_user_bmap(struct inode *inode, struct lv_bmap *lvb); + +/* + * Protect the mapped_devices referenced from _dev[] + */ +struct mapped_device *dm_get_r(int minor) +{ + struct mapped_device *md; + + if (minor >= MAX_DEVICES) + return NULL; + + down_read(_dev_locks + minor); + md = _devs[minor]; + if (!md) + up_read(_dev_locks + minor); + return md; +} + +struct mapped_device *dm_get_w(int minor) +{ + struct mapped_device *md; + + if (minor >= MAX_DEVICES) + return NULL; + + down_write(_dev_locks + minor); + md = _devs[minor]; + if (!md) + up_write(_dev_locks + minor); + return md; +} + +static int namecmp(struct mapped_device *md, const char *name, int nametype) +{ + switch (nametype) { + case DM_LOOKUP_BY_NAME: + return strcmp(md->name, name); + break; + + case DM_LOOKUP_BY_UUID: + if (!md->uuid) + return -1; /* never equal */ + + return strcmp(md->uuid, name); + break; + + default: + DMWARN("Unknown comparison type in namecmp: %d", nametype); + BUG(); + } + + return -1; +} + +/* + * The interface (eg, ioctl) will probably access the devices + * through these slow 'by name' locks, this needs improving at + * some point if people start playing with *large* numbers of dm + * devices. + */ +struct mapped_device *dm_get_name_r(const char *name, int nametype) +{ + int i; + struct mapped_device *md; + + for (i = 0; i < MAX_DEVICES; i++) { + md = dm_get_r(i); + if (md) { + if (!namecmp(md, name, nametype)) + return md; + + dm_put_r(md); + } + } + + return NULL; +} + +struct mapped_device *dm_get_name_w(const char *name, int nametype) +{ + int i; + struct mapped_device *md; + + /* + * To avoid getting write locks on all the devices we try + * and promote a read lock to a write lock, this can + * fail, in which case we just start again. + */ + + restart: + for (i = 0; i < MAX_DEVICES; i++) { + md = dm_get_r(i); + if (!md) + continue; + + if (namecmp(md, name, nametype)) { + dm_put_r(md); + continue; + } + + /* found it */ + dm_put_r(md); + + md = dm_get_w(i); + if (!md) + goto restart; + + if (namecmp(md, name, nametype)) { + dm_put_w(md); + goto restart; + } + + return md; + } + + return NULL; +} + +void dm_put_r(struct mapped_device *md) +{ + int minor = MINOR(md->dev); + + if (minor >= MAX_DEVICES) + return; + + up_read(_dev_locks + minor); +} + +void dm_put_w(struct mapped_device *md) +{ + int minor = MINOR(md->dev); + + if (minor >= MAX_DEVICES) + return; + + up_write(_dev_locks + minor); +} + +/* + * Setup and tear down the driver + */ +static __init void init_locks(void) +{ + int i; + + for (i = 0; i < MAX_DEVICES; i++) + init_rwsem(_dev_locks + i); +} + +static __init int local_init(void) +{ + int r; + + init_locks(); + + /* allocate a slab for the io-hooks */ + if (!_io_hook_cache && + !(_io_hook_cache = kmem_cache_create("dm io hooks", + sizeof(struct io_hook), + 0, 0, NULL, NULL))) + return -ENOMEM; + + _major = major; + r = devfs_register_blkdev(_major, _name, &dm_blk_dops); + if (r < 0) { + DMERR("register_blkdev failed"); + kmem_cache_destroy(_io_hook_cache); + return r; + } + + if (!_major) + _major = r; + + /* set up the arrays */ + read_ahead[_major] = DEFAULT_READ_AHEAD; + blk_size[_major] = _block_size; + blksize_size[_major] = _blksize_size; + hardsect_size[_major] = _hardsect_size; + + blk_queue_make_request(BLK_DEFAULT_QUEUE(_major), request); + + _dev_dir = devfs_mk_dir(0, DM_DIR, NULL); + + return 0; +} + +static void local_exit(void) +{ + if (kmem_cache_destroy(_io_hook_cache)) + DMWARN("io_hooks still allocated during unregistration"); + _io_hook_cache = NULL; + + if (devfs_unregister_blkdev(_major, _name) < 0) + DMERR("devfs_unregister_blkdev failed"); + + read_ahead[_major] = 0; + blk_size[_major] = NULL; + blksize_size[_major] = NULL; + hardsect_size[_major] = NULL; + _major = 0; + + DMINFO("cleaned up"); +} + +/* + * We have a lot of init/exit functions, so it seems easier to + * store them in an array. The disposable macro 'xx' + * expands a prefix into a pair of function names. + */ +static struct { + int (*init)(void); + void (*exit)(void); + +} _inits[] = { +#define xx(n) {n ## _init, n ## _exit}, + xx(local) + xx(dm_target) + xx(dm_linear) + xx(dm_stripe) + xx(dm_snapshot) + xx(dm_interface) +#undef xx +}; + +static int __init dm_init(void) +{ + const int count = sizeof(_inits) / sizeof(*_inits); + + int r, i; + + for (i = 0; i < count; i++) { + r = _inits[i].init(); + if (r) + goto bad; + } + + return 0; + + bad: + while (i--) + _inits[i].exit(); + + return r; +} + +static void __exit dm_exit(void) +{ + int i = sizeof(_inits) / sizeof(*_inits); + + dm_destroy_all(); + while (i--) + _inits[i].exit(); +} + +/* + * Block device functions + */ +static int dm_blk_open(struct inode *inode, struct file *file) +{ + struct mapped_device *md; + + md = dm_get_w(MINOR(inode->i_rdev)); + if (!md) + return -ENXIO; + + md->use_count++; + dm_put_w(md); + + return 0; +} + +static int dm_blk_close(struct inode *inode, struct file *file) +{ + struct mapped_device *md; + + md = dm_get_w(MINOR(inode->i_rdev)); + if (!md) + return -ENXIO; + + if (md->use_count < 1) + DMWARN("incorrect reference count found in mapped_device"); + + md->use_count--; + dm_put_w(md); + + return 0; +} + +/* In 512-byte units */ +#define VOLUME_SIZE(minor) (_block_size[(minor)] << 1) + +static int dm_blk_ioctl(struct inode *inode, struct file *file, + uint command, unsigned long a) +{ + int minor = MINOR(inode->i_rdev); + long size; + + if (minor >= MAX_DEVICES) + return -ENXIO; + + switch (command) { + case BLKROSET: + case BLKROGET: + case BLKRASET: + case BLKRAGET: + case BLKFLSBUF: + case BLKSSZGET: + //case BLKRRPART: /* Re-read partition tables */ + //case BLKPG: + case BLKELVGET: + case BLKELVSET: + case BLKBSZGET: + case BLKBSZSET: + return blk_ioctl(inode->i_rdev, command, a); + break; + + case BLKGETSIZE: + size = VOLUME_SIZE(minor); + if (copy_to_user((void *) a, &size, sizeof(long))) + return -EFAULT; + break; + + case BLKGETSIZE64: + size = VOLUME_SIZE(minor); + if (put_user((u64) ((u64) size) << 9, (u64 *) a)) + return -EFAULT; + break; + + case BLKRRPART: + return -ENOTTY; + + case LV_BMAP: + return dm_user_bmap(inode, (struct lv_bmap *) a); + + default: + DMWARN("unknown block ioctl 0x%x", command); + return -ENOTTY; + } + + return 0; +} + +static inline struct io_hook *alloc_io_hook(void) +{ + return kmem_cache_alloc(_io_hook_cache, GFP_NOIO); +} + +static inline void free_io_hook(struct io_hook *ih) +{ + kmem_cache_free(_io_hook_cache, ih); +} + +/* + * FIXME: We need to decide if deferred_io's need + * their own slab, I say no for now since they are + * only used when the device is suspended. + */ +static inline struct deferred_io *alloc_deferred(void) +{ + return kmalloc(sizeof(struct deferred_io), GFP_NOIO); +} + +static inline void free_deferred(struct deferred_io *di) +{ + kfree(di); +} + +/* + * Call a target's optional error function if an I/O failed. + */ +static inline int call_err_fn(struct io_hook *ih, struct buffer_head *bh) +{ + dm_err_fn err = ih->target->type->err; + + if (err) + return err(bh, ih->rw, ih->target->private); + + return 0; +} + +/* + * bh->b_end_io routine that decrements the pending count + * and then calls the original bh->b_end_io fn. + */ +static void dec_pending(struct buffer_head *bh, int uptodate) +{ + struct io_hook *ih = bh->b_private; + + if (!uptodate && call_err_fn(ih, bh)) + return; + + if (atomic_dec_and_test(&ih->md->pending)) + /* nudge anyone waiting on suspend queue */ + wake_up(&ih->md->wait); + + bh->b_end_io = ih->end_io; + bh->b_private = ih->context; + free_io_hook(ih); + + bh->b_end_io(bh, uptodate); +} + +/* + * Add the bh to the list of deferred io. + */ +static int queue_io(struct buffer_head *bh, int rw) +{ + struct deferred_io *di = alloc_deferred(); + struct mapped_device *md; + + if (!di) + return -ENOMEM; + + md = dm_get_w(MINOR(bh->b_rdev)); + if (!md) { + free_deferred(di); + return -ENXIO; + } + + if (!md->suspended) { + dm_put_w(md); + free_deferred(di); + return 1; + } + + di->bh = bh; + di->rw = rw; + di->next = md->deferred; + md->deferred = di; + + dm_put_w(md); + + return 0; /* deferred successfully */ +} + +/* + * Do the bh mapping for a given leaf + */ +static inline int __map_buffer(struct mapped_device *md, + struct buffer_head *bh, int rw, int leaf) +{ + int r; + dm_map_fn fn; + void *context; + struct io_hook *ih = NULL; + struct target *ti = md->map->targets + leaf; + + fn = ti->type->map; + context = ti->private; + + ih = alloc_io_hook(); + + if (!ih) + return -1; + + ih->md = md; + ih->rw = rw; + ih->target = ti; + ih->end_io = bh->b_end_io; + ih->context = bh->b_private; + + r = fn(bh, rw, context); + + if (r > 0) { + /* hook the end io request fn */ + atomic_inc(&md->pending); + bh->b_end_io = dec_pending; + bh->b_private = ih; + + } else if (r == 0) + /* we don't need to hook */ + free_io_hook(ih); + + else if (r < 0) { + free_io_hook(ih); + return -1; + } + + return r; +} + +/* + * Search the btree for the correct target. + */ +static inline int __find_node(struct dm_table *t, struct buffer_head *bh) +{ + int l, n = 0, k = 0; + offset_t *node; + + for (l = 0; l < t->depth; l++) { + n = get_child(n, k); + node = get_node(t, l, n); + + for (k = 0; k < KEYS_PER_NODE; k++) + if (node[k] >= bh->b_rsector) + break; + } + + return (KEYS_PER_NODE * n) + k; +} + +static int request(request_queue_t * q, int rw, struct buffer_head *bh) +{ + struct mapped_device *md; + int r, minor = MINOR(bh->b_rdev); + unsigned int block_size = _blksize_size[minor]; + + md = dm_get_r(minor); + if (!md) { + buffer_IO_error(bh); + return 0; + } + + /* + * Sanity checks. + */ + if (bh->b_size > block_size) + DMERR("request is larger than block size " + "b_size (%d), block size (%d)", + bh->b_size, block_size); + + if (bh->b_rsector & ((bh->b_size >> 9) - 1)) + DMERR("misaligned block requested logical " + "sector (%lu), b_size (%d)", + bh->b_rsector, bh->b_size); + + /* + * If we're suspended we have to queue + * this io for later. + */ + while (md->suspended) { + dm_put_r(md); + + if (rw == READA) + goto bad_no_lock; + + r = queue_io(bh, rw); + + if (r < 0) + goto bad_no_lock; + + else if (r == 0) + return 0; /* deferred successfully */ + + /* + * We're in a while loop, because someone could suspend + * before we get to the following read lock. + */ + md = dm_get_r(minor); + if (!md) { + buffer_IO_error(bh); + return 0; + } + } + + if ((r = __map_buffer(md, bh, rw, __find_node(md->map, bh))) < 0) + goto bad; + + dm_put_r(md); + return r; + + bad: + dm_put_r(md); + + bad_no_lock: + buffer_IO_error(bh); + return 0; +} + +static int check_dev_size(int minor, unsigned long block) +{ + /* FIXME: check this */ + unsigned long max_sector = (_block_size[minor] << 1) + 1; + unsigned long sector = (block + 1) * (_blksize_size[minor] >> 9); + + return (sector > max_sector) ? 0 : 1; +} + +/* + * Creates a dummy buffer head and maps it (for lilo). + */ +static int do_bmap(kdev_t dev, unsigned long block, + kdev_t * r_dev, unsigned long *r_block) +{ + struct mapped_device *md; + struct buffer_head bh; + int minor = MINOR(dev), r; + struct target *t; + + md = dm_get_r(minor); + if (!md) + return -ENXIO; + + if (md->suspended) { + dm_put_r(md); + return -EPERM; + } + + if (!check_dev_size(minor, block)) { + dm_put_r(md); + return -EINVAL; + } + + /* setup dummy bh */ + memset(&bh, 0, sizeof(bh)); + bh.b_blocknr = block; + bh.b_dev = bh.b_rdev = dev; + bh.b_size = _blksize_size[minor]; + bh.b_rsector = block * (bh.b_size >> 9); + + /* find target */ + t = md->map->targets + __find_node(md->map, &bh); + + /* do the mapping */ + r = t->type->map(&bh, READ, t->private); + + *r_dev = bh.b_rdev; + *r_block = bh.b_rsector / (bh.b_size >> 9); + + dm_put_r(md); + return r; +} + +/* + * Marshals arguments and results between user and kernel space. + */ +static int dm_user_bmap(struct inode *inode, struct lv_bmap *lvb) +{ + unsigned long block, r_block; + kdev_t r_dev; + int r; + + if (get_user(block, &lvb->lv_block)) + return -EFAULT; + + if ((r = do_bmap(inode->i_rdev, block, &r_dev, &r_block))) + return r; + + if (put_user(kdev_t_to_nr(r_dev), &lvb->lv_dev) || + put_user(r_block, &lvb->lv_block)) + return -EFAULT; + + return 0; +} + +/* + * See if the device with a specific minor # is free. The write + * lock is held when it returns successfully. + */ +static inline int specific_dev(int minor, struct mapped_device *md) +{ + if (minor >= MAX_DEVICES) { + DMWARN("request for a mapped_device beyond MAX_DEVICES (%d)", + MAX_DEVICES); + return -1; + } + + down_write(_dev_locks + minor); + if (_devs[minor]) { + /* in use */ + up_write(_dev_locks + minor); + return -1; + } + + return minor; +} + +/* + * Find the first free device. Again the write lock is held on + * success. + */ +static int any_old_dev(struct mapped_device *md) +{ + int i; + + for (i = 0; i < MAX_DEVICES; i++) + if (specific_dev(i, md) != -1) + return i; + + return -1; +} + +/* + * Allocate and initialise a blank device. + * Caller must ensure uuid is null-terminated. + * Device is returned with a write lock held. + */ +static struct mapped_device *alloc_dev(const char *name, const char *uuid, + int minor) +{ + struct mapped_device *md = kmalloc(sizeof(*md), GFP_KERNEL); + int len; + + if (!md) { + DMWARN("unable to allocate device, out of memory."); + return NULL; + } + + memset(md, 0, sizeof(*md)); + + /* + * This grabs the write lock if it succeeds. + */ + minor = (minor < 0) ? any_old_dev(md) : specific_dev(minor, md); + if (minor < 0) { + kfree(md); + return NULL; + } + + md->dev = MKDEV(_major, minor); + md->suspended = 0; + + strncpy(md->name, name, sizeof(md->name) - 1); + md->name[sizeof(md->name) - 1] = '\0'; + + /* + * Copy in the uuid. + */ + if (uuid && *uuid) { + len = strlen(uuid) + 1; + if (!(md->uuid = kmalloc(len, GFP_KERNEL))) { + DMWARN("unable to allocate uuid - out of memory."); + kfree(md); + return NULL; + } + strcpy(md->uuid, uuid); + } + + init_waitqueue_head(&md->wait); + return md; +} + +static int __register_device(struct mapped_device *md) +{ + md->devfs_entry = + devfs_register(_dev_dir, md->name, DEVFS_FL_CURRENT_OWNER, + MAJOR(md->dev), MINOR(md->dev), + S_IFBLK | S_IRUSR | S_IWUSR | S_IRGRP, + &dm_blk_dops, NULL); + + return 0; +} + +static int __unregister_device(struct mapped_device *md) +{ + devfs_unregister(md->devfs_entry); + return 0; +} + +/* + * The hardsect size for a mapped device is the largest hardsect size + * from the devices it maps onto. + */ +static int __find_hardsect_size(struct list_head *devices) +{ + int result = 512, size; + struct list_head *tmp; + + list_for_each(tmp, devices) { + struct dm_dev *dd = list_entry(tmp, struct dm_dev, list); + size = get_hardsect_size(dd->dev); + if (size > result) + result = size; + } + + return result; +} + +/* + * Bind a table to the device. + */ +static int __bind(struct mapped_device *md, struct dm_table *t) +{ + int minor = MINOR(md->dev); + + md->map = t; + + if (!t->num_targets) { + _block_size[minor] = 0; + _blksize_size[minor] = BLOCK_SIZE; + _hardsect_size[minor] = 0; + return 0; + } + + /* in k */ + _block_size[minor] = (t->highs[t->num_targets - 1] + 1) >> 1; + + _blksize_size[minor] = BLOCK_SIZE; + _hardsect_size[minor] = __find_hardsect_size(&t->devices); + register_disk(NULL, md->dev, 1, &dm_blk_dops, _block_size[minor]); + + return 0; +} + +static void __unbind(struct mapped_device *md) +{ + int minor = MINOR(md->dev); + + dm_table_destroy(md->map); + md->map = NULL; + + _block_size[minor] = 0; + _blksize_size[minor] = 0; + _hardsect_size[minor] = 0; +} + +static int check_name(const char *name) +{ + struct mapped_device *md; + + if (strchr(name, '/') || strlen(name) > DM_NAME_LEN) { + DMWARN("invalid device name"); + return -1; + } + + md = dm_get_name_r(name, DM_LOOKUP_BY_NAME); + if (md) { + dm_put_r(md); + DMWARN("device name already in use"); + return -1; + } + + return 0; +} + +static int check_uuid(const char *uuid) +{ + struct mapped_device *md; + + if (uuid) { + md = dm_get_name_r(uuid, DM_LOOKUP_BY_UUID); + if (md) { + dm_put_r(md); + DMWARN("device uuid already in use"); + return -1; + } + } + + return 0; +} + +/* + * Constructor for a new device. + */ +int dm_create(const char *name, const char *uuid, int minor, int ro, + struct dm_table *table) +{ + int r; + struct mapped_device *md; + + spin_lock(&_create_lock); + if (check_name(name) || check_uuid(uuid)) { + spin_unlock(&_create_lock); + return -EINVAL; + } + + md = alloc_dev(name, uuid, minor); + if (!md) { + spin_unlock(&_create_lock); + return -ENXIO; + } + minor = MINOR(md->dev); + _devs[minor] = md; + + r = __register_device(md); + if (r) + goto err; + + r = __bind(md, table); + if (r) + goto err; + + dm_set_ro(md, ro); + + spin_unlock(&_create_lock); + dm_put_w(md); + return 0; + + err: + _devs[minor] = NULL; + if (md->uuid) + kfree(md->uuid); + + dm_put_w(md); + kfree(md); + spin_unlock(&_create_lock); + return r; +} + +/* + * Renames the device. No lock held. + */ +int dm_set_name(const char *name, int nametype, const char *newname) +{ + int r; + struct mapped_device *md; + + spin_lock(&_create_lock); + if (check_name(newname) < 0) { + spin_unlock(&_create_lock); + return -EINVAL; + } + + md = dm_get_name_w(name, nametype); + if (!md) { + spin_unlock(&_create_lock); + return -ENXIO; + } + + r = __unregister_device(md); + if (r) + goto out; + + strcpy(md->name, newname); + r = __register_device(md); + + out: + dm_put_w(md); + spin_unlock(&_create_lock); + return r; +} + +/* + * Destructor for the device. You cannot destroy an open + * device. Write lock must be held before calling. + * Caller must dm_put_w(md) then kfree(md) if call was successful. + */ +int dm_destroy(struct mapped_device *md) +{ + int minor, r; + + if (md->use_count) + return -EPERM; + + r = __unregister_device(md); + if (r) + return r; + + minor = MINOR(md->dev); + _devs[minor] = NULL; + __unbind(md); + + if (md->uuid) + kfree(md->uuid); + + return 0; +} + +/* + * Destroy all devices - except open ones + */ +void dm_destroy_all(void) +{ + int i, some_destroyed, r; + struct mapped_device *md; + + do { + some_destroyed = 0; + for (i = 0; i < MAX_DEVICES; i++) { + md = dm_get_w(i); + if (!md) + continue; + + r = dm_destroy(md); + dm_put_w(md); + + if (!r) { + kfree(md); + some_destroyed = 1; + } + } + } while (some_destroyed); +} + +/* + * Sets or clears the read-only flag for the device. Write lock + * must be held. + */ +void dm_set_ro(struct mapped_device *md, int ro) +{ + md->read_only = ro; + set_device_ro(md->dev, ro); +} + +/* + * Requeue the deferred buffer_heads by calling generic_make_request. + */ +static void flush_deferred_io(struct deferred_io *c) +{ + struct deferred_io *n; + + while (c) { + n = c->next; + generic_make_request(c->rw, c->bh); + free_deferred(c); + c = n; + } +} + +/* + * Swap in a new table (destroying old one). Write lock must be + * held. + */ +int dm_swap_table(struct mapped_device *md, struct dm_table *table) +{ + int r; + + /* device must be suspended */ + if (!md->suspended) + return -EPERM; + + __unbind(md); + + r = __bind(md, table); + if (r) + return r; + + return 0; +} + +/* + * We need to be able to change a mapping table under a mounted + * filesystem. for example we might want to move some data in + * the background. Before the table can be swapped with + * dm_bind_table, dm_suspend must be called to flush any in + * flight buffer_heads and ensure that any further io gets + * deferred. Write lock must be held. + */ +int dm_suspend(struct mapped_device *md) +{ + int minor = MINOR(md->dev); + DECLARE_WAITQUEUE(wait, current); + + if (md->suspended) + return -EINVAL; + + md->suspended = 1; + dm_put_w(md); + + /* wait for all the pending io to flush */ + add_wait_queue(&md->wait, &wait); + current->state = TASK_UNINTERRUPTIBLE; + do { + md = dm_get_w(minor); + if (!md) { + /* Caller expects to free this lock. Yuck. */ + down_write(_dev_locks + minor); + return -ENXIO; + } + + if (!atomic_read(&md->pending)) + break; + + dm_put_w(md); + schedule(); + + } while (1); + + current->state = TASK_RUNNING; + remove_wait_queue(&md->wait, &wait); + + return 0; +} + +int dm_resume(struct mapped_device *md) +{ + int minor = MINOR(md->dev); + struct deferred_io *def; + + if (!md->suspended || !md->map->num_targets) + return -EINVAL; + + md->suspended = 0; + def = md->deferred; + md->deferred = NULL; + + dm_put_w(md); + flush_deferred_io(def); + run_task_queue(&tq_disk); + + if (!dm_get_w(minor)) { + /* FIXME: yuck */ + down_write(_dev_locks + minor); + return -ENXIO; + } + + return 0; +} + +struct block_device_operations dm_blk_dops = { + open: dm_blk_open, + release: dm_blk_close, + ioctl: dm_blk_ioctl, + owner: THIS_MODULE +}; + +/* + * module hooks + */ +module_init(dm_init); +module_exit(dm_exit); + +MODULE_PARM(major, "i"); +MODULE_PARM_DESC(major, "The major number of the device mapper"); +MODULE_DESCRIPTION(DM_NAME " driver"); +MODULE_AUTHOR("Joe Thornber "); +MODULE_LICENSE("GPL"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/dm-exception-store.c linux.20pre5-ac2/drivers/md/dm-exception-store.c --- linux.20pre5/drivers/md/dm-exception-store.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/dm-exception-store.c 2002-08-12 22:44:36.000000000 +0100 @@ -0,0 +1,724 @@ +/* + * dm-snapshot.c + * + * Copyright (C) 2001-2002 Sistina Software (UK) Limited. + * + * This file is released under the GPL. + */ + +#include "dm-snapshot.h" +#include "kcopyd.h" +#include +#include + +#define SECTOR_SIZE 512 +#define SECTOR_SHIFT 9 + +/*----------------------------------------------------------------- + * Persistent snapshots, by persistent we mean that the snapshot + * will survive a reboot. + *---------------------------------------------------------------*/ + +/* + * We need to store a record of which parts of the origin have + * been copied to the snapshot device. The snapshot code + * requires that we copy exception chunks to chunk aligned areas + * of the COW store. It makes sense therefore, to store the + * metadata in chunk size blocks. + * + * There is no backward or forward compatibility implemented, + * snapshots with different disk versions than the kernel will + * not be usable. It is expected that "lvcreate" will blank out + * the start of a fresh COW device before calling the snapshot + * constructor. + * + * The first chunk of the COW device just contains the header. + * After this there is a chunk filled with exception metadata, + * followed by as many exception chunks as can fit in the + * metadata areas. + * + * All on disk structures are in little-endian format. The end + * of the exceptions info is indicated by an exception with a + * new_chunk of 0, which is invalid since it would point to the + * header chunk. + */ + +/* + * Magic for persistent snapshots: "SnAp" - Feeble isn't it. + */ +#define SNAP_MAGIC 0x70416e53 + +/* + * The on-disk version of the metadata. + */ +#define SNAPSHOT_DISK_VERSION 1 + +struct disk_header { + uint32_t magic; + + /* + * Is this snapshot valid. There is no way of recovering + * an invalid snapshot. + */ + int valid; + + /* + * Simple, incrementing version. no backward + * compatibility. + */ + uint32_t version; + + /* In sectors */ + uint32_t chunk_size; +}; + +struct disk_exception { + uint64_t old_chunk; + uint64_t new_chunk; +}; + +struct commit_callback { + void (*callback)(void *, int success); + void *context; +}; + +/* + * The top level structure for a persistent exception store. + */ +struct pstore { + struct dm_snapshot *snap; /* up pointer to my snapshot */ + int version; + int valid; + uint32_t chunk_size; + uint32_t exceptions_per_area; + + /* + * Now that we have an asynchronous kcopyd there is no + * need for large chunk sizes, so it wont hurt to have a + * whole chunks worth of metadata in memory at once. + */ + void *area; + struct kiobuf *iobuf; + + /* + * Used to keep track of which metadata area the data in + * 'chunk' refers to. + */ + uint32_t current_area; + + /* + * The next free chunk for an exception. + */ + uint32_t next_free; + + /* + * The index of next free exception in the current + * metadata area. + */ + uint32_t current_committed; + + atomic_t pending_count; + uint32_t callback_count; + struct commit_callback *callbacks; +}; + +/* + * For performance reasons we want to defer writing a committed + * exceptions metadata to disk so that we can amortise away this + * exensive operation. + * + * For the initial version of this code we will remain with + * synchronous io. There are some deadlock issues with async + * that I haven't yet worked out. + */ +static int do_io(int rw, struct kcopyd_region *where, struct kiobuf *iobuf) +{ + int i, sectors_per_block, nr_blocks, start; + int blocksize = get_hardsect_size(where->dev); + int status; + + sectors_per_block = blocksize / SECTOR_SIZE; + + nr_blocks = where->count / sectors_per_block; + start = where->sector / sectors_per_block; + + for (i = 0; i < nr_blocks; i++) + iobuf->blocks[i] = start++; + + iobuf->length = where->count << 9; + iobuf->locked = 1; + + status = brw_kiovec(rw, 1, &iobuf, where->dev, iobuf->blocks, + blocksize); + if (status != (where->count << 9)) + return -EIO; + + return 0; +} + +#if LINUX_VERSION_CODE < KERNEL_VERSION ( 2, 4, 19) +/* + * FIXME: Remove once 2.4.19 has been released. + */ +struct page *vmalloc_to_page(void *vmalloc_addr) +{ + unsigned long addr = (unsigned long) vmalloc_addr; + struct page *page = NULL; + pmd_t *pmd; + pte_t *pte; + pgd_t *pgd; + + pgd = pgd_offset_k(addr); + if (!pgd_none(*pgd)) { + pmd = pmd_offset(pgd, addr); + if (!pmd_none(*pmd)) { + pte = pte_offset(pmd, addr); + if (pte_present(*pte)) { + page = pte_page(*pte); + } + } + } + return page; +} +#endif + +static int allocate_iobuf(struct pstore *ps) +{ + size_t i, r = -ENOMEM, len, nr_pages; + struct page *page; + + len = ps->chunk_size << SECTOR_SHIFT; + + /* + * Allocate the chunk_size block of memory that will hold + * a single metadata area. + */ + ps->area = vmalloc(len); + if (!ps->area) + return r; + + if (alloc_kiovec(1, &ps->iobuf)) + goto bad; + + nr_pages = ps->chunk_size / (PAGE_SIZE / SECTOR_SIZE); + r = expand_kiobuf(ps->iobuf, nr_pages); + if (r) + goto bad; + + /* + * We lock the pages for ps->area into memory since they'll be + * doing a lot of io. + */ + for (i = 0; i < nr_pages; i++) { + page = vmalloc_to_page(ps->area + (i * PAGE_SIZE)); + LockPage(page); + ps->iobuf->maplist[i] = page; + ps->iobuf->nr_pages++; + } + + ps->iobuf->nr_pages = nr_pages; + ps->iobuf->offset = 0; + + return 0; + + bad: + if (ps->iobuf) + free_kiovec(1, &ps->iobuf); + + if (ps->area) + vfree(ps->area); + ps->iobuf = NULL; + return r; +} + +static void free_iobuf(struct pstore *ps) +{ + int i; + + for (i = 0; i < ps->iobuf->nr_pages; i++) + UnlockPage(ps->iobuf->maplist[i]); + ps->iobuf->locked = 0; + + free_kiovec(1, &ps->iobuf); + vfree(ps->area); +} + +/* + * Read or write a chunk aligned and sized block of data from a device. + */ +static int chunk_io(struct pstore *ps, uint32_t chunk, int rw) +{ + int r; + struct kcopyd_region where; + + where.dev = ps->snap->cow->dev; + where.sector = ps->chunk_size * chunk; + where.count = ps->chunk_size; + + r = do_io(rw, &where, ps->iobuf); + if (r) + return r; + + return 0; +} + +/* + * Read or write a metadata area. Remembering to skip the first + * chunk which holds the header. + */ +static int area_io(struct pstore *ps, uint32_t area, int rw) +{ + int r; + uint32_t chunk; + + /* convert a metadata area index to a chunk index */ + chunk = 1 + ((ps->exceptions_per_area + 1) * area); + + r = chunk_io(ps, chunk, rw); + if (r) + return r; + + ps->current_area = area; + return 0; +} + +static int zero_area(struct pstore *ps, uint32_t area) +{ + memset(ps->area, 0, ps->chunk_size << SECTOR_SHIFT); + return area_io(ps, area, WRITE); +} + +static int read_header(struct pstore *ps, int *new_snapshot) +{ + int r; + struct disk_header *dh; + + r = chunk_io(ps, 0, READ); + if (r) + return r; + + dh = (struct disk_header *) ps->area; + + if (dh->magic == 0) { + *new_snapshot = 1; + + } else if (dh->magic == SNAP_MAGIC) { + *new_snapshot = 0; + ps->valid = dh->valid; + ps->version = dh->version; + ps->chunk_size = dh->chunk_size; + + } else { + DMWARN("Invalid/corrupt snapshot"); + r = -ENXIO; + } + + return r; +} + +static int write_header(struct pstore *ps) +{ + struct disk_header *dh; + + memset(ps->area, 0, ps->chunk_size << SECTOR_SHIFT); + + dh = (struct disk_header *) ps->area; + dh->magic = SNAP_MAGIC; + dh->valid = ps->valid; + dh->version = ps->version; + dh->chunk_size = ps->chunk_size; + + return chunk_io(ps, 0, WRITE); +} + +/* + * Access functions for the disk exceptions, these do the endian conversions. + */ +static struct disk_exception *get_exception(struct pstore *ps, uint32_t index) +{ + if (index >= ps->exceptions_per_area) + return NULL; + + return ((struct disk_exception *) ps->area) + index; +} + +static int read_exception(struct pstore *ps, + uint32_t index, struct disk_exception *result) +{ + struct disk_exception *e; + + e = get_exception(ps, index); + if (!e) + return -EINVAL; + + /* copy it */ + result->old_chunk = le64_to_cpu(e->old_chunk); + result->new_chunk = le64_to_cpu(e->new_chunk); + + return 0; +} + +static int write_exception(struct pstore *ps, + uint32_t index, struct disk_exception *de) +{ + struct disk_exception *e; + + e = get_exception(ps, index); + if (!e) + return -EINVAL; + + /* copy it */ + e->old_chunk = cpu_to_le64(de->old_chunk); + e->new_chunk = cpu_to_le64(de->new_chunk); + + return 0; +} + +/* + * Registers the exceptions that are present in the current area. + * 'full' is filled in to indicate if the area has been + * filled. + */ +static int insert_exceptions(struct pstore *ps, int *full) +{ + int i, r; + struct disk_exception de; + + /* presume the area is full */ + *full = 1; + + for (i = 0; i < ps->exceptions_per_area; i++) { + r = read_exception(ps, i, &de); + + if (r) + return r; + + /* + * If the new_chunk is pointing at the start of + * the COW device, where the first metadata area + * is we know that we've hit the end of the + * exceptions. Therefore the area is not full. + */ + if (de.new_chunk == 0LL) { + ps->current_committed = i; + *full = 0; + break; + } + + /* + * Keep track of the start of the free chunks. + */ + if (ps->next_free <= de.new_chunk) + ps->next_free = de.new_chunk + 1; + + /* + * Otherwise we add the exception to the snapshot. + */ + r = dm_add_exception(ps->snap, de.old_chunk, de.new_chunk); + if (r) + return r; + } + + return 0; +} + +static int read_exceptions(struct pstore *ps) +{ + uint32_t area; + int r, full = 1; + + /* + * Keeping reading chunks and inserting exceptions until + * we find a partially full area. + */ + for (area = 0; full; area++) { + r = area_io(ps, area, READ); + if (r) + return r; + + r = insert_exceptions(ps, &full); + if (r) + return r; + + area++; + } + + return 0; +} + +static inline struct pstore *get_info(struct exception_store *store) +{ + return (struct pstore *) store->context; +} + +static int persistent_percentfull(struct exception_store *store) +{ + struct pstore *ps = get_info(store); + return (ps->next_free * store->snap->chunk_size * 100) / + get_dev_size(store->snap->cow->dev); +} + +static void persistent_destroy(struct exception_store *store) +{ + struct pstore *ps = get_info(store); + + vfree(ps->callbacks); + free_iobuf(ps); + kfree(ps); +} + +static int persistent_prepare(struct exception_store *store, + struct exception *e) +{ + struct pstore *ps = get_info(store); + uint32_t stride; + offset_t size = get_dev_size(store->snap->cow->dev); + + /* Is there enough room ? */ + if (size <= (ps->next_free * store->snap->chunk_size)) + return -ENOSPC; + + e->new_chunk = ps->next_free; + + /* + * Move onto the next free pending, making sure to take + * into account the location of the metadata chunks. + */ + stride = (ps->exceptions_per_area + 1); + if (!(++ps->next_free % stride)) + ps->next_free++; + + atomic_inc(&ps->pending_count); + return 0; +} + +static void persistent_commit(struct exception_store *store, + struct exception *e, + void (*callback) (void *, int success), + void *callback_context) +{ + int r, i; + struct pstore *ps = get_info(store); + struct disk_exception de; + struct commit_callback *cb; + + de.old_chunk = e->old_chunk; + de.new_chunk = e->new_chunk; + write_exception(ps, ps->current_committed++, &de); + + /* + * Add the callback to the back of the array. This code + * is the only place where the callback array is + * manipulated, and we know that it will never be called + * multiple times concurrently. + */ + cb = ps->callbacks + ps->callback_count++; + cb->callback = callback; + cb->context = callback_context; + + /* + * If there are no more exceptions in flight, or we have + * filled this metadata area we commit the exceptions to + * disk. + */ + if (atomic_dec_and_test(&ps->pending_count) || + (ps->current_committed == ps->exceptions_per_area)) { + r = area_io(ps, ps->current_area, WRITE); + if (r) + ps->valid = 0; + + for (i = 0; i < ps->callback_count; i++) { + cb = ps->callbacks + i; + cb->callback(cb->context, r == 0 ? 1 : 0); + } + + ps->callback_count = 0; + } + + /* + * Have we completely filled the current area ? + */ + if (ps->current_committed == ps->exceptions_per_area) { + ps->current_committed = 0; + r = zero_area(ps, ps->current_area + 1); + if (r) + ps->valid = 0; + } +} + +static void persistent_drop(struct exception_store *store) +{ + struct pstore *ps = get_info(store); + + ps->valid = 0; + if (write_header(ps)) + DMWARN("write header failed"); +} + +int dm_create_persistent(struct exception_store *store, uint32_t chunk_size) +{ + int r, new_snapshot; + struct pstore *ps; + + /* allocate the pstore */ + ps = kmalloc(sizeof(*ps), GFP_KERNEL); + if (!ps) + return -ENOMEM; + + ps->snap = store->snap; + ps->valid = 1; + ps->version = SNAPSHOT_DISK_VERSION; + ps->chunk_size = chunk_size; + ps->exceptions_per_area = (chunk_size << SECTOR_SHIFT) / + sizeof(struct disk_exception); + ps->next_free = 2; /* skipping the header and first area */ + ps->current_committed = 0; + + r = allocate_iobuf(ps); + if (r) + goto bad; + + /* + * Allocate space for all the callbacks. + */ + ps->callback_count = 0; + atomic_set(&ps->pending_count, 0); + ps->callbacks = vcalloc(ps->exceptions_per_area, + sizeof(*ps->callbacks)); + + if (!ps->callbacks) + goto bad; + + /* + * Read the snapshot header. + */ + r = read_header(ps, &new_snapshot); + if (r) + goto bad; + + /* + * Do we need to setup a new snapshot ? + */ + if (new_snapshot) { + r = write_header(ps); + if (r) { + DMWARN("write_header failed"); + goto bad; + } + + r = zero_area(ps, 0); + if (r) { + DMWARN("zero_area(0) failed"); + goto bad; + } + + } else { + /* + * Sanity checks. + */ + if (ps->chunk_size != chunk_size) { + DMWARN("chunk size for existing snapshot different " + "from that requested"); + r = -EINVAL; + goto bad; + } + + if (ps->version != SNAPSHOT_DISK_VERSION) { + DMWARN("unable to handle snapshot disk version %d", + ps->version); + r = -EINVAL; + goto bad; + } + + /* + * Read the metadata. + */ + r = read_exceptions(ps); + if (r) + goto bad; + } + + store->destroy = persistent_destroy; + store->prepare_exception = persistent_prepare; + store->commit_exception = persistent_commit; + store->drop_snapshot = persistent_drop; + store->percent_full = persistent_percentfull; + store->context = ps; + + return r; + + bad: + if (ps) { + if (ps->callbacks) + vfree(ps->callbacks); + + if (ps->iobuf) + free_iobuf(ps); + + kfree(ps); + } + return r; +} + +/*----------------------------------------------------------------- + * Implementation of the store for non-persistent snapshots. + *---------------------------------------------------------------*/ +struct transient_c { + offset_t next_free; +}; + +void transient_destroy(struct exception_store *store) +{ + kfree(store->context); +} + +int transient_prepare(struct exception_store *store, struct exception *e) +{ + struct transient_c *tc = (struct transient_c *) store->context; + offset_t size = get_dev_size(store->snap->cow->dev); + + if (size < (tc->next_free + store->snap->chunk_size)) + return -1; + + e->new_chunk = sector_to_chunk(store->snap, tc->next_free); + tc->next_free += store->snap->chunk_size; + + return 0; +} + +void transient_commit(struct exception_store *store, + struct exception *e, + void (*callback) (void *, int success), + void *callback_context) +{ + /* Just succeed */ + callback(callback_context, 1); +} + +static int transient_percentfull(struct exception_store *store) +{ + struct transient_c *tc = (struct transient_c *) store->context; + return (tc->next_free * 100) / get_dev_size(store->snap->cow->dev); +} + +int dm_create_transient(struct exception_store *store, + struct dm_snapshot *s, int blocksize, void **error) +{ + struct transient_c *tc; + + memset(store, 0, sizeof(*store)); + store->destroy = transient_destroy; + store->prepare_exception = transient_prepare; + store->commit_exception = transient_commit; + store->percent_full = transient_percentfull; + store->snap = s; + + tc = kmalloc(sizeof(struct transient_c), GFP_KERNEL); + if (!tc) + return -ENOMEM; + + tc->next_free = 0; + store->context = tc; + + return 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/dm.h linux.20pre5-ac2/drivers/md/dm.h --- linux.20pre5/drivers/md/dm.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/dm.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,241 @@ +/* + * Internal header file for device mapper + * + * Copyright (C) 2001 Sistina Software + * + * This file is released under the LGPL. + */ + +#ifndef DM_INTERNAL_H +#define DM_INTERNAL_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DM_NAME "device-mapper" /* Name for messaging */ +#define DM_DRIVER_EMAIL "lvm-devel@lists.sistina.com" +#define MAX_DEPTH 16 +#define NODE_SIZE L1_CACHE_BYTES +#define KEYS_PER_NODE (NODE_SIZE / sizeof(offset_t)) +#define CHILDREN_PER_NODE (KEYS_PER_NODE + 1) +#define MAX_ARGS 32 +#define MAX_DEVICES 256 + +/* + * List of devices that a metadevice uses and should open/close. + */ +struct dm_dev { + atomic_t count; + struct list_head list; + + int mode; + + kdev_t dev; + struct block_device *bd; +}; + +/* + * I/O that had to be deferred while we were suspended + */ +struct deferred_io { + int rw; + struct buffer_head *bh; + struct deferred_io *next; +}; + +/* + * Btree leaf - this does the actual mapping + */ +struct target { + struct target_type *type; + void *private; +}; + +/* + * The btree + */ +struct dm_table { + /* btree table */ + int depth; + int counts[MAX_DEPTH]; /* in nodes */ + offset_t *index[MAX_DEPTH]; + + int num_targets; + int num_allocated; + offset_t *highs; + struct target *targets; + + /* + * Indicates the rw permissions for the new logical + * device. This should be a combination of FMODE_READ + * and FMODE_WRITE. + */ + int mode; + + /* a list of devices used by this table */ + struct list_head devices; + + /* + * A waitqueue for processes waiting for something + * interesting to happen to this table. + */ + wait_queue_head_t eventq; +}; + +/* + * The actual device struct + */ +struct mapped_device { + kdev_t dev; + char name[DM_NAME_LEN]; + char *uuid; + + int use_count; + int suspended; + int read_only; + + /* a list of io's that arrived while we were suspended */ + atomic_t pending; + wait_queue_head_t wait; + struct deferred_io *deferred; + + struct dm_table *map; + + /* used by dm-fs.c */ + devfs_handle_t devfs_entry; +}; + +extern struct block_device_operations dm_blk_dops; + +/* dm-target.c */ +int dm_target_init(void); +struct target_type *dm_get_target_type(const char *name); +void dm_put_target_type(struct target_type *t); +void dm_target_exit(void); + +/* + * Destructively splits argument list to pass to ctr. + */ +int split_args(int max, int *argc, char **argv, char *input); + +/* dm.c */ +struct mapped_device *dm_get_r(int minor); +struct mapped_device *dm_get_w(int minor); + +/* + * There are two ways to lookup a device. + */ +enum { + DM_LOOKUP_BY_NAME, + DM_LOOKUP_BY_UUID +}; + +struct mapped_device *dm_get_name_r(const char *name, int nametype); +struct mapped_device *dm_get_name_w(const char *name, int nametype); + +void dm_put_r(struct mapped_device *md); +void dm_put_w(struct mapped_device *md); + +/* + * Call with no lock. + */ +int dm_create(const char *name, const char *uuid, int minor, int ro, + struct dm_table *table); +int dm_set_name(const char *name, int nametype, const char *newname); +void dm_destroy_all(void); + +/* + * You must have the write lock before calling the remaining md + * methods. + */ +int dm_destroy(struct mapped_device *md); +void dm_set_ro(struct mapped_device *md, int ro); + +/* + * The device must be suspended before calling this method. + */ +int dm_swap_table(struct mapped_device *md, struct dm_table *t); + +/* + * A device can still be used while suspended, but I/O is deferred. + */ +int dm_suspend(struct mapped_device *md); +int dm_resume(struct mapped_device *md); + +/* dm-table.c */ +int dm_table_create(struct dm_table **result, int mode); +void dm_table_destroy(struct dm_table *t); + +int dm_table_add_target(struct dm_table *t, offset_t highs, + struct target_type *type, void *private); +int dm_table_complete(struct dm_table *t); + +/* + * Event handling + */ +void dm_table_event(struct dm_table *t); + +#define DMWARN(f, x...) printk(KERN_WARNING DM_NAME ": " f "\n" , ## x) +#define DMERR(f, x...) printk(KERN_ERR DM_NAME ": " f "\n" , ## x) +#define DMINFO(f, x...) printk(KERN_INFO DM_NAME ": " f "\n" , ## x) + +/* + * Calculate the index of the child node of the n'th node k'th key. + */ +static inline int get_child(int n, int k) +{ + return (n * CHILDREN_PER_NODE) + k; +} + +/* + * Return the n'th node of level l from table t. + */ +static inline offset_t *get_node(struct dm_table *t, int l, int n) +{ + return t->index[l] + (n * KEYS_PER_NODE); +} + +static inline int array_too_big(unsigned long fixed, unsigned long obj, + unsigned long num) +{ + return (num > (ULONG_MAX - fixed) / obj); +} + + +/* + * Targets + */ +int dm_linear_init(void); +void dm_linear_exit(void); + +int dm_stripe_init(void); +void dm_stripe_exit(void); + +int dm_snapshot_init(void); +void dm_snapshot_exit(void); + + +/* + * Init functions for the user interface to device-mapper. At + * the moment an ioctl interface on a special char device is + * used. A filesystem based interface would be a nicer way to + * go. + */ +int __init dm_interface_init(void); +void dm_interface_exit(void); + + +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/dm-ioctl.c linux.20pre5-ac2/drivers/md/dm-ioctl.c --- linux.20pre5/drivers/md/dm-ioctl.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/dm-ioctl.c 2002-08-12 22:45:52.000000000 +0100 @@ -0,0 +1,830 @@ +/* + * Copyright (C) 2001 Sistina Software (UK) Limited. + * + * This file is released under the GPL. + */ + +#include "dm.h" + +#include +#include +#include +#include + +/*----------------------------------------------------------------- + * Implementation of the ioctl commands + *---------------------------------------------------------------*/ + +/* + * All the ioctl commands get dispatched to functions with this + * prototype. + */ +typedef int (*ioctl_fn)(struct dm_ioctl *param, struct dm_ioctl *user); + +/* + * This is really a debug only call. + */ +static int remove_all(struct dm_ioctl *param, struct dm_ioctl *user) +{ + dm_destroy_all(); + return 0; +} + +/* + * Check a string doesn't overrun the chunk of + * memory we copied from userland. + */ +static int valid_str(char *str, void *begin, void *end) +{ + while (((void *) str >= begin) && ((void *) str < end)) + if (!*str++) + return 0; + + return -EINVAL; +} + +static int next_target(struct dm_target_spec *last, uint32_t next, + void *begin, void *end, + struct dm_target_spec **spec, char **params) +{ + *spec = (struct dm_target_spec *) + ((unsigned char *) last + next); + *params = (char *) (*spec + 1); + + if (*spec < (last + 1) || ((void *) *spec > end)) + return -EINVAL; + + return valid_str(*params, begin, end); +} + +/* + * Checks to see if there's a gap in the table. + * Returns true iff there is a gap. + */ +static int gap(struct dm_table *table, struct dm_target_spec *spec) +{ + if (!table->num_targets) + return (spec->sector_start > 0) ? 1 : 0; + + if (spec->sector_start != table->highs[table->num_targets - 1] + 1) + return 1; + + return 0; +} + +static int populate_table(struct dm_table *table, struct dm_ioctl *args) +{ + int i = 0, r, first = 1, argc; + struct dm_target_spec *spec; + char *params, *argv[MAX_ARGS]; + struct target_type *ttype; + void *context, *begin, *end; + offset_t highs = 0; + + if (!args->target_count) { + DMWARN("populate_table: no targets specified"); + return -EINVAL; + } + + begin = (void *) args; + end = begin + args->data_size; + +#define PARSE_ERROR(msg) {DMWARN(msg); return -EINVAL;} + + for (i = 0; i < args->target_count; i++) { + + if (first) + r = next_target((struct dm_target_spec *) args, + args->data_start, + begin, end, &spec, ¶ms); + else + r = next_target(spec, spec->next, begin, end, + &spec, ¶ms); + + if (r) + PARSE_ERROR("unable to find target"); + + /* Look up the target type */ + ttype = dm_get_target_type(spec->target_type); + if (!ttype) + PARSE_ERROR("unable to find target type"); + + if (gap(table, spec)) + PARSE_ERROR("gap in target ranges"); + + /* Split up the parameter list */ + if (split_args(MAX_ARGS, &argc, argv, params) < 0) + PARSE_ERROR("Too many arguments"); + + /* Build the target */ + if (ttype->ctr(table, spec->sector_start, spec->length, + argc, argv, &context)) { + DMWARN("%s: target constructor failed", + (char *) context); + return -EINVAL; + } + + /* Add the target to the table */ + highs = spec->sector_start + (spec->length - 1); + if (dm_table_add_target(table, highs, ttype, context)) + PARSE_ERROR("internal error adding target to table"); + + first = 0; + } + +#undef PARSE_ERROR + + r = dm_table_complete(table); + return r; +} + +/* + * Round up the ptr to the next 'align' boundary. Obviously + * 'align' must be a power of 2. + */ +static inline void *align_ptr(void *ptr, unsigned int align) +{ + align--; + return (void *) (((unsigned long) (ptr + align)) & ~align); +} + +/* + * Copies a dm_ioctl and an optional additional payload to + * userland. + */ +static int results_to_user(struct dm_ioctl *user, struct dm_ioctl *param, + void *data, uint32_t len) +{ + int r; + void *ptr = NULL; + + if (data) { + ptr = align_ptr(user + 1, sizeof(unsigned long)); + param->data_start = ptr - (void *) user; + } + + /* + * The version number has already been filled in, so we + * just copy later fields. + */ + r = copy_to_user(&user->data_size, ¶m->data_size, + sizeof(*param) - sizeof(param->version)); + if (r) + return -EFAULT; + + if (data) { + if (param->data_start + len > param->data_size) + return -ENOSPC; + + if (copy_to_user(ptr, data, len)) + r = -EFAULT; + } + + return r; +} + +/* + * Fills in a dm_ioctl structure, ready for sending back to + * userland. + */ +static void __info(struct mapped_device *md, struct dm_ioctl *param) +{ + param->flags = DM_EXISTS_FLAG; + if (md->suspended) + param->flags |= DM_SUSPEND_FLAG; + if (md->read_only) + param->flags |= DM_READONLY_FLAG; + + strncpy(param->name, md->name, sizeof(param->name)); + + if (md->uuid) + strncpy(param->uuid, md->uuid, sizeof(param->uuid) - 1); + else + param->uuid[0] = '\0'; + + param->open_count = md->use_count; + param->dev = kdev_t_to_nr(md->dev); + param->target_count = md->map->num_targets; +} + +/* + * Always use UUID for lookups if it's present, otherwise use name. + */ +static inline char *lookup_name(struct dm_ioctl *param) +{ + return (*param->uuid) ? param->uuid : param->name; +} + +static inline int lookup_type(struct dm_ioctl *param) +{ + return (*param->uuid) ? DM_LOOKUP_BY_UUID : DM_LOOKUP_BY_NAME; +} + +#define ALIGNMENT sizeof(int) +static void *_align(void *ptr, unsigned int a) +{ + register unsigned long align = --a; + + return (void *) (((unsigned long) ptr + align) & ~align); +} + +/* + * Copies device info back to user space, used by + * the create and info ioctls. + */ +static int info(struct dm_ioctl *param, struct dm_ioctl *user) +{ + struct mapped_device *md; + + param->flags = 0; + + md = dm_get_name_r(lookup_name(param), lookup_type(param)); + if (!md) + /* + * Device not found - returns cleared exists flag. + */ + goto out; + + __info(md, param); + dm_put_r(md); + + out: + return results_to_user(user, param, NULL, 0); +} + +static inline int get_mode(struct dm_ioctl *param) +{ + int mode = FMODE_READ | FMODE_WRITE; + + if (param->flags & DM_READONLY_FLAG) + mode = FMODE_READ; + + return mode; +} + +static int create(struct dm_ioctl *param, struct dm_ioctl *user) +{ + int r, ro; + struct dm_table *t; + int minor; + + r = dm_table_create(&t, get_mode(param)); + if (r) + return r; + + r = populate_table(t, param); + if (r) { + dm_table_destroy(t); + return r; + } + + minor = (param->flags & DM_PERSISTENT_DEV_FLAG) ? + MINOR(to_kdev_t(param->dev)) : -1; + + ro = (param->flags & DM_READONLY_FLAG) ? 1 : 0; + + r = dm_create(param->name, param->uuid, minor, ro, t); + if (r) { + dm_table_destroy(t); + return r; + } + + r = info(param, user); + return r; +} + + + +/* + * Build up the status struct for each target + */ +static int __status(struct mapped_device *md, struct dm_ioctl *param, + char *outbuf, int *len) +{ + int i; + struct dm_target_spec *spec; + uint64_t sector = 0LL; + char *outptr; + status_type_t type; + + if (param->flags & DM_STATUS_TABLE_FLAG) + type = STATUSTYPE_TABLE; + else + type = STATUSTYPE_INFO; + + outptr = outbuf; + + /* Get all the target info */ + for (i = 0; i < md->map->num_targets; i++) { + struct target_type *tt = md->map->targets[i].type; + offset_t high = md->map->highs[i]; + + if (outptr - outbuf + + sizeof(struct dm_target_spec) > param->data_size) + return -ENOMEM; + + spec = (struct dm_target_spec *) outptr; + + spec->status = 0; + spec->sector_start = sector; + spec->length = high - sector + 1; + strncpy(spec->target_type, tt->name, sizeof(spec->target_type)); + + outptr += sizeof(struct dm_target_spec); + + /* Get the status/table string from the target driver */ + if (tt->status) + tt->status(type, outptr, + outbuf + param->data_size - outptr, + md->map->targets[i].private); + else + outptr[0] = '\0'; + + outptr += strlen(outptr) + 1; + _align(outptr, ALIGNMENT); + + sector = high + 1; + + spec->next = outptr - outbuf; + } + + param->target_count = md->map->num_targets; + *len = outptr - outbuf; + + return 0; +} + +/* + * Return the status of a device as a text string for each + * target. + */ +static int get_status(struct dm_ioctl *param, struct dm_ioctl *user) +{ + struct mapped_device *md; + int len = 0; + int ret; + char *outbuf = NULL; + + md = dm_get_name_r(lookup_name(param), lookup_type(param)); + if (!md) + /* + * Device not found - returns cleared exists flag. + */ + goto out; + + /* We haven't a clue how long the resultant data will be so + just allocate as much as userland has allowed us and make sure + we don't overun it */ + outbuf = kmalloc(param->data_size, GFP_KERNEL); + if (!outbuf) + goto out; + /* + * Get the status of all targets + */ + __status(md, param, outbuf, &len); + + /* + * Setup the basic dm_ioctl structure. + */ + __info(md, param); + + out: + if (md) + dm_put_r(md); + + ret = results_to_user(user, param, outbuf, len); + + if (outbuf) + kfree(outbuf); + + return ret; +} + +/* + * Wait for a device to report an event + */ +static int wait_device_event(struct dm_ioctl *param, struct dm_ioctl *user) +{ + struct mapped_device *md; + DECLARE_WAITQUEUE(wq, current); + + md = dm_get_name_r(lookup_name(param), lookup_type(param)); + if (!md) + /* + * Device not found - returns cleared exists flag. + */ + goto out; + /* + * Setup the basic dm_ioctl structure. + */ + __info(md, param); + + /* + * Wait for a notification event + */ + set_current_state(TASK_INTERRUPTIBLE); + add_wait_queue(&md->map->eventq, &wq); + + dm_put_r(md); + + schedule(); + set_current_state(TASK_RUNNING); + + out: + return results_to_user(user, param, NULL, 0); +} + +/* + * Retrieves a list of devices used by a particular dm device. + */ +static int dep(struct dm_ioctl *param, struct dm_ioctl *user) +{ + int count, r; + struct mapped_device *md; + struct list_head *tmp; + size_t len = 0; + struct dm_target_deps *deps = NULL; + + md = dm_get_name_r(lookup_name(param), lookup_type(param)); + if (!md) + goto out; + + /* + * Setup the basic dm_ioctl structure. + */ + __info(md, param); + + /* + * Count the devices. + */ + count = 0; + list_for_each(tmp, &md->map->devices) + count++; + + /* + * Allocate a kernel space version of the dm_target_status + * struct. + */ + if (array_too_big(sizeof(*deps), sizeof(*deps->dev), count)) { + dm_put_r(md); + return -ENOMEM; + } + + len = sizeof(*deps) + (sizeof(*deps->dev) * count); + deps = kmalloc(len, GFP_KERNEL); + if (!deps) { + dm_put_r(md); + return -ENOMEM; + } + + /* + * Fill in the devices. + */ + deps->count = count; + count = 0; + list_for_each(tmp, &md->map->devices) { + struct dm_dev *dd = list_entry(tmp, struct dm_dev, list); + deps->dev[count++] = kdev_t_to_nr(dd->dev); + } + dm_put_r(md); + + out: + r = results_to_user(user, param, deps, len); + + kfree(deps); + return r; +} + +static int remove(struct dm_ioctl *param, struct dm_ioctl *user) +{ + int r; + struct mapped_device *md; + + md = dm_get_name_w(lookup_name(param), lookup_type(param)); + if (!md) + return -ENXIO; + + r = dm_destroy(md); + dm_put_w(md); + if (!r) + kfree(md); + + return r; +} + +static int suspend(struct dm_ioctl *param, struct dm_ioctl *user) +{ + int r; + struct mapped_device *md; + + md = dm_get_name_w(lookup_name(param), lookup_type(param)); + if (!md) + return -ENXIO; + + r = (param->flags & DM_SUSPEND_FLAG) ? dm_suspend(md) : dm_resume(md); + dm_put_w(md); + + return r; +} + +static int reload(struct dm_ioctl *param, struct dm_ioctl *user) +{ + int r; + struct mapped_device *md; + struct dm_table *t; + + r = dm_table_create(&t, get_mode(param)); + if (r) + return r; + + r = populate_table(t, param); + if (r) { + dm_table_destroy(t); + return r; + } + + md = dm_get_name_w(lookup_name(param), lookup_type(param)); + if (!md) { + dm_table_destroy(t); + return -ENXIO; + } + + r = dm_swap_table(md, t); + if (r) { + dm_put_w(md); + dm_table_destroy(t); + return r; + } + + dm_set_ro(md, (param->flags & DM_READONLY_FLAG) ? 1 : 0); + dm_put_w(md); + + r = info(param, user); + return r; +} + +static int rename(struct dm_ioctl *param, struct dm_ioctl *user) +{ + char *newname = (char *) param + param->data_start; + + if (valid_str(newname, (void *) param, + (void *) param + param->data_size) || + dm_set_name(lookup_name(param), lookup_type(param), newname)) { + DMWARN("Invalid new logical volume name supplied."); + return -EINVAL; + } + + return 0; +} + + +/*----------------------------------------------------------------- + * Implementation of open/close/ioctl on the special char + * device. + *---------------------------------------------------------------*/ +static int ctl_open(struct inode *inode, struct file *file) +{ + /* only root can open this */ + if (!capable(CAP_SYS_ADMIN)) + return -EACCES; + + MOD_INC_USE_COUNT; + + return 0; +} + +static int ctl_close(struct inode *inode, struct file *file) +{ + MOD_DEC_USE_COUNT; + return 0; +} + +static ioctl_fn lookup_ioctl(unsigned int cmd) +{ + static struct { + int cmd; + ioctl_fn fn; + } _ioctls[] = { + {DM_VERSION_CMD, NULL}, /* version is dealt with elsewhere */ + {DM_REMOVE_ALL_CMD, remove_all}, + {DM_DEV_CREATE_CMD, create}, + {DM_DEV_REMOVE_CMD, remove}, + {DM_DEV_RELOAD_CMD, reload}, + {DM_DEV_RENAME_CMD, rename}, + {DM_DEV_SUSPEND_CMD, suspend}, + {DM_DEV_DEPS_CMD, dep}, + {DM_DEV_STATUS_CMD, info}, + {DM_TARGET_STATUS_CMD, get_status}, + {DM_TARGET_WAIT_CMD, wait_device_event}, + }; + static int nelts = sizeof(_ioctls) / sizeof(*_ioctls); + + return (cmd >= nelts) ? NULL : _ioctls[cmd].fn; +} + +/* + * As well as checking the version compatibility this always + * copies the kernel interface version out. + */ +static int check_version(int cmd, struct dm_ioctl *user) +{ + uint32_t version[3]; + int r = 0; + + if (copy_from_user(version, user->version, sizeof(version))) + return -EFAULT; + + if ((DM_VERSION_MAJOR != version[0]) || + (DM_VERSION_MINOR < version[1])) { + DMWARN("ioctl interface mismatch: " + "kernel(%u.%u.%u), user(%u.%u.%u), cmd(%d)", + DM_VERSION_MAJOR, DM_VERSION_MINOR, + DM_VERSION_PATCHLEVEL, + version[0], version[1], version[2], cmd); + r = -EINVAL; + } + + /* + * Fill in the kernel version. + */ + version[0] = DM_VERSION_MAJOR; + version[1] = DM_VERSION_MINOR; + version[2] = DM_VERSION_PATCHLEVEL; + if (copy_to_user(user->version, version, sizeof(version))) + return -EFAULT; + + return r; +} + +static void free_params(struct dm_ioctl *param) +{ + vfree(param); +} + +static int copy_params(struct dm_ioctl *user, struct dm_ioctl **param) +{ + struct dm_ioctl tmp, *dmi; + + if (copy_from_user(&tmp, user, sizeof(tmp))) + return -EFAULT; + + if (tmp.data_size < sizeof(tmp)) + return -EINVAL; + + dmi = (struct dm_ioctl *) vmalloc(tmp.data_size); + if (!dmi) + return -ENOMEM; + + if (copy_from_user(dmi, user, tmp.data_size)) { + vfree(dmi); + return -EFAULT; + } + + *param = dmi; + return 0; +} + +static int validate_params(uint cmd, struct dm_ioctl *param) +{ + /* Ignores parameters */ + if (cmd == DM_REMOVE_ALL_CMD) + return 0; + + /* Unless creating, either name of uuid but not both */ + if (cmd != DM_DEV_CREATE_CMD) { + if ((!*param->uuid && !*param->name) || + (*param->uuid && *param->name)) { + DMWARN("one of name or uuid must be supplied"); + return -EINVAL; + } + } + + /* Ensure strings are terminated */ + param->name[DM_NAME_LEN - 1] = '\0'; + param->uuid[DM_UUID_LEN - 1] = '\0'; + + return 0; +} + +static int ctl_ioctl(struct inode *inode, struct file *file, + uint command, ulong u) +{ + + int r = 0, cmd; + struct dm_ioctl *param; + struct dm_ioctl *user = (struct dm_ioctl *) u; + ioctl_fn fn = NULL; + + if (_IOC_TYPE(command) != DM_IOCTL) + return -ENOTTY; + + cmd = _IOC_NR(command); + + /* + * Check the interface version passed in. This also + * writes out the kernel's interface version. + */ + r = check_version(cmd, user); + if (r) + return r; + + /* + * Nothing more to do for the version command. + */ + if (cmd == DM_VERSION_CMD) + return 0; + + fn = lookup_ioctl(cmd); + if (!fn) { + DMWARN("dm_ctl_ioctl: unknown command 0x%x", command); + return -ENOTTY; + } + + /* + * Copy the parameters into kernel space. + */ + r = copy_params(user, ¶m); + if (r) + return r; + + r = validate_params(cmd, param); + if (r) { + free_params(param); + return r; + } + + r = fn(param, user); + free_params(param); + return r; +} + +static struct file_operations _ctl_fops = { + open: ctl_open, + release: ctl_close, + ioctl: ctl_ioctl, + owner: THIS_MODULE, +}; + +static devfs_handle_t _ctl_handle; + +static struct miscdevice _dm_misc = { + minor: MISC_DYNAMIC_MINOR, + name: DM_NAME, + fops: &_ctl_fops +}; + +static int __init dm_devfs_init(void) { + int r; + char rname[64]; + + r = devfs_generate_path(_dm_misc.devfs_handle, rname + 3, + sizeof rname - 3); + if (r == -ENOSYS) + return 0; /* devfs not present */ + + if (r < 0) { + DMERR("devfs_generate_path failed for control device"); + return r; + } + + strncpy(rname + r, "../", 3); + r = devfs_mk_symlink(NULL, DM_DIR "/control", + DEVFS_FL_DEFAULT, rname + r, &_ctl_handle, NULL); + if (r) { + DMERR("devfs_mk_symlink failed for control device"); + return r; + } + devfs_auto_unregister(_dm_misc.devfs_handle, _ctl_handle); + + return 0; +} + +/* Create misc character device and link to DM_DIR/control */ +int __init dm_interface_init(void) +{ + int r; + + r = misc_register(&_dm_misc); + if (r) { + DMERR("misc_register failed for control device"); + return r; + } + + r = dm_devfs_init(); + if (r) { + misc_deregister(&_dm_misc); + return r; + } + + DMINFO("%d.%d.%d%s initialised: %s", DM_VERSION_MAJOR, + DM_VERSION_MINOR, DM_VERSION_PATCHLEVEL, DM_VERSION_EXTRA, + DM_DRIVER_EMAIL); + + return 0; +} + +void dm_interface_exit(void) +{ + if (misc_deregister(&_dm_misc) < 0) + DMERR("misc_deregister failed for control device"); +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/dm-linear.c linux.20pre5-ac2/drivers/md/dm-linear.c --- linux.20pre5/drivers/md/dm-linear.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/dm-linear.c 2002-08-12 22:45:52.000000000 +0100 @@ -0,0 +1,125 @@ +/* + * Copyright (C) 2001 Sistina Software (UK) Limited. + * + * This file is released under the GPL. + */ + +#include "dm.h" + +#include +#include +#include + +/* + * Linear: maps a linear range of a device. + */ +struct linear_c { + long delta; /* FIXME: we need a signed offset type */ + long start; /* For display only */ + struct dm_dev *dev; +}; + +/* + * Construct a linear mapping: + */ +static int linear_ctr(struct dm_table *t, offset_t b, offset_t l, + int argc, char **argv, void **context) +{ + struct linear_c *lc; + unsigned long start; /* FIXME: unsigned long long */ + char *end; + + if (argc != 2) { + *context = "dm-linear: Not enough arguments"; + return -EINVAL; + } + + lc = kmalloc(sizeof(*lc), GFP_KERNEL); + if (lc == NULL) { + *context = "dm-linear: Cannot allocate linear context"; + return -ENOMEM; + } + + start = simple_strtoul(argv[1], &end, 10); + if (*end) { + *context = "dm-linear: Invalid device sector"; + goto bad; + } + + if (dm_table_get_device(t, argv[0], start, l, t->mode, &lc->dev)) { + *context = "dm-linear: Device lookup failed"; + goto bad; + } + + lc->delta = (int) start - (int) b; + lc->start = start; + *context = lc; + return 0; + + bad: + kfree(lc); + return -EINVAL; +} + +static void linear_dtr(struct dm_table *t, void *c) +{ + struct linear_c *lc = (struct linear_c *) c; + + dm_table_put_device(t, lc->dev); + kfree(c); +} + +static int linear_map(struct buffer_head *bh, int rw, void *context) +{ + struct linear_c *lc = (struct linear_c *) context; + + bh->b_rdev = lc->dev->dev; + bh->b_rsector = bh->b_rsector + lc->delta; + + return 1; +} + +static int linear_status(status_type_t type, char *result, int maxlen, + void *context) +{ + struct linear_c *lc = (struct linear_c *) context; + + switch (type) { + case STATUSTYPE_INFO: + result[0] = '\0'; + break; + + case STATUSTYPE_TABLE: + snprintf(result, maxlen, "%s %ld", kdevname(lc->dev->dev), + lc->start); + break; + } + return 0; +} + +static struct target_type linear_target = { + name: "linear", + module: THIS_MODULE, + ctr: linear_ctr, + dtr: linear_dtr, + map: linear_map, + status: linear_status, +}; + +int __init dm_linear_init(void) +{ + int r = dm_register_target(&linear_target); + + if (r < 0) + DMERR("linear: register failed %d", r); + + return r; +} + +void dm_linear_exit(void) +{ + int r = dm_unregister_target(&linear_target); + + if (r < 0) + DMERR("linear: unregister failed %d", r); +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/dm-snapshot.c linux.20pre5-ac2/drivers/md/dm-snapshot.c --- linux.20pre5/drivers/md/dm-snapshot.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/dm-snapshot.c 2002-08-12 22:45:52.000000000 +0100 @@ -0,0 +1,1169 @@ +/* + * dm-snapshot.c + * + * Copyright (C) 2001-2002 Sistina Software (UK) Limited. + * + * This file is released under the GPL. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dm-snapshot.h" +#include "kcopyd.h" + +/* + * FIXME: Remove this before release. + */ +#if 0 +#define DMDEBUG(x...) DMWARN( ## x) +#else +#define DMDEBUG(x...) +#endif + +/* + * The percentage increment we will wake up users at + */ +#define WAKE_UP_PERCENT 5 + +/* + * Hard sector size used all over the kernel + */ +#define SECTOR_SIZE 512 + +/* + * kcopyd priority of snapshot operations + */ +#define SNAPSHOT_COPY_PRIORITY 2 + +struct pending_exception { + struct exception e; + + /* + * Origin buffers waiting for this to complete are held + * in a list (using b_reqnext). + */ + struct buffer_head *origin_bhs; + struct buffer_head *snapshot_bhs; + + /* + * Other pending_exceptions that are processing this + * chunk. When this list is empty, we know we can + * complete the origins. + */ + struct list_head siblings; + + /* Pointer back to snapshot context */ + struct dm_snapshot *snap; + + /* + * 1 indicates the exception has already been sent to + * kcopyd. + */ + int started; +}; + +/* + * Hash table mapping origin volumes to lists of snapshots and + * a lock to protect it + */ +static kmem_cache_t *exception_cache; +static kmem_cache_t *pending_cache; +static mempool_t *pending_pool; + +/* + * One of these per registered origin, held in the snapshot_origins hash + */ +struct origin { + /* The origin device */ + kdev_t dev; + + struct list_head hash_list; + + /* List of snapshots for this origin */ + struct list_head snapshots; +}; + +/* + * Size of the hash table for origin volumes. If we make this + * the size of the minors list then it should be nearly perfect + */ +#define ORIGIN_HASH_SIZE 256 +#define ORIGIN_MASK 0xFF +static struct list_head *_origins; +static struct rw_semaphore _origins_lock; + +static int init_origin_hash(void) +{ + int i; + + _origins = kmalloc(ORIGIN_HASH_SIZE * sizeof(struct list_head), + GFP_KERNEL); + if (!_origins) { + DMERR("Device mapper: Snapshot: unable to allocate memory"); + return -ENOMEM; + } + + for (i = 0; i < ORIGIN_HASH_SIZE; i++) + INIT_LIST_HEAD(_origins + i); + init_rwsem(&_origins_lock); + + return 0; +} + +static void exit_origin_hash(void) +{ + kfree(_origins); +} + +static inline unsigned int origin_hash(kdev_t dev) +{ + return MINOR(dev) & ORIGIN_MASK; +} + +static struct origin *__lookup_origin(kdev_t origin) +{ + struct list_head *slist; + struct list_head *ol; + struct origin *o; + + ol = &_origins[origin_hash(origin)]; + list_for_each(slist, ol) { + o = list_entry(slist, struct origin, hash_list); + + if (o->dev == origin) + return o; + } + + return NULL; +} + +static void __insert_origin(struct origin *o) +{ + struct list_head *sl = &_origins[origin_hash(o->dev)]; + list_add_tail(&o->hash_list, sl); +} + +/* + * Make a note of the snapshot and its origin so we can look it + * up when the origin has a write on it. + */ +static int register_snapshot(struct dm_snapshot *snap) +{ + struct origin *o; + kdev_t dev = snap->origin->dev; + + down_write(&_origins_lock); + o = __lookup_origin(dev); + + if (!o) { + /* New origin */ + o = kmalloc(sizeof(*o), GFP_KERNEL); + if (!o) { + up_write(&_origins_lock); + return -ENOMEM; + } + + /* Initialise the struct */ + INIT_LIST_HEAD(&o->snapshots); + o->dev = dev; + + __insert_origin(o); + } + + list_add_tail(&snap->list, &o->snapshots); + + up_write(&_origins_lock); + return 0; +} + +static void unregister_snapshot(struct dm_snapshot *s) +{ + struct origin *o; + + down_write(&_origins_lock); + o = __lookup_origin(s->origin->dev); + + list_del(&s->list); + if (list_empty(&o->snapshots)) { + list_del(&o->hash_list); + kfree(o); + } + + up_write(&_origins_lock); +} + +/* + * Implementation of the exception hash tables. + */ +static int init_exception_table(struct exception_table *et, uint32_t size) +{ + int i; + + et->hash_mask = size - 1; + et->table = vcalloc(size, sizeof(struct list_head)); + if (!et->table) + return -ENOMEM; + + for (i = 0; i < size; i++) + INIT_LIST_HEAD(et->table + i); + + return 0; +} + +static void exit_exception_table(struct exception_table *et, kmem_cache_t *mem) +{ + struct list_head *slot, *entry, *temp; + struct exception *ex; + int i, size; + + size = et->hash_mask + 1; + for (i = 0; i < size; i++) { + slot = et->table + i; + + list_for_each_safe(entry, temp, slot) { + ex = list_entry(entry, struct exception, hash_list); + kmem_cache_free(mem, ex); + } + } + + vfree(et->table); +} + +/* + * FIXME: check how this hash fn is performing. + */ +static inline uint32_t exception_hash(struct exception_table *et, chunk_t chunk) +{ + return chunk & et->hash_mask; +} + +static void insert_exception(struct exception_table *eh, struct exception *e) +{ + struct list_head *l = &eh->table[exception_hash(eh, e->old_chunk)]; + list_add(&e->hash_list, l); +} + +static inline void remove_exception(struct exception *e) +{ + list_del(&e->hash_list); +} + +/* + * Return the exception data for a sector, or NULL if not + * remapped. + */ +static struct exception *lookup_exception(struct exception_table *et, + chunk_t chunk) +{ + struct list_head *slot, *el; + struct exception *e; + + slot = &et->table[exception_hash(et, chunk)]; + list_for_each(el, slot) { + e = list_entry(el, struct exception, hash_list); + if (e->old_chunk == chunk) + return e; + } + + return NULL; +} + +static inline struct exception *alloc_exception(void) +{ + struct exception *e; + + e = kmem_cache_alloc(exception_cache, GFP_NOIO); + if (!e) + e = kmem_cache_alloc(exception_cache, GFP_ATOMIC); + + return e; +} + +static inline void free_exception(struct exception *e) +{ + kmem_cache_free(exception_cache, e); +} + +static inline struct pending_exception *alloc_pending_exception(void) +{ + return mempool_alloc(pending_pool, GFP_NOIO); +} + +static inline void free_pending_exception(struct pending_exception *pe) +{ + mempool_free(pe, pending_pool); +} + +int dm_add_exception(struct dm_snapshot *s, chunk_t old, chunk_t new) +{ + struct exception *e; + + e = alloc_exception(); + if (!e) + return -ENOMEM; + + e->old_chunk = old; + e->new_chunk = new; + insert_exception(&s->complete, e); + return 0; +} + +/* + * Hard coded magic. + */ +static int calc_max_buckets(void) +{ + unsigned long mem; + + mem = num_physpages << PAGE_SHIFT; + mem /= 50; + mem /= sizeof(struct list_head); + + return mem; +} + +/* + * Rounds a number down to a power of 2. + */ +static inline uint32_t round_down(uint32_t n) +{ + while (n & (n - 1)) + n &= (n - 1); + return n; +} + +/* + * Allocate room for a suitable hash table. + */ +static int init_hash_tables(struct dm_snapshot *s) +{ + offset_t hash_size, cow_dev_size, origin_dev_size, max_buckets; + + /* + * Calculate based on the size of the original volume or + * the COW volume... + */ + cow_dev_size = get_dev_size(s->cow->dev); + origin_dev_size = get_dev_size(s->origin->dev); + max_buckets = calc_max_buckets(); + + hash_size = min(origin_dev_size, cow_dev_size) / s->chunk_size; + hash_size = min(hash_size, max_buckets); + + /* Round it down to a power of 2 */ + hash_size = round_down(hash_size); + if (init_exception_table(&s->complete, hash_size)) + return -ENOMEM; + + /* + * Allocate hash table for in-flight exceptions + * Make this smaller than the real hash table + */ + hash_size >>= 3; + if (!hash_size) + hash_size = 64; + + if (init_exception_table(&s->pending, hash_size)) { + exit_exception_table(&s->complete, exception_cache); + return -ENOMEM; + } + + return 0; +} + +/* + * Round a number up to the nearest 'size' boundary. size must + * be a power of 2. + */ +static inline ulong round_up(ulong n, ulong size) +{ + size--; + return (n + size) & ~size; +} + +/* + * Construct a snapshot mapping:

+ */ +static int snapshot_ctr(struct dm_table *t, offset_t b, offset_t l, + int argc, char **argv, void **context) +{ + struct dm_snapshot *s; + unsigned long chunk_size; + int r = -EINVAL; + char *persistent; + char *origin_path; + char *cow_path; + char *value; + int blocksize; + + if (argc < 4) { + *context = "dm-snapshot: requires exactly 4 arguments"; + r = -EINVAL; + goto bad; + } + + origin_path = argv[0]; + cow_path = argv[1]; + persistent = argv[2]; + + if ((*persistent & 0x5f) != 'P' && (*persistent & 0x5f) != 'N') { + *context = "Persistent flag is not P or N"; + r = -EINVAL; + goto bad; + } + + chunk_size = simple_strtoul(argv[3], &value, 10); + if (chunk_size == 0 || value == NULL) { + *context = "Invalid chunk size"; + r = -EINVAL; + goto bad; + } + + s = kmalloc(sizeof(*s), GFP_KERNEL); + if (s == NULL) { + *context = "Cannot allocate snapshot context private structure"; + r = -ENOMEM; + goto bad; + } + + r = dm_table_get_device(t, origin_path, 0, 0, FMODE_READ, &s->origin); + if (r) { + *context = "Cannot get origin device"; + goto bad_free; + } + + r = dm_table_get_device(t, cow_path, 0, 0, + FMODE_READ | FMODE_WRITE, &s->cow); + if (r) { + dm_table_put_device(t, s->origin); + *context = "Cannot get COW device"; + goto bad_free; + } + + /* + * Chunk size must be multiple of page size. Silently + * round up if it's not. + */ + chunk_size = round_up(chunk_size, PAGE_SIZE / SECTOR_SIZE); + + /* Validate the chunk size against the device block size */ + blocksize = get_hardsect_size(s->cow->dev); + if (chunk_size % (blocksize / SECTOR_SIZE)) { + *context = "Chunk size is not a multiple of device blocksize"; + r = -EINVAL; + goto bad_putdev; + } + + /* Check the sizes are small enough to fit in one kiovec */ + if (chunk_size > KIO_MAX_SECTORS) { + *context = "Chunk size is too big"; + r = -EINVAL; + goto bad_putdev; + } + + /* Check chunk_size is a power of 2 */ + if (chunk_size & (chunk_size - 1)) { + *context = "Chunk size is not a power of 2"; + r = -EINVAL; + goto bad_putdev; + } + + s->chunk_size = chunk_size; + s->chunk_mask = chunk_size - 1; + s->type = *persistent; + for (s->chunk_shift = 0; chunk_size; + s->chunk_shift++, chunk_size >>= 1) + ; + s->chunk_shift--; + + s->valid = 1; + s->last_percent = 0; + s->table = t; + init_rwsem(&s->lock); + + /* Allocate hash table for COW data */ + if (init_hash_tables(s)) { + *context = "Unable to allocate hash table space"; + r = -ENOMEM; + goto bad_putdev; + } + + /* + * Check the persistent flag - done here because we need the iobuf + * to check the LV header + */ + s->store.snap = s; + + if ((*persistent & 0x5f) == 'P') + r = dm_create_persistent(&s->store, s->chunk_size); + else + r = dm_create_transient(&s->store, s, blocksize, context); + + if (r) { + *context = "Couldn't create exception store"; + r = -EINVAL; + goto bad_free1; + } + + /* Flush IO to the origin device */ +#if LVM_VFS_ENHANCEMENT + fsync_dev_lockfs(s->origin->dev); +#else + fsync_dev(s->origin->dev); +#endif + + /* Add snapshot to the list of snapshots for this origin */ + if (register_snapshot(s)) { + r = -EINVAL; + *context = "Cannot register snapshot origin"; + goto bad_free2; + } +#if LVM_VFS_ENHANCEMENT + unlockfs(s->origin->dev); +#endif + kcopyd_inc_client_count(); + + *context = s; + return 0; + + bad_free2: + s->store.destroy(&s->store); + + bad_free1: + exit_exception_table(&s->pending, pending_cache); + exit_exception_table(&s->complete, exception_cache); + + bad_putdev: + dm_table_put_device(t, s->cow); + dm_table_put_device(t, s->origin); + + bad_free: + kfree(s); + + bad: + return r; +} + +static void snapshot_dtr(struct dm_table *t, void *context) +{ + struct dm_snapshot *s = (struct dm_snapshot *) context; + + dm_table_event(s->table); + + unregister_snapshot(s); + + exit_exception_table(&s->pending, pending_cache); + exit_exception_table(&s->complete, exception_cache); + + /* Deallocate memory used */ + s->store.destroy(&s->store); + + dm_table_put_device(t, s->origin); + dm_table_put_device(t, s->cow); + kfree(s); + + kcopyd_dec_client_count(); +} + +/* + * We hold lists of buffer_heads, using the b_reqnext field. + */ +static void queue_buffer(struct buffer_head **queue, struct buffer_head *bh) +{ + bh->b_reqnext = *queue; + *queue = bh; +} + +/* + * Flush a list of buffers. + */ +static void flush_buffers(struct buffer_head *bh) +{ + struct buffer_head *n; + + DMDEBUG("begin flush"); + while (bh) { + n = bh->b_reqnext; + bh->b_reqnext = NULL; + DMDEBUG("flushing %p", bh); + generic_make_request(WRITE, bh); + bh = n; + } + + run_task_queue(&tq_disk); +} + +/* + * Error a list of buffers. + */ +static void error_buffers(struct buffer_head *bh) +{ + struct buffer_head *n; + + while (bh) { + n = bh->b_reqnext; + bh->b_reqnext = NULL; + buffer_IO_error(bh); + bh = n; + } +} + +static void pending_complete(struct pending_exception *pe, int success) +{ + struct exception *e; + struct dm_snapshot *s = pe->snap; + + if (success) { + e = alloc_exception(); + if (!e) { + printk("Unable to allocate exception."); + down_write(&s->lock); + s->store.drop_snapshot(&s->store); + s->valid = 0; + up_write(&s->lock); + return; + } + + /* + * Add a proper exception, and remove the + * inflight exception from the list. + */ + down_write(&s->lock); + + memcpy(e, &pe->e, sizeof(*e)); + insert_exception(&s->complete, e); + remove_exception(&pe->e); + + /* Submit any pending write BHs */ + up_write(&s->lock); + + flush_buffers(pe->snapshot_bhs); + DMDEBUG("Exception completed successfully."); + + /* Notify any interested parties */ + if (s->store.percent_full) { + int pc = s->store.percent_full(&s->store); + + if (pc >= s->last_percent + WAKE_UP_PERCENT) { + dm_table_event(s->table); + s->last_percent = pc - pc % WAKE_UP_PERCENT; + } + } + + } else { + /* Read/write error - snapshot is unusable */ + DMERR("Error reading/writing snapshot"); + + down_write(&s->lock); + s->store.drop_snapshot(&s->store); + s->valid = 0; + remove_exception(&pe->e); + up_write(&s->lock); + + error_buffers(pe->snapshot_bhs); + + dm_table_event(s->table); + DMDEBUG("Exception failed."); + } + + if (list_empty(&pe->siblings)) + flush_buffers(pe->origin_bhs); + else + list_del(&pe->siblings); + + free_pending_exception(pe); +} + +static void commit_callback(void *context, int success) +{ + struct pending_exception *pe = (struct pending_exception *) context; + pending_complete(pe, success); +} + +/* + * Called when the copy I/O has finished. kcopyd actually runs + * this code so don't block. + */ +static void copy_callback(int err, void *context) +{ + struct pending_exception *pe = (struct pending_exception *) context; + struct dm_snapshot *s = pe->snap; + + if (err) + pending_complete(pe, 0); + + else + /* Update the metadata if we are persistent */ + s->store.commit_exception(&s->store, &pe->e, commit_callback, + pe); +} + +/* + * Dispatches the copy operation to kcopyd. + */ +static inline void start_copy(struct pending_exception *pe) +{ + struct dm_snapshot *s = pe->snap; + struct kcopyd_region src, dest; + + src.dev = s->origin->dev; + src.sector = chunk_to_sector(s, pe->e.old_chunk); + src.count = s->chunk_size; + + dest.dev = s->cow->dev; + dest.sector = chunk_to_sector(s, pe->e.new_chunk); + dest.count = s->chunk_size; + + if (!pe->started) { + /* Hand over to kcopyd */ + kcopyd_copy(&src, &dest, copy_callback, pe); + pe->started = 1; + } +} + +/* + * Looks to see if this snapshot already has a pending exception + * for this chunk, otherwise it allocates a new one and inserts + * it into the pending table. + */ +static struct pending_exception *find_pending_exception(struct dm_snapshot *s, + struct buffer_head *bh) +{ + struct exception *e; + struct pending_exception *pe; + chunk_t chunk = sector_to_chunk(s, bh->b_rsector); + + /* + * Is there a pending exception for this already ? + */ + e = lookup_exception(&s->pending, chunk); + if (e) { + /* cast the exception to a pending exception */ + pe = list_entry(e, struct pending_exception, e); + + } else { + /* Create a new pending exception */ + pe = alloc_pending_exception(); + if (!pe) { + DMWARN("Couldn't allocate pending exception."); + return NULL; + } + + pe->e.old_chunk = chunk; + pe->origin_bhs = pe->snapshot_bhs = NULL; + INIT_LIST_HEAD(&pe->siblings); + pe->snap = s; + pe->started = 0; + + if (s->store.prepare_exception(&s->store, &pe->e)) { + free_pending_exception(pe); + s->valid = 0; + return NULL; + } + + insert_exception(&s->pending, &pe->e); + } + + return pe; +} + +static inline void remap_exception(struct dm_snapshot *s, struct exception *e, + struct buffer_head *bh) +{ + bh->b_rdev = s->cow->dev; + bh->b_rsector = chunk_to_sector(s, e->new_chunk) + + (bh->b_rsector & s->chunk_mask); +} + +static int snapshot_map(struct buffer_head *bh, int rw, void *context) +{ + struct exception *e; + struct dm_snapshot *s = (struct dm_snapshot *) context; + int r = 1; + chunk_t chunk; + struct pending_exception *pe; + + chunk = sector_to_chunk(s, bh->b_rsector); + + /* Full snapshots are not usable */ + if (!s->valid) + return -1; + + /* + * Write to snapshot - higher level takes care of RW/RO + * flags so we should only get this if we are + * writeable. + */ + if (rw == WRITE) { + + down_write(&s->lock); + + /* If the block is already remapped - use that, else remap it */ + e = lookup_exception(&s->complete, chunk); + if (e) + remap_exception(s, e, bh); + + else { + pe = find_pending_exception(s, bh); + + if (!pe) { + s->store.drop_snapshot(&s->store); + s->valid = 0; + } + + queue_buffer(&pe->snapshot_bhs, bh); + start_copy(pe); + r = 0; + } + + up_write(&s->lock); + + } else { + /* + * FIXME: this read path scares me because we + * always use the origin when we have a pending + * exception. However I can't think of a + * situation where this is wrong - ejt. + */ + + /* Do reads */ + down_read(&s->lock); + + /* See if it it has been remapped */ + e = lookup_exception(&s->complete, chunk); + if (e) + remap_exception(s, e, bh); + else + bh->b_rdev = s->origin->dev; + + up_read(&s->lock); + } + + return r; +} + +static void list_merge(struct list_head *l1, struct list_head *l2) +{ + struct list_head *l1_n, *l2_p; + + l1_n = l1->next; + l2_p = l2->prev; + + l1->next = l2; + l2->prev = l1; + + l2_p->next = l1_n; + l1_n->prev = l2_p; +} + +static int __origin_write(struct list_head *snapshots, struct buffer_head *bh) +{ + int r = 1; + struct list_head *sl; + struct dm_snapshot *snap; + struct exception *e; + struct pending_exception *pe, *last = NULL; + chunk_t chunk; + + /* Do all the snapshots on this origin */ + list_for_each(sl, snapshots) { + snap = list_entry(sl, struct dm_snapshot, list); + + /* Only deal with valid snapshots */ + if (!snap->valid) + continue; + + down_write(&snap->lock); + + /* + * Remember, different snapshots can have + * different chunk sizes. + */ + chunk = sector_to_chunk(snap, bh->b_rsector); + + /* + * Check exception table to see if block + * is already remapped in this snapshot + * and trigger an exception if not. + */ + e = lookup_exception(&snap->complete, chunk); + if (!e) { + pe = find_pending_exception(snap, bh); + if (!pe) { + snap->store.drop_snapshot(&snap->store); + snap->valid = 0; + + } else { + if (last) + list_merge(&pe->siblings, + &last->siblings); + + last = pe; + r = 0; + } + } + + up_write(&snap->lock); + } + + /* + * Now that we have a complete pe list we can start the copying. + */ + if (last) { + pe = last; + do { + down_write(&pe->snap->lock); + queue_buffer(&pe->origin_bhs, bh); + start_copy(pe); + up_write(&pe->snap->lock); + pe = list_entry(pe->siblings.next, + struct pending_exception, siblings); + + } while (pe != last); + } + + return r; +} + +static int snapshot_status(status_type_t type, char *result, + int maxlen, void *context) +{ + struct dm_snapshot *snap = (struct dm_snapshot *) context; + char cow[16]; + char org[16]; + + switch (type) { + case STATUSTYPE_INFO: + if (!snap->valid) + snprintf(result, maxlen, "Invalid"); + else { + if (snap->store.percent_full) + snprintf(result, maxlen, "%d%%", + snap->store.percent_full(&snap-> + store)); + else + snprintf(result, maxlen, "Unknown"); + } + break; + + case STATUSTYPE_TABLE: + /* + * kdevname returns a static pointer so we need + * to make private copies if the output is to + * make sense. + */ + strncpy(cow, kdevname(snap->cow->dev), sizeof(cow)); + strncpy(org, kdevname(snap->origin->dev), sizeof(org)); + snprintf(result, maxlen, "%s %s %c %ld", org, cow, + snap->type, snap->chunk_size); + break; + } + + return 0; +} + +/* + * Called on a write from the origin driver. + */ +int do_origin(struct dm_dev *origin, struct buffer_head *bh) +{ + struct origin *o; + int r; + + down_read(&_origins_lock); + o = __lookup_origin(origin->dev); + if (!o) + BUG(); + + r = __origin_write(&o->snapshots, bh); + up_read(&_origins_lock); + + return r; +} + +/* + * Origin: maps a linear range of a device, with hooks for snapshotting. + */ + +/* + * Construct an origin mapping: + * The context for an origin is merely a 'struct dm_dev *' + * pointing to the real device. + */ +static int origin_ctr(struct dm_table *t, offset_t b, offset_t l, + int argc, char **argv, void **context) +{ + int r; + struct dm_dev *dev; + + if (argc != 1) { + *context = "dm-origin: incorrect number of arguments"; + return -EINVAL; + } + + r = dm_table_get_device(t, argv[0], 0, l, t->mode, &dev); + if (r) { + *context = "Cannot get target device"; + return r; + } + + *context = dev; + + return 0; +} + +static void origin_dtr(struct dm_table *t, void *c) +{ + struct dm_dev *dev = (struct dm_dev *) c; + dm_table_put_device(t, dev); +} + +static int origin_map(struct buffer_head *bh, int rw, void *context) +{ + struct dm_dev *dev = (struct dm_dev *) context; + bh->b_rdev = dev->dev; + + /* Only tell snapshots if this is a write */ + return (rw == WRITE) ? do_origin(dev, bh) : 1; +} + +static int origin_status(status_type_t type, char *result, + int maxlen, void *context) +{ + struct dm_dev *dev = (struct dm_dev *) context; + + switch (type) { + case STATUSTYPE_INFO: + result[0] = '\0'; + break; + + case STATUSTYPE_TABLE: + snprintf(result, maxlen, "%s", kdevname(dev->dev)); + break; + } + + return 0; +} + +static struct target_type origin_target = { + name: "snapshot-origin", + module: THIS_MODULE, + ctr: origin_ctr, + dtr: origin_dtr, + map: origin_map, + status: origin_status, + err: NULL +}; + +static struct target_type snapshot_target = { + name: "snapshot", + module: THIS_MODULE, + ctr: snapshot_ctr, + dtr: snapshot_dtr, + map: snapshot_map, + status: snapshot_status, + err: NULL +}; + +int __init dm_snapshot_init(void) +{ + int r; + + r = dm_register_target(&snapshot_target); + if (r) { + DMERR("snapshot target register failed %d", r); + return r; + } + + r = dm_register_target(&origin_target); + if (r < 0) { + DMERR("Device mapper: Origin: register failed %d\n", r); + goto bad1; + } + + r = init_origin_hash(); + if (r) { + DMERR("init_origin_hash failed."); + goto bad2; + } + + exception_cache = kmem_cache_create("dm-snapshot-ex", + sizeof(struct exception), + __alignof__(struct exception), + 0, NULL, NULL); + if (!exception_cache) { + DMERR("Couldn't create exception cache."); + r = -ENOMEM; + goto bad3; + } + + pending_cache = + kmem_cache_create("dm-snapshot-in", + sizeof(struct pending_exception), + __alignof__(struct pending_exception), + 0, NULL, NULL); + if (!pending_cache) { + DMERR("Couldn't create pending cache."); + r = -ENOMEM; + goto bad4; + } + + pending_pool = mempool_create(128, mempool_alloc_slab, + mempool_free_slab, pending_cache); + if (!pending_pool) { + DMERR("Couldn't create pending pool."); + r = -ENOMEM; + goto bad5; + } + + return 0; + + bad5: + kmem_cache_destroy(pending_cache); + bad4: + kmem_cache_destroy(exception_cache); + bad3: + exit_origin_hash(); + bad2: + dm_unregister_target(&origin_target); + bad1: + dm_unregister_target(&snapshot_target); + return r; +} + +void dm_snapshot_exit(void) +{ + int r; + + r = dm_unregister_target(&snapshot_target); + if (r) + DMERR("snapshot unregister failed %d", r); + + r = dm_unregister_target(&origin_target); + if (r) + DMERR("origin unregister failed %d", r); + + exit_origin_hash(); + mempool_destroy(pending_pool); + kmem_cache_destroy(pending_cache); + kmem_cache_destroy(exception_cache); +} + +/* + * 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-file-style: "linux" + * End: + */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/dm-snapshot.h linux.20pre5-ac2/drivers/md/dm-snapshot.h --- linux.20pre5/drivers/md/dm-snapshot.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/dm-snapshot.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,147 @@ +/* + * dm-snapshot.c + * + * Copyright (C) 2001-2002 Sistina Software (UK) Limited. + * + * This file is released under the GPL. + */ + +#ifndef DM_SNAPSHOT_H +#define DM_SNAPSHOT_H + +#include "dm.h" +#include + +struct exception_table { + uint32_t hash_mask; + struct list_head *table; +}; + +/* + * The snapshot code deals with largish chunks of the disk at a + * time. Typically 64k - 256k. + */ +/* FIXME: can we get away with limiting these to a uint32_t ? */ +typedef offset_t chunk_t; + +/* + * An exception is used where an old chunk of data has been + * replaced by a new one. + */ +struct exception { + struct list_head hash_list; + + chunk_t old_chunk; + chunk_t new_chunk; +}; + +/* + * Abstraction to handle the meta/layout of exception stores (the + * COW device). + */ +struct exception_store { + + /* + * Destroys this object when you've finished with it. + */ + void (*destroy) (struct exception_store *store); + + /* + * Find somewhere to store the next exception. + */ + int (*prepare_exception) (struct exception_store *store, + struct exception *e); + + /* + * Update the metadata with this exception. + */ + void (*commit_exception) (struct exception_store *store, + struct exception *e, + void (*callback) (void *, int success), + void *callback_context); + + /* + * The snapshot is invalid, note this in the metadata. + */ + void (*drop_snapshot) (struct exception_store *store); + + /* + * Return the %age full of the snapshot + */ + int (*percent_full) (struct exception_store *store); + + struct dm_snapshot *snap; + void *context; +}; + +struct dm_snapshot { + struct rw_semaphore lock; + struct dm_table *table; + + struct dm_dev *origin; + struct dm_dev *cow; + + /* List of snapshots per Origin */ + struct list_head list; + + /* Size of data blocks saved - must be a power of 2 */ + chunk_t chunk_size; + chunk_t chunk_mask; + chunk_t chunk_shift; + + /* You can't use a snapshot if this is 0 (e.g. if full) */ + int valid; + + /* Used for display of table */ + char type; + + /* The last percentage we notified */ + int last_percent; + + struct exception_table pending; + struct exception_table complete; + + /* The on disk metadata handler */ + struct exception_store store; +}; + +/* + * Used by the exception stores to load exceptions hen + * initialising. + */ +int dm_add_exception(struct dm_snapshot *s, chunk_t old, chunk_t new); + +/* + * Constructor and destructor for the default persistent + * store. + */ +int dm_create_persistent(struct exception_store *store, uint32_t chunk_size); + +int dm_create_transient(struct exception_store *store, + struct dm_snapshot *s, int blocksize, void **error); + +/* + * Return the number of sectors in the device. + */ +static inline offset_t get_dev_size(kdev_t dev) +{ + int *sizes; + + sizes = blk_size[MAJOR(dev)]; + if (sizes) + return sizes[MINOR(dev)] << 1; + + return 0; +} + +static inline chunk_t sector_to_chunk(struct dm_snapshot *s, offset_t sector) +{ + return (sector & ~s->chunk_mask) >> s->chunk_shift; +} + +static inline offset_t chunk_to_sector(struct dm_snapshot *s, chunk_t chunk) +{ + return chunk << s->chunk_shift; +} + +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/dm-stripe.c linux.20pre5-ac2/drivers/md/dm-stripe.c --- linux.20pre5/drivers/md/dm-stripe.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/dm-stripe.c 2002-08-12 22:45:52.000000000 +0100 @@ -0,0 +1,234 @@ +/* + * Copyright (C) 2001 Sistina Software (UK) Limited. + * + * This file is released under the GPL. + */ + +#include "dm.h" + +#include +#include +#include + +struct stripe { + struct dm_dev *dev; + offset_t physical_start; +}; + +struct stripe_c { + offset_t logical_start; + uint32_t stripes; + + /* The size of this target / num. stripes */ + uint32_t stripe_width; + + /* stripe chunk size */ + uint32_t chunk_shift; + offset_t chunk_mask; + + struct stripe stripe[0]; +}; + +static inline struct stripe_c *alloc_context(int stripes) +{ + size_t len; + + if (array_too_big(sizeof(struct stripe_c), sizeof(struct stripe), + stripes)) + return NULL; + + len = sizeof(struct stripe_c) + (sizeof(struct stripe) * stripes); + + return kmalloc(len, GFP_KERNEL); +} + +/* + * Parse a single pair + */ +static int get_stripe(struct dm_table *t, struct stripe_c *sc, + int stripe, char **argv) +{ + char *end; + unsigned long start; + + start = simple_strtoul(argv[1], &end, 10); + if (*end) + return -EINVAL; + + if (dm_table_get_device(t, argv[0], start, sc->stripe_width, + t->mode, &sc->stripe[stripe].dev)) + return -ENXIO; + + sc->stripe[stripe].physical_start = start; + return 0; +} + +/* + * Construct a striped mapping. + * [ ]+ + */ +static int stripe_ctr(struct dm_table *t, offset_t b, offset_t l, + int argc, char **argv, void **context) +{ + struct stripe_c *sc; + uint32_t stripes; + uint32_t chunk_size; + char *end; + int r, i; + + if (argc < 2) { + *context = "dm-stripe: Not enough arguments"; + return -EINVAL; + } + + stripes = simple_strtoul(argv[0], &end, 10); + if (*end) { + *context = "dm-stripe: Invalid stripe count"; + return -EINVAL; + } + + chunk_size = simple_strtoul(argv[1], &end, 10); + if (*end) { + *context = "dm-stripe: Invalid chunk_size"; + return -EINVAL; + } + + if (l % stripes) { + *context = "dm-stripe: Target length not divisable by " + "number of stripes"; + return -EINVAL; + } + + sc = alloc_context(stripes); + if (!sc) { + *context = "dm-stripe: Memory allocation for striped context " + "failed"; + return -ENOMEM; + } + + sc->logical_start = b; + sc->stripes = stripes; + sc->stripe_width = l / stripes; + + /* + * chunk_size is a power of two + */ + if (!chunk_size || (chunk_size & (chunk_size - 1))) { + *context = "dm-stripe: Invalid chunk size"; + kfree(sc); + return -EINVAL; + } + + sc->chunk_mask = chunk_size - 1; + for (sc->chunk_shift = 0; chunk_size; sc->chunk_shift++) + chunk_size >>= 1; + sc->chunk_shift--; + + /* + * Get the stripe destinations. + */ + for (i = 0; i < stripes; i++) { + if (argc < 2) { + *context = "dm-stripe: Not enough destinations " + "specified"; + kfree(sc); + return -EINVAL; + } + + argv += 2; + + r = get_stripe(t, sc, i, argv); + if (r < 0) { + *context = "dm-stripe: Couldn't parse stripe " + "destination"; + while (i--) + dm_table_put_device(t, sc->stripe[i].dev); + kfree(sc); + return r; + } + } + + *context = sc; + return 0; +} + +static void stripe_dtr(struct dm_table *t, void *c) +{ + unsigned int i; + struct stripe_c *sc = (struct stripe_c *) c; + + for (i = 0; i < sc->stripes; i++) + dm_table_put_device(t, sc->stripe[i].dev); + + kfree(sc); +} + +static int stripe_map(struct buffer_head *bh, int rw, void *context) +{ + struct stripe_c *sc = (struct stripe_c *) context; + + offset_t offset = bh->b_rsector - sc->logical_start; + uint32_t chunk = (uint32_t) (offset >> sc->chunk_shift); + uint32_t stripe = chunk % sc->stripes; /* 32bit modulus */ + chunk = chunk / sc->stripes; + + bh->b_rdev = sc->stripe[stripe].dev->dev; + bh->b_rsector = sc->stripe[stripe].physical_start + + (chunk << sc->chunk_shift) + (offset & sc->chunk_mask); + return 1; +} + +static int stripe_status(status_type_t type, char *result, int maxlen, + void *context) +{ + struct stripe_c *sc = (struct stripe_c *) context; + int offset; + int i; + + switch (type) { + case STATUSTYPE_INFO: + result[0] = '\0'; + break; + + case STATUSTYPE_TABLE: + offset = snprintf(result, maxlen, "%d %ld", + sc->stripes, sc->chunk_mask + 1); + for (i = 0; i < sc->stripes; i++) { + offset += + snprintf(result + offset, maxlen - offset, + " %s %ld", + kdevname(sc->stripe[i].dev->dev), + sc->stripe[i].physical_start); + } + break; + } + return 0; +} + +static struct target_type stripe_target = { + name: "striped", + module: THIS_MODULE, + ctr: stripe_ctr, + dtr: stripe_dtr, + map: stripe_map, + status: stripe_status, +}; + +int __init dm_stripe_init(void) +{ + int r; + + r = dm_register_target(&stripe_target); + if (r < 0) + DMWARN("striped target registration failed"); + + return r; +} + +void dm_stripe_exit(void) +{ + if (dm_unregister_target(&stripe_target)) + DMWARN("striped target unregistration failed"); + + return; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/dm-table.c linux.20pre5-ac2/drivers/md/dm-table.c --- linux.20pre5/drivers/md/dm-table.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/dm-table.c 2002-08-12 22:45:52.000000000 +0100 @@ -0,0 +1,452 @@ +/* + * Copyright (C) 2001 Sistina Software (UK) Limited. + * + * This file is released under the GPL. + */ + +#include "dm.h" + +#include + +/* ceiling(n / size) * size */ +static inline unsigned long round_up(unsigned long n, unsigned long size) +{ + unsigned long r = n % size; + return n + (r ? (size - r) : 0); +} + +/* ceiling(n / size) */ +static inline unsigned long div_up(unsigned long n, unsigned long size) +{ + return round_up(n, size) / size; +} + +/* similar to ceiling(log_size(n)) */ +static uint int_log(unsigned long n, unsigned long base) +{ + int result = 0; + + while (n > 1) { + n = div_up(n, base); + result++; + } + + return result; +} + +/* + * return the highest key that you could lookup + * from the n'th node on level l of the btree. + */ +static offset_t high(struct dm_table *t, int l, int n) +{ + for (; l < t->depth - 1; l++) + n = get_child(n, CHILDREN_PER_NODE - 1); + + if (n >= t->counts[l]) + return (offset_t) - 1; + + return get_node(t, l, n)[KEYS_PER_NODE - 1]; +} + +/* + * fills in a level of the btree based on the + * highs of the level below it. + */ +static int setup_btree_index(int l, struct dm_table *t) +{ + int n, k; + offset_t *node; + + for (n = 0; n < t->counts[l]; n++) { + node = get_node(t, l, n); + + for (k = 0; k < KEYS_PER_NODE; k++) + node[k] = high(t, l + 1, get_child(n, k)); + } + + return 0; +} + +/* + * highs, and targets are managed as dynamic + * arrays during a table load. + */ +static int alloc_targets(struct dm_table *t, int num) +{ + offset_t *n_highs; + struct target *n_targets; + int n = t->num_targets; + + /* + * Allocate both the target array and offset array at once. + */ + n_highs = (offset_t *) vcalloc(sizeof(struct target) + sizeof(offset_t), + num); + if (!n_highs) + return -ENOMEM; + + n_targets = (struct target *) (n_highs + num); + + if (n) { + memcpy(n_highs, t->highs, sizeof(*n_highs) * n); + memcpy(n_targets, t->targets, sizeof(*n_targets) * n); + } + + memset(n_highs + n, -1, sizeof(*n_highs) * (num - n)); + if (t->highs) + vfree(t->highs); + + t->num_allocated = num; + t->highs = n_highs; + t->targets = n_targets; + + return 0; +} + +int dm_table_create(struct dm_table **result, int mode) +{ + struct dm_table *t = kmalloc(sizeof(*t), GFP_NOIO); + + if (!t) + return -ENOMEM; + + memset(t, 0, sizeof(*t)); + INIT_LIST_HEAD(&t->devices); + + /* allocate a single node's worth of targets to begin with */ + if (alloc_targets(t, KEYS_PER_NODE)) { + kfree(t); + t = NULL; + return -ENOMEM; + } + + init_waitqueue_head(&t->eventq); + t->mode = mode; + *result = t; + return 0; +} + +static void free_devices(struct list_head *devices) +{ + struct list_head *tmp, *next; + + for (tmp = devices->next; tmp != devices; tmp = next) { + struct dm_dev *dd = list_entry(tmp, struct dm_dev, list); + next = tmp->next; + kfree(dd); + } +} + +void dm_table_destroy(struct dm_table *t) +{ + int i; + + /* destroying the table counts as an event */ + dm_table_event(t); + + /* free the indexes (see dm_table_complete) */ + if (t->depth >= 2) + vfree(t->index[t->depth - 2]); + + /* free the targets */ + for (i = 0; i < t->num_targets; i++) { + struct target *tgt = &t->targets[i]; + + dm_put_target_type(t->targets[i].type); + + if (tgt->type->dtr) + tgt->type->dtr(t, tgt->private); + } + + vfree(t->highs); + + /* free the device list */ + if (t->devices.next != &t->devices) { + DMWARN("devices still present during destroy: " + "dm_table_remove_device calls missing"); + + free_devices(&t->devices); + } + + kfree(t); +} + +/* + * Checks to see if we need to extend highs or targets. + */ +static inline int check_space(struct dm_table *t) +{ + if (t->num_targets >= t->num_allocated) + return alloc_targets(t, t->num_allocated * 2); + + return 0; +} + +/* + * Convert a device path to a kdev_t. + */ +int lookup_device(const char *path, kdev_t *dev) +{ + int r; + struct nameidata nd; + struct inode *inode; + + if (!path_init(path, LOOKUP_FOLLOW, &nd)) + return 0; + + if ((r = path_walk(path, &nd))) + goto bad; + + inode = nd.dentry->d_inode; + if (!inode) { + r = -ENOENT; + goto bad; + } + + if (!S_ISBLK(inode->i_mode)) { + r = -EINVAL; + goto bad; + } + + *dev = inode->i_rdev; + + bad: + path_release(&nd); + return r; +} + +/* + * See if we've already got a device in the list. + */ +static struct dm_dev *find_device(struct list_head *l, kdev_t dev) +{ + struct list_head *tmp; + + list_for_each(tmp, l) { + struct dm_dev *dd = list_entry(tmp, struct dm_dev, list); + if (dd->dev == dev) + return dd; + } + + return NULL; +} + +/* + * Open a device so we can use it as a map destination. + */ +static int open_dev(struct dm_dev *d) +{ + int err; + + if (d->bd) + BUG(); + + if (!(d->bd = bdget(kdev_t_to_nr(d->dev)))) + return -ENOMEM; + + if ((err = blkdev_get(d->bd, d->mode, 0, BDEV_FILE))) + return err; + + return 0; +} + +/* + * Close a device that we've been using. + */ +static void close_dev(struct dm_dev *d) +{ + if (!d->bd) + return; + + blkdev_put(d->bd, BDEV_FILE); + d->bd = NULL; +} + +/* + * If possible (ie. blk_size[major] is set), this + * checks an area of a destination device is + * valid. + */ +static int check_device_area(kdev_t dev, offset_t start, offset_t len) +{ + int *sizes; + offset_t dev_size; + + if (!(sizes = blk_size[MAJOR(dev)]) || !(dev_size = sizes[MINOR(dev)])) + /* we don't know the device details, + * so give the benefit of the doubt */ + return 1; + + /* convert to 512-byte sectors */ + dev_size <<= 1; + + return ((start < dev_size) && (len <= (dev_size - start))); +} + +/* + * This upgrades the mode on an already open dm_dev. Being + * careful to leave things as they were if we fail to reopen the + * device. + */ +static int upgrade_mode(struct dm_dev *dd, int new_mode) +{ + int r; + struct dm_dev dd_copy; + + memcpy(&dd_copy, dd, sizeof(dd_copy)); + + dd->mode |= new_mode; + dd->bd = NULL; + r = open_dev(dd); + if (!r) + close_dev(&dd_copy); + else + memcpy(dd, &dd_copy, sizeof(dd_copy)); + + return r; +} + +/* + * Add a device to the list, or just increment the usage count + * if it's already present. + */ +int dm_table_get_device(struct dm_table *t, const char *path, + offset_t start, offset_t len, int mode, + struct dm_dev **result) +{ + int r; + kdev_t dev; + struct dm_dev *dd; + int major, minor; + + if (sscanf(path, "%x:%x", &major, &minor) == 2) { + /* Extract the major/minor numbers */ + dev = MKDEV(major, minor); + } else { + /* convert the path to a device */ + if ((r = lookup_device(path, &dev))) + return r; + } + + dd = find_device(&t->devices, dev); + if (!dd) { + dd = kmalloc(sizeof(*dd), GFP_KERNEL); + if (!dd) + return -ENOMEM; + + dd->mode = mode; + dd->dev = dev; + dd->bd = NULL; + + if ((r = open_dev(dd))) { + kfree(dd); + return r; + } + + atomic_set(&dd->count, 0); + list_add(&dd->list, &t->devices); + + } else if (dd->mode != (mode | dd->mode)) { + r = upgrade_mode(dd, mode); + if (r) + return r; + } + atomic_inc(&dd->count); + + if (!check_device_area(dd->dev, start, len)) { + DMWARN("device %s too small for target", path); + dm_table_put_device(t, dd); + return -EINVAL; + } + + *result = dd; + + return 0; +} + +/* + * Decrement a devices use count and remove it if neccessary. + */ +void dm_table_put_device(struct dm_table *t, struct dm_dev *dd) +{ + if (atomic_dec_and_test(&dd->count)) { + close_dev(dd); + list_del(&dd->list); + kfree(dd); + } +} + +/* + * Adds a target to the map + */ +int dm_table_add_target(struct dm_table *t, offset_t highs, + struct target_type *type, void *private) +{ + int r, n; + + if ((r = check_space(t))) + return r; + + n = t->num_targets++; + t->highs[n] = highs; + t->targets[n].type = type; + t->targets[n].private = private; + + return 0; +} + +static int setup_indexes(struct dm_table *t) +{ + int i, total = 0; + offset_t *indexes; + + /* allocate the space for *all* the indexes */ + for (i = t->depth - 2; i >= 0; i--) { + t->counts[i] = div_up(t->counts[i + 1], CHILDREN_PER_NODE); + total += t->counts[i]; + } + + indexes = (offset_t *) vcalloc(total, (unsigned long) NODE_SIZE); + if (!indexes) + return -ENOMEM; + + /* set up internal nodes, bottom-up */ + for (i = t->depth - 2, total = 0; i >= 0; i--) { + t->index[i] = indexes; + indexes += (KEYS_PER_NODE * t->counts[i]); + setup_btree_index(i, t); + } + + return 0; +} + +/* + * Builds the btree to index the map + */ +int dm_table_complete(struct dm_table *t) +{ + int leaf_nodes, r = 0; + + /* how many indexes will the btree have ? */ + leaf_nodes = div_up(t->num_targets, KEYS_PER_NODE); + t->depth = 1 + int_log(leaf_nodes, CHILDREN_PER_NODE); + + /* leaf layer has already been set up */ + t->counts[t->depth - 1] = leaf_nodes; + t->index[t->depth - 1] = t->highs; + + if (t->depth >= 2) + r = setup_indexes(t); + + return r; +} + +void dm_table_event(struct dm_table *t) +{ + wake_up_interruptible(&t->eventq); +} + +EXPORT_SYMBOL(dm_table_get_device); +EXPORT_SYMBOL(dm_table_put_device); +EXPORT_SYMBOL(dm_table_event); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/dm-target.c linux.20pre5-ac2/drivers/md/dm-target.c --- linux.20pre5/drivers/md/dm-target.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/dm-target.c 2002-08-12 22:42:29.000000000 +0100 @@ -0,0 +1,242 @@ +/* + * Copyright (C) 2001 Sistina Software (UK) Limited + * + * This file is released under the GPL. + */ + +#include "dm.h" + +#include + +struct tt_internal { + struct target_type tt; + + struct list_head list; + long use; +}; + +static LIST_HEAD(_targets); +static rwlock_t _lock = RW_LOCK_UNLOCKED; + +#define DM_MOD_NAME_SIZE 32 + +/* + * Destructively splits up the argument list to pass to ctr. + */ +int split_args(int max, int *argc, char **argv, char *input) +{ + char *start, *end = input, *out; + *argc = 0; + + while (1) { + start = end; + + /* Skip whitespace */ + while (*start && isspace(*start)) + start++; + + if (!*start) + break; /* success, we hit the end */ + + /* 'out' is used to remove any back-quotes */ + end = out = start; + while (*end) { + /* Everything apart from '\0' can be quoted */ + if (*end == '\\' && *(end + 1)) { + *out++ = *(end + 1); + end += 2; + continue; + } + + if (isspace(*end)) + break; /* end of token */ + + *out++ = *end++; + } + + /* have we already filled the array ? */ + if ((*argc + 1) > max) + return -EINVAL; + + /* we know this is whitespace */ + if (*end) + end++; + + /* terminate the string and put it in the array */ + *out = '\0'; + argv[*argc] = start; + (*argc)++; + } + + return 0; +} + +static inline struct tt_internal *__find_target_type(const char *name) +{ + struct list_head *tih; + struct tt_internal *ti; + + list_for_each(tih, &_targets) { + ti = list_entry(tih, struct tt_internal, list); + + if (!strcmp(name, ti->tt.name)) + return ti; + } + + return NULL; +} + +static struct tt_internal *get_target_type(const char *name) +{ + struct tt_internal *ti; + + read_lock(&_lock); + ti = __find_target_type(name); + + if (ti) { + if (ti->use == 0 && ti->tt.module) + __MOD_INC_USE_COUNT(ti->tt.module); + ti->use++; + } + read_unlock(&_lock); + + return ti; +} + +static void load_module(const char *name) +{ + char module_name[DM_MOD_NAME_SIZE] = "dm-"; + + /* Length check for strcat() below */ + if (strlen(name) > (DM_MOD_NAME_SIZE - 4)) + return; + + strcat(module_name, name); + request_module(module_name); + + return; +} + +struct target_type *dm_get_target_type(const char *name) +{ + struct tt_internal *ti = get_target_type(name); + + if (!ti) { + load_module(name); + ti = get_target_type(name); + } + + return ti ? &ti->tt : NULL; +} + +void dm_put_target_type(struct target_type *t) +{ + struct tt_internal *ti = (struct tt_internal *) t; + + read_lock(&_lock); + if (--ti->use == 0 && ti->tt.module) + __MOD_DEC_USE_COUNT(ti->tt.module); + + if (ti->use < 0) + BUG(); + read_unlock(&_lock); + + return; +} + +static struct tt_internal *alloc_target(struct target_type *t) +{ + struct tt_internal *ti = kmalloc(sizeof(*ti), GFP_KERNEL); + + if (ti) { + memset(ti, 0, sizeof(*ti)); + ti->tt = *t; + } + + return ti; +} + +int dm_register_target(struct target_type *t) +{ + int rv = 0; + struct tt_internal *ti = alloc_target(t); + + if (!ti) + return -ENOMEM; + + write_lock(&_lock); + if (__find_target_type(t->name)) + rv = -EEXIST; + else + list_add(&ti->list, &_targets); + + write_unlock(&_lock); + return rv; +} + +int dm_unregister_target(struct target_type *t) +{ + struct tt_internal *ti; + + write_lock(&_lock); + if (!(ti = __find_target_type(t->name))) { + write_unlock(&_lock); + return -EINVAL; + } + + if (ti->use) { + write_unlock(&_lock); + return -ETXTBSY; + } + + list_del(&ti->list); + kfree(ti); + + write_unlock(&_lock); + return 0; +} + +/* + * io-err: always fails an io, useful for bringing + * up LV's that have holes in them. + */ +static int io_err_ctr(struct dm_table *t, offset_t b, offset_t l, + int argc, char **args, void **context) +{ + *context = NULL; + return 0; +} + +static void io_err_dtr(struct dm_table *t, void *c) +{ + /* empty */ + return; +} + +static int io_err_map(struct buffer_head *bh, int rw, void *context) +{ + buffer_IO_error(bh); + return 0; +} + +static struct target_type error_target = { + name: "error", + ctr: io_err_ctr, + dtr: io_err_dtr, + map: io_err_map, + status: NULL, +}; + +int dm_target_init(void) +{ + return dm_register_target(&error_target); +} + +void dm_target_exit(void) +{ + if (dm_unregister_target(&error_target)) + DMWARN("error target unregistration failed"); +} + +EXPORT_SYMBOL(dm_register_target); +EXPORT_SYMBOL(dm_unregister_target); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/kcopyd.c linux.20pre5-ac2/drivers/md/kcopyd.c --- linux.20pre5/drivers/md/kcopyd.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/kcopyd.c 2002-08-12 22:46:01.000000000 +0100 @@ -0,0 +1,841 @@ +/* + * Copyright (C) 2002 Sistina Software (UK) Limited. + * + * This file is released under the GPL. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "kcopyd.h" + +/* FIXME: this is only needed for the DMERR macros */ +#include "dm.h" + +/* + * Hard sector size used all over the kernel. + */ +#define SECTOR_SIZE 512 +#define SECTOR_SHIFT 9 + +static void wake_kcopyd(void); + +/*----------------------------------------------------------------- + * We reserve our own pool of preallocated pages that are + * only used for kcopyd io. + *---------------------------------------------------------------*/ + +/* + * FIXME: This should be configurable. + */ +#define NUM_PAGES 512 + +static DECLARE_MUTEX(_pages_lock); +static int _num_free_pages; +static struct page *_pages_array[NUM_PAGES]; +static DECLARE_MUTEX(start_lock); + +static int init_pages(void) +{ + int i; + struct page *p; + + for (i = 0; i < NUM_PAGES; i++) { + p = alloc_page(GFP_KERNEL); + if (!p) + goto bad; + + LockPage(p); + _pages_array[i] = p; + } + + _num_free_pages = NUM_PAGES; + return 0; + + bad: + while (i--) + __free_page(_pages_array[i]); + return -ENOMEM; +} + +static void exit_pages(void) +{ + int i; + struct page *p; + + for (i = 0; i < NUM_PAGES; i++) { + p = _pages_array[i]; + UnlockPage(p); + __free_page(p); + } + + _num_free_pages = 0; +} + +static int kcopyd_get_pages(int num, struct page **result) +{ + int i; + + down(&_pages_lock); + if (_num_free_pages < num) { + up(&_pages_lock); + return -ENOMEM; + } + + for (i = 0; i < num; i++) { + _num_free_pages--; + result[i] = _pages_array[_num_free_pages]; + } + up(&_pages_lock); + + return 0; +} + +static void kcopyd_free_pages(int num, struct page **result) +{ + int i; + + down(&_pages_lock); + for (i = 0; i < num; i++) + _pages_array[_num_free_pages++] = result[i]; + up(&_pages_lock); +} + +/*----------------------------------------------------------------- + * We keep our own private pool of buffer_heads. These are just + * held in a list on the b_reqnext field. + *---------------------------------------------------------------*/ + +/* + * Make sure we have enough buffers to always keep the pages + * occupied. So we assume the worst case scenario where blocks + * are the size of a single sector. + */ +#define NUM_BUFFERS NUM_PAGES * (PAGE_SIZE / SECTOR_SIZE) + +static spinlock_t _buffer_lock = SPIN_LOCK_UNLOCKED; +static struct buffer_head *_all_buffers; +static struct buffer_head *_free_buffers; + +static int init_buffers(void) +{ + int i; + struct buffer_head *buffers; + + buffers = vcalloc(NUM_BUFFERS, sizeof(struct buffer_head)); + if (!buffers) { + DMWARN("Couldn't allocate buffer heads."); + return -ENOMEM; + } + + for (i = 0; i < NUM_BUFFERS; i++) { + if (i < NUM_BUFFERS - 1) + buffers[i].b_reqnext = &buffers[i + 1]; + init_waitqueue_head(&buffers[i].b_wait); + INIT_LIST_HEAD(&buffers[i].b_inode_buffers); + } + + _all_buffers = _free_buffers = buffers; + return 0; +} + +static void exit_buffers(void) +{ + vfree(_all_buffers); +} + +static struct buffer_head *alloc_buffer(void) +{ + struct buffer_head *r; + int flags; + + spin_lock_irqsave(&_buffer_lock, flags); + + if (!_free_buffers) + r = NULL; + else { + r = _free_buffers; + _free_buffers = _free_buffers->b_reqnext; + r->b_reqnext = NULL; + } + + spin_unlock_irqrestore(&_buffer_lock, flags); + + return r; +} + +/* + * Only called from interrupt context. + */ +static void free_buffer(struct buffer_head *bh) +{ + int flags, was_empty; + + spin_lock_irqsave(&_buffer_lock, flags); + was_empty = (_free_buffers == NULL) ? 1 : 0; + bh->b_reqnext = _free_buffers; + _free_buffers = bh; + spin_unlock_irqrestore(&_buffer_lock, flags); + + /* + * If the buffer list was empty then kcopyd probably went + * to sleep because it ran out of buffer heads, so let's + * wake it up. + */ + if (was_empty) + wake_kcopyd(); +} + +/*----------------------------------------------------------------- + * kcopyd_jobs need to be allocated by the *clients* of kcopyd, + * for this reason we use a mempool to prevent the client from + * ever having to do io (which could cause a + * deadlock). + *---------------------------------------------------------------*/ +#define MIN_JOBS NUM_PAGES + +static kmem_cache_t *_job_cache = NULL; +static mempool_t *_job_pool = NULL; + +/* + * We maintain three lists of jobs: + * + * i) jobs waiting for pages + * ii) jobs that have pages, and are waiting for the io to be issued. + * iii) jobs that have completed. + * + * All three of these are protected by job_lock. + */ + +static spinlock_t _job_lock = SPIN_LOCK_UNLOCKED; + +static LIST_HEAD(_complete_jobs); +static LIST_HEAD(_io_jobs); +static LIST_HEAD(_pages_jobs); + +static int init_jobs(void) +{ + INIT_LIST_HEAD(&_complete_jobs); + INIT_LIST_HEAD(&_io_jobs); + INIT_LIST_HEAD(&_pages_jobs); + + _job_cache = kmem_cache_create("kcopyd-jobs", sizeof(struct kcopyd_job), + __alignof__(struct kcopyd_job), + 0, NULL, NULL); + if (!_job_cache) + return -ENOMEM; + + _job_pool = mempool_create(MIN_JOBS, mempool_alloc_slab, + mempool_free_slab, _job_cache); + if (!_job_pool) { + kmem_cache_destroy(_job_cache); + return -ENOMEM; + } + + return 0; +} + +static void exit_jobs(void) +{ + mempool_destroy(_job_pool); + kmem_cache_destroy(_job_cache); +} + +struct kcopyd_job *kcopyd_alloc_job(void) +{ + struct kcopyd_job *job; + + job = mempool_alloc(_job_pool, GFP_KERNEL); + if (!job) + return NULL; + + memset(job, 0, sizeof(*job)); + return job; +} + +void kcopyd_free_job(struct kcopyd_job *job) +{ + mempool_free(job, _job_pool); +} + +/* + * Functions to push and pop a job onto the head of a given job + * list. + */ +static inline struct kcopyd_job *pop(struct list_head *jobs) +{ + struct kcopyd_job *job = NULL; + int flags; + + spin_lock_irqsave(&_job_lock, flags); + + if (!list_empty(jobs)) { + job = list_entry(jobs->next, struct kcopyd_job, list); + list_del(&job->list); + } + spin_unlock_irqrestore(&_job_lock, flags); + + return job; +} + +static inline void push(struct list_head *jobs, struct kcopyd_job *job) +{ + int flags; + + spin_lock_irqsave(&_job_lock, flags); + list_add(&job->list, jobs); + spin_unlock_irqrestore(&_job_lock, flags); +} + +/* + * Completion function for one of our buffers. + */ +static void end_bh(struct buffer_head *bh, int uptodate) +{ + struct kcopyd_job *job = bh->b_private; + + mark_buffer_uptodate(bh, uptodate); + unlock_buffer(bh); + + if (!uptodate) + job->err = -EIO; + + /* are we the last ? */ + if (atomic_dec_and_test(&job->nr_incomplete)) { + push(&_complete_jobs, job); + wake_kcopyd(); + } + + free_buffer(bh); +} + +static void dispatch_bh(struct kcopyd_job *job, + struct buffer_head *bh, int block) +{ + int p; + + /* + * Add in the job offset + */ + bh->b_blocknr = (job->disk.sector >> job->block_shift) + block; + + p = block >> job->bpp_shift; + block &= job->bpp_mask; + + bh->b_dev = B_FREE; + bh->b_size = job->block_size; + set_bh_page(bh, job->pages[p], ((block << job->block_shift) + + job->offset) << SECTOR_SHIFT); + bh->b_this_page = bh; + + init_buffer(bh, end_bh, job); + + bh->b_dev = job->disk.dev; + bh->b_state = ((1 << BH_Mapped) | (1 << BH_Lock) | (1 << BH_Req)); + + set_bit(BH_Uptodate, &bh->b_state); + if (job->rw == WRITE) + clear_bit(BH_Dirty, &bh->b_state); + + submit_bh(job->rw, bh); +} + +/* + * These three functions process 1 item from the corresponding + * job list. + * + * They return: + * < 0: error + * 0: success + * > 0: can't process yet. + */ +static int run_complete_job(struct kcopyd_job *job) +{ + job->callback(job); + return 0; +} + +/* + * Request io on as many buffer heads as we can currently get for + * a particular job. + */ +static int run_io_job(struct kcopyd_job *job) +{ + unsigned int block; + struct buffer_head *bh; + + for (block = atomic_read(&job->nr_requested); + block < job->nr_blocks; block++) { + bh = alloc_buffer(); + if (!bh) + break; + + atomic_inc(&job->nr_requested); + dispatch_bh(job, bh, block); + } + + return (block == job->nr_blocks) ? 0 : 1; +} + +static int run_pages_job(struct kcopyd_job *job) +{ + int r; + + job->nr_pages = (job->disk.count + job->offset) / + (PAGE_SIZE / SECTOR_SIZE); + r = kcopyd_get_pages(job->nr_pages, job->pages); + + if (!r) { + /* this job is ready for io */ + push(&_io_jobs, job); + return 0; + } + + if (r == -ENOMEM) + /* can complete now */ + return 1; + + return r; +} + +/* + * Run through a list for as long as possible. Returns the count + * of successful jobs. + */ +static int process_jobs(struct list_head *jobs, int (*fn) (struct kcopyd_job *)) +{ + struct kcopyd_job *job; + int r, count = 0; + + while ((job = pop(jobs))) { + + r = fn(job); + + if (r < 0) { + /* error this rogue job */ + job->err = r; + push(&_complete_jobs, job); + break; + } + + if (r > 0) { + /* + * We couldn't service this job ATM, so + * push this job back onto the list. + */ + push(jobs, job); + break; + } + + count++; + } + + return count; +} + +/* + * kcopyd does this every time it's woken up. + */ +static void do_work(void) +{ + int count; + + /* + * We loop round until there is no more work to do. + */ + do { + count = process_jobs(&_complete_jobs, run_complete_job); + count += process_jobs(&_io_jobs, run_io_job); + count += process_jobs(&_pages_jobs, run_pages_job); + + } while (count); + + run_task_queue(&tq_disk); +} + +/*----------------------------------------------------------------- + * The daemon + *---------------------------------------------------------------*/ +static atomic_t _kcopyd_must_die; +static DECLARE_MUTEX(_run_lock); +static DECLARE_WAIT_QUEUE_HEAD(_job_queue); + +static int kcopyd(void *arg) +{ + DECLARE_WAITQUEUE(wq, current); + + daemonize(); + strcpy(current->comm, "kcopyd"); + atomic_set(&_kcopyd_must_die, 0); + + add_wait_queue(&_job_queue, &wq); + + down(&_run_lock); + up(&start_lock); + + while (1) { + set_current_state(TASK_INTERRUPTIBLE); + + if (atomic_read(&_kcopyd_must_die)) + break; + + do_work(); + schedule(); + } + + set_current_state(TASK_RUNNING); + remove_wait_queue(&_job_queue, &wq); + + up(&_run_lock); + + return 0; +} + +static int start_daemon(void) +{ + static pid_t pid = 0; + + down(&start_lock); + + pid = kernel_thread(kcopyd, NULL, 0); + if (pid <= 0) { + DMERR("Failed to start kcopyd thread"); + return -EAGAIN; + } + + /* + * wait for the daemon to up this mutex. + */ + down(&start_lock); + up(&start_lock); + + return 0; +} + +static int stop_daemon(void) +{ + atomic_set(&_kcopyd_must_die, 1); + wake_kcopyd(); + down(&_run_lock); + up(&_run_lock); + + return 0; +} + +static void wake_kcopyd(void) +{ + wake_up_interruptible(&_job_queue); +} + +static int calc_shift(unsigned int n) +{ + int s; + + for (s = 0; n; s++, n >>= 1) + ; + + return --s; +} + +static void calc_block_sizes(struct kcopyd_job *job) +{ + job->block_size = get_hardsect_size(job->disk.dev); + job->block_shift = calc_shift(job->block_size / SECTOR_SIZE); + job->bpp_shift = PAGE_SHIFT - job->block_shift - SECTOR_SHIFT; + job->bpp_mask = (1 << job->bpp_shift) - 1; + job->nr_blocks = job->disk.count >> job->block_shift; + atomic_set(&job->nr_requested, 0); + atomic_set(&job->nr_incomplete, job->nr_blocks); +} + +int kcopyd_io(struct kcopyd_job *job) +{ + calc_block_sizes(job); + push(job->pages[0] ? &_io_jobs : &_pages_jobs, job); + wake_kcopyd(); + return 0; +} + +/*----------------------------------------------------------------- + * The copier is implemented on top of the simpler async io + * daemon above. + *---------------------------------------------------------------*/ +struct copy_info { + kcopyd_notify_fn notify; + void *notify_context; + + struct kcopyd_region to; +}; + +#define MIN_INFOS 128 +static kmem_cache_t *_copy_cache = NULL; +static mempool_t *_copy_pool = NULL; + +static int init_copier(void) +{ + _copy_cache = kmem_cache_create("kcopyd-info", + sizeof(struct copy_info), + __alignof__(struct copy_info), + 0, NULL, NULL); + if (!_copy_cache) + return -ENOMEM; + + _copy_pool = mempool_create(MIN_INFOS, mempool_alloc_slab, + mempool_free_slab, _copy_cache); + if (!_copy_pool) { + kmem_cache_destroy(_copy_cache); + return -ENOMEM; + } + + return 0; +} + +static void exit_copier(void) +{ + if (_copy_pool) + mempool_destroy(_copy_pool); + + if (_copy_cache) + kmem_cache_destroy(_copy_cache); +} + +static inline struct copy_info *alloc_copy_info(void) +{ + return mempool_alloc(_copy_pool, GFP_KERNEL); +} + +static inline void free_copy_info(struct copy_info *info) +{ + mempool_free(info, _copy_pool); +} + +void copy_complete(struct kcopyd_job *job) +{ + struct copy_info *info = (struct copy_info *) job->context; + + if (info->notify) + info->notify(job->err, info->notify_context); + + free_copy_info(info); + + kcopyd_free_pages(job->nr_pages, job->pages); + + kcopyd_free_job(job); +} + +static void page_write_complete(struct kcopyd_job *job) +{ + struct copy_info *info = (struct copy_info *) job->context; + int i; + + if (info->notify) + info->notify(job->err, info->notify_context); + + free_copy_info(info); + for (i = 0; i < job->nr_pages; i++) + put_page(job->pages[i]); + + kcopyd_free_job(job); +} + +/* + * These callback functions implement the state machine that copies regions. + */ +void copy_write(struct kcopyd_job *job) +{ + struct copy_info *info = (struct copy_info *) job->context; + + if (job->err && info->notify) { + info->notify(job->err, job->context); + kcopyd_free_job(job); + free_copy_info(info); + return; + } + + job->rw = WRITE; + memcpy(&job->disk, &info->to, sizeof(job->disk)); + job->callback = copy_complete; + job->context = info; + + /* + * Queue the write. + */ + kcopyd_io(job); +} + +int kcopyd_write_pages(struct kcopyd_region *to, int nr_pages, + struct page **pages, int offset, kcopyd_notify_fn fn, + void *context) +{ + struct copy_info *info; + struct kcopyd_job *job; + int i; + + /* + * Allocate a new copy_info. + */ + info = alloc_copy_info(); + if (!info) + return -ENOMEM; + + job = kcopyd_alloc_job(); + if (!job) { + free_copy_info(info); + return -ENOMEM; + } + + /* + * set up for the write. + */ + info->notify = fn; + info->notify_context = context; + memcpy(&info->to, to, sizeof(*to)); + + /* Get the pages */ + job->nr_pages = nr_pages; + for (i = 0; i < nr_pages; i++) { + get_page(pages[i]); + job->pages[i] = pages[i]; + } + + job->rw = WRITE; + + memcpy(&job->disk, &info->to, sizeof(job->disk)); + job->offset = offset; + calc_block_sizes(job); + job->callback = page_write_complete; + job->context = info; + + /* + * Trigger job. + */ + kcopyd_io(job); + return 0; +} + +int kcopyd_copy(struct kcopyd_region *from, struct kcopyd_region *to, + kcopyd_notify_fn fn, void *context) +{ + struct copy_info *info; + struct kcopyd_job *job; + + /* + * Allocate a new copy_info. + */ + info = alloc_copy_info(); + if (!info) + return -ENOMEM; + + job = kcopyd_alloc_job(); + if (!job) { + free_copy_info(info); + return -ENOMEM; + } + + /* + * set up for the read. + */ + info->notify = fn; + info->notify_context = context; + memcpy(&info->to, to, sizeof(*to)); + + job->rw = READ; + memcpy(&job->disk, from, sizeof(*from)); + + job->offset = 0; + calc_block_sizes(job); + job->callback = copy_write; + job->context = info; + + /* + * Trigger job. + */ + kcopyd_io(job); + return 0; +} + +/*----------------------------------------------------------------- + * Unit setup + *---------------------------------------------------------------*/ +static struct { + int (*init) (void); + void (*exit) (void); + +} _inits[] = { +#define xx(n) { init_ ## n, exit_ ## n} + xx(pages), + xx(buffers), + xx(jobs), + xx(copier) +#undef xx +}; + +static int _client_count = 0; +static DECLARE_MUTEX(_client_count_sem); + +static int kcopyd_init(void) +{ + const int count = sizeof(_inits) / sizeof(*_inits); + + int r, i; + + for (i = 0; i < count; i++) { + r = _inits[i].init(); + if (r) + goto bad; + } + + start_daemon(); + return 0; + + bad: + while (i--) + _inits[i].exit(); + + return r; +} + +static void kcopyd_exit(void) +{ + int i = sizeof(_inits) / sizeof(*_inits); + + if (stop_daemon()) + DMWARN("Couldn't stop kcopyd."); + + while (i--) + _inits[i].exit(); +} + +void kcopyd_inc_client_count(void) +{ + /* + * What I need here is an atomic_test_and_inc that returns + * the previous value of the atomic... In its absence I lock + * an int with a semaphore. :-( + */ + down(&_client_count_sem); + if (_client_count == 0) + kcopyd_init(); + _client_count++; + + up(&_client_count_sem); +} + +void kcopyd_dec_client_count(void) +{ + down(&_client_count_sem); + if (--_client_count == 0) + kcopyd_exit(); + + up(&_client_count_sem); +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/kcopyd.h linux.20pre5-ac2/drivers/md/kcopyd.h --- linux.20pre5/drivers/md/kcopyd.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/kcopyd.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2001 Sistina Software + * + * This file is released under the GPL. + */ + +#ifndef DM_KCOPYD_H +#define DM_KCOPYD_H + +/* + * Needed for the definition of offset_t. + */ +#include +#include + +struct kcopyd_region { + kdev_t dev; + offset_t sector; + offset_t count; +}; + +#define MAX_KCOPYD_PAGES 128 + +struct kcopyd_job { + struct list_head list; + + /* + * Error state of the job. + */ + int err; + + /* + * Either READ or WRITE + */ + int rw; + + /* + * The source or destination for the transfer. + */ + struct kcopyd_region disk; + + int nr_pages; + struct page *pages[MAX_KCOPYD_PAGES]; + + /* + * Shifts and masks that will be useful when dispatching + * each buffer_head. + */ + offset_t offset; + offset_t block_size; + offset_t block_shift; + offset_t bpp_shift; /* blocks per page */ + offset_t bpp_mask; + + /* + * nr_blocks is how many buffer heads will have to be + * displatched to service this job, nr_requested is how + * many have been dispatched and nr_complete is how many + * have come back. + */ + unsigned int nr_blocks; + atomic_t nr_requested; + atomic_t nr_incomplete; + + /* + * Set this to ensure you are notified when the job has + * completed. 'context' is for callback to use. + */ + void (*callback)(struct kcopyd_job *job); + void *context; +}; + +/* + * Low level async io routines. + */ +struct kcopyd_job *kcopyd_alloc_job(void); +void kcopyd_free_job(struct kcopyd_job *job); + +int kcopyd_queue_job(struct kcopyd_job *job); + +/* + * Submit a copy job to kcopyd. This is built on top of the + * previous three fns. + */ +typedef void (*kcopyd_notify_fn)(int err, void *context); + +int kcopyd_copy(struct kcopyd_region *from, struct kcopyd_region *to, + kcopyd_notify_fn fn, void *context); + +int kcopyd_write_pages(struct kcopyd_region *to, int nr_pages, + struct page **pages, int offset, kcopyd_notify_fn fn, + void *context); + +/* + * We only want kcopyd to reserve resources if someone is + * actually using it. + */ +void kcopyd_inc_client_count(void); +void kcopyd_dec_client_count(void); + +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/Makefile linux.20pre5-ac2/drivers/md/Makefile --- linux.20pre5/drivers/md/Makefile 2002-08-29 18:39:46.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/Makefile 2002-08-12 22:44:36.000000000 +0100 @@ -4,9 +4,11 @@ O_TARGET := mddev.o -export-objs := md.o xor.o +export-objs := md.o xor.o dm-table.o dm-target.o kcopyd.o list-multi := lvm-mod.o lvm-mod-objs := lvm.o lvm-snap.o lvm-fs.o +dm-mod-objs := dm.o dm-table.o dm-target.o dm-linear.o dm-stripe.o \ + dm-ioctl.o dm-snapshot.o dm-exception-store.o kcopyd.o # Note: link order is important. All raid personalities # and xor.o must come before md.o, as they each initialise @@ -20,8 +22,12 @@ obj-$(CONFIG_MD_MULTIPATH) += multipath.o obj-$(CONFIG_BLK_DEV_MD) += md.o obj-$(CONFIG_BLK_DEV_LVM) += lvm-mod.o +obj-$(CONFIG_BLK_DEV_DM) += dm-mod.o include $(TOPDIR)/Rules.make lvm-mod.o: $(lvm-mod-objs) $(LD) -r -o $@ $(lvm-mod-objs) + +dm-mod.o: $(dm-mod-objs) + $(LD) -r -o $@ $(dm-mod-objs) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/md/md.c linux.20pre5-ac2/drivers/md/md.c --- linux.20pre5/drivers/md/md.c 2002-08-29 18:39:54.000000000 +0100 +++ linux.20pre5-ac2/drivers/md/md.c 2002-08-29 18:49:34.000000000 +0100 @@ -2936,8 +2936,6 @@ * bdflush, otherwise bdflush will deadlock if there are too * many dirty RAID5 blocks. */ - current->policy = SCHED_OTHER; - current->nice = -20; md_unlock_kernel(); complete(thread->event); @@ -3391,11 +3389,6 @@ "(but not more than %d KB/sec) for reconstruction.\n", sysctl_speed_limit_max); - /* - * Resync has low priority. - */ - current->nice = 19; - is_mddev_idle(mddev); /* this also initializes IO event counters */ for (m = 0; m < SYNC_MARKS; m++) { mark[m] = jiffies; @@ -3473,16 +3466,13 @@ currspeed = (j-mddev->resync_mark_cnt)/2/((jiffies-mddev->resync_mark)/HZ +1) +1; if (currspeed > sysctl_speed_limit_min) { - current->nice = 19; - if ((currspeed > sysctl_speed_limit_max) || !is_mddev_idle(mddev)) { current->state = TASK_INTERRUPTIBLE; md_schedule_timeout(HZ/4); goto repeat; } - } else - current->nice = -20; + } } printk(KERN_INFO "md: md%d: sync done.\n",mdidx(mddev)); err = 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/Config.in linux.20pre5-ac2/drivers/media/video/Config.in --- linux.20pre5/drivers/media/video/Config.in 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/Config.in 2002-08-06 15:42:12.000000000 +0100 @@ -11,6 +11,8 @@ if [ "$CONFIG_I2C_ALGOBIT" = "y" -o "$CONFIG_I2C_ALGOBIT" = "m" ]; then dep_tristate ' BT848 Video For Linux' CONFIG_VIDEO_BT848 $CONFIG_VIDEO_DEV $CONFIG_PCI $CONFIG_I2C_ALGOBIT fi +dep_tristate ' Luxsonor LS220 (EXPERIMENTAL)' CONFIG_VIDEO_LS220 $CONFIG_VIDEO_DEV +dep_tristate ' Margi DVD-to-Go (EXPERIMENTAL)' CONFIG_VIDEO_MARGI $CONFIG_PCMCIA $CONFIG_VIDEO_DEV dep_tristate ' Mediavision Pro Movie Studio Video For Linux' CONFIG_VIDEO_PMS $CONFIG_VIDEO_DEV if [ "$CONFIG_ALL_PPC" = "y" ]; then dep_tristate ' PlanB Video-In on PowerMac' CONFIG_VIDEO_PLANB $CONFIG_VIDEO_DEV diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/ac3_240.h linux.20pre5-ac2/drivers/media/video/ls220/ac3_240.h --- linux.20pre5/drivers/media/video/ls220/ac3_240.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/ac3_240.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,2835 @@ +static u32 AC3240Ucode1f1800[] = { + 0xb500000f, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xb500118f, 0x00000000, 0x00000000, 0x00000000, + 0x820f001f, 0x802f001f, 0x80070800, 0x001f6193, + 0x800500d4, 0x8053ffff, 0x9842c7ff, 0x8039ff7c, + 0x1400b802, 0x003f6000, 0x94210007, 0xb0010001, + 0xb4200001, 0x98002800, 0xb0010000, 0xb4200001, + 0x98000800, 0x805300ff, 0x1800b802, 0x800600d4, + 0x8013001f, 0x9020c000, 0x003fb006, 0x803effe0, + 0x803effe8, 0x803effec, 0x9020e000, 0x9021ffe4, + 0x9020fa00, 0x803effd0, 0x803effdc, 0x803effd8, + 0x9020fe00, 0x803effd4, 0x90400000, 0x804600a2, + 0x90421800, 0x804600a3, 0x80134099, 0x98000040, + 0x800600a6, 0x80130000, 0x98003ca1, 0x800600a1, + 0x80050080, 0x98000002, 0x80060080, 0x80070001, + 0x001f2013, 0x001f2324, 0x80070000, 0x001fb0ba, + 0x001f23f9, 0x801eb3f0, 0x80070800, 0x001f600f, + 0x80070000, 0x001f2012, 0x001fb0cb, 0x001fb010, + 0x801efff0, 0x98004000, 0x98008000, 0x001f600e, + 0x83e40123, 0x80070000, 0x801eb3f8, 0x801eff70, + 0x800500a0, 0xb0000001, 0xb4000009, 0x80070001, + 0x800600a0, 0x80050080, 0x98000020, 0x80060080, + 0x9400ffdf, 0x80060080, 0x80070000, 0x800600a0, + 0x81df0004, 0x00000000, 0x00000000, 0x801bfff0, + 0x00000000, 0x940000ff, 0xb0000000, 0xb420004e, + 0x003f400e, 0x94010010, 0xb0000000, 0xb400fff4, + 0x838413a4, 0x003f0013, 0xb0010001, 0xb420003b, + 0x803bffe8, 0x801bffec, 0x00000000, 0x3001b800, + 0xb4600001, 0x90212000, 0x0421b800, 0x005f4193, + 0x5841b802, 0x3001b802, 0xb460000d, 0x80050086, + 0x005f9016, 0xb0020000, 0xb4200002, 0x001fb016, + 0xb500ffdf, 0x0420b802, 0xb0010b50, 0xb4a0ffdc, + 0x80070000, 0x001fb016, 0x83e400ed, 0xb500ffd8, + 0x80070000, 0x001fb016, 0x001f400e, 0x9400000f, + 0xb0000000, 0xb4000014, 0xb0000001, 0xb4000010, + 0x003f400e, 0x9421fff0, 0x003f600e, 0x003f9006, + 0x9421ffff, 0x90210004, 0xb001e000, 0xb4800002, + 0x8421e000, 0x9021c000, 0x8013001f, 0x1021b800, + 0x003fb006, 0x003f90cb, 0x90210004, 0x003fb0cb, + 0x83e400df, 0x83e41383, 0x8007001f, 0x94000003, + 0x5810b800, 0x83e71aa8, 0x1bffb800, 0x003f9008, + 0x1821b800, 0x00ffb801, 0x83e413d6, 0x80270000, + 0x003f2013, 0x8007001f, 0x94000003, 0x5810b800, + 0x83671ad4, 0x1b7bb800, 0x003f9009, 0x1821b800, + 0x00ffb801, 0xb500ffaa, 0x803bffc0, 0x805bffc4, + 0x807bffc8, 0x809bffcc, 0x5828b801, 0x5cb8b802, + 0x1821b805, 0x5848b802, 0x5cb8b803, 0x1842b805, + 0x5868b803, 0x5cb8b804, 0x1863b805, 0x5888b804, + 0x1884b800, 0x803effc0, 0x805effc4, 0x807effc8, + 0x809effcc, 0x003f400e, 0xb0000086, 0xb4400040, + 0xb0000084, 0xb400002a, 0xb0000085, 0xb4000030, + 0xb0000086, 0xb4000032, 0x001f4000, 0x94000080, + 0xb0000080, 0xb400006a, 0x80130000, 0x98003ca1, + 0x005f4000, 0x94420008, 0xb0020008, 0xb4000001, + 0xa0000080, 0x800600a1, 0x8013001f, 0x9040c000, + 0x005fb006, 0x805effe0, 0x805effe8, 0x805effec, + 0x9040e000, 0x805effe4, 0x9040fa00, 0x805effd0, + 0x805effdc, 0x805effd8, 0x9040fe00, 0x805effd4, + 0x80070001, 0x001f2013, 0x80070000, 0x001fb0cb, + 0x001fb010, 0x001f2058, 0x80071f40, 0x001fb008, + 0x80075d70, 0x001fb009, 0x98214000, 0xb5000010, + 0x94011000, 0xb0001000, 0xb4200001, 0x9421efff, + 0x98210010, 0xb500000a, 0x80070000, 0x001fb0cb, + 0x83e4007f, 0x003f400e, 0x9421ffef, 0xb5000004, + 0x83e4007b, 0x003f400e, 0x98211000, 0x9421ffef, + 0x003f600e, 0x80070100, 0x801efff0, 0xb500ff54, + 0xb000008b, 0xb400001c, 0xb000008e, 0xb4000022, + 0xb000008d, 0xb400001c, 0xb000008c, 0xb4000021, + 0xb0000087, 0xb400ffe8, 0xb0000088, 0xb4000014, + 0xb000008a, 0xb4000015, 0xb0000089, 0xb400001d, + 0xb00000a0, 0xb400001f, 0xb00000a1, 0xb4000041, + 0xb00000a2, 0xb400004a, 0xb00000a3, 0xb4000046, + 0xb00000a4, 0xb4000048, 0xb00000a5, 0xb4000048, + 0xb00000a6, 0xb4000048, 0x803efff8, 0xb500ffdd, + 0x9421ffdf, 0xb500ffda, 0xb500ffda, 0x80270100, + 0x803efff8, 0xb500ffd7, 0x80070000, 0x001fb017, + 0xb500ffd4, 0x801bffb0, 0x00000000, 0x001fb003, + 0xb500ffd0, 0x803bff80, 0x00000000, 0x003f6001, + 0xb500ffcc, 0x003f90ba, 0x803efff8, 0xb500ffc9, + 0x80130001, 0x98003da1, 0x800600a1, 0x80070200, + 0x801ebf34, 0x83e4002e, 0x8013001f, 0x9840c000, + 0x805effe0, 0x005fb006, 0x805effe8, 0x805effec, + 0x90422000, 0x805effe4, 0x9040fa00, 0x805effd0, + 0x805effdc, 0x805effd8, 0x9040fe00, 0x805effd4, + 0x80070001, 0x001f2013, 0x80070000, 0x001f2324, + 0x001fb0cb, 0x001fb010, 0x001f2058, 0x80077490, + 0x001fb008, 0x80077710, 0x001fb009, 0x98214000, + 0xb500ffa7, 0x80270000, 0x8047fef0, 0x003eb802, + 0x90420004, 0x003eb802, 0x90420004, 0x003eb802, + 0x90420004, 0x003eb802, 0x83641460, 0xb500ff9d, + 0x8364140e, 0xb500ff9b, 0x836413cd, 0xb500ff99, + 0x83441334, 0xb500ff97, 0x8344131d, 0xb500ff95, + 0x80070000, 0x80470000, 0xb6002003, 0xb6003002, + 0x001eb802, 0x90420004, 0x80171000, 0x8057ffff, + 0xb6002002, 0xb6001801, 0x001fa020, 0x00ffb81f, + 0x001f4000, 0x94000080, 0xb0000080, 0xb4200001, + 0xb500ffef, 0xb500000a, 0x80270000, 0x003f2013, + 0x8007001f, 0x94000003, 0x5810b800, 0x83671e40, + 0x1b7bb800, 0x003f9009, 0x1821b800, 0x00ffb801, + 0x003f0013, 0xb0010001, 0xb420fff3, 0x83a70000, + 0x803bff70, 0x00000000, 0xb0010000, 0xb4000011, + 0x80170300, 0x80070000, 0xb6000601, 0x001fa020, + 0x83640c6e, 0x00ff0325, 0x82870000, 0xb6270002, + 0x83640217, 0x92940001, 0x001f033b, 0xb0000000, + 0xb4000002, 0x80270000, 0xb5000001, 0x80270001, + 0x003f233b, 0x80270000, 0x003f2013, 0x8007001f, + 0x94000003, 0x5810b800, 0x83671ecc, 0x1b7bb800, + 0x003f9009, 0x1821b800, 0x00ffb801, 0x003f0013, + 0xb0010001, 0xb420fff3, 0x93bd0001, 0xb01d0004, + 0xb480ffdb, 0x803bff70, 0x00000000, 0xb0010000, + 0xb4000001, 0x83640c1a, 0x00000000, 0x00000000, + 0x00ffb81f, 0x007f90cb, 0x90630400, 0x007fb0cb, + 0x003f9006, 0x9421ffff, 0x90210400, 0xb001e000, + 0xb4800002, 0x8421e000, 0x9021c000, 0x8013001f, + 0x1021b800, 0x003fb006, 0x803effec, 0x00ffb81f, + 0x015f400e, 0x944a4000, 0xb0024000, 0xb4200084, + 0x954abfff, 0x015f600e, 0x820f001f, 0x802f001f, + 0x81470000, 0x015f23f9, 0x829702ec, 0x82d7ffff, + 0x82f70000, 0xb6000501, 0x029fa02a, 0x82970400, + 0xb6000702, 0xb6000001, 0x029fa02a, 0x8053ff00, + 0x98420000, 0x805ebf14, 0x805ebf18, 0x805ebf1c, + 0x805ebf20, 0x805ebf24, 0x805ebf28, 0x80270000, + 0x003f2328, 0x80275480, 0x005fb801, 0x8033001f, + 0x9821c000, 0x803effe0, 0x90212000, 0x803effe4, + 0x80dbff8c, 0x80fbff90, 0x80debf14, 0x80febf18, + 0x80dbff94, 0x80fbff98, 0x80debf1c, 0x80febf20, + 0x80dbff9c, 0x80fbffa0, 0x80debf24, 0x80febf28, + 0x80dbff84, 0x80e70001, 0x00dfb001, 0x80dbff88, + 0x00ff6191, 0x00dfb002, 0x80dbffb0, 0x80470000, + 0x00dfb003, 0x80d9ff80, 0x005fb0cf, 0x005fb0c6, + 0x00df6001, 0x80470001, 0x005f618f, 0x804700ff, + 0x005f231c, 0x005f231d, 0x80470000, 0x005f204e, + 0x8047e138, 0x5c42b802, 0x814f6300, 0x80cf00a9, + 0x005fb0bc, 0x5842b802, 0x01cfb802, 0x005f90bc, + 0xb520ffff, 0x8067e16c, 0x5c62b803, 0x80270040, + 0xb6000209, 0x814fffc0, 0x00cfb801, 0x007fb0bc, + 0x5862b803, 0x01cfb803, 0x007f90bc, 0xb520ffff, + 0x90210020, 0x90630020, 0x8047e398, 0x5c42b802, + 0x814fce40, 0x80cf0080, 0x005fb0bc, 0x5842b802, + 0x01cfb802, 0x005f90bc, 0xb520ffff, 0x8047e400, + 0x5c42b802, 0x814f7380, 0x80cf009a, 0x005fb0bc, + 0x5842b802, 0x01cfb802, 0x005f90bc, 0xb520ffff, + 0x8047e43c, 0x5c42b802, 0x814f18c0, 0x80cf00b6, + 0x005fb0bc, 0x5842b802, 0x01cfb802, 0x005f90bc, + 0xb520ffff, 0x80e70000, 0x00ffb0ba, 0x808f0000, + 0x806f001f, 0x80af001f, 0x8027b9fc, 0x5c22b801, + 0x80670700, 0xb600080a, 0x00cfb803, 0x003fb0bc, + 0x5822b801, 0x01cfb801, 0x003f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90210020, 0x90630020, + 0x834400d3, 0xb0180000, 0xb4200025, 0x83440680, + 0x80c70000, 0x00df2324, 0x83640026, 0x83440228, + 0x00df0324, 0x90c60001, 0x00df2324, 0xb0060006, + 0xb4000003, 0x81472178, 0x015fb008, 0x00ffb81f, + 0x00ff90ba, 0x90e70001, 0x00ffb0ba, 0x019f9006, + 0x958cffff, 0x00df4193, 0x58c1b806, 0x118cb806, + 0xb00ce000, 0xb4800002, 0x858ce000, 0x918cc000, + 0x8153001f, 0x118cb80a, 0x819effec, 0x019fb006, + 0x015f4193, 0x5941b80a, 0x019f90cb, 0x118cb80a, + 0x019fb0cb, 0x81472160, 0x015fb008, 0x00ffb81f, + 0x015f400e, 0x194ab818, 0x015f600e, 0x802500a5, + 0x00ffb81f, 0x803bff8c, 0x805bff90, 0x803ebf14, + 0x805ebf18, 0x803bff94, 0x805bff98, 0x803ebf1c, + 0x805ebf20, 0x803bff9c, 0x805bffa0, 0x803ebf24, + 0x805ebf28, 0x80470003, 0x805ebefc, 0x003f0384, + 0x5822b801, 0x9021eb50, 0x005bb801, 0x00000000, + 0xb0020001, 0xb4200002, 0x80470001, 0x805ebefc, + 0x8073ff80, 0x98630000, 0x8027bf14, 0x8047befc, + 0xb6000609, 0x009bb801, 0x00000000, 0x00a7b804, + 0x6081b804, 0x3004b803, 0xb4000001, 0x00beb802, + 0x90210004, 0x90420004, 0x00ffb81b, 0x00000000, + 0x81150010, 0x00000000, 0x00000000, 0x81350010, + 0x00000000, 0x00000000, 0x81550002, 0x00000000, + 0x015f2380, 0x81550006, 0x00000000, 0x015f2381, + 0x81550005, 0x00000000, 0x015f2382, 0x81550003, + 0x00000000, 0x015f2383, 0x81550003, 0x015f2384, + 0xb00a0001, 0xb4000005, 0x956a0001, 0xb00b0000, + 0xb4000002, 0x81750002, 0x017f2385, 0x956a0004, + 0xb00b0000, 0xb4000002, 0x81750002, 0x017f2386, + 0xb00a0002, 0xb4200003, 0x81750002, 0x00000000, + 0x017f2387, 0x81750001, 0x00000000, 0x017f2388, + 0x81750005, 0x00000000, 0x017f2389, 0x81750001, + 0x017f239f, 0xb00b0001, 0xb4200003, 0x81750008, + 0x5968b80b, 0x017f61c5, 0x81750001, 0x017f238c, + 0xb00b0001, 0xb4200003, 0x81750008, 0x00000000, + 0x017f238d, 0x81750001, 0x017f238e, 0xb00b0001, + 0xb4200005, 0x81750005, 0x00000000, 0x017f238f, + 0x81750002, 0x017f2390, 0xb00a0000, 0xb420001b, + 0x81750005, 0x00000000, 0x017f2391, 0x81750001, + 0x017f23a0, 0xb00b0001, 0xb4200003, 0x81750008, + 0x5968b80b, 0x017f61c9, 0x81750001, 0x017f2394, + 0xb00b0001, 0xb4200003, 0x81750008, 0x00000000, + 0x017f2395, 0x81750001, 0x017f2396, 0xb00b0001, + 0xb4200006, 0x81750005, 0x00000000, 0x017f2397, + 0x81750002, 0x00000000, 0x017f2398, 0x81750001, + 0x00000000, 0x017f2399, 0x81750001, 0x00000000, + 0x017f239a, 0x81750001, 0x017f239b, 0xb00b0001, + 0xb4200003, 0x8175000e, 0x00000000, 0x017f61be, + 0x81750001, 0x017f239c, 0xb00b0001, 0xb4200003, + 0x8175000e, 0x00000000, 0x017f237e, 0x81750001, + 0x017f239d, 0xb00b0001, 0xb4200006, 0x81750006, + 0x017f239e, 0x916b0001, 0x81550008, 0x856b0001, + 0xb4e0fffd, 0x00ffb81c, 0x00000000, 0x00000000, + 0x81470000, 0x015f2385, 0x015f2386, 0x015f2387, + 0x015f238d, 0x015f238f, 0x015f2390, 0x015f2391, + 0x015f2395, 0x015f2396, 0x015f2397, 0x015f2398, + 0x015f61be, 0x015f61bf, 0x82070028, 0x023f9006, + 0x83a4003a, 0x83270000, 0x003fb819, 0x003f9006, + 0x5823b801, 0x83338000, 0x1b39b801, 0x003fb819, + 0x00000000, 0x00000000, 0x81550000, 0x8384ff64, + 0x017f0380, 0xad4b0026, 0x013f0381, 0x114ab809, + 0x5941b80a, 0x914ae00c, 0x0199b80a, 0x00000000, + 0x019f6193, 0xb0080b77, 0xb4200016, 0x015f0380, + 0xb00a0003, 0xb4600017, 0xb0090026, 0xb4600019, + 0x017f90ba, 0xb00b0000, 0xb4200004, 0x017f0384, + 0x017f204d, 0x017f0383, 0x017f2057, 0x015f0383, + 0x017f0057, 0x300ab80b, 0xb4200012, 0x015f0384, + 0x017f004d, 0x300ab80b, 0xb420000e, 0x83070000, + 0x00ffb81a, 0x83070800, 0x031f6193, 0x83070001, + 0x00ffb81a, 0x83070800, 0x031f6193, 0x83070002, + 0x00ffb81a, 0x83070800, 0x031f6193, 0x83070003, + 0x00ffb81a, 0x83070003, 0x00ffb81a, 0x5e02b810, + 0x5a02b810, 0x00bf9011, 0x00df004f, 0xa5260020, + 0x81e70000, 0x82471000, 0x95d1ffff, 0xa5cee000, + 0x300eb810, 0xb4600002, 0x05f0b80e, 0x0207b80e, + 0x8267001f, 0x82c70020, 0x82971000, 0xb0100080, + 0xb480001f, 0x5a8bb813, 0x5aa6b813, 0x1a94b815, + 0x01efb812, 0x014fb814, 0x01cfb811, 0xb520ffff, + 0xb636000f, 0x81470000, 0x039f8014, 0xb6000404, + 0x5948b80a, 0x957c00ff, 0x194ab80b, 0x5f88b81c, + 0xb0060020, 0xb4200001, 0x80a70000, 0x64a6b805, + 0x68e9b80a, 0x18a5b807, 0x029fa025, 0x00a7b80a, + 0x01efb812, 0x014fb814, 0x01afb811, 0xb520ffff, + 0x5ae2b816, 0x1231b817, 0x0610b817, 0xb500ffde, + 0xb0100000, 0xb4000003, 0x5ec2b810, 0x86760001, + 0xb500ffdc, 0xb00f0000, 0xb4000005, 0x0207b80f, + 0x81f3001f, 0x9a2fc000, 0x81e70000, 0xb500ffd0, + 0x015fb011, 0x00ffb81d, 0x00000000, 0x00000000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x81d7ffff, + 0x8257ffff, 0x82d7ffff, 0x8357ffff, 0x83d7ffff, + 0x80770000, 0x80f70000, 0x81770000, 0x81f70000, + 0x82770000, 0x82f70000, 0x83770000, 0x83f70000, + 0xaeb40080, 0x808f0000, 0x806f001f, 0x80af001f, + 0xb0140000, 0xb4400014, 0x806f001f, 0x80af001f, + 0x8027b9fc, 0x5c22b801, 0x80670700, 0xb6000208, + 0x00cfb803, 0x003fb0bc, 0x5822b801, 0x01cfb801, + 0x003f90bc, 0xb520ffff, 0x90630020, 0x90210020, + 0x80270000, 0x80171000, 0xb6000303, 0xb6000001, + 0x001fa021, 0x00000000, 0x82670000, 0xb6000268, + 0x80170a00, 0x80970afc, 0x81170b00, 0x81970bfc, + 0x80271c00, 0x1021b813, 0x1021b813, 0x0217b801, + 0x80271ffc, 0x0421b813, 0x0421b813, 0x0297b801, + 0x80270c00, 0x1021b813, 0x1021b813, 0x0317b801, + 0x80270ffc, 0x0421b813, 0x0421b813, 0x0397b801, + 0x80478500, 0x1042b813, 0x5c42b802, 0x1022b815, + 0x80670280, 0x00cfb803, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0xb520ffff, 0x009f033b, + 0x80478480, 0x0442b813, 0x5c42b802, 0x1022b815, + 0x806702a0, 0x00cfb803, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0xb520ffff, 0xb0040000, + 0xb4000002, 0x80479000, 0xb5000001, 0x80479c00, + 0x1042b813, 0x5c42b802, 0x1022b815, 0x806702c0, + 0x00cfb803, 0x003fb0bc, 0x5822b801, 0x01cfb801, + 0x003f90bc, 0xb520ffff, 0xb0040000, 0xb4000002, + 0x80479180, 0xb5000001, 0x80479d80, 0x0442b813, + 0x5c42b802, 0x1022b815, 0x806702e0, 0x00cfb803, + 0x003fb0bc, 0x5822b801, 0x01cfb801, 0x003f90bc, + 0xb520ffff, 0x81270000, 0x80370000, 0x80b70000, + 0x81370000, 0x81b70000, 0x82370004, 0x82b7fffc, + 0xb6002016, 0x41498008, 0x51498814, 0x51498814, + 0x51418810, 0x51418810, 0x41818814, 0x0308a02a, + 0x49958820, 0x51898810, 0x51918828, 0x414d8814, + 0x0388a7ec, 0x494d8814, 0x49458810, 0x49458810, + 0x418d8810, 0x0308a02a, 0x49918fec, 0x51858814, + 0x51958fe4, 0x00000000, 0x0388a7ec, 0x92730080, + 0x009f033b, 0x5802b814, 0x90400300, 0x001f9802, + 0x00000000, 0xb0000000, 0xb4200016, 0x80170a00, + 0x80070000, 0xb6002001, 0x001fa020, 0xb0040000, + 0xb4200002, 0x80279000, 0xb5000001, 0x80279c00, + 0xac740080, 0x5c22b801, 0x11e1b803, 0x806f001f, + 0x80af001f, 0xb6000407, 0x80cf0280, 0x01ffb0bc, + 0x59e2b80f, 0x01afb80f, 0x01ff90bc, 0xb520ffff, + 0x91ef0020, 0x007f0320, 0x011f90cd, 0xaca30006, + 0x80c7b004, 0x10a5b814, 0x58a1b805, 0x10a5b806, + 0x0099b805, 0x8027b3dc, 0x5841b804, 0x1021b802, + 0x0159b801, 0x8027b3d0, 0x5841b804, 0x1021b802, + 0x0139b801, 0x80170c00, 0x0097b80a, 0xb0090000, + 0xb4200004, 0xb6000002, 0x015f8020, 0x009fe0ca, + 0xb5000004, 0x015fc024, 0xb6000002, 0x015f8020, + 0x009fe0ca, 0x00ffb81b, 0x00000000, 0x00000000, + 0x009f0011, 0x015f0012, 0xb0060000, 0xb4200007, + 0x968a0001, 0xb0140000, 0xb400000d, 0x80870001, + 0x009f2011, 0x954a0002, 0x015f2012, 0xb0060002, + 0xb4200007, 0x968a0002, 0xb0140000, 0xb4000004, + 0x80870001, 0x009f2011, 0x81470000, 0x015f2012, + 0x8364002b, 0x00bf2010, 0xb0060000, 0xb4200003, + 0xb0050000, 0xb4200001, 0x8364008d, 0xb0050000, + 0xb4200001, 0x836400b2, 0x00bf0010, 0xb0050000, + 0xb4200006, 0x83640983, 0x8364029d, 0x00000000, + 0x8364092b, 0x00000000, 0xb5000005, 0x00bf0010, + 0xb0050001, 0xb4000002, 0x00000000, 0x83640924, + 0x00ff0325, 0x82870000, 0xb6270002, 0x8364ff00, + 0x92940001, 0x80070001, 0x801eff70, 0x001f0010, + 0xb0000001, 0xb4000007, 0x001f033b, 0xb0000000, + 0xb4000002, 0x80270000, 0xb5000001, 0x80270001, + 0x003f233b, 0x00ffb81a, 0x00000000, 0x00000000, + 0x027f4001, 0x5e2ab813, 0x96310003, 0x81c70000, + 0x820700ff, 0xb0110000, 0xb4000005, 0x5a21b811, + 0x81c70200, 0x8207000e, 0x69d1b80e, 0x1210b811, + 0x01dfb0cd, 0x5e2cb813, 0x96310003, 0x023f2323, + 0x5e28b813, 0x96310003, 0x023f2322, 0x5e27b813, + 0x96310001, 0x023f2328, 0x5e23b813, 0x96310001, + 0x023f2321, 0x95f30007, 0x01ff2320, 0x920fe004, + 0x0258b810, 0x00000000, 0x1252b811, 0x025f2325, + 0x8167befc, 0x017f6195, 0x021f031c, 0x01df031d, + 0x3010b80f, 0xb4200003, 0x3011b80e, 0xb4200001, + 0xb5000021, 0x80270000, 0x80471000, 0x0017b802, + 0x8057ffff, 0xb6002001, 0x001fa021, 0x80270400, + 0x80679000, 0x5c62b803, 0xb6001809, 0x00cfb801, + 0x007fb0bc, 0x5862b803, 0x01afb803, 0x007f90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x90630020, + 0x80679c00, 0x5c62b803, 0xb6001809, 0x00cfb801, + 0x007fb0bc, 0x5862b803, 0x01afb803, 0x007f90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x90630020, + 0x01ff231c, 0x023f231d, 0x83970300, 0x82070000, + 0xb6320001, 0x039fa030, 0x00bf0010, 0x021f0324, + 0xb0100000, 0xb4200001, 0x80a70000, 0xb0050000, + 0xb4200008, 0xb0040000, 0xb4a00002, 0x80a70001, + 0xb5000004, 0x82070000, 0x021f204e, 0xb4000001, + 0x80a70002, 0xb0050001, 0xb4200007, 0x021f004e, + 0xb0100002, 0xb4a00002, 0x80a70002, 0x00ffb81b, + 0x92100001, 0x021f204e, 0x00000000, 0x00ffb81b, + 0x81530000, 0x003fb80a, 0x00000000, 0x00000000, + 0x003fb819, 0x00000000, 0x00000000, 0x81550000, + 0x8384fd73, 0x81470000, 0x015f61ee, 0x015f61ef, + 0x015f23a4, 0x8297050c, 0x82d7ffff, 0xb6000501, + 0x029fa02a, 0x8167e004, 0x116b0384, 0x0158b80b, + 0x019f0382, 0x015f237b, 0x017f0388, 0x116bb80a, + 0xb00c0008, 0xb4a00003, 0x80a70003, 0x00bf2010, + 0x00ffb81b, 0xb00a0005, 0xb4400003, 0xb00b0006, + 0xb4400001, 0x00ffb81b, 0x80a70004, 0x00bf2010, + 0x00ffb81b, 0x00000000, 0x00000000, 0x00000000, + 0x027f0388, 0x02bf037b, 0x02df0384, 0x02ff03a1, + 0x82970400, 0x8257ffff, 0x82d7ffff, 0xb6350003, + 0x81550001, 0x8357ffff, 0x029fa02a, 0x82970414, + 0xb6350003, 0x81550001, 0x83d7ffff, 0x029fa02a, + 0x81550001, 0xb00a0001, 0xb4200004, 0x814d0008, + 0x6149b80a, 0x954affff, 0x015f61ee, 0xb0160000, + 0xb4200007, 0x81550001, 0xb00a0001, 0xb4200004, + 0x814d0008, 0x6149b80a, 0x954affff, 0x015f61ef, + 0x81550001, 0xb00a0001, 0xb4200036, 0x82f50001, + 0x02ff23a1, 0xb0170001, 0xb420002c, 0x82970428, + 0xb6350003, 0x81550001, 0x00000000, 0x029fa02a, + 0x82970428, 0x81470000, 0x017f8034, 0xb00b0001, + 0xb4000004, 0x914a0001, 0x300ab815, 0xb480fffa, + 0xb5000001, 0x015f23a5, 0x81670000, 0xb0160002, + 0xb4200002, 0x81750001, 0x00000000, 0x017f233a, + 0x81550004, 0xadaa000c, 0x015f23a2, 0x81750004, + 0x916b0003, 0x017f23a3, 0x91ad0025, 0x01bf23a6, + 0xadab000c, 0x81e70000, 0x91ad0025, 0x01bf23a7, + 0x920a0001, 0x05abb810, 0xb00d0000, 0xb400000d, + 0xb62d0004, 0x81b50001, 0x65b0b80d, 0x19efb80d, + 0x92100001, 0x01ffb0be, 0xb5000006, 0x81a70000, + 0x82970428, 0xb6350001, 0x029fa02d, 0x01bf233a, + 0x01bf23a5, 0x82070000, 0x82270000, 0x82170428, + 0xb635003a, 0x01bf8030, 0xb00d0001, 0xb4200036, + 0x81d50001, 0x65b1b80e, 0x1a10b80d, 0xb00e0001, + 0xb4200031, 0x81b50002, 0xadad0003, 0xae510048, + 0x91cd000f, 0x91320868, 0x015f03a2, 0xad4a0004, + 0x92920700, 0x1189b80a, 0x0297b80c, 0x1194b80a, + 0x0317b80c, 0x01ff90be, 0x015f03a2, 0x017f03a3, + 0x064bb80a, 0x0107b80a, 0xb0120000, 0xb400001e, + 0xb632001d, 0x6928b80f, 0x95290001, 0xb0090000, + 0xb420000e, 0x81350004, 0x1129b80d, 0x029fa029, + 0x824d0004, 0x5a48b812, 0x5e48b812, 0x3009b80e, + 0xb4200002, 0x5e41b812, 0xb500000d, 0x5e42b812, + 0x81330040, 0x1a52b809, 0xb5000009, 0x0127b854, + 0x85290004, 0x0397b809, 0x0287b858, 0x86940004, + 0x013f803c, 0x0397b814, 0x029fa029, 0x025f803c, + 0x031fa032, 0x91080001, 0x92310001, 0x015f03a2, + 0x017f03a3, 0x013f033a, 0xb0090001, 0xb420001f, + 0x95300002, 0x95900001, 0x1929b80c, 0xb0090000, + 0xb400001a, 0x064bb80a, 0x0107b80a, 0xb6320017, + 0x6928b80f, 0x95290001, 0xb0090000, 0xb4200002, + 0x81350001, 0x013f23f8, 0x81a70700, 0x91ad0048, + 0x5982b808, 0x11adb80c, 0x0397b80d, 0x013f03f8, + 0xb0090001, 0xb4200005, 0x019f801c, 0x0196b80c, + 0x81b3ff80, 0x418cb80d, 0xb5000002, 0x019f801c, + 0x0196b80c, 0x039fa00c, 0x91080001, 0xb0160002, + 0xb420001a, 0xb0170001, 0xb4200008, 0xb00a0000, + 0xb4200002, 0x81270002, 0xb5000005, 0xb00a0002, + 0xb4400002, 0x81270003, 0xb5000001, 0x81270004, + 0x013f23a9, 0x81950001, 0xb00c0001, 0xb420000d, + 0x81a70000, 0x8397043c, 0xb6290006, 0x81150001, + 0x039fa028, 0xb0080001, 0xb4200001, 0x81a70001, + 0x00000000, 0x01bf23a8, 0xb5000002, 0x81a70000, + 0x01bf23a8, 0xb0170001, 0xb4200001, 0x81b50002, + 0x82970c20, 0xb6350003, 0x81550002, 0x00000000, + 0x029fa02a, 0xb0130001, 0xb4200001, 0x81150001, + 0x81c70000, 0xb6350014, 0x922e0c20, 0x015ff011, + 0xb00a0000, 0xb400000f, 0x922e0428, 0x015ff011, + 0xb00a0001, 0xb4200005, 0x922e044c, 0x0297b811, + 0x015f03a6, 0x029fa00a, 0xb5000006, 0x81550006, + 0xad4a0003, 0x922e044c, 0x0297b811, 0x914a0049, + 0x029fa00a, 0x91ce0004, 0xb0170001, 0xb420001e, + 0xb00d0000, 0xb400001c, 0x852d0001, 0x81470001, + 0x6549b80a, 0xad6a0003, 0x019f03a7, 0x058c03a6, + 0x81270000, 0xb00b0000, 0xb4000005, 0x300cb80b, + 0xb4800003, 0x058cb80b, 0x91290001, 0xb500fffb, + 0x81750004, 0x5961b80b, 0x839704ec, 0x0187b860, + 0x039fa02c, 0x039fa02a, 0x039fa029, 0x039fa02b, + 0xb0090000, 0xb4000004, 0xb6290003, 0x81550007, + 0x00000000, 0x00000000, 0x81c70000, 0xb635002e, + 0x922e0c20, 0x01fff011, 0xb00f0000, 0xb4000029, + 0x852f0001, 0x81470001, 0x6549b80a, 0xad6a0003, + 0x922e044c, 0x025fd811, 0x86520001, 0x0227b812, + 0x81270000, 0xb00b0000, 0xb4000005, 0x3012b80b, + 0xb4800003, 0x0652b80b, 0x91290001, 0xb500fffb, + 0x2e09b80b, 0x00000000, 0x3010b811, 0xb4600001, + 0x91290001, 0xae4e0004, 0x82150004, 0x9232049c, + 0x0297b811, 0x0187b860, 0x029fa02c, 0x029fa02a, + 0x029fa029, 0x029fa030, 0xb0090000, 0xb4000004, + 0xb6290003, 0x81550007, 0x00000000, 0x00000000, + 0x82270460, 0x1231b80e, 0x0217b811, 0x81550002, + 0x021fa00a, 0x91ce0004, 0xb0130001, 0xb420000c, + 0xb0080000, 0xb400000a, 0x81550004, 0x839704fc, + 0x0167b860, 0x039fa02b, 0x81670001, 0x039fa02b, + 0x8175000e, 0x81670002, 0x039fa02b, 0x039fa02a, + 0x81150001, 0xb0080001, 0xb420000a, 0x8135000b, + 0x5d2923aa, 0x95490180, 0x5d4723ab, 0x95490060, + 0x5d4523ac, 0x95490018, 0x5d4323ad, 0x95490007, + 0x015f23ae, 0x81350001, 0xb0090001, 0xb4200017, + 0x81350006, 0x013f23af, 0xb0170001, 0xb4200005, + 0x81550004, 0x00000000, 0x015f23b0, 0x81550003, + 0x015f23b1, 0x82970474, 0x83170488, 0xb6350004, + 0x81550007, 0x5e83a02a, 0x954a0007, 0x031fa02a, + 0xb0130001, 0xb4200005, 0x81750004, 0x00000000, + 0x017f23b2, 0x81750003, 0x017f23b3, 0xb0170001, + 0xb420000b, 0x81b50001, 0xb00d0001, 0xb4200008, + 0x81d50003, 0x59c8b80e, 0x91ce0300, 0x01df61da, + 0x81d50003, 0x59c8b80e, 0x91ce0300, 0x01df61db, + 0x81550001, 0xb00a0001, 0xb420004b, 0xb0170001, + 0xb4200001, 0x81550002, 0x82470000, 0x82270000, + 0xb6350004, 0x81750002, 0x6571b80b, 0x92310002, + 0x1a52b80b, 0xb0170001, 0xb4200017, 0xb00a0001, + 0xb4200011, 0x81150003, 0x91080001, 0x011f23a4, + 0x829709d0, 0x831709f0, 0x83970060, 0xb6280009, + 0x81750005, 0x00000000, 0x029fa02b, 0x81750004, + 0x00000000, 0x031fa02b, 0x81750003, 0x00000000, + 0x039fa02b, 0xb5000004, 0xb00a0002, 0xb4800002, + 0x81070000, 0x011f23a4, 0x82270000, 0x81270000, + 0xb6350025, 0x6a11b812, 0x92310002, 0x96100003, + 0xb0100001, 0xb4200018, 0xada90020, 0x81750003, + 0x920d0520, 0x0217b810, 0x920d05c0, 0x0297b810, + 0x920d0660, 0x0317b810, 0x5942b809, 0x920a050c, + 0x0397b810, 0x916b0001, 0x039fa02b, 0xb62b0009, + 0x81750005, 0x00000000, 0x021fa02b, 0x81750004, + 0x00000000, 0x029fa02b, 0x81750003, 0x00000000, + 0x031fa02b, 0xb5000007, 0xb0100002, 0xb4800005, + 0x59a2b809, 0x91ad050c, 0x0397b80d, 0x82070000, + 0x039fa010, 0x91290001, 0x81550001, 0xb00a0001, + 0xb4200007, 0x81550009, 0xb00a0000, 0xb4000004, + 0xb62a0003, 0x82150008, 0x00000000, 0x00000000, + 0xb00a0100, 0xb4a00007, 0x954aff00, 0xb6008003, + 0x82150010, 0x00000000, 0x00000000, 0x854a0100, + 0xb4e0fffa, 0x00ffb81b, 0x00000000, 0x00000000, + 0x81070000, 0x011f61dc, 0x011f61de, 0x011f61e0, + 0x011f03aa, 0x9108e0f4, 0x0138b808, 0x011f03ab, + 0x013f61ac, 0x9108e0f0, 0x0138b808, 0x011f03ac, + 0x013f61ad, 0x5901b808, 0x9108e0f8, 0x0139b808, + 0x011f03ad, 0x013f61ae, 0x5901b808, 0x9108e100, + 0x0139b808, 0x011f03ae, 0x013f61b0, 0x5901b808, + 0x9108e108, 0x0179b808, 0x013f03af, 0x017f61b1, + 0x02bf037b, 0x82970474, 0xb6350002, 0x015f8034, + 0x1929b80a, 0x011f03a1, 0xb0080001, 0xb4200002, + 0x015f03b0, 0x1929b80a, 0x019f0388, 0xb00c0001, + 0xb4200002, 0x015f03b2, 0x1929b80a, 0x013f61b3, + 0x015f03a8, 0xb00a0001, 0xb420003a, 0x81a70000, + 0x01bf237a, 0x83840056, 0x806f001f, 0x80af001f, + 0x80270300, 0x8067a800, 0x5c62b803, 0xb600080a, + 0x00cfb801, 0x007fb0bc, 0x5862b803, 0x01afb803, + 0x007f90bc, 0x0047b86f, 0xb0020001, 0xb4c0fffd, + 0x90210020, 0x90630020, 0x81a70001, 0x01bf237a, + 0x83840043, 0x838403c6, 0x81a70000, 0x01bf237a, + 0x82470400, 0x01bff012, 0x01bf23fa, 0x83840418, + 0x8384048f, 0x8384053e, 0x83840595, 0x806f001f, + 0x80af001f, 0x80270300, 0x8067ac00, 0x5c62b803, + 0xb600080a, 0x00cfb801, 0x007fb0bc, 0x5862b803, + 0x01cfb803, 0x007f90bc, 0x0047b86f, 0xb0020001, + 0xb4c0fffd, 0x90210020, 0x90630020, 0x81a70001, + 0x01bf237a, 0x82470404, 0x015ff012, 0x015f23fa, + 0x838403ff, 0x83840476, 0x83840525, 0x8384057c, + 0xb5000011, 0x81a70000, 0x01bf237a, 0xb635000e, + 0x8384001b, 0x01bf037a, 0xad4d0004, 0x00000000, + 0x914a0400, 0x01bff00a, 0x01bf23fa, 0x838403f0, + 0x83840467, 0x83840516, 0x8384056d, 0x01df037a, + 0x91ce0001, 0x01df237a, 0x019f0388, 0xb00c0001, + 0xb4200009, 0x02bf037b, 0x02bf237a, 0x838400e8, + 0x82470000, 0x025f23fa, 0x838403e1, 0x83840458, + 0x83840507, 0x8384055e, 0x00ffb81b, 0x00000000, + 0x80770000, 0x80f70000, 0x81770000, 0x81f70000, + 0x82770000, 0x82f70000, 0x83770000, 0x83f70000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x81d7ffff, + 0x8257ffff, 0x82d7ffff, 0x8357ffff, 0x83d7ffff, + 0x017f037a, 0x5a42b80b, 0x01bf03a8, 0xb00d0001, + 0xb4200004, 0x011f9118, 0x013f9119, 0x7929b808, + 0xb5000002, 0x91b20460, 0x013ff00d, 0x91b20340, + 0x0297b80d, 0x00000000, 0x029fa009, 0x01df0384, + 0xb00e0000, 0xb4200005, 0xb00b0001, 0xb4200003, + 0x009f90c6, 0x00bf0391, 0xb5000002, 0x009f90cf, + 0x00bf0389, 0x83a4013a, 0x81870000, 0x019f61b5, + 0x019f61b4, 0x5a02b80b, 0x9190044c, 0x01dfd80c, + 0x01df61b6, 0x91900488, 0x01dff00c, 0x59c1b80e, + 0x918ee118, 0x01d9b80c, 0x019f03af, 0x01df61af, + 0x858c000f, 0x5986b80c, 0x91d00474, 0x01bff00e, + 0x59c2b80d, 0x11cc61b2, 0x81870000, 0x019f61b8, + 0x91900414, 0x01dfd80c, 0x01df61b7, 0xadab0010, + 0x00000000, 0x908d049c, 0x83a40189, 0xadcb0020, + 0x5982b80b, 0x908e0520, 0x90ae05c0, 0x90ce0660, + 0x928c050c, 0x00ff9814, 0x83a40161, 0x83a401b0, + 0x017f037a, 0x59c2b80b, 0x918e0428, 0x01fff00c, + 0xb00f0001, 0xb4200081, 0x023f03a5, 0x3011b80b, + 0xb420000f, 0x01c7b860, 0x01dfb0fa, 0x01df41dc, + 0x01df61e8, 0x01df41de, 0x01df61ea, 0x01df41e0, + 0x01df61ec, 0x01df41dd, 0x01df61e9, 0x01df41df, + 0x01df61eb, 0x01df41e1, 0x01df61ed, 0xb5000024, + 0x01c7b860, 0x01dfb0f9, 0x01df41dc, 0x01df61e2, + 0x01df41de, 0x01df61e4, 0x01df41e0, 0x01df61e6, + 0x01df41dd, 0x01df61e3, 0x01df41df, 0x01df61e5, + 0x01df41e1, 0x01df61e7, 0x803f0000, 0x00000000, + 0x00000000, 0x01df90fa, 0x003fb80e, 0x00000000, + 0x00000000, 0x81d50000, 0x00000000, 0x00000000, + 0x01df41e8, 0x01df61dc, 0x01df41ea, 0x01df61de, + 0x01df41ec, 0x01df61e0, 0x01df41e9, 0x01df61dd, + 0x01df41eb, 0x01df61df, 0x01df41ed, 0x01df61e1, + 0x029f03a6, 0x029f236a, 0x029f03a7, 0x029f236c, + 0x027f03a2, 0x92b3e128, 0x0298b815, 0x019f03b0, + 0x029f2368, 0x5982b80c, 0x01df03af, 0x85ce000f, + 0x59c6b80e, 0x11cc61b2, 0x82a70001, 0x02bf61b8, + 0x82a70000, 0x02bf61b9, 0x029f41da, 0x029f61ba, + 0x029f41db, 0x029f61bb, 0x019f03b1, 0x5981b80c, + 0x918ce118, 0x0299b80c, 0xad8b0048, 0x029f61af, + 0x59a2b813, 0x118cb80d, 0x928c0868, 0x029fb0fb, + 0x928c0700, 0x029fb0fc, 0x019f41bc, 0x918c0003, + 0x019f61bc, 0x5a02b80b, 0x91900414, 0x029fd80c, + 0x029f236e, 0x808704ec, 0x83a40119, 0x808709d0, + 0x80a709f0, 0x80c70060, 0x00ff03a4, 0x83a400f4, + 0x83a40143, 0x021f037a, 0x019f03a5, 0x300cb810, + 0xb4000016, 0x803f0000, 0x00000000, 0x00000000, + 0x01df90f9, 0x003fb80e, 0x00000000, 0x00000000, + 0x81d50000, 0x00000000, 0x00000000, 0x01df41e2, + 0x01df61dc, 0x01df41e4, 0x01df61de, 0x01df41e6, + 0x01df61e0, 0x01df41e3, 0x01df61dd, 0x01df41e5, + 0x01df61df, 0x01df41e7, 0x01df61e1, 0x029f41b6, + 0xa6d40100, 0xaeb40004, 0x81870000, 0x92b50c00, + 0x0397b815, 0xb6360001, 0x039fa02c, 0x00ffb81c, + 0x009f90cf, 0x00bf0389, 0x019f037a, 0x5982b80c, + 0x918c0340, 0x0397b80c, 0x81870000, 0x039fa00c, + 0x83a4007b, 0x81870000, 0x019f61b5, 0x019f61b4, + 0x81870007, 0x019f61b6, 0x019f03b3, 0x5981b80c, + 0x918ce118, 0x01b9b80c, 0x019f03af, 0x01bf61af, + 0x858c000f, 0x5986b80c, 0x01bf03b2, 0x59a2b80d, + 0x118cb80d, 0x019f61b2, 0x81870000, 0x019f61b7, + 0x019f61b8, 0x808704fc, 0x83a400d1, 0x80870000, + 0x80a70000, 0x80c70000, 0x80e70000, 0x83a400ac, + 0x83a400fb, 0x81470000, 0x81e70c1c, 0x0397b80f, + 0xb600f901, 0x039fa02a, 0x00ffb81c, 0x00000000, + 0x82270000, 0x023f2011, 0x0227b860, 0x023fb0ff, + 0x02bf9006, 0x92350028, 0x8213001f, 0x9210e000, + 0x3011b810, 0xb4800001, 0x86312000, 0x021f4193, + 0x5a01b810, 0x86100028, 0x83a4fa8c, 0x82270000, + 0x003fb811, 0x02bf9006, 0x5aa3b815, 0x82338000, + 0x1a31b815, 0x003fb811, 0x8067e950, 0x5c62b803, + 0x81f50000, 0x80270400, 0xb6000409, 0x814fffc0, + 0x00cfb801, 0x007fb0bc, 0x5862b803, 0x01cfb803, + 0x007f90bc, 0xb520ffff, 0x90210020, 0x90630020, + 0x82870000, 0x81f50010, 0x019f4193, 0x5d61b80c, + 0x5d43b80c, 0x114ab80b, 0x0187b80a, 0x960cff00, + 0x92100100, 0x858c0001, 0xb62c000c, 0x81f50010, + 0x5e28b80f, 0xb6000209, 0x5a48b814, 0x9652ff00, + 0x5e68b814, 0x5981b813, 0x918c1000, 0x01dfd80c, + 0x2252b811, 0x2292b80e, 0x962f00ff, 0x81870000, + 0x86100100, 0xb4e0fff0, 0xb00a0000, 0xb4000009, + 0x81670000, 0xb0140000, 0xb4000001, 0x81670001, + 0x017f2012, 0x258a4193, 0x918c0001, 0x81470000, + 0xb500ffe2, 0x81670000, 0xb0140000, 0xb4000001, + 0x81670002, 0x116b0012, 0x803f0000, 0x00000000, + 0x00000000, 0x003fb811, 0x00000000, 0x00000000, + 0x81f50000, 0x017f2012, 0x00ffb81a, 0x00000000, + 0x61f4b804, 0x91ef0001, 0x8233003f, 0x9a31ffff, + 0x5a02b804, 0x1610b811, 0x92510001, 0x1a10b812, + 0x029f03fb, 0xb0140001, 0xb4200012, 0x5a21b805, + 0x92b1e910, 0x0299b815, 0x5a22b805, 0x5a90b814, + 0x6290b814, 0x92b1e890, 0x11efb814, 0x029bb815, + 0x8233ff80, 0x3011b814, 0xb4000006, 0x4294b811, + 0x00000000, 0x0288b814, 0x4210b814, 0x00000000, + 0x0208b810, 0x029f9003, 0x82f3007f, 0x9af7ffff, + 0x3017b814, 0xb4000003, 0x4210b814, 0x00000000, + 0x0208b810, 0x82270000, 0x02c7b810, 0xb0160000, + 0xb400000a, 0x1676b812, 0x3013b812, 0xb4000003, + 0x5ac1b816, 0x92310001, 0xb500fffa, 0x81d3ff80, + 0x3010b80e, 0xb4200001, 0x1ad6b80e, 0x05efb811, + 0x027f037a, 0x5a62b813, 0x92730340, 0x0397b813, + 0x023fd813, 0x02dfb0fd, 0x5a30b811, 0x6230b811, + 0x0631b80f, 0x3010b812, 0xb4200001, 0x92310001, + 0x82470000, 0xb0110000, 0xb4800004, 0x82470003, + 0xb0110003, 0xb4400001, 0x0247b811, 0x039fa012, + 0x124f61bc, 0x00ffb81d, 0x00000000, 0x00000000, + 0x83970a10, 0x82070000, 0xb6003201, 0x039fa030, + 0xb0070000, 0xb4000019, 0x029f41b4, 0x0297b804, + 0x0317b805, 0x0397b806, 0xb6270014, 0x12948034, + 0x01df8038, 0xb00e0000, 0xb4a0000e, 0x02bf803c, + 0x5a02b814, 0x91b00a10, 0x0217b80d, 0xb62e0008, + 0x96150003, 0x91f00001, 0xadef0080, 0xb0150004, + 0xb4600001, 0x85ef0280, 0x021fa02f, 0x92940001, + 0xb5000001, 0x021f803c, 0x00000000, 0x00ffb81d, + 0x0397b804, 0x021f036a, 0x027f803c, 0x029f803c, + 0x02bf803c, 0x02df803c, 0x5a22b810, 0x92311000, + 0x0397b811, 0xb0100000, 0xb4200001, 0x039fa036, + 0xb0150000, 0xb4000021, 0x0227b860, 0x023fb0ff, + 0xb520ffff, 0x803f0000, 0x82138000, 0x1a10b813, + 0x003fb810, 0x00000000, 0x00000000, 0x82150000, + 0x00000000, 0xb635000d, 0x82550007, 0x5a42b812, + 0x9212e4b8, 0x025bb810, 0x8227000c, 0xb6000307, + 0x68d1b812, 0x94c6000f, 0x84c60002, 0x12d6b806, + 0xb6340001, 0x039fa036, 0x86310004, 0x803f0000, + 0x82138000, 0x023f90ff, 0x1a31b810, 0x003fb811, + 0x00000000, 0x00000000, 0x82150000, 0x00ffb81d, + 0x00ff41b5, 0x011f41b4, 0x019f41af, 0x01bf41ae, + 0x01df41ba, 0x01ff41bb, 0x82070000, 0x023f0380, + 0x82470000, 0xae310032, 0x029f41b3, 0x5862b807, + 0x90431000, 0x81970ad8, 0x0217b802, 0x90430c00, + 0x0297b802, 0x0317b802, 0x912802a4, 0x007ff009, + 0x58478030, 0x792341b6, 0x0529b807, 0x019fa029, + 0xb0080014, 0xb4800011, 0xa5420c00, 0x031fa02a, + 0x84690001, 0xb4a00011, 0xb623000b, 0x58678030, + 0xa4030c00, 0x031fa020, 0x044ab800, 0x0056b802, + 0x5c41b802, 0xf84200ff, 0x90620100, 0x005ff003, + 0x7d40b80a, 0x114ab802, 0xb5000004, 0xa5420c00, + 0x58478010, 0xa5620c00, 0x031fa02a, 0xb0080016, + 0xb4400043, 0xb0080013, 0xb440002c, 0xb0080006, + 0xb4400024, 0xb0080005, 0xb4400014, 0xb0080002, + 0xb4400006, 0x80440030, 0x015f619c, 0x05cab80c, + 0x05eab80d, 0x066eb810, 0xb500003c, 0x8044002a, + 0x300a419c, 0xb4800001, 0x82470001, 0x015f619c, + 0xb0120001, 0xb4200001, 0xb500001a, 0x05cab80c, + 0x05eab80d, 0x066eb810, 0xb5000030, 0x001f41b6, + 0xb0000007, 0xb4000001, 0x8044001b, 0x300a419c, + 0xb4800001, 0x82470001, 0xb0120001, 0xb4200001, + 0xb500000c, 0x05cab80c, 0x05eab80d, 0x066eb810, + 0xb5000022, 0x80440010, 0x840b0100, 0x300ab800, + 0xb4200001, 0x86100040, 0xb5000002, 0x86100080, + 0xfe100000, 0x046e41ad, 0x042ab80c, 0x7dc1b803, + 0x044f41ac, 0x042ab80d, 0x7de1b802, 0x046eb810, + 0x7e6fb803, 0xb5000011, 0x840b0100, 0x3000b80a, + 0xb4200002, 0x82070180, 0x00ffb802, 0x300ab80b, + 0xb4a00002, 0x86100040, 0xfe100000, 0x00ffb802, + 0x046e41ad, 0x042ab80c, 0x7dc1b803, 0x044f41ac, + 0x042ab80d, 0x7de1b802, 0x7e6eb80f, 0x380a41b0, + 0xb4600003, 0x242a41b0, 0x5c22b801, 0x1273b801, + 0xb0140000, 0xb4200002, 0x80071fe0, 0xb5000016, + 0x1011b808, 0x5801b800, 0x9020e26c, 0x0079b801, + 0x5842b808, 0x90420a10, 0x7c03b813, 0x003f9802, + 0x1000b801, 0x003f41b2, 0x5830b801, 0x6030b801, + 0x0400b801, 0x003f41b1, 0x5830b801, 0x6030b801, + 0x0400b801, 0xfc000000, 0xf8001fe0, 0x94001fe0, + 0x100041b1, 0x9400ffff, 0x8067003f, 0xb6290008, + 0x005f8014, 0x0442b800, 0x9442ffff, 0x5850b802, + 0x6050b802, 0xfc420000, 0x5c45b802, 0x7a82a023, + 0x10e7b809, 0x91080001, 0x300741b6, 0xb420ff6a, + 0x019f61af, 0x01bf61ae, 0x01df61ba, 0x01ff61bb, + 0x00ff41b5, 0x011f41b4, 0x019f41b8, 0x01bf41b7, + 0x01df41dd, 0x01ff41df, 0x021f41e1, 0x027f90fd, + 0x029f41bc, 0x02ff41dc, 0x031f41de, 0x033f41e0, + 0x5822b807, 0x91210c00, 0x0117b809, 0x81970ad8, + 0x91211000, 0x0217b809, 0x91210c00, 0x0317b809, + 0x80170ba0, 0x013f802c, 0xb629005f, 0x003f8038, + 0xb001000e, 0xb440001e, 0xb001000c, 0xb4400054, + 0xb001000a, 0xb4400043, 0xb0010007, 0xb440003c, + 0xb0010005, 0xb440002b, 0xb0010000, 0xb440001a, + 0xb00d0001, 0xb4200010, 0x005f418f, 0xac42bb75, + 0x8073005a, 0x9442ffff, 0x005f618f, 0x95628000, + 0x5848b802, 0xb00b8000, 0xb4200002, 0x8173ff00, + 0x1842b80b, 0x9863827a, 0x4043b802, 0x00000000, + 0x0048b802, 0xb500003f, 0x80470000, 0xb500003d, + 0x8401000f, 0x5c22b800, 0x902102d8, 0x001ff001, + 0x004db800, 0xb5000037, 0x86f70001, 0xb4600005, + 0x80750005, 0x5862b803, 0x9043e44c, 0x01d9b802, + 0x82e70002, 0x5c4cb80e, 0x9462000f, 0x5862b803, + 0x90630200, 0x005f9803, 0x59c4b80e, 0x95ceffff, + 0xb5000028, 0x87180001, 0xb4600005, 0x80750007, + 0x5862b803, 0x9043e4b8, 0x01f9b802, 0x83070002, + 0x5c4cb80f, 0x9462000f, 0x5862b803, 0x9063020c, + 0x005f9803, 0x59e4b80f, 0x95efffff, 0xb5000019, + 0x80750003, 0x5862b803, 0x90630220, 0x005f9803, + 0xb5000014, 0x87390001, 0xb4600005, 0x80750007, + 0x5862b803, 0x9043e6ac, 0x0219b802, 0x83270001, + 0x5c4cb810, 0x9462000f, 0x5862b803, 0x9063023c, + 0x005f9803, 0x5a04b810, 0x9610ffff, 0xb5000005, + 0x80750004, 0x5862b803, 0x90630268, 0x005f9803, + 0x00000000, 0x001fa022, 0x80170ba0, 0xb00c0001, + 0xb4200035, 0x023f90fb, 0x007f9811, 0x025f90fc, + 0x06d4b803, 0x007f9812, 0x4083b813, 0x00000000, + 0x0088b804, 0xb629002b, 0x24368030, 0x9421ffff, + 0x5830b801, 0x6030b801, 0x40448020, 0xb0010020, + 0xb4800003, 0x80470000, 0x80670000, 0xb500000e, + 0xb0010000, 0xb4a00004, 0x82b30080, 0x6aa1b815, + 0x4042b815, 0xb5000008, 0x6c41b802, 0x82a70017, + 0x12b5b801, 0x6875b803, 0x1842b803, 0x00000000, + 0x00000000, 0x00000000, 0x0108a022, 0x007f41b9, + 0x90630001, 0x007f61b9, 0xb003000c, 0xb420000c, + 0x92310004, 0x023fb0fb, 0x007f9811, 0x92520004, + 0x06d4b803, 0x025fb0fc, 0x007f9812, 0x80470000, + 0x4083b813, 0x00000000, 0x0088b804, 0x005f61b9, + 0x00000000, 0xb500001a, 0xb6290019, 0x24348030, + 0x9421ffff, 0x5830b801, 0x6030b801, 0x40538020, + 0xb0010020, 0xb4800003, 0x80470000, 0x80670000, + 0xb500000e, 0xb0010000, 0xb4a00004, 0x82b30080, + 0x6aa1b815, 0x4042b815, 0xb5000008, 0x6c41b802, + 0x82a70017, 0x12b5b801, 0x6875b803, 0x1842b803, + 0x00000000, 0x00000000, 0x00000000, 0x0108a022, + 0x10e7b809, 0x91080001, 0x300741b6, 0xb420ff48, + 0x00ff61b5, 0x011f61b4, 0x01df61dd, 0x01ff61df, + 0x021f61e1, 0x02ff61dc, 0x031f61de, 0x033f61e0, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x81d7ffff, + 0x8257ffff, 0x808f0000, 0x003f9113, 0x005f9114, + 0x7141b802, 0x80cf0700, 0x8027b064, 0x5c22b801, + 0x003fb0bc, 0x5822b801, 0x01cfb801, 0x003f90bc, + 0xb520ffff, 0x80cf0704, 0x8027b06c, 0x5c22b801, + 0x003fb0bc, 0x5822b801, 0x01cfb801, 0x003f90bc, + 0xb520ffff, 0x81e7043c, 0x82071c00, 0x82271c10, + 0x019f03a9, 0x806f001f, 0x80af001f, 0x80270400, + 0x8067a800, 0x5c62b803, 0xb6000808, 0x00cfb801, + 0x007fb0bc, 0x5862b803, 0x01cfb803, 0x007f90bc, + 0xb520ffff, 0x90210020, 0x90630020, 0x81971000, + 0x82170c00, 0xb6000004, 0x003f800c, 0x005f8010, + 0x021fa021, 0x019fa022, 0x00bfd810, 0x003fd811, + 0x70c1b80a, 0x001f980f, 0x91ef0004, 0x92100002, + 0x92310002, 0x5822b805, 0x90411000, 0x0197b802, + 0x90410c00, 0x0217b802, 0x0466b805, 0xb0000000, + 0xb4000005, 0xb6230004, 0x003f8010, 0x005f800c, + 0x1201a022, 0x0581a022, 0x858c0001, 0xb4e0ffea, + 0x80270400, 0x8067ac00, 0x5c62b803, 0xb6000808, + 0x00cfb801, 0x007fb0bc, 0x5862b803, 0x01afb803, + 0x007f90bc, 0xb520ffff, 0x90210020, 0x90630020, + 0x00ffb81c, 0x00000000, 0x00000000, 0x00000000, + 0x808f0000, 0x806f001f, 0x80af001f, 0x003f037a, + 0xb0010000, 0xb4400030, 0x81a7b7fc, 0x5da2b80d, + 0x80670500, 0xb6000208, 0x00cfb803, 0x01bfb0bc, + 0x59a2b80d, 0x01cfb80d, 0x01bf90bc, 0xb520ffff, + 0x90630020, 0x91ad0020, 0x81c7b8fc, 0x5dc2b80e, + 0x80670540, 0xb6000208, 0x00cfb803, 0x01dfb0bc, + 0x59c2b80e, 0x01cfb80e, 0x01df90bc, 0xb520ffff, + 0x90630020, 0x91ce0020, 0x81a7b3fc, 0x5da2b80d, + 0x80670600, 0xb6000408, 0x00cfb803, 0x01bfb0bc, + 0x59a2b80d, 0x01cfb80d, 0x01bf90bc, 0xb520ffff, + 0x90630020, 0x91ad0020, 0x81c7b5fc, 0x5dc2b80e, + 0x80670680, 0xb6000408, 0x00cfb803, 0x01dfb0bc, + 0x59c2b80e, 0x01cfb80e, 0x01df90bc, 0xb520ffff, + 0x90630020, 0x91ce0020, 0x005f03fa, 0xb0020000, + 0xb4000024, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x8257ffff, 0x82d7ffff, 0x8357ffff, + 0x83d7ffff, 0x83971300, 0x83171200, 0x82971100, + 0x82171000, 0x81170c00, 0x81970ff8, 0x80171400, + 0x80971500, 0x005f802c, 0x001f8028, 0xb6004010, + 0x41028000, 0x51008004, 0x007f876c, 0x0208a028, + 0x41008000, 0x49028004, 0x003f8068, 0x0388a028, + 0x41038000, 0x51018004, 0x005f802c, 0x0288a028, + 0x41018020, 0x49038024, 0x001f8028, 0x0308a028, + 0x00ffb81c, 0x83d7ffff, 0x8357ffff, 0x82d7ffff, + 0x8257ffff, 0x8157ffff, 0x81d7ffff, 0x8057ffff, + 0x80d7ffff, 0x82971200, 0x82171000, 0x81170c00, + 0x81970ffc, 0x83171800, 0x83971a00, 0x83370000, + 0x83b70000, 0x81370008, 0x81b7fff8, 0x4119880c, + 0xb6008006, 0x511d8808, 0x41498838, 0x0208a028, + 0x494d883c, 0x4119880c, 0x0288a02a, 0x00ffb81c, + 0x82670000, 0x82a70000, 0x003f037a, 0xb0010000, + 0xb4400018, 0x81a7bdfc, 0x5da2b80d, 0x80670580, + 0xb6000208, 0x00cfb803, 0x01bfb0bc, 0x59a2b80d, + 0x01cfb80d, 0x01bf90bc, 0xb520ffff, 0x90630020, + 0x91ad0020, 0x81a7eb70, 0x5da2b80d, 0x806705c0, + 0xb6000208, 0x00cfb803, 0x01bfb0bc, 0x59a2b80d, + 0x01cfb80d, 0x01bf90bc, 0xb520ffff, 0x90630020, + 0x91ad0020, 0x02bf03fa, 0x808f0000, 0xb0150000, + 0xb4000006, 0x81470040, 0x81670003, 0x81870002, + 0x81a71000, 0x81c71300, 0xb5000005, 0x81470080, + 0x81670004, 0x81870001, 0x81a71000, 0x81c71200, + 0x0017b80d, 0x0097b80e, 0x108db80a, 0x0117b804, + 0x108eb80a, 0x0197b804, 0x5841b80a, 0x108db802, + 0x0217b804, 0x108eb802, 0x0297b804, 0x106ab802, + 0x108db803, 0x0317b804, 0x108eb803, 0x0397b804, + 0x5ea2b80a, 0xb6350020, 0x001f8000, 0x003f8008, + 0x005f8004, 0x007f800c, 0x10c08010, 0x10a18018, + 0x10828014, 0x10e3801c, 0x1246b805, 0x0686b805, + 0x10c4b807, 0x0484b807, 0x80e70000, 0x80a70000, + 0x0008a032, 0x0108a034, 0x0088a026, 0x0188a024, + 0x04c08010, 0x04a18018, 0x04828014, 0x04e3801c, + 0x0646b807, 0x1286b807, 0x10c4b805, 0x0484b805, + 0x80e70000, 0x80a70000, 0x0208a032, 0x0308a034, + 0x0288a026, 0x0388a024, 0x5de1b80a, 0x82070004, + 0xb62b002a, 0x0017b80d, 0x0097b80e, 0x102db80f, + 0x0117b801, 0x104eb80f, 0x0197b802, 0x82171600, + 0x82971700, 0x0037b80f, 0x00b7b80f, 0x0137b80f, + 0x01b7b80f, 0xb630001b, 0x003f8030, 0x005f8034, + 0x5ee2b80f, 0x8013007f, 0x9800ffff, 0xb6370011, + 0x41008000, 0x51018008, 0x4902800c, 0x40c08000, + 0x0008a028, 0x48c18008, 0x50c2800c, 0x42808004, + 0x00c8b806, 0x52828008, 0x5281800c, 0x41008004, + 0x0088a034, 0x49028008, 0x4901800c, 0x011fa026, + 0x0188a028, 0x001f8001, 0x001f8005, 0x001f8009, + 0x001f800d, 0x5de1b80f, 0x5a01b810, 0x0017b80d, + 0x0097b80e, 0x902d0004, 0x0117b801, 0x904e0004, + 0x0197b802, 0x82171600, 0x82971700, 0x5ea1b80a, + 0x8013007f, 0x9800ffff, 0xb6350013, 0x003f8030, + 0x005f8034, 0x42408000, 0x52418008, 0x4a42800c, + 0x41008000, 0x0008a052, 0x49018008, 0x5102800c, + 0x42808004, 0x0108b808, 0x52828008, 0x5281800c, + 0x40c08004, 0x0088a054, 0x48c28008, 0x48c1800c, + 0x011fa048, 0x0188a046, 0x81a71100, 0x81c71200, + 0x858c0001, 0xb4e0ff7e, 0x00ffb81c, 0x00000000, + 0x005f03fa, 0x00000000, 0xb0020000, 0xb4000034, + 0x81b70080, 0x81d7ffff, 0x81f70001, 0x82370080, + 0x8257ffff, 0x82770001, 0x82b70080, 0x82d7ffff, + 0x82f70001, 0x83370080, 0x8357ffff, 0x83770001, + 0x81971000, 0x82171100, 0x82971200, 0x83171300, + 0x815703fc, 0x81370200, 0x81170c00, 0x83d703fc, + 0x83b70200, 0x83970f00, 0x8057ffff, 0x80d7ffff, + 0x80171400, 0x80971500, 0x001f800d, 0x003f8019, + 0xb6004012, 0x41008000, 0x51018004, 0x007f8011, + 0x0128a008, 0x41018000, 0x49008004, 0x009f8015, + 0x03a8a008, 0x41038000, 0x51048004, 0x001f800d, + 0x03a8a008, 0x41048020, 0x49038024, 0x003f8019, + 0x0128a008, 0x005f8028, 0x005f803c, 0x81f70000, + 0x82770000, 0x82f70000, 0x83770000, 0x00ffb81c, + 0x82370040, 0x8257ffff, 0x82770001, 0x82b70040, + 0x82d7ffff, 0x82f70001, 0x82171000, 0x82971200, + 0x8157ffff, 0x81170c00, 0x81d7ffff, 0x81970e00, + 0x8057ffff, 0x80d7ffff, 0x80171800, 0x80971a00, + 0xb600800a, 0x001f8011, 0x003f8015, 0x41008000, + 0x51018004, 0x00000000, 0x0108a028, 0x41018020, + 0x49008024, 0x00000000, 0x0188a028, 0x82770000, + 0x82f70000, 0x00ffb81c, 0x00000000, 0x00000000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x808f0000, + 0x015f0384, 0x017f037a, 0xac4a0006, 0x8027b004, + 0x1042b80b, 0x5841b802, 0x1021b802, 0x0159b801, + 0x013f0325, 0x01bf0320, 0x5822b80b, 0x90210340, + 0x00ff9801, 0x8027b2e8, 0x5842b807, 0x1021b802, + 0x025bb801, 0x80070000, 0xac4d0006, 0x8027b004, + 0x1042b800, 0x5841b802, 0x1021b802, 0x0199b801, + 0x00000000, 0xac4c0006, 0x8027b078, 0x1042b80a, + 0x5842b802, 0x1021b802, 0x011bb801, 0x00000000, + 0x40d2b808, 0x00000000, 0xb0060000, 0xb4000080, + 0x005f033b, 0x80278400, 0xac600080, 0x5c22b801, + 0x10a1b803, 0xb0020000, 0xb4200002, 0x80279000, + 0xb5000001, 0x80279c00, 0x5c22b801, 0x11e1b803, + 0x80470300, 0x5822b800, 0x1042b801, 0x003f9802, + 0x806f001f, 0x80af001f, 0xb0010000, 0xb4200024, + 0x80170c00, 0x80971000, 0x003f8020, 0xb6000003, + 0x4201b806, 0x003f8020, 0x0088a030, 0x80270400, + 0xb6000208, 0x00cfb801, 0x00bfb0bc, 0x58a2b805, + 0x01afb805, 0x00bf90bc, 0xb520ffff, 0x90210020, + 0x90a50020, 0xb6000408, 0x00cfb801, 0x01ffb0bc, + 0x59e2b80f, 0x01afb80f, 0x01ff90bc, 0xb520ffff, + 0x90210020, 0x91ef0020, 0xb6000208, 0x00cfb801, + 0x00bfb0bc, 0x58a2b805, 0x01afb805, 0x00bf90bc, + 0xb520ffff, 0x90210020, 0x90a50020, 0xb5000043, + 0x80270400, 0x0087b805, 0x01c7b80f, 0xb6000208, + 0x00cfb801, 0x009fb0bc, 0x5882b804, 0x01cfb804, + 0x009f90bc, 0xb520ffff, 0x90210020, 0x90840020, + 0xb6000408, 0x00cfb801, 0x01dfb0bc, 0x59c2b80e, + 0x01cfb80e, 0x01df90bc, 0xb520ffff, 0x90210020, + 0x91ce0020, 0xb6000208, 0x00cfb801, 0x009fb0bc, + 0x5882b804, 0x01cfb804, 0x009f90bc, 0xb520ffff, + 0x90210020, 0x90840020, 0x80170c00, 0x80971000, + 0x8053007f, 0x9842ffff, 0xb6000004, 0x42028004, + 0x4a068020, 0x00000000, 0x0088a030, 0x80270400, + 0xb6000208, 0x00cfb801, 0x00bfb0bc, 0x58a2b805, + 0x01afb805, 0x00bf90bc, 0xb520ffff, 0x90210020, + 0x90a50020, 0xb6000408, 0x00cfb801, 0x01ffb0bc, + 0x59e2b80f, 0x01afb80f, 0x01ff90bc, 0xb520ffff, + 0x90210020, 0x91ef0020, 0xb6000208, 0x00cfb801, + 0x00bfb0bc, 0x58a2b805, 0x01afb805, 0x00bf90bc, + 0xb520ffff, 0x90210020, 0x90a50020, 0x5822b800, + 0x90210300, 0x0117b801, 0x80470001, 0x011fa002, + 0x90000001, 0x3000b809, 0xb480ff6b, 0x00ffb81c, + 0x8057ffff, 0x013f0325, 0x015f033b, 0x80171000, + 0x80070000, 0xb6002001, 0x001fa020, 0xb00a0001, + 0xb4c00002, 0x81679000, 0xb5000001, 0x81679c00, + 0x5d62b80b, 0x81878400, 0x5d82b80c, 0x80070000, + 0x5822b800, 0x90410300, 0x003f9802, 0x00000000, + 0xb0010000, 0xb4200019, 0xac400080, 0x00000000, + 0x10ccb802, 0x10abb802, 0x806f001f, 0x80af001f, + 0x80cf0400, 0xb6000408, 0xb520ffff, 0x00dfb0bc, + 0x58c2b806, 0x01afb806, 0x00df90bc, 0xb520ffff, + 0x80cf0400, 0x90c60020, 0x80cf0400, 0xb6000407, + 0x00bfb0bc, 0x58a2b805, 0x01afb805, 0x00bf90bc, + 0xb520ffff, 0x80cf0400, 0x90a50020, 0x90000001, + 0x3000b809, 0xb480ffde, 0x00ffb81b, 0x8057ffff, + 0x013f0325, 0x80171000, 0x80070000, 0xb6002001, + 0x001fa020, 0x81878400, 0x5d82b80c, 0x80070000, + 0x5822b800, 0x90410300, 0x003f9802, 0x00000000, + 0xb0010000, 0xb420000f, 0xac400080, 0x00000000, + 0x10ccb802, 0x806f001f, 0x80af001f, 0x80cf0400, + 0xb6000408, 0xb520ffff, 0x00dfb0bc, 0x58c2b806, + 0x01afb806, 0x00df90bc, 0xb520ffff, 0x80cf0400, + 0x90c60020, 0x90000001, 0x3000b809, 0xb480ffe8, + 0x00ffb81b, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x8139b000, 0x00000000, 0xb0090000, 0xb4000012, + 0x806f001f, 0x80af001f, 0x80cf0400, 0x013fb0bc, + 0x5922b809, 0x01cfb809, 0x013f90bc, 0xb520ffff, + 0x806f0003, 0x80af0003, 0x80cf0420, 0x91290020, + 0x013fb0bc, 0x5922b809, 0x01cfb809, 0x013f90bc, + 0xb520ffff, 0xb5000233, 0x80270000, 0x80171000, + 0xb6002401, 0x001fa021, 0x007f0384, 0x009f0320, + 0x00bf0385, 0x00df0386, 0x80e7b36c, 0x5821b803, + 0x1021b807, 0x0159b801, 0x5821b804, 0x1021b807, + 0x0179b801, 0x80e7b37c, 0x5821b803, 0x1021b807, + 0x0199b801, 0x5821b804, 0x1021b807, 0x01b9b801, + 0x80e7b38c, 0x5821b803, 0x1021b807, 0x01d9b801, + 0x5821b804, 0x1021b807, 0x01f9b801, 0x005f0385, + 0x8027b39c, 0x5842b802, 0x1021b802, 0x021bb801, + 0x005f0386, 0x8027b3ac, 0x5842b802, 0x1021b802, + 0x023bb801, 0x027f0383, 0x003f0328, 0x005f4195, + 0xb0130007, 0xb42000df, 0xb0010000, 0xb42000dd, + 0xb0020000, 0xb40000db, 0xb0030002, 0xb48000d9, + 0x029bb802, 0x82a7b108, 0xb00b0001, 0xb4200001, + 0xb5000005, 0xb00b0002, 0xb4200002, 0x92b500a0, + 0xb5000001, 0x92b50140, 0xb0030004, 0xb4600002, + 0x82870000, 0xb5000006, 0xb0030006, 0xb4600004, + 0xb0140001, 0xb4a00002, 0x82870001, 0xb5000000, + 0xac54000a, 0x806f0009, 0x80af0009, 0x5c22b815, + 0x80cf0440, 0x1021b802, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0xb520ffff, 0xb0030003, + 0xb400000f, 0xb0030004, 0xb400001d, 0xb0030005, + 0xb400002b, 0xb0030006, 0xb4000042, 0xb0030007, + 0xb4000059, 0x80171000, 0x005f9440, 0x001fa002, + 0x80171038, 0x005f9440, 0x001fa002, 0xb5000073, + 0x80171000, 0x005f9440, 0x001fa002, 0x80171004, + 0x005f9443, 0x001fa002, 0x8017101c, 0x005f9446, + 0x001fa002, 0x80171034, 0x005f9449, 0x001fa002, + 0x80171038, 0x005f9440, 0x001fa002, 0xb5000063, + 0x80171000, 0x005f9440, 0x001fa002, 0x80171008, + 0x005f9441, 0x001fa002, 0x80171020, 0x005f9444, + 0x001fa002, 0x80171034, 0x005f9440, 0x001fa002, + 0x80171038, 0x005f9447, 0x001fa002, 0xb5000053, + 0x80171000, 0x005f9440, 0x001fa002, 0x80171004, + 0x005f9443, 0x001fa002, 0x8017100c, 0x005f9441, + 0x001fa002, 0x8017101c, 0x005f9446, 0x001fa002, + 0x80171024, 0x005f9444, 0x001fa002, 0x80171034, + 0x005f9449, 0x001fa002, 0x80171038, 0x005f9440, + 0x001fa002, 0x8017103c, 0x005f9447, 0x001fa002, + 0xb500003a, 0x80171000, 0x005f9440, 0x001fa002, + 0x80171008, 0x005f9441, 0x001fa002, 0x8017100c, + 0x005f9442, 0x001fa002, 0x80171020, 0x005f9444, + 0x001fa002, 0x80171024, 0x005f9445, 0x001fa002, + 0x80171034, 0x005f9440, 0x001fa002, 0x80171038, + 0x005f9447, 0x001fa002, 0x8017103c, 0x005f9448, + 0x001fa002, 0xb5000021, 0x80171000, 0x005f9440, + 0x001fa002, 0x80171004, 0x005f9443, 0x001fa002, + 0x8017100c, 0x005f9441, 0x001fa002, 0x80171010, + 0x005f9442, 0x001fa002, 0x8017101c, 0x005f9446, + 0x001fa002, 0x80171024, 0x005f9444, 0x001fa002, + 0x80171028, 0x005f9445, 0x001fa002, 0x80171034, + 0x005f9449, 0x001fa002, 0x80171038, 0x005f9440, + 0x001fa002, 0x8017103c, 0x005f9447, 0x001fa002, + 0x80171040, 0x005f9448, 0x001fa002, 0x80270001, + 0x803eff90, 0x80171000, 0x82b30020, 0x9ab50000, + 0x40158020, 0xb6000501, 0x48158020, 0x82b30020, + 0x9ab50000, 0x80470000, 0x3015b800, 0xb4600006, + 0x80171000, 0x83840226, 0xb6000603, 0x40028000, + 0x00000000, 0x0008a020, 0x80171018, 0x82b30020, + 0x9ab50000, 0x40158020, 0xb6000501, 0x48158020, + 0x82b30020, 0x9ab50000, 0x80470000, 0x3015b800, + 0xb4600006, 0x80171018, 0x83840215, 0xb6000603, + 0x40028000, 0x00000000, 0x0008a020, 0x80171030, + 0x82b30020, 0x9ab50000, 0x40158020, 0xb6000501, + 0x48158020, 0x82b30020, 0x9ab50000, 0x80470000, + 0x3015b800, 0xb4600006, 0x80171030, 0x83840204, + 0xb6000603, 0x40028000, 0x00000000, 0x0008a020, + 0xb500011e, 0x80270000, 0x803eff90, 0xb0030000, + 0xb4200067, 0x025f0322, 0xb00b0001, 0xb4200016, + 0xb0120001, 0xb4200005, 0x80171018, 0x8033007f, + 0x9821ffff, 0x001fa001, 0xb5000110, 0xb0120002, + 0xb4200005, 0x80171020, 0x8033007f, 0x9821ffff, + 0x001fa001, 0xb5000109, 0x80171018, 0x80330040, + 0x98210000, 0x001fa001, 0x80171020, 0x00000000, + 0x001fa001, 0xb5000101, 0xb00b0002, 0xb420002c, + 0xb0120000, 0xb4200008, 0x80171000, 0x8033007f, + 0x9821ffff, 0x001fa001, 0x80171038, 0x00000000, + 0x001fa001, 0xb50000f5, 0xb0120001, 0xb4200008, + 0x80171000, 0x8033005a, 0x98218279, 0x001fa001, + 0x80171030, 0x00000000, 0x001fa001, 0xb50000eb, + 0xb0120002, 0xb4200008, 0x80171008, 0x8033005a, + 0x98218279, 0x001fa001, 0x80171038, 0x00000000, + 0x001fa001, 0xb50000e1, 0x80171000, 0x80330040, + 0x98210000, 0x001fa001, 0x80171008, 0x00000000, + 0x001fa001, 0x8017100c, 0x00000000, 0x001fa001, + 0x80171038, 0x00000000, 0x001fa001, 0xb50000d3, + 0xb0120000, 0xb4200008, 0x80171000, 0x8033007f, + 0x9821ffff, 0x001fa001, 0x80171038, 0x00000000, + 0x001fa001, 0xb50000c9, 0xb0120001, 0xb4200005, + 0x80171018, 0x8033007f, 0x9821ffff, 0x001fa001, + 0xb50000c2, 0xb0120002, 0xb4200005, 0x80171020, + 0x8033007f, 0x9821ffff, 0x001fa001, 0xb50000bb, + 0x80171018, 0x80330040, 0x98210000, 0x001fa001, + 0x80171020, 0x00000000, 0x001fa001, 0xb50000b3, + 0x80070000, 0x8033007f, 0x9821ffff, 0xb600050e, + 0x144eb80f, 0xb0028000, 0xb4c00008, 0xac400006, + 0x00000000, 0x1042b800, 0x5842b802, 0x90421000, + 0x0017b802, 0x00000000, 0x001fa001, 0x90000001, + 0x59c1b80e, 0x59e1b80f, 0xb0040000, 0xb4200023, + 0xb00a0002, 0xb4000007, 0x80171004, 0x8033005a, + 0x98218279, 0x001fa001, 0x80171034, 0x00000000, + 0x001fa001, 0xb00c0002, 0xb4000009, 0x8017100c, + 0x8033ffa5, 0x98217d87, 0x001fa001, 0x8017103c, + 0x8033005a, 0x98218279, 0x001fa001, 0xb500008b, + 0x8017100c, 0x8033ffa5, 0x98217d87, 0x001fa001, + 0x80171010, 0x00000000, 0x001fa001, 0x8017103c, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171040, + 0x00000000, 0x001fa001, 0xb500007c, 0xb0040001, + 0xb420002a, 0xb00a0001, 0xb4000007, 0x80171018, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171020, + 0x00000000, 0x001fa001, 0xb00a0003, 0xb420000a, + 0x8053005a, 0x98428279, 0x4030b802, 0x8017101c, + 0x5821b801, 0x00000000, 0x00000000, 0x00000000, + 0x0028b801, 0x001fa001, 0xb00c0001, 0xb4200007, + 0x8053005a, 0x98428279, 0x4031b802, 0x80171024, + 0x0028b801, 0x001fa001, 0xb500005c, 0xb00c0002, + 0xb420005a, 0x8053005a, 0x98428279, 0x4031b802, + 0x80171024, 0x0028b801, 0x001fa001, 0x80171028, + 0x00000000, 0x001fa001, 0xb5000050, 0xb00b0002, + 0xb4200012, 0xb00a0001, 0xb4200008, 0x80171004, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171034, + 0x00000000, 0x001fa001, 0xb5000008, 0xb00a0003, + 0xb4200006, 0x80171004, 0x00000000, 0x001fa010, + 0x80171034, 0x00000000, 0x001fa010, 0xb00c0001, + 0xb4200025, 0x027f0383, 0x003f0328, 0xb0130007, + 0xb420000b, 0xb00b0003, 0xb4200009, 0xb0010000, + 0xb4200007, 0x80171024, 0x00000000, 0x001fa011, + 0x80171054, 0x80270000, 0x001fa001, 0xb500002b, + 0xb00d0000, 0xb420000a, 0x8033005a, 0x98218279, + 0x4041b811, 0x8017100c, 0x0048b802, 0x001fa002, + 0x8017103c, 0x00000000, 0x001fa002, 0xb500001f, + 0xb00d0002, 0xb420001d, 0x80171054, 0x8033005a, + 0x98218279, 0x001fa001, 0x8017106c, 0x00000000, + 0x001fa001, 0xb5000015, 0xb00c0002, 0xb4200013, + 0xb00d0000, 0xb4200007, 0x8017100c, 0x00000000, + 0x001fa011, 0x80171040, 0x00000000, 0x001fa011, + 0xb500000a, 0xb00d0001, 0xb4200008, 0x80171054, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171058, + 0x00000000, 0x001fa001, 0xb5000000, 0x029f0388, + 0x02bf0321, 0xb0140000, 0xb4000006, 0xb0150000, + 0xb4000004, 0x8017108c, 0x8033007f, 0x9821ffff, + 0x001fa001, 0x8027b078, 0x5c22b801, 0x806f001f, + 0x80af001f, 0x80cf0400, 0x003fb0bc, 0x5822b801, + 0x01afb801, 0x003f90bc, 0xb520ffff, 0x90210020, + 0x806f0003, 0x80af0003, 0x80cf0420, 0x003fb0bc, + 0x5822b801, 0x01afb801, 0x003f90bc, 0xb520ffff, + 0x81270000, 0x8033007f, 0x9821ffff, 0x80171000, + 0xb600060a, 0x80470000, 0xb6000603, 0x015f8020, + 0x0156b80a, 0x1042b80a, 0x3002b801, 0xb4a00001, + 0x81270001, 0x00000000, 0x00000000, 0x015f0323, + 0x00000000, 0xb00a0000, 0xb4200002, 0x81670000, + 0xb5000001, 0x81670001, 0x017f23fb, 0x01ff41ee, + 0x59f0b80f, 0x61f0b80f, 0x021f41ef, 0x5a10b810, + 0x6210b810, 0xb00a0003, 0xb420003b, 0x017f039f, + 0x019f41c5, 0x5990b80c, 0x6190b80c, 0xb00b0000, + 0xb400000c, 0xb00c0000, 0xb4000005, 0xac4c0100, + 0x8033001d, 0x98215500, 0x12c1b802, 0xb500000f, + 0xac4f0100, 0x8033001d, 0x98215500, 0x12c1b802, + 0xb500000a, 0xb0090000, 0xb4000005, 0xac4f0100, + 0x8033ffe2, 0x9821ab00, 0x12c1b802, 0xb5000003, + 0xac4f0100, 0x00000000, 0x02c7b802, 0xb0030000, + 0xb420007e, 0x01bf03a0, 0x01df41c9, 0x59d0b80e, + 0x61d0b80e, 0xb00d0000, 0xb400000c, 0xb00e0000, + 0xb4000005, 0xac4e0100, 0x8033001d, 0x98215500, + 0x12e1b802, 0xb5000071, 0xac500100, 0x8033001d, + 0x98215500, 0x12e1b802, 0xb500006c, 0xb0090000, + 0xb4000005, 0xac500100, 0x8033ffe2, 0x9821ab00, + 0x12e1b802, 0xb5000065, 0xac500100, 0x00000000, + 0x02e7b802, 0xb5000061, 0xb00a0002, 0xb420002f, + 0x023f9002, 0x025f9001, 0xb00f0000, 0xb4a00007, + 0xac4f0100, 0x00000000, 0x4022b811, 0x00000000, + 0x0028b801, 0x02c7b801, 0xb500000c, 0xb0090000, + 0xb4000004, 0xac4f0100, 0x00000000, 0x02c7b802, + 0xb5000006, 0xac4f0100, 0x00000000, 0x4022b812, + 0x00000000, 0x0028b801, 0x02c7b801, 0xb0030000, + 0xb4200046, 0xb0100000, 0xb4a00007, 0xac500100, + 0x00000000, 0x4022b811, 0x00000000, 0x0028b801, + 0x02e7b801, 0xb500003d, 0xb0090000, 0xb4000004, + 0xac500100, 0x00000000, 0x02e7b802, 0xb5000037, + 0xac500100, 0x00000000, 0x4022b812, 0x00000000, + 0x0028b801, 0x02e7b801, 0xb5000030, 0x023f9002, + 0x025f9001, 0xb00f0000, 0xb4a00007, 0xac4f0100, + 0x00000000, 0x4022b811, 0x00000000, 0x0028b801, + 0x02c7b801, 0xb5000006, 0xac4f0100, 0x00000000, + 0x4022b812, 0x00000000, 0x0028b801, 0x02c7b801, + 0xb0090000, 0xb4000005, 0x0047b816, 0x8033ffe2, + 0x9821ab00, 0x1042b801, 0x02c7b802, 0xb0030000, + 0xb4200016, 0xb0100000, 0xb4a00007, 0xac500100, + 0x00000000, 0x4022b811, 0x00000000, 0x0028b801, + 0x02e7b801, 0xb5000006, 0xac500100, 0x00000000, + 0x4022b812, 0x00000000, 0x0028b801, 0x02e7b801, + 0xb0090000, 0xb4000005, 0x0047b817, 0x8033ffe2, + 0x9821ab00, 0x1042b801, 0x02e7b802, 0x00000000, + 0x00000000, 0x02c8b816, 0x02dfb0cf, 0xb0030000, + 0xb4200002, 0x02e8b817, 0x02ffb0c6, 0x00ffb81b, + 0xb6001807, 0x5841b802, 0x3015b800, 0xb4800002, + 0x06b5b800, 0x98420001, 0x5aa1b815, 0x00000000, + 0x00ffb81c, 0x00000000, 0x00000000, 0x00000000, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815bb3f0, 0x81070000, 0x81270bf4, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x812717f4, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a00029, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200001, + 0x8384026c, 0x80af001f, 0x808f0000, 0x806f0000, + 0x80670400, 0x5d22b80a, 0xb600180a, 0x00cfb803, + 0x013fb0bc, 0x5922b809, 0x01afb809, 0x013f90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x90630020, + 0x91290020, 0x801bb3f8, 0x80270001, 0xb0000001, + 0xb4000002, 0x802600a0, 0x803eb3f8, 0x81270c00, + 0xb00a0000, 0xb4000001, 0x81270000, 0x813eb3f0, + 0x80270001, 0x003f2013, 0x00ffb81b, 0x00000000, + 0x029fb00a, 0x02bfb00b, 0x02dfb00c, 0x02ffb00d, + 0x031fb00e, 0x033fb00f, 0x033f400f, 0x0287b86f, + 0x029fb005, 0x8285009d, 0x9a940008, 0x8286009d, + 0x8285009c, 0x96b48000, 0xb0158000, 0xb40001b5, + 0x96b40100, 0xb0150100, 0xb400020c, 0x96b40400, + 0xb0150400, 0xb400020d, 0x96b40001, 0xb0150001, + 0xb400000c, 0x96b40008, 0xb0150008, 0xb40001ad, + 0x96b44000, 0xb0154000, 0xb400020c, 0x96b40002, + 0xb0150002, 0xb4000182, 0x00000000, 0x00000000, + 0xb500021e, 0x02bf9017, 0x92b50001, 0x02bfb017, + 0x82850082, 0x96f40001, 0xb0170000, 0xb4000171, + 0x5efdb814, 0x96f70001, 0xb0170001, 0xb420000b, + 0x83050069, 0x9718003f, 0x82e50064, 0x12f7b818, + 0x86f70109, 0x82feff74, 0x02e7b86f, 0x9af74000, + 0x01ffb817, 0x96f7bfff, 0x01ffb817, 0x83050081, + 0x82a5009a, 0x96b50001, 0xb0150001, 0xb4200014, + 0x82a70000, 0x02bfb017, 0x96b41840, 0xb0150800, + 0xb420000c, 0x96b40008, 0x5aa9b815, 0x96d46000, + 0x5ec3b816, 0x82f3000f, 0x9af7c00f, 0x1718b817, + 0x1ab5b818, 0x1ab5b816, 0x9ab50340, 0x82a60081, + 0xb500014c, 0x9b180180, 0x83060081, 0xb5000149, + 0x82a5009a, 0x96b50002, 0xb0150002, 0xb420001b, + 0x82a70000, 0x02bfb017, 0x96b41800, 0xb0151800, + 0xb4000013, 0x96b40040, 0xb0150040, 0xb4200004, + 0xa3180c00, 0x9b180340, 0x83060081, 0xb5000139, + 0x96b40008, 0x5aa9b815, 0x96d46000, 0x5ec3b816, + 0x82f3000f, 0x9af7c00f, 0x1718b817, 0x1ab5b818, + 0x1ab5b816, 0x9ab50340, 0x82a60081, 0xb500012d, + 0x9b180180, 0x83060081, 0xb500012a, 0x82a500c1, + 0x96b5000f, 0xb015000b, 0xb420000e, 0x96b40020, + 0xb0150020, 0xb400000b, 0x96b40200, 0xb0150200, + 0xb4000008, 0x82c50086, 0x82e50094, 0x3016b817, + 0xb4400004, 0x06f7b816, 0xb017ff00, 0xb4400001, + 0xb5000118, 0x96b46000, 0xb0156000, 0xb4000011, + 0x96b41820, 0xb0150820, 0xb4200004, 0x9b391000, + 0x82a5009a, 0x96b5feff, 0x82a6009a, 0x96b40040, + 0xb0150040, 0xb4200001, 0x9739efff, 0x96b91000, + 0xb0151000, 0xb4200003, 0x82a5009a, 0x9ab50100, + 0x82a6009a, 0x96b40040, 0xb0150040, 0xb4200019, + 0x96b41800, 0xb0151800, 0xb4200006, 0x96b98000, + 0xb0158000, 0xb4200003, 0x9b180180, 0x83060081, + 0xb50000f8, 0x96d80c00, 0x82b300ff, 0x9ab5f3ff, + 0x1718b815, 0xb0160c00, 0xb4000007, 0x82e50098, + 0x96f70400, 0xb0170400, 0xb4200002, 0x82c70c00, + 0xb5000001, 0xa2d60c00, 0x1b18b816, 0x9b180340, + 0xb50000c4, 0x96b40220, 0xb0150000, 0xb4e00021, + 0x82a5009d, 0x82f3ffff, 0x16b5b817, 0x82f33800, + 0x3015b817, 0xb420001b, 0x96f98000, 0xb0178000, + 0xb4000018, 0x82a70000, 0x02bfb017, 0x82c5009d, + 0x96d6ffff, 0x82b3c800, 0x9ab58001, 0x82e500c1, + 0x96f7000f, 0xb017000b, 0xb4000002, 0x82b38800, + 0x9ab58001, 0x1ab5b816, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82b3c800, 0x9ab58001, + 0x82a6009d, 0x02ff9017, 0x00000000, 0xb0170040, + 0xb4800000, 0x5eb5b814, 0x96b500f0, 0x96f46000, + 0x5eedb817, 0x1ab5b817, 0xb0170003, 0xb4000004, + 0x96b500ef, 0x96f70001, 0x5ae4b817, 0x1ab5b817, + 0x96d41800, 0xb0161800, 0xb400000a, 0x96f900ff, + 0x96b500ff, 0x9739ff00, 0x1b39b815, 0x02a7b817, + 0x96b500f3, 0x96d40008, 0x5ec1b816, 0x1ab5b816, + 0xb500000c, 0x96f98000, 0xb0178000, 0xb4200007, + 0x5efeb814, 0x96f70001, 0xb0170001, 0xb4000003, + 0x9b180180, 0x83060081, 0xb50000a2, 0x96b500f3, + 0x9ab50008, 0x9739fff3, 0x96d40020, 0xb0160020, + 0xb4200019, 0x82c7001f, 0x82c600c9, 0x9b398000, + 0x82c70000, 0x02dfb017, 0x96d40010, 0x5ac8b816, + 0x82f300ff, 0x9af7cfff, 0x1718b817, 0x1b18b816, + 0x9b180340, 0x82c5009d, 0x96d6ffff, 0x82f33800, + 0x9af78001, 0x1af7b816, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82f3c800, 0x9af78001, + 0x82e6009d, 0xb500005f, 0x97397fff, 0x96b500ff, + 0x5aaab815, 0x82f300fc, 0x9af703ff, 0x1718b817, + 0x1b18b815, 0x9b180340, 0x82c5009a, 0x96d60010, + 0xb0160010, 0xb4200027, 0x82c70000, 0x02dfb017, + 0x82c50086, 0x92d60bb8, 0x82c60086, 0x82c50094, + 0x5eefb818, 0x96f70003, 0xb0170003, 0xb4200002, + 0x82e70bb8, 0xb5000001, 0x82e70bb8, 0x12d6b817, + 0x82e50081, 0x9af70020, 0x82e60081, 0x82c60094, + 0xa2f70020, 0x82e60081, 0x82f30001, 0x16f7b818, + 0x5ef0b817, 0xb0170001, 0xb4000004, 0x96f84000, + 0x5ee4b817, 0x9718f3ff, 0x1b18b817, 0x82f32800, + 0x9af78000, 0x82e6009d, 0x83060081, 0x83070001, + 0x8306009f, 0x8305009c, 0xb0180001, 0xb4e0fffb, + 0xb50000f6, 0x82c5009d, 0x82f33800, 0x9af78001, + 0x3016b817, 0xb420000f, 0x82b3c800, 0x9ab58001, + 0x82e500c1, 0x96f7000f, 0xb017000b, 0xb4000002, + 0x82b38800, 0x9ab58001, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82b3c800, 0x9ab58001, + 0x82a6009d, 0x82c5009a, 0x96d60080, 0xb0160080, + 0xb4000013, 0x02df9017, 0x00000000, 0xb0160010, + 0xb480000f, 0x82c500c1, 0x96d6000f, 0xb016000b, + 0xb400000b, 0x82c50087, 0x96d60080, 0x5ac7b816, + 0x82c50098, 0x96d60800, 0x5ac3b816, 0x96f84000, + 0x3017b816, 0xb4200002, 0x033f400f, 0x9b394000, + 0x9739bfff, 0x82e50061, 0x96f70008, 0xb0170008, + 0xb4000005, 0x5eefb818, 0x96f70003, 0xb0170003, + 0xb4000001, 0x9718ffff, 0x96b41800, 0xb0151800, + 0xb4000008, 0x5eb9b814, 0x96b5000f, 0x82c50099, + 0x5ed0b816, 0x96f6000f, 0x5ab0b815, 0x82a60099, + 0xb5000002, 0x5ef9b814, 0x96f7000f, 0x5aecb817, + 0x82c5009a, 0x96d60fff, 0x1ad6b817, 0x82c6009a, + 0x96b46000, 0xb0156000, 0xb4200005, 0x5ae2b817, + 0x82d30ffc, 0x9ad63fff, 0x1718b816, 0x1b18b817, + 0x83060081, 0x83070001, 0x8306009f, 0x8305009c, + 0xb0180001, 0xb4e0fffb, 0x00000000, 0xb500009f, + 0x82850083, 0x96b400ff, 0xb015003c, 0xb4200019, + 0x96b92000, 0xb0152000, 0xb4000002, 0x9b392000, + 0xb5000014, 0x9739d3ff, 0x82870000, 0x82860087, + 0x82870008, 0x82860083, 0x829bff78, 0x82a7001f, + 0xb0140400, 0xb4000001, 0x82a70010, 0x82a600c9, + 0x829bff78, 0x00000000, 0x828600cb, 0x8285009d, + 0x82b3ffff, 0x9ab5fffd, 0x1694b815, 0x8286009d, + 0xb5000000, 0x83070002, 0x8306009f, 0x00000000, + 0xb500007e, 0x83078000, 0x8306009f, 0x00000000, + 0xb500007a, 0x82850094, 0x82a50086, 0x06b5b814, + 0x02b6b815, 0xb0151700, 0xb440004c, 0x8285006c, + 0x969400ff, 0xb0140024, 0xb4000019, 0xb0140012, + 0xb4000017, 0x8285009a, 0x5eedb814, 0x96f70003, + 0xb0170003, 0xb4000009, 0x82a50083, 0x5ea8b815, + 0x96b500ff, 0xb0150020, 0xb4400002, 0x82c70bbc, + 0xb5000001, 0x82c70bb8, 0xb5000008, 0x82a50083, + 0x5ea8b815, 0x96b500ff, 0xb0150020, 0xb4400002, + 0x82c71199, 0xb5000001, 0x82c71197, 0xb5000017, + 0xb500002e, 0x8285009a, 0x5eedb814, 0x96f70003, + 0xb0170003, 0xb4000009, 0x82a50083, 0x5ea8b815, + 0x96b500ff, 0xb0150020, 0xb4400002, 0x82c70e12, + 0xb5000001, 0x82c70e0e, 0xb5000008, 0x82a50083, + 0x5ea8b815, 0x96b500ff, 0xb0150020, 0xb4400002, + 0x82c70e12, 0xb5000001, 0x82c70e0e, 0x82e50086, + 0x12f7b816, 0x02bf9017, 0xb0150020, 0xb480000b, + 0x82a5009a, 0x96b56000, 0xb0156000, 0xb4000007, + 0x82a50098, 0x96d50a00, 0xb0160a00, 0xb4000002, + 0xb0160000, 0xb4200001, 0x92f705dc, 0x82850081, + 0x9ab40020, 0x82a60081, 0x82c50094, 0x82e60094, + 0x82860081, 0x86b705dc, 0x82a6009b, 0x83070008, + 0x8306009f, 0x00000000, 0xb5000024, 0x83070100, + 0x8306009f, 0x00000000, 0xb5000020, 0x83070000, + 0x83050081, 0x9b180180, 0x83060081, 0x83070400, + 0x8306009f, 0x00000000, 0xb5000018, 0x82870000, + 0x82850082, 0x5eb7b814, 0x96b500fc, 0x96d40006, + 0x5ec1b816, 0x1ab5b816, 0x5aacb815, 0x83050081, + 0x82d3001c, 0x9ad600ff, 0x1718b816, 0x1b18b815, + 0x9b180e00, 0x83060081, 0x83074000, 0x8306009f, + 0x8305009d, 0x82d3ffff, 0x9ad6bfff, 0x1718b816, + 0x8306009d, 0x00000000, 0xb5000000, 0x029f9005, + 0x01ffb814, 0x033f600f, 0x029f900a, 0x02bf900b, + 0x02df900c, 0x02ff900d, 0x031f900e, 0x033f900f, + 0x00ffb81e, 0x02ff9010, 0x92f70b43, 0x02ffb010, + 0x02ff90cb, 0x82bbffdc, 0x829bffd8, 0x93150004, + 0x3014b815, 0xb400000f, 0x02dbb818, 0x029bb815, + 0x3017b816, 0xb480000b, 0x5a81b814, 0x029fb010, + 0x82860095, 0x8293001f, 0x9294fe00, 0x92b50008, + 0x3015b814, 0xb4800002, 0x82b3001f, 0x92b5fa00, + 0x82beffdc, 0x82850086, 0x83250094, 0x06d4b819, + 0x02d6b816, 0xb016ffff, 0xb4a00009, 0x82c50081, + 0x9ab60020, 0x82a60081, 0x82a50086, 0x92b50bbb, + 0x82a60094, 0x82c60081, 0x86b505df, 0x82a6009b, + 0x00ffb81c, 0x82870001, 0x829ef500, 0x82850086, + 0x83250094, 0x06d4b819, 0x02d6b816, 0xb016ffff, + 0xb4a0000b, 0x82870001, 0x829ef504, 0x82c50081, + 0x9ab60020, 0x82a60081, 0x82a50086, 0x92b50bbb, + 0x82a60094, 0x82c60081, 0x86b505df, 0x82a6009b, + 0x00ffb81c, 0x82070028, 0x023f9006, 0x83a4ef4f, + 0x80070000, 0x001fb011, 0x001f204f, 0x003fb800, + 0x001f9006, 0x5803b800, 0x80338000, 0x1800b801, + 0x003fb800, 0x005f4193, 0x5c41b802, 0x80350000, + 0x00000000, 0x0027b860, 0x80150010, 0x5810b800, + 0x80750010, 0x1863b800, 0x8087ffff, 0x80a7770b, + 0x80c70000, 0x1403b804, 0x3000b805, 0xb4000008, + 0x5888b804, 0x58a8b805, 0x90c60001, 0xb0060003, + 0xb4a0fff8, 0x84420001, 0xb4e0ffee, 0xb5000027, + 0xb0060003, 0xb4200007, 0x80150010, 0x5810b800, + 0x81150010, 0x950800ff, 0xb0080077, 0xb4000001, + 0xb500fff4, 0x001f400e, 0x98000010, 0x98004000, + 0x9400fffe, 0x001f600e, 0x80e71f40, 0x001f4000, + 0x94000080, 0xb0000080, 0xb4200001, 0x80e77490, + 0x00ffb008, 0x80e70020, 0xb0060000, 0xb400000e, + 0x58e3b806, 0x90210020, 0x81070000, 0x5938b803, + 0x1908b809, 0x9523ff00, 0x5928b809, 0x1908b809, + 0x5d28b803, 0x9529ff00, 0x1908b809, 0x5d38b803, + 0x1908b809, 0x011fb011, 0x00ff204f, 0x80137fff, + 0x9800ffe7, 0x1421b800, 0x5c23b801, 0x001f9006, + 0x0441b800, 0x3001b800, 0xb4600002, 0x0440b801, + 0xa4422000, 0x007f90cb, 0x1063b802, 0x007fb0cb, + 0x003fb006, 0x803effec, 0x80470001, 0x005f2013, + 0xb500ebdf, 0x001f400e, 0x9400000f, 0xb0000000, + 0xb4200001, 0x00ffb81f, 0xb0000001, 0xb4000005, + 0xb0000003, 0xb4000003, 0xb0000002, 0xb4000001, + 0x00ffb81f, 0x80070001, 0x001f2013, 0xb500ebd0, + 0x001f9012, 0x001fb100, 0x001f004c, 0x001f2404, + 0x801bfef0, 0x8058fef4, 0x803bff68, 0x8078ff6c, + 0x2000b801, 0x2042b803, 0x001fb104, 0x005f2414, + 0x82e70001, 0x83640048, 0x029fb014, 0x829efef0, + 0x8286000f, 0x02bf2054, 0x82bcfef4, 0x82a6000e, + 0x00ffb81a, 0x80e70001, 0x801336e3, 0x9800eb76, + 0x001fb100, 0x800700ab, 0x001f2404, 0x801bc3e8, + 0x8058c3ec, 0x83640024, 0x82e70000, 0x83640036, + 0x029fb300, 0x029fb100, 0x02bf2c04, 0x02bf2404, + 0x801bc000, 0x8058c004, 0x8364001b, 0x82e70000, + 0x8364002d, 0x001f9300, 0x3000b814, 0xb420000a, + 0x001f0c04, 0x3000b815, 0xb4200007, 0x829efef0, + 0x82bcfef4, 0x029fb012, 0x02bf204c, 0x82870001, + 0x829cfef5, 0x00ffb81a, 0xb0070000, 0xb4000007, + 0x80e70000, 0x801399fa, 0x9800c92e, 0x001fb100, + 0x800700af, 0x001f2404, 0xb500ffdc, 0x82870000, + 0x829cfef5, 0x00ffb81a, 0x80c700ff, 0x803bff68, + 0x8078ff6c, 0x14a0b806, 0x2063b805, 0x007f2414, + 0x2021b802, 0x58c8b806, 0x14a0b806, 0x58b0b805, + 0x2021b805, 0x58c8b806, 0x14a0b806, 0x2021b805, + 0x58c8b806, 0x14a0b806, 0x5cb0b805, 0x2021b805, + 0x003fb104, 0x00ffb81b, 0x82c70000, 0x83070400, + 0x83270005, 0x8197040c, 0x81d7ffff, 0x83840126, + 0x83840001, 0x00ffb81b, 0x808f0000, 0x806f001f, + 0x80af001f, 0x80270140, 0x81e7ef98, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x80270180, 0x81e7ee90, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x8057ffff, 0x80170430, 0x80070410, + 0x80270408, 0xb6000509, 0x005ff000, 0x90420500, + 0x007ff001, 0x90630600, 0x009ff002, 0x00bff003, + 0x2004a025, 0x90000001, 0x90210001, 0x80070414, + 0x80d7ffff, 0x8097045c, 0x8017043c, 0xb6000404, + 0x005ff000, 0x007f87e0, 0x84000001, 0x2082a7e3, + 0x80970460, 0x80170440, 0x2082b803, 0x007f8000, + 0x2083a004, 0x80170430, 0x80970450, 0x80270408, + 0xb6000508, 0x005f8024, 0x90420500, 0x007ff001, + 0x90630600, 0x009ff002, 0x00bff003, 0x2004a025, + 0x90210001, 0x80170440, 0x00000000, 0x02bf87e0, + 0x80970460, 0x82870000, 0xb6000404, 0x005f87e4, + 0x5a88b814, 0x204287e0, 0x1a94b802, 0x00ffb81c, + 0x001f0a49, 0x001f2709, 0x001f0a41, 0x001f2708, + 0x001f0a46, 0x001f2707, 0x001f0a48, 0x001f2706, + 0x001f0a42, 0x001f2705, 0x001f0a47, 0x001f2704, + 0x001f0a45, 0x001f2703, 0x001f0a43, 0x001f2702, + 0x001f0a40, 0x001f2701, 0x001f0a44, 0x001f2700, + 0x001f0c25, 0xa020000c, 0x94400001, 0x94600002, + 0x94810004, 0x94a10008, 0x94c00010, 0x5943b802, + 0x5861b803, 0x5882b804, 0x5ca2b805, 0x5cc4b806, + 0x194ab803, 0x194ab804, 0x194ab805, 0x194ab806, + 0x015f2738, 0x801bef90, 0x003f91c1, 0x5c28b801, + 0x005f91c2, 0x5858b802, 0x1821b802, 0x2000b801, + 0x001fb1c4, 0x8018ef94, 0x003f0709, 0x2000b801, + 0x001f2714, 0x82c70001, 0x82e70001, 0x83070710, + 0x8327001e, 0x81970735, 0x8384009f, 0x02df0738, + 0x82170a30, 0x838400f1, 0x819efef0, 0x817cfef4, + 0x819eff68, 0x817cff6c, 0x00ffb81b, 0x820f001f, + 0x8018fef8, 0x8057ffff, 0x001f2709, 0x8018fef6, + 0x80d7ffff, 0x001f2708, 0x8018fefa, 0x8157ffff, + 0x001f2707, 0x8018fefd, 0x81d7ffff, 0x001f2706, + 0x8018fefb, 0x802f001f, 0x001f2705, 0x8018fefe, + 0x00000000, 0x001f2704, 0x8018fef9, 0x00000000, + 0x001f2703, 0x8018feff, 0x00000000, 0x001f2702, + 0x8018fef7, 0x00000000, 0x001f2701, 0x8018fefc, + 0x00000000, 0x001f2700, 0x001f0c25, 0xa0200011, + 0x94410001, 0x94600002, 0x94800004, 0x94a00008, + 0x94c10010, 0x5941b802, 0x5861b803, 0x5c82b804, + 0x58a1b805, 0x5cc1b806, 0x194ab803, 0x194ab804, + 0x194ab805, 0x194ab806, 0x015f2738, 0x801bef90, + 0x003f91c1, 0x5c28b801, 0x005f91c2, 0x5858b802, + 0x1821b802, 0x2000b801, 0x001fb1c4, 0x8018ef94, + 0x003f0709, 0x2000b801, 0x001f2714, 0x82c70001, + 0x82e70001, 0x83070710, 0x8327001e, 0x81970735, + 0x83840055, 0x02df0738, 0x82170a20, 0x838400a7, + 0x819efef0, 0x817cfef4, 0x5ac8b80c, 0x02ff0a44, + 0x1ad6b817, 0x02dfb291, 0x5ed8b80c, 0x5968b80b, + 0x1ad6b80b, 0x02df6524, 0x00ffb81b, 0x820f001f, + 0x8018fefe, 0x8057ffff, 0x001f2709, 0x8018fefa, + 0x80d7ffff, 0x001f2708, 0x8018fefc, 0x8157ffff, + 0x001f2707, 0x8018feff, 0x81d7ffff, 0x001f2706, + 0x8018fef8, 0x802f001f, 0x001f2705, 0x8018fefb, + 0x00000000, 0x001f2704, 0x8018fefd, 0x00000000, + 0x001f2703, 0x8018fef6, 0x00000000, 0x001f2702, + 0x8018fef9, 0x00000000, 0x001f2701, 0x8018fef7, + 0x00000000, 0x001f2700, 0x801bef90, 0x003f91c1, + 0x5c28b801, 0x005f91c2, 0x5858b802, 0x1821b802, + 0x2000b801, 0x001fb1c4, 0x8018ef94, 0x003f0709, + 0x2000b801, 0x001f2714, 0x82c70001, 0x82e70001, + 0x83070710, 0x8327001e, 0x81970735, 0x83840016, + 0x83270000, 0x831bfef0, 0x82f8fef4, 0x02c7b819, + 0x82170a28, 0x83840065, 0x300cb818, 0xb4200002, + 0x300bb817, 0xb4000006, 0x93390001, 0xb0190020, + 0xb480fff6, 0x83270000, 0x833cfef5, 0x00ffb81b, + 0x019fb290, 0x017f2a44, 0x033f2c25, 0x83270001, + 0x833cfef5, 0x00ffb81b, 0x0007b818, 0x90000003, + 0x00000000, 0x015ff000, 0x90000001, 0x5949b80a, + 0x013ff000, 0x194ab809, 0x84000002, 0x994a0100, + 0x017ff000, 0x958b00f8, 0x5981b80c, 0x956b0007, + 0x198cb80b, 0x84000002, 0x998c0008, 0x017ff000, + 0x90000001, 0x5971b80b, 0x198cb80b, 0x017ff000, + 0x5969b80b, 0x198cb80b, 0x81a70000, 0x94d90003, + 0x82a70000, 0xb6260019, 0xb6000818, 0x5df0b80a, + 0x5e02b80a, 0x21efb810, 0x95ef0001, 0x5941b80a, + 0x194ab80f, 0x21efb816, 0x5e18b80c, 0x5e35b80c, + 0x5e54b80c, 0x5e6cb80c, 0x2210b811, 0x2252b813, + 0x2210b812, 0x96100001, 0x5981b80c, 0x198cb810, + 0x2210b817, 0x10afb810, 0x10a5b80d, 0x5da1b805, + 0x94a50001, 0x5aa1b815, 0x1ab5b805, 0x019fa7f5, + 0x5cc2b819, 0xb626001c, 0x82870000, 0xb6000419, + 0xb6000818, 0x5df0b80a, 0x5e02b80a, 0x21efb810, + 0x95ef0001, 0x5941b80a, 0x194ab80f, 0x21efb816, + 0x5e18b80c, 0x5e35b80c, 0x5e54b80c, 0x5e6cb80c, + 0x2210b811, 0x2252b813, 0x2210b812, 0x96100001, + 0x5981b80c, 0x198cb810, 0x2210b817, 0x10afb810, + 0x10a5b80d, 0x5da1b805, 0x94a50001, 0x5a81b814, + 0x1a94b805, 0x019fa7f4, 0x00ffb81c, 0x8257ffff, + 0x808f0000, 0x806f001f, 0x80af001f, 0x80270200, + 0x81e7ec70, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270240, + 0x81e7ed70, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270180, + 0x81e7ee90, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x806f0007, + 0x80af0007, 0x80270280, 0x81e7ee70, 0x5de2b80f, + 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, + 0x01ff90bc, 0xb520ffff, 0x91ef0020, 0x90210020, + 0x80170760, 0x001f0700, 0x001fa020, 0x001f0701, + 0x001fa020, 0x001f0702, 0x001fa020, 0x001f0703, + 0x001fa020, 0x001f0704, 0x001fa000, 0x80970750, + 0x81170770, 0x82a70735, 0x83a40060, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4005c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a70730, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40050, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4004c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a7072b, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40040, 0x83a4004e, + 0xb6000407, 0x86b50001, 0x83a4003c, 0x001f8004, + 0x003f87e8, 0x2080a001, 0x83a40047, 0x00000000, + 0x80970770, 0x80170750, 0x81170750, 0x81970740, + 0x82a70726, 0x001f800c, 0x003f8008, 0x2100a001, + 0x83a4002e, 0x83a4003c, 0xb6000407, 0x86b50001, + 0x83a4002a, 0x001f8004, 0x003f87e8, 0x2080a001, + 0x83a40035, 0x00000000, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a70721, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4001c, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a40018, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a7071c, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4000c, 0x017f87e4, + 0x81870000, 0xb6000406, 0x86b50001, 0x83a40007, + 0x001f87e4, 0x200087e8, 0x5988b80c, 0x198cb800, + 0x021fa02c, 0x021fa00b, 0x00ffb81c, 0x005ff015, + 0x90420600, 0x003f87e0, 0x001ff002, 0x2060b801, + 0x90630800, 0x90960a00, 0x001ff003, 0x003ff004, + 0x20a0b801, 0x90a50900, 0x00000000, 0x001ff005, + 0x009fa000, 0x00ffb81d, 0x001f8004, 0x5c21b800, + 0x5847b800, 0x1821b802, 0x942100ff, 0x2080a7e1, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x015f400e, 0x944a4000, 0xb0024000, 0xb420001a, + 0x954abfff, 0x015f600e, 0x820f001f, 0x802f001f, + 0x81470000, 0x015f23f9, 0x015fb0ba, 0x8057ffff, + 0x80770000, 0x82970400, 0x82d7ffff, 0x82f70000, + 0xb6000702, 0xb6000001, 0x029fa02a, 0x80275480, + 0x005fb801, 0x8033001f, 0x9821c000, 0x803effe0, + 0x90212000, 0x803effe4, 0x80d9ff80, 0x00df6001, + 0x81477508, 0x015fb008, 0x003f0324, 0xb0010000, + 0xb4200076, 0x8344ebe6, 0xb0180000, 0xb4000004, + 0x011f400e, 0x1908b818, 0x011f600e, 0x00ffb81f, + 0x8344f18f, 0xb00b0000, 0xb4000006, 0x023f400e, + 0x9a310002, 0x023f600e, 0x82270000, 0x023f2012, + 0x00ffb81f, 0x8364ed72, 0x82270000, 0x023f2011, + 0x80070000, 0x80170800, 0xb6002002, 0xb6003001, + 0x001fa020, 0x82270000, 0x003fb811, 0x02bf9006, + 0x5aa3b815, 0x82338000, 0x1a31b815, 0x003fb811, + 0x8067e950, 0x5c62b803, 0x81f50000, 0x019f4193, + 0x0267b80c, 0xadcc0010, 0x80170800, 0x80130000, + 0x9800f872, 0x001fa020, 0x80134e1f, 0x98000001, + 0x001fa020, 0x59d0b80e, 0x81150010, 0x1908b80e, + 0x001fa028, 0x858c0001, 0x5e01b80c, 0x5e25b810, + 0xb6310006, 0xb6002005, 0x81150010, 0x5910b808, + 0x00000000, 0x81350010, 0x1808a029, 0x9630001f, + 0xb0110000, 0xb4000006, 0xb6310005, 0x81150010, + 0x5910b808, 0x00000000, 0x81350010, 0x1808a029, + 0x962c0001, 0xb0110000, 0xb4000003, 0x81150010, + 0x5910b808, 0x001fa028, 0x019f9006, 0x958cffff, + 0x00df4193, 0x58c1b806, 0x118cb806, 0xb00ce000, + 0xb4800002, 0x858ce000, 0x918cc000, 0x8153001f, + 0x118cb80a, 0x819effec, 0x019fb006, 0x015f4193, + 0x5941b80a, 0x019f90cb, 0x118cb80a, 0x019fb0cb, + 0x019f90ba, 0x918c0001, 0x019fb0ba, 0xb00c0002, + 0xb4200016, 0x019f400e, 0x940c8000, 0xb0008000, + 0xb4200012, 0x958c7fff, 0x019f600e, 0x80070000, + 0x800600a0, 0x80073da1, 0x800600a1, 0x801bff60, + 0x00000000, 0x801eff60, 0x00000000, 0x801bff60, + 0x00000000, 0x801eff60, 0x80130001, 0x98003da1, + 0x800600a1, 0x80070001, 0x800600a0, 0x003f0324, + 0x90210001, 0xb0010005, 0xb4a00001, 0x80270000, + 0x003f2324, 0x00ffb81f, 0x00000000, 0x00000000, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815bb3f0, 0x81070000, 0x81270bf4, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x81271800, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a0002e, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200001, + 0x8384fc04, 0x80af001f, 0x808f0002, 0x806f0000, + 0x807bbf34, 0x5d22b80a, 0xb600080a, 0x00cfb803, + 0x013fb0bc, 0x5922b809, 0x01afb809, 0x013f90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x90630020, + 0x91290060, 0x808f0000, 0x813bb3f8, 0x80270001, + 0xb0090001, 0xb4000002, 0x802600a0, 0x803eb3f8, + 0x81270c00, 0xb00a0000, 0xb4000001, 0x81270000, + 0x813eb3f0, 0xb0030800, 0xb4800001, 0x80670200, + 0x807ebf34, 0x80270001, 0x003f2013, 0x00ffb81b, + +}; + +static u32 AC3240Ucode1f8000[] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00020000, 0xffff0005, 0xffffffff, + 0x00050001, 0xffffffff, 0xffffffff, 0x00020000, + 0xffff0005, 0xffffffff, 0x00010000, 0x00050002, + 0xffffffff, 0x00020000, 0x00050003, 0xffffffff, + 0x00010000, 0x00030002, 0xffff0005, 0x00020000, + 0x00040003, 0xffff0005, 0x00010000, 0x00030002, + 0x00050004, 0x0019000d, 0x003d0025, 0x00250019, + 0x00fd003d, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x007fffff, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x007fffff, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00599999, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00599999, + 0x007fffff, 0x00599999, 0x00000000, 0x00599999, + 0x00000000, 0x00000000, 0x00000000, 0x00599999, + 0x00000000, 0x00599999, 0x007fffff, 0x00000000, + 0x00599999, 0x00599999, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00599999, 0x00599999, + 0x007fffff, 0x007fffff, 0x00000000, 0x00599999, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00599999, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x007fffff, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x007fffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x007fffff, 0x00000000, 0x007fffff, 0x00400000, + 0x00200000, 0x00100000, 0x00080000, 0x00040000, + 0x00020000, 0x00010000, 0x00008000, 0x00004000, + 0x00002000, 0x00001000, 0x00000800, 0x00000400, + 0x00000200, 0x00000100, 0x00000080, 0x00000040, + 0x00000020, 0x00000010, 0x00000008, 0x00000004, + 0x00000002, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00010002, + 0x00030002, 0x00030002, 0x00030002, 0x00000000, + 0x00000000, 0x00010001, 0x00020002, 0x4000a000, + 0xe000a000, 0xf000b000, 0xf800b800, 0x005a8279, + 0x004c1bf8, 0x00400000, 0x004c1bf8, 0x005a8279, + 0x00400000, 0x00000000, 0x00400000, 0x03020100, + 0x00000000, 0x00000080, 0x00000020, 0x00000008, + 0x00000000, 0x00000001, 0x00010001, 0x10081000, + 0x10041000, 0x10081004, 0x10081008, 0x10081008, + 0x00000000, 0x00000000, 0x00000000, 0xff80000a, + 0xff80031f, 0xff800b24, 0xff801818, 0xff8029fa, + 0xff8040c9, 0xff805c86, 0xff807d2e, 0xff80a2c1, + 0xff80cd3c, 0xff80fc9f, 0xff8130e8, 0xff816a14, + 0xff81a821, 0xff81eb0e, 0xff8232d6, 0xff827f79, + 0xff82d0f2, 0xff83273e, 0xff83825b, 0xff83e244, + 0xff8446f7, 0xff84b06e, 0xff851ea6, 0xff85919b, + 0xff860949, 0xff8685aa, 0xff8706ba, 0xff878c74, + 0xff8816d3, 0xff88a5d1, 0xff89396a, 0xff89d196, + 0xff8a6e51, 0xff8b0f94, 0xff8bb55a, 0xff8c5f9b, + 0xff8d0e51, 0xff8dc176, 0xff8e7902, 0xff8f34ef, + 0xff8ff535, 0xff90b9cc, 0xff9182ae, 0xff924fd3, + 0xff932132, 0xff93f6c3, 0xff94d07f, 0xff95ae5d, + 0xff969054, 0xff97765b, 0xff98606a, 0xff994e78, + 0xff9a407c, 0xff9b366b, 0xff9c303e, 0xff9d2de9, + 0xff9e2f64, 0xff9f34a4, 0xffa03da0, 0xffa14a4c, + 0xffa25aa0, 0xffa36e8f, 0xffa48610, 0xffa5a118, + 0xffa6bf9c, 0xffa7e191, 0xffa906ec, 0xffaa2fa0, + 0xffab5ba4, 0xffac8aeb, 0xffadbd6a, 0xffaef315, + 0xffb02bdf, 0xffb167be, 0xffb2a6a4, 0xffb3e886, + 0xffb52d56, 0xffb67509, 0xffb7bf92, 0xffb90ce4, + 0xffba5cf2, 0xffbbafb0, 0xffbd050f, 0xffbe5d04, + 0xffbfb780, 0xffc11477, 0xffc273db, 0xffc3d59f, + 0xffc539b4, 0xffc6a00d, 0xffc8089d, 0xffc97355, + 0xffcae027, 0xffcc4f05, 0xffcdbfe2, 0xffcf32af, + 0xffd0a75d, 0xffd21ddf, 0xffd39625, 0xffd51022, + 0xffd68bc7, 0xffd80904, 0xffd987cd, 0xffdb0810, + 0xffdc89c1, 0xffde0cd0, 0xffdf912d, 0xffe116cb, + 0xffe29d9a, 0xffe4258b, 0xffe5ae8f, 0xffe73896, + 0xffe8c392, 0xffea4f74, 0xffebdc2b, 0xffed69aa, + 0xffeef7df, 0xfff086bd, 0xfff21634, 0xfff3a634, + 0xfff536ad, 0xfff6c792, 0xfff858d1, 0xfff9ea5b, + 0xfffb7c22, 0xfffd0e16, 0xfffea026, 0xffffcdbc, + 0xfffe3ba0, 0xfffca995, 0xfffb17ac, 0xfff985f3, + 0xfff7f479, 0xfff6634f, 0xfff4d284, 0xfff34228, + 0xfff1b249, 0xfff022f7, 0xffee9442, 0xffed0638, + 0xffeb78ea, 0xffe9ec67, 0xffe860bd, 0xffe6d5fd, + 0xffe54c35, 0xffe3c374, 0xffe23bcb, 0xffe0b547, + 0xffdf2ff7, 0xffddabec, 0xffdc2933, 0xffdaa7dd, + 0xffd927f6, 0xffd7a98f, 0xffd62cb7, 0xffd4b17b, + 0xffd337ea, 0xffd1c013, 0xffd04a05, 0xffced5ce, + 0xffcd637c, 0xffcbf31d, 0xffca84c1, 0xffc91874, + 0xffc7ae45, 0xffc64641, 0xffc4e078, 0xffc37cf6, + 0xffc21bc9, 0xffc0bcff, 0xffbf60a5, 0xffbe06c9, + 0xffbcaf79, 0xffbb5ac0, 0xffba08ae, 0xffb8b94d, + 0xffb76cac, 0xffb622d8, 0xffb4dbdc, 0xffb397c6, + 0xffb256a2, 0xffb1187d, 0xffafdd62, 0xffaea55f, + 0xffad707e, 0xffac3ecc, 0xffab1054, 0xffa9e523, + 0xffa8bd44, 0xffa798c2, 0xffa677a8, 0xffa55a02, + 0xffa43fdb, 0xffa3293d, 0xffa21634, 0xffa106c9, + 0xff9ffb08, 0xff9ef2fa, 0xff9deeab, 0xff9cee23, + 0xff9bf16c, 0xff9af892, 0xff9a039c, 0xff991295, + 0xff982586, 0xff973c78, 0xff965774, 0xff957683, + 0xff9499ad, 0xff93c0fb, 0xff92ec75, 0xff921c24, + 0xff91500f, 0xff90883f, 0xff8fc4bb, 0xff8f058b, + 0xff8e4ab6, 0xff8d9443, 0xff8ce239, 0xff8c349f, + 0xff8b8b7d, 0xff8ae6d7, 0xff8a46b5, 0xff89ab1e, + 0xff891416, 0xff8881a3, 0xff87f3cc, 0xff876a96, + 0xff86e606, 0xff866621, 0xff85eaed, 0xff85746d, + 0xff8502a6, 0xff84959e, 0xff842d57, 0xff83c9d7, + 0xff836b20, 0xff831138, 0xff82bc20, 0xff826bdc, + 0xff822070, 0xff81d9de, 0xff819829, 0xff815b54, + 0xff812360, 0xff80f051, 0xff80c228, 0xff8098e6, + 0xff80748e, 0xff805521, 0xff803a9f, 0xff80250b, + 0xff801464, 0xff8008ad, 0xff8001e4, 0xff800027, + 0xff800c7e, 0xff802c8f, 0xff806056, 0xff80a7cb, + 0xff8102e4, 0xff817191, 0xff81f3c3, 0xff828964, + 0xff83325f, 0xff83ee98, 0xff84bdf3, 0xff85a04f, + 0xff86958b, 0xff879d7f, 0xff88b804, 0xff89e4ee, + 0xff8b240e, 0xff8c7533, 0xff8dd82a, 0xff8f4cbb, + 0xff90d2ad, 0xff9269c4, 0xff9411c1, 0xff95ca62, + 0xff979365, 0xff996c81, 0xff9b5570, 0xff9d4de4, + 0xff9f5590, 0xffa16c24, 0xffa3914e, 0xffa5c4b8, + 0xffa8060d, 0xffaa54f3, 0xffacb10e, 0xffaf1a03, + 0xffb18f70, 0xffb410f7, 0xffb69e33, 0xffb936c0, + 0xffbbda37, 0xffbe8830, 0xffc14042, 0xffc40201, + 0xffc6cd00, 0xffc9a0d2, 0xffcc7d05, 0xffcf612b, + 0xffd24ccf, 0xffd53f80, 0xffd838c8, 0xffdb3833, + 0xffde3d49, 0xffe14795, 0xffe4569d, 0xffe769e9, + 0xffea80ff, 0xffed9b67, 0xfff0b8a4, 0xfff3d83c, + 0xfff6f9b5, 0xfffa1c91, 0xfffd4056, 0xffff9b78, + 0xfffc7756, 0xfff953c0, 0xfff63130, 0xfff31025, + 0xffeff117, 0xffecd484, 0xffe9bae5, 0xffe6a4b6, + 0xffe39270, 0xffe0848b, 0xffdd7b82, 0xffda77cb, + 0xffd779de, 0xffd48231, 0xffd19138, 0xffcea769, + 0xffcbc535, 0xffc8eb10, 0xffc61969, 0xffc350af, + 0xffc09151, 0xffbddbbb, 0xffbb3059, 0xffb88f92, + 0xffb5f9d0, 0xffb36f78, 0xffb0f0ef, 0xffae7e96, + 0xffac18cf, 0xffa9bff9, 0xffa7746f, 0xffa5368c, + 0xffa306aa, 0xffa0e51e, 0xff9ed23c, 0xff9cce56, + 0xff9ad9bc, 0xff98f4bc, 0xff971f9f, 0xff955aae, + 0xff93a62f, 0xff920266, 0xff906f92, 0xff8eedf3, + 0xff8d7dc4, 0xff8c1f3c, 0xff8ad294, 0xff8997fd, + 0xff886fa8, 0xff8759c3, 0xff865679, 0xff8565f2, + 0xff848852, 0xff83bdbd, 0xff830651, 0xff82622b, + 0xff81d163, 0xff815411, 0xff80ea47, 0xff809416, + 0xff80518b, 0xff8022b1, 0xff80078e, 0x00000475, + 0x000007fe, 0x00000c02, 0x000010a3, 0x000015f5, + 0x00001c08, 0x000022ed, 0x00002ab5, 0x00003371, + 0x00003d32, 0x0000480a, 0x0000540d, 0x0000614b, + 0x00006fda, 0x00007fcd, 0x00009138, 0x0000a431, + 0x0000b8cc, 0x0000cf1f, 0x0000e741, 0x00010148, + 0x00011d4b, 0x00013b61, 0x00015ba2, 0x00017e25, + 0x0001a302, 0x0001ca51, 0x0001f42c, 0x000220a9, + 0x00024fe2, 0x000281f0, 0x0002b6ea, 0x0002eee9, + 0x00032a07, 0x0003685a, 0x0003a9fc, 0x0003ef04, + 0x0004378a, 0x000483a5, 0x0004d36d, 0x000526f7, + 0x00057e5b, 0x0005d9ae, 0x00063904, 0x00069c74, + 0x00070410, 0x00076feb, 0x0007e01a, 0x000854ac, + 0x0008cdb3, 0x00094b40, 0x0009cd61, 0x000a5425, + 0x000adf98, 0x000b6fc8, 0x000c04bf, 0x000c9e87, + 0x000d3d2a, 0x000de0ae, 0x000e891a, 0x000f3674, + 0x000fe8c0, 0x00109fff, 0x00115c34, 0x00121d5d, + 0x0012e37b, 0x0013ae89, 0x00147e84, 0x00155366, + 0x00162d27, 0x00170bbf, 0x0017ef23, 0x0018d748, + 0x0019c421, 0x001ab59f, 0x001babb2, 0x001ca648, + 0x001da54f, 0x001ea8b0, 0x001fb058, 0x0020bc2d, + 0x0021cc18, 0x0022dffd, 0x0023f7c2, 0x00251348, + 0x00263272, 0x00275520, 0x00287b31, 0x0029a482, + 0x002ad0f1, 0x002c0059, 0x002d3294, 0x002e677c, + 0x002f9ee8, 0x0030d8b1, 0x003214ac, 0x003352b0, + 0x00349290, 0x0035d422, 0x00371738, 0x00385ba5, + 0x0039a13b, 0x003ae7cc, 0x003c2f2a, 0x003d7725, + 0x003ebf8d, 0x00400834, 0x004150e9, 0x0042997d, + 0x0043e1c0, 0x00452981, 0x00467092, 0x0047b6c3, + 0x0048fbe3, 0x004a3fc6, 0x004b823b, 0x004cc316, + 0x004e0228, 0x004f3f45, 0x00507a40, 0x0051b2ef, + 0x0052e925, 0x00541cba, 0x00554d85, 0x00567b5e, + 0x0057a61d, 0x0058cd9e, 0x0059f1bb, 0x005b1252, + 0x005c2f3f, 0x005d4863, 0x005e5d9d, 0x005f6ed0, + 0x00607bde, 0x006184ad, 0x00628923, 0x00638927, + 0x006484a3, 0x00657b81, 0x00666daf, 0x00675b19, + 0x006843b1, 0x00692767, 0x006a062d, 0x006adff9, + 0x006bb4c2, 0x006c847d, 0x006d4f27, 0x006e14b8, + 0x006ed52f, 0x006f9089, 0x007046c6, 0x0070f7e9, + 0x0071a3f3, 0x00724aea, 0x0072ecd3, 0x007389b6, + 0x0074219d, 0x0074b490, 0x0075429b, 0x0075cbcc, + 0x00765031, 0x0076cfd8, 0x00774ad3, 0x0077c132, + 0x00783308, 0x0078a068, 0x00790968, 0x00796e1c, + 0x0079ce9a, 0x007a2af9, 0x007a8350, 0x007ad7b8, + 0x007b2849, 0x007b751d, 0x007bbe4c, 0x007c03f1, + 0x007c4625, 0x007c8504, 0x007cc0a8, 0x007cf92c, + 0x007d2eaa, 0x007d613e, 0x007d9101, 0x007dbe10, + 0x007de883, 0x007e1076, 0x007e3603, 0x007e5943, + 0x007e7a4f, 0x007e9942, 0x007eb633, 0x007ed13a, + 0x007eea6f, 0x007f01ea, 0x007f17c0, 0x007f2c08, + 0x007f3ed7, 0x007f5043, 0x007f605e, 0x007f6f3c, + 0x007f7cf1, 0x007f898e, 0x007f9525, 0x007f9fc6, + 0x007fa982, 0x007fb268, 0x007fba86, 0x007fc1eb, + 0x007fc8a4, 0x007fcebe, 0x007fd443, 0x007fd941, + 0x007fddc2, 0x007fe1cf, 0x007fe572, 0x007fe8b4, + 0x007feb9e, 0x007fee36, 0x007ff086, 0x007ff293, + 0x007ff463, 0x007ff5fd, 0x007ff765, 0x007ff8a1, + 0x007ff9b6, 0x007ffaa7, 0x007ffb79, 0x007ffc2f, + 0x007ffccb, 0x007ffd52, 0x007ffdc6, 0x007ffe28, + 0x007ffe7b, 0x007ffec2, 0x007ffefd, 0x007fff2f, + 0x007fff58, 0x007fff7b, 0x007fff97, 0x007fffae, + 0x007fffc0, 0x007fffcf, 0x007fffdb, 0x007fffe4, + 0x007fffec, 0x007ffff1, 0x007ffff6, 0x007ffff9, + 0x007ffffb, 0x007ffffd, 0x007ffffe, 0x007fffff, + 0x007fffff, 0x007fffff, 0x007fffff, 0xff800000, + 0x00000000, 0xffa57d86, 0x005a827a, 0xff89be51, + 0x0030fbc5, 0xffcf043b, 0x007641af, 0xff8275a1, + 0x0018f8b8, 0xffb8e313, 0x006a6d99, 0xff959267, + 0x00471ced, 0xffe70748, 0x007d8a5f, 0xff809dc9, + 0x000c8bd3, 0xffaecc33, 0x0062f202, 0xff8f1d34, + 0x003c56ba, 0xffdad7f4, 0x007a7d05, 0xff8582fb, + 0x0025280c, 0xffc3a946, 0x0070e2cc, 0xff9d0dfe, + 0x005133cd, 0xfff3742d, 0x007f6237, 0xff802778, + 0x000647d9, 0xffaa0a5b, 0x005ed77d, 0xff8c4a14, + 0x0036ba20, 0xffd4e0cb, 0x00788484, 0xff83d604, + 0x001f19f9, 0xffbe31e2, 0x006dca0d, 0xff99307f, + 0x004c3fe0, 0xffed37f0, 0x007e9d56, 0xff8162aa, + 0x0012c810, 0xffb3c020, 0x0066cf81, 0xff9235f3, + 0x0041ce1e, 0xffe0e607, 0x007c29fc, 0xff877b7c, + 0x002b1f35, 0xffc945e0, 0x0073b5ec, 0xffa12883, + 0x0055f5a5, 0xfff9b827, 0x007fd888, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + +}; + +static u32 AC3240Ucode1fe000[] = { + 0x00000000, 0x03020102, 0x05040403, 0x00400040, + 0x00500050, 0x00600060, 0x00700070, 0x00800080, + 0x00a000a0, 0x00c000c0, 0x00e000e0, 0x01000100, + 0x01400140, 0x01800180, 0x01c001c0, 0x02000200, + 0x02800280, 0x03000300, 0x03800380, 0x04000400, + 0x04800480, 0x05000500, 0x00460045, 0x00580057, + 0x00690068, 0x007a0079, 0x008c008b, 0x00af00ae, + 0x00d100d0, 0x00f400f3, 0x01170116, 0x015d015c, + 0x01a201a1, 0x01e801e7, 0x022e022d, 0x02b902b8, + 0x03440343, 0x03d003cf, 0x045b045a, 0x04e604e5, + 0x05720571, 0x00600060, 0x00780078, 0x00900090, + 0x00a800a8, 0x00c000c0, 0x00f000f0, 0x01200120, + 0x01500150, 0x01800180, 0x01e001e0, 0x02400240, + 0x02a002a0, 0x03000300, 0x03c003c0, 0x04800480, + 0x05400540, 0x06000600, 0x06c006c0, 0x07800780, + 0x7b67533f, 0x1513110f, 0x04d80540, 0x04100478, + 0x07000000, 0x0b000900, 0x02b002f0, 0x02300270, + 0x017001f0, 0xf80000f0, 0x01000080, 0x02000180, + 0x03000280, 0x04000380, 0x2725231f, 0x2c2b2a29, + 0x2e2e2d2d, 0x30302f2f, 0x04030201, 0x08070605, + 0x0c0b0a09, 0x100f0e0d, 0x14131211, 0x18171615, + 0x1c1b1a19, 0x2825221f, 0x37312e2b, 0x4f49433d, + 0x796d6155, 0xcdb59d85, 0x0000fde5, 0x3d3e3f40, + 0x393a3b3c, 0x35363738, 0x32333434, 0x2f2f3031, + 0x2c2c2d2e, 0x29292a2b, 0x26262728, 0x23242425, + 0x21212223, 0x1e1f2020, 0x1c1d1d1e, 0x1a1b1b1c, + 0x1819191a, 0x16171718, 0x15151516, 0x13131414, + 0x12121213, 0x10111111, 0x0f0f1010, 0x0e0e0e0f, + 0x0d0d0d0d, 0x0c0c0c0c, 0x0b0b0b0b, 0x0a0a0a0a, + 0x0909090a, 0x08080909, 0x08080808, 0x07070707, + 0x06060707, 0x06060606, 0x05050606, 0x05050505, + 0x04040505, 0x04040404, 0x04040404, 0x03030304, + 0x03030303, 0x03030303, 0x02030303, 0x02020202, + 0x02020202, 0x02020202, 0x02020202, 0x01010202, + 0x01010101, 0x01010101, 0x01010101, 0x01010101, + 0x01010101, 0x01010101, 0x01010101, 0x00000101, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x04d004d0, + 0x04000440, 0x03c003e0, 0x03b003b0, 0x03a003a0, + 0x03a003a0, 0x039003a0, 0x03900390, 0x03800380, + 0x03700370, 0x03600360, 0x03500350, 0x03400340, + 0x03200330, 0x03000310, 0x02f002f0, 0x02f002f0, + 0x03100300, 0x03900340, 0x042003e0, 0x04900460, + 0x046004a0, 0x04400440, 0x08000520, 0x08400840, + 0x04f004f0, 0x04100460, 0x03d003e0, 0x03b003c0, + 0x03a003b0, 0x03a003a0, 0x03a003a0, 0x03900390, + 0x03800390, 0x03800380, 0x03700370, 0x03600360, + 0x03500350, 0x03400340, 0x03100320, 0x02f00300, + 0x02f002f0, 0x030002f0, 0x03500320, 0x03e00390, + 0x04500420, 0x049004a0, 0x04400460, 0x06300480, + 0x08400840, 0x05800580, 0x045004b0, 0x03f00420, + 0x03d003e0, 0x03b003c0, 0x03b003b0, 0x03a003a0, + 0x03a003a0, 0x03a003a0, 0x03a003a0, 0x03900390, + 0x03900390, 0x03800380, 0x03700380, 0x03500360, + 0x03300340, 0x03100320, 0x02f00300, 0x02f002f0, + 0x03100300, 0x03500330, 0x041003c0, 0x04a00470, + 0x04400460, 0x04e00450, 0xffaaaaab, 0x00000000, + 0x00555555, 0xff99999a, 0xffcccccd, 0x00000000, + 0x00333333, 0x00666666, 0xff924925, 0xffb6db6e, + 0xffdb6db7, 0x00000000, 0x00249249, 0x00492492, + 0x006db6db, 0xff8ba2e9, 0xffa2e8ba, 0xffba2e8c, + 0xffd1745d, 0xffe8ba2f, 0x00000000, 0x001745d1, + 0x002e8ba3, 0x0045d174, 0x005d1746, 0x00745d17, + 0xff888889, 0xff99999a, 0xffaaaaab, 0xffbbbbbc, + 0xffcccccd, 0xffddddde, 0xffeeeeef, 0x00000000, + 0x00111111, 0x00222222, 0x00333333, 0x00444444, + 0x00555555, 0x00666666, 0x00777777, 0x08070605, + 0x0c0b0a09, 0x10100e0e, 0x00000010, 0x00000000, + 0x00000010, 0x00000020, 0x00000100, 0x00000110, + 0x00000120, 0x00000200, 0x00000210, 0x00000220, + 0x00001000, 0x00001010, 0x00001020, 0x00001100, + 0x00001110, 0x00001120, 0x00001200, 0x00001210, + 0x00001220, 0x00002000, 0x00002010, 0x00002020, + 0x00002100, 0x00002110, 0x00002120, 0x00002200, + 0x00002210, 0x00002220, 0x00000000, 0x00000010, + 0x00000020, 0x00000030, 0x00000040, 0x00000100, + 0x00000110, 0x00000120, 0x00000130, 0x00000140, + 0x00000200, 0x00000210, 0x00000220, 0x00000230, + 0x00000240, 0x00000300, 0x00000310, 0x00000320, + 0x00000330, 0x00000340, 0x00000400, 0x00000410, + 0x00000420, 0x00000430, 0x00000440, 0x00001000, + 0x00001010, 0x00001020, 0x00001030, 0x00001040, + 0x00001100, 0x00001110, 0x00001120, 0x00001130, + 0x00001140, 0x00001200, 0x00001210, 0x00001220, + 0x00001230, 0x00001240, 0x00001300, 0x00001310, + 0x00001320, 0x00001330, 0x00001340, 0x00001400, + 0x00001410, 0x00001420, 0x00001430, 0x00001440, + 0x00002000, 0x00002010, 0x00002020, 0x00002030, + 0x00002040, 0x00002100, 0x00002110, 0x00002120, + 0x00002130, 0x00002140, 0x00002200, 0x00002210, + 0x00002220, 0x00002230, 0x00002240, 0x00002300, + 0x00002310, 0x00002320, 0x00002330, 0x00002340, + 0x00002400, 0x00002410, 0x00002420, 0x00002430, + 0x00002440, 0x00003000, 0x00003010, 0x00003020, + 0x00003030, 0x00003040, 0x00003100, 0x00003110, + 0x00003120, 0x00003130, 0x00003140, 0x00003200, + 0x00003210, 0x00003220, 0x00003230, 0x00003240, + 0x00003300, 0x00003310, 0x00003320, 0x00003330, + 0x00003340, 0x00003400, 0x00003410, 0x00003420, + 0x00003430, 0x00003440, 0x00004000, 0x00004010, + 0x00004020, 0x00004030, 0x00004040, 0x00004100, + 0x00004110, 0x00004120, 0x00004130, 0x00004140, + 0x00004200, 0x00004210, 0x00004220, 0x00004230, + 0x00004240, 0x00004300, 0x00004310, 0x00004320, + 0x00004330, 0x00004340, 0x00004400, 0x00004410, + 0x00004420, 0x00004430, 0x00004440, 0x00000000, + 0x00000100, 0x00000200, 0x00000300, 0x00000400, + 0x00000500, 0x00000600, 0x00000700, 0x00000800, + 0x00000900, 0x00000a00, 0x00001000, 0x00001100, + 0x00001200, 0x00001300, 0x00001400, 0x00001500, + 0x00001600, 0x00001700, 0x00001800, 0x00001900, + 0x00001a00, 0x00002000, 0x00002100, 0x00002200, + 0x00002300, 0x00002400, 0x00002500, 0x00002600, + 0x00002700, 0x00002800, 0x00002900, 0x00002a00, + 0x00003000, 0x00003100, 0x00003200, 0x00003300, + 0x00003400, 0x00003500, 0x00003600, 0x00003700, + 0x00003800, 0x00003900, 0x00003a00, 0x00004000, + 0x00004100, 0x00004200, 0x00004300, 0x00004400, + 0x00004500, 0x00004600, 0x00004700, 0x00004800, + 0x00004900, 0x00004a00, 0x00005000, 0x00005100, + 0x00005200, 0x00005300, 0x00005400, 0x00005500, + 0x00005600, 0x00005700, 0x00005800, 0x00005900, + 0x00005a00, 0x00006000, 0x00006100, 0x00006200, + 0x00006300, 0x00006400, 0x00006500, 0x00006600, + 0x00006700, 0x00006800, 0x00006900, 0x00006a00, + 0x00007000, 0x00007100, 0x00007200, 0x00007300, + 0x00007400, 0x00007500, 0x00007600, 0x00007700, + 0x00007800, 0x00007900, 0x00007a00, 0x00008000, + 0x00008100, 0x00008200, 0x00008300, 0x00008400, + 0x00008500, 0x00008600, 0x00008700, 0x00008800, + 0x00008900, 0x00008a00, 0x00009000, 0x00009100, + 0x00009200, 0x00009300, 0x00009400, 0x00009500, + 0x00009600, 0x00009700, 0x00009800, 0x00009900, + 0x00009a00, 0x0000a000, 0x0000a100, 0x0000a200, + 0x0000a300, 0x0000a400, 0x0000a500, 0x0000a600, + 0x0000a700, 0x0000a800, 0x0000a900, 0x0000aa00, + 0xff800000, 0xff800000, 0xffb82995, 0xffaf5d75, + 0xffa57d87, 0xff9a6806, 0xff8df708, 0xff800000, + 0xffb82995, 0xffaf5d75, 0xffa57d87, 0xff9a6806, + 0xff8df708, 0xff800000, 0xffb82995, 0xffaf5d75, + 0xffa57d87, 0xff9a6806, 0xff8df708, 0xff800000, + 0xffb82995, 0xffaf5d75, 0xffa57d87, 0xff9a6806, + 0xff8df708, 0xff800000, 0xffb82995, 0xffaf5d75, + 0xffa57d87, 0xff9a6806, 0xff8df708, 0xff800000, + 0xfffb0000, 0xfffcfffc, 0xfffcfffc, 0xfffcfffc, + 0xfffdfffd, 0xfffdfffd, 0xfffdfffd, 0xfffefffe, + 0xfffefffe, 0xfffefffe, 0xffffffff, 0xffffffff, + 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x80050000, 0x000a800f, 0x001e801b, 0x80110014, + 0x00368033, 0x8039003c, 0x802d0028, 0x00228027, + 0x00668063, 0x8069006c, 0x807d0078, 0x00728077, + 0x80550050, 0x005a805f, 0x004e804b, 0x80410044, + 0x00c680c3, 0x80c900cc, 0x80dd00d8, 0x00d280d7, + 0x80f500f0, 0x00fa80ff, 0x00ee80eb, 0x80e100e4, + 0x80a500a0, 0x00aa80af, 0x00be80bb, 0x80b100b4, + 0x00968093, 0x8099009c, 0x808d0088, 0x00828087, + 0x01868183, 0x8189018c, 0x819d0198, 0x01928197, + 0x81b501b0, 0x01ba81bf, 0x01ae81ab, 0x81a101a4, + 0x81e501e0, 0x01ea81ef, 0x01fe81fb, 0x81f101f4, + 0x01d681d3, 0x81d901dc, 0x81cd01c8, 0x01c281c7, + 0x81450140, 0x014a814f, 0x015e815b, 0x81510154, + 0x01768173, 0x8179017c, 0x816d0168, 0x01628167, + 0x01268123, 0x8129012c, 0x813d0138, 0x01328137, + 0x81150110, 0x011a811f, 0x010e810b, 0x81010104, + 0x03068303, 0x8309030c, 0x831d0318, 0x03128317, + 0x83350330, 0x033a833f, 0x032e832b, 0x83210324, + 0x83650360, 0x036a836f, 0x037e837b, 0x83710374, + 0x03568353, 0x8359035c, 0x834d0348, 0x03428347, + 0x83c503c0, 0x03ca83cf, 0x03de83db, 0x83d103d4, + 0x03f683f3, 0x83f903fc, 0x83ed03e8, 0x03e283e7, + 0x03a683a3, 0x83a903ac, 0x83bd03b8, 0x03b283b7, + 0x83950390, 0x039a839f, 0x038e838b, 0x83810384, + 0x82850280, 0x028a828f, 0x029e829b, 0x82910294, + 0x02b682b3, 0x82b902bc, 0x82ad02a8, 0x02a282a7, + 0x02e682e3, 0x82e902ec, 0x82fd02f8, 0x02f282f7, + 0x82d502d0, 0x02da82df, 0x02ce82cb, 0x82c102c4, + 0x02468243, 0x8249024c, 0x825d0258, 0x02528257, + 0x82750270, 0x027a827f, 0x026e826b, 0x82610264, + 0x82250220, 0x022a822f, 0x023e823b, 0x82310234, + 0x02168213, 0x8219021c, 0x820d0208, 0x02028207, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, + 0x00000000, 0xff800000, 0xffa57d86, 0xffa57d86, + 0xffcf043b, 0xff89be51, 0xff89be51, 0xffcf043b, + 0xffe70748, 0xff8275a1, 0xff959267, 0xffb8e313, + 0xffb8e313, 0xff959267, 0xff8275a1, 0xffe70748, + 0xfff3742d, 0xff809dc9, 0xff9d0dfe, 0xffaecc33, + 0xffc3a946, 0xff8f1d34, 0xff8582fb, 0xffdad7f4, + 0xffdad7f4, 0xff8582fb, 0xff8f1d34, 0xffc3a946, + 0xffaecc33, 0xff9d0dfe, 0xff809dc9, 0xfff3742d, + 0xfff9b827, 0xff802778, 0xffa12883, 0xffaa0a5b, + 0xffc945e0, 0xff8c4a14, 0xff877b7c, 0xffd4e0cb, + 0xffe0e607, 0xff83d604, 0xff9235f3, 0xffbe31e2, + 0xffb3c020, 0xff99307f, 0xff8162aa, 0xffed37f0, + 0xffed37f0, 0xff8162aa, 0xff99307f, 0xffb3c020, + 0xffbe31e2, 0xff9235f3, 0xff83d604, 0xffe0e607, + 0xffd4e0cb, 0xff877b7c, 0xff8c4a14, 0xffc945e0, + 0xffaa0a5b, 0xffa12883, 0xff802778, 0xfff9b827, + 0xcbcecdc4, 0xcfcac9c8, 0xc3c6c5cc, 0xc7c2c1c0, + 0x1b1e1d14, 0x1f1a1918, 0x1316151c, 0x17121110, + 0x2b2e2d24, 0x2f2a2928, 0x2326252c, 0x27222120, + 0x3b3e3d34, 0x3f3a3938, 0x3336353c, 0x37323130, + 0x0b0e0d04, 0x0f0a0908, 0x0306050c, 0x07020100, + 0xdbdeddd4, 0xdfdad9d8, 0xd3d6d5dc, 0xd7d2d1d0, + 0xebeeede4, 0xefeae9e8, 0xe3e6e5ec, 0xe7e2e1e0, + 0xfbfefdf4, 0xfffaf9f8, 0xf3f6f5fc, 0xf7f2f1f0, + 0x4b4e4d44, 0x4f4a4948, 0x4346454c, 0x47424140, + 0x9b9e9d94, 0x9f9a9998, 0x9396959c, 0x97929190, + 0xabaeada4, 0xafaaa9a8, 0xa3a6a5ac, 0xa7a2a1a0, + 0xbbbebdb4, 0xbfbab9b8, 0xb3b6b5bc, 0xb7b2b1b0, + 0x8b8e8d84, 0x8f8a8988, 0x8386858c, 0x87828180, + 0x5b5e5d54, 0x5f5a5958, 0x5356555c, 0x57525150, + 0x6b6e6d64, 0x6f6a6968, 0x6366656c, 0x67626160, + 0x7b7e7d74, 0x7f7a7978, 0x7376757c, 0x77727170, + 0x341424c4, 0x3e1e2ece, 0x3d1d2dcd, 0x3b1b2bcb, + 0xb494a444, 0xbe9eae4e, 0xbd9dad4d, 0xbb9bab4b, + 0xf4d4e404, 0xfedeee0e, 0xfddded0d, 0xfbdbeb0b, + 0x74546484, 0x7e5e6e8e, 0x7d5d6d8d, 0x7b5b6b8b, + 0x3c1c2ccc, 0x361626c6, 0x351525c5, 0x331323c3, + 0xbc9cac4c, 0xb696a646, 0xb595a545, 0xb393a343, + 0xfcdcec0c, 0xf6d6e606, 0xf5d5e505, 0xf3d3e303, + 0x7c5c6c8c, 0x76566686, 0x75556585, 0x73536383, + 0x381828c8, 0x3a1a2aca, 0x391929c9, 0x3f1f2fcf, + 0xb898a848, 0xba9aaa4a, 0xb999a949, 0xbf9faf4f, + 0xf8d8e808, 0xfadaea0a, 0xf9d9e909, 0xffdfef0f, + 0x78586888, 0x7a5a6a8a, 0x79596989, 0x7f5f6f8f, + 0x301020c0, 0x321222c2, 0x311121c1, 0x371727c7, + 0xb090a040, 0xb292a242, 0xb191a141, 0xb797a747, + 0xf0d0e000, 0xf2d2e202, 0xf1d1e101, 0xf7d7e707, + 0x70506080, 0x72526282, 0x71516181, 0x77576787, + 0x05040100, 0x15141110, 0x25242120, 0x35343130, + 0x85848180, 0x95949190, 0xa5a4a1a0, 0xb5b4b1b0, + 0xc0408000, 0xe060a020, 0xd0509010, 0xf070b030, + 0xc8488808, 0xe868a828, 0xd8589818, 0xf878b838, + 0xc4448404, 0xe464a424, 0xd4549414, 0xf474b434, + 0xcc4c8c0c, 0xec6cac2c, 0xdc5c9c1c, 0xfc7cbc3c, + 0xc2428202, 0xe262a222, 0xd2529212, 0xf272b232, + 0xca4a8a0a, 0xea6aaa2a, 0xda5a9a1a, 0xfa7aba3a, + 0xc6468606, 0xe666a626, 0xd6569616, 0xf676b636, + 0xce4e8e0e, 0xee6eae2e, 0xde5e9e1e, 0xfe7ebe3e, + 0xc1418101, 0xe161a121, 0xd1519111, 0xf171b131, + 0xc9498909, 0xe969a929, 0xd9599919, 0xf979b939, + 0xc5458505, 0xe565a525, 0xd5559515, 0xf575b535, + 0xcd4d8d0d, 0xed6dad2d, 0xdd5d9d1d, 0xfd7dbd3d, + 0xc3438303, 0xe363a323, 0xd3539313, 0xf373b333, + 0xcb4b8b0b, 0xeb6bab2b, 0xdb5b9b1b, 0xfb7bbb3b, + 0xc7478707, 0xe767a727, 0xd7579717, 0xf777b737, + 0xcf4f8f0f, 0xef6faf2f, 0xdf5f9f1f, 0xff7fbf3f, + 0x1045a3e2, 0x000000f4, 0x263b7333, 0x766b2363, + 0x2b367e3e, 0x7b662e6e, 0x06db93d3, 0x964b0343, + 0x0bd69ede, 0x9b460e4e, 0x825f1757, 0x12cf87c7, + 0x8f521a5a, 0x1fc28aca, 0x00d199d9, 0x90410949, + 0x01d098d8, 0x91400848, 0x24357d3d, 0x74652d6d, + 0x25347c3c, 0x75642c6c, 0x04d59ddd, 0x94450d4d, + 0x05d49cdc, 0x95440c4c, 0x80511959, 0x10c189c9, + 0x81501858, 0x11c088c8, 0x02df97d7, 0x924f0747, + 0x0fd29ada, 0x9f420a4a, 0x865b1353, 0x16cb83c3, + 0x8b561e5e, 0x1bc68ece, 0xa6bbf3b3, 0xf6eba3e3, + 0xabb6febe, 0xfbe6aeee, 0x223f7737, 0x726f2767, + 0x2f327a3a, 0x7f622a6a, 0xa0b1f9b9, 0xf0e1a9e9, + 0xa1b0f8b8, 0xf1e0a8e8, 0x84551d5d, 0x14c58dcd, + 0x85541c5c, 0x15c48ccc, 0xa4b5fdbd, 0xf4e5aded, + 0xa5b4fcbc, 0xf5e4acec, 0x20317939, 0x70612969, + 0x21307838, 0x71602868, 0xa2bff7b7, 0xf2efa7e7, + 0xafb2faba, 0xffe2aaea, 0x00000000, 0x00000000, + +}; + +static u32 AC3240Ucode1fff80[] = { + 0x0000240f, 0x007fffff, 0x007fffff, 0x00000003, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/ac3.h linux.20pre5-ac2/drivers/media/video/ls220/ac3.h --- linux.20pre5/drivers/media/video/ls220/ac3.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/ac3.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,2850 @@ +static u32 AC3Ucode1f1800[] = { + 0xb500000f, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xb5001223, 0x00000000, 0x00000000, 0x00000000, + 0x820f001f, 0x802f001f, 0x80070800, 0x001f6193, + 0x800500d4, 0x8053ffff, 0x9842c7ff, 0x8039ff7c, + 0x1400b802, 0x003f6000, 0x94210007, 0xb0010001, + 0xb4200001, 0x98002800, 0xb0010000, 0xb4200001, + 0x98000800, 0x805300ff, 0x1800b802, 0x800600d4, + 0x8013001f, 0x9020c000, 0x003fb006, 0x803effe0, + 0x803effe8, 0x803effec, 0x9020e000, 0x9021ffe4, + 0x9020fa00, 0x803effd0, 0x803effdc, 0x803effd8, + 0x9020fe00, 0x803effd4, 0x90400000, 0x804600a2, + 0x90421800, 0x804600a3, 0x80134099, 0x98000040, + 0x800600a6, 0x80130000, 0x98003ca1, 0x800600a1, + 0x80050080, 0x98000002, 0x80060080, 0x80070001, + 0x001f2013, 0x001f2324, 0x80070000, 0x001fb0ba, + 0x001f23f9, 0x801eb3f0, 0x80070800, 0x001f600f, + 0x80070000, 0x001f2012, 0x001fb0cb, 0x001fb010, + 0x801efff0, 0x98004000, 0x98008000, 0x001f600e, + 0x83e40137, 0x80070000, 0x801eb3f8, 0x801eff70, + 0x800500a0, 0xb0000001, 0xb4000009, 0x80070001, + 0x800600a0, 0x80050080, 0x98000020, 0x80060080, + 0x9400ffdf, 0x80060080, 0x80070000, 0x800600a0, + 0x81df0004, 0x00000000, 0x00000000, 0x801bfff0, + 0x00000000, 0x940000ff, 0xb0000000, 0xb420004e, + 0x003f400e, 0x94010010, 0xb0000000, 0xb400fff4, + 0x838413d5, 0x003f0013, 0xb0010001, 0xb420003b, + 0x803bffe8, 0x801bffec, 0x00000000, 0x3001b800, + 0xb4600001, 0x90212000, 0x0421b800, 0x005f4193, + 0x5841b802, 0x3001b802, 0xb460000d, 0x80050086, + 0x005f9016, 0xb0020000, 0xb4200002, 0x001fb016, + 0xb500ffdf, 0x0420b802, 0xb0010b50, 0xb4a0ffdc, + 0x80070000, 0x001fb016, 0x83e40101, 0xb500ffd8, + 0x80070000, 0x001fb016, 0x001f400e, 0x9400000f, + 0xb0000000, 0xb4000014, 0xb0000001, 0xb4000010, + 0x003f400e, 0x9421fff0, 0x003f600e, 0x003f9006, + 0x9421ffff, 0x90210004, 0xb001e000, 0xb4800002, + 0x8421e000, 0x9021c000, 0x8013001f, 0x1021b800, + 0x003fb006, 0x003f90cb, 0x90210004, 0x003fb0cb, + 0x83e400f7, 0x83e413b4, 0x8007001f, 0x94000003, + 0x5810b800, 0x83e71aa8, 0x1bffb800, 0x003f9008, + 0x1821b800, 0x00ffb801, 0x83e41407, 0x80270000, + 0x003f2013, 0x8007001f, 0x94000003, 0x5810b800, + 0x83671ad4, 0x1b7bb800, 0x003f9009, 0x1821b800, + 0x00ffb801, 0xb500ffaa, 0x803bffc0, 0x805bffc4, + 0x807bffc8, 0x809bffcc, 0x5828b801, 0x5cb8b802, + 0x1821b805, 0x5848b802, 0x5cb8b803, 0x1842b805, + 0x5868b803, 0x5cb8b804, 0x1863b805, 0x5888b804, + 0x1884b800, 0x803effc0, 0x805effc4, 0x807effc8, + 0x809effcc, 0x003f400e, 0xb0000086, 0xb4400040, + 0xb0000084, 0xb400002a, 0xb0000085, 0xb4000030, + 0xb0000086, 0xb4000032, 0x001f4000, 0x94000080, + 0xb0000080, 0xb400006a, 0x80130000, 0x98003ca1, + 0x005f4000, 0x94420008, 0xb0020008, 0xb4000001, + 0xa0000080, 0x800600a1, 0x8013001f, 0x9040c000, + 0x005fb006, 0x805effe0, 0x805effe8, 0x805effec, + 0x9040e000, 0x805effe4, 0x9040fa00, 0x805effd0, + 0x805effdc, 0x805effd8, 0x9040fe00, 0x805effd4, + 0x80070001, 0x001f2013, 0x80070000, 0x001fb0cb, + 0x001fb010, 0x001f2058, 0x80071fc0, 0x001fb008, + 0x80075fb0, 0x001fb009, 0x98214000, 0xb5000010, + 0x94011000, 0xb0001000, 0xb4200001, 0x9421efff, + 0x98210010, 0xb500000a, 0x80070000, 0x001fb0cb, + 0x83e40097, 0x003f400e, 0x9421ffef, 0xb5000004, + 0x83e40093, 0x003f400e, 0x98211000, 0x9421ffef, + 0x003f600e, 0x80070100, 0x801efff0, 0xb500ff54, + 0xb000008b, 0xb400001c, 0xb000008e, 0xb4000022, + 0xb000008d, 0xb400001c, 0xb000008c, 0xb4000021, + 0xb0000087, 0xb400ffe8, 0xb0000088, 0xb4000014, + 0xb000008a, 0xb4000015, 0xb0000089, 0xb400001d, + 0xb00000a0, 0xb400001f, 0xb00000a1, 0xb4000041, + 0xb00000a2, 0xb400004e, 0xb00000a3, 0xb4000046, + 0xb00000a4, 0xb4000050, 0xb00000a5, 0xb4000054, + 0xb00000a6, 0xb4000058, 0x803efff8, 0xb500ffdd, + 0x9421ffdf, 0xb500ffda, 0xb500ffda, 0x80270100, + 0x803efff8, 0xb500ffd7, 0x80070000, 0x001fb017, + 0xb500ffd4, 0x801bffb0, 0x00000000, 0x001fb003, + 0xb500ffd0, 0x803bff80, 0x00000000, 0x003f6001, + 0xb500ffcc, 0x003f90ba, 0x803efff8, 0xb500ffc9, + 0x80130001, 0x98003da1, 0x800600a1, 0x80070200, + 0x801ebf34, 0x83e40042, 0x8013001f, 0x9840c000, + 0x805effe0, 0x005fb006, 0x805effe8, 0x805effec, + 0x90422000, 0x805effe4, 0x9040fa00, 0x805effd0, + 0x805effdc, 0x805effd8, 0x9040fe00, 0x805effd4, + 0x80070001, 0x001f2013, 0x80070000, 0x001f2324, + 0x001fb0cb, 0x001fb010, 0x001f2058, 0x80077560, + 0x001fb008, 0x80077810, 0x001fb009, 0x98214000, + 0xb500ffa7, 0x80270000, 0x8047fef0, 0x003eb802, + 0x90420004, 0x003eb802, 0x90420004, 0x003eb802, + 0x90420004, 0x003eb802, 0x81df0000, 0x00000000, + 0x00000000, 0x83641491, 0x81df0004, 0xb500ff99, + 0x81df0000, 0x00000000, 0x00000000, 0x8364143b, + 0x81df0004, 0xb500ff93, 0x81df0000, 0x00000000, + 0x00000000, 0x836413f6, 0x81df0004, 0xb500ff8d, + 0x81df0000, 0x00000000, 0x00000000, 0x83441359, + 0x81df0004, 0xb500ff87, 0x81df0000, 0x00000000, + 0x00000000, 0x8344133e, 0x81df0004, 0xb500ff81, + 0x80070000, 0x80470000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6002003, 0xb6003002, 0x001eb802, + 0x90420004, 0x80171000, 0x8057ffff, 0xb6002002, + 0xb6001801, 0x001fa020, 0x81df0004, 0x00ffb81f, + 0x001f4000, 0x94000080, 0xb0000080, 0xb4200001, + 0xb500ffeb, 0xb500000a, 0x80270000, 0x003f2013, + 0x8007001f, 0x94000003, 0x5810b800, 0x83671ea0, + 0x1b7bb800, 0x003f9009, 0x1821b800, 0x00ffb801, + 0x003f0013, 0xb0010001, 0xb420fff3, 0x83a70000, + 0x803bff70, 0x00000000, 0xb0010000, 0xb4000015, + 0x80170300, 0x80070000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6000601, 0x001fa020, 0x83640ce3, + 0x00ff0325, 0x82870000, 0xb6270002, 0x83640228, + 0x92940001, 0x81df0004, 0x001f033b, 0xb0000000, + 0xb4000002, 0x80270000, 0xb5000001, 0x80270001, + 0x003f233b, 0x80270000, 0x003f2013, 0x8007001f, + 0x94000003, 0x5810b800, 0x83671f3c, 0x1b7bb800, + 0x003f9009, 0x1821b800, 0x00ffb801, 0x003f0013, + 0xb0010001, 0xb420fff3, 0x93bd0001, 0xb01d0004, + 0xb480ffd7, 0x803bff70, 0x00000000, 0xb0010000, + 0xb4000005, 0x81df0000, 0x00000000, 0x00000000, + 0x83640c8b, 0x81df0004, 0x00000000, 0x00000000, + 0x00ffb81f, 0x007f90cb, 0x90630400, 0x007fb0cb, + 0x003f9006, 0x9421ffff, 0x90210400, 0xb001e000, + 0xb4800002, 0x8421e000, 0x9021c000, 0x8013001f, + 0x1021b800, 0x003fb006, 0x803effec, 0x00ffb81f, + 0x015f400e, 0x944a4000, 0xb0024000, 0xb4200090, + 0x954abfff, 0x015f600e, 0x820f001f, 0x802f001f, + 0x81470000, 0x015f23f9, 0x829702ec, 0x82d7ffff, + 0x82f70000, 0x81df0000, 0x00000000, 0x00000000, + 0xb6000501, 0x029fa02a, 0x82970400, 0xb6000702, + 0xb6000001, 0x029fa02a, 0x81df0004, 0x8053ff00, + 0x98420000, 0x805ebf14, 0x805ebf18, 0x805ebf1c, + 0x805ebf20, 0x805ebf24, 0x805ebf28, 0x80270000, + 0x003f2328, 0x80275480, 0x005fb801, 0x8033001f, + 0x9821c000, 0x803effe0, 0x90212000, 0x803effe4, + 0x80dbff8c, 0x80fbff90, 0x80debf14, 0x80febf18, + 0x80dbff94, 0x80fbff98, 0x80debf1c, 0x80febf20, + 0x80dbff9c, 0x80fbffa0, 0x80debf24, 0x80febf28, + 0x80dbff84, 0x80e70001, 0x00dfb001, 0x80dbff88, + 0x00ff6191, 0x00dfb002, 0x80dbffb0, 0x80470000, + 0x00dfb003, 0x80d9ff80, 0x005fb0cf, 0x005fb0c6, + 0x00df6001, 0x80470001, 0x005f618f, 0x804700ff, + 0x005f231c, 0x005f231d, 0x80470000, 0x005f204e, + 0x8047e138, 0x5c42b802, 0x814f6300, 0x80cf00a9, + 0x005fb0bc, 0x5842b802, 0x01cfb802, 0x005f90bc, + 0xb520ffff, 0x8067e16c, 0x5c62b803, 0x80270040, + 0x81df0000, 0x00000000, 0x00000000, 0xb6000209, + 0x814fffc0, 0x00cfb801, 0x007fb0bc, 0x5862b803, + 0x01cfb803, 0x007f90bc, 0xb520ffff, 0x90210020, + 0x90630020, 0x81df0004, 0x8047e398, 0x5c42b802, + 0x814fce40, 0x80cf0080, 0x005fb0bc, 0x5842b802, + 0x01cfb802, 0x005f90bc, 0xb520ffff, 0x8047e400, + 0x5c42b802, 0x814f7380, 0x80cf009a, 0x005fb0bc, + 0x5842b802, 0x01cfb802, 0x005f90bc, 0xb520ffff, + 0x8047e43c, 0x5c42b802, 0x814f18c0, 0x80cf00b6, + 0x005fb0bc, 0x5842b802, 0x01cfb802, 0x005f90bc, + 0xb520ffff, 0x80e70000, 0x00ffb0ba, 0x808f0000, + 0x806f001f, 0x80af001f, 0x8027b9fc, 0x5c22b801, + 0x80670700, 0x81df0000, 0x00000000, 0x00000000, + 0xb600080a, 0x00cfb803, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0x0047b86f, 0xb0020001, + 0xb4c0fffd, 0x90210020, 0x90630020, 0x81df0004, + 0x834400d7, 0xb0180000, 0xb4200025, 0x834406dc, + 0x80c70000, 0x00df2324, 0x83640026, 0x83440228, + 0x00df0324, 0x90c60001, 0x00df2324, 0xb0060006, + 0xb4000003, 0x81472228, 0x015fb008, 0x00ffb81f, + 0x00ff90ba, 0x90e70001, 0x00ffb0ba, 0x019f9006, + 0x958cffff, 0x00df4193, 0x58c1b806, 0x118cb806, + 0xb00ce000, 0xb4800002, 0x858ce000, 0x918cc000, + 0x8153001f, 0x118cb80a, 0x819effec, 0x019fb006, + 0x015f4193, 0x5941b80a, 0x019f90cb, 0x118cb80a, + 0x019fb0cb, 0x81472210, 0x015fb008, 0x00ffb81f, + 0x015f400e, 0x194ab818, 0x015f600e, 0x802500a5, + 0x00ffb81f, 0x803bff8c, 0x805bff90, 0x803ebf14, + 0x805ebf18, 0x803bff94, 0x805bff98, 0x803ebf1c, + 0x805ebf20, 0x803bff9c, 0x805bffa0, 0x803ebf24, + 0x805ebf28, 0x80470003, 0x805ebefc, 0x003f0384, + 0x5822b801, 0x9021eb50, 0x005bb801, 0x00000000, + 0xb0020001, 0xb4200002, 0x80470001, 0x805ebefc, + 0x8073ff80, 0x98630000, 0x8027bf14, 0x8047befc, + 0x81df0000, 0x00000000, 0x00000000, 0xb6000609, + 0x009bb801, 0x00000000, 0x00a7b804, 0x6081b804, + 0x3004b803, 0xb4000001, 0x00beb802, 0x90210004, + 0x90420004, 0x81df0004, 0x00ffb81b, 0x00000000, + 0x81150010, 0x00000000, 0x00000000, 0x81350010, + 0x00000000, 0x00000000, 0x81550002, 0x00000000, + 0x015f2380, 0x81550006, 0x00000000, 0x015f2381, + 0x81550005, 0x00000000, 0x015f2382, 0x81550003, + 0x00000000, 0x015f2383, 0x81550003, 0x015f2384, + 0xb00a0001, 0xb4000005, 0x956a0001, 0xb00b0000, + 0xb4000002, 0x81750002, 0x017f2385, 0x956a0004, + 0xb00b0000, 0xb4000002, 0x81750002, 0x017f2386, + 0xb00a0002, 0xb4200003, 0x81750002, 0x00000000, + 0x017f2387, 0x81750001, 0x00000000, 0x017f2388, + 0x81750005, 0x00000000, 0x017f2389, 0x81750001, + 0x017f239f, 0xb00b0001, 0xb4200003, 0x81750008, + 0x5968b80b, 0x017f61c5, 0x81750001, 0x017f238c, + 0xb00b0001, 0xb4200003, 0x81750008, 0x00000000, + 0x017f238d, 0x81750001, 0x017f238e, 0xb00b0001, + 0xb4200005, 0x81750005, 0x00000000, 0x017f238f, + 0x81750002, 0x017f2390, 0xb00a0000, 0xb420001b, + 0x81750005, 0x00000000, 0x017f2391, 0x81750001, + 0x017f23a0, 0xb00b0001, 0xb4200003, 0x81750008, + 0x5968b80b, 0x017f61c9, 0x81750001, 0x017f2394, + 0xb00b0001, 0xb4200003, 0x81750008, 0x00000000, + 0x017f2395, 0x81750001, 0x017f2396, 0xb00b0001, + 0xb4200006, 0x81750005, 0x00000000, 0x017f2397, + 0x81750002, 0x00000000, 0x017f2398, 0x81750001, + 0x00000000, 0x017f2399, 0x81750001, 0x00000000, + 0x017f239a, 0x81750001, 0x017f239b, 0xb00b0001, + 0xb4200003, 0x8175000e, 0x00000000, 0x017f61be, + 0x81750001, 0x017f239c, 0xb00b0001, 0xb4200003, + 0x8175000e, 0x00000000, 0x017f237e, 0x81750001, + 0x017f239d, 0xb00b0001, 0xb4200006, 0x81750006, + 0x017f239e, 0x916b0001, 0x81550008, 0x856b0001, + 0xb4e0fffd, 0x00ffb81c, 0x00000000, 0x00000000, + 0x81470000, 0x015f2385, 0x015f2386, 0x015f2387, + 0x015f238d, 0x015f238f, 0x015f2390, 0x015f2391, + 0x015f2395, 0x015f2396, 0x015f2397, 0x015f2398, + 0x015f61be, 0x015f61bf, 0x82070028, 0x023f9006, + 0x83a40034, 0x83270000, 0x003fb819, 0x003f9006, + 0x5823b801, 0x83338000, 0x1b39b801, 0x003fb819, + 0x00000000, 0x00000000, 0x81550000, 0x8384ff64, + 0x017f0380, 0xad4b0026, 0x013f0381, 0x114ab809, + 0x5941b80a, 0x914ae00c, 0x0199b80a, 0x00000000, + 0x019f6193, 0xb0080b77, 0xb4200010, 0x015f0380, + 0xb00a0003, 0xb4600011, 0xb0090026, 0xb4600013, + 0x017f90ba, 0xb00b0000, 0xb4200002, 0x017f0383, + 0x017f2057, 0x015f0383, 0x017f0057, 0x300ab80b, + 0xb420000e, 0x83070000, 0x00ffb81a, 0x83070800, + 0x031f6193, 0x83070001, 0x00ffb81a, 0x83070800, + 0x031f6193, 0x83070002, 0x00ffb81a, 0x83070800, + 0x031f6193, 0x83070003, 0x00ffb81a, 0x83070003, + 0x00ffb81a, 0x5e02b810, 0x5a02b810, 0x00bf9011, + 0x00df004f, 0xa5260020, 0x81e70000, 0x82471000, + 0x95d1ffff, 0xa5cee000, 0x300eb810, 0xb4600002, + 0x05f0b80e, 0x0207b80e, 0x8267001f, 0x82c70020, + 0x82971000, 0xb0100080, 0xb4800023, 0x5a8bb813, + 0x5aa6b813, 0x1a94b815, 0x01efb812, 0x014fb814, + 0x01cfb811, 0xb520ffff, 0x81df0000, 0x00000000, + 0x00000000, 0xb636000f, 0x81470000, 0x039f8014, + 0xb6000404, 0x5948b80a, 0x957c00ff, 0x194ab80b, + 0x5f88b81c, 0xb0060020, 0xb4200001, 0x80a70000, + 0x64a6b805, 0x68e9b80a, 0x18a5b807, 0x029fa025, + 0x00a7b80a, 0x81df0004, 0x01efb812, 0x014fb814, + 0x01afb811, 0xb520ffff, 0x5ae2b816, 0x1231b817, + 0x0610b817, 0xb500ffda, 0xb0100000, 0xb4000003, + 0x5ec2b810, 0x86760001, 0xb500ffd8, 0xb00f0000, + 0xb4000005, 0x0207b80f, 0x81f3001f, 0x9a2fc000, + 0x81e70000, 0xb500ffcc, 0x015fb011, 0x00ffb81d, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x81d7ffff, + 0x8257ffff, 0x82d7ffff, 0x8357ffff, 0x83d7ffff, + 0x80770000, 0x80f70000, 0x81770000, 0x81f70000, + 0x82770000, 0x82f70000, 0x83770000, 0x83f70000, + 0xaeb40080, 0x808f0000, 0x806f001f, 0x80af001f, + 0xb0140000, 0xb4400014, 0x806f001f, 0x80af001f, + 0x8027b9fc, 0x5c22b801, 0x80670700, 0xb6000208, + 0x00cfb803, 0x003fb0bc, 0x5822b801, 0x01cfb801, + 0x003f90bc, 0xb520ffff, 0x90630020, 0x90210020, + 0x80270000, 0x80171000, 0xb6000303, 0xb6000001, + 0x001fa021, 0x00000000, 0x82670000, 0xb6000268, + 0x80170a00, 0x80970afc, 0x81170b00, 0x81970bfc, + 0x80271c00, 0x1021b813, 0x1021b813, 0x0217b801, + 0x80271ffc, 0x0421b813, 0x0421b813, 0x0297b801, + 0x80270c00, 0x1021b813, 0x1021b813, 0x0317b801, + 0x80270ffc, 0x0421b813, 0x0421b813, 0x0397b801, + 0x80478500, 0x1042b813, 0x5c42b802, 0x1022b815, + 0x80670280, 0x00cfb803, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0xb520ffff, 0x009f033b, + 0x80478480, 0x0442b813, 0x5c42b802, 0x1022b815, + 0x806702a0, 0x00cfb803, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0xb520ffff, 0xb0040000, + 0xb4000002, 0x80479000, 0xb5000001, 0x80479c00, + 0x1042b813, 0x5c42b802, 0x1022b815, 0x806702c0, + 0x00cfb803, 0x003fb0bc, 0x5822b801, 0x01cfb801, + 0x003f90bc, 0xb520ffff, 0xb0040000, 0xb4000002, + 0x80479180, 0xb5000001, 0x80479d80, 0x0442b813, + 0x5c42b802, 0x1022b815, 0x806702e0, 0x00cfb803, + 0x003fb0bc, 0x5822b801, 0x01cfb801, 0x003f90bc, + 0xb520ffff, 0x81270000, 0x80370000, 0x80b70000, + 0x81370000, 0x81b70000, 0x82370004, 0x82b7fffc, + 0xb6002016, 0x41498008, 0x51498814, 0x51498814, + 0x51418810, 0x51418810, 0x41818814, 0x0308a02a, + 0x49958820, 0x51898810, 0x51918828, 0x414d8814, + 0x0388a7ec, 0x494d8814, 0x49458810, 0x49458810, + 0x418d8810, 0x0308a02a, 0x49918fec, 0x51858814, + 0x51958fe4, 0x00000000, 0x0388a7ec, 0x92730080, + 0x009f033b, 0x5802b814, 0x90400300, 0x001f9802, + 0x00000000, 0xb0000000, 0xb4200016, 0x80170a00, + 0x80070000, 0xb6002001, 0x001fa020, 0xb0040000, + 0xb4200002, 0x80279000, 0xb5000001, 0x80279c00, + 0xac740080, 0x5c22b801, 0x11e1b803, 0x806f001f, + 0x80af001f, 0xb6000407, 0x80cf0280, 0x01ffb0bc, + 0x59e2b80f, 0x01afb80f, 0x01ff90bc, 0xb520ffff, + 0x91ef0020, 0x007f0320, 0x011f90cd, 0xaca30006, + 0x80c7b004, 0x10a5b814, 0x58a1b805, 0x10a5b806, + 0x0099b805, 0x8027b3dc, 0x5841b804, 0x1021b802, + 0x0159b801, 0x8027b3d0, 0x5841b804, 0x1021b802, + 0x0139b801, 0x80170c00, 0x0097b80a, 0xb0090000, + 0xb4200004, 0xb6000002, 0x015f8020, 0x009fe0ca, + 0xb5000004, 0x015fc024, 0xb6000002, 0x015f8020, + 0x009fe0ca, 0x00ffb81b, 0x00000000, 0x00000000, + 0x009f0011, 0x015f0012, 0xb0060000, 0xb4200007, + 0x968a0001, 0xb0140000, 0xb400000d, 0x80870001, + 0x009f2011, 0x954a0002, 0x015f2012, 0xb0060002, + 0xb4200007, 0x968a0002, 0xb0140000, 0xb4000004, + 0x80870001, 0x009f2011, 0x81470000, 0x015f2012, + 0x83640037, 0x00bf2010, 0xb0060000, 0xb4200003, + 0xb0050000, 0xb4200001, 0x836400a1, 0xb0050000, + 0xb4200001, 0x836400ca, 0x00bf0010, 0xb0050000, + 0xb420000a, 0x81df0000, 0x00000000, 0x00000000, + 0x836409e4, 0x836402f6, 0x00000000, 0x8364098c, + 0x81df0004, 0x00000000, 0xb5000009, 0x00bf0010, + 0xb0050001, 0xb4000006, 0x00000000, 0x81df0000, + 0x00000000, 0x00000000, 0x83640981, 0x81df0004, + 0x00ff0325, 0x82870000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6270002, 0x8364fef5, 0x92940001, + 0x81df0004, 0x80070001, 0x801eff70, 0x001f0010, + 0xb0000001, 0xb4000007, 0x001f033b, 0xb0000000, + 0xb4000002, 0x80270000, 0xb5000001, 0x80270001, + 0x003f233b, 0x00ffb81a, 0x00000000, 0x00000000, + 0x027f4001, 0x5e2ab813, 0x96310003, 0x81c70000, + 0x820700ff, 0xb0110000, 0xb4000005, 0x5a21b811, + 0x81c70200, 0x8207000e, 0x69d1b80e, 0x1210b811, + 0x01dfb0cd, 0x5e2cb813, 0x96310003, 0x023f2323, + 0x5e28b813, 0x96310003, 0x023f2322, 0x5e27b813, + 0x96310001, 0x023f2328, 0x5e23b813, 0x96310001, + 0x023f2321, 0x95f30007, 0x01ff2320, 0x920fe004, + 0x0258b810, 0x00000000, 0x1252b811, 0x025f2325, + 0x8167befc, 0x017f6195, 0x021f031c, 0x01df031d, + 0x3010b80f, 0xb4200003, 0x3011b80e, 0xb4200001, + 0xb5000025, 0x80270000, 0x80471000, 0x0017b802, + 0x8057ffff, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002001, 0x001fa021, 0x80270400, 0x80679000, + 0x5c62b803, 0xb6001809, 0x00cfb801, 0x007fb0bc, + 0x5862b803, 0x01afb803, 0x007f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x80679c00, + 0x5c62b803, 0xb6001809, 0x00cfb801, 0x007fb0bc, + 0x5862b803, 0x01afb803, 0x007f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x81df0004, + 0x01ff231c, 0x023f231d, 0x83970300, 0x82070000, + 0x81df0000, 0x00000000, 0x00000000, 0xb6320001, + 0x039fa030, 0x81df0004, 0x00bf0010, 0x021f0324, + 0xb0100000, 0xb4200001, 0x80a70000, 0xb0050000, + 0xb4200008, 0xb0040000, 0xb4a00002, 0x80a70001, + 0xb5000004, 0x82070000, 0x021f204e, 0xb4000001, + 0x80a70002, 0xb0050001, 0xb4200007, 0x021f004e, + 0xb0100002, 0xb4a00002, 0x80a70002, 0x00ffb81b, + 0x92100001, 0x021f204e, 0x00000000, 0x00ffb81b, + 0x81530000, 0x003fb80a, 0x00000000, 0x00000000, + 0x003fb819, 0x00000000, 0x00000000, 0x81550000, + 0x8384fd63, 0x81470000, 0x015f61ee, 0x015f61ef, + 0x015f23a4, 0x8297050c, 0x82d7ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6000501, 0x029fa02a, + 0x81df0004, 0x8167e004, 0x116b0384, 0x0158b80b, + 0x019f0382, 0x015f237b, 0x017f0388, 0x116bb80a, + 0xb00c0008, 0xb4a00003, 0x80a70003, 0x00bf2010, + 0x00ffb81b, 0xb00a0005, 0xb4400003, 0xb00b0006, + 0xb4400001, 0x00ffb81b, 0x80a70004, 0x00bf2010, + 0x00ffb81b, 0x00000000, 0x00000000, 0x00000000, + 0x027f0388, 0x02bf037b, 0x02df0384, 0x02ff03a1, + 0x82970400, 0x8257ffff, 0x82d7ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6350003, 0x81550001, + 0x8357ffff, 0x029fa02a, 0x82970414, 0xb6350003, + 0x81550001, 0x83d7ffff, 0x029fa02a, 0x81df0004, + 0x81550001, 0xb00a0001, 0xb4200004, 0x814d0008, + 0x6149b80a, 0x954affff, 0x015f61ee, 0xb0160000, + 0xb4200007, 0x81550001, 0xb00a0001, 0xb4200004, + 0x814d0008, 0x6149b80a, 0x954affff, 0x015f61ef, + 0x81550001, 0xb00a0001, 0xb4200042, 0x82f50001, + 0x02ff23a1, 0xb0170001, 0xb4200034, 0x82970428, + 0x81df0000, 0x00000000, 0x00000000, 0xb6350003, + 0x81550001, 0x00000000, 0x029fa02a, 0x81df0004, + 0x82970428, 0x81470000, 0x017f8034, 0xb00b0001, + 0xb4000004, 0x914a0001, 0x300ab815, 0xb480fffa, + 0xb5000001, 0x015f23a5, 0x81670000, 0xb0160002, + 0xb4200002, 0x81750001, 0x00000000, 0x017f233a, + 0x81550004, 0xadaa000c, 0x015f23a2, 0x81750004, + 0x916b0003, 0x017f23a3, 0x91ad0025, 0x01bf23a6, + 0xadab000c, 0x81e70000, 0x91ad0025, 0x01bf23a7, + 0x920a0001, 0x05abb810, 0xb00d0000, 0xb4000015, + 0x81df0000, 0x00000000, 0x00000000, 0xb62d0004, + 0x81b50001, 0x65b0b80d, 0x19efb80d, 0x92100001, + 0x81df0004, 0x01ffb0be, 0xb500000a, 0x81a70000, + 0x82970428, 0x81df0000, 0x00000000, 0x00000000, + 0xb6350001, 0x029fa02d, 0x81df0004, 0x01bf233a, + 0x01bf23a5, 0x82070000, 0x82270000, 0x82170428, + 0x81df0000, 0x00000000, 0x00000000, 0xb635003a, + 0x01bf8030, 0xb00d0001, 0xb4200036, 0x81d50001, + 0x65b1b80e, 0x1a10b80d, 0xb00e0001, 0xb4200031, + 0x81b50002, 0xadad0003, 0xae510048, 0x91cd000f, + 0x91320868, 0x015f03a2, 0xad4a0004, 0x92920700, + 0x1189b80a, 0x0297b80c, 0x1194b80a, 0x0317b80c, + 0x01ff90be, 0x015f03a2, 0x017f03a3, 0x064bb80a, + 0x0107b80a, 0xb0120000, 0xb400001e, 0xb632001d, + 0x6928b80f, 0x95290001, 0xb0090000, 0xb420000e, + 0x81350004, 0x1129b80d, 0x029fa029, 0x824d0004, + 0x5a48b812, 0x5e48b812, 0x3009b80e, 0xb4200002, + 0x5e41b812, 0xb500000d, 0x5e42b812, 0x81330040, + 0x1a52b809, 0xb5000009, 0x0127b854, 0x85290004, + 0x0397b809, 0x0287b858, 0x86940004, 0x013f803c, + 0x0397b814, 0x029fa029, 0x025f803c, 0x031fa032, + 0x91080001, 0x92310001, 0x81df0004, 0x015f03a2, + 0x017f03a3, 0x013f033a, 0xb0090001, 0xb4200023, + 0x95300002, 0x95900001, 0x1929b80c, 0xb0090000, + 0xb400001e, 0x064bb80a, 0x0107b80a, 0x81df0000, + 0x00000000, 0x00000000, 0xb6320017, 0x6928b80f, + 0x95290001, 0xb0090000, 0xb4200002, 0x81350001, + 0x013f23f8, 0x81a70700, 0x91ad0048, 0x5982b808, + 0x11adb80c, 0x0397b80d, 0x013f03f8, 0xb0090001, + 0xb4200005, 0x019f801c, 0x0196b80c, 0x81b3ff80, + 0x418cb80d, 0xb5000002, 0x019f801c, 0x0196b80c, + 0x039fa00c, 0x91080001, 0x81df0004, 0xb0160002, + 0xb420001e, 0xb0170001, 0xb4200008, 0xb00a0000, + 0xb4200002, 0x81270002, 0xb5000005, 0xb00a0002, + 0xb4400002, 0x81270003, 0xb5000001, 0x81270004, + 0x013f23a9, 0x81950001, 0xb00c0001, 0xb4200011, + 0x81a70000, 0x8397043c, 0x81df0000, 0x00000000, + 0x00000000, 0xb6290006, 0x81150001, 0x039fa028, + 0xb0080001, 0xb4200001, 0x81a70001, 0x00000000, + 0x81df0004, 0x01bf23a8, 0xb5000002, 0x81a70000, + 0x01bf23a8, 0xb0170001, 0xb4200001, 0x81b50002, + 0x82970c20, 0x81df0000, 0x00000000, 0x00000000, + 0xb6350003, 0x81550002, 0x00000000, 0x029fa02a, + 0x81df0004, 0xb0130001, 0xb4200001, 0x81150001, + 0x81c70000, 0x81df0000, 0x00000000, 0x00000000, + 0xb6350014, 0x922e0c20, 0x015ff011, 0xb00a0000, + 0xb400000f, 0x922e0428, 0x015ff011, 0xb00a0001, + 0xb4200005, 0x922e044c, 0x0297b811, 0x015f03a6, + 0x029fa00a, 0xb5000006, 0x81550006, 0xad4a0003, + 0x922e044c, 0x0297b811, 0x914a0049, 0x029fa00a, + 0x91ce0004, 0x81df0004, 0xb0170001, 0xb4200022, + 0xb00d0000, 0xb4000020, 0x852d0001, 0x81470001, + 0x6549b80a, 0xad6a0003, 0x019f03a7, 0x058c03a6, + 0x81270000, 0xb00b0000, 0xb4000005, 0x300cb80b, + 0xb4800003, 0x058cb80b, 0x91290001, 0xb500fffb, + 0x81750004, 0x5961b80b, 0x839704ec, 0x0187b860, + 0x039fa02c, 0x039fa02a, 0x039fa029, 0x039fa02b, + 0xb0090000, 0xb4000007, 0x81df0000, 0x00000000, + 0x00000000, 0xb6290003, 0x81550007, 0x00000000, + 0x00000000, 0x81df0004, 0x81c70000, 0x81df0000, + 0x00000000, 0x00000000, 0xb635002e, 0x922e0c20, + 0x01fff011, 0xb00f0000, 0xb4000029, 0x852f0001, + 0x81470001, 0x6549b80a, 0xad6a0003, 0x922e044c, + 0x025fd811, 0x86520001, 0x0227b812, 0x81270000, + 0xb00b0000, 0xb4000005, 0x3012b80b, 0xb4800003, + 0x0652b80b, 0x91290001, 0xb500fffb, 0x2e09b80b, + 0x00000000, 0x3010b811, 0xb4600001, 0x91290001, + 0xae4e0004, 0x82150004, 0x9232049c, 0x0297b811, + 0x0187b860, 0x029fa02c, 0x029fa02a, 0x029fa029, + 0x029fa030, 0xb0090000, 0xb4000004, 0xb6290003, + 0x81550007, 0x00000000, 0x00000000, 0x82270460, + 0x1231b80e, 0x0217b811, 0x81550002, 0x021fa00a, + 0x91ce0004, 0x81df0004, 0xb0130001, 0xb420000c, + 0xb0080000, 0xb400000a, 0x81550004, 0x839704fc, + 0x0167b860, 0x039fa02b, 0x81670001, 0x039fa02b, + 0x8175000e, 0x81670002, 0x039fa02b, 0x039fa02a, + 0x81150001, 0xb0080001, 0xb420000a, 0x8135000b, + 0x5d2923aa, 0x95490180, 0x5d4723ab, 0x95490060, + 0x5d4523ac, 0x95490018, 0x5d4323ad, 0x95490007, + 0x015f23ae, 0x81350001, 0xb0090001, 0xb420001b, + 0x81350006, 0x013f23af, 0xb0170001, 0xb4200005, + 0x81550004, 0x00000000, 0x015f23b0, 0x81550003, + 0x015f23b1, 0x82970474, 0x83170488, 0x81df0000, + 0x00000000, 0x00000000, 0xb6350004, 0x81550007, + 0x5e83a02a, 0x954a0007, 0x031fa02a, 0x81df0004, + 0xb0130001, 0xb4200005, 0x81750004, 0x00000000, + 0x017f23b2, 0x81750003, 0x017f23b3, 0xb0170001, + 0xb420000b, 0x81b50001, 0xb00d0001, 0xb4200008, + 0x81d50003, 0x59c8b80e, 0x91ce0300, 0x01df61da, + 0x81d50003, 0x59c8b80e, 0x91ce0300, 0x01df61db, + 0x81550001, 0xb00a0001, 0xb4200057, 0xb0170001, + 0xb4200001, 0x81550002, 0x82470000, 0x82270000, + 0x81df0000, 0x00000000, 0x00000000, 0xb6350004, + 0x81750002, 0x6571b80b, 0x92310002, 0x1a52b80b, + 0x81df0004, 0xb0170001, 0xb420001b, 0xb00a0001, + 0xb4200015, 0x81150003, 0x91080001, 0x011f23a4, + 0x829709d0, 0x831709f0, 0x83970060, 0x81df0000, + 0x00000000, 0x00000000, 0xb6280009, 0x81750005, + 0x00000000, 0x029fa02b, 0x81750004, 0x00000000, + 0x031fa02b, 0x81750003, 0x00000000, 0x039fa02b, + 0x81df0004, 0xb5000004, 0xb00a0002, 0xb4800002, + 0x81070000, 0x011f23a4, 0x82270000, 0x81270000, + 0x81df0000, 0x00000000, 0x00000000, 0xb6350025, + 0x6a11b812, 0x92310002, 0x96100003, 0xb0100001, + 0xb4200018, 0xada90020, 0x81750003, 0x920d0520, + 0x0217b810, 0x920d05c0, 0x0297b810, 0x920d0660, + 0x0317b810, 0x5942b809, 0x920a050c, 0x0397b810, + 0x916b0001, 0x039fa02b, 0xb62b0009, 0x81750005, + 0x00000000, 0x021fa02b, 0x81750004, 0x00000000, + 0x029fa02b, 0x81750003, 0x00000000, 0x031fa02b, + 0xb5000007, 0xb0100002, 0xb4800005, 0x59a2b809, + 0x91ad050c, 0x0397b80d, 0x82070000, 0x039fa010, + 0x91290001, 0x81df0004, 0x81550001, 0xb00a0001, + 0xb420000a, 0x81550009, 0xb00a0000, 0xb4000007, + 0x81df0000, 0x00000000, 0x00000000, 0xb62a0003, + 0x82150008, 0x00000000, 0x00000000, 0x81df0004, + 0xb00a0100, 0xb4a0000b, 0x954aff00, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008003, 0x82150010, + 0x00000000, 0x00000000, 0x81df0004, 0x854a0100, + 0xb4e0fff6, 0x00ffb81b, 0x00000000, 0x00000000, + 0x81070000, 0x011f61dc, 0x011f61de, 0x011f61e0, + 0x011f03aa, 0x9108e0f4, 0x0138b808, 0x011f03ab, + 0x013f61ac, 0x9108e0f0, 0x0138b808, 0x011f03ac, + 0x013f61ad, 0x5901b808, 0x9108e0f8, 0x0139b808, + 0x011f03ad, 0x013f61ae, 0x5901b808, 0x9108e100, + 0x0139b808, 0x011f03ae, 0x013f61b0, 0x5901b808, + 0x9108e108, 0x0179b808, 0x013f03af, 0x017f61b1, + 0x02bf037b, 0x82970474, 0xb6350002, 0x015f8034, + 0x1929b80a, 0x011f03a1, 0xb0080001, 0xb4200002, + 0x015f03b0, 0x1929b80a, 0x019f0388, 0xb00c0001, + 0xb4200002, 0x015f03b2, 0x1929b80a, 0x013f61b3, + 0x015f03a8, 0xb00a0001, 0xb420003a, 0x81a70000, + 0x01bf237a, 0x83840056, 0x806f001f, 0x80af001f, + 0x80270300, 0x8067a800, 0x5c62b803, 0xb600080a, + 0x00cfb801, 0x007fb0bc, 0x5862b803, 0x01afb803, + 0x007f90bc, 0x0047b86f, 0xb0020001, 0xb4c0fffd, + 0x90210020, 0x90630020, 0x81a70001, 0x01bf237a, + 0x83840043, 0x838403ce, 0x81a70000, 0x01bf237a, + 0x82470400, 0x01bff012, 0x01bf23fa, 0x83840420, + 0x83840497, 0x83840546, 0x8384059d, 0x806f001f, + 0x80af001f, 0x80270300, 0x8067ac00, 0x5c62b803, + 0xb600080a, 0x00cfb801, 0x007fb0bc, 0x5862b803, + 0x01cfb803, 0x007f90bc, 0x0047b86f, 0xb0020001, + 0xb4c0fffd, 0x90210020, 0x90630020, 0x81a70001, + 0x01bf237a, 0x82470404, 0x015ff012, 0x015f23fa, + 0x83840407, 0x8384047e, 0x8384052d, 0x83840584, + 0xb5000011, 0x81a70000, 0x01bf237a, 0xb635000e, + 0x8384001b, 0x01bf037a, 0xad4d0004, 0x00000000, + 0x914a0400, 0x01bff00a, 0x01bf23fa, 0x838403f8, + 0x8384046f, 0x8384051e, 0x83840575, 0x01df037a, + 0x91ce0001, 0x01df237a, 0x019f0388, 0xb00c0001, + 0xb4200009, 0x02bf037b, 0x02bf237a, 0x838400e8, + 0x82470000, 0x025f23fa, 0x838403e9, 0x83840460, + 0x8384050f, 0x83840566, 0x00ffb81b, 0x00000000, + 0x80770000, 0x80f70000, 0x81770000, 0x81f70000, + 0x82770000, 0x82f70000, 0x83770000, 0x83f70000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x81d7ffff, + 0x8257ffff, 0x82d7ffff, 0x8357ffff, 0x83d7ffff, + 0x017f037a, 0x5a42b80b, 0x01bf03a8, 0xb00d0001, + 0xb4200004, 0x011f9118, 0x013f9119, 0x7929b808, + 0xb5000002, 0x91b20460, 0x013ff00d, 0x91b20340, + 0x0297b80d, 0x00000000, 0x029fa009, 0x01df0384, + 0xb00e0000, 0xb4200005, 0xb00b0001, 0xb4200003, + 0x009f90c6, 0x00bf0391, 0xb5000002, 0x009f90cf, + 0x00bf0389, 0x83a40142, 0x81870000, 0x019f61b5, + 0x019f61b4, 0x5a02b80b, 0x9190044c, 0x01dfd80c, + 0x01df61b6, 0x91900488, 0x01dff00c, 0x59c1b80e, + 0x918ee118, 0x01d9b80c, 0x019f03af, 0x01df61af, + 0x858c000f, 0x5986b80c, 0x91d00474, 0x01bff00e, + 0x59c2b80d, 0x11cc61b2, 0x81870000, 0x019f61b8, + 0x91900414, 0x01dfd80c, 0x01df61b7, 0xadab0010, + 0x00000000, 0x908d049c, 0x83a40191, 0xadcb0020, + 0x5982b80b, 0x908e0520, 0x90ae05c0, 0x90ce0660, + 0x928c050c, 0x00ff9814, 0x83a40169, 0x83a401b8, + 0x017f037a, 0x59c2b80b, 0x918e0428, 0x01fff00c, + 0xb00f0001, 0xb4200081, 0x023f03a5, 0x3011b80b, + 0xb420000f, 0x01c7b860, 0x01dfb0fa, 0x01df41dc, + 0x01df61e8, 0x01df41de, 0x01df61ea, 0x01df41e0, + 0x01df61ec, 0x01df41dd, 0x01df61e9, 0x01df41df, + 0x01df61eb, 0x01df41e1, 0x01df61ed, 0xb5000024, + 0x01c7b860, 0x01dfb0f9, 0x01df41dc, 0x01df61e2, + 0x01df41de, 0x01df61e4, 0x01df41e0, 0x01df61e6, + 0x01df41dd, 0x01df61e3, 0x01df41df, 0x01df61e5, + 0x01df41e1, 0x01df61e7, 0x803f0000, 0x00000000, + 0x00000000, 0x01df90fa, 0x003fb80e, 0x00000000, + 0x00000000, 0x81d50000, 0x00000000, 0x00000000, + 0x01df41e8, 0x01df61dc, 0x01df41ea, 0x01df61de, + 0x01df41ec, 0x01df61e0, 0x01df41e9, 0x01df61dd, + 0x01df41eb, 0x01df61df, 0x01df41ed, 0x01df61e1, + 0x029f03a6, 0x029f236a, 0x029f03a7, 0x029f236c, + 0x027f03a2, 0x92b3e128, 0x0298b815, 0x019f03b0, + 0x029f2368, 0x5982b80c, 0x01df03af, 0x85ce000f, + 0x59c6b80e, 0x11cc61b2, 0x82a70001, 0x02bf61b8, + 0x82a70000, 0x02bf61b9, 0x029f41da, 0x029f61ba, + 0x029f41db, 0x029f61bb, 0x019f03b1, 0x5981b80c, + 0x918ce118, 0x0299b80c, 0xad8b0048, 0x029f61af, + 0x59a2b813, 0x118cb80d, 0x928c0868, 0x029fb0fb, + 0x928c0700, 0x029fb0fc, 0x019f41bc, 0x918c0003, + 0x019f61bc, 0x5a02b80b, 0x91900414, 0x029fd80c, + 0x029f236e, 0x808704ec, 0x83a40121, 0x808709d0, + 0x80a709f0, 0x80c70060, 0x00ff03a4, 0x83a400fc, + 0x83a4014b, 0x021f037a, 0x019f03a5, 0x300cb810, + 0xb4000016, 0x803f0000, 0x00000000, 0x00000000, + 0x01df90f9, 0x003fb80e, 0x00000000, 0x00000000, + 0x81d50000, 0x00000000, 0x00000000, 0x01df41e2, + 0x01df61dc, 0x01df41e4, 0x01df61de, 0x01df41e6, + 0x01df61e0, 0x01df41e3, 0x01df61dd, 0x01df41e5, + 0x01df61df, 0x01df41e7, 0x01df61e1, 0x029f41b6, + 0xa6d40100, 0xaeb40004, 0x81870000, 0x92b50c00, + 0x0397b815, 0xb6360001, 0x039fa02c, 0x00ffb81c, + 0x009f90cf, 0x00bf0389, 0x019f037a, 0x5982b80c, + 0x918c0340, 0x0397b80c, 0x81870000, 0x039fa00c, + 0x83a40083, 0x81870000, 0x019f61b5, 0x019f61b4, + 0x81870007, 0x019f61b6, 0x019f03b3, 0x5981b80c, + 0x918ce118, 0x01b9b80c, 0x019f03af, 0x01bf61af, + 0x858c000f, 0x5986b80c, 0x01bf03b2, 0x59a2b80d, + 0x118cb80d, 0x019f61b2, 0x81870000, 0x019f61b7, + 0x019f61b8, 0x808704fc, 0x83a400d9, 0x80870000, + 0x80a70000, 0x80c70000, 0x80e70000, 0x83a400b4, + 0x83a40103, 0x81470000, 0x81e70c1c, 0x0397b80f, + 0xb600f901, 0x039fa02a, 0x00ffb81c, 0x00000000, + 0x82270000, 0x023f2011, 0x0227b860, 0x023fb0ff, + 0x02bf9006, 0x92350028, 0x8213001f, 0x9210e000, + 0x3011b810, 0xb4800001, 0x86312000, 0x021f4193, + 0x5a01b810, 0x86100028, 0x83a4fa2e, 0x82270000, + 0x003fb811, 0x02bf9006, 0x5aa3b815, 0x82338000, + 0x1a31b815, 0x003fb811, 0x8067e950, 0x5c62b803, + 0x81f50000, 0x80270400, 0x81df0000, 0x00000000, + 0x00000000, 0xb6000409, 0x814fffc0, 0x00cfb801, + 0x007fb0bc, 0x5862b803, 0x01cfb803, 0x007f90bc, + 0xb520ffff, 0x90210020, 0x90630020, 0x81df0004, + 0x82870000, 0x81f50010, 0x019f4193, 0x5d61b80c, + 0x5d43b80c, 0x114ab80b, 0x0187b80a, 0x960cff00, + 0x92100100, 0x858c0001, 0x81df0000, 0x00000000, + 0x00000000, 0xb62c000c, 0x81f50010, 0x5e28b80f, + 0xb6000209, 0x5a48b814, 0x9652ff00, 0x5e68b814, + 0x5981b813, 0x918c1000, 0x01dfd80c, 0x2252b811, + 0x2292b80e, 0x962f00ff, 0x81df0004, 0x81870000, + 0x86100100, 0xb4e0ffec, 0xb00a0000, 0xb4000009, + 0x81670000, 0xb0140000, 0xb4000001, 0x81670001, + 0x017f2012, 0x258a4193, 0x918c0001, 0x81470000, + 0xb500ffde, 0x81670000, 0xb0140000, 0xb4000001, + 0x81670002, 0x116b0012, 0x803f0000, 0x00000000, + 0x00000000, 0x003fb811, 0x00000000, 0x00000000, + 0x81f50000, 0x017f2012, 0x00ffb81a, 0x00000000, + 0x61f4b804, 0x91ef0001, 0x8233003f, 0x9a31ffff, + 0x5a02b804, 0x1610b811, 0x92510001, 0x1a10b812, + 0x029f03fb, 0xb0140001, 0xb4200012, 0x5a21b805, + 0x92b1e910, 0x0299b815, 0x5a22b805, 0x5a90b814, + 0x6290b814, 0x92b1e890, 0x11efb814, 0x029bb815, + 0x8233ff80, 0x3011b814, 0xb4000006, 0x4294b811, + 0x00000000, 0x0288b814, 0x4210b814, 0x00000000, + 0x0208b810, 0x029f9003, 0x82f3007f, 0x9af7ffff, + 0x3017b814, 0xb4000003, 0x4210b814, 0x00000000, + 0x0208b810, 0x82270000, 0x02c7b810, 0xb0160000, + 0xb400000a, 0x1676b812, 0x3013b812, 0xb4000003, + 0x5ac1b816, 0x92310001, 0xb500fffa, 0x81d3ff80, + 0x3010b80e, 0xb4200001, 0x1ad6b80e, 0x05efb811, + 0x027f037a, 0x5a62b813, 0x92730340, 0x0397b813, + 0x023fd813, 0x02dfb0fd, 0x5a30b811, 0x6230b811, + 0x0631b80f, 0x3010b812, 0xb4200001, 0x92310001, + 0x82470000, 0xb0110000, 0xb4800004, 0x82470003, + 0xb0110003, 0xb4400001, 0x0247b811, 0x039fa012, + 0x124f61bc, 0x00ffb81d, 0x00000000, 0x00000000, + 0x83970a10, 0x82070000, 0xb6003201, 0x039fa030, + 0xb0070000, 0xb4000019, 0x029f41b4, 0x0297b804, + 0x0317b805, 0x0397b806, 0xb6270014, 0x12948034, + 0x01df8038, 0xb00e0000, 0xb4a0000e, 0x02bf803c, + 0x5a02b814, 0x91b00a10, 0x0217b80d, 0xb62e0008, + 0x96150003, 0x91f00001, 0xadef0080, 0xb0150004, + 0xb4600001, 0x85ef0280, 0x021fa02f, 0x92940001, + 0xb5000001, 0x021f803c, 0x00000000, 0x00ffb81d, + 0x0397b804, 0x021f036a, 0x027f803c, 0x029f803c, + 0x02bf803c, 0x02df803c, 0x5a22b810, 0x92311000, + 0x0397b811, 0xb0100000, 0xb4200001, 0x039fa036, + 0xb0150000, 0xb4000021, 0x0227b860, 0x023fb0ff, + 0xb520ffff, 0x803f0000, 0x82138000, 0x1a10b813, + 0x003fb810, 0x00000000, 0x00000000, 0x82150000, + 0x00000000, 0xb635000d, 0x82550007, 0x5a42b812, + 0x9212e4b8, 0x025bb810, 0x8227000c, 0xb6000307, + 0x68d1b812, 0x94c6000f, 0x84c60002, 0x12d6b806, + 0xb6340001, 0x039fa036, 0x86310004, 0x803f0000, + 0x82138000, 0x023f90ff, 0x1a31b810, 0x003fb811, + 0x00000000, 0x00000000, 0x82150000, 0x00ffb81d, + 0x00ff41b5, 0x011f41b4, 0x019f41af, 0x01bf41ae, + 0x01df41ba, 0x01ff41bb, 0x82070000, 0x023f0380, + 0x82470000, 0xae310032, 0x029f41b3, 0x5862b807, + 0x90431000, 0x81970ad8, 0x0217b802, 0x90430c00, + 0x0297b802, 0x0317b802, 0x912802a4, 0x007ff009, + 0x58478030, 0x792341b6, 0x0529b807, 0x019fa029, + 0xb0080014, 0xb4800011, 0xa5420c00, 0x031fa02a, + 0x84690001, 0xb4a00011, 0xb623000b, 0x58678030, + 0xa4030c00, 0x031fa020, 0x044ab800, 0x0056b802, + 0x5c41b802, 0xf84200ff, 0x90620100, 0x005ff003, + 0x7d40b80a, 0x114ab802, 0xb5000004, 0xa5420c00, + 0x58478010, 0xa5620c00, 0x031fa02a, 0xb0080016, + 0xb4400043, 0xb0080013, 0xb440002c, 0xb0080006, + 0xb4400024, 0xb0080005, 0xb4400014, 0xb0080002, + 0xb4400006, 0x80440030, 0x015f619c, 0x05cab80c, + 0x05eab80d, 0x066eb810, 0xb500003c, 0x8044002a, + 0x300a419c, 0xb4800001, 0x82470001, 0x015f619c, + 0xb0120001, 0xb4200001, 0xb500001a, 0x05cab80c, + 0x05eab80d, 0x066eb810, 0xb5000030, 0x001f41b6, + 0xb0000007, 0xb4000001, 0x8044001b, 0x300a419c, + 0xb4800001, 0x82470001, 0xb0120001, 0xb4200001, + 0xb500000c, 0x05cab80c, 0x05eab80d, 0x066eb810, + 0xb5000022, 0x80440010, 0x840b0100, 0x300ab800, + 0xb4200001, 0x86100040, 0xb5000002, 0x86100080, + 0xfe100000, 0x046e41ad, 0x042ab80c, 0x7dc1b803, + 0x044f41ac, 0x042ab80d, 0x7de1b802, 0x046eb810, + 0x7e6fb803, 0xb5000011, 0x840b0100, 0x3000b80a, + 0xb4200002, 0x82070180, 0x00ffb802, 0x300ab80b, + 0xb4a00002, 0x86100040, 0xfe100000, 0x00ffb802, + 0x046e41ad, 0x042ab80c, 0x7dc1b803, 0x044f41ac, + 0x042ab80d, 0x7de1b802, 0x7e6eb80f, 0x380a41b0, + 0xb4600003, 0x242a41b0, 0x5c22b801, 0x1273b801, + 0xb0140000, 0xb4200002, 0x80071fe0, 0xb5000016, + 0x1011b808, 0x5801b800, 0x9020e26c, 0x0079b801, + 0x5842b808, 0x90420a10, 0x7c03b813, 0x003f9802, + 0x1000b801, 0x003f41b2, 0x5830b801, 0x6030b801, + 0x0400b801, 0x003f41b1, 0x5830b801, 0x6030b801, + 0x0400b801, 0xfc000000, 0xf8001fe0, 0x94001fe0, + 0x100041b1, 0x9400ffff, 0x8067003f, 0xb6290008, + 0x005f8014, 0x0442b800, 0x9442ffff, 0x5850b802, + 0x6050b802, 0xfc420000, 0x5c45b802, 0x7a82a023, + 0x10e7b809, 0x91080001, 0x300741b6, 0xb420ff6a, + 0x019f61af, 0x01bf61ae, 0x01df61ba, 0x01ff61bb, + 0x00ff41b5, 0x011f41b4, 0x019f41b8, 0x01bf41b7, + 0x01df41dd, 0x01ff41df, 0x021f41e1, 0x027f90fd, + 0x029f41bc, 0x02ff41dc, 0x031f41de, 0x033f41e0, + 0x5822b807, 0x91210c00, 0x0117b809, 0x81970ad8, + 0x91211000, 0x0217b809, 0x91210c00, 0x0317b809, + 0x80170ba0, 0x013f802c, 0xb629005f, 0x003f8038, + 0xb001000e, 0xb440001e, 0xb001000c, 0xb4400054, + 0xb001000a, 0xb4400043, 0xb0010007, 0xb440003c, + 0xb0010005, 0xb440002b, 0xb0010000, 0xb440001a, + 0xb00d0001, 0xb4200010, 0x005f418f, 0xac42bb75, + 0x8073005a, 0x9442ffff, 0x005f618f, 0x95628000, + 0x5848b802, 0xb00b8000, 0xb4200002, 0x8173ff00, + 0x1842b80b, 0x9863827a, 0x4043b802, 0x00000000, + 0x0048b802, 0xb500003f, 0x80470000, 0xb500003d, + 0x8401000f, 0x5c22b800, 0x902102d8, 0x001ff001, + 0x004db800, 0xb5000037, 0x86f70001, 0xb4600005, + 0x80750005, 0x5862b803, 0x9043e44c, 0x01d9b802, + 0x82e70002, 0x5c4cb80e, 0x9462000f, 0x5862b803, + 0x90630200, 0x005f9803, 0x59c4b80e, 0x95ceffff, + 0xb5000028, 0x87180001, 0xb4600005, 0x80750007, + 0x5862b803, 0x9043e4b8, 0x01f9b802, 0x83070002, + 0x5c4cb80f, 0x9462000f, 0x5862b803, 0x9063020c, + 0x005f9803, 0x59e4b80f, 0x95efffff, 0xb5000019, + 0x80750003, 0x5862b803, 0x90630220, 0x005f9803, + 0xb5000014, 0x87390001, 0xb4600005, 0x80750007, + 0x5862b803, 0x9043e6ac, 0x0219b802, 0x83270001, + 0x5c4cb810, 0x9462000f, 0x5862b803, 0x9063023c, + 0x005f9803, 0x5a04b810, 0x9610ffff, 0xb5000005, + 0x80750004, 0x5862b803, 0x90630268, 0x005f9803, + 0x00000000, 0x001fa022, 0x80170ba0, 0xb00c0001, + 0xb4200035, 0x023f90fb, 0x007f9811, 0x025f90fc, + 0x06d4b803, 0x007f9812, 0x4083b813, 0x00000000, + 0x0088b804, 0xb629002b, 0x24368030, 0x9421ffff, + 0x5830b801, 0x6030b801, 0x40448020, 0xb0010020, + 0xb4800003, 0x80470000, 0x80670000, 0xb500000e, + 0xb0010000, 0xb4a00004, 0x82b30080, 0x6aa1b815, + 0x4042b815, 0xb5000008, 0x6c41b802, 0x82a70017, + 0x12b5b801, 0x6875b803, 0x1842b803, 0x00000000, + 0x00000000, 0x00000000, 0x0108a022, 0x007f41b9, + 0x90630001, 0x007f61b9, 0xb003000c, 0xb420000c, + 0x92310004, 0x023fb0fb, 0x007f9811, 0x92520004, + 0x06d4b803, 0x025fb0fc, 0x007f9812, 0x80470000, + 0x4083b813, 0x00000000, 0x0088b804, 0x005f61b9, + 0x00000000, 0xb500001a, 0xb6290019, 0x24348030, + 0x9421ffff, 0x5830b801, 0x6030b801, 0x40538020, + 0xb0010020, 0xb4800003, 0x80470000, 0x80670000, + 0xb500000e, 0xb0010000, 0xb4a00004, 0x82b30080, + 0x6aa1b815, 0x4042b815, 0xb5000008, 0x6c41b802, + 0x82a70017, 0x12b5b801, 0x6875b803, 0x1842b803, + 0x00000000, 0x00000000, 0x00000000, 0x0108a022, + 0x10e7b809, 0x91080001, 0x300741b6, 0xb420ff48, + 0x00ff61b5, 0x011f61b4, 0x01df61dd, 0x01ff61df, + 0x021f61e1, 0x02ff61dc, 0x031f61de, 0x033f61e0, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x81d7ffff, + 0x8257ffff, 0x808f0000, 0x003f9113, 0x005f9114, + 0x7141b802, 0x80cf0700, 0x8027b064, 0x5c22b801, + 0x003fb0bc, 0x5822b801, 0x01cfb801, 0x003f90bc, + 0xb520ffff, 0x80cf0704, 0x8027b06c, 0x5c22b801, + 0x003fb0bc, 0x5822b801, 0x01cfb801, 0x003f90bc, + 0xb520ffff, 0x81e7043c, 0x82071c00, 0x82271c10, + 0x019f03a9, 0x806f001f, 0x80af001f, 0x80270400, + 0x8067a800, 0x5c62b803, 0xb6000808, 0x00cfb801, + 0x007fb0bc, 0x5862b803, 0x01cfb803, 0x007f90bc, + 0xb520ffff, 0x90210020, 0x90630020, 0x81971000, + 0x82170c00, 0xb6000004, 0x003f800c, 0x005f8010, + 0x021fa021, 0x019fa022, 0x00bfd810, 0x003fd811, + 0x70c1b80a, 0x001f980f, 0x91ef0004, 0x92100002, + 0x92310002, 0x5822b805, 0x90411000, 0x0197b802, + 0x90410c00, 0x0217b802, 0x0466b805, 0xb0000000, + 0xb4000005, 0xb6230004, 0x003f8010, 0x005f800c, + 0x1201a022, 0x0581a022, 0x858c0001, 0xb4e0ffea, + 0x80270400, 0x8067ac00, 0x5c62b803, 0xb6000808, + 0x00cfb801, 0x007fb0bc, 0x5862b803, 0x01afb803, + 0x007f90bc, 0xb520ffff, 0x90210020, 0x90630020, + 0x00ffb81c, 0x00000000, 0x00000000, 0x00000000, + 0x808f0000, 0x806f001f, 0x80af001f, 0x003f037a, + 0xb0010000, 0xb4400030, 0x81a7b7fc, 0x5da2b80d, + 0x80670500, 0xb6000208, 0x00cfb803, 0x01bfb0bc, + 0x59a2b80d, 0x01cfb80d, 0x01bf90bc, 0xb520ffff, + 0x90630020, 0x91ad0020, 0x81c7b8fc, 0x5dc2b80e, + 0x80670540, 0xb6000208, 0x00cfb803, 0x01dfb0bc, + 0x59c2b80e, 0x01cfb80e, 0x01df90bc, 0xb520ffff, + 0x90630020, 0x91ce0020, 0x81a7b3fc, 0x5da2b80d, + 0x80670600, 0xb6000408, 0x00cfb803, 0x01bfb0bc, + 0x59a2b80d, 0x01cfb80d, 0x01bf90bc, 0xb520ffff, + 0x90630020, 0x91ad0020, 0x81c7b5fc, 0x5dc2b80e, + 0x80670680, 0xb6000408, 0x00cfb803, 0x01dfb0bc, + 0x59c2b80e, 0x01cfb80e, 0x01df90bc, 0xb520ffff, + 0x90630020, 0x91ce0020, 0x005f03fa, 0xb0020000, + 0xb4000024, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x8257ffff, 0x82d7ffff, 0x8357ffff, + 0x83d7ffff, 0x83971300, 0x83171200, 0x82971100, + 0x82171000, 0x81170c00, 0x81970ff8, 0x80171400, + 0x80971500, 0x005f802c, 0x001f8028, 0xb6004010, + 0x41028000, 0x51008004, 0x007f876c, 0x0208a028, + 0x41008000, 0x49028004, 0x003f8068, 0x0388a028, + 0x41038000, 0x51018004, 0x005f802c, 0x0288a028, + 0x41018020, 0x49038024, 0x001f8028, 0x0308a028, + 0x00ffb81c, 0x83d7ffff, 0x8357ffff, 0x82d7ffff, + 0x8257ffff, 0x8157ffff, 0x81d7ffff, 0x8057ffff, + 0x80d7ffff, 0x82971200, 0x82171000, 0x81170c00, + 0x81970ffc, 0x83171800, 0x83971a00, 0x83370000, + 0x83b70000, 0x81370008, 0x81b7fff8, 0x4119880c, + 0xb6008006, 0x511d8808, 0x41498838, 0x0208a028, + 0x494d883c, 0x4119880c, 0x0288a02a, 0x00ffb81c, + 0x82670000, 0x82a70000, 0x003f037a, 0xb0010000, + 0xb4400018, 0x81a7bdfc, 0x5da2b80d, 0x80670580, + 0xb6000208, 0x00cfb803, 0x01bfb0bc, 0x59a2b80d, + 0x01cfb80d, 0x01bf90bc, 0xb520ffff, 0x90630020, + 0x91ad0020, 0x81a7eb70, 0x5da2b80d, 0x806705c0, + 0xb6000208, 0x00cfb803, 0x01bfb0bc, 0x59a2b80d, + 0x01cfb80d, 0x01bf90bc, 0xb520ffff, 0x90630020, + 0x91ad0020, 0x02bf03fa, 0x808f0000, 0xb0150000, + 0xb4000006, 0x81470040, 0x81670003, 0x81870002, + 0x81a71000, 0x81c71300, 0xb5000005, 0x81470080, + 0x81670004, 0x81870001, 0x81a71000, 0x81c71200, + 0x0017b80d, 0x0097b80e, 0x108db80a, 0x0117b804, + 0x108eb80a, 0x0197b804, 0x5841b80a, 0x108db802, + 0x0217b804, 0x108eb802, 0x0297b804, 0x106ab802, + 0x108db803, 0x0317b804, 0x108eb803, 0x0397b804, + 0x5ea2b80a, 0xb6350020, 0x001f8000, 0x003f8008, + 0x005f8004, 0x007f800c, 0x10c08010, 0x10a18018, + 0x10828014, 0x10e3801c, 0x1246b805, 0x0686b805, + 0x10c4b807, 0x0484b807, 0x80e70000, 0x80a70000, + 0x0008a032, 0x0108a034, 0x0088a026, 0x0188a024, + 0x04c08010, 0x04a18018, 0x04828014, 0x04e3801c, + 0x0646b807, 0x1286b807, 0x10c4b805, 0x0484b805, + 0x80e70000, 0x80a70000, 0x0208a032, 0x0308a034, + 0x0288a026, 0x0388a024, 0x5de1b80a, 0x82070004, + 0xb62b002a, 0x0017b80d, 0x0097b80e, 0x102db80f, + 0x0117b801, 0x104eb80f, 0x0197b802, 0x82171600, + 0x82971700, 0x0037b80f, 0x00b7b80f, 0x0137b80f, + 0x01b7b80f, 0xb630001b, 0x003f8030, 0x005f8034, + 0x5ee2b80f, 0x8013007f, 0x9800ffff, 0xb6370011, + 0x41008000, 0x51018008, 0x4902800c, 0x40c08000, + 0x0008a028, 0x48c18008, 0x50c2800c, 0x42808004, + 0x00c8b806, 0x52828008, 0x5281800c, 0x41008004, + 0x0088a034, 0x49028008, 0x4901800c, 0x011fa026, + 0x0188a028, 0x001f8001, 0x001f8005, 0x001f8009, + 0x001f800d, 0x5de1b80f, 0x5a01b810, 0x0017b80d, + 0x0097b80e, 0x902d0004, 0x0117b801, 0x904e0004, + 0x0197b802, 0x82171600, 0x82971700, 0x5ea1b80a, + 0x8013007f, 0x9800ffff, 0xb6350013, 0x003f8030, + 0x005f8034, 0x42408000, 0x52418008, 0x4a42800c, + 0x41008000, 0x0008a052, 0x49018008, 0x5102800c, + 0x42808004, 0x0108b808, 0x52828008, 0x5281800c, + 0x40c08004, 0x0088a054, 0x48c28008, 0x48c1800c, + 0x011fa048, 0x0188a046, 0x81a71100, 0x81c71200, + 0x858c0001, 0xb4e0ff7e, 0x00ffb81c, 0x00000000, + 0x005f03fa, 0x00000000, 0xb0020000, 0xb4000034, + 0x81b70080, 0x81d7ffff, 0x81f70001, 0x82370080, + 0x8257ffff, 0x82770001, 0x82b70080, 0x82d7ffff, + 0x82f70001, 0x83370080, 0x8357ffff, 0x83770001, + 0x81971000, 0x82171100, 0x82971200, 0x83171300, + 0x815703fc, 0x81370200, 0x81170c00, 0x83d703fc, + 0x83b70200, 0x83970f00, 0x8057ffff, 0x80d7ffff, + 0x80171400, 0x80971500, 0x001f800d, 0x003f8019, + 0xb6004012, 0x41008000, 0x51018004, 0x007f8011, + 0x0128a008, 0x41018000, 0x49008004, 0x009f8015, + 0x03a8a008, 0x41038000, 0x51048004, 0x001f800d, + 0x03a8a008, 0x41048020, 0x49038024, 0x003f8019, + 0x0128a008, 0x005f8028, 0x005f803c, 0x81f70000, + 0x82770000, 0x82f70000, 0x83770000, 0x00ffb81c, + 0x82370040, 0x8257ffff, 0x82770001, 0x82b70040, + 0x82d7ffff, 0x82f70001, 0x82171000, 0x82971200, + 0x8157ffff, 0x81170c00, 0x81d7ffff, 0x81970e00, + 0x8057ffff, 0x80d7ffff, 0x80171800, 0x80971a00, + 0xb600800a, 0x001f8011, 0x003f8015, 0x41008000, + 0x51018004, 0x00000000, 0x0108a028, 0x41018020, + 0x49008024, 0x00000000, 0x0188a028, 0x82770000, + 0x82f70000, 0x00ffb81c, 0x00000000, 0x00000000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x808f0000, + 0x015f0384, 0x017f037a, 0xac4a0006, 0x8027b004, + 0x1042b80b, 0x5841b802, 0x1021b802, 0x0159b801, + 0x013f0325, 0x01bf0320, 0x5822b80b, 0x90210340, + 0x00ff9801, 0x8027b2e8, 0x5842b807, 0x1021b802, + 0x025bb801, 0x80070000, 0xac4d0006, 0x8027b004, + 0x1042b800, 0x5841b802, 0x1021b802, 0x0199b801, + 0x00000000, 0xac4c0006, 0x8027b078, 0x1042b80a, + 0x5842b802, 0x1021b802, 0x011bb801, 0x00000000, + 0x40d2b808, 0x00000000, 0xb0060000, 0xb4000080, + 0x005f033b, 0x80278400, 0xac600080, 0x5c22b801, + 0x10a1b803, 0xb0020000, 0xb4200002, 0x80279000, + 0xb5000001, 0x80279c00, 0x5c22b801, 0x11e1b803, + 0x80470300, 0x5822b800, 0x1042b801, 0x003f9802, + 0x806f001f, 0x80af001f, 0xb0010000, 0xb4200024, + 0x80170c00, 0x80971000, 0x003f8020, 0xb6000003, + 0x4201b806, 0x003f8020, 0x0088a030, 0x80270400, + 0xb6000208, 0x00cfb801, 0x00bfb0bc, 0x58a2b805, + 0x01afb805, 0x00bf90bc, 0xb520ffff, 0x90210020, + 0x90a50020, 0xb6000408, 0x00cfb801, 0x01ffb0bc, + 0x59e2b80f, 0x01afb80f, 0x01ff90bc, 0xb520ffff, + 0x90210020, 0x91ef0020, 0xb6000208, 0x00cfb801, + 0x00bfb0bc, 0x58a2b805, 0x01afb805, 0x00bf90bc, + 0xb520ffff, 0x90210020, 0x90a50020, 0xb5000043, + 0x80270400, 0x0087b805, 0x01c7b80f, 0xb6000208, + 0x00cfb801, 0x009fb0bc, 0x5882b804, 0x01cfb804, + 0x009f90bc, 0xb520ffff, 0x90210020, 0x90840020, + 0xb6000408, 0x00cfb801, 0x01dfb0bc, 0x59c2b80e, + 0x01cfb80e, 0x01df90bc, 0xb520ffff, 0x90210020, + 0x91ce0020, 0xb6000208, 0x00cfb801, 0x009fb0bc, + 0x5882b804, 0x01cfb804, 0x009f90bc, 0xb520ffff, + 0x90210020, 0x90840020, 0x80170c00, 0x80971000, + 0x8053007f, 0x9842ffff, 0xb6000004, 0x42028004, + 0x4a068020, 0x00000000, 0x0088a030, 0x80270400, + 0xb6000208, 0x00cfb801, 0x00bfb0bc, 0x58a2b805, + 0x01afb805, 0x00bf90bc, 0xb520ffff, 0x90210020, + 0x90a50020, 0xb6000408, 0x00cfb801, 0x01ffb0bc, + 0x59e2b80f, 0x01afb80f, 0x01ff90bc, 0xb520ffff, + 0x90210020, 0x91ef0020, 0xb6000208, 0x00cfb801, + 0x00bfb0bc, 0x58a2b805, 0x01afb805, 0x00bf90bc, + 0xb520ffff, 0x90210020, 0x90a50020, 0x5822b800, + 0x90210300, 0x0117b801, 0x80470001, 0x011fa002, + 0x90000001, 0x3000b809, 0xb480ff6b, 0x00ffb81c, + 0x8057ffff, 0x013f0325, 0x015f033b, 0x80171000, + 0x80070000, 0xb6002001, 0x001fa020, 0xb00a0001, + 0xb4c00002, 0x81679000, 0xb5000001, 0x81679c00, + 0x5d62b80b, 0x81878400, 0x5d82b80c, 0x80070000, + 0x5822b800, 0x90410300, 0x003f9802, 0x00000000, + 0xb0010000, 0xb4200019, 0xac400080, 0x00000000, + 0x10ccb802, 0x10abb802, 0x806f001f, 0x80af001f, + 0x80cf0400, 0xb6000408, 0xb520ffff, 0x00dfb0bc, + 0x58c2b806, 0x01afb806, 0x00df90bc, 0xb520ffff, + 0x80cf0400, 0x90c60020, 0x80cf0400, 0xb6000407, + 0x00bfb0bc, 0x58a2b805, 0x01afb805, 0x00bf90bc, + 0xb520ffff, 0x80cf0400, 0x90a50020, 0x90000001, + 0x3000b809, 0xb480ffde, 0x00ffb81b, 0x8057ffff, + 0x013f0325, 0x80171000, 0x80070000, 0xb6002001, + 0x001fa020, 0x81878400, 0x5d82b80c, 0x80070000, + 0x5822b800, 0x90410300, 0x003f9802, 0x00000000, + 0xb0010000, 0xb420000f, 0xac400080, 0x00000000, + 0x10ccb802, 0x806f001f, 0x80af001f, 0x80cf0400, + 0xb6000408, 0xb520ffff, 0x00dfb0bc, 0x58c2b806, + 0x01afb806, 0x00df90bc, 0xb520ffff, 0x80cf0400, + 0x90c60020, 0x90000001, 0x3000b809, 0xb480ffe8, + 0x00ffb81b, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x8139b000, 0x00000000, 0xb0090000, 0xb4000012, + 0x806f001f, 0x80af001f, 0x80cf0400, 0x013fb0bc, + 0x5922b809, 0x01cfb809, 0x013f90bc, 0xb520ffff, + 0x806f0003, 0x80af0003, 0x80cf0420, 0x91290020, + 0x013fb0bc, 0x5922b809, 0x01cfb809, 0x013f90bc, + 0xb520ffff, 0xb5000233, 0x80270000, 0x80171000, + 0xb6002401, 0x001fa021, 0x007f0384, 0x009f0320, + 0x00bf0385, 0x00df0386, 0x80e7b36c, 0x5821b803, + 0x1021b807, 0x0159b801, 0x5821b804, 0x1021b807, + 0x0179b801, 0x80e7b37c, 0x5821b803, 0x1021b807, + 0x0199b801, 0x5821b804, 0x1021b807, 0x01b9b801, + 0x80e7b38c, 0x5821b803, 0x1021b807, 0x01d9b801, + 0x5821b804, 0x1021b807, 0x01f9b801, 0x005f0385, + 0x8027b39c, 0x5842b802, 0x1021b802, 0x021bb801, + 0x005f0386, 0x8027b3ac, 0x5842b802, 0x1021b802, + 0x023bb801, 0x027f0383, 0x003f0328, 0x005f4195, + 0xb0130007, 0xb42000df, 0xb0010000, 0xb42000dd, + 0xb0020000, 0xb40000db, 0xb0030002, 0xb48000d9, + 0x029bb802, 0x82a7b108, 0xb00b0001, 0xb4200001, + 0xb5000005, 0xb00b0002, 0xb4200002, 0x92b500a0, + 0xb5000001, 0x92b50140, 0xb0030004, 0xb4600002, + 0x82870000, 0xb5000006, 0xb0030006, 0xb4600004, + 0xb0140001, 0xb4a00002, 0x82870001, 0xb5000000, + 0xac54000a, 0x806f0009, 0x80af0009, 0x5c22b815, + 0x80cf0440, 0x1021b802, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0xb520ffff, 0xb0030003, + 0xb400000f, 0xb0030004, 0xb400001d, 0xb0030005, + 0xb400002b, 0xb0030006, 0xb4000042, 0xb0030007, + 0xb4000059, 0x80171000, 0x005f9440, 0x001fa002, + 0x80171038, 0x005f9440, 0x001fa002, 0xb5000073, + 0x80171000, 0x005f9440, 0x001fa002, 0x80171004, + 0x005f9443, 0x001fa002, 0x8017101c, 0x005f9446, + 0x001fa002, 0x80171034, 0x005f9449, 0x001fa002, + 0x80171038, 0x005f9440, 0x001fa002, 0xb5000063, + 0x80171000, 0x005f9440, 0x001fa002, 0x80171008, + 0x005f9441, 0x001fa002, 0x80171020, 0x005f9444, + 0x001fa002, 0x80171034, 0x005f9440, 0x001fa002, + 0x80171038, 0x005f9447, 0x001fa002, 0xb5000053, + 0x80171000, 0x005f9440, 0x001fa002, 0x80171004, + 0x005f9443, 0x001fa002, 0x8017100c, 0x005f9441, + 0x001fa002, 0x8017101c, 0x005f9446, 0x001fa002, + 0x80171024, 0x005f9444, 0x001fa002, 0x80171034, + 0x005f9449, 0x001fa002, 0x80171038, 0x005f9440, + 0x001fa002, 0x8017103c, 0x005f9447, 0x001fa002, + 0xb500003a, 0x80171000, 0x005f9440, 0x001fa002, + 0x80171008, 0x005f9441, 0x001fa002, 0x8017100c, + 0x005f9442, 0x001fa002, 0x80171020, 0x005f9444, + 0x001fa002, 0x80171024, 0x005f9445, 0x001fa002, + 0x80171034, 0x005f9440, 0x001fa002, 0x80171038, + 0x005f9447, 0x001fa002, 0x8017103c, 0x005f9448, + 0x001fa002, 0xb5000021, 0x80171000, 0x005f9440, + 0x001fa002, 0x80171004, 0x005f9443, 0x001fa002, + 0x8017100c, 0x005f9441, 0x001fa002, 0x80171010, + 0x005f9442, 0x001fa002, 0x8017101c, 0x005f9446, + 0x001fa002, 0x80171024, 0x005f9444, 0x001fa002, + 0x80171028, 0x005f9445, 0x001fa002, 0x80171034, + 0x005f9449, 0x001fa002, 0x80171038, 0x005f9440, + 0x001fa002, 0x8017103c, 0x005f9447, 0x001fa002, + 0x80171040, 0x005f9448, 0x001fa002, 0x80270001, + 0x803eff90, 0x80171000, 0x82b30020, 0x9ab50000, + 0x40158020, 0xb6000501, 0x48158020, 0x82b30020, + 0x9ab50000, 0x80470000, 0x3015b800, 0xb4600006, + 0x80171000, 0x83840226, 0xb6000603, 0x40028000, + 0x00000000, 0x0008a020, 0x80171018, 0x82b30020, + 0x9ab50000, 0x40158020, 0xb6000501, 0x48158020, + 0x82b30020, 0x9ab50000, 0x80470000, 0x3015b800, + 0xb4600006, 0x80171018, 0x83840215, 0xb6000603, + 0x40028000, 0x00000000, 0x0008a020, 0x80171030, + 0x82b30020, 0x9ab50000, 0x40158020, 0xb6000501, + 0x48158020, 0x82b30020, 0x9ab50000, 0x80470000, + 0x3015b800, 0xb4600006, 0x80171030, 0x83840204, + 0xb6000603, 0x40028000, 0x00000000, 0x0008a020, + 0xb500011e, 0x80270000, 0x803eff90, 0xb0030000, + 0xb4200067, 0x025f0322, 0xb00b0001, 0xb4200016, + 0xb0120001, 0xb4200005, 0x80171018, 0x8033007f, + 0x9821ffff, 0x001fa001, 0xb5000110, 0xb0120002, + 0xb4200005, 0x80171020, 0x8033007f, 0x9821ffff, + 0x001fa001, 0xb5000109, 0x80171018, 0x80330040, + 0x98210000, 0x001fa001, 0x80171020, 0x00000000, + 0x001fa001, 0xb5000101, 0xb00b0002, 0xb420002c, + 0xb0120000, 0xb4200008, 0x80171000, 0x8033007f, + 0x9821ffff, 0x001fa001, 0x80171038, 0x00000000, + 0x001fa001, 0xb50000f5, 0xb0120001, 0xb4200008, + 0x80171000, 0x8033005a, 0x98218279, 0x001fa001, + 0x80171030, 0x00000000, 0x001fa001, 0xb50000eb, + 0xb0120002, 0xb4200008, 0x80171008, 0x8033005a, + 0x98218279, 0x001fa001, 0x80171038, 0x00000000, + 0x001fa001, 0xb50000e1, 0x80171000, 0x80330040, + 0x98210000, 0x001fa001, 0x80171008, 0x00000000, + 0x001fa001, 0x8017100c, 0x00000000, 0x001fa001, + 0x80171038, 0x00000000, 0x001fa001, 0xb50000d3, + 0xb0120000, 0xb4200008, 0x80171000, 0x8033007f, + 0x9821ffff, 0x001fa001, 0x80171038, 0x00000000, + 0x001fa001, 0xb50000c9, 0xb0120001, 0xb4200005, + 0x80171018, 0x8033007f, 0x9821ffff, 0x001fa001, + 0xb50000c2, 0xb0120002, 0xb4200005, 0x80171020, + 0x8033007f, 0x9821ffff, 0x001fa001, 0xb50000bb, + 0x80171018, 0x80330040, 0x98210000, 0x001fa001, + 0x80171020, 0x00000000, 0x001fa001, 0xb50000b3, + 0x80070000, 0x8033007f, 0x9821ffff, 0xb600050e, + 0x144eb80f, 0xb0028000, 0xb4c00008, 0xac400006, + 0x00000000, 0x1042b800, 0x5842b802, 0x90421000, + 0x0017b802, 0x00000000, 0x001fa001, 0x90000001, + 0x59c1b80e, 0x59e1b80f, 0xb0040000, 0xb4200023, + 0xb00a0002, 0xb4000007, 0x80171004, 0x8033005a, + 0x98218279, 0x001fa001, 0x80171034, 0x00000000, + 0x001fa001, 0xb00c0002, 0xb4000009, 0x8017100c, + 0x8033ffa5, 0x98217d87, 0x001fa001, 0x8017103c, + 0x8033005a, 0x98218279, 0x001fa001, 0xb500008b, + 0x8017100c, 0x8033ffa5, 0x98217d87, 0x001fa001, + 0x80171010, 0x00000000, 0x001fa001, 0x8017103c, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171040, + 0x00000000, 0x001fa001, 0xb500007c, 0xb0040001, + 0xb420002a, 0xb00a0001, 0xb4000007, 0x80171018, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171020, + 0x00000000, 0x001fa001, 0xb00a0003, 0xb420000a, + 0x8053005a, 0x98428279, 0x4030b802, 0x8017101c, + 0x5821b801, 0x00000000, 0x00000000, 0x00000000, + 0x0028b801, 0x001fa001, 0xb00c0001, 0xb4200007, + 0x8053005a, 0x98428279, 0x4031b802, 0x80171024, + 0x0028b801, 0x001fa001, 0xb500005c, 0xb00c0002, + 0xb420005a, 0x8053005a, 0x98428279, 0x4031b802, + 0x80171024, 0x0028b801, 0x001fa001, 0x80171028, + 0x00000000, 0x001fa001, 0xb5000050, 0xb00b0002, + 0xb4200012, 0xb00a0001, 0xb4200008, 0x80171004, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171034, + 0x00000000, 0x001fa001, 0xb5000008, 0xb00a0003, + 0xb4200006, 0x80171004, 0x00000000, 0x001fa010, + 0x80171034, 0x00000000, 0x001fa010, 0xb00c0001, + 0xb4200025, 0x027f0383, 0x003f0328, 0xb0130007, + 0xb420000b, 0xb00b0003, 0xb4200009, 0xb0010000, + 0xb4200007, 0x80171024, 0x00000000, 0x001fa011, + 0x80171054, 0x80270000, 0x001fa001, 0xb500002b, + 0xb00d0000, 0xb420000a, 0x8033005a, 0x98218279, + 0x4041b811, 0x8017100c, 0x0048b802, 0x001fa002, + 0x8017103c, 0x00000000, 0x001fa002, 0xb500001f, + 0xb00d0002, 0xb420001d, 0x80171054, 0x8033005a, + 0x98218279, 0x001fa001, 0x8017106c, 0x00000000, + 0x001fa001, 0xb5000015, 0xb00c0002, 0xb4200013, + 0xb00d0000, 0xb4200007, 0x8017100c, 0x00000000, + 0x001fa011, 0x80171040, 0x00000000, 0x001fa011, + 0xb500000a, 0xb00d0001, 0xb4200008, 0x80171054, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171058, + 0x00000000, 0x001fa001, 0xb5000000, 0x029f0388, + 0x02bf0321, 0xb0140000, 0xb4000006, 0xb0150000, + 0xb4000004, 0x8017108c, 0x8033007f, 0x9821ffff, + 0x001fa001, 0x8027b078, 0x5c22b801, 0x806f001f, + 0x80af001f, 0x80cf0400, 0x003fb0bc, 0x5822b801, + 0x01afb801, 0x003f90bc, 0xb520ffff, 0x90210020, + 0x806f0003, 0x80af0003, 0x80cf0420, 0x003fb0bc, + 0x5822b801, 0x01afb801, 0x003f90bc, 0xb520ffff, + 0x81270000, 0x8033007f, 0x9821ffff, 0x80171000, + 0xb600060a, 0x80470000, 0xb6000603, 0x015f8020, + 0x0156b80a, 0x1042b80a, 0x3002b801, 0xb4a00001, + 0x81270001, 0x00000000, 0x00000000, 0x015f0323, + 0x00000000, 0xb00a0000, 0xb4200002, 0x81670000, + 0xb5000001, 0x81670001, 0x017f23fb, 0x01ff41ee, + 0x59f0b80f, 0x61f0b80f, 0x021f41ef, 0x5a10b810, + 0x6210b810, 0xb00a0003, 0xb420003b, 0x017f039f, + 0x019f41c5, 0x5990b80c, 0x6190b80c, 0xb00b0000, + 0xb400000c, 0xb00c0000, 0xb4000005, 0xac4c0100, + 0x8033001d, 0x98215500, 0x12c1b802, 0xb500000f, + 0xac4f0100, 0x8033001d, 0x98215500, 0x12c1b802, + 0xb500000a, 0xb0090000, 0xb4000005, 0xac4f0100, + 0x8033ffe2, 0x9821ab00, 0x12c1b802, 0xb5000003, + 0xac4f0100, 0x00000000, 0x02c7b802, 0xb0030000, + 0xb420007e, 0x01bf03a0, 0x01df41c9, 0x59d0b80e, + 0x61d0b80e, 0xb00d0000, 0xb400000c, 0xb00e0000, + 0xb4000005, 0xac4e0100, 0x8033001d, 0x98215500, + 0x12e1b802, 0xb5000071, 0xac500100, 0x8033001d, + 0x98215500, 0x12e1b802, 0xb500006c, 0xb0090000, + 0xb4000005, 0xac500100, 0x8033ffe2, 0x9821ab00, + 0x12e1b802, 0xb5000065, 0xac500100, 0x00000000, + 0x02e7b802, 0xb5000061, 0xb00a0002, 0xb420002f, + 0x023f9002, 0x025f9001, 0xb00f0000, 0xb4a00007, + 0xac4f0100, 0x00000000, 0x4022b811, 0x00000000, + 0x0028b801, 0x02c7b801, 0xb500000c, 0xb0090000, + 0xb4000004, 0xac4f0100, 0x00000000, 0x02c7b802, + 0xb5000006, 0xac4f0100, 0x00000000, 0x4022b812, + 0x00000000, 0x0028b801, 0x02c7b801, 0xb0030000, + 0xb4200046, 0xb0100000, 0xb4a00007, 0xac500100, + 0x00000000, 0x4022b811, 0x00000000, 0x0028b801, + 0x02e7b801, 0xb500003d, 0xb0090000, 0xb4000004, + 0xac500100, 0x00000000, 0x02e7b802, 0xb5000037, + 0xac500100, 0x00000000, 0x4022b812, 0x00000000, + 0x0028b801, 0x02e7b801, 0xb5000030, 0x023f9002, + 0x025f9001, 0xb00f0000, 0xb4a00007, 0xac4f0100, + 0x00000000, 0x4022b811, 0x00000000, 0x0028b801, + 0x02c7b801, 0xb5000006, 0xac4f0100, 0x00000000, + 0x4022b812, 0x00000000, 0x0028b801, 0x02c7b801, + 0xb0090000, 0xb4000005, 0x0047b816, 0x8033ffe2, + 0x9821ab00, 0x1042b801, 0x02c7b802, 0xb0030000, + 0xb4200016, 0xb0100000, 0xb4a00007, 0xac500100, + 0x00000000, 0x4022b811, 0x00000000, 0x0028b801, + 0x02e7b801, 0xb5000006, 0xac500100, 0x00000000, + 0x4022b812, 0x00000000, 0x0028b801, 0x02e7b801, + 0xb0090000, 0xb4000005, 0x0047b817, 0x8033ffe2, + 0x9821ab00, 0x1042b801, 0x02e7b802, 0x00000000, + 0x00000000, 0x02c8b816, 0x02dfb0cf, 0xb0030000, + 0xb4200002, 0x02e8b817, 0x02ffb0c6, 0x00ffb81b, + 0xb6001807, 0x5841b802, 0x3015b800, 0xb4800002, + 0x06b5b800, 0x98420001, 0x5aa1b815, 0x00000000, + 0x00ffb81c, 0x00000000, 0x00000000, 0x00000000, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815bb3f0, 0x81070000, 0x81270bf4, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x812717f4, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a0002d, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200001, + 0x8384020c, 0x80af001f, 0x808f0000, 0x806f0000, + 0x80670400, 0x5d22b80a, 0x81df0000, 0x00000000, + 0x00000000, 0xb600180a, 0x00cfb803, 0x013fb0bc, + 0x5922b809, 0x01afb809, 0x013f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x91290020, + 0x81df0004, 0x801bb3f8, 0x80270001, 0xb0000001, + 0xb4000002, 0x802600a0, 0x803eb3f8, 0x81270c00, + 0xb00a0000, 0xb4000001, 0x81270000, 0x813eb3f0, + 0x80270001, 0x003f2013, 0x00ffb81b, 0x00000000, + 0x029fb00a, 0x02bfb00b, 0x02dfb00c, 0x02ffb00d, + 0x031fb00e, 0x033fb00f, 0x033f400f, 0x0287b86f, + 0x029fb005, 0x8285009c, 0x96b48000, 0xb0158000, + 0xb4000195, 0x96b40100, 0xb0150100, 0xb40001ab, + 0x96b40400, 0xb0150400, 0xb40001ac, 0x96b40001, + 0xb0150001, 0xb400000c, 0x96b40008, 0xb0150008, + 0xb400019e, 0x96b44000, 0xb0154000, 0xb40001ab, + 0x96b40002, 0xb0150002, 0xb4000162, 0x00000000, + 0x00000000, 0xb50001bd, 0x02bf9017, 0x92b50001, + 0x02bfb017, 0x82850082, 0x5efdb814, 0x96f70001, + 0xb0170001, 0xb420000b, 0x83050069, 0x9718003f, + 0x82e50064, 0x12f7b818, 0x86f70109, 0x82feff74, + 0x02e7b86f, 0x9af74000, 0x01ffb817, 0x96f7bfff, + 0x01ffb817, 0x83050081, 0x82a5009a, 0x96b50001, + 0xb0150001, 0xb4200014, 0x82a70000, 0x02bfb017, + 0x96b41840, 0xb0150800, 0xb420000c, 0x96b40008, + 0x5aa9b815, 0x96d46000, 0x5ec3b816, 0x82f3000f, + 0x9af7c00f, 0x1718b817, 0x1ab5b818, 0x1ab5b816, + 0x9ab50340, 0x82a60081, 0xb5000132, 0x9b180180, + 0x83060081, 0xb500012f, 0x82a5009a, 0x96b50002, + 0xb0150002, 0xb420001b, 0x82a70000, 0x02bfb017, + 0x96b41800, 0xb0151800, 0xb4000013, 0x96b40040, + 0xb0150040, 0xb4200004, 0xa3180c00, 0x9b180340, + 0x83060081, 0xb500011f, 0x96b40008, 0x5aa9b815, + 0x96d46000, 0x5ec3b816, 0x82f3000f, 0x9af7c00f, + 0x1718b817, 0x1ab5b818, 0x1ab5b816, 0x9ab50340, + 0x82a60081, 0xb5000113, 0x9b180180, 0x83060081, + 0xb5000110, 0x82a500c1, 0x96b5000f, 0xb015000b, + 0xb420000e, 0x96b40020, 0xb0150020, 0xb400000b, + 0x96b40200, 0xb0150200, 0xb4000008, 0x82c50086, + 0x82e50094, 0x3016b817, 0xb4400004, 0x06f7b816, + 0xb017ff00, 0xb4400001, 0xb50000fe, 0x96b46000, + 0xb0156000, 0xb4000011, 0x96b41820, 0xb0150820, + 0xb4200004, 0x9b391000, 0x82a5009a, 0x96b5feff, + 0x82a6009a, 0x96b40040, 0xb0150040, 0xb4200001, + 0x9739efff, 0x96b91000, 0xb0151000, 0xb4200003, + 0x82a5009a, 0x9ab50100, 0x82a6009a, 0x96b40040, + 0xb0150040, 0xb4200019, 0x96b41800, 0xb0151800, + 0xb4200006, 0x96b98000, 0xb0158000, 0xb4200003, + 0x9b180180, 0x83060081, 0xb50000de, 0x96d80c00, + 0x82b300ff, 0x9ab5f3ff, 0x1718b815, 0xb0160c00, + 0xb4000007, 0x82e50098, 0x96f70400, 0xb0170400, + 0xb4200002, 0x82c70c00, 0xb5000001, 0xa2d60c00, + 0x1b18b816, 0x9b180340, 0xb50000c4, 0x96b40220, + 0xb0150000, 0xb4e00028, 0x82a5009d, 0x82f3ffff, + 0x16b5b817, 0x82f3000e, 0x3015b817, 0xb4200022, + 0x96f98000, 0xb0178000, 0xb400001f, 0x82a70000, + 0x02bfb017, 0x82c50081, 0x9ab60020, 0x82a60081, + 0x82a50086, 0x92b50bb8, 0x82a60094, 0x82c60081, + 0x82c5009d, 0x96d6ffff, 0x82b30032, 0x9ab58001, + 0x82e500c1, 0x96f7000f, 0xb017000b, 0xb4000002, + 0x82b30022, 0x9ab58001, 0x1ab5b816, 0x82c5009a, + 0x96d60020, 0xb0160020, 0xb4200002, 0x82b30032, + 0x9ab58001, 0x82a6009d, 0x02ff9017, 0x00000000, + 0xb0170040, 0xb4800000, 0x5eb5b814, 0x96b500f0, + 0x96f46000, 0x5eedb817, 0x1ab5b817, 0xb0170003, + 0xb4000004, 0x96b500ef, 0x96f70001, 0x5ae4b817, + 0x1ab5b817, 0x96d41800, 0xb0161800, 0xb400000a, + 0x96f900ff, 0x96b500ff, 0x9739ff00, 0x1b39b815, + 0x02a7b817, 0x96b500f3, 0x96d40008, 0x5ec1b816, + 0x1ab5b816, 0xb500000c, 0x96f98000, 0xb0178000, + 0xb4200007, 0x5efeb814, 0x96f70001, 0xb0170001, + 0xb4000003, 0x9b180180, 0x83060081, 0xb5000081, + 0x96b500f3, 0x9ab50008, 0x9739fff3, 0x96d40020, + 0xb0160020, 0xb4200017, 0x9b398000, 0x82c70000, + 0x02dfb017, 0x96d40010, 0x5ac8b816, 0x82f300ff, + 0x9af7cfff, 0x1718b817, 0x1b18b816, 0x9b180340, + 0x82c5009d, 0x96d6ffff, 0x82f3000e, 0x9af78001, + 0x1af7b816, 0x82c5009a, 0x96d60020, 0xb0160020, + 0xb4200002, 0x82f30032, 0x9af78001, 0x82e6009d, + 0xb500005a, 0x97397fff, 0x96b500ff, 0x5aaab815, + 0x82f300fc, 0x9af703ff, 0x1718b817, 0x1b18b815, + 0x9b180340, 0x82c5009a, 0x96d60010, 0xb0160010, + 0xb4200024, 0x82c70000, 0x02dfb017, 0x82c50086, + 0x92d60bb8, 0x82c60086, 0x82c50094, 0x5eefb818, + 0x96f70003, 0xb0170003, 0xb4200002, 0x82e70bb8, + 0xb5000001, 0x82e70bb8, 0x12d6b817, 0x82e50081, + 0x9af70020, 0x82e60081, 0x82c60094, 0xa2f70020, + 0x82e60081, 0x82f30001, 0x16f7b818, 0x5ef0b817, + 0xb0170001, 0xb4000004, 0x96f84000, 0x5ee4b817, + 0x9718f3ff, 0x1b18b817, 0x82f3000a, 0x9af78000, + 0x82e6009d, 0x83060081, 0x83070001, 0x8306009f, + 0xb5000096, 0x82c5009d, 0x82f3000e, 0x9af78001, + 0x3016b817, 0xb420000f, 0x82b30032, 0x9ab58001, + 0x82e500c1, 0x96f7000f, 0xb017000b, 0xb4000002, + 0x82b30022, 0x9ab58001, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82b30032, 0x9ab58001, + 0x82a6009d, 0x82c5009a, 0x96d60080, 0xb0160080, + 0xb4000011, 0x02df9017, 0x00000000, 0xb0160010, + 0xb480000d, 0x82c500c1, 0x96d6000f, 0xb016000b, + 0xb4000009, 0x82c50087, 0x96d60080, 0x5ac7b816, + 0x96f84000, 0x3017b816, 0xb4200003, 0x033f400f, + 0x9b394000, 0xb500000b, 0x9739bfff, 0x82e50061, + 0x96f70008, 0xb0170008, 0xb4000005, 0x5eefb818, + 0x96f70003, 0xb0170003, 0xb4000001, 0x9718ffff, + 0x83060081, 0x83070001, 0x8306009f, 0x00000000, + 0xb500005e, 0x82850083, 0x96b400ff, 0xb015003c, + 0xb4200019, 0x96b92000, 0xb0152000, 0xb4000002, + 0x9b392000, 0xb5000014, 0x9739d3ff, 0x82870000, + 0x82860087, 0x82870008, 0x82860083, 0x829bff78, + 0x82a7001f, 0xb0140400, 0xb4000001, 0x82a70010, + 0x82a600c9, 0x829bff78, 0x00000000, 0x828600cb, + 0x8285009d, 0x82b3ffff, 0x9ab5fffd, 0x1694b815, + 0x8286009d, 0xb5000000, 0x83070002, 0x8306009f, + 0x00000000, 0xb500003d, 0x96b90800, 0xb0150800, + 0xb4200009, 0x9739f7ff, 0x82a703fd, 0x82a600cb, + 0x82a7003c, 0x82a60083, 0x8285009d, 0x9a940002, + 0x8286009d, 0xb5000004, 0x82850087, 0x5a82b814, + 0xa2940200, 0x82860087, 0xb5000000, 0x83078000, + 0x8306009f, 0x00000000, 0xb5000028, 0x83070008, + 0x8306009f, 0x00000000, 0xb5000024, 0x83070100, + 0x8306009f, 0x00000000, 0xb5000020, 0x83070000, + 0x83050081, 0x9b180180, 0x83060081, 0x83070400, + 0x8306009f, 0x00000000, 0xb5000018, 0x82870000, + 0x82850082, 0x5eb7b814, 0x96b500fc, 0x96d40006, + 0x5ec1b816, 0x1ab5b816, 0x5aacb815, 0x83050081, + 0x82d3001c, 0x9ad600ff, 0x1718b816, 0x1b18b815, + 0x9b180e00, 0x83060081, 0x83074000, 0x8306009f, + 0x8305009d, 0x82d300ff, 0x9ad6bfff, 0x1718b816, + 0x8306009d, 0x00000000, 0xb5000000, 0x029f9005, + 0x01ffb814, 0x033f600f, 0x029f900a, 0x02bf900b, + 0x02df900c, 0x02ff900d, 0x031f900e, 0x033f900f, + 0x00ffb81e, 0x02ff9010, 0x92f70b43, 0x02ffb010, + 0x02ff90cb, 0x82bbffdc, 0x829bffd8, 0x93150004, + 0x3014b815, 0xb400000f, 0x02dbb818, 0x029bb815, + 0x3017b816, 0xb480000b, 0x5a81b814, 0x029fb010, + 0x82860095, 0x8293001f, 0x9294fe00, 0x92b50008, + 0x3015b814, 0xb4800002, 0x82b3001f, 0x92b5fa00, + 0x82beffdc, 0x029f9010, 0x83250094, 0x06d4b819, + 0x02d6b816, 0xb016ffff, 0xb4a0000a, 0x8293000e, + 0x9a948001, 0x82c5009d, 0x96d6ffff, 0x1a94b816, + 0x82c5009a, 0x96d60010, 0xb0160010, 0xb4000001, + 0x8286009d, 0x00ffb81c, 0x82870001, 0x829ef500, + 0x82850086, 0x83250094, 0x06d4b819, 0x02d6b816, + 0xb016ffff, 0xb4a0000b, 0x82870001, 0x829ef504, + 0x82c50081, 0x9ab60020, 0x82a60081, 0x82a50086, + 0x92b50bbb, 0x82a60094, 0x82c60081, 0x86b505df, + 0x82a6009b, 0x00ffb81c, 0x82070028, 0x023f9006, + 0x83a4ef48, 0x80070000, 0x001fb011, 0x001f204f, + 0x003fb800, 0x001f9006, 0x5803b800, 0x80338000, + 0x1800b801, 0x003fb800, 0x005f4193, 0x5c41b802, + 0x80350000, 0x00000000, 0x0027b860, 0x80150010, + 0x5810b800, 0x80750010, 0x1863b800, 0x8087ffff, + 0x80a7770b, 0x80c70000, 0x1403b804, 0x3000b805, + 0xb4000008, 0x5888b804, 0x58a8b805, 0x90c60001, + 0xb0060003, 0xb4a0fff8, 0x84420001, 0xb4e0ffee, + 0xb5000027, 0xb0060003, 0xb4200007, 0x80150010, + 0x5810b800, 0x81150010, 0x950800ff, 0xb0080077, + 0xb4000001, 0xb500fff4, 0x001f400e, 0x98000010, + 0x98004000, 0x9400fffe, 0x001f600e, 0x80e71fc0, + 0x001f4000, 0x94000080, 0xb0000080, 0xb4200001, + 0x80e77560, 0x00ffb008, 0x80e70020, 0xb0060000, + 0xb400000e, 0x58e3b806, 0x90210020, 0x81070000, + 0x5938b803, 0x1908b809, 0x9523ff00, 0x5928b809, + 0x1908b809, 0x5d28b803, 0x9529ff00, 0x1908b809, + 0x5d38b803, 0x1908b809, 0x011fb011, 0x00ff204f, + 0x80137fff, 0x9800ffe7, 0x1421b800, 0x5c23b801, + 0x001f9006, 0x0441b800, 0x3001b800, 0xb4600002, + 0x0440b801, 0xa4422000, 0x007f90cb, 0x1063b802, + 0x007fb0cb, 0x003fb006, 0x803effec, 0x80470001, + 0x005f2013, 0xb500ebae, 0x001f400e, 0x9400000f, + 0xb0000000, 0xb4200001, 0x00ffb81f, 0xb0000001, + 0xb4000005, 0xb0000003, 0xb4000003, 0xb0000002, + 0xb4000001, 0x00ffb81f, 0x80070001, 0x001f2013, + 0xb500eb9f, 0x00000000, 0x00000000, 0x00000000, + 0x001f9012, 0x001fb100, 0x001f004c, 0x001f2404, + 0x801bfef0, 0x8058fef4, 0x803bff68, 0x8078ff6c, + 0x2000b801, 0x2042b803, 0x001fb104, 0x005f2414, + 0x82e70001, 0x83640048, 0x029fb014, 0x829efef0, + 0x8286000f, 0x02bf2054, 0x82bcfef4, 0x82a6000e, + 0x00ffb81a, 0x80e70001, 0x801336e3, 0x9800eb76, + 0x001fb100, 0x800700ab, 0x001f2404, 0x801bc3e8, + 0x8058c3ec, 0x83640024, 0x82e70000, 0x83640036, + 0x029fb300, 0x029fb100, 0x02bf2c04, 0x02bf2404, + 0x801bc000, 0x8058c004, 0x8364001b, 0x82e70000, + 0x8364002d, 0x001f9300, 0x3000b814, 0xb420000a, + 0x001f0c04, 0x3000b815, 0xb4200007, 0x829efef0, + 0x82bcfef4, 0x029fb012, 0x02bf204c, 0x82870001, + 0x829cfef5, 0x00ffb81a, 0xb0070000, 0xb4000007, + 0x80e70000, 0x801399fa, 0x9800c92e, 0x001fb100, + 0x800700af, 0x001f2404, 0xb500ffdc, 0x82870000, + 0x829cfef5, 0x00ffb81a, 0x80c700ff, 0x803bff68, + 0x8078ff6c, 0x14a0b806, 0x2063b805, 0x007f2414, + 0x2021b802, 0x58c8b806, 0x14a0b806, 0x58b0b805, + 0x2021b805, 0x58c8b806, 0x14a0b806, 0x2021b805, + 0x58c8b806, 0x14a0b806, 0x5cb0b805, 0x2021b805, + 0x003fb104, 0x00ffb81b, 0x82c70000, 0x83070400, + 0x83270005, 0x8197040c, 0x81d7ffff, 0x83840126, + 0x83840001, 0x00ffb81b, 0x808f0000, 0x806f001f, + 0x80af001f, 0x80270140, 0x81e7ef98, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x80270180, 0x81e7ee90, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x8057ffff, 0x80170430, 0x80070410, + 0x80270408, 0xb6000509, 0x005ff000, 0x90420500, + 0x007ff001, 0x90630600, 0x009ff002, 0x00bff003, + 0x2004a025, 0x90000001, 0x90210001, 0x80070414, + 0x80d7ffff, 0x8097045c, 0x8017043c, 0xb6000404, + 0x005ff000, 0x007f87e0, 0x84000001, 0x2082a7e3, + 0x80970460, 0x80170440, 0x2082b803, 0x007f8000, + 0x2083a004, 0x80170430, 0x80970450, 0x80270408, + 0xb6000508, 0x005f8024, 0x90420500, 0x007ff001, + 0x90630600, 0x009ff002, 0x00bff003, 0x2004a025, + 0x90210001, 0x80170440, 0x00000000, 0x02bf87e0, + 0x80970460, 0x82870000, 0xb6000404, 0x005f87e4, + 0x5a88b814, 0x204287e0, 0x1a94b802, 0x00ffb81c, + 0x001f0a49, 0x001f2709, 0x001f0a41, 0x001f2708, + 0x001f0a46, 0x001f2707, 0x001f0a48, 0x001f2706, + 0x001f0a42, 0x001f2705, 0x001f0a47, 0x001f2704, + 0x001f0a45, 0x001f2703, 0x001f0a43, 0x001f2702, + 0x001f0a40, 0x001f2701, 0x001f0a44, 0x001f2700, + 0x001f0c25, 0xa020000c, 0x94400001, 0x94600002, + 0x94810004, 0x94a10008, 0x94c00010, 0x5943b802, + 0x5861b803, 0x5882b804, 0x5ca2b805, 0x5cc4b806, + 0x194ab803, 0x194ab804, 0x194ab805, 0x194ab806, + 0x015f2738, 0x801bef90, 0x003f91c1, 0x5c28b801, + 0x005f91c2, 0x5858b802, 0x1821b802, 0x2000b801, + 0x001fb1c4, 0x8018ef94, 0x003f0709, 0x2000b801, + 0x001f2714, 0x82c70001, 0x82e70001, 0x83070710, + 0x8327001e, 0x81970735, 0x8384009f, 0x02df0738, + 0x82170a30, 0x838400f1, 0x819efef0, 0x817cfef4, + 0x819eff68, 0x817cff6c, 0x00ffb81b, 0x820f001f, + 0x8018fef8, 0x8057ffff, 0x001f2709, 0x8018fef6, + 0x80d7ffff, 0x001f2708, 0x8018fefa, 0x8157ffff, + 0x001f2707, 0x8018fefd, 0x81d7ffff, 0x001f2706, + 0x8018fefb, 0x802f001f, 0x001f2705, 0x8018fefe, + 0x00000000, 0x001f2704, 0x8018fef9, 0x00000000, + 0x001f2703, 0x8018feff, 0x00000000, 0x001f2702, + 0x8018fef7, 0x00000000, 0x001f2701, 0x8018fefc, + 0x00000000, 0x001f2700, 0x001f0c25, 0xa0200011, + 0x94410001, 0x94600002, 0x94800004, 0x94a00008, + 0x94c10010, 0x5941b802, 0x5861b803, 0x5c82b804, + 0x58a1b805, 0x5cc1b806, 0x194ab803, 0x194ab804, + 0x194ab805, 0x194ab806, 0x015f2738, 0x801bef90, + 0x003f91c1, 0x5c28b801, 0x005f91c2, 0x5858b802, + 0x1821b802, 0x2000b801, 0x001fb1c4, 0x8018ef94, + 0x003f0709, 0x2000b801, 0x001f2714, 0x82c70001, + 0x82e70001, 0x83070710, 0x8327001e, 0x81970735, + 0x83840055, 0x02df0738, 0x82170a20, 0x838400a7, + 0x819efef0, 0x817cfef4, 0x5ac8b80c, 0x02ff0a44, + 0x1ad6b817, 0x02dfb291, 0x5ed8b80c, 0x5968b80b, + 0x1ad6b80b, 0x02df6524, 0x00ffb81b, 0x820f001f, + 0x8018fefe, 0x8057ffff, 0x001f2709, 0x8018fefa, + 0x80d7ffff, 0x001f2708, 0x8018fefc, 0x8157ffff, + 0x001f2707, 0x8018feff, 0x81d7ffff, 0x001f2706, + 0x8018fef8, 0x802f001f, 0x001f2705, 0x8018fefb, + 0x00000000, 0x001f2704, 0x8018fefd, 0x00000000, + 0x001f2703, 0x8018fef6, 0x00000000, 0x001f2702, + 0x8018fef9, 0x00000000, 0x001f2701, 0x8018fef7, + 0x00000000, 0x001f2700, 0x801bef90, 0x003f91c1, + 0x5c28b801, 0x005f91c2, 0x5858b802, 0x1821b802, + 0x2000b801, 0x001fb1c4, 0x8018ef94, 0x003f0709, + 0x2000b801, 0x001f2714, 0x82c70001, 0x82e70001, + 0x83070710, 0x8327001e, 0x81970735, 0x83840016, + 0x83270000, 0x831bfef0, 0x82f8fef4, 0x02c7b819, + 0x82170a28, 0x83840065, 0x300cb818, 0xb4200002, + 0x300bb817, 0xb4000006, 0x93390001, 0xb0190020, + 0xb480fff6, 0x83270000, 0x833cfef5, 0x00ffb81b, + 0x019fb290, 0x017f2a44, 0x033f2c25, 0x83270001, + 0x833cfef5, 0x00ffb81b, 0x0007b818, 0x90000003, + 0x00000000, 0x015ff000, 0x90000001, 0x5949b80a, + 0x013ff000, 0x194ab809, 0x84000002, 0x994a0100, + 0x017ff000, 0x958b00f8, 0x5981b80c, 0x956b0007, + 0x198cb80b, 0x84000002, 0x998c0008, 0x017ff000, + 0x90000001, 0x5971b80b, 0x198cb80b, 0x017ff000, + 0x5969b80b, 0x198cb80b, 0x81a70000, 0x94d90003, + 0x82a70000, 0xb6260019, 0xb6000818, 0x5df0b80a, + 0x5e02b80a, 0x21efb810, 0x95ef0001, 0x5941b80a, + 0x194ab80f, 0x21efb816, 0x5e18b80c, 0x5e35b80c, + 0x5e54b80c, 0x5e6cb80c, 0x2210b811, 0x2252b813, + 0x2210b812, 0x96100001, 0x5981b80c, 0x198cb810, + 0x2210b817, 0x10afb810, 0x10a5b80d, 0x5da1b805, + 0x94a50001, 0x5aa1b815, 0x1ab5b805, 0x019fa7f5, + 0x5cc2b819, 0xb626001c, 0x82870000, 0xb6000419, + 0xb6000818, 0x5df0b80a, 0x5e02b80a, 0x21efb810, + 0x95ef0001, 0x5941b80a, 0x194ab80f, 0x21efb816, + 0x5e18b80c, 0x5e35b80c, 0x5e54b80c, 0x5e6cb80c, + 0x2210b811, 0x2252b813, 0x2210b812, 0x96100001, + 0x5981b80c, 0x198cb810, 0x2210b817, 0x10afb810, + 0x10a5b80d, 0x5da1b805, 0x94a50001, 0x5a81b814, + 0x1a94b805, 0x019fa7f4, 0x00ffb81c, 0x8257ffff, + 0x808f0000, 0x806f001f, 0x80af001f, 0x80270200, + 0x81e7ec70, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270240, + 0x81e7ed70, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270180, + 0x81e7ee90, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x806f0007, + 0x80af0007, 0x80270280, 0x81e7ee70, 0x5de2b80f, + 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, + 0x01ff90bc, 0xb520ffff, 0x91ef0020, 0x90210020, + 0x80170760, 0x001f0700, 0x001fa020, 0x001f0701, + 0x001fa020, 0x001f0702, 0x001fa020, 0x001f0703, + 0x001fa020, 0x001f0704, 0x001fa000, 0x80970750, + 0x81170770, 0x82a70735, 0x83a40060, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4005c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a70730, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40050, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4004c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a7072b, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40040, 0x83a4004e, + 0xb6000407, 0x86b50001, 0x83a4003c, 0x001f8004, + 0x003f87e8, 0x2080a001, 0x83a40047, 0x00000000, + 0x80970770, 0x80170750, 0x81170750, 0x81970740, + 0x82a70726, 0x001f800c, 0x003f8008, 0x2100a001, + 0x83a4002e, 0x83a4003c, 0xb6000407, 0x86b50001, + 0x83a4002a, 0x001f8004, 0x003f87e8, 0x2080a001, + 0x83a40035, 0x00000000, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a70721, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4001c, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a40018, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a7071c, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4000c, 0x017f87e4, + 0x81870000, 0xb6000406, 0x86b50001, 0x83a40007, + 0x001f87e4, 0x200087e8, 0x5988b80c, 0x198cb800, + 0x021fa02c, 0x021fa00b, 0x00ffb81c, 0x005ff015, + 0x90420600, 0x003f87e0, 0x001ff002, 0x2060b801, + 0x90630800, 0x90960a00, 0x001ff003, 0x003ff004, + 0x20a0b801, 0x90a50900, 0x00000000, 0x001ff005, + 0x009fa000, 0x00ffb81d, 0x001f8004, 0x5c21b800, + 0x5847b800, 0x1821b802, 0x942100ff, 0x2080a7e1, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x015f400e, 0x944a4000, 0xb0024000, 0xb420001e, + 0x954abfff, 0x015f600e, 0x820f001f, 0x802f001f, + 0x81470000, 0x015f23f9, 0x015fb0ba, 0x8057ffff, + 0x80770000, 0x82970400, 0x82d7ffff, 0x82f70000, + 0x81df0000, 0x00000000, 0x00000000, 0xb6000702, + 0xb6000001, 0x029fa02a, 0x81df0004, 0x80275480, + 0x005fb801, 0x8033001f, 0x9821c000, 0x803effe0, + 0x90212000, 0x803effe4, 0x80d9ff80, 0x00df6001, + 0x814775e8, 0x015fb008, 0x003f0324, 0xb0010000, + 0xb420007e, 0x8344ebde, 0xb0180000, 0xb4000004, + 0x011f400e, 0x1908b818, 0x011f600e, 0x00ffb81f, + 0x8344f1df, 0xb00b0000, 0xb4000006, 0x023f400e, + 0x9a310002, 0x023f600e, 0x82270000, 0x023f2012, + 0x00ffb81f, 0x8364ed72, 0x82270000, 0x023f2011, + 0x80070000, 0x80170800, 0x81df0000, 0x00000000, + 0x00000000, 0xb6002002, 0xb6003001, 0x001fa020, + 0x81df0004, 0x82270000, 0x003fb811, 0x02bf9006, + 0x5aa3b815, 0x82338000, 0x1a31b815, 0x003fb811, + 0x8067e950, 0x5c62b803, 0x81f50000, 0x019f4193, + 0x0267b80c, 0xadcc0010, 0x80170800, 0x80130000, + 0x9800f872, 0x001fa020, 0x80134e1f, 0x98000001, + 0x001fa020, 0x59d0b80e, 0x81150010, 0x1908b80e, + 0x001fa028, 0x858c0001, 0x5e01b80c, 0x5e25b810, + 0x81df0000, 0x00000000, 0x00000000, 0xb6310006, + 0xb6002005, 0x81150010, 0x5910b808, 0x00000000, + 0x81350010, 0x1808a029, 0x9630001f, 0xb0110000, + 0xb4000006, 0xb6310005, 0x81150010, 0x5910b808, + 0x00000000, 0x81350010, 0x1808a029, 0x81df0004, + 0x962c0001, 0xb0110000, 0xb4000003, 0x81150010, + 0x5910b808, 0x001fa028, 0x019f9006, 0x958cffff, + 0x00df4193, 0x58c1b806, 0x118cb806, 0xb00ce000, + 0xb4800002, 0x858ce000, 0x918cc000, 0x8153001f, + 0x118cb80a, 0x819effec, 0x019fb006, 0x015f4193, + 0x5941b80a, 0x019f90cb, 0x118cb80a, 0x019fb0cb, + 0x019f90ba, 0x918c0001, 0x019fb0ba, 0xb00c0002, + 0xb4200016, 0x019f400e, 0x940c8000, 0xb0008000, + 0xb4200012, 0x958c7fff, 0x019f600e, 0x80070000, + 0x800600a0, 0x80073da1, 0x800600a1, 0x801bff60, + 0x00000000, 0x801eff60, 0x00000000, 0x801bff60, + 0x00000000, 0x801eff60, 0x80130001, 0x98003da1, + 0x800600a1, 0x80070001, 0x800600a0, 0x003f0324, + 0x90210001, 0xb0010005, 0xb4a00001, 0x80270000, + 0x003f2324, 0x00ffb81f, 0x00000000, 0x00000000, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815bb3f0, 0x81070000, 0x81270bf4, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x81271800, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a00032, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200001, + 0x8384fbf4, 0x80af001f, 0x808f0002, 0x806f0000, + 0x807bbf34, 0x5d22b80a, 0x81df0000, 0x00000000, + 0x00000000, 0xb600080a, 0x00cfb803, 0x013fb0bc, + 0x5922b809, 0x01afb809, 0x013f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x91290060, + 0x81df0004, 0x808f0000, 0x813bb3f8, 0x80270001, + 0xb0090001, 0xb4000002, 0x802600a0, 0x803eb3f8, + 0x81270c00, 0xb00a0000, 0xb4000001, 0x81270000, + 0x813eb3f0, 0xb0030800, 0xb4800001, 0x80670200, + 0x807ebf34, 0x80270001, 0x003f2013, 0x00ffb81b, + +}; + +static u32 AC3Ucode1f8000[] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00020000, 0xffff0005, 0xffffffff, + 0x00050001, 0xffffffff, 0xffffffff, 0x00020000, + 0xffff0005, 0xffffffff, 0x00010000, 0x00050002, + 0xffffffff, 0x00020000, 0x00050003, 0xffffffff, + 0x00010000, 0x00030002, 0xffff0005, 0x00020000, + 0x00040003, 0xffff0005, 0x00010000, 0x00030002, + 0x00050004, 0x0019000d, 0x003d0025, 0x00250019, + 0x00fd003d, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x007fffff, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x007fffff, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00599999, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00599999, + 0x007fffff, 0x00599999, 0x00000000, 0x00599999, + 0x00000000, 0x00000000, 0x00000000, 0x00599999, + 0x00000000, 0x00599999, 0x007fffff, 0x00000000, + 0x00599999, 0x00599999, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00599999, 0x00599999, + 0x007fffff, 0x007fffff, 0x00000000, 0x00599999, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00599999, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x007fffff, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x007fffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x007fffff, 0x00000000, 0x007fffff, 0x00400000, + 0x00200000, 0x00100000, 0x00080000, 0x00040000, + 0x00020000, 0x00010000, 0x00008000, 0x00004000, + 0x00002000, 0x00001000, 0x00000800, 0x00000400, + 0x00000200, 0x00000100, 0x00000080, 0x00000040, + 0x00000020, 0x00000010, 0x00000008, 0x00000004, + 0x00000002, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00010002, + 0x00030002, 0x00030002, 0x00030002, 0x00000000, + 0x00000000, 0x00010001, 0x00020002, 0x4000a000, + 0xe000a000, 0xf000b000, 0xf800b800, 0x005a8279, + 0x004c1bf8, 0x00400000, 0x004c1bf8, 0x005a8279, + 0x00400000, 0x00000000, 0x00400000, 0x03020100, + 0x00000000, 0x00000080, 0x00000020, 0x00000008, + 0x00000000, 0x00000001, 0x00010001, 0x10081000, + 0x10041000, 0x10081004, 0x10081008, 0x10081008, + 0x00000000, 0x00000000, 0x00000000, 0xff80000a, + 0xff80031f, 0xff800b24, 0xff801818, 0xff8029fa, + 0xff8040c9, 0xff805c86, 0xff807d2e, 0xff80a2c1, + 0xff80cd3c, 0xff80fc9f, 0xff8130e8, 0xff816a14, + 0xff81a821, 0xff81eb0e, 0xff8232d6, 0xff827f79, + 0xff82d0f2, 0xff83273e, 0xff83825b, 0xff83e244, + 0xff8446f7, 0xff84b06e, 0xff851ea6, 0xff85919b, + 0xff860949, 0xff8685aa, 0xff8706ba, 0xff878c74, + 0xff8816d3, 0xff88a5d1, 0xff89396a, 0xff89d196, + 0xff8a6e51, 0xff8b0f94, 0xff8bb55a, 0xff8c5f9b, + 0xff8d0e51, 0xff8dc176, 0xff8e7902, 0xff8f34ef, + 0xff8ff535, 0xff90b9cc, 0xff9182ae, 0xff924fd3, + 0xff932132, 0xff93f6c3, 0xff94d07f, 0xff95ae5d, + 0xff969054, 0xff97765b, 0xff98606a, 0xff994e78, + 0xff9a407c, 0xff9b366b, 0xff9c303e, 0xff9d2de9, + 0xff9e2f64, 0xff9f34a4, 0xffa03da0, 0xffa14a4c, + 0xffa25aa0, 0xffa36e8f, 0xffa48610, 0xffa5a118, + 0xffa6bf9c, 0xffa7e191, 0xffa906ec, 0xffaa2fa0, + 0xffab5ba4, 0xffac8aeb, 0xffadbd6a, 0xffaef315, + 0xffb02bdf, 0xffb167be, 0xffb2a6a4, 0xffb3e886, + 0xffb52d56, 0xffb67509, 0xffb7bf92, 0xffb90ce4, + 0xffba5cf2, 0xffbbafb0, 0xffbd050f, 0xffbe5d04, + 0xffbfb780, 0xffc11477, 0xffc273db, 0xffc3d59f, + 0xffc539b4, 0xffc6a00d, 0xffc8089d, 0xffc97355, + 0xffcae027, 0xffcc4f05, 0xffcdbfe2, 0xffcf32af, + 0xffd0a75d, 0xffd21ddf, 0xffd39625, 0xffd51022, + 0xffd68bc7, 0xffd80904, 0xffd987cd, 0xffdb0810, + 0xffdc89c1, 0xffde0cd0, 0xffdf912d, 0xffe116cb, + 0xffe29d9a, 0xffe4258b, 0xffe5ae8f, 0xffe73896, + 0xffe8c392, 0xffea4f74, 0xffebdc2b, 0xffed69aa, + 0xffeef7df, 0xfff086bd, 0xfff21634, 0xfff3a634, + 0xfff536ad, 0xfff6c792, 0xfff858d1, 0xfff9ea5b, + 0xfffb7c22, 0xfffd0e16, 0xfffea026, 0xffffcdbc, + 0xfffe3ba0, 0xfffca995, 0xfffb17ac, 0xfff985f3, + 0xfff7f479, 0xfff6634f, 0xfff4d284, 0xfff34228, + 0xfff1b249, 0xfff022f7, 0xffee9442, 0xffed0638, + 0xffeb78ea, 0xffe9ec67, 0xffe860bd, 0xffe6d5fd, + 0xffe54c35, 0xffe3c374, 0xffe23bcb, 0xffe0b547, + 0xffdf2ff7, 0xffddabec, 0xffdc2933, 0xffdaa7dd, + 0xffd927f6, 0xffd7a98f, 0xffd62cb7, 0xffd4b17b, + 0xffd337ea, 0xffd1c013, 0xffd04a05, 0xffced5ce, + 0xffcd637c, 0xffcbf31d, 0xffca84c1, 0xffc91874, + 0xffc7ae45, 0xffc64641, 0xffc4e078, 0xffc37cf6, + 0xffc21bc9, 0xffc0bcff, 0xffbf60a5, 0xffbe06c9, + 0xffbcaf79, 0xffbb5ac0, 0xffba08ae, 0xffb8b94d, + 0xffb76cac, 0xffb622d8, 0xffb4dbdc, 0xffb397c6, + 0xffb256a2, 0xffb1187d, 0xffafdd62, 0xffaea55f, + 0xffad707e, 0xffac3ecc, 0xffab1054, 0xffa9e523, + 0xffa8bd44, 0xffa798c2, 0xffa677a8, 0xffa55a02, + 0xffa43fdb, 0xffa3293d, 0xffa21634, 0xffa106c9, + 0xff9ffb08, 0xff9ef2fa, 0xff9deeab, 0xff9cee23, + 0xff9bf16c, 0xff9af892, 0xff9a039c, 0xff991295, + 0xff982586, 0xff973c78, 0xff965774, 0xff957683, + 0xff9499ad, 0xff93c0fb, 0xff92ec75, 0xff921c24, + 0xff91500f, 0xff90883f, 0xff8fc4bb, 0xff8f058b, + 0xff8e4ab6, 0xff8d9443, 0xff8ce239, 0xff8c349f, + 0xff8b8b7d, 0xff8ae6d7, 0xff8a46b5, 0xff89ab1e, + 0xff891416, 0xff8881a3, 0xff87f3cc, 0xff876a96, + 0xff86e606, 0xff866621, 0xff85eaed, 0xff85746d, + 0xff8502a6, 0xff84959e, 0xff842d57, 0xff83c9d7, + 0xff836b20, 0xff831138, 0xff82bc20, 0xff826bdc, + 0xff822070, 0xff81d9de, 0xff819829, 0xff815b54, + 0xff812360, 0xff80f051, 0xff80c228, 0xff8098e6, + 0xff80748e, 0xff805521, 0xff803a9f, 0xff80250b, + 0xff801464, 0xff8008ad, 0xff8001e4, 0xff800027, + 0xff800c7e, 0xff802c8f, 0xff806056, 0xff80a7cb, + 0xff8102e4, 0xff817191, 0xff81f3c3, 0xff828964, + 0xff83325f, 0xff83ee98, 0xff84bdf3, 0xff85a04f, + 0xff86958b, 0xff879d7f, 0xff88b804, 0xff89e4ee, + 0xff8b240e, 0xff8c7533, 0xff8dd82a, 0xff8f4cbb, + 0xff90d2ad, 0xff9269c4, 0xff9411c1, 0xff95ca62, + 0xff979365, 0xff996c81, 0xff9b5570, 0xff9d4de4, + 0xff9f5590, 0xffa16c24, 0xffa3914e, 0xffa5c4b8, + 0xffa8060d, 0xffaa54f3, 0xffacb10e, 0xffaf1a03, + 0xffb18f70, 0xffb410f7, 0xffb69e33, 0xffb936c0, + 0xffbbda37, 0xffbe8830, 0xffc14042, 0xffc40201, + 0xffc6cd00, 0xffc9a0d2, 0xffcc7d05, 0xffcf612b, + 0xffd24ccf, 0xffd53f80, 0xffd838c8, 0xffdb3833, + 0xffde3d49, 0xffe14795, 0xffe4569d, 0xffe769e9, + 0xffea80ff, 0xffed9b67, 0xfff0b8a4, 0xfff3d83c, + 0xfff6f9b5, 0xfffa1c91, 0xfffd4056, 0xffff9b78, + 0xfffc7756, 0xfff953c0, 0xfff63130, 0xfff31025, + 0xffeff117, 0xffecd484, 0xffe9bae5, 0xffe6a4b6, + 0xffe39270, 0xffe0848b, 0xffdd7b82, 0xffda77cb, + 0xffd779de, 0xffd48231, 0xffd19138, 0xffcea769, + 0xffcbc535, 0xffc8eb10, 0xffc61969, 0xffc350af, + 0xffc09151, 0xffbddbbb, 0xffbb3059, 0xffb88f92, + 0xffb5f9d0, 0xffb36f78, 0xffb0f0ef, 0xffae7e96, + 0xffac18cf, 0xffa9bff9, 0xffa7746f, 0xffa5368c, + 0xffa306aa, 0xffa0e51e, 0xff9ed23c, 0xff9cce56, + 0xff9ad9bc, 0xff98f4bc, 0xff971f9f, 0xff955aae, + 0xff93a62f, 0xff920266, 0xff906f92, 0xff8eedf3, + 0xff8d7dc4, 0xff8c1f3c, 0xff8ad294, 0xff8997fd, + 0xff886fa8, 0xff8759c3, 0xff865679, 0xff8565f2, + 0xff848852, 0xff83bdbd, 0xff830651, 0xff82622b, + 0xff81d163, 0xff815411, 0xff80ea47, 0xff809416, + 0xff80518b, 0xff8022b1, 0xff80078e, 0x00000475, + 0x000007fe, 0x00000c02, 0x000010a3, 0x000015f5, + 0x00001c08, 0x000022ed, 0x00002ab5, 0x00003371, + 0x00003d32, 0x0000480a, 0x0000540d, 0x0000614b, + 0x00006fda, 0x00007fcd, 0x00009138, 0x0000a431, + 0x0000b8cc, 0x0000cf1f, 0x0000e741, 0x00010148, + 0x00011d4b, 0x00013b61, 0x00015ba2, 0x00017e25, + 0x0001a302, 0x0001ca51, 0x0001f42c, 0x000220a9, + 0x00024fe2, 0x000281f0, 0x0002b6ea, 0x0002eee9, + 0x00032a07, 0x0003685a, 0x0003a9fc, 0x0003ef04, + 0x0004378a, 0x000483a5, 0x0004d36d, 0x000526f7, + 0x00057e5b, 0x0005d9ae, 0x00063904, 0x00069c74, + 0x00070410, 0x00076feb, 0x0007e01a, 0x000854ac, + 0x0008cdb3, 0x00094b40, 0x0009cd61, 0x000a5425, + 0x000adf98, 0x000b6fc8, 0x000c04bf, 0x000c9e87, + 0x000d3d2a, 0x000de0ae, 0x000e891a, 0x000f3674, + 0x000fe8c0, 0x00109fff, 0x00115c34, 0x00121d5d, + 0x0012e37b, 0x0013ae89, 0x00147e84, 0x00155366, + 0x00162d27, 0x00170bbf, 0x0017ef23, 0x0018d748, + 0x0019c421, 0x001ab59f, 0x001babb2, 0x001ca648, + 0x001da54f, 0x001ea8b0, 0x001fb058, 0x0020bc2d, + 0x0021cc18, 0x0022dffd, 0x0023f7c2, 0x00251348, + 0x00263272, 0x00275520, 0x00287b31, 0x0029a482, + 0x002ad0f1, 0x002c0059, 0x002d3294, 0x002e677c, + 0x002f9ee8, 0x0030d8b1, 0x003214ac, 0x003352b0, + 0x00349290, 0x0035d422, 0x00371738, 0x00385ba5, + 0x0039a13b, 0x003ae7cc, 0x003c2f2a, 0x003d7725, + 0x003ebf8d, 0x00400834, 0x004150e9, 0x0042997d, + 0x0043e1c0, 0x00452981, 0x00467092, 0x0047b6c3, + 0x0048fbe3, 0x004a3fc6, 0x004b823b, 0x004cc316, + 0x004e0228, 0x004f3f45, 0x00507a40, 0x0051b2ef, + 0x0052e925, 0x00541cba, 0x00554d85, 0x00567b5e, + 0x0057a61d, 0x0058cd9e, 0x0059f1bb, 0x005b1252, + 0x005c2f3f, 0x005d4863, 0x005e5d9d, 0x005f6ed0, + 0x00607bde, 0x006184ad, 0x00628923, 0x00638927, + 0x006484a3, 0x00657b81, 0x00666daf, 0x00675b19, + 0x006843b1, 0x00692767, 0x006a062d, 0x006adff9, + 0x006bb4c2, 0x006c847d, 0x006d4f27, 0x006e14b8, + 0x006ed52f, 0x006f9089, 0x007046c6, 0x0070f7e9, + 0x0071a3f3, 0x00724aea, 0x0072ecd3, 0x007389b6, + 0x0074219d, 0x0074b490, 0x0075429b, 0x0075cbcc, + 0x00765031, 0x0076cfd8, 0x00774ad3, 0x0077c132, + 0x00783308, 0x0078a068, 0x00790968, 0x00796e1c, + 0x0079ce9a, 0x007a2af9, 0x007a8350, 0x007ad7b8, + 0x007b2849, 0x007b751d, 0x007bbe4c, 0x007c03f1, + 0x007c4625, 0x007c8504, 0x007cc0a8, 0x007cf92c, + 0x007d2eaa, 0x007d613e, 0x007d9101, 0x007dbe10, + 0x007de883, 0x007e1076, 0x007e3603, 0x007e5943, + 0x007e7a4f, 0x007e9942, 0x007eb633, 0x007ed13a, + 0x007eea6f, 0x007f01ea, 0x007f17c0, 0x007f2c08, + 0x007f3ed7, 0x007f5043, 0x007f605e, 0x007f6f3c, + 0x007f7cf1, 0x007f898e, 0x007f9525, 0x007f9fc6, + 0x007fa982, 0x007fb268, 0x007fba86, 0x007fc1eb, + 0x007fc8a4, 0x007fcebe, 0x007fd443, 0x007fd941, + 0x007fddc2, 0x007fe1cf, 0x007fe572, 0x007fe8b4, + 0x007feb9e, 0x007fee36, 0x007ff086, 0x007ff293, + 0x007ff463, 0x007ff5fd, 0x007ff765, 0x007ff8a1, + 0x007ff9b6, 0x007ffaa7, 0x007ffb79, 0x007ffc2f, + 0x007ffccb, 0x007ffd52, 0x007ffdc6, 0x007ffe28, + 0x007ffe7b, 0x007ffec2, 0x007ffefd, 0x007fff2f, + 0x007fff58, 0x007fff7b, 0x007fff97, 0x007fffae, + 0x007fffc0, 0x007fffcf, 0x007fffdb, 0x007fffe4, + 0x007fffec, 0x007ffff1, 0x007ffff6, 0x007ffff9, + 0x007ffffb, 0x007ffffd, 0x007ffffe, 0x007fffff, + 0x007fffff, 0x007fffff, 0x007fffff, 0xff800000, + 0x00000000, 0xffa57d86, 0x005a827a, 0xff89be51, + 0x0030fbc5, 0xffcf043b, 0x007641af, 0xff8275a1, + 0x0018f8b8, 0xffb8e313, 0x006a6d99, 0xff959267, + 0x00471ced, 0xffe70748, 0x007d8a5f, 0xff809dc9, + 0x000c8bd3, 0xffaecc33, 0x0062f202, 0xff8f1d34, + 0x003c56ba, 0xffdad7f4, 0x007a7d05, 0xff8582fb, + 0x0025280c, 0xffc3a946, 0x0070e2cc, 0xff9d0dfe, + 0x005133cd, 0xfff3742d, 0x007f6237, 0xff802778, + 0x000647d9, 0xffaa0a5b, 0x005ed77d, 0xff8c4a14, + 0x0036ba20, 0xffd4e0cb, 0x00788484, 0xff83d604, + 0x001f19f9, 0xffbe31e2, 0x006dca0d, 0xff99307f, + 0x004c3fe0, 0xffed37f0, 0x007e9d56, 0xff8162aa, + 0x0012c810, 0xffb3c020, 0x0066cf81, 0xff9235f3, + 0x0041ce1e, 0xffe0e607, 0x007c29fc, 0xff877b7c, + 0x002b1f35, 0xffc945e0, 0x0073b5ec, 0xffa12883, + 0x0055f5a5, 0xfff9b827, 0x007fd888, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + +}; + +static u32 AC3Ucode1fe000[] = { + 0x00000000, 0x03020102, 0x05040403, 0x00400040, + 0x00500050, 0x00600060, 0x00700070, 0x00800080, + 0x00a000a0, 0x00c000c0, 0x00e000e0, 0x01000100, + 0x01400140, 0x01800180, 0x01c001c0, 0x02000200, + 0x02800280, 0x03000300, 0x03800380, 0x04000400, + 0x04800480, 0x05000500, 0x00460045, 0x00580057, + 0x00690068, 0x007a0079, 0x008c008b, 0x00af00ae, + 0x00d100d0, 0x00f400f3, 0x01170116, 0x015d015c, + 0x01a201a1, 0x01e801e7, 0x022e022d, 0x02b902b8, + 0x03440343, 0x03d003cf, 0x045b045a, 0x04e604e5, + 0x05720571, 0x00600060, 0x00780078, 0x00900090, + 0x00a800a8, 0x00c000c0, 0x00f000f0, 0x01200120, + 0x01500150, 0x01800180, 0x01e001e0, 0x02400240, + 0x02a002a0, 0x03000300, 0x03c003c0, 0x04800480, + 0x05400540, 0x06000600, 0x06c006c0, 0x07800780, + 0x7b67533f, 0x1513110f, 0x04d80540, 0x04100478, + 0x07000000, 0x0b000900, 0x02b002f0, 0x02300270, + 0x017001f0, 0xf80000f0, 0x01000080, 0x02000180, + 0x03000280, 0x04000380, 0x2725231f, 0x2c2b2a29, + 0x2e2e2d2d, 0x30302f2f, 0x04030201, 0x08070605, + 0x0c0b0a09, 0x100f0e0d, 0x14131211, 0x18171615, + 0x1c1b1a19, 0x2825221f, 0x37312e2b, 0x4f49433d, + 0x796d6155, 0xcdb59d85, 0x0000fde5, 0x3d3e3f40, + 0x393a3b3c, 0x35363738, 0x32333434, 0x2f2f3031, + 0x2c2c2d2e, 0x29292a2b, 0x26262728, 0x23242425, + 0x21212223, 0x1e1f2020, 0x1c1d1d1e, 0x1a1b1b1c, + 0x1819191a, 0x16171718, 0x15151516, 0x13131414, + 0x12121213, 0x10111111, 0x0f0f1010, 0x0e0e0e0f, + 0x0d0d0d0d, 0x0c0c0c0c, 0x0b0b0b0b, 0x0a0a0a0a, + 0x0909090a, 0x08080909, 0x08080808, 0x07070707, + 0x06060707, 0x06060606, 0x05050606, 0x05050505, + 0x04040505, 0x04040404, 0x04040404, 0x03030304, + 0x03030303, 0x03030303, 0x02030303, 0x02020202, + 0x02020202, 0x02020202, 0x02020202, 0x01010202, + 0x01010101, 0x01010101, 0x01010101, 0x01010101, + 0x01010101, 0x01010101, 0x01010101, 0x00000101, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x04d004d0, + 0x04000440, 0x03c003e0, 0x03b003b0, 0x03a003a0, + 0x03a003a0, 0x039003a0, 0x03900390, 0x03800380, + 0x03700370, 0x03600360, 0x03500350, 0x03400340, + 0x03200330, 0x03000310, 0x02f002f0, 0x02f002f0, + 0x03100300, 0x03900340, 0x042003e0, 0x04900460, + 0x046004a0, 0x04400440, 0x08000520, 0x08400840, + 0x04f004f0, 0x04100460, 0x03d003e0, 0x03b003c0, + 0x03a003b0, 0x03a003a0, 0x03a003a0, 0x03900390, + 0x03800390, 0x03800380, 0x03700370, 0x03600360, + 0x03500350, 0x03400340, 0x03100320, 0x02f00300, + 0x02f002f0, 0x030002f0, 0x03500320, 0x03e00390, + 0x04500420, 0x049004a0, 0x04400460, 0x06300480, + 0x08400840, 0x05800580, 0x045004b0, 0x03f00420, + 0x03d003e0, 0x03b003c0, 0x03b003b0, 0x03a003a0, + 0x03a003a0, 0x03a003a0, 0x03a003a0, 0x03900390, + 0x03900390, 0x03800380, 0x03700380, 0x03500360, + 0x03300340, 0x03100320, 0x02f00300, 0x02f002f0, + 0x03100300, 0x03500330, 0x041003c0, 0x04a00470, + 0x04400460, 0x04e00450, 0xffaaaaab, 0x00000000, + 0x00555555, 0xff99999a, 0xffcccccd, 0x00000000, + 0x00333333, 0x00666666, 0xff924925, 0xffb6db6e, + 0xffdb6db7, 0x00000000, 0x00249249, 0x00492492, + 0x006db6db, 0xff8ba2e9, 0xffa2e8ba, 0xffba2e8c, + 0xffd1745d, 0xffe8ba2f, 0x00000000, 0x001745d1, + 0x002e8ba3, 0x0045d174, 0x005d1746, 0x00745d17, + 0xff888889, 0xff99999a, 0xffaaaaab, 0xffbbbbbc, + 0xffcccccd, 0xffddddde, 0xffeeeeef, 0x00000000, + 0x00111111, 0x00222222, 0x00333333, 0x00444444, + 0x00555555, 0x00666666, 0x00777777, 0x08070605, + 0x0c0b0a09, 0x10100e0e, 0x00000010, 0x00000000, + 0x00000010, 0x00000020, 0x00000100, 0x00000110, + 0x00000120, 0x00000200, 0x00000210, 0x00000220, + 0x00001000, 0x00001010, 0x00001020, 0x00001100, + 0x00001110, 0x00001120, 0x00001200, 0x00001210, + 0x00001220, 0x00002000, 0x00002010, 0x00002020, + 0x00002100, 0x00002110, 0x00002120, 0x00002200, + 0x00002210, 0x00002220, 0x00000000, 0x00000010, + 0x00000020, 0x00000030, 0x00000040, 0x00000100, + 0x00000110, 0x00000120, 0x00000130, 0x00000140, + 0x00000200, 0x00000210, 0x00000220, 0x00000230, + 0x00000240, 0x00000300, 0x00000310, 0x00000320, + 0x00000330, 0x00000340, 0x00000400, 0x00000410, + 0x00000420, 0x00000430, 0x00000440, 0x00001000, + 0x00001010, 0x00001020, 0x00001030, 0x00001040, + 0x00001100, 0x00001110, 0x00001120, 0x00001130, + 0x00001140, 0x00001200, 0x00001210, 0x00001220, + 0x00001230, 0x00001240, 0x00001300, 0x00001310, + 0x00001320, 0x00001330, 0x00001340, 0x00001400, + 0x00001410, 0x00001420, 0x00001430, 0x00001440, + 0x00002000, 0x00002010, 0x00002020, 0x00002030, + 0x00002040, 0x00002100, 0x00002110, 0x00002120, + 0x00002130, 0x00002140, 0x00002200, 0x00002210, + 0x00002220, 0x00002230, 0x00002240, 0x00002300, + 0x00002310, 0x00002320, 0x00002330, 0x00002340, + 0x00002400, 0x00002410, 0x00002420, 0x00002430, + 0x00002440, 0x00003000, 0x00003010, 0x00003020, + 0x00003030, 0x00003040, 0x00003100, 0x00003110, + 0x00003120, 0x00003130, 0x00003140, 0x00003200, + 0x00003210, 0x00003220, 0x00003230, 0x00003240, + 0x00003300, 0x00003310, 0x00003320, 0x00003330, + 0x00003340, 0x00003400, 0x00003410, 0x00003420, + 0x00003430, 0x00003440, 0x00004000, 0x00004010, + 0x00004020, 0x00004030, 0x00004040, 0x00004100, + 0x00004110, 0x00004120, 0x00004130, 0x00004140, + 0x00004200, 0x00004210, 0x00004220, 0x00004230, + 0x00004240, 0x00004300, 0x00004310, 0x00004320, + 0x00004330, 0x00004340, 0x00004400, 0x00004410, + 0x00004420, 0x00004430, 0x00004440, 0x00000000, + 0x00000100, 0x00000200, 0x00000300, 0x00000400, + 0x00000500, 0x00000600, 0x00000700, 0x00000800, + 0x00000900, 0x00000a00, 0x00001000, 0x00001100, + 0x00001200, 0x00001300, 0x00001400, 0x00001500, + 0x00001600, 0x00001700, 0x00001800, 0x00001900, + 0x00001a00, 0x00002000, 0x00002100, 0x00002200, + 0x00002300, 0x00002400, 0x00002500, 0x00002600, + 0x00002700, 0x00002800, 0x00002900, 0x00002a00, + 0x00003000, 0x00003100, 0x00003200, 0x00003300, + 0x00003400, 0x00003500, 0x00003600, 0x00003700, + 0x00003800, 0x00003900, 0x00003a00, 0x00004000, + 0x00004100, 0x00004200, 0x00004300, 0x00004400, + 0x00004500, 0x00004600, 0x00004700, 0x00004800, + 0x00004900, 0x00004a00, 0x00005000, 0x00005100, + 0x00005200, 0x00005300, 0x00005400, 0x00005500, + 0x00005600, 0x00005700, 0x00005800, 0x00005900, + 0x00005a00, 0x00006000, 0x00006100, 0x00006200, + 0x00006300, 0x00006400, 0x00006500, 0x00006600, + 0x00006700, 0x00006800, 0x00006900, 0x00006a00, + 0x00007000, 0x00007100, 0x00007200, 0x00007300, + 0x00007400, 0x00007500, 0x00007600, 0x00007700, + 0x00007800, 0x00007900, 0x00007a00, 0x00008000, + 0x00008100, 0x00008200, 0x00008300, 0x00008400, + 0x00008500, 0x00008600, 0x00008700, 0x00008800, + 0x00008900, 0x00008a00, 0x00009000, 0x00009100, + 0x00009200, 0x00009300, 0x00009400, 0x00009500, + 0x00009600, 0x00009700, 0x00009800, 0x00009900, + 0x00009a00, 0x0000a000, 0x0000a100, 0x0000a200, + 0x0000a300, 0x0000a400, 0x0000a500, 0x0000a600, + 0x0000a700, 0x0000a800, 0x0000a900, 0x0000aa00, + 0xff800000, 0xff800000, 0xffb82995, 0xffaf5d75, + 0xffa57d87, 0xff9a6806, 0xff8df708, 0xff800000, + 0xffb82995, 0xffaf5d75, 0xffa57d87, 0xff9a6806, + 0xff8df708, 0xff800000, 0xffb82995, 0xffaf5d75, + 0xffa57d87, 0xff9a6806, 0xff8df708, 0xff800000, + 0xffb82995, 0xffaf5d75, 0xffa57d87, 0xff9a6806, + 0xff8df708, 0xff800000, 0xffb82995, 0xffaf5d75, + 0xffa57d87, 0xff9a6806, 0xff8df708, 0xff800000, + 0xfffb0000, 0xfffcfffc, 0xfffcfffc, 0xfffcfffc, + 0xfffdfffd, 0xfffdfffd, 0xfffdfffd, 0xfffefffe, + 0xfffefffe, 0xfffefffe, 0xffffffff, 0xffffffff, + 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x80050000, 0x000a800f, 0x001e801b, 0x80110014, + 0x00368033, 0x8039003c, 0x802d0028, 0x00228027, + 0x00668063, 0x8069006c, 0x807d0078, 0x00728077, + 0x80550050, 0x005a805f, 0x004e804b, 0x80410044, + 0x00c680c3, 0x80c900cc, 0x80dd00d8, 0x00d280d7, + 0x80f500f0, 0x00fa80ff, 0x00ee80eb, 0x80e100e4, + 0x80a500a0, 0x00aa80af, 0x00be80bb, 0x80b100b4, + 0x00968093, 0x8099009c, 0x808d0088, 0x00828087, + 0x01868183, 0x8189018c, 0x819d0198, 0x01928197, + 0x81b501b0, 0x01ba81bf, 0x01ae81ab, 0x81a101a4, + 0x81e501e0, 0x01ea81ef, 0x01fe81fb, 0x81f101f4, + 0x01d681d3, 0x81d901dc, 0x81cd01c8, 0x01c281c7, + 0x81450140, 0x014a814f, 0x015e815b, 0x81510154, + 0x01768173, 0x8179017c, 0x816d0168, 0x01628167, + 0x01268123, 0x8129012c, 0x813d0138, 0x01328137, + 0x81150110, 0x011a811f, 0x010e810b, 0x81010104, + 0x03068303, 0x8309030c, 0x831d0318, 0x03128317, + 0x83350330, 0x033a833f, 0x032e832b, 0x83210324, + 0x83650360, 0x036a836f, 0x037e837b, 0x83710374, + 0x03568353, 0x8359035c, 0x834d0348, 0x03428347, + 0x83c503c0, 0x03ca83cf, 0x03de83db, 0x83d103d4, + 0x03f683f3, 0x83f903fc, 0x83ed03e8, 0x03e283e7, + 0x03a683a3, 0x83a903ac, 0x83bd03b8, 0x03b283b7, + 0x83950390, 0x039a839f, 0x038e838b, 0x83810384, + 0x82850280, 0x028a828f, 0x029e829b, 0x82910294, + 0x02b682b3, 0x82b902bc, 0x82ad02a8, 0x02a282a7, + 0x02e682e3, 0x82e902ec, 0x82fd02f8, 0x02f282f7, + 0x82d502d0, 0x02da82df, 0x02ce82cb, 0x82c102c4, + 0x02468243, 0x8249024c, 0x825d0258, 0x02528257, + 0x82750270, 0x027a827f, 0x026e826b, 0x82610264, + 0x82250220, 0x022a822f, 0x023e823b, 0x82310234, + 0x02168213, 0x8219021c, 0x820d0208, 0x02028207, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, + 0x00000000, 0xff800000, 0xffa57d86, 0xffa57d86, + 0xffcf043b, 0xff89be51, 0xff89be51, 0xffcf043b, + 0xffe70748, 0xff8275a1, 0xff959267, 0xffb8e313, + 0xffb8e313, 0xff959267, 0xff8275a1, 0xffe70748, + 0xfff3742d, 0xff809dc9, 0xff9d0dfe, 0xffaecc33, + 0xffc3a946, 0xff8f1d34, 0xff8582fb, 0xffdad7f4, + 0xffdad7f4, 0xff8582fb, 0xff8f1d34, 0xffc3a946, + 0xffaecc33, 0xff9d0dfe, 0xff809dc9, 0xfff3742d, + 0xfff9b827, 0xff802778, 0xffa12883, 0xffaa0a5b, + 0xffc945e0, 0xff8c4a14, 0xff877b7c, 0xffd4e0cb, + 0xffe0e607, 0xff83d604, 0xff9235f3, 0xffbe31e2, + 0xffb3c020, 0xff99307f, 0xff8162aa, 0xffed37f0, + 0xffed37f0, 0xff8162aa, 0xff99307f, 0xffb3c020, + 0xffbe31e2, 0xff9235f3, 0xff83d604, 0xffe0e607, + 0xffd4e0cb, 0xff877b7c, 0xff8c4a14, 0xffc945e0, + 0xffaa0a5b, 0xffa12883, 0xff802778, 0xfff9b827, + 0xcbcecdc4, 0xcfcac9c8, 0xc3c6c5cc, 0xc7c2c1c0, + 0x1b1e1d14, 0x1f1a1918, 0x1316151c, 0x17121110, + 0x2b2e2d24, 0x2f2a2928, 0x2326252c, 0x27222120, + 0x3b3e3d34, 0x3f3a3938, 0x3336353c, 0x37323130, + 0x0b0e0d04, 0x0f0a0908, 0x0306050c, 0x07020100, + 0xdbdeddd4, 0xdfdad9d8, 0xd3d6d5dc, 0xd7d2d1d0, + 0xebeeede4, 0xefeae9e8, 0xe3e6e5ec, 0xe7e2e1e0, + 0xfbfefdf4, 0xfffaf9f8, 0xf3f6f5fc, 0xf7f2f1f0, + 0x4b4e4d44, 0x4f4a4948, 0x4346454c, 0x47424140, + 0x9b9e9d94, 0x9f9a9998, 0x9396959c, 0x97929190, + 0xabaeada4, 0xafaaa9a8, 0xa3a6a5ac, 0xa7a2a1a0, + 0xbbbebdb4, 0xbfbab9b8, 0xb3b6b5bc, 0xb7b2b1b0, + 0x8b8e8d84, 0x8f8a8988, 0x8386858c, 0x87828180, + 0x5b5e5d54, 0x5f5a5958, 0x5356555c, 0x57525150, + 0x6b6e6d64, 0x6f6a6968, 0x6366656c, 0x67626160, + 0x7b7e7d74, 0x7f7a7978, 0x7376757c, 0x77727170, + 0x341424c4, 0x3e1e2ece, 0x3d1d2dcd, 0x3b1b2bcb, + 0xb494a444, 0xbe9eae4e, 0xbd9dad4d, 0xbb9bab4b, + 0xf4d4e404, 0xfedeee0e, 0xfddded0d, 0xfbdbeb0b, + 0x74546484, 0x7e5e6e8e, 0x7d5d6d8d, 0x7b5b6b8b, + 0x3c1c2ccc, 0x361626c6, 0x351525c5, 0x331323c3, + 0xbc9cac4c, 0xb696a646, 0xb595a545, 0xb393a343, + 0xfcdcec0c, 0xf6d6e606, 0xf5d5e505, 0xf3d3e303, + 0x7c5c6c8c, 0x76566686, 0x75556585, 0x73536383, + 0x381828c8, 0x3a1a2aca, 0x391929c9, 0x3f1f2fcf, + 0xb898a848, 0xba9aaa4a, 0xb999a949, 0xbf9faf4f, + 0xf8d8e808, 0xfadaea0a, 0xf9d9e909, 0xffdfef0f, + 0x78586888, 0x7a5a6a8a, 0x79596989, 0x7f5f6f8f, + 0x301020c0, 0x321222c2, 0x311121c1, 0x371727c7, + 0xb090a040, 0xb292a242, 0xb191a141, 0xb797a747, + 0xf0d0e000, 0xf2d2e202, 0xf1d1e101, 0xf7d7e707, + 0x70506080, 0x72526282, 0x71516181, 0x77576787, + 0x05040100, 0x15141110, 0x25242120, 0x35343130, + 0x85848180, 0x95949190, 0xa5a4a1a0, 0xb5b4b1b0, + 0xc0408000, 0xe060a020, 0xd0509010, 0xf070b030, + 0xc8488808, 0xe868a828, 0xd8589818, 0xf878b838, + 0xc4448404, 0xe464a424, 0xd4549414, 0xf474b434, + 0xcc4c8c0c, 0xec6cac2c, 0xdc5c9c1c, 0xfc7cbc3c, + 0xc2428202, 0xe262a222, 0xd2529212, 0xf272b232, + 0xca4a8a0a, 0xea6aaa2a, 0xda5a9a1a, 0xfa7aba3a, + 0xc6468606, 0xe666a626, 0xd6569616, 0xf676b636, + 0xce4e8e0e, 0xee6eae2e, 0xde5e9e1e, 0xfe7ebe3e, + 0xc1418101, 0xe161a121, 0xd1519111, 0xf171b131, + 0xc9498909, 0xe969a929, 0xd9599919, 0xf979b939, + 0xc5458505, 0xe565a525, 0xd5559515, 0xf575b535, + 0xcd4d8d0d, 0xed6dad2d, 0xdd5d9d1d, 0xfd7dbd3d, + 0xc3438303, 0xe363a323, 0xd3539313, 0xf373b333, + 0xcb4b8b0b, 0xeb6bab2b, 0xdb5b9b1b, 0xfb7bbb3b, + 0xc7478707, 0xe767a727, 0xd7579717, 0xf777b737, + 0xcf4f8f0f, 0xef6faf2f, 0xdf5f9f1f, 0xff7fbf3f, + 0x1045a3e2, 0x000000f4, 0x263b7333, 0x766b2363, + 0x2b367e3e, 0x7b662e6e, 0x06db93d3, 0x964b0343, + 0x0bd69ede, 0x9b460e4e, 0x825f1757, 0x12cf87c7, + 0x8f521a5a, 0x1fc28aca, 0x00d199d9, 0x90410949, + 0x01d098d8, 0x91400848, 0x24357d3d, 0x74652d6d, + 0x25347c3c, 0x75642c6c, 0x04d59ddd, 0x94450d4d, + 0x05d49cdc, 0x95440c4c, 0x80511959, 0x10c189c9, + 0x81501858, 0x11c088c8, 0x02df97d7, 0x924f0747, + 0x0fd29ada, 0x9f420a4a, 0x865b1353, 0x16cb83c3, + 0x8b561e5e, 0x1bc68ece, 0xa6bbf3b3, 0xf6eba3e3, + 0xabb6febe, 0xfbe6aeee, 0x223f7737, 0x726f2767, + 0x2f327a3a, 0x7f622a6a, 0xa0b1f9b9, 0xf0e1a9e9, + 0xa1b0f8b8, 0xf1e0a8e8, 0x84551d5d, 0x14c58dcd, + 0x85541c5c, 0x15c48ccc, 0xa4b5fdbd, 0xf4e5aded, + 0xa5b4fcbc, 0xf5e4acec, 0x20317939, 0x70612969, + 0x21307838, 0x71602868, 0xa2bff7b7, 0xf2efa7e7, + 0xafb2faba, 0xffe2aaea, 0x00000000, 0x00000000, +}; + +static u32 AC3Ucode1fff80[] = { + 0x0000240f, 0x007fffff, 0x007fffff, 0x00000003, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/ac3i2s_240.h linux.20pre5-ac2/drivers/media/video/ls220/ac3i2s_240.h --- linux.20pre5/drivers/media/video/ls220/ac3i2s_240.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/ac3i2s_240.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,2833 @@ +static u32 AC3I2S240Ucode1f1800[] = { + 0xb500000f, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xb5001197, 0x00000000, 0x00000000, 0x00000000, + 0x820f001f, 0x802f001f, 0x80070800, 0x001f6193, + 0x800500d4, 0x8053ffff, 0x9842c7ff, 0x8039ff7c, + 0x1400b802, 0x003f6000, 0x94210007, 0xb0010001, + 0xb4200001, 0x98002800, 0xb0010000, 0xb4200001, + 0x98000800, 0x805300ff, 0x1800b802, 0x800600d4, + 0x8013001f, 0x9020c000, 0x003fb006, 0x803effe0, + 0x803effe8, 0x803effec, 0x9020e000, 0x9021ffe4, + 0x9020fa00, 0x803effd0, 0x803effdc, 0x803effd8, + 0x9020fe00, 0x803effd4, 0x90400000, 0x804600a2, + 0x90421800, 0x804600a3, 0x80134099, 0x98000040, + 0x800600a6, 0x80130000, 0x98003ca1, 0x800600a1, + 0x80050080, 0x98000002, 0x80060080, 0x80070001, + 0x001f2013, 0x001f2324, 0x80070000, 0x001fb0ba, + 0x001f23f9, 0x801eb3f0, 0x80070800, 0x001f600f, + 0x80070000, 0x001f2012, 0x001fb0cb, 0x001fb010, + 0x801efff0, 0x98004000, 0x98008000, 0x001f600e, + 0x83e4012b, 0x80070000, 0x801eb3f8, 0x801eff70, + 0x800500a0, 0xb0000001, 0xb4000009, 0x80070001, + 0x800600a0, 0x80050080, 0x98000020, 0x80060080, + 0x9400ffdf, 0x80060080, 0x80070000, 0x800600a0, + 0x81df0004, 0x00000000, 0x00000000, 0x801bfff0, + 0x00000000, 0x940000ff, 0xb0000000, 0xb420004e, + 0x003f400e, 0x94010010, 0xb0000000, 0xb400fff4, + 0x838413ac, 0x003f0013, 0xb0010001, 0xb420003b, + 0x803bffe8, 0x801bffec, 0x00000000, 0x3001b800, + 0xb4600001, 0x90212000, 0x0421b800, 0x005f4193, + 0x5841b802, 0x3001b802, 0xb460000d, 0x80050086, + 0x005f9016, 0xb0020000, 0xb4200002, 0x001fb016, + 0xb500ffdf, 0x0420b802, 0xb0010b50, 0xb4a0ffdc, + 0x80070000, 0x001fb016, 0x83e400f5, 0xb500ffd8, + 0x80070000, 0x001fb016, 0x001f400e, 0x9400000f, + 0xb0000000, 0xb4000014, 0xb0000001, 0xb4000010, + 0x003f400e, 0x9421fff0, 0x003f600e, 0x003f9006, + 0x9421ffff, 0x90210004, 0xb001e000, 0xb4800002, + 0x8421e000, 0x9021c000, 0x8013001f, 0x1021b800, + 0x003fb006, 0x003f90cb, 0x90210004, 0x003fb0cb, + 0x83e400e7, 0x83e4138b, 0x8007001f, 0x94000003, + 0x5810b800, 0x83e71aa8, 0x1bffb800, 0x003f9008, + 0x1821b800, 0x00ffb801, 0x83e413de, 0x80270000, + 0x003f2013, 0x8007001f, 0x94000003, 0x5810b800, + 0x83671ad4, 0x1b7bb800, 0x003f9009, 0x1821b800, + 0x00ffb801, 0xb500ffaa, 0x803bffc0, 0x805bffc4, + 0x807bffc8, 0x809bffcc, 0x5828b801, 0x5cb8b802, + 0x1821b805, 0x5848b802, 0x5cb8b803, 0x1842b805, + 0x5868b803, 0x5cb8b804, 0x1863b805, 0x5888b804, + 0x1884b800, 0x803effc0, 0x805effc4, 0x807effc8, + 0x809effcc, 0x003f400e, 0xb0000086, 0xb4400048, + 0xb0000084, 0xb4000032, 0xb0000085, 0xb4000038, + 0xb0000086, 0xb400003a, 0x001f4000, 0x94000080, + 0xb0000080, 0xb4000072, 0x800500d4, 0x8053ffff, + 0x9842c7ff, 0x1400b802, 0x805300ff, 0x98422800, + 0x1800b802, 0x800600d4, 0x80130000, 0x98000c7f, + 0x005f4000, 0x94420008, 0xb0020008, 0xb4200001, + 0xa0000080, 0x800600a1, 0x8013001f, 0x9040c000, + 0x005fb006, 0x805effe0, 0x805effe8, 0x805effec, + 0x9040e000, 0x805effe4, 0x9040fa00, 0x805effd0, + 0x805effdc, 0x805effd8, 0x9040fe00, 0x805effd4, + 0x80070001, 0x001f2013, 0x80070000, 0x001fb0cb, + 0x001fb010, 0x001f2058, 0x80071f60, 0x001fb008, + 0x80075d70, 0x001fb009, 0x98214000, 0xb5000010, + 0x94011000, 0xb0001000, 0xb4200001, 0x9421efff, + 0x98210010, 0xb500000a, 0x80070000, 0x001fb0cb, + 0x83e4007f, 0x003f400e, 0x9421ffef, 0xb5000004, + 0x83e4007b, 0x003f400e, 0x98211000, 0x9421ffef, + 0x003f600e, 0x80070100, 0x801efff0, 0xb500ff4c, + 0xb000008b, 0xb400001c, 0xb000008e, 0xb4000022, + 0xb000008d, 0xb400001c, 0xb000008c, 0xb4000021, + 0xb0000087, 0xb400ffe8, 0xb0000088, 0xb4000014, + 0xb000008a, 0xb4000015, 0xb0000089, 0xb400001d, + 0xb00000a0, 0xb400001f, 0xb00000a1, 0xb4000041, + 0xb00000a2, 0xb400004a, 0xb00000a3, 0xb4000046, + 0xb00000a4, 0xb4000048, 0xb00000a5, 0xb4000048, + 0xb00000a6, 0xb4000048, 0x803efff8, 0xb500ffdd, + 0x9421ffdf, 0xb500ffda, 0xb500ffda, 0x80270100, + 0x803efff8, 0xb500ffd7, 0x80070000, 0x001fb017, + 0xb500ffd4, 0x801bffb0, 0x00000000, 0x001fb003, + 0xb500ffd0, 0x803bff80, 0x00000000, 0x003f6001, + 0xb500ffcc, 0x003f90ba, 0x803efff8, 0xb500ffc9, + 0x80130001, 0x98003da1, 0x800600a1, 0x80070200, + 0x801ebf34, 0x83e4002e, 0x8013001f, 0x9840c000, + 0x805effe0, 0x005fb006, 0x805effe8, 0x805effec, + 0x90422000, 0x805effe4, 0x9040fa00, 0x805effd0, + 0x805effdc, 0x805effd8, 0x9040fe00, 0x805effd4, + 0x80070001, 0x001f2013, 0x80070000, 0x001f2324, + 0x001fb0cb, 0x001fb010, 0x001f2058, 0x800774b0, + 0x001fb008, 0x80077730, 0x001fb009, 0x98214000, + 0xb500ffa7, 0x80270000, 0x8047fef0, 0x003eb802, + 0x90420004, 0x003eb802, 0x90420004, 0x003eb802, + 0x90420004, 0x003eb802, 0x83641460, 0xb500ff9d, + 0x8364140e, 0xb500ff9b, 0x836413cd, 0xb500ff99, + 0x83441334, 0xb500ff97, 0x8344131d, 0xb500ff95, + 0x80070000, 0x80470000, 0xb6002003, 0xb6003002, + 0x001eb802, 0x90420004, 0x80171000, 0x8057ffff, + 0xb6002002, 0xb6001801, 0x001fa020, 0x00ffb81f, + 0x001f4000, 0x94000080, 0xb0000080, 0xb4200001, + 0xb500ffef, 0xb500000a, 0x80270000, 0x003f2013, + 0x8007001f, 0x94000003, 0x5810b800, 0x83671e60, + 0x1b7bb800, 0x003f9009, 0x1821b800, 0x00ffb801, + 0x003f0013, 0xb0010001, 0xb420fff3, 0x83a70000, + 0x803bff70, 0x00000000, 0xb0010000, 0xb4000011, + 0x80170300, 0x80070000, 0xb6000601, 0x001fa020, + 0x83640c66, 0x00ff0325, 0x82870000, 0xb6270002, + 0x83640217, 0x92940001, 0x001f033b, 0xb0000000, + 0xb4000002, 0x80270000, 0xb5000001, 0x80270001, + 0x003f233b, 0x80270000, 0x003f2013, 0x8007001f, + 0x94000003, 0x5810b800, 0x83671eec, 0x1b7bb800, + 0x003f9009, 0x1821b800, 0x00ffb801, 0x003f0013, + 0xb0010001, 0xb420fff3, 0x93bd0001, 0xb01d0004, + 0xb480ffdb, 0x803bff70, 0x00000000, 0xb0010000, + 0xb4000001, 0x83640c12, 0x00000000, 0x00000000, + 0x00ffb81f, 0x007f90cb, 0x90630400, 0x007fb0cb, + 0x003f9006, 0x9421ffff, 0x90210400, 0xb001e000, + 0xb4800002, 0x8421e000, 0x9021c000, 0x8013001f, + 0x1021b800, 0x003fb006, 0x803effec, 0x00ffb81f, + 0x015f400e, 0x944a4000, 0xb0024000, 0xb4200084, + 0x954abfff, 0x015f600e, 0x820f001f, 0x802f001f, + 0x81470000, 0x015f23f9, 0x829702ec, 0x82d7ffff, + 0x82f70000, 0xb6000501, 0x029fa02a, 0x82970400, + 0xb6000702, 0xb6000001, 0x029fa02a, 0x8053ff00, + 0x98420000, 0x805ebf14, 0x805ebf18, 0x805ebf1c, + 0x805ebf20, 0x805ebf24, 0x805ebf28, 0x80270000, + 0x003f2328, 0x80275480, 0x005fb801, 0x8033001f, + 0x9821c000, 0x803effe0, 0x90212000, 0x803effe4, + 0x80dbff8c, 0x80fbff90, 0x80debf14, 0x80febf18, + 0x80dbff94, 0x80fbff98, 0x80debf1c, 0x80febf20, + 0x80dbff9c, 0x80fbffa0, 0x80debf24, 0x80febf28, + 0x80dbff84, 0x80e70001, 0x00dfb001, 0x80dbff88, + 0x00ff6191, 0x00dfb002, 0x80dbffb0, 0x80470000, + 0x00dfb003, 0x80d9ff80, 0x005fb0cf, 0x005fb0c6, + 0x00df6001, 0x80470001, 0x005f618f, 0x804700ff, + 0x005f231c, 0x005f231d, 0x80470000, 0x005f204e, + 0x8047e138, 0x5c42b802, 0x814f6300, 0x80cf00a9, + 0x005fb0bc, 0x5842b802, 0x01cfb802, 0x005f90bc, + 0xb520ffff, 0x8067e16c, 0x5c62b803, 0x80270040, + 0xb6000209, 0x814fffc0, 0x00cfb801, 0x007fb0bc, + 0x5862b803, 0x01cfb803, 0x007f90bc, 0xb520ffff, + 0x90210020, 0x90630020, 0x8047e398, 0x5c42b802, + 0x814fce40, 0x80cf0080, 0x005fb0bc, 0x5842b802, + 0x01cfb802, 0x005f90bc, 0xb520ffff, 0x8047e400, + 0x5c42b802, 0x814f7380, 0x80cf009a, 0x005fb0bc, + 0x5842b802, 0x01cfb802, 0x005f90bc, 0xb520ffff, + 0x8047e43c, 0x5c42b802, 0x814f18c0, 0x80cf00b6, + 0x005fb0bc, 0x5842b802, 0x01cfb802, 0x005f90bc, + 0xb520ffff, 0x80e70000, 0x00ffb0ba, 0x808f0000, + 0x806f001f, 0x80af001f, 0x8027b9fc, 0x5c22b801, + 0x80670700, 0xb600080a, 0x00cfb803, 0x003fb0bc, + 0x5822b801, 0x01cfb801, 0x003f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90210020, 0x90630020, + 0x834400d3, 0xb0180000, 0xb4200025, 0x83440678, + 0x80c70000, 0x00df2324, 0x83640026, 0x83440220, + 0x00df0324, 0x90c60001, 0x00df2324, 0xb0060006, + 0xb4000003, 0x81472198, 0x015fb008, 0x00ffb81f, + 0x00ff90ba, 0x90e70001, 0x00ffb0ba, 0x019f9006, + 0x958cffff, 0x00df4193, 0x58c1b806, 0x118cb806, + 0xb00ce000, 0xb4800002, 0x858ce000, 0x918cc000, + 0x8153001f, 0x118cb80a, 0x819effec, 0x019fb006, + 0x015f4193, 0x5941b80a, 0x019f90cb, 0x118cb80a, + 0x019fb0cb, 0x81472180, 0x015fb008, 0x00ffb81f, + 0x015f400e, 0x194ab818, 0x015f600e, 0x802500a5, + 0x00ffb81f, 0x803bff8c, 0x805bff90, 0x803ebf14, + 0x805ebf18, 0x803bff94, 0x805bff98, 0x803ebf1c, + 0x805ebf20, 0x803bff9c, 0x805bffa0, 0x803ebf24, + 0x805ebf28, 0x80470003, 0x805ebefc, 0x003f0384, + 0x5822b801, 0x9021eb50, 0x005bb801, 0x00000000, + 0xb0020001, 0xb4200002, 0x80470001, 0x805ebefc, + 0x8073ff80, 0x98630000, 0x8027bf14, 0x8047befc, + 0xb6000609, 0x009bb801, 0x00000000, 0x00a7b804, + 0x6081b804, 0x3004b803, 0xb4000001, 0x00beb802, + 0x90210004, 0x90420004, 0x00ffb81b, 0x00000000, + 0x81150010, 0x00000000, 0x00000000, 0x81350010, + 0x00000000, 0x00000000, 0x81550002, 0x00000000, + 0x015f2380, 0x81550006, 0x00000000, 0x015f2381, + 0x81550005, 0x00000000, 0x015f2382, 0x81550003, + 0x00000000, 0x015f2383, 0x81550003, 0x015f2384, + 0xb00a0001, 0xb4000005, 0x956a0001, 0xb00b0000, + 0xb4000002, 0x81750002, 0x017f2385, 0x956a0004, + 0xb00b0000, 0xb4000002, 0x81750002, 0x017f2386, + 0xb00a0002, 0xb4200003, 0x81750002, 0x00000000, + 0x017f2387, 0x81750001, 0x00000000, 0x017f2388, + 0x81750005, 0x00000000, 0x017f2389, 0x81750001, + 0x017f239f, 0xb00b0001, 0xb4200003, 0x81750008, + 0x5968b80b, 0x017f61c5, 0x81750001, 0x017f238c, + 0xb00b0001, 0xb4200003, 0x81750008, 0x00000000, + 0x017f238d, 0x81750001, 0x017f238e, 0xb00b0001, + 0xb4200005, 0x81750005, 0x00000000, 0x017f238f, + 0x81750002, 0x017f2390, 0xb00a0000, 0xb420001b, + 0x81750005, 0x00000000, 0x017f2391, 0x81750001, + 0x017f23a0, 0xb00b0001, 0xb4200003, 0x81750008, + 0x5968b80b, 0x017f61c9, 0x81750001, 0x017f2394, + 0xb00b0001, 0xb4200003, 0x81750008, 0x00000000, + 0x017f2395, 0x81750001, 0x017f2396, 0xb00b0001, + 0xb4200006, 0x81750005, 0x00000000, 0x017f2397, + 0x81750002, 0x00000000, 0x017f2398, 0x81750001, + 0x00000000, 0x017f2399, 0x81750001, 0x00000000, + 0x017f239a, 0x81750001, 0x017f239b, 0xb00b0001, + 0xb4200003, 0x8175000e, 0x00000000, 0x017f61be, + 0x81750001, 0x017f239c, 0xb00b0001, 0xb4200003, + 0x8175000e, 0x00000000, 0x017f237e, 0x81750001, + 0x017f239d, 0xb00b0001, 0xb4200006, 0x81750006, + 0x017f239e, 0x916b0001, 0x81550008, 0x856b0001, + 0xb4e0fffd, 0x00ffb81c, 0x00000000, 0x00000000, + 0x81470000, 0x015f2385, 0x015f2386, 0x015f2387, + 0x015f238d, 0x015f238f, 0x015f2390, 0x015f2391, + 0x015f2395, 0x015f2396, 0x015f2397, 0x015f2398, + 0x015f61be, 0x015f61bf, 0x82070028, 0x023f9006, + 0x83a4003a, 0x83270000, 0x003fb819, 0x003f9006, + 0x5823b801, 0x83338000, 0x1b39b801, 0x003fb819, + 0x00000000, 0x00000000, 0x81550000, 0x8384ff64, + 0x017f0380, 0xad4b0026, 0x013f0381, 0x114ab809, + 0x5941b80a, 0x914ae00c, 0x0199b80a, 0x00000000, + 0x019f6193, 0xb0080b77, 0xb4200016, 0x015f0380, + 0xb00a0003, 0xb4600017, 0xb0090026, 0xb4600019, + 0x017f90ba, 0xb00b0000, 0xb4200004, 0x017f0384, + 0x017f204d, 0x017f0383, 0x017f2057, 0x015f0383, + 0x017f0057, 0x300ab80b, 0xb4200012, 0x015f0384, + 0x017f004d, 0x300ab80b, 0xb420000e, 0x83070000, + 0x00ffb81a, 0x83070800, 0x031f6193, 0x83070001, + 0x00ffb81a, 0x83070800, 0x031f6193, 0x83070002, + 0x00ffb81a, 0x83070800, 0x031f6193, 0x83070003, + 0x00ffb81a, 0x83070003, 0x00ffb81a, 0x5e02b810, + 0x5a02b810, 0x00bf9011, 0x00df004f, 0xa5260020, + 0x81e70000, 0x82471000, 0x95d1ffff, 0xa5cee000, + 0x300eb810, 0xb4600002, 0x05f0b80e, 0x0207b80e, + 0x8267001f, 0x82c70020, 0x82971000, 0xb0100080, + 0xb480001f, 0x5a8bb813, 0x5aa6b813, 0x1a94b815, + 0x01efb812, 0x014fb814, 0x01cfb811, 0xb520ffff, + 0xb636000f, 0x81470000, 0x039f8014, 0xb6000404, + 0x5948b80a, 0x957c00ff, 0x194ab80b, 0x5f88b81c, + 0xb0060020, 0xb4200001, 0x80a70000, 0x64a6b805, + 0x68e9b80a, 0x18a5b807, 0x029fa025, 0x00a7b80a, + 0x01efb812, 0x014fb814, 0x01afb811, 0xb520ffff, + 0x5ae2b816, 0x1231b817, 0x0610b817, 0xb500ffde, + 0xb0100000, 0xb4000003, 0x5ec2b810, 0x86760001, + 0xb500ffdc, 0xb00f0000, 0xb4000005, 0x0207b80f, + 0x81f3001f, 0x9a2fc000, 0x81e70000, 0xb500ffd0, + 0x015fb011, 0x00ffb81d, 0x00000000, 0x00000000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x81d7ffff, + 0x8257ffff, 0x82d7ffff, 0x8357ffff, 0x83d7ffff, + 0x80770000, 0x80f70000, 0x81770000, 0x81f70000, + 0x82770000, 0x82f70000, 0x83770000, 0x83f70000, + 0xaeb40080, 0x808f0000, 0x806f001f, 0x80af001f, + 0xb0140000, 0xb4400014, 0x806f001f, 0x80af001f, + 0x8027b9fc, 0x5c22b801, 0x80670700, 0xb6000208, + 0x00cfb803, 0x003fb0bc, 0x5822b801, 0x01cfb801, + 0x003f90bc, 0xb520ffff, 0x90630020, 0x90210020, + 0x80270000, 0x80171000, 0xb6000303, 0xb6000001, + 0x001fa021, 0x00000000, 0x82670000, 0xb6000268, + 0x80170a00, 0x80970afc, 0x81170b00, 0x81970bfc, + 0x80271c00, 0x1021b813, 0x1021b813, 0x0217b801, + 0x80271ffc, 0x0421b813, 0x0421b813, 0x0297b801, + 0x80270c00, 0x1021b813, 0x1021b813, 0x0317b801, + 0x80270ffc, 0x0421b813, 0x0421b813, 0x0397b801, + 0x80478500, 0x1042b813, 0x5c42b802, 0x1022b815, + 0x80670280, 0x00cfb803, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0xb520ffff, 0x009f033b, + 0x80478480, 0x0442b813, 0x5c42b802, 0x1022b815, + 0x806702a0, 0x00cfb803, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0xb520ffff, 0xb0040000, + 0xb4000002, 0x80479000, 0xb5000001, 0x80479c00, + 0x1042b813, 0x5c42b802, 0x1022b815, 0x806702c0, + 0x00cfb803, 0x003fb0bc, 0x5822b801, 0x01cfb801, + 0x003f90bc, 0xb520ffff, 0xb0040000, 0xb4000002, + 0x80479180, 0xb5000001, 0x80479d80, 0x0442b813, + 0x5c42b802, 0x1022b815, 0x806702e0, 0x00cfb803, + 0x003fb0bc, 0x5822b801, 0x01cfb801, 0x003f90bc, + 0xb520ffff, 0x81270000, 0x80370000, 0x80b70000, + 0x81370000, 0x81b70000, 0x82370004, 0x82b7fffc, + 0xb6002016, 0x41498008, 0x51498814, 0x51498814, + 0x51418810, 0x51418810, 0x41818814, 0x0308a02a, + 0x49958820, 0x51898810, 0x51918828, 0x414d8814, + 0x0388a7ec, 0x494d8814, 0x49458810, 0x49458810, + 0x418d8810, 0x0308a02a, 0x49918fec, 0x51858814, + 0x51958fe4, 0x00000000, 0x0388a7ec, 0x92730080, + 0x009f033b, 0x5802b814, 0x90400300, 0x001f9802, + 0x00000000, 0xb0000000, 0xb4200016, 0x80170a00, + 0x80070000, 0xb6002001, 0x001fa020, 0xb0040000, + 0xb4200002, 0x80279000, 0xb5000001, 0x80279c00, + 0xac740080, 0x5c22b801, 0x11e1b803, 0x806f001f, + 0x80af001f, 0xb6000407, 0x80cf0280, 0x01ffb0bc, + 0x59e2b80f, 0x01afb80f, 0x01ff90bc, 0xb520ffff, + 0x91ef0020, 0x007f0320, 0x011f90cd, 0xaca30006, + 0x80c7b004, 0x10a5b814, 0x58a1b805, 0x10a5b806, + 0x0099b805, 0x8027b3dc, 0x5841b804, 0x1021b802, + 0x0159b801, 0x8027b3d0, 0x5841b804, 0x1021b802, + 0x0139b801, 0x80170c00, 0x0097b80a, 0xb6000002, + 0x59478020, 0x009fa04a, 0x00ffb81b, 0x00000000, + 0x009f0011, 0x015f0012, 0xb0060000, 0xb4200007, + 0x968a0001, 0xb0140000, 0xb400000d, 0x80870001, + 0x009f2011, 0x954a0002, 0x015f2012, 0xb0060002, + 0xb4200007, 0x968a0002, 0xb0140000, 0xb4000004, + 0x80870001, 0x009f2011, 0x81470000, 0x015f2012, + 0x8364002b, 0x00bf2010, 0xb0060000, 0xb4200003, + 0xb0050000, 0xb4200001, 0x8364008d, 0xb0050000, + 0xb4200001, 0x836400b2, 0x00bf0010, 0xb0050000, + 0xb4200006, 0x83640983, 0x8364029d, 0x00000000, + 0x8364092b, 0x00000000, 0xb5000005, 0x00bf0010, + 0xb0050001, 0xb4000002, 0x00000000, 0x83640924, + 0x00ff0325, 0x82870000, 0xb6270002, 0x8364ff08, + 0x92940001, 0x80070001, 0x801eff70, 0x001f0010, + 0xb0000001, 0xb4000007, 0x001f033b, 0xb0000000, + 0xb4000002, 0x80270000, 0xb5000001, 0x80270001, + 0x003f233b, 0x00ffb81a, 0x00000000, 0x00000000, + 0x027f4001, 0x5e2ab813, 0x96310003, 0x81c70000, + 0x820700ff, 0xb0110000, 0xb4000005, 0x5a21b811, + 0x81c70200, 0x8207000e, 0x69d1b80e, 0x1210b811, + 0x01dfb0cd, 0x5e2cb813, 0x96310003, 0x023f2323, + 0x5e28b813, 0x96310003, 0x023f2322, 0x5e27b813, + 0x96310001, 0x023f2328, 0x5e23b813, 0x96310001, + 0x023f2321, 0x95f30007, 0x01ff2320, 0x920fe004, + 0x0258b810, 0x00000000, 0x1252b811, 0x025f2325, + 0x8167befc, 0x017f6195, 0x021f031c, 0x01df031d, + 0x3010b80f, 0xb4200003, 0x3011b80e, 0xb4200001, + 0xb5000021, 0x80270000, 0x80471000, 0x0017b802, + 0x8057ffff, 0xb6002001, 0x001fa021, 0x80270400, + 0x80679000, 0x5c62b803, 0xb6001809, 0x00cfb801, + 0x007fb0bc, 0x5862b803, 0x01afb803, 0x007f90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x90630020, + 0x80679c00, 0x5c62b803, 0xb6001809, 0x00cfb801, + 0x007fb0bc, 0x5862b803, 0x01afb803, 0x007f90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x90630020, + 0x01ff231c, 0x023f231d, 0x83970300, 0x82070000, + 0xb6320001, 0x039fa030, 0x00bf0010, 0x021f0324, + 0xb0100000, 0xb4200001, 0x80a70000, 0xb0050000, + 0xb4200008, 0xb0040000, 0xb4a00002, 0x80a70001, + 0xb5000004, 0x82070000, 0x021f204e, 0xb4000001, + 0x80a70002, 0xb0050001, 0xb4200007, 0x021f004e, + 0xb0100002, 0xb4a00002, 0x80a70002, 0x00ffb81b, + 0x92100001, 0x021f204e, 0x00000000, 0x00ffb81b, + 0x81530000, 0x003fb80a, 0x00000000, 0x00000000, + 0x003fb819, 0x00000000, 0x00000000, 0x81550000, + 0x8384fd7b, 0x81470000, 0x015f61ee, 0x015f61ef, + 0x015f23a4, 0x8297050c, 0x82d7ffff, 0xb6000501, + 0x029fa02a, 0x8167e004, 0x116b0384, 0x0158b80b, + 0x019f0382, 0x015f237b, 0x017f0388, 0x116bb80a, + 0xb00c0008, 0xb4a00003, 0x80a70003, 0x00bf2010, + 0x00ffb81b, 0xb00a0005, 0xb4400003, 0xb00b0006, + 0xb4400001, 0x00ffb81b, 0x80a70004, 0x00bf2010, + 0x00ffb81b, 0x00000000, 0x00000000, 0x00000000, + 0x027f0388, 0x02bf037b, 0x02df0384, 0x02ff03a1, + 0x82970400, 0x8257ffff, 0x82d7ffff, 0xb6350003, + 0x81550001, 0x8357ffff, 0x029fa02a, 0x82970414, + 0xb6350003, 0x81550001, 0x83d7ffff, 0x029fa02a, + 0x81550001, 0xb00a0001, 0xb4200004, 0x814d0008, + 0x6149b80a, 0x954affff, 0x015f61ee, 0xb0160000, + 0xb4200007, 0x81550001, 0xb00a0001, 0xb4200004, + 0x814d0008, 0x6149b80a, 0x954affff, 0x015f61ef, + 0x81550001, 0xb00a0001, 0xb4200036, 0x82f50001, + 0x02ff23a1, 0xb0170001, 0xb420002c, 0x82970428, + 0xb6350003, 0x81550001, 0x00000000, 0x029fa02a, + 0x82970428, 0x81470000, 0x017f8034, 0xb00b0001, + 0xb4000004, 0x914a0001, 0x300ab815, 0xb480fffa, + 0xb5000001, 0x015f23a5, 0x81670000, 0xb0160002, + 0xb4200002, 0x81750001, 0x00000000, 0x017f233a, + 0x81550004, 0xadaa000c, 0x015f23a2, 0x81750004, + 0x916b0003, 0x017f23a3, 0x91ad0025, 0x01bf23a6, + 0xadab000c, 0x81e70000, 0x91ad0025, 0x01bf23a7, + 0x920a0001, 0x05abb810, 0xb00d0000, 0xb400000d, + 0xb62d0004, 0x81b50001, 0x65b0b80d, 0x19efb80d, + 0x92100001, 0x01ffb0be, 0xb5000006, 0x81a70000, + 0x82970428, 0xb6350001, 0x029fa02d, 0x01bf233a, + 0x01bf23a5, 0x82070000, 0x82270000, 0x82170428, + 0xb635003a, 0x01bf8030, 0xb00d0001, 0xb4200036, + 0x81d50001, 0x65b1b80e, 0x1a10b80d, 0xb00e0001, + 0xb4200031, 0x81b50002, 0xadad0003, 0xae510048, + 0x91cd000f, 0x91320868, 0x015f03a2, 0xad4a0004, + 0x92920700, 0x1189b80a, 0x0297b80c, 0x1194b80a, + 0x0317b80c, 0x01ff90be, 0x015f03a2, 0x017f03a3, + 0x064bb80a, 0x0107b80a, 0xb0120000, 0xb400001e, + 0xb632001d, 0x6928b80f, 0x95290001, 0xb0090000, + 0xb420000e, 0x81350004, 0x1129b80d, 0x029fa029, + 0x824d0004, 0x5a48b812, 0x5e48b812, 0x3009b80e, + 0xb4200002, 0x5e41b812, 0xb500000d, 0x5e42b812, + 0x81330040, 0x1a52b809, 0xb5000009, 0x0127b854, + 0x85290004, 0x0397b809, 0x0287b858, 0x86940004, + 0x013f803c, 0x0397b814, 0x029fa029, 0x025f803c, + 0x031fa032, 0x91080001, 0x92310001, 0x015f03a2, + 0x017f03a3, 0x013f033a, 0xb0090001, 0xb420001f, + 0x95300002, 0x95900001, 0x1929b80c, 0xb0090000, + 0xb400001a, 0x064bb80a, 0x0107b80a, 0xb6320017, + 0x6928b80f, 0x95290001, 0xb0090000, 0xb4200002, + 0x81350001, 0x013f23f8, 0x81a70700, 0x91ad0048, + 0x5982b808, 0x11adb80c, 0x0397b80d, 0x013f03f8, + 0xb0090001, 0xb4200005, 0x019f801c, 0x0196b80c, + 0x81b3ff80, 0x418cb80d, 0xb5000002, 0x019f801c, + 0x0196b80c, 0x039fa00c, 0x91080001, 0xb0160002, + 0xb420001a, 0xb0170001, 0xb4200008, 0xb00a0000, + 0xb4200002, 0x81270002, 0xb5000005, 0xb00a0002, + 0xb4400002, 0x81270003, 0xb5000001, 0x81270004, + 0x013f23a9, 0x81950001, 0xb00c0001, 0xb420000d, + 0x81a70000, 0x8397043c, 0xb6290006, 0x81150001, + 0x039fa028, 0xb0080001, 0xb4200001, 0x81a70001, + 0x00000000, 0x01bf23a8, 0xb5000002, 0x81a70000, + 0x01bf23a8, 0xb0170001, 0xb4200001, 0x81b50002, + 0x82970c20, 0xb6350003, 0x81550002, 0x00000000, + 0x029fa02a, 0xb0130001, 0xb4200001, 0x81150001, + 0x81c70000, 0xb6350014, 0x922e0c20, 0x015ff011, + 0xb00a0000, 0xb400000f, 0x922e0428, 0x015ff011, + 0xb00a0001, 0xb4200005, 0x922e044c, 0x0297b811, + 0x015f03a6, 0x029fa00a, 0xb5000006, 0x81550006, + 0xad4a0003, 0x922e044c, 0x0297b811, 0x914a0049, + 0x029fa00a, 0x91ce0004, 0xb0170001, 0xb420001e, + 0xb00d0000, 0xb400001c, 0x852d0001, 0x81470001, + 0x6549b80a, 0xad6a0003, 0x019f03a7, 0x058c03a6, + 0x81270000, 0xb00b0000, 0xb4000005, 0x300cb80b, + 0xb4800003, 0x058cb80b, 0x91290001, 0xb500fffb, + 0x81750004, 0x5961b80b, 0x839704ec, 0x0187b860, + 0x039fa02c, 0x039fa02a, 0x039fa029, 0x039fa02b, + 0xb0090000, 0xb4000004, 0xb6290003, 0x81550007, + 0x00000000, 0x00000000, 0x81c70000, 0xb635002e, + 0x922e0c20, 0x01fff011, 0xb00f0000, 0xb4000029, + 0x852f0001, 0x81470001, 0x6549b80a, 0xad6a0003, + 0x922e044c, 0x025fd811, 0x86520001, 0x0227b812, + 0x81270000, 0xb00b0000, 0xb4000005, 0x3012b80b, + 0xb4800003, 0x0652b80b, 0x91290001, 0xb500fffb, + 0x2e09b80b, 0x00000000, 0x3010b811, 0xb4600001, + 0x91290001, 0xae4e0004, 0x82150004, 0x9232049c, + 0x0297b811, 0x0187b860, 0x029fa02c, 0x029fa02a, + 0x029fa029, 0x029fa030, 0xb0090000, 0xb4000004, + 0xb6290003, 0x81550007, 0x00000000, 0x00000000, + 0x82270460, 0x1231b80e, 0x0217b811, 0x81550002, + 0x021fa00a, 0x91ce0004, 0xb0130001, 0xb420000c, + 0xb0080000, 0xb400000a, 0x81550004, 0x839704fc, + 0x0167b860, 0x039fa02b, 0x81670001, 0x039fa02b, + 0x8175000e, 0x81670002, 0x039fa02b, 0x039fa02a, + 0x81150001, 0xb0080001, 0xb420000a, 0x8135000b, + 0x5d2923aa, 0x95490180, 0x5d4723ab, 0x95490060, + 0x5d4523ac, 0x95490018, 0x5d4323ad, 0x95490007, + 0x015f23ae, 0x81350001, 0xb0090001, 0xb4200017, + 0x81350006, 0x013f23af, 0xb0170001, 0xb4200005, + 0x81550004, 0x00000000, 0x015f23b0, 0x81550003, + 0x015f23b1, 0x82970474, 0x83170488, 0xb6350004, + 0x81550007, 0x5e83a02a, 0x954a0007, 0x031fa02a, + 0xb0130001, 0xb4200005, 0x81750004, 0x00000000, + 0x017f23b2, 0x81750003, 0x017f23b3, 0xb0170001, + 0xb420000b, 0x81b50001, 0xb00d0001, 0xb4200008, + 0x81d50003, 0x59c8b80e, 0x91ce0300, 0x01df61da, + 0x81d50003, 0x59c8b80e, 0x91ce0300, 0x01df61db, + 0x81550001, 0xb00a0001, 0xb420004b, 0xb0170001, + 0xb4200001, 0x81550002, 0x82470000, 0x82270000, + 0xb6350004, 0x81750002, 0x6571b80b, 0x92310002, + 0x1a52b80b, 0xb0170001, 0xb4200017, 0xb00a0001, + 0xb4200011, 0x81150003, 0x91080001, 0x011f23a4, + 0x829709d0, 0x831709f0, 0x83970060, 0xb6280009, + 0x81750005, 0x00000000, 0x029fa02b, 0x81750004, + 0x00000000, 0x031fa02b, 0x81750003, 0x00000000, + 0x039fa02b, 0xb5000004, 0xb00a0002, 0xb4800002, + 0x81070000, 0x011f23a4, 0x82270000, 0x81270000, + 0xb6350025, 0x6a11b812, 0x92310002, 0x96100003, + 0xb0100001, 0xb4200018, 0xada90020, 0x81750003, + 0x920d0520, 0x0217b810, 0x920d05c0, 0x0297b810, + 0x920d0660, 0x0317b810, 0x5942b809, 0x920a050c, + 0x0397b810, 0x916b0001, 0x039fa02b, 0xb62b0009, + 0x81750005, 0x00000000, 0x021fa02b, 0x81750004, + 0x00000000, 0x029fa02b, 0x81750003, 0x00000000, + 0x031fa02b, 0xb5000007, 0xb0100002, 0xb4800005, + 0x59a2b809, 0x91ad050c, 0x0397b80d, 0x82070000, + 0x039fa010, 0x91290001, 0x81550001, 0xb00a0001, + 0xb4200007, 0x81550009, 0xb00a0000, 0xb4000004, + 0xb62a0003, 0x82150008, 0x00000000, 0x00000000, + 0xb00a0100, 0xb4a00007, 0x954aff00, 0xb6008003, + 0x82150010, 0x00000000, 0x00000000, 0x854a0100, + 0xb4e0fffa, 0x00ffb81b, 0x00000000, 0x00000000, + 0x81070000, 0x011f61dc, 0x011f61de, 0x011f61e0, + 0x011f03aa, 0x9108e0f4, 0x0138b808, 0x011f03ab, + 0x013f61ac, 0x9108e0f0, 0x0138b808, 0x011f03ac, + 0x013f61ad, 0x5901b808, 0x9108e0f8, 0x0139b808, + 0x011f03ad, 0x013f61ae, 0x5901b808, 0x9108e100, + 0x0139b808, 0x011f03ae, 0x013f61b0, 0x5901b808, + 0x9108e108, 0x0179b808, 0x013f03af, 0x017f61b1, + 0x02bf037b, 0x82970474, 0xb6350002, 0x015f8034, + 0x1929b80a, 0x011f03a1, 0xb0080001, 0xb4200002, + 0x015f03b0, 0x1929b80a, 0x019f0388, 0xb00c0001, + 0xb4200002, 0x015f03b2, 0x1929b80a, 0x013f61b3, + 0x015f03a8, 0xb00a0001, 0xb420003a, 0x81a70000, + 0x01bf237a, 0x83840056, 0x806f001f, 0x80af001f, + 0x80270300, 0x8067a800, 0x5c62b803, 0xb600080a, + 0x00cfb801, 0x007fb0bc, 0x5862b803, 0x01afb803, + 0x007f90bc, 0x0047b86f, 0xb0020001, 0xb4c0fffd, + 0x90210020, 0x90630020, 0x81a70001, 0x01bf237a, + 0x83840043, 0x838403c6, 0x81a70000, 0x01bf237a, + 0x82470400, 0x01bff012, 0x01bf23fa, 0x83840418, + 0x8384048f, 0x8384053e, 0x83840595, 0x806f001f, + 0x80af001f, 0x80270300, 0x8067ac00, 0x5c62b803, + 0xb600080a, 0x00cfb801, 0x007fb0bc, 0x5862b803, + 0x01cfb803, 0x007f90bc, 0x0047b86f, 0xb0020001, + 0xb4c0fffd, 0x90210020, 0x90630020, 0x81a70001, + 0x01bf237a, 0x82470404, 0x015ff012, 0x015f23fa, + 0x838403ff, 0x83840476, 0x83840525, 0x8384057c, + 0xb5000011, 0x81a70000, 0x01bf237a, 0xb635000e, + 0x8384001b, 0x01bf037a, 0xad4d0004, 0x00000000, + 0x914a0400, 0x01bff00a, 0x01bf23fa, 0x838403f0, + 0x83840467, 0x83840516, 0x8384056d, 0x01df037a, + 0x91ce0001, 0x01df237a, 0x019f0388, 0xb00c0001, + 0xb4200009, 0x02bf037b, 0x02bf237a, 0x838400e8, + 0x82470000, 0x025f23fa, 0x838403e1, 0x83840458, + 0x83840507, 0x8384055e, 0x00ffb81b, 0x00000000, + 0x80770000, 0x80f70000, 0x81770000, 0x81f70000, + 0x82770000, 0x82f70000, 0x83770000, 0x83f70000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x81d7ffff, + 0x8257ffff, 0x82d7ffff, 0x8357ffff, 0x83d7ffff, + 0x017f037a, 0x5a42b80b, 0x01bf03a8, 0xb00d0001, + 0xb4200004, 0x011f9118, 0x013f9119, 0x7929b808, + 0xb5000002, 0x91b20460, 0x013ff00d, 0x91b20340, + 0x0297b80d, 0x00000000, 0x029fa009, 0x01df0384, + 0xb00e0000, 0xb4200005, 0xb00b0001, 0xb4200003, + 0x009f90c6, 0x00bf0391, 0xb5000002, 0x009f90cf, + 0x00bf0389, 0x83a4013a, 0x81870000, 0x019f61b5, + 0x019f61b4, 0x5a02b80b, 0x9190044c, 0x01dfd80c, + 0x01df61b6, 0x91900488, 0x01dff00c, 0x59c1b80e, + 0x918ee118, 0x01d9b80c, 0x019f03af, 0x01df61af, + 0x858c000f, 0x5986b80c, 0x91d00474, 0x01bff00e, + 0x59c2b80d, 0x11cc61b2, 0x81870000, 0x019f61b8, + 0x91900414, 0x01dfd80c, 0x01df61b7, 0xadab0010, + 0x00000000, 0x908d049c, 0x83a40189, 0xadcb0020, + 0x5982b80b, 0x908e0520, 0x90ae05c0, 0x90ce0660, + 0x928c050c, 0x00ff9814, 0x83a40161, 0x83a401b0, + 0x017f037a, 0x59c2b80b, 0x918e0428, 0x01fff00c, + 0xb00f0001, 0xb4200081, 0x023f03a5, 0x3011b80b, + 0xb420000f, 0x01c7b860, 0x01dfb0fa, 0x01df41dc, + 0x01df61e8, 0x01df41de, 0x01df61ea, 0x01df41e0, + 0x01df61ec, 0x01df41dd, 0x01df61e9, 0x01df41df, + 0x01df61eb, 0x01df41e1, 0x01df61ed, 0xb5000024, + 0x01c7b860, 0x01dfb0f9, 0x01df41dc, 0x01df61e2, + 0x01df41de, 0x01df61e4, 0x01df41e0, 0x01df61e6, + 0x01df41dd, 0x01df61e3, 0x01df41df, 0x01df61e5, + 0x01df41e1, 0x01df61e7, 0x803f0000, 0x00000000, + 0x00000000, 0x01df90fa, 0x003fb80e, 0x00000000, + 0x00000000, 0x81d50000, 0x00000000, 0x00000000, + 0x01df41e8, 0x01df61dc, 0x01df41ea, 0x01df61de, + 0x01df41ec, 0x01df61e0, 0x01df41e9, 0x01df61dd, + 0x01df41eb, 0x01df61df, 0x01df41ed, 0x01df61e1, + 0x029f03a6, 0x029f236a, 0x029f03a7, 0x029f236c, + 0x027f03a2, 0x92b3e128, 0x0298b815, 0x019f03b0, + 0x029f2368, 0x5982b80c, 0x01df03af, 0x85ce000f, + 0x59c6b80e, 0x11cc61b2, 0x82a70001, 0x02bf61b8, + 0x82a70000, 0x02bf61b9, 0x029f41da, 0x029f61ba, + 0x029f41db, 0x029f61bb, 0x019f03b1, 0x5981b80c, + 0x918ce118, 0x0299b80c, 0xad8b0048, 0x029f61af, + 0x59a2b813, 0x118cb80d, 0x928c0868, 0x029fb0fb, + 0x928c0700, 0x029fb0fc, 0x019f41bc, 0x918c0003, + 0x019f61bc, 0x5a02b80b, 0x91900414, 0x029fd80c, + 0x029f236e, 0x808704ec, 0x83a40119, 0x808709d0, + 0x80a709f0, 0x80c70060, 0x00ff03a4, 0x83a400f4, + 0x83a40143, 0x021f037a, 0x019f03a5, 0x300cb810, + 0xb4000016, 0x803f0000, 0x00000000, 0x00000000, + 0x01df90f9, 0x003fb80e, 0x00000000, 0x00000000, + 0x81d50000, 0x00000000, 0x00000000, 0x01df41e2, + 0x01df61dc, 0x01df41e4, 0x01df61de, 0x01df41e6, + 0x01df61e0, 0x01df41e3, 0x01df61dd, 0x01df41e5, + 0x01df61df, 0x01df41e7, 0x01df61e1, 0x029f41b6, + 0xa6d40100, 0xaeb40004, 0x81870000, 0x92b50c00, + 0x0397b815, 0xb6360001, 0x039fa02c, 0x00ffb81c, + 0x009f90cf, 0x00bf0389, 0x019f037a, 0x5982b80c, + 0x918c0340, 0x0397b80c, 0x81870000, 0x039fa00c, + 0x83a4007b, 0x81870000, 0x019f61b5, 0x019f61b4, + 0x81870007, 0x019f61b6, 0x019f03b3, 0x5981b80c, + 0x918ce118, 0x01b9b80c, 0x019f03af, 0x01bf61af, + 0x858c000f, 0x5986b80c, 0x01bf03b2, 0x59a2b80d, + 0x118cb80d, 0x019f61b2, 0x81870000, 0x019f61b7, + 0x019f61b8, 0x808704fc, 0x83a400d1, 0x80870000, + 0x80a70000, 0x80c70000, 0x80e70000, 0x83a400ac, + 0x83a400fb, 0x81470000, 0x81e70c1c, 0x0397b80f, + 0xb600f901, 0x039fa02a, 0x00ffb81c, 0x00000000, + 0x82270000, 0x023f2011, 0x0227b860, 0x023fb0ff, + 0x02bf9006, 0x92350028, 0x8213001f, 0x9210e000, + 0x3011b810, 0xb4800001, 0x86312000, 0x021f4193, + 0x5a01b810, 0x86100028, 0x83a4fa94, 0x82270000, + 0x003fb811, 0x02bf9006, 0x5aa3b815, 0x82338000, + 0x1a31b815, 0x003fb811, 0x8067e950, 0x5c62b803, + 0x81f50000, 0x80270400, 0xb6000409, 0x814fffc0, + 0x00cfb801, 0x007fb0bc, 0x5862b803, 0x01cfb803, + 0x007f90bc, 0xb520ffff, 0x90210020, 0x90630020, + 0x82870000, 0x81f50010, 0x019f4193, 0x5d61b80c, + 0x5d43b80c, 0x114ab80b, 0x0187b80a, 0x960cff00, + 0x92100100, 0x858c0001, 0xb62c000c, 0x81f50010, + 0x5e28b80f, 0xb6000209, 0x5a48b814, 0x9652ff00, + 0x5e68b814, 0x5981b813, 0x918c1000, 0x01dfd80c, + 0x2252b811, 0x2292b80e, 0x962f00ff, 0x81870000, + 0x86100100, 0xb4e0fff0, 0xb00a0000, 0xb4000009, + 0x81670000, 0xb0140000, 0xb4000001, 0x81670001, + 0x017f2012, 0x258a4193, 0x918c0001, 0x81470000, + 0xb500ffe2, 0x81670000, 0xb0140000, 0xb4000001, + 0x81670002, 0x116b0012, 0x803f0000, 0x00000000, + 0x00000000, 0x003fb811, 0x00000000, 0x00000000, + 0x81f50000, 0x017f2012, 0x00ffb81a, 0x00000000, + 0x61f4b804, 0x91ef0001, 0x8233003f, 0x9a31ffff, + 0x5a02b804, 0x1610b811, 0x92510001, 0x1a10b812, + 0x029f03fb, 0xb0140001, 0xb4200012, 0x5a21b805, + 0x92b1e910, 0x0299b815, 0x5a22b805, 0x5a90b814, + 0x6290b814, 0x92b1e890, 0x11efb814, 0x029bb815, + 0x8233ff80, 0x3011b814, 0xb4000006, 0x4294b811, + 0x00000000, 0x0288b814, 0x4210b814, 0x00000000, + 0x0208b810, 0x029f9003, 0x82f3007f, 0x9af7ffff, + 0x3017b814, 0xb4000003, 0x4210b814, 0x00000000, + 0x0208b810, 0x82270000, 0x02c7b810, 0xb0160000, + 0xb400000a, 0x1676b812, 0x3013b812, 0xb4000003, + 0x5ac1b816, 0x92310001, 0xb500fffa, 0x81d3ff80, + 0x3010b80e, 0xb4200001, 0x1ad6b80e, 0x05efb811, + 0x027f037a, 0x5a62b813, 0x92730340, 0x0397b813, + 0x023fd813, 0x02dfb0fd, 0x5a30b811, 0x6230b811, + 0x0631b80f, 0x3010b812, 0xb4200001, 0x92310001, + 0x82470000, 0xb0110000, 0xb4800004, 0x82470003, + 0xb0110003, 0xb4400001, 0x0247b811, 0x039fa012, + 0x124f61bc, 0x00ffb81d, 0x00000000, 0x00000000, + 0x83970a10, 0x82070000, 0xb6003201, 0x039fa030, + 0xb0070000, 0xb4000019, 0x029f41b4, 0x0297b804, + 0x0317b805, 0x0397b806, 0xb6270014, 0x12948034, + 0x01df8038, 0xb00e0000, 0xb4a0000e, 0x02bf803c, + 0x5a02b814, 0x91b00a10, 0x0217b80d, 0xb62e0008, + 0x96150003, 0x91f00001, 0xadef0080, 0xb0150004, + 0xb4600001, 0x85ef0280, 0x021fa02f, 0x92940001, + 0xb5000001, 0x021f803c, 0x00000000, 0x00ffb81d, + 0x0397b804, 0x021f036a, 0x027f803c, 0x029f803c, + 0x02bf803c, 0x02df803c, 0x5a22b810, 0x92311000, + 0x0397b811, 0xb0100000, 0xb4200001, 0x039fa036, + 0xb0150000, 0xb4000021, 0x0227b860, 0x023fb0ff, + 0xb520ffff, 0x803f0000, 0x82138000, 0x1a10b813, + 0x003fb810, 0x00000000, 0x00000000, 0x82150000, + 0x00000000, 0xb635000d, 0x82550007, 0x5a42b812, + 0x9212e4b8, 0x025bb810, 0x8227000c, 0xb6000307, + 0x68d1b812, 0x94c6000f, 0x84c60002, 0x12d6b806, + 0xb6340001, 0x039fa036, 0x86310004, 0x803f0000, + 0x82138000, 0x023f90ff, 0x1a31b810, 0x003fb811, + 0x00000000, 0x00000000, 0x82150000, 0x00ffb81d, + 0x00ff41b5, 0x011f41b4, 0x019f41af, 0x01bf41ae, + 0x01df41ba, 0x01ff41bb, 0x82070000, 0x023f0380, + 0x82470000, 0xae310032, 0x029f41b3, 0x5862b807, + 0x90431000, 0x81970ad8, 0x0217b802, 0x90430c00, + 0x0297b802, 0x0317b802, 0x912802a4, 0x007ff009, + 0x58478030, 0x792341b6, 0x0529b807, 0x019fa029, + 0xb0080014, 0xb4800011, 0xa5420c00, 0x031fa02a, + 0x84690001, 0xb4a00011, 0xb623000b, 0x58678030, + 0xa4030c00, 0x031fa020, 0x044ab800, 0x0056b802, + 0x5c41b802, 0xf84200ff, 0x90620100, 0x005ff003, + 0x7d40b80a, 0x114ab802, 0xb5000004, 0xa5420c00, + 0x58478010, 0xa5620c00, 0x031fa02a, 0xb0080016, + 0xb4400043, 0xb0080013, 0xb440002c, 0xb0080006, + 0xb4400024, 0xb0080005, 0xb4400014, 0xb0080002, + 0xb4400006, 0x80440030, 0x015f619c, 0x05cab80c, + 0x05eab80d, 0x066eb810, 0xb500003c, 0x8044002a, + 0x300a419c, 0xb4800001, 0x82470001, 0x015f619c, + 0xb0120001, 0xb4200001, 0xb500001a, 0x05cab80c, + 0x05eab80d, 0x066eb810, 0xb5000030, 0x001f41b6, + 0xb0000007, 0xb4000001, 0x8044001b, 0x300a419c, + 0xb4800001, 0x82470001, 0xb0120001, 0xb4200001, + 0xb500000c, 0x05cab80c, 0x05eab80d, 0x066eb810, + 0xb5000022, 0x80440010, 0x840b0100, 0x300ab800, + 0xb4200001, 0x86100040, 0xb5000002, 0x86100080, + 0xfe100000, 0x046e41ad, 0x042ab80c, 0x7dc1b803, + 0x044f41ac, 0x042ab80d, 0x7de1b802, 0x046eb810, + 0x7e6fb803, 0xb5000011, 0x840b0100, 0x3000b80a, + 0xb4200002, 0x82070180, 0x00ffb802, 0x300ab80b, + 0xb4a00002, 0x86100040, 0xfe100000, 0x00ffb802, + 0x046e41ad, 0x042ab80c, 0x7dc1b803, 0x044f41ac, + 0x042ab80d, 0x7de1b802, 0x7e6eb80f, 0x380a41b0, + 0xb4600003, 0x242a41b0, 0x5c22b801, 0x1273b801, + 0xb0140000, 0xb4200002, 0x80071fe0, 0xb5000016, + 0x1011b808, 0x5801b800, 0x9020e26c, 0x0079b801, + 0x5842b808, 0x90420a10, 0x7c03b813, 0x003f9802, + 0x1000b801, 0x003f41b2, 0x5830b801, 0x6030b801, + 0x0400b801, 0x003f41b1, 0x5830b801, 0x6030b801, + 0x0400b801, 0xfc000000, 0xf8001fe0, 0x94001fe0, + 0x100041b1, 0x9400ffff, 0x8067003f, 0xb6290008, + 0x005f8014, 0x0442b800, 0x9442ffff, 0x5850b802, + 0x6050b802, 0xfc420000, 0x5c45b802, 0x7a82a023, + 0x10e7b809, 0x91080001, 0x300741b6, 0xb420ff6a, + 0x019f61af, 0x01bf61ae, 0x01df61ba, 0x01ff61bb, + 0x00ff41b5, 0x011f41b4, 0x019f41b8, 0x01bf41b7, + 0x01df41dd, 0x01ff41df, 0x021f41e1, 0x027f90fd, + 0x029f41bc, 0x02ff41dc, 0x031f41de, 0x033f41e0, + 0x5822b807, 0x91210c00, 0x0117b809, 0x81970ad8, + 0x91211000, 0x0217b809, 0x91210c00, 0x0317b809, + 0x80170ba0, 0x013f802c, 0xb629005f, 0x003f8038, + 0xb001000e, 0xb440001e, 0xb001000c, 0xb4400054, + 0xb001000a, 0xb4400043, 0xb0010007, 0xb440003c, + 0xb0010005, 0xb440002b, 0xb0010000, 0xb440001a, + 0xb00d0001, 0xb4200010, 0x005f418f, 0xac42bb75, + 0x8073005a, 0x9442ffff, 0x005f618f, 0x95628000, + 0x5848b802, 0xb00b8000, 0xb4200002, 0x8173ff00, + 0x1842b80b, 0x9863827a, 0x4043b802, 0x00000000, + 0x0048b802, 0xb500003f, 0x80470000, 0xb500003d, + 0x8401000f, 0x5c22b800, 0x902102d8, 0x001ff001, + 0x004db800, 0xb5000037, 0x86f70001, 0xb4600005, + 0x80750005, 0x5862b803, 0x9043e44c, 0x01d9b802, + 0x82e70002, 0x5c4cb80e, 0x9462000f, 0x5862b803, + 0x90630200, 0x005f9803, 0x59c4b80e, 0x95ceffff, + 0xb5000028, 0x87180001, 0xb4600005, 0x80750007, + 0x5862b803, 0x9043e4b8, 0x01f9b802, 0x83070002, + 0x5c4cb80f, 0x9462000f, 0x5862b803, 0x9063020c, + 0x005f9803, 0x59e4b80f, 0x95efffff, 0xb5000019, + 0x80750003, 0x5862b803, 0x90630220, 0x005f9803, + 0xb5000014, 0x87390001, 0xb4600005, 0x80750007, + 0x5862b803, 0x9043e6ac, 0x0219b802, 0x83270001, + 0x5c4cb810, 0x9462000f, 0x5862b803, 0x9063023c, + 0x005f9803, 0x5a04b810, 0x9610ffff, 0xb5000005, + 0x80750004, 0x5862b803, 0x90630268, 0x005f9803, + 0x00000000, 0x001fa022, 0x80170ba0, 0xb00c0001, + 0xb4200035, 0x023f90fb, 0x007f9811, 0x025f90fc, + 0x06d4b803, 0x007f9812, 0x4083b813, 0x00000000, + 0x0088b804, 0xb629002b, 0x24368030, 0x9421ffff, + 0x5830b801, 0x6030b801, 0x40448020, 0xb0010020, + 0xb4800003, 0x80470000, 0x80670000, 0xb500000e, + 0xb0010000, 0xb4a00004, 0x82b30080, 0x6aa1b815, + 0x4042b815, 0xb5000008, 0x6c41b802, 0x82a70017, + 0x12b5b801, 0x6875b803, 0x1842b803, 0x00000000, + 0x00000000, 0x00000000, 0x0108a022, 0x007f41b9, + 0x90630001, 0x007f61b9, 0xb003000c, 0xb420000c, + 0x92310004, 0x023fb0fb, 0x007f9811, 0x92520004, + 0x06d4b803, 0x025fb0fc, 0x007f9812, 0x80470000, + 0x4083b813, 0x00000000, 0x0088b804, 0x005f61b9, + 0x00000000, 0xb500001a, 0xb6290019, 0x24348030, + 0x9421ffff, 0x5830b801, 0x6030b801, 0x40538020, + 0xb0010020, 0xb4800003, 0x80470000, 0x80670000, + 0xb500000e, 0xb0010000, 0xb4a00004, 0x82b30080, + 0x6aa1b815, 0x4042b815, 0xb5000008, 0x6c41b802, + 0x82a70017, 0x12b5b801, 0x6875b803, 0x1842b803, + 0x00000000, 0x00000000, 0x00000000, 0x0108a022, + 0x10e7b809, 0x91080001, 0x300741b6, 0xb420ff48, + 0x00ff61b5, 0x011f61b4, 0x01df61dd, 0x01ff61df, + 0x021f61e1, 0x02ff61dc, 0x031f61de, 0x033f61e0, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x81d7ffff, + 0x8257ffff, 0x808f0000, 0x003f9113, 0x005f9114, + 0x7141b802, 0x80cf0700, 0x8027b064, 0x5c22b801, + 0x003fb0bc, 0x5822b801, 0x01cfb801, 0x003f90bc, + 0xb520ffff, 0x80cf0704, 0x8027b06c, 0x5c22b801, + 0x003fb0bc, 0x5822b801, 0x01cfb801, 0x003f90bc, + 0xb520ffff, 0x81e7043c, 0x82071c00, 0x82271c10, + 0x019f03a9, 0x806f001f, 0x80af001f, 0x80270400, + 0x8067a800, 0x5c62b803, 0xb6000808, 0x00cfb801, + 0x007fb0bc, 0x5862b803, 0x01cfb803, 0x007f90bc, + 0xb520ffff, 0x90210020, 0x90630020, 0x81971000, + 0x82170c00, 0xb6000004, 0x003f800c, 0x005f8010, + 0x021fa021, 0x019fa022, 0x00bfd810, 0x003fd811, + 0x70c1b80a, 0x001f980f, 0x91ef0004, 0x92100002, + 0x92310002, 0x5822b805, 0x90411000, 0x0197b802, + 0x90410c00, 0x0217b802, 0x0466b805, 0xb0000000, + 0xb4000005, 0xb6230004, 0x003f8010, 0x005f800c, + 0x1201a022, 0x0581a022, 0x858c0001, 0xb4e0ffea, + 0x80270400, 0x8067ac00, 0x5c62b803, 0xb6000808, + 0x00cfb801, 0x007fb0bc, 0x5862b803, 0x01afb803, + 0x007f90bc, 0xb520ffff, 0x90210020, 0x90630020, + 0x00ffb81c, 0x00000000, 0x00000000, 0x00000000, + 0x808f0000, 0x806f001f, 0x80af001f, 0x003f037a, + 0xb0010000, 0xb4400030, 0x81a7b7fc, 0x5da2b80d, + 0x80670500, 0xb6000208, 0x00cfb803, 0x01bfb0bc, + 0x59a2b80d, 0x01cfb80d, 0x01bf90bc, 0xb520ffff, + 0x90630020, 0x91ad0020, 0x81c7b8fc, 0x5dc2b80e, + 0x80670540, 0xb6000208, 0x00cfb803, 0x01dfb0bc, + 0x59c2b80e, 0x01cfb80e, 0x01df90bc, 0xb520ffff, + 0x90630020, 0x91ce0020, 0x81a7b3fc, 0x5da2b80d, + 0x80670600, 0xb6000408, 0x00cfb803, 0x01bfb0bc, + 0x59a2b80d, 0x01cfb80d, 0x01bf90bc, 0xb520ffff, + 0x90630020, 0x91ad0020, 0x81c7b5fc, 0x5dc2b80e, + 0x80670680, 0xb6000408, 0x00cfb803, 0x01dfb0bc, + 0x59c2b80e, 0x01cfb80e, 0x01df90bc, 0xb520ffff, + 0x90630020, 0x91ce0020, 0x005f03fa, 0xb0020000, + 0xb4000024, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x8257ffff, 0x82d7ffff, 0x8357ffff, + 0x83d7ffff, 0x83971300, 0x83171200, 0x82971100, + 0x82171000, 0x81170c00, 0x81970ff8, 0x80171400, + 0x80971500, 0x005f802c, 0x001f8028, 0xb6004010, + 0x41028000, 0x51008004, 0x007f876c, 0x0208a028, + 0x41008000, 0x49028004, 0x003f8068, 0x0388a028, + 0x41038000, 0x51018004, 0x005f802c, 0x0288a028, + 0x41018020, 0x49038024, 0x001f8028, 0x0308a028, + 0x00ffb81c, 0x83d7ffff, 0x8357ffff, 0x82d7ffff, + 0x8257ffff, 0x8157ffff, 0x81d7ffff, 0x8057ffff, + 0x80d7ffff, 0x82971200, 0x82171000, 0x81170c00, + 0x81970ffc, 0x83171800, 0x83971a00, 0x83370000, + 0x83b70000, 0x81370008, 0x81b7fff8, 0x4119880c, + 0xb6008006, 0x511d8808, 0x41498838, 0x0208a028, + 0x494d883c, 0x4119880c, 0x0288a02a, 0x00ffb81c, + 0x82670000, 0x82a70000, 0x003f037a, 0xb0010000, + 0xb4400018, 0x81a7bdfc, 0x5da2b80d, 0x80670580, + 0xb6000208, 0x00cfb803, 0x01bfb0bc, 0x59a2b80d, + 0x01cfb80d, 0x01bf90bc, 0xb520ffff, 0x90630020, + 0x91ad0020, 0x81a7eb70, 0x5da2b80d, 0x806705c0, + 0xb6000208, 0x00cfb803, 0x01bfb0bc, 0x59a2b80d, + 0x01cfb80d, 0x01bf90bc, 0xb520ffff, 0x90630020, + 0x91ad0020, 0x02bf03fa, 0x808f0000, 0xb0150000, + 0xb4000006, 0x81470040, 0x81670003, 0x81870002, + 0x81a71000, 0x81c71300, 0xb5000005, 0x81470080, + 0x81670004, 0x81870001, 0x81a71000, 0x81c71200, + 0x0017b80d, 0x0097b80e, 0x108db80a, 0x0117b804, + 0x108eb80a, 0x0197b804, 0x5841b80a, 0x108db802, + 0x0217b804, 0x108eb802, 0x0297b804, 0x106ab802, + 0x108db803, 0x0317b804, 0x108eb803, 0x0397b804, + 0x5ea2b80a, 0xb6350020, 0x001f8000, 0x003f8008, + 0x005f8004, 0x007f800c, 0x10c08010, 0x10a18018, + 0x10828014, 0x10e3801c, 0x1246b805, 0x0686b805, + 0x10c4b807, 0x0484b807, 0x80e70000, 0x80a70000, + 0x0008a032, 0x0108a034, 0x0088a026, 0x0188a024, + 0x04c08010, 0x04a18018, 0x04828014, 0x04e3801c, + 0x0646b807, 0x1286b807, 0x10c4b805, 0x0484b805, + 0x80e70000, 0x80a70000, 0x0208a032, 0x0308a034, + 0x0288a026, 0x0388a024, 0x5de1b80a, 0x82070004, + 0xb62b002a, 0x0017b80d, 0x0097b80e, 0x102db80f, + 0x0117b801, 0x104eb80f, 0x0197b802, 0x82171600, + 0x82971700, 0x0037b80f, 0x00b7b80f, 0x0137b80f, + 0x01b7b80f, 0xb630001b, 0x003f8030, 0x005f8034, + 0x5ee2b80f, 0x8013007f, 0x9800ffff, 0xb6370011, + 0x41008000, 0x51018008, 0x4902800c, 0x40c08000, + 0x0008a028, 0x48c18008, 0x50c2800c, 0x42808004, + 0x00c8b806, 0x52828008, 0x5281800c, 0x41008004, + 0x0088a034, 0x49028008, 0x4901800c, 0x011fa026, + 0x0188a028, 0x001f8001, 0x001f8005, 0x001f8009, + 0x001f800d, 0x5de1b80f, 0x5a01b810, 0x0017b80d, + 0x0097b80e, 0x902d0004, 0x0117b801, 0x904e0004, + 0x0197b802, 0x82171600, 0x82971700, 0x5ea1b80a, + 0x8013007f, 0x9800ffff, 0xb6350013, 0x003f8030, + 0x005f8034, 0x42408000, 0x52418008, 0x4a42800c, + 0x41008000, 0x0008a052, 0x49018008, 0x5102800c, + 0x42808004, 0x0108b808, 0x52828008, 0x5281800c, + 0x40c08004, 0x0088a054, 0x48c28008, 0x48c1800c, + 0x011fa048, 0x0188a046, 0x81a71100, 0x81c71200, + 0x858c0001, 0xb4e0ff7e, 0x00ffb81c, 0x00000000, + 0x005f03fa, 0x00000000, 0xb0020000, 0xb4000034, + 0x81b70080, 0x81d7ffff, 0x81f70001, 0x82370080, + 0x8257ffff, 0x82770001, 0x82b70080, 0x82d7ffff, + 0x82f70001, 0x83370080, 0x8357ffff, 0x83770001, + 0x81971000, 0x82171100, 0x82971200, 0x83171300, + 0x815703fc, 0x81370200, 0x81170c00, 0x83d703fc, + 0x83b70200, 0x83970f00, 0x8057ffff, 0x80d7ffff, + 0x80171400, 0x80971500, 0x001f800d, 0x003f8019, + 0xb6004012, 0x41008000, 0x51018004, 0x007f8011, + 0x0128a008, 0x41018000, 0x49008004, 0x009f8015, + 0x03a8a008, 0x41038000, 0x51048004, 0x001f800d, + 0x03a8a008, 0x41048020, 0x49038024, 0x003f8019, + 0x0128a008, 0x005f8028, 0x005f803c, 0x81f70000, + 0x82770000, 0x82f70000, 0x83770000, 0x00ffb81c, + 0x82370040, 0x8257ffff, 0x82770001, 0x82b70040, + 0x82d7ffff, 0x82f70001, 0x82171000, 0x82971200, + 0x8157ffff, 0x81170c00, 0x81d7ffff, 0x81970e00, + 0x8057ffff, 0x80d7ffff, 0x80171800, 0x80971a00, + 0xb600800a, 0x001f8011, 0x003f8015, 0x41008000, + 0x51018004, 0x00000000, 0x0108a028, 0x41018020, + 0x49008024, 0x00000000, 0x0188a028, 0x82770000, + 0x82f70000, 0x00ffb81c, 0x00000000, 0x00000000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x808f0000, + 0x015f0384, 0x017f037a, 0xac4a0006, 0x8027b004, + 0x1042b80b, 0x5841b802, 0x1021b802, 0x0159b801, + 0x013f0325, 0x01bf0320, 0x5822b80b, 0x90210340, + 0x00ff9801, 0x8027b2e8, 0x5842b807, 0x1021b802, + 0x025bb801, 0x80070000, 0xac4d0006, 0x8027b004, + 0x1042b800, 0x5841b802, 0x1021b802, 0x0199b801, + 0x00000000, 0xac4c0006, 0x8027b078, 0x1042b80a, + 0x5842b802, 0x1021b802, 0x011bb801, 0x00000000, + 0x40d2b808, 0x00000000, 0xb0060000, 0xb4000080, + 0x005f033b, 0x80278400, 0xac600080, 0x5c22b801, + 0x10a1b803, 0xb0020000, 0xb4200002, 0x80279000, + 0xb5000001, 0x80279c00, 0x5c22b801, 0x11e1b803, + 0x80470300, 0x5822b800, 0x1042b801, 0x003f9802, + 0x806f001f, 0x80af001f, 0xb0010000, 0xb4200024, + 0x80170c00, 0x80971000, 0x003f8020, 0xb6000003, + 0x4201b806, 0x003f8020, 0x0088a030, 0x80270400, + 0xb6000208, 0x00cfb801, 0x00bfb0bc, 0x58a2b805, + 0x01afb805, 0x00bf90bc, 0xb520ffff, 0x90210020, + 0x90a50020, 0xb6000408, 0x00cfb801, 0x01ffb0bc, + 0x59e2b80f, 0x01afb80f, 0x01ff90bc, 0xb520ffff, + 0x90210020, 0x91ef0020, 0xb6000208, 0x00cfb801, + 0x00bfb0bc, 0x58a2b805, 0x01afb805, 0x00bf90bc, + 0xb520ffff, 0x90210020, 0x90a50020, 0xb5000043, + 0x80270400, 0x0087b805, 0x01c7b80f, 0xb6000208, + 0x00cfb801, 0x009fb0bc, 0x5882b804, 0x01cfb804, + 0x009f90bc, 0xb520ffff, 0x90210020, 0x90840020, + 0xb6000408, 0x00cfb801, 0x01dfb0bc, 0x59c2b80e, + 0x01cfb80e, 0x01df90bc, 0xb520ffff, 0x90210020, + 0x91ce0020, 0xb6000208, 0x00cfb801, 0x009fb0bc, + 0x5882b804, 0x01cfb804, 0x009f90bc, 0xb520ffff, + 0x90210020, 0x90840020, 0x80170c00, 0x80971000, + 0x8053007f, 0x9842ffff, 0xb6000004, 0x42028004, + 0x4a068020, 0x00000000, 0x0088a030, 0x80270400, + 0xb6000208, 0x00cfb801, 0x00bfb0bc, 0x58a2b805, + 0x01afb805, 0x00bf90bc, 0xb520ffff, 0x90210020, + 0x90a50020, 0xb6000408, 0x00cfb801, 0x01ffb0bc, + 0x59e2b80f, 0x01afb80f, 0x01ff90bc, 0xb520ffff, + 0x90210020, 0x91ef0020, 0xb6000208, 0x00cfb801, + 0x00bfb0bc, 0x58a2b805, 0x01afb805, 0x00bf90bc, + 0xb520ffff, 0x90210020, 0x90a50020, 0x5822b800, + 0x90210300, 0x0117b801, 0x80470001, 0x011fa002, + 0x90000001, 0x3000b809, 0xb480ff6b, 0x00ffb81c, + 0x8057ffff, 0x013f0325, 0x015f033b, 0x80171000, + 0x80070000, 0xb6002001, 0x001fa020, 0xb00a0001, + 0xb4c00002, 0x81679000, 0xb5000001, 0x81679c00, + 0x5d62b80b, 0x81878400, 0x5d82b80c, 0x80070000, + 0x5822b800, 0x90410300, 0x003f9802, 0x00000000, + 0xb0010000, 0xb4200019, 0xac400080, 0x00000000, + 0x10ccb802, 0x10abb802, 0x806f001f, 0x80af001f, + 0x80cf0400, 0xb6000408, 0xb520ffff, 0x00dfb0bc, + 0x58c2b806, 0x01afb806, 0x00df90bc, 0xb520ffff, + 0x80cf0400, 0x90c60020, 0x80cf0400, 0xb6000407, + 0x00bfb0bc, 0x58a2b805, 0x01afb805, 0x00bf90bc, + 0xb520ffff, 0x80cf0400, 0x90a50020, 0x90000001, + 0x3000b809, 0xb480ffde, 0x00ffb81b, 0x8057ffff, + 0x013f0325, 0x80171000, 0x80070000, 0xb6002001, + 0x001fa020, 0x81878400, 0x5d82b80c, 0x80070000, + 0x5822b800, 0x90410300, 0x003f9802, 0x00000000, + 0xb0010000, 0xb420000f, 0xac400080, 0x00000000, + 0x10ccb802, 0x806f001f, 0x80af001f, 0x80cf0400, + 0xb6000408, 0xb520ffff, 0x00dfb0bc, 0x58c2b806, + 0x01afb806, 0x00df90bc, 0xb520ffff, 0x80cf0400, + 0x90c60020, 0x90000001, 0x3000b809, 0xb480ffe8, + 0x00ffb81b, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x8139b000, 0x00000000, 0xb0090000, 0xb4000012, + 0x806f001f, 0x80af001f, 0x80cf0400, 0x013fb0bc, + 0x5922b809, 0x01cfb809, 0x013f90bc, 0xb520ffff, + 0x806f0003, 0x80af0003, 0x80cf0420, 0x91290020, + 0x013fb0bc, 0x5922b809, 0x01cfb809, 0x013f90bc, + 0xb520ffff, 0xb5000233, 0x80270000, 0x80171000, + 0xb6002401, 0x001fa021, 0x007f0384, 0x009f0320, + 0x00bf0385, 0x00df0386, 0x80e7b36c, 0x5821b803, + 0x1021b807, 0x0159b801, 0x5821b804, 0x1021b807, + 0x0179b801, 0x80e7b37c, 0x5821b803, 0x1021b807, + 0x0199b801, 0x5821b804, 0x1021b807, 0x01b9b801, + 0x80e7b38c, 0x5821b803, 0x1021b807, 0x01d9b801, + 0x5821b804, 0x1021b807, 0x01f9b801, 0x005f0385, + 0x8027b39c, 0x5842b802, 0x1021b802, 0x021bb801, + 0x005f0386, 0x8027b3ac, 0x5842b802, 0x1021b802, + 0x023bb801, 0x027f0383, 0x003f0328, 0x005f4195, + 0xb0130007, 0xb42000df, 0xb0010000, 0xb42000dd, + 0xb0020000, 0xb40000db, 0xb0030002, 0xb48000d9, + 0x029bb802, 0x82a7b108, 0xb00b0001, 0xb4200001, + 0xb5000005, 0xb00b0002, 0xb4200002, 0x92b500a0, + 0xb5000001, 0x92b50140, 0xb0030004, 0xb4600002, + 0x82870000, 0xb5000006, 0xb0030006, 0xb4600004, + 0xb0140001, 0xb4a00002, 0x82870001, 0xb5000000, + 0xac54000a, 0x806f0009, 0x80af0009, 0x5c22b815, + 0x80cf0440, 0x1021b802, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0xb520ffff, 0xb0030003, + 0xb400000f, 0xb0030004, 0xb400001d, 0xb0030005, + 0xb400002b, 0xb0030006, 0xb4000042, 0xb0030007, + 0xb4000059, 0x80171000, 0x005f9440, 0x001fa002, + 0x80171038, 0x005f9440, 0x001fa002, 0xb5000073, + 0x80171000, 0x005f9440, 0x001fa002, 0x80171004, + 0x005f9443, 0x001fa002, 0x8017101c, 0x005f9446, + 0x001fa002, 0x80171034, 0x005f9449, 0x001fa002, + 0x80171038, 0x005f9440, 0x001fa002, 0xb5000063, + 0x80171000, 0x005f9440, 0x001fa002, 0x80171008, + 0x005f9441, 0x001fa002, 0x80171020, 0x005f9444, + 0x001fa002, 0x80171034, 0x005f9440, 0x001fa002, + 0x80171038, 0x005f9447, 0x001fa002, 0xb5000053, + 0x80171000, 0x005f9440, 0x001fa002, 0x80171004, + 0x005f9443, 0x001fa002, 0x8017100c, 0x005f9441, + 0x001fa002, 0x8017101c, 0x005f9446, 0x001fa002, + 0x80171024, 0x005f9444, 0x001fa002, 0x80171034, + 0x005f9449, 0x001fa002, 0x80171038, 0x005f9440, + 0x001fa002, 0x8017103c, 0x005f9447, 0x001fa002, + 0xb500003a, 0x80171000, 0x005f9440, 0x001fa002, + 0x80171008, 0x005f9441, 0x001fa002, 0x8017100c, + 0x005f9442, 0x001fa002, 0x80171020, 0x005f9444, + 0x001fa002, 0x80171024, 0x005f9445, 0x001fa002, + 0x80171034, 0x005f9440, 0x001fa002, 0x80171038, + 0x005f9447, 0x001fa002, 0x8017103c, 0x005f9448, + 0x001fa002, 0xb5000021, 0x80171000, 0x005f9440, + 0x001fa002, 0x80171004, 0x005f9443, 0x001fa002, + 0x8017100c, 0x005f9441, 0x001fa002, 0x80171010, + 0x005f9442, 0x001fa002, 0x8017101c, 0x005f9446, + 0x001fa002, 0x80171024, 0x005f9444, 0x001fa002, + 0x80171028, 0x005f9445, 0x001fa002, 0x80171034, + 0x005f9449, 0x001fa002, 0x80171038, 0x005f9440, + 0x001fa002, 0x8017103c, 0x005f9447, 0x001fa002, + 0x80171040, 0x005f9448, 0x001fa002, 0x80270001, + 0x803eff90, 0x80171000, 0x82b30020, 0x9ab50000, + 0x40158020, 0xb6000501, 0x48158020, 0x82b30020, + 0x9ab50000, 0x80470000, 0x3015b800, 0xb4600006, + 0x80171000, 0x83840226, 0xb6000603, 0x40028000, + 0x00000000, 0x0008a020, 0x80171018, 0x82b30020, + 0x9ab50000, 0x40158020, 0xb6000501, 0x48158020, + 0x82b30020, 0x9ab50000, 0x80470000, 0x3015b800, + 0xb4600006, 0x80171018, 0x83840215, 0xb6000603, + 0x40028000, 0x00000000, 0x0008a020, 0x80171030, + 0x82b30020, 0x9ab50000, 0x40158020, 0xb6000501, + 0x48158020, 0x82b30020, 0x9ab50000, 0x80470000, + 0x3015b800, 0xb4600006, 0x80171030, 0x83840204, + 0xb6000603, 0x40028000, 0x00000000, 0x0008a020, + 0xb500011e, 0x80270000, 0x803eff90, 0xb0030000, + 0xb4200067, 0x025f0322, 0xb00b0001, 0xb4200016, + 0xb0120001, 0xb4200005, 0x80171018, 0x8033007f, + 0x9821ffff, 0x001fa001, 0xb5000110, 0xb0120002, + 0xb4200005, 0x80171020, 0x8033007f, 0x9821ffff, + 0x001fa001, 0xb5000109, 0x80171018, 0x80330040, + 0x98210000, 0x001fa001, 0x80171020, 0x00000000, + 0x001fa001, 0xb5000101, 0xb00b0002, 0xb420002c, + 0xb0120000, 0xb4200008, 0x80171000, 0x8033007f, + 0x9821ffff, 0x001fa001, 0x80171038, 0x00000000, + 0x001fa001, 0xb50000f5, 0xb0120001, 0xb4200008, + 0x80171000, 0x8033005a, 0x98218279, 0x001fa001, + 0x80171030, 0x00000000, 0x001fa001, 0xb50000eb, + 0xb0120002, 0xb4200008, 0x80171008, 0x8033005a, + 0x98218279, 0x001fa001, 0x80171038, 0x00000000, + 0x001fa001, 0xb50000e1, 0x80171000, 0x80330040, + 0x98210000, 0x001fa001, 0x80171008, 0x00000000, + 0x001fa001, 0x8017100c, 0x00000000, 0x001fa001, + 0x80171038, 0x00000000, 0x001fa001, 0xb50000d3, + 0xb0120000, 0xb4200008, 0x80171000, 0x8033007f, + 0x9821ffff, 0x001fa001, 0x80171038, 0x00000000, + 0x001fa001, 0xb50000c9, 0xb0120001, 0xb4200005, + 0x80171018, 0x8033007f, 0x9821ffff, 0x001fa001, + 0xb50000c2, 0xb0120002, 0xb4200005, 0x80171020, + 0x8033007f, 0x9821ffff, 0x001fa001, 0xb50000bb, + 0x80171018, 0x80330040, 0x98210000, 0x001fa001, + 0x80171020, 0x00000000, 0x001fa001, 0xb50000b3, + 0x80070000, 0x8033007f, 0x9821ffff, 0xb600050e, + 0x144eb80f, 0xb0028000, 0xb4c00008, 0xac400006, + 0x00000000, 0x1042b800, 0x5842b802, 0x90421000, + 0x0017b802, 0x00000000, 0x001fa001, 0x90000001, + 0x59c1b80e, 0x59e1b80f, 0xb0040000, 0xb4200023, + 0xb00a0002, 0xb4000007, 0x80171004, 0x8033005a, + 0x98218279, 0x001fa001, 0x80171034, 0x00000000, + 0x001fa001, 0xb00c0002, 0xb4000009, 0x8017100c, + 0x8033ffa5, 0x98217d87, 0x001fa001, 0x8017103c, + 0x8033005a, 0x98218279, 0x001fa001, 0xb500008b, + 0x8017100c, 0x8033ffa5, 0x98217d87, 0x001fa001, + 0x80171010, 0x00000000, 0x001fa001, 0x8017103c, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171040, + 0x00000000, 0x001fa001, 0xb500007c, 0xb0040001, + 0xb420002a, 0xb00a0001, 0xb4000007, 0x80171018, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171020, + 0x00000000, 0x001fa001, 0xb00a0003, 0xb420000a, + 0x8053005a, 0x98428279, 0x4030b802, 0x8017101c, + 0x5821b801, 0x00000000, 0x00000000, 0x00000000, + 0x0028b801, 0x001fa001, 0xb00c0001, 0xb4200007, + 0x8053005a, 0x98428279, 0x4031b802, 0x80171024, + 0x0028b801, 0x001fa001, 0xb500005c, 0xb00c0002, + 0xb420005a, 0x8053005a, 0x98428279, 0x4031b802, + 0x80171024, 0x0028b801, 0x001fa001, 0x80171028, + 0x00000000, 0x001fa001, 0xb5000050, 0xb00b0002, + 0xb4200012, 0xb00a0001, 0xb4200008, 0x80171004, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171034, + 0x00000000, 0x001fa001, 0xb5000008, 0xb00a0003, + 0xb4200006, 0x80171004, 0x00000000, 0x001fa010, + 0x80171034, 0x00000000, 0x001fa010, 0xb00c0001, + 0xb4200025, 0x027f0383, 0x003f0328, 0xb0130007, + 0xb420000b, 0xb00b0003, 0xb4200009, 0xb0010000, + 0xb4200007, 0x80171024, 0x00000000, 0x001fa011, + 0x80171054, 0x80270000, 0x001fa001, 0xb500002b, + 0xb00d0000, 0xb420000a, 0x8033005a, 0x98218279, + 0x4041b811, 0x8017100c, 0x0048b802, 0x001fa002, + 0x8017103c, 0x00000000, 0x001fa002, 0xb500001f, + 0xb00d0002, 0xb420001d, 0x80171054, 0x8033005a, + 0x98218279, 0x001fa001, 0x8017106c, 0x00000000, + 0x001fa001, 0xb5000015, 0xb00c0002, 0xb4200013, + 0xb00d0000, 0xb4200007, 0x8017100c, 0x00000000, + 0x001fa011, 0x80171040, 0x00000000, 0x001fa011, + 0xb500000a, 0xb00d0001, 0xb4200008, 0x80171054, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171058, + 0x00000000, 0x001fa001, 0xb5000000, 0x029f0388, + 0x02bf0321, 0xb0140000, 0xb4000006, 0xb0150000, + 0xb4000004, 0x8017108c, 0x8033007f, 0x9821ffff, + 0x001fa001, 0x8027b078, 0x5c22b801, 0x806f001f, + 0x80af001f, 0x80cf0400, 0x003fb0bc, 0x5822b801, + 0x01afb801, 0x003f90bc, 0xb520ffff, 0x90210020, + 0x806f0003, 0x80af0003, 0x80cf0420, 0x003fb0bc, + 0x5822b801, 0x01afb801, 0x003f90bc, 0xb520ffff, + 0x81270000, 0x8033007f, 0x9821ffff, 0x80171000, + 0xb600060a, 0x80470000, 0xb6000603, 0x015f8020, + 0x0156b80a, 0x1042b80a, 0x3002b801, 0xb4a00001, + 0x81270001, 0x00000000, 0x00000000, 0x015f0323, + 0x00000000, 0xb00a0000, 0xb4200002, 0x81670000, + 0xb5000001, 0x81670001, 0x017f23fb, 0x01ff41ee, + 0x59f0b80f, 0x61f0b80f, 0x021f41ef, 0x5a10b810, + 0x6210b810, 0xb00a0003, 0xb420003b, 0x017f039f, + 0x019f41c5, 0x5990b80c, 0x6190b80c, 0xb00b0000, + 0xb400000c, 0xb00c0000, 0xb4000005, 0xac4c0100, + 0x8033001d, 0x98215500, 0x12c1b802, 0xb500000f, + 0xac4f0100, 0x8033001d, 0x98215500, 0x12c1b802, + 0xb500000a, 0xb0090000, 0xb4000005, 0xac4f0100, + 0x8033ffe2, 0x9821ab00, 0x12c1b802, 0xb5000003, + 0xac4f0100, 0x00000000, 0x02c7b802, 0xb0030000, + 0xb420007e, 0x01bf03a0, 0x01df41c9, 0x59d0b80e, + 0x61d0b80e, 0xb00d0000, 0xb400000c, 0xb00e0000, + 0xb4000005, 0xac4e0100, 0x8033001d, 0x98215500, + 0x12e1b802, 0xb5000071, 0xac500100, 0x8033001d, + 0x98215500, 0x12e1b802, 0xb500006c, 0xb0090000, + 0xb4000005, 0xac500100, 0x8033ffe2, 0x9821ab00, + 0x12e1b802, 0xb5000065, 0xac500100, 0x00000000, + 0x02e7b802, 0xb5000061, 0xb00a0002, 0xb420002f, + 0x023f9002, 0x025f9001, 0xb00f0000, 0xb4a00007, + 0xac4f0100, 0x00000000, 0x4022b811, 0x00000000, + 0x0028b801, 0x02c7b801, 0xb500000c, 0xb0090000, + 0xb4000004, 0xac4f0100, 0x00000000, 0x02c7b802, + 0xb5000006, 0xac4f0100, 0x00000000, 0x4022b812, + 0x00000000, 0x0028b801, 0x02c7b801, 0xb0030000, + 0xb4200046, 0xb0100000, 0xb4a00007, 0xac500100, + 0x00000000, 0x4022b811, 0x00000000, 0x0028b801, + 0x02e7b801, 0xb500003d, 0xb0090000, 0xb4000004, + 0xac500100, 0x00000000, 0x02e7b802, 0xb5000037, + 0xac500100, 0x00000000, 0x4022b812, 0x00000000, + 0x0028b801, 0x02e7b801, 0xb5000030, 0x023f9002, + 0x025f9001, 0xb00f0000, 0xb4a00007, 0xac4f0100, + 0x00000000, 0x4022b811, 0x00000000, 0x0028b801, + 0x02c7b801, 0xb5000006, 0xac4f0100, 0x00000000, + 0x4022b812, 0x00000000, 0x0028b801, 0x02c7b801, + 0xb0090000, 0xb4000005, 0x0047b816, 0x8033ffe2, + 0x9821ab00, 0x1042b801, 0x02c7b802, 0xb0030000, + 0xb4200016, 0xb0100000, 0xb4a00007, 0xac500100, + 0x00000000, 0x4022b811, 0x00000000, 0x0028b801, + 0x02e7b801, 0xb5000006, 0xac500100, 0x00000000, + 0x4022b812, 0x00000000, 0x0028b801, 0x02e7b801, + 0xb0090000, 0xb4000005, 0x0047b817, 0x8033ffe2, + 0x9821ab00, 0x1042b801, 0x02e7b802, 0x00000000, + 0x00000000, 0x02c8b816, 0x02dfb0cf, 0xb0030000, + 0xb4200002, 0x02e8b817, 0x02ffb0c6, 0x00ffb81b, + 0xb6001807, 0x5841b802, 0x3015b800, 0xb4800002, + 0x06b5b800, 0x98420001, 0x5aa1b815, 0x00000000, + 0x00ffb81c, 0x00000000, 0x00000000, 0x00000000, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000015, 0x815bb3f0, 0x81070000, 0x812707f8, + 0xb00a0000, 0xb4000006, 0x81070800, 0x81270ff8, + 0xb00a0001, 0xb4000002, 0x81071000, 0x812717f8, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000f, 0x3001b809, + 0xb4a0002d, 0xb500000c, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81070000, 0xb5000007, 0xb0040001, + 0xb4200002, 0x81070800, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81071000, 0xb0040000, 0xb4200001, + 0x8384026c, 0x80af001f, 0x808f0000, 0x806f0000, + 0x80670400, 0x5d22b808, 0xb600100a, 0x00cfb803, + 0x013fb0bc, 0x5922b809, 0x01afb809, 0x013f90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x90630020, + 0x91290020, 0x801bb3f8, 0x80270001, 0xb0000001, + 0xb4000002, 0x802600a0, 0x803eb3f8, 0x914a0001, + 0xb00a0002, 0xb4a00001, 0x81470000, 0x815eb3f0, + 0x80270001, 0x003f2013, 0x00ffb81b, 0x00000000, + 0x029fb00a, 0x02bfb00b, 0x02dfb00c, 0x02ffb00d, + 0x031fb00e, 0x033fb00f, 0x033f400f, 0x0287b86f, + 0x029fb005, 0x8285009d, 0x9a940008, 0x8286009d, + 0x8285009c, 0x96b48000, 0xb0158000, 0xb40001b5, + 0x96b40100, 0xb0150100, 0xb400020c, 0x96b40400, + 0xb0150400, 0xb400020d, 0x96b40001, 0xb0150001, + 0xb400000c, 0x96b40008, 0xb0150008, 0xb40001ad, + 0x96b44000, 0xb0154000, 0xb400020c, 0x96b40002, + 0xb0150002, 0xb4000182, 0x00000000, 0x00000000, + 0xb500021e, 0x02bf9017, 0x92b50001, 0x02bfb017, + 0x82850082, 0x96f40001, 0xb0170000, 0xb4000171, + 0x5efdb814, 0x96f70001, 0xb0170001, 0xb420000b, + 0x83050069, 0x9718003f, 0x82e50064, 0x12f7b818, + 0x86f70109, 0x82feff74, 0x02e7b86f, 0x9af74000, + 0x01ffb817, 0x96f7bfff, 0x01ffb817, 0x83050081, + 0x82a5009a, 0x96b50001, 0xb0150001, 0xb4200014, + 0x82a70000, 0x02bfb017, 0x96b41840, 0xb0150800, + 0xb420000c, 0x96b40008, 0x5aa9b815, 0x96d46000, + 0x5ec3b816, 0x82f3000f, 0x9af7c00f, 0x1718b817, + 0x1ab5b818, 0x1ab5b816, 0x9ab50340, 0x82a60081, + 0xb500014c, 0x9b180180, 0x83060081, 0xb5000149, + 0x82a5009a, 0x96b50002, 0xb0150002, 0xb420001b, + 0x82a70000, 0x02bfb017, 0x96b41800, 0xb0151800, + 0xb4000013, 0x96b40040, 0xb0150040, 0xb4200004, + 0xa3180c00, 0x9b180340, 0x83060081, 0xb5000139, + 0x96b40008, 0x5aa9b815, 0x96d46000, 0x5ec3b816, + 0x82f3000f, 0x9af7c00f, 0x1718b817, 0x1ab5b818, + 0x1ab5b816, 0x9ab50340, 0x82a60081, 0xb500012d, + 0x9b180180, 0x83060081, 0xb500012a, 0x82a500c1, + 0x96b5000f, 0xb015000b, 0xb420000e, 0x96b40020, + 0xb0150020, 0xb400000b, 0x96b40200, 0xb0150200, + 0xb4000008, 0x82c50086, 0x82e50094, 0x3016b817, + 0xb4400004, 0x06f7b816, 0xb017ff00, 0xb4400001, + 0xb5000118, 0x96b46000, 0xb0156000, 0xb4000011, + 0x96b41820, 0xb0150820, 0xb4200004, 0x9b391000, + 0x82a5009a, 0x96b5feff, 0x82a6009a, 0x96b40040, + 0xb0150040, 0xb4200001, 0x9739efff, 0x96b91000, + 0xb0151000, 0xb4200003, 0x82a5009a, 0x9ab50100, + 0x82a6009a, 0x96b40040, 0xb0150040, 0xb4200019, + 0x96b41800, 0xb0151800, 0xb4200006, 0x96b98000, + 0xb0158000, 0xb4200003, 0x9b180180, 0x83060081, + 0xb50000f8, 0x96d80c00, 0x82b300ff, 0x9ab5f3ff, + 0x1718b815, 0xb0160c00, 0xb4000007, 0x82e50098, + 0x96f70400, 0xb0170400, 0xb4200002, 0x82c70c00, + 0xb5000001, 0xa2d60c00, 0x1b18b816, 0x9b180340, + 0xb50000c4, 0x96b40220, 0xb0150000, 0xb4e00021, + 0x82a5009d, 0x82f3ffff, 0x16b5b817, 0x82f33800, + 0x3015b817, 0xb420001b, 0x96f98000, 0xb0178000, + 0xb4000018, 0x82a70000, 0x02bfb017, 0x82c5009d, + 0x96d6ffff, 0x82b3c800, 0x9ab58001, 0x82e500c1, + 0x96f7000f, 0xb017000b, 0xb4000002, 0x82b38800, + 0x9ab58001, 0x1ab5b816, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82b3c800, 0x9ab58001, + 0x82a6009d, 0x02ff9017, 0x00000000, 0xb0170040, + 0xb4800000, 0x5eb5b814, 0x96b500f0, 0x96f46000, + 0x5eedb817, 0x1ab5b817, 0xb0170003, 0xb4000004, + 0x96b500ef, 0x96f70001, 0x5ae4b817, 0x1ab5b817, + 0x96d41800, 0xb0161800, 0xb400000a, 0x96f900ff, + 0x96b500ff, 0x9739ff00, 0x1b39b815, 0x02a7b817, + 0x96b500f3, 0x96d40008, 0x5ec1b816, 0x1ab5b816, + 0xb500000c, 0x96f98000, 0xb0178000, 0xb4200007, + 0x5efeb814, 0x96f70001, 0xb0170001, 0xb4000003, + 0x9b180180, 0x83060081, 0xb50000a2, 0x96b500f3, + 0x9ab50008, 0x9739fff3, 0x96d40020, 0xb0160020, + 0xb4200019, 0x82c7001f, 0x82c600c9, 0x9b398000, + 0x82c70000, 0x02dfb017, 0x96d40010, 0x5ac8b816, + 0x82f300ff, 0x9af7cfff, 0x1718b817, 0x1b18b816, + 0x9b180340, 0x82c5009d, 0x96d6ffff, 0x82f33800, + 0x9af78001, 0x1af7b816, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82f3c800, 0x9af78001, + 0x82e6009d, 0xb500005f, 0x97397fff, 0x96b500ff, + 0x5aaab815, 0x82f300fc, 0x9af703ff, 0x1718b817, + 0x1b18b815, 0x9b180340, 0x82c5009a, 0x96d60010, + 0xb0160010, 0xb4200027, 0x82c70000, 0x02dfb017, + 0x82c50086, 0x92d60bb8, 0x82c60086, 0x82c50094, + 0x5eefb818, 0x96f70003, 0xb0170003, 0xb4200002, + 0x82e70bb8, 0xb5000001, 0x82e70bb8, 0x12d6b817, + 0x82e50081, 0x9af70020, 0x82e60081, 0x82c60094, + 0xa2f70020, 0x82e60081, 0x82f30001, 0x16f7b818, + 0x5ef0b817, 0xb0170001, 0xb4000004, 0x96f84000, + 0x5ee4b817, 0x9718f3ff, 0x1b18b817, 0x82f32800, + 0x9af78000, 0x82e6009d, 0x83060081, 0x83070001, + 0x8306009f, 0x8305009c, 0xb0180001, 0xb4e0fffb, + 0xb50000f6, 0x82c5009d, 0x82f33800, 0x9af78001, + 0x3016b817, 0xb420000f, 0x82b3c800, 0x9ab58001, + 0x82e500c1, 0x96f7000f, 0xb017000b, 0xb4000002, + 0x82b38800, 0x9ab58001, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82b3c800, 0x9ab58001, + 0x82a6009d, 0x82c5009a, 0x96d60080, 0xb0160080, + 0xb4000013, 0x02df9017, 0x00000000, 0xb0160010, + 0xb480000f, 0x82c500c1, 0x96d6000f, 0xb016000b, + 0xb400000b, 0x82c50087, 0x96d60080, 0x5ac7b816, + 0x82c50098, 0x96d60800, 0x5ac3b816, 0x96f84000, + 0x3017b816, 0xb4200002, 0x033f400f, 0x9b394000, + 0x9739bfff, 0x82e50061, 0x96f70008, 0xb0170008, + 0xb4000005, 0x5eefb818, 0x96f70003, 0xb0170003, + 0xb4000001, 0x9718ffff, 0x96b41800, 0xb0151800, + 0xb4000008, 0x5eb9b814, 0x96b5000f, 0x82c50099, + 0x5ed0b816, 0x96f6000f, 0x5ab0b815, 0x82a60099, + 0xb5000002, 0x5ef9b814, 0x96f7000f, 0x5aecb817, + 0x82c5009a, 0x96d60fff, 0x1ad6b817, 0x82c6009a, + 0x96b46000, 0xb0156000, 0xb4200005, 0x5ae2b817, + 0x82d30ffc, 0x9ad63fff, 0x1718b816, 0x1b18b817, + 0x83060081, 0x83070001, 0x8306009f, 0x8305009c, + 0xb0180001, 0xb4e0fffb, 0x00000000, 0xb500009f, + 0x82850083, 0x96b400ff, 0xb015003c, 0xb4200019, + 0x96b92000, 0xb0152000, 0xb4000002, 0x9b392000, + 0xb5000014, 0x9739d3ff, 0x82870000, 0x82860087, + 0x82870008, 0x82860083, 0x829bff78, 0x82a7001f, + 0xb0140400, 0xb4000001, 0x82a70010, 0x82a600c9, + 0x829bff78, 0x00000000, 0x828600cb, 0x8285009d, + 0x82b3ffff, 0x9ab5fffd, 0x1694b815, 0x8286009d, + 0xb5000000, 0x83070002, 0x8306009f, 0x00000000, + 0xb500007e, 0x83078000, 0x8306009f, 0x00000000, + 0xb500007a, 0x82850094, 0x82a50086, 0x06b5b814, + 0x02b6b815, 0xb0151700, 0xb440004c, 0x8285006c, + 0x969400ff, 0xb0140024, 0xb4000019, 0xb0140012, + 0xb4000017, 0x8285009a, 0x5eedb814, 0x96f70003, + 0xb0170003, 0xb4000009, 0x82a50083, 0x5ea8b815, + 0x96b500ff, 0xb0150020, 0xb4400002, 0x82c70bbc, + 0xb5000001, 0x82c70bb8, 0xb5000008, 0x82a50083, + 0x5ea8b815, 0x96b500ff, 0xb0150020, 0xb4400002, + 0x82c71199, 0xb5000001, 0x82c71197, 0xb5000017, + 0xb500002e, 0x8285009a, 0x5eedb814, 0x96f70003, + 0xb0170003, 0xb4000009, 0x82a50083, 0x5ea8b815, + 0x96b500ff, 0xb0150020, 0xb4400002, 0x82c70e12, + 0xb5000001, 0x82c70e0e, 0xb5000008, 0x82a50083, + 0x5ea8b815, 0x96b500ff, 0xb0150020, 0xb4400002, + 0x82c70e12, 0xb5000001, 0x82c70e0e, 0x82e50086, + 0x12f7b816, 0x02bf9017, 0xb0150020, 0xb480000b, + 0x82a5009a, 0x96b56000, 0xb0156000, 0xb4000007, + 0x82a50098, 0x96d50a00, 0xb0160a00, 0xb4000002, + 0xb0160000, 0xb4200001, 0x92f705dc, 0x82850081, + 0x9ab40020, 0x82a60081, 0x82c50094, 0x82e60094, + 0x82860081, 0x86b705dc, 0x82a6009b, 0x83070008, + 0x8306009f, 0x00000000, 0xb5000024, 0x83070100, + 0x8306009f, 0x00000000, 0xb5000020, 0x83070000, + 0x83050081, 0x9b180180, 0x83060081, 0x83070400, + 0x8306009f, 0x00000000, 0xb5000018, 0x82870000, + 0x82850082, 0x5eb7b814, 0x96b500fc, 0x96d40006, + 0x5ec1b816, 0x1ab5b816, 0x5aacb815, 0x83050081, + 0x82d3001c, 0x9ad600ff, 0x1718b816, 0x1b18b815, + 0x9b180e00, 0x83060081, 0x83074000, 0x8306009f, + 0x8305009d, 0x82d3ffff, 0x9ad6bfff, 0x1718b816, + 0x8306009d, 0x00000000, 0xb5000000, 0x029f9005, + 0x01ffb814, 0x033f600f, 0x029f900a, 0x02bf900b, + 0x02df900c, 0x02ff900d, 0x031f900e, 0x033f900f, + 0x00ffb81e, 0x02ff9010, 0x92f70b43, 0x02ffb010, + 0x02ff90cb, 0x82bbffdc, 0x829bffd8, 0x93150004, + 0x3014b815, 0xb400000f, 0x02dbb818, 0x029bb815, + 0x3017b816, 0xb480000b, 0x5a81b814, 0x029fb010, + 0x82860095, 0x8293001f, 0x9294fe00, 0x92b50008, + 0x3015b814, 0xb4800002, 0x82b3001f, 0x92b5fa00, + 0x82beffdc, 0x82850086, 0x83250094, 0x06d4b819, + 0x02d6b816, 0xb016ffff, 0xb4a00009, 0x82c50081, + 0x9ab60020, 0x82a60081, 0x82a50086, 0x92b50bbb, + 0x82a60094, 0x82c60081, 0x86b505df, 0x82a6009b, + 0x00ffb81c, 0x82870001, 0x829ef500, 0x82850086, + 0x83250094, 0x06d4b819, 0x02d6b816, 0xb016ffff, + 0xb4a0000b, 0x82870001, 0x829ef504, 0x82c50081, + 0x9ab60020, 0x82a60081, 0x82a50086, 0x92b50bbb, + 0x82a60094, 0x82c60081, 0x86b505df, 0x82a6009b, + 0x00ffb81c, 0x82070028, 0x023f9006, 0x83a4ef4f, + 0x80070000, 0x001fb011, 0x001f204f, 0x003fb800, + 0x001f9006, 0x5803b800, 0x80338000, 0x1800b801, + 0x003fb800, 0x005f4193, 0x5c41b802, 0x80350000, + 0x00000000, 0x0027b860, 0x80150010, 0x5810b800, + 0x80750010, 0x1863b800, 0x8087ffff, 0x80a7770b, + 0x80c70000, 0x1403b804, 0x3000b805, 0xb4000008, + 0x5888b804, 0x58a8b805, 0x90c60001, 0xb0060003, + 0xb4a0fff8, 0x84420001, 0xb4e0ffee, 0xb5000027, + 0xb0060003, 0xb4200007, 0x80150010, 0x5810b800, + 0x81150010, 0x950800ff, 0xb0080077, 0xb4000001, + 0xb500fff4, 0x001f400e, 0x98000010, 0x98004000, + 0x9400fffe, 0x001f600e, 0x80e71f60, 0x001f4000, + 0x94000080, 0xb0000080, 0xb4200001, 0x80e774b0, + 0x00ffb008, 0x80e70020, 0xb0060000, 0xb400000e, + 0x58e3b806, 0x90210020, 0x81070000, 0x5938b803, + 0x1908b809, 0x9523ff00, 0x5928b809, 0x1908b809, + 0x5d28b803, 0x9529ff00, 0x1908b809, 0x5d38b803, + 0x1908b809, 0x011fb011, 0x00ff204f, 0x80137fff, + 0x9800ffe7, 0x1421b800, 0x5c23b801, 0x001f9006, + 0x0441b800, 0x3001b800, 0xb4600002, 0x0440b801, + 0xa4422000, 0x007f90cb, 0x1063b802, 0x007fb0cb, + 0x003fb006, 0x803effec, 0x80470001, 0x005f2013, + 0xb500ebd7, 0x001f400e, 0x9400000f, 0xb0000000, + 0xb4200001, 0x00ffb81f, 0xb0000001, 0xb4000005, + 0xb0000003, 0xb4000003, 0xb0000002, 0xb4000001, + 0x00ffb81f, 0x80070001, 0x001f2013, 0xb500ebc8, + 0x001f9012, 0x001fb100, 0x001f004c, 0x001f2404, + 0x801bfef0, 0x8058fef4, 0x803bff68, 0x8078ff6c, + 0x2000b801, 0x2042b803, 0x001fb104, 0x005f2414, + 0x82e70001, 0x83640048, 0x029fb014, 0x829efef0, + 0x8286000f, 0x02bf2054, 0x82bcfef4, 0x82a6000e, + 0x00ffb81a, 0x80e70001, 0x801336e3, 0x9800eb76, + 0x001fb100, 0x800700ab, 0x001f2404, 0x801bc3e8, + 0x8058c3ec, 0x83640024, 0x82e70000, 0x83640036, + 0x029fb300, 0x029fb100, 0x02bf2c04, 0x02bf2404, + 0x801bc000, 0x8058c004, 0x8364001b, 0x82e70000, + 0x8364002d, 0x001f9300, 0x3000b814, 0xb420000a, + 0x001f0c04, 0x3000b815, 0xb4200007, 0x829efef0, + 0x82bcfef4, 0x029fb012, 0x02bf204c, 0x82870001, + 0x829cfef5, 0x00ffb81a, 0xb0070000, 0xb4000007, + 0x80e70000, 0x801399fa, 0x9800c92e, 0x001fb100, + 0x800700af, 0x001f2404, 0xb500ffdc, 0x82870000, + 0x829cfef5, 0x00ffb81a, 0x80c700ff, 0x803bff68, + 0x8078ff6c, 0x14a0b806, 0x2063b805, 0x007f2414, + 0x2021b802, 0x58c8b806, 0x14a0b806, 0x58b0b805, + 0x2021b805, 0x58c8b806, 0x14a0b806, 0x2021b805, + 0x58c8b806, 0x14a0b806, 0x5cb0b805, 0x2021b805, + 0x003fb104, 0x00ffb81b, 0x82c70000, 0x83070400, + 0x83270005, 0x8197040c, 0x81d7ffff, 0x83840126, + 0x83840001, 0x00ffb81b, 0x808f0000, 0x806f001f, + 0x80af001f, 0x80270140, 0x81e7ef98, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x80270180, 0x81e7ee90, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x8057ffff, 0x80170430, 0x80070410, + 0x80270408, 0xb6000509, 0x005ff000, 0x90420500, + 0x007ff001, 0x90630600, 0x009ff002, 0x00bff003, + 0x2004a025, 0x90000001, 0x90210001, 0x80070414, + 0x80d7ffff, 0x8097045c, 0x8017043c, 0xb6000404, + 0x005ff000, 0x007f87e0, 0x84000001, 0x2082a7e3, + 0x80970460, 0x80170440, 0x2082b803, 0x007f8000, + 0x2083a004, 0x80170430, 0x80970450, 0x80270408, + 0xb6000508, 0x005f8024, 0x90420500, 0x007ff001, + 0x90630600, 0x009ff002, 0x00bff003, 0x2004a025, + 0x90210001, 0x80170440, 0x00000000, 0x02bf87e0, + 0x80970460, 0x82870000, 0xb6000404, 0x005f87e4, + 0x5a88b814, 0x204287e0, 0x1a94b802, 0x00ffb81c, + 0x001f0a49, 0x001f2709, 0x001f0a41, 0x001f2708, + 0x001f0a46, 0x001f2707, 0x001f0a48, 0x001f2706, + 0x001f0a42, 0x001f2705, 0x001f0a47, 0x001f2704, + 0x001f0a45, 0x001f2703, 0x001f0a43, 0x001f2702, + 0x001f0a40, 0x001f2701, 0x001f0a44, 0x001f2700, + 0x001f0c25, 0xa020000c, 0x94400001, 0x94600002, + 0x94810004, 0x94a10008, 0x94c00010, 0x5943b802, + 0x5861b803, 0x5882b804, 0x5ca2b805, 0x5cc4b806, + 0x194ab803, 0x194ab804, 0x194ab805, 0x194ab806, + 0x015f2738, 0x801bef90, 0x003f91c1, 0x5c28b801, + 0x005f91c2, 0x5858b802, 0x1821b802, 0x2000b801, + 0x001fb1c4, 0x8018ef94, 0x003f0709, 0x2000b801, + 0x001f2714, 0x82c70001, 0x82e70001, 0x83070710, + 0x8327001e, 0x81970735, 0x8384009f, 0x02df0738, + 0x82170a30, 0x838400f1, 0x819efef0, 0x817cfef4, + 0x819eff68, 0x817cff6c, 0x00ffb81b, 0x820f001f, + 0x8018fef8, 0x8057ffff, 0x001f2709, 0x8018fef6, + 0x80d7ffff, 0x001f2708, 0x8018fefa, 0x8157ffff, + 0x001f2707, 0x8018fefd, 0x81d7ffff, 0x001f2706, + 0x8018fefb, 0x802f001f, 0x001f2705, 0x8018fefe, + 0x00000000, 0x001f2704, 0x8018fef9, 0x00000000, + 0x001f2703, 0x8018feff, 0x00000000, 0x001f2702, + 0x8018fef7, 0x00000000, 0x001f2701, 0x8018fefc, + 0x00000000, 0x001f2700, 0x001f0c25, 0xa0200011, + 0x94410001, 0x94600002, 0x94800004, 0x94a00008, + 0x94c10010, 0x5941b802, 0x5861b803, 0x5c82b804, + 0x58a1b805, 0x5cc1b806, 0x194ab803, 0x194ab804, + 0x194ab805, 0x194ab806, 0x015f2738, 0x801bef90, + 0x003f91c1, 0x5c28b801, 0x005f91c2, 0x5858b802, + 0x1821b802, 0x2000b801, 0x001fb1c4, 0x8018ef94, + 0x003f0709, 0x2000b801, 0x001f2714, 0x82c70001, + 0x82e70001, 0x83070710, 0x8327001e, 0x81970735, + 0x83840055, 0x02df0738, 0x82170a20, 0x838400a7, + 0x819efef0, 0x817cfef4, 0x5ac8b80c, 0x02ff0a44, + 0x1ad6b817, 0x02dfb291, 0x5ed8b80c, 0x5968b80b, + 0x1ad6b80b, 0x02df6524, 0x00ffb81b, 0x820f001f, + 0x8018fefe, 0x8057ffff, 0x001f2709, 0x8018fefa, + 0x80d7ffff, 0x001f2708, 0x8018fefc, 0x8157ffff, + 0x001f2707, 0x8018feff, 0x81d7ffff, 0x001f2706, + 0x8018fef8, 0x802f001f, 0x001f2705, 0x8018fefb, + 0x00000000, 0x001f2704, 0x8018fefd, 0x00000000, + 0x001f2703, 0x8018fef6, 0x00000000, 0x001f2702, + 0x8018fef9, 0x00000000, 0x001f2701, 0x8018fef7, + 0x00000000, 0x001f2700, 0x801bef90, 0x003f91c1, + 0x5c28b801, 0x005f91c2, 0x5858b802, 0x1821b802, + 0x2000b801, 0x001fb1c4, 0x8018ef94, 0x003f0709, + 0x2000b801, 0x001f2714, 0x82c70001, 0x82e70001, + 0x83070710, 0x8327001e, 0x81970735, 0x83840016, + 0x83270000, 0x831bfef0, 0x82f8fef4, 0x02c7b819, + 0x82170a28, 0x83840065, 0x300cb818, 0xb4200002, + 0x300bb817, 0xb4000006, 0x93390001, 0xb0190020, + 0xb480fff6, 0x83270000, 0x833cfef5, 0x00ffb81b, + 0x019fb290, 0x017f2a44, 0x033f2c25, 0x83270001, + 0x833cfef5, 0x00ffb81b, 0x0007b818, 0x90000003, + 0x00000000, 0x015ff000, 0x90000001, 0x5949b80a, + 0x013ff000, 0x194ab809, 0x84000002, 0x994a0100, + 0x017ff000, 0x958b00f8, 0x5981b80c, 0x956b0007, + 0x198cb80b, 0x84000002, 0x998c0008, 0x017ff000, + 0x90000001, 0x5971b80b, 0x198cb80b, 0x017ff000, + 0x5969b80b, 0x198cb80b, 0x81a70000, 0x94d90003, + 0x82a70000, 0xb6260019, 0xb6000818, 0x5df0b80a, + 0x5e02b80a, 0x21efb810, 0x95ef0001, 0x5941b80a, + 0x194ab80f, 0x21efb816, 0x5e18b80c, 0x5e35b80c, + 0x5e54b80c, 0x5e6cb80c, 0x2210b811, 0x2252b813, + 0x2210b812, 0x96100001, 0x5981b80c, 0x198cb810, + 0x2210b817, 0x10afb810, 0x10a5b80d, 0x5da1b805, + 0x94a50001, 0x5aa1b815, 0x1ab5b805, 0x019fa7f5, + 0x5cc2b819, 0xb626001c, 0x82870000, 0xb6000419, + 0xb6000818, 0x5df0b80a, 0x5e02b80a, 0x21efb810, + 0x95ef0001, 0x5941b80a, 0x194ab80f, 0x21efb816, + 0x5e18b80c, 0x5e35b80c, 0x5e54b80c, 0x5e6cb80c, + 0x2210b811, 0x2252b813, 0x2210b812, 0x96100001, + 0x5981b80c, 0x198cb810, 0x2210b817, 0x10afb810, + 0x10a5b80d, 0x5da1b805, 0x94a50001, 0x5a81b814, + 0x1a94b805, 0x019fa7f4, 0x00ffb81c, 0x8257ffff, + 0x808f0000, 0x806f001f, 0x80af001f, 0x80270200, + 0x81e7ec70, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270240, + 0x81e7ed70, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270180, + 0x81e7ee90, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x806f0007, + 0x80af0007, 0x80270280, 0x81e7ee70, 0x5de2b80f, + 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, + 0x01ff90bc, 0xb520ffff, 0x91ef0020, 0x90210020, + 0x80170760, 0x001f0700, 0x001fa020, 0x001f0701, + 0x001fa020, 0x001f0702, 0x001fa020, 0x001f0703, + 0x001fa020, 0x001f0704, 0x001fa000, 0x80970750, + 0x81170770, 0x82a70735, 0x83a40060, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4005c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a70730, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40050, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4004c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a7072b, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40040, 0x83a4004e, + 0xb6000407, 0x86b50001, 0x83a4003c, 0x001f8004, + 0x003f87e8, 0x2080a001, 0x83a40047, 0x00000000, + 0x80970770, 0x80170750, 0x81170750, 0x81970740, + 0x82a70726, 0x001f800c, 0x003f8008, 0x2100a001, + 0x83a4002e, 0x83a4003c, 0xb6000407, 0x86b50001, + 0x83a4002a, 0x001f8004, 0x003f87e8, 0x2080a001, + 0x83a40035, 0x00000000, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a70721, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4001c, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a40018, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a7071c, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4000c, 0x017f87e4, + 0x81870000, 0xb6000406, 0x86b50001, 0x83a40007, + 0x001f87e4, 0x200087e8, 0x5988b80c, 0x198cb800, + 0x021fa02c, 0x021fa00b, 0x00ffb81c, 0x005ff015, + 0x90420600, 0x003f87e0, 0x001ff002, 0x2060b801, + 0x90630800, 0x90960a00, 0x001ff003, 0x003ff004, + 0x20a0b801, 0x90a50900, 0x00000000, 0x001ff005, + 0x009fa000, 0x00ffb81d, 0x001f8004, 0x5c21b800, + 0x5847b800, 0x1821b802, 0x942100ff, 0x2080a7e1, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x015f400e, 0x944a4000, 0xb0024000, 0xb420001a, + 0x954abfff, 0x015f600e, 0x820f001f, 0x802f001f, + 0x81470000, 0x015f23f9, 0x015fb0ba, 0x8057ffff, + 0x80770000, 0x82970400, 0x82d7ffff, 0x82f70000, + 0xb6000702, 0xb6000001, 0x029fa02a, 0x80275480, + 0x005fb801, 0x8033001f, 0x9821c000, 0x803effe0, + 0x90212000, 0x803effe4, 0x80d9ff80, 0x00df6001, + 0x81477528, 0x015fb008, 0x003f0324, 0xb0010000, + 0xb4200076, 0x8344ebe6, 0xb0180000, 0xb4000004, + 0x011f400e, 0x1908b818, 0x011f600e, 0x00ffb81f, + 0x8344f187, 0xb00b0000, 0xb4000006, 0x023f400e, + 0x9a310002, 0x023f600e, 0x82270000, 0x023f2012, + 0x00ffb81f, 0x8364ed6a, 0x82270000, 0x023f2011, + 0x80070000, 0x80170800, 0xb6002002, 0xb6003001, + 0x001fa020, 0x82270000, 0x003fb811, 0x02bf9006, + 0x5aa3b815, 0x82338000, 0x1a31b815, 0x003fb811, + 0x8067e950, 0x5c62b803, 0x81f50000, 0x019f4193, + 0x0267b80c, 0xadcc0010, 0x80170800, 0x80130000, + 0x9800f872, 0x001fa020, 0x80134e1f, 0x98000001, + 0x001fa020, 0x59d0b80e, 0x81150010, 0x1908b80e, + 0x001fa028, 0x858c0001, 0x5e01b80c, 0x5e25b810, + 0xb6310006, 0xb6002005, 0x81150010, 0x5910b808, + 0x00000000, 0x81350010, 0x1808a029, 0x9630001f, + 0xb0110000, 0xb4000006, 0xb6310005, 0x81150010, + 0x5910b808, 0x00000000, 0x81350010, 0x1808a029, + 0x962c0001, 0xb0110000, 0xb4000003, 0x81150010, + 0x5910b808, 0x001fa028, 0x019f9006, 0x958cffff, + 0x00df4193, 0x58c1b806, 0x118cb806, 0xb00ce000, + 0xb4800002, 0x858ce000, 0x918cc000, 0x8153001f, + 0x118cb80a, 0x819effec, 0x019fb006, 0x015f4193, + 0x5941b80a, 0x019f90cb, 0x118cb80a, 0x019fb0cb, + 0x019f90ba, 0x918c0001, 0x019fb0ba, 0xb00c0002, + 0xb4200016, 0x019f400e, 0x940c8000, 0xb0008000, + 0xb4200012, 0x958c7fff, 0x019f600e, 0x80070000, + 0x800600a0, 0x80073da1, 0x800600a1, 0x801bff60, + 0x00000000, 0x801eff60, 0x00000000, 0x801bff60, + 0x00000000, 0x801eff60, 0x80130001, 0x98003da1, + 0x800600a1, 0x80070001, 0x800600a0, 0x003f0324, + 0x90210001, 0xb0010005, 0xb4a00001, 0x80270000, + 0x003f2324, 0x00ffb81f, 0x00000000, 0x00000000, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815bb3f0, 0x81070000, 0x81270bf4, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x81271800, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a0002e, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200001, + 0x8384fc04, 0x80af001f, 0x808f0002, 0x806f0000, + 0x807bbf34, 0x5d22b80a, 0xb600080a, 0x00cfb803, + 0x013fb0bc, 0x5922b809, 0x01afb809, 0x013f90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x90630020, + 0x91290060, 0x808f0000, 0x813bb3f8, 0x80270001, + 0xb0090001, 0xb4000002, 0x802600a0, 0x803eb3f8, + 0x81270c00, 0xb00a0000, 0xb4000001, 0x81270000, + 0x813eb3f0, 0xb0030800, 0xb4800001, 0x80670200, + 0x807ebf34, 0x80270001, 0x003f2013, 0x00ffb81b, +}; + +static u32 AC3I2S240Ucode1f8000[] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00020000, 0xffff0005, 0xffffffff, + 0x00050001, 0xffffffff, 0xffffffff, 0x00020000, + 0xffff0005, 0xffffffff, 0x00010000, 0x00050002, + 0xffffffff, 0x00020000, 0x00050003, 0xffffffff, + 0x00010000, 0x00030002, 0xffff0005, 0x00020000, + 0x00040003, 0xffff0005, 0x00010000, 0x00030002, + 0x00050004, 0x0019000d, 0x003d0025, 0x00250019, + 0x00fd003d, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x007fffff, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x007fffff, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00599999, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00599999, + 0x007fffff, 0x00599999, 0x00000000, 0x00599999, + 0x00000000, 0x00000000, 0x00000000, 0x00599999, + 0x00000000, 0x00599999, 0x007fffff, 0x00000000, + 0x00599999, 0x00599999, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00599999, 0x00599999, + 0x007fffff, 0x007fffff, 0x00000000, 0x00599999, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00599999, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x007fffff, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x007fffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x007fffff, 0x00000000, 0x007fffff, 0x00400000, + 0x00200000, 0x00100000, 0x00080000, 0x00040000, + 0x00020000, 0x00010000, 0x00008000, 0x00004000, + 0x00002000, 0x00001000, 0x00000800, 0x00000400, + 0x00000200, 0x00000100, 0x00000080, 0x00000040, + 0x00000020, 0x00000010, 0x00000008, 0x00000004, + 0x00000002, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00010002, + 0x00030002, 0x00030002, 0x00030002, 0x00000000, + 0x00000000, 0x00010001, 0x00020002, 0x4000a000, + 0xe000a000, 0xf000b000, 0xf800b800, 0x005a8279, + 0x004c1bf8, 0x00400000, 0x004c1bf8, 0x005a8279, + 0x00400000, 0x00000000, 0x00400000, 0x03020100, + 0x00000000, 0x00000080, 0x00000020, 0x00000008, + 0x00000000, 0x00000001, 0x00010001, 0x10001000, + 0x10001004, 0x10041004, 0x10041004, 0x10041004, + 0x00000000, 0x00000000, 0x00000000, 0xff80000a, + 0xff80031f, 0xff800b24, 0xff801818, 0xff8029fa, + 0xff8040c9, 0xff805c86, 0xff807d2e, 0xff80a2c1, + 0xff80cd3c, 0xff80fc9f, 0xff8130e8, 0xff816a14, + 0xff81a821, 0xff81eb0e, 0xff8232d6, 0xff827f79, + 0xff82d0f2, 0xff83273e, 0xff83825b, 0xff83e244, + 0xff8446f7, 0xff84b06e, 0xff851ea6, 0xff85919b, + 0xff860949, 0xff8685aa, 0xff8706ba, 0xff878c74, + 0xff8816d3, 0xff88a5d1, 0xff89396a, 0xff89d196, + 0xff8a6e51, 0xff8b0f94, 0xff8bb55a, 0xff8c5f9b, + 0xff8d0e51, 0xff8dc176, 0xff8e7902, 0xff8f34ef, + 0xff8ff535, 0xff90b9cc, 0xff9182ae, 0xff924fd3, + 0xff932132, 0xff93f6c3, 0xff94d07f, 0xff95ae5d, + 0xff969054, 0xff97765b, 0xff98606a, 0xff994e78, + 0xff9a407c, 0xff9b366b, 0xff9c303e, 0xff9d2de9, + 0xff9e2f64, 0xff9f34a4, 0xffa03da0, 0xffa14a4c, + 0xffa25aa0, 0xffa36e8f, 0xffa48610, 0xffa5a118, + 0xffa6bf9c, 0xffa7e191, 0xffa906ec, 0xffaa2fa0, + 0xffab5ba4, 0xffac8aeb, 0xffadbd6a, 0xffaef315, + 0xffb02bdf, 0xffb167be, 0xffb2a6a4, 0xffb3e886, + 0xffb52d56, 0xffb67509, 0xffb7bf92, 0xffb90ce4, + 0xffba5cf2, 0xffbbafb0, 0xffbd050f, 0xffbe5d04, + 0xffbfb780, 0xffc11477, 0xffc273db, 0xffc3d59f, + 0xffc539b4, 0xffc6a00d, 0xffc8089d, 0xffc97355, + 0xffcae027, 0xffcc4f05, 0xffcdbfe2, 0xffcf32af, + 0xffd0a75d, 0xffd21ddf, 0xffd39625, 0xffd51022, + 0xffd68bc7, 0xffd80904, 0xffd987cd, 0xffdb0810, + 0xffdc89c1, 0xffde0cd0, 0xffdf912d, 0xffe116cb, + 0xffe29d9a, 0xffe4258b, 0xffe5ae8f, 0xffe73896, + 0xffe8c392, 0xffea4f74, 0xffebdc2b, 0xffed69aa, + 0xffeef7df, 0xfff086bd, 0xfff21634, 0xfff3a634, + 0xfff536ad, 0xfff6c792, 0xfff858d1, 0xfff9ea5b, + 0xfffb7c22, 0xfffd0e16, 0xfffea026, 0xffffcdbc, + 0xfffe3ba0, 0xfffca995, 0xfffb17ac, 0xfff985f3, + 0xfff7f479, 0xfff6634f, 0xfff4d284, 0xfff34228, + 0xfff1b249, 0xfff022f7, 0xffee9442, 0xffed0638, + 0xffeb78ea, 0xffe9ec67, 0xffe860bd, 0xffe6d5fd, + 0xffe54c35, 0xffe3c374, 0xffe23bcb, 0xffe0b547, + 0xffdf2ff7, 0xffddabec, 0xffdc2933, 0xffdaa7dd, + 0xffd927f6, 0xffd7a98f, 0xffd62cb7, 0xffd4b17b, + 0xffd337ea, 0xffd1c013, 0xffd04a05, 0xffced5ce, + 0xffcd637c, 0xffcbf31d, 0xffca84c1, 0xffc91874, + 0xffc7ae45, 0xffc64641, 0xffc4e078, 0xffc37cf6, + 0xffc21bc9, 0xffc0bcff, 0xffbf60a5, 0xffbe06c9, + 0xffbcaf79, 0xffbb5ac0, 0xffba08ae, 0xffb8b94d, + 0xffb76cac, 0xffb622d8, 0xffb4dbdc, 0xffb397c6, + 0xffb256a2, 0xffb1187d, 0xffafdd62, 0xffaea55f, + 0xffad707e, 0xffac3ecc, 0xffab1054, 0xffa9e523, + 0xffa8bd44, 0xffa798c2, 0xffa677a8, 0xffa55a02, + 0xffa43fdb, 0xffa3293d, 0xffa21634, 0xffa106c9, + 0xff9ffb08, 0xff9ef2fa, 0xff9deeab, 0xff9cee23, + 0xff9bf16c, 0xff9af892, 0xff9a039c, 0xff991295, + 0xff982586, 0xff973c78, 0xff965774, 0xff957683, + 0xff9499ad, 0xff93c0fb, 0xff92ec75, 0xff921c24, + 0xff91500f, 0xff90883f, 0xff8fc4bb, 0xff8f058b, + 0xff8e4ab6, 0xff8d9443, 0xff8ce239, 0xff8c349f, + 0xff8b8b7d, 0xff8ae6d7, 0xff8a46b5, 0xff89ab1e, + 0xff891416, 0xff8881a3, 0xff87f3cc, 0xff876a96, + 0xff86e606, 0xff866621, 0xff85eaed, 0xff85746d, + 0xff8502a6, 0xff84959e, 0xff842d57, 0xff83c9d7, + 0xff836b20, 0xff831138, 0xff82bc20, 0xff826bdc, + 0xff822070, 0xff81d9de, 0xff819829, 0xff815b54, + 0xff812360, 0xff80f051, 0xff80c228, 0xff8098e6, + 0xff80748e, 0xff805521, 0xff803a9f, 0xff80250b, + 0xff801464, 0xff8008ad, 0xff8001e4, 0xff800027, + 0xff800c7e, 0xff802c8f, 0xff806056, 0xff80a7cb, + 0xff8102e4, 0xff817191, 0xff81f3c3, 0xff828964, + 0xff83325f, 0xff83ee98, 0xff84bdf3, 0xff85a04f, + 0xff86958b, 0xff879d7f, 0xff88b804, 0xff89e4ee, + 0xff8b240e, 0xff8c7533, 0xff8dd82a, 0xff8f4cbb, + 0xff90d2ad, 0xff9269c4, 0xff9411c1, 0xff95ca62, + 0xff979365, 0xff996c81, 0xff9b5570, 0xff9d4de4, + 0xff9f5590, 0xffa16c24, 0xffa3914e, 0xffa5c4b8, + 0xffa8060d, 0xffaa54f3, 0xffacb10e, 0xffaf1a03, + 0xffb18f70, 0xffb410f7, 0xffb69e33, 0xffb936c0, + 0xffbbda37, 0xffbe8830, 0xffc14042, 0xffc40201, + 0xffc6cd00, 0xffc9a0d2, 0xffcc7d05, 0xffcf612b, + 0xffd24ccf, 0xffd53f80, 0xffd838c8, 0xffdb3833, + 0xffde3d49, 0xffe14795, 0xffe4569d, 0xffe769e9, + 0xffea80ff, 0xffed9b67, 0xfff0b8a4, 0xfff3d83c, + 0xfff6f9b5, 0xfffa1c91, 0xfffd4056, 0xffff9b78, + 0xfffc7756, 0xfff953c0, 0xfff63130, 0xfff31025, + 0xffeff117, 0xffecd484, 0xffe9bae5, 0xffe6a4b6, + 0xffe39270, 0xffe0848b, 0xffdd7b82, 0xffda77cb, + 0xffd779de, 0xffd48231, 0xffd19138, 0xffcea769, + 0xffcbc535, 0xffc8eb10, 0xffc61969, 0xffc350af, + 0xffc09151, 0xffbddbbb, 0xffbb3059, 0xffb88f92, + 0xffb5f9d0, 0xffb36f78, 0xffb0f0ef, 0xffae7e96, + 0xffac18cf, 0xffa9bff9, 0xffa7746f, 0xffa5368c, + 0xffa306aa, 0xffa0e51e, 0xff9ed23c, 0xff9cce56, + 0xff9ad9bc, 0xff98f4bc, 0xff971f9f, 0xff955aae, + 0xff93a62f, 0xff920266, 0xff906f92, 0xff8eedf3, + 0xff8d7dc4, 0xff8c1f3c, 0xff8ad294, 0xff8997fd, + 0xff886fa8, 0xff8759c3, 0xff865679, 0xff8565f2, + 0xff848852, 0xff83bdbd, 0xff830651, 0xff82622b, + 0xff81d163, 0xff815411, 0xff80ea47, 0xff809416, + 0xff80518b, 0xff8022b1, 0xff80078e, 0x00000475, + 0x000007fe, 0x00000c02, 0x000010a3, 0x000015f5, + 0x00001c08, 0x000022ed, 0x00002ab5, 0x00003371, + 0x00003d32, 0x0000480a, 0x0000540d, 0x0000614b, + 0x00006fda, 0x00007fcd, 0x00009138, 0x0000a431, + 0x0000b8cc, 0x0000cf1f, 0x0000e741, 0x00010148, + 0x00011d4b, 0x00013b61, 0x00015ba2, 0x00017e25, + 0x0001a302, 0x0001ca51, 0x0001f42c, 0x000220a9, + 0x00024fe2, 0x000281f0, 0x0002b6ea, 0x0002eee9, + 0x00032a07, 0x0003685a, 0x0003a9fc, 0x0003ef04, + 0x0004378a, 0x000483a5, 0x0004d36d, 0x000526f7, + 0x00057e5b, 0x0005d9ae, 0x00063904, 0x00069c74, + 0x00070410, 0x00076feb, 0x0007e01a, 0x000854ac, + 0x0008cdb3, 0x00094b40, 0x0009cd61, 0x000a5425, + 0x000adf98, 0x000b6fc8, 0x000c04bf, 0x000c9e87, + 0x000d3d2a, 0x000de0ae, 0x000e891a, 0x000f3674, + 0x000fe8c0, 0x00109fff, 0x00115c34, 0x00121d5d, + 0x0012e37b, 0x0013ae89, 0x00147e84, 0x00155366, + 0x00162d27, 0x00170bbf, 0x0017ef23, 0x0018d748, + 0x0019c421, 0x001ab59f, 0x001babb2, 0x001ca648, + 0x001da54f, 0x001ea8b0, 0x001fb058, 0x0020bc2d, + 0x0021cc18, 0x0022dffd, 0x0023f7c2, 0x00251348, + 0x00263272, 0x00275520, 0x00287b31, 0x0029a482, + 0x002ad0f1, 0x002c0059, 0x002d3294, 0x002e677c, + 0x002f9ee8, 0x0030d8b1, 0x003214ac, 0x003352b0, + 0x00349290, 0x0035d422, 0x00371738, 0x00385ba5, + 0x0039a13b, 0x003ae7cc, 0x003c2f2a, 0x003d7725, + 0x003ebf8d, 0x00400834, 0x004150e9, 0x0042997d, + 0x0043e1c0, 0x00452981, 0x00467092, 0x0047b6c3, + 0x0048fbe3, 0x004a3fc6, 0x004b823b, 0x004cc316, + 0x004e0228, 0x004f3f45, 0x00507a40, 0x0051b2ef, + 0x0052e925, 0x00541cba, 0x00554d85, 0x00567b5e, + 0x0057a61d, 0x0058cd9e, 0x0059f1bb, 0x005b1252, + 0x005c2f3f, 0x005d4863, 0x005e5d9d, 0x005f6ed0, + 0x00607bde, 0x006184ad, 0x00628923, 0x00638927, + 0x006484a3, 0x00657b81, 0x00666daf, 0x00675b19, + 0x006843b1, 0x00692767, 0x006a062d, 0x006adff9, + 0x006bb4c2, 0x006c847d, 0x006d4f27, 0x006e14b8, + 0x006ed52f, 0x006f9089, 0x007046c6, 0x0070f7e9, + 0x0071a3f3, 0x00724aea, 0x0072ecd3, 0x007389b6, + 0x0074219d, 0x0074b490, 0x0075429b, 0x0075cbcc, + 0x00765031, 0x0076cfd8, 0x00774ad3, 0x0077c132, + 0x00783308, 0x0078a068, 0x00790968, 0x00796e1c, + 0x0079ce9a, 0x007a2af9, 0x007a8350, 0x007ad7b8, + 0x007b2849, 0x007b751d, 0x007bbe4c, 0x007c03f1, + 0x007c4625, 0x007c8504, 0x007cc0a8, 0x007cf92c, + 0x007d2eaa, 0x007d613e, 0x007d9101, 0x007dbe10, + 0x007de883, 0x007e1076, 0x007e3603, 0x007e5943, + 0x007e7a4f, 0x007e9942, 0x007eb633, 0x007ed13a, + 0x007eea6f, 0x007f01ea, 0x007f17c0, 0x007f2c08, + 0x007f3ed7, 0x007f5043, 0x007f605e, 0x007f6f3c, + 0x007f7cf1, 0x007f898e, 0x007f9525, 0x007f9fc6, + 0x007fa982, 0x007fb268, 0x007fba86, 0x007fc1eb, + 0x007fc8a4, 0x007fcebe, 0x007fd443, 0x007fd941, + 0x007fddc2, 0x007fe1cf, 0x007fe572, 0x007fe8b4, + 0x007feb9e, 0x007fee36, 0x007ff086, 0x007ff293, + 0x007ff463, 0x007ff5fd, 0x007ff765, 0x007ff8a1, + 0x007ff9b6, 0x007ffaa7, 0x007ffb79, 0x007ffc2f, + 0x007ffccb, 0x007ffd52, 0x007ffdc6, 0x007ffe28, + 0x007ffe7b, 0x007ffec2, 0x007ffefd, 0x007fff2f, + 0x007fff58, 0x007fff7b, 0x007fff97, 0x007fffae, + 0x007fffc0, 0x007fffcf, 0x007fffdb, 0x007fffe4, + 0x007fffec, 0x007ffff1, 0x007ffff6, 0x007ffff9, + 0x007ffffb, 0x007ffffd, 0x007ffffe, 0x007fffff, + 0x007fffff, 0x007fffff, 0x007fffff, 0xff800000, + 0x00000000, 0xffa57d86, 0x005a827a, 0xff89be51, + 0x0030fbc5, 0xffcf043b, 0x007641af, 0xff8275a1, + 0x0018f8b8, 0xffb8e313, 0x006a6d99, 0xff959267, + 0x00471ced, 0xffe70748, 0x007d8a5f, 0xff809dc9, + 0x000c8bd3, 0xffaecc33, 0x0062f202, 0xff8f1d34, + 0x003c56ba, 0xffdad7f4, 0x007a7d05, 0xff8582fb, + 0x0025280c, 0xffc3a946, 0x0070e2cc, 0xff9d0dfe, + 0x005133cd, 0xfff3742d, 0x007f6237, 0xff802778, + 0x000647d9, 0xffaa0a5b, 0x005ed77d, 0xff8c4a14, + 0x0036ba20, 0xffd4e0cb, 0x00788484, 0xff83d604, + 0x001f19f9, 0xffbe31e2, 0x006dca0d, 0xff99307f, + 0x004c3fe0, 0xffed37f0, 0x007e9d56, 0xff8162aa, + 0x0012c810, 0xffb3c020, 0x0066cf81, 0xff9235f3, + 0x0041ce1e, 0xffe0e607, 0x007c29fc, 0xff877b7c, + 0x002b1f35, 0xffc945e0, 0x0073b5ec, 0xffa12883, + 0x0055f5a5, 0xfff9b827, 0x007fd888, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static u32 AC3I2S240Ucode1fe000[] = { + 0x00000000, 0x03020102, 0x05040403, 0x00400040, + 0x00500050, 0x00600060, 0x00700070, 0x00800080, + 0x00a000a0, 0x00c000c0, 0x00e000e0, 0x01000100, + 0x01400140, 0x01800180, 0x01c001c0, 0x02000200, + 0x02800280, 0x03000300, 0x03800380, 0x04000400, + 0x04800480, 0x05000500, 0x00460045, 0x00580057, + 0x00690068, 0x007a0079, 0x008c008b, 0x00af00ae, + 0x00d100d0, 0x00f400f3, 0x01170116, 0x015d015c, + 0x01a201a1, 0x01e801e7, 0x022e022d, 0x02b902b8, + 0x03440343, 0x03d003cf, 0x045b045a, 0x04e604e5, + 0x05720571, 0x00600060, 0x00780078, 0x00900090, + 0x00a800a8, 0x00c000c0, 0x00f000f0, 0x01200120, + 0x01500150, 0x01800180, 0x01e001e0, 0x02400240, + 0x02a002a0, 0x03000300, 0x03c003c0, 0x04800480, + 0x05400540, 0x06000600, 0x06c006c0, 0x07800780, + 0x7b67533f, 0x1513110f, 0x04d80540, 0x04100478, + 0x07000000, 0x0b000900, 0x02b002f0, 0x02300270, + 0x017001f0, 0xf80000f0, 0x01000080, 0x02000180, + 0x03000280, 0x04000380, 0x2725231f, 0x2c2b2a29, + 0x2e2e2d2d, 0x30302f2f, 0x04030201, 0x08070605, + 0x0c0b0a09, 0x100f0e0d, 0x14131211, 0x18171615, + 0x1c1b1a19, 0x2825221f, 0x37312e2b, 0x4f49433d, + 0x796d6155, 0xcdb59d85, 0x0000fde5, 0x3d3e3f40, + 0x393a3b3c, 0x35363738, 0x32333434, 0x2f2f3031, + 0x2c2c2d2e, 0x29292a2b, 0x26262728, 0x23242425, + 0x21212223, 0x1e1f2020, 0x1c1d1d1e, 0x1a1b1b1c, + 0x1819191a, 0x16171718, 0x15151516, 0x13131414, + 0x12121213, 0x10111111, 0x0f0f1010, 0x0e0e0e0f, + 0x0d0d0d0d, 0x0c0c0c0c, 0x0b0b0b0b, 0x0a0a0a0a, + 0x0909090a, 0x08080909, 0x08080808, 0x07070707, + 0x06060707, 0x06060606, 0x05050606, 0x05050505, + 0x04040505, 0x04040404, 0x04040404, 0x03030304, + 0x03030303, 0x03030303, 0x02030303, 0x02020202, + 0x02020202, 0x02020202, 0x02020202, 0x01010202, + 0x01010101, 0x01010101, 0x01010101, 0x01010101, + 0x01010101, 0x01010101, 0x01010101, 0x00000101, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x04d004d0, + 0x04000440, 0x03c003e0, 0x03b003b0, 0x03a003a0, + 0x03a003a0, 0x039003a0, 0x03900390, 0x03800380, + 0x03700370, 0x03600360, 0x03500350, 0x03400340, + 0x03200330, 0x03000310, 0x02f002f0, 0x02f002f0, + 0x03100300, 0x03900340, 0x042003e0, 0x04900460, + 0x046004a0, 0x04400440, 0x08000520, 0x08400840, + 0x04f004f0, 0x04100460, 0x03d003e0, 0x03b003c0, + 0x03a003b0, 0x03a003a0, 0x03a003a0, 0x03900390, + 0x03800390, 0x03800380, 0x03700370, 0x03600360, + 0x03500350, 0x03400340, 0x03100320, 0x02f00300, + 0x02f002f0, 0x030002f0, 0x03500320, 0x03e00390, + 0x04500420, 0x049004a0, 0x04400460, 0x06300480, + 0x08400840, 0x05800580, 0x045004b0, 0x03f00420, + 0x03d003e0, 0x03b003c0, 0x03b003b0, 0x03a003a0, + 0x03a003a0, 0x03a003a0, 0x03a003a0, 0x03900390, + 0x03900390, 0x03800380, 0x03700380, 0x03500360, + 0x03300340, 0x03100320, 0x02f00300, 0x02f002f0, + 0x03100300, 0x03500330, 0x041003c0, 0x04a00470, + 0x04400460, 0x04e00450, 0xffaaaaab, 0x00000000, + 0x00555555, 0xff99999a, 0xffcccccd, 0x00000000, + 0x00333333, 0x00666666, 0xff924925, 0xffb6db6e, + 0xffdb6db7, 0x00000000, 0x00249249, 0x00492492, + 0x006db6db, 0xff8ba2e9, 0xffa2e8ba, 0xffba2e8c, + 0xffd1745d, 0xffe8ba2f, 0x00000000, 0x001745d1, + 0x002e8ba3, 0x0045d174, 0x005d1746, 0x00745d17, + 0xff888889, 0xff99999a, 0xffaaaaab, 0xffbbbbbc, + 0xffcccccd, 0xffddddde, 0xffeeeeef, 0x00000000, + 0x00111111, 0x00222222, 0x00333333, 0x00444444, + 0x00555555, 0x00666666, 0x00777777, 0x08070605, + 0x0c0b0a09, 0x10100e0e, 0x00000010, 0x00000000, + 0x00000010, 0x00000020, 0x00000100, 0x00000110, + 0x00000120, 0x00000200, 0x00000210, 0x00000220, + 0x00001000, 0x00001010, 0x00001020, 0x00001100, + 0x00001110, 0x00001120, 0x00001200, 0x00001210, + 0x00001220, 0x00002000, 0x00002010, 0x00002020, + 0x00002100, 0x00002110, 0x00002120, 0x00002200, + 0x00002210, 0x00002220, 0x00000000, 0x00000010, + 0x00000020, 0x00000030, 0x00000040, 0x00000100, + 0x00000110, 0x00000120, 0x00000130, 0x00000140, + 0x00000200, 0x00000210, 0x00000220, 0x00000230, + 0x00000240, 0x00000300, 0x00000310, 0x00000320, + 0x00000330, 0x00000340, 0x00000400, 0x00000410, + 0x00000420, 0x00000430, 0x00000440, 0x00001000, + 0x00001010, 0x00001020, 0x00001030, 0x00001040, + 0x00001100, 0x00001110, 0x00001120, 0x00001130, + 0x00001140, 0x00001200, 0x00001210, 0x00001220, + 0x00001230, 0x00001240, 0x00001300, 0x00001310, + 0x00001320, 0x00001330, 0x00001340, 0x00001400, + 0x00001410, 0x00001420, 0x00001430, 0x00001440, + 0x00002000, 0x00002010, 0x00002020, 0x00002030, + 0x00002040, 0x00002100, 0x00002110, 0x00002120, + 0x00002130, 0x00002140, 0x00002200, 0x00002210, + 0x00002220, 0x00002230, 0x00002240, 0x00002300, + 0x00002310, 0x00002320, 0x00002330, 0x00002340, + 0x00002400, 0x00002410, 0x00002420, 0x00002430, + 0x00002440, 0x00003000, 0x00003010, 0x00003020, + 0x00003030, 0x00003040, 0x00003100, 0x00003110, + 0x00003120, 0x00003130, 0x00003140, 0x00003200, + 0x00003210, 0x00003220, 0x00003230, 0x00003240, + 0x00003300, 0x00003310, 0x00003320, 0x00003330, + 0x00003340, 0x00003400, 0x00003410, 0x00003420, + 0x00003430, 0x00003440, 0x00004000, 0x00004010, + 0x00004020, 0x00004030, 0x00004040, 0x00004100, + 0x00004110, 0x00004120, 0x00004130, 0x00004140, + 0x00004200, 0x00004210, 0x00004220, 0x00004230, + 0x00004240, 0x00004300, 0x00004310, 0x00004320, + 0x00004330, 0x00004340, 0x00004400, 0x00004410, + 0x00004420, 0x00004430, 0x00004440, 0x00000000, + 0x00000100, 0x00000200, 0x00000300, 0x00000400, + 0x00000500, 0x00000600, 0x00000700, 0x00000800, + 0x00000900, 0x00000a00, 0x00001000, 0x00001100, + 0x00001200, 0x00001300, 0x00001400, 0x00001500, + 0x00001600, 0x00001700, 0x00001800, 0x00001900, + 0x00001a00, 0x00002000, 0x00002100, 0x00002200, + 0x00002300, 0x00002400, 0x00002500, 0x00002600, + 0x00002700, 0x00002800, 0x00002900, 0x00002a00, + 0x00003000, 0x00003100, 0x00003200, 0x00003300, + 0x00003400, 0x00003500, 0x00003600, 0x00003700, + 0x00003800, 0x00003900, 0x00003a00, 0x00004000, + 0x00004100, 0x00004200, 0x00004300, 0x00004400, + 0x00004500, 0x00004600, 0x00004700, 0x00004800, + 0x00004900, 0x00004a00, 0x00005000, 0x00005100, + 0x00005200, 0x00005300, 0x00005400, 0x00005500, + 0x00005600, 0x00005700, 0x00005800, 0x00005900, + 0x00005a00, 0x00006000, 0x00006100, 0x00006200, + 0x00006300, 0x00006400, 0x00006500, 0x00006600, + 0x00006700, 0x00006800, 0x00006900, 0x00006a00, + 0x00007000, 0x00007100, 0x00007200, 0x00007300, + 0x00007400, 0x00007500, 0x00007600, 0x00007700, + 0x00007800, 0x00007900, 0x00007a00, 0x00008000, + 0x00008100, 0x00008200, 0x00008300, 0x00008400, + 0x00008500, 0x00008600, 0x00008700, 0x00008800, + 0x00008900, 0x00008a00, 0x00009000, 0x00009100, + 0x00009200, 0x00009300, 0x00009400, 0x00009500, + 0x00009600, 0x00009700, 0x00009800, 0x00009900, + 0x00009a00, 0x0000a000, 0x0000a100, 0x0000a200, + 0x0000a300, 0x0000a400, 0x0000a500, 0x0000a600, + 0x0000a700, 0x0000a800, 0x0000a900, 0x0000aa00, + 0xff800000, 0xff800000, 0xffb82995, 0xffaf5d75, + 0xffa57d87, 0xff9a6806, 0xff8df708, 0xff800000, + 0xffb82995, 0xffaf5d75, 0xffa57d87, 0xff9a6806, + 0xff8df708, 0xff800000, 0xffb82995, 0xffaf5d75, + 0xffa57d87, 0xff9a6806, 0xff8df708, 0xff800000, + 0xffb82995, 0xffaf5d75, 0xffa57d87, 0xff9a6806, + 0xff8df708, 0xff800000, 0xffb82995, 0xffaf5d75, + 0xffa57d87, 0xff9a6806, 0xff8df708, 0xff800000, + 0xfffb0000, 0xfffcfffc, 0xfffcfffc, 0xfffcfffc, + 0xfffdfffd, 0xfffdfffd, 0xfffdfffd, 0xfffefffe, + 0xfffefffe, 0xfffefffe, 0xffffffff, 0xffffffff, + 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x80050000, 0x000a800f, 0x001e801b, 0x80110014, + 0x00368033, 0x8039003c, 0x802d0028, 0x00228027, + 0x00668063, 0x8069006c, 0x807d0078, 0x00728077, + 0x80550050, 0x005a805f, 0x004e804b, 0x80410044, + 0x00c680c3, 0x80c900cc, 0x80dd00d8, 0x00d280d7, + 0x80f500f0, 0x00fa80ff, 0x00ee80eb, 0x80e100e4, + 0x80a500a0, 0x00aa80af, 0x00be80bb, 0x80b100b4, + 0x00968093, 0x8099009c, 0x808d0088, 0x00828087, + 0x01868183, 0x8189018c, 0x819d0198, 0x01928197, + 0x81b501b0, 0x01ba81bf, 0x01ae81ab, 0x81a101a4, + 0x81e501e0, 0x01ea81ef, 0x01fe81fb, 0x81f101f4, + 0x01d681d3, 0x81d901dc, 0x81cd01c8, 0x01c281c7, + 0x81450140, 0x014a814f, 0x015e815b, 0x81510154, + 0x01768173, 0x8179017c, 0x816d0168, 0x01628167, + 0x01268123, 0x8129012c, 0x813d0138, 0x01328137, + 0x81150110, 0x011a811f, 0x010e810b, 0x81010104, + 0x03068303, 0x8309030c, 0x831d0318, 0x03128317, + 0x83350330, 0x033a833f, 0x032e832b, 0x83210324, + 0x83650360, 0x036a836f, 0x037e837b, 0x83710374, + 0x03568353, 0x8359035c, 0x834d0348, 0x03428347, + 0x83c503c0, 0x03ca83cf, 0x03de83db, 0x83d103d4, + 0x03f683f3, 0x83f903fc, 0x83ed03e8, 0x03e283e7, + 0x03a683a3, 0x83a903ac, 0x83bd03b8, 0x03b283b7, + 0x83950390, 0x039a839f, 0x038e838b, 0x83810384, + 0x82850280, 0x028a828f, 0x029e829b, 0x82910294, + 0x02b682b3, 0x82b902bc, 0x82ad02a8, 0x02a282a7, + 0x02e682e3, 0x82e902ec, 0x82fd02f8, 0x02f282f7, + 0x82d502d0, 0x02da82df, 0x02ce82cb, 0x82c102c4, + 0x02468243, 0x8249024c, 0x825d0258, 0x02528257, + 0x82750270, 0x027a827f, 0x026e826b, 0x82610264, + 0x82250220, 0x022a822f, 0x023e823b, 0x82310234, + 0x02168213, 0x8219021c, 0x820d0208, 0x02028207, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, + 0x00000000, 0xff800000, 0xffa57d86, 0xffa57d86, + 0xffcf043b, 0xff89be51, 0xff89be51, 0xffcf043b, + 0xffe70748, 0xff8275a1, 0xff959267, 0xffb8e313, + 0xffb8e313, 0xff959267, 0xff8275a1, 0xffe70748, + 0xfff3742d, 0xff809dc9, 0xff9d0dfe, 0xffaecc33, + 0xffc3a946, 0xff8f1d34, 0xff8582fb, 0xffdad7f4, + 0xffdad7f4, 0xff8582fb, 0xff8f1d34, 0xffc3a946, + 0xffaecc33, 0xff9d0dfe, 0xff809dc9, 0xfff3742d, + 0xfff9b827, 0xff802778, 0xffa12883, 0xffaa0a5b, + 0xffc945e0, 0xff8c4a14, 0xff877b7c, 0xffd4e0cb, + 0xffe0e607, 0xff83d604, 0xff9235f3, 0xffbe31e2, + 0xffb3c020, 0xff99307f, 0xff8162aa, 0xffed37f0, + 0xffed37f0, 0xff8162aa, 0xff99307f, 0xffb3c020, + 0xffbe31e2, 0xff9235f3, 0xff83d604, 0xffe0e607, + 0xffd4e0cb, 0xff877b7c, 0xff8c4a14, 0xffc945e0, + 0xffaa0a5b, 0xffa12883, 0xff802778, 0xfff9b827, + 0xcbcecdc4, 0xcfcac9c8, 0xc3c6c5cc, 0xc7c2c1c0, + 0x1b1e1d14, 0x1f1a1918, 0x1316151c, 0x17121110, + 0x2b2e2d24, 0x2f2a2928, 0x2326252c, 0x27222120, + 0x3b3e3d34, 0x3f3a3938, 0x3336353c, 0x37323130, + 0x0b0e0d04, 0x0f0a0908, 0x0306050c, 0x07020100, + 0xdbdeddd4, 0xdfdad9d8, 0xd3d6d5dc, 0xd7d2d1d0, + 0xebeeede4, 0xefeae9e8, 0xe3e6e5ec, 0xe7e2e1e0, + 0xfbfefdf4, 0xfffaf9f8, 0xf3f6f5fc, 0xf7f2f1f0, + 0x4b4e4d44, 0x4f4a4948, 0x4346454c, 0x47424140, + 0x9b9e9d94, 0x9f9a9998, 0x9396959c, 0x97929190, + 0xabaeada4, 0xafaaa9a8, 0xa3a6a5ac, 0xa7a2a1a0, + 0xbbbebdb4, 0xbfbab9b8, 0xb3b6b5bc, 0xb7b2b1b0, + 0x8b8e8d84, 0x8f8a8988, 0x8386858c, 0x87828180, + 0x5b5e5d54, 0x5f5a5958, 0x5356555c, 0x57525150, + 0x6b6e6d64, 0x6f6a6968, 0x6366656c, 0x67626160, + 0x7b7e7d74, 0x7f7a7978, 0x7376757c, 0x77727170, + 0x341424c4, 0x3e1e2ece, 0x3d1d2dcd, 0x3b1b2bcb, + 0xb494a444, 0xbe9eae4e, 0xbd9dad4d, 0xbb9bab4b, + 0xf4d4e404, 0xfedeee0e, 0xfddded0d, 0xfbdbeb0b, + 0x74546484, 0x7e5e6e8e, 0x7d5d6d8d, 0x7b5b6b8b, + 0x3c1c2ccc, 0x361626c6, 0x351525c5, 0x331323c3, + 0xbc9cac4c, 0xb696a646, 0xb595a545, 0xb393a343, + 0xfcdcec0c, 0xf6d6e606, 0xf5d5e505, 0xf3d3e303, + 0x7c5c6c8c, 0x76566686, 0x75556585, 0x73536383, + 0x381828c8, 0x3a1a2aca, 0x391929c9, 0x3f1f2fcf, + 0xb898a848, 0xba9aaa4a, 0xb999a949, 0xbf9faf4f, + 0xf8d8e808, 0xfadaea0a, 0xf9d9e909, 0xffdfef0f, + 0x78586888, 0x7a5a6a8a, 0x79596989, 0x7f5f6f8f, + 0x301020c0, 0x321222c2, 0x311121c1, 0x371727c7, + 0xb090a040, 0xb292a242, 0xb191a141, 0xb797a747, + 0xf0d0e000, 0xf2d2e202, 0xf1d1e101, 0xf7d7e707, + 0x70506080, 0x72526282, 0x71516181, 0x77576787, + 0x05040100, 0x15141110, 0x25242120, 0x35343130, + 0x85848180, 0x95949190, 0xa5a4a1a0, 0xb5b4b1b0, + 0xc0408000, 0xe060a020, 0xd0509010, 0xf070b030, + 0xc8488808, 0xe868a828, 0xd8589818, 0xf878b838, + 0xc4448404, 0xe464a424, 0xd4549414, 0xf474b434, + 0xcc4c8c0c, 0xec6cac2c, 0xdc5c9c1c, 0xfc7cbc3c, + 0xc2428202, 0xe262a222, 0xd2529212, 0xf272b232, + 0xca4a8a0a, 0xea6aaa2a, 0xda5a9a1a, 0xfa7aba3a, + 0xc6468606, 0xe666a626, 0xd6569616, 0xf676b636, + 0xce4e8e0e, 0xee6eae2e, 0xde5e9e1e, 0xfe7ebe3e, + 0xc1418101, 0xe161a121, 0xd1519111, 0xf171b131, + 0xc9498909, 0xe969a929, 0xd9599919, 0xf979b939, + 0xc5458505, 0xe565a525, 0xd5559515, 0xf575b535, + 0xcd4d8d0d, 0xed6dad2d, 0xdd5d9d1d, 0xfd7dbd3d, + 0xc3438303, 0xe363a323, 0xd3539313, 0xf373b333, + 0xcb4b8b0b, 0xeb6bab2b, 0xdb5b9b1b, 0xfb7bbb3b, + 0xc7478707, 0xe767a727, 0xd7579717, 0xf777b737, + 0xcf4f8f0f, 0xef6faf2f, 0xdf5f9f1f, 0xff7fbf3f, + 0x1045a3e2, 0x000000f4, 0x263b7333, 0x766b2363, + 0x2b367e3e, 0x7b662e6e, 0x06db93d3, 0x964b0343, + 0x0bd69ede, 0x9b460e4e, 0x825f1757, 0x12cf87c7, + 0x8f521a5a, 0x1fc28aca, 0x00d199d9, 0x90410949, + 0x01d098d8, 0x91400848, 0x24357d3d, 0x74652d6d, + 0x25347c3c, 0x75642c6c, 0x04d59ddd, 0x94450d4d, + 0x05d49cdc, 0x95440c4c, 0x80511959, 0x10c189c9, + 0x81501858, 0x11c088c8, 0x02df97d7, 0x924f0747, + 0x0fd29ada, 0x9f420a4a, 0x865b1353, 0x16cb83c3, + 0x8b561e5e, 0x1bc68ece, 0xa6bbf3b3, 0xf6eba3e3, + 0xabb6febe, 0xfbe6aeee, 0x223f7737, 0x726f2767, + 0x2f327a3a, 0x7f622a6a, 0xa0b1f9b9, 0xf0e1a9e9, + 0xa1b0f8b8, 0xf1e0a8e8, 0x84551d5d, 0x14c58dcd, + 0x85541c5c, 0x15c48ccc, 0xa4b5fdbd, 0xf4e5aded, + 0xa5b4fcbc, 0xf5e4acec, 0x20317939, 0x70612969, + 0x21307838, 0x71602868, 0xa2bff7b7, 0xf2efa7e7, + 0xafb2faba, 0xffe2aaea, 0x00000000, 0x00000000, +}; + +static u32 AC3I2S240Ucode1fff80[] = { + 0x0000240f, 0x007fffff, 0x007fffff, 0x00000003, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/ac3i2s.h linux.20pre5-ac2/drivers/media/video/ls220/ac3i2s.h --- linux.20pre5/drivers/media/video/ls220/ac3i2s.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/ac3i2s.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,2850 @@ +static u32 AC3I2SUcode1f1800[] = { + 0xb500000f, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xb500122b, 0x00000000, 0x00000000, 0x00000000, + 0x820f001f, 0x802f001f, 0x80070800, 0x001f6193, + 0x800500d4, 0x8053ffff, 0x9842c7ff, 0x8039ff7c, + 0x1400b802, 0x003f6000, 0x94210007, 0xb0010001, + 0xb4200001, 0x98002800, 0xb0010000, 0xb4200001, + 0x98000800, 0x805300ff, 0x1800b802, 0x800600d4, + 0x8013001f, 0x9020c000, 0x003fb006, 0x803effe0, + 0x803effe8, 0x803effec, 0x9020e000, 0x9021ffe4, + 0x9020fa00, 0x803effd0, 0x803effdc, 0x803effd8, + 0x9020fe00, 0x803effd4, 0x90400000, 0x804600a2, + 0x90421800, 0x804600a3, 0x80134099, 0x98000040, + 0x800600a6, 0x80130000, 0x98003ca1, 0x800600a1, + 0x80050080, 0x98000002, 0x80060080, 0x80070001, + 0x001f2013, 0x001f2324, 0x80070000, 0x001fb0ba, + 0x001f23f9, 0x801eb3f0, 0x80070800, 0x001f600f, + 0x80070000, 0x001f2012, 0x001fb0cb, 0x001fb010, + 0x801efff0, 0x98004000, 0x98008000, 0x001f600e, + 0x83e4013f, 0x80070000, 0x801eb3f8, 0x801eff70, + 0x800500a0, 0xb0000001, 0xb4000009, 0x80070001, + 0x800600a0, 0x80050080, 0x98000020, 0x80060080, + 0x9400ffdf, 0x80060080, 0x80070000, 0x800600a0, + 0x81df0004, 0x00000000, 0x00000000, 0x801bfff0, + 0x00000000, 0x940000ff, 0xb0000000, 0xb420004e, + 0x003f400e, 0x94010010, 0xb0000000, 0xb400fff4, + 0x838413dd, 0x003f0013, 0xb0010001, 0xb420003b, + 0x803bffe8, 0x801bffec, 0x00000000, 0x3001b800, + 0xb4600001, 0x90212000, 0x0421b800, 0x005f4193, + 0x5841b802, 0x3001b802, 0xb460000d, 0x80050086, + 0x005f9016, 0xb0020000, 0xb4200002, 0x001fb016, + 0xb500ffdf, 0x0420b802, 0xb0010b50, 0xb4a0ffdc, + 0x80070000, 0x001fb016, 0x83e40109, 0xb500ffd8, + 0x80070000, 0x001fb016, 0x001f400e, 0x9400000f, + 0xb0000000, 0xb4000014, 0xb0000001, 0xb4000010, + 0x003f400e, 0x9421fff0, 0x003f600e, 0x003f9006, + 0x9421ffff, 0x90210004, 0xb001e000, 0xb4800002, + 0x8421e000, 0x9021c000, 0x8013001f, 0x1021b800, + 0x003fb006, 0x003f90cb, 0x90210004, 0x003fb0cb, + 0x83e400ff, 0x83e413bc, 0x8007001f, 0x94000003, + 0x5810b800, 0x83e71aa8, 0x1bffb800, 0x003f9008, + 0x1821b800, 0x00ffb801, 0x83e4140f, 0x80270000, + 0x003f2013, 0x8007001f, 0x94000003, 0x5810b800, + 0x83671ad4, 0x1b7bb800, 0x003f9009, 0x1821b800, + 0x00ffb801, 0xb500ffaa, 0x803bffc0, 0x805bffc4, + 0x807bffc8, 0x809bffcc, 0x5828b801, 0x5cb8b802, + 0x1821b805, 0x5848b802, 0x5cb8b803, 0x1842b805, + 0x5868b803, 0x5cb8b804, 0x1863b805, 0x5888b804, + 0x1884b800, 0x803effc0, 0x805effc4, 0x807effc8, + 0x809effcc, 0x003f400e, 0xb0000086, 0xb4400048, + 0xb0000084, 0xb4000032, 0xb0000085, 0xb4000038, + 0xb0000086, 0xb400003a, 0x001f4000, 0x94000080, + 0xb0000080, 0xb4000072, 0x800500d4, 0x8053ffff, + 0x9842c7ff, 0x1400b802, 0x805300ff, 0x98422800, + 0x1800b802, 0x800600d4, 0x80130000, 0x98000c7f, + 0x005f4000, 0x94420008, 0xb0020008, 0xb4200001, + 0xa0000080, 0x800600a1, 0x8013001f, 0x9040c000, + 0x005fb006, 0x805effe0, 0x805effe8, 0x805effec, + 0x9040e000, 0x805effe4, 0x9040fa00, 0x805effd0, + 0x805effdc, 0x805effd8, 0x9040fe00, 0x805effd4, + 0x80070001, 0x001f2013, 0x80070000, 0x001fb0cb, + 0x001fb010, 0x001f2058, 0x80071fe0, 0x001fb008, + 0x80075fb0, 0x001fb009, 0x98214000, 0xb5000010, + 0x94011000, 0xb0001000, 0xb4200001, 0x9421efff, + 0x98210010, 0xb500000a, 0x80070000, 0x001fb0cb, + 0x83e40097, 0x003f400e, 0x9421ffef, 0xb5000004, + 0x83e40093, 0x003f400e, 0x98211000, 0x9421ffef, + 0x003f600e, 0x80070100, 0x801efff0, 0xb500ff4c, + 0xb000008b, 0xb400001c, 0xb000008e, 0xb4000022, + 0xb000008d, 0xb400001c, 0xb000008c, 0xb4000021, + 0xb0000087, 0xb400ffe8, 0xb0000088, 0xb4000014, + 0xb000008a, 0xb4000015, 0xb0000089, 0xb400001d, + 0xb00000a0, 0xb400001f, 0xb00000a1, 0xb4000041, + 0xb00000a2, 0xb400004e, 0xb00000a3, 0xb4000046, + 0xb00000a4, 0xb4000050, 0xb00000a5, 0xb4000054, + 0xb00000a6, 0xb4000058, 0x803efff8, 0xb500ffdd, + 0x9421ffdf, 0xb500ffda, 0xb500ffda, 0x80270100, + 0x803efff8, 0xb500ffd7, 0x80070000, 0x001fb017, + 0xb500ffd4, 0x801bffb0, 0x00000000, 0x001fb003, + 0xb500ffd0, 0x803bff80, 0x00000000, 0x003f6001, + 0xb500ffcc, 0x003f90ba, 0x803efff8, 0xb500ffc9, + 0x80130001, 0x98003da1, 0x800600a1, 0x80070200, + 0x801ebf34, 0x83e40042, 0x8013001f, 0x9840c000, + 0x805effe0, 0x005fb006, 0x805effe8, 0x805effec, + 0x90422000, 0x805effe4, 0x9040fa00, 0x805effd0, + 0x805effdc, 0x805effd8, 0x9040fe00, 0x805effd4, + 0x80070001, 0x001f2013, 0x80070000, 0x001f2324, + 0x001fb0cb, 0x001fb010, 0x001f2058, 0x80077580, + 0x001fb008, 0x80077830, 0x001fb009, 0x98214000, + 0xb500ffa7, 0x80270000, 0x8047fef0, 0x003eb802, + 0x90420004, 0x003eb802, 0x90420004, 0x003eb802, + 0x90420004, 0x003eb802, 0x81df0000, 0x00000000, + 0x00000000, 0x83641491, 0x81df0004, 0xb500ff99, + 0x81df0000, 0x00000000, 0x00000000, 0x8364143b, + 0x81df0004, 0xb500ff93, 0x81df0000, 0x00000000, + 0x00000000, 0x836413f6, 0x81df0004, 0xb500ff8d, + 0x81df0000, 0x00000000, 0x00000000, 0x83441359, + 0x81df0004, 0xb500ff87, 0x81df0000, 0x00000000, + 0x00000000, 0x8344133e, 0x81df0004, 0xb500ff81, + 0x80070000, 0x80470000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6002003, 0xb6003002, 0x001eb802, + 0x90420004, 0x80171000, 0x8057ffff, 0xb6002002, + 0xb6001801, 0x001fa020, 0x81df0004, 0x00ffb81f, + 0x001f4000, 0x94000080, 0xb0000080, 0xb4200001, + 0xb500ffeb, 0xb500000a, 0x80270000, 0x003f2013, + 0x8007001f, 0x94000003, 0x5810b800, 0x83671ec0, + 0x1b7bb800, 0x003f9009, 0x1821b800, 0x00ffb801, + 0x003f0013, 0xb0010001, 0xb420fff3, 0x83a70000, + 0x803bff70, 0x00000000, 0xb0010000, 0xb4000015, + 0x80170300, 0x80070000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6000601, 0x001fa020, 0x83640cdb, + 0x00ff0325, 0x82870000, 0xb6270002, 0x83640228, + 0x92940001, 0x81df0004, 0x001f033b, 0xb0000000, + 0xb4000002, 0x80270000, 0xb5000001, 0x80270001, + 0x003f233b, 0x80270000, 0x003f2013, 0x8007001f, + 0x94000003, 0x5810b800, 0x83671f5c, 0x1b7bb800, + 0x003f9009, 0x1821b800, 0x00ffb801, 0x003f0013, + 0xb0010001, 0xb420fff3, 0x93bd0001, 0xb01d0004, + 0xb480ffd7, 0x803bff70, 0x00000000, 0xb0010000, + 0xb4000005, 0x81df0000, 0x00000000, 0x00000000, + 0x83640c83, 0x81df0004, 0x00000000, 0x00000000, + 0x00ffb81f, 0x007f90cb, 0x90630400, 0x007fb0cb, + 0x003f9006, 0x9421ffff, 0x90210400, 0xb001e000, + 0xb4800002, 0x8421e000, 0x9021c000, 0x8013001f, + 0x1021b800, 0x003fb006, 0x803effec, 0x00ffb81f, + 0x015f400e, 0x944a4000, 0xb0024000, 0xb4200090, + 0x954abfff, 0x015f600e, 0x820f001f, 0x802f001f, + 0x81470000, 0x015f23f9, 0x829702ec, 0x82d7ffff, + 0x82f70000, 0x81df0000, 0x00000000, 0x00000000, + 0xb6000501, 0x029fa02a, 0x82970400, 0xb6000702, + 0xb6000001, 0x029fa02a, 0x81df0004, 0x8053ff00, + 0x98420000, 0x805ebf14, 0x805ebf18, 0x805ebf1c, + 0x805ebf20, 0x805ebf24, 0x805ebf28, 0x80270000, + 0x003f2328, 0x80275480, 0x005fb801, 0x8033001f, + 0x9821c000, 0x803effe0, 0x90212000, 0x803effe4, + 0x80dbff8c, 0x80fbff90, 0x80debf14, 0x80febf18, + 0x80dbff94, 0x80fbff98, 0x80debf1c, 0x80febf20, + 0x80dbff9c, 0x80fbffa0, 0x80debf24, 0x80febf28, + 0x80dbff84, 0x80e70001, 0x00dfb001, 0x80dbff88, + 0x00ff6191, 0x00dfb002, 0x80dbffb0, 0x80470000, + 0x00dfb003, 0x80d9ff80, 0x005fb0cf, 0x005fb0c6, + 0x00df6001, 0x80470001, 0x005f618f, 0x804700ff, + 0x005f231c, 0x005f231d, 0x80470000, 0x005f204e, + 0x8047e138, 0x5c42b802, 0x814f6300, 0x80cf00a9, + 0x005fb0bc, 0x5842b802, 0x01cfb802, 0x005f90bc, + 0xb520ffff, 0x8067e16c, 0x5c62b803, 0x80270040, + 0x81df0000, 0x00000000, 0x00000000, 0xb6000209, + 0x814fffc0, 0x00cfb801, 0x007fb0bc, 0x5862b803, + 0x01cfb803, 0x007f90bc, 0xb520ffff, 0x90210020, + 0x90630020, 0x81df0004, 0x8047e398, 0x5c42b802, + 0x814fce40, 0x80cf0080, 0x005fb0bc, 0x5842b802, + 0x01cfb802, 0x005f90bc, 0xb520ffff, 0x8047e400, + 0x5c42b802, 0x814f7380, 0x80cf009a, 0x005fb0bc, + 0x5842b802, 0x01cfb802, 0x005f90bc, 0xb520ffff, + 0x8047e43c, 0x5c42b802, 0x814f18c0, 0x80cf00b6, + 0x005fb0bc, 0x5842b802, 0x01cfb802, 0x005f90bc, + 0xb520ffff, 0x80e70000, 0x00ffb0ba, 0x808f0000, + 0x806f001f, 0x80af001f, 0x8027b9fc, 0x5c22b801, + 0x80670700, 0x81df0000, 0x00000000, 0x00000000, + 0xb600080a, 0x00cfb803, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0x0047b86f, 0xb0020001, + 0xb4c0fffd, 0x90210020, 0x90630020, 0x81df0004, + 0x834400d7, 0xb0180000, 0xb4200025, 0x834406d4, + 0x80c70000, 0x00df2324, 0x83640026, 0x83440220, + 0x00df0324, 0x90c60001, 0x00df2324, 0xb0060006, + 0xb4000003, 0x81472248, 0x015fb008, 0x00ffb81f, + 0x00ff90ba, 0x90e70001, 0x00ffb0ba, 0x019f9006, + 0x958cffff, 0x00df4193, 0x58c1b806, 0x118cb806, + 0xb00ce000, 0xb4800002, 0x858ce000, 0x918cc000, + 0x8153001f, 0x118cb80a, 0x819effec, 0x019fb006, + 0x015f4193, 0x5941b80a, 0x019f90cb, 0x118cb80a, + 0x019fb0cb, 0x81472230, 0x015fb008, 0x00ffb81f, + 0x015f400e, 0x194ab818, 0x015f600e, 0x802500a5, + 0x00ffb81f, 0x803bff8c, 0x805bff90, 0x803ebf14, + 0x805ebf18, 0x803bff94, 0x805bff98, 0x803ebf1c, + 0x805ebf20, 0x803bff9c, 0x805bffa0, 0x803ebf24, + 0x805ebf28, 0x80470003, 0x805ebefc, 0x003f0384, + 0x5822b801, 0x9021eb50, 0x005bb801, 0x00000000, + 0xb0020001, 0xb4200002, 0x80470001, 0x805ebefc, + 0x8073ff80, 0x98630000, 0x8027bf14, 0x8047befc, + 0x81df0000, 0x00000000, 0x00000000, 0xb6000609, + 0x009bb801, 0x00000000, 0x00a7b804, 0x6081b804, + 0x3004b803, 0xb4000001, 0x00beb802, 0x90210004, + 0x90420004, 0x81df0004, 0x00ffb81b, 0x00000000, + 0x81150010, 0x00000000, 0x00000000, 0x81350010, + 0x00000000, 0x00000000, 0x81550002, 0x00000000, + 0x015f2380, 0x81550006, 0x00000000, 0x015f2381, + 0x81550005, 0x00000000, 0x015f2382, 0x81550003, + 0x00000000, 0x015f2383, 0x81550003, 0x015f2384, + 0xb00a0001, 0xb4000005, 0x956a0001, 0xb00b0000, + 0xb4000002, 0x81750002, 0x017f2385, 0x956a0004, + 0xb00b0000, 0xb4000002, 0x81750002, 0x017f2386, + 0xb00a0002, 0xb4200003, 0x81750002, 0x00000000, + 0x017f2387, 0x81750001, 0x00000000, 0x017f2388, + 0x81750005, 0x00000000, 0x017f2389, 0x81750001, + 0x017f239f, 0xb00b0001, 0xb4200003, 0x81750008, + 0x5968b80b, 0x017f61c5, 0x81750001, 0x017f238c, + 0xb00b0001, 0xb4200003, 0x81750008, 0x00000000, + 0x017f238d, 0x81750001, 0x017f238e, 0xb00b0001, + 0xb4200005, 0x81750005, 0x00000000, 0x017f238f, + 0x81750002, 0x017f2390, 0xb00a0000, 0xb420001b, + 0x81750005, 0x00000000, 0x017f2391, 0x81750001, + 0x017f23a0, 0xb00b0001, 0xb4200003, 0x81750008, + 0x5968b80b, 0x017f61c9, 0x81750001, 0x017f2394, + 0xb00b0001, 0xb4200003, 0x81750008, 0x00000000, + 0x017f2395, 0x81750001, 0x017f2396, 0xb00b0001, + 0xb4200006, 0x81750005, 0x00000000, 0x017f2397, + 0x81750002, 0x00000000, 0x017f2398, 0x81750001, + 0x00000000, 0x017f2399, 0x81750001, 0x00000000, + 0x017f239a, 0x81750001, 0x017f239b, 0xb00b0001, + 0xb4200003, 0x8175000e, 0x00000000, 0x017f61be, + 0x81750001, 0x017f239c, 0xb00b0001, 0xb4200003, + 0x8175000e, 0x00000000, 0x017f237e, 0x81750001, + 0x017f239d, 0xb00b0001, 0xb4200006, 0x81750006, + 0x017f239e, 0x916b0001, 0x81550008, 0x856b0001, + 0xb4e0fffd, 0x00ffb81c, 0x00000000, 0x00000000, + 0x81470000, 0x015f2385, 0x015f2386, 0x015f2387, + 0x015f238d, 0x015f238f, 0x015f2390, 0x015f2391, + 0x015f2395, 0x015f2396, 0x015f2397, 0x015f2398, + 0x015f61be, 0x015f61bf, 0x82070028, 0x023f9006, + 0x83a40034, 0x83270000, 0x003fb819, 0x003f9006, + 0x5823b801, 0x83338000, 0x1b39b801, 0x003fb819, + 0x00000000, 0x00000000, 0x81550000, 0x8384ff64, + 0x017f0380, 0xad4b0026, 0x013f0381, 0x114ab809, + 0x5941b80a, 0x914ae00c, 0x0199b80a, 0x00000000, + 0x019f6193, 0xb0080b77, 0xb4200010, 0x015f0380, + 0xb00a0003, 0xb4600011, 0xb0090026, 0xb4600013, + 0x017f90ba, 0xb00b0000, 0xb4200002, 0x017f0383, + 0x017f2057, 0x015f0383, 0x017f0057, 0x300ab80b, + 0xb420000e, 0x83070000, 0x00ffb81a, 0x83070800, + 0x031f6193, 0x83070001, 0x00ffb81a, 0x83070800, + 0x031f6193, 0x83070002, 0x00ffb81a, 0x83070800, + 0x031f6193, 0x83070003, 0x00ffb81a, 0x83070003, + 0x00ffb81a, 0x5e02b810, 0x5a02b810, 0x00bf9011, + 0x00df004f, 0xa5260020, 0x81e70000, 0x82471000, + 0x95d1ffff, 0xa5cee000, 0x300eb810, 0xb4600002, + 0x05f0b80e, 0x0207b80e, 0x8267001f, 0x82c70020, + 0x82971000, 0xb0100080, 0xb4800023, 0x5a8bb813, + 0x5aa6b813, 0x1a94b815, 0x01efb812, 0x014fb814, + 0x01cfb811, 0xb520ffff, 0x81df0000, 0x00000000, + 0x00000000, 0xb636000f, 0x81470000, 0x039f8014, + 0xb6000404, 0x5948b80a, 0x957c00ff, 0x194ab80b, + 0x5f88b81c, 0xb0060020, 0xb4200001, 0x80a70000, + 0x64a6b805, 0x68e9b80a, 0x18a5b807, 0x029fa025, + 0x00a7b80a, 0x81df0004, 0x01efb812, 0x014fb814, + 0x01afb811, 0xb520ffff, 0x5ae2b816, 0x1231b817, + 0x0610b817, 0xb500ffda, 0xb0100000, 0xb4000003, + 0x5ec2b810, 0x86760001, 0xb500ffd8, 0xb00f0000, + 0xb4000005, 0x0207b80f, 0x81f3001f, 0x9a2fc000, + 0x81e70000, 0xb500ffcc, 0x015fb011, 0x00ffb81d, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x81d7ffff, + 0x8257ffff, 0x82d7ffff, 0x8357ffff, 0x83d7ffff, + 0x80770000, 0x80f70000, 0x81770000, 0x81f70000, + 0x82770000, 0x82f70000, 0x83770000, 0x83f70000, + 0xaeb40080, 0x808f0000, 0x806f001f, 0x80af001f, + 0xb0140000, 0xb4400014, 0x806f001f, 0x80af001f, + 0x8027b9fc, 0x5c22b801, 0x80670700, 0xb6000208, + 0x00cfb803, 0x003fb0bc, 0x5822b801, 0x01cfb801, + 0x003f90bc, 0xb520ffff, 0x90630020, 0x90210020, + 0x80270000, 0x80171000, 0xb6000303, 0xb6000001, + 0x001fa021, 0x00000000, 0x82670000, 0xb6000268, + 0x80170a00, 0x80970afc, 0x81170b00, 0x81970bfc, + 0x80271c00, 0x1021b813, 0x1021b813, 0x0217b801, + 0x80271ffc, 0x0421b813, 0x0421b813, 0x0297b801, + 0x80270c00, 0x1021b813, 0x1021b813, 0x0317b801, + 0x80270ffc, 0x0421b813, 0x0421b813, 0x0397b801, + 0x80478500, 0x1042b813, 0x5c42b802, 0x1022b815, + 0x80670280, 0x00cfb803, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0xb520ffff, 0x009f033b, + 0x80478480, 0x0442b813, 0x5c42b802, 0x1022b815, + 0x806702a0, 0x00cfb803, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0xb520ffff, 0xb0040000, + 0xb4000002, 0x80479000, 0xb5000001, 0x80479c00, + 0x1042b813, 0x5c42b802, 0x1022b815, 0x806702c0, + 0x00cfb803, 0x003fb0bc, 0x5822b801, 0x01cfb801, + 0x003f90bc, 0xb520ffff, 0xb0040000, 0xb4000002, + 0x80479180, 0xb5000001, 0x80479d80, 0x0442b813, + 0x5c42b802, 0x1022b815, 0x806702e0, 0x00cfb803, + 0x003fb0bc, 0x5822b801, 0x01cfb801, 0x003f90bc, + 0xb520ffff, 0x81270000, 0x80370000, 0x80b70000, + 0x81370000, 0x81b70000, 0x82370004, 0x82b7fffc, + 0xb6002016, 0x41498008, 0x51498814, 0x51498814, + 0x51418810, 0x51418810, 0x41818814, 0x0308a02a, + 0x49958820, 0x51898810, 0x51918828, 0x414d8814, + 0x0388a7ec, 0x494d8814, 0x49458810, 0x49458810, + 0x418d8810, 0x0308a02a, 0x49918fec, 0x51858814, + 0x51958fe4, 0x00000000, 0x0388a7ec, 0x92730080, + 0x009f033b, 0x5802b814, 0x90400300, 0x001f9802, + 0x00000000, 0xb0000000, 0xb4200016, 0x80170a00, + 0x80070000, 0xb6002001, 0x001fa020, 0xb0040000, + 0xb4200002, 0x80279000, 0xb5000001, 0x80279c00, + 0xac740080, 0x5c22b801, 0x11e1b803, 0x806f001f, + 0x80af001f, 0xb6000407, 0x80cf0280, 0x01ffb0bc, + 0x59e2b80f, 0x01afb80f, 0x01ff90bc, 0xb520ffff, + 0x91ef0020, 0x007f0320, 0x011f90cd, 0xaca30006, + 0x80c7b004, 0x10a5b814, 0x58a1b805, 0x10a5b806, + 0x0099b805, 0x8027b3dc, 0x5841b804, 0x1021b802, + 0x0159b801, 0x8027b3d0, 0x5841b804, 0x1021b802, + 0x0139b801, 0x80170c00, 0x0097b80a, 0xb6000002, + 0x59478020, 0x009fa04a, 0x00ffb81b, 0x00000000, + 0x009f0011, 0x015f0012, 0xb0060000, 0xb4200007, + 0x968a0001, 0xb0140000, 0xb400000d, 0x80870001, + 0x009f2011, 0x954a0002, 0x015f2012, 0xb0060002, + 0xb4200007, 0x968a0002, 0xb0140000, 0xb4000004, + 0x80870001, 0x009f2011, 0x81470000, 0x015f2012, + 0x83640037, 0x00bf2010, 0xb0060000, 0xb4200003, + 0xb0050000, 0xb4200001, 0x836400a1, 0xb0050000, + 0xb4200001, 0x836400ca, 0x00bf0010, 0xb0050000, + 0xb420000a, 0x81df0000, 0x00000000, 0x00000000, + 0x836409e4, 0x836402f6, 0x00000000, 0x8364098c, + 0x81df0004, 0x00000000, 0xb5000009, 0x00bf0010, + 0xb0050001, 0xb4000006, 0x00000000, 0x81df0000, + 0x00000000, 0x00000000, 0x83640981, 0x81df0004, + 0x00ff0325, 0x82870000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6270002, 0x8364fefd, 0x92940001, + 0x81df0004, 0x80070001, 0x801eff70, 0x001f0010, + 0xb0000001, 0xb4000007, 0x001f033b, 0xb0000000, + 0xb4000002, 0x80270000, 0xb5000001, 0x80270001, + 0x003f233b, 0x00ffb81a, 0x00000000, 0x00000000, + 0x027f4001, 0x5e2ab813, 0x96310003, 0x81c70000, + 0x820700ff, 0xb0110000, 0xb4000005, 0x5a21b811, + 0x81c70200, 0x8207000e, 0x69d1b80e, 0x1210b811, + 0x01dfb0cd, 0x5e2cb813, 0x96310003, 0x023f2323, + 0x5e28b813, 0x96310003, 0x023f2322, 0x5e27b813, + 0x96310001, 0x023f2328, 0x5e23b813, 0x96310001, + 0x023f2321, 0x95f30007, 0x01ff2320, 0x920fe004, + 0x0258b810, 0x00000000, 0x1252b811, 0x025f2325, + 0x8167befc, 0x017f6195, 0x021f031c, 0x01df031d, + 0x3010b80f, 0xb4200003, 0x3011b80e, 0xb4200001, + 0xb5000025, 0x80270000, 0x80471000, 0x0017b802, + 0x8057ffff, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002001, 0x001fa021, 0x80270400, 0x80679000, + 0x5c62b803, 0xb6001809, 0x00cfb801, 0x007fb0bc, + 0x5862b803, 0x01afb803, 0x007f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x80679c00, + 0x5c62b803, 0xb6001809, 0x00cfb801, 0x007fb0bc, + 0x5862b803, 0x01afb803, 0x007f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x81df0004, + 0x01ff231c, 0x023f231d, 0x83970300, 0x82070000, + 0x81df0000, 0x00000000, 0x00000000, 0xb6320001, + 0x039fa030, 0x81df0004, 0x00bf0010, 0x021f0324, + 0xb0100000, 0xb4200001, 0x80a70000, 0xb0050000, + 0xb4200008, 0xb0040000, 0xb4a00002, 0x80a70001, + 0xb5000004, 0x82070000, 0x021f204e, 0xb4000001, + 0x80a70002, 0xb0050001, 0xb4200007, 0x021f004e, + 0xb0100002, 0xb4a00002, 0x80a70002, 0x00ffb81b, + 0x92100001, 0x021f204e, 0x00000000, 0x00ffb81b, + 0x81530000, 0x003fb80a, 0x00000000, 0x00000000, + 0x003fb819, 0x00000000, 0x00000000, 0x81550000, + 0x8384fd6b, 0x81470000, 0x015f61ee, 0x015f61ef, + 0x015f23a4, 0x8297050c, 0x82d7ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6000501, 0x029fa02a, + 0x81df0004, 0x8167e004, 0x116b0384, 0x0158b80b, + 0x019f0382, 0x015f237b, 0x017f0388, 0x116bb80a, + 0xb00c0008, 0xb4a00003, 0x80a70003, 0x00bf2010, + 0x00ffb81b, 0xb00a0005, 0xb4400003, 0xb00b0006, + 0xb4400001, 0x00ffb81b, 0x80a70004, 0x00bf2010, + 0x00ffb81b, 0x00000000, 0x00000000, 0x00000000, + 0x027f0388, 0x02bf037b, 0x02df0384, 0x02ff03a1, + 0x82970400, 0x8257ffff, 0x82d7ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6350003, 0x81550001, + 0x8357ffff, 0x029fa02a, 0x82970414, 0xb6350003, + 0x81550001, 0x83d7ffff, 0x029fa02a, 0x81df0004, + 0x81550001, 0xb00a0001, 0xb4200004, 0x814d0008, + 0x6149b80a, 0x954affff, 0x015f61ee, 0xb0160000, + 0xb4200007, 0x81550001, 0xb00a0001, 0xb4200004, + 0x814d0008, 0x6149b80a, 0x954affff, 0x015f61ef, + 0x81550001, 0xb00a0001, 0xb4200042, 0x82f50001, + 0x02ff23a1, 0xb0170001, 0xb4200034, 0x82970428, + 0x81df0000, 0x00000000, 0x00000000, 0xb6350003, + 0x81550001, 0x00000000, 0x029fa02a, 0x81df0004, + 0x82970428, 0x81470000, 0x017f8034, 0xb00b0001, + 0xb4000004, 0x914a0001, 0x300ab815, 0xb480fffa, + 0xb5000001, 0x015f23a5, 0x81670000, 0xb0160002, + 0xb4200002, 0x81750001, 0x00000000, 0x017f233a, + 0x81550004, 0xadaa000c, 0x015f23a2, 0x81750004, + 0x916b0003, 0x017f23a3, 0x91ad0025, 0x01bf23a6, + 0xadab000c, 0x81e70000, 0x91ad0025, 0x01bf23a7, + 0x920a0001, 0x05abb810, 0xb00d0000, 0xb4000015, + 0x81df0000, 0x00000000, 0x00000000, 0xb62d0004, + 0x81b50001, 0x65b0b80d, 0x19efb80d, 0x92100001, + 0x81df0004, 0x01ffb0be, 0xb500000a, 0x81a70000, + 0x82970428, 0x81df0000, 0x00000000, 0x00000000, + 0xb6350001, 0x029fa02d, 0x81df0004, 0x01bf233a, + 0x01bf23a5, 0x82070000, 0x82270000, 0x82170428, + 0x81df0000, 0x00000000, 0x00000000, 0xb635003a, + 0x01bf8030, 0xb00d0001, 0xb4200036, 0x81d50001, + 0x65b1b80e, 0x1a10b80d, 0xb00e0001, 0xb4200031, + 0x81b50002, 0xadad0003, 0xae510048, 0x91cd000f, + 0x91320868, 0x015f03a2, 0xad4a0004, 0x92920700, + 0x1189b80a, 0x0297b80c, 0x1194b80a, 0x0317b80c, + 0x01ff90be, 0x015f03a2, 0x017f03a3, 0x064bb80a, + 0x0107b80a, 0xb0120000, 0xb400001e, 0xb632001d, + 0x6928b80f, 0x95290001, 0xb0090000, 0xb420000e, + 0x81350004, 0x1129b80d, 0x029fa029, 0x824d0004, + 0x5a48b812, 0x5e48b812, 0x3009b80e, 0xb4200002, + 0x5e41b812, 0xb500000d, 0x5e42b812, 0x81330040, + 0x1a52b809, 0xb5000009, 0x0127b854, 0x85290004, + 0x0397b809, 0x0287b858, 0x86940004, 0x013f803c, + 0x0397b814, 0x029fa029, 0x025f803c, 0x031fa032, + 0x91080001, 0x92310001, 0x81df0004, 0x015f03a2, + 0x017f03a3, 0x013f033a, 0xb0090001, 0xb4200023, + 0x95300002, 0x95900001, 0x1929b80c, 0xb0090000, + 0xb400001e, 0x064bb80a, 0x0107b80a, 0x81df0000, + 0x00000000, 0x00000000, 0xb6320017, 0x6928b80f, + 0x95290001, 0xb0090000, 0xb4200002, 0x81350001, + 0x013f23f8, 0x81a70700, 0x91ad0048, 0x5982b808, + 0x11adb80c, 0x0397b80d, 0x013f03f8, 0xb0090001, + 0xb4200005, 0x019f801c, 0x0196b80c, 0x81b3ff80, + 0x418cb80d, 0xb5000002, 0x019f801c, 0x0196b80c, + 0x039fa00c, 0x91080001, 0x81df0004, 0xb0160002, + 0xb420001e, 0xb0170001, 0xb4200008, 0xb00a0000, + 0xb4200002, 0x81270002, 0xb5000005, 0xb00a0002, + 0xb4400002, 0x81270003, 0xb5000001, 0x81270004, + 0x013f23a9, 0x81950001, 0xb00c0001, 0xb4200011, + 0x81a70000, 0x8397043c, 0x81df0000, 0x00000000, + 0x00000000, 0xb6290006, 0x81150001, 0x039fa028, + 0xb0080001, 0xb4200001, 0x81a70001, 0x00000000, + 0x81df0004, 0x01bf23a8, 0xb5000002, 0x81a70000, + 0x01bf23a8, 0xb0170001, 0xb4200001, 0x81b50002, + 0x82970c20, 0x81df0000, 0x00000000, 0x00000000, + 0xb6350003, 0x81550002, 0x00000000, 0x029fa02a, + 0x81df0004, 0xb0130001, 0xb4200001, 0x81150001, + 0x81c70000, 0x81df0000, 0x00000000, 0x00000000, + 0xb6350014, 0x922e0c20, 0x015ff011, 0xb00a0000, + 0xb400000f, 0x922e0428, 0x015ff011, 0xb00a0001, + 0xb4200005, 0x922e044c, 0x0297b811, 0x015f03a6, + 0x029fa00a, 0xb5000006, 0x81550006, 0xad4a0003, + 0x922e044c, 0x0297b811, 0x914a0049, 0x029fa00a, + 0x91ce0004, 0x81df0004, 0xb0170001, 0xb4200022, + 0xb00d0000, 0xb4000020, 0x852d0001, 0x81470001, + 0x6549b80a, 0xad6a0003, 0x019f03a7, 0x058c03a6, + 0x81270000, 0xb00b0000, 0xb4000005, 0x300cb80b, + 0xb4800003, 0x058cb80b, 0x91290001, 0xb500fffb, + 0x81750004, 0x5961b80b, 0x839704ec, 0x0187b860, + 0x039fa02c, 0x039fa02a, 0x039fa029, 0x039fa02b, + 0xb0090000, 0xb4000007, 0x81df0000, 0x00000000, + 0x00000000, 0xb6290003, 0x81550007, 0x00000000, + 0x00000000, 0x81df0004, 0x81c70000, 0x81df0000, + 0x00000000, 0x00000000, 0xb635002e, 0x922e0c20, + 0x01fff011, 0xb00f0000, 0xb4000029, 0x852f0001, + 0x81470001, 0x6549b80a, 0xad6a0003, 0x922e044c, + 0x025fd811, 0x86520001, 0x0227b812, 0x81270000, + 0xb00b0000, 0xb4000005, 0x3012b80b, 0xb4800003, + 0x0652b80b, 0x91290001, 0xb500fffb, 0x2e09b80b, + 0x00000000, 0x3010b811, 0xb4600001, 0x91290001, + 0xae4e0004, 0x82150004, 0x9232049c, 0x0297b811, + 0x0187b860, 0x029fa02c, 0x029fa02a, 0x029fa029, + 0x029fa030, 0xb0090000, 0xb4000004, 0xb6290003, + 0x81550007, 0x00000000, 0x00000000, 0x82270460, + 0x1231b80e, 0x0217b811, 0x81550002, 0x021fa00a, + 0x91ce0004, 0x81df0004, 0xb0130001, 0xb420000c, + 0xb0080000, 0xb400000a, 0x81550004, 0x839704fc, + 0x0167b860, 0x039fa02b, 0x81670001, 0x039fa02b, + 0x8175000e, 0x81670002, 0x039fa02b, 0x039fa02a, + 0x81150001, 0xb0080001, 0xb420000a, 0x8135000b, + 0x5d2923aa, 0x95490180, 0x5d4723ab, 0x95490060, + 0x5d4523ac, 0x95490018, 0x5d4323ad, 0x95490007, + 0x015f23ae, 0x81350001, 0xb0090001, 0xb420001b, + 0x81350006, 0x013f23af, 0xb0170001, 0xb4200005, + 0x81550004, 0x00000000, 0x015f23b0, 0x81550003, + 0x015f23b1, 0x82970474, 0x83170488, 0x81df0000, + 0x00000000, 0x00000000, 0xb6350004, 0x81550007, + 0x5e83a02a, 0x954a0007, 0x031fa02a, 0x81df0004, + 0xb0130001, 0xb4200005, 0x81750004, 0x00000000, + 0x017f23b2, 0x81750003, 0x017f23b3, 0xb0170001, + 0xb420000b, 0x81b50001, 0xb00d0001, 0xb4200008, + 0x81d50003, 0x59c8b80e, 0x91ce0300, 0x01df61da, + 0x81d50003, 0x59c8b80e, 0x91ce0300, 0x01df61db, + 0x81550001, 0xb00a0001, 0xb4200057, 0xb0170001, + 0xb4200001, 0x81550002, 0x82470000, 0x82270000, + 0x81df0000, 0x00000000, 0x00000000, 0xb6350004, + 0x81750002, 0x6571b80b, 0x92310002, 0x1a52b80b, + 0x81df0004, 0xb0170001, 0xb420001b, 0xb00a0001, + 0xb4200015, 0x81150003, 0x91080001, 0x011f23a4, + 0x829709d0, 0x831709f0, 0x83970060, 0x81df0000, + 0x00000000, 0x00000000, 0xb6280009, 0x81750005, + 0x00000000, 0x029fa02b, 0x81750004, 0x00000000, + 0x031fa02b, 0x81750003, 0x00000000, 0x039fa02b, + 0x81df0004, 0xb5000004, 0xb00a0002, 0xb4800002, + 0x81070000, 0x011f23a4, 0x82270000, 0x81270000, + 0x81df0000, 0x00000000, 0x00000000, 0xb6350025, + 0x6a11b812, 0x92310002, 0x96100003, 0xb0100001, + 0xb4200018, 0xada90020, 0x81750003, 0x920d0520, + 0x0217b810, 0x920d05c0, 0x0297b810, 0x920d0660, + 0x0317b810, 0x5942b809, 0x920a050c, 0x0397b810, + 0x916b0001, 0x039fa02b, 0xb62b0009, 0x81750005, + 0x00000000, 0x021fa02b, 0x81750004, 0x00000000, + 0x029fa02b, 0x81750003, 0x00000000, 0x031fa02b, + 0xb5000007, 0xb0100002, 0xb4800005, 0x59a2b809, + 0x91ad050c, 0x0397b80d, 0x82070000, 0x039fa010, + 0x91290001, 0x81df0004, 0x81550001, 0xb00a0001, + 0xb420000a, 0x81550009, 0xb00a0000, 0xb4000007, + 0x81df0000, 0x00000000, 0x00000000, 0xb62a0003, + 0x82150008, 0x00000000, 0x00000000, 0x81df0004, + 0xb00a0100, 0xb4a0000b, 0x954aff00, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008003, 0x82150010, + 0x00000000, 0x00000000, 0x81df0004, 0x854a0100, + 0xb4e0fff6, 0x00ffb81b, 0x00000000, 0x00000000, + 0x81070000, 0x011f61dc, 0x011f61de, 0x011f61e0, + 0x011f03aa, 0x9108e0f4, 0x0138b808, 0x011f03ab, + 0x013f61ac, 0x9108e0f0, 0x0138b808, 0x011f03ac, + 0x013f61ad, 0x5901b808, 0x9108e0f8, 0x0139b808, + 0x011f03ad, 0x013f61ae, 0x5901b808, 0x9108e100, + 0x0139b808, 0x011f03ae, 0x013f61b0, 0x5901b808, + 0x9108e108, 0x0179b808, 0x013f03af, 0x017f61b1, + 0x02bf037b, 0x82970474, 0xb6350002, 0x015f8034, + 0x1929b80a, 0x011f03a1, 0xb0080001, 0xb4200002, + 0x015f03b0, 0x1929b80a, 0x019f0388, 0xb00c0001, + 0xb4200002, 0x015f03b2, 0x1929b80a, 0x013f61b3, + 0x015f03a8, 0xb00a0001, 0xb420003a, 0x81a70000, + 0x01bf237a, 0x83840056, 0x806f001f, 0x80af001f, + 0x80270300, 0x8067a800, 0x5c62b803, 0xb600080a, + 0x00cfb801, 0x007fb0bc, 0x5862b803, 0x01afb803, + 0x007f90bc, 0x0047b86f, 0xb0020001, 0xb4c0fffd, + 0x90210020, 0x90630020, 0x81a70001, 0x01bf237a, + 0x83840043, 0x838403ce, 0x81a70000, 0x01bf237a, + 0x82470400, 0x01bff012, 0x01bf23fa, 0x83840420, + 0x83840497, 0x83840546, 0x8384059d, 0x806f001f, + 0x80af001f, 0x80270300, 0x8067ac00, 0x5c62b803, + 0xb600080a, 0x00cfb801, 0x007fb0bc, 0x5862b803, + 0x01cfb803, 0x007f90bc, 0x0047b86f, 0xb0020001, + 0xb4c0fffd, 0x90210020, 0x90630020, 0x81a70001, + 0x01bf237a, 0x82470404, 0x015ff012, 0x015f23fa, + 0x83840407, 0x8384047e, 0x8384052d, 0x83840584, + 0xb5000011, 0x81a70000, 0x01bf237a, 0xb635000e, + 0x8384001b, 0x01bf037a, 0xad4d0004, 0x00000000, + 0x914a0400, 0x01bff00a, 0x01bf23fa, 0x838403f8, + 0x8384046f, 0x8384051e, 0x83840575, 0x01df037a, + 0x91ce0001, 0x01df237a, 0x019f0388, 0xb00c0001, + 0xb4200009, 0x02bf037b, 0x02bf237a, 0x838400e8, + 0x82470000, 0x025f23fa, 0x838403e9, 0x83840460, + 0x8384050f, 0x83840566, 0x00ffb81b, 0x00000000, + 0x80770000, 0x80f70000, 0x81770000, 0x81f70000, + 0x82770000, 0x82f70000, 0x83770000, 0x83f70000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x81d7ffff, + 0x8257ffff, 0x82d7ffff, 0x8357ffff, 0x83d7ffff, + 0x017f037a, 0x5a42b80b, 0x01bf03a8, 0xb00d0001, + 0xb4200004, 0x011f9118, 0x013f9119, 0x7929b808, + 0xb5000002, 0x91b20460, 0x013ff00d, 0x91b20340, + 0x0297b80d, 0x00000000, 0x029fa009, 0x01df0384, + 0xb00e0000, 0xb4200005, 0xb00b0001, 0xb4200003, + 0x009f90c6, 0x00bf0391, 0xb5000002, 0x009f90cf, + 0x00bf0389, 0x83a40142, 0x81870000, 0x019f61b5, + 0x019f61b4, 0x5a02b80b, 0x9190044c, 0x01dfd80c, + 0x01df61b6, 0x91900488, 0x01dff00c, 0x59c1b80e, + 0x918ee118, 0x01d9b80c, 0x019f03af, 0x01df61af, + 0x858c000f, 0x5986b80c, 0x91d00474, 0x01bff00e, + 0x59c2b80d, 0x11cc61b2, 0x81870000, 0x019f61b8, + 0x91900414, 0x01dfd80c, 0x01df61b7, 0xadab0010, + 0x00000000, 0x908d049c, 0x83a40191, 0xadcb0020, + 0x5982b80b, 0x908e0520, 0x90ae05c0, 0x90ce0660, + 0x928c050c, 0x00ff9814, 0x83a40169, 0x83a401b8, + 0x017f037a, 0x59c2b80b, 0x918e0428, 0x01fff00c, + 0xb00f0001, 0xb4200081, 0x023f03a5, 0x3011b80b, + 0xb420000f, 0x01c7b860, 0x01dfb0fa, 0x01df41dc, + 0x01df61e8, 0x01df41de, 0x01df61ea, 0x01df41e0, + 0x01df61ec, 0x01df41dd, 0x01df61e9, 0x01df41df, + 0x01df61eb, 0x01df41e1, 0x01df61ed, 0xb5000024, + 0x01c7b860, 0x01dfb0f9, 0x01df41dc, 0x01df61e2, + 0x01df41de, 0x01df61e4, 0x01df41e0, 0x01df61e6, + 0x01df41dd, 0x01df61e3, 0x01df41df, 0x01df61e5, + 0x01df41e1, 0x01df61e7, 0x803f0000, 0x00000000, + 0x00000000, 0x01df90fa, 0x003fb80e, 0x00000000, + 0x00000000, 0x81d50000, 0x00000000, 0x00000000, + 0x01df41e8, 0x01df61dc, 0x01df41ea, 0x01df61de, + 0x01df41ec, 0x01df61e0, 0x01df41e9, 0x01df61dd, + 0x01df41eb, 0x01df61df, 0x01df41ed, 0x01df61e1, + 0x029f03a6, 0x029f236a, 0x029f03a7, 0x029f236c, + 0x027f03a2, 0x92b3e128, 0x0298b815, 0x019f03b0, + 0x029f2368, 0x5982b80c, 0x01df03af, 0x85ce000f, + 0x59c6b80e, 0x11cc61b2, 0x82a70001, 0x02bf61b8, + 0x82a70000, 0x02bf61b9, 0x029f41da, 0x029f61ba, + 0x029f41db, 0x029f61bb, 0x019f03b1, 0x5981b80c, + 0x918ce118, 0x0299b80c, 0xad8b0048, 0x029f61af, + 0x59a2b813, 0x118cb80d, 0x928c0868, 0x029fb0fb, + 0x928c0700, 0x029fb0fc, 0x019f41bc, 0x918c0003, + 0x019f61bc, 0x5a02b80b, 0x91900414, 0x029fd80c, + 0x029f236e, 0x808704ec, 0x83a40121, 0x808709d0, + 0x80a709f0, 0x80c70060, 0x00ff03a4, 0x83a400fc, + 0x83a4014b, 0x021f037a, 0x019f03a5, 0x300cb810, + 0xb4000016, 0x803f0000, 0x00000000, 0x00000000, + 0x01df90f9, 0x003fb80e, 0x00000000, 0x00000000, + 0x81d50000, 0x00000000, 0x00000000, 0x01df41e2, + 0x01df61dc, 0x01df41e4, 0x01df61de, 0x01df41e6, + 0x01df61e0, 0x01df41e3, 0x01df61dd, 0x01df41e5, + 0x01df61df, 0x01df41e7, 0x01df61e1, 0x029f41b6, + 0xa6d40100, 0xaeb40004, 0x81870000, 0x92b50c00, + 0x0397b815, 0xb6360001, 0x039fa02c, 0x00ffb81c, + 0x009f90cf, 0x00bf0389, 0x019f037a, 0x5982b80c, + 0x918c0340, 0x0397b80c, 0x81870000, 0x039fa00c, + 0x83a40083, 0x81870000, 0x019f61b5, 0x019f61b4, + 0x81870007, 0x019f61b6, 0x019f03b3, 0x5981b80c, + 0x918ce118, 0x01b9b80c, 0x019f03af, 0x01bf61af, + 0x858c000f, 0x5986b80c, 0x01bf03b2, 0x59a2b80d, + 0x118cb80d, 0x019f61b2, 0x81870000, 0x019f61b7, + 0x019f61b8, 0x808704fc, 0x83a400d9, 0x80870000, + 0x80a70000, 0x80c70000, 0x80e70000, 0x83a400b4, + 0x83a40103, 0x81470000, 0x81e70c1c, 0x0397b80f, + 0xb600f901, 0x039fa02a, 0x00ffb81c, 0x00000000, + 0x82270000, 0x023f2011, 0x0227b860, 0x023fb0ff, + 0x02bf9006, 0x92350028, 0x8213001f, 0x9210e000, + 0x3011b810, 0xb4800001, 0x86312000, 0x021f4193, + 0x5a01b810, 0x86100028, 0x83a4fa36, 0x82270000, + 0x003fb811, 0x02bf9006, 0x5aa3b815, 0x82338000, + 0x1a31b815, 0x003fb811, 0x8067e950, 0x5c62b803, + 0x81f50000, 0x80270400, 0x81df0000, 0x00000000, + 0x00000000, 0xb6000409, 0x814fffc0, 0x00cfb801, + 0x007fb0bc, 0x5862b803, 0x01cfb803, 0x007f90bc, + 0xb520ffff, 0x90210020, 0x90630020, 0x81df0004, + 0x82870000, 0x81f50010, 0x019f4193, 0x5d61b80c, + 0x5d43b80c, 0x114ab80b, 0x0187b80a, 0x960cff00, + 0x92100100, 0x858c0001, 0x81df0000, 0x00000000, + 0x00000000, 0xb62c000c, 0x81f50010, 0x5e28b80f, + 0xb6000209, 0x5a48b814, 0x9652ff00, 0x5e68b814, + 0x5981b813, 0x918c1000, 0x01dfd80c, 0x2252b811, + 0x2292b80e, 0x962f00ff, 0x81df0004, 0x81870000, + 0x86100100, 0xb4e0ffec, 0xb00a0000, 0xb4000009, + 0x81670000, 0xb0140000, 0xb4000001, 0x81670001, + 0x017f2012, 0x258a4193, 0x918c0001, 0x81470000, + 0xb500ffde, 0x81670000, 0xb0140000, 0xb4000001, + 0x81670002, 0x116b0012, 0x803f0000, 0x00000000, + 0x00000000, 0x003fb811, 0x00000000, 0x00000000, + 0x81f50000, 0x017f2012, 0x00ffb81a, 0x00000000, + 0x61f4b804, 0x91ef0001, 0x8233003f, 0x9a31ffff, + 0x5a02b804, 0x1610b811, 0x92510001, 0x1a10b812, + 0x029f03fb, 0xb0140001, 0xb4200012, 0x5a21b805, + 0x92b1e910, 0x0299b815, 0x5a22b805, 0x5a90b814, + 0x6290b814, 0x92b1e890, 0x11efb814, 0x029bb815, + 0x8233ff80, 0x3011b814, 0xb4000006, 0x4294b811, + 0x00000000, 0x0288b814, 0x4210b814, 0x00000000, + 0x0208b810, 0x029f9003, 0x82f3007f, 0x9af7ffff, + 0x3017b814, 0xb4000003, 0x4210b814, 0x00000000, + 0x0208b810, 0x82270000, 0x02c7b810, 0xb0160000, + 0xb400000a, 0x1676b812, 0x3013b812, 0xb4000003, + 0x5ac1b816, 0x92310001, 0xb500fffa, 0x81d3ff80, + 0x3010b80e, 0xb4200001, 0x1ad6b80e, 0x05efb811, + 0x027f037a, 0x5a62b813, 0x92730340, 0x0397b813, + 0x023fd813, 0x02dfb0fd, 0x5a30b811, 0x6230b811, + 0x0631b80f, 0x3010b812, 0xb4200001, 0x92310001, + 0x82470000, 0xb0110000, 0xb4800004, 0x82470003, + 0xb0110003, 0xb4400001, 0x0247b811, 0x039fa012, + 0x124f61bc, 0x00ffb81d, 0x00000000, 0x00000000, + 0x83970a10, 0x82070000, 0xb6003201, 0x039fa030, + 0xb0070000, 0xb4000019, 0x029f41b4, 0x0297b804, + 0x0317b805, 0x0397b806, 0xb6270014, 0x12948034, + 0x01df8038, 0xb00e0000, 0xb4a0000e, 0x02bf803c, + 0x5a02b814, 0x91b00a10, 0x0217b80d, 0xb62e0008, + 0x96150003, 0x91f00001, 0xadef0080, 0xb0150004, + 0xb4600001, 0x85ef0280, 0x021fa02f, 0x92940001, + 0xb5000001, 0x021f803c, 0x00000000, 0x00ffb81d, + 0x0397b804, 0x021f036a, 0x027f803c, 0x029f803c, + 0x02bf803c, 0x02df803c, 0x5a22b810, 0x92311000, + 0x0397b811, 0xb0100000, 0xb4200001, 0x039fa036, + 0xb0150000, 0xb4000021, 0x0227b860, 0x023fb0ff, + 0xb520ffff, 0x803f0000, 0x82138000, 0x1a10b813, + 0x003fb810, 0x00000000, 0x00000000, 0x82150000, + 0x00000000, 0xb635000d, 0x82550007, 0x5a42b812, + 0x9212e4b8, 0x025bb810, 0x8227000c, 0xb6000307, + 0x68d1b812, 0x94c6000f, 0x84c60002, 0x12d6b806, + 0xb6340001, 0x039fa036, 0x86310004, 0x803f0000, + 0x82138000, 0x023f90ff, 0x1a31b810, 0x003fb811, + 0x00000000, 0x00000000, 0x82150000, 0x00ffb81d, + 0x00ff41b5, 0x011f41b4, 0x019f41af, 0x01bf41ae, + 0x01df41ba, 0x01ff41bb, 0x82070000, 0x023f0380, + 0x82470000, 0xae310032, 0x029f41b3, 0x5862b807, + 0x90431000, 0x81970ad8, 0x0217b802, 0x90430c00, + 0x0297b802, 0x0317b802, 0x912802a4, 0x007ff009, + 0x58478030, 0x792341b6, 0x0529b807, 0x019fa029, + 0xb0080014, 0xb4800011, 0xa5420c00, 0x031fa02a, + 0x84690001, 0xb4a00011, 0xb623000b, 0x58678030, + 0xa4030c00, 0x031fa020, 0x044ab800, 0x0056b802, + 0x5c41b802, 0xf84200ff, 0x90620100, 0x005ff003, + 0x7d40b80a, 0x114ab802, 0xb5000004, 0xa5420c00, + 0x58478010, 0xa5620c00, 0x031fa02a, 0xb0080016, + 0xb4400043, 0xb0080013, 0xb440002c, 0xb0080006, + 0xb4400024, 0xb0080005, 0xb4400014, 0xb0080002, + 0xb4400006, 0x80440030, 0x015f619c, 0x05cab80c, + 0x05eab80d, 0x066eb810, 0xb500003c, 0x8044002a, + 0x300a419c, 0xb4800001, 0x82470001, 0x015f619c, + 0xb0120001, 0xb4200001, 0xb500001a, 0x05cab80c, + 0x05eab80d, 0x066eb810, 0xb5000030, 0x001f41b6, + 0xb0000007, 0xb4000001, 0x8044001b, 0x300a419c, + 0xb4800001, 0x82470001, 0xb0120001, 0xb4200001, + 0xb500000c, 0x05cab80c, 0x05eab80d, 0x066eb810, + 0xb5000022, 0x80440010, 0x840b0100, 0x300ab800, + 0xb4200001, 0x86100040, 0xb5000002, 0x86100080, + 0xfe100000, 0x046e41ad, 0x042ab80c, 0x7dc1b803, + 0x044f41ac, 0x042ab80d, 0x7de1b802, 0x046eb810, + 0x7e6fb803, 0xb5000011, 0x840b0100, 0x3000b80a, + 0xb4200002, 0x82070180, 0x00ffb802, 0x300ab80b, + 0xb4a00002, 0x86100040, 0xfe100000, 0x00ffb802, + 0x046e41ad, 0x042ab80c, 0x7dc1b803, 0x044f41ac, + 0x042ab80d, 0x7de1b802, 0x7e6eb80f, 0x380a41b0, + 0xb4600003, 0x242a41b0, 0x5c22b801, 0x1273b801, + 0xb0140000, 0xb4200002, 0x80071fe0, 0xb5000016, + 0x1011b808, 0x5801b800, 0x9020e26c, 0x0079b801, + 0x5842b808, 0x90420a10, 0x7c03b813, 0x003f9802, + 0x1000b801, 0x003f41b2, 0x5830b801, 0x6030b801, + 0x0400b801, 0x003f41b1, 0x5830b801, 0x6030b801, + 0x0400b801, 0xfc000000, 0xf8001fe0, 0x94001fe0, + 0x100041b1, 0x9400ffff, 0x8067003f, 0xb6290008, + 0x005f8014, 0x0442b800, 0x9442ffff, 0x5850b802, + 0x6050b802, 0xfc420000, 0x5c45b802, 0x7a82a023, + 0x10e7b809, 0x91080001, 0x300741b6, 0xb420ff6a, + 0x019f61af, 0x01bf61ae, 0x01df61ba, 0x01ff61bb, + 0x00ff41b5, 0x011f41b4, 0x019f41b8, 0x01bf41b7, + 0x01df41dd, 0x01ff41df, 0x021f41e1, 0x027f90fd, + 0x029f41bc, 0x02ff41dc, 0x031f41de, 0x033f41e0, + 0x5822b807, 0x91210c00, 0x0117b809, 0x81970ad8, + 0x91211000, 0x0217b809, 0x91210c00, 0x0317b809, + 0x80170ba0, 0x013f802c, 0xb629005f, 0x003f8038, + 0xb001000e, 0xb440001e, 0xb001000c, 0xb4400054, + 0xb001000a, 0xb4400043, 0xb0010007, 0xb440003c, + 0xb0010005, 0xb440002b, 0xb0010000, 0xb440001a, + 0xb00d0001, 0xb4200010, 0x005f418f, 0xac42bb75, + 0x8073005a, 0x9442ffff, 0x005f618f, 0x95628000, + 0x5848b802, 0xb00b8000, 0xb4200002, 0x8173ff00, + 0x1842b80b, 0x9863827a, 0x4043b802, 0x00000000, + 0x0048b802, 0xb500003f, 0x80470000, 0xb500003d, + 0x8401000f, 0x5c22b800, 0x902102d8, 0x001ff001, + 0x004db800, 0xb5000037, 0x86f70001, 0xb4600005, + 0x80750005, 0x5862b803, 0x9043e44c, 0x01d9b802, + 0x82e70002, 0x5c4cb80e, 0x9462000f, 0x5862b803, + 0x90630200, 0x005f9803, 0x59c4b80e, 0x95ceffff, + 0xb5000028, 0x87180001, 0xb4600005, 0x80750007, + 0x5862b803, 0x9043e4b8, 0x01f9b802, 0x83070002, + 0x5c4cb80f, 0x9462000f, 0x5862b803, 0x9063020c, + 0x005f9803, 0x59e4b80f, 0x95efffff, 0xb5000019, + 0x80750003, 0x5862b803, 0x90630220, 0x005f9803, + 0xb5000014, 0x87390001, 0xb4600005, 0x80750007, + 0x5862b803, 0x9043e6ac, 0x0219b802, 0x83270001, + 0x5c4cb810, 0x9462000f, 0x5862b803, 0x9063023c, + 0x005f9803, 0x5a04b810, 0x9610ffff, 0xb5000005, + 0x80750004, 0x5862b803, 0x90630268, 0x005f9803, + 0x00000000, 0x001fa022, 0x80170ba0, 0xb00c0001, + 0xb4200035, 0x023f90fb, 0x007f9811, 0x025f90fc, + 0x06d4b803, 0x007f9812, 0x4083b813, 0x00000000, + 0x0088b804, 0xb629002b, 0x24368030, 0x9421ffff, + 0x5830b801, 0x6030b801, 0x40448020, 0xb0010020, + 0xb4800003, 0x80470000, 0x80670000, 0xb500000e, + 0xb0010000, 0xb4a00004, 0x82b30080, 0x6aa1b815, + 0x4042b815, 0xb5000008, 0x6c41b802, 0x82a70017, + 0x12b5b801, 0x6875b803, 0x1842b803, 0x00000000, + 0x00000000, 0x00000000, 0x0108a022, 0x007f41b9, + 0x90630001, 0x007f61b9, 0xb003000c, 0xb420000c, + 0x92310004, 0x023fb0fb, 0x007f9811, 0x92520004, + 0x06d4b803, 0x025fb0fc, 0x007f9812, 0x80470000, + 0x4083b813, 0x00000000, 0x0088b804, 0x005f61b9, + 0x00000000, 0xb500001a, 0xb6290019, 0x24348030, + 0x9421ffff, 0x5830b801, 0x6030b801, 0x40538020, + 0xb0010020, 0xb4800003, 0x80470000, 0x80670000, + 0xb500000e, 0xb0010000, 0xb4a00004, 0x82b30080, + 0x6aa1b815, 0x4042b815, 0xb5000008, 0x6c41b802, + 0x82a70017, 0x12b5b801, 0x6875b803, 0x1842b803, + 0x00000000, 0x00000000, 0x00000000, 0x0108a022, + 0x10e7b809, 0x91080001, 0x300741b6, 0xb420ff48, + 0x00ff61b5, 0x011f61b4, 0x01df61dd, 0x01ff61df, + 0x021f61e1, 0x02ff61dc, 0x031f61de, 0x033f61e0, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x81d7ffff, + 0x8257ffff, 0x808f0000, 0x003f9113, 0x005f9114, + 0x7141b802, 0x80cf0700, 0x8027b064, 0x5c22b801, + 0x003fb0bc, 0x5822b801, 0x01cfb801, 0x003f90bc, + 0xb520ffff, 0x80cf0704, 0x8027b06c, 0x5c22b801, + 0x003fb0bc, 0x5822b801, 0x01cfb801, 0x003f90bc, + 0xb520ffff, 0x81e7043c, 0x82071c00, 0x82271c10, + 0x019f03a9, 0x806f001f, 0x80af001f, 0x80270400, + 0x8067a800, 0x5c62b803, 0xb6000808, 0x00cfb801, + 0x007fb0bc, 0x5862b803, 0x01cfb803, 0x007f90bc, + 0xb520ffff, 0x90210020, 0x90630020, 0x81971000, + 0x82170c00, 0xb6000004, 0x003f800c, 0x005f8010, + 0x021fa021, 0x019fa022, 0x00bfd810, 0x003fd811, + 0x70c1b80a, 0x001f980f, 0x91ef0004, 0x92100002, + 0x92310002, 0x5822b805, 0x90411000, 0x0197b802, + 0x90410c00, 0x0217b802, 0x0466b805, 0xb0000000, + 0xb4000005, 0xb6230004, 0x003f8010, 0x005f800c, + 0x1201a022, 0x0581a022, 0x858c0001, 0xb4e0ffea, + 0x80270400, 0x8067ac00, 0x5c62b803, 0xb6000808, + 0x00cfb801, 0x007fb0bc, 0x5862b803, 0x01afb803, + 0x007f90bc, 0xb520ffff, 0x90210020, 0x90630020, + 0x00ffb81c, 0x00000000, 0x00000000, 0x00000000, + 0x808f0000, 0x806f001f, 0x80af001f, 0x003f037a, + 0xb0010000, 0xb4400030, 0x81a7b7fc, 0x5da2b80d, + 0x80670500, 0xb6000208, 0x00cfb803, 0x01bfb0bc, + 0x59a2b80d, 0x01cfb80d, 0x01bf90bc, 0xb520ffff, + 0x90630020, 0x91ad0020, 0x81c7b8fc, 0x5dc2b80e, + 0x80670540, 0xb6000208, 0x00cfb803, 0x01dfb0bc, + 0x59c2b80e, 0x01cfb80e, 0x01df90bc, 0xb520ffff, + 0x90630020, 0x91ce0020, 0x81a7b3fc, 0x5da2b80d, + 0x80670600, 0xb6000408, 0x00cfb803, 0x01bfb0bc, + 0x59a2b80d, 0x01cfb80d, 0x01bf90bc, 0xb520ffff, + 0x90630020, 0x91ad0020, 0x81c7b5fc, 0x5dc2b80e, + 0x80670680, 0xb6000408, 0x00cfb803, 0x01dfb0bc, + 0x59c2b80e, 0x01cfb80e, 0x01df90bc, 0xb520ffff, + 0x90630020, 0x91ce0020, 0x005f03fa, 0xb0020000, + 0xb4000024, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x8257ffff, 0x82d7ffff, 0x8357ffff, + 0x83d7ffff, 0x83971300, 0x83171200, 0x82971100, + 0x82171000, 0x81170c00, 0x81970ff8, 0x80171400, + 0x80971500, 0x005f802c, 0x001f8028, 0xb6004010, + 0x41028000, 0x51008004, 0x007f876c, 0x0208a028, + 0x41008000, 0x49028004, 0x003f8068, 0x0388a028, + 0x41038000, 0x51018004, 0x005f802c, 0x0288a028, + 0x41018020, 0x49038024, 0x001f8028, 0x0308a028, + 0x00ffb81c, 0x83d7ffff, 0x8357ffff, 0x82d7ffff, + 0x8257ffff, 0x8157ffff, 0x81d7ffff, 0x8057ffff, + 0x80d7ffff, 0x82971200, 0x82171000, 0x81170c00, + 0x81970ffc, 0x83171800, 0x83971a00, 0x83370000, + 0x83b70000, 0x81370008, 0x81b7fff8, 0x4119880c, + 0xb6008006, 0x511d8808, 0x41498838, 0x0208a028, + 0x494d883c, 0x4119880c, 0x0288a02a, 0x00ffb81c, + 0x82670000, 0x82a70000, 0x003f037a, 0xb0010000, + 0xb4400018, 0x81a7bdfc, 0x5da2b80d, 0x80670580, + 0xb6000208, 0x00cfb803, 0x01bfb0bc, 0x59a2b80d, + 0x01cfb80d, 0x01bf90bc, 0xb520ffff, 0x90630020, + 0x91ad0020, 0x81a7eb70, 0x5da2b80d, 0x806705c0, + 0xb6000208, 0x00cfb803, 0x01bfb0bc, 0x59a2b80d, + 0x01cfb80d, 0x01bf90bc, 0xb520ffff, 0x90630020, + 0x91ad0020, 0x02bf03fa, 0x808f0000, 0xb0150000, + 0xb4000006, 0x81470040, 0x81670003, 0x81870002, + 0x81a71000, 0x81c71300, 0xb5000005, 0x81470080, + 0x81670004, 0x81870001, 0x81a71000, 0x81c71200, + 0x0017b80d, 0x0097b80e, 0x108db80a, 0x0117b804, + 0x108eb80a, 0x0197b804, 0x5841b80a, 0x108db802, + 0x0217b804, 0x108eb802, 0x0297b804, 0x106ab802, + 0x108db803, 0x0317b804, 0x108eb803, 0x0397b804, + 0x5ea2b80a, 0xb6350020, 0x001f8000, 0x003f8008, + 0x005f8004, 0x007f800c, 0x10c08010, 0x10a18018, + 0x10828014, 0x10e3801c, 0x1246b805, 0x0686b805, + 0x10c4b807, 0x0484b807, 0x80e70000, 0x80a70000, + 0x0008a032, 0x0108a034, 0x0088a026, 0x0188a024, + 0x04c08010, 0x04a18018, 0x04828014, 0x04e3801c, + 0x0646b807, 0x1286b807, 0x10c4b805, 0x0484b805, + 0x80e70000, 0x80a70000, 0x0208a032, 0x0308a034, + 0x0288a026, 0x0388a024, 0x5de1b80a, 0x82070004, + 0xb62b002a, 0x0017b80d, 0x0097b80e, 0x102db80f, + 0x0117b801, 0x104eb80f, 0x0197b802, 0x82171600, + 0x82971700, 0x0037b80f, 0x00b7b80f, 0x0137b80f, + 0x01b7b80f, 0xb630001b, 0x003f8030, 0x005f8034, + 0x5ee2b80f, 0x8013007f, 0x9800ffff, 0xb6370011, + 0x41008000, 0x51018008, 0x4902800c, 0x40c08000, + 0x0008a028, 0x48c18008, 0x50c2800c, 0x42808004, + 0x00c8b806, 0x52828008, 0x5281800c, 0x41008004, + 0x0088a034, 0x49028008, 0x4901800c, 0x011fa026, + 0x0188a028, 0x001f8001, 0x001f8005, 0x001f8009, + 0x001f800d, 0x5de1b80f, 0x5a01b810, 0x0017b80d, + 0x0097b80e, 0x902d0004, 0x0117b801, 0x904e0004, + 0x0197b802, 0x82171600, 0x82971700, 0x5ea1b80a, + 0x8013007f, 0x9800ffff, 0xb6350013, 0x003f8030, + 0x005f8034, 0x42408000, 0x52418008, 0x4a42800c, + 0x41008000, 0x0008a052, 0x49018008, 0x5102800c, + 0x42808004, 0x0108b808, 0x52828008, 0x5281800c, + 0x40c08004, 0x0088a054, 0x48c28008, 0x48c1800c, + 0x011fa048, 0x0188a046, 0x81a71100, 0x81c71200, + 0x858c0001, 0xb4e0ff7e, 0x00ffb81c, 0x00000000, + 0x005f03fa, 0x00000000, 0xb0020000, 0xb4000034, + 0x81b70080, 0x81d7ffff, 0x81f70001, 0x82370080, + 0x8257ffff, 0x82770001, 0x82b70080, 0x82d7ffff, + 0x82f70001, 0x83370080, 0x8357ffff, 0x83770001, + 0x81971000, 0x82171100, 0x82971200, 0x83171300, + 0x815703fc, 0x81370200, 0x81170c00, 0x83d703fc, + 0x83b70200, 0x83970f00, 0x8057ffff, 0x80d7ffff, + 0x80171400, 0x80971500, 0x001f800d, 0x003f8019, + 0xb6004012, 0x41008000, 0x51018004, 0x007f8011, + 0x0128a008, 0x41018000, 0x49008004, 0x009f8015, + 0x03a8a008, 0x41038000, 0x51048004, 0x001f800d, + 0x03a8a008, 0x41048020, 0x49038024, 0x003f8019, + 0x0128a008, 0x005f8028, 0x005f803c, 0x81f70000, + 0x82770000, 0x82f70000, 0x83770000, 0x00ffb81c, + 0x82370040, 0x8257ffff, 0x82770001, 0x82b70040, + 0x82d7ffff, 0x82f70001, 0x82171000, 0x82971200, + 0x8157ffff, 0x81170c00, 0x81d7ffff, 0x81970e00, + 0x8057ffff, 0x80d7ffff, 0x80171800, 0x80971a00, + 0xb600800a, 0x001f8011, 0x003f8015, 0x41008000, + 0x51018004, 0x00000000, 0x0108a028, 0x41018020, + 0x49008024, 0x00000000, 0x0188a028, 0x82770000, + 0x82f70000, 0x00ffb81c, 0x00000000, 0x00000000, + 0x8057ffff, 0x80d7ffff, 0x8157ffff, 0x808f0000, + 0x015f0384, 0x017f037a, 0xac4a0006, 0x8027b004, + 0x1042b80b, 0x5841b802, 0x1021b802, 0x0159b801, + 0x013f0325, 0x01bf0320, 0x5822b80b, 0x90210340, + 0x00ff9801, 0x8027b2e8, 0x5842b807, 0x1021b802, + 0x025bb801, 0x80070000, 0xac4d0006, 0x8027b004, + 0x1042b800, 0x5841b802, 0x1021b802, 0x0199b801, + 0x00000000, 0xac4c0006, 0x8027b078, 0x1042b80a, + 0x5842b802, 0x1021b802, 0x011bb801, 0x00000000, + 0x40d2b808, 0x00000000, 0xb0060000, 0xb4000080, + 0x005f033b, 0x80278400, 0xac600080, 0x5c22b801, + 0x10a1b803, 0xb0020000, 0xb4200002, 0x80279000, + 0xb5000001, 0x80279c00, 0x5c22b801, 0x11e1b803, + 0x80470300, 0x5822b800, 0x1042b801, 0x003f9802, + 0x806f001f, 0x80af001f, 0xb0010000, 0xb4200024, + 0x80170c00, 0x80971000, 0x003f8020, 0xb6000003, + 0x4201b806, 0x003f8020, 0x0088a030, 0x80270400, + 0xb6000208, 0x00cfb801, 0x00bfb0bc, 0x58a2b805, + 0x01afb805, 0x00bf90bc, 0xb520ffff, 0x90210020, + 0x90a50020, 0xb6000408, 0x00cfb801, 0x01ffb0bc, + 0x59e2b80f, 0x01afb80f, 0x01ff90bc, 0xb520ffff, + 0x90210020, 0x91ef0020, 0xb6000208, 0x00cfb801, + 0x00bfb0bc, 0x58a2b805, 0x01afb805, 0x00bf90bc, + 0xb520ffff, 0x90210020, 0x90a50020, 0xb5000043, + 0x80270400, 0x0087b805, 0x01c7b80f, 0xb6000208, + 0x00cfb801, 0x009fb0bc, 0x5882b804, 0x01cfb804, + 0x009f90bc, 0xb520ffff, 0x90210020, 0x90840020, + 0xb6000408, 0x00cfb801, 0x01dfb0bc, 0x59c2b80e, + 0x01cfb80e, 0x01df90bc, 0xb520ffff, 0x90210020, + 0x91ce0020, 0xb6000208, 0x00cfb801, 0x009fb0bc, + 0x5882b804, 0x01cfb804, 0x009f90bc, 0xb520ffff, + 0x90210020, 0x90840020, 0x80170c00, 0x80971000, + 0x8053007f, 0x9842ffff, 0xb6000004, 0x42028004, + 0x4a068020, 0x00000000, 0x0088a030, 0x80270400, + 0xb6000208, 0x00cfb801, 0x00bfb0bc, 0x58a2b805, + 0x01afb805, 0x00bf90bc, 0xb520ffff, 0x90210020, + 0x90a50020, 0xb6000408, 0x00cfb801, 0x01ffb0bc, + 0x59e2b80f, 0x01afb80f, 0x01ff90bc, 0xb520ffff, + 0x90210020, 0x91ef0020, 0xb6000208, 0x00cfb801, + 0x00bfb0bc, 0x58a2b805, 0x01afb805, 0x00bf90bc, + 0xb520ffff, 0x90210020, 0x90a50020, 0x5822b800, + 0x90210300, 0x0117b801, 0x80470001, 0x011fa002, + 0x90000001, 0x3000b809, 0xb480ff6b, 0x00ffb81c, + 0x8057ffff, 0x013f0325, 0x015f033b, 0x80171000, + 0x80070000, 0xb6002001, 0x001fa020, 0xb00a0001, + 0xb4c00002, 0x81679000, 0xb5000001, 0x81679c00, + 0x5d62b80b, 0x81878400, 0x5d82b80c, 0x80070000, + 0x5822b800, 0x90410300, 0x003f9802, 0x00000000, + 0xb0010000, 0xb4200019, 0xac400080, 0x00000000, + 0x10ccb802, 0x10abb802, 0x806f001f, 0x80af001f, + 0x80cf0400, 0xb6000408, 0xb520ffff, 0x00dfb0bc, + 0x58c2b806, 0x01afb806, 0x00df90bc, 0xb520ffff, + 0x80cf0400, 0x90c60020, 0x80cf0400, 0xb6000407, + 0x00bfb0bc, 0x58a2b805, 0x01afb805, 0x00bf90bc, + 0xb520ffff, 0x80cf0400, 0x90a50020, 0x90000001, + 0x3000b809, 0xb480ffde, 0x00ffb81b, 0x8057ffff, + 0x013f0325, 0x80171000, 0x80070000, 0xb6002001, + 0x001fa020, 0x81878400, 0x5d82b80c, 0x80070000, + 0x5822b800, 0x90410300, 0x003f9802, 0x00000000, + 0xb0010000, 0xb420000f, 0xac400080, 0x00000000, + 0x10ccb802, 0x806f001f, 0x80af001f, 0x80cf0400, + 0xb6000408, 0xb520ffff, 0x00dfb0bc, 0x58c2b806, + 0x01afb806, 0x00df90bc, 0xb520ffff, 0x80cf0400, + 0x90c60020, 0x90000001, 0x3000b809, 0xb480ffe8, + 0x00ffb81b, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x8139b000, 0x00000000, 0xb0090000, 0xb4000012, + 0x806f001f, 0x80af001f, 0x80cf0400, 0x013fb0bc, + 0x5922b809, 0x01cfb809, 0x013f90bc, 0xb520ffff, + 0x806f0003, 0x80af0003, 0x80cf0420, 0x91290020, + 0x013fb0bc, 0x5922b809, 0x01cfb809, 0x013f90bc, + 0xb520ffff, 0xb5000233, 0x80270000, 0x80171000, + 0xb6002401, 0x001fa021, 0x007f0384, 0x009f0320, + 0x00bf0385, 0x00df0386, 0x80e7b36c, 0x5821b803, + 0x1021b807, 0x0159b801, 0x5821b804, 0x1021b807, + 0x0179b801, 0x80e7b37c, 0x5821b803, 0x1021b807, + 0x0199b801, 0x5821b804, 0x1021b807, 0x01b9b801, + 0x80e7b38c, 0x5821b803, 0x1021b807, 0x01d9b801, + 0x5821b804, 0x1021b807, 0x01f9b801, 0x005f0385, + 0x8027b39c, 0x5842b802, 0x1021b802, 0x021bb801, + 0x005f0386, 0x8027b3ac, 0x5842b802, 0x1021b802, + 0x023bb801, 0x027f0383, 0x003f0328, 0x005f4195, + 0xb0130007, 0xb42000df, 0xb0010000, 0xb42000dd, + 0xb0020000, 0xb40000db, 0xb0030002, 0xb48000d9, + 0x029bb802, 0x82a7b108, 0xb00b0001, 0xb4200001, + 0xb5000005, 0xb00b0002, 0xb4200002, 0x92b500a0, + 0xb5000001, 0x92b50140, 0xb0030004, 0xb4600002, + 0x82870000, 0xb5000006, 0xb0030006, 0xb4600004, + 0xb0140001, 0xb4a00002, 0x82870001, 0xb5000000, + 0xac54000a, 0x806f0009, 0x80af0009, 0x5c22b815, + 0x80cf0440, 0x1021b802, 0x003fb0bc, 0x5822b801, + 0x01cfb801, 0x003f90bc, 0xb520ffff, 0xb0030003, + 0xb400000f, 0xb0030004, 0xb400001d, 0xb0030005, + 0xb400002b, 0xb0030006, 0xb4000042, 0xb0030007, + 0xb4000059, 0x80171000, 0x005f9440, 0x001fa002, + 0x80171038, 0x005f9440, 0x001fa002, 0xb5000073, + 0x80171000, 0x005f9440, 0x001fa002, 0x80171004, + 0x005f9443, 0x001fa002, 0x8017101c, 0x005f9446, + 0x001fa002, 0x80171034, 0x005f9449, 0x001fa002, + 0x80171038, 0x005f9440, 0x001fa002, 0xb5000063, + 0x80171000, 0x005f9440, 0x001fa002, 0x80171008, + 0x005f9441, 0x001fa002, 0x80171020, 0x005f9444, + 0x001fa002, 0x80171034, 0x005f9440, 0x001fa002, + 0x80171038, 0x005f9447, 0x001fa002, 0xb5000053, + 0x80171000, 0x005f9440, 0x001fa002, 0x80171004, + 0x005f9443, 0x001fa002, 0x8017100c, 0x005f9441, + 0x001fa002, 0x8017101c, 0x005f9446, 0x001fa002, + 0x80171024, 0x005f9444, 0x001fa002, 0x80171034, + 0x005f9449, 0x001fa002, 0x80171038, 0x005f9440, + 0x001fa002, 0x8017103c, 0x005f9447, 0x001fa002, + 0xb500003a, 0x80171000, 0x005f9440, 0x001fa002, + 0x80171008, 0x005f9441, 0x001fa002, 0x8017100c, + 0x005f9442, 0x001fa002, 0x80171020, 0x005f9444, + 0x001fa002, 0x80171024, 0x005f9445, 0x001fa002, + 0x80171034, 0x005f9440, 0x001fa002, 0x80171038, + 0x005f9447, 0x001fa002, 0x8017103c, 0x005f9448, + 0x001fa002, 0xb5000021, 0x80171000, 0x005f9440, + 0x001fa002, 0x80171004, 0x005f9443, 0x001fa002, + 0x8017100c, 0x005f9441, 0x001fa002, 0x80171010, + 0x005f9442, 0x001fa002, 0x8017101c, 0x005f9446, + 0x001fa002, 0x80171024, 0x005f9444, 0x001fa002, + 0x80171028, 0x005f9445, 0x001fa002, 0x80171034, + 0x005f9449, 0x001fa002, 0x80171038, 0x005f9440, + 0x001fa002, 0x8017103c, 0x005f9447, 0x001fa002, + 0x80171040, 0x005f9448, 0x001fa002, 0x80270001, + 0x803eff90, 0x80171000, 0x82b30020, 0x9ab50000, + 0x40158020, 0xb6000501, 0x48158020, 0x82b30020, + 0x9ab50000, 0x80470000, 0x3015b800, 0xb4600006, + 0x80171000, 0x83840226, 0xb6000603, 0x40028000, + 0x00000000, 0x0008a020, 0x80171018, 0x82b30020, + 0x9ab50000, 0x40158020, 0xb6000501, 0x48158020, + 0x82b30020, 0x9ab50000, 0x80470000, 0x3015b800, + 0xb4600006, 0x80171018, 0x83840215, 0xb6000603, + 0x40028000, 0x00000000, 0x0008a020, 0x80171030, + 0x82b30020, 0x9ab50000, 0x40158020, 0xb6000501, + 0x48158020, 0x82b30020, 0x9ab50000, 0x80470000, + 0x3015b800, 0xb4600006, 0x80171030, 0x83840204, + 0xb6000603, 0x40028000, 0x00000000, 0x0008a020, + 0xb500011e, 0x80270000, 0x803eff90, 0xb0030000, + 0xb4200067, 0x025f0322, 0xb00b0001, 0xb4200016, + 0xb0120001, 0xb4200005, 0x80171018, 0x8033007f, + 0x9821ffff, 0x001fa001, 0xb5000110, 0xb0120002, + 0xb4200005, 0x80171020, 0x8033007f, 0x9821ffff, + 0x001fa001, 0xb5000109, 0x80171018, 0x80330040, + 0x98210000, 0x001fa001, 0x80171020, 0x00000000, + 0x001fa001, 0xb5000101, 0xb00b0002, 0xb420002c, + 0xb0120000, 0xb4200008, 0x80171000, 0x8033007f, + 0x9821ffff, 0x001fa001, 0x80171038, 0x00000000, + 0x001fa001, 0xb50000f5, 0xb0120001, 0xb4200008, + 0x80171000, 0x8033005a, 0x98218279, 0x001fa001, + 0x80171030, 0x00000000, 0x001fa001, 0xb50000eb, + 0xb0120002, 0xb4200008, 0x80171008, 0x8033005a, + 0x98218279, 0x001fa001, 0x80171038, 0x00000000, + 0x001fa001, 0xb50000e1, 0x80171000, 0x80330040, + 0x98210000, 0x001fa001, 0x80171008, 0x00000000, + 0x001fa001, 0x8017100c, 0x00000000, 0x001fa001, + 0x80171038, 0x00000000, 0x001fa001, 0xb50000d3, + 0xb0120000, 0xb4200008, 0x80171000, 0x8033007f, + 0x9821ffff, 0x001fa001, 0x80171038, 0x00000000, + 0x001fa001, 0xb50000c9, 0xb0120001, 0xb4200005, + 0x80171018, 0x8033007f, 0x9821ffff, 0x001fa001, + 0xb50000c2, 0xb0120002, 0xb4200005, 0x80171020, + 0x8033007f, 0x9821ffff, 0x001fa001, 0xb50000bb, + 0x80171018, 0x80330040, 0x98210000, 0x001fa001, + 0x80171020, 0x00000000, 0x001fa001, 0xb50000b3, + 0x80070000, 0x8033007f, 0x9821ffff, 0xb600050e, + 0x144eb80f, 0xb0028000, 0xb4c00008, 0xac400006, + 0x00000000, 0x1042b800, 0x5842b802, 0x90421000, + 0x0017b802, 0x00000000, 0x001fa001, 0x90000001, + 0x59c1b80e, 0x59e1b80f, 0xb0040000, 0xb4200023, + 0xb00a0002, 0xb4000007, 0x80171004, 0x8033005a, + 0x98218279, 0x001fa001, 0x80171034, 0x00000000, + 0x001fa001, 0xb00c0002, 0xb4000009, 0x8017100c, + 0x8033ffa5, 0x98217d87, 0x001fa001, 0x8017103c, + 0x8033005a, 0x98218279, 0x001fa001, 0xb500008b, + 0x8017100c, 0x8033ffa5, 0x98217d87, 0x001fa001, + 0x80171010, 0x00000000, 0x001fa001, 0x8017103c, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171040, + 0x00000000, 0x001fa001, 0xb500007c, 0xb0040001, + 0xb420002a, 0xb00a0001, 0xb4000007, 0x80171018, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171020, + 0x00000000, 0x001fa001, 0xb00a0003, 0xb420000a, + 0x8053005a, 0x98428279, 0x4030b802, 0x8017101c, + 0x5821b801, 0x00000000, 0x00000000, 0x00000000, + 0x0028b801, 0x001fa001, 0xb00c0001, 0xb4200007, + 0x8053005a, 0x98428279, 0x4031b802, 0x80171024, + 0x0028b801, 0x001fa001, 0xb500005c, 0xb00c0002, + 0xb420005a, 0x8053005a, 0x98428279, 0x4031b802, + 0x80171024, 0x0028b801, 0x001fa001, 0x80171028, + 0x00000000, 0x001fa001, 0xb5000050, 0xb00b0002, + 0xb4200012, 0xb00a0001, 0xb4200008, 0x80171004, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171034, + 0x00000000, 0x001fa001, 0xb5000008, 0xb00a0003, + 0xb4200006, 0x80171004, 0x00000000, 0x001fa010, + 0x80171034, 0x00000000, 0x001fa010, 0xb00c0001, + 0xb4200025, 0x027f0383, 0x003f0328, 0xb0130007, + 0xb420000b, 0xb00b0003, 0xb4200009, 0xb0010000, + 0xb4200007, 0x80171024, 0x00000000, 0x001fa011, + 0x80171054, 0x80270000, 0x001fa001, 0xb500002b, + 0xb00d0000, 0xb420000a, 0x8033005a, 0x98218279, + 0x4041b811, 0x8017100c, 0x0048b802, 0x001fa002, + 0x8017103c, 0x00000000, 0x001fa002, 0xb500001f, + 0xb00d0002, 0xb420001d, 0x80171054, 0x8033005a, + 0x98218279, 0x001fa001, 0x8017106c, 0x00000000, + 0x001fa001, 0xb5000015, 0xb00c0002, 0xb4200013, + 0xb00d0000, 0xb4200007, 0x8017100c, 0x00000000, + 0x001fa011, 0x80171040, 0x00000000, 0x001fa011, + 0xb500000a, 0xb00d0001, 0xb4200008, 0x80171054, + 0x8033005a, 0x98218279, 0x001fa001, 0x80171058, + 0x00000000, 0x001fa001, 0xb5000000, 0x029f0388, + 0x02bf0321, 0xb0140000, 0xb4000006, 0xb0150000, + 0xb4000004, 0x8017108c, 0x8033007f, 0x9821ffff, + 0x001fa001, 0x8027b078, 0x5c22b801, 0x806f001f, + 0x80af001f, 0x80cf0400, 0x003fb0bc, 0x5822b801, + 0x01afb801, 0x003f90bc, 0xb520ffff, 0x90210020, + 0x806f0003, 0x80af0003, 0x80cf0420, 0x003fb0bc, + 0x5822b801, 0x01afb801, 0x003f90bc, 0xb520ffff, + 0x81270000, 0x8033007f, 0x9821ffff, 0x80171000, + 0xb600060a, 0x80470000, 0xb6000603, 0x015f8020, + 0x0156b80a, 0x1042b80a, 0x3002b801, 0xb4a00001, + 0x81270001, 0x00000000, 0x00000000, 0x015f0323, + 0x00000000, 0xb00a0000, 0xb4200002, 0x81670000, + 0xb5000001, 0x81670001, 0x017f23fb, 0x01ff41ee, + 0x59f0b80f, 0x61f0b80f, 0x021f41ef, 0x5a10b810, + 0x6210b810, 0xb00a0003, 0xb420003b, 0x017f039f, + 0x019f41c5, 0x5990b80c, 0x6190b80c, 0xb00b0000, + 0xb400000c, 0xb00c0000, 0xb4000005, 0xac4c0100, + 0x8033001d, 0x98215500, 0x12c1b802, 0xb500000f, + 0xac4f0100, 0x8033001d, 0x98215500, 0x12c1b802, + 0xb500000a, 0xb0090000, 0xb4000005, 0xac4f0100, + 0x8033ffe2, 0x9821ab00, 0x12c1b802, 0xb5000003, + 0xac4f0100, 0x00000000, 0x02c7b802, 0xb0030000, + 0xb420007e, 0x01bf03a0, 0x01df41c9, 0x59d0b80e, + 0x61d0b80e, 0xb00d0000, 0xb400000c, 0xb00e0000, + 0xb4000005, 0xac4e0100, 0x8033001d, 0x98215500, + 0x12e1b802, 0xb5000071, 0xac500100, 0x8033001d, + 0x98215500, 0x12e1b802, 0xb500006c, 0xb0090000, + 0xb4000005, 0xac500100, 0x8033ffe2, 0x9821ab00, + 0x12e1b802, 0xb5000065, 0xac500100, 0x00000000, + 0x02e7b802, 0xb5000061, 0xb00a0002, 0xb420002f, + 0x023f9002, 0x025f9001, 0xb00f0000, 0xb4a00007, + 0xac4f0100, 0x00000000, 0x4022b811, 0x00000000, + 0x0028b801, 0x02c7b801, 0xb500000c, 0xb0090000, + 0xb4000004, 0xac4f0100, 0x00000000, 0x02c7b802, + 0xb5000006, 0xac4f0100, 0x00000000, 0x4022b812, + 0x00000000, 0x0028b801, 0x02c7b801, 0xb0030000, + 0xb4200046, 0xb0100000, 0xb4a00007, 0xac500100, + 0x00000000, 0x4022b811, 0x00000000, 0x0028b801, + 0x02e7b801, 0xb500003d, 0xb0090000, 0xb4000004, + 0xac500100, 0x00000000, 0x02e7b802, 0xb5000037, + 0xac500100, 0x00000000, 0x4022b812, 0x00000000, + 0x0028b801, 0x02e7b801, 0xb5000030, 0x023f9002, + 0x025f9001, 0xb00f0000, 0xb4a00007, 0xac4f0100, + 0x00000000, 0x4022b811, 0x00000000, 0x0028b801, + 0x02c7b801, 0xb5000006, 0xac4f0100, 0x00000000, + 0x4022b812, 0x00000000, 0x0028b801, 0x02c7b801, + 0xb0090000, 0xb4000005, 0x0047b816, 0x8033ffe2, + 0x9821ab00, 0x1042b801, 0x02c7b802, 0xb0030000, + 0xb4200016, 0xb0100000, 0xb4a00007, 0xac500100, + 0x00000000, 0x4022b811, 0x00000000, 0x0028b801, + 0x02e7b801, 0xb5000006, 0xac500100, 0x00000000, + 0x4022b812, 0x00000000, 0x0028b801, 0x02e7b801, + 0xb0090000, 0xb4000005, 0x0047b817, 0x8033ffe2, + 0x9821ab00, 0x1042b801, 0x02e7b802, 0x00000000, + 0x00000000, 0x02c8b816, 0x02dfb0cf, 0xb0030000, + 0xb4200002, 0x02e8b817, 0x02ffb0c6, 0x00ffb81b, + 0xb6001807, 0x5841b802, 0x3015b800, 0xb4800002, + 0x06b5b800, 0x98420001, 0x5aa1b815, 0x00000000, + 0x00ffb81c, 0x00000000, 0x00000000, 0x00000000, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000015, 0x815bb3f0, 0x81070000, 0x812707f8, + 0xb00a0000, 0xb4000006, 0x81070800, 0x81270ff8, + 0xb00a0001, 0xb4000002, 0x81071000, 0x812717f8, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000f, 0x3001b809, + 0xb4a00031, 0xb500000c, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81070000, 0xb5000007, 0xb0040001, + 0xb4200002, 0x81070800, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81071000, 0xb0040000, 0xb4200001, + 0x8384020c, 0x80af001f, 0x808f0000, 0x806f0000, + 0x80670400, 0x5d22b808, 0x81df0000, 0x00000000, + 0x00000000, 0xb600100a, 0x00cfb803, 0x013fb0bc, + 0x5922b809, 0x01afb809, 0x013f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x91290020, + 0x81df0004, 0x801bb3f8, 0x80270001, 0xb0000001, + 0xb4000002, 0x802600a0, 0x803eb3f8, 0x914a0001, + 0xb00a0002, 0xb4a00001, 0x81470000, 0x815eb3f0, + 0x80270001, 0x003f2013, 0x00ffb81b, 0x00000000, + 0x029fb00a, 0x02bfb00b, 0x02dfb00c, 0x02ffb00d, + 0x031fb00e, 0x033fb00f, 0x033f400f, 0x0287b86f, + 0x029fb005, 0x8285009c, 0x96b48000, 0xb0158000, + 0xb4000195, 0x96b40100, 0xb0150100, 0xb40001ab, + 0x96b40400, 0xb0150400, 0xb40001ac, 0x96b40001, + 0xb0150001, 0xb400000c, 0x96b40008, 0xb0150008, + 0xb400019e, 0x96b44000, 0xb0154000, 0xb40001ab, + 0x96b40002, 0xb0150002, 0xb4000162, 0x00000000, + 0x00000000, 0xb50001bd, 0x02bf9017, 0x92b50001, + 0x02bfb017, 0x82850082, 0x5efdb814, 0x96f70001, + 0xb0170001, 0xb420000b, 0x83050069, 0x9718003f, + 0x82e50064, 0x12f7b818, 0x86f70109, 0x82feff74, + 0x02e7b86f, 0x9af74000, 0x01ffb817, 0x96f7bfff, + 0x01ffb817, 0x83050081, 0x82a5009a, 0x96b50001, + 0xb0150001, 0xb4200014, 0x82a70000, 0x02bfb017, + 0x96b41840, 0xb0150800, 0xb420000c, 0x96b40008, + 0x5aa9b815, 0x96d46000, 0x5ec3b816, 0x82f3000f, + 0x9af7c00f, 0x1718b817, 0x1ab5b818, 0x1ab5b816, + 0x9ab50340, 0x82a60081, 0xb5000132, 0x9b180180, + 0x83060081, 0xb500012f, 0x82a5009a, 0x96b50002, + 0xb0150002, 0xb420001b, 0x82a70000, 0x02bfb017, + 0x96b41800, 0xb0151800, 0xb4000013, 0x96b40040, + 0xb0150040, 0xb4200004, 0xa3180c00, 0x9b180340, + 0x83060081, 0xb500011f, 0x96b40008, 0x5aa9b815, + 0x96d46000, 0x5ec3b816, 0x82f3000f, 0x9af7c00f, + 0x1718b817, 0x1ab5b818, 0x1ab5b816, 0x9ab50340, + 0x82a60081, 0xb5000113, 0x9b180180, 0x83060081, + 0xb5000110, 0x82a500c1, 0x96b5000f, 0xb015000b, + 0xb420000e, 0x96b40020, 0xb0150020, 0xb400000b, + 0x96b40200, 0xb0150200, 0xb4000008, 0x82c50086, + 0x82e50094, 0x3016b817, 0xb4400004, 0x06f7b816, + 0xb017ff00, 0xb4400001, 0xb50000fe, 0x96b46000, + 0xb0156000, 0xb4000011, 0x96b41820, 0xb0150820, + 0xb4200004, 0x9b391000, 0x82a5009a, 0x96b5feff, + 0x82a6009a, 0x96b40040, 0xb0150040, 0xb4200001, + 0x9739efff, 0x96b91000, 0xb0151000, 0xb4200003, + 0x82a5009a, 0x9ab50100, 0x82a6009a, 0x96b40040, + 0xb0150040, 0xb4200019, 0x96b41800, 0xb0151800, + 0xb4200006, 0x96b98000, 0xb0158000, 0xb4200003, + 0x9b180180, 0x83060081, 0xb50000de, 0x96d80c00, + 0x82b300ff, 0x9ab5f3ff, 0x1718b815, 0xb0160c00, + 0xb4000007, 0x82e50098, 0x96f70400, 0xb0170400, + 0xb4200002, 0x82c70c00, 0xb5000001, 0xa2d60c00, + 0x1b18b816, 0x9b180340, 0xb50000c4, 0x96b40220, + 0xb0150000, 0xb4e00028, 0x82a5009d, 0x82f3ffff, + 0x16b5b817, 0x82f3000e, 0x3015b817, 0xb4200022, + 0x96f98000, 0xb0178000, 0xb400001f, 0x82a70000, + 0x02bfb017, 0x82c50081, 0x9ab60020, 0x82a60081, + 0x82a50086, 0x92b50bb8, 0x82a60094, 0x82c60081, + 0x82c5009d, 0x96d6ffff, 0x82b30032, 0x9ab58001, + 0x82e500c1, 0x96f7000f, 0xb017000b, 0xb4000002, + 0x82b30022, 0x9ab58001, 0x1ab5b816, 0x82c5009a, + 0x96d60020, 0xb0160020, 0xb4200002, 0x82b30032, + 0x9ab58001, 0x82a6009d, 0x02ff9017, 0x00000000, + 0xb0170040, 0xb4800000, 0x5eb5b814, 0x96b500f0, + 0x96f46000, 0x5eedb817, 0x1ab5b817, 0xb0170003, + 0xb4000004, 0x96b500ef, 0x96f70001, 0x5ae4b817, + 0x1ab5b817, 0x96d41800, 0xb0161800, 0xb400000a, + 0x96f900ff, 0x96b500ff, 0x9739ff00, 0x1b39b815, + 0x02a7b817, 0x96b500f3, 0x96d40008, 0x5ec1b816, + 0x1ab5b816, 0xb500000c, 0x96f98000, 0xb0178000, + 0xb4200007, 0x5efeb814, 0x96f70001, 0xb0170001, + 0xb4000003, 0x9b180180, 0x83060081, 0xb5000081, + 0x96b500f3, 0x9ab50008, 0x9739fff3, 0x96d40020, + 0xb0160020, 0xb4200017, 0x9b398000, 0x82c70000, + 0x02dfb017, 0x96d40010, 0x5ac8b816, 0x82f300ff, + 0x9af7cfff, 0x1718b817, 0x1b18b816, 0x9b180340, + 0x82c5009d, 0x96d6ffff, 0x82f3000e, 0x9af78001, + 0x1af7b816, 0x82c5009a, 0x96d60020, 0xb0160020, + 0xb4200002, 0x82f30032, 0x9af78001, 0x82e6009d, + 0xb500005a, 0x97397fff, 0x96b500ff, 0x5aaab815, + 0x82f300fc, 0x9af703ff, 0x1718b817, 0x1b18b815, + 0x9b180340, 0x82c5009a, 0x96d60010, 0xb0160010, + 0xb4200024, 0x82c70000, 0x02dfb017, 0x82c50086, + 0x92d60bb8, 0x82c60086, 0x82c50094, 0x5eefb818, + 0x96f70003, 0xb0170003, 0xb4200002, 0x82e70bb8, + 0xb5000001, 0x82e70bb8, 0x12d6b817, 0x82e50081, + 0x9af70020, 0x82e60081, 0x82c60094, 0xa2f70020, + 0x82e60081, 0x82f30001, 0x16f7b818, 0x5ef0b817, + 0xb0170001, 0xb4000004, 0x96f84000, 0x5ee4b817, + 0x9718f3ff, 0x1b18b817, 0x82f3000a, 0x9af78000, + 0x82e6009d, 0x83060081, 0x83070001, 0x8306009f, + 0xb5000096, 0x82c5009d, 0x82f3000e, 0x9af78001, + 0x3016b817, 0xb420000f, 0x82b30032, 0x9ab58001, + 0x82e500c1, 0x96f7000f, 0xb017000b, 0xb4000002, + 0x82b30022, 0x9ab58001, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82b30032, 0x9ab58001, + 0x82a6009d, 0x82c5009a, 0x96d60080, 0xb0160080, + 0xb4000011, 0x02df9017, 0x00000000, 0xb0160010, + 0xb480000d, 0x82c500c1, 0x96d6000f, 0xb016000b, + 0xb4000009, 0x82c50087, 0x96d60080, 0x5ac7b816, + 0x96f84000, 0x3017b816, 0xb4200003, 0x033f400f, + 0x9b394000, 0xb500000b, 0x9739bfff, 0x82e50061, + 0x96f70008, 0xb0170008, 0xb4000005, 0x5eefb818, + 0x96f70003, 0xb0170003, 0xb4000001, 0x9718ffff, + 0x83060081, 0x83070001, 0x8306009f, 0x00000000, + 0xb500005e, 0x82850083, 0x96b400ff, 0xb015003c, + 0xb4200019, 0x96b92000, 0xb0152000, 0xb4000002, + 0x9b392000, 0xb5000014, 0x9739d3ff, 0x82870000, + 0x82860087, 0x82870008, 0x82860083, 0x829bff78, + 0x82a7001f, 0xb0140400, 0xb4000001, 0x82a70010, + 0x82a600c9, 0x829bff78, 0x00000000, 0x828600cb, + 0x8285009d, 0x82b3ffff, 0x9ab5fffd, 0x1694b815, + 0x8286009d, 0xb5000000, 0x83070002, 0x8306009f, + 0x00000000, 0xb500003d, 0x96b90800, 0xb0150800, + 0xb4200009, 0x9739f7ff, 0x82a703fd, 0x82a600cb, + 0x82a7003c, 0x82a60083, 0x8285009d, 0x9a940002, + 0x8286009d, 0xb5000004, 0x82850087, 0x5a82b814, + 0xa2940200, 0x82860087, 0xb5000000, 0x83078000, + 0x8306009f, 0x00000000, 0xb5000028, 0x83070008, + 0x8306009f, 0x00000000, 0xb5000024, 0x83070100, + 0x8306009f, 0x00000000, 0xb5000020, 0x83070000, + 0x83050081, 0x9b180180, 0x83060081, 0x83070400, + 0x8306009f, 0x00000000, 0xb5000018, 0x82870000, + 0x82850082, 0x5eb7b814, 0x96b500fc, 0x96d40006, + 0x5ec1b816, 0x1ab5b816, 0x5aacb815, 0x83050081, + 0x82d3001c, 0x9ad600ff, 0x1718b816, 0x1b18b815, + 0x9b180e00, 0x83060081, 0x83074000, 0x8306009f, + 0x8305009d, 0x82d300ff, 0x9ad6bfff, 0x1718b816, + 0x8306009d, 0x00000000, 0xb5000000, 0x029f9005, + 0x01ffb814, 0x033f600f, 0x029f900a, 0x02bf900b, + 0x02df900c, 0x02ff900d, 0x031f900e, 0x033f900f, + 0x00ffb81e, 0x02ff9010, 0x92f70b43, 0x02ffb010, + 0x02ff90cb, 0x82bbffdc, 0x829bffd8, 0x93150004, + 0x3014b815, 0xb400000f, 0x02dbb818, 0x029bb815, + 0x3017b816, 0xb480000b, 0x5a81b814, 0x029fb010, + 0x82860095, 0x8293001f, 0x9294fe00, 0x92b50008, + 0x3015b814, 0xb4800002, 0x82b3001f, 0x92b5fa00, + 0x82beffdc, 0x029f9010, 0x83250094, 0x06d4b819, + 0x02d6b816, 0xb016ffff, 0xb4a0000a, 0x8293000e, + 0x9a948001, 0x82c5009d, 0x96d6ffff, 0x1a94b816, + 0x82c5009a, 0x96d60010, 0xb0160010, 0xb4000001, + 0x8286009d, 0x00ffb81c, 0x82870001, 0x829ef500, + 0x82850086, 0x83250094, 0x06d4b819, 0x02d6b816, + 0xb016ffff, 0xb4a0000b, 0x82870001, 0x829ef504, + 0x82c50081, 0x9ab60020, 0x82a60081, 0x82a50086, + 0x92b50bbb, 0x82a60094, 0x82c60081, 0x86b505df, + 0x82a6009b, 0x00ffb81c, 0x82070028, 0x023f9006, + 0x83a4ef48, 0x80070000, 0x001fb011, 0x001f204f, + 0x003fb800, 0x001f9006, 0x5803b800, 0x80338000, + 0x1800b801, 0x003fb800, 0x005f4193, 0x5c41b802, + 0x80350000, 0x00000000, 0x0027b860, 0x80150010, + 0x5810b800, 0x80750010, 0x1863b800, 0x8087ffff, + 0x80a7770b, 0x80c70000, 0x1403b804, 0x3000b805, + 0xb4000008, 0x5888b804, 0x58a8b805, 0x90c60001, + 0xb0060003, 0xb4a0fff8, 0x84420001, 0xb4e0ffee, + 0xb5000027, 0xb0060003, 0xb4200007, 0x80150010, + 0x5810b800, 0x81150010, 0x950800ff, 0xb0080077, + 0xb4000001, 0xb500fff4, 0x001f400e, 0x98000010, + 0x98004000, 0x9400fffe, 0x001f600e, 0x80e71fe0, + 0x001f4000, 0x94000080, 0xb0000080, 0xb4200001, + 0x80e77580, 0x00ffb008, 0x80e70020, 0xb0060000, + 0xb400000e, 0x58e3b806, 0x90210020, 0x81070000, + 0x5938b803, 0x1908b809, 0x9523ff00, 0x5928b809, + 0x1908b809, 0x5d28b803, 0x9529ff00, 0x1908b809, + 0x5d38b803, 0x1908b809, 0x011fb011, 0x00ff204f, + 0x80137fff, 0x9800ffe7, 0x1421b800, 0x5c23b801, + 0x001f9006, 0x0441b800, 0x3001b800, 0xb4600002, + 0x0440b801, 0xa4422000, 0x007f90cb, 0x1063b802, + 0x007fb0cb, 0x003fb006, 0x803effec, 0x80470001, + 0x005f2013, 0xb500eba6, 0x001f400e, 0x9400000f, + 0xb0000000, 0xb4200001, 0x00ffb81f, 0xb0000001, + 0xb4000005, 0xb0000003, 0xb4000003, 0xb0000002, + 0xb4000001, 0x00ffb81f, 0x80070001, 0x001f2013, + 0xb500eb97, 0x00000000, 0x00000000, 0x00000000, + 0x001f9012, 0x001fb100, 0x001f004c, 0x001f2404, + 0x801bfef0, 0x8058fef4, 0x803bff68, 0x8078ff6c, + 0x2000b801, 0x2042b803, 0x001fb104, 0x005f2414, + 0x82e70001, 0x83640048, 0x029fb014, 0x829efef0, + 0x8286000f, 0x02bf2054, 0x82bcfef4, 0x82a6000e, + 0x00ffb81a, 0x80e70001, 0x801336e3, 0x9800eb76, + 0x001fb100, 0x800700ab, 0x001f2404, 0x801bc3e8, + 0x8058c3ec, 0x83640024, 0x82e70000, 0x83640036, + 0x029fb300, 0x029fb100, 0x02bf2c04, 0x02bf2404, + 0x801bc000, 0x8058c004, 0x8364001b, 0x82e70000, + 0x8364002d, 0x001f9300, 0x3000b814, 0xb420000a, + 0x001f0c04, 0x3000b815, 0xb4200007, 0x829efef0, + 0x82bcfef4, 0x029fb012, 0x02bf204c, 0x82870001, + 0x829cfef5, 0x00ffb81a, 0xb0070000, 0xb4000007, + 0x80e70000, 0x801399fa, 0x9800c92e, 0x001fb100, + 0x800700af, 0x001f2404, 0xb500ffdc, 0x82870000, + 0x829cfef5, 0x00ffb81a, 0x80c700ff, 0x803bff68, + 0x8078ff6c, 0x14a0b806, 0x2063b805, 0x007f2414, + 0x2021b802, 0x58c8b806, 0x14a0b806, 0x58b0b805, + 0x2021b805, 0x58c8b806, 0x14a0b806, 0x2021b805, + 0x58c8b806, 0x14a0b806, 0x5cb0b805, 0x2021b805, + 0x003fb104, 0x00ffb81b, 0x82c70000, 0x83070400, + 0x83270005, 0x8197040c, 0x81d7ffff, 0x83840126, + 0x83840001, 0x00ffb81b, 0x808f0000, 0x806f001f, + 0x80af001f, 0x80270140, 0x81e7ef98, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x80270180, 0x81e7ee90, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x8057ffff, 0x80170430, 0x80070410, + 0x80270408, 0xb6000509, 0x005ff000, 0x90420500, + 0x007ff001, 0x90630600, 0x009ff002, 0x00bff003, + 0x2004a025, 0x90000001, 0x90210001, 0x80070414, + 0x80d7ffff, 0x8097045c, 0x8017043c, 0xb6000404, + 0x005ff000, 0x007f87e0, 0x84000001, 0x2082a7e3, + 0x80970460, 0x80170440, 0x2082b803, 0x007f8000, + 0x2083a004, 0x80170430, 0x80970450, 0x80270408, + 0xb6000508, 0x005f8024, 0x90420500, 0x007ff001, + 0x90630600, 0x009ff002, 0x00bff003, 0x2004a025, + 0x90210001, 0x80170440, 0x00000000, 0x02bf87e0, + 0x80970460, 0x82870000, 0xb6000404, 0x005f87e4, + 0x5a88b814, 0x204287e0, 0x1a94b802, 0x00ffb81c, + 0x001f0a49, 0x001f2709, 0x001f0a41, 0x001f2708, + 0x001f0a46, 0x001f2707, 0x001f0a48, 0x001f2706, + 0x001f0a42, 0x001f2705, 0x001f0a47, 0x001f2704, + 0x001f0a45, 0x001f2703, 0x001f0a43, 0x001f2702, + 0x001f0a40, 0x001f2701, 0x001f0a44, 0x001f2700, + 0x001f0c25, 0xa020000c, 0x94400001, 0x94600002, + 0x94810004, 0x94a10008, 0x94c00010, 0x5943b802, + 0x5861b803, 0x5882b804, 0x5ca2b805, 0x5cc4b806, + 0x194ab803, 0x194ab804, 0x194ab805, 0x194ab806, + 0x015f2738, 0x801bef90, 0x003f91c1, 0x5c28b801, + 0x005f91c2, 0x5858b802, 0x1821b802, 0x2000b801, + 0x001fb1c4, 0x8018ef94, 0x003f0709, 0x2000b801, + 0x001f2714, 0x82c70001, 0x82e70001, 0x83070710, + 0x8327001e, 0x81970735, 0x8384009f, 0x02df0738, + 0x82170a30, 0x838400f1, 0x819efef0, 0x817cfef4, + 0x819eff68, 0x817cff6c, 0x00ffb81b, 0x820f001f, + 0x8018fef8, 0x8057ffff, 0x001f2709, 0x8018fef6, + 0x80d7ffff, 0x001f2708, 0x8018fefa, 0x8157ffff, + 0x001f2707, 0x8018fefd, 0x81d7ffff, 0x001f2706, + 0x8018fefb, 0x802f001f, 0x001f2705, 0x8018fefe, + 0x00000000, 0x001f2704, 0x8018fef9, 0x00000000, + 0x001f2703, 0x8018feff, 0x00000000, 0x001f2702, + 0x8018fef7, 0x00000000, 0x001f2701, 0x8018fefc, + 0x00000000, 0x001f2700, 0x001f0c25, 0xa0200011, + 0x94410001, 0x94600002, 0x94800004, 0x94a00008, + 0x94c10010, 0x5941b802, 0x5861b803, 0x5c82b804, + 0x58a1b805, 0x5cc1b806, 0x194ab803, 0x194ab804, + 0x194ab805, 0x194ab806, 0x015f2738, 0x801bef90, + 0x003f91c1, 0x5c28b801, 0x005f91c2, 0x5858b802, + 0x1821b802, 0x2000b801, 0x001fb1c4, 0x8018ef94, + 0x003f0709, 0x2000b801, 0x001f2714, 0x82c70001, + 0x82e70001, 0x83070710, 0x8327001e, 0x81970735, + 0x83840055, 0x02df0738, 0x82170a20, 0x838400a7, + 0x819efef0, 0x817cfef4, 0x5ac8b80c, 0x02ff0a44, + 0x1ad6b817, 0x02dfb291, 0x5ed8b80c, 0x5968b80b, + 0x1ad6b80b, 0x02df6524, 0x00ffb81b, 0x820f001f, + 0x8018fefe, 0x8057ffff, 0x001f2709, 0x8018fefa, + 0x80d7ffff, 0x001f2708, 0x8018fefc, 0x8157ffff, + 0x001f2707, 0x8018feff, 0x81d7ffff, 0x001f2706, + 0x8018fef8, 0x802f001f, 0x001f2705, 0x8018fefb, + 0x00000000, 0x001f2704, 0x8018fefd, 0x00000000, + 0x001f2703, 0x8018fef6, 0x00000000, 0x001f2702, + 0x8018fef9, 0x00000000, 0x001f2701, 0x8018fef7, + 0x00000000, 0x001f2700, 0x801bef90, 0x003f91c1, + 0x5c28b801, 0x005f91c2, 0x5858b802, 0x1821b802, + 0x2000b801, 0x001fb1c4, 0x8018ef94, 0x003f0709, + 0x2000b801, 0x001f2714, 0x82c70001, 0x82e70001, + 0x83070710, 0x8327001e, 0x81970735, 0x83840016, + 0x83270000, 0x831bfef0, 0x82f8fef4, 0x02c7b819, + 0x82170a28, 0x83840065, 0x300cb818, 0xb4200002, + 0x300bb817, 0xb4000006, 0x93390001, 0xb0190020, + 0xb480fff6, 0x83270000, 0x833cfef5, 0x00ffb81b, + 0x019fb290, 0x017f2a44, 0x033f2c25, 0x83270001, + 0x833cfef5, 0x00ffb81b, 0x0007b818, 0x90000003, + 0x00000000, 0x015ff000, 0x90000001, 0x5949b80a, + 0x013ff000, 0x194ab809, 0x84000002, 0x994a0100, + 0x017ff000, 0x958b00f8, 0x5981b80c, 0x956b0007, + 0x198cb80b, 0x84000002, 0x998c0008, 0x017ff000, + 0x90000001, 0x5971b80b, 0x198cb80b, 0x017ff000, + 0x5969b80b, 0x198cb80b, 0x81a70000, 0x94d90003, + 0x82a70000, 0xb6260019, 0xb6000818, 0x5df0b80a, + 0x5e02b80a, 0x21efb810, 0x95ef0001, 0x5941b80a, + 0x194ab80f, 0x21efb816, 0x5e18b80c, 0x5e35b80c, + 0x5e54b80c, 0x5e6cb80c, 0x2210b811, 0x2252b813, + 0x2210b812, 0x96100001, 0x5981b80c, 0x198cb810, + 0x2210b817, 0x10afb810, 0x10a5b80d, 0x5da1b805, + 0x94a50001, 0x5aa1b815, 0x1ab5b805, 0x019fa7f5, + 0x5cc2b819, 0xb626001c, 0x82870000, 0xb6000419, + 0xb6000818, 0x5df0b80a, 0x5e02b80a, 0x21efb810, + 0x95ef0001, 0x5941b80a, 0x194ab80f, 0x21efb816, + 0x5e18b80c, 0x5e35b80c, 0x5e54b80c, 0x5e6cb80c, + 0x2210b811, 0x2252b813, 0x2210b812, 0x96100001, + 0x5981b80c, 0x198cb810, 0x2210b817, 0x10afb810, + 0x10a5b80d, 0x5da1b805, 0x94a50001, 0x5a81b814, + 0x1a94b805, 0x019fa7f4, 0x00ffb81c, 0x8257ffff, + 0x808f0000, 0x806f001f, 0x80af001f, 0x80270200, + 0x81e7ec70, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270240, + 0x81e7ed70, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270180, + 0x81e7ee90, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x806f0007, + 0x80af0007, 0x80270280, 0x81e7ee70, 0x5de2b80f, + 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, + 0x01ff90bc, 0xb520ffff, 0x91ef0020, 0x90210020, + 0x80170760, 0x001f0700, 0x001fa020, 0x001f0701, + 0x001fa020, 0x001f0702, 0x001fa020, 0x001f0703, + 0x001fa020, 0x001f0704, 0x001fa000, 0x80970750, + 0x81170770, 0x82a70735, 0x83a40060, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4005c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a70730, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40050, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4004c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a7072b, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40040, 0x83a4004e, + 0xb6000407, 0x86b50001, 0x83a4003c, 0x001f8004, + 0x003f87e8, 0x2080a001, 0x83a40047, 0x00000000, + 0x80970770, 0x80170750, 0x81170750, 0x81970740, + 0x82a70726, 0x001f800c, 0x003f8008, 0x2100a001, + 0x83a4002e, 0x83a4003c, 0xb6000407, 0x86b50001, + 0x83a4002a, 0x001f8004, 0x003f87e8, 0x2080a001, + 0x83a40035, 0x00000000, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a70721, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4001c, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a40018, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a7071c, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4000c, 0x017f87e4, + 0x81870000, 0xb6000406, 0x86b50001, 0x83a40007, + 0x001f87e4, 0x200087e8, 0x5988b80c, 0x198cb800, + 0x021fa02c, 0x021fa00b, 0x00ffb81c, 0x005ff015, + 0x90420600, 0x003f87e0, 0x001ff002, 0x2060b801, + 0x90630800, 0x90960a00, 0x001ff003, 0x003ff004, + 0x20a0b801, 0x90a50900, 0x00000000, 0x001ff005, + 0x009fa000, 0x00ffb81d, 0x001f8004, 0x5c21b800, + 0x5847b800, 0x1821b802, 0x942100ff, 0x2080a7e1, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x015f400e, 0x944a4000, 0xb0024000, 0xb420001e, + 0x954abfff, 0x015f600e, 0x820f001f, 0x802f001f, + 0x81470000, 0x015f23f9, 0x015fb0ba, 0x8057ffff, + 0x80770000, 0x82970400, 0x82d7ffff, 0x82f70000, + 0x81df0000, 0x00000000, 0x00000000, 0xb6000702, + 0xb6000001, 0x029fa02a, 0x81df0004, 0x80275480, + 0x005fb801, 0x8033001f, 0x9821c000, 0x803effe0, + 0x90212000, 0x803effe4, 0x80d9ff80, 0x00df6001, + 0x81477608, 0x015fb008, 0x003f0324, 0xb0010000, + 0xb420007e, 0x8344ebde, 0xb0180000, 0xb4000004, + 0x011f400e, 0x1908b818, 0x011f600e, 0x00ffb81f, + 0x8344f1d7, 0xb00b0000, 0xb4000006, 0x023f400e, + 0x9a310002, 0x023f600e, 0x82270000, 0x023f2012, + 0x00ffb81f, 0x8364ed6a, 0x82270000, 0x023f2011, + 0x80070000, 0x80170800, 0x81df0000, 0x00000000, + 0x00000000, 0xb6002002, 0xb6003001, 0x001fa020, + 0x81df0004, 0x82270000, 0x003fb811, 0x02bf9006, + 0x5aa3b815, 0x82338000, 0x1a31b815, 0x003fb811, + 0x8067e950, 0x5c62b803, 0x81f50000, 0x019f4193, + 0x0267b80c, 0xadcc0010, 0x80170800, 0x80130000, + 0x9800f872, 0x001fa020, 0x80134e1f, 0x98000001, + 0x001fa020, 0x59d0b80e, 0x81150010, 0x1908b80e, + 0x001fa028, 0x858c0001, 0x5e01b80c, 0x5e25b810, + 0x81df0000, 0x00000000, 0x00000000, 0xb6310006, + 0xb6002005, 0x81150010, 0x5910b808, 0x00000000, + 0x81350010, 0x1808a029, 0x9630001f, 0xb0110000, + 0xb4000006, 0xb6310005, 0x81150010, 0x5910b808, + 0x00000000, 0x81350010, 0x1808a029, 0x81df0004, + 0x962c0001, 0xb0110000, 0xb4000003, 0x81150010, + 0x5910b808, 0x001fa028, 0x019f9006, 0x958cffff, + 0x00df4193, 0x58c1b806, 0x118cb806, 0xb00ce000, + 0xb4800002, 0x858ce000, 0x918cc000, 0x8153001f, + 0x118cb80a, 0x819effec, 0x019fb006, 0x015f4193, + 0x5941b80a, 0x019f90cb, 0x118cb80a, 0x019fb0cb, + 0x019f90ba, 0x918c0001, 0x019fb0ba, 0xb00c0002, + 0xb4200016, 0x019f400e, 0x940c8000, 0xb0008000, + 0xb4200012, 0x958c7fff, 0x019f600e, 0x80070000, + 0x800600a0, 0x80073da1, 0x800600a1, 0x801bff60, + 0x00000000, 0x801eff60, 0x00000000, 0x801bff60, + 0x00000000, 0x801eff60, 0x80130001, 0x98003da1, + 0x800600a1, 0x80070001, 0x800600a0, 0x003f0324, + 0x90210001, 0xb0010005, 0xb4a00001, 0x80270000, + 0x003f2324, 0x00ffb81f, 0x00000000, 0x00000000, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815bb3f0, 0x81070000, 0x81270bf4, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x81271800, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a00032, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200001, + 0x8384fbf4, 0x80af001f, 0x808f0002, 0x806f0000, + 0x807bbf34, 0x5d22b80a, 0x81df0000, 0x00000000, + 0x00000000, 0xb600080a, 0x00cfb803, 0x013fb0bc, + 0x5922b809, 0x01afb809, 0x013f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x91290060, + 0x81df0004, 0x808f0000, 0x813bb3f8, 0x80270001, + 0xb0090001, 0xb4000002, 0x802600a0, 0x803eb3f8, + 0x81270c00, 0xb00a0000, 0xb4000001, 0x81270000, + 0x813eb3f0, 0xb0030800, 0xb4800001, 0x80670200, + 0x807ebf34, 0x80270001, 0x003f2013, 0x00ffb81b, +}; + +static u32 AC3I2SUcode1f8000[] = { + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00020000, 0xffff0005, 0xffffffff, + 0x00050001, 0xffffffff, 0xffffffff, 0x00020000, + 0xffff0005, 0xffffffff, 0x00010000, 0x00050002, + 0xffffffff, 0x00020000, 0x00050003, 0xffffffff, + 0x00010000, 0x00030002, 0xffff0005, 0x00020000, + 0x00040003, 0xffff0005, 0x00010000, 0x00030002, + 0x00050004, 0x0019000d, 0x003d0025, 0x00250019, + 0x00fd003d, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x007fffff, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x007fffff, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00599999, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00599999, + 0x007fffff, 0x00599999, 0x00000000, 0x00599999, + 0x00000000, 0x00000000, 0x00000000, 0x00599999, + 0x00000000, 0x00599999, 0x007fffff, 0x00000000, + 0x00599999, 0x00599999, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00599999, 0x00599999, + 0x007fffff, 0x007fffff, 0x00000000, 0x00599999, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00599999, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x007fffff, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x007fffff, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x007fffff, 0x00000000, + 0x007fffff, 0x00000000, 0x007fffff, 0x00400000, + 0x00200000, 0x00100000, 0x00080000, 0x00040000, + 0x00020000, 0x00010000, 0x00008000, 0x00004000, + 0x00002000, 0x00001000, 0x00000800, 0x00000400, + 0x00000200, 0x00000100, 0x00000080, 0x00000040, + 0x00000020, 0x00000010, 0x00000008, 0x00000004, + 0x00000002, 0x00000001, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00010002, + 0x00030002, 0x00030002, 0x00030002, 0x00000000, + 0x00000000, 0x00010001, 0x00020002, 0x4000a000, + 0xe000a000, 0xf000b000, 0xf800b800, 0x005a8279, + 0x004c1bf8, 0x00400000, 0x004c1bf8, 0x005a8279, + 0x00400000, 0x00000000, 0x00400000, 0x03020100, + 0x00000000, 0x00000080, 0x00000020, 0x00000008, + 0x00000000, 0x00000001, 0x00010001, 0x10001000, + 0x10001004, 0x10041004, 0x10041004, 0x10041004, + 0x00000000, 0x00000000, 0x00000000, 0xff80000a, + 0xff80031f, 0xff800b24, 0xff801818, 0xff8029fa, + 0xff8040c9, 0xff805c86, 0xff807d2e, 0xff80a2c1, + 0xff80cd3c, 0xff80fc9f, 0xff8130e8, 0xff816a14, + 0xff81a821, 0xff81eb0e, 0xff8232d6, 0xff827f79, + 0xff82d0f2, 0xff83273e, 0xff83825b, 0xff83e244, + 0xff8446f7, 0xff84b06e, 0xff851ea6, 0xff85919b, + 0xff860949, 0xff8685aa, 0xff8706ba, 0xff878c74, + 0xff8816d3, 0xff88a5d1, 0xff89396a, 0xff89d196, + 0xff8a6e51, 0xff8b0f94, 0xff8bb55a, 0xff8c5f9b, + 0xff8d0e51, 0xff8dc176, 0xff8e7902, 0xff8f34ef, + 0xff8ff535, 0xff90b9cc, 0xff9182ae, 0xff924fd3, + 0xff932132, 0xff93f6c3, 0xff94d07f, 0xff95ae5d, + 0xff969054, 0xff97765b, 0xff98606a, 0xff994e78, + 0xff9a407c, 0xff9b366b, 0xff9c303e, 0xff9d2de9, + 0xff9e2f64, 0xff9f34a4, 0xffa03da0, 0xffa14a4c, + 0xffa25aa0, 0xffa36e8f, 0xffa48610, 0xffa5a118, + 0xffa6bf9c, 0xffa7e191, 0xffa906ec, 0xffaa2fa0, + 0xffab5ba4, 0xffac8aeb, 0xffadbd6a, 0xffaef315, + 0xffb02bdf, 0xffb167be, 0xffb2a6a4, 0xffb3e886, + 0xffb52d56, 0xffb67509, 0xffb7bf92, 0xffb90ce4, + 0xffba5cf2, 0xffbbafb0, 0xffbd050f, 0xffbe5d04, + 0xffbfb780, 0xffc11477, 0xffc273db, 0xffc3d59f, + 0xffc539b4, 0xffc6a00d, 0xffc8089d, 0xffc97355, + 0xffcae027, 0xffcc4f05, 0xffcdbfe2, 0xffcf32af, + 0xffd0a75d, 0xffd21ddf, 0xffd39625, 0xffd51022, + 0xffd68bc7, 0xffd80904, 0xffd987cd, 0xffdb0810, + 0xffdc89c1, 0xffde0cd0, 0xffdf912d, 0xffe116cb, + 0xffe29d9a, 0xffe4258b, 0xffe5ae8f, 0xffe73896, + 0xffe8c392, 0xffea4f74, 0xffebdc2b, 0xffed69aa, + 0xffeef7df, 0xfff086bd, 0xfff21634, 0xfff3a634, + 0xfff536ad, 0xfff6c792, 0xfff858d1, 0xfff9ea5b, + 0xfffb7c22, 0xfffd0e16, 0xfffea026, 0xffffcdbc, + 0xfffe3ba0, 0xfffca995, 0xfffb17ac, 0xfff985f3, + 0xfff7f479, 0xfff6634f, 0xfff4d284, 0xfff34228, + 0xfff1b249, 0xfff022f7, 0xffee9442, 0xffed0638, + 0xffeb78ea, 0xffe9ec67, 0xffe860bd, 0xffe6d5fd, + 0xffe54c35, 0xffe3c374, 0xffe23bcb, 0xffe0b547, + 0xffdf2ff7, 0xffddabec, 0xffdc2933, 0xffdaa7dd, + 0xffd927f6, 0xffd7a98f, 0xffd62cb7, 0xffd4b17b, + 0xffd337ea, 0xffd1c013, 0xffd04a05, 0xffced5ce, + 0xffcd637c, 0xffcbf31d, 0xffca84c1, 0xffc91874, + 0xffc7ae45, 0xffc64641, 0xffc4e078, 0xffc37cf6, + 0xffc21bc9, 0xffc0bcff, 0xffbf60a5, 0xffbe06c9, + 0xffbcaf79, 0xffbb5ac0, 0xffba08ae, 0xffb8b94d, + 0xffb76cac, 0xffb622d8, 0xffb4dbdc, 0xffb397c6, + 0xffb256a2, 0xffb1187d, 0xffafdd62, 0xffaea55f, + 0xffad707e, 0xffac3ecc, 0xffab1054, 0xffa9e523, + 0xffa8bd44, 0xffa798c2, 0xffa677a8, 0xffa55a02, + 0xffa43fdb, 0xffa3293d, 0xffa21634, 0xffa106c9, + 0xff9ffb08, 0xff9ef2fa, 0xff9deeab, 0xff9cee23, + 0xff9bf16c, 0xff9af892, 0xff9a039c, 0xff991295, + 0xff982586, 0xff973c78, 0xff965774, 0xff957683, + 0xff9499ad, 0xff93c0fb, 0xff92ec75, 0xff921c24, + 0xff91500f, 0xff90883f, 0xff8fc4bb, 0xff8f058b, + 0xff8e4ab6, 0xff8d9443, 0xff8ce239, 0xff8c349f, + 0xff8b8b7d, 0xff8ae6d7, 0xff8a46b5, 0xff89ab1e, + 0xff891416, 0xff8881a3, 0xff87f3cc, 0xff876a96, + 0xff86e606, 0xff866621, 0xff85eaed, 0xff85746d, + 0xff8502a6, 0xff84959e, 0xff842d57, 0xff83c9d7, + 0xff836b20, 0xff831138, 0xff82bc20, 0xff826bdc, + 0xff822070, 0xff81d9de, 0xff819829, 0xff815b54, + 0xff812360, 0xff80f051, 0xff80c228, 0xff8098e6, + 0xff80748e, 0xff805521, 0xff803a9f, 0xff80250b, + 0xff801464, 0xff8008ad, 0xff8001e4, 0xff800027, + 0xff800c7e, 0xff802c8f, 0xff806056, 0xff80a7cb, + 0xff8102e4, 0xff817191, 0xff81f3c3, 0xff828964, + 0xff83325f, 0xff83ee98, 0xff84bdf3, 0xff85a04f, + 0xff86958b, 0xff879d7f, 0xff88b804, 0xff89e4ee, + 0xff8b240e, 0xff8c7533, 0xff8dd82a, 0xff8f4cbb, + 0xff90d2ad, 0xff9269c4, 0xff9411c1, 0xff95ca62, + 0xff979365, 0xff996c81, 0xff9b5570, 0xff9d4de4, + 0xff9f5590, 0xffa16c24, 0xffa3914e, 0xffa5c4b8, + 0xffa8060d, 0xffaa54f3, 0xffacb10e, 0xffaf1a03, + 0xffb18f70, 0xffb410f7, 0xffb69e33, 0xffb936c0, + 0xffbbda37, 0xffbe8830, 0xffc14042, 0xffc40201, + 0xffc6cd00, 0xffc9a0d2, 0xffcc7d05, 0xffcf612b, + 0xffd24ccf, 0xffd53f80, 0xffd838c8, 0xffdb3833, + 0xffde3d49, 0xffe14795, 0xffe4569d, 0xffe769e9, + 0xffea80ff, 0xffed9b67, 0xfff0b8a4, 0xfff3d83c, + 0xfff6f9b5, 0xfffa1c91, 0xfffd4056, 0xffff9b78, + 0xfffc7756, 0xfff953c0, 0xfff63130, 0xfff31025, + 0xffeff117, 0xffecd484, 0xffe9bae5, 0xffe6a4b6, + 0xffe39270, 0xffe0848b, 0xffdd7b82, 0xffda77cb, + 0xffd779de, 0xffd48231, 0xffd19138, 0xffcea769, + 0xffcbc535, 0xffc8eb10, 0xffc61969, 0xffc350af, + 0xffc09151, 0xffbddbbb, 0xffbb3059, 0xffb88f92, + 0xffb5f9d0, 0xffb36f78, 0xffb0f0ef, 0xffae7e96, + 0xffac18cf, 0xffa9bff9, 0xffa7746f, 0xffa5368c, + 0xffa306aa, 0xffa0e51e, 0xff9ed23c, 0xff9cce56, + 0xff9ad9bc, 0xff98f4bc, 0xff971f9f, 0xff955aae, + 0xff93a62f, 0xff920266, 0xff906f92, 0xff8eedf3, + 0xff8d7dc4, 0xff8c1f3c, 0xff8ad294, 0xff8997fd, + 0xff886fa8, 0xff8759c3, 0xff865679, 0xff8565f2, + 0xff848852, 0xff83bdbd, 0xff830651, 0xff82622b, + 0xff81d163, 0xff815411, 0xff80ea47, 0xff809416, + 0xff80518b, 0xff8022b1, 0xff80078e, 0x00000475, + 0x000007fe, 0x00000c02, 0x000010a3, 0x000015f5, + 0x00001c08, 0x000022ed, 0x00002ab5, 0x00003371, + 0x00003d32, 0x0000480a, 0x0000540d, 0x0000614b, + 0x00006fda, 0x00007fcd, 0x00009138, 0x0000a431, + 0x0000b8cc, 0x0000cf1f, 0x0000e741, 0x00010148, + 0x00011d4b, 0x00013b61, 0x00015ba2, 0x00017e25, + 0x0001a302, 0x0001ca51, 0x0001f42c, 0x000220a9, + 0x00024fe2, 0x000281f0, 0x0002b6ea, 0x0002eee9, + 0x00032a07, 0x0003685a, 0x0003a9fc, 0x0003ef04, + 0x0004378a, 0x000483a5, 0x0004d36d, 0x000526f7, + 0x00057e5b, 0x0005d9ae, 0x00063904, 0x00069c74, + 0x00070410, 0x00076feb, 0x0007e01a, 0x000854ac, + 0x0008cdb3, 0x00094b40, 0x0009cd61, 0x000a5425, + 0x000adf98, 0x000b6fc8, 0x000c04bf, 0x000c9e87, + 0x000d3d2a, 0x000de0ae, 0x000e891a, 0x000f3674, + 0x000fe8c0, 0x00109fff, 0x00115c34, 0x00121d5d, + 0x0012e37b, 0x0013ae89, 0x00147e84, 0x00155366, + 0x00162d27, 0x00170bbf, 0x0017ef23, 0x0018d748, + 0x0019c421, 0x001ab59f, 0x001babb2, 0x001ca648, + 0x001da54f, 0x001ea8b0, 0x001fb058, 0x0020bc2d, + 0x0021cc18, 0x0022dffd, 0x0023f7c2, 0x00251348, + 0x00263272, 0x00275520, 0x00287b31, 0x0029a482, + 0x002ad0f1, 0x002c0059, 0x002d3294, 0x002e677c, + 0x002f9ee8, 0x0030d8b1, 0x003214ac, 0x003352b0, + 0x00349290, 0x0035d422, 0x00371738, 0x00385ba5, + 0x0039a13b, 0x003ae7cc, 0x003c2f2a, 0x003d7725, + 0x003ebf8d, 0x00400834, 0x004150e9, 0x0042997d, + 0x0043e1c0, 0x00452981, 0x00467092, 0x0047b6c3, + 0x0048fbe3, 0x004a3fc6, 0x004b823b, 0x004cc316, + 0x004e0228, 0x004f3f45, 0x00507a40, 0x0051b2ef, + 0x0052e925, 0x00541cba, 0x00554d85, 0x00567b5e, + 0x0057a61d, 0x0058cd9e, 0x0059f1bb, 0x005b1252, + 0x005c2f3f, 0x005d4863, 0x005e5d9d, 0x005f6ed0, + 0x00607bde, 0x006184ad, 0x00628923, 0x00638927, + 0x006484a3, 0x00657b81, 0x00666daf, 0x00675b19, + 0x006843b1, 0x00692767, 0x006a062d, 0x006adff9, + 0x006bb4c2, 0x006c847d, 0x006d4f27, 0x006e14b8, + 0x006ed52f, 0x006f9089, 0x007046c6, 0x0070f7e9, + 0x0071a3f3, 0x00724aea, 0x0072ecd3, 0x007389b6, + 0x0074219d, 0x0074b490, 0x0075429b, 0x0075cbcc, + 0x00765031, 0x0076cfd8, 0x00774ad3, 0x0077c132, + 0x00783308, 0x0078a068, 0x00790968, 0x00796e1c, + 0x0079ce9a, 0x007a2af9, 0x007a8350, 0x007ad7b8, + 0x007b2849, 0x007b751d, 0x007bbe4c, 0x007c03f1, + 0x007c4625, 0x007c8504, 0x007cc0a8, 0x007cf92c, + 0x007d2eaa, 0x007d613e, 0x007d9101, 0x007dbe10, + 0x007de883, 0x007e1076, 0x007e3603, 0x007e5943, + 0x007e7a4f, 0x007e9942, 0x007eb633, 0x007ed13a, + 0x007eea6f, 0x007f01ea, 0x007f17c0, 0x007f2c08, + 0x007f3ed7, 0x007f5043, 0x007f605e, 0x007f6f3c, + 0x007f7cf1, 0x007f898e, 0x007f9525, 0x007f9fc6, + 0x007fa982, 0x007fb268, 0x007fba86, 0x007fc1eb, + 0x007fc8a4, 0x007fcebe, 0x007fd443, 0x007fd941, + 0x007fddc2, 0x007fe1cf, 0x007fe572, 0x007fe8b4, + 0x007feb9e, 0x007fee36, 0x007ff086, 0x007ff293, + 0x007ff463, 0x007ff5fd, 0x007ff765, 0x007ff8a1, + 0x007ff9b6, 0x007ffaa7, 0x007ffb79, 0x007ffc2f, + 0x007ffccb, 0x007ffd52, 0x007ffdc6, 0x007ffe28, + 0x007ffe7b, 0x007ffec2, 0x007ffefd, 0x007fff2f, + 0x007fff58, 0x007fff7b, 0x007fff97, 0x007fffae, + 0x007fffc0, 0x007fffcf, 0x007fffdb, 0x007fffe4, + 0x007fffec, 0x007ffff1, 0x007ffff6, 0x007ffff9, + 0x007ffffb, 0x007ffffd, 0x007ffffe, 0x007fffff, + 0x007fffff, 0x007fffff, 0x007fffff, 0xff800000, + 0x00000000, 0xffa57d86, 0x005a827a, 0xff89be51, + 0x0030fbc5, 0xffcf043b, 0x007641af, 0xff8275a1, + 0x0018f8b8, 0xffb8e313, 0x006a6d99, 0xff959267, + 0x00471ced, 0xffe70748, 0x007d8a5f, 0xff809dc9, + 0x000c8bd3, 0xffaecc33, 0x0062f202, 0xff8f1d34, + 0x003c56ba, 0xffdad7f4, 0x007a7d05, 0xff8582fb, + 0x0025280c, 0xffc3a946, 0x0070e2cc, 0xff9d0dfe, + 0x005133cd, 0xfff3742d, 0x007f6237, 0xff802778, + 0x000647d9, 0xffaa0a5b, 0x005ed77d, 0xff8c4a14, + 0x0036ba20, 0xffd4e0cb, 0x00788484, 0xff83d604, + 0x001f19f9, 0xffbe31e2, 0x006dca0d, 0xff99307f, + 0x004c3fe0, 0xffed37f0, 0x007e9d56, 0xff8162aa, + 0x0012c810, 0xffb3c020, 0x0066cf81, 0xff9235f3, + 0x0041ce1e, 0xffe0e607, 0x007c29fc, 0xff877b7c, + 0x002b1f35, 0xffc945e0, 0x0073b5ec, 0xffa12883, + 0x0055f5a5, 0xfff9b827, 0x007fd888, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, +}; + +static u32 AC3I2SUcode1fe000[] = { + 0x00000000, 0x03020102, 0x05040403, 0x00400040, + 0x00500050, 0x00600060, 0x00700070, 0x00800080, + 0x00a000a0, 0x00c000c0, 0x00e000e0, 0x01000100, + 0x01400140, 0x01800180, 0x01c001c0, 0x02000200, + 0x02800280, 0x03000300, 0x03800380, 0x04000400, + 0x04800480, 0x05000500, 0x00460045, 0x00580057, + 0x00690068, 0x007a0079, 0x008c008b, 0x00af00ae, + 0x00d100d0, 0x00f400f3, 0x01170116, 0x015d015c, + 0x01a201a1, 0x01e801e7, 0x022e022d, 0x02b902b8, + 0x03440343, 0x03d003cf, 0x045b045a, 0x04e604e5, + 0x05720571, 0x00600060, 0x00780078, 0x00900090, + 0x00a800a8, 0x00c000c0, 0x00f000f0, 0x01200120, + 0x01500150, 0x01800180, 0x01e001e0, 0x02400240, + 0x02a002a0, 0x03000300, 0x03c003c0, 0x04800480, + 0x05400540, 0x06000600, 0x06c006c0, 0x07800780, + 0x7b67533f, 0x1513110f, 0x04d80540, 0x04100478, + 0x07000000, 0x0b000900, 0x02b002f0, 0x02300270, + 0x017001f0, 0xf80000f0, 0x01000080, 0x02000180, + 0x03000280, 0x04000380, 0x2725231f, 0x2c2b2a29, + 0x2e2e2d2d, 0x30302f2f, 0x04030201, 0x08070605, + 0x0c0b0a09, 0x100f0e0d, 0x14131211, 0x18171615, + 0x1c1b1a19, 0x2825221f, 0x37312e2b, 0x4f49433d, + 0x796d6155, 0xcdb59d85, 0x0000fde5, 0x3d3e3f40, + 0x393a3b3c, 0x35363738, 0x32333434, 0x2f2f3031, + 0x2c2c2d2e, 0x29292a2b, 0x26262728, 0x23242425, + 0x21212223, 0x1e1f2020, 0x1c1d1d1e, 0x1a1b1b1c, + 0x1819191a, 0x16171718, 0x15151516, 0x13131414, + 0x12121213, 0x10111111, 0x0f0f1010, 0x0e0e0e0f, + 0x0d0d0d0d, 0x0c0c0c0c, 0x0b0b0b0b, 0x0a0a0a0a, + 0x0909090a, 0x08080909, 0x08080808, 0x07070707, + 0x06060707, 0x06060606, 0x05050606, 0x05050505, + 0x04040505, 0x04040404, 0x04040404, 0x03030304, + 0x03030303, 0x03030303, 0x02030303, 0x02020202, + 0x02020202, 0x02020202, 0x02020202, 0x01010202, + 0x01010101, 0x01010101, 0x01010101, 0x01010101, + 0x01010101, 0x01010101, 0x01010101, 0x00000101, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x04d004d0, + 0x04000440, 0x03c003e0, 0x03b003b0, 0x03a003a0, + 0x03a003a0, 0x039003a0, 0x03900390, 0x03800380, + 0x03700370, 0x03600360, 0x03500350, 0x03400340, + 0x03200330, 0x03000310, 0x02f002f0, 0x02f002f0, + 0x03100300, 0x03900340, 0x042003e0, 0x04900460, + 0x046004a0, 0x04400440, 0x08000520, 0x08400840, + 0x04f004f0, 0x04100460, 0x03d003e0, 0x03b003c0, + 0x03a003b0, 0x03a003a0, 0x03a003a0, 0x03900390, + 0x03800390, 0x03800380, 0x03700370, 0x03600360, + 0x03500350, 0x03400340, 0x03100320, 0x02f00300, + 0x02f002f0, 0x030002f0, 0x03500320, 0x03e00390, + 0x04500420, 0x049004a0, 0x04400460, 0x06300480, + 0x08400840, 0x05800580, 0x045004b0, 0x03f00420, + 0x03d003e0, 0x03b003c0, 0x03b003b0, 0x03a003a0, + 0x03a003a0, 0x03a003a0, 0x03a003a0, 0x03900390, + 0x03900390, 0x03800380, 0x03700380, 0x03500360, + 0x03300340, 0x03100320, 0x02f00300, 0x02f002f0, + 0x03100300, 0x03500330, 0x041003c0, 0x04a00470, + 0x04400460, 0x04e00450, 0xffaaaaab, 0x00000000, + 0x00555555, 0xff99999a, 0xffcccccd, 0x00000000, + 0x00333333, 0x00666666, 0xff924925, 0xffb6db6e, + 0xffdb6db7, 0x00000000, 0x00249249, 0x00492492, + 0x006db6db, 0xff8ba2e9, 0xffa2e8ba, 0xffba2e8c, + 0xffd1745d, 0xffe8ba2f, 0x00000000, 0x001745d1, + 0x002e8ba3, 0x0045d174, 0x005d1746, 0x00745d17, + 0xff888889, 0xff99999a, 0xffaaaaab, 0xffbbbbbc, + 0xffcccccd, 0xffddddde, 0xffeeeeef, 0x00000000, + 0x00111111, 0x00222222, 0x00333333, 0x00444444, + 0x00555555, 0x00666666, 0x00777777, 0x08070605, + 0x0c0b0a09, 0x10100e0e, 0x00000010, 0x00000000, + 0x00000010, 0x00000020, 0x00000100, 0x00000110, + 0x00000120, 0x00000200, 0x00000210, 0x00000220, + 0x00001000, 0x00001010, 0x00001020, 0x00001100, + 0x00001110, 0x00001120, 0x00001200, 0x00001210, + 0x00001220, 0x00002000, 0x00002010, 0x00002020, + 0x00002100, 0x00002110, 0x00002120, 0x00002200, + 0x00002210, 0x00002220, 0x00000000, 0x00000010, + 0x00000020, 0x00000030, 0x00000040, 0x00000100, + 0x00000110, 0x00000120, 0x00000130, 0x00000140, + 0x00000200, 0x00000210, 0x00000220, 0x00000230, + 0x00000240, 0x00000300, 0x00000310, 0x00000320, + 0x00000330, 0x00000340, 0x00000400, 0x00000410, + 0x00000420, 0x00000430, 0x00000440, 0x00001000, + 0x00001010, 0x00001020, 0x00001030, 0x00001040, + 0x00001100, 0x00001110, 0x00001120, 0x00001130, + 0x00001140, 0x00001200, 0x00001210, 0x00001220, + 0x00001230, 0x00001240, 0x00001300, 0x00001310, + 0x00001320, 0x00001330, 0x00001340, 0x00001400, + 0x00001410, 0x00001420, 0x00001430, 0x00001440, + 0x00002000, 0x00002010, 0x00002020, 0x00002030, + 0x00002040, 0x00002100, 0x00002110, 0x00002120, + 0x00002130, 0x00002140, 0x00002200, 0x00002210, + 0x00002220, 0x00002230, 0x00002240, 0x00002300, + 0x00002310, 0x00002320, 0x00002330, 0x00002340, + 0x00002400, 0x00002410, 0x00002420, 0x00002430, + 0x00002440, 0x00003000, 0x00003010, 0x00003020, + 0x00003030, 0x00003040, 0x00003100, 0x00003110, + 0x00003120, 0x00003130, 0x00003140, 0x00003200, + 0x00003210, 0x00003220, 0x00003230, 0x00003240, + 0x00003300, 0x00003310, 0x00003320, 0x00003330, + 0x00003340, 0x00003400, 0x00003410, 0x00003420, + 0x00003430, 0x00003440, 0x00004000, 0x00004010, + 0x00004020, 0x00004030, 0x00004040, 0x00004100, + 0x00004110, 0x00004120, 0x00004130, 0x00004140, + 0x00004200, 0x00004210, 0x00004220, 0x00004230, + 0x00004240, 0x00004300, 0x00004310, 0x00004320, + 0x00004330, 0x00004340, 0x00004400, 0x00004410, + 0x00004420, 0x00004430, 0x00004440, 0x00000000, + 0x00000100, 0x00000200, 0x00000300, 0x00000400, + 0x00000500, 0x00000600, 0x00000700, 0x00000800, + 0x00000900, 0x00000a00, 0x00001000, 0x00001100, + 0x00001200, 0x00001300, 0x00001400, 0x00001500, + 0x00001600, 0x00001700, 0x00001800, 0x00001900, + 0x00001a00, 0x00002000, 0x00002100, 0x00002200, + 0x00002300, 0x00002400, 0x00002500, 0x00002600, + 0x00002700, 0x00002800, 0x00002900, 0x00002a00, + 0x00003000, 0x00003100, 0x00003200, 0x00003300, + 0x00003400, 0x00003500, 0x00003600, 0x00003700, + 0x00003800, 0x00003900, 0x00003a00, 0x00004000, + 0x00004100, 0x00004200, 0x00004300, 0x00004400, + 0x00004500, 0x00004600, 0x00004700, 0x00004800, + 0x00004900, 0x00004a00, 0x00005000, 0x00005100, + 0x00005200, 0x00005300, 0x00005400, 0x00005500, + 0x00005600, 0x00005700, 0x00005800, 0x00005900, + 0x00005a00, 0x00006000, 0x00006100, 0x00006200, + 0x00006300, 0x00006400, 0x00006500, 0x00006600, + 0x00006700, 0x00006800, 0x00006900, 0x00006a00, + 0x00007000, 0x00007100, 0x00007200, 0x00007300, + 0x00007400, 0x00007500, 0x00007600, 0x00007700, + 0x00007800, 0x00007900, 0x00007a00, 0x00008000, + 0x00008100, 0x00008200, 0x00008300, 0x00008400, + 0x00008500, 0x00008600, 0x00008700, 0x00008800, + 0x00008900, 0x00008a00, 0x00009000, 0x00009100, + 0x00009200, 0x00009300, 0x00009400, 0x00009500, + 0x00009600, 0x00009700, 0x00009800, 0x00009900, + 0x00009a00, 0x0000a000, 0x0000a100, 0x0000a200, + 0x0000a300, 0x0000a400, 0x0000a500, 0x0000a600, + 0x0000a700, 0x0000a800, 0x0000a900, 0x0000aa00, + 0xff800000, 0xff800000, 0xffb82995, 0xffaf5d75, + 0xffa57d87, 0xff9a6806, 0xff8df708, 0xff800000, + 0xffb82995, 0xffaf5d75, 0xffa57d87, 0xff9a6806, + 0xff8df708, 0xff800000, 0xffb82995, 0xffaf5d75, + 0xffa57d87, 0xff9a6806, 0xff8df708, 0xff800000, + 0xffb82995, 0xffaf5d75, 0xffa57d87, 0xff9a6806, + 0xff8df708, 0xff800000, 0xffb82995, 0xffaf5d75, + 0xffa57d87, 0xff9a6806, 0xff8df708, 0xff800000, + 0xfffb0000, 0xfffcfffc, 0xfffcfffc, 0xfffcfffc, + 0xfffdfffd, 0xfffdfffd, 0xfffdfffd, 0xfffefffe, + 0xfffefffe, 0xfffefffe, 0xffffffff, 0xffffffff, + 0xffffffff, 0x00000000, 0x00000000, 0x00000000, + 0x80050000, 0x000a800f, 0x001e801b, 0x80110014, + 0x00368033, 0x8039003c, 0x802d0028, 0x00228027, + 0x00668063, 0x8069006c, 0x807d0078, 0x00728077, + 0x80550050, 0x005a805f, 0x004e804b, 0x80410044, + 0x00c680c3, 0x80c900cc, 0x80dd00d8, 0x00d280d7, + 0x80f500f0, 0x00fa80ff, 0x00ee80eb, 0x80e100e4, + 0x80a500a0, 0x00aa80af, 0x00be80bb, 0x80b100b4, + 0x00968093, 0x8099009c, 0x808d0088, 0x00828087, + 0x01868183, 0x8189018c, 0x819d0198, 0x01928197, + 0x81b501b0, 0x01ba81bf, 0x01ae81ab, 0x81a101a4, + 0x81e501e0, 0x01ea81ef, 0x01fe81fb, 0x81f101f4, + 0x01d681d3, 0x81d901dc, 0x81cd01c8, 0x01c281c7, + 0x81450140, 0x014a814f, 0x015e815b, 0x81510154, + 0x01768173, 0x8179017c, 0x816d0168, 0x01628167, + 0x01268123, 0x8129012c, 0x813d0138, 0x01328137, + 0x81150110, 0x011a811f, 0x010e810b, 0x81010104, + 0x03068303, 0x8309030c, 0x831d0318, 0x03128317, + 0x83350330, 0x033a833f, 0x032e832b, 0x83210324, + 0x83650360, 0x036a836f, 0x037e837b, 0x83710374, + 0x03568353, 0x8359035c, 0x834d0348, 0x03428347, + 0x83c503c0, 0x03ca83cf, 0x03de83db, 0x83d103d4, + 0x03f683f3, 0x83f903fc, 0x83ed03e8, 0x03e283e7, + 0x03a683a3, 0x83a903ac, 0x83bd03b8, 0x03b283b7, + 0x83950390, 0x039a839f, 0x038e838b, 0x83810384, + 0x82850280, 0x028a828f, 0x029e829b, 0x82910294, + 0x02b682b3, 0x82b902bc, 0x82ad02a8, 0x02a282a7, + 0x02e682e3, 0x82e902ec, 0x82fd02f8, 0x02f282f7, + 0x82d502d0, 0x02da82df, 0x02ce82cb, 0x82c102c4, + 0x02468243, 0x8249024c, 0x825d0258, 0x02528257, + 0x82750270, 0x027a827f, 0x026e826b, 0x82610264, + 0x82250220, 0x022a822f, 0x023e823b, 0x82310234, + 0x02168213, 0x8219021c, 0x820d0208, 0x02028207, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000001, 0x00000001, 0x00000002, 0x00000002, + 0x00000000, 0xff800000, 0xffa57d86, 0xffa57d86, + 0xffcf043b, 0xff89be51, 0xff89be51, 0xffcf043b, + 0xffe70748, 0xff8275a1, 0xff959267, 0xffb8e313, + 0xffb8e313, 0xff959267, 0xff8275a1, 0xffe70748, + 0xfff3742d, 0xff809dc9, 0xff9d0dfe, 0xffaecc33, + 0xffc3a946, 0xff8f1d34, 0xff8582fb, 0xffdad7f4, + 0xffdad7f4, 0xff8582fb, 0xff8f1d34, 0xffc3a946, + 0xffaecc33, 0xff9d0dfe, 0xff809dc9, 0xfff3742d, + 0xfff9b827, 0xff802778, 0xffa12883, 0xffaa0a5b, + 0xffc945e0, 0xff8c4a14, 0xff877b7c, 0xffd4e0cb, + 0xffe0e607, 0xff83d604, 0xff9235f3, 0xffbe31e2, + 0xffb3c020, 0xff99307f, 0xff8162aa, 0xffed37f0, + 0xffed37f0, 0xff8162aa, 0xff99307f, 0xffb3c020, + 0xffbe31e2, 0xff9235f3, 0xff83d604, 0xffe0e607, + 0xffd4e0cb, 0xff877b7c, 0xff8c4a14, 0xffc945e0, + 0xffaa0a5b, 0xffa12883, 0xff802778, 0xfff9b827, + 0xcbcecdc4, 0xcfcac9c8, 0xc3c6c5cc, 0xc7c2c1c0, + 0x1b1e1d14, 0x1f1a1918, 0x1316151c, 0x17121110, + 0x2b2e2d24, 0x2f2a2928, 0x2326252c, 0x27222120, + 0x3b3e3d34, 0x3f3a3938, 0x3336353c, 0x37323130, + 0x0b0e0d04, 0x0f0a0908, 0x0306050c, 0x07020100, + 0xdbdeddd4, 0xdfdad9d8, 0xd3d6d5dc, 0xd7d2d1d0, + 0xebeeede4, 0xefeae9e8, 0xe3e6e5ec, 0xe7e2e1e0, + 0xfbfefdf4, 0xfffaf9f8, 0xf3f6f5fc, 0xf7f2f1f0, + 0x4b4e4d44, 0x4f4a4948, 0x4346454c, 0x47424140, + 0x9b9e9d94, 0x9f9a9998, 0x9396959c, 0x97929190, + 0xabaeada4, 0xafaaa9a8, 0xa3a6a5ac, 0xa7a2a1a0, + 0xbbbebdb4, 0xbfbab9b8, 0xb3b6b5bc, 0xb7b2b1b0, + 0x8b8e8d84, 0x8f8a8988, 0x8386858c, 0x87828180, + 0x5b5e5d54, 0x5f5a5958, 0x5356555c, 0x57525150, + 0x6b6e6d64, 0x6f6a6968, 0x6366656c, 0x67626160, + 0x7b7e7d74, 0x7f7a7978, 0x7376757c, 0x77727170, + 0x341424c4, 0x3e1e2ece, 0x3d1d2dcd, 0x3b1b2bcb, + 0xb494a444, 0xbe9eae4e, 0xbd9dad4d, 0xbb9bab4b, + 0xf4d4e404, 0xfedeee0e, 0xfddded0d, 0xfbdbeb0b, + 0x74546484, 0x7e5e6e8e, 0x7d5d6d8d, 0x7b5b6b8b, + 0x3c1c2ccc, 0x361626c6, 0x351525c5, 0x331323c3, + 0xbc9cac4c, 0xb696a646, 0xb595a545, 0xb393a343, + 0xfcdcec0c, 0xf6d6e606, 0xf5d5e505, 0xf3d3e303, + 0x7c5c6c8c, 0x76566686, 0x75556585, 0x73536383, + 0x381828c8, 0x3a1a2aca, 0x391929c9, 0x3f1f2fcf, + 0xb898a848, 0xba9aaa4a, 0xb999a949, 0xbf9faf4f, + 0xf8d8e808, 0xfadaea0a, 0xf9d9e909, 0xffdfef0f, + 0x78586888, 0x7a5a6a8a, 0x79596989, 0x7f5f6f8f, + 0x301020c0, 0x321222c2, 0x311121c1, 0x371727c7, + 0xb090a040, 0xb292a242, 0xb191a141, 0xb797a747, + 0xf0d0e000, 0xf2d2e202, 0xf1d1e101, 0xf7d7e707, + 0x70506080, 0x72526282, 0x71516181, 0x77576787, + 0x05040100, 0x15141110, 0x25242120, 0x35343130, + 0x85848180, 0x95949190, 0xa5a4a1a0, 0xb5b4b1b0, + 0xc0408000, 0xe060a020, 0xd0509010, 0xf070b030, + 0xc8488808, 0xe868a828, 0xd8589818, 0xf878b838, + 0xc4448404, 0xe464a424, 0xd4549414, 0xf474b434, + 0xcc4c8c0c, 0xec6cac2c, 0xdc5c9c1c, 0xfc7cbc3c, + 0xc2428202, 0xe262a222, 0xd2529212, 0xf272b232, + 0xca4a8a0a, 0xea6aaa2a, 0xda5a9a1a, 0xfa7aba3a, + 0xc6468606, 0xe666a626, 0xd6569616, 0xf676b636, + 0xce4e8e0e, 0xee6eae2e, 0xde5e9e1e, 0xfe7ebe3e, + 0xc1418101, 0xe161a121, 0xd1519111, 0xf171b131, + 0xc9498909, 0xe969a929, 0xd9599919, 0xf979b939, + 0xc5458505, 0xe565a525, 0xd5559515, 0xf575b535, + 0xcd4d8d0d, 0xed6dad2d, 0xdd5d9d1d, 0xfd7dbd3d, + 0xc3438303, 0xe363a323, 0xd3539313, 0xf373b333, + 0xcb4b8b0b, 0xeb6bab2b, 0xdb5b9b1b, 0xfb7bbb3b, + 0xc7478707, 0xe767a727, 0xd7579717, 0xf777b737, + 0xcf4f8f0f, 0xef6faf2f, 0xdf5f9f1f, 0xff7fbf3f, + 0x1045a3e2, 0x000000f4, 0x263b7333, 0x766b2363, + 0x2b367e3e, 0x7b662e6e, 0x06db93d3, 0x964b0343, + 0x0bd69ede, 0x9b460e4e, 0x825f1757, 0x12cf87c7, + 0x8f521a5a, 0x1fc28aca, 0x00d199d9, 0x90410949, + 0x01d098d8, 0x91400848, 0x24357d3d, 0x74652d6d, + 0x25347c3c, 0x75642c6c, 0x04d59ddd, 0x94450d4d, + 0x05d49cdc, 0x95440c4c, 0x80511959, 0x10c189c9, + 0x81501858, 0x11c088c8, 0x02df97d7, 0x924f0747, + 0x0fd29ada, 0x9f420a4a, 0x865b1353, 0x16cb83c3, + 0x8b561e5e, 0x1bc68ece, 0xa6bbf3b3, 0xf6eba3e3, + 0xabb6febe, 0xfbe6aeee, 0x223f7737, 0x726f2767, + 0x2f327a3a, 0x7f622a6a, 0xa0b1f9b9, 0xf0e1a9e9, + 0xa1b0f8b8, 0xf1e0a8e8, 0x84551d5d, 0x14c58dcd, + 0x85541c5c, 0x15c48ccc, 0xa4b5fdbd, 0xf4e5aded, + 0xa5b4fcbc, 0xf5e4acec, 0x20317939, 0x70612969, + 0x21307838, 0x71602868, 0xa2bff7b7, 0xf2efa7e7, + 0xafb2faba, 0xffe2aaea, 0x00000000, 0x00000000, +}; + +static u32 AC3I2SUcode1fff80[] = { + 0x0000240f, 0x007fffff, 0x007fffff, 0x00000003, + 0xff000000, 0xff000000, 0xff000000, 0xff000000, + 0xff000000, 0x00000000, 0x00000000, 0x00000000, + 0x007fffff, 0x00000000, 0x00000000, 0x00000000, +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/lpcm.h linux.20pre5-ac2/drivers/media/video/ls220/lpcm.h --- linux.20pre5/drivers/media/video/ls220/lpcm.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/lpcm.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,818 @@ +static u32 PCMUcode1f1800[] = { + 0xb500000f, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xb50001f7, 0x00000000, 0x00000000, 0x00000000, + 0x820f001f, 0x802f001f, 0x029f9014, 0x829efef0, + 0x8286000f, 0x02bf0054, 0x82bcfef4, 0x82a6000e, + 0x80074000, 0x001f6193, 0x8013001f, 0x9020c000, + 0x003fb006, 0x803effe8, 0x803effec, 0x9020fa00, + 0x803effd0, 0x803effdc, 0x803effd8, 0x9020fe00, + 0x803effd4, 0x90400000, 0x804600a2, 0x90421800, + 0x804600a3, 0x80132000, 0x98000040, 0x800600a6, + 0x80050080, 0x98000002, 0x80060080, 0x80070001, + 0x001f2013, 0x80070000, 0x001f23f9, 0x801e4b0c, + 0x001f210c, 0x80070001, 0x001f2324, 0x80070800, + 0x001f600f, 0x001fb0cb, 0x001fb010, 0x801efff0, + 0x98004000, 0x001f600e, 0x83e40121, 0x80070000, + 0x801e4b14, 0x800500a0, 0xb0000001, 0xb4000009, + 0x80070001, 0x800600a0, 0x80050080, 0x98000020, + 0x80060080, 0x9400ffdf, 0x80060080, 0x80070000, + 0x800600a0, 0x80074000, 0x801e4b04, 0x81df0004, + 0x801bfff0, 0x00000000, 0x940000ff, 0xb0000000, + 0xb4200033, 0x003f400e, 0x94010010, 0xb0000000, + 0xb400fff7, 0x003f0013, 0xb0010001, 0xb420001f, + 0x803bffe8, 0x801bffec, 0x805b4b04, 0x00000000, + 0x3001b800, 0xb4600001, 0x9021a000, 0x0421b800, + 0x3001b802, 0xb460000d, 0x80050086, 0x005f9044, + 0x0420b802, 0xb00101e0, 0xb4a0ffe5, 0x001fb010, + 0x001f010c, 0xb0000001, 0xb400ffe1, 0x80070001, + 0x001f210c, 0x83e400ee, 0xb500ffdd, 0x8007001f, + 0x94000003, 0x5810b800, 0x83e719ec, 0x1bffb800, + 0x003f9008, 0x1821b800, 0x00ffb801, 0x80270000, + 0x003f2013, 0x8007001f, 0x94000003, 0x5810b800, + 0x83671a14, 0x1b7bb800, 0x003f9009, 0x1821b800, + 0x00ffb801, 0x80070000, 0x001f210c, 0xb500ffc8, + 0x003f400e, 0xb0000086, 0xb4400056, 0xb0000084, + 0xb4000040, 0xb0000085, 0xb4000046, 0xb0000086, + 0xb4000048, 0xb0000083, 0xb4000000, 0x815bff7c, + 0x00000000, 0x940a0080, 0x5c07b800, 0xb0000001, + 0xb4000074, 0x81674b18, 0x940a0007, 0x5803b800, + 0x116bb800, 0x005bb80b, 0x916b0004, 0x001bb80b, + 0x80530030, 0x98422000, 0x8013ffcf, 0x9800cfff, + 0x806500d4, 0x1463b800, 0x1863b802, 0x806600d4, + 0x80073cfb, 0x801e4b00, 0x800600a1, 0x80074000, + 0x801e4b04, 0x8013001f, 0x98405000, 0x805effe0, + 0x005fb006, 0x805effe8, 0x805effec, 0x9042a000, + 0x805effe4, 0x9040fa00, 0x805effd0, 0x805effdc, + 0x805effd8, 0x9040fe00, 0x805effd4, 0x8013007f, + 0x9800ffff, 0x001fb040, 0x80070001, 0x001f2013, + 0x80070000, 0x001f2324, 0x001f600f, 0x001fb0cb, + 0x001fb010, 0x001fb041, 0x001fb042, 0x80073470, + 0x001fb008, 0x80071e50, 0x001fb009, 0x98214000, + 0xb5000010, 0x94011000, 0xb0001000, 0xb4200001, + 0x9421efff, 0x98210010, 0xb500000a, 0x80070000, + 0x001fb0cb, 0x83e4009a, 0x003f400e, 0x9421ffef, + 0xb5000004, 0x83e40096, 0x003f400e, 0x98211000, + 0x9421ffef, 0x003f600e, 0x80070100, 0x801efff0, + 0xb500ff6f, 0xb000008b, 0xb4000018, 0xb0000087, + 0xb400ffee, 0xb0000088, 0xb4000016, 0xb000008a, + 0xb4000016, 0xb000008c, 0xb4000017, 0xb0000089, + 0xb4000019, 0xb00000a0, 0xb400001b, 0xb00000a1, + 0xb4000048, 0xb00000a2, 0xb4000055, 0xb00000a3, + 0xb400004d, 0xb00000a4, 0xb4000057, 0xb00000a5, + 0xb400005b, 0xb00000a6, 0xb400005f, 0x803efff8, + 0xb500ffe1, 0x9421ffdf, 0xb500ffde, 0x80270100, + 0x803efff8, 0xb500ffdc, 0x803bffb0, 0x00000000, + 0x003fb040, 0xb500ffd8, 0x803bff80, 0x00000000, + 0x003f6001, 0xb500ffd4, 0x003f90ba, 0x803efff8, + 0xb500ffd1, 0x81674b18, 0x940a0007, 0x5803b800, + 0x116bb800, 0x005bb80b, 0x916b0004, 0x001bb80b, + 0x806500d4, 0x1463b800, 0x1863b802, 0x806600d4, + 0x80130001, 0x98003d21, 0x800600a1, 0x801e4b00, + 0x80074000, 0x801e4b04, 0x8013001f, 0x98405000, + 0x805effe0, 0x005fb006, 0x805effe8, 0x805effec, + 0x9042a000, 0x805effe4, 0x9040fa00, 0x805effd0, + 0x805effdc, 0x805effd8, 0x9040fe00, 0x805effd4, + 0x80070001, 0x001f2013, 0x80070000, 0x001f2324, + 0x001f600f, 0x001fb0cb, 0x001fb010, 0x80073cb0, + 0x001fb008, 0x800744a0, 0x001fb009, 0x98214000, + 0xb500ffa4, 0x80270000, 0x8047fef0, 0x003eb802, + 0x90420004, 0x003eb802, 0x90420004, 0x003eb802, + 0x90420004, 0x003eb802, 0x81df0000, 0x00000000, + 0x00000000, 0x83640475, 0x81df0004, 0xb500ff96, + 0x81df0000, 0x00000000, 0x00000000, 0x8364041f, + 0x81df0004, 0xb500ff90, 0x81df0000, 0x00000000, + 0x00000000, 0x836403da, 0x81df0004, 0xb500ff8a, + 0x81df0000, 0x00000000, 0x00000000, 0x83440339, + 0x81df0004, 0xb500ff84, 0x81df0000, 0x00000000, + 0x00000000, 0x8344031e, 0x81df0004, 0xb500ff7e, + 0x80070000, 0x80470000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6002003, 0xb6003002, 0x001eb802, + 0x90420004, 0x80171000, 0x8057ffff, 0xb6002002, + 0xb6001801, 0x001fa020, 0x81df0004, 0x00ffb81f, + 0x83a70000, 0x8057ffff, 0x80770000, 0x8073007a, + 0x9863e7d2, 0x0207b803, 0x81df0000, 0x00000000, + 0x00000000, 0x80171000, 0xb6008007, 0x003fc0c0, + 0x005fc740, 0x40c1b810, 0x4102b810, 0x001fe0c6, + 0x001fe0c8, 0x4210b803, 0x81df0004, 0x80270000, + 0x003f2013, 0x8007001f, 0x94000003, 0x5810b800, + 0x83671e34, 0x1b7bb800, 0x003f9009, 0x1821b800, + 0x00ffb801, 0x003f0013, 0xb0010001, 0xb420fff3, + 0x93bd0001, 0xb01d0004, 0xb480ffe3, 0x00ffb81f, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815b4b0c, 0x81070000, 0x81270be8, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x812717e8, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a00059, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200006, + 0x039f4193, 0x5b81b81c, 0x003f90cb, 0x1021b81c, + 0x003fb0cb, 0x83840237, 0x829bff80, 0x801300e0, + 0x1434b800, 0x5c35b801, 0x8013001f, 0x1454b800, + 0x5c50b802, 0x8073007f, 0x9863ffff, 0xb002000f, + 0xb4800001, 0x90210001, 0x84210004, 0xb0010000, + 0xb4a00001, 0x6861b803, 0x005f9040, 0x4082b803, + 0x80af001f, 0x808f0000, 0x806f0000, 0x8007ffff, + 0x8033ffff, 0x80171000, 0x81df0000, 0x00000000, + 0x00000000, 0xb600180a, 0xb6002009, 0x58708000, + 0x6068b803, 0x40c4b803, 0x00000000, 0x00c8b806, + 0x00000000, 0x00000000, 0x00000000, 0x5807a026, + 0x81df0004, 0x80670400, 0x5d22b80a, 0x81df0000, + 0x00000000, 0x00000000, 0xb600180a, 0x00cfb803, + 0x013fb0bc, 0x5922b809, 0x01afb809, 0x013f90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x90630020, + 0x91290020, 0x81df0004, 0x808f0000, 0x801b4b14, + 0x80270001, 0xb0000001, 0xb4000002, 0x802600a0, + 0x803e4b14, 0x81270c00, 0xb00a0000, 0xb4000001, + 0x81270000, 0x813e4b0c, 0x80270001, 0x003f2013, + 0x80050086, 0x001fb044, 0x00ffb81b, 0x00000000, + 0x029fb00a, 0x02bfb00b, 0x02dfb00c, 0x02ffb00d, + 0x031fb00e, 0x033fb00f, 0x033f400f, 0x0287b86f, + 0x029fb005, 0x8285009c, 0x96b48000, 0xb0158000, + 0xb400018d, 0x96b40100, 0xb0150100, 0xb40001a9, + 0x96b40400, 0xb0150400, 0xb40001b0, 0x96b40001, + 0xb0150001, 0xb400000c, 0x96b40008, 0xb0150008, + 0xb4000196, 0x96b44000, 0xb0154000, 0xb40001af, + 0x96b40002, 0xb0150002, 0xb400015e, 0x00000000, + 0x00000000, 0xb50001c1, 0x02bf9017, 0x92b50001, + 0x02bfb017, 0x82850082, 0x83050081, 0x82a5009a, + 0x96b50001, 0xb0150001, 0xb4200014, 0x82a70000, + 0x02bfb017, 0x96b41840, 0xb0150800, 0xb420000c, + 0x96b40008, 0x5aa9b815, 0x96d46000, 0x5ec3b816, + 0x82f3000f, 0x9af7c00f, 0x1718b817, 0x1ab5b818, + 0x1ab5b816, 0x9ab50340, 0x82a60081, 0xb500013d, + 0x9b180180, 0x83060081, 0xb500013a, 0x82a5009a, + 0x96b50002, 0xb0150002, 0xb420001b, 0x82a70000, + 0x02bfb017, 0x96b41800, 0xb0151800, 0xb4000013, + 0x96b40040, 0xb0150040, 0xb4200004, 0xa3180c00, + 0x9b180340, 0x83060081, 0xb500012a, 0x96b40008, + 0x5aa9b815, 0x96d46000, 0x5ec3b816, 0x82f3000f, + 0x9af7c00f, 0x1718b817, 0x1ab5b818, 0x1ab5b816, + 0x9ab50340, 0x82a60081, 0xb500011e, 0x9b180180, + 0x83060081, 0xb500011b, 0x82a500c1, 0x96b5000f, + 0xb015000b, 0xb420000e, 0x96b40020, 0xb0150020, + 0xb400000b, 0x96b40200, 0xb0150200, 0xb4000008, + 0x82c50086, 0x82e50094, 0x3016b817, 0xb4400004, + 0x06f7b816, 0xb017ff00, 0xb4400001, 0xb5000109, + 0x96b46000, 0xb0156000, 0xb4000011, 0x96b41820, + 0xb0150820, 0xb4200004, 0x9b391000, 0x82a5009a, + 0x96b5feff, 0x82a6009a, 0x96b40040, 0xb0150040, + 0xb4200001, 0x9739efff, 0x96b91000, 0xb0151000, + 0xb4200003, 0x82a5009a, 0x9ab50100, 0x82a6009a, + 0x96b40040, 0xb0150040, 0xb4200019, 0x96b41800, + 0xb0151800, 0xb4200006, 0x96b98000, 0xb0158000, + 0xb4200003, 0x9b180180, 0x83060081, 0xb50000e9, + 0x96d80c00, 0x82b300ff, 0x9ab5f3ff, 0x1718b815, + 0xb0160c00, 0xb4000007, 0x82e50098, 0x96f70400, + 0xb0170400, 0xb4200002, 0x82c70c00, 0xb5000001, + 0xa2d60c00, 0x1b18b816, 0x9b180340, 0xb50000cf, + 0x96b40220, 0xb0150000, 0xb4e00033, 0x82a5009d, + 0x82f3ffff, 0x16b5b817, 0x82f3000e, 0x3015b817, + 0xb420002d, 0x96f98000, 0xb0178000, 0xb400002a, + 0x82a70000, 0x02bfb017, 0x82c50081, 0x9ab60020, + 0x82a60081, 0x82a50086, 0x92b50bb8, 0x82a60094, + 0x82c60081, 0x82c5009d, 0x96d6ffff, 0x82b30032, + 0x9ab58001, 0x82e500c1, 0x96f7000f, 0xb017000b, + 0xb4000002, 0x82b30022, 0x9ab58001, 0x1ab5b816, + 0x82c5009a, 0x96d60020, 0xb0160020, 0xb4200002, + 0x82b30032, 0x9ab58001, 0x82a6009d, 0x02ff9017, + 0x00000000, 0xb0170040, 0xb480000b, 0x96f41c00, + 0xb0171c00, 0xb4200008, 0x82e50086, 0x82c50094, + 0x92d63000, 0x3016b817, 0xb4400003, 0x9b180180, + 0x83060081, 0xb50000a3, 0x5eb5b814, 0x96b500f0, + 0x96f46000, 0x5eedb817, 0x1ab5b817, 0xb0170003, + 0xb4000004, 0x96b500ef, 0x96f70001, 0x5ae4b817, + 0x1ab5b817, 0x96d41800, 0xb0161800, 0xb400000a, + 0x96f900ff, 0x96b500ff, 0x9739ff00, 0x1b39b815, + 0x02a7b817, 0x96b500f3, 0x96d40008, 0x5ec1b816, + 0x1ab5b816, 0xb500000c, 0x96f98000, 0xb0178000, + 0xb4200007, 0x5efeb814, 0x96f70001, 0xb0170001, + 0xb4000003, 0x9b180180, 0x83060081, 0xb5000081, + 0x96b500f3, 0x9ab50008, 0x9739fff3, 0x96d40020, + 0xb0160020, 0xb4200017, 0x9b398000, 0x82c70000, + 0x02dfb017, 0x96d40010, 0x5ac8b816, 0x82f300ff, + 0x9af7cfff, 0x1718b817, 0x1b18b816, 0x9b180340, + 0x82c5009d, 0x96d6ffff, 0x82f3000e, 0x9af78001, + 0x1af7b816, 0x82c5009a, 0x96d60020, 0xb0160020, + 0xb4200002, 0x82f30032, 0x9af78001, 0x82e6009d, + 0xb500005a, 0x97397fff, 0x96b500ff, 0x5aaab815, + 0x82f300fc, 0x9af703ff, 0x1718b817, 0x1b18b815, + 0x9b180340, 0x82c5009a, 0x96d60010, 0xb0160010, + 0xb4200024, 0x82c70000, 0x02dfb017, 0x82c50086, + 0x92d60bb8, 0x82c60086, 0x82c50094, 0x5eefb818, + 0x96f70003, 0xb0170003, 0xb4200002, 0x82e70bb8, + 0xb5000001, 0x82e70bb8, 0x12d6b817, 0x82e50081, + 0x9af70020, 0x82e60081, 0x82c60094, 0xa2f70020, + 0x82e60081, 0x82f30001, 0x16f7b818, 0x5ef0b817, + 0xb0170001, 0xb4000004, 0x96f84000, 0x5ee4b817, + 0x9718f3ff, 0x1b18b817, 0x82f3000a, 0x9af78000, + 0x82e6009d, 0x83060081, 0x83070001, 0x8306009f, + 0xb500009e, 0x82c5009d, 0x82f3000e, 0x9af78001, + 0x3016b817, 0xb420000f, 0x82b30032, 0x9ab58001, + 0x82e500c1, 0x96f7000f, 0xb017000b, 0xb4000002, + 0x82b30022, 0x9ab58001, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82b30032, 0x9ab58001, + 0x82a6009d, 0x82c5009a, 0x96d60080, 0xb0160080, + 0xb4000011, 0x02df9017, 0x00000000, 0xb0160010, + 0xb480000d, 0x82c500c1, 0x96d6000f, 0xb016000b, + 0xb4000009, 0x82c50087, 0x96d60080, 0x5ac7b816, + 0x96f84000, 0x3017b816, 0xb4200003, 0x033f400f, + 0x9b394000, 0xb500000b, 0x9739bfff, 0x82e50061, + 0x96f70008, 0xb0170008, 0xb4000005, 0x5eefb818, + 0x96f70003, 0xb0170003, 0xb4000001, 0x9718ffff, + 0x83060081, 0x83070001, 0x8306009f, 0x00000000, + 0xb5000066, 0x82850083, 0x96b400ff, 0xb015003c, + 0xb4200015, 0x96b92000, 0xb0152000, 0xb4000002, + 0x9b392000, 0xb5000010, 0x9739d3ff, 0x82870000, + 0x82860087, 0x82870008, 0x82860083, 0x8287001f, + 0x828600c9, 0x829bff78, 0x00000000, 0x828600cb, + 0x8285009d, 0x82b3ffff, 0x9ab5fffd, 0x1694b815, + 0x8286009d, 0xb5000000, 0x83070002, 0x8306009f, + 0x00000000, 0xb5000049, 0x96b90800, 0xb0150800, + 0xb4200009, 0x9739f7ff, 0x82a703fd, 0x82a600cb, + 0x82a7003c, 0x82a60083, 0x8285009d, 0x9a940002, + 0x8286009d, 0xb5000004, 0x82850087, 0x5a82b814, + 0xa2940200, 0x82860087, 0xb5000000, 0x83078000, + 0x8306009f, 0x00000000, 0xb5000034, 0x82850086, + 0x82a50094, 0x3015b814, 0xb4800002, 0x86b50bb8, + 0x82a60086, 0x83070008, 0x8306009f, 0x00000000, + 0xb500002a, 0x83050081, 0x82f3001c, 0x9af703ff, + 0x1718b817, 0x9b180140, 0x83060081, 0x83070100, + 0x8306009f, 0x00000000, 0xb5000020, 0x83070000, + 0x83050081, 0x9b180180, 0x83060081, 0x83070400, + 0x8306009f, 0x00000000, 0xb5000018, 0x82870000, + 0x82850082, 0x5eb7b814, 0x96b500fc, 0x96d40006, + 0x5ec1b816, 0x1ab5b816, 0x5aacb815, 0x83050081, + 0x82d3001c, 0x9ad600ff, 0x1718b816, 0x1b18b815, + 0x9b180e00, 0x83060081, 0x83074000, 0x8306009f, + 0x8305009d, 0x82d300ff, 0x9ad6bfff, 0x1718b816, + 0x8306009d, 0x00000000, 0xb5000000, 0x029f9005, + 0x01ffb814, 0x033f600f, 0x029f900a, 0x02bf900b, + 0x02df900c, 0x02ff900d, 0x031f900e, 0x033f900f, + 0x00ffb81e, 0x02ff9010, 0x92f70b43, 0x02ffb010, + 0x02ff90cb, 0x82bbffdc, 0x829bffd8, 0x93150004, + 0x3014b815, 0xb4000010, 0x02dbb818, 0x029bb815, + 0x3017b816, 0xb480000c, 0x5a81b814, 0x029fb010, + 0x82860095, 0x8293001f, 0x9294fe00, 0x92b50008, + 0x3015b814, 0xb4800002, 0x82b3001f, 0x92b5fa00, + 0x82beffdc, 0xb500ffeb, 0x029f9010, 0x83250094, + 0x06d4b819, 0x02d6b816, 0xb016ffff, 0xb4a0000a, + 0x8293000e, 0x9a948001, 0x82c5009d, 0x96d6ffff, + 0x1a94b816, 0x82c5009a, 0x96d60010, 0xb0160010, + 0xb4000001, 0x8286009d, 0x00ffb81c, 0x80070000, + 0x001fb0bf, 0x001f2329, 0x003fb800, 0x001f9006, + 0x5803b800, 0x80338000, 0x1800b801, 0x003fb800, + 0x005f4193, 0x5c41b802, 0x80350000, 0x00000000, + 0x0027b860, 0x80150010, 0x5810b800, 0x80750010, + 0x1863b800, 0x8087ffff, 0x80a7770b, 0x80c70000, + 0x1403b804, 0x3000b805, 0xb4000008, 0x5888b804, + 0x58a8b805, 0x90c60001, 0xb0060003, 0xb4a0fff8, + 0x84420001, 0xb4e0ffee, 0xb5000020, 0xb0060003, + 0xb4200007, 0x80150010, 0x5810b800, 0x81150010, + 0x950800ff, 0xb0080077, 0xb4000001, 0xb500fff4, + 0x001f400e, 0x98000010, 0x98004000, 0x9400fffe, + 0x001f600e, 0x80e70020, 0xb0060000, 0xb400000e, + 0x58e3b806, 0x90210020, 0x81070000, 0x5938b803, + 0x1908b809, 0x9523ff00, 0x5928b809, 0x1908b809, + 0x5d28b803, 0x9529ff00, 0x1908b809, 0x5d38b803, + 0x1908b809, 0x011fb0bf, 0x00ff2329, 0x80137fff, + 0x9800ffe7, 0x1421b800, 0x5c23b801, 0x001f9006, + 0x0441b800, 0x3001b800, 0xb4600002, 0x0440b801, + 0xa4422000, 0x007f90cb, 0x1063b802, 0x007fb0cb, + 0x003fb006, 0x803effec, 0x80470001, 0x005f2013, + 0xb500fbe3, 0x001f400e, 0x9400000f, 0xb0000000, + 0xb4200001, 0x00ffb81f, 0xb0000001, 0xb4000005, + 0xb0000003, 0xb4000003, 0xb0000002, 0xb4000001, + 0x00ffb81f, 0x80070001, 0x001f2013, 0xb500fbd4, + 0x001f9012, 0x001fb100, 0x001f004c, 0x001f2404, + 0x801bfef0, 0x8058fef4, 0x003f9304, 0x007f0c14, + 0x2000b801, 0x2042b803, 0x001fb104, 0x005f2414, + 0x82e70001, 0x83640048, 0x029fb014, 0x829efef0, + 0x8286000f, 0x02bf2054, 0x82bcfef4, 0x82a6000e, + 0x00ffb81a, 0x80e70001, 0x801336e3, 0x9800eb76, + 0x001fb100, 0x800700ab, 0x001f2404, 0x801bc3e8, + 0x8058c3ec, 0x83640024, 0x82e70000, 0x83640036, + 0x029fb300, 0x029fb100, 0x02bf2c04, 0x02bf2404, + 0x801bc000, 0x8058c004, 0x8364001b, 0x82e70000, + 0x8364002d, 0x001f9300, 0x3000b814, 0xb420000a, + 0x001f0c04, 0x3000b815, 0xb4200007, 0x829efef0, + 0x82bcfef4, 0x029fb012, 0x02bf204c, 0x82870001, + 0x829cfef5, 0x00ffb81a, 0xb0070000, 0xb4000007, + 0x80e70000, 0x801399fa, 0x9800c92e, 0x001fb100, + 0x800700af, 0x001f2404, 0xb500ffdc, 0x82870000, + 0x829cfef5, 0x00ffb81a, 0x80c700ff, 0x003f9304, + 0x007f0c14, 0x14a0b806, 0x2063b805, 0x007f2414, + 0x2021b802, 0x58c8b806, 0x14a0b806, 0x58b0b805, + 0x2021b805, 0x58c8b806, 0x14a0b806, 0x2021b805, + 0x58c8b806, 0x14a0b806, 0x5cb0b805, 0x2021b805, + 0x003fb104, 0x00ffb81b, 0x82c70000, 0x83070400, + 0x83270005, 0x8197040c, 0x81d7ffff, 0x8384012a, + 0x83840001, 0x00ffb81b, 0x808f0000, 0x806f001f, + 0x80af001f, 0x80270140, 0x81e74e58, 0x5de2b80f, + 0xb600020a, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0x0047b86f, 0xb0020001, + 0xb4c0fffd, 0x91ef0020, 0x90210020, 0x80270180, + 0x81e74d50, 0x5de2b80f, 0xb600020a, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x91ef0020, + 0x90210020, 0x8057ffff, 0x80170430, 0x80070410, + 0x80270408, 0xb6000509, 0x005ff000, 0x90420500, + 0x007ff001, 0x90630600, 0x009ff002, 0x00bff003, + 0x2004a025, 0x90000001, 0x90210001, 0x80070414, + 0x80d7ffff, 0x8097045c, 0x8017043c, 0xb6000404, + 0x005ff000, 0x007f87e0, 0x84000001, 0x2082a7e3, + 0x80970460, 0x80170440, 0x2082b803, 0x007f8000, + 0x2083a004, 0x80170430, 0x80970450, 0x80270408, + 0xb6000508, 0x005f8024, 0x90420500, 0x007ff001, + 0x90630600, 0x009ff002, 0x00bff003, 0x2004a025, + 0x90210001, 0x80170440, 0x00000000, 0x02bf87e0, + 0x80970460, 0x82870000, 0xb6000404, 0x005f87e4, + 0x5a88b814, 0x204287e0, 0x1a94b802, 0x00ffb81c, + 0x001f0a49, 0x001f2709, 0x001f0a41, 0x001f2708, + 0x001f0a46, 0x001f2707, 0x001f0a48, 0x001f2706, + 0x001f0a42, 0x001f2705, 0x001f0a47, 0x001f2704, + 0x001f0a45, 0x001f2703, 0x001f0a43, 0x001f2702, + 0x001f0a40, 0x001f2701, 0x001f0a44, 0x001f2700, + 0x001f0c25, 0xa020000c, 0x94400001, 0x94600002, + 0x94810004, 0x94a10008, 0x94c00010, 0x5943b802, + 0x5861b803, 0x5882b804, 0x5ca2b805, 0x5cc4b806, + 0x194ab803, 0x194ab804, 0x194ab805, 0x194ab806, + 0x015f2738, 0x801b4e50, 0x003f91c1, 0x5c28b801, + 0x005f91c2, 0x5858b802, 0x1821b802, 0x2000b801, + 0x001fb1c4, 0x80184e54, 0x003f0709, 0x2000b801, + 0x001f2714, 0x82c70001, 0x82e70001, 0x83070710, + 0x8327001e, 0x81970735, 0x8384009f, 0x02df0738, + 0x82170a30, 0x838400f1, 0x819efef0, 0x817cfef4, + 0x019fb304, 0x017f2c14, 0x00ffb81b, 0x820f001f, + 0x8018fef8, 0x8057ffff, 0x001f2709, 0x8018fef6, + 0x80d7ffff, 0x001f2708, 0x8018fefa, 0x8157ffff, + 0x001f2707, 0x8018fefd, 0x81d7ffff, 0x001f2706, + 0x8018fefb, 0x802f001f, 0x001f2705, 0x8018fefe, + 0x00000000, 0x001f2704, 0x8018fef9, 0x00000000, + 0x001f2703, 0x8018feff, 0x00000000, 0x001f2702, + 0x8018fef7, 0x00000000, 0x001f2701, 0x8018fefc, + 0x00000000, 0x001f2700, 0x001f0c25, 0xa0200011, + 0x94410001, 0x94600002, 0x94800004, 0x94a00008, + 0x94c10010, 0x5941b802, 0x5861b803, 0x5c82b804, + 0x58a1b805, 0x5cc1b806, 0x194ab803, 0x194ab804, + 0x194ab805, 0x194ab806, 0x015f2738, 0x801b4e50, + 0x003f91c1, 0x5c28b801, 0x005f91c2, 0x5858b802, + 0x1821b802, 0x2000b801, 0x001fb1c4, 0x80184e54, + 0x003f0709, 0x2000b801, 0x001f2714, 0x82c70001, + 0x82e70001, 0x83070710, 0x8327001e, 0x81970735, + 0x83840055, 0x02df0738, 0x82170a20, 0x838400a7, + 0x819efef0, 0x817cfef4, 0x5ac8b80c, 0x02ff0a44, + 0x1ad6b817, 0x02dfb291, 0x5ed8b80c, 0x5968b80b, + 0x1ad6b80b, 0x02df6524, 0x00ffb81b, 0x820f001f, + 0x8018fefe, 0x8057ffff, 0x001f2709, 0x8018fefa, + 0x80d7ffff, 0x001f2708, 0x8018fefc, 0x8157ffff, + 0x001f2707, 0x8018feff, 0x81d7ffff, 0x001f2706, + 0x8018fef8, 0x802f001f, 0x001f2705, 0x8018fefb, + 0x00000000, 0x001f2704, 0x8018fefd, 0x00000000, + 0x001f2703, 0x8018fef6, 0x00000000, 0x001f2702, + 0x8018fef9, 0x00000000, 0x001f2701, 0x8018fef7, + 0x00000000, 0x001f2700, 0x801b4e50, 0x003f91c1, + 0x5c28b801, 0x005f91c2, 0x5858b802, 0x1821b802, + 0x2000b801, 0x001fb1c4, 0x80184e54, 0x003f0709, + 0x2000b801, 0x001f2714, 0x82c70001, 0x82e70001, + 0x83070710, 0x8327001e, 0x81970735, 0x83840016, + 0x83270000, 0x831bfef0, 0x82f8fef4, 0x02c7b819, + 0x82170a28, 0x83840065, 0x300cb818, 0xb4200002, + 0x300bb817, 0xb4000006, 0x93390001, 0xb0190020, + 0xb480fff6, 0x83270000, 0x833cfef5, 0x00ffb81b, + 0x019fb290, 0x017f2a44, 0x033f2c25, 0x83270001, + 0x833cfef5, 0x00ffb81b, 0x0007b818, 0x90000003, + 0x00000000, 0x015ff000, 0x90000001, 0x5949b80a, + 0x013ff000, 0x194ab809, 0x84000002, 0x994a0100, + 0x017ff000, 0x958b00f8, 0x5981b80c, 0x956b0007, + 0x198cb80b, 0x84000002, 0x998c0008, 0x017ff000, + 0x90000001, 0x5971b80b, 0x198cb80b, 0x017ff000, + 0x5969b80b, 0x198cb80b, 0x81a70000, 0x94d90003, + 0x82a70000, 0xb6260019, 0xb6000818, 0x5df0b80a, + 0x5e02b80a, 0x21efb810, 0x95ef0001, 0x5941b80a, + 0x194ab80f, 0x21efb816, 0x5e18b80c, 0x5e35b80c, + 0x5e54b80c, 0x5e6cb80c, 0x2210b811, 0x2252b813, + 0x2210b812, 0x96100001, 0x5981b80c, 0x198cb810, + 0x2210b817, 0x10afb810, 0x10a5b80d, 0x5da1b805, + 0x94a50001, 0x5aa1b815, 0x1ab5b805, 0x019fa7f5, + 0x5cc2b819, 0xb626001c, 0x82870000, 0xb6000419, + 0xb6000818, 0x5df0b80a, 0x5e02b80a, 0x21efb810, + 0x95ef0001, 0x5941b80a, 0x194ab80f, 0x21efb816, + 0x5e18b80c, 0x5e35b80c, 0x5e54b80c, 0x5e6cb80c, + 0x2210b811, 0x2252b813, 0x2210b812, 0x96100001, + 0x5981b80c, 0x198cb810, 0x2210b817, 0x10afb810, + 0x10a5b80d, 0x5da1b805, 0x94a50001, 0x5a81b814, + 0x1a94b805, 0x019fa7f4, 0x00ffb81c, 0x8257ffff, + 0x808f0000, 0x806f001f, 0x80af001f, 0x80270200, + 0x81e74b30, 0x5de2b80f, 0xb600020a, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x91ef0020, + 0x90210020, 0x80270240, 0x81e74c30, 0x5de2b80f, + 0xb600020a, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0x0047b86f, 0xb0020001, + 0xb4c0fffd, 0x91ef0020, 0x90210020, 0x80270180, + 0x81e74d50, 0x5de2b80f, 0xb600020a, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x91ef0020, + 0x90210020, 0x806f0007, 0x80af0007, 0x80270280, + 0x81e74d30, 0x5de2b80f, 0x00cfb801, 0x01ffb0bc, + 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x91ef0020, 0x90210020, + 0x80170760, 0x001f0700, 0x001fa020, 0x001f0701, + 0x001fa020, 0x001f0702, 0x001fa020, 0x001f0703, + 0x001fa020, 0x001f0704, 0x001fa000, 0x80970750, + 0x81170770, 0x82a70735, 0x83a40060, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4005c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a70730, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40050, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4004c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a7072b, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40040, 0x83a4004e, + 0xb6000407, 0x86b50001, 0x83a4003c, 0x001f8004, + 0x003f87e8, 0x2080a001, 0x83a40047, 0x00000000, + 0x80970770, 0x80170750, 0x81170750, 0x81970740, + 0x82a70726, 0x001f800c, 0x003f8008, 0x2100a001, + 0x83a4002e, 0x83a4003c, 0xb6000407, 0x86b50001, + 0x83a4002a, 0x001f8004, 0x003f87e8, 0x2080a001, + 0x83a40035, 0x00000000, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a70721, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4001c, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a40018, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a7071c, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4000c, 0x017f87e4, + 0x81870000, 0xb6000406, 0x86b50001, 0x83a40007, + 0x001f87e4, 0x200087e8, 0x5988b80c, 0x198cb800, + 0x021fa02c, 0x021fa00b, 0x00ffb81c, 0x005ff015, + 0x90420600, 0x003f87e0, 0x001ff002, 0x2060b801, + 0x90630800, 0x90960a00, 0x001ff003, 0x003ff004, + 0x20a0b801, 0x90a50900, 0x00000000, 0x001ff005, + 0x009fa000, 0x00ffb81d, 0x001f8004, 0x5c21b800, + 0x5847b800, 0x1821b802, 0x942100ff, 0x2080a7e1, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x829bff80, 0x80af000f, 0x808f0000, 0x806f0000, + 0x82bbffec, 0x82fbffe4, 0x00000000, 0x82beffb8, + 0x95540700, 0x5d48b80a, 0x914a0001, 0x0227b80a, + 0x94343000, 0x5c2cb801, 0xb0010000, 0xb4000001, + 0x5a21b811, 0x9574c000, 0x5d6eb80b, 0x918b4b08, + 0x01b8b80c, 0x96d5ffff, 0x5ec2b816, 0x96f7ffff, + 0x5ee2b817, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x81f3ff00, 0x99efff00, 0x821300ff, + 0x9a1000ff, 0x81971000, 0x82670000, 0x82470000, + 0x80270280, 0x81df0000, 0x00000000, 0x00000000, + 0xb62d000d, 0x3016b817, 0xb4800001, 0x86d62800, + 0x00cfb801, 0x02dfb0bc, 0x5ac2b816, 0x01cfb816, + 0x02df90bc, 0x0067b86f, 0xb0030001, 0xb4c0fffd, + 0x92d60010, 0x90210010, 0x81df0004, 0x80170a00, + 0x81df0000, 0x00000000, 0x00000000, 0xb62d0006, + 0xb6001005, 0x146f8000, 0x14908000, 0x5c68b803, + 0x5888b804, 0x1803a024, 0x81df0004, 0x80170a00, + 0x80970d00, 0xb00b0000, 0xb4000004, 0xb00b0001, + 0xb400000a, 0xb00b0002, 0xb4000027, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004002, 0x007f8020, + 0x009fa023, 0x81df0004, 0xb5000029, 0x80d3ffff, + 0x81df0000, 0x00000000, 0x00000000, 0xb6001018, + 0x5c648000, 0x9463ffff, 0x5c888020, 0x58b88000, + 0x1884b805, 0x1484b806, 0x1883a024, 0x5c6c8020, + 0x9463ffff, 0x58908000, 0x1883a024, 0x5c748020, + 0x588c8000, 0x1863b804, 0x9463ffff, 0x58888000, + 0x1484b806, 0x1883a024, 0x5c7c8020, 0x58848000, + 0x1863b804, 0x9463ffff, 0x14868020, 0x1883a024, + 0x81df0004, 0xb500000a, 0x80d3ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6002004, 0x007f8020, + 0x009fa023, 0x007f8040, 0x009fa023, 0x81df0004, + 0x00000000, 0x81170d00, 0x80070000, 0x94343000, + 0x5c2cb801, 0xb0010001, 0xb4000099, 0xb00a0001, + 0xb400000e, 0xb00a0002, 0xb4000022, 0xb00a0003, + 0xb400002f, 0xb00a0004, 0xb400005d, 0xb00a0005, + 0xb4000066, 0xb00a0006, 0xb400008a, 0xb00a0007, + 0xb4000088, 0xb00a0008, 0xb4000086, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004010, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x019fa020, 0x019fa020, 0x019fa020, 0x5c708028, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x019fa020, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000070, 0x81df0000, 0x00000000, 0x00000000, + 0x8027ffff, 0xb6004008, 0x14618008, 0x019fa023, + 0x019fa020, 0x019fa020, 0x5c708028, 0x019fa023, + 0x019fa020, 0x019fa020, 0x81df0004, 0xb5000061, + 0xb0130000, 0xb4000004, 0xb0130001, 0xb4000009, + 0xb0130002, 0xb400001a, 0x83a40102, 0x80170f00, + 0x007f8028, 0x001fa023, 0x007f8028, 0x001fa023, + 0xb5000054, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8000, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708020, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a400ed, + 0x80170f00, 0x007f8028, 0x001fa023, 0xb5000041, + 0x80170f00, 0x00000000, 0x007f8020, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x019fa020, 0x83a400da, 0xb5000031, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002005, + 0x007f8008, 0x019fa023, 0x007f8008, 0x019fa023, + 0x019fa020, 0x81df0004, 0xb5000026, 0xb0130000, + 0xb4000008, 0xb0130001, 0xb4000012, 0xb0130002, + 0xb400001f, 0xb0130003, 0xb400001d, 0xb0130004, + 0xb400001b, 0x83a400d5, 0x007f8028, 0x019fa023, + 0x007f8028, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000010, 0x80170f00, 0x00000000, 0x5c708020, + 0x58908008, 0x1983a024, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x83a400bf, + 0x80170f00, 0x007f8028, 0x001fa023, 0xb5000001, + 0xb5000000, 0x00000000, 0x00000000, 0xb500008e, + 0xb00a0001, 0xb400000e, 0xb00a0002, 0xb400001a, + 0xb00a0003, 0xb4000027, 0xb00a0004, 0xb4000055, + 0xb00a0005, 0xb400005e, 0xb00a0006, 0xb4000082, + 0xb00a0007, 0xb4000080, 0xb00a0008, 0xb400007e, + 0x81df0000, 0x00000000, 0x00000000, 0xb6004008, + 0x007f8028, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x019fa020, 0x019fa020, 0x019fa020, 0x019fa020, + 0x81df0004, 0xb5000070, 0x81df0000, 0x00000000, + 0x00000000, 0x8027ffff, 0xb6002008, 0x14618008, + 0x019fa023, 0x019fa020, 0x019fa020, 0x5c708048, + 0x019fa023, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000061, 0xb0130000, 0xb4000004, 0xb0130001, + 0xb4000009, 0xb0130002, 0xb400001a, 0x83a40098, + 0x80170f00, 0x007f8028, 0x001fa023, 0x007f8028, + 0x001fa023, 0xb5000054, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8000, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708020, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a40083, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000041, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8008, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a40070, + 0xb5000031, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002005, 0x007f8008, 0x019fa023, 0x007f8008, + 0x019fa023, 0x019fa020, 0x81df0004, 0xb5000026, + 0xb0130000, 0xb4000008, 0xb0130001, 0xb4000012, + 0xb0130002, 0xb400001f, 0xb0130003, 0xb400001d, + 0xb0130004, 0xb400001b, 0x83a4006b, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000010, 0x80170f00, 0x00000000, + 0x5c708020, 0x58908008, 0x1983a024, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x83a40055, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000001, 0xb5000000, 0x92730001, 0x92520001, + 0x3012b811, 0xb480fe76, 0x003f0324, 0x90210001, + 0xb0010006, 0xb4a00001, 0x80270001, 0x003f2324, + 0x2c8db811, 0x803bffe0, 0x805bffe4, 0x5886b804, + 0x1015b804, 0xad440003, 0x3000b802, 0xb4800001, + 0x8400a000, 0x801effec, 0x015f6193, 0x809e4b04, + 0x00ffb81f, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002a0c, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x81df0004, 0x00ffb81d, 0x81df0000, + 0x00000000, 0x00000000, 0xb600190f, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x81df0004, 0x00ffb81d, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002a0c, + 0x007f8028, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x81df0004, 0x00ffb81d, 0x81df0000, 0x00000000, + 0x00000000, 0xb600190f, 0x007f8028, 0x019fa023, + 0x007f8028, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x81df0004, 0x00ffb81d, 0x00000000, + 0x829bff80, 0x80af001f, 0x808f0000, 0x806f0000, + 0x82bbffec, 0x82fbffe4, 0x00000000, 0x82beffb8, + 0x95540700, 0x5d48b80a, 0x914a0001, 0x0227b80a, + 0x94343000, 0x5c2cb801, 0xb0010000, 0xb4000001, + 0x5a21b811, 0x9574c000, 0x5d6eb80b, 0x918b4b08, + 0x01b8b80c, 0x96d5ffff, 0x5ec2b816, 0x96f7ffff, + 0x5ee2b817, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x81f3ff00, 0x99efff00, 0x821300ff, + 0x9a1000ff, 0x81971000, 0x82670000, 0x82470000, + 0x80270280, 0x81df0000, 0x00000000, 0x00000000, + 0xb62d000d, 0x3016b817, 0xb4800001, 0x86d62800, + 0x00cfb801, 0x02dfb0bc, 0x5ac2b816, 0x01cfb816, + 0x02df90bc, 0x0067b86f, 0xb0030001, 0xb4c0fffd, + 0x92d60020, 0x90210020, 0x81df0004, 0x80170a00, + 0x81df0000, 0x00000000, 0x00000000, 0xb62d0006, + 0xb6002005, 0x146f8000, 0x14908000, 0x5c68b803, + 0x5888b804, 0x1803a024, 0x81df0004, 0x80170a00, + 0x80970d00, 0xb00b0000, 0xb4000004, 0xb00b0001, + 0xb400000a, 0xb00b0002, 0xb4000027, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008002, 0x007f8020, + 0x009fa023, 0x81df0004, 0xb5000029, 0x80d3ffff, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002018, + 0x5c648000, 0x9463ffff, 0x5c888020, 0x58b88000, + 0x1884b805, 0x1484b806, 0x1883a024, 0x5c6c8020, + 0x9463ffff, 0x58908000, 0x1883a024, 0x5c748020, + 0x588c8000, 0x1863b804, 0x9463ffff, 0x58888000, + 0x1484b806, 0x1883a024, 0x5c7c8020, 0x58848000, + 0x1863b804, 0x9463ffff, 0x14868020, 0x1883a024, + 0x81df0004, 0xb500000a, 0x80d3ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004004, 0x007f8020, + 0x009fa023, 0x007f8040, 0x009fa023, 0x81df0004, + 0x00000000, 0x81170d00, 0x80070000, 0x94343000, + 0x5c2cb801, 0xb0010001, 0xb400008e, 0xb00a0001, + 0xb400000e, 0xb00a0002, 0xb400001c, 0xb00a0003, + 0xb4000024, 0xb00a0004, 0xb4000052, 0xb00a0005, + 0xb400005b, 0xb00a0006, 0xb400007f, 0xb00a0007, + 0xb400007d, 0xb00a0008, 0xb400007b, 0x81df0000, + 0x00000000, 0x00000000, 0xb600800a, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x5c708028, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x019fa020, 0x81df0004, 0xb500006b, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008004, 0x007f8028, + 0x019fa023, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000061, 0xb0130000, 0xb4000004, 0xb0130001, + 0xb4000009, 0xb0130002, 0xb400001a, 0x83a400fa, + 0x80170f00, 0x007f8028, 0x001fa023, 0x007f8028, + 0x001fa023, 0xb5000054, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8000, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708020, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a400e5, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000041, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8008, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a400d2, + 0xb5000031, 0x81df0000, 0x00000000, 0x00000000, + 0xb6004005, 0x007f8008, 0x019fa023, 0x007f8008, + 0x019fa023, 0x019fa020, 0x81df0004, 0xb5000026, + 0xb0130000, 0xb4000008, 0xb0130001, 0xb4000012, + 0xb0130002, 0xb400001f, 0xb0130003, 0xb400001d, + 0xb0130004, 0xb400001b, 0x83a400cd, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000010, 0x80170f00, 0x00000000, + 0x5c708020, 0x58908008, 0x1983a024, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x83a400b7, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000001, 0xb5000000, 0x00000000, 0x00000000, + 0xb5000086, 0xb00a0001, 0xb400000e, 0xb00a0002, + 0xb4000017, 0xb00a0003, 0xb400001f, 0xb00a0004, + 0xb400004d, 0xb00a0005, 0xb4000056, 0xb00a0006, + 0xb400007a, 0xb00a0007, 0xb4000078, 0xb00a0008, + 0xb4000076, 0x81df0000, 0x00000000, 0x00000000, + 0xb6008005, 0x007f8028, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x019fa020, 0x81df0004, 0xb500006b, + 0x81df0000, 0x00000000, 0x00000000, 0xb6004004, + 0x007f8048, 0x019fa023, 0x019fa020, 0x019fa020, + 0x81df0004, 0xb5000061, 0xb0130000, 0xb4000004, + 0xb0130001, 0xb4000009, 0xb0130002, 0xb400001a, + 0x83a40098, 0x80170f00, 0x007f8028, 0x001fa023, + 0x007f8028, 0x001fa023, 0xb5000054, 0x80170f00, + 0x00000000, 0x007f8020, 0x019fa023, 0x007f8000, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708020, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x83a40083, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000041, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a40070, 0xb5000031, 0x81df0000, 0x00000000, + 0x00000000, 0xb6004005, 0x007f8008, 0x019fa023, + 0x007f8008, 0x019fa023, 0x019fa020, 0x81df0004, + 0xb5000026, 0xb0130000, 0xb4000008, 0xb0130001, + 0xb4000012, 0xb0130002, 0xb400001f, 0xb0130003, + 0xb400001d, 0xb0130004, 0xb400001b, 0x83a4006b, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x80170f00, + 0x007f8028, 0x001fa023, 0xb5000010, 0x80170f00, + 0x00000000, 0x5c708020, 0x58908008, 0x1983a024, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x83a40055, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000001, 0xb5000000, 0x92730001, + 0x92520001, 0x3012b811, 0xb480fe89, 0x003f0324, + 0x90210001, 0xb0010006, 0xb4a00001, 0x80270001, + 0x003f2324, 0x2c8db811, 0x803bffe0, 0x805bffe4, + 0x5887b804, 0x1015b804, 0xad440003, 0x3000b802, + 0xb4800001, 0x8400a000, 0x801effec, 0x015f6193, + 0x809e4b04, 0x00ffb81f, 0x81df0000, 0x00000000, + 0x00000000, 0xb6002a0c, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x019fa020, 0x81df0004, 0x00ffb81d, + 0x81df0000, 0x00000000, 0x00000000, 0xb600190f, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x81df0004, + 0x00ffb81d, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002a0c, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x81df0004, 0x00ffb81d, 0x81df0000, + 0x00000000, 0x00000000, 0xb600190f, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x81df0004, 0x00ffb81d, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815b4b0c, 0x81070000, 0x81270be8, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x812717e8, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a0005d, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200006, + 0x039f4193, 0x5b81b81c, 0x003f90cb, 0x1021b81c, + 0x003fb0cb, 0x8384f8a3, 0x829bff80, 0x801300e0, + 0x1434b800, 0x5c35b801, 0x8013001f, 0x1454b800, + 0x5c50b802, 0x8073007f, 0x9863ffff, 0xb002000f, + 0xb4800001, 0x90210001, 0x84210004, 0xb0010000, + 0xb4a00001, 0x6861b803, 0x005f9040, 0x4082b803, + 0x80af001f, 0x808f0000, 0x806f0000, 0x8007ffff, + 0x8033ffff, 0x80171000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6001811, 0xb6002010, 0x14618000, + 0x6068b803, 0x40c4b803, 0x14608000, 0x00c8b806, + 0x5870b803, 0x6068b803, 0x4104b803, 0x58c8b806, + 0x0108b808, 0x14c6b801, 0x00000000, 0x00000000, + 0x5d08b808, 0x1508b800, 0x1806a028, 0x81df0004, + 0x80670400, 0x5d22b80a, 0x81df0000, 0x00000000, + 0x00000000, 0xb600180a, 0x00cfb803, 0x013fb0bc, + 0x5922b809, 0x01afb809, 0x013f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x91290020, + 0x81df0004, 0x808f0000, 0x803b4b00, 0x00000000, + 0x802600a1, 0x80270001, 0x802600a0, 0x81270c00, + 0xb00a0000, 0xb4000001, 0x81270000, 0x813e4b0c, + 0x80270001, 0x003f2013, 0x00ffb81b, 0x00000000, +}; + +static u32 PCMUcode1f4b00[] = { + 0x00000000, 0x00000000, 0x00060504, 0x00000000, + 0x00000000, 0x00000000, 0x00300000, 0xffcfcfff, + 0x00302000, 0xffcfcfff, 0x00380000, 0xffc7c7ff, + 0xcbcecdc4, 0xcfcac9c8, 0xc3c6c5cc, 0xc7c2c1c0, + 0x1b1e1d14, 0x1f1a1918, 0x1316151c, 0x17121110, + 0x2b2e2d24, 0x2f2a2928, 0x2326252c, 0x27222120, + 0x3b3e3d34, 0x3f3a3938, 0x3336353c, 0x37323130, + 0x0b0e0d04, 0x0f0a0908, 0x0306050c, 0x07020100, + 0xdbdeddd4, 0xdfdad9d8, 0xd3d6d5dc, 0xd7d2d1d0, + 0xebeeede4, 0xefeae9e8, 0xe3e6e5ec, 0xe7e2e1e0, + 0xfbfefdf4, 0xfffaf9f8, 0xf3f6f5fc, 0xf7f2f1f0, + 0x4b4e4d44, 0x4f4a4948, 0x4346454c, 0x47424140, + 0x9b9e9d94, 0x9f9a9998, 0x9396959c, 0x97929190, + 0xabaeada4, 0xafaaa9a8, 0xa3a6a5ac, 0xa7a2a1a0, + 0xbbbebdb4, 0xbfbab9b8, 0xb3b6b5bc, 0xb7b2b1b0, + 0x8b8e8d84, 0x8f8a8988, 0x8386858c, 0x87828180, + 0x5b5e5d54, 0x5f5a5958, 0x5356555c, 0x57525150, + 0x6b6e6d64, 0x6f6a6968, 0x6366656c, 0x67626160, + 0x7b7e7d74, 0x7f7a7978, 0x7376757c, 0x77727170, + 0x341424c4, 0x3e1e2ece, 0x3d1d2dcd, 0x3b1b2bcb, + 0xb494a444, 0xbe9eae4e, 0xbd9dad4d, 0xbb9bab4b, + 0xf4d4e404, 0xfedeee0e, 0xfddded0d, 0xfbdbeb0b, + 0x74546484, 0x7e5e6e8e, 0x7d5d6d8d, 0x7b5b6b8b, + 0x3c1c2ccc, 0x361626c6, 0x351525c5, 0x331323c3, + 0xbc9cac4c, 0xb696a646, 0xb595a545, 0xb393a343, + 0xfcdcec0c, 0xf6d6e606, 0xf5d5e505, 0xf3d3e303, + 0x7c5c6c8c, 0x76566686, 0x75556585, 0x73536383, + 0x381828c8, 0x3a1a2aca, 0x391929c9, 0x3f1f2fcf, + 0xb898a848, 0xba9aaa4a, 0xb999a949, 0xbf9faf4f, + 0xf8d8e808, 0xfadaea0a, 0xf9d9e909, 0xffdfef0f, + 0x78586888, 0x7a5a6a8a, 0x79596989, 0x7f5f6f8f, + 0x301020c0, 0x321222c2, 0x311121c1, 0x371727c7, + 0xb090a040, 0xb292a242, 0xb191a141, 0xb797a747, + 0xf0d0e000, 0xf2d2e202, 0xf1d1e101, 0xf7d7e707, + 0x70506080, 0x72526282, 0x71516181, 0x77576787, + 0x05040100, 0x15141110, 0x25242120, 0x35343130, + 0x85848180, 0x95949190, 0xa5a4a1a0, 0xb5b4b1b0, + 0xc0408000, 0xe060a020, 0xd0509010, 0xf070b030, + 0xc8488808, 0xe868a828, 0xd8589818, 0xf878b838, + 0xc4448404, 0xe464a424, 0xd4549414, 0xf474b434, + 0xcc4c8c0c, 0xec6cac2c, 0xdc5c9c1c, 0xfc7cbc3c, + 0xc2428202, 0xe262a222, 0xd2529212, 0xf272b232, + 0xca4a8a0a, 0xea6aaa2a, 0xda5a9a1a, 0xfa7aba3a, + 0xc6468606, 0xe666a626, 0xd6569616, 0xf676b636, + 0xce4e8e0e, 0xee6eae2e, 0xde5e9e1e, 0xfe7ebe3e, + 0xc1418101, 0xe161a121, 0xd1519111, 0xf171b131, + 0xc9498909, 0xe969a929, 0xd9599919, 0xf979b939, + 0xc5458505, 0xe565a525, 0xd5559515, 0xf575b535, + 0xcd4d8d0d, 0xed6dad2d, 0xdd5d9d1d, 0xfd7dbd3d, + 0xc3438303, 0xe363a323, 0xd3539313, 0xf373b333, + 0xcb4b8b0b, 0xeb6bab2b, 0xdb5b9b1b, 0xfb7bbb3b, + 0xc7478707, 0xe767a727, 0xd7579717, 0xf777b737, + 0xcf4f8f0f, 0xef6faf2f, 0xdf5f9f1f, 0xff7fbf3f, + 0x1045a3e2, 0x000000f4, 0x263b7333, 0x766b2363, + 0x2b367e3e, 0x7b662e6e, 0x06db93d3, 0x964b0343, + 0x0bd69ede, 0x9b460e4e, 0x825f1757, 0x12cf87c7, + 0x8f521a5a, 0x1fc28aca, 0x00d199d9, 0x90410949, + 0x01d098d8, 0x91400848, 0x24357d3d, 0x74652d6d, + 0x25347c3c, 0x75642c6c, 0x04d59ddd, 0x94450d4d, + 0x05d49cdc, 0x95440c4c, 0x80511959, 0x10c189c9, + 0x81501858, 0x11c088c8, 0x02df97d7, 0x924f0747, + 0x0fd29ada, 0x9f420a4a, 0x865b1353, 0x16cb83c3, + 0x8b561e5e, 0x1bc68ece, 0xa6bbf3b3, 0xf6eba3e3, + 0xabb6febe, 0xfbe6aeee, 0x223f7737, 0x726f2767, + 0x2f327a3a, 0x7f622a6a, 0xa0b1f9b9, 0xf0e1a9e9, + 0xa1b0f8b8, 0xf1e0a8e8, 0x84551d5d, 0x14c58dcd, + 0x85541c5c, 0x15c48ccc, 0xa4b5fdbd, 0xf4e5aded, + 0xa5b4fcbc, 0xf5e4acec, 0x20317939, 0x70612969, + 0x21307838, 0x71602868, 0xa2bff7b7, 0xf2efa7e7, + 0xafb2faba, 0xffe2aaea, 0x00000000, 0x00000000, +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/mpg_240.h linux.20pre5-ac2/drivers/media/video/ls220/mpg_240.h --- linux.20pre5/drivers/media/video/ls220/mpg_240.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/mpg_240.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,1594 @@ +static u32 MPG240Ucode1f1800[] = { +0x820f001f,0x802f001f,0xb500000d,0x00000000, +0x00ffb81e,0x00000000,0x00000000,0x00000000, +0x00ffb81e,0x00000000,0x00000000,0x00000000, +0xb5000b5f,0x00000000,0x00000000,0x00000000, +0x80070800,0x001f6047,0x8013001f,0x90208000, +0x003fb174,0x803effe8,0x803effec,0x9020fa00, +0x803effd0,0x803effdc,0x803effd8,0x9020fe00, +0x803effd4,0x805bff7c,0x802500d4,0x94020080, +0xb0000000,0xb4200023,0x8013ffcf,0x9800cfff, +0x80730030,0x98631000,0x94420007,0xb0020002, +0xb4200005,0x8013ffc7,0x9800c7ff,0x80730038, +0x98631000,0xb5000006,0xb0020001,0xb4200004, +0x8013ffcf,0x9800cfff,0x80730030,0x98631000, +0x1421b800,0x1821b803,0x802600d4,0x8033001f, +0x98210000,0x802600a2,0x8033001f,0x98210300, +0x802600a3,0x80270225,0x80530001,0x98420100, +0x1821b802,0x80530200,0x98420000,0x804600a6, +0xb500001d,0x805bff7c,0x8013ffcf,0x9800cfff, +0x80730030,0x98631000,0x94420007,0xb0020002, +0xb4200005,0x8013ffc7,0x9800c7ff,0x80730038, +0x98631000,0xb5000006,0xb0020001,0xb4200004, +0x8013ffcf,0x9800cfff,0x80730030,0x98631000, +0x1421b800,0x1821b803,0x802600d4,0x8033001f, +0x98210000,0x802600a2,0x8033001f,0x98210300, +0x802600a3,0x80270c25,0x802600a1,0x80270002, +0x803eff84,0x80070000,0x801effc0,0x801effc4, +0x801effc8,0x801effcc,0x801eff88,0x80770000, +0x8057ffff,0x80170080,0x80070000,0xb6003f02, +0xb6002001,0x001fa020,0x8007ffff,0x801eff84, +0x80070001,0x001f25dc,0x001f20b1,0x80070000, +0x001f6046,0x001fb17c,0x001fb17d,0x80070000, +0x801e78d0,0x98004000,0x001f62ea,0x80070100, +0x801efff0,0x81df0004,0x00000000,0x00000000, +0x801bfff0,0x00000000,0x940000ff,0xb0000000, +0xb4200057,0x003f42ea,0x94010010,0xb0000000, +0xb400fff7,0x003f05dc,0xb0010001,0xb4200034, +0x803bffe8,0x801bffec,0x00000000,0x3001b800, +0xb4600001,0x90214000,0x0421b800,0xb0010800, +0xb460000d,0x80050086,0x005f902e,0xb0020000, +0xb4200002,0x001fb02e,0xb5000006,0x0420b802, +0xb0010930,0xb4a0ffe2,0x80070000,0x001fb02e, +0x83e40146,0xb500ffde,0x83e40111,0x80070000, +0x001fb02e,0x001f42ea,0x9400000f,0xb0000000, +0xb4000010,0x9400fff0,0x001f62ea,0x003f9174, +0x9421ffff,0x90210004,0xb001c000,0xb4800002, +0x8421c000,0x90218000,0x8013001f,0x1821b800, +0x003fb174,0x003f917c,0x90210004,0x003fb17c, +0x83e4012e,0x8013001f,0x83e71b0c,0x1bffb800, +0x003f9179,0x1821b800,0x00ffb801,0xb5000008, +0x80270000,0x003f25dc,0x8013001f,0x83e71b30, +0x1bffb800,0x003f917a,0x1821b800,0x00ffb801, +0x80070000,0x001f20b1,0x001f42ea,0x9420000f, +0xb0010000,0xb4200003,0x98000800,0x001f62ea, +0xb500ffaf,0x9400fff0,0x001f62ea,0x80270000, +0x8057ffff,0x80770000,0x80171800,0xb6000302, +0xb6002001,0x001fa021,0xb500ffa5,0xb500ffa4, +0x803bffc0,0x805bffc4,0x807bffc8,0x809bffcc, +0x5828b801,0x5cb8b802,0x1821b805,0x5848b802, +0x5cb8b803,0x1842b805,0x5868b803,0x5cb8b804, +0x1863b805,0x5888b804,0x1884b800,0x803effc0, +0x805effc4,0x807effc8,0x809effcc,0x003f42ea, +0xb0000086,0xb4400079,0xb0000084,0xb4000049, +0xb0000085,0xb4000063,0xb0000086,0xb400006c, +0xb0000081,0xb4000005,0xb0000082,0xb4000003, +0xb0000080,0xb4000001,0xb5000069,0x8013007f, +0x9800ffff,0x001fb02d,0x80070000,0x001fb17c, +0x8013001f,0x9040fa00,0x805effd0,0x805effdc, +0x805effd8,0x9040fe00,0x805effd4,0x9040c000, +0x805effe4,0x90008000,0x801effe0,0x001fb174, +0x801effe8,0x801effec,0x80078000,0x801e78d4, +0x80070000,0x001fb17c,0x001fb17d,0x001fb02e, +0x83e400ce,0x8013001f,0x98000000,0x800600a2, +0x8013001f,0x98000300,0x800600a3,0x805bff7c, +0x80070c25,0x94420080,0xb0020080,0xb420000d, +0x8013001f,0x98000000,0x800600a2,0x8013001f, +0x98000300,0x800600a3,0x80070225,0x80530001, +0x98420100,0x1800b802,0x80530200,0x98420000, +0x804600a6,0x800600a1,0x80050080,0x98000022, +0x80060080,0x80072000,0x001fb179,0x80074360, +0x001fb17a,0x80070001,0x001f25dc,0x98214000, +0xb5000029,0x8047ffff,0x805eff84,0x805bff88, +0x00000000,0xb0020001,0xb4200002,0x80470000, +0x805eff88,0x805bff7c,0x80070c25,0x94420080, +0xb0020080,0xb4200007,0x80070225,0x80530001, +0x98420100,0x1800b802,0x80530200,0x98420000, +0x804600a6,0x800600a1,0x80070001,0x800600a0, +0x9421efff,0x98210010,0xb500000f,0x80070000, +0x001fb17c,0x80070001,0x001f25dc,0x83e4008b, +0x80050081,0x80330008,0x98210000,0x1800b801, +0x80060081,0x003f42ea,0x9421ffef,0xb5000002, +0x98211000,0x9421ffef,0x83e40080,0x003f62ea, +0x80070100,0x801efff0,0xb500ff15,0xb000008b, +0xb400001c,0xb0000087,0xb400ffe8,0xb0000088, +0xb4000023,0xb000008a,0xb4000024,0xb000008c, +0xb4000019,0xb000008e,0xb4000014,0xb000008d, +0xb400001d,0xb0000089,0xb400001f,0xb00000a0, +0xb4000021,0xb00000a1,0xb4000022,0xb00000a2, +0xb400002b,0xb00000a3,0xb4000027,0xb00000a4, +0xb4000029,0xb00000a5,0xb4000029,0xb00000a6, +0xb4000029,0x803efff8,0xb500ffdd,0x80070000, +0x001fb17e,0xb500ffda,0x803bffb0,0x00000000, +0x003fb02d,0xb500ffd6,0x98210020,0xb500ffd2, +0x9421ffdf,0xb500ffd0,0xb500ffd1,0x80270341, +0x803efff8,0xb500ffce,0x803bff80,0x00000000, +0x003f62ef,0xb500ffca,0x003f917b,0x803efff8, +0xb500ffc7,0x80270000,0x8047fef0,0x003eb802, +0x90420004,0x003eb802,0x90420004,0x003eb802, +0x90420004,0x003eb802,0x83640d7c,0xb500ffbc, +0x83640d2a,0xb500ffba,0x83640ce9,0xb500ffb8, +0x83440c50,0xb500ffb6,0x83440c39,0xb500ffb4, +0x817bffe8,0x815b78d4,0x00000000,0x956bffff, +0x300bb80a,0xb4600001,0x916b4000,0x056bb80a, +0xb00b0080,0xb4a00026,0x80af001f,0x808f0000, +0x806f0000,0x81b300ff,0x8057ffff,0x5d67b80b, +0x5d42b80a,0xb62b001c,0xb00a3000,0xb4800001, +0x854a1000,0x80cf0400,0x015fb178,0x5942b80a, +0x01cfb80a,0x015f9178,0xb520ffff,0x80171000, +0xb600200a,0x01ff8000,0x5a18b80f,0x5a28b80f, +0x1631b80d,0x5e48b80f,0x9652ff00,0x5e78b80f, +0x1a73b810,0x1a73b811,0x1813a032,0x80cf0400, +0x015fb178,0x5942b80a,0x01afb80a,0x015f9178, +0xb520ffff,0x914a0020,0x5942b80a,0x815e78d4, +0x00000000,0x00000000,0x00ffb81f,0x80070000, +0x80470000,0x81171800,0xb6002003,0xb6003002, +0x001eb802,0x90420004,0xb6002003,0x011fa020, +0x011fa020,0x011fa020,0x00ffb81f,0x80070000, +0x80478000,0xb6002003,0xb6008002,0x001eb802, +0x90420004,0x00ffb81f,0x00000000,0x00000000, +0x015f42ea,0x944a4000,0xb0024000,0xb4200071, +0x954abfff,0x015f62ea,0x808f0000,0x80ef007c, +0x80171000,0x80971400,0x80270000,0xb6001003, +0xb6002002,0x001fa021,0x009fa021,0x80a76604, +0x80271400,0xb6001004,0x01efb801,0x01afb805, +0xb520ffff,0x90a50080,0x80a76e04,0x80271400, +0xb6001004,0x01efb801,0x01afb805,0xb520ffff, +0x90a50080,0x806f001f,0x80af001f,0x80276400, +0x5c22b801,0x806701e1,0x00cfb803,0x003fb178, +0x5822b801,0x01cfb801,0x003f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x80275c00,0x5c22b801, +0x80670200,0xb600100a,0x00cfb803,0x003fb178, +0x5822b801,0x01cfb801,0x003f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x90210020,0x90630020, +0x808f0000,0x806f001f,0x80af001f,0x8027647c, +0x5c22b801,0x8067017e,0xb600020a,0x00cfb803, +0x003fb178,0x5822b801,0x01cfb801,0x003f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x90210020, +0x90630020,0x806f0010,0x80af0010,0x8027657c, +0x5c22b801,0x806701be,0x00cfb803,0x003fb178, +0x5822b801,0x01cfb801,0x003f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x802765c0,0x5c22b801, +0x806701cf,0x00cfb803,0x003fb178,0x5822b801, +0x01cfb801,0x003f9178,0x0047b86f,0xb0020001, +0xb4c0fffd,0x80276000,0x005fb801,0x8033001f, +0x98218000,0x803effe0,0x90214000,0x803effe4, +0x8193001f,0x998c8000,0x019fb174,0x83270000, +0x003fb819,0x003f9174,0x5823b801,0x83338000, +0x1b39b801,0x003fb819,0x00000000,0x00000000, +0x81550000,0x0187b860,0x858c0040,0x81b380fc, +0x99ad0000,0x300cb80d,0xb4600003,0x81b30002, +0x99ad0000,0x118cb80d,0x003fb80c,0x00000000, +0x00000000,0x81550000,0x8257ffff,0x82d7ffff, +0x8357ffff,0x81672000,0x83440189,0xb00a0001, +0xb4000141,0x0187b860,0x858c0010,0x5988b80c, +0x5d8bb80c,0x958cffff,0xb00cc000,0xb4800002, +0x858cc000,0x918c8000,0x81b3001f,0x198cb80d, +0x801bffec,0x00000000,0x819effec,0x819e78d8, +0x019fb174,0x05acb800,0x300cb800,0xb4600001, +0x91ad4000,0x001f917c,0x1000b80d,0x001fb17c, +0x83440194,0xb00a0000,0xb4200127,0x015f0081, +0xb00a0002,0xb4200124,0x037f0082,0xb01b0000, +0xb400001e,0x0367b860,0x5b68b81b,0x5f68b81b, +0x017f4047,0x916b0010,0x5963b80b,0x83440160, +0x801bff84,0xb00a0001,0xb400000b,0xb00b00c0, +0xb460fffa,0x803f0000,0x80138000,0x1b7bb800, +0x003fb81b,0x00000000,0x00000000,0x80150000, +0x801bff84,0xb5000009,0x803f0000,0x80138000, +0x1b7bb800,0x003fb81b,0x00000000,0x00000000, +0x80150000,0x801bff84,0xb5000103,0x801bff84, +0x003f0084,0x3000b801,0x803eff84,0xb4000073, +0x801bff7c,0x00000000,0x94800080,0xb0040080, +0xb4200036,0x94800007,0x80730200,0xb0010002, +0xb420000e,0x80270265,0xb0040001,0xb4200003, +0x80130030,0x98000000,0xb5000006,0x80130030, +0x98000000,0xb0040000,0xb4000002,0x80130038, +0x98000000,0x98630060,0xb500001f,0xb0010000, +0xb420000e,0x80270225,0xb0040001,0xb4200003, +0x80130030,0x98001000,0xb5000006,0x80130030, +0x98001000,0xb0040000,0xb4000002,0x80130038, +0x98001000,0x98630000,0xb500000f,0xb0010001, +0xb420004a,0x80270225,0xb0040001,0xb4200003, +0x80130030,0x98002000,0xb5000006,0x80130030, +0x98000000,0xb0040000,0xb4000002,0x80130038, +0x98000000,0x98630040,0x806600a6,0x80530001, +0x98420100,0x1821b802,0xb500002d,0x94800007, +0xb0010002,0xb420000d,0x80270c65,0xb0040001, +0xb4200003,0x80130030,0x98000000,0xb5000006, +0x80130030,0x98000000,0xb0040000,0xb4000002, +0x80130038,0x98000000,0xb500001d,0xb0010000, +0xb420000d,0x80270c25,0xb0040001,0xb4200003, +0x80130030,0x98001000,0xb5000006,0x80130030, +0x98001000,0xb0040000,0xb4000002,0x80130038, +0x98001000,0xb500000e,0xb0010001,0xb4200017, +0x80270c25,0xb0040001,0xb4200003,0x80130030, +0x98002000,0xb5000006,0x80130030,0x98000000, +0xb0040000,0xb4000002,0x80130038,0x98000000, +0x806500d4,0x8053ffcf,0x9842cfff,0xb0040002, +0xb4200002,0x8053ffc7,0x9842c7ff,0x802600a1, +0x1463b802,0x1863b800,0x806600d4,0x807bff7c, +0x00000000,0x94630080,0xb0030080,0xb420000b, +0x807bff88,0x00000000,0xb0030001,0xb4000007, +0x802500a1,0x80670001,0x807eff88,0x80530001, +0x98420100,0x1821b802,0x802600a1,0x81070000, +0x011f62e2,0x011f62e3,0x011f0082,0xb0080000, +0xb4200004,0x81150010,0x00000000,0x00000000, +0x011f62de,0x011f0081,0xb0080001,0xb4200026, +0x81070020,0x011f25c1,0x81070180,0x011f62e1, +0x8344022a,0x8344024e,0x011f0082,0xb0080000, +0xb4200004,0x834401b1,0x8344019e,0xb00a0000, +0xb4200061,0x80c70000,0x00df25cb,0x83440261, +0x834405e7,0x02ff05b9,0x82a70000,0x82870000, +0x834403cf,0x92940001,0x3014b817,0xb480fffc, +0x8344067f,0x80270000,0x003f25dc,0x83440760, +0x003f05dc,0xb0010001,0xb4000003,0x802725d4, +0x003fb17a,0x00ffb81f,0x80d3001f,0x834725ac, +0x1b5ab806,0xb500002d,0xb0080002,0x81470004, +0xb4200045,0x81070008,0x011f25c1,0x81070480, +0x011f62e1,0x83440276,0x834402b0,0x011f0082, +0xb0080000,0xb4200004,0x8344019a,0x83440175, +0xb00a0000,0xb4200038,0x80c70000,0x00df25cb, +0x83440334,0x02df05cb,0x5ec2b816,0x834405ff, +0x02ff05b9,0x82a70000,0x82870000,0x834403a4, +0x92940001,0x3014b817,0xb480fffc,0x92b50001, +0xb0150003,0xb480fff8,0x83440651,0x80270000, +0x003f25dc,0x83440732,0x003f05dc,0xb0010001, +0xb4000003,0x8027268c,0x003fb17a,0x00ffb81f, +0x80d3001f,0x83472650,0x1b5ab806,0x80db78d8, +0x80fbffec,0x00000000,0x3006b807,0xb4200007, +0x00df05cb,0x90c60001,0x00df25cb,0xb006000c, +0xb4000002,0x035fb179,0x00ffb81f,0x80c70000, +0x00df25cb,0x80fb78dc,0x00000000,0x90e70001, +0xb00701b9,0xb4a00001,0x80e70001,0x80fe78dc, +0xb500feb0,0x802500a5,0x8153001f,0x3001b80a, +0xb420fffc,0x00ffb81f,0x001f42ea,0x1800b80a, +0x001f62ea,0x017f4047,0x5963b80b,0x0187b860, +0x118cb80b,0x81b380fe,0x99ad0000,0x300cb80d, +0xb4800003,0x81b30002,0x99ad0000,0x058cb80d, +0x003fb80c,0x00000000,0x00000000,0x81550000, +0x0187b860,0x5988b80c,0x5d8bb80c,0x958cffff, +0xb00cc000,0xb4800002,0x858cc000,0x918c8000, +0x81b3001f,0x198cb80d,0x801bffec,0x00000000, +0x819effec,0x019fb174,0x05acb800,0x300cb800, +0xb4600001,0x91ad4000,0x001f917c,0x1000b80d, +0x001fb17c,0x80171000,0x80971400,0x80270000, +0xb6001003,0xb6002002,0x001fa021,0x009fa021, +0x80171800,0xb6000602,0xb6002001,0x001fa021, +0x806f001f,0x80af001f,0x80a76604,0x80271400, +0xb6001004,0x01efb801,0x01afb805,0xb520ffff, +0x90a50080,0x80a76e04,0x80271400,0xb6001004, +0x01efb801,0x01afb805,0xb520ffff,0x90a50080, +0x81472000,0x015fb179,0x00ffb81f,0x00000000, +0x811be024,0x0107b860,0x95080007,0xb0080000, +0xb4000004,0xa5080008,0x00000000,0x0155b808, +0x00000000,0x8115000c,0x856b000c,0xb0080fff, +0xb400000b,0x81550004,0x856b0004,0x5904b808, +0x1908b80a,0x95080fff,0xb0080fff,0xb4000004, +0x81470001,0xb00b0020,0xb440fff6,0xb500000c, +0x81d50004,0x856b0004,0x00000000,0xb00e000f, +0xb400fffb,0x940b0007,0xb0000000,0xb420ffed, +0x001f42ea,0x9400fffe,0x81470000,0x001f62ea, +0x00ffb81a,0x950e0008,0x5d03b808,0x00000000, +0xb0080000,0xb40000c9,0x011f2080,0x950e0006, +0x5d01b808,0x81270004,0x0529b808,0x950e0001, +0x013f2081,0x011f2082,0x81150004,0x00000000, +0xb0080000,0xb40000bd,0xb008000f,0xb40000bb, +0x011f2083,0x81150002,0x00000000,0x81670004, +0xb0080002,0xb46000b5,0x011f2084,0x013f0081, +0xb0090002,0xb4200011,0x013f0083,0xb0080000, +0xb4200002,0x81077844,0xb5000005,0xb0080001, +0xb4200002,0x81077884,0xb5000001,0x81077824, +0x013f0083,0x5921b809,0x1129b808,0x0119b809, +0x00000000,0x00000000,0x011f6047,0x81150001, +0x00000000,0x011f2085,0x81150001,0x00000000, +0x011f2086,0x81350002,0x00000000,0x013f2087, +0x81150002,0x00000000,0x011f2088,0x81150001, +0x00000000,0x011f2089,0x81150001,0x00000000, +0x011f208a,0x81150002,0x00000000,0x011f208b, +0x81070001,0xb0090003,0xb4000001,0x81070002, +0x011f25b9,0x81070020,0x013f0081,0xb0090002, +0xb4200065,0x85290001,0xad29000f,0x00000000, +0x011f0083,0x1108b809,0x5901b808,0x910877c8, +0x0139b808,0x011f05b9,0x85080001,0x6928b809, +0x011f0084,0xb0090038,0xb4800007,0xb0080001, +0xb4000002,0xb0090050,0xb4400003,0x81270000, +0x8107001b,0xb5000010,0xb0080001,0xb4000005, +0xb0090060,0xb4800003,0x81270001,0x8107001e, +0xb5000009,0xb0080002,0xb4000005,0xb0090030, +0xb4400003,0x81270002,0x81070008,0xb5000002, +0x81270003,0x8107000c,0x011f25bb,0x013f25c0, +0xb0090002,0xb460001b,0x80477604,0x5c42b802, +0x814fffc0,0x80cf0037,0x005fb178,0x5842b802, +0x01cfb802,0x005f9178,0xb520ffff,0x90420020, +0x814fb580,0x80cf0057,0x005fb178,0x5842b802, +0x01cfb802,0x005f9178,0xb520ffff,0x804778a4, +0x5c42b802,0x814f39c0,0x80cf002f,0x005fb178, +0x5842b802,0x01cfb802,0x005f9178,0xb520ffff, +0xb5000021,0x804776e0,0x5c42b802,0x814fef40, +0x80cf0037,0x005fb178,0x5842b802,0x01cfb802, +0x005f9178,0xb520ffff,0x8297013c,0x8317018c, +0xb6000602,0x005f8034,0x031fa022,0x82970124, +0x83170160,0xb6000602,0x005f8034,0x031fa022, +0x8297010c,0x83170134,0xb6000602,0x005f8034, +0x031fa022,0x804778c4,0x5c42b802,0x814f1080, +0x80cf002f,0x005fb178,0x5842b802,0x01cfb802, +0x005f9178,0xb520ffff,0x013f0081,0xb0090001, +0xb420000e,0x808f0000,0x806f001b,0x80af001b, +0x80277758,0x5c22b801,0x80670037,0x00cfb803, +0x003fb178,0x5822b801,0x01cfb801,0x003f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x011f25bb, +0x011f0087,0xb0080001,0xb4000002,0x011f05bb, +0xb5000003,0x011f0088,0x91080001,0x5902b808, +0x011f25ba,0x81470000,0x00ffb81a,0x81470008, +0x00ffb81a,0x81270000,0x81470000,0x300842de, +0xb400000b,0x013f42e2,0x91290001,0x013f62e2, +0x013f42e3,0x91290001,0x013f62e3,0x83640006, +0x00000000,0x00000000,0x013f42e2,0x81470002, +0x013f62e2,0x00ffb81a,0x00ffb81b,0x83640041, +0x80c70004,0x80270000,0xb600200d,0x00ff05b9, +0x5c42b801,0x300205ba,0xb4800001,0x80e70001, +0x80470000,0xb6270005,0x1062b801,0x914301b8, +0x00fff00a,0x83840050,0x90420080,0x90210004, +0x00ffb81a,0x8364002f,0x017f05bb,0x800700bc, +0x80270000,0xb00b0000,0xb4000015,0xb62b0014, +0x00ff05b9,0x5c42b801,0x300205ba,0xb4800001, +0x80e70001,0x80470000,0xb0070000,0xb400000b, +0xb627000a,0x1062b801,0x914301b8,0x00fff00a, +0x5c62b801,0x1063b800,0x00bff003,0x90650134, +0x00dff003,0x83840034,0x90420080,0x90210004, +0x019f05b9,0x80c70002,0x80270000,0xb00b0000, +0xb400000f,0xb62b000e,0x80470000,0xb00c0000, +0xb400000a,0xb62c0009,0x1062b801,0x914301b8, +0x00fff00a,0xb0070000,0xb4000003,0x906302b8, +0x00fff003,0x83840020,0x90420080,0x90210004, +0x00ffb81a,0x8107ffff,0x80c70004,0x00ff0083, +0x83840019,0x80c70002,0x00ff0084,0x83840016, +0x80c70001,0x00ff0085,0x83840013,0x80c70001, +0x00ff0086,0x83840010,0x80c70002,0x00ff0087, +0x8384000d,0x80c70002,0x00ff0088,0x8384000a, +0x80c70001,0x00ff0089,0x83840007,0x80c70001, +0x00ff008a,0x83840004,0x80c70002,0x00ff008b, +0x83840001,0x00ffb81b,0x80a70001,0x64a6b805, +0x5ca1b805,0xb0050000,0xb400000e,0x95288000, +0xb0090000,0xb4000001,0x81270001,0x5901b808, +0x1547b805,0xb00a0000,0xb4000001,0x81470001, +0x2129b80a,0xb0090000,0xb4000001,0xa1088005, +0xb500ffef,0x9508ffff,0x00ffb81c,0x015f05ba, +0x013f05b9,0x800700bc,0xb0090000,0xb400000f, +0xb00a0000,0xb400000d,0x80270000,0xb62a000b, +0x80470000,0xb6290008,0x80950004,0x5865b802, +0x1063b801,0x5862b803,0x906301b8,0x0217b803, +0x90420001,0x021fa004,0x90210001,0xa54a0020, +0xb4c0000e,0xb0090000,0xb400000c,0xb62a000b, +0x80950004,0x80470000,0xb6290007,0x5865b802, +0x1063b801,0x5862b803,0x906301b8,0x0217b803, +0x90420001,0x021fa004,0x90210001,0x00ffb81a, +0x013f05b9,0xb0090000,0xb4000019,0x80270000, +0xb6002017,0x80470000,0xb6290014,0x5865b802, +0x1063b801,0x5862b803,0x914301b8,0x009ff00a, +0xad420060,0x00000000,0x114ab801,0x5942b80a, +0x914a1c80,0x0217b80a,0xb0040000,0xb4000004, +0x80950006,0x00000000,0x021fa004,0xb5000002, +0x8087003f,0x021fa004,0x90420001,0x90210001, +0x00ffb81a,0x8257ffff,0x82d7ffff,0x011f05ba, +0x013f05b9,0x80270000,0xb0090000,0xb400002b, +0xb6280015,0x80470000,0xb6290012,0x5865b802, +0x1063b801,0x5862b803,0x914301b8,0xaca20060, +0x009ff00a,0x10a5b801,0x58a2b805,0x90a502b8, +0x0217b805,0x80670000,0xb0040000,0xb4000003, +0x90840001,0x0075b804,0x00000000,0x021fa003, +0x90420001,0x90210001,0xa5480020,0xb4000013, +0x5822b801,0xb62a0011,0x914101b8,0x90a102b8, +0x0217b805,0x009ff00a,0xb0040000,0x80670000, +0xb4000002,0x90840001,0x0075b804,0xb6290006, +0x021fa203,0x009f8210,0x009f8210,0x009f8210, +0x009f8210,0x009f8210,0x90210004,0x00ffb81a, +0x015f05ba,0x013f05b9,0x800700bc,0xb0090000, +0xb4000013,0xb00a0000,0xb4000011,0x80270000, +0xb62a000f,0x80470000,0xb629000c,0x1080b801, +0x007ff004,0x90830134,0x007ff004,0x0095b803, +0x5865b802,0x1063b801,0x5862b803,0x906301b8, +0x0217b803,0x90420001,0x021fa004,0x90210001, +0x011f05bb,0x254ab808,0xb4c0000d,0xb62a000c, +0x1080b801,0x007ff004,0x90830134,0x007ff004, +0x0095b803,0x5862b801,0x906301b8,0x0217b803, +0x90210001,0x021fa204,0x007f8210,0x021fa004, +0xa5480020,0xb4c0000e,0xb0090000,0xb400000c, +0x80870000,0xb62a000a,0x80470000,0xb6290007, +0x5865b802,0x1063b801,0x5862b803,0x906301b8, +0x0217b803,0x90420001,0x021fa004,0x90210001, +0x00000000,0x00000000,0x00ffb81a,0x011f05bb, +0x013f05b9,0xb0080000,0xb4000015,0xb0090000, +0xb4000013,0x00000000,0x80270000,0xb6280010, +0x80470000,0xb629000d,0x5865b802,0x1063b801, +0x5862b803,0x914301b8,0x009ff00a,0xb0040000, +0xb4000005,0x80950002,0x906302b8,0x0217b803, +0x00000000,0x021fa004,0x90420001,0x90210001, +0xa5480020,0xb00a0000,0xb4000010,0xb0090000, +0xb400000e,0x00000000,0x80870000,0xb62a000b, +0x80470000,0xb6290008,0x5865b802,0x1063b801, +0x5862b803,0x906302b8,0x0217b803,0x00000000, +0x021fa004,0x90420001,0x90210001,0xb0080000, +0xb400004c,0xb0090000,0xb400004a,0x00000000, +0x80270000,0xb6280047,0x80470000,0xb6290044, +0x5865b802,0x1063b801,0x5862b803,0x914301b8, +0x009ff00a,0xad420060,0x00000000,0x00000000, +0x00000000,0x114ab801,0x5942b80a,0x914a1c80, +0x0217b80a,0xb0040000,0xb400002e,0x906302b8, +0x009ff003,0xb0040000,0xb420000a,0x80950006, +0x00000000,0x021fa204,0x80950006,0x015f8210, +0x021fa204,0x80950006,0x015f8210,0x021fa004, +0xb5000026,0xb0040001,0xb4200009,0x80950006, +0x00000000,0x021fa204,0x015f8210,0x021fa204, +0x80950006,0x015f8210,0x021fa004,0xb500001b, +0xb0040003,0xb4200009,0x80950006,0x00000000, +0x021fa204,0x80950006,0x015f8210,0x021fa204, +0x015f8210,0x021fa004,0xb5000010,0xb0040002, +0xb420000e,0x80950006,0x00000000,0x021fa204, +0x015f8210,0x021fa204,0x015f8210,0x021fa004, +0xb5000006,0x8087003f,0x021fa204,0x015f8210, +0x021fa204,0x015f8210,0x021fa004,0x90420001, +0x90210001,0xa5480020,0xb4c00011,0xb0090000, +0xb400000f,0x8087003f,0x5862b801,0x90631afc, +0xb62a000b,0x90630004,0x0047b803,0xb6290008, +0x90420180,0x0217b802,0x00000000,0x021fa204, +0x003f8210,0x021fa204,0x003f8210,0x021fa004, +0x00ffb81a,0x8257ffff,0x82d7ffff,0x011f05bb, +0x013f05b9,0x80270000,0x00e7b809,0x300105ba, +0xb4800001,0x80e70001,0x800700bc,0x80470000, +0xb0070000,0xb400004c,0xb627004b,0x5865b802, +0x1063b801,0x5862b803,0x914301b8,0xaca20060, +0x009ff00a,0x10a5b801,0x58a2b805,0x90a502b8, +0x0217b805,0xb0040000,0xb400002b,0x1060b801, +0x00bff003,0x10a5b804,0x90650160,0x00dff003, +0xb0060003,0xb4200007,0x90650134,0x00dff003, +0xb6000303,0x0075b806,0x021fa203,0x007f8210, +0xb5000021,0x5861b805,0x906300dc,0x009fd803, +0x90650134,0x00dff003,0xaca20060,0x00000000, +0x00000000,0x00000000,0x0075b806,0x10a5b801, +0x58a2b805,0x90a502b8,0x0217b805,0x588fb804, +0xb600030c,0xb6001007,0x04a3b804,0xb4600002, +0x58a1b803,0xb5000002,0x58a1b805,0x90a50001, +0x0067b805,0x9465ffff,0x5d50b805,0x021fa20a, +0x015f8210,0xb5000004,0x81470000,0xb6000302, +0x021fa20a,0x009f8210,0x009f05b9,0xb0040002, +0xb420000c,0x300105ba,0xb480000a,0x58a2b801, +0x90a502b8,0x0217b805,0x90a50180,0x0297b805, +0xb6000304,0x00bf8210,0x009f8210,0x029fa205, +0x009f8214,0x90420001,0x90210001,0x3001b808, +0xb480ffa9,0xa5480020,0xb00a0000,0xb4000015, +0xb0090000,0xb4000013,0x58a2b801,0x90a502b8, +0xb62a0010,0x80470000,0xb629000d,0xaca20060, +0x00000000,0x00000000,0x00000000,0x80670000, +0x10a5b801,0x58a2b805,0x90a502b8,0x0217b805, +0xb6000302,0x021fa203,0x00bf8210,0x90420001, +0x90210001,0x00ffb81a,0x00000000,0x00000000, +0x80770000,0x8057ffff,0x80f70000,0x80d7ffff, +0x81770000,0x8157ffff,0x81f70000,0x81d7ffff, +0xac140060,0xac350020,0x00000000,0x00000000, +0x12c0b801,0x5ac2b816,0x92d61980,0x83a400a5, +0xad940400,0x009f9173,0x013f05ca,0x914c6604, +0x114ab804,0x001f97e0,0x001eb80a,0xb0090000, +0xb4000003,0x80a76e44,0x80c76644,0xb5000002, +0x80a76644,0x80c76e44,0x808f000f,0x806f0000, +0x80af000e,0x80cf07e1,0x11e5b80c,0x11efb804, +0x5de2b80f,0x01ffb178,0x59e2b80f,0x01afb80f, +0x01ff9178,0x0047b86f,0xb0020001,0xb4c0fffd, +0x80cf07f0,0x1206b80c,0x1210b804,0x5e02b810, +0x021fb178,0x5a02b810,0x01afb810,0x021f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x916c6e04, +0x116bb804,0x001f97ff,0x001eb80b,0x808f0000, +0x806f001f,0x80af001f,0x90ac6604,0x5ca2b805, +0x80270400,0xb600080a,0x00cfb801,0x00bfb178, +0x58a2b805,0x01cfb805,0x00bf9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x90210020,0x90a50020, +0x90ac6e04,0x5ca2b805,0x80270500,0xb600080a, +0x00cfb801,0x00bfb178,0x58a2b805,0x01cfb805, +0x00bf9178,0x0047b86f,0xb0020001,0xb4c0fffd, +0x90210020,0x90a50020,0x81530020,0xac140060, +0xac350020,0x80170800,0x80d7003c,0x12c0b801, +0x5ac2b816,0x92d602b8,0x0117b816,0x90241000, +0x0097b801,0x80470000,0x4002b803,0xb6000804, +0x005f8020,0x480287e4,0x005f8020,0x500287e4, +0x00000000,0x00000000,0x00000000,0x1021b80a, +0x5c36b801,0x5801b800,0x18c0b801,0xb0090000, +0xb4000002,0x90641440,0xb5000001,0x90641040, +0xb6000f0d,0x0097b803,0x80470000,0x4002b803, +0xb6001002,0x005f8020,0x480287e4,0x0108a026, +0x90630040,0x00000000,0x1021b80a,0x5c36b801, +0x5801b800,0x18c0b801,0x90641400,0x0097b803, +0x80470000,0x4002b803,0x005f8020,0x005f87e4, +0xb6000802,0x005f8040,0x480287c4,0x005f87e0, +0x0108a026,0x00000000,0x1021b80a,0x5c36b801, +0x5801b800,0x18c0b801,0xb0090000,0xb4000002, +0x906417c0,0xb5000001,0x906413c0,0xb6000f0f, +0x0097b803,0x80470000,0x4002b803,0xb6000804, +0x005f8020,0x500287e4,0x005f8020,0x480287e4, +0x0108a026,0x84630040,0x00000000,0x1021b80a, +0x5c36b801,0x5801b800,0x18c0b801,0xb0140000, +0xb4200005,0x90840004,0x9484003f,0x009fb173, +0xa1290001,0x013f25ca,0x80d7ffff,0x0108a026, +0x00ffb81a,0x81330004,0x8093007f,0x9884ffff, +0x80b3ff80,0x0017b816,0x90360040,0x0097b801, +0x81530010,0xb6001004,0x400a8000,0x404a8004, +0x0008a020,0x0088a022,0x0017b816,0x9036007c, +0x0097b801,0x81171000,0xb6001004,0x40048020, +0x480487e4,0x00000000,0x0108a020,0x81470000, +0x81670001,0x81870008,0x81a70040,0x81c707c4, +0x81e70040,0xb6000432,0xb00a0001,0xb4e00004, +0x80c71000,0x80e71000,0x81171040,0xb5000003, +0x80c71040,0x80e71040,0x81171000,0x844d0004, +0x10e7b802,0xb62b001f,0x0017b806,0x0097b807, +0xb62c0004,0x40048020,0x480487e4,0x00000000, +0x0108a020,0x0017b806,0x0097b807,0x0197b80e, +0x00000000,0x001f8020,0x042087e4,0xb62c000f, +0x4041800c,0x001f8020,0x0048b802,0x5e38802c, +0x2e11b801,0x042087e4,0x1042b810,0x0462b804, +0xb4a00002,0x0047b804,0xb5000003,0x0462b805, +0xb4600001,0x0047b805,0x011fa022,0x10c6b80f, +0x10e7b80f,0x5961b80b,0x5d81b80c,0x5da1b80d, +0x5de1b80f,0x914a0001,0x954a0001,0x11ceb80f, +0x80171018,0x81171fcc,0x80470000,0x41448020, +0x494487c0,0x00000000,0x0188b80a,0x494487e0, +0x00000000,0x0148b80a,0x0502a10a,0x4145b80c, +0x494580e0,0x00000000,0x0108a5ea,0x41448080, +0x494487c0,0x00000000,0x0108a78a,0x49448020, +0x00000000,0x0108a2ea,0x41448020,0x49448720, +0x00000000,0x0188b80a,0x4145b80c,0x49458080, +0x494587a0,0x00000000,0x0108a68a,0x4145b80c, +0x49458080,0x494587a0,0x00000000,0x0108a08a, +0x4145b80c,0x49458020,0x49458040,0x00000000, +0x0188b80a,0x494587e0,0x00000000,0x0108a08a, +0x4144b80c,0x494587a0,0x00000000,0x0108a52a, +0x41448080,0x49448040,0x494486c0,0x00000000, +0x0108a04a,0x41448040,0x49448720,0x00000000, +0x0108a36a,0x04028020,0x011fa420,0x001f8040, +0x011fa100,0x001f8080,0x011fa080,0x001f8100, +0x011fa040,0x001f8660,0x011fa120,0x41458020, +0x49458000,0x00000000,0x0108a00a,0x0017b816, +0x9036007c,0x0097b801,0x81171000,0x81970784, +0x00000000,0x001f8020,0x042087e4,0xb600100f, +0x4041800c,0x001f8020,0x0048b802,0x5e38802c, +0x2e11b801,0x042087e4,0x1042b810,0x0462b804, +0xb4a00002,0x0047b804,0xb5000003,0x0462b805, +0xb4600001,0x0047b805,0x011fa022,0x81470000, +0x81670001,0x81870008,0x81a70040,0x81c707c4, +0x81e70040,0xb6000432,0xb00a0001,0xb4e00004, +0x80c71000,0x80e71000,0x81171040,0xb5000003, +0x80c71040,0x80e71040,0x81171000,0x844d0004, +0x10e7b802,0xb62b001f,0x0017b806,0x0097b807, +0xb62c0004,0x40048020,0x480487e4,0x00000000, +0x0108a020,0x0017b806,0x0097b807,0x0197b80e, +0x00000000,0x001f8020,0x042087e4,0xb62c000f, +0x4041800c,0x001f8020,0x0048b802,0x5e38802c, +0x2e11b801,0x042087e4,0x1042b810,0x0462b804, +0xb4a00002,0x0047b804,0xb5000003,0x0462b805, +0xb4600001,0x0047b805,0x011fa022,0x10c6b80f, +0x10e7b80f,0x5961b80b,0x5d81b80c,0x5da1b80d, +0x5de1b80f,0x914a0001,0x954a0001,0x11ceb80f, +0x80171034,0x81171f84,0x80470000,0x41448040, +0x49448640,0x00000000,0x0188b80a,0x49448100, +0x49448780,0x00000000,0x0108a08a,0x4144b80c, +0x49448040,0x49448080,0x494487c0,0x00000000, +0x0108a16a,0x4145b80c,0x49458700,0x00000000, +0x0188b80a,0x494581a0,0x494586e0,0x00000000, +0x0108a66a,0x4145b80c,0x49448040,0x494487e0, +0x00000000,0x0188b80a,0x011fa1ec,0x4145b80c, +0x49458100,0x49458780,0x00000000,0x0108a08a, +0x41458720,0x49458100,0x494586e0,0x49458160, +0x49458020,0x49458020,0x49458760,0x00000000, +0x0108a08a,0x414587a0,0x49458080,0x49458760, +0x494580c0,0x49458700,0x49458140,0x49458020, +0x49458760,0x00000000,0x0108a74a,0x414587a0, +0x49458080,0x49458760,0x494580e0,0x49458700, +0x49458120,0x49458020,0x49458760,0x00000000, +0x0108a08a,0x41458720,0x49458100,0x494586e0, +0x49458140,0x49458040,0x49458020,0x49458720, +0x00000000,0x0108a0ca,0x41458080,0x49458040, +0x49458020,0x49458620,0x00000000,0x0188b80a, +0x49458080,0x00000000,0x0108a7ca,0x4144b80c, +0x49458040,0x49458020,0x49458080,0x00000000, +0x0108a5ea,0x41448080,0x49448700,0x00000000, +0x0188b80a,0x49448780,0x00000000,0x0108a7ca, +0x4144b80c,0x49448140,0x00000000,0x0108a7ca, +0x49448040,0x00000000,0x0108a0ca,0x41448700, +0x00000000,0x0188b80a,0x49448000,0x00000000, +0x0108a04a,0x011fa00c,0x80171f80,0xb6002006, +0x40048000,0x48048000,0x48048000,0x48048000, +0x00000000,0x0008a020,0x00ffb81d,0x00000000, +0x80770000,0x8057ffff,0x015f05b9,0x017f05bb, +0x8293ffff,0x9a94ffff,0x81a70000,0xb62a003a, +0xaded0180,0xae0d0180,0xadcd0080,0x902f1980, +0x0017b801,0xb6002033,0x904e01b8,0x00000000, +0x013ff002,0xb0090000,0xb400001f,0x904f02b8, +0x80c70000,0x011fd802,0x6829b808,0x94210001, +0xb0010001,0xb4e00001,0x00c7b814,0x6429b806, +0x80470001,0x6449b802,0x84420001,0x1442b808, +0x84690001,0x5863b803,0x906300dc,0x1042b801, +0x003f9803,0x90420001,0x4082b801,0x90630004, +0x003f9803,0x00000000,0x5897b804,0x1804b805, +0x4082b801,0x00000000,0x00000000,0x00000000, +0x10a4b800,0xb5000001,0x80a70000,0x90501c80, +0x00000000,0x007ff002,0x5842b803,0x904205f8, +0x0097b802,0x00000000,0x40058004,0x48058004, +0x00000000,0x0008a020,0x91ce0004,0x91ef0004, +0x92100004,0x91ad0001,0x00ffb81a,0x80770000, +0x8057ffff,0x80d7ffff,0x015f05b9,0x017f05bb, +0x8293ff80,0x9a940000,0x82a70020,0x81a70000, +0x81e702b8,0x80171980,0xb62a004f,0xb600034d, +0xac0d0080,0xac4d0180,0xac960080,0x822700bc, +0x91c001b8,0x00000000,0x1042b804,0x92021c80, +0xb62b003a,0x013ff00e,0x00fff011,0xb0090000, +0xb4000027,0x10e7b809,0x5821b807,0x902100dc, +0x00000000,0x001fd801,0x82470000,0x80270001, +0x6452b801,0x3002b800,0xb4600002,0x92520001, +0xb500fffb,0x86520001,0x80c70000,0x011fd80f, +0x6832b808,0xb0010001,0xb4e00001,0x00c7b814, +0x84520017,0x0056b802,0x80270001,0x6432b801, +0x84210001,0x1408b801,0x6402b800,0x10c6b800, +0x9027018c,0x00000000,0x001ff001,0x5802b800, +0x9020073c,0x904006f8,0x007f9801,0x0097b802, +0x10c6b803,0x40868004,0x48868004,0xb5000003, +0x80c70000,0x40868004,0x00000000,0x0088b804, +0x003ff010,0x5822b801,0x902105f8,0x0097b801, +0x91ce0004,0x91ef0004,0x40448004,0x48448004, +0x92100004,0x0008a022,0x92310001,0x0435b80b, +0xb4000007,0x80870000,0xb6210005,0x001fa024, +0x91ce0004,0x91ef0004,0x92100004,0x92310001, +0x00000000,0x91ad0001,0x00ffb81a,0x00000000, +0x007f05b9,0x001f0081,0xb0000001,0xb4400029, +0x001f05d8,0xac400080,0x801702b8,0x80970438, +0x90421800,0x0117b802,0x8087ffff,0x80b3ffff, +0x80d3007f,0x98c6ff00,0x80f3ff80,0x81070080, +0xb6002018,0x10088020,0x0056b800,0x0442b806, +0xb4a00004,0xb0000000,0x0007b806,0xb4400001, +0x0007b807,0x0027b800,0x5c08b800,0x1400b804, +0xb0030001,0xb4000008,0x10288024,0x0056b801, +0x0442b806,0xb4a00004,0xb0010000,0x0027b806, +0xb4400001,0x0027b807,0x5828b801,0x1421b805, +0x1900a021,0x001f05d8,0x90000001,0x001f25d8, +0x00ffb81a,0x801702b8,0x80970438,0x81171800, +0x8087ffff,0x80b3ffff,0x80d3007f,0x98c6ff00, +0x80f3ff80,0x81070080,0xb6006018,0x10088020, +0x0056b800,0x0442b806,0xb4a00004,0xb0000000, +0x0007b806,0xb4400001,0x0007b807,0x0027b800, +0x5c08b800,0x1400b804,0xb0030001,0xb4000008, +0x10288024,0x0056b801,0x0442b806,0xb4a00004, +0xb0010000,0x0027b806,0xb4400001,0x0027b807, +0x5828b801,0x1421b805,0x1900a021,0x00ffb81a, +0x001f0081,0xb0000001,0xb4400006,0x001f05d8, +0xb0000003,0xb4000003,0x80270001,0x003f25dc, +0x00ffb81a,0x003f05d9,0x009f05cb,0xb0010000, +0xb400000e,0x015f42ed,0x81070000,0x8127017c, +0xb00a0000,0xb4000002,0x81070180,0x812702fc, +0x802500a5,0x9421ffff,0x3001b808,0xb4800011, +0x3001b809,0xb4a00079,0xb500000e,0x001f0081, +0xb0000001,0xb4400003,0xb0040002,0xb4200006, +0xb5000002,0xb0040000,0xb4200003,0x802702ff, +0x81470000,0xb5000003,0x80270001,0x003f25d9, +0x81470180,0xb0040000,0xb4200001,0x83840348, +0x80070000,0x001f25d8,0x009f902d,0x80af001f, +0x808f0000,0x806f0000,0x8007ffff,0x8033ffff, +0x80171800,0x807bff8c,0x94630003,0xb0030003, +0xb4000016,0xb0030002,0xb4000035,0xb0030001, +0xb4000024,0xb6006010,0x14618000,0x6068b803, +0x40c4b803,0x14608000,0x00c8b806,0x5870b803, +0x6068b803,0x4104b803,0x58c8b806,0x0108b808, +0x14c6b801,0x00000000,0x00000000,0x5d08b808, +0x1508b800,0x1806a028,0xb5000030,0xb6006010, +0x14618000,0x6068b803,0x40c4b803,0x14608000, +0x00c8b806,0x5870b803,0x6068b803,0x4104b803, +0x5cc8b806,0x0108b808,0x14c6b800,0x00000000, +0x00000000,0x5908b808,0x1508b801,0x1806a028, +0xb500001e,0xb600600d,0x14618000,0x6068b803, +0x40c4b803,0x00000000,0x00c8b806,0x00000000, +0x00000000,0x00000000,0x5d08b806,0x1508b800, +0x58c8b806,0x14c6b801,0x1806a028,0xb500000f, +0xb600600e,0x14608000,0x5868b803,0x6068b803, +0x40c4b803,0x00000000,0x00c8b806,0x00000000, +0x00000000,0x00000000,0x5d08b806,0x1508b800, +0x58c8b806,0x14c6b801,0x1806a028,0x80670600, +0x5d22b80a,0xb600030a,0x00cfb803,0x013fb178, +0x5922b809,0x01afb809,0x013f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x90630020,0x91290020, +0x81270180,0xb00a0000,0xb4000001,0x81270000, +0x013f62ed,0x80270001,0x003f25dc,0x00ffb81a, +0x001f0081,0xb0000001,0xb4400006,0x001f05d8, +0xb0000003,0xb4000003,0x80270001,0x003f25dc, +0x00ffb81a,0x003f05d9,0x009f05cb,0xb0010000, +0xb400000e,0x015f42ed,0x81070000,0x8127017c, +0xb00a0000,0xb4000002,0x81070180,0x812702fc, +0x802500a5,0x9421ffff,0x3001b808,0xb4800011, +0x3001b809,0xb4a00079,0xb500000e,0x001f0081, +0xb0000001,0xb4400003,0xb0040002,0xb4200006, +0xb5000002,0xb0040000,0xb4200003,0x802702ff, +0x81470000,0xb5000003,0x80270001,0x003f25d9, +0x81470180,0xb0040000,0xb4200001,0x838402b4, +0x80070000,0x001f25d8,0x009f902d,0x80af001f, +0x808f0000,0x806f0000,0x8007ffff,0x8033ffff, +0x80171800,0x807bff8c,0x94630003,0xb0030003, +0xb4000016,0xb0030002,0xb4000035,0xb0030001, +0xb4000024,0xb6006010,0x14618000,0x6068b803, +0x40c4b803,0x14608000,0x00c8b806,0x5870b803, +0x6068b803,0x4104b803,0x58c8b806,0x0108b808, +0x14c6b801,0x00000000,0x00000000,0x5d08b808, +0x1508b800,0x1806a028,0xb5000030,0xb6006010, +0x14618000,0x6068b803,0x40c4b803,0x14608000, +0x00c8b806,0x5870b803,0x6068b803,0x4104b803, +0x5cc8b806,0x0108b808,0x14c6b800,0x00000000, +0x00000000,0x5908b808,0x1508b801,0x1806a028, +0xb500001e,0xb600600d,0x14618000,0x6068b803, +0x40c4b803,0x00000000,0x00c8b806,0x00000000, +0x00000000,0x00000000,0x5908b806,0x1508b801, +0x5cc8b806,0x14c6b800,0x1806a028,0xb500000f, +0xb600600e,0x14608000,0x5870b803,0x6068b803, +0x40c4b803,0x00000000,0x00c8b806,0x00000000, +0x00000000,0x00000000,0x5908b806,0x1508b801, +0x5cc8b806,0x14c6b800,0x1806a028,0x80670600, +0x5d22b80a,0xb600030a,0x00cfb803,0x013fb178, +0x5922b809,0x01afb809,0x013f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x90630020,0x91290020, +0x81270180,0xb00a0000,0xb4000001,0x81270000, +0x013f62ed,0x80270001,0x003f25dc,0x00ffb81a, +0x029fb024,0x02bfb025,0x02dfb026,0x02ffb027, +0x031fb028,0x033fb029,0x033f4046,0x0287b86f, +0x029fb02a,0x8285009d,0x9a940008,0x8286009d, +0x8285009c,0x96b48000,0xb0158000,0xb40001b5, +0x96b40100,0xb0150100,0xb400020b,0x96b40400, +0xb0150400,0xb400020c,0x96b40001,0xb0150001, +0xb400000c,0x96b40008,0xb0150008,0xb40001ad, +0x96b44000,0xb0154000,0xb400020b,0x96b40002, +0xb0150002,0xb4000182,0x00000000,0x00000000, +0xb500021d,0x02bf917e,0x92b50001,0x02bfb17e, +0x82850082,0x96f40001,0xb0170000,0xb4000171, +0x5efdb814,0x96f70001,0xb0170001,0xb420000b, +0x83050069,0x9718003f,0x82e50064,0x12f7b818, +0x86f70109,0x82feff74,0x02e7b86f,0x9af74000, +0x01ffb817,0x96f7bfff,0x01ffb817,0x83050081, +0x82a5009a,0x96b50001,0xb0150001,0xb4200014, +0x82a70000,0x02bfb17e,0x96b41840,0xb0150800, +0xb420000c,0x96b40008,0x5aa9b815,0x96d46000, +0x5ec3b816,0x82f3000f,0x9af7c00f,0x1718b817, +0x1ab5b818,0x1ab5b816,0x9ab50340,0x82a60081, +0xb500014c,0x9b180180,0x83060081,0xb5000149, +0x82a5009a,0x96b50002,0xb0150002,0xb420001b, +0x82a70000,0x02bfb17e,0x96b41800,0xb0151800, +0xb4000013,0x96b40040,0xb0150040,0xb4200004, +0xa3180c00,0x9b180340,0x83060081,0xb5000139, +0x96b40008,0x5aa9b815,0x96d46000,0x5ec3b816, +0x82f3000f,0x9af7c00f,0x1718b817,0x1ab5b818, +0x1ab5b816,0x9ab50340,0x82a60081,0xb500012d, +0x9b180180,0x83060081,0xb500012a,0x82a500c1, +0x96b5000f,0xb015000b,0xb420000e,0x96b40020, +0xb0150020,0xb400000b,0x96b40200,0xb0150200, +0xb4000008,0x82c50086,0x82e50094,0x3016b817, +0xb4400004,0x06f7b816,0xb017ff00,0xb4400001, +0xb5000118,0x96b46000,0xb0156000,0xb4000011, +0x96b41820,0xb0150820,0xb4200004,0x9b391000, +0x82a5009a,0x96b5feff,0x82a6009a,0x96b40040, +0xb0150040,0xb4200001,0x9739efff,0x96b91000, +0xb0151000,0xb4200003,0x82a5009a,0x9ab50100, +0x82a6009a,0x96b40040,0xb0150040,0xb4200019, +0x96b41800,0xb0151800,0xb4200006,0x96b98000, +0xb0158000,0xb4200003,0x9b180180,0x83060081, +0xb50000f8,0x96d80c00,0x82b300ff,0x9ab5f3ff, +0x1718b815,0xb0160c00,0xb4000007,0x82e50098, +0x96f70400,0xb0170400,0xb4200002,0x82c70c00, +0xb5000001,0xa2d60c00,0x1b18b816,0x9b180340, +0xb50000c4,0x96b40220,0xb0150000,0xb4e00021, +0x82a5009d,0x82f3ffff,0x16b5b817,0x82f33800, +0x3015b817,0xb420001b,0x96f98000,0xb0178000, +0xb4000018,0x82a70000,0x02bfb17e,0x82c5009d, +0x96d6ffff,0x82b3c800,0x9ab58001,0x82e500c1, +0x96f7000f,0xb017000b,0xb4000002,0x82b38800, +0x9ab58001,0x1ab5b816,0x82c5009a,0x96d60020, +0xb0160020,0xb4200002,0x82b3c800,0x9ab58001, +0x82a6009d,0x02ff917e,0x00000000,0xb0170040, +0xb4800000,0x5eb5b814,0x96b500f0,0x96f46000, +0x5eedb817,0x1ab5b817,0xb0170003,0xb4000004, +0x96b500ef,0x96f70001,0x5ae4b817,0x1ab5b817, +0x96d41800,0xb0161800,0xb400000a,0x96f900ff, +0x96b500ff,0x9739ff00,0x1b39b815,0x02a7b817, +0x96b500f3,0x96d40008,0x5ec1b816,0x1ab5b816, +0xb500000c,0x96f98000,0xb0178000,0xb4200007, +0x5efeb814,0x96f70001,0xb0170001,0xb4000003, +0x9b180180,0x83060081,0xb50000a2,0x96b500f3, +0x9ab50008,0x9739fff3,0x96d40020,0xb0160020, +0xb4200019,0x82c7001f,0x82c600c9,0x9b398000, +0x82c70000,0x02dfb17e,0x96d40010,0x5ac8b816, +0x82f300ff,0x9af7cfff,0x1718b817,0x1b18b816, +0x9b180340,0x82c5009d,0x96d6ffff,0x82f33800, +0x9af78001,0x1af7b816,0x82c5009a,0x96d60020, +0xb0160020,0xb4200002,0x82f3c800,0x9af78001, +0x82e6009d,0xb500005f,0x97397fff,0x96b500ff, +0x5aaab815,0x82f300fc,0x9af703ff,0x1718b817, +0x1b18b815,0x9b180340,0x82c5009a,0x96d60010, +0xb0160010,0xb4200027,0x82c70000,0x02dfb17e, +0x82c50086,0x92d60e10,0x82c60086,0x82c50094, +0x5eefb818,0x96f70003,0xb0170003,0xb4200002, +0x82e70e10,0xb5000001,0x82e70e10,0x12d6b817, +0x82e50081,0x9af70020,0x82e60081,0x82c60094, +0xa2f70020,0x82e60081,0x82f30001,0x16f7b818, +0x5ef0b817,0xb0170001,0xb4000004,0x96f84000, +0x5ee4b817,0x9718f3ff,0x1b18b817,0x82f32800, +0x9af78000,0x82e6009d,0x83060081,0x83070001, +0x8306009f,0x8305009c,0xb0180001,0xb4e0fffb, +0xb50000f5,0x82c5009d,0x82f33800,0x9af78001, +0x3016b817,0xb420000f,0x82b3c800,0x9ab58001, +0x82e500c1,0x96f7000f,0xb017000b,0xb4000002, +0x82b38800,0x9ab58001,0x82c5009a,0x96d60020, +0xb0160020,0xb4200002,0x82b3c800,0x9ab58001, +0x82a6009d,0x82c5009a,0x96d60080,0xb0160080, +0xb4000013,0x02df917e,0x00000000,0xb0160010, +0xb480000f,0x82c500c1,0x96d6000f,0xb016000b, +0xb400000b,0x82c50087,0x96d60080,0x5ac7b816, +0x82c50098,0x96d60800,0x5ac3b816,0x96f84000, +0x3017b816,0xb4200002,0x033f4046,0x9b394000, +0x9739bfff,0x82e50061,0x96f70008,0xb0170008, +0xb4000005,0x5eefb818,0x96f70003,0xb0170003, +0xb4000001,0x9718ffff,0x96b41800,0xb0151800, +0xb4000008,0x5eb9b814,0x96b5000f,0x82c50099, +0x5ed0b816,0x96f6000f,0x5ab0b815,0x82a60099, +0xb5000002,0x5ef9b814,0x96f7000f,0x5aecb817, +0x82c5009a,0x96d60fff,0x1ad6b817,0x82c6009a, +0x96b46000,0xb0156000,0xb4200005,0x5ae2b817, +0x82d30ffc,0x9ad63fff,0x1718b816,0x1b18b817, +0x83060081,0x83070001,0x8306009f,0x8305009c, +0xb0180001,0xb4e0fffb,0x00000000,0xb500009e, +0x82850083,0x96b400ff,0xb015003c,0xb4200019, +0x96b92000,0xb0152000,0xb4000002,0x9b392000, +0xb5000014,0x9739d3ff,0x82870000,0x82860087, +0x82870008,0x82860083,0x829bff78,0x82a7001f, +0xb0140400,0xb4000001,0x82a70010,0x82a600c9, +0x829bff78,0x00000000,0x828600cb,0x8285009d, +0x82b3ffff,0x9ab5fffd,0x1694b815,0x8286009d, +0xb5000000,0x83070002,0x8306009f,0x00000000, +0xb500007d,0x83078000,0x8306009f,0x00000000, +0xb5000079,0x82850094,0x82a50086,0x06b5b814, +0x02b6b815,0xb0151700,0xb440004b,0x8285006c, +0x969400ff,0xb0140024,0xb4000019,0xb0140012, +0xb4000017,0x8285009a,0x5eedb814,0x96f70003, +0xb0170003,0xb4000009,0x82a50083,0x5ea8b815, +0x96b500ff,0xb0150020,0xb4400002,0x82c70bbc, +0xb5000001,0x82c70bb8,0xb5000008,0x82a50083, +0x5ea8b815,0x96b500ff,0xb0150020,0xb4400002, +0x82c71199,0xb5000001,0x82c71197,0xb5000016, +0x8285009a,0x5eedb814,0x96f70003,0xb0170003, +0xb4000009,0x82a50083,0x5ea8b815,0x96b500ff, +0xb0150020,0xb4400002,0x82c70e18,0xb5000001, +0x82c70e04,0xb5000008,0x82a50083,0x5ea8b815, +0x96b500ff,0xb0150020,0xb4400002,0x82c70e18, +0xb5000001,0x82c70e04,0x82e50086,0x12f7b816, +0x02bf917e,0xb0150020,0xb480000b,0x82a5009a, +0x96b56000,0xb0156000,0xb4000007,0x82a50098, +0x96d50a00,0xb0160a00,0xb4000002,0xb0160000, +0xb4200001,0x92f70704,0x82850081,0x9ab40020, +0x82a60081,0x82c50094,0x82e60094,0x82860081, +0x86b70704,0x82a6009b,0x83070008,0x8306009f, +0x00000000,0xb5000024,0x83070100,0x8306009f, +0x00000000,0xb5000020,0x83070000,0x83050081, +0x9b180180,0x83060081,0x83070400,0x8306009f, +0x00000000,0xb5000018,0x82870000,0x82850082, +0x5eb7b814,0x96b500fc,0x96d40006,0x5ec1b816, +0x1ab5b816,0x5aacb815,0x83050081,0x82d3001c, +0x9ad600ff,0x1718b816,0x1b18b815,0x9b180e00, +0x83060081,0x83074000,0x8306009f,0x8305009d, +0x82d3ffff,0x9ad6bfff,0x1718b816,0x8306009d, +0x00000000,0xb5000000,0x029f902a,0x01ffb814, +0x033f6046,0x029f9024,0x02bf9025,0x02df9026, +0x02ff9027,0x031f9028,0x033f9029,0x00ffb81e, +0x02ff917d,0x92f7092f,0x031f0084,0xb0180001, +0xb4200002,0x02ff917d,0x92f70870,0x02ffb17d, +0x02ff917c,0x82bbffdc,0x829bffd8,0x93150004, +0x3014b815,0xb4000017,0x02dbb818,0x029bb815, +0x3017b816,0xb4800013,0x5a81b814,0x029fb17d, +0x82def200,0x82fef204,0x82e50086,0x06f7b814, +0x02f6b817,0x82fef208,0x82860095,0x82870001, +0x829ef220,0x8293001f,0x9294fe00,0x92b50008, +0x3015b814,0xb4800002,0x82b3001f,0x92b5fa00, +0x82beffdc,0x82850086,0x83250094,0x06d4b819, +0x02d6b816,0xb016ffff,0xb4a00009,0x82c50081, +0x9ab60020,0x82a60081,0x82a50086,0x92b50e10, +0x82a60094,0x82c60081,0x86b50704,0x82a6009b, +0x00ffb81c,0x00000000,0x00000000,0x00000000, +0x001f9012,0x001fb200,0x001f004c,0x001f2804, +0x801bfef0,0x8058fef4,0x803bff68,0x8078ff6c, +0x2000b801,0x2042b803,0x001fb204,0x005f2814, +0x82e70001,0x83640048,0x029fb014,0x829efef0, +0x8286000f,0x02bf2054,0x82bcfef4,0x82a6000e, +0x00ffb81a,0x80e70001,0x801336e3,0x9800eb76, +0x001fb200,0x800700ab,0x001f2804,0x801bc3e8, +0x8058c3ec,0x83640024,0x82e70000,0x83640036, +0x029fb3c0,0x029fb200,0x02bf2f04,0x02bf2804, +0x801bc000,0x8058c004,0x8364001b,0x82e70000, +0x8364002d,0x001f93c0,0x3000b814,0xb420000a, +0x001f0f04,0x3000b815,0xb4200007,0x829efef0, +0x82bcfef4,0x029fb012,0x02bf204c,0x82870001, +0x829cfef5,0x00ffb81a,0xb0070000,0xb4000007, +0x80e70000,0x801399fa,0x9800c92e,0x001fb200, +0x800700af,0x001f2804,0xb500ffdc,0x82870000, +0x829cfef5,0x00ffb81a,0x80c700ff,0x803bff68, +0x8078ff6c,0x14a0b806,0x2063b805,0x007f2814, +0x2021b802,0x58c8b806,0x14a0b806,0x58b0b805, +0x2021b805,0x58c8b806,0x14a0b806,0x2021b805, +0x58c8b806,0x14a0b806,0x5cb0b805,0x2021b805, +0x003fb204,0x00ffb81b,0x82c70000,0x83070800, +0x83270005,0x8197080c,0x81d7ffff,0x83840126, +0x83840001,0x00ffb81b,0x808f0000,0x806f001f, +0x80af001f,0x80270240,0x81e77c08,0x5de2b80f, +0xb6000208,0x00cfb801,0x01ffb178,0x59e2b80f, +0x01cfb80f,0x01ff9178,0xb520ffff,0x91ef0020, +0x90210020,0x80270280,0x81e77b00,0x5de2b80f, +0xb6000208,0x00cfb801,0x01ffb178,0x59e2b80f, +0x01cfb80f,0x01ff9178,0xb520ffff,0x91ef0020, +0x90210020,0x8057ffff,0x80170830,0x80070810, +0x80270808,0xb6000509,0x005ff000,0x90420900, +0x007ff001,0x90630a00,0x009ff002,0x00bff003, +0x2004a025,0x90000001,0x90210001,0x80070814, +0x80d7ffff,0x8097085c,0x8017083c,0xb6000404, +0x005ff000,0x007f87e0,0x84000001,0x2082a7e3, +0x80970860,0x80170840,0x2082b803,0x007f8000, +0x2083a004,0x80170830,0x80970850,0x80270808, +0xb6000508,0x005f8024,0x90420900,0x007ff001, +0x90630a00,0x009ff002,0x00bff003,0x2004a025, +0x90210001,0x80170840,0x00000000,0x02bf87e0, +0x80970860,0x82870000,0xb6000404,0x005f87e4, +0x5a88b814,0x204287e0,0x1a94b802,0x00ffb81c, +0x001f0e49,0x001f2b09,0x001f0e41,0x001f2b08, +0x001f0e46,0x001f2b07,0x001f0e48,0x001f2b06, +0x001f0e42,0x001f2b05,0x001f0e47,0x001f2b04, +0x001f0e45,0x001f2b03,0x001f0e43,0x001f2b02, +0x001f0e40,0x001f2b01,0x001f0e44,0x001f2b00, +0x001f0f25,0xa020000c,0x94400001,0x94600002, +0x94810004,0x94a10008,0x94c00010,0x5943b802, +0x5861b803,0x5882b804,0x5ca2b805,0x5cc4b806, +0x194ab803,0x194ab804,0x194ab805,0x194ab806, +0x015f2b38,0x801b7c00,0x003f92c1,0x5c28b801, +0x005f92c2,0x5858b802,0x1821b802,0x2000b801, +0x001fb2c4,0x80187c04,0x003f0b09,0x2000b801, +0x001f2b14,0x82c70001,0x82e70001,0x83070b10, +0x8327001e,0x81970b35,0x8384009f,0x02df0b38, +0x82170e30,0x838400f1,0x819efef0,0x817cfef4, +0x819eff68,0x817cff6c,0x00ffb81b,0x820f001f, +0x8018fef8,0x8057ffff,0x001f2b09,0x8018fef6, +0x80d7ffff,0x001f2b08,0x8018fefa,0x8157ffff, +0x001f2b07,0x8018fefd,0x81d7ffff,0x001f2b06, +0x8018fefb,0x802f001f,0x001f2b05,0x8018fefe, +0x00000000,0x001f2b04,0x8018fef9,0x00000000, +0x001f2b03,0x8018feff,0x00000000,0x001f2b02, +0x8018fef7,0x00000000,0x001f2b01,0x8018fefc, +0x00000000,0x001f2b00,0x001f0f25,0xa0200011, +0x94410001,0x94600002,0x94800004,0x94a00008, +0x94c10010,0x5941b802,0x5861b803,0x5c82b804, +0x58a1b805,0x5cc1b806,0x194ab803,0x194ab804, +0x194ab805,0x194ab806,0x015f2b38,0x801b7c00, +0x003f92c1,0x5c28b801,0x005f92c2,0x5858b802, +0x1821b802,0x2000b801,0x001fb2c4,0x80187c04, +0x003f0b09,0x2000b801,0x001f2b14,0x82c70001, +0x82e70001,0x83070b10,0x8327001e,0x81970b35, +0x83840055,0x02df0b38,0x82170e20,0x838400a7, +0x819efef0,0x817cfef4,0x5ac8b80c,0x02ff0e44, +0x1ad6b817,0x02dfb391,0x5ed8b80c,0x5968b80b, +0x1ad6b80b,0x02df6724,0x00ffb81b,0x820f001f, +0x8018fefe,0x8057ffff,0x001f2b09,0x8018fefa, +0x80d7ffff,0x001f2b08,0x8018fefc,0x8157ffff, +0x001f2b07,0x8018feff,0x81d7ffff,0x001f2b06, +0x8018fef8,0x802f001f,0x001f2b05,0x8018fefb, +0x00000000,0x001f2b04,0x8018fefd,0x00000000, +0x001f2b03,0x8018fef6,0x00000000,0x001f2b02, +0x8018fef9,0x00000000,0x001f2b01,0x8018fef7, +0x00000000,0x001f2b00,0x801b7c00,0x003f92c1, +0x5c28b801,0x005f92c2,0x5858b802,0x1821b802, +0x2000b801,0x001fb2c4,0x80187c04,0x003f0b09, +0x2000b801,0x001f2b14,0x82c70001,0x82e70001, +0x83070b10,0x8327001e,0x81970b35,0x83840016, +0x83270000,0x831bfef0,0x82f8fef4,0x02c7b819, +0x82170e28,0x83840065,0x300cb818,0xb4200002, +0x300bb817,0xb4000006,0x93390001,0xb0190020, +0xb480fff6,0x83270000,0x833cfef5,0x00ffb81b, +0x019fb390,0x017f2e44,0x033f2f25,0x83270001, +0x833cfef5,0x00ffb81b,0x0007b818,0x90000003, +0x00000000,0x015ff000,0x90000001,0x5949b80a, +0x013ff000,0x194ab809,0x84000002,0x994a0100, +0x017ff000,0x958b00f8,0x5981b80c,0x956b0007, +0x198cb80b,0x84000002,0x998c0008,0x017ff000, +0x90000001,0x5971b80b,0x198cb80b,0x017ff000, +0x5969b80b,0x198cb80b,0x81a70000,0x94d90003, +0x82a70000,0xb6260019,0xb6000818,0x5df0b80a, +0x5e02b80a,0x21efb810,0x95ef0001,0x5941b80a, +0x194ab80f,0x21efb816,0x5e18b80c,0x5e35b80c, +0x5e54b80c,0x5e6cb80c,0x2210b811,0x2252b813, +0x2210b812,0x96100001,0x5981b80c,0x198cb810, +0x2210b817,0x10afb810,0x10a5b80d,0x5da1b805, +0x94a50001,0x5aa1b815,0x1ab5b805,0x019fa7f5, +0x5cc2b819,0xb626001c,0x82870000,0xb6000419, +0xb6000818,0x5df0b80a,0x5e02b80a,0x21efb810, +0x95ef0001,0x5941b80a,0x194ab80f,0x21efb816, +0x5e18b80c,0x5e35b80c,0x5e54b80c,0x5e6cb80c, +0x2210b811,0x2252b813,0x2210b812,0x96100001, +0x5981b80c,0x198cb810,0x2210b817,0x10afb810, +0x10a5b80d,0x5da1b805,0x94a50001,0x5a81b814, +0x1a94b805,0x019fa7f4,0x00ffb81c,0x8257ffff, +0x808f0000,0x806f001f,0x80af001f,0x80270300, +0x81e778e0,0x5de2b80f,0xb6000208,0x00cfb801, +0x01ffb178,0x59e2b80f,0x01cfb80f,0x01ff9178, +0xb520ffff,0x91ef0020,0x90210020,0x80270340, +0x81e779e0,0x5de2b80f,0xb6000208,0x00cfb801, +0x01ffb178,0x59e2b80f,0x01cfb80f,0x01ff9178, +0xb520ffff,0x91ef0020,0x90210020,0x80270280, +0x81e77b00,0x5de2b80f,0xb6000208,0x00cfb801, +0x01ffb178,0x59e2b80f,0x01cfb80f,0x01ff9178, +0xb520ffff,0x91ef0020,0x90210020,0x806f0007, +0x80af0007,0x80270380,0x81e77ae0,0x5de2b80f, +0x00cfb801,0x01ffb178,0x59e2b80f,0x01cfb80f, +0x01ff9178,0xb520ffff,0x91ef0020,0x90210020, +0x80170b60,0x001f0b00,0x001fa020,0x001f0b01, +0x001fa020,0x001f0b02,0x001fa020,0x001f0b03, +0x001fa020,0x001f0b04,0x001fa000,0x80970b50, +0x81170b70,0x82a70b35,0x83a40060,0x001f87e4, +0xb6000405,0x86b50001,0x83a4005c,0x001f8004, +0x003f87e8,0x2080a7e1,0x80970b70,0x80170b50, +0x81170b50,0x81970b40,0x82a70b30,0x001f800c, +0x003f8008,0x2100a001,0x83a40050,0x001f87e4, +0xb6000405,0x86b50001,0x83a4004c,0x001f8004, +0x003f87e8,0x2080a7e1,0x80970b50,0x80170b70, +0x81170b70,0x81970b60,0x82a70b2b,0x001f800c, +0x003f8008,0x2100a001,0x83a40040,0x83a4004e, +0xb6000407,0x86b50001,0x83a4003c,0x001f8004, +0x003f87e8,0x2080a001,0x83a40047,0x00000000, +0x80970b70,0x80170b50,0x81170b50,0x81970b40, +0x82a70b26,0x001f800c,0x003f8008,0x2100a001, +0x83a4002e,0x83a4003c,0xb6000407,0x86b50001, +0x83a4002a,0x001f8004,0x003f87e8,0x2080a001, +0x83a40035,0x00000000,0x80970b50,0x80170b70, +0x81170b70,0x81970b60,0x82a70b21,0x001f800c, +0x003f8008,0x2100a001,0x83a4001c,0x001f87e4, +0xb6000405,0x86b50001,0x83a40018,0x001f8004, +0x003f87e8,0x2080a7e1,0x80970b70,0x80170b50, +0x81170b50,0x81970b40,0x82a70b1c,0x001f800c, +0x003f8008,0x2100a001,0x83a4000c,0x017f87e4, +0x81870000,0xb6000406,0x86b50001,0x83a40007, +0x001f87e4,0x200087e8,0x5988b80c,0x198cb800, +0x021fa02c,0x021fa00b,0x00ffb81c,0x005ff015, +0x90420a00,0x003f87e0,0x001ff002,0x2060b801, +0x90630c00,0x90960e00,0x001ff003,0x003ff004, +0x20a0b801,0x90a50d00,0x00000000,0x001ff005, +0x009fa000,0x00ffb81d,0x001f8004,0x5c21b800, +0x5847b800,0x1821b802,0x942100ff,0x2080a7e1, +0x00ffb81d,0x00000000,0x00000000,0x00000000, + +}; + +static u32 MPG240Ucode1f5c00[] = { +0x00000000,0xfffff8c0,0x00003540,0xffff8d40, +0x0001fd40,0xfffaf7c0,0x00066b80,0xffdb63c0, +0x00494780,0x00249c40,0x00066b80,0x00050840, +0x0001fd40,0x000072c0,0x00003540,0x00000740, +0xffffffc0,0xfffff840,0x00003680,0xffff7e40, +0x0001f400,0xfffa9cc0,0x0005d1c0,0xffd99600, +0x00493c00,0x0022ce00,0x0006f780,0x0004ad00, +0x000203c0,0x00006440,0x00003400,0x00000680, +0xffffffc0,0xfffff740,0x00003780,0xffff6ec0, +0x0001e800,0xfffa4240,0x00052a00,0xffd7ca00, +0x00491a00,0x0020ffc0,0x00077600,0x00045240, +0x00020800,0x000056c0,0x00003280,0x00000600, +0xffffffc0,0xfffff680,0x00003840,0xffff5ec0, +0x0001d940,0xfff9e8c0,0x00047440,0xffd60080, +0x0048e180,0x001f32c0,0x0007e700,0x0003f7c0, +0x000209c0,0x00004980,0x00003100,0x00000540, +0xffffffc0,0xfffff5c0,0x000038c0,0xffff4e40, +0x0001c780,0xfff990c0,0x0003b000,0xffd43ac0, +0x00489240,0x001d6800,0x00084b00,0x00039e40, +0x00020940,0x00003d00,0x00002f80,0x000004c0, +0xffffffc0,0xfffff4c0,0x00003900,0xffff3d40, +0x0001b2c0,0xfff93a40,0x0002ddc0,0xffd279c0, +0x00482d00,0x001ba040,0x0008a200,0x000345c0, +0x000206c0,0x00003140,0x00002dc0,0x00000440, +0xffffffc0,0xfffff3c0,0x00003900,0xffff2c00, +0x00019b00,0xfff8e640,0x0001fd40,0xffd0be80, +0x0047b1c0,0x0019dc80,0x0008ecc0,0x0002ef00, +0x00020240,0x00002640,0x00002c00,0x00000400, +0xffffff80,0xfffff2c0,0x000038c0,0xffff1a40, +0x00017fc0,0xfff894c0,0x00010e80,0xffcf09c0, +0x004720c0,0x00181d80,0x00092b40,0x000299c0, +0x0001fc00,0x00001bc0,0x00002a40,0x00000380, +0xffffff80,0xfffff180,0x00003800,0xffff0840, +0x00016180,0xfff84680,0x00001180,0xffcd5cc0, +0x00467a40,0x00166440,0x00095e00,0x00024680, +0x0001f440,0x00001200,0x00002840,0x00000340, +0xffffff80,0xfffff040,0x00003740,0xfffef600, +0x00014000,0xfff7fbc0,0xffff0680,0xffcbb880, +0x0045bf00,0x0014b140,0x00098580,0x0001f580, +0x0001ea80,0x00000900,0x00002680,0x000002c0, +0xffffff80,0xffffef00,0x000035c0,0xfffee3c0, +0x00011ac0,0xfff7b540,0xfffded80,0xffca1d80, +0x0044ef80,0x00130580,0x0009a1c0,0x0001a700, +0x0001dfc0,0x00000080,0x000024c0,0x00000280, +0xffffff40,0xffffedc0,0x00003400,0xfffed180, +0x0000f280,0xfff77340,0xfffcc700,0xffc88d80, +0x00440bc0,0x001161c0,0x0009b3c0,0x00015b00, +0x0001d380,0xfffff8c0,0x000022c0,0x00000240, +0xffffff40,0xffffec40,0x00003200,0xfffebf40, +0x0000c680,0xfff73680,0xfffb92c0,0xffc708c0, +0x00431500,0x000fc6c0,0x0009bb80,0x000111c0, +0x0001c640,0xfffff1c0,0x00002100,0x00000200, +0xffffff00,0xffffeac0,0x00002f40,0xfffead00, +0x00009740,0xfff6ff40,0xfffa5180,0xffc59080, +0x00420b40,0x000e3500,0x0009b9c0,0x0000cb80, +0x0001b7c0,0xffffeb40,0x00001f40,0x000001c0, +0xffffff00,0xffffe940,0x00002c40,0xfffe9b00, +0x00006480,0xfff6ce00,0xfff90380,0xffc425c0, +0x0040ef80,0x000cad00,0x0009af00,0x00008840, +0x0001a880,0xffffe580,0x00001d40,0x000001c0, +0xfffffec0,0xffffe7c0,0x000028c0,0xfffe8980, +0x00002e40,0xfff6a3c0,0xfff7a900,0xffc2c900, +0x003fc280,0x000b2fc0,0x00099b80,0x00004800, +0x00019880,0xffffe040,0x00001bc0,0x00000180, +0xfffffec0,0xffffe600,0x00002480,0xfffe7840, +0xfffff4c0,0xfff68040,0xfff64240,0xffc17b40, +0x003e84c0,0x0009bdc0,0x00097fc0,0x00000b40, +0x000187c0,0xffffdb80,0x00001a00,0x00000140, +0xfffffe80,0xffffe440,0x00001fc0,0xfffe6780, +0xffffb800,0xfff66480,0xfff4d040,0xffc03d80, +0x003d3700,0x00085700,0x00095c40,0xffffd1c0, +0x00017680,0xffffd740,0x00001840,0x00000140, +0xfffffe40,0xffffe2c0,0x00001a80,0xfffe5780, +0xffff77c0,0xfff65100,0xfff35300,0xffbf1080, +0x003bda40,0x0006fc80,0x00093200,0xffff9b80, +0x00016500,0xffffd3c0,0x000016c0,0x00000100, +0xfffffe40,0xffffe0c0,0x000014c0,0xfffe4840, +0xffff3480,0xfff64640,0xfff1cb00,0xffbdf4c0, +0x003a6f80,0x0005ae80,0x000900c0,0xffff68c0, +0x00015300,0xffffd0c0,0x00001540,0x00000100, +0xfffffe00,0xffffdf00,0x00000e40,0xfffe39c0, +0xfffeee40,0xfff64480,0xfff03940,0xffbceb00, +0x0038f740,0x00046d40,0x0008c980,0xffff3980, +0x000140c0,0xffffce00,0x000013c0,0x000000c0, +0xfffffdc0,0xffffdd40,0x00000740,0xfffe2c80, +0xfffea500,0xfff64c40,0xffee9e40,0xffbbf440, +0x00377280,0x00033900,0x00088cc0,0xffff0d80, +0x00012e80,0xffffcc00,0x00001240,0x000000c0, +0xfffffd80,0xffffdb40,0xffffff80,0xfffe2040, +0xfffe5900,0xfff65e40,0xffecfa80,0xffbb1080, +0x0035e280,0x00021280,0x00084ac0,0xfffee540, +0x00011c40,0xffffca40,0x00001100,0x00000080, +0xfffffd40,0xffffd980,0xfffff700,0xfffe1580, +0xfffe0a80,0xfff67a80,0xffeb4ec0,0xffba4100, +0x00344780,0x0000f980,0x00080440,0xfffec000, +0x00010a00,0xffffc8c0,0x00000fc0,0x00000080, +0xfffffcc0,0xffffd7c0,0xffffee00,0xfffe0bc0, +0xfffdb980,0xfff6a200,0xffe99bc0,0xffb985c0, +0x0032a340,0xffffee80,0x0007b980,0xfffe9e80, +0x0000f7c0,0xffffc800,0x00000e80,0x00000080, +0xfffffc80,0xffffd5c0,0xffffe440,0xfffe0400, +0xfffd6640,0xfff6d4c0,0xffe7e280,0xffb8df40, +0x0030f640,0xfffef180,0x00076b40,0xfffe8040, +0x0000e5c0,0xffffc740,0x00000d40,0x00000080, +0xfffffc00,0xffffd400,0xffffd9c0,0xfffdfdc0, +0xfffd1100,0xfff71340,0xffe62380,0xffb84e40, +0x002f4180,0xfffe02c0,0x000719c0,0xfffe6500, +0x0000d400,0xffffc700,0x00000c40,0x00000040, +0xfffffbc0,0xffffd240,0xffffcec0,0xfffdf940, +0xfffcba40,0xfff75e00,0xffe45fc0,0xffb7d300, +0x002d8640,0xfffd2240,0x0006c5c0,0xfffe4d40, +0x0000c2c0,0xffffc700,0x00000b40,0x00000040, +0xfffffb40,0xffffd080,0xffffc300,0xfffdf6c0, +0xfffc61c0,0xfff7b500,0xffe29800,0xffb76dc0, +0x002bc540,0xfffc5000,0x00066f40,0xfffe3880, +0x0000b1c0,0xffffc740,0x00000a40,0x00000040, +0xfffffac0,0xffffcf00,0xffffb680,0xfffdf640, +0xfffc0840,0xfff81900,0xffe0cd40,0xffb71e80, +0x0029ff80,0xfffb8bc0,0x00061740,0xfffe26c0, +0x0000a140,0xffffc7c0,0x00000980,0x00000040, +0xfffffa00,0xffffcd80,0xffffa940,0xfffdf800, +0xfffbadc0,0xfff88a00,0xffdf0040,0xffb6e600, +0x00283600,0xfffad600,0x0005bdc0,0xfffe1800, +0x00009140,0xffffc880,0x000008c0,0x00000040, +0xfffff980,0xffffcc00,0xffff9bc0,0xfffdfc40, +0xfffb5300,0xfff90880,0xffdd3200,0xffb6c400, +0x00266a00,0xfffa2e40,0x00056340,0xfffe0c00, +0x000081c0,0xffffc980,0x000007c0,0x00000040, +0x004013c2,0x0040b346,0x0041fa2d,0x0043f934, +0x0046cc1c,0x004a9d9d,0x004fae37,0x0056601f, +0x005f4cf7,0x006b6fcf,0x007c7d1e,0x0115b035, +0x013df91b,0x0207655e,0x03342c83,0x0a185230, +0x00404f46,0x0042e13c,0x0048919f,0x0052cb0e, +0x0064e240,0x0107c449,0x015c7926,0x050cf270, +0x004140fb,0x004cf8df,0x0073326c,0x02480d9d, +0x004545ea,0x01273d75,0x005a827a,0x007fffff, +0x006597fb,0x0050a28c,0x00400000,0x0032cbfd, +0x00285146,0x00200000,0x001965ff,0x001428a3, +0x00100000,0x000cb2ff,0x000a1451,0x00080000, +0x00065980,0x00050a29,0x00040000,0x00032cc0, +0x00028514,0x00020000,0x00019660,0x0001428a, +0x00010000,0x0000cb30,0x0000a145,0x00008000, +0x00006598,0x000050a3,0x00004000,0x000032cc, +0x00002851,0x00002000,0x00001966,0x00001429, +0x00001000,0x00000cb3,0x00000a14,0x00000800, +0x00000659,0x0000050a,0x00000400,0x0000032d, +0x00000285,0x00000200,0x00000196,0x00000143, +0x00000100,0x000000cb,0x000000a1,0x00000080, +0x00000066,0x00000051,0x00000040,0x00000033, +0x00000028,0x00000020,0x00000019,0x00000014, +0x00000010,0x0000000d,0x0000000a,0x00000008, +0x00000006,0x00000005,0x00000000,0x00555555, +0x00666666,0x00492492,0x0071c71c,0x00444444, +0x00421084,0x00410410,0x00408102,0x00404040, +0x00402010,0x00401004,0x00400801,0x00400400, +0x00400200,0x00400100,0x00400080,0x00400040, +0x00400000,0x00400000,0x00200000,0x00400000, +0x00100000,0x00080000,0x00040000,0x00020000, +0x00010000,0x00008000,0x00004000,0x00002000, +0x00001000,0x00000800,0x00000400,0x00000200, +0x00000100,0x0003588d,0x0002b15e,0x0002056d, +0x00015600,0x0000a329,0xffffeed9,0xffff3960, +0xfffe8423,0xfffdd11c,0xfffd2048,0xfffc7353, +0xfffbcb6f,0xfffb29a6,0xfffa8f15,0x000494ae, +0x0003f991,0x00032dd1,0xfffd2d8f,0x0001eb47, +0xfffe9968,0x00009af6,0x000011de,0xffff4335, +0x00018d69,0xfffdecd4,0x000302f8,0xfffca0d7, +0x0004683d,0xfffb67f8,0x0005b36d,0x00045963, +0xfffbd51e,0x00030062,0xfffd0dee,0x0001d046, +0xfffe8a0a,0x00009258,0x000012b1,0xffff4d9e, +0x00019ec3,0xfffe0a44,0x0003245a,0xfffcd082, +0x000498f0,0xfffba919,0x0005f304,0x00041bf4, +0xfffba72a,0x0002d19e,0xfffcf060,0x0001b407, +0xfffe7c08,0x0000894a,0x0000138d,0xffff58ac, +0x0001afaf,0xfffe28fe,0x000343bf,0xfffd026f, +0x0004c6f6,0xfffbed06,0x00062e61,0x0003dc0e, +0xfffb7bf1,0x0002a17f,0xfffcd522,0x000196a0, +0xfffe6e70,0x00007ff6,0x00001439,0xffff63f6, +0x0001beb3,0xfffe4882,0x0003616d,0xfffd361b, +0x0004f1cf,0xfffc332a,0x0006658f,0x00039943, +0xfffb52c0,0x00026ec7,0xfffcbb94,0x0001789f, +0xfffe6160,0x00007677,0x000014d4,0xffff6f74, +0x0001cc9b,0xfffe694f,0x00037cbf,0xfffd6b41, +0x000519c2,0xfffc7baf,0x00069971,0x00035486, +0xfffb2d0c,0x00023ad8,0xfffca3ee,0x00015989, +0xfffe55af,0x00006ca7,0x00001570,0xffff7b71, +0x0001d9cb,0xfffe8b46,0x0003959e,0xfffda1fe, +0x00053ee6,0xfffcc6b4,0x0006c950,0x00030e08, +0xfffb0a7a,0x0002061e,0xfffc8ec0,0x00013911, +0xfffe4b1d,0x00006278,0x000015e8,0xffff87b6, +0x0001e577,0xfffeadd6,0x0003acc2,0xfffdda34, +0x00056059,0xfffd136d,0x0006f4b5,0x0002c562, +0xfffaea7c,0x0001cfa6,0xfffc7b14,0x0001182b, +0xfffe4159,0x00005817,0x0000165c,0xffff9417, +0x0001f00f,0xfffed14c,0x0003c199,0xfffe13f6, +0x00057e83,0xfffd61cd,0x00071ba1,0x00027ab5, +0xfffacdc3,0x00019833,0xfffc6989,0x0000f6ca, +0xfffe38da,0x00004d9d,0x000016ef,0xffffa103, +0x0001f98f,0xfffef5c0,0x0003d3d1,0xfffe4f00, +0x0005998c,0xfffdb21e,0x00073e77,0x00022e75, +0xfffab482,0x00015fd1,0xfffc5b13,0x0000d45d, +0xfffe318f,0x000042ed,0x0000176b,0xffffae8f, +0x0002018f,0xffff1a91,0x0003e40c,0xfffe8af2, +0x0005b0ca,0xfffe03b8,0x00075d14,0x0001e141, +0xfffa9e9b,0x0001262a,0xfffc4e31,0x0000b1af, +0xfffe2b26,0x00003805,0x000017b1,0xffffbc21, +0x000208b8,0xffff3fb6,0x0003f1d7,0xfffec7af, +0x0005c4c5,0xfffe5654,0x0007768a,0x000192fe, +0xfffa8bb0,0x0000ec3f,0xfffc4365,0x00008ec9, +0xfffe25f0,0x00002d05,0x000017ec,0xffffc984, +0x00020ec6,0xffff658d,0x0003fcba,0xffff0500, +0x0005d576,0xfffeaa37,0x00078bc6,0x00014367, +0xfffa7bec,0x0000b1f4,0xfffc3b82,0x00006b06, +0xfffe2201,0x000021eb,0x00001823,0xffffd704, +0x0002132a,0xffff8be7,0x00040534,0xffff4315, +0x0005e22e,0xfffeff0a,0x00079ce3,0x0000f33f, +0xfffa6fc9,0x000076ca,0xfffc3558,0x00004762, +0xfffe1ef3,0x000016a1,0x0000183f,0xffffe4a6, +0x00021664,0xffffb27d,0x00040b7b,0xffff81e5, +0x0005eb4e,0xffff5475,0x0007a857,0x0000a2cb, +0xfffa671b,0x00003b64,0xfffc31e2,0x00002416, +0xfffe1ce1,0x00000b46,0x00001850,0xfffff24d, +0x00021855,0xffffd93a,0x00040f75,0xffffc0e6, +0x0005f0e3,0xffffaa3e,0x0007af45,0x0000519f, +0xfffa6218,0x0003f991,0x0003588d,0x0002b15e, +0x0002056d,0x00015600,0x0000a329,0xffffeed9, +0xffff3960,0xfffe8423,0xfffdd11c,0xfffd2048, +0xfffc7353,0xfffbcb6f,0xfffb29a6,0xfffa8f15, +0x000494ae,0x0003c6b0,0xfffc7e8b,0x00028ef6, +0xfffde181,0x000144eb,0xffff5500,0xffffefb9, +0x0000d01d,0xfffe9755,0x000249a4,0xfffd453c, +0x0003b80e,0xfffc01aa,0x000511d6,0xfffad527, +0xfffb334e,0x0003916c,0xfffc5778,0x00026a92, +0xfffdc9f5,0x00013314,0xffff4d99,0xfffff0b6, +0x0000d911,0xfffeab80,0x00026369,0xfffd6c0a, +0x0003e17f,0xfffc39d8,0x000549df,0xfffb1eb2, +0xfffafe6c,0x00035929,0xfffc3321,0x000244a6, +0xfffdb402,0x00012035,0xffff46ac,0xfffff192, +0x0000e16a,0xfffebfe0,0x00027b3d,0xfffd9433, +0x0004087b,0xfffc74b7,0x00057e8d,0xfffb6a81, +0xfffacc1c,0x00031fbe,0xfffc10df,0x00021e0c, +0xfffd9f6d,0x00010cb7,0xffff402e,0xfffff279, +0x0000e965,0xfffed574,0x00029159,0xfffdbdc4, +0x00042c4c,0xfffcb1e7,0x0005b02d,0xfffbb942, +0xfffa9d38,0x0002e44a,0xfffbf0fd,0x0001f5b4, +0xfffd8c38,0x0000f8b1,0xffff3a21,0xfffff391, +0x0000f0e6,0xfffeec44,0x0002a642,0xfffde90e, +0x00044e32,0xfffcf0fb,0x0005de46,0xfffc0b18, +0xfffa71d1,0x0002a659,0xfffbd3de,0x0001cb90, +0xfffd7a97,0x0000e403,0xffff3490,0xfffff49c, +0x0000f7a8,0xffff0340,0x0002b95f,0xfffe1573, +0x00046dbe,0xfffd3284,0x00060888,0xfffc5f51, +0xfffa4996,0x00026786,0xfffbb8df,0x0001a0e1, +0xfffd6a4e,0x0000ced2,0xffff2f75,0xfffff593, +0x0000fdbe,0xffff1a53,0x0002ca87,0xfffe42f5, +0x0004898a,0xfffd7563,0x00062f0b,0xfffcb5de, +0xfffa2508,0x00022713,0xfffba0bf,0x0001754a, +0xfffd5b5f,0x0000b92c,0xffff2acd,0xfffff6b0, +0x0001034f,0xffff3241,0x0002da5c,0xfffe71c6, +0x0004a341,0xfffdb946,0x000651e8,0xfffd0e37, +0xfffa0402,0x0001e4d4,0xfffb8b9c,0x00014898, +0xfffd4e7d,0x0000a304,0xffff26b7,0xfffff7e1, +0x00010846,0xffff4b34,0x0002e897,0xfffea13f, +0x0004ba63,0xfffdff2d,0x00067115,0xfffd6839, +0xfff9e680,0x0001a1fa,0xfffb789e,0x00011b2e, +0xfffd43a4,0x00008c6e,0xffff2341,0xfffff8fd, +0x00010c9c,0xffff6469,0x0002f48f,0xfffed1a4, +0x0004cd6a,0xfffe4608,0x00068c1b,0xfffdc409, +0xfff9cd15,0x00015dfe,0xfffb68a0,0x0000ecee, +0xfffd3a2e,0x0000757d,0xffff204b,0xfffffa1e, +0x00011054,0xffff7da1,0x0002fe9c,0xffff033e, +0x0004de57,0xfffe8dc6,0x0006a2d5,0xfffe213e, +0xfff9b77d,0x000118d3,0xfffb5bde,0x0000be25, +0xfffd3224,0x00005e52,0xffff1dc1,0xfffffb4b, +0x00011353,0xffff9740,0x00030748,0xffff351c, +0x0004ec95,0xfffed755,0x0006b5b4,0xfffe7fc6, +0xfff9a599,0x0000d334,0xfffb519f,0x00008f08, +0xfffd2bbf,0x00004704,0xffff1bc1,0xfffffc71, +0x00011598,0xffffb135,0x00030e43,0xffff6720, +0x0004f6f3,0xffff2119,0x0006c46e,0xfffedf38, +0xfff997c7,0x00008d13,0xfffb4a55,0x00005fa5, +0xfffd273b,0x00002f76,0xffff1a63,0xfffffda0, +0x00011744,0xffffcb67,0x000312ff,0xffff99cf, +0x0004ff0c,0xffff6a9c,0x0006cebd,0xffff3f0a, +0xfff98dbe,0x00004691,0xfffb4620,0x00003010, +0xfffd24fc,0x000017b5,0xffff199d,0xfffffed8, +0x0001185a,0xffffe5c6,0x0003157e,0xffffcce3, +0x000503ae,0xffffb515,0x0006d537,0xffff9f5a, +0xfff98767,0xfffb44b0,0xfffc3131,0xfffd2475, +0xfffe1c28,0xffff195d,0x00001859,0x000118bd, +0x000218df,0x0003163a,0x000410e0,0x000504a7, +0x0005f2b3,0x0006d796,0x0007b1fe,0xfff98537, +0xfffa609b,0xfffc7e8b,0x00028ef6,0xfffde181, +0x000144eb,0xffff5500,0xffffefb9,0x0000d01d, +0xfffe9755,0x000249a4,0xfffd453c,0x0003b80e, +0xfffc01aa,0x000511d6,0xfffad527,0xfffb334e, +0x0003c6b0,0xfffc5778,0x00026a92,0xfffdc9f5, +0x00013314,0xffff4d99,0xfffff0b6,0x0000d911, +0xfffeab80,0x00026369,0xfffd6c0a,0x0003e17f, +0xfffc39d8,0x000549df,0xfffb1eb2,0xfffafe6c, +0x0003916c,0xfffc3321,0x000244a6,0xfffdb402, +0x00012035,0xffff46ac,0xfffff192,0x0000e16a, +0xfffebfe0,0x00027b3d,0xfffd9433,0x0004087b, +0xfffc74b7,0x00057e8d,0xfffb6a81,0xfffacc1c, +0x00035929,0xfffc10df,0x00021e0c,0xfffd9f6d, +0x00010cb7,0xffff402e,0xfffff279,0x0000e965, +0xfffed574,0x00029159,0xfffdbdc4,0x00042c4c, +0xfffcb1e7,0x0005b02d,0xfffbb942,0xfffa9d38, +0x00031fbe,0xfffbf0fd,0x0001f5b4,0xfffd8c38, +0x0000f8b1,0xffff3a21,0xfffff391,0x0000f0e6, +0xfffeec44,0x0002a642,0xfffde90e,0x00044e32, +0xfffcf0fb,0x0005de46,0xfffc0b18,0xfffa71d1, +0x0002e44a,0xfffbd3de,0x0001cb90,0xfffd7a97, +0x0000e403,0xffff3490,0xfffff49c,0x0000f7a8, +0xffff0340,0x0002b95f,0xfffe1573,0x00046dbe, +0xfffd3284,0x00060888,0xfffc5f51,0xfffa4996, +0x0002a659,0xfffbb8df,0x0001a0e1,0xfffd6a4e, +0x0000ced2,0xffff2f75,0xfffff593,0x0000fdbe, +0xffff1a53,0x0002ca87,0xfffe42f5,0x0004898a, +0xfffd7563,0x00062f0b,0xfffcb5de,0xfffa2508, +0x00026786,0xfffba0bf,0x0001754a,0xfffd5b5f, +0x0000b92c,0xffff2acd,0xfffff6b0,0x0001034f, +0xffff3241,0x0002da5c,0xfffe71c6,0x0004a341, +0xfffdb946,0x000651e8,0xfffd0e37,0xfffa0402, +0x00022713,0xfffb8b9c,0x00014898,0xfffd4e7d, +0x0000a304,0xffff26b7,0xfffff7e1,0x00010846, +0xffff4b34,0x0002e897,0xfffea13f,0x0004ba63, +0xfffdff2d,0x00067115,0xfffd6839,0xfff9e680, +0x0001e4d4,0xfffb789e,0x00011b2e,0xfffd43a4, +0x00008c6e,0xffff2341,0xfffff8fd,0x00010c9c, +0xffff6469,0x0002f48f,0xfffed1a4,0x0004cd6a, +0xfffe4608,0x00068c1b,0xfffdc409,0xfff9cd15, +0x0001a1fa,0xfffb68a0,0x0000ecee,0xfffd3a2e, +0x0000757d,0xffff204b,0xfffffa1e,0x00011054, +0xffff7da1,0x0002fe9c,0xffff033e,0x0004de57, +0xfffe8dc6,0x0006a2d5,0xfffe213e,0xfff9b77d, +0x00015dfe,0xfffb5bde,0x0000be25,0xfffd3224, +0x00005e52,0xffff1dc1,0xfffffb4b,0x00011353, +0xffff9740,0x00030748,0xffff351c,0x0004ec95, +0xfffed755,0x0006b5b4,0xfffe7fc6,0xfff9a599, +0x000118d3,0xfffb519f,0x00008f08,0xfffd2bbf, +0x00004704,0xffff1bc1,0xfffffc71,0x00011598, +0xffffb135,0x00030e43,0xffff6720,0x0004f6f3, +0xffff2119,0x0006c46e,0xfffedf38,0xfff997c7, +0x0000d334,0xfffb4a55,0x00005fa5,0xfffd273b, +0x00002f76,0xffff1a63,0xfffffda0,0x00011744, +0xffffcb67,0x000312ff,0xffff99cf,0x0004ff0c, +0xffff6a9c,0x0006cebd,0xffff3f0a,0xfff98dbe, +0x00008d13,0xfffb4620,0x00003010,0xfffd24fc, +0x000017b5,0xffff199d,0xfffffed8,0x0001185a, +0xffffe5c6,0x0003157e,0xffffcce3,0x000503ae, +0xffffb515,0x0006d537,0xffff9f5a,0xfff98767, +0x00004691,0xfffa609b,0xfffb44b0,0xfffc3131, +0xfffd2475,0xfffe1c28,0xffff195d,0x00001859, +0x000118bd,0x000218df,0x0003163a,0x000410e0, +0x000504a7,0x0005f2b3,0x0006d796,0x0007b1fe, +0xfff98537,0xfffbd51e,0x00032dd1,0xfffd2d8f, +0x0001eb47,0xfffe9968,0x00009af6,0x000011de, +0xffff4335,0x00018d69,0xfffdecd4,0x000302f8, +0xfffca0d7,0x0004683d,0xfffb67f8,0x0005b36d, +0x00045963,0xfffba72a,0x00030062,0xfffd0dee, +0x0001d046,0xfffe8a0a,0x00009258,0x000012b1, +0xffff4d9e,0x00019ec3,0xfffe0a44,0x0003245a, +0xfffcd082,0x000498f0,0xfffba919,0x0005f304, +0x00041bf4,0xfffb7bf1,0x0002d19e,0xfffcf060, +0x0001b407,0xfffe7c08,0x0000894a,0x0000138d, +0xffff58ac,0x0001afaf,0xfffe28fe,0x000343bf, +0xfffd026f,0x0004c6f6,0xfffbed06,0x00062e61, +0x0003dc0e,0xfffb52c0,0x0002a17f,0xfffcd522, +0x000196a0,0xfffe6e70,0x00007ff6,0x00001439, +0xffff63f6,0x0001beb3,0xfffe4882,0x0003616d, +0xfffd361b,0x0004f1cf,0xfffc332a,0x0006658f, +0x00039943,0xfffb2d0c,0x00026ec7,0xfffcbb94, +0x0001789f,0xfffe6160,0x00007677,0x000014d4, +0xffff6f74,0x0001cc9b,0xfffe694f,0x00037cbf, +0xfffd6b41,0x000519c2,0xfffc7baf,0x00069971, +0x00035486,0xfffb0a7a,0x00023ad8,0xfffca3ee, +0x00015989,0xfffe55af,0x00006ca7,0x00001570, +0xffff7b71,0x0001d9cb,0xfffe8b46,0x0003959e, +0xfffda1fe,0x00053ee6,0xfffcc6b4,0x0006c950, +0x00030e08,0xfffaea7c,0x0002061e,0xfffc8ec0, +0x00013911,0xfffe4b1d,0x00006278,0x000015e8, +0xffff87b6,0x0001e577,0xfffeadd6,0x0003acc2, +0xfffdda34,0x00056059,0xfffd136d,0x0006f4b5, +0x0002c562,0xfffacdc3,0x0001cfa6,0xfffc7b14, +0x0001182b,0xfffe4159,0x00005817,0x0000165c, +0xffff9417,0x0001f00f,0xfffed14c,0x0003c199, +0xfffe13f6,0x00057e83,0xfffd61cd,0x00071ba1, +0x00027ab5,0xfffab482,0x00019833,0xfffc6989, +0x0000f6ca,0xfffe38da,0x00004d9d,0x000016ef, +0xffffa103,0x0001f98f,0xfffef5c0,0x0003d3d1, +0xfffe4f00,0x0005998c,0xfffdb21e,0x00073e77, +0x00022e75,0xfffa9e9b,0x00015fd1,0xfffc5b13, +0x0000d45d,0xfffe318f,0x000042ed,0x0000176b, +0xffffae8f,0x0002018f,0xffff1a91,0x0003e40c, +0xfffe8af2,0x0005b0ca,0xfffe03b8,0x00075d14, +0x0001e141,0xfffa8bb0,0x0001262a,0xfffc4e31, +0x0000b1af,0xfffe2b26,0x00003805,0x000017b1, +0xffffbc21,0x000208b8,0xffff3fb6,0x0003f1d7, +0xfffec7af,0x0005c4c5,0xfffe5654,0x0007768a, +0x000192fe,0xfffa7bec,0x0000ec3f,0xfffc4365, +0x00008ec9,0xfffe25f0,0x00002d05,0x000017ec, +0xffffc984,0x00020ec6,0xffff658d,0x0003fcba, +0xffff0500,0x0005d576,0xfffeaa37,0x00078bc6, +0x00014367,0xfffa6fc9,0x0000b1f4,0xfffc3b82, +0x00006b06,0xfffe2201,0x000021eb,0x00001823, +0xffffd704,0x0002132a,0xffff8be7,0x00040534, +0xffff4315,0x0005e22e,0xfffeff0a,0x00079ce3, +0x0000f33f,0xfffa671b,0x000076ca,0xfffc3558, +0x00004762,0xfffe1ef3,0x000016a1,0x0000183f, +0xffffe4a6,0x00021664,0xffffb27d,0x00040b7b, +0xffff81e5,0x0005eb4e,0xffff5475,0x0007a857, +0x0000a2cb,0xfffa6218,0x00003b64,0xfffc31e2, +0x00002416,0xfffe1ce1,0x00000b46,0x00001850, +0xfffff24d,0x00021855,0xffffd93a,0x00040f75, +0xffffc0e6,0x0005f0e3,0xffffaa3e,0x0007af45, +0x0000519f,0x00030000,0x000f0007,0x003f001f, +0x00ff007f,0x03ff01ff,0x0fff07ff,0x3fff1fff, +0xffff7fff,0x00030000,0x00070005,0x000f0009, +0x003f001f,0x00ff007f,0x03ff01ff,0x0fff07ff, +0xffff1fff,0x00030000,0x00070005,0x000f0009, +0xffff001f,0x00030000,0xffff0005,0x04030504, +0x08070605,0x0c0b0a09,0x100f0e0d,0x03070504, +0x0605040a,0x0a090807,0x100d0c0b,0x03070503, +0x1005040a,0x10070502,0x03030100,0x03030303, +0x03030303,0x03030303,0x03010100,0x03030301, +0x03030303,0x03030303,0x03010100,0x03030301, +0x03010100,0x04020000,0x08070605,0x0c0b0a09, +0x100f0e0d,0x02010000,0x06050403,0x0a090807, +0x100d0c0b,0x02010000,0x10050403,0x10010000, +0x00030000,0x00090005,0x001f000f,0x007f003f, +0x01ff00ff,0x07ff03ff,0x1fff0fff,0x7fff3fff, +0x00030000,0x00090005,0x001f000f,0x007f003f, +0x0a070504,0x07060504,0x0b0a0908,0x0f0e0d0c, +0x0a070503,0x07060504,0x01010100,0x03030303, +0x03030303,0x03030303,0x01010100,0x03030303, +0x03010000,0x07060504,0x0b0a0908,0x0f0e0d0c, +0x03010000,0x07060504,0x00555555,0x002aaaab, +0x00249249,0x00124925,0x00111111,0x00088889, +0x00084210,0x00421084,0x00041041,0x00020821, +0x00020408,0x00081020,0x00010101,0x00008081, +0x00008040,0x00100804,0x00004010,0x00020080, +0x00002004,0x00004008,0x00001001,0x00000801, +0x00000800,0x00200100,0x00000400,0x00080020, +0x00000200,0x00020004,0x00200000,0x00600040, +0x00a00080,0x00e000c0,0x01200100,0x01600140, +0x01a00180,0x000001c0,0x00300020,0x00400038, +0x00600050,0x00800070,0x00c000a0,0x010000e0, +0x01800140,0x00200000,0x00300028,0x00400038, +0x00600050,0x00800070,0x00c000a0,0x010000e0, +0x00000140,0x00900000,0x00fc00d8,0x01680120, +0x01f801b0,0x02d00240,0x03f00360,0x05a00480, +0x000006c0,0x00680000,0x00b6009c,0x010500d0, +0x016d0139,0x020a01a1,0x02db0272,0x04140343, +0x000004e5,0x006c0000,0x00bd00a2,0x010e00d8, +0x017a0144,0x006301b0,0x013b00cf,0x00c601a7, +0x0000019e,0x00600000,0x00a80090,0x00f000c0, +0x01500120,0x01e00180,0x02a00240,0x03c00300, +0x00000480,0x10000000,0x10101010,0x20101010, +0x20202020,0x20202020,0x28202020,0x28282828, +0x00002828,0x10100000,0x10101010,0x10101010, +0x00000000,0x00000000,0x00000000,0x00000000, +0xcbcecdc4,0xcfcac9c8,0xc3c6c5cc,0xc7c2c1c0, +0x1b1e1d14,0x1f1a1918,0x1316151c,0x17121110, +0x2b2e2d24,0x2f2a2928,0x2326252c,0x27222120, +0x3b3e3d34,0x3f3a3938,0x3336353c,0x37323130, +0x0b0e0d04,0x0f0a0908,0x0306050c,0x07020100, +0xdbdeddd4,0xdfdad9d8,0xd3d6d5dc,0xd7d2d1d0, +0xebeeede4,0xefeae9e8,0xe3e6e5ec,0xe7e2e1e0, +0xfbfefdf4,0xfffaf9f8,0xf3f6f5fc,0xf7f2f1f0, +0x4b4e4d44,0x4f4a4948,0x4346454c,0x47424140, +0x9b9e9d94,0x9f9a9998,0x9396959c,0x97929190, +0xabaeada4,0xafaaa9a8,0xa3a6a5ac,0xa7a2a1a0, +0xbbbebdb4,0xbfbab9b8,0xb3b6b5bc,0xb7b2b1b0, +0x8b8e8d84,0x8f8a8988,0x8386858c,0x87828180, +0x5b5e5d54,0x5f5a5958,0x5356555c,0x57525150, +0x6b6e6d64,0x6f6a6968,0x6366656c,0x67626160, +0x7b7e7d74,0x7f7a7978,0x7376757c,0x77727170, +0x341424c4,0x3e1e2ece,0x3d1d2dcd,0x3b1b2bcb, +0xb494a444,0xbe9eae4e,0xbd9dad4d,0xbb9bab4b, +0xf4d4e404,0xfedeee0e,0xfddded0d,0xfbdbeb0b, +0x74546484,0x7e5e6e8e,0x7d5d6d8d,0x7b5b6b8b, +0x3c1c2ccc,0x361626c6,0x351525c5,0x331323c3, +0xbc9cac4c,0xb696a646,0xb595a545,0xb393a343, +0xfcdcec0c,0xf6d6e606,0xf5d5e505,0xf3d3e303, +0x7c5c6c8c,0x76566686,0x75556585,0x73536383, +0x381828c8,0x3a1a2aca,0x391929c9,0x3f1f2fcf, +0xb898a848,0xba9aaa4a,0xb999a949,0xbf9faf4f, +0xf8d8e808,0xfadaea0a,0xf9d9e909,0xffdfef0f, +0x78586888,0x7a5a6a8a,0x79596989,0x7f5f6f8f, +0x301020c0,0x321222c2,0x311121c1,0x371727c7, +0xb090a040,0xb292a242,0xb191a141,0xb797a747, +0xf0d0e000,0xf2d2e202,0xf1d1e101,0xf7d7e707, +0x70506080,0x72526282,0x71516181,0x77576787, +0x05040100,0x15141110,0x25242120,0x35343130, +0x85848180,0x95949190,0xa5a4a1a0,0xb5b4b1b0, +0xc0408000,0xe060a020,0xd0509010,0xf070b030, +0xc8488808,0xe868a828,0xd8589818,0xf878b838, +0xc4448404,0xe464a424,0xd4549414,0xf474b434, +0xcc4c8c0c,0xec6cac2c,0xdc5c9c1c,0xfc7cbc3c, +0xc2428202,0xe262a222,0xd2529212,0xf272b232, +0xca4a8a0a,0xea6aaa2a,0xda5a9a1a,0xfa7aba3a, +0xc6468606,0xe666a626,0xd6569616,0xf676b636, +0xce4e8e0e,0xee6eae2e,0xde5e9e1e,0xfe7ebe3e, +0xc1418101,0xe161a121,0xd1519111,0xf171b131, +0xc9498909,0xe969a929,0xd9599919,0xf979b939, +0xc5458505,0xe565a525,0xd5559515,0xf575b535, +0xcd4d8d0d,0xed6dad2d,0xdd5d9d1d,0xfd7dbd3d, +0xc3438303,0xe363a323,0xd3539313,0xf373b333, +0xcb4b8b0b,0xeb6bab2b,0xdb5b9b1b,0xfb7bbb3b, +0xc7478707,0xe767a727,0xd7579717,0xf777b737, +0xcf4f8f0f,0xef6faf2f,0xdf5f9f1f,0xff7fbf3f, +0x1045a3e2,0x000000f4,0x263b7333,0x766b2363, +0x2b367e3e,0x7b662e6e,0x06db93d3,0x964b0343, +0x0bd69ede,0x9b460e4e,0x825f1757,0x12cf87c7, +0x8f521a5a,0x1fc28aca,0x00d199d9,0x90410949, +0x01d098d8,0x91400848,0x24357d3d,0x74652d6d, +0x25347c3c,0x75642c6c,0x04d59ddd,0x94450d4d, +0x05d49cdc,0x95440c4c,0x80511959,0x10c189c9, +0x81501858,0x11c088c8,0x02df97d7,0x924f0747, +0x0fd29ada,0x9f420a4a,0x865b1353,0x16cb83c3, +0x8b561e5e,0x1bc68ece,0xa6bbf3b3,0xf6eba3e3, +0xabb6febe,0xfbe6aeee,0x223f7737,0x726f2767, +0x2f327a3a,0x7f622a6a,0xa0b1f9b9,0xf0e1a9e9, +0xa1b0f8b8,0xf1e0a8e8,0x84551d5d,0x14c58dcd, +0x85541c5c,0x15c48ccc,0xa4b5fdbd,0xf4e5aded, +0xa5b4fcbc,0xf5e4acec,0x20317939,0x70612969, +0x21307838,0x71602868,0xa2bff7b7,0xf2efa7e7, +0xafb2faba,0xffe2aaea,0x00000000,0x00000000, + +}; + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/mpg.h linux.20pre5-ac2/drivers/media/video/ls220/mpg.h --- linux.20pre5/drivers/media/video/ls220/mpg.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/mpg.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,1612 @@ +static u32 MPGUcode1f1800[] = { +0x820f001f,0x802f001f,0x81df0000,0xb500000c, +0x00ffb81e,0x00000000,0x00000000,0x00000000, +0x00ffb81e,0x00000000,0x00000000,0x00000000, +0xb5000c13,0x00000000,0x00000000,0x00000000, +0x80070800,0x001f6047,0x8013001f,0x90208000, +0x003fb174,0x803effe8,0x803effec,0x9020fa00, +0x803effd0,0x803effdc,0x803effd8,0x9020fe00, +0x803effd4,0x805bff7c,0x802500d4,0x94020080, +0xb0000000,0xb4200023,0x8013ffcf,0x9800cfff, +0x80730030,0x98631000,0x94420007,0xb0020002, +0xb4200005,0x8013ffc7,0x9800c7ff,0x80730038, +0x98631000,0xb5000006,0xb0020001,0xb4200004, +0x8013ffcf,0x9800cfff,0x80730030,0x98631000, +0x1421b800,0x1821b803,0x802600d4,0x8033001f, +0x98210000,0x802600a2,0x8033001f,0x98210300, +0x802600a3,0x80270225,0x80530001,0x98420100, +0x1821b802,0x80530200,0x98420000,0x804600a6, +0xb500001d,0x805bff7c,0x8013ffcf,0x9800cfff, +0x80730030,0x98631000,0x94420007,0xb0020002, +0xb4200005,0x8013ffc7,0x9800c7ff,0x80730038, +0x98631000,0xb5000006,0xb0020001,0xb4200004, +0x8013ffcf,0x9800cfff,0x80730030,0x98631000, +0x1421b800,0x1821b803,0x802600d4,0x8033001f, +0x98210000,0x802600a2,0x8033001f,0x98210300, +0x802600a3,0x80270c25,0x802600a1,0x80270002, +0x803eff84,0x80070000,0x801effc0,0x801effc4, +0x801effc8,0x801effcc,0x801eff88,0x80770000, +0x8057ffff,0x80170080,0x80070000,0xb6003f02, +0xb6002001,0x001fa020,0x8007ffff,0x801eff84, +0x80070001,0x001f25dc,0x001f20b1,0x80070000, +0x001f6046,0x001fb17c,0x001fb17d,0x80070000, +0x801e78d0,0x98004000,0x001f62ea,0x80070100, +0x801efff0,0x81df0004,0x00000000,0x00000000, +0x801bfff0,0x00000000,0x940000ff,0xb0000000, +0xb420005b,0x003f42ea,0x94010010,0xb0000000, +0xb400fff7,0x003f05dc,0xb0010001,0xb4200034, +0x803bffe8,0x801bffec,0x00000000,0x3001b800, +0xb4600001,0x90214000,0x0421b800,0xb0010800, +0xb460000d,0x80050086,0x005f902e,0xb0020000, +0xb4200002,0x001fb02e,0xb5000006,0x0420b802, +0xb0010930,0xb4a0ffe2,0x80070000,0x001fb02e, +0x83e40162,0xb500ffde,0x83e40129,0x80070000, +0x001fb02e,0x001f42ea,0x9400000f,0xb0000000, +0xb4000010,0x9400fff0,0x001f62ea,0x003f9174, +0x9421ffff,0x90210004,0xb001c000,0xb4800002, +0x8421c000,0x90218000,0x8013001f,0x1821b800, +0x003fb174,0x003f917c,0x90210004,0x003fb17c, +0x83e4014a,0x8013001f,0x83e71b0c,0x1bffb800, +0x003f9179,0x1821b800,0x00ffb801,0xb5000008, +0x80270000,0x003f25dc,0x8013001f,0x83e71b30, +0x1bffb800,0x003f917a,0x1821b800,0x00ffb801, +0x80070000,0x001f20b1,0x001f42ea,0x9420000f, +0xb0010000,0xb4200003,0x98000800,0x001f62ea, +0xb500ffaf,0x9400fff0,0x001f62ea,0x80270000, +0x8057ffff,0x80770000,0x80171800,0x81df0000, +0x00000000,0x00000000,0xb6000302,0xb6002001, +0x001fa021,0x81df0004,0xb500ffa1,0xb500ffa0, +0x803bffc0,0x805bffc4,0x807bffc8,0x809bffcc, +0x5828b801,0x5cb8b802,0x1821b805,0x5848b802, +0x5cb8b803,0x1842b805,0x5868b803,0x5cb8b804, +0x1863b805,0x5888b804,0x1884b800,0x803effc0, +0x805effc4,0x807effc8,0x809effcc,0x003f42ea, +0xb0000086,0xb4400079,0xb0000084,0xb4000049, +0xb0000085,0xb4000063,0xb0000086,0xb400006c, +0xb0000081,0xb4000005,0xb0000082,0xb4000003, +0xb0000080,0xb4000001,0xb5000069,0x8013007f, +0x9800ffff,0x001fb02d,0x80070000,0x001fb17c, +0x8013001f,0x9040fa00,0x805effd0,0x805effdc, +0x805effd8,0x9040fe00,0x805effd4,0x9040c000, +0x805effe4,0x90008000,0x801effe0,0x001fb174, +0x801effe8,0x801effec,0x80078000,0x801e78d4, +0x80070000,0x001fb17c,0x001fb17d,0x001fb02e, +0x83e400e6,0x8013001f,0x98000000,0x800600a2, +0x8013001f,0x98000300,0x800600a3,0x805bff7c, +0x80070c25,0x94420080,0xb0020080,0xb420000d, +0x8013001f,0x98000000,0x800600a2,0x8013001f, +0x98000300,0x800600a3,0x80070225,0x80530001, +0x98420100,0x1800b802,0x80530200,0x98420000, +0x804600a6,0x800600a1,0x80050080,0x98000022, +0x80060080,0x80072080,0x001fb179,0x80074618, +0x001fb17a,0x80070001,0x001f25dc,0x98214000, +0xb5000029,0x8047ffff,0x805eff84,0x805bff88, +0x00000000,0xb0020001,0xb4200002,0x80470000, +0x805eff88,0x805bff7c,0x80070c25,0x94420080, +0xb0020080,0xb4200007,0x80070225,0x80530001, +0x98420100,0x1800b802,0x80530200,0x98420000, +0x804600a6,0x800600a1,0x80070001,0x800600a0, +0x9421efff,0x98210010,0xb500000f,0x80070000, +0x001fb17c,0x80070001,0x001f25dc,0x83e400a3, +0x80050081,0x80330008,0x98210000,0x1800b801, +0x80060081,0x003f42ea,0x9421ffef,0xb5000002, +0x98211000,0x9421ffef,0x83e40098,0x003f62ea, +0x80070100,0x801efff0,0xb500ff11,0xb000008b, +0xb400001c,0xb0000087,0xb400ffe8,0xb0000088, +0xb4000023,0xb000008a,0xb4000024,0xb000008c, +0xb4000019,0xb000008e,0xb4000014,0xb000008d, +0xb400001d,0xb0000089,0xb400001f,0xb00000a0, +0xb4000021,0xb00000a1,0xb4000022,0xb00000a2, +0xb400002f,0xb00000a3,0xb4000027,0xb00000a4, +0xb4000031,0xb00000a5,0xb4000035,0xb00000a6, +0xb4000039,0x803efff8,0xb500ffdd,0x80070000, +0x001fb17e,0xb500ffda,0x803bffb0,0x00000000, +0x003fb02d,0xb500ffd6,0x98210020,0xb500ffd2, +0x9421ffdf,0xb500ffd0,0xb500ffd1,0x80270341, +0x803efff8,0xb500ffce,0x803bff80,0x00000000, +0x003f62ef,0xb500ffca,0x003f917b,0x803efff8, +0xb500ffc7,0x80270000,0x8047fef0,0x003eb802, +0x90420004,0x003eb802,0x90420004,0x003eb802, +0x90420004,0x003eb802,0x81df0000,0x00000000, +0x00000000,0x83640dbd,0x81df0004,0xb500ffb8, +0x81df0000,0x00000000,0x00000000,0x83640d67, +0x81df0004,0xb500ffb2,0x81df0000,0x00000000, +0x00000000,0x83640d22,0x81df0004,0xb500ffac, +0x81df0000,0x00000000,0x00000000,0x83440c85, +0x81df0004,0xb500ffa6,0x81df0000,0x00000000, +0x00000000,0x83440c6a,0x81df0004,0xb500ffa0, +0x817bffe8,0x815b78d4,0x00000000,0x956bffff, +0x300bb80a,0xb4600001,0x916b4000,0x056bb80a, +0xb00b0080,0xb4a0002a,0x80af001f,0x808f0000, +0x806f0000,0x81b300ff,0x8057ffff,0x5d67b80b, +0x5d42b80a,0x81df0000,0x00000000,0x00000000, +0xb62b001c,0xb00a3000,0xb4800001,0x854a1000, +0x80cf0400,0x015fb178,0x5942b80a,0x01cfb80a, +0x015f9178,0xb520ffff,0x80171000,0xb600200a, +0x01ff8000,0x5a18b80f,0x5a28b80f,0x1631b80d, +0x5e48b80f,0x9652ff00,0x5e78b80f,0x1a73b810, +0x1a73b811,0x1813a032,0x80cf0400,0x015fb178, +0x5942b80a,0x01afb80a,0x015f9178,0xb520ffff, +0x914a0020,0x81df0004,0x5942b80a,0x815e78d4, +0x00000000,0x00000000,0x00ffb81f,0x81df0000, +0x80070000,0x80470000,0x81171800,0xb6002003, +0xb6003002,0x001eb802,0x90420004,0xb6002003, +0x011fa020,0x011fa020,0x011fa020,0x81df0004, +0x00ffb81f,0x80070000,0x80478000,0x81df0000, +0x00000000,0x00000000,0xb6002003,0xb6008002, +0x001eb802,0x90420004,0x81df0004,0x00ffb81f, +0x015f42ea,0x944a4000,0xb0024000,0xb4200081, +0x954abfff,0x015f62ea,0x808f0000,0x80ef007c, +0x80171000,0x80971400,0x80270000,0xb6001003, +0xb6002002,0x001fa021,0x009fa021,0x80a76604, +0x80271400,0x81df0000,0x00000000,0x00000000, +0xb6001004,0x01efb801,0x01afb805,0xb520ffff, +0x90a50080,0x81df0004,0x80a76e04,0x80271400, +0x81df0000,0x00000000,0x00000000,0xb6001004, +0x01efb801,0x01afb805,0xb520ffff,0x90a50080, +0x81df0004,0x806f001f,0x80af001f,0x80276400, +0x5c22b801,0x806701e1,0x00cfb803,0x003fb178, +0x5822b801,0x01cfb801,0x003f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x80275c00,0x5c22b801, +0x80670200,0x81df0000,0x00000000,0x00000000, +0xb600100a,0x00cfb803,0x003fb178,0x5822b801, +0x01cfb801,0x003f9178,0x0047b86f,0xb0020001, +0xb4c0fffd,0x90210020,0x90630020,0x81df0004, +0x808f0000,0x806f001f,0x80af001f,0x8027647c, +0x5c22b801,0x8067017e,0x81df0000,0x00000000, +0x00000000,0xb600020a,0x00cfb803,0x003fb178, +0x5822b801,0x01cfb801,0x003f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x90210020,0x90630020, +0x81df0004,0x806f0010,0x80af0010,0x8027657c, +0x5c22b801,0x806701be,0x00cfb803,0x003fb178, +0x5822b801,0x01cfb801,0x003f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x802765c0,0x5c22b801, +0x806701cf,0x00cfb803,0x003fb178,0x5822b801, +0x01cfb801,0x003f9178,0x0047b86f,0xb0020001, +0xb4c0fffd,0x80276000,0x005fb801,0x8033001f, +0x98218000,0x803effe0,0x90214000,0x803effe4, +0x8193001f,0x998c8000,0x019fb174,0x83270000, +0x003fb819,0x003f9174,0x5823b801,0x83338000, +0x1b39b801,0x003fb819,0x00000000,0x00000000, +0x81550000,0x0187b860,0x858c0040,0x81b380fc, +0x99ad0000,0x300cb80d,0xb4600003,0x81b30002, +0x99ad0000,0x118cb80d,0x003fb80c,0x00000000, +0x00000000,0x81550000,0x8257ffff,0x82d7ffff, +0x8357ffff,0x81672000,0x83440191,0xb00a0001, +0xb4000141,0x0187b860,0x858c0010,0x5988b80c, +0x5d8bb80c,0x958cffff,0xb00cc000,0xb4800002, +0x858cc000,0x918c8000,0x81b3001f,0x198cb80d, +0x801bffec,0x00000000,0x819effec,0x819e78d8, +0x019fb174,0x05acb800,0x300cb800,0xb4600001, +0x91ad4000,0x001f917c,0x1000b80d,0x001fb17c, +0x8344019c,0xb00a0000,0xb4200127,0x015f0081, +0xb00a0002,0xb4200124,0x037f0082,0xb01b0000, +0xb400001e,0x0367b860,0x5b68b81b,0x5f68b81b, +0x017f4047,0x916b0010,0x5963b80b,0x83440168, +0x801bff84,0xb00a0001,0xb400000b,0xb00b00c0, +0xb460fffa,0x803f0000,0x80138000,0x1b7bb800, +0x003fb81b,0x00000000,0x00000000,0x80150000, +0x801bff84,0xb5000009,0x803f0000,0x80138000, +0x1b7bb800,0x003fb81b,0x00000000,0x00000000, +0x80150000,0x801bff84,0xb5000103,0x801bff84, +0x003f0084,0x3000b801,0x803eff84,0xb4000073, +0x801bff7c,0x00000000,0x94800080,0xb0040080, +0xb4200036,0x94800007,0x80730200,0xb0010002, +0xb420000e,0x80270265,0xb0040001,0xb4200003, +0x80130030,0x98000000,0xb5000006,0x80130030, +0x98000000,0xb0040000,0xb4000002,0x80130038, +0x98000000,0x98630060,0xb500001f,0xb0010000, +0xb420000e,0x80270225,0xb0040001,0xb4200003, +0x80130030,0x98001000,0xb5000006,0x80130030, +0x98001000,0xb0040000,0xb4000002,0x80130038, +0x98001000,0x98630000,0xb500000f,0xb0010001, +0xb420004a,0x80270225,0xb0040001,0xb4200003, +0x80130030,0x98002000,0xb5000006,0x80130030, +0x98000000,0xb0040000,0xb4000002,0x80130038, +0x98000000,0x98630040,0x806600a6,0x80530001, +0x98420100,0x1821b802,0xb500002d,0x94800007, +0xb0010002,0xb420000d,0x80270c65,0xb0040001, +0xb4200003,0x80130030,0x98000000,0xb5000006, +0x80130030,0x98000000,0xb0040000,0xb4000002, +0x80130038,0x98000000,0xb500001d,0xb0010000, +0xb420000d,0x80270c25,0xb0040001,0xb4200003, +0x80130030,0x98001000,0xb5000006,0x80130030, +0x98001000,0xb0040000,0xb4000002,0x80130038, +0x98001000,0xb500000e,0xb0010001,0xb4200017, +0x80270c25,0xb0040001,0xb4200003,0x80130030, +0x98002000,0xb5000006,0x80130030,0x98000000, +0xb0040000,0xb4000002,0x80130038,0x98000000, +0x806500d4,0x8053ffcf,0x9842cfff,0xb0040002, +0xb4200002,0x8053ffc7,0x9842c7ff,0x802600a1, +0x1463b802,0x1863b800,0x806600d4,0x807bff7c, +0x00000000,0x94630080,0xb0030080,0xb420000b, +0x807bff88,0x00000000,0xb0030001,0xb4000007, +0x802500a1,0x80670001,0x807eff88,0x80530001, +0x98420100,0x1821b802,0x802600a1,0x81070000, +0x011f62e2,0x011f62e3,0x011f0082,0xb0080000, +0xb4200004,0x81150010,0x00000000,0x00000000, +0x011f62de,0x011f0081,0xb0080001,0xb4200026, +0x81070020,0x011f25c1,0x81070180,0x011f62e1, +0x8344023e,0x8344026a,0x011f0082,0xb0080000, +0xb4200004,0x834401bd,0x834401aa,0xb00a0000, +0xb4200061,0x80c70000,0x00df25cb,0x83440281, +0x8344064f,0x02ff05b9,0x82a70000,0x82870000, +0x83440407,0x92940001,0x3014b817,0xb480fffc, +0x834406ef,0x80270000,0x003f25dc,0x834407de, +0x003f05dc,0xb0010001,0xb4000003,0x80272694, +0x003fb17a,0x00ffb81f,0x80d3001f,0x8347266c, +0x1b5ab806,0xb500002d,0xb0080002,0x81470004, +0xb4200045,0x81070008,0x011f25c1,0x81070480, +0x011f62e1,0x8344029e,0x834402dc,0x011f0082, +0xb0080000,0xb4200004,0x834401aa,0x83440181, +0xb00a0000,0xb4200038,0x80c70000,0x00df25cb, +0x83440368,0x02df05cb,0x5ec2b816,0x8344066b, +0x02ff05b9,0x82a70000,0x82870000,0x834403dc, +0x92940001,0x3014b817,0xb480fffc,0x92b50001, +0xb0150003,0xb480fff8,0x834406c1,0x80270000, +0x003f25dc,0x834407b0,0x003f05dc,0xb0010001, +0xb4000003,0x8027274c,0x003fb17a,0x00ffb81f, +0x80d3001f,0x83472710,0x1b5ab806,0x80db78d8, +0x80fbffec,0x00000000,0x3006b807,0xb4200007, +0x00df05cb,0x90c60001,0x00df25cb,0xb006000c, +0xb4000002,0x035fb179,0x00ffb81f,0x80c70000, +0x00df25cb,0x80fb78dc,0x00000000,0x90e70001, +0xb00701b9,0xb4a00001,0x80e70001,0x80fe78dc, +0xb500feb0,0x802500a5,0x8153001f,0x3001b80a, +0xb420fffc,0x00ffb81f,0x001f42ea,0x1800b80a, +0x001f62ea,0x017f4047,0x5963b80b,0x0187b860, +0x118cb80b,0x81b380fe,0x99ad0000,0x300cb80d, +0xb4800003,0x81b30002,0x99ad0000,0x058cb80d, +0x003fb80c,0x00000000,0x00000000,0x81550000, +0x0187b860,0x5988b80c,0x5d8bb80c,0x958cffff, +0xb00cc000,0xb4800002,0x858cc000,0x918c8000, +0x81b3001f,0x198cb80d,0x801bffec,0x00000000, +0x819effec,0x019fb174,0x05acb800,0x300cb800, +0xb4600001,0x91ad4000,0x001f917c,0x1000b80d, +0x001fb17c,0x80171000,0x80971400,0x80270000, +0xb6001003,0xb6002002,0x001fa021,0x009fa021, +0x80171800,0xb6000602,0xb6002001,0x001fa021, +0x806f001f,0x80af001f,0x80a76604,0x80271400, +0x81df0000,0x00000000,0x00000000,0xb6001004, +0x01efb801,0x01afb805,0xb520ffff,0x90a50080, +0x81df0004,0x80a76e04,0x80271400,0x81df0000, +0x00000000,0x00000000,0xb6001004,0x01efb801, +0x01afb805,0xb520ffff,0x90a50080,0x81df0004, +0x81472080,0x015fb179,0x00ffb81f,0x00000000, +0x811be024,0x0107b860,0x95080007,0xb0080000, +0xb4000004,0xa5080008,0x00000000,0x0155b808, +0x00000000,0x8115000c,0x856b000c,0xb0080fff, +0xb400000b,0x81550004,0x856b0004,0x5904b808, +0x1908b80a,0x95080fff,0xb0080fff,0xb4000004, +0x81470001,0xb00b0020,0xb440fff6,0xb500000c, +0x81d50004,0x856b0004,0x00000000,0xb00e000f, +0xb400fffb,0x940b0007,0xb0000000,0xb420ffed, +0x001f42ea,0x9400fffe,0x81470000,0x001f62ea, +0x00ffb81a,0x950e0008,0x5d03b808,0x00000000, +0xb0080000,0xb40000cd,0x011f2080,0x950e0006, +0x5d01b808,0x81270004,0x0529b808,0x950e0001, +0x013f2081,0x011f2082,0x81150004,0x00000000, +0xb0080000,0xb40000c1,0xb008000f,0xb40000bf, +0x011f2083,0x81150002,0x00000000,0x81670004, +0xb0080002,0xb46000b9,0x011f2084,0x013f0081, +0xb0090002,0xb4200011,0x013f0083,0xb0080000, +0xb4200002,0x81077844,0xb5000005,0xb0080001, +0xb4200002,0x81077884,0xb5000001,0x81077824, +0x013f0083,0x5921b809,0x1129b808,0x0119b809, +0x00000000,0x00000000,0x011f6047,0x81150001, +0x00000000,0x011f2085,0x81150001,0x00000000, +0x011f2086,0x81350002,0x00000000,0x013f2087, +0x81150002,0x00000000,0x011f2088,0x81150001, +0x00000000,0x011f2089,0x81150001,0x00000000, +0x011f208a,0x81150002,0x00000000,0x011f208b, +0x81070001,0xb0090003,0xb4000001,0x81070002, +0x011f25b9,0x81070020,0x013f0081,0xb0090002, +0xb4200069,0x85290001,0xad29000f,0x00000000, +0x011f0083,0x1108b809,0x5901b808,0x910877c8, +0x0139b808,0x011f05b9,0x85080001,0x6928b809, +0x011f0084,0xb0090038,0xb4800007,0xb0080001, +0xb4000002,0xb0090050,0xb4400003,0x81270000, +0x8107001b,0xb5000010,0xb0080001,0xb4000005, +0xb0090060,0xb4800003,0x81270001,0x8107001e, +0xb5000009,0xb0080002,0xb4000005,0xb0090030, +0xb4400003,0x81270002,0x81070008,0xb5000002, +0x81270003,0x8107000c,0x011f25bb,0x013f25c0, +0xb0090002,0xb460001b,0x80477604,0x5c42b802, +0x814fffc0,0x80cf0037,0x005fb178,0x5842b802, +0x01cfb802,0x005f9178,0xb520ffff,0x90420020, +0x814fb580,0x80cf0057,0x005fb178,0x5842b802, +0x01cfb802,0x005f9178,0xb520ffff,0x804778a4, +0x5c42b802,0x814f39c0,0x80cf002f,0x005fb178, +0x5842b802,0x01cfb802,0x005f9178,0xb520ffff, +0xb5000025,0x804776e0,0x5c42b802,0x814fef40, +0x80cf0037,0x005fb178,0x5842b802,0x01cfb802, +0x005f9178,0xb520ffff,0x8297013c,0x8317018c, +0x81df0000,0x00000000,0x00000000,0xb6000602, +0x005f8034,0x031fa022,0x82970124,0x83170160, +0xb6000602,0x005f8034,0x031fa022,0x8297010c, +0x83170134,0xb6000602,0x005f8034,0x031fa022, +0x81df0004,0x804778c4,0x5c42b802,0x814f1080, +0x80cf002f,0x005fb178,0x5842b802,0x01cfb802, +0x005f9178,0xb520ffff,0x013f0081,0xb0090001, +0xb420000e,0x808f0000,0x806f001b,0x80af001b, +0x80277758,0x5c22b801,0x80670037,0x00cfb803, +0x003fb178,0x5822b801,0x01cfb801,0x003f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x011f25bb, +0x011f0087,0xb0080001,0xb4000002,0x011f05bb, +0xb5000003,0x011f0088,0x91080001,0x5902b808, +0x011f25ba,0x81470000,0x00ffb81a,0x81470008, +0x00ffb81a,0x81270000,0x81470000,0x300842de, +0xb400000b,0x013f42e2,0x91290001,0x013f62e2, +0x013f42e3,0x91290001,0x013f62e3,0x83640006, +0x00000000,0x00000000,0x013f42e2,0x81470002, +0x013f62e2,0x00ffb81a,0x00ffb81b,0x83640049, +0x80c70004,0x80270000,0x81df0000,0x00000000, +0x00000000,0xb600200d,0x00ff05b9,0x5c42b801, +0x300205ba,0xb4800001,0x80e70001,0x80470000, +0xb6270005,0x1062b801,0x914301b8,0x00fff00a, +0x83840055,0x90420080,0x90210004,0x81df0004, +0x00ffb81a,0x83640033,0x017f05bb,0x800700bc, +0x80270000,0x81df0000,0xb00b0000,0xb4000015, +0xb62b0014,0x00ff05b9,0x5c42b801,0x300205ba, +0xb4800001,0x80e70001,0x80470000,0xb0070000, +0xb400000b,0xb627000a,0x1062b801,0x914301b8, +0x00fff00a,0x5c62b801,0x1063b800,0x00bff003, +0x90650134,0x00dff003,0x83840037,0x90420080, +0x90210004,0x81df0004,0x019f05b9,0x80c70002, +0x80270000,0x81df0000,0xb00b0000,0xb400000f, +0xb62b000e,0x80470000,0xb00c0000,0xb400000a, +0xb62c0009,0x1062b801,0x914301b8,0x00fff00a, +0xb0070000,0xb4000003,0x906302b8,0x00fff003, +0x83840021,0x90420080,0x90210004,0x81df0004, +0x00ffb81a,0x8107ffff,0x80c70004,0x00ff0083, +0x83840019,0x80c70002,0x00ff0084,0x83840016, +0x80c70001,0x00ff0085,0x83840013,0x80c70001, +0x00ff0086,0x83840010,0x80c70002,0x00ff0087, +0x8384000d,0x80c70002,0x00ff0088,0x8384000a, +0x80c70001,0x00ff0089,0x83840007,0x80c70001, +0x00ff008a,0x83840004,0x80c70002,0x00ff008b, +0x83840001,0x00ffb81b,0x80a70001,0x64a6b805, +0x5ca1b805,0xb0050000,0xb400000e,0x95288000, +0xb0090000,0xb4000001,0x81270001,0x5901b808, +0x1547b805,0xb00a0000,0xb4000001,0x81470001, +0x2129b80a,0xb0090000,0xb4000001,0xa1088005, +0xb500ffef,0x9508ffff,0x00ffb81c,0x015f05ba, +0x013f05b9,0x800700bc,0xb0090000,0xb4000012, +0xb00a0000,0xb4000010,0x80270000,0x81df0000, +0x00000000,0x00000000,0xb62a000b,0x80470000, +0xb6290008,0x80950004,0x5865b802,0x1063b801, +0x5862b803,0x906301b8,0x0217b803,0x90420001, +0x021fa004,0x90210001,0x81df0004,0xa54a0020, +0xb4c00011,0xb0090000,0xb400000f,0x81df0000, +0x00000000,0x00000000,0xb62a000b,0x80950004, +0x80470000,0xb6290007,0x5865b802,0x1063b801, +0x5862b803,0x906301b8,0x0217b803,0x90420001, +0x021fa004,0x90210001,0x81df0004,0x00ffb81a, +0x013f05b9,0xb0090000,0xb400001c,0x80270000, +0x81df0000,0x00000000,0x00000000,0xb6002017, +0x80470000,0xb6290014,0x5865b802,0x1063b801, +0x5862b803,0x914301b8,0x009ff00a,0xad420060, +0x00000000,0x114ab801,0x5942b80a,0x914a1c80, +0x0217b80a,0xb0040000,0xb4000004,0x80950006, +0x00000000,0x021fa004,0xb5000002,0x8087003f, +0x021fa004,0x90420001,0x90210001,0x81df0004, +0x00ffb81a,0x8257ffff,0x82d7ffff,0x011f05ba, +0x013f05b9,0x80270000,0xb0090000,0xb4000033, +0x81df0000,0x00000000,0x00000000,0xb6280015, +0x80470000,0xb6290012,0x5865b802,0x1063b801, +0x5862b803,0x914301b8,0xaca20060,0x009ff00a, +0x10a5b801,0x58a2b805,0x90a502b8,0x0217b805, +0x80670000,0xb0040000,0xb4000003,0x90840001, +0x0075b804,0x00000000,0x021fa003,0x90420001, +0x90210001,0x81df0004,0xa5480020,0xb4000017, +0x5822b801,0x81df0000,0x00000000,0x00000000, +0xb62a0011,0x914101b8,0x90a102b8,0x0217b805, +0x009ff00a,0xb0040000,0x80670000,0xb4000002, +0x90840001,0x0075b804,0xb6290006,0x021fa203, +0x009f8210,0x009f8210,0x009f8210,0x009f8210, +0x009f8210,0x90210004,0x81df0004,0x00ffb81a, +0x015f05ba,0x013f05b9,0x800700bc,0xb0090000, +0xb4000016,0xb00a0000,0xb4000014,0x80270000, +0x81df0000,0x00000000,0x00000000,0xb62a000f, +0x80470000,0xb629000c,0x1080b801,0x007ff004, +0x90830134,0x007ff004,0x0095b803,0x5865b802, +0x1063b801,0x5862b803,0x906301b8,0x0217b803, +0x90420001,0x021fa004,0x90210001,0x011f05bb, +0x254ab808,0xb4c0000d,0xb62a000c,0x1080b801, +0x007ff004,0x90830134,0x007ff004,0x0095b803, +0x5862b801,0x906301b8,0x0217b803,0x90210001, +0x021fa204,0x007f8210,0x021fa004,0xa5480020, +0xb4c0000e,0xb0090000,0xb400000c,0x80870000, +0xb62a000a,0x80470000,0xb6290007,0x5865b802, +0x1063b801,0x5862b803,0x906301b8,0x0217b803, +0x90420001,0x021fa004,0x90210001,0x81df0004, +0x00000000,0x00000000,0x00ffb81a,0x011f05bb, +0x013f05b9,0xb0080000,0xb4000016,0xb0090000, +0xb4000014,0x81df0000,0x00000000,0x80270000, +0xb6280010,0x80470000,0xb629000d,0x5865b802, +0x1063b801,0x5862b803,0x914301b8,0x009ff00a, +0xb0040000,0xb4000005,0x80950002,0x906302b8, +0x0217b803,0x00000000,0x021fa004,0x90420001, +0x90210001,0x81df0004,0xa5480020,0xb00a0000, +0xb4000011,0xb0090000,0xb400000f,0x81df0000, +0x00000000,0x80870000,0xb62a000b,0x80470000, +0xb6290008,0x5865b802,0x1063b801,0x5862b803, +0x906302b8,0x0217b803,0x00000000,0x021fa004, +0x90420001,0x90210001,0x81df0004,0xb0080000, +0xb400004d,0xb0090000,0xb400004b,0x81df0000, +0x00000000,0x80270000,0xb6280047,0x80470000, +0xb6290044,0x5865b802,0x1063b801,0x5862b803, +0x914301b8,0x009ff00a,0xad420060,0x00000000, +0x00000000,0x00000000,0x114ab801,0x5942b80a, +0x914a1c80,0x0217b80a,0xb0040000,0xb400002e, +0x906302b8,0x009ff003,0xb0040000,0xb420000a, +0x80950006,0x00000000,0x021fa204,0x80950006, +0x015f8210,0x021fa204,0x80950006,0x015f8210, +0x021fa004,0xb5000026,0xb0040001,0xb4200009, +0x80950006,0x00000000,0x021fa204,0x015f8210, +0x021fa204,0x80950006,0x015f8210,0x021fa004, +0xb500001b,0xb0040003,0xb4200009,0x80950006, +0x00000000,0x021fa204,0x80950006,0x015f8210, +0x021fa204,0x015f8210,0x021fa004,0xb5000010, +0xb0040002,0xb420000e,0x80950006,0x00000000, +0x021fa204,0x015f8210,0x021fa204,0x015f8210, +0x021fa004,0xb5000006,0x8087003f,0x021fa204, +0x015f8210,0x021fa204,0x015f8210,0x021fa004, +0x90420001,0x90210001,0x81df0004,0xa5480020, +0xb4c00012,0xb0090000,0xb4000010,0x8087003f, +0x81df0000,0x5862b801,0x90631afc,0xb62a000b, +0x90630004,0x0047b803,0xb6290008,0x90420180, +0x0217b802,0x00000000,0x021fa204,0x003f8210, +0x021fa204,0x003f8210,0x021fa004,0x81df0004, +0x00ffb81a,0x8257ffff,0x82d7ffff,0x011f05bb, +0x013f05b9,0x80270000,0x00e7b809,0x300105ba, +0xb4800001,0x80e70001,0x800700bc,0x80470000, +0x81df0000,0xb0070000,0xb400004c,0xb627004b, +0x5865b802,0x1063b801,0x5862b803,0x914301b8, +0xaca20060,0x009ff00a,0x10a5b801,0x58a2b805, +0x90a502b8,0x0217b805,0xb0040000,0xb400002b, +0x1060b801,0x00bff003,0x10a5b804,0x90650160, +0x00dff003,0xb0060003,0xb4200007,0x90650134, +0x00dff003,0xb6000303,0x0075b806,0x021fa203, +0x007f8210,0xb5000021,0x5861b805,0x906300dc, +0x009fd803,0x90650134,0x00dff003,0xaca20060, +0x00000000,0x00000000,0x00000000,0x0075b806, +0x10a5b801,0x58a2b805,0x90a502b8,0x0217b805, +0x588fb804,0xb600030c,0xb6001007,0x04a3b804, +0xb4600002,0x58a1b803,0xb5000002,0x58a1b805, +0x90a50001,0x0067b805,0x9465ffff,0x5d50b805, +0x021fa20a,0x015f8210,0xb5000004,0x81470000, +0xb6000302,0x021fa20a,0x009f8210,0x009f05b9, +0xb0040002,0xb420000c,0x300105ba,0xb480000a, +0x58a2b801,0x90a502b8,0x0217b805,0x90a50180, +0x0297b805,0xb6000304,0x00bf8210,0x009f8210, +0x029fa205,0x009f8214,0x90420001,0x81df0004, +0x90210001,0x3001b808,0xb480ffa7,0xa5480020, +0xb00a0000,0xb4000019,0xb0090000,0xb4000017, +0x58a2b801,0x90a502b8,0x81df0000,0x00000000, +0x00000000,0xb62a0010,0x80470000,0xb629000d, +0xaca20060,0x00000000,0x00000000,0x00000000, +0x80670000,0x10a5b801,0x58a2b805,0x90a502b8, +0x0217b805,0xb6000302,0x021fa203,0x00bf8210, +0x90420001,0x90210001,0x81df0004,0x00ffb81a, +0x80770000,0x8057ffff,0x80f70000,0x80d7ffff, +0x81770000,0x8157ffff,0x81f70000,0x81d7ffff, +0xac140060,0xac350020,0x00000000,0x00000000, +0x12c0b801,0x5ac2b816,0x92d61980,0x83a400bd, +0xad940400,0x009f9173,0x013f05ca,0x914c6604, +0x114ab804,0x001f97e0,0x001eb80a,0xb0090000, +0xb4000003,0x80a76e44,0x80c76644,0xb5000002, +0x80a76644,0x80c76e44,0x808f000f,0x806f0000, +0x80af000e,0x80cf07e1,0x11e5b80c,0x11efb804, +0x5de2b80f,0x01ffb178,0x59e2b80f,0x01afb80f, +0x01ff9178,0x0047b86f,0xb0020001,0xb4c0fffd, +0x80cf07f0,0x1206b80c,0x1210b804,0x5e02b810, +0x021fb178,0x5a02b810,0x01afb810,0x021f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x916c6e04, +0x116bb804,0x001f97ff,0x001eb80b,0x808f0000, +0x806f001f,0x80af001f,0x90ac6604,0x5ca2b805, +0x80270400,0x81df0000,0x00000000,0x00000000, +0xb600080a,0x00cfb801,0x00bfb178,0x58a2b805, +0x01cfb805,0x00bf9178,0x0047b86f,0xb0020001, +0xb4c0fffd,0x90210020,0x90a50020,0x81df0004, +0x90ac6e04,0x5ca2b805,0x80270500,0x81df0000, +0x00000000,0x00000000,0xb600080a,0x00cfb801, +0x00bfb178,0x58a2b805,0x01cfb805,0x00bf9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x90210020, +0x90a50020,0x81df0004,0x81530020,0xac140060, +0xac350020,0x80170800,0x80d7003c,0x12c0b801, +0x5ac2b816,0x92d602b8,0x0117b816,0x90241000, +0x0097b801,0x80470000,0x4002b803,0x81df0000, +0x00000000,0x00000000,0xb6000804,0x005f8020, +0x480287e4,0x005f8020,0x500287e4,0x81df0004, +0x00000000,0x00000000,0x00000000,0x1021b80a, +0x5c36b801,0x5801b800,0x18c0b801,0xb0090000, +0xb4000002,0x90641440,0xb5000001,0x90641040, +0x81df0000,0x00000000,0x00000000,0xb6000f0d, +0x0097b803,0x80470000,0x4002b803,0xb6001002, +0x005f8020,0x480287e4,0x0108a026,0x90630040, +0x00000000,0x1021b80a,0x5c36b801,0x5801b800, +0x18c0b801,0x81df0004,0x90641400,0x0097b803, +0x80470000,0x4002b803,0x005f8020,0x005f87e4, +0x81df0000,0x00000000,0x00000000,0xb6000802, +0x005f8040,0x480287c4,0x81df0004,0x005f87e0, +0x0108a026,0x00000000,0x1021b80a,0x5c36b801, +0x5801b800,0x18c0b801,0xb0090000,0xb4000002, +0x906417c0,0xb5000001,0x906413c0,0x81df0000, +0x00000000,0x00000000,0xb6000f0f,0x0097b803, +0x80470000,0x4002b803,0xb6000804,0x005f8020, +0x500287e4,0x005f8020,0x480287e4,0x0108a026, +0x84630040,0x00000000,0x1021b80a,0x5c36b801, +0x5801b800,0x18c0b801,0x81df0004,0xb0140000, +0xb4200005,0x90840004,0x9484003f,0x009fb173, +0xa1290001,0x013f25ca,0x80d7ffff,0x0108a026, +0x00ffb81a,0x81330004,0x8093007f,0x9884ffff, +0x80b3ff80,0x0017b816,0x90360040,0x0097b801, +0x81530010,0x81df0000,0x00000000,0x00000000, +0xb6001004,0x400a8000,0x404a8004,0x0008a020, +0x0088a022,0x81df0004,0x0017b816,0x9036007c, +0x0097b801,0x81171000,0x81df0000,0x00000000, +0x00000000,0xb6001004,0x40048020,0x480487e4, +0x00000000,0x0108a020,0x81df0004,0x81470000, +0x81670001,0x81870008,0x81a70040,0x81c707c4, +0x81e70040,0x81df0000,0x00000000,0x00000000, +0xb6000432,0xb00a0001,0xb4e00004,0x80c71000, +0x80e71000,0x81171040,0xb5000003,0x80c71040, +0x80e71040,0x81171000,0x844d0004,0x10e7b802, +0xb62b001f,0x0017b806,0x0097b807,0xb62c0004, +0x40048020,0x480487e4,0x00000000,0x0108a020, +0x0017b806,0x0097b807,0x0197b80e,0x00000000, +0x001f8020,0x042087e4,0xb62c000f,0x4041800c, +0x001f8020,0x0048b802,0x5e38802c,0x2e11b801, +0x042087e4,0x1042b810,0x0462b804,0xb4a00002, +0x0047b804,0xb5000003,0x0462b805,0xb4600001, +0x0047b805,0x011fa022,0x10c6b80f,0x10e7b80f, +0x5961b80b,0x5d81b80c,0x5da1b80d,0x5de1b80f, +0x914a0001,0x954a0001,0x11ceb80f,0x81df0004, +0x80171018,0x81171fcc,0x80470000,0x41448020, +0x494487c0,0x00000000,0x0188b80a,0x494487e0, +0x00000000,0x0148b80a,0x0502a10a,0x4145b80c, +0x494580e0,0x00000000,0x0108a5ea,0x41448080, +0x494487c0,0x00000000,0x0108a78a,0x49448020, +0x00000000,0x0108a2ea,0x41448020,0x49448720, +0x00000000,0x0188b80a,0x4145b80c,0x49458080, +0x494587a0,0x00000000,0x0108a68a,0x4145b80c, +0x49458080,0x494587a0,0x00000000,0x0108a08a, +0x4145b80c,0x49458020,0x49458040,0x00000000, +0x0188b80a,0x494587e0,0x00000000,0x0108a08a, +0x4144b80c,0x494587a0,0x00000000,0x0108a52a, +0x41448080,0x49448040,0x494486c0,0x00000000, +0x0108a04a,0x41448040,0x49448720,0x00000000, +0x0108a36a,0x04028020,0x011fa420,0x001f8040, +0x011fa100,0x001f8080,0x011fa080,0x001f8100, +0x011fa040,0x001f8660,0x011fa120,0x41458020, +0x49458000,0x00000000,0x0108a00a,0x0017b816, +0x9036007c,0x0097b801,0x81171000,0x81970784, +0x00000000,0x001f8020,0x042087e4,0x81df0000, +0x00000000,0x00000000,0xb600100f,0x4041800c, +0x001f8020,0x0048b802,0x5e38802c,0x2e11b801, +0x042087e4,0x1042b810,0x0462b804,0xb4a00002, +0x0047b804,0xb5000003,0x0462b805,0xb4600001, +0x0047b805,0x011fa022,0x81df0004,0x81470000, +0x81670001,0x81870008,0x81a70040,0x81c707c4, +0x81e70040,0x81df0000,0x00000000,0x00000000, +0xb6000432,0xb00a0001,0xb4e00004,0x80c71000, +0x80e71000,0x81171040,0xb5000003,0x80c71040, +0x80e71040,0x81171000,0x844d0004,0x10e7b802, +0xb62b001f,0x0017b806,0x0097b807,0xb62c0004, +0x40048020,0x480487e4,0x00000000,0x0108a020, +0x0017b806,0x0097b807,0x0197b80e,0x00000000, +0x001f8020,0x042087e4,0xb62c000f,0x4041800c, +0x001f8020,0x0048b802,0x5e38802c,0x2e11b801, +0x042087e4,0x1042b810,0x0462b804,0xb4a00002, +0x0047b804,0xb5000003,0x0462b805,0xb4600001, +0x0047b805,0x011fa022,0x10c6b80f,0x10e7b80f, +0x5961b80b,0x5d81b80c,0x5da1b80d,0x5de1b80f, +0x914a0001,0x954a0001,0x11ceb80f,0x81df0004, +0x80171034,0x81171f84,0x80470000,0x41448040, +0x49448640,0x00000000,0x0188b80a,0x49448100, +0x49448780,0x00000000,0x0108a08a,0x4144b80c, +0x49448040,0x49448080,0x494487c0,0x00000000, +0x0108a16a,0x4145b80c,0x49458700,0x00000000, +0x0188b80a,0x494581a0,0x494586e0,0x00000000, +0x0108a66a,0x4145b80c,0x49448040,0x494487e0, +0x00000000,0x0188b80a,0x011fa1ec,0x4145b80c, +0x49458100,0x49458780,0x00000000,0x0108a08a, +0x41458720,0x49458100,0x494586e0,0x49458160, +0x49458020,0x49458020,0x49458760,0x00000000, +0x0108a08a,0x414587a0,0x49458080,0x49458760, +0x494580c0,0x49458700,0x49458140,0x49458020, +0x49458760,0x00000000,0x0108a74a,0x414587a0, +0x49458080,0x49458760,0x494580e0,0x49458700, +0x49458120,0x49458020,0x49458760,0x00000000, +0x0108a08a,0x41458720,0x49458100,0x494586e0, +0x49458140,0x49458040,0x49458020,0x49458720, +0x00000000,0x0108a0ca,0x41458080,0x49458040, +0x49458020,0x49458620,0x00000000,0x0188b80a, +0x49458080,0x00000000,0x0108a7ca,0x4144b80c, +0x49458040,0x49458020,0x49458080,0x00000000, +0x0108a5ea,0x41448080,0x49448700,0x00000000, +0x0188b80a,0x49448780,0x00000000,0x0108a7ca, +0x4144b80c,0x49448140,0x00000000,0x0108a7ca, +0x49448040,0x00000000,0x0108a0ca,0x41448700, +0x00000000,0x0188b80a,0x49448000,0x00000000, +0x0108a04a,0x011fa00c,0x80171f80,0x81df0000, +0x00000000,0x00000000,0xb6002006,0x40048000, +0x48048000,0x48048000,0x48048000,0x00000000, +0x0008a020,0x81df0004,0x00ffb81d,0x00000000, +0x80770000,0x8057ffff,0x015f05b9,0x017f05bb, +0x8293ffff,0x9a94ffff,0x81a70000,0x81df0000, +0x00000000,0x00000000,0xb62a003a,0xaded0180, +0xae0d0180,0xadcd0080,0x902f1980,0x0017b801, +0xb6002033,0x904e01b8,0x00000000,0x013ff002, +0xb0090000,0xb400001f,0x904f02b8,0x80c70000, +0x011fd802,0x6829b808,0x94210001,0xb0010001, +0xb4e00001,0x00c7b814,0x6429b806,0x80470001, +0x6449b802,0x84420001,0x1442b808,0x84690001, +0x5863b803,0x906300dc,0x1042b801,0x003f9803, +0x90420001,0x4082b801,0x90630004,0x003f9803, +0x00000000,0x5897b804,0x1804b805,0x4082b801, +0x00000000,0x00000000,0x00000000,0x10a4b800, +0xb5000001,0x80a70000,0x90501c80,0x00000000, +0x007ff002,0x5842b803,0x904205f8,0x0097b802, +0x00000000,0x40058004,0x48058004,0x00000000, +0x0008a020,0x91ce0004,0x91ef0004,0x92100004, +0x91ad0001,0x81df0004,0x00ffb81a,0x80770000, +0x8057ffff,0x80d7ffff,0x015f05b9,0x017f05bb, +0x8293ff80,0x9a940000,0x82a70020,0x81a70000, +0x81e702b8,0x80171980,0x81df0000,0x00000000, +0x00000000,0xb62a004f,0xb600034d,0xac0d0080, +0xac4d0180,0xac960080,0x822700bc,0x91c001b8, +0x00000000,0x1042b804,0x92021c80,0xb62b003a, +0x013ff00e,0x00fff011,0xb0090000,0xb4000027, +0x10e7b809,0x5821b807,0x902100dc,0x00000000, +0x001fd801,0x82470000,0x80270001,0x6452b801, +0x3002b800,0xb4600002,0x92520001,0xb500fffb, +0x86520001,0x80c70000,0x011fd80f,0x6832b808, +0xb0010001,0xb4e00001,0x00c7b814,0x84520017, +0x0056b802,0x80270001,0x6432b801,0x84210001, +0x1408b801,0x6402b800,0x10c6b800,0x9027018c, +0x00000000,0x001ff001,0x5802b800,0x9020073c, +0x904006f8,0x007f9801,0x0097b802,0x10c6b803, +0x40868004,0x48868004,0xb5000003,0x80c70000, +0x40868004,0x00000000,0x0088b804,0x003ff010, +0x5822b801,0x902105f8,0x0097b801,0x91ce0004, +0x91ef0004,0x40448004,0x48448004,0x92100004, +0x0008a022,0x92310001,0x0435b80b,0xb4000007, +0x80870000,0xb6210005,0x001fa024,0x91ce0004, +0x91ef0004,0x92100004,0x92310001,0x00000000, +0x91ad0001,0x81df0004,0x00ffb81a,0x00000000, +0x007f05b9,0x001f0081,0xb0000001,0xb440002d, +0x001f05d8,0xac400080,0x801702b8,0x80970438, +0x90421800,0x0117b802,0x8087ffff,0x80b3ffff, +0x80d3007f,0x98c6ff00,0x80f3ff80,0x81070080, +0x81df0000,0x00000000,0x00000000,0xb6002018, +0x10088020,0x0056b800,0x0442b806,0xb4a00004, +0xb0000000,0x0007b806,0xb4400001,0x0007b807, +0x0027b800,0x5c08b800,0x1400b804,0xb0030001, +0xb4000008,0x10288024,0x0056b801,0x0442b806, +0xb4a00004,0xb0010000,0x0027b806,0xb4400001, +0x0027b807,0x5828b801,0x1421b805,0x1900a021, +0x81df0004,0x001f05d8,0x90000001,0x001f25d8, +0x00ffb81a,0x801702b8,0x80970438,0x81171800, +0x8087ffff,0x80b3ffff,0x80d3007f,0x98c6ff00, +0x80f3ff80,0x81070080,0x81df0000,0x00000000, +0x00000000,0xb6006018,0x10088020,0x0056b800, +0x0442b806,0xb4a00004,0xb0000000,0x0007b806, +0xb4400001,0x0007b807,0x0027b800,0x5c08b800, +0x1400b804,0xb0030001,0xb4000008,0x10288024, +0x0056b801,0x0442b806,0xb4a00004,0xb0010000, +0x0027b806,0xb4400001,0x0027b807,0x5828b801, +0x1421b805,0x1900a021,0x81df0004,0x00ffb81a, +0x001f0081,0xb0000001,0xb4400006,0x001f05d8, +0xb0000003,0xb4000003,0x80270001,0x003f25dc, +0x00ffb81a,0x003f05d9,0x009f05cb,0xb0010000, +0xb400000e,0x015f42ed,0x81070000,0x8127017c, +0xb00a0000,0xb4000002,0x81070180,0x812702fc, +0x802500a5,0x9421ffff,0x3001b808,0xb4800011, +0x3001b809,0xb4a0007f,0xb500000e,0x001f0081, +0xb0000001,0xb4400003,0xb0040002,0xb4200006, +0xb5000002,0xb0040000,0xb4200003,0x802702ff, +0x81470000,0xb5000003,0x80270001,0x003f25d9, +0x81470180,0xb0040000,0xb4200001,0x838402ea, +0x80070000,0x001f25d8,0x009f902d,0x80af001f, +0x808f0000,0x806f0000,0x8007ffff,0x8033ffff, +0x80171800,0x81df0000,0x807bff8c,0x94630003, +0xb0030003,0xb4000016,0xb0030002,0xb4000035, +0xb0030001,0xb4000024,0xb6006010,0x14618000, +0x6068b803,0x40c4b803,0x14608000,0x00c8b806, +0x5870b803,0x6068b803,0x4104b803,0x58c8b806, +0x0108b808,0x14c6b801,0x00000000,0x00000000, +0x5d08b808,0x1508b800,0x1806a028,0xb5000030, +0xb6006010,0x14618000,0x6068b803,0x40c4b803, +0x14608000,0x00c8b806,0x5870b803,0x6068b803, +0x4104b803,0x5cc8b806,0x0108b808,0x14c6b800, +0x00000000,0x00000000,0x5908b808,0x1508b801, +0x1806a028,0xb500001e,0xb600600d,0x14618000, +0x6068b803,0x40c4b803,0x00000000,0x00c8b806, +0x00000000,0x00000000,0x00000000,0x5d08b806, +0x1508b800,0x58c8b806,0x14c6b801,0x1806a028, +0xb500000f,0xb600600e,0x14608000,0x5868b803, +0x6068b803,0x40c4b803,0x00000000,0x00c8b806, +0x00000000,0x00000000,0x00000000,0x5d08b806, +0x1508b800,0x58c8b806,0x14c6b801,0x1806a028, +0x81df0004,0x80670600,0x5d22b80a,0x81df0000, +0x00000000,0x00000000,0xb600030a,0x00cfb803, +0x013fb178,0x5922b809,0x01afb809,0x013f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x90630020, +0x91290020,0x81df0004,0x81270180,0xb00a0000, +0xb4000001,0x81270000,0x013f62ed,0x80270001, +0x003f25dc,0x00ffb81a,0x001f0081,0xb0000001, +0xb4400006,0x001f05d8,0xb0000003,0xb4000003, +0x80270001,0x003f25dc,0x00ffb81a,0x003f05d9, +0x009f05cb,0xb0010000,0xb400000e,0x015f42ed, +0x81070000,0x8127017c,0xb00a0000,0xb4000002, +0x81070180,0x812702fc,0x802500a5,0x9421ffff, +0x3001b808,0xb4800011,0x3001b809,0xb4a0007f, +0xb500000e,0x001f0081,0xb0000001,0xb4400003, +0xb0040002,0xb4200006,0xb5000002,0xb0040000, +0xb4200003,0x802702ff,0x81470000,0xb5000003, +0x80270001,0x003f25d9,0x81470180,0xb0040000, +0xb4200001,0x83840250,0x80070000,0x001f25d8, +0x009f902d,0x80af001f,0x808f0000,0x806f0000, +0x8007ffff,0x8033ffff,0x80171800,0x807bff8c, +0x81df0000,0x94630003,0xb0030003,0xb4000016, +0xb0030002,0xb4000035,0xb0030001,0xb4000024, +0xb6006010,0x14618000,0x6068b803,0x40c4b803, +0x14608000,0x00c8b806,0x5870b803,0x6068b803, +0x4104b803,0x58c8b806,0x0108b808,0x14c6b801, +0x00000000,0x00000000,0x5d08b808,0x1508b800, +0x1806a028,0xb5000030,0xb6006010,0x14618000, +0x6068b803,0x40c4b803,0x14608000,0x00c8b806, +0x5870b803,0x6068b803,0x4104b803,0x5cc8b806, +0x0108b808,0x14c6b800,0x00000000,0x00000000, +0x5908b808,0x1508b801,0x1806a028,0xb500001e, +0xb600600d,0x14618000,0x6068b803,0x40c4b803, +0x00000000,0x00c8b806,0x00000000,0x00000000, +0x00000000,0x5908b806,0x1508b801,0x5cc8b806, +0x14c6b800,0x1806a028,0xb500000f,0xb600600e, +0x14608000,0x5870b803,0x6068b803,0x40c4b803, +0x00000000,0x00c8b806,0x00000000,0x00000000, +0x00000000,0x5908b806,0x1508b801,0x5cc8b806, +0x14c6b800,0x1806a028,0x81df0004,0x80670600, +0x5d22b80a,0x81df0000,0x00000000,0x00000000, +0xb600030a,0x00cfb803,0x013fb178,0x5922b809, +0x01afb809,0x013f9178,0x0047b86f,0xb0020001, +0xb4c0fffd,0x90630020,0x91290020,0x81df0004, +0x81270180,0xb00a0000,0xb4000001,0x81270000, +0x013f62ed,0x80270001,0x003f25dc,0x00ffb81a, +0x029fb024,0x02bfb025,0x02dfb026,0x02ffb027, +0x031fb028,0x033fb029,0x033f4046,0x0287b86f, +0x029fb02a,0x8285009c,0x96b48000,0xb0158000, +0xb400018e,0x96b40100,0xb0150100,0xb40001a4, +0x96b40400,0xb0150400,0xb40001a5,0x96b40001, +0xb0150001,0xb400000c,0x96b40008,0xb0150008, +0xb4000197,0x96b44000,0xb0154000,0xb40001a4, +0x96b40002,0xb0150002,0xb400015b,0x00000000, +0x00000000,0xb50001b6,0x02bf917e,0x92b50001, +0x02bfb17e,0x82850082,0x5efdb814,0x96f70001, +0xb0170001,0xb420000b,0x83050069,0x9718003f, +0x82e50064,0x12f7b818,0x86f70109,0x82feff74, +0x02e7b86f,0x9af74000,0x01ffb817,0x96f7bfff, +0x01ffb817,0x83050081,0x82a5009a,0x96b50001, +0xb0150001,0xb4200014,0x82a70000,0x02bfb17e, +0x96b41840,0xb0150800,0xb420000c,0x96b40008, +0x5aa9b815,0x96d46000,0x5ec3b816,0x82f3000f, +0x9af7c00f,0x1718b817,0x1ab5b818,0x1ab5b816, +0x9ab50340,0x82a60081,0xb500012b,0x9b180180, +0x83060081,0xb5000128,0x82a5009a,0x96b50002, +0xb0150002,0xb420001b,0x82a70000,0x02bfb17e, +0x96b41800,0xb0151800,0xb4000013,0x96b40040, +0xb0150040,0xb4200004,0xa3180c00,0x9b180340, +0x83060081,0xb5000118,0x96b40008,0x5aa9b815, +0x96d46000,0x5ec3b816,0x82f3000f,0x9af7c00f, +0x1718b817,0x1ab5b818,0x1ab5b816,0x9ab50340, +0x82a60081,0xb500010c,0x9b180180,0x83060081, +0xb5000109,0x82a500c1,0x96b5000f,0xb015000b, +0xb420000e,0x96b40020,0xb0150020,0xb400000b, +0x96b40200,0xb0150200,0xb4000008,0x82c50086, +0x82e50094,0x3016b817,0xb4400004,0x06f7b816, +0xb017ff00,0xb4400001,0xb50000f7,0x96b46000, +0xb0156000,0xb4000011,0x96b41820,0xb0150820, +0xb4200004,0x9b391000,0x82a5009a,0x96b5feff, +0x82a6009a,0x96b40040,0xb0150040,0xb4200001, +0x9739efff,0x96b91000,0xb0151000,0xb4200003, +0x82a5009a,0x9ab50100,0x82a6009a,0x96b40040, +0xb0150040,0xb4200019,0x96b41800,0xb0151800, +0xb4200006,0x96b98000,0xb0158000,0xb4200003, +0x9b180180,0x83060081,0xb50000d7,0x96d80c00, +0x82b300ff,0x9ab5f3ff,0x1718b815,0xb0160c00, +0xb4000007,0x82e50098,0x96f70400,0xb0170400, +0xb4200002,0x82c70c00,0xb5000001,0xa2d60c00, +0x1b18b816,0x9b180340,0xb50000bd,0x96b40220, +0xb0150000,0xb4e00021,0x82a5009d,0x82f3ffff, +0x16b5b817,0x82f3000e,0x3015b817,0xb420001b, +0x96f98000,0xb0178000,0xb4000018,0x82a70000, +0x02bfb17e,0x82c5009d,0x96d6ffff,0x82b30032, +0x9ab58001,0x82e500c1,0x96f7000f,0xb017000b, +0xb4000002,0x82b30022,0x9ab58001,0x1ab5b816, +0x82c5009a,0x96d60020,0xb0160020,0xb4200002, +0x82b30032,0x9ab58001,0x82a6009d,0x02ff917e, +0x00000000,0xb0170040,0xb4800000,0x5eb5b814, +0x96b500f0,0x96f46000,0x5eedb817,0x1ab5b817, +0xb0170003,0xb4000004,0x96b500ef,0x96f70001, +0x5ae4b817,0x1ab5b817,0x96d41800,0xb0161800, +0xb400000a,0x96f900ff,0x96b500ff,0x9739ff00, +0x1b39b815,0x02a7b817,0x96b500f3,0x96d40008, +0x5ec1b816,0x1ab5b816,0xb500000c,0x96f98000, +0xb0178000,0xb4200007,0x5efeb814,0x96f70001, +0xb0170001,0xb4000003,0x9b180180,0x83060081, +0xb5000081,0x96b500f3,0x9ab50008,0x9739fff3, +0x96d40020,0xb0160020,0xb4200017,0x9b398000, +0x82c70000,0x02dfb17e,0x96d40010,0x5ac8b816, +0x82f300ff,0x9af7cfff,0x1718b817,0x1b18b816, +0x9b180340,0x82c5009d,0x96d6ffff,0x82f3000e, +0x9af78001,0x1af7b816,0x82c5009a,0x96d60020, +0xb0160020,0xb4200002,0x82f30032,0x9af78001, +0x82e6009d,0xb500005a,0x97397fff,0x96b500ff, +0x5aaab815,0x82f300fc,0x9af703ff,0x1718b817, +0x1b18b815,0x9b180340,0x82c5009a,0x96d60010, +0xb0160010,0xb4200024,0x82c70000,0x02dfb17e, +0x82c50086,0x92d60e10,0x82c60086,0x82c50094, +0x5eefb818,0x96f70003,0xb0170003,0xb4200002, +0x82e70e10,0xb5000001,0x82e70e10,0x12d6b817, +0x82e50081,0x9af70020,0x82e60081,0x82c60094, +0xa2f70020,0x82e60081,0x82f30001,0x16f7b818, +0x5ef0b817,0xb0170001,0xb4000004,0x96f84000, +0x5ee4b817,0x9718f3ff,0x1b18b817,0x82f3000a, +0x9af78000,0x82e6009d,0x83060081,0x83070001, +0x8306009f,0xb5000096,0x82c5009d,0x82f3000e, +0x9af78001,0x3016b817,0xb420000f,0x82b30032, +0x9ab58001,0x82e500c1,0x96f7000f,0xb017000b, +0xb4000002,0x82b30022,0x9ab58001,0x82c5009a, +0x96d60020,0xb0160020,0xb4200002,0x82b30032, +0x9ab58001,0x82a6009d,0x82c5009a,0x96d60080, +0xb0160080,0xb4000011,0x02df917e,0x00000000, +0xb0160010,0xb480000d,0x82c500c1,0x96d6000f, +0xb016000b,0xb4000009,0x82c50087,0x96d60080, +0x5ac7b816,0x96f84000,0x3017b816,0xb4200003, +0x033f4046,0x9b394000,0xb500000b,0x9739bfff, +0x82e50061,0x96f70008,0xb0170008,0xb4000005, +0x5eefb818,0x96f70003,0xb0170003,0xb4000001, +0x9718ffff,0x83060081,0x83070001,0x8306009f, +0x00000000,0xb500005e,0x82850083,0x96b400ff, +0xb015003c,0xb4200019,0x96b92000,0xb0152000, +0xb4000002,0x9b392000,0xb5000014,0x9739d3ff, +0x82870000,0x82860087,0x82870008,0x82860083, +0x829bff78,0x82a7001f,0xb0140400,0xb4000001, +0x82a70010,0x82a600c9,0x829bff78,0x00000000, +0x828600cb,0x8285009d,0x82b3ffff,0x9ab5fffd, +0x1694b815,0x8286009d,0xb5000000,0x83070002, +0x8306009f,0x00000000,0xb500003d,0x96b90800, +0xb0150800,0xb4200009,0x9739f7ff,0x82a703fd, +0x82a600cb,0x82a7003c,0x82a60083,0x8285009d, +0x9a940002,0x8286009d,0xb5000004,0x82850087, +0x5a82b814,0xa2940200,0x82860087,0xb5000000, +0x83078000,0x8306009f,0x00000000,0xb5000028, +0x83070008,0x8306009f,0x00000000,0xb5000024, +0x83070100,0x8306009f,0x00000000,0xb5000020, +0x83070000,0x83050081,0x9b180180,0x83060081, +0x83070400,0x8306009f,0x00000000,0xb5000018, +0x82870000,0x82850082,0x5eb7b814,0x96b500fc, +0x96d40006,0x5ec1b816,0x1ab5b816,0x5aacb815, +0x83050081,0x82d3001c,0x9ad600ff,0x1718b816, +0x1b18b815,0x9b180e00,0x83060081,0x83074000, +0x8306009f,0x8305009d,0x82d300ff,0x9ad6bfff, +0x1718b816,0x8306009d,0x00000000,0xb5000000, +0x029f902a,0x01ffb814,0x033f6046,0x029f9024, +0x02bf9025,0x02df9026,0x02ff9027,0x031f9028, +0x033f9029,0x00ffb81e,0x02ff917d,0x92f7092f, +0x031f0084,0xb0180001,0xb4200002,0x02ff917d, +0x92f70870,0x02ffb17d,0x02ff917c,0x82bbffdc, +0x829bffd8,0x93150004,0x3014b815,0xb4000017, +0x02dbb818,0x029bb815,0x3017b816,0xb4800013, +0x5a81b814,0x029fb17d,0x82def200,0x82fef204, +0x82e50086,0x06f7b814,0x02f6b817,0x82fef208, +0x82860095,0x82870001,0x829ef220,0x8293001f, +0x9294fe00,0x92b50008,0x3015b814,0xb4800002, +0x82b3001f,0x92b5fa00,0x82beffdc,0x82850086, +0x83250094,0x06d4b819,0x02d6b816,0xb016ffff, +0xb4a00009,0x82c50081,0x9ab60020,0x82a60081, +0x82a50086,0x92b50e10,0x82a60094,0x82c60081, +0x86b50704,0x82a6009b,0x00ffb81c,0x00000000, +0x001f9012,0x001fb200,0x001f004c,0x001f2804, +0x801bfef0,0x8058fef4,0x803bff68,0x8078ff6c, +0x2000b801,0x2042b803,0x001fb204,0x005f2814, +0x82e70001,0x83640048,0x029fb014,0x829efef0, +0x8286000f,0x02bf2054,0x82bcfef4,0x82a6000e, +0x00ffb81a,0x80e70001,0x801336e3,0x9800eb76, +0x001fb200,0x800700ab,0x001f2804,0x801bc3e8, +0x8058c3ec,0x83640024,0x82e70000,0x83640036, +0x029fb3c0,0x029fb200,0x02bf2f04,0x02bf2804, +0x801bc000,0x8058c004,0x8364001b,0x82e70000, +0x8364002d,0x001f93c0,0x3000b814,0xb420000a, +0x001f0f04,0x3000b815,0xb4200007,0x829efef0, +0x82bcfef4,0x029fb012,0x02bf204c,0x82870001, +0x829cfef5,0x00ffb81a,0xb0070000,0xb4000007, +0x80e70000,0x801399fa,0x9800c92e,0x001fb200, +0x800700af,0x001f2804,0xb500ffdc,0x82870000, +0x829cfef5,0x00ffb81a,0x80c700ff,0x803bff68, +0x8078ff6c,0x14a0b806,0x2063b805,0x007f2814, +0x2021b802,0x58c8b806,0x14a0b806,0x58b0b805, +0x2021b805,0x58c8b806,0x14a0b806,0x2021b805, +0x58c8b806,0x14a0b806,0x5cb0b805,0x2021b805, +0x003fb204,0x00ffb81b,0x82c70000,0x83070800, +0x83270005,0x8197080c,0x81d7ffff,0x83840126, +0x83840001,0x00ffb81b,0x808f0000,0x806f001f, +0x80af001f,0x80270240,0x81e77c08,0x5de2b80f, +0xb6000208,0x00cfb801,0x01ffb178,0x59e2b80f, +0x01cfb80f,0x01ff9178,0xb520ffff,0x91ef0020, +0x90210020,0x80270280,0x81e77b00,0x5de2b80f, +0xb6000208,0x00cfb801,0x01ffb178,0x59e2b80f, +0x01cfb80f,0x01ff9178,0xb520ffff,0x91ef0020, +0x90210020,0x8057ffff,0x80170830,0x80070810, +0x80270808,0xb6000509,0x005ff000,0x90420900, +0x007ff001,0x90630a00,0x009ff002,0x00bff003, +0x2004a025,0x90000001,0x90210001,0x80070814, +0x80d7ffff,0x8097085c,0x8017083c,0xb6000404, +0x005ff000,0x007f87e0,0x84000001,0x2082a7e3, +0x80970860,0x80170840,0x2082b803,0x007f8000, +0x2083a004,0x80170830,0x80970850,0x80270808, +0xb6000508,0x005f8024,0x90420900,0x007ff001, +0x90630a00,0x009ff002,0x00bff003,0x2004a025, +0x90210001,0x80170840,0x00000000,0x02bf87e0, +0x80970860,0x82870000,0xb6000404,0x005f87e4, +0x5a88b814,0x204287e0,0x1a94b802,0x00ffb81c, +0x001f0e49,0x001f2b09,0x001f0e41,0x001f2b08, +0x001f0e46,0x001f2b07,0x001f0e48,0x001f2b06, +0x001f0e42,0x001f2b05,0x001f0e47,0x001f2b04, +0x001f0e45,0x001f2b03,0x001f0e43,0x001f2b02, +0x001f0e40,0x001f2b01,0x001f0e44,0x001f2b00, +0x001f0f25,0xa020000c,0x94400001,0x94600002, +0x94810004,0x94a10008,0x94c00010,0x5943b802, +0x5861b803,0x5882b804,0x5ca2b805,0x5cc4b806, +0x194ab803,0x194ab804,0x194ab805,0x194ab806, +0x015f2b38,0x801b7c00,0x003f92c1,0x5c28b801, +0x005f92c2,0x5858b802,0x1821b802,0x2000b801, +0x001fb2c4,0x80187c04,0x003f0b09,0x2000b801, +0x001f2b14,0x82c70001,0x82e70001,0x83070b10, +0x8327001e,0x81970b35,0x8384009f,0x02df0b38, +0x82170e30,0x838400f1,0x819efef0,0x817cfef4, +0x819eff68,0x817cff6c,0x00ffb81b,0x820f001f, +0x8018fef8,0x8057ffff,0x001f2b09,0x8018fef6, +0x80d7ffff,0x001f2b08,0x8018fefa,0x8157ffff, +0x001f2b07,0x8018fefd,0x81d7ffff,0x001f2b06, +0x8018fefb,0x802f001f,0x001f2b05,0x8018fefe, +0x00000000,0x001f2b04,0x8018fef9,0x00000000, +0x001f2b03,0x8018feff,0x00000000,0x001f2b02, +0x8018fef7,0x00000000,0x001f2b01,0x8018fefc, +0x00000000,0x001f2b00,0x001f0f25,0xa0200011, +0x94410001,0x94600002,0x94800004,0x94a00008, +0x94c10010,0x5941b802,0x5861b803,0x5c82b804, +0x58a1b805,0x5cc1b806,0x194ab803,0x194ab804, +0x194ab805,0x194ab806,0x015f2b38,0x801b7c00, +0x003f92c1,0x5c28b801,0x005f92c2,0x5858b802, +0x1821b802,0x2000b801,0x001fb2c4,0x80187c04, +0x003f0b09,0x2000b801,0x001f2b14,0x82c70001, +0x82e70001,0x83070b10,0x8327001e,0x81970b35, +0x83840055,0x02df0b38,0x82170e20,0x838400a7, +0x819efef0,0x817cfef4,0x5ac8b80c,0x02ff0e44, +0x1ad6b817,0x02dfb391,0x5ed8b80c,0x5968b80b, +0x1ad6b80b,0x02df6724,0x00ffb81b,0x820f001f, +0x8018fefe,0x8057ffff,0x001f2b09,0x8018fefa, +0x80d7ffff,0x001f2b08,0x8018fefc,0x8157ffff, +0x001f2b07,0x8018feff,0x81d7ffff,0x001f2b06, +0x8018fef8,0x802f001f,0x001f2b05,0x8018fefb, +0x00000000,0x001f2b04,0x8018fefd,0x00000000, +0x001f2b03,0x8018fef6,0x00000000,0x001f2b02, +0x8018fef9,0x00000000,0x001f2b01,0x8018fef7, +0x00000000,0x001f2b00,0x801b7c00,0x003f92c1, +0x5c28b801,0x005f92c2,0x5858b802,0x1821b802, +0x2000b801,0x001fb2c4,0x80187c04,0x003f0b09, +0x2000b801,0x001f2b14,0x82c70001,0x82e70001, +0x83070b10,0x8327001e,0x81970b35,0x83840016, +0x83270000,0x831bfef0,0x82f8fef4,0x02c7b819, +0x82170e28,0x83840065,0x300cb818,0xb4200002, +0x300bb817,0xb4000006,0x93390001,0xb0190020, +0xb480fff6,0x83270000,0x833cfef5,0x00ffb81b, +0x019fb390,0x017f2e44,0x033f2f25,0x83270001, +0x833cfef5,0x00ffb81b,0x0007b818,0x90000003, +0x00000000,0x015ff000,0x90000001,0x5949b80a, +0x013ff000,0x194ab809,0x84000002,0x994a0100, +0x017ff000,0x958b00f8,0x5981b80c,0x956b0007, +0x198cb80b,0x84000002,0x998c0008,0x017ff000, +0x90000001,0x5971b80b,0x198cb80b,0x017ff000, +0x5969b80b,0x198cb80b,0x81a70000,0x94d90003, +0x82a70000,0xb6260019,0xb6000818,0x5df0b80a, +0x5e02b80a,0x21efb810,0x95ef0001,0x5941b80a, +0x194ab80f,0x21efb816,0x5e18b80c,0x5e35b80c, +0x5e54b80c,0x5e6cb80c,0x2210b811,0x2252b813, +0x2210b812,0x96100001,0x5981b80c,0x198cb810, +0x2210b817,0x10afb810,0x10a5b80d,0x5da1b805, +0x94a50001,0x5aa1b815,0x1ab5b805,0x019fa7f5, +0x5cc2b819,0xb626001c,0x82870000,0xb6000419, +0xb6000818,0x5df0b80a,0x5e02b80a,0x21efb810, +0x95ef0001,0x5941b80a,0x194ab80f,0x21efb816, +0x5e18b80c,0x5e35b80c,0x5e54b80c,0x5e6cb80c, +0x2210b811,0x2252b813,0x2210b812,0x96100001, +0x5981b80c,0x198cb810,0x2210b817,0x10afb810, +0x10a5b80d,0x5da1b805,0x94a50001,0x5a81b814, +0x1a94b805,0x019fa7f4,0x00ffb81c,0x8257ffff, +0x808f0000,0x806f001f,0x80af001f,0x80270300, +0x81e778e0,0x5de2b80f,0xb6000208,0x00cfb801, +0x01ffb178,0x59e2b80f,0x01cfb80f,0x01ff9178, +0xb520ffff,0x91ef0020,0x90210020,0x80270340, +0x81e779e0,0x5de2b80f,0xb6000208,0x00cfb801, +0x01ffb178,0x59e2b80f,0x01cfb80f,0x01ff9178, +0xb520ffff,0x91ef0020,0x90210020,0x80270280, +0x81e77b00,0x5de2b80f,0xb6000208,0x00cfb801, +0x01ffb178,0x59e2b80f,0x01cfb80f,0x01ff9178, +0xb520ffff,0x91ef0020,0x90210020,0x806f0007, +0x80af0007,0x80270380,0x81e77ae0,0x5de2b80f, +0x00cfb801,0x01ffb178,0x59e2b80f,0x01cfb80f, +0x01ff9178,0xb520ffff,0x91ef0020,0x90210020, +0x80170b60,0x001f0b00,0x001fa020,0x001f0b01, +0x001fa020,0x001f0b02,0x001fa020,0x001f0b03, +0x001fa020,0x001f0b04,0x001fa000,0x80970b50, +0x81170b70,0x82a70b35,0x83a40060,0x001f87e4, +0xb6000405,0x86b50001,0x83a4005c,0x001f8004, +0x003f87e8,0x2080a7e1,0x80970b70,0x80170b50, +0x81170b50,0x81970b40,0x82a70b30,0x001f800c, +0x003f8008,0x2100a001,0x83a40050,0x001f87e4, +0xb6000405,0x86b50001,0x83a4004c,0x001f8004, +0x003f87e8,0x2080a7e1,0x80970b50,0x80170b70, +0x81170b70,0x81970b60,0x82a70b2b,0x001f800c, +0x003f8008,0x2100a001,0x83a40040,0x83a4004e, +0xb6000407,0x86b50001,0x83a4003c,0x001f8004, +0x003f87e8,0x2080a001,0x83a40047,0x00000000, +0x80970b70,0x80170b50,0x81170b50,0x81970b40, +0x82a70b26,0x001f800c,0x003f8008,0x2100a001, +0x83a4002e,0x83a4003c,0xb6000407,0x86b50001, +0x83a4002a,0x001f8004,0x003f87e8,0x2080a001, +0x83a40035,0x00000000,0x80970b50,0x80170b70, +0x81170b70,0x81970b60,0x82a70b21,0x001f800c, +0x003f8008,0x2100a001,0x83a4001c,0x001f87e4, +0xb6000405,0x86b50001,0x83a40018,0x001f8004, +0x003f87e8,0x2080a7e1,0x80970b70,0x80170b50, +0x81170b50,0x81970b40,0x82a70b1c,0x001f800c, +0x003f8008,0x2100a001,0x83a4000c,0x017f87e4, +0x81870000,0xb6000406,0x86b50001,0x83a40007, +0x001f87e4,0x200087e8,0x5988b80c,0x198cb800, +0x021fa02c,0x021fa00b,0x00ffb81c,0x005ff015, +0x90420a00,0x003f87e0,0x001ff002,0x2060b801, +0x90630c00,0x90960e00,0x001ff003,0x003ff004, +0x20a0b801,0x90a50d00,0x00000000,0x001ff005, +0x009fa000,0x00ffb81d,0x001f8004,0x5c21b800, +0x5847b800,0x1821b802,0x942100ff,0x2080a7e1, +0x00ffb81d,0x00000000,0x00000000,0x00000000, + +}; + +static u32 MPGUcode1f5c00[] = { +0x00000000,0xfffff8c0,0x00003540,0xffff8d40, +0x0001fd40,0xfffaf7c0,0x00066b80,0xffdb63c0, +0x00494780,0x00249c40,0x00066b80,0x00050840, +0x0001fd40,0x000072c0,0x00003540,0x00000740, +0xffffffc0,0xfffff840,0x00003680,0xffff7e40, +0x0001f400,0xfffa9cc0,0x0005d1c0,0xffd99600, +0x00493c00,0x0022ce00,0x0006f780,0x0004ad00, +0x000203c0,0x00006440,0x00003400,0x00000680, +0xffffffc0,0xfffff740,0x00003780,0xffff6ec0, +0x0001e800,0xfffa4240,0x00052a00,0xffd7ca00, +0x00491a00,0x0020ffc0,0x00077600,0x00045240, +0x00020800,0x000056c0,0x00003280,0x00000600, +0xffffffc0,0xfffff680,0x00003840,0xffff5ec0, +0x0001d940,0xfff9e8c0,0x00047440,0xffd60080, +0x0048e180,0x001f32c0,0x0007e700,0x0003f7c0, +0x000209c0,0x00004980,0x00003100,0x00000540, +0xffffffc0,0xfffff5c0,0x000038c0,0xffff4e40, +0x0001c780,0xfff990c0,0x0003b000,0xffd43ac0, +0x00489240,0x001d6800,0x00084b00,0x00039e40, +0x00020940,0x00003d00,0x00002f80,0x000004c0, +0xffffffc0,0xfffff4c0,0x00003900,0xffff3d40, +0x0001b2c0,0xfff93a40,0x0002ddc0,0xffd279c0, +0x00482d00,0x001ba040,0x0008a200,0x000345c0, +0x000206c0,0x00003140,0x00002dc0,0x00000440, +0xffffffc0,0xfffff3c0,0x00003900,0xffff2c00, +0x00019b00,0xfff8e640,0x0001fd40,0xffd0be80, +0x0047b1c0,0x0019dc80,0x0008ecc0,0x0002ef00, +0x00020240,0x00002640,0x00002c00,0x00000400, +0xffffff80,0xfffff2c0,0x000038c0,0xffff1a40, +0x00017fc0,0xfff894c0,0x00010e80,0xffcf09c0, +0x004720c0,0x00181d80,0x00092b40,0x000299c0, +0x0001fc00,0x00001bc0,0x00002a40,0x00000380, +0xffffff80,0xfffff180,0x00003800,0xffff0840, +0x00016180,0xfff84680,0x00001180,0xffcd5cc0, +0x00467a40,0x00166440,0x00095e00,0x00024680, +0x0001f440,0x00001200,0x00002840,0x00000340, +0xffffff80,0xfffff040,0x00003740,0xfffef600, +0x00014000,0xfff7fbc0,0xffff0680,0xffcbb880, +0x0045bf00,0x0014b140,0x00098580,0x0001f580, +0x0001ea80,0x00000900,0x00002680,0x000002c0, +0xffffff80,0xffffef00,0x000035c0,0xfffee3c0, +0x00011ac0,0xfff7b540,0xfffded80,0xffca1d80, +0x0044ef80,0x00130580,0x0009a1c0,0x0001a700, +0x0001dfc0,0x00000080,0x000024c0,0x00000280, +0xffffff40,0xffffedc0,0x00003400,0xfffed180, +0x0000f280,0xfff77340,0xfffcc700,0xffc88d80, +0x00440bc0,0x001161c0,0x0009b3c0,0x00015b00, +0x0001d380,0xfffff8c0,0x000022c0,0x00000240, +0xffffff40,0xffffec40,0x00003200,0xfffebf40, +0x0000c680,0xfff73680,0xfffb92c0,0xffc708c0, +0x00431500,0x000fc6c0,0x0009bb80,0x000111c0, +0x0001c640,0xfffff1c0,0x00002100,0x00000200, +0xffffff00,0xffffeac0,0x00002f40,0xfffead00, +0x00009740,0xfff6ff40,0xfffa5180,0xffc59080, +0x00420b40,0x000e3500,0x0009b9c0,0x0000cb80, +0x0001b7c0,0xffffeb40,0x00001f40,0x000001c0, +0xffffff00,0xffffe940,0x00002c40,0xfffe9b00, +0x00006480,0xfff6ce00,0xfff90380,0xffc425c0, +0x0040ef80,0x000cad00,0x0009af00,0x00008840, +0x0001a880,0xffffe580,0x00001d40,0x000001c0, +0xfffffec0,0xffffe7c0,0x000028c0,0xfffe8980, +0x00002e40,0xfff6a3c0,0xfff7a900,0xffc2c900, +0x003fc280,0x000b2fc0,0x00099b80,0x00004800, +0x00019880,0xffffe040,0x00001bc0,0x00000180, +0xfffffec0,0xffffe600,0x00002480,0xfffe7840, +0xfffff4c0,0xfff68040,0xfff64240,0xffc17b40, +0x003e84c0,0x0009bdc0,0x00097fc0,0x00000b40, +0x000187c0,0xffffdb80,0x00001a00,0x00000140, +0xfffffe80,0xffffe440,0x00001fc0,0xfffe6780, +0xffffb800,0xfff66480,0xfff4d040,0xffc03d80, +0x003d3700,0x00085700,0x00095c40,0xffffd1c0, +0x00017680,0xffffd740,0x00001840,0x00000140, +0xfffffe40,0xffffe2c0,0x00001a80,0xfffe5780, +0xffff77c0,0xfff65100,0xfff35300,0xffbf1080, +0x003bda40,0x0006fc80,0x00093200,0xffff9b80, +0x00016500,0xffffd3c0,0x000016c0,0x00000100, +0xfffffe40,0xffffe0c0,0x000014c0,0xfffe4840, +0xffff3480,0xfff64640,0xfff1cb00,0xffbdf4c0, +0x003a6f80,0x0005ae80,0x000900c0,0xffff68c0, +0x00015300,0xffffd0c0,0x00001540,0x00000100, +0xfffffe00,0xffffdf00,0x00000e40,0xfffe39c0, +0xfffeee40,0xfff64480,0xfff03940,0xffbceb00, +0x0038f740,0x00046d40,0x0008c980,0xffff3980, +0x000140c0,0xffffce00,0x000013c0,0x000000c0, +0xfffffdc0,0xffffdd40,0x00000740,0xfffe2c80, +0xfffea500,0xfff64c40,0xffee9e40,0xffbbf440, +0x00377280,0x00033900,0x00088cc0,0xffff0d80, +0x00012e80,0xffffcc00,0x00001240,0x000000c0, +0xfffffd80,0xffffdb40,0xffffff80,0xfffe2040, +0xfffe5900,0xfff65e40,0xffecfa80,0xffbb1080, +0x0035e280,0x00021280,0x00084ac0,0xfffee540, +0x00011c40,0xffffca40,0x00001100,0x00000080, +0xfffffd40,0xffffd980,0xfffff700,0xfffe1580, +0xfffe0a80,0xfff67a80,0xffeb4ec0,0xffba4100, +0x00344780,0x0000f980,0x00080440,0xfffec000, +0x00010a00,0xffffc8c0,0x00000fc0,0x00000080, +0xfffffcc0,0xffffd7c0,0xffffee00,0xfffe0bc0, +0xfffdb980,0xfff6a200,0xffe99bc0,0xffb985c0, +0x0032a340,0xffffee80,0x0007b980,0xfffe9e80, +0x0000f7c0,0xffffc800,0x00000e80,0x00000080, +0xfffffc80,0xffffd5c0,0xffffe440,0xfffe0400, +0xfffd6640,0xfff6d4c0,0xffe7e280,0xffb8df40, +0x0030f640,0xfffef180,0x00076b40,0xfffe8040, +0x0000e5c0,0xffffc740,0x00000d40,0x00000080, +0xfffffc00,0xffffd400,0xffffd9c0,0xfffdfdc0, +0xfffd1100,0xfff71340,0xffe62380,0xffb84e40, +0x002f4180,0xfffe02c0,0x000719c0,0xfffe6500, +0x0000d400,0xffffc700,0x00000c40,0x00000040, +0xfffffbc0,0xffffd240,0xffffcec0,0xfffdf940, +0xfffcba40,0xfff75e00,0xffe45fc0,0xffb7d300, +0x002d8640,0xfffd2240,0x0006c5c0,0xfffe4d40, +0x0000c2c0,0xffffc700,0x00000b40,0x00000040, +0xfffffb40,0xffffd080,0xffffc300,0xfffdf6c0, +0xfffc61c0,0xfff7b500,0xffe29800,0xffb76dc0, +0x002bc540,0xfffc5000,0x00066f40,0xfffe3880, +0x0000b1c0,0xffffc740,0x00000a40,0x00000040, +0xfffffac0,0xffffcf00,0xffffb680,0xfffdf640, +0xfffc0840,0xfff81900,0xffe0cd40,0xffb71e80, +0x0029ff80,0xfffb8bc0,0x00061740,0xfffe26c0, +0x0000a140,0xffffc7c0,0x00000980,0x00000040, +0xfffffa00,0xffffcd80,0xffffa940,0xfffdf800, +0xfffbadc0,0xfff88a00,0xffdf0040,0xffb6e600, +0x00283600,0xfffad600,0x0005bdc0,0xfffe1800, +0x00009140,0xffffc880,0x000008c0,0x00000040, +0xfffff980,0xffffcc00,0xffff9bc0,0xfffdfc40, +0xfffb5300,0xfff90880,0xffdd3200,0xffb6c400, +0x00266a00,0xfffa2e40,0x00056340,0xfffe0c00, +0x000081c0,0xffffc980,0x000007c0,0x00000040, +0x004013c2,0x0040b346,0x0041fa2d,0x0043f934, +0x0046cc1c,0x004a9d9d,0x004fae37,0x0056601f, +0x005f4cf7,0x006b6fcf,0x007c7d1e,0x0115b035, +0x013df91b,0x0207655e,0x03342c83,0x0a185230, +0x00404f46,0x0042e13c,0x0048919f,0x0052cb0e, +0x0064e240,0x0107c449,0x015c7926,0x050cf270, +0x004140fb,0x004cf8df,0x0073326c,0x02480d9d, +0x004545ea,0x01273d75,0x005a827a,0x007fffff, +0x006597fb,0x0050a28c,0x00400000,0x0032cbfd, +0x00285146,0x00200000,0x001965ff,0x001428a3, +0x00100000,0x000cb2ff,0x000a1451,0x00080000, +0x00065980,0x00050a29,0x00040000,0x00032cc0, +0x00028514,0x00020000,0x00019660,0x0001428a, +0x00010000,0x0000cb30,0x0000a145,0x00008000, +0x00006598,0x000050a3,0x00004000,0x000032cc, +0x00002851,0x00002000,0x00001966,0x00001429, +0x00001000,0x00000cb3,0x00000a14,0x00000800, +0x00000659,0x0000050a,0x00000400,0x0000032d, +0x00000285,0x00000200,0x00000196,0x00000143, +0x00000100,0x000000cb,0x000000a1,0x00000080, +0x00000066,0x00000051,0x00000040,0x00000033, +0x00000028,0x00000020,0x00000019,0x00000014, +0x00000010,0x0000000d,0x0000000a,0x00000008, +0x00000006,0x00000005,0x00000000,0x00555555, +0x00666666,0x00492492,0x0071c71c,0x00444444, +0x00421084,0x00410410,0x00408102,0x00404040, +0x00402010,0x00401004,0x00400801,0x00400400, +0x00400200,0x00400100,0x00400080,0x00400040, +0x00400000,0x00400000,0x00200000,0x00400000, +0x00100000,0x00080000,0x00040000,0x00020000, +0x00010000,0x00008000,0x00004000,0x00002000, +0x00001000,0x00000800,0x00000400,0x00000200, +0x00000100,0x0003588d,0x0002b15e,0x0002056d, +0x00015600,0x0000a329,0xffffeed9,0xffff3960, +0xfffe8423,0xfffdd11c,0xfffd2048,0xfffc7353, +0xfffbcb6f,0xfffb29a6,0xfffa8f15,0x000494ae, +0x0003f991,0x00032dd1,0xfffd2d8f,0x0001eb47, +0xfffe9968,0x00009af6,0x000011de,0xffff4335, +0x00018d69,0xfffdecd4,0x000302f8,0xfffca0d7, +0x0004683d,0xfffb67f8,0x0005b36d,0x00045963, +0xfffbd51e,0x00030062,0xfffd0dee,0x0001d046, +0xfffe8a0a,0x00009258,0x000012b1,0xffff4d9e, +0x00019ec3,0xfffe0a44,0x0003245a,0xfffcd082, +0x000498f0,0xfffba919,0x0005f304,0x00041bf4, +0xfffba72a,0x0002d19e,0xfffcf060,0x0001b407, +0xfffe7c08,0x0000894a,0x0000138d,0xffff58ac, +0x0001afaf,0xfffe28fe,0x000343bf,0xfffd026f, +0x0004c6f6,0xfffbed06,0x00062e61,0x0003dc0e, +0xfffb7bf1,0x0002a17f,0xfffcd522,0x000196a0, +0xfffe6e70,0x00007ff6,0x00001439,0xffff63f6, +0x0001beb3,0xfffe4882,0x0003616d,0xfffd361b, +0x0004f1cf,0xfffc332a,0x0006658f,0x00039943, +0xfffb52c0,0x00026ec7,0xfffcbb94,0x0001789f, +0xfffe6160,0x00007677,0x000014d4,0xffff6f74, +0x0001cc9b,0xfffe694f,0x00037cbf,0xfffd6b41, +0x000519c2,0xfffc7baf,0x00069971,0x00035486, +0xfffb2d0c,0x00023ad8,0xfffca3ee,0x00015989, +0xfffe55af,0x00006ca7,0x00001570,0xffff7b71, +0x0001d9cb,0xfffe8b46,0x0003959e,0xfffda1fe, +0x00053ee6,0xfffcc6b4,0x0006c950,0x00030e08, +0xfffb0a7a,0x0002061e,0xfffc8ec0,0x00013911, +0xfffe4b1d,0x00006278,0x000015e8,0xffff87b6, +0x0001e577,0xfffeadd6,0x0003acc2,0xfffdda34, +0x00056059,0xfffd136d,0x0006f4b5,0x0002c562, +0xfffaea7c,0x0001cfa6,0xfffc7b14,0x0001182b, +0xfffe4159,0x00005817,0x0000165c,0xffff9417, +0x0001f00f,0xfffed14c,0x0003c199,0xfffe13f6, +0x00057e83,0xfffd61cd,0x00071ba1,0x00027ab5, +0xfffacdc3,0x00019833,0xfffc6989,0x0000f6ca, +0xfffe38da,0x00004d9d,0x000016ef,0xffffa103, +0x0001f98f,0xfffef5c0,0x0003d3d1,0xfffe4f00, +0x0005998c,0xfffdb21e,0x00073e77,0x00022e75, +0xfffab482,0x00015fd1,0xfffc5b13,0x0000d45d, +0xfffe318f,0x000042ed,0x0000176b,0xffffae8f, +0x0002018f,0xffff1a91,0x0003e40c,0xfffe8af2, +0x0005b0ca,0xfffe03b8,0x00075d14,0x0001e141, +0xfffa9e9b,0x0001262a,0xfffc4e31,0x0000b1af, +0xfffe2b26,0x00003805,0x000017b1,0xffffbc21, +0x000208b8,0xffff3fb6,0x0003f1d7,0xfffec7af, +0x0005c4c5,0xfffe5654,0x0007768a,0x000192fe, +0xfffa8bb0,0x0000ec3f,0xfffc4365,0x00008ec9, +0xfffe25f0,0x00002d05,0x000017ec,0xffffc984, +0x00020ec6,0xffff658d,0x0003fcba,0xffff0500, +0x0005d576,0xfffeaa37,0x00078bc6,0x00014367, +0xfffa7bec,0x0000b1f4,0xfffc3b82,0x00006b06, +0xfffe2201,0x000021eb,0x00001823,0xffffd704, +0x0002132a,0xffff8be7,0x00040534,0xffff4315, +0x0005e22e,0xfffeff0a,0x00079ce3,0x0000f33f, +0xfffa6fc9,0x000076ca,0xfffc3558,0x00004762, +0xfffe1ef3,0x000016a1,0x0000183f,0xffffe4a6, +0x00021664,0xffffb27d,0x00040b7b,0xffff81e5, +0x0005eb4e,0xffff5475,0x0007a857,0x0000a2cb, +0xfffa671b,0x00003b64,0xfffc31e2,0x00002416, +0xfffe1ce1,0x00000b46,0x00001850,0xfffff24d, +0x00021855,0xffffd93a,0x00040f75,0xffffc0e6, +0x0005f0e3,0xffffaa3e,0x0007af45,0x0000519f, +0xfffa6218,0x0003f991,0x0003588d,0x0002b15e, +0x0002056d,0x00015600,0x0000a329,0xffffeed9, +0xffff3960,0xfffe8423,0xfffdd11c,0xfffd2048, +0xfffc7353,0xfffbcb6f,0xfffb29a6,0xfffa8f15, +0x000494ae,0x0003c6b0,0xfffc7e8b,0x00028ef6, +0xfffde181,0x000144eb,0xffff5500,0xffffefb9, +0x0000d01d,0xfffe9755,0x000249a4,0xfffd453c, +0x0003b80e,0xfffc01aa,0x000511d6,0xfffad527, +0xfffb334e,0x0003916c,0xfffc5778,0x00026a92, +0xfffdc9f5,0x00013314,0xffff4d99,0xfffff0b6, +0x0000d911,0xfffeab80,0x00026369,0xfffd6c0a, +0x0003e17f,0xfffc39d8,0x000549df,0xfffb1eb2, +0xfffafe6c,0x00035929,0xfffc3321,0x000244a6, +0xfffdb402,0x00012035,0xffff46ac,0xfffff192, +0x0000e16a,0xfffebfe0,0x00027b3d,0xfffd9433, +0x0004087b,0xfffc74b7,0x00057e8d,0xfffb6a81, +0xfffacc1c,0x00031fbe,0xfffc10df,0x00021e0c, +0xfffd9f6d,0x00010cb7,0xffff402e,0xfffff279, +0x0000e965,0xfffed574,0x00029159,0xfffdbdc4, +0x00042c4c,0xfffcb1e7,0x0005b02d,0xfffbb942, +0xfffa9d38,0x0002e44a,0xfffbf0fd,0x0001f5b4, +0xfffd8c38,0x0000f8b1,0xffff3a21,0xfffff391, +0x0000f0e6,0xfffeec44,0x0002a642,0xfffde90e, +0x00044e32,0xfffcf0fb,0x0005de46,0xfffc0b18, +0xfffa71d1,0x0002a659,0xfffbd3de,0x0001cb90, +0xfffd7a97,0x0000e403,0xffff3490,0xfffff49c, +0x0000f7a8,0xffff0340,0x0002b95f,0xfffe1573, +0x00046dbe,0xfffd3284,0x00060888,0xfffc5f51, +0xfffa4996,0x00026786,0xfffbb8df,0x0001a0e1, +0xfffd6a4e,0x0000ced2,0xffff2f75,0xfffff593, +0x0000fdbe,0xffff1a53,0x0002ca87,0xfffe42f5, +0x0004898a,0xfffd7563,0x00062f0b,0xfffcb5de, +0xfffa2508,0x00022713,0xfffba0bf,0x0001754a, +0xfffd5b5f,0x0000b92c,0xffff2acd,0xfffff6b0, +0x0001034f,0xffff3241,0x0002da5c,0xfffe71c6, +0x0004a341,0xfffdb946,0x000651e8,0xfffd0e37, +0xfffa0402,0x0001e4d4,0xfffb8b9c,0x00014898, +0xfffd4e7d,0x0000a304,0xffff26b7,0xfffff7e1, +0x00010846,0xffff4b34,0x0002e897,0xfffea13f, +0x0004ba63,0xfffdff2d,0x00067115,0xfffd6839, +0xfff9e680,0x0001a1fa,0xfffb789e,0x00011b2e, +0xfffd43a4,0x00008c6e,0xffff2341,0xfffff8fd, +0x00010c9c,0xffff6469,0x0002f48f,0xfffed1a4, +0x0004cd6a,0xfffe4608,0x00068c1b,0xfffdc409, +0xfff9cd15,0x00015dfe,0xfffb68a0,0x0000ecee, +0xfffd3a2e,0x0000757d,0xffff204b,0xfffffa1e, +0x00011054,0xffff7da1,0x0002fe9c,0xffff033e, +0x0004de57,0xfffe8dc6,0x0006a2d5,0xfffe213e, +0xfff9b77d,0x000118d3,0xfffb5bde,0x0000be25, +0xfffd3224,0x00005e52,0xffff1dc1,0xfffffb4b, +0x00011353,0xffff9740,0x00030748,0xffff351c, +0x0004ec95,0xfffed755,0x0006b5b4,0xfffe7fc6, +0xfff9a599,0x0000d334,0xfffb519f,0x00008f08, +0xfffd2bbf,0x00004704,0xffff1bc1,0xfffffc71, +0x00011598,0xffffb135,0x00030e43,0xffff6720, +0x0004f6f3,0xffff2119,0x0006c46e,0xfffedf38, +0xfff997c7,0x00008d13,0xfffb4a55,0x00005fa5, +0xfffd273b,0x00002f76,0xffff1a63,0xfffffda0, +0x00011744,0xffffcb67,0x000312ff,0xffff99cf, +0x0004ff0c,0xffff6a9c,0x0006cebd,0xffff3f0a, +0xfff98dbe,0x00004691,0xfffb4620,0x00003010, +0xfffd24fc,0x000017b5,0xffff199d,0xfffffed8, +0x0001185a,0xffffe5c6,0x0003157e,0xffffcce3, +0x000503ae,0xffffb515,0x0006d537,0xffff9f5a, +0xfff98767,0xfffb44b0,0xfffc3131,0xfffd2475, +0xfffe1c28,0xffff195d,0x00001859,0x000118bd, +0x000218df,0x0003163a,0x000410e0,0x000504a7, +0x0005f2b3,0x0006d796,0x0007b1fe,0xfff98537, +0xfffa609b,0xfffc7e8b,0x00028ef6,0xfffde181, +0x000144eb,0xffff5500,0xffffefb9,0x0000d01d, +0xfffe9755,0x000249a4,0xfffd453c,0x0003b80e, +0xfffc01aa,0x000511d6,0xfffad527,0xfffb334e, +0x0003c6b0,0xfffc5778,0x00026a92,0xfffdc9f5, +0x00013314,0xffff4d99,0xfffff0b6,0x0000d911, +0xfffeab80,0x00026369,0xfffd6c0a,0x0003e17f, +0xfffc39d8,0x000549df,0xfffb1eb2,0xfffafe6c, +0x0003916c,0xfffc3321,0x000244a6,0xfffdb402, +0x00012035,0xffff46ac,0xfffff192,0x0000e16a, +0xfffebfe0,0x00027b3d,0xfffd9433,0x0004087b, +0xfffc74b7,0x00057e8d,0xfffb6a81,0xfffacc1c, +0x00035929,0xfffc10df,0x00021e0c,0xfffd9f6d, +0x00010cb7,0xffff402e,0xfffff279,0x0000e965, +0xfffed574,0x00029159,0xfffdbdc4,0x00042c4c, +0xfffcb1e7,0x0005b02d,0xfffbb942,0xfffa9d38, +0x00031fbe,0xfffbf0fd,0x0001f5b4,0xfffd8c38, +0x0000f8b1,0xffff3a21,0xfffff391,0x0000f0e6, +0xfffeec44,0x0002a642,0xfffde90e,0x00044e32, +0xfffcf0fb,0x0005de46,0xfffc0b18,0xfffa71d1, +0x0002e44a,0xfffbd3de,0x0001cb90,0xfffd7a97, +0x0000e403,0xffff3490,0xfffff49c,0x0000f7a8, +0xffff0340,0x0002b95f,0xfffe1573,0x00046dbe, +0xfffd3284,0x00060888,0xfffc5f51,0xfffa4996, +0x0002a659,0xfffbb8df,0x0001a0e1,0xfffd6a4e, +0x0000ced2,0xffff2f75,0xfffff593,0x0000fdbe, +0xffff1a53,0x0002ca87,0xfffe42f5,0x0004898a, +0xfffd7563,0x00062f0b,0xfffcb5de,0xfffa2508, +0x00026786,0xfffba0bf,0x0001754a,0xfffd5b5f, +0x0000b92c,0xffff2acd,0xfffff6b0,0x0001034f, +0xffff3241,0x0002da5c,0xfffe71c6,0x0004a341, +0xfffdb946,0x000651e8,0xfffd0e37,0xfffa0402, +0x00022713,0xfffb8b9c,0x00014898,0xfffd4e7d, +0x0000a304,0xffff26b7,0xfffff7e1,0x00010846, +0xffff4b34,0x0002e897,0xfffea13f,0x0004ba63, +0xfffdff2d,0x00067115,0xfffd6839,0xfff9e680, +0x0001e4d4,0xfffb789e,0x00011b2e,0xfffd43a4, +0x00008c6e,0xffff2341,0xfffff8fd,0x00010c9c, +0xffff6469,0x0002f48f,0xfffed1a4,0x0004cd6a, +0xfffe4608,0x00068c1b,0xfffdc409,0xfff9cd15, +0x0001a1fa,0xfffb68a0,0x0000ecee,0xfffd3a2e, +0x0000757d,0xffff204b,0xfffffa1e,0x00011054, +0xffff7da1,0x0002fe9c,0xffff033e,0x0004de57, +0xfffe8dc6,0x0006a2d5,0xfffe213e,0xfff9b77d, +0x00015dfe,0xfffb5bde,0x0000be25,0xfffd3224, +0x00005e52,0xffff1dc1,0xfffffb4b,0x00011353, +0xffff9740,0x00030748,0xffff351c,0x0004ec95, +0xfffed755,0x0006b5b4,0xfffe7fc6,0xfff9a599, +0x000118d3,0xfffb519f,0x00008f08,0xfffd2bbf, +0x00004704,0xffff1bc1,0xfffffc71,0x00011598, +0xffffb135,0x00030e43,0xffff6720,0x0004f6f3, +0xffff2119,0x0006c46e,0xfffedf38,0xfff997c7, +0x0000d334,0xfffb4a55,0x00005fa5,0xfffd273b, +0x00002f76,0xffff1a63,0xfffffda0,0x00011744, +0xffffcb67,0x000312ff,0xffff99cf,0x0004ff0c, +0xffff6a9c,0x0006cebd,0xffff3f0a,0xfff98dbe, +0x00008d13,0xfffb4620,0x00003010,0xfffd24fc, +0x000017b5,0xffff199d,0xfffffed8,0x0001185a, +0xffffe5c6,0x0003157e,0xffffcce3,0x000503ae, +0xffffb515,0x0006d537,0xffff9f5a,0xfff98767, +0x00004691,0xfffa609b,0xfffb44b0,0xfffc3131, +0xfffd2475,0xfffe1c28,0xffff195d,0x00001859, +0x000118bd,0x000218df,0x0003163a,0x000410e0, +0x000504a7,0x0005f2b3,0x0006d796,0x0007b1fe, +0xfff98537,0xfffbd51e,0x00032dd1,0xfffd2d8f, +0x0001eb47,0xfffe9968,0x00009af6,0x000011de, +0xffff4335,0x00018d69,0xfffdecd4,0x000302f8, +0xfffca0d7,0x0004683d,0xfffb67f8,0x0005b36d, +0x00045963,0xfffba72a,0x00030062,0xfffd0dee, +0x0001d046,0xfffe8a0a,0x00009258,0x000012b1, +0xffff4d9e,0x00019ec3,0xfffe0a44,0x0003245a, +0xfffcd082,0x000498f0,0xfffba919,0x0005f304, +0x00041bf4,0xfffb7bf1,0x0002d19e,0xfffcf060, +0x0001b407,0xfffe7c08,0x0000894a,0x0000138d, +0xffff58ac,0x0001afaf,0xfffe28fe,0x000343bf, +0xfffd026f,0x0004c6f6,0xfffbed06,0x00062e61, +0x0003dc0e,0xfffb52c0,0x0002a17f,0xfffcd522, +0x000196a0,0xfffe6e70,0x00007ff6,0x00001439, +0xffff63f6,0x0001beb3,0xfffe4882,0x0003616d, +0xfffd361b,0x0004f1cf,0xfffc332a,0x0006658f, +0x00039943,0xfffb2d0c,0x00026ec7,0xfffcbb94, +0x0001789f,0xfffe6160,0x00007677,0x000014d4, +0xffff6f74,0x0001cc9b,0xfffe694f,0x00037cbf, +0xfffd6b41,0x000519c2,0xfffc7baf,0x00069971, +0x00035486,0xfffb0a7a,0x00023ad8,0xfffca3ee, +0x00015989,0xfffe55af,0x00006ca7,0x00001570, +0xffff7b71,0x0001d9cb,0xfffe8b46,0x0003959e, +0xfffda1fe,0x00053ee6,0xfffcc6b4,0x0006c950, +0x00030e08,0xfffaea7c,0x0002061e,0xfffc8ec0, +0x00013911,0xfffe4b1d,0x00006278,0x000015e8, +0xffff87b6,0x0001e577,0xfffeadd6,0x0003acc2, +0xfffdda34,0x00056059,0xfffd136d,0x0006f4b5, +0x0002c562,0xfffacdc3,0x0001cfa6,0xfffc7b14, +0x0001182b,0xfffe4159,0x00005817,0x0000165c, +0xffff9417,0x0001f00f,0xfffed14c,0x0003c199, +0xfffe13f6,0x00057e83,0xfffd61cd,0x00071ba1, +0x00027ab5,0xfffab482,0x00019833,0xfffc6989, +0x0000f6ca,0xfffe38da,0x00004d9d,0x000016ef, +0xffffa103,0x0001f98f,0xfffef5c0,0x0003d3d1, +0xfffe4f00,0x0005998c,0xfffdb21e,0x00073e77, +0x00022e75,0xfffa9e9b,0x00015fd1,0xfffc5b13, +0x0000d45d,0xfffe318f,0x000042ed,0x0000176b, +0xffffae8f,0x0002018f,0xffff1a91,0x0003e40c, +0xfffe8af2,0x0005b0ca,0xfffe03b8,0x00075d14, +0x0001e141,0xfffa8bb0,0x0001262a,0xfffc4e31, +0x0000b1af,0xfffe2b26,0x00003805,0x000017b1, +0xffffbc21,0x000208b8,0xffff3fb6,0x0003f1d7, +0xfffec7af,0x0005c4c5,0xfffe5654,0x0007768a, +0x000192fe,0xfffa7bec,0x0000ec3f,0xfffc4365, +0x00008ec9,0xfffe25f0,0x00002d05,0x000017ec, +0xffffc984,0x00020ec6,0xffff658d,0x0003fcba, +0xffff0500,0x0005d576,0xfffeaa37,0x00078bc6, +0x00014367,0xfffa6fc9,0x0000b1f4,0xfffc3b82, +0x00006b06,0xfffe2201,0x000021eb,0x00001823, +0xffffd704,0x0002132a,0xffff8be7,0x00040534, +0xffff4315,0x0005e22e,0xfffeff0a,0x00079ce3, +0x0000f33f,0xfffa671b,0x000076ca,0xfffc3558, +0x00004762,0xfffe1ef3,0x000016a1,0x0000183f, +0xffffe4a6,0x00021664,0xffffb27d,0x00040b7b, +0xffff81e5,0x0005eb4e,0xffff5475,0x0007a857, +0x0000a2cb,0xfffa6218,0x00003b64,0xfffc31e2, +0x00002416,0xfffe1ce1,0x00000b46,0x00001850, +0xfffff24d,0x00021855,0xffffd93a,0x00040f75, +0xffffc0e6,0x0005f0e3,0xffffaa3e,0x0007af45, +0x0000519f,0x00030000,0x000f0007,0x003f001f, +0x00ff007f,0x03ff01ff,0x0fff07ff,0x3fff1fff, +0xffff7fff,0x00030000,0x00070005,0x000f0009, +0x003f001f,0x00ff007f,0x03ff01ff,0x0fff07ff, +0xffff1fff,0x00030000,0x00070005,0x000f0009, +0xffff001f,0x00030000,0xffff0005,0x04030504, +0x08070605,0x0c0b0a09,0x100f0e0d,0x03070504, +0x0605040a,0x0a090807,0x100d0c0b,0x03070503, +0x1005040a,0x10070502,0x03030100,0x03030303, +0x03030303,0x03030303,0x03010100,0x03030301, +0x03030303,0x03030303,0x03010100,0x03030301, +0x03010100,0x04020000,0x08070605,0x0c0b0a09, +0x100f0e0d,0x02010000,0x06050403,0x0a090807, +0x100d0c0b,0x02010000,0x10050403,0x10010000, +0x00030000,0x00090005,0x001f000f,0x007f003f, +0x01ff00ff,0x07ff03ff,0x1fff0fff,0x7fff3fff, +0x00030000,0x00090005,0x001f000f,0x007f003f, +0x0a070504,0x07060504,0x0b0a0908,0x0f0e0d0c, +0x0a070503,0x07060504,0x01010100,0x03030303, +0x03030303,0x03030303,0x01010100,0x03030303, +0x03010000,0x07060504,0x0b0a0908,0x0f0e0d0c, +0x03010000,0x07060504,0x00555555,0x002aaaab, +0x00249249,0x00124925,0x00111111,0x00088889, +0x00084210,0x00421084,0x00041041,0x00020821, +0x00020408,0x00081020,0x00010101,0x00008081, +0x00008040,0x00100804,0x00004010,0x00020080, +0x00002004,0x00004008,0x00001001,0x00000801, +0x00000800,0x00200100,0x00000400,0x00080020, +0x00000200,0x00020004,0x00200000,0x00600040, +0x00a00080,0x00e000c0,0x01200100,0x01600140, +0x01a00180,0x000001c0,0x00300020,0x00400038, +0x00600050,0x00800070,0x00c000a0,0x010000e0, +0x01800140,0x00200000,0x00300028,0x00400038, +0x00600050,0x00800070,0x00c000a0,0x010000e0, +0x00000140,0x00900000,0x00fc00d8,0x01680120, +0x01f801b0,0x02d00240,0x03f00360,0x05a00480, +0x000006c0,0x00680000,0x00b6009c,0x010500d0, +0x016d0139,0x020a01a1,0x02db0272,0x04140343, +0x000004e5,0x006c0000,0x00bd00a2,0x010e00d8, +0x017a0144,0x006301b0,0x013b00cf,0x00c601a7, +0x0000019e,0x00600000,0x00a80090,0x00f000c0, +0x01500120,0x01e00180,0x02a00240,0x03c00300, +0x00000480,0x10000000,0x10101010,0x20101010, +0x20202020,0x20202020,0x28202020,0x28282828, +0x00002828,0x10100000,0x10101010,0x10101010, +0x00000000,0x00000000,0x00000000,0x00000000, +0xcbcecdc4,0xcfcac9c8,0xc3c6c5cc,0xc7c2c1c0, +0x1b1e1d14,0x1f1a1918,0x1316151c,0x17121110, +0x2b2e2d24,0x2f2a2928,0x2326252c,0x27222120, +0x3b3e3d34,0x3f3a3938,0x3336353c,0x37323130, +0x0b0e0d04,0x0f0a0908,0x0306050c,0x07020100, +0xdbdeddd4,0xdfdad9d8,0xd3d6d5dc,0xd7d2d1d0, +0xebeeede4,0xefeae9e8,0xe3e6e5ec,0xe7e2e1e0, +0xfbfefdf4,0xfffaf9f8,0xf3f6f5fc,0xf7f2f1f0, +0x4b4e4d44,0x4f4a4948,0x4346454c,0x47424140, +0x9b9e9d94,0x9f9a9998,0x9396959c,0x97929190, +0xabaeada4,0xafaaa9a8,0xa3a6a5ac,0xa7a2a1a0, +0xbbbebdb4,0xbfbab9b8,0xb3b6b5bc,0xb7b2b1b0, +0x8b8e8d84,0x8f8a8988,0x8386858c,0x87828180, +0x5b5e5d54,0x5f5a5958,0x5356555c,0x57525150, +0x6b6e6d64,0x6f6a6968,0x6366656c,0x67626160, +0x7b7e7d74,0x7f7a7978,0x7376757c,0x77727170, +0x341424c4,0x3e1e2ece,0x3d1d2dcd,0x3b1b2bcb, +0xb494a444,0xbe9eae4e,0xbd9dad4d,0xbb9bab4b, +0xf4d4e404,0xfedeee0e,0xfddded0d,0xfbdbeb0b, +0x74546484,0x7e5e6e8e,0x7d5d6d8d,0x7b5b6b8b, +0x3c1c2ccc,0x361626c6,0x351525c5,0x331323c3, +0xbc9cac4c,0xb696a646,0xb595a545,0xb393a343, +0xfcdcec0c,0xf6d6e606,0xf5d5e505,0xf3d3e303, +0x7c5c6c8c,0x76566686,0x75556585,0x73536383, +0x381828c8,0x3a1a2aca,0x391929c9,0x3f1f2fcf, +0xb898a848,0xba9aaa4a,0xb999a949,0xbf9faf4f, +0xf8d8e808,0xfadaea0a,0xf9d9e909,0xffdfef0f, +0x78586888,0x7a5a6a8a,0x79596989,0x7f5f6f8f, +0x301020c0,0x321222c2,0x311121c1,0x371727c7, +0xb090a040,0xb292a242,0xb191a141,0xb797a747, +0xf0d0e000,0xf2d2e202,0xf1d1e101,0xf7d7e707, +0x70506080,0x72526282,0x71516181,0x77576787, +0x05040100,0x15141110,0x25242120,0x35343130, +0x85848180,0x95949190,0xa5a4a1a0,0xb5b4b1b0, +0xc0408000,0xe060a020,0xd0509010,0xf070b030, +0xc8488808,0xe868a828,0xd8589818,0xf878b838, +0xc4448404,0xe464a424,0xd4549414,0xf474b434, +0xcc4c8c0c,0xec6cac2c,0xdc5c9c1c,0xfc7cbc3c, +0xc2428202,0xe262a222,0xd2529212,0xf272b232, +0xca4a8a0a,0xea6aaa2a,0xda5a9a1a,0xfa7aba3a, +0xc6468606,0xe666a626,0xd6569616,0xf676b636, +0xce4e8e0e,0xee6eae2e,0xde5e9e1e,0xfe7ebe3e, +0xc1418101,0xe161a121,0xd1519111,0xf171b131, +0xc9498909,0xe969a929,0xd9599919,0xf979b939, +0xc5458505,0xe565a525,0xd5559515,0xf575b535, +0xcd4d8d0d,0xed6dad2d,0xdd5d9d1d,0xfd7dbd3d, +0xc3438303,0xe363a323,0xd3539313,0xf373b333, +0xcb4b8b0b,0xeb6bab2b,0xdb5b9b1b,0xfb7bbb3b, +0xc7478707,0xe767a727,0xd7579717,0xf777b737, +0xcf4f8f0f,0xef6faf2f,0xdf5f9f1f,0xff7fbf3f, +0x1045a3e2,0x000000f4,0x263b7333,0x766b2363, +0x2b367e3e,0x7b662e6e,0x06db93d3,0x964b0343, +0x0bd69ede,0x9b460e4e,0x825f1757,0x12cf87c7, +0x8f521a5a,0x1fc28aca,0x00d199d9,0x90410949, +0x01d098d8,0x91400848,0x24357d3d,0x74652d6d, +0x25347c3c,0x75642c6c,0x04d59ddd,0x94450d4d, +0x05d49cdc,0x95440c4c,0x80511959,0x10c189c9, +0x81501858,0x11c088c8,0x02df97d7,0x924f0747, +0x0fd29ada,0x9f420a4a,0x865b1353,0x16cb83c3, +0x8b561e5e,0x1bc68ece,0xa6bbf3b3,0xf6eba3e3, +0xabb6febe,0xfbe6aeee,0x223f7737,0x726f2767, +0x2f327a3a,0x7f622a6a,0xa0b1f9b9,0xf0e1a9e9, +0xa1b0f8b8,0xf1e0a8e8,0x84551d5d,0x14c58dcd, +0x85541c5c,0x15c48ccc,0xa4b5fdbd,0xf4e5aded, +0xa5b4fcbc,0xf5e4acec,0x20317939,0x70612969, +0x21307838,0x71602868,0xa2bff7b7,0xf2efa7e7, +0xafb2faba,0xffe2aaea,0x00000000,0x00000000, + +}; + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/mpgi2s_240.h linux.20pre5-ac2/drivers/media/video/ls220/mpgi2s_240.h --- linux.20pre5/drivers/media/video/ls220/mpgi2s_240.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/mpgi2s_240.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,1593 @@ +static u32 MPGI2S240Ucode1f1800[] = { +0x820f001f,0x802f001f,0xb500000d,0x00000000, +0x00ffb81e,0x00000000,0x00000000,0x00000000, +0x00ffb81e,0x00000000,0x00000000,0x00000000, +0xb5000b5b,0x00000000,0x00000000,0x00000000, +0x80070800,0x001f6047,0x8013001f,0x90208000, +0x003fb174,0x803effe8,0x803effec,0x9020fa00, +0x803effd0,0x803effdc,0x803effd8,0x9020fe00, +0x803effd4,0x805bff7c,0x802500d4,0x94020080, +0xb0000000,0xb4200023,0x8013ffcf,0x9800cfff, +0x80730030,0x98631000,0x94420007,0xb0020002, +0xb4200005,0x8013ffc7,0x9800c7ff,0x80730038, +0x98631000,0xb5000006,0xb0020001,0xb4200004, +0x8013ffcf,0x9800cfff,0x80730030,0x98631000, +0x1421b800,0x1821b803,0x802600d4,0x8033001f, +0x98210000,0x802600a2,0x8033001f,0x98210300, +0x802600a3,0x80270225,0x80530001,0x98420100, +0x1821b802,0x80530200,0x98420000,0x804600a6, +0xb500001d,0x805bff7c,0x8013ffcf,0x9800cfff, +0x80730030,0x98632000,0x94420007,0xb0020002, +0xb4200005,0x8013ffc7,0x9800c7ff,0x80730038, +0x98632800,0xb5000006,0xb0020001,0xb4200004, +0x8013ffcf,0x9800cfff,0x80730030,0x98632000, +0x1421b800,0x1821b803,0x802600d4,0x8033001f, +0x98210000,0x802600a2,0x8033001f,0x98210600, +0x802600a3,0x80270eff,0x802600a1,0x80270002, +0x803eff84,0x80070000,0x801effc0,0x801effc4, +0x801effc8,0x801effcc,0x801eff88,0x80770000, +0x8057ffff,0x80170080,0x80070000,0xb6003f02, +0xb6002001,0x001fa020,0x8007ffff,0x801eff84, +0x80070001,0x001f25dc,0x001f20b1,0x80070000, +0x001f6046,0x001fb17c,0x001fb17d,0x80070000, +0x801e78d0,0x98004000,0x001f62ea,0x80070100, +0x801efff0,0x81df0004,0x00000000,0x00000000, +0x801bfff0,0x00000000,0x940000ff,0xb0000000, +0xb4200057,0x003f42ea,0x94010010,0xb0000000, +0xb400fff7,0x003f05dc,0xb0010001,0xb4200034, +0x803bffe8,0x801bffec,0x00000000,0x3001b800, +0xb4600001,0x90214000,0x0421b800,0xb0010800, +0xb460000d,0x80050086,0x005f902e,0xb0020000, +0xb4200002,0x001fb02e,0xb5000006,0x0420b802, +0xb0010930,0xb4a0ffe2,0x80070000,0x001fb02e, +0x83e40146,0xb500ffde,0x83e40111,0x80070000, +0x001fb02e,0x001f42ea,0x9400000f,0xb0000000, +0xb4000010,0x9400fff0,0x001f62ea,0x003f9174, +0x9421ffff,0x90210004,0xb001c000,0xb4800002, +0x8421c000,0x90218000,0x8013001f,0x1821b800, +0x003fb174,0x003f917c,0x90210004,0x003fb17c, +0x83e4012e,0x8013001f,0x83e71b0c,0x1bffb800, +0x003f9179,0x1821b800,0x00ffb801,0xb5000008, +0x80270000,0x003f25dc,0x8013001f,0x83e71b30, +0x1bffb800,0x003f917a,0x1821b800,0x00ffb801, +0x80070000,0x001f20b1,0x001f42ea,0x9420000f, +0xb0010000,0xb4200003,0x98000800,0x001f62ea, +0xb500ffaf,0x9400fff0,0x001f62ea,0x80270000, +0x8057ffff,0x80770000,0x80171980,0xb6000602, +0xb6002001,0x001fa021,0xb500ffa5,0xb500ffa4, +0x803bffc0,0x805bffc4,0x807bffc8,0x809bffcc, +0x5828b801,0x5cb8b802,0x1821b805,0x5848b802, +0x5cb8b803,0x1842b805,0x5868b803,0x5cb8b804, +0x1863b805,0x5888b804,0x1884b800,0x803effc0, +0x805effc4,0x807effc8,0x809effcc,0x003f42ea, +0xb0000086,0xb4400079,0xb0000084,0xb4000049, +0xb0000085,0xb4000063,0xb0000086,0xb400006c, +0xb0000081,0xb4000005,0xb0000082,0xb4000003, +0xb0000080,0xb4000001,0xb5000069,0x8013007f, +0x9800ffff,0x001fb02d,0x80070000,0x001fb17c, +0x8013001f,0x9040fa00,0x805effd0,0x805effdc, +0x805effd8,0x9040fe00,0x805effd4,0x9040c000, +0x805effe4,0x90008000,0x801effe0,0x001fb174, +0x801effe8,0x801effec,0x80078000,0x801e78d4, +0x80070000,0x001fb17c,0x001fb17d,0x001fb02e, +0x83e400ce,0x8013001f,0x98000000,0x800600a2, +0x8013001f,0x98000600,0x800600a3,0x805bff7c, +0x80070eff,0x94420080,0xb0020080,0xb420000d, +0x8013001f,0x98000000,0x800600a2,0x8013001f, +0x98000300,0x800600a3,0x80070225,0x80530001, +0x98420100,0x1800b802,0x80530200,0x98420000, +0x804600a6,0x800600a1,0x80050080,0x98000022, +0x80060080,0x80072000,0x001fb179,0x80074360, +0x001fb17a,0x80070001,0x001f25dc,0x98214000, +0xb5000029,0x8047ffff,0x805eff84,0x805bff88, +0x00000000,0xb0020001,0xb4200002,0x80470000, +0x805eff88,0x805bff7c,0x80070eff,0x94420080, +0xb0020080,0xb4200007,0x80070225,0x80530001, +0x98420100,0x1800b802,0x80530200,0x98420000, +0x804600a6,0x800600a1,0x80070001,0x800600a0, +0x9421efff,0x98210010,0xb500000f,0x80070000, +0x001fb17c,0x80070001,0x001f25dc,0x83e4008b, +0x80050081,0x80330008,0x98210000,0x1800b801, +0x80060081,0x003f42ea,0x9421ffef,0xb5000002, +0x98211000,0x9421ffef,0x83e40080,0x003f62ea, +0x80070100,0x801efff0,0xb500ff15,0xb000008b, +0xb400001c,0xb0000087,0xb400ffe8,0xb0000088, +0xb4000023,0xb000008a,0xb4000024,0xb000008c, +0xb4000019,0xb000008e,0xb4000014,0xb000008d, +0xb400001d,0xb0000089,0xb400001f,0xb00000a0, +0xb4000021,0xb00000a1,0xb4000022,0xb00000a2, +0xb400002b,0xb00000a3,0xb4000027,0xb00000a4, +0xb4000029,0xb00000a5,0xb4000029,0xb00000a6, +0xb4000029,0x803efff8,0xb500ffdd,0x80070000, +0x001fb17e,0xb500ffda,0x803bffb0,0x00000000, +0x003fb02d,0xb500ffd6,0x98210020,0xb500ffd2, +0x9421ffdf,0xb500ffd0,0xb500ffd1,0x80270351, +0x803efff8,0xb500ffce,0x803bff80,0x00000000, +0x003f62ef,0xb500ffca,0x003f917b,0x803efff8, +0xb500ffc7,0x80270000,0x8047fef0,0x003eb802, +0x90420004,0x003eb802,0x90420004,0x003eb802, +0x90420004,0x003eb802,0x83640d78,0xb500ffbc, +0x83640d26,0xb500ffba,0x83640ce5,0xb500ffb8, +0x83440c4c,0xb500ffb6,0x83440c35,0xb500ffb4, +0x817bffe8,0x815b78d4,0x00000000,0x956bffff, +0x300bb80a,0xb4600001,0x916b4000,0x056bb80a, +0xb00b0080,0xb4a00026,0x80af001f,0x808f0000, +0x806f0000,0x81b300ff,0x8057ffff,0x5d67b80b, +0x5d42b80a,0xb62b001c,0xb00a3000,0xb4800001, +0x854a1000,0x80cf0400,0x015fb178,0x5942b80a, +0x01cfb80a,0x015f9178,0xb520ffff,0x80171000, +0xb600200a,0x01ff8000,0x5a18b80f,0x5a28b80f, +0x1631b80d,0x5e48b80f,0x9652ff00,0x5e78b80f, +0x1a73b810,0x1a73b811,0x1813a032,0x80cf0400, +0x015fb178,0x5942b80a,0x01afb80a,0x015f9178, +0xb520ffff,0x914a0020,0x5942b80a,0x815e78d4, +0x00000000,0x00000000,0x00ffb81f,0x80070000, +0x80470000,0x81171800,0xb6002003,0xb6003002, +0x001eb802,0x90420004,0xb6002003,0x011fa020, +0x011fa020,0x011fa020,0x00ffb81f,0x80070000, +0x80478000,0xb6002003,0xb6008002,0x001eb802, +0x90420004,0x00ffb81f,0x00000000,0x00000000, +0x015f42ea,0x944a4000,0xb0024000,0xb4200071, +0x954abfff,0x015f62ea,0x808f0000,0x80ef007c, +0x80171000,0x80971400,0x80270000,0xb6001003, +0xb6002002,0x001fa021,0x009fa021,0x80a76604, +0x80271400,0xb6001004,0x01efb801,0x01afb805, +0xb520ffff,0x90a50080,0x80a76e04,0x80271400, +0xb6001004,0x01efb801,0x01afb805,0xb520ffff, +0x90a50080,0x806f001f,0x80af001f,0x80276400, +0x5c22b801,0x806701e1,0x00cfb803,0x003fb178, +0x5822b801,0x01cfb801,0x003f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x80275c00,0x5c22b801, +0x80670200,0xb600100a,0x00cfb803,0x003fb178, +0x5822b801,0x01cfb801,0x003f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x90210020,0x90630020, +0x808f0000,0x806f001f,0x80af001f,0x8027647c, +0x5c22b801,0x8067017e,0xb600020a,0x00cfb803, +0x003fb178,0x5822b801,0x01cfb801,0x003f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x90210020, +0x90630020,0x806f0010,0x80af0010,0x8027657c, +0x5c22b801,0x806701be,0x00cfb803,0x003fb178, +0x5822b801,0x01cfb801,0x003f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x802765c0,0x5c22b801, +0x806701cf,0x00cfb803,0x003fb178,0x5822b801, +0x01cfb801,0x003f9178,0x0047b86f,0xb0020001, +0xb4c0fffd,0x80276000,0x005fb801,0x8033001f, +0x98218000,0x803effe0,0x90214000,0x803effe4, +0x8193001f,0x998c8000,0x019fb174,0x83270000, +0x003fb819,0x003f9174,0x5823b801,0x83338000, +0x1b39b801,0x003fb819,0x00000000,0x00000000, +0x81550000,0x0187b860,0x858c0040,0x81b380fc, +0x99ad0000,0x300cb80d,0xb4600003,0x81b30002, +0x99ad0000,0x118cb80d,0x003fb80c,0x00000000, +0x00000000,0x81550000,0x8257ffff,0x82d7ffff, +0x8357ffff,0x81672000,0x83440189,0xb00a0001, +0xb4000141,0x0187b860,0x858c0010,0x5988b80c, +0x5d8bb80c,0x958cffff,0xb00cc000,0xb4800002, +0x858cc000,0x918c8000,0x81b3001f,0x198cb80d, +0x801bffec,0x00000000,0x819effec,0x819e78d8, +0x019fb174,0x05acb800,0x300cb800,0xb4600001, +0x91ad4000,0x001f917c,0x1000b80d,0x001fb17c, +0x83440194,0xb00a0000,0xb4200127,0x015f0081, +0xb00a0002,0xb4200124,0x037f0082,0xb01b0000, +0xb400001e,0x0367b860,0x5b68b81b,0x5f68b81b, +0x017f4047,0x916b0010,0x5963b80b,0x83440160, +0x801bff84,0xb00a0001,0xb400000b,0xb00b00c0, +0xb460fffa,0x803f0000,0x80138000,0x1b7bb800, +0x003fb81b,0x00000000,0x00000000,0x80150000, +0x801bff84,0xb5000009,0x803f0000,0x80138000, +0x1b7bb800,0x003fb81b,0x00000000,0x00000000, +0x80150000,0x801bff84,0xb5000103,0x801bff84, +0x003f0084,0x3000b801,0x803eff84,0xb4000073, +0x801bff7c,0x00000000,0x94800080,0xb0040080, +0xb4200036,0x94800007,0x80730200,0xb0010002, +0xb420000e,0x80270265,0xb0040001,0xb4200003, +0x80130030,0x98000000,0xb5000006,0x80130030, +0x98000000,0xb0040000,0xb4000002,0x80130038, +0x98000000,0x98630060,0xb500001f,0xb0010000, +0xb420000e,0x80270225,0xb0040001,0xb4200003, +0x80130030,0x98001000,0xb5000006,0x80130030, +0x98001000,0xb0040000,0xb4000002,0x80130038, +0x98001000,0x98630000,0xb500000f,0xb0010001, +0xb420004a,0x80270225,0xb0040001,0xb4200003, +0x80130030,0x98002000,0xb5000006,0x80130030, +0x98000000,0xb0040000,0xb4000002,0x80130038, +0x98000000,0x98630040,0x806600a6,0x80530001, +0x98420100,0x1821b802,0xb500002d,0x94800007, +0xb0010002,0xb420000d,0x80270eff,0xb0040001, +0xb4200003,0x80130030,0x98002000,0xb5000006, +0x80130030,0x98000000,0xb0040000,0xb4000002, +0x80130038,0x98000000,0xb500001d,0xb0010000, +0xb420000d,0x80270eff,0xb0040001,0xb4200003, +0x80130030,0x98002000,0xb5000006,0x80130030, +0x98002000,0xb0040000,0xb4000002,0x80130038, +0x98002800,0xb500000e,0xb0010001,0xb4200017, +0x80270eff,0xb0040001,0xb4200003,0x80130030, +0x98002000,0xb5000006,0x80130030,0x98002000, +0xb0040000,0xb4000002,0x80130038,0x98002800, +0x806500d4,0x8053ffcf,0x9842cfff,0xb0040002, +0xb4200002,0x8053ffc7,0x9842c7ff,0x802600a1, +0x1463b802,0x1863b800,0x806600d4,0x807bff7c, +0x00000000,0x94630080,0xb0030080,0xb420000b, +0x807bff88,0x00000000,0xb0030001,0xb4000007, +0x802500a1,0x80670001,0x807eff88,0x80530001, +0x98420100,0x1821b802,0x802600a1,0x81070000, +0x011f62e2,0x011f62e3,0x011f0082,0xb0080000, +0xb4200004,0x81150010,0x00000000,0x00000000, +0x011f62de,0x011f0081,0xb0080001,0xb4200026, +0x81070020,0x011f25c1,0x81070180,0x011f62e1, +0x8344022a,0x8344024e,0x011f0082,0xb0080000, +0xb4200004,0x834401b1,0x8344019e,0xb00a0000, +0xb4200061,0x80c70000,0x00df25cb,0x83440261, +0x834405e7,0x02ff05b9,0x82a70000,0x82870000, +0x834403cf,0x92940001,0x3014b817,0xb480fffc, +0x8344067f,0x80270000,0x003f25dc,0x83440760, +0x003f05dc,0xb0010001,0xb4000003,0x802725d4, +0x003fb17a,0x00ffb81f,0x80d3001f,0x834725ac, +0x1b5ab806,0xb500002d,0xb0080002,0x81470004, +0xb4200045,0x81070008,0x011f25c1,0x81070480, +0x011f62e1,0x83440276,0x834402b0,0x011f0082, +0xb0080000,0xb4200004,0x8344019a,0x83440175, +0xb00a0000,0xb4200038,0x80c70000,0x00df25cb, +0x83440334,0x02df05cb,0x5ec2b816,0x834405ff, +0x02ff05b9,0x82a70000,0x82870000,0x834403a4, +0x92940001,0x3014b817,0xb480fffc,0x92b50001, +0xb0150003,0xb480fff8,0x83440651,0x80270000, +0x003f25dc,0x83440732,0x003f05dc,0xb0010001, +0xb4000003,0x8027268c,0x003fb17a,0x00ffb81f, +0x80d3001f,0x83472650,0x1b5ab806,0x80db78d8, +0x80fbffec,0x00000000,0x3006b807,0xb4200007, +0x00df05cb,0x90c60001,0x00df25cb,0xb006000c, +0xb4000002,0x035fb179,0x00ffb81f,0x80c70000, +0x00df25cb,0x80fb78dc,0x00000000,0x90e70001, +0xb00701b9,0xb4a00001,0x80e70001,0x80fe78dc, +0xb500feb0,0x802500a5,0x8153001f,0x3001b80a, +0xb420fffc,0x00ffb81f,0x001f42ea,0x1800b80a, +0x001f62ea,0x017f4047,0x5963b80b,0x0187b860, +0x118cb80b,0x81b380fe,0x99ad0000,0x300cb80d, +0xb4800003,0x81b30002,0x99ad0000,0x058cb80d, +0x003fb80c,0x00000000,0x00000000,0x81550000, +0x0187b860,0x5988b80c,0x5d8bb80c,0x958cffff, +0xb00cc000,0xb4800002,0x858cc000,0x918c8000, +0x81b3001f,0x198cb80d,0x801bffec,0x00000000, +0x819effec,0x019fb174,0x05acb800,0x300cb800, +0xb4600001,0x91ad4000,0x001f917c,0x1000b80d, +0x001fb17c,0x80171000,0x80971400,0x80270000, +0xb6001003,0xb6002002,0x001fa021,0x009fa021, +0x80171800,0xb6000602,0xb6002001,0x001fa021, +0x806f001f,0x80af001f,0x80a76604,0x80271400, +0xb6001004,0x01efb801,0x01afb805,0xb520ffff, +0x90a50080,0x80a76e04,0x80271400,0xb6001004, +0x01efb801,0x01afb805,0xb520ffff,0x90a50080, +0x81472000,0x015fb179,0x00ffb81f,0x00000000, +0x811be024,0x0107b860,0x95080007,0xb0080000, +0xb4000004,0xa5080008,0x00000000,0x0155b808, +0x00000000,0x8115000c,0x856b000c,0xb0080fff, +0xb400000b,0x81550004,0x856b0004,0x5904b808, +0x1908b80a,0x95080fff,0xb0080fff,0xb4000004, +0x81470001,0xb00b0020,0xb440fff6,0xb500000c, +0x81d50004,0x856b0004,0x00000000,0xb00e000f, +0xb400fffb,0x940b0007,0xb0000000,0xb420ffed, +0x001f42ea,0x9400fffe,0x81470000,0x001f62ea, +0x00ffb81a,0x950e0008,0x5d03b808,0x00000000, +0xb0080000,0xb40000c9,0x011f2080,0x950e0006, +0x5d01b808,0x81270004,0x0529b808,0x950e0001, +0x013f2081,0x011f2082,0x81150004,0x00000000, +0xb0080000,0xb40000bd,0xb008000f,0xb40000bb, +0x011f2083,0x81150002,0x00000000,0x81670004, +0xb0080002,0xb46000b5,0x011f2084,0x013f0081, +0xb0090002,0xb4200011,0x013f0083,0xb0080000, +0xb4200002,0x81077844,0xb5000005,0xb0080001, +0xb4200002,0x81077884,0xb5000001,0x81077824, +0x013f0083,0x5921b809,0x1129b808,0x0119b809, +0x00000000,0x00000000,0x011f6047,0x81150001, +0x00000000,0x011f2085,0x81150001,0x00000000, +0x011f2086,0x81350002,0x00000000,0x013f2087, +0x81150002,0x00000000,0x011f2088,0x81150001, +0x00000000,0x011f2089,0x81150001,0x00000000, +0x011f208a,0x81150002,0x00000000,0x011f208b, +0x81070001,0xb0090003,0xb4000001,0x81070002, +0x011f25b9,0x81070020,0x013f0081,0xb0090002, +0xb4200065,0x85290001,0xad29000f,0x00000000, +0x011f0083,0x1108b809,0x5901b808,0x910877c8, +0x0139b808,0x011f05b9,0x85080001,0x6928b809, +0x011f0084,0xb0090038,0xb4800007,0xb0080001, +0xb4000002,0xb0090050,0xb4400003,0x81270000, +0x8107001b,0xb5000010,0xb0080001,0xb4000005, +0xb0090060,0xb4800003,0x81270001,0x8107001e, +0xb5000009,0xb0080002,0xb4000005,0xb0090030, +0xb4400003,0x81270002,0x81070008,0xb5000002, +0x81270003,0x8107000c,0x011f25bb,0x013f25c0, +0xb0090002,0xb460001b,0x80477604,0x5c42b802, +0x814fffc0,0x80cf0037,0x005fb178,0x5842b802, +0x01cfb802,0x005f9178,0xb520ffff,0x90420020, +0x814fb580,0x80cf0057,0x005fb178,0x5842b802, +0x01cfb802,0x005f9178,0xb520ffff,0x804778a4, +0x5c42b802,0x814f39c0,0x80cf002f,0x005fb178, +0x5842b802,0x01cfb802,0x005f9178,0xb520ffff, +0xb5000021,0x804776e0,0x5c42b802,0x814fef40, +0x80cf0037,0x005fb178,0x5842b802,0x01cfb802, +0x005f9178,0xb520ffff,0x8297013c,0x8317018c, +0xb6000602,0x005f8034,0x031fa022,0x82970124, +0x83170160,0xb6000602,0x005f8034,0x031fa022, +0x8297010c,0x83170134,0xb6000602,0x005f8034, +0x031fa022,0x804778c4,0x5c42b802,0x814f1080, +0x80cf002f,0x005fb178,0x5842b802,0x01cfb802, +0x005f9178,0xb520ffff,0x013f0081,0xb0090001, +0xb420000e,0x808f0000,0x806f001b,0x80af001b, +0x80277758,0x5c22b801,0x80670037,0x00cfb803, +0x003fb178,0x5822b801,0x01cfb801,0x003f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x011f25bb, +0x011f0087,0xb0080001,0xb4000002,0x011f05bb, +0xb5000003,0x011f0088,0x91080001,0x5902b808, +0x011f25ba,0x81470000,0x00ffb81a,0x81470008, +0x00ffb81a,0x81270000,0x81470000,0x300842de, +0xb400000b,0x013f42e2,0x91290001,0x013f62e2, +0x013f42e3,0x91290001,0x013f62e3,0x83640006, +0x00000000,0x00000000,0x013f42e2,0x81470002, +0x013f62e2,0x00ffb81a,0x00ffb81b,0x83640041, +0x80c70004,0x80270000,0xb600200d,0x00ff05b9, +0x5c42b801,0x300205ba,0xb4800001,0x80e70001, +0x80470000,0xb6270005,0x1062b801,0x914301b8, +0x00fff00a,0x83840050,0x90420080,0x90210004, +0x00ffb81a,0x8364002f,0x017f05bb,0x800700bc, +0x80270000,0xb00b0000,0xb4000015,0xb62b0014, +0x00ff05b9,0x5c42b801,0x300205ba,0xb4800001, +0x80e70001,0x80470000,0xb0070000,0xb400000b, +0xb627000a,0x1062b801,0x914301b8,0x00fff00a, +0x5c62b801,0x1063b800,0x00bff003,0x90650134, +0x00dff003,0x83840034,0x90420080,0x90210004, +0x019f05b9,0x80c70002,0x80270000,0xb00b0000, +0xb400000f,0xb62b000e,0x80470000,0xb00c0000, +0xb400000a,0xb62c0009,0x1062b801,0x914301b8, +0x00fff00a,0xb0070000,0xb4000003,0x906302b8, +0x00fff003,0x83840020,0x90420080,0x90210004, +0x00ffb81a,0x8107ffff,0x80c70004,0x00ff0083, +0x83840019,0x80c70002,0x00ff0084,0x83840016, +0x80c70001,0x00ff0085,0x83840013,0x80c70001, +0x00ff0086,0x83840010,0x80c70002,0x00ff0087, +0x8384000d,0x80c70002,0x00ff0088,0x8384000a, +0x80c70001,0x00ff0089,0x83840007,0x80c70001, +0x00ff008a,0x83840004,0x80c70002,0x00ff008b, +0x83840001,0x00ffb81b,0x80a70001,0x64a6b805, +0x5ca1b805,0xb0050000,0xb400000e,0x95288000, +0xb0090000,0xb4000001,0x81270001,0x5901b808, +0x1547b805,0xb00a0000,0xb4000001,0x81470001, +0x2129b80a,0xb0090000,0xb4000001,0xa1088005, +0xb500ffef,0x9508ffff,0x00ffb81c,0x015f05ba, +0x013f05b9,0x800700bc,0xb0090000,0xb400000f, +0xb00a0000,0xb400000d,0x80270000,0xb62a000b, +0x80470000,0xb6290008,0x80950004,0x5865b802, +0x1063b801,0x5862b803,0x906301b8,0x0217b803, +0x90420001,0x021fa004,0x90210001,0xa54a0020, +0xb4c0000e,0xb0090000,0xb400000c,0xb62a000b, +0x80950004,0x80470000,0xb6290007,0x5865b802, +0x1063b801,0x5862b803,0x906301b8,0x0217b803, +0x90420001,0x021fa004,0x90210001,0x00ffb81a, +0x013f05b9,0xb0090000,0xb4000019,0x80270000, +0xb6002017,0x80470000,0xb6290014,0x5865b802, +0x1063b801,0x5862b803,0x914301b8,0x009ff00a, +0xad420060,0x00000000,0x114ab801,0x5942b80a, +0x914a1c80,0x0217b80a,0xb0040000,0xb4000004, +0x80950006,0x00000000,0x021fa004,0xb5000002, +0x8087003f,0x021fa004,0x90420001,0x90210001, +0x00ffb81a,0x8257ffff,0x82d7ffff,0x011f05ba, +0x013f05b9,0x80270000,0xb0090000,0xb400002b, +0xb6280015,0x80470000,0xb6290012,0x5865b802, +0x1063b801,0x5862b803,0x914301b8,0xaca20060, +0x009ff00a,0x10a5b801,0x58a2b805,0x90a502b8, +0x0217b805,0x80670000,0xb0040000,0xb4000003, +0x90840001,0x0075b804,0x00000000,0x021fa003, +0x90420001,0x90210001,0xa5480020,0xb4000013, +0x5822b801,0xb62a0011,0x914101b8,0x90a102b8, +0x0217b805,0x009ff00a,0xb0040000,0x80670000, +0xb4000002,0x90840001,0x0075b804,0xb6290006, +0x021fa203,0x009f8210,0x009f8210,0x009f8210, +0x009f8210,0x009f8210,0x90210004,0x00ffb81a, +0x015f05ba,0x013f05b9,0x800700bc,0xb0090000, +0xb4000013,0xb00a0000,0xb4000011,0x80270000, +0xb62a000f,0x80470000,0xb629000c,0x1080b801, +0x007ff004,0x90830134,0x007ff004,0x0095b803, +0x5865b802,0x1063b801,0x5862b803,0x906301b8, +0x0217b803,0x90420001,0x021fa004,0x90210001, +0x011f05bb,0x254ab808,0xb4c0000d,0xb62a000c, +0x1080b801,0x007ff004,0x90830134,0x007ff004, +0x0095b803,0x5862b801,0x906301b8,0x0217b803, +0x90210001,0x021fa204,0x007f8210,0x021fa004, +0xa5480020,0xb4c0000e,0xb0090000,0xb400000c, +0x80870000,0xb62a000a,0x80470000,0xb6290007, +0x5865b802,0x1063b801,0x5862b803,0x906301b8, +0x0217b803,0x90420001,0x021fa004,0x90210001, +0x00000000,0x00000000,0x00ffb81a,0x011f05bb, +0x013f05b9,0xb0080000,0xb4000015,0xb0090000, +0xb4000013,0x00000000,0x80270000,0xb6280010, +0x80470000,0xb629000d,0x5865b802,0x1063b801, +0x5862b803,0x914301b8,0x009ff00a,0xb0040000, +0xb4000005,0x80950002,0x906302b8,0x0217b803, +0x00000000,0x021fa004,0x90420001,0x90210001, +0xa5480020,0xb00a0000,0xb4000010,0xb0090000, +0xb400000e,0x00000000,0x80870000,0xb62a000b, +0x80470000,0xb6290008,0x5865b802,0x1063b801, +0x5862b803,0x906302b8,0x0217b803,0x00000000, +0x021fa004,0x90420001,0x90210001,0xb0080000, +0xb400004c,0xb0090000,0xb400004a,0x00000000, +0x80270000,0xb6280047,0x80470000,0xb6290044, +0x5865b802,0x1063b801,0x5862b803,0x914301b8, +0x009ff00a,0xad420060,0x00000000,0x00000000, +0x00000000,0x114ab801,0x5942b80a,0x914a1c80, +0x0217b80a,0xb0040000,0xb400002e,0x906302b8, +0x009ff003,0xb0040000,0xb420000a,0x80950006, +0x00000000,0x021fa204,0x80950006,0x015f8210, +0x021fa204,0x80950006,0x015f8210,0x021fa004, +0xb5000026,0xb0040001,0xb4200009,0x80950006, +0x00000000,0x021fa204,0x015f8210,0x021fa204, +0x80950006,0x015f8210,0x021fa004,0xb500001b, +0xb0040003,0xb4200009,0x80950006,0x00000000, +0x021fa204,0x80950006,0x015f8210,0x021fa204, +0x015f8210,0x021fa004,0xb5000010,0xb0040002, +0xb420000e,0x80950006,0x00000000,0x021fa204, +0x015f8210,0x021fa204,0x015f8210,0x021fa004, +0xb5000006,0x8087003f,0x021fa204,0x015f8210, +0x021fa204,0x015f8210,0x021fa004,0x90420001, +0x90210001,0xa5480020,0xb4c00011,0xb0090000, +0xb400000f,0x8087003f,0x5862b801,0x90631afc, +0xb62a000b,0x90630004,0x0047b803,0xb6290008, +0x90420180,0x0217b802,0x00000000,0x021fa204, +0x003f8210,0x021fa204,0x003f8210,0x021fa004, +0x00ffb81a,0x8257ffff,0x82d7ffff,0x011f05bb, +0x013f05b9,0x80270000,0x00e7b809,0x300105ba, +0xb4800001,0x80e70001,0x800700bc,0x80470000, +0xb0070000,0xb400004c,0xb627004b,0x5865b802, +0x1063b801,0x5862b803,0x914301b8,0xaca20060, +0x009ff00a,0x10a5b801,0x58a2b805,0x90a502b8, +0x0217b805,0xb0040000,0xb400002b,0x1060b801, +0x00bff003,0x10a5b804,0x90650160,0x00dff003, +0xb0060003,0xb4200007,0x90650134,0x00dff003, +0xb6000303,0x0075b806,0x021fa203,0x007f8210, +0xb5000021,0x5861b805,0x906300dc,0x009fd803, +0x90650134,0x00dff003,0xaca20060,0x00000000, +0x00000000,0x00000000,0x0075b806,0x10a5b801, +0x58a2b805,0x90a502b8,0x0217b805,0x588fb804, +0xb600030c,0xb6001007,0x04a3b804,0xb4600002, +0x58a1b803,0xb5000002,0x58a1b805,0x90a50001, +0x0067b805,0x9465ffff,0x5d50b805,0x021fa20a, +0x015f8210,0xb5000004,0x81470000,0xb6000302, +0x021fa20a,0x009f8210,0x009f05b9,0xb0040002, +0xb420000c,0x300105ba,0xb480000a,0x58a2b801, +0x90a502b8,0x0217b805,0x90a50180,0x0297b805, +0xb6000304,0x00bf8210,0x009f8210,0x029fa205, +0x009f8214,0x90420001,0x90210001,0x3001b808, +0xb480ffa9,0xa5480020,0xb00a0000,0xb4000015, +0xb0090000,0xb4000013,0x58a2b801,0x90a502b8, +0xb62a0010,0x80470000,0xb629000d,0xaca20060, +0x00000000,0x00000000,0x00000000,0x80670000, +0x10a5b801,0x58a2b805,0x90a502b8,0x0217b805, +0xb6000302,0x021fa203,0x00bf8210,0x90420001, +0x90210001,0x00ffb81a,0x00000000,0x00000000, +0x80770000,0x8057ffff,0x80f70000,0x80d7ffff, +0x81770000,0x8157ffff,0x81f70000,0x81d7ffff, +0xac140060,0xac350020,0x00000000,0x00000000, +0x12c0b801,0x5ac2b816,0x92d61980,0x83a400a5, +0xad940400,0x009f9173,0x013f05ca,0x914c6604, +0x114ab804,0x001f97e0,0x001eb80a,0xb0090000, +0xb4000003,0x80a76e44,0x80c76644,0xb5000002, +0x80a76644,0x80c76e44,0x808f000f,0x806f0000, +0x80af000e,0x80cf07e1,0x11e5b80c,0x11efb804, +0x5de2b80f,0x01ffb178,0x59e2b80f,0x01afb80f, +0x01ff9178,0x0047b86f,0xb0020001,0xb4c0fffd, +0x80cf07f0,0x1206b80c,0x1210b804,0x5e02b810, +0x021fb178,0x5a02b810,0x01afb810,0x021f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x916c6e04, +0x116bb804,0x001f97ff,0x001eb80b,0x808f0000, +0x806f001f,0x80af001f,0x90ac6604,0x5ca2b805, +0x80270400,0xb600080a,0x00cfb801,0x00bfb178, +0x58a2b805,0x01cfb805,0x00bf9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x90210020,0x90a50020, +0x90ac6e04,0x5ca2b805,0x80270500,0xb600080a, +0x00cfb801,0x00bfb178,0x58a2b805,0x01cfb805, +0x00bf9178,0x0047b86f,0xb0020001,0xb4c0fffd, +0x90210020,0x90a50020,0x81530020,0xac140060, +0xac350020,0x80170800,0x80d7003c,0x12c0b801, +0x5ac2b816,0x92d602b8,0x0117b816,0x90241000, +0x0097b801,0x80470000,0x4002b803,0xb6000804, +0x005f8020,0x480287e4,0x005f8020,0x500287e4, +0x00000000,0x00000000,0x00000000,0x1021b80a, +0x5c36b801,0x5801b800,0x18c0b801,0xb0090000, +0xb4000002,0x90641440,0xb5000001,0x90641040, +0xb6000f0d,0x0097b803,0x80470000,0x4002b803, +0xb6001002,0x005f8020,0x480287e4,0x0108a026, +0x90630040,0x00000000,0x1021b80a,0x5c36b801, +0x5801b800,0x18c0b801,0x90641400,0x0097b803, +0x80470000,0x4002b803,0x005f8020,0x005f87e4, +0xb6000802,0x005f8040,0x480287c4,0x005f87e0, +0x0108a026,0x00000000,0x1021b80a,0x5c36b801, +0x5801b800,0x18c0b801,0xb0090000,0xb4000002, +0x906417c0,0xb5000001,0x906413c0,0xb6000f0f, +0x0097b803,0x80470000,0x4002b803,0xb6000804, +0x005f8020,0x500287e4,0x005f8020,0x480287e4, +0x0108a026,0x84630040,0x00000000,0x1021b80a, +0x5c36b801,0x5801b800,0x18c0b801,0xb0140000, +0xb4200005,0x90840004,0x9484003f,0x009fb173, +0xa1290001,0x013f25ca,0x80d7ffff,0x0108a026, +0x00ffb81a,0x81330004,0x8093007f,0x9884ffff, +0x80b3ff80,0x0017b816,0x90360040,0x0097b801, +0x81530010,0xb6001004,0x400a8000,0x404a8004, +0x0008a020,0x0088a022,0x0017b816,0x9036007c, +0x0097b801,0x81171000,0xb6001004,0x40048020, +0x480487e4,0x00000000,0x0108a020,0x81470000, +0x81670001,0x81870008,0x81a70040,0x81c707c4, +0x81e70040,0xb6000432,0xb00a0001,0xb4e00004, +0x80c71000,0x80e71000,0x81171040,0xb5000003, +0x80c71040,0x80e71040,0x81171000,0x844d0004, +0x10e7b802,0xb62b001f,0x0017b806,0x0097b807, +0xb62c0004,0x40048020,0x480487e4,0x00000000, +0x0108a020,0x0017b806,0x0097b807,0x0197b80e, +0x00000000,0x001f8020,0x042087e4,0xb62c000f, +0x4041800c,0x001f8020,0x0048b802,0x5e38802c, +0x2e11b801,0x042087e4,0x1042b810,0x0462b804, +0xb4a00002,0x0047b804,0xb5000003,0x0462b805, +0xb4600001,0x0047b805,0x011fa022,0x10c6b80f, +0x10e7b80f,0x5961b80b,0x5d81b80c,0x5da1b80d, +0x5de1b80f,0x914a0001,0x954a0001,0x11ceb80f, +0x80171018,0x81171fcc,0x80470000,0x41448020, +0x494487c0,0x00000000,0x0188b80a,0x494487e0, +0x00000000,0x0148b80a,0x0502a10a,0x4145b80c, +0x494580e0,0x00000000,0x0108a5ea,0x41448080, +0x494487c0,0x00000000,0x0108a78a,0x49448020, +0x00000000,0x0108a2ea,0x41448020,0x49448720, +0x00000000,0x0188b80a,0x4145b80c,0x49458080, +0x494587a0,0x00000000,0x0108a68a,0x4145b80c, +0x49458080,0x494587a0,0x00000000,0x0108a08a, +0x4145b80c,0x49458020,0x49458040,0x00000000, +0x0188b80a,0x494587e0,0x00000000,0x0108a08a, +0x4144b80c,0x494587a0,0x00000000,0x0108a52a, +0x41448080,0x49448040,0x494486c0,0x00000000, +0x0108a04a,0x41448040,0x49448720,0x00000000, +0x0108a36a,0x04028020,0x011fa420,0x001f8040, +0x011fa100,0x001f8080,0x011fa080,0x001f8100, +0x011fa040,0x001f8660,0x011fa120,0x41458020, +0x49458000,0x00000000,0x0108a00a,0x0017b816, +0x9036007c,0x0097b801,0x81171000,0x81970784, +0x00000000,0x001f8020,0x042087e4,0xb600100f, +0x4041800c,0x001f8020,0x0048b802,0x5e38802c, +0x2e11b801,0x042087e4,0x1042b810,0x0462b804, +0xb4a00002,0x0047b804,0xb5000003,0x0462b805, +0xb4600001,0x0047b805,0x011fa022,0x81470000, +0x81670001,0x81870008,0x81a70040,0x81c707c4, +0x81e70040,0xb6000432,0xb00a0001,0xb4e00004, +0x80c71000,0x80e71000,0x81171040,0xb5000003, +0x80c71040,0x80e71040,0x81171000,0x844d0004, +0x10e7b802,0xb62b001f,0x0017b806,0x0097b807, +0xb62c0004,0x40048020,0x480487e4,0x00000000, +0x0108a020,0x0017b806,0x0097b807,0x0197b80e, +0x00000000,0x001f8020,0x042087e4,0xb62c000f, +0x4041800c,0x001f8020,0x0048b802,0x5e38802c, +0x2e11b801,0x042087e4,0x1042b810,0x0462b804, +0xb4a00002,0x0047b804,0xb5000003,0x0462b805, +0xb4600001,0x0047b805,0x011fa022,0x10c6b80f, +0x10e7b80f,0x5961b80b,0x5d81b80c,0x5da1b80d, +0x5de1b80f,0x914a0001,0x954a0001,0x11ceb80f, +0x80171034,0x81171f84,0x80470000,0x41448040, +0x49448640,0x00000000,0x0188b80a,0x49448100, +0x49448780,0x00000000,0x0108a08a,0x4144b80c, +0x49448040,0x49448080,0x494487c0,0x00000000, +0x0108a16a,0x4145b80c,0x49458700,0x00000000, +0x0188b80a,0x494581a0,0x494586e0,0x00000000, +0x0108a66a,0x4145b80c,0x49448040,0x494487e0, +0x00000000,0x0188b80a,0x011fa1ec,0x4145b80c, +0x49458100,0x49458780,0x00000000,0x0108a08a, +0x41458720,0x49458100,0x494586e0,0x49458160, +0x49458020,0x49458020,0x49458760,0x00000000, +0x0108a08a,0x414587a0,0x49458080,0x49458760, +0x494580c0,0x49458700,0x49458140,0x49458020, +0x49458760,0x00000000,0x0108a74a,0x414587a0, +0x49458080,0x49458760,0x494580e0,0x49458700, +0x49458120,0x49458020,0x49458760,0x00000000, +0x0108a08a,0x41458720,0x49458100,0x494586e0, +0x49458140,0x49458040,0x49458020,0x49458720, +0x00000000,0x0108a0ca,0x41458080,0x49458040, +0x49458020,0x49458620,0x00000000,0x0188b80a, +0x49458080,0x00000000,0x0108a7ca,0x4144b80c, +0x49458040,0x49458020,0x49458080,0x00000000, +0x0108a5ea,0x41448080,0x49448700,0x00000000, +0x0188b80a,0x49448780,0x00000000,0x0108a7ca, +0x4144b80c,0x49448140,0x00000000,0x0108a7ca, +0x49448040,0x00000000,0x0108a0ca,0x41448700, +0x00000000,0x0188b80a,0x49448000,0x00000000, +0x0108a04a,0x011fa00c,0x80171f80,0xb6002006, +0x40048000,0x48048000,0x48048000,0x48048000, +0x00000000,0x0008a020,0x00ffb81d,0x00000000, +0x80770000,0x8057ffff,0x015f05b9,0x017f05bb, +0x8293ffff,0x9a94ffff,0x81a70000,0xb62a003a, +0xaded0180,0xae0d0180,0xadcd0080,0x902f1980, +0x0017b801,0xb6002033,0x904e01b8,0x00000000, +0x013ff002,0xb0090000,0xb400001f,0x904f02b8, +0x80c70000,0x011fd802,0x6829b808,0x94210001, +0xb0010001,0xb4e00001,0x00c7b814,0x6429b806, +0x80470001,0x6449b802,0x84420001,0x1442b808, +0x84690001,0x5863b803,0x906300dc,0x1042b801, +0x003f9803,0x90420001,0x4082b801,0x90630004, +0x003f9803,0x00000000,0x5897b804,0x1804b805, +0x4082b801,0x00000000,0x00000000,0x00000000, +0x10a4b800,0xb5000001,0x80a70000,0x90501c80, +0x00000000,0x007ff002,0x5842b803,0x904205f8, +0x0097b802,0x00000000,0x40058004,0x48058004, +0x00000000,0x0008a020,0x91ce0004,0x91ef0004, +0x92100004,0x91ad0001,0x00ffb81a,0x80770000, +0x8057ffff,0x80d7ffff,0x015f05b9,0x017f05bb, +0x8293ff80,0x9a940000,0x82a70020,0x81a70000, +0x81e702b8,0x80171980,0xb62a004f,0xb600034d, +0xac0d0080,0xac4d0180,0xac960080,0x822700bc, +0x91c001b8,0x00000000,0x1042b804,0x92021c80, +0xb62b003a,0x013ff00e,0x00fff011,0xb0090000, +0xb4000027,0x10e7b809,0x5821b807,0x902100dc, +0x00000000,0x001fd801,0x82470000,0x80270001, +0x6452b801,0x3002b800,0xb4600002,0x92520001, +0xb500fffb,0x86520001,0x80c70000,0x011fd80f, +0x6832b808,0xb0010001,0xb4e00001,0x00c7b814, +0x84520017,0x0056b802,0x80270001,0x6432b801, +0x84210001,0x1408b801,0x6402b800,0x10c6b800, +0x9027018c,0x00000000,0x001ff001,0x5802b800, +0x9020073c,0x904006f8,0x007f9801,0x0097b802, +0x10c6b803,0x40868004,0x48868004,0xb5000003, +0x80c70000,0x40868004,0x00000000,0x0088b804, +0x003ff010,0x5822b801,0x902105f8,0x0097b801, +0x91ce0004,0x91ef0004,0x40448004,0x48448004, +0x92100004,0x0008a022,0x92310001,0x0435b80b, +0xb4000007,0x80870000,0xb6210005,0x001fa024, +0x91ce0004,0x91ef0004,0x92100004,0x92310001, +0x00000000,0x91ad0001,0x00ffb81a,0x00000000, +0x007f05b9,0x001f0081,0xb0000001,0xb4400029, +0x001f05d8,0xac400080,0x801702b8,0x80970438, +0x90421800,0x0117b802,0x8087ffff,0x80b3ffff, +0x80d3007f,0x98c6ff00,0x80f3ff80,0x81070080, +0xb6002018,0x10088020,0x0056b800,0x0442b806, +0xb4a00004,0xb0000000,0x0007b806,0xb4400001, +0x0007b807,0x0027b800,0x5c08b800,0x1400b804, +0xb0030001,0xb4000008,0x10288024,0x0056b801, +0x0442b806,0xb4a00004,0xb0010000,0x0027b806, +0xb4400001,0x0027b807,0x5828b801,0x1421b805, +0x1900a021,0x001f05d8,0x90000001,0x001f25d8, +0x00ffb81a,0x801702b8,0x80970438,0x81171800, +0x8087ffff,0x80b3ffff,0x80d3007f,0x98c6ff00, +0x80f3ff80,0x81070080,0xb6006018,0x10088020, +0x0056b800,0x0442b806,0xb4a00004,0xb0000000, +0x0007b806,0xb4400001,0x0007b807,0x0027b800, +0x5c08b800,0x1400b804,0xb0030001,0xb4000008, +0x10288024,0x0056b801,0x0442b806,0xb4a00004, +0xb0010000,0x0027b806,0xb4400001,0x0027b807, +0x5828b801,0x1421b805,0x1900a021,0x00ffb81a, +0x001f0081,0xb0000001,0xb4400006,0x001f05d8, +0xb0000003,0xb4000003,0x80270001,0x003f25dc, +0x00ffb81a,0x003f05d9,0x009f05cb,0xb0010000, +0xb400000e,0x015f42ed,0x81070000,0x8127017c, +0xb00a0000,0xb4000002,0x81070180,0x812702fc, +0x802500a5,0x9421ffff,0x3001b808,0xb4800011, +0x3001b809,0xb4a00079,0xb500000e,0x001f0081, +0xb0000001,0xb4400003,0xb0040002,0xb4200006, +0xb5000002,0xb0040000,0xb4200003,0x802702ff, +0x81470000,0xb5000003,0x80270001,0x003f25d9, +0x81470180,0xb0040000,0xb4200001,0x83840344, +0x80070000,0x001f25d8,0x009f902d,0x80af001f, +0x808f0000,0x806f0000,0x8007ffff,0x8033ffff, +0x80171800,0x807bff8c,0x94630003,0xb0030003, +0xb4000016,0xb0030002,0xb4000035,0xb0030001, +0xb4000024,0xb6006010,0x14618000,0x6068b803, +0x40c4b803,0x14608000,0x00c8b806,0x5870b803, +0x6068b803,0x4104b803,0x58c8b806,0x0108b808, +0x14c6b801,0x00000000,0x00000000,0x5d08b808, +0x1508b800,0x1806a028,0xb5000030,0xb6006010, +0x14618000,0x6068b803,0x40c4b803,0x14608000, +0x00c8b806,0x5870b803,0x6068b803,0x4104b803, +0x5cc8b806,0x0108b808,0x14c6b800,0x00000000, +0x00000000,0x5908b808,0x1508b801,0x1806a028, +0xb500001e,0xb600600d,0x14618000,0x6068b803, +0x40c4b803,0x00000000,0x00c8b806,0x00000000, +0x00000000,0x00000000,0x5d08b806,0x1508b800, +0x58c8b806,0x14c6b801,0x1806a028,0xb500000f, +0xb600600e,0x14608000,0x5868b803,0x6068b803, +0x40c4b803,0x00000000,0x00c8b806,0x00000000, +0x00000000,0x00000000,0x5d08b806,0x1508b800, +0x58c8b806,0x14c6b801,0x1806a028,0x80670600, +0x5d22b80a,0xb600030a,0x00cfb803,0x013fb178, +0x5922b809,0x01afb809,0x013f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x90630020,0x91290020, +0x81270180,0xb00a0000,0xb4000001,0x81270000, +0x013f62ed,0x80270001,0x003f25dc,0x00ffb81a, +0x801bff7c,0x00000000,0x94000080,0xb0000080, +0xb400ff67,0x001f0081,0xb0000001,0xb4400006, +0x001f05d8,0xb0000003,0xb4000003,0x80270001, +0x003f25dc,0x00ffb81a,0x003f05d9,0x009f05cb, +0xb0010000,0xb400000e,0x015f42ed,0x81070000, +0x812702fc,0xb00a0000,0xb4000002,0x81070300, +0x812705fc,0x802500a5,0x9421ffff,0x3001b808, +0xb4800011,0x3001b809,0xb4a0006d,0xb500000e, +0x001f0081,0xb0000001,0xb4400003,0xb0040002, +0xb4200006,0xb5000002,0xb0040000,0xb4200003, +0x802705ff,0x81470000,0xb5000003,0x80270001, +0x003f25d9,0x81470300,0xb0040000,0xb4200001, +0x838402ab,0x80070000,0x001f25d8,0x009f902d, +0x80af001f,0x808f0000,0x806f0000,0x8007ffff, +0x8033ffff,0x80171800,0x807bff8c,0x80971980, +0x94630003,0xb0030003,0xb4000013,0xb0030002, +0xb400002c,0xb0030001,0xb400001e,0xb600600d, +0x58708000,0x6068b803,0x40c4b803,0x14618020, +0x00c8b806,0x6068b803,0x4104b803,0x00000000, +0x0108b808,0x5887a026,0x00000000,0x00000000, +0x5887a028,0xb5000026,0xb600600d,0x14618000, +0x6068b803,0x40c4b803,0x58708020,0x00c8b806, +0x6068b803,0x4104b803,0x00000000,0x0108b808, +0x5887a026,0x00000000,0x00000000,0x5887a028, +0xb5000017,0xb600600a,0x14618000,0x6068b803, +0x40c4b803,0x00000000,0x00c8b806,0x00000000, +0x00000000,0x00000000,0x5887a026,0x5887a026, +0xb500000b,0xb600600a,0x58708000,0x6068b803, +0x40c4b803,0x00000000,0x00c8b806,0x00000000, +0x00000000,0x00000000,0x5887a026,0x5887a026, +0x80670660,0x5d22b80a,0xb600060a,0x00cfb803, +0x013fb178,0x5922b809,0x01afb809,0x013f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x90630020, +0x91290020,0x81270300,0xb00a0000,0xb4000001, +0x81270000,0x013f62ed,0x80270001,0x003f25dc, +0x00ffb81a,0x00000000,0x00000000,0x00000000, +0x029fb024,0x02bfb025,0x02dfb026,0x02ffb027, +0x031fb028,0x033fb029,0x033f4046,0x0287b86f, +0x029fb02a,0x8285009d,0x9a940008,0x8286009d, +0x8285009c,0x96b48000,0xb0158000,0xb40001b5, +0x96b40100,0xb0150100,0xb400020b,0x96b40400, +0xb0150400,0xb400020c,0x96b40001,0xb0150001, +0xb400000c,0x96b40008,0xb0150008,0xb40001ad, +0x96b44000,0xb0154000,0xb400020b,0x96b40002, +0xb0150002,0xb4000182,0x00000000,0x00000000, +0xb500021d,0x02bf917e,0x92b50001,0x02bfb17e, +0x82850082,0x96f40001,0xb0170000,0xb4000171, +0x5efdb814,0x96f70001,0xb0170001,0xb420000b, +0x83050069,0x9718003f,0x82e50064,0x12f7b818, +0x86f70109,0x82feff74,0x02e7b86f,0x9af74000, +0x01ffb817,0x96f7bfff,0x01ffb817,0x83050081, +0x82a5009a,0x96b50001,0xb0150001,0xb4200014, +0x82a70000,0x02bfb17e,0x96b41840,0xb0150800, +0xb420000c,0x96b40008,0x5aa9b815,0x96d46000, +0x5ec3b816,0x82f3000f,0x9af7c00f,0x1718b817, +0x1ab5b818,0x1ab5b816,0x9ab50340,0x82a60081, +0xb500014c,0x9b180180,0x83060081,0xb5000149, +0x82a5009a,0x96b50002,0xb0150002,0xb420001b, +0x82a70000,0x02bfb17e,0x96b41800,0xb0151800, +0xb4000013,0x96b40040,0xb0150040,0xb4200004, +0xa3180c00,0x9b180340,0x83060081,0xb5000139, +0x96b40008,0x5aa9b815,0x96d46000,0x5ec3b816, +0x82f3000f,0x9af7c00f,0x1718b817,0x1ab5b818, +0x1ab5b816,0x9ab50340,0x82a60081,0xb500012d, +0x9b180180,0x83060081,0xb500012a,0x82a500c1, +0x96b5000f,0xb015000b,0xb420000e,0x96b40020, +0xb0150020,0xb400000b,0x96b40200,0xb0150200, +0xb4000008,0x82c50086,0x82e50094,0x3016b817, +0xb4400004,0x06f7b816,0xb017ff00,0xb4400001, +0xb5000118,0x96b46000,0xb0156000,0xb4000011, +0x96b41820,0xb0150820,0xb4200004,0x9b391000, +0x82a5009a,0x96b5feff,0x82a6009a,0x96b40040, +0xb0150040,0xb4200001,0x9739efff,0x96b91000, +0xb0151000,0xb4200003,0x82a5009a,0x9ab50100, +0x82a6009a,0x96b40040,0xb0150040,0xb4200019, +0x96b41800,0xb0151800,0xb4200006,0x96b98000, +0xb0158000,0xb4200003,0x9b180180,0x83060081, +0xb50000f8,0x96d80c00,0x82b300ff,0x9ab5f3ff, +0x1718b815,0xb0160c00,0xb4000007,0x82e50098, +0x96f70400,0xb0170400,0xb4200002,0x82c70c00, +0xb5000001,0xa2d60c00,0x1b18b816,0x9b180340, +0xb50000c4,0x96b40220,0xb0150000,0xb4e00021, +0x82a5009d,0x82f3ffff,0x16b5b817,0x82f33800, +0x3015b817,0xb420001b,0x96f98000,0xb0178000, +0xb4000018,0x82a70000,0x02bfb17e,0x82c5009d, +0x96d6ffff,0x82b3c800,0x9ab58001,0x82e500c1, +0x96f7000f,0xb017000b,0xb4000002,0x82b38800, +0x9ab58001,0x1ab5b816,0x82c5009a,0x96d60020, +0xb0160020,0xb4200002,0x82b3c800,0x9ab58001, +0x82a6009d,0x02ff917e,0x00000000,0xb0170040, +0xb4800000,0x5eb5b814,0x96b500f0,0x96f46000, +0x5eedb817,0x1ab5b817,0xb0170003,0xb4000004, +0x96b500ef,0x96f70001,0x5ae4b817,0x1ab5b817, +0x96d41800,0xb0161800,0xb400000a,0x96f900ff, +0x96b500ff,0x9739ff00,0x1b39b815,0x02a7b817, +0x96b500f3,0x96d40008,0x5ec1b816,0x1ab5b816, +0xb500000c,0x96f98000,0xb0178000,0xb4200007, +0x5efeb814,0x96f70001,0xb0170001,0xb4000003, +0x9b180180,0x83060081,0xb50000a2,0x96b500f3, +0x9ab50008,0x9739fff3,0x96d40020,0xb0160020, +0xb4200019,0x82c7001f,0x82c600c9,0x9b398000, +0x82c70000,0x02dfb17e,0x96d40010,0x5ac8b816, +0x82f300ff,0x9af7cfff,0x1718b817,0x1b18b816, +0x9b180340,0x82c5009d,0x96d6ffff,0x82f33800, +0x9af78001,0x1af7b816,0x82c5009a,0x96d60020, +0xb0160020,0xb4200002,0x82f3c800,0x9af78001, +0x82e6009d,0xb500005f,0x97397fff,0x96b500ff, +0x5aaab815,0x82f300fc,0x9af703ff,0x1718b817, +0x1b18b815,0x9b180340,0x82c5009a,0x96d60010, +0xb0160010,0xb4200027,0x82c70000,0x02dfb17e, +0x82c50086,0x92d60e10,0x82c60086,0x82c50094, +0x5eefb818,0x96f70003,0xb0170003,0xb4200002, +0x82e70e10,0xb5000001,0x82e70e10,0x12d6b817, +0x82e50081,0x9af70020,0x82e60081,0x82c60094, +0xa2f70020,0x82e60081,0x82f30001,0x16f7b818, +0x5ef0b817,0xb0170001,0xb4000004,0x96f84000, +0x5ee4b817,0x9718f3ff,0x1b18b817,0x82f32800, +0x9af78000,0x82e6009d,0x83060081,0x83070001, +0x8306009f,0x8305009c,0xb0180001,0xb4e0fffb, +0xb50000f5,0x82c5009d,0x82f33800,0x9af78001, +0x3016b817,0xb420000f,0x82b3c800,0x9ab58001, +0x82e500c1,0x96f7000f,0xb017000b,0xb4000002, +0x82b38800,0x9ab58001,0x82c5009a,0x96d60020, +0xb0160020,0xb4200002,0x82b3c800,0x9ab58001, +0x82a6009d,0x82c5009a,0x96d60080,0xb0160080, +0xb4000013,0x02df917e,0x00000000,0xb0160010, +0xb480000f,0x82c500c1,0x96d6000f,0xb016000b, +0xb400000b,0x82c50087,0x96d60080,0x5ac7b816, +0x82c50098,0x96d60800,0x5ac3b816,0x96f84000, +0x3017b816,0xb4200002,0x033f4046,0x9b394000, +0x9739bfff,0x82e50061,0x96f70008,0xb0170008, +0xb4000005,0x5eefb818,0x96f70003,0xb0170003, +0xb4000001,0x9718ffff,0x96b41800,0xb0151800, +0xb4000008,0x5eb9b814,0x96b5000f,0x82c50099, +0x5ed0b816,0x96f6000f,0x5ab0b815,0x82a60099, +0xb5000002,0x5ef9b814,0x96f7000f,0x5aecb817, +0x82c5009a,0x96d60fff,0x1ad6b817,0x82c6009a, +0x96b46000,0xb0156000,0xb4200005,0x5ae2b817, +0x82d30ffc,0x9ad63fff,0x1718b816,0x1b18b817, +0x83060081,0x83070001,0x8306009f,0x8305009c, +0xb0180001,0xb4e0fffb,0x00000000,0xb500009e, +0x82850083,0x96b400ff,0xb015003c,0xb4200019, +0x96b92000,0xb0152000,0xb4000002,0x9b392000, +0xb5000014,0x9739d3ff,0x82870000,0x82860087, +0x82870008,0x82860083,0x829bff78,0x82a7001f, +0xb0140400,0xb4000001,0x82a70010,0x82a600c9, +0x829bff78,0x00000000,0x828600cb,0x8285009d, +0x82b3ffff,0x9ab5fffd,0x1694b815,0x8286009d, +0xb5000000,0x83070002,0x8306009f,0x00000000, +0xb500007d,0x83078000,0x8306009f,0x00000000, +0xb5000079,0x82850094,0x82a50086,0x06b5b814, +0x02b6b815,0xb0151700,0xb440004b,0x8285006c, +0x969400ff,0xb0140024,0xb4000019,0xb0140012, +0xb4000017,0x8285009a,0x5eedb814,0x96f70003, +0xb0170003,0xb4000009,0x82a50083,0x5ea8b815, +0x96b500ff,0xb0150020,0xb4400002,0x82c70bbc, +0xb5000001,0x82c70bb8,0xb5000008,0x82a50083, +0x5ea8b815,0x96b500ff,0xb0150020,0xb4400002, +0x82c71199,0xb5000001,0x82c71197,0xb5000016, +0x8285009a,0x5eedb814,0x96f70003,0xb0170003, +0xb4000009,0x82a50083,0x5ea8b815,0x96b500ff, +0xb0150020,0xb4400002,0x82c70e18,0xb5000001, +0x82c70e04,0xb5000008,0x82a50083,0x5ea8b815, +0x96b500ff,0xb0150020,0xb4400002,0x82c70e18, +0xb5000001,0x82c70e04,0x82e50086,0x12f7b816, +0x02bf917e,0xb0150020,0xb480000b,0x82a5009a, +0x96b56000,0xb0156000,0xb4000007,0x82a50098, +0x96d50a00,0xb0160a00,0xb4000002,0xb0160000, +0xb4200001,0x92f70704,0x82850081,0x9ab40020, +0x82a60081,0x82c50094,0x82e60094,0x82860081, +0x86b70704,0x82a6009b,0x83070008,0x8306009f, +0x00000000,0xb5000024,0x83070100,0x8306009f, +0x00000000,0xb5000020,0x83070000,0x83050081, +0x9b180180,0x83060081,0x83070400,0x8306009f, +0x00000000,0xb5000018,0x82870000,0x82850082, +0x5eb7b814,0x96b500fc,0x96d40006,0x5ec1b816, +0x1ab5b816,0x5aacb815,0x83050081,0x82d3001c, +0x9ad600ff,0x1718b816,0x1b18b815,0x9b180e00, +0x83060081,0x83074000,0x8306009f,0x8305009d, +0x82d3ffff,0x9ad6bfff,0x1718b816,0x8306009d, +0x00000000,0xb5000000,0x029f902a,0x01ffb814, +0x033f6046,0x029f9024,0x02bf9025,0x02df9026, +0x02ff9027,0x031f9028,0x033f9029,0x00ffb81e, +0x02ff917d,0x92f7092f,0x031f0084,0xb0180001, +0xb4200002,0x02ff917d,0x92f70870,0x02ffb17d, +0x02ff917c,0x82bbffdc,0x829bffd8,0x93150004, +0x3014b815,0xb4000017,0x02dbb818,0x029bb815, +0x3017b816,0xb4800013,0x5a81b814,0x029fb17d, +0x82def200,0x82fef204,0x82e50086,0x06f7b814, +0x02f6b817,0x82fef208,0x82860095,0x82870001, +0x829ef220,0x8293001f,0x9294fe00,0x92b50008, +0x3015b814,0xb4800002,0x82b3001f,0x92b5fa00, +0x82beffdc,0x82850086,0x83250094,0x06d4b819, +0x02d6b816,0xb016ffff,0xb4a00009,0x82c50081, +0x9ab60020,0x82a60081,0x82a50086,0x92b50e10, +0x82a60094,0x82c60081,0x86b50704,0x82a6009b, +0x00ffb81c,0x00000000,0x00000000,0x00000000, +0x001f9012,0x001fb200,0x001f004c,0x001f2804, +0x801bfef0,0x8058fef4,0x803bff68,0x8078ff6c, +0x2000b801,0x2042b803,0x001fb204,0x005f2814, +0x82e70001,0x83640048,0x029fb014,0x829efef0, +0x8286000f,0x02bf2054,0x82bcfef4,0x82a6000e, +0x00ffb81a,0x80e70001,0x801336e3,0x9800eb76, +0x001fb200,0x800700ab,0x001f2804,0x801bc3e8, +0x8058c3ec,0x83640024,0x82e70000,0x83640036, +0x029fb3c0,0x029fb200,0x02bf2f04,0x02bf2804, +0x801bc000,0x8058c004,0x8364001b,0x82e70000, +0x8364002d,0x001f93c0,0x3000b814,0xb420000a, +0x001f0f04,0x3000b815,0xb4200007,0x829efef0, +0x82bcfef4,0x029fb012,0x02bf204c,0x82870001, +0x829cfef5,0x00ffb81a,0xb0070000,0xb4000007, +0x80e70000,0x801399fa,0x9800c92e,0x001fb200, +0x800700af,0x001f2804,0xb500ffdc,0x82870000, +0x829cfef5,0x00ffb81a,0x80c700ff,0x803bff68, +0x8078ff6c,0x14a0b806,0x2063b805,0x007f2814, +0x2021b802,0x58c8b806,0x14a0b806,0x58b0b805, +0x2021b805,0x58c8b806,0x14a0b806,0x2021b805, +0x58c8b806,0x14a0b806,0x5cb0b805,0x2021b805, +0x003fb204,0x00ffb81b,0x82c70000,0x83070800, +0x83270005,0x8197080c,0x81d7ffff,0x83840126, +0x83840001,0x00ffb81b,0x808f0000,0x806f001f, +0x80af001f,0x80270240,0x81e77c08,0x5de2b80f, +0xb6000208,0x00cfb801,0x01ffb178,0x59e2b80f, +0x01cfb80f,0x01ff9178,0xb520ffff,0x91ef0020, +0x90210020,0x80270280,0x81e77b00,0x5de2b80f, +0xb6000208,0x00cfb801,0x01ffb178,0x59e2b80f, +0x01cfb80f,0x01ff9178,0xb520ffff,0x91ef0020, +0x90210020,0x8057ffff,0x80170830,0x80070810, +0x80270808,0xb6000509,0x005ff000,0x90420900, +0x007ff001,0x90630a00,0x009ff002,0x00bff003, +0x2004a025,0x90000001,0x90210001,0x80070814, +0x80d7ffff,0x8097085c,0x8017083c,0xb6000404, +0x005ff000,0x007f87e0,0x84000001,0x2082a7e3, +0x80970860,0x80170840,0x2082b803,0x007f8000, +0x2083a004,0x80170830,0x80970850,0x80270808, +0xb6000508,0x005f8024,0x90420900,0x007ff001, +0x90630a00,0x009ff002,0x00bff003,0x2004a025, +0x90210001,0x80170840,0x00000000,0x02bf87e0, +0x80970860,0x82870000,0xb6000404,0x005f87e4, +0x5a88b814,0x204287e0,0x1a94b802,0x00ffb81c, +0x001f0e49,0x001f2b09,0x001f0e41,0x001f2b08, +0x001f0e46,0x001f2b07,0x001f0e48,0x001f2b06, +0x001f0e42,0x001f2b05,0x001f0e47,0x001f2b04, +0x001f0e45,0x001f2b03,0x001f0e43,0x001f2b02, +0x001f0e40,0x001f2b01,0x001f0e44,0x001f2b00, +0x001f0f25,0xa020000c,0x94400001,0x94600002, +0x94810004,0x94a10008,0x94c00010,0x5943b802, +0x5861b803,0x5882b804,0x5ca2b805,0x5cc4b806, +0x194ab803,0x194ab804,0x194ab805,0x194ab806, +0x015f2b38,0x801b7c00,0x003f92c1,0x5c28b801, +0x005f92c2,0x5858b802,0x1821b802,0x2000b801, +0x001fb2c4,0x80187c04,0x003f0b09,0x2000b801, +0x001f2b14,0x82c70001,0x82e70001,0x83070b10, +0x8327001e,0x81970b35,0x8384009f,0x02df0b38, +0x82170e30,0x838400f1,0x819efef0,0x817cfef4, +0x819eff68,0x817cff6c,0x00ffb81b,0x820f001f, +0x8018fef8,0x8057ffff,0x001f2b09,0x8018fef6, +0x80d7ffff,0x001f2b08,0x8018fefa,0x8157ffff, +0x001f2b07,0x8018fefd,0x81d7ffff,0x001f2b06, +0x8018fefb,0x802f001f,0x001f2b05,0x8018fefe, +0x00000000,0x001f2b04,0x8018fef9,0x00000000, +0x001f2b03,0x8018feff,0x00000000,0x001f2b02, +0x8018fef7,0x00000000,0x001f2b01,0x8018fefc, +0x00000000,0x001f2b00,0x001f0f25,0xa0200011, +0x94410001,0x94600002,0x94800004,0x94a00008, +0x94c10010,0x5941b802,0x5861b803,0x5c82b804, +0x58a1b805,0x5cc1b806,0x194ab803,0x194ab804, +0x194ab805,0x194ab806,0x015f2b38,0x801b7c00, +0x003f92c1,0x5c28b801,0x005f92c2,0x5858b802, +0x1821b802,0x2000b801,0x001fb2c4,0x80187c04, +0x003f0b09,0x2000b801,0x001f2b14,0x82c70001, +0x82e70001,0x83070b10,0x8327001e,0x81970b35, +0x83840055,0x02df0b38,0x82170e20,0x838400a7, +0x819efef0,0x817cfef4,0x5ac8b80c,0x02ff0e44, +0x1ad6b817,0x02dfb391,0x5ed8b80c,0x5968b80b, +0x1ad6b80b,0x02df6724,0x00ffb81b,0x820f001f, +0x8018fefe,0x8057ffff,0x001f2b09,0x8018fefa, +0x80d7ffff,0x001f2b08,0x8018fefc,0x8157ffff, +0x001f2b07,0x8018feff,0x81d7ffff,0x001f2b06, +0x8018fef8,0x802f001f,0x001f2b05,0x8018fefb, +0x00000000,0x001f2b04,0x8018fefd,0x00000000, +0x001f2b03,0x8018fef6,0x00000000,0x001f2b02, +0x8018fef9,0x00000000,0x001f2b01,0x8018fef7, +0x00000000,0x001f2b00,0x801b7c00,0x003f92c1, +0x5c28b801,0x005f92c2,0x5858b802,0x1821b802, +0x2000b801,0x001fb2c4,0x80187c04,0x003f0b09, +0x2000b801,0x001f2b14,0x82c70001,0x82e70001, +0x83070b10,0x8327001e,0x81970b35,0x83840016, +0x83270000,0x831bfef0,0x82f8fef4,0x02c7b819, +0x82170e28,0x83840065,0x300cb818,0xb4200002, +0x300bb817,0xb4000006,0x93390001,0xb0190020, +0xb480fff6,0x83270000,0x833cfef5,0x00ffb81b, +0x019fb390,0x017f2e44,0x033f2f25,0x83270001, +0x833cfef5,0x00ffb81b,0x0007b818,0x90000003, +0x00000000,0x015ff000,0x90000001,0x5949b80a, +0x013ff000,0x194ab809,0x84000002,0x994a0100, +0x017ff000,0x958b00f8,0x5981b80c,0x956b0007, +0x198cb80b,0x84000002,0x998c0008,0x017ff000, +0x90000001,0x5971b80b,0x198cb80b,0x017ff000, +0x5969b80b,0x198cb80b,0x81a70000,0x94d90003, +0x82a70000,0xb6260019,0xb6000818,0x5df0b80a, +0x5e02b80a,0x21efb810,0x95ef0001,0x5941b80a, +0x194ab80f,0x21efb816,0x5e18b80c,0x5e35b80c, +0x5e54b80c,0x5e6cb80c,0x2210b811,0x2252b813, +0x2210b812,0x96100001,0x5981b80c,0x198cb810, +0x2210b817,0x10afb810,0x10a5b80d,0x5da1b805, +0x94a50001,0x5aa1b815,0x1ab5b805,0x019fa7f5, +0x5cc2b819,0xb626001c,0x82870000,0xb6000419, +0xb6000818,0x5df0b80a,0x5e02b80a,0x21efb810, +0x95ef0001,0x5941b80a,0x194ab80f,0x21efb816, +0x5e18b80c,0x5e35b80c,0x5e54b80c,0x5e6cb80c, +0x2210b811,0x2252b813,0x2210b812,0x96100001, +0x5981b80c,0x198cb810,0x2210b817,0x10afb810, +0x10a5b80d,0x5da1b805,0x94a50001,0x5a81b814, +0x1a94b805,0x019fa7f4,0x00ffb81c,0x8257ffff, +0x808f0000,0x806f001f,0x80af001f,0x80270300, +0x81e778e0,0x5de2b80f,0xb6000208,0x00cfb801, +0x01ffb178,0x59e2b80f,0x01cfb80f,0x01ff9178, +0xb520ffff,0x91ef0020,0x90210020,0x80270340, +0x81e779e0,0x5de2b80f,0xb6000208,0x00cfb801, +0x01ffb178,0x59e2b80f,0x01cfb80f,0x01ff9178, +0xb520ffff,0x91ef0020,0x90210020,0x80270280, +0x81e77b00,0x5de2b80f,0xb6000208,0x00cfb801, +0x01ffb178,0x59e2b80f,0x01cfb80f,0x01ff9178, +0xb520ffff,0x91ef0020,0x90210020,0x806f0007, +0x80af0007,0x80270380,0x81e77ae0,0x5de2b80f, +0x00cfb801,0x01ffb178,0x59e2b80f,0x01cfb80f, +0x01ff9178,0xb520ffff,0x91ef0020,0x90210020, +0x80170b60,0x001f0b00,0x001fa020,0x001f0b01, +0x001fa020,0x001f0b02,0x001fa020,0x001f0b03, +0x001fa020,0x001f0b04,0x001fa000,0x80970b50, +0x81170b70,0x82a70b35,0x83a40060,0x001f87e4, +0xb6000405,0x86b50001,0x83a4005c,0x001f8004, +0x003f87e8,0x2080a7e1,0x80970b70,0x80170b50, +0x81170b50,0x81970b40,0x82a70b30,0x001f800c, +0x003f8008,0x2100a001,0x83a40050,0x001f87e4, +0xb6000405,0x86b50001,0x83a4004c,0x001f8004, +0x003f87e8,0x2080a7e1,0x80970b50,0x80170b70, +0x81170b70,0x81970b60,0x82a70b2b,0x001f800c, +0x003f8008,0x2100a001,0x83a40040,0x83a4004e, +0xb6000407,0x86b50001,0x83a4003c,0x001f8004, +0x003f87e8,0x2080a001,0x83a40047,0x00000000, +0x80970b70,0x80170b50,0x81170b50,0x81970b40, +0x82a70b26,0x001f800c,0x003f8008,0x2100a001, +0x83a4002e,0x83a4003c,0xb6000407,0x86b50001, +0x83a4002a,0x001f8004,0x003f87e8,0x2080a001, +0x83a40035,0x00000000,0x80970b50,0x80170b70, +0x81170b70,0x81970b60,0x82a70b21,0x001f800c, +0x003f8008,0x2100a001,0x83a4001c,0x001f87e4, +0xb6000405,0x86b50001,0x83a40018,0x001f8004, +0x003f87e8,0x2080a7e1,0x80970b70,0x80170b50, +0x81170b50,0x81970b40,0x82a70b1c,0x001f800c, +0x003f8008,0x2100a001,0x83a4000c,0x017f87e4, +0x81870000,0xb6000406,0x86b50001,0x83a40007, +0x001f87e4,0x200087e8,0x5988b80c,0x198cb800, +0x021fa02c,0x021fa00b,0x00ffb81c,0x005ff015, +0x90420a00,0x003f87e0,0x001ff002,0x2060b801, +0x90630c00,0x90960e00,0x001ff003,0x003ff004, +0x20a0b801,0x90a50d00,0x00000000,0x001ff005, +0x009fa000,0x00ffb81d,0x001f8004,0x5c21b800, +0x5847b800,0x1821b802,0x942100ff,0x2080a7e1, +0x00ffb81d,0x00000000,0x00000000,0x00000000, + +}; + +static u32 MPGI2S240Ucode1f5c00[] = { +0x00000000,0xfffff8c0,0x00003540,0xffff8d40, +0x0001fd40,0xfffaf7c0,0x00066b80,0xffdb63c0, +0x00494780,0x00249c40,0x00066b80,0x00050840, +0x0001fd40,0x000072c0,0x00003540,0x00000740, +0xffffffc0,0xfffff840,0x00003680,0xffff7e40, +0x0001f400,0xfffa9cc0,0x0005d1c0,0xffd99600, +0x00493c00,0x0022ce00,0x0006f780,0x0004ad00, +0x000203c0,0x00006440,0x00003400,0x00000680, +0xffffffc0,0xfffff740,0x00003780,0xffff6ec0, +0x0001e800,0xfffa4240,0x00052a00,0xffd7ca00, +0x00491a00,0x0020ffc0,0x00077600,0x00045240, +0x00020800,0x000056c0,0x00003280,0x00000600, +0xffffffc0,0xfffff680,0x00003840,0xffff5ec0, +0x0001d940,0xfff9e8c0,0x00047440,0xffd60080, +0x0048e180,0x001f32c0,0x0007e700,0x0003f7c0, +0x000209c0,0x00004980,0x00003100,0x00000540, +0xffffffc0,0xfffff5c0,0x000038c0,0xffff4e40, +0x0001c780,0xfff990c0,0x0003b000,0xffd43ac0, +0x00489240,0x001d6800,0x00084b00,0x00039e40, +0x00020940,0x00003d00,0x00002f80,0x000004c0, +0xffffffc0,0xfffff4c0,0x00003900,0xffff3d40, +0x0001b2c0,0xfff93a40,0x0002ddc0,0xffd279c0, +0x00482d00,0x001ba040,0x0008a200,0x000345c0, +0x000206c0,0x00003140,0x00002dc0,0x00000440, +0xffffffc0,0xfffff3c0,0x00003900,0xffff2c00, +0x00019b00,0xfff8e640,0x0001fd40,0xffd0be80, +0x0047b1c0,0x0019dc80,0x0008ecc0,0x0002ef00, +0x00020240,0x00002640,0x00002c00,0x00000400, +0xffffff80,0xfffff2c0,0x000038c0,0xffff1a40, +0x00017fc0,0xfff894c0,0x00010e80,0xffcf09c0, +0x004720c0,0x00181d80,0x00092b40,0x000299c0, +0x0001fc00,0x00001bc0,0x00002a40,0x00000380, +0xffffff80,0xfffff180,0x00003800,0xffff0840, +0x00016180,0xfff84680,0x00001180,0xffcd5cc0, +0x00467a40,0x00166440,0x00095e00,0x00024680, +0x0001f440,0x00001200,0x00002840,0x00000340, +0xffffff80,0xfffff040,0x00003740,0xfffef600, +0x00014000,0xfff7fbc0,0xffff0680,0xffcbb880, +0x0045bf00,0x0014b140,0x00098580,0x0001f580, +0x0001ea80,0x00000900,0x00002680,0x000002c0, +0xffffff80,0xffffef00,0x000035c0,0xfffee3c0, +0x00011ac0,0xfff7b540,0xfffded80,0xffca1d80, +0x0044ef80,0x00130580,0x0009a1c0,0x0001a700, +0x0001dfc0,0x00000080,0x000024c0,0x00000280, +0xffffff40,0xffffedc0,0x00003400,0xfffed180, +0x0000f280,0xfff77340,0xfffcc700,0xffc88d80, +0x00440bc0,0x001161c0,0x0009b3c0,0x00015b00, +0x0001d380,0xfffff8c0,0x000022c0,0x00000240, +0xffffff40,0xffffec40,0x00003200,0xfffebf40, +0x0000c680,0xfff73680,0xfffb92c0,0xffc708c0, +0x00431500,0x000fc6c0,0x0009bb80,0x000111c0, +0x0001c640,0xfffff1c0,0x00002100,0x00000200, +0xffffff00,0xffffeac0,0x00002f40,0xfffead00, +0x00009740,0xfff6ff40,0xfffa5180,0xffc59080, +0x00420b40,0x000e3500,0x0009b9c0,0x0000cb80, +0x0001b7c0,0xffffeb40,0x00001f40,0x000001c0, +0xffffff00,0xffffe940,0x00002c40,0xfffe9b00, +0x00006480,0xfff6ce00,0xfff90380,0xffc425c0, +0x0040ef80,0x000cad00,0x0009af00,0x00008840, +0x0001a880,0xffffe580,0x00001d40,0x000001c0, +0xfffffec0,0xffffe7c0,0x000028c0,0xfffe8980, +0x00002e40,0xfff6a3c0,0xfff7a900,0xffc2c900, +0x003fc280,0x000b2fc0,0x00099b80,0x00004800, +0x00019880,0xffffe040,0x00001bc0,0x00000180, +0xfffffec0,0xffffe600,0x00002480,0xfffe7840, +0xfffff4c0,0xfff68040,0xfff64240,0xffc17b40, +0x003e84c0,0x0009bdc0,0x00097fc0,0x00000b40, +0x000187c0,0xffffdb80,0x00001a00,0x00000140, +0xfffffe80,0xffffe440,0x00001fc0,0xfffe6780, +0xffffb800,0xfff66480,0xfff4d040,0xffc03d80, +0x003d3700,0x00085700,0x00095c40,0xffffd1c0, +0x00017680,0xffffd740,0x00001840,0x00000140, +0xfffffe40,0xffffe2c0,0x00001a80,0xfffe5780, +0xffff77c0,0xfff65100,0xfff35300,0xffbf1080, +0x003bda40,0x0006fc80,0x00093200,0xffff9b80, +0x00016500,0xffffd3c0,0x000016c0,0x00000100, +0xfffffe40,0xffffe0c0,0x000014c0,0xfffe4840, +0xffff3480,0xfff64640,0xfff1cb00,0xffbdf4c0, +0x003a6f80,0x0005ae80,0x000900c0,0xffff68c0, +0x00015300,0xffffd0c0,0x00001540,0x00000100, +0xfffffe00,0xffffdf00,0x00000e40,0xfffe39c0, +0xfffeee40,0xfff64480,0xfff03940,0xffbceb00, +0x0038f740,0x00046d40,0x0008c980,0xffff3980, +0x000140c0,0xffffce00,0x000013c0,0x000000c0, +0xfffffdc0,0xffffdd40,0x00000740,0xfffe2c80, +0xfffea500,0xfff64c40,0xffee9e40,0xffbbf440, +0x00377280,0x00033900,0x00088cc0,0xffff0d80, +0x00012e80,0xffffcc00,0x00001240,0x000000c0, +0xfffffd80,0xffffdb40,0xffffff80,0xfffe2040, +0xfffe5900,0xfff65e40,0xffecfa80,0xffbb1080, +0x0035e280,0x00021280,0x00084ac0,0xfffee540, +0x00011c40,0xffffca40,0x00001100,0x00000080, +0xfffffd40,0xffffd980,0xfffff700,0xfffe1580, +0xfffe0a80,0xfff67a80,0xffeb4ec0,0xffba4100, +0x00344780,0x0000f980,0x00080440,0xfffec000, +0x00010a00,0xffffc8c0,0x00000fc0,0x00000080, +0xfffffcc0,0xffffd7c0,0xffffee00,0xfffe0bc0, +0xfffdb980,0xfff6a200,0xffe99bc0,0xffb985c0, +0x0032a340,0xffffee80,0x0007b980,0xfffe9e80, +0x0000f7c0,0xffffc800,0x00000e80,0x00000080, +0xfffffc80,0xffffd5c0,0xffffe440,0xfffe0400, +0xfffd6640,0xfff6d4c0,0xffe7e280,0xffb8df40, +0x0030f640,0xfffef180,0x00076b40,0xfffe8040, +0x0000e5c0,0xffffc740,0x00000d40,0x00000080, +0xfffffc00,0xffffd400,0xffffd9c0,0xfffdfdc0, +0xfffd1100,0xfff71340,0xffe62380,0xffb84e40, +0x002f4180,0xfffe02c0,0x000719c0,0xfffe6500, +0x0000d400,0xffffc700,0x00000c40,0x00000040, +0xfffffbc0,0xffffd240,0xffffcec0,0xfffdf940, +0xfffcba40,0xfff75e00,0xffe45fc0,0xffb7d300, +0x002d8640,0xfffd2240,0x0006c5c0,0xfffe4d40, +0x0000c2c0,0xffffc700,0x00000b40,0x00000040, +0xfffffb40,0xffffd080,0xffffc300,0xfffdf6c0, +0xfffc61c0,0xfff7b500,0xffe29800,0xffb76dc0, +0x002bc540,0xfffc5000,0x00066f40,0xfffe3880, +0x0000b1c0,0xffffc740,0x00000a40,0x00000040, +0xfffffac0,0xffffcf00,0xffffb680,0xfffdf640, +0xfffc0840,0xfff81900,0xffe0cd40,0xffb71e80, +0x0029ff80,0xfffb8bc0,0x00061740,0xfffe26c0, +0x0000a140,0xffffc7c0,0x00000980,0x00000040, +0xfffffa00,0xffffcd80,0xffffa940,0xfffdf800, +0xfffbadc0,0xfff88a00,0xffdf0040,0xffb6e600, +0x00283600,0xfffad600,0x0005bdc0,0xfffe1800, +0x00009140,0xffffc880,0x000008c0,0x00000040, +0xfffff980,0xffffcc00,0xffff9bc0,0xfffdfc40, +0xfffb5300,0xfff90880,0xffdd3200,0xffb6c400, +0x00266a00,0xfffa2e40,0x00056340,0xfffe0c00, +0x000081c0,0xffffc980,0x000007c0,0x00000040, +0x004013c2,0x0040b346,0x0041fa2d,0x0043f934, +0x0046cc1c,0x004a9d9d,0x004fae37,0x0056601f, +0x005f4cf7,0x006b6fcf,0x007c7d1e,0x0115b035, +0x013df91b,0x0207655e,0x03342c83,0x0a185230, +0x00404f46,0x0042e13c,0x0048919f,0x0052cb0e, +0x0064e240,0x0107c449,0x015c7926,0x050cf270, +0x004140fb,0x004cf8df,0x0073326c,0x02480d9d, +0x004545ea,0x01273d75,0x005a827a,0x007fffff, +0x006597fb,0x0050a28c,0x00400000,0x0032cbfd, +0x00285146,0x00200000,0x001965ff,0x001428a3, +0x00100000,0x000cb2ff,0x000a1451,0x00080000, +0x00065980,0x00050a29,0x00040000,0x00032cc0, +0x00028514,0x00020000,0x00019660,0x0001428a, +0x00010000,0x0000cb30,0x0000a145,0x00008000, +0x00006598,0x000050a3,0x00004000,0x000032cc, +0x00002851,0x00002000,0x00001966,0x00001429, +0x00001000,0x00000cb3,0x00000a14,0x00000800, +0x00000659,0x0000050a,0x00000400,0x0000032d, +0x00000285,0x00000200,0x00000196,0x00000143, +0x00000100,0x000000cb,0x000000a1,0x00000080, +0x00000066,0x00000051,0x00000040,0x00000033, +0x00000028,0x00000020,0x00000019,0x00000014, +0x00000010,0x0000000d,0x0000000a,0x00000008, +0x00000006,0x00000005,0x00000000,0x00555555, +0x00666666,0x00492492,0x0071c71c,0x00444444, +0x00421084,0x00410410,0x00408102,0x00404040, +0x00402010,0x00401004,0x00400801,0x00400400, +0x00400200,0x00400100,0x00400080,0x00400040, +0x00400000,0x00400000,0x00200000,0x00400000, +0x00100000,0x00080000,0x00040000,0x00020000, +0x00010000,0x00008000,0x00004000,0x00002000, +0x00001000,0x00000800,0x00000400,0x00000200, +0x00000100,0x0003588d,0x0002b15e,0x0002056d, +0x00015600,0x0000a329,0xffffeed9,0xffff3960, +0xfffe8423,0xfffdd11c,0xfffd2048,0xfffc7353, +0xfffbcb6f,0xfffb29a6,0xfffa8f15,0x000494ae, +0x0003f991,0x00032dd1,0xfffd2d8f,0x0001eb47, +0xfffe9968,0x00009af6,0x000011de,0xffff4335, +0x00018d69,0xfffdecd4,0x000302f8,0xfffca0d7, +0x0004683d,0xfffb67f8,0x0005b36d,0x00045963, +0xfffbd51e,0x00030062,0xfffd0dee,0x0001d046, +0xfffe8a0a,0x00009258,0x000012b1,0xffff4d9e, +0x00019ec3,0xfffe0a44,0x0003245a,0xfffcd082, +0x000498f0,0xfffba919,0x0005f304,0x00041bf4, +0xfffba72a,0x0002d19e,0xfffcf060,0x0001b407, +0xfffe7c08,0x0000894a,0x0000138d,0xffff58ac, +0x0001afaf,0xfffe28fe,0x000343bf,0xfffd026f, +0x0004c6f6,0xfffbed06,0x00062e61,0x0003dc0e, +0xfffb7bf1,0x0002a17f,0xfffcd522,0x000196a0, +0xfffe6e70,0x00007ff6,0x00001439,0xffff63f6, +0x0001beb3,0xfffe4882,0x0003616d,0xfffd361b, +0x0004f1cf,0xfffc332a,0x0006658f,0x00039943, +0xfffb52c0,0x00026ec7,0xfffcbb94,0x0001789f, +0xfffe6160,0x00007677,0x000014d4,0xffff6f74, +0x0001cc9b,0xfffe694f,0x00037cbf,0xfffd6b41, +0x000519c2,0xfffc7baf,0x00069971,0x00035486, +0xfffb2d0c,0x00023ad8,0xfffca3ee,0x00015989, +0xfffe55af,0x00006ca7,0x00001570,0xffff7b71, +0x0001d9cb,0xfffe8b46,0x0003959e,0xfffda1fe, +0x00053ee6,0xfffcc6b4,0x0006c950,0x00030e08, +0xfffb0a7a,0x0002061e,0xfffc8ec0,0x00013911, +0xfffe4b1d,0x00006278,0x000015e8,0xffff87b6, +0x0001e577,0xfffeadd6,0x0003acc2,0xfffdda34, +0x00056059,0xfffd136d,0x0006f4b5,0x0002c562, +0xfffaea7c,0x0001cfa6,0xfffc7b14,0x0001182b, +0xfffe4159,0x00005817,0x0000165c,0xffff9417, +0x0001f00f,0xfffed14c,0x0003c199,0xfffe13f6, +0x00057e83,0xfffd61cd,0x00071ba1,0x00027ab5, +0xfffacdc3,0x00019833,0xfffc6989,0x0000f6ca, +0xfffe38da,0x00004d9d,0x000016ef,0xffffa103, +0x0001f98f,0xfffef5c0,0x0003d3d1,0xfffe4f00, +0x0005998c,0xfffdb21e,0x00073e77,0x00022e75, +0xfffab482,0x00015fd1,0xfffc5b13,0x0000d45d, +0xfffe318f,0x000042ed,0x0000176b,0xffffae8f, +0x0002018f,0xffff1a91,0x0003e40c,0xfffe8af2, +0x0005b0ca,0xfffe03b8,0x00075d14,0x0001e141, +0xfffa9e9b,0x0001262a,0xfffc4e31,0x0000b1af, +0xfffe2b26,0x00003805,0x000017b1,0xffffbc21, +0x000208b8,0xffff3fb6,0x0003f1d7,0xfffec7af, +0x0005c4c5,0xfffe5654,0x0007768a,0x000192fe, +0xfffa8bb0,0x0000ec3f,0xfffc4365,0x00008ec9, +0xfffe25f0,0x00002d05,0x000017ec,0xffffc984, +0x00020ec6,0xffff658d,0x0003fcba,0xffff0500, +0x0005d576,0xfffeaa37,0x00078bc6,0x00014367, +0xfffa7bec,0x0000b1f4,0xfffc3b82,0x00006b06, +0xfffe2201,0x000021eb,0x00001823,0xffffd704, +0x0002132a,0xffff8be7,0x00040534,0xffff4315, +0x0005e22e,0xfffeff0a,0x00079ce3,0x0000f33f, +0xfffa6fc9,0x000076ca,0xfffc3558,0x00004762, +0xfffe1ef3,0x000016a1,0x0000183f,0xffffe4a6, +0x00021664,0xffffb27d,0x00040b7b,0xffff81e5, +0x0005eb4e,0xffff5475,0x0007a857,0x0000a2cb, +0xfffa671b,0x00003b64,0xfffc31e2,0x00002416, +0xfffe1ce1,0x00000b46,0x00001850,0xfffff24d, +0x00021855,0xffffd93a,0x00040f75,0xffffc0e6, +0x0005f0e3,0xffffaa3e,0x0007af45,0x0000519f, +0xfffa6218,0x0003f991,0x0003588d,0x0002b15e, +0x0002056d,0x00015600,0x0000a329,0xffffeed9, +0xffff3960,0xfffe8423,0xfffdd11c,0xfffd2048, +0xfffc7353,0xfffbcb6f,0xfffb29a6,0xfffa8f15, +0x000494ae,0x0003c6b0,0xfffc7e8b,0x00028ef6, +0xfffde181,0x000144eb,0xffff5500,0xffffefb9, +0x0000d01d,0xfffe9755,0x000249a4,0xfffd453c, +0x0003b80e,0xfffc01aa,0x000511d6,0xfffad527, +0xfffb334e,0x0003916c,0xfffc5778,0x00026a92, +0xfffdc9f5,0x00013314,0xffff4d99,0xfffff0b6, +0x0000d911,0xfffeab80,0x00026369,0xfffd6c0a, +0x0003e17f,0xfffc39d8,0x000549df,0xfffb1eb2, +0xfffafe6c,0x00035929,0xfffc3321,0x000244a6, +0xfffdb402,0x00012035,0xffff46ac,0xfffff192, +0x0000e16a,0xfffebfe0,0x00027b3d,0xfffd9433, +0x0004087b,0xfffc74b7,0x00057e8d,0xfffb6a81, +0xfffacc1c,0x00031fbe,0xfffc10df,0x00021e0c, +0xfffd9f6d,0x00010cb7,0xffff402e,0xfffff279, +0x0000e965,0xfffed574,0x00029159,0xfffdbdc4, +0x00042c4c,0xfffcb1e7,0x0005b02d,0xfffbb942, +0xfffa9d38,0x0002e44a,0xfffbf0fd,0x0001f5b4, +0xfffd8c38,0x0000f8b1,0xffff3a21,0xfffff391, +0x0000f0e6,0xfffeec44,0x0002a642,0xfffde90e, +0x00044e32,0xfffcf0fb,0x0005de46,0xfffc0b18, +0xfffa71d1,0x0002a659,0xfffbd3de,0x0001cb90, +0xfffd7a97,0x0000e403,0xffff3490,0xfffff49c, +0x0000f7a8,0xffff0340,0x0002b95f,0xfffe1573, +0x00046dbe,0xfffd3284,0x00060888,0xfffc5f51, +0xfffa4996,0x00026786,0xfffbb8df,0x0001a0e1, +0xfffd6a4e,0x0000ced2,0xffff2f75,0xfffff593, +0x0000fdbe,0xffff1a53,0x0002ca87,0xfffe42f5, +0x0004898a,0xfffd7563,0x00062f0b,0xfffcb5de, +0xfffa2508,0x00022713,0xfffba0bf,0x0001754a, +0xfffd5b5f,0x0000b92c,0xffff2acd,0xfffff6b0, +0x0001034f,0xffff3241,0x0002da5c,0xfffe71c6, +0x0004a341,0xfffdb946,0x000651e8,0xfffd0e37, +0xfffa0402,0x0001e4d4,0xfffb8b9c,0x00014898, +0xfffd4e7d,0x0000a304,0xffff26b7,0xfffff7e1, +0x00010846,0xffff4b34,0x0002e897,0xfffea13f, +0x0004ba63,0xfffdff2d,0x00067115,0xfffd6839, +0xfff9e680,0x0001a1fa,0xfffb789e,0x00011b2e, +0xfffd43a4,0x00008c6e,0xffff2341,0xfffff8fd, +0x00010c9c,0xffff6469,0x0002f48f,0xfffed1a4, +0x0004cd6a,0xfffe4608,0x00068c1b,0xfffdc409, +0xfff9cd15,0x00015dfe,0xfffb68a0,0x0000ecee, +0xfffd3a2e,0x0000757d,0xffff204b,0xfffffa1e, +0x00011054,0xffff7da1,0x0002fe9c,0xffff033e, +0x0004de57,0xfffe8dc6,0x0006a2d5,0xfffe213e, +0xfff9b77d,0x000118d3,0xfffb5bde,0x0000be25, +0xfffd3224,0x00005e52,0xffff1dc1,0xfffffb4b, +0x00011353,0xffff9740,0x00030748,0xffff351c, +0x0004ec95,0xfffed755,0x0006b5b4,0xfffe7fc6, +0xfff9a599,0x0000d334,0xfffb519f,0x00008f08, +0xfffd2bbf,0x00004704,0xffff1bc1,0xfffffc71, +0x00011598,0xffffb135,0x00030e43,0xffff6720, +0x0004f6f3,0xffff2119,0x0006c46e,0xfffedf38, +0xfff997c7,0x00008d13,0xfffb4a55,0x00005fa5, +0xfffd273b,0x00002f76,0xffff1a63,0xfffffda0, +0x00011744,0xffffcb67,0x000312ff,0xffff99cf, +0x0004ff0c,0xffff6a9c,0x0006cebd,0xffff3f0a, +0xfff98dbe,0x00004691,0xfffb4620,0x00003010, +0xfffd24fc,0x000017b5,0xffff199d,0xfffffed8, +0x0001185a,0xffffe5c6,0x0003157e,0xffffcce3, +0x000503ae,0xffffb515,0x0006d537,0xffff9f5a, +0xfff98767,0xfffb44b0,0xfffc3131,0xfffd2475, +0xfffe1c28,0xffff195d,0x00001859,0x000118bd, +0x000218df,0x0003163a,0x000410e0,0x000504a7, +0x0005f2b3,0x0006d796,0x0007b1fe,0xfff98537, +0xfffa609b,0xfffc7e8b,0x00028ef6,0xfffde181, +0x000144eb,0xffff5500,0xffffefb9,0x0000d01d, +0xfffe9755,0x000249a4,0xfffd453c,0x0003b80e, +0xfffc01aa,0x000511d6,0xfffad527,0xfffb334e, +0x0003c6b0,0xfffc5778,0x00026a92,0xfffdc9f5, +0x00013314,0xffff4d99,0xfffff0b6,0x0000d911, +0xfffeab80,0x00026369,0xfffd6c0a,0x0003e17f, +0xfffc39d8,0x000549df,0xfffb1eb2,0xfffafe6c, +0x0003916c,0xfffc3321,0x000244a6,0xfffdb402, +0x00012035,0xffff46ac,0xfffff192,0x0000e16a, +0xfffebfe0,0x00027b3d,0xfffd9433,0x0004087b, +0xfffc74b7,0x00057e8d,0xfffb6a81,0xfffacc1c, +0x00035929,0xfffc10df,0x00021e0c,0xfffd9f6d, +0x00010cb7,0xffff402e,0xfffff279,0x0000e965, +0xfffed574,0x00029159,0xfffdbdc4,0x00042c4c, +0xfffcb1e7,0x0005b02d,0xfffbb942,0xfffa9d38, +0x00031fbe,0xfffbf0fd,0x0001f5b4,0xfffd8c38, +0x0000f8b1,0xffff3a21,0xfffff391,0x0000f0e6, +0xfffeec44,0x0002a642,0xfffde90e,0x00044e32, +0xfffcf0fb,0x0005de46,0xfffc0b18,0xfffa71d1, +0x0002e44a,0xfffbd3de,0x0001cb90,0xfffd7a97, +0x0000e403,0xffff3490,0xfffff49c,0x0000f7a8, +0xffff0340,0x0002b95f,0xfffe1573,0x00046dbe, +0xfffd3284,0x00060888,0xfffc5f51,0xfffa4996, +0x0002a659,0xfffbb8df,0x0001a0e1,0xfffd6a4e, +0x0000ced2,0xffff2f75,0xfffff593,0x0000fdbe, +0xffff1a53,0x0002ca87,0xfffe42f5,0x0004898a, +0xfffd7563,0x00062f0b,0xfffcb5de,0xfffa2508, +0x00026786,0xfffba0bf,0x0001754a,0xfffd5b5f, +0x0000b92c,0xffff2acd,0xfffff6b0,0x0001034f, +0xffff3241,0x0002da5c,0xfffe71c6,0x0004a341, +0xfffdb946,0x000651e8,0xfffd0e37,0xfffa0402, +0x00022713,0xfffb8b9c,0x00014898,0xfffd4e7d, +0x0000a304,0xffff26b7,0xfffff7e1,0x00010846, +0xffff4b34,0x0002e897,0xfffea13f,0x0004ba63, +0xfffdff2d,0x00067115,0xfffd6839,0xfff9e680, +0x0001e4d4,0xfffb789e,0x00011b2e,0xfffd43a4, +0x00008c6e,0xffff2341,0xfffff8fd,0x00010c9c, +0xffff6469,0x0002f48f,0xfffed1a4,0x0004cd6a, +0xfffe4608,0x00068c1b,0xfffdc409,0xfff9cd15, +0x0001a1fa,0xfffb68a0,0x0000ecee,0xfffd3a2e, +0x0000757d,0xffff204b,0xfffffa1e,0x00011054, +0xffff7da1,0x0002fe9c,0xffff033e,0x0004de57, +0xfffe8dc6,0x0006a2d5,0xfffe213e,0xfff9b77d, +0x00015dfe,0xfffb5bde,0x0000be25,0xfffd3224, +0x00005e52,0xffff1dc1,0xfffffb4b,0x00011353, +0xffff9740,0x00030748,0xffff351c,0x0004ec95, +0xfffed755,0x0006b5b4,0xfffe7fc6,0xfff9a599, +0x000118d3,0xfffb519f,0x00008f08,0xfffd2bbf, +0x00004704,0xffff1bc1,0xfffffc71,0x00011598, +0xffffb135,0x00030e43,0xffff6720,0x0004f6f3, +0xffff2119,0x0006c46e,0xfffedf38,0xfff997c7, +0x0000d334,0xfffb4a55,0x00005fa5,0xfffd273b, +0x00002f76,0xffff1a63,0xfffffda0,0x00011744, +0xffffcb67,0x000312ff,0xffff99cf,0x0004ff0c, +0xffff6a9c,0x0006cebd,0xffff3f0a,0xfff98dbe, +0x00008d13,0xfffb4620,0x00003010,0xfffd24fc, +0x000017b5,0xffff199d,0xfffffed8,0x0001185a, +0xffffe5c6,0x0003157e,0xffffcce3,0x000503ae, +0xffffb515,0x0006d537,0xffff9f5a,0xfff98767, +0x00004691,0xfffa609b,0xfffb44b0,0xfffc3131, +0xfffd2475,0xfffe1c28,0xffff195d,0x00001859, +0x000118bd,0x000218df,0x0003163a,0x000410e0, +0x000504a7,0x0005f2b3,0x0006d796,0x0007b1fe, +0xfff98537,0xfffbd51e,0x00032dd1,0xfffd2d8f, +0x0001eb47,0xfffe9968,0x00009af6,0x000011de, +0xffff4335,0x00018d69,0xfffdecd4,0x000302f8, +0xfffca0d7,0x0004683d,0xfffb67f8,0x0005b36d, +0x00045963,0xfffba72a,0x00030062,0xfffd0dee, +0x0001d046,0xfffe8a0a,0x00009258,0x000012b1, +0xffff4d9e,0x00019ec3,0xfffe0a44,0x0003245a, +0xfffcd082,0x000498f0,0xfffba919,0x0005f304, +0x00041bf4,0xfffb7bf1,0x0002d19e,0xfffcf060, +0x0001b407,0xfffe7c08,0x0000894a,0x0000138d, +0xffff58ac,0x0001afaf,0xfffe28fe,0x000343bf, +0xfffd026f,0x0004c6f6,0xfffbed06,0x00062e61, +0x0003dc0e,0xfffb52c0,0x0002a17f,0xfffcd522, +0x000196a0,0xfffe6e70,0x00007ff6,0x00001439, +0xffff63f6,0x0001beb3,0xfffe4882,0x0003616d, +0xfffd361b,0x0004f1cf,0xfffc332a,0x0006658f, +0x00039943,0xfffb2d0c,0x00026ec7,0xfffcbb94, +0x0001789f,0xfffe6160,0x00007677,0x000014d4, +0xffff6f74,0x0001cc9b,0xfffe694f,0x00037cbf, +0xfffd6b41,0x000519c2,0xfffc7baf,0x00069971, +0x00035486,0xfffb0a7a,0x00023ad8,0xfffca3ee, +0x00015989,0xfffe55af,0x00006ca7,0x00001570, +0xffff7b71,0x0001d9cb,0xfffe8b46,0x0003959e, +0xfffda1fe,0x00053ee6,0xfffcc6b4,0x0006c950, +0x00030e08,0xfffaea7c,0x0002061e,0xfffc8ec0, +0x00013911,0xfffe4b1d,0x00006278,0x000015e8, +0xffff87b6,0x0001e577,0xfffeadd6,0x0003acc2, +0xfffdda34,0x00056059,0xfffd136d,0x0006f4b5, +0x0002c562,0xfffacdc3,0x0001cfa6,0xfffc7b14, +0x0001182b,0xfffe4159,0x00005817,0x0000165c, +0xffff9417,0x0001f00f,0xfffed14c,0x0003c199, +0xfffe13f6,0x00057e83,0xfffd61cd,0x00071ba1, +0x00027ab5,0xfffab482,0x00019833,0xfffc6989, +0x0000f6ca,0xfffe38da,0x00004d9d,0x000016ef, +0xffffa103,0x0001f98f,0xfffef5c0,0x0003d3d1, +0xfffe4f00,0x0005998c,0xfffdb21e,0x00073e77, +0x00022e75,0xfffa9e9b,0x00015fd1,0xfffc5b13, +0x0000d45d,0xfffe318f,0x000042ed,0x0000176b, +0xffffae8f,0x0002018f,0xffff1a91,0x0003e40c, +0xfffe8af2,0x0005b0ca,0xfffe03b8,0x00075d14, +0x0001e141,0xfffa8bb0,0x0001262a,0xfffc4e31, +0x0000b1af,0xfffe2b26,0x00003805,0x000017b1, +0xffffbc21,0x000208b8,0xffff3fb6,0x0003f1d7, +0xfffec7af,0x0005c4c5,0xfffe5654,0x0007768a, +0x000192fe,0xfffa7bec,0x0000ec3f,0xfffc4365, +0x00008ec9,0xfffe25f0,0x00002d05,0x000017ec, +0xffffc984,0x00020ec6,0xffff658d,0x0003fcba, +0xffff0500,0x0005d576,0xfffeaa37,0x00078bc6, +0x00014367,0xfffa6fc9,0x0000b1f4,0xfffc3b82, +0x00006b06,0xfffe2201,0x000021eb,0x00001823, +0xffffd704,0x0002132a,0xffff8be7,0x00040534, +0xffff4315,0x0005e22e,0xfffeff0a,0x00079ce3, +0x0000f33f,0xfffa671b,0x000076ca,0xfffc3558, +0x00004762,0xfffe1ef3,0x000016a1,0x0000183f, +0xffffe4a6,0x00021664,0xffffb27d,0x00040b7b, +0xffff81e5,0x0005eb4e,0xffff5475,0x0007a857, +0x0000a2cb,0xfffa6218,0x00003b64,0xfffc31e2, +0x00002416,0xfffe1ce1,0x00000b46,0x00001850, +0xfffff24d,0x00021855,0xffffd93a,0x00040f75, +0xffffc0e6,0x0005f0e3,0xffffaa3e,0x0007af45, +0x0000519f,0x00030000,0x000f0007,0x003f001f, +0x00ff007f,0x03ff01ff,0x0fff07ff,0x3fff1fff, +0xffff7fff,0x00030000,0x00070005,0x000f0009, +0x003f001f,0x00ff007f,0x03ff01ff,0x0fff07ff, +0xffff1fff,0x00030000,0x00070005,0x000f0009, +0xffff001f,0x00030000,0xffff0005,0x04030504, +0x08070605,0x0c0b0a09,0x100f0e0d,0x03070504, +0x0605040a,0x0a090807,0x100d0c0b,0x03070503, +0x1005040a,0x10070502,0x03030100,0x03030303, +0x03030303,0x03030303,0x03010100,0x03030301, +0x03030303,0x03030303,0x03010100,0x03030301, +0x03010100,0x04020000,0x08070605,0x0c0b0a09, +0x100f0e0d,0x02010000,0x06050403,0x0a090807, +0x100d0c0b,0x02010000,0x10050403,0x10010000, +0x00030000,0x00090005,0x001f000f,0x007f003f, +0x01ff00ff,0x07ff03ff,0x1fff0fff,0x7fff3fff, +0x00030000,0x00090005,0x001f000f,0x007f003f, +0x0a070504,0x07060504,0x0b0a0908,0x0f0e0d0c, +0x0a070503,0x07060504,0x01010100,0x03030303, +0x03030303,0x03030303,0x01010100,0x03030303, +0x03010000,0x07060504,0x0b0a0908,0x0f0e0d0c, +0x03010000,0x07060504,0x00555555,0x002aaaab, +0x00249249,0x00124925,0x00111111,0x00088889, +0x00084210,0x00421084,0x00041041,0x00020821, +0x00020408,0x00081020,0x00010101,0x00008081, +0x00008040,0x00100804,0x00004010,0x00020080, +0x00002004,0x00004008,0x00001001,0x00000801, +0x00000800,0x00200100,0x00000400,0x00080020, +0x00000200,0x00020004,0x00200000,0x00600040, +0x00a00080,0x00e000c0,0x01200100,0x01600140, +0x01a00180,0x000001c0,0x00300020,0x00400038, +0x00600050,0x00800070,0x00c000a0,0x010000e0, +0x01800140,0x00200000,0x00300028,0x00400038, +0x00600050,0x00800070,0x00c000a0,0x010000e0, +0x00000140,0x00900000,0x00fc00d8,0x01680120, +0x01f801b0,0x02d00240,0x03f00360,0x05a00480, +0x000006c0,0x00680000,0x00b6009c,0x010500d0, +0x016d0139,0x020a01a1,0x02db0272,0x04140343, +0x000004e5,0x006c0000,0x00bd00a2,0x010e00d8, +0x017a0144,0x006301b0,0x013b00cf,0x00c601a7, +0x0000019e,0x00600000,0x00a80090,0x00f000c0, +0x01500120,0x01e00180,0x02a00240,0x03c00300, +0x00000480,0x10000000,0x10101010,0x20101010, +0x20202020,0x20202020,0x28202020,0x28282828, +0x00002828,0x10100000,0x10101010,0x10101010, +0x00000000,0x00000000,0x00000000,0x00000000, +0xcbcecdc4,0xcfcac9c8,0xc3c6c5cc,0xc7c2c1c0, +0x1b1e1d14,0x1f1a1918,0x1316151c,0x17121110, +0x2b2e2d24,0x2f2a2928,0x2326252c,0x27222120, +0x3b3e3d34,0x3f3a3938,0x3336353c,0x37323130, +0x0b0e0d04,0x0f0a0908,0x0306050c,0x07020100, +0xdbdeddd4,0xdfdad9d8,0xd3d6d5dc,0xd7d2d1d0, +0xebeeede4,0xefeae9e8,0xe3e6e5ec,0xe7e2e1e0, +0xfbfefdf4,0xfffaf9f8,0xf3f6f5fc,0xf7f2f1f0, +0x4b4e4d44,0x4f4a4948,0x4346454c,0x47424140, +0x9b9e9d94,0x9f9a9998,0x9396959c,0x97929190, +0xabaeada4,0xafaaa9a8,0xa3a6a5ac,0xa7a2a1a0, +0xbbbebdb4,0xbfbab9b8,0xb3b6b5bc,0xb7b2b1b0, +0x8b8e8d84,0x8f8a8988,0x8386858c,0x87828180, +0x5b5e5d54,0x5f5a5958,0x5356555c,0x57525150, +0x6b6e6d64,0x6f6a6968,0x6366656c,0x67626160, +0x7b7e7d74,0x7f7a7978,0x7376757c,0x77727170, +0x341424c4,0x3e1e2ece,0x3d1d2dcd,0x3b1b2bcb, +0xb494a444,0xbe9eae4e,0xbd9dad4d,0xbb9bab4b, +0xf4d4e404,0xfedeee0e,0xfddded0d,0xfbdbeb0b, +0x74546484,0x7e5e6e8e,0x7d5d6d8d,0x7b5b6b8b, +0x3c1c2ccc,0x361626c6,0x351525c5,0x331323c3, +0xbc9cac4c,0xb696a646,0xb595a545,0xb393a343, +0xfcdcec0c,0xf6d6e606,0xf5d5e505,0xf3d3e303, +0x7c5c6c8c,0x76566686,0x75556585,0x73536383, +0x381828c8,0x3a1a2aca,0x391929c9,0x3f1f2fcf, +0xb898a848,0xba9aaa4a,0xb999a949,0xbf9faf4f, +0xf8d8e808,0xfadaea0a,0xf9d9e909,0xffdfef0f, +0x78586888,0x7a5a6a8a,0x79596989,0x7f5f6f8f, +0x301020c0,0x321222c2,0x311121c1,0x371727c7, +0xb090a040,0xb292a242,0xb191a141,0xb797a747, +0xf0d0e000,0xf2d2e202,0xf1d1e101,0xf7d7e707, +0x70506080,0x72526282,0x71516181,0x77576787, +0x05040100,0x15141110,0x25242120,0x35343130, +0x85848180,0x95949190,0xa5a4a1a0,0xb5b4b1b0, +0xc0408000,0xe060a020,0xd0509010,0xf070b030, +0xc8488808,0xe868a828,0xd8589818,0xf878b838, +0xc4448404,0xe464a424,0xd4549414,0xf474b434, +0xcc4c8c0c,0xec6cac2c,0xdc5c9c1c,0xfc7cbc3c, +0xc2428202,0xe262a222,0xd2529212,0xf272b232, +0xca4a8a0a,0xea6aaa2a,0xda5a9a1a,0xfa7aba3a, +0xc6468606,0xe666a626,0xd6569616,0xf676b636, +0xce4e8e0e,0xee6eae2e,0xde5e9e1e,0xfe7ebe3e, +0xc1418101,0xe161a121,0xd1519111,0xf171b131, +0xc9498909,0xe969a929,0xd9599919,0xf979b939, +0xc5458505,0xe565a525,0xd5559515,0xf575b535, +0xcd4d8d0d,0xed6dad2d,0xdd5d9d1d,0xfd7dbd3d, +0xc3438303,0xe363a323,0xd3539313,0xf373b333, +0xcb4b8b0b,0xeb6bab2b,0xdb5b9b1b,0xfb7bbb3b, +0xc7478707,0xe767a727,0xd7579717,0xf777b737, +0xcf4f8f0f,0xef6faf2f,0xdf5f9f1f,0xff7fbf3f, +0x1045a3e2,0x000000f4,0x263b7333,0x766b2363, +0x2b367e3e,0x7b662e6e,0x06db93d3,0x964b0343, +0x0bd69ede,0x9b460e4e,0x825f1757,0x12cf87c7, +0x8f521a5a,0x1fc28aca,0x00d199d9,0x90410949, +0x01d098d8,0x91400848,0x24357d3d,0x74652d6d, +0x25347c3c,0x75642c6c,0x04d59ddd,0x94450d4d, +0x05d49cdc,0x95440c4c,0x80511959,0x10c189c9, +0x81501858,0x11c088c8,0x02df97d7,0x924f0747, +0x0fd29ada,0x9f420a4a,0x865b1353,0x16cb83c3, +0x8b561e5e,0x1bc68ece,0xa6bbf3b3,0xf6eba3e3, +0xabb6febe,0xfbe6aeee,0x223f7737,0x726f2767, +0x2f327a3a,0x7f622a6a,0xa0b1f9b9,0xf0e1a9e9, +0xa1b0f8b8,0xf1e0a8e8,0x84551d5d,0x14c58dcd, +0x85541c5c,0x15c48ccc,0xa4b5fdbd,0xf4e5aded, +0xa5b4fcbc,0xf5e4acec,0x20317939,0x70612969, +0x21307838,0x71602868,0xa2bff7b7,0xf2efa7e7, +0xafb2faba,0xffe2aaea,0x00000000,0x00000000, + +}; + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/mpgi2s.h linux.20pre5-ac2/drivers/media/video/ls220/mpgi2s.h --- linux.20pre5/drivers/media/video/ls220/mpgi2s.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/mpgi2s.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,1611 @@ +static u32 MPGI2SUcode1f1800[] = { +0x820f001f,0x802f001f,0x81df0000,0xb500000c, +0x00ffb81e,0x00000000,0x00000000,0x00000000, +0x00ffb81e,0x00000000,0x00000000,0x00000000, +0xb5000c0f,0x00000000,0x00000000,0x00000000, +0x80070800,0x001f6047,0x8013001f,0x90208000, +0x003fb174,0x803effe8,0x803effec,0x9020fa00, +0x803effd0,0x803effdc,0x803effd8,0x9020fe00, +0x803effd4,0x805bff7c,0x802500d4,0x94020080, +0xb0000000,0xb4200023,0x8013ffcf,0x9800cfff, +0x80730030,0x98631000,0x94420007,0xb0020002, +0xb4200005,0x8013ffc7,0x9800c7ff,0x80730038, +0x98631000,0xb5000006,0xb0020001,0xb4200004, +0x8013ffcf,0x9800cfff,0x80730030,0x98631000, +0x1421b800,0x1821b803,0x802600d4,0x8033001f, +0x98210000,0x802600a2,0x8033001f,0x98210300, +0x802600a3,0x80270225,0x80530001,0x98420100, +0x1821b802,0x80530200,0x98420000,0x804600a6, +0xb500001d,0x805bff7c,0x8013ffcf,0x9800cfff, +0x80730030,0x98632000,0x94420007,0xb0020002, +0xb4200005,0x8013ffc7,0x9800c7ff,0x80730038, +0x98632800,0xb5000006,0xb0020001,0xb4200004, +0x8013ffcf,0x9800cfff,0x80730030,0x98632000, +0x1421b800,0x1821b803,0x802600d4,0x8033001f, +0x98210000,0x802600a2,0x8033001f,0x98210600, +0x802600a3,0x80270eff,0x802600a1,0x80270002, +0x803eff84,0x80070000,0x801effc0,0x801effc4, +0x801effc8,0x801effcc,0x801eff88,0x80770000, +0x8057ffff,0x80170080,0x80070000,0xb6003f02, +0xb6002001,0x001fa020,0x8007ffff,0x801eff84, +0x80070001,0x001f25dc,0x001f20b1,0x80070000, +0x001f6046,0x001fb17c,0x001fb17d,0x80070000, +0x801e78d0,0x98004000,0x001f62ea,0x80070100, +0x801efff0,0x81df0004,0x00000000,0x00000000, +0x801bfff0,0x00000000,0x940000ff,0xb0000000, +0xb420005b,0x003f42ea,0x94010010,0xb0000000, +0xb400fff7,0x003f05dc,0xb0010001,0xb4200034, +0x803bffe8,0x801bffec,0x00000000,0x3001b800, +0xb4600001,0x90214000,0x0421b800,0xb0010800, +0xb460000d,0x80050086,0x005f902e,0xb0020000, +0xb4200002,0x001fb02e,0xb5000006,0x0420b802, +0xb0010930,0xb4a0ffe2,0x80070000,0x001fb02e, +0x83e40162,0xb500ffde,0x83e40129,0x80070000, +0x001fb02e,0x001f42ea,0x9400000f,0xb0000000, +0xb4000010,0x9400fff0,0x001f62ea,0x003f9174, +0x9421ffff,0x90210004,0xb001c000,0xb4800002, +0x8421c000,0x90218000,0x8013001f,0x1821b800, +0x003fb174,0x003f917c,0x90210004,0x003fb17c, +0x83e4014a,0x8013001f,0x83e71b0c,0x1bffb800, +0x003f9179,0x1821b800,0x00ffb801,0xb5000008, +0x80270000,0x003f25dc,0x8013001f,0x83e71b30, +0x1bffb800,0x003f917a,0x1821b800,0x00ffb801, +0x80070000,0x001f20b1,0x001f42ea,0x9420000f, +0xb0010000,0xb4200003,0x98000800,0x001f62ea, +0xb500ffaf,0x9400fff0,0x001f62ea,0x80270000, +0x8057ffff,0x80770000,0x80171980,0x81df0000, +0x00000000,0x00000000,0xb6000602,0xb6002001, +0x001fa021,0x81df0004,0xb500ffa1,0xb500ffa0, +0x803bffc0,0x805bffc4,0x807bffc8,0x809bffcc, +0x5828b801,0x5cb8b802,0x1821b805,0x5848b802, +0x5cb8b803,0x1842b805,0x5868b803,0x5cb8b804, +0x1863b805,0x5888b804,0x1884b800,0x803effc0, +0x805effc4,0x807effc8,0x809effcc,0x003f42ea, +0xb0000086,0xb4400079,0xb0000084,0xb4000049, +0xb0000085,0xb4000063,0xb0000086,0xb400006c, +0xb0000081,0xb4000005,0xb0000082,0xb4000003, +0xb0000080,0xb4000001,0xb5000069,0x8013007f, +0x9800ffff,0x001fb02d,0x80070000,0x001fb17c, +0x8013001f,0x9040fa00,0x805effd0,0x805effdc, +0x805effd8,0x9040fe00,0x805effd4,0x9040c000, +0x805effe4,0x90008000,0x801effe0,0x001fb174, +0x801effe8,0x801effec,0x80078000,0x801e78d4, +0x80070000,0x001fb17c,0x001fb17d,0x001fb02e, +0x83e400e6,0x8013001f,0x98000000,0x800600a2, +0x8013001f,0x98000600,0x800600a3,0x805bff7c, +0x80070eff,0x94420080,0xb0020080,0xb420000d, +0x8013001f,0x98000000,0x800600a2,0x8013001f, +0x98000300,0x800600a3,0x80070225,0x80530001, +0x98420100,0x1800b802,0x80530200,0x98420000, +0x804600a6,0x800600a1,0x80050080,0x98000022, +0x80060080,0x80072080,0x001fb179,0x80074618, +0x001fb17a,0x80070001,0x001f25dc,0x98214000, +0xb5000029,0x8047ffff,0x805eff84,0x805bff88, +0x00000000,0xb0020001,0xb4200002,0x80470000, +0x805eff88,0x805bff7c,0x80070eff,0x94420080, +0xb0020080,0xb4200007,0x80070225,0x80530001, +0x98420100,0x1800b802,0x80530200,0x98420000, +0x804600a6,0x800600a1,0x80070001,0x800600a0, +0x9421efff,0x98210010,0xb500000f,0x80070000, +0x001fb17c,0x80070001,0x001f25dc,0x83e400a3, +0x80050081,0x80330008,0x98210000,0x1800b801, +0x80060081,0x003f42ea,0x9421ffef,0xb5000002, +0x98211000,0x9421ffef,0x83e40098,0x003f62ea, +0x80070100,0x801efff0,0xb500ff11,0xb000008b, +0xb400001c,0xb0000087,0xb400ffe8,0xb0000088, +0xb4000023,0xb000008a,0xb4000024,0xb000008c, +0xb4000019,0xb000008e,0xb4000014,0xb000008d, +0xb400001d,0xb0000089,0xb400001f,0xb00000a0, +0xb4000021,0xb00000a1,0xb4000022,0xb00000a2, +0xb400002f,0xb00000a3,0xb4000027,0xb00000a4, +0xb4000031,0xb00000a5,0xb4000035,0xb00000a6, +0xb4000039,0x803efff8,0xb500ffdd,0x80070000, +0x001fb17e,0xb500ffda,0x803bffb0,0x00000000, +0x003fb02d,0xb500ffd6,0x98210020,0xb500ffd2, +0x9421ffdf,0xb500ffd0,0xb500ffd1,0x80270351, +0x803efff8,0xb500ffce,0x803bff80,0x00000000, +0x003f62ef,0xb500ffca,0x003f917b,0x803efff8, +0xb500ffc7,0x80270000,0x8047fef0,0x003eb802, +0x90420004,0x003eb802,0x90420004,0x003eb802, +0x90420004,0x003eb802,0x81df0000,0x00000000, +0x00000000,0x83640db9,0x81df0004,0xb500ffb8, +0x81df0000,0x00000000,0x00000000,0x83640d63, +0x81df0004,0xb500ffb2,0x81df0000,0x00000000, +0x00000000,0x83640d1e,0x81df0004,0xb500ffac, +0x81df0000,0x00000000,0x00000000,0x83440c81, +0x81df0004,0xb500ffa6,0x81df0000,0x00000000, +0x00000000,0x83440c66,0x81df0004,0xb500ffa0, +0x817bffe8,0x815b78d4,0x00000000,0x956bffff, +0x300bb80a,0xb4600001,0x916b4000,0x056bb80a, +0xb00b0080,0xb4a0002a,0x80af001f,0x808f0000, +0x806f0000,0x81b300ff,0x8057ffff,0x5d67b80b, +0x5d42b80a,0x81df0000,0x00000000,0x00000000, +0xb62b001c,0xb00a3000,0xb4800001,0x854a1000, +0x80cf0400,0x015fb178,0x5942b80a,0x01cfb80a, +0x015f9178,0xb520ffff,0x80171000,0xb600200a, +0x01ff8000,0x5a18b80f,0x5a28b80f,0x1631b80d, +0x5e48b80f,0x9652ff00,0x5e78b80f,0x1a73b810, +0x1a73b811,0x1813a032,0x80cf0400,0x015fb178, +0x5942b80a,0x01afb80a,0x015f9178,0xb520ffff, +0x914a0020,0x81df0004,0x5942b80a,0x815e78d4, +0x00000000,0x00000000,0x00ffb81f,0x81df0000, +0x80070000,0x80470000,0x81171800,0xb6002003, +0xb6003002,0x001eb802,0x90420004,0xb6002003, +0x011fa020,0x011fa020,0x011fa020,0x81df0004, +0x00ffb81f,0x80070000,0x80478000,0x81df0000, +0x00000000,0x00000000,0xb6002003,0xb6008002, +0x001eb802,0x90420004,0x81df0004,0x00ffb81f, +0x015f42ea,0x944a4000,0xb0024000,0xb4200081, +0x954abfff,0x015f62ea,0x808f0000,0x80ef007c, +0x80171000,0x80971400,0x80270000,0xb6001003, +0xb6002002,0x001fa021,0x009fa021,0x80a76604, +0x80271400,0x81df0000,0x00000000,0x00000000, +0xb6001004,0x01efb801,0x01afb805,0xb520ffff, +0x90a50080,0x81df0004,0x80a76e04,0x80271400, +0x81df0000,0x00000000,0x00000000,0xb6001004, +0x01efb801,0x01afb805,0xb520ffff,0x90a50080, +0x81df0004,0x806f001f,0x80af001f,0x80276400, +0x5c22b801,0x806701e1,0x00cfb803,0x003fb178, +0x5822b801,0x01cfb801,0x003f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x80275c00,0x5c22b801, +0x80670200,0x81df0000,0x00000000,0x00000000, +0xb600100a,0x00cfb803,0x003fb178,0x5822b801, +0x01cfb801,0x003f9178,0x0047b86f,0xb0020001, +0xb4c0fffd,0x90210020,0x90630020,0x81df0004, +0x808f0000,0x806f001f,0x80af001f,0x8027647c, +0x5c22b801,0x8067017e,0x81df0000,0x00000000, +0x00000000,0xb600020a,0x00cfb803,0x003fb178, +0x5822b801,0x01cfb801,0x003f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x90210020,0x90630020, +0x81df0004,0x806f0010,0x80af0010,0x8027657c, +0x5c22b801,0x806701be,0x00cfb803,0x003fb178, +0x5822b801,0x01cfb801,0x003f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x802765c0,0x5c22b801, +0x806701cf,0x00cfb803,0x003fb178,0x5822b801, +0x01cfb801,0x003f9178,0x0047b86f,0xb0020001, +0xb4c0fffd,0x80276000,0x005fb801,0x8033001f, +0x98218000,0x803effe0,0x90214000,0x803effe4, +0x8193001f,0x998c8000,0x019fb174,0x83270000, +0x003fb819,0x003f9174,0x5823b801,0x83338000, +0x1b39b801,0x003fb819,0x00000000,0x00000000, +0x81550000,0x0187b860,0x858c0040,0x81b380fc, +0x99ad0000,0x300cb80d,0xb4600003,0x81b30002, +0x99ad0000,0x118cb80d,0x003fb80c,0x00000000, +0x00000000,0x81550000,0x8257ffff,0x82d7ffff, +0x8357ffff,0x81672000,0x83440191,0xb00a0001, +0xb4000141,0x0187b860,0x858c0010,0x5988b80c, +0x5d8bb80c,0x958cffff,0xb00cc000,0xb4800002, +0x858cc000,0x918c8000,0x81b3001f,0x198cb80d, +0x801bffec,0x00000000,0x819effec,0x819e78d8, +0x019fb174,0x05acb800,0x300cb800,0xb4600001, +0x91ad4000,0x001f917c,0x1000b80d,0x001fb17c, +0x8344019c,0xb00a0000,0xb4200127,0x015f0081, +0xb00a0002,0xb4200124,0x037f0082,0xb01b0000, +0xb400001e,0x0367b860,0x5b68b81b,0x5f68b81b, +0x017f4047,0x916b0010,0x5963b80b,0x83440168, +0x801bff84,0xb00a0001,0xb400000b,0xb00b00c0, +0xb460fffa,0x803f0000,0x80138000,0x1b7bb800, +0x003fb81b,0x00000000,0x00000000,0x80150000, +0x801bff84,0xb5000009,0x803f0000,0x80138000, +0x1b7bb800,0x003fb81b,0x00000000,0x00000000, +0x80150000,0x801bff84,0xb5000103,0x801bff84, +0x003f0084,0x3000b801,0x803eff84,0xb4000073, +0x801bff7c,0x00000000,0x94800080,0xb0040080, +0xb4200036,0x94800007,0x80730200,0xb0010002, +0xb420000e,0x80270265,0xb0040001,0xb4200003, +0x80130030,0x98000000,0xb5000006,0x80130030, +0x98000000,0xb0040000,0xb4000002,0x80130038, +0x98000000,0x98630060,0xb500001f,0xb0010000, +0xb420000e,0x80270225,0xb0040001,0xb4200003, +0x80130030,0x98001000,0xb5000006,0x80130030, +0x98001000,0xb0040000,0xb4000002,0x80130038, +0x98001000,0x98630000,0xb500000f,0xb0010001, +0xb420004a,0x80270225,0xb0040001,0xb4200003, +0x80130030,0x98002000,0xb5000006,0x80130030, +0x98000000,0xb0040000,0xb4000002,0x80130038, +0x98000000,0x98630040,0x806600a6,0x80530001, +0x98420100,0x1821b802,0xb500002d,0x94800007, +0xb0010002,0xb420000d,0x80270eff,0xb0040001, +0xb4200003,0x80130030,0x98002000,0xb5000006, +0x80130030,0x98000000,0xb0040000,0xb4000002, +0x80130038,0x98000000,0xb500001d,0xb0010000, +0xb420000d,0x80270eff,0xb0040001,0xb4200003, +0x80130030,0x98002000,0xb5000006,0x80130030, +0x98002000,0xb0040000,0xb4000002,0x80130038, +0x98002800,0xb500000e,0xb0010001,0xb4200017, +0x80270eff,0xb0040001,0xb4200003,0x80130030, +0x98002000,0xb5000006,0x80130030,0x98002000, +0xb0040000,0xb4000002,0x80130038,0x98002800, +0x806500d4,0x8053ffcf,0x9842cfff,0xb0040002, +0xb4200002,0x8053ffc7,0x9842c7ff,0x802600a1, +0x1463b802,0x1863b800,0x806600d4,0x807bff7c, +0x00000000,0x94630080,0xb0030080,0xb420000b, +0x807bff88,0x00000000,0xb0030001,0xb4000007, +0x802500a1,0x80670001,0x807eff88,0x80530001, +0x98420100,0x1821b802,0x802600a1,0x81070000, +0x011f62e2,0x011f62e3,0x011f0082,0xb0080000, +0xb4200004,0x81150010,0x00000000,0x00000000, +0x011f62de,0x011f0081,0xb0080001,0xb4200026, +0x81070020,0x011f25c1,0x81070180,0x011f62e1, +0x8344023e,0x8344026a,0x011f0082,0xb0080000, +0xb4200004,0x834401bd,0x834401aa,0xb00a0000, +0xb4200061,0x80c70000,0x00df25cb,0x83440281, +0x8344064f,0x02ff05b9,0x82a70000,0x82870000, +0x83440407,0x92940001,0x3014b817,0xb480fffc, +0x834406ef,0x80270000,0x003f25dc,0x834407de, +0x003f05dc,0xb0010001,0xb4000003,0x80272694, +0x003fb17a,0x00ffb81f,0x80d3001f,0x8347266c, +0x1b5ab806,0xb500002d,0xb0080002,0x81470004, +0xb4200045,0x81070008,0x011f25c1,0x81070480, +0x011f62e1,0x8344029e,0x834402dc,0x011f0082, +0xb0080000,0xb4200004,0x834401aa,0x83440181, +0xb00a0000,0xb4200038,0x80c70000,0x00df25cb, +0x83440368,0x02df05cb,0x5ec2b816,0x8344066b, +0x02ff05b9,0x82a70000,0x82870000,0x834403dc, +0x92940001,0x3014b817,0xb480fffc,0x92b50001, +0xb0150003,0xb480fff8,0x834406c1,0x80270000, +0x003f25dc,0x834407b0,0x003f05dc,0xb0010001, +0xb4000003,0x8027274c,0x003fb17a,0x00ffb81f, +0x80d3001f,0x83472710,0x1b5ab806,0x80db78d8, +0x80fbffec,0x00000000,0x3006b807,0xb4200007, +0x00df05cb,0x90c60001,0x00df25cb,0xb006000c, +0xb4000002,0x035fb179,0x00ffb81f,0x80c70000, +0x00df25cb,0x80fb78dc,0x00000000,0x90e70001, +0xb00701b9,0xb4a00001,0x80e70001,0x80fe78dc, +0xb500feb0,0x802500a5,0x8153001f,0x3001b80a, +0xb420fffc,0x00ffb81f,0x001f42ea,0x1800b80a, +0x001f62ea,0x017f4047,0x5963b80b,0x0187b860, +0x118cb80b,0x81b380fe,0x99ad0000,0x300cb80d, +0xb4800003,0x81b30002,0x99ad0000,0x058cb80d, +0x003fb80c,0x00000000,0x00000000,0x81550000, +0x0187b860,0x5988b80c,0x5d8bb80c,0x958cffff, +0xb00cc000,0xb4800002,0x858cc000,0x918c8000, +0x81b3001f,0x198cb80d,0x801bffec,0x00000000, +0x819effec,0x019fb174,0x05acb800,0x300cb800, +0xb4600001,0x91ad4000,0x001f917c,0x1000b80d, +0x001fb17c,0x80171000,0x80971400,0x80270000, +0xb6001003,0xb6002002,0x001fa021,0x009fa021, +0x80171800,0xb6000602,0xb6002001,0x001fa021, +0x806f001f,0x80af001f,0x80a76604,0x80271400, +0x81df0000,0x00000000,0x00000000,0xb6001004, +0x01efb801,0x01afb805,0xb520ffff,0x90a50080, +0x81df0004,0x80a76e04,0x80271400,0x81df0000, +0x00000000,0x00000000,0xb6001004,0x01efb801, +0x01afb805,0xb520ffff,0x90a50080,0x81df0004, +0x81472080,0x015fb179,0x00ffb81f,0x00000000, +0x811be024,0x0107b860,0x95080007,0xb0080000, +0xb4000004,0xa5080008,0x00000000,0x0155b808, +0x00000000,0x8115000c,0x856b000c,0xb0080fff, +0xb400000b,0x81550004,0x856b0004,0x5904b808, +0x1908b80a,0x95080fff,0xb0080fff,0xb4000004, +0x81470001,0xb00b0020,0xb440fff6,0xb500000c, +0x81d50004,0x856b0004,0x00000000,0xb00e000f, +0xb400fffb,0x940b0007,0xb0000000,0xb420ffed, +0x001f42ea,0x9400fffe,0x81470000,0x001f62ea, +0x00ffb81a,0x950e0008,0x5d03b808,0x00000000, +0xb0080000,0xb40000cd,0x011f2080,0x950e0006, +0x5d01b808,0x81270004,0x0529b808,0x950e0001, +0x013f2081,0x011f2082,0x81150004,0x00000000, +0xb0080000,0xb40000c1,0xb008000f,0xb40000bf, +0x011f2083,0x81150002,0x00000000,0x81670004, +0xb0080002,0xb46000b9,0x011f2084,0x013f0081, +0xb0090002,0xb4200011,0x013f0083,0xb0080000, +0xb4200002,0x81077844,0xb5000005,0xb0080001, +0xb4200002,0x81077884,0xb5000001,0x81077824, +0x013f0083,0x5921b809,0x1129b808,0x0119b809, +0x00000000,0x00000000,0x011f6047,0x81150001, +0x00000000,0x011f2085,0x81150001,0x00000000, +0x011f2086,0x81350002,0x00000000,0x013f2087, +0x81150002,0x00000000,0x011f2088,0x81150001, +0x00000000,0x011f2089,0x81150001,0x00000000, +0x011f208a,0x81150002,0x00000000,0x011f208b, +0x81070001,0xb0090003,0xb4000001,0x81070002, +0x011f25b9,0x81070020,0x013f0081,0xb0090002, +0xb4200069,0x85290001,0xad29000f,0x00000000, +0x011f0083,0x1108b809,0x5901b808,0x910877c8, +0x0139b808,0x011f05b9,0x85080001,0x6928b809, +0x011f0084,0xb0090038,0xb4800007,0xb0080001, +0xb4000002,0xb0090050,0xb4400003,0x81270000, +0x8107001b,0xb5000010,0xb0080001,0xb4000005, +0xb0090060,0xb4800003,0x81270001,0x8107001e, +0xb5000009,0xb0080002,0xb4000005,0xb0090030, +0xb4400003,0x81270002,0x81070008,0xb5000002, +0x81270003,0x8107000c,0x011f25bb,0x013f25c0, +0xb0090002,0xb460001b,0x80477604,0x5c42b802, +0x814fffc0,0x80cf0037,0x005fb178,0x5842b802, +0x01cfb802,0x005f9178,0xb520ffff,0x90420020, +0x814fb580,0x80cf0057,0x005fb178,0x5842b802, +0x01cfb802,0x005f9178,0xb520ffff,0x804778a4, +0x5c42b802,0x814f39c0,0x80cf002f,0x005fb178, +0x5842b802,0x01cfb802,0x005f9178,0xb520ffff, +0xb5000025,0x804776e0,0x5c42b802,0x814fef40, +0x80cf0037,0x005fb178,0x5842b802,0x01cfb802, +0x005f9178,0xb520ffff,0x8297013c,0x8317018c, +0x81df0000,0x00000000,0x00000000,0xb6000602, +0x005f8034,0x031fa022,0x82970124,0x83170160, +0xb6000602,0x005f8034,0x031fa022,0x8297010c, +0x83170134,0xb6000602,0x005f8034,0x031fa022, +0x81df0004,0x804778c4,0x5c42b802,0x814f1080, +0x80cf002f,0x005fb178,0x5842b802,0x01cfb802, +0x005f9178,0xb520ffff,0x013f0081,0xb0090001, +0xb420000e,0x808f0000,0x806f001b,0x80af001b, +0x80277758,0x5c22b801,0x80670037,0x00cfb803, +0x003fb178,0x5822b801,0x01cfb801,0x003f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x011f25bb, +0x011f0087,0xb0080001,0xb4000002,0x011f05bb, +0xb5000003,0x011f0088,0x91080001,0x5902b808, +0x011f25ba,0x81470000,0x00ffb81a,0x81470008, +0x00ffb81a,0x81270000,0x81470000,0x300842de, +0xb400000b,0x013f42e2,0x91290001,0x013f62e2, +0x013f42e3,0x91290001,0x013f62e3,0x83640006, +0x00000000,0x00000000,0x013f42e2,0x81470002, +0x013f62e2,0x00ffb81a,0x00ffb81b,0x83640049, +0x80c70004,0x80270000,0x81df0000,0x00000000, +0x00000000,0xb600200d,0x00ff05b9,0x5c42b801, +0x300205ba,0xb4800001,0x80e70001,0x80470000, +0xb6270005,0x1062b801,0x914301b8,0x00fff00a, +0x83840055,0x90420080,0x90210004,0x81df0004, +0x00ffb81a,0x83640033,0x017f05bb,0x800700bc, +0x80270000,0x81df0000,0xb00b0000,0xb4000015, +0xb62b0014,0x00ff05b9,0x5c42b801,0x300205ba, +0xb4800001,0x80e70001,0x80470000,0xb0070000, +0xb400000b,0xb627000a,0x1062b801,0x914301b8, +0x00fff00a,0x5c62b801,0x1063b800,0x00bff003, +0x90650134,0x00dff003,0x83840037,0x90420080, +0x90210004,0x81df0004,0x019f05b9,0x80c70002, +0x80270000,0x81df0000,0xb00b0000,0xb400000f, +0xb62b000e,0x80470000,0xb00c0000,0xb400000a, +0xb62c0009,0x1062b801,0x914301b8,0x00fff00a, +0xb0070000,0xb4000003,0x906302b8,0x00fff003, +0x83840021,0x90420080,0x90210004,0x81df0004, +0x00ffb81a,0x8107ffff,0x80c70004,0x00ff0083, +0x83840019,0x80c70002,0x00ff0084,0x83840016, +0x80c70001,0x00ff0085,0x83840013,0x80c70001, +0x00ff0086,0x83840010,0x80c70002,0x00ff0087, +0x8384000d,0x80c70002,0x00ff0088,0x8384000a, +0x80c70001,0x00ff0089,0x83840007,0x80c70001, +0x00ff008a,0x83840004,0x80c70002,0x00ff008b, +0x83840001,0x00ffb81b,0x80a70001,0x64a6b805, +0x5ca1b805,0xb0050000,0xb400000e,0x95288000, +0xb0090000,0xb4000001,0x81270001,0x5901b808, +0x1547b805,0xb00a0000,0xb4000001,0x81470001, +0x2129b80a,0xb0090000,0xb4000001,0xa1088005, +0xb500ffef,0x9508ffff,0x00ffb81c,0x015f05ba, +0x013f05b9,0x800700bc,0xb0090000,0xb4000012, +0xb00a0000,0xb4000010,0x80270000,0x81df0000, +0x00000000,0x00000000,0xb62a000b,0x80470000, +0xb6290008,0x80950004,0x5865b802,0x1063b801, +0x5862b803,0x906301b8,0x0217b803,0x90420001, +0x021fa004,0x90210001,0x81df0004,0xa54a0020, +0xb4c00011,0xb0090000,0xb400000f,0x81df0000, +0x00000000,0x00000000,0xb62a000b,0x80950004, +0x80470000,0xb6290007,0x5865b802,0x1063b801, +0x5862b803,0x906301b8,0x0217b803,0x90420001, +0x021fa004,0x90210001,0x81df0004,0x00ffb81a, +0x013f05b9,0xb0090000,0xb400001c,0x80270000, +0x81df0000,0x00000000,0x00000000,0xb6002017, +0x80470000,0xb6290014,0x5865b802,0x1063b801, +0x5862b803,0x914301b8,0x009ff00a,0xad420060, +0x00000000,0x114ab801,0x5942b80a,0x914a1c80, +0x0217b80a,0xb0040000,0xb4000004,0x80950006, +0x00000000,0x021fa004,0xb5000002,0x8087003f, +0x021fa004,0x90420001,0x90210001,0x81df0004, +0x00ffb81a,0x8257ffff,0x82d7ffff,0x011f05ba, +0x013f05b9,0x80270000,0xb0090000,0xb4000033, +0x81df0000,0x00000000,0x00000000,0xb6280015, +0x80470000,0xb6290012,0x5865b802,0x1063b801, +0x5862b803,0x914301b8,0xaca20060,0x009ff00a, +0x10a5b801,0x58a2b805,0x90a502b8,0x0217b805, +0x80670000,0xb0040000,0xb4000003,0x90840001, +0x0075b804,0x00000000,0x021fa003,0x90420001, +0x90210001,0x81df0004,0xa5480020,0xb4000017, +0x5822b801,0x81df0000,0x00000000,0x00000000, +0xb62a0011,0x914101b8,0x90a102b8,0x0217b805, +0x009ff00a,0xb0040000,0x80670000,0xb4000002, +0x90840001,0x0075b804,0xb6290006,0x021fa203, +0x009f8210,0x009f8210,0x009f8210,0x009f8210, +0x009f8210,0x90210004,0x81df0004,0x00ffb81a, +0x015f05ba,0x013f05b9,0x800700bc,0xb0090000, +0xb4000016,0xb00a0000,0xb4000014,0x80270000, +0x81df0000,0x00000000,0x00000000,0xb62a000f, +0x80470000,0xb629000c,0x1080b801,0x007ff004, +0x90830134,0x007ff004,0x0095b803,0x5865b802, +0x1063b801,0x5862b803,0x906301b8,0x0217b803, +0x90420001,0x021fa004,0x90210001,0x011f05bb, +0x254ab808,0xb4c0000d,0xb62a000c,0x1080b801, +0x007ff004,0x90830134,0x007ff004,0x0095b803, +0x5862b801,0x906301b8,0x0217b803,0x90210001, +0x021fa204,0x007f8210,0x021fa004,0xa5480020, +0xb4c0000e,0xb0090000,0xb400000c,0x80870000, +0xb62a000a,0x80470000,0xb6290007,0x5865b802, +0x1063b801,0x5862b803,0x906301b8,0x0217b803, +0x90420001,0x021fa004,0x90210001,0x81df0004, +0x00000000,0x00000000,0x00ffb81a,0x011f05bb, +0x013f05b9,0xb0080000,0xb4000016,0xb0090000, +0xb4000014,0x81df0000,0x00000000,0x80270000, +0xb6280010,0x80470000,0xb629000d,0x5865b802, +0x1063b801,0x5862b803,0x914301b8,0x009ff00a, +0xb0040000,0xb4000005,0x80950002,0x906302b8, +0x0217b803,0x00000000,0x021fa004,0x90420001, +0x90210001,0x81df0004,0xa5480020,0xb00a0000, +0xb4000011,0xb0090000,0xb400000f,0x81df0000, +0x00000000,0x80870000,0xb62a000b,0x80470000, +0xb6290008,0x5865b802,0x1063b801,0x5862b803, +0x906302b8,0x0217b803,0x00000000,0x021fa004, +0x90420001,0x90210001,0x81df0004,0xb0080000, +0xb400004d,0xb0090000,0xb400004b,0x81df0000, +0x00000000,0x80270000,0xb6280047,0x80470000, +0xb6290044,0x5865b802,0x1063b801,0x5862b803, +0x914301b8,0x009ff00a,0xad420060,0x00000000, +0x00000000,0x00000000,0x114ab801,0x5942b80a, +0x914a1c80,0x0217b80a,0xb0040000,0xb400002e, +0x906302b8,0x009ff003,0xb0040000,0xb420000a, +0x80950006,0x00000000,0x021fa204,0x80950006, +0x015f8210,0x021fa204,0x80950006,0x015f8210, +0x021fa004,0xb5000026,0xb0040001,0xb4200009, +0x80950006,0x00000000,0x021fa204,0x015f8210, +0x021fa204,0x80950006,0x015f8210,0x021fa004, +0xb500001b,0xb0040003,0xb4200009,0x80950006, +0x00000000,0x021fa204,0x80950006,0x015f8210, +0x021fa204,0x015f8210,0x021fa004,0xb5000010, +0xb0040002,0xb420000e,0x80950006,0x00000000, +0x021fa204,0x015f8210,0x021fa204,0x015f8210, +0x021fa004,0xb5000006,0x8087003f,0x021fa204, +0x015f8210,0x021fa204,0x015f8210,0x021fa004, +0x90420001,0x90210001,0x81df0004,0xa5480020, +0xb4c00012,0xb0090000,0xb4000010,0x8087003f, +0x81df0000,0x5862b801,0x90631afc,0xb62a000b, +0x90630004,0x0047b803,0xb6290008,0x90420180, +0x0217b802,0x00000000,0x021fa204,0x003f8210, +0x021fa204,0x003f8210,0x021fa004,0x81df0004, +0x00ffb81a,0x8257ffff,0x82d7ffff,0x011f05bb, +0x013f05b9,0x80270000,0x00e7b809,0x300105ba, +0xb4800001,0x80e70001,0x800700bc,0x80470000, +0x81df0000,0xb0070000,0xb400004c,0xb627004b, +0x5865b802,0x1063b801,0x5862b803,0x914301b8, +0xaca20060,0x009ff00a,0x10a5b801,0x58a2b805, +0x90a502b8,0x0217b805,0xb0040000,0xb400002b, +0x1060b801,0x00bff003,0x10a5b804,0x90650160, +0x00dff003,0xb0060003,0xb4200007,0x90650134, +0x00dff003,0xb6000303,0x0075b806,0x021fa203, +0x007f8210,0xb5000021,0x5861b805,0x906300dc, +0x009fd803,0x90650134,0x00dff003,0xaca20060, +0x00000000,0x00000000,0x00000000,0x0075b806, +0x10a5b801,0x58a2b805,0x90a502b8,0x0217b805, +0x588fb804,0xb600030c,0xb6001007,0x04a3b804, +0xb4600002,0x58a1b803,0xb5000002,0x58a1b805, +0x90a50001,0x0067b805,0x9465ffff,0x5d50b805, +0x021fa20a,0x015f8210,0xb5000004,0x81470000, +0xb6000302,0x021fa20a,0x009f8210,0x009f05b9, +0xb0040002,0xb420000c,0x300105ba,0xb480000a, +0x58a2b801,0x90a502b8,0x0217b805,0x90a50180, +0x0297b805,0xb6000304,0x00bf8210,0x009f8210, +0x029fa205,0x009f8214,0x90420001,0x81df0004, +0x90210001,0x3001b808,0xb480ffa7,0xa5480020, +0xb00a0000,0xb4000019,0xb0090000,0xb4000017, +0x58a2b801,0x90a502b8,0x81df0000,0x00000000, +0x00000000,0xb62a0010,0x80470000,0xb629000d, +0xaca20060,0x00000000,0x00000000,0x00000000, +0x80670000,0x10a5b801,0x58a2b805,0x90a502b8, +0x0217b805,0xb6000302,0x021fa203,0x00bf8210, +0x90420001,0x90210001,0x81df0004,0x00ffb81a, +0x80770000,0x8057ffff,0x80f70000,0x80d7ffff, +0x81770000,0x8157ffff,0x81f70000,0x81d7ffff, +0xac140060,0xac350020,0x00000000,0x00000000, +0x12c0b801,0x5ac2b816,0x92d61980,0x83a400bd, +0xad940400,0x009f9173,0x013f05ca,0x914c6604, +0x114ab804,0x001f97e0,0x001eb80a,0xb0090000, +0xb4000003,0x80a76e44,0x80c76644,0xb5000002, +0x80a76644,0x80c76e44,0x808f000f,0x806f0000, +0x80af000e,0x80cf07e1,0x11e5b80c,0x11efb804, +0x5de2b80f,0x01ffb178,0x59e2b80f,0x01afb80f, +0x01ff9178,0x0047b86f,0xb0020001,0xb4c0fffd, +0x80cf07f0,0x1206b80c,0x1210b804,0x5e02b810, +0x021fb178,0x5a02b810,0x01afb810,0x021f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x916c6e04, +0x116bb804,0x001f97ff,0x001eb80b,0x808f0000, +0x806f001f,0x80af001f,0x90ac6604,0x5ca2b805, +0x80270400,0x81df0000,0x00000000,0x00000000, +0xb600080a,0x00cfb801,0x00bfb178,0x58a2b805, +0x01cfb805,0x00bf9178,0x0047b86f,0xb0020001, +0xb4c0fffd,0x90210020,0x90a50020,0x81df0004, +0x90ac6e04,0x5ca2b805,0x80270500,0x81df0000, +0x00000000,0x00000000,0xb600080a,0x00cfb801, +0x00bfb178,0x58a2b805,0x01cfb805,0x00bf9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x90210020, +0x90a50020,0x81df0004,0x81530020,0xac140060, +0xac350020,0x80170800,0x80d7003c,0x12c0b801, +0x5ac2b816,0x92d602b8,0x0117b816,0x90241000, +0x0097b801,0x80470000,0x4002b803,0x81df0000, +0x00000000,0x00000000,0xb6000804,0x005f8020, +0x480287e4,0x005f8020,0x500287e4,0x81df0004, +0x00000000,0x00000000,0x00000000,0x1021b80a, +0x5c36b801,0x5801b800,0x18c0b801,0xb0090000, +0xb4000002,0x90641440,0xb5000001,0x90641040, +0x81df0000,0x00000000,0x00000000,0xb6000f0d, +0x0097b803,0x80470000,0x4002b803,0xb6001002, +0x005f8020,0x480287e4,0x0108a026,0x90630040, +0x00000000,0x1021b80a,0x5c36b801,0x5801b800, +0x18c0b801,0x81df0004,0x90641400,0x0097b803, +0x80470000,0x4002b803,0x005f8020,0x005f87e4, +0x81df0000,0x00000000,0x00000000,0xb6000802, +0x005f8040,0x480287c4,0x81df0004,0x005f87e0, +0x0108a026,0x00000000,0x1021b80a,0x5c36b801, +0x5801b800,0x18c0b801,0xb0090000,0xb4000002, +0x906417c0,0xb5000001,0x906413c0,0x81df0000, +0x00000000,0x00000000,0xb6000f0f,0x0097b803, +0x80470000,0x4002b803,0xb6000804,0x005f8020, +0x500287e4,0x005f8020,0x480287e4,0x0108a026, +0x84630040,0x00000000,0x1021b80a,0x5c36b801, +0x5801b800,0x18c0b801,0x81df0004,0xb0140000, +0xb4200005,0x90840004,0x9484003f,0x009fb173, +0xa1290001,0x013f25ca,0x80d7ffff,0x0108a026, +0x00ffb81a,0x81330004,0x8093007f,0x9884ffff, +0x80b3ff80,0x0017b816,0x90360040,0x0097b801, +0x81530010,0x81df0000,0x00000000,0x00000000, +0xb6001004,0x400a8000,0x404a8004,0x0008a020, +0x0088a022,0x81df0004,0x0017b816,0x9036007c, +0x0097b801,0x81171000,0x81df0000,0x00000000, +0x00000000,0xb6001004,0x40048020,0x480487e4, +0x00000000,0x0108a020,0x81df0004,0x81470000, +0x81670001,0x81870008,0x81a70040,0x81c707c4, +0x81e70040,0x81df0000,0x00000000,0x00000000, +0xb6000432,0xb00a0001,0xb4e00004,0x80c71000, +0x80e71000,0x81171040,0xb5000003,0x80c71040, +0x80e71040,0x81171000,0x844d0004,0x10e7b802, +0xb62b001f,0x0017b806,0x0097b807,0xb62c0004, +0x40048020,0x480487e4,0x00000000,0x0108a020, +0x0017b806,0x0097b807,0x0197b80e,0x00000000, +0x001f8020,0x042087e4,0xb62c000f,0x4041800c, +0x001f8020,0x0048b802,0x5e38802c,0x2e11b801, +0x042087e4,0x1042b810,0x0462b804,0xb4a00002, +0x0047b804,0xb5000003,0x0462b805,0xb4600001, +0x0047b805,0x011fa022,0x10c6b80f,0x10e7b80f, +0x5961b80b,0x5d81b80c,0x5da1b80d,0x5de1b80f, +0x914a0001,0x954a0001,0x11ceb80f,0x81df0004, +0x80171018,0x81171fcc,0x80470000,0x41448020, +0x494487c0,0x00000000,0x0188b80a,0x494487e0, +0x00000000,0x0148b80a,0x0502a10a,0x4145b80c, +0x494580e0,0x00000000,0x0108a5ea,0x41448080, +0x494487c0,0x00000000,0x0108a78a,0x49448020, +0x00000000,0x0108a2ea,0x41448020,0x49448720, +0x00000000,0x0188b80a,0x4145b80c,0x49458080, +0x494587a0,0x00000000,0x0108a68a,0x4145b80c, +0x49458080,0x494587a0,0x00000000,0x0108a08a, +0x4145b80c,0x49458020,0x49458040,0x00000000, +0x0188b80a,0x494587e0,0x00000000,0x0108a08a, +0x4144b80c,0x494587a0,0x00000000,0x0108a52a, +0x41448080,0x49448040,0x494486c0,0x00000000, +0x0108a04a,0x41448040,0x49448720,0x00000000, +0x0108a36a,0x04028020,0x011fa420,0x001f8040, +0x011fa100,0x001f8080,0x011fa080,0x001f8100, +0x011fa040,0x001f8660,0x011fa120,0x41458020, +0x49458000,0x00000000,0x0108a00a,0x0017b816, +0x9036007c,0x0097b801,0x81171000,0x81970784, +0x00000000,0x001f8020,0x042087e4,0x81df0000, +0x00000000,0x00000000,0xb600100f,0x4041800c, +0x001f8020,0x0048b802,0x5e38802c,0x2e11b801, +0x042087e4,0x1042b810,0x0462b804,0xb4a00002, +0x0047b804,0xb5000003,0x0462b805,0xb4600001, +0x0047b805,0x011fa022,0x81df0004,0x81470000, +0x81670001,0x81870008,0x81a70040,0x81c707c4, +0x81e70040,0x81df0000,0x00000000,0x00000000, +0xb6000432,0xb00a0001,0xb4e00004,0x80c71000, +0x80e71000,0x81171040,0xb5000003,0x80c71040, +0x80e71040,0x81171000,0x844d0004,0x10e7b802, +0xb62b001f,0x0017b806,0x0097b807,0xb62c0004, +0x40048020,0x480487e4,0x00000000,0x0108a020, +0x0017b806,0x0097b807,0x0197b80e,0x00000000, +0x001f8020,0x042087e4,0xb62c000f,0x4041800c, +0x001f8020,0x0048b802,0x5e38802c,0x2e11b801, +0x042087e4,0x1042b810,0x0462b804,0xb4a00002, +0x0047b804,0xb5000003,0x0462b805,0xb4600001, +0x0047b805,0x011fa022,0x10c6b80f,0x10e7b80f, +0x5961b80b,0x5d81b80c,0x5da1b80d,0x5de1b80f, +0x914a0001,0x954a0001,0x11ceb80f,0x81df0004, +0x80171034,0x81171f84,0x80470000,0x41448040, +0x49448640,0x00000000,0x0188b80a,0x49448100, +0x49448780,0x00000000,0x0108a08a,0x4144b80c, +0x49448040,0x49448080,0x494487c0,0x00000000, +0x0108a16a,0x4145b80c,0x49458700,0x00000000, +0x0188b80a,0x494581a0,0x494586e0,0x00000000, +0x0108a66a,0x4145b80c,0x49448040,0x494487e0, +0x00000000,0x0188b80a,0x011fa1ec,0x4145b80c, +0x49458100,0x49458780,0x00000000,0x0108a08a, +0x41458720,0x49458100,0x494586e0,0x49458160, +0x49458020,0x49458020,0x49458760,0x00000000, +0x0108a08a,0x414587a0,0x49458080,0x49458760, +0x494580c0,0x49458700,0x49458140,0x49458020, +0x49458760,0x00000000,0x0108a74a,0x414587a0, +0x49458080,0x49458760,0x494580e0,0x49458700, +0x49458120,0x49458020,0x49458760,0x00000000, +0x0108a08a,0x41458720,0x49458100,0x494586e0, +0x49458140,0x49458040,0x49458020,0x49458720, +0x00000000,0x0108a0ca,0x41458080,0x49458040, +0x49458020,0x49458620,0x00000000,0x0188b80a, +0x49458080,0x00000000,0x0108a7ca,0x4144b80c, +0x49458040,0x49458020,0x49458080,0x00000000, +0x0108a5ea,0x41448080,0x49448700,0x00000000, +0x0188b80a,0x49448780,0x00000000,0x0108a7ca, +0x4144b80c,0x49448140,0x00000000,0x0108a7ca, +0x49448040,0x00000000,0x0108a0ca,0x41448700, +0x00000000,0x0188b80a,0x49448000,0x00000000, +0x0108a04a,0x011fa00c,0x80171f80,0x81df0000, +0x00000000,0x00000000,0xb6002006,0x40048000, +0x48048000,0x48048000,0x48048000,0x00000000, +0x0008a020,0x81df0004,0x00ffb81d,0x00000000, +0x80770000,0x8057ffff,0x015f05b9,0x017f05bb, +0x8293ffff,0x9a94ffff,0x81a70000,0x81df0000, +0x00000000,0x00000000,0xb62a003a,0xaded0180, +0xae0d0180,0xadcd0080,0x902f1980,0x0017b801, +0xb6002033,0x904e01b8,0x00000000,0x013ff002, +0xb0090000,0xb400001f,0x904f02b8,0x80c70000, +0x011fd802,0x6829b808,0x94210001,0xb0010001, +0xb4e00001,0x00c7b814,0x6429b806,0x80470001, +0x6449b802,0x84420001,0x1442b808,0x84690001, +0x5863b803,0x906300dc,0x1042b801,0x003f9803, +0x90420001,0x4082b801,0x90630004,0x003f9803, +0x00000000,0x5897b804,0x1804b805,0x4082b801, +0x00000000,0x00000000,0x00000000,0x10a4b800, +0xb5000001,0x80a70000,0x90501c80,0x00000000, +0x007ff002,0x5842b803,0x904205f8,0x0097b802, +0x00000000,0x40058004,0x48058004,0x00000000, +0x0008a020,0x91ce0004,0x91ef0004,0x92100004, +0x91ad0001,0x81df0004,0x00ffb81a,0x80770000, +0x8057ffff,0x80d7ffff,0x015f05b9,0x017f05bb, +0x8293ff80,0x9a940000,0x82a70020,0x81a70000, +0x81e702b8,0x80171980,0x81df0000,0x00000000, +0x00000000,0xb62a004f,0xb600034d,0xac0d0080, +0xac4d0180,0xac960080,0x822700bc,0x91c001b8, +0x00000000,0x1042b804,0x92021c80,0xb62b003a, +0x013ff00e,0x00fff011,0xb0090000,0xb4000027, +0x10e7b809,0x5821b807,0x902100dc,0x00000000, +0x001fd801,0x82470000,0x80270001,0x6452b801, +0x3002b800,0xb4600002,0x92520001,0xb500fffb, +0x86520001,0x80c70000,0x011fd80f,0x6832b808, +0xb0010001,0xb4e00001,0x00c7b814,0x84520017, +0x0056b802,0x80270001,0x6432b801,0x84210001, +0x1408b801,0x6402b800,0x10c6b800,0x9027018c, +0x00000000,0x001ff001,0x5802b800,0x9020073c, +0x904006f8,0x007f9801,0x0097b802,0x10c6b803, +0x40868004,0x48868004,0xb5000003,0x80c70000, +0x40868004,0x00000000,0x0088b804,0x003ff010, +0x5822b801,0x902105f8,0x0097b801,0x91ce0004, +0x91ef0004,0x40448004,0x48448004,0x92100004, +0x0008a022,0x92310001,0x0435b80b,0xb4000007, +0x80870000,0xb6210005,0x001fa024,0x91ce0004, +0x91ef0004,0x92100004,0x92310001,0x00000000, +0x91ad0001,0x81df0004,0x00ffb81a,0x00000000, +0x007f05b9,0x001f0081,0xb0000001,0xb440002d, +0x001f05d8,0xac400080,0x801702b8,0x80970438, +0x90421800,0x0117b802,0x8087ffff,0x80b3ffff, +0x80d3007f,0x98c6ff00,0x80f3ff80,0x81070080, +0x81df0000,0x00000000,0x00000000,0xb6002018, +0x10088020,0x0056b800,0x0442b806,0xb4a00004, +0xb0000000,0x0007b806,0xb4400001,0x0007b807, +0x0027b800,0x5c08b800,0x1400b804,0xb0030001, +0xb4000008,0x10288024,0x0056b801,0x0442b806, +0xb4a00004,0xb0010000,0x0027b806,0xb4400001, +0x0027b807,0x5828b801,0x1421b805,0x1900a021, +0x81df0004,0x001f05d8,0x90000001,0x001f25d8, +0x00ffb81a,0x801702b8,0x80970438,0x81171800, +0x8087ffff,0x80b3ffff,0x80d3007f,0x98c6ff00, +0x80f3ff80,0x81070080,0x81df0000,0x00000000, +0x00000000,0xb6006018,0x10088020,0x0056b800, +0x0442b806,0xb4a00004,0xb0000000,0x0007b806, +0xb4400001,0x0007b807,0x0027b800,0x5c08b800, +0x1400b804,0xb0030001,0xb4000008,0x10288024, +0x0056b801,0x0442b806,0xb4a00004,0xb0010000, +0x0027b806,0xb4400001,0x0027b807,0x5828b801, +0x1421b805,0x1900a021,0x81df0004,0x00ffb81a, +0x001f0081,0xb0000001,0xb4400006,0x001f05d8, +0xb0000003,0xb4000003,0x80270001,0x003f25dc, +0x00ffb81a,0x003f05d9,0x009f05cb,0xb0010000, +0xb400000e,0x015f42ed,0x81070000,0x8127017c, +0xb00a0000,0xb4000002,0x81070180,0x812702fc, +0x802500a5,0x9421ffff,0x3001b808,0xb4800011, +0x3001b809,0xb4a0007f,0xb500000e,0x001f0081, +0xb0000001,0xb4400003,0xb0040002,0xb4200006, +0xb5000002,0xb0040000,0xb4200003,0x802702ff, +0x81470000,0xb5000003,0x80270001,0x003f25d9, +0x81470180,0xb0040000,0xb4200001,0x838402e6, +0x80070000,0x001f25d8,0x009f902d,0x80af001f, +0x808f0000,0x806f0000,0x8007ffff,0x8033ffff, +0x80171800,0x81df0000,0x807bff8c,0x94630003, +0xb0030003,0xb4000016,0xb0030002,0xb4000035, +0xb0030001,0xb4000024,0xb6006010,0x14618000, +0x6068b803,0x40c4b803,0x14608000,0x00c8b806, +0x5870b803,0x6068b803,0x4104b803,0x58c8b806, +0x0108b808,0x14c6b801,0x00000000,0x00000000, +0x5d08b808,0x1508b800,0x1806a028,0xb5000030, +0xb6006010,0x14618000,0x6068b803,0x40c4b803, +0x14608000,0x00c8b806,0x5870b803,0x6068b803, +0x4104b803,0x5cc8b806,0x0108b808,0x14c6b800, +0x00000000,0x00000000,0x5908b808,0x1508b801, +0x1806a028,0xb500001e,0xb600600d,0x14618000, +0x6068b803,0x40c4b803,0x00000000,0x00c8b806, +0x00000000,0x00000000,0x00000000,0x5d08b806, +0x1508b800,0x58c8b806,0x14c6b801,0x1806a028, +0xb500000f,0xb600600e,0x14608000,0x5868b803, +0x6068b803,0x40c4b803,0x00000000,0x00c8b806, +0x00000000,0x00000000,0x00000000,0x5d08b806, +0x1508b800,0x58c8b806,0x14c6b801,0x1806a028, +0x81df0004,0x80670600,0x5d22b80a,0x81df0000, +0x00000000,0x00000000,0xb600030a,0x00cfb803, +0x013fb178,0x5922b809,0x01afb809,0x013f9178, +0x0047b86f,0xb0020001,0xb4c0fffd,0x90630020, +0x91290020,0x81df0004,0x81270180,0xb00a0000, +0xb4000001,0x81270000,0x013f62ed,0x80270001, +0x003f25dc,0x00ffb81a,0x801bff7c,0x00000000, +0x94000080,0xb0000080,0xb400ff61,0x001f0081, +0xb0000001,0xb4400006,0x001f05d8,0xb0000003, +0xb4000003,0x80270001,0x003f25dc,0x00ffb81a, +0x003f05d9,0x009f05cb,0xb0010000,0xb400000e, +0x015f42ed,0x81070000,0x812702fc,0xb00a0000, +0xb4000002,0x81070300,0x812705fc,0x802500a5, +0x9421ffff,0x3001b808,0xb4800011,0x3001b809, +0xb4a00073,0xb500000e,0x001f0081,0xb0000001, +0xb4400003,0xb0040002,0xb4200006,0xb5000002, +0xb0040000,0xb4200003,0x802705ff,0x81470000, +0xb5000003,0x80270001,0x003f25d9,0x81470300, +0xb0040000,0xb4200001,0x83840247,0x80070000, +0x001f25d8,0x009f902d,0x80af001f,0x808f0000, +0x806f0000,0x8007ffff,0x8033ffff,0x80171800, +0x807bff8c,0x80971980,0x81df0000,0x94630003, +0xb0030003,0xb4000013,0xb0030002,0xb400002c, +0xb0030001,0xb400001e,0xb600600d,0x58708000, +0x6068b803,0x40c4b803,0x14618020,0x00c8b806, +0x6068b803,0x4104b803,0x00000000,0x0108b808, +0x5887a026,0x00000000,0x00000000,0x5887a028, +0xb5000026,0xb600600d,0x14618000,0x6068b803, +0x40c4b803,0x58708020,0x00c8b806,0x6068b803, +0x4104b803,0x00000000,0x0108b808,0x5887a026, +0x00000000,0x00000000,0x5887a028,0xb5000017, +0xb600600a,0x14618000,0x6068b803,0x40c4b803, +0x00000000,0x00c8b806,0x00000000,0x00000000, +0x00000000,0x5887a026,0x5887a026,0xb500000b, +0xb600600a,0x58708000,0x6068b803,0x40c4b803, +0x00000000,0x00c8b806,0x00000000,0x00000000, +0x00000000,0x5887a026,0x5887a026,0x81df0004, +0x80670660,0x5d22b80a,0x81df0000,0x00000000, +0x00000000,0xb600060a,0x00cfb803,0x013fb178, +0x5922b809,0x01afb809,0x013f9178,0x0047b86f, +0xb0020001,0xb4c0fffd,0x90630020,0x91290020, +0x81df0004,0x81270300,0xb00a0000,0xb4000001, +0x81270000,0x013f62ed,0x80270001,0x003f25dc, +0x00ffb81a,0x00000000,0x00000000,0x00000000, +0x029fb024,0x02bfb025,0x02dfb026,0x02ffb027, +0x031fb028,0x033fb029,0x033f4046,0x0287b86f, +0x029fb02a,0x8285009c,0x96b48000,0xb0158000, +0xb400018e,0x96b40100,0xb0150100,0xb40001a4, +0x96b40400,0xb0150400,0xb40001a5,0x96b40001, +0xb0150001,0xb400000c,0x96b40008,0xb0150008, +0xb4000197,0x96b44000,0xb0154000,0xb40001a4, +0x96b40002,0xb0150002,0xb400015b,0x00000000, +0x00000000,0xb50001b6,0x02bf917e,0x92b50001, +0x02bfb17e,0x82850082,0x5efdb814,0x96f70001, +0xb0170001,0xb420000b,0x83050069,0x9718003f, +0x82e50064,0x12f7b818,0x86f70109,0x82feff74, +0x02e7b86f,0x9af74000,0x01ffb817,0x96f7bfff, +0x01ffb817,0x83050081,0x82a5009a,0x96b50001, +0xb0150001,0xb4200014,0x82a70000,0x02bfb17e, +0x96b41840,0xb0150800,0xb420000c,0x96b40008, +0x5aa9b815,0x96d46000,0x5ec3b816,0x82f3000f, +0x9af7c00f,0x1718b817,0x1ab5b818,0x1ab5b816, +0x9ab50340,0x82a60081,0xb500012b,0x9b180180, +0x83060081,0xb5000128,0x82a5009a,0x96b50002, +0xb0150002,0xb420001b,0x82a70000,0x02bfb17e, +0x96b41800,0xb0151800,0xb4000013,0x96b40040, +0xb0150040,0xb4200004,0xa3180c00,0x9b180340, +0x83060081,0xb5000118,0x96b40008,0x5aa9b815, +0x96d46000,0x5ec3b816,0x82f3000f,0x9af7c00f, +0x1718b817,0x1ab5b818,0x1ab5b816,0x9ab50340, +0x82a60081,0xb500010c,0x9b180180,0x83060081, +0xb5000109,0x82a500c1,0x96b5000f,0xb015000b, +0xb420000e,0x96b40020,0xb0150020,0xb400000b, +0x96b40200,0xb0150200,0xb4000008,0x82c50086, +0x82e50094,0x3016b817,0xb4400004,0x06f7b816, +0xb017ff00,0xb4400001,0xb50000f7,0x96b46000, +0xb0156000,0xb4000011,0x96b41820,0xb0150820, +0xb4200004,0x9b391000,0x82a5009a,0x96b5feff, +0x82a6009a,0x96b40040,0xb0150040,0xb4200001, +0x9739efff,0x96b91000,0xb0151000,0xb4200003, +0x82a5009a,0x9ab50100,0x82a6009a,0x96b40040, +0xb0150040,0xb4200019,0x96b41800,0xb0151800, +0xb4200006,0x96b98000,0xb0158000,0xb4200003, +0x9b180180,0x83060081,0xb50000d7,0x96d80c00, +0x82b300ff,0x9ab5f3ff,0x1718b815,0xb0160c00, +0xb4000007,0x82e50098,0x96f70400,0xb0170400, +0xb4200002,0x82c70c00,0xb5000001,0xa2d60c00, +0x1b18b816,0x9b180340,0xb50000bd,0x96b40220, +0xb0150000,0xb4e00021,0x82a5009d,0x82f3ffff, +0x16b5b817,0x82f3000e,0x3015b817,0xb420001b, +0x96f98000,0xb0178000,0xb4000018,0x82a70000, +0x02bfb17e,0x82c5009d,0x96d6ffff,0x82b30032, +0x9ab58001,0x82e500c1,0x96f7000f,0xb017000b, +0xb4000002,0x82b30022,0x9ab58001,0x1ab5b816, +0x82c5009a,0x96d60020,0xb0160020,0xb4200002, +0x82b30032,0x9ab58001,0x82a6009d,0x02ff917e, +0x00000000,0xb0170040,0xb4800000,0x5eb5b814, +0x96b500f0,0x96f46000,0x5eedb817,0x1ab5b817, +0xb0170003,0xb4000004,0x96b500ef,0x96f70001, +0x5ae4b817,0x1ab5b817,0x96d41800,0xb0161800, +0xb400000a,0x96f900ff,0x96b500ff,0x9739ff00, +0x1b39b815,0x02a7b817,0x96b500f3,0x96d40008, +0x5ec1b816,0x1ab5b816,0xb500000c,0x96f98000, +0xb0178000,0xb4200007,0x5efeb814,0x96f70001, +0xb0170001,0xb4000003,0x9b180180,0x83060081, +0xb5000081,0x96b500f3,0x9ab50008,0x9739fff3, +0x96d40020,0xb0160020,0xb4200017,0x9b398000, +0x82c70000,0x02dfb17e,0x96d40010,0x5ac8b816, +0x82f300ff,0x9af7cfff,0x1718b817,0x1b18b816, +0x9b180340,0x82c5009d,0x96d6ffff,0x82f3000e, +0x9af78001,0x1af7b816,0x82c5009a,0x96d60020, +0xb0160020,0xb4200002,0x82f30032,0x9af78001, +0x82e6009d,0xb500005a,0x97397fff,0x96b500ff, +0x5aaab815,0x82f300fc,0x9af703ff,0x1718b817, +0x1b18b815,0x9b180340,0x82c5009a,0x96d60010, +0xb0160010,0xb4200024,0x82c70000,0x02dfb17e, +0x82c50086,0x92d60e10,0x82c60086,0x82c50094, +0x5eefb818,0x96f70003,0xb0170003,0xb4200002, +0x82e70e10,0xb5000001,0x82e70e10,0x12d6b817, +0x82e50081,0x9af70020,0x82e60081,0x82c60094, +0xa2f70020,0x82e60081,0x82f30001,0x16f7b818, +0x5ef0b817,0xb0170001,0xb4000004,0x96f84000, +0x5ee4b817,0x9718f3ff,0x1b18b817,0x82f3000a, +0x9af78000,0x82e6009d,0x83060081,0x83070001, +0x8306009f,0xb5000096,0x82c5009d,0x82f3000e, +0x9af78001,0x3016b817,0xb420000f,0x82b30032, +0x9ab58001,0x82e500c1,0x96f7000f,0xb017000b, +0xb4000002,0x82b30022,0x9ab58001,0x82c5009a, +0x96d60020,0xb0160020,0xb4200002,0x82b30032, +0x9ab58001,0x82a6009d,0x82c5009a,0x96d60080, +0xb0160080,0xb4000011,0x02df917e,0x00000000, +0xb0160010,0xb480000d,0x82c500c1,0x96d6000f, +0xb016000b,0xb4000009,0x82c50087,0x96d60080, +0x5ac7b816,0x96f84000,0x3017b816,0xb4200003, +0x033f4046,0x9b394000,0xb500000b,0x9739bfff, +0x82e50061,0x96f70008,0xb0170008,0xb4000005, +0x5eefb818,0x96f70003,0xb0170003,0xb4000001, +0x9718ffff,0x83060081,0x83070001,0x8306009f, +0x00000000,0xb500005e,0x82850083,0x96b400ff, +0xb015003c,0xb4200019,0x96b92000,0xb0152000, +0xb4000002,0x9b392000,0xb5000014,0x9739d3ff, +0x82870000,0x82860087,0x82870008,0x82860083, +0x829bff78,0x82a7001f,0xb0140400,0xb4000001, +0x82a70010,0x82a600c9,0x829bff78,0x00000000, +0x828600cb,0x8285009d,0x82b3ffff,0x9ab5fffd, +0x1694b815,0x8286009d,0xb5000000,0x83070002, +0x8306009f,0x00000000,0xb500003d,0x96b90800, +0xb0150800,0xb4200009,0x9739f7ff,0x82a703fd, +0x82a600cb,0x82a7003c,0x82a60083,0x8285009d, +0x9a940002,0x8286009d,0xb5000004,0x82850087, +0x5a82b814,0xa2940200,0x82860087,0xb5000000, +0x83078000,0x8306009f,0x00000000,0xb5000028, +0x83070008,0x8306009f,0x00000000,0xb5000024, +0x83070100,0x8306009f,0x00000000,0xb5000020, +0x83070000,0x83050081,0x9b180180,0x83060081, +0x83070400,0x8306009f,0x00000000,0xb5000018, +0x82870000,0x82850082,0x5eb7b814,0x96b500fc, +0x96d40006,0x5ec1b816,0x1ab5b816,0x5aacb815, +0x83050081,0x82d3001c,0x9ad600ff,0x1718b816, +0x1b18b815,0x9b180e00,0x83060081,0x83074000, +0x8306009f,0x8305009d,0x82d300ff,0x9ad6bfff, +0x1718b816,0x8306009d,0x00000000,0xb5000000, +0x029f902a,0x01ffb814,0x033f6046,0x029f9024, +0x02bf9025,0x02df9026,0x02ff9027,0x031f9028, +0x033f9029,0x00ffb81e,0x02ff917d,0x92f7092f, +0x031f0084,0xb0180001,0xb4200002,0x02ff917d, +0x92f70870,0x02ffb17d,0x02ff917c,0x82bbffdc, +0x829bffd8,0x93150004,0x3014b815,0xb4000017, +0x02dbb818,0x029bb815,0x3017b816,0xb4800013, +0x5a81b814,0x029fb17d,0x82def200,0x82fef204, +0x82e50086,0x06f7b814,0x02f6b817,0x82fef208, +0x82860095,0x82870001,0x829ef220,0x8293001f, +0x9294fe00,0x92b50008,0x3015b814,0xb4800002, +0x82b3001f,0x92b5fa00,0x82beffdc,0x82850086, +0x83250094,0x06d4b819,0x02d6b816,0xb016ffff, +0xb4a00009,0x82c50081,0x9ab60020,0x82a60081, +0x82a50086,0x92b50e10,0x82a60094,0x82c60081, +0x86b50704,0x82a6009b,0x00ffb81c,0x00000000, +0x001f9012,0x001fb200,0x001f004c,0x001f2804, +0x801bfef0,0x8058fef4,0x803bff68,0x8078ff6c, +0x2000b801,0x2042b803,0x001fb204,0x005f2814, +0x82e70001,0x83640048,0x029fb014,0x829efef0, +0x8286000f,0x02bf2054,0x82bcfef4,0x82a6000e, +0x00ffb81a,0x80e70001,0x801336e3,0x9800eb76, +0x001fb200,0x800700ab,0x001f2804,0x801bc3e8, +0x8058c3ec,0x83640024,0x82e70000,0x83640036, +0x029fb3c0,0x029fb200,0x02bf2f04,0x02bf2804, +0x801bc000,0x8058c004,0x8364001b,0x82e70000, +0x8364002d,0x001f93c0,0x3000b814,0xb420000a, +0x001f0f04,0x3000b815,0xb4200007,0x829efef0, +0x82bcfef4,0x029fb012,0x02bf204c,0x82870001, +0x829cfef5,0x00ffb81a,0xb0070000,0xb4000007, +0x80e70000,0x801399fa,0x9800c92e,0x001fb200, +0x800700af,0x001f2804,0xb500ffdc,0x82870000, +0x829cfef5,0x00ffb81a,0x80c700ff,0x803bff68, +0x8078ff6c,0x14a0b806,0x2063b805,0x007f2814, +0x2021b802,0x58c8b806,0x14a0b806,0x58b0b805, +0x2021b805,0x58c8b806,0x14a0b806,0x2021b805, +0x58c8b806,0x14a0b806,0x5cb0b805,0x2021b805, +0x003fb204,0x00ffb81b,0x82c70000,0x83070800, +0x83270005,0x8197080c,0x81d7ffff,0x83840126, +0x83840001,0x00ffb81b,0x808f0000,0x806f001f, +0x80af001f,0x80270240,0x81e77c08,0x5de2b80f, +0xb6000208,0x00cfb801,0x01ffb178,0x59e2b80f, +0x01cfb80f,0x01ff9178,0xb520ffff,0x91ef0020, +0x90210020,0x80270280,0x81e77b00,0x5de2b80f, +0xb6000208,0x00cfb801,0x01ffb178,0x59e2b80f, +0x01cfb80f,0x01ff9178,0xb520ffff,0x91ef0020, +0x90210020,0x8057ffff,0x80170830,0x80070810, +0x80270808,0xb6000509,0x005ff000,0x90420900, +0x007ff001,0x90630a00,0x009ff002,0x00bff003, +0x2004a025,0x90000001,0x90210001,0x80070814, +0x80d7ffff,0x8097085c,0x8017083c,0xb6000404, +0x005ff000,0x007f87e0,0x84000001,0x2082a7e3, +0x80970860,0x80170840,0x2082b803,0x007f8000, +0x2083a004,0x80170830,0x80970850,0x80270808, +0xb6000508,0x005f8024,0x90420900,0x007ff001, +0x90630a00,0x009ff002,0x00bff003,0x2004a025, +0x90210001,0x80170840,0x00000000,0x02bf87e0, +0x80970860,0x82870000,0xb6000404,0x005f87e4, +0x5a88b814,0x204287e0,0x1a94b802,0x00ffb81c, +0x001f0e49,0x001f2b09,0x001f0e41,0x001f2b08, +0x001f0e46,0x001f2b07,0x001f0e48,0x001f2b06, +0x001f0e42,0x001f2b05,0x001f0e47,0x001f2b04, +0x001f0e45,0x001f2b03,0x001f0e43,0x001f2b02, +0x001f0e40,0x001f2b01,0x001f0e44,0x001f2b00, +0x001f0f25,0xa020000c,0x94400001,0x94600002, +0x94810004,0x94a10008,0x94c00010,0x5943b802, +0x5861b803,0x5882b804,0x5ca2b805,0x5cc4b806, +0x194ab803,0x194ab804,0x194ab805,0x194ab806, +0x015f2b38,0x801b7c00,0x003f92c1,0x5c28b801, +0x005f92c2,0x5858b802,0x1821b802,0x2000b801, +0x001fb2c4,0x80187c04,0x003f0b09,0x2000b801, +0x001f2b14,0x82c70001,0x82e70001,0x83070b10, +0x8327001e,0x81970b35,0x8384009f,0x02df0b38, +0x82170e30,0x838400f1,0x819efef0,0x817cfef4, +0x819eff68,0x817cff6c,0x00ffb81b,0x820f001f, +0x8018fef8,0x8057ffff,0x001f2b09,0x8018fef6, +0x80d7ffff,0x001f2b08,0x8018fefa,0x8157ffff, +0x001f2b07,0x8018fefd,0x81d7ffff,0x001f2b06, +0x8018fefb,0x802f001f,0x001f2b05,0x8018fefe, +0x00000000,0x001f2b04,0x8018fef9,0x00000000, +0x001f2b03,0x8018feff,0x00000000,0x001f2b02, +0x8018fef7,0x00000000,0x001f2b01,0x8018fefc, +0x00000000,0x001f2b00,0x001f0f25,0xa0200011, +0x94410001,0x94600002,0x94800004,0x94a00008, +0x94c10010,0x5941b802,0x5861b803,0x5c82b804, +0x58a1b805,0x5cc1b806,0x194ab803,0x194ab804, +0x194ab805,0x194ab806,0x015f2b38,0x801b7c00, +0x003f92c1,0x5c28b801,0x005f92c2,0x5858b802, +0x1821b802,0x2000b801,0x001fb2c4,0x80187c04, +0x003f0b09,0x2000b801,0x001f2b14,0x82c70001, +0x82e70001,0x83070b10,0x8327001e,0x81970b35, +0x83840055,0x02df0b38,0x82170e20,0x838400a7, +0x819efef0,0x817cfef4,0x5ac8b80c,0x02ff0e44, +0x1ad6b817,0x02dfb391,0x5ed8b80c,0x5968b80b, +0x1ad6b80b,0x02df6724,0x00ffb81b,0x820f001f, +0x8018fefe,0x8057ffff,0x001f2b09,0x8018fefa, +0x80d7ffff,0x001f2b08,0x8018fefc,0x8157ffff, +0x001f2b07,0x8018feff,0x81d7ffff,0x001f2b06, +0x8018fef8,0x802f001f,0x001f2b05,0x8018fefb, +0x00000000,0x001f2b04,0x8018fefd,0x00000000, +0x001f2b03,0x8018fef6,0x00000000,0x001f2b02, +0x8018fef9,0x00000000,0x001f2b01,0x8018fef7, +0x00000000,0x001f2b00,0x801b7c00,0x003f92c1, +0x5c28b801,0x005f92c2,0x5858b802,0x1821b802, +0x2000b801,0x001fb2c4,0x80187c04,0x003f0b09, +0x2000b801,0x001f2b14,0x82c70001,0x82e70001, +0x83070b10,0x8327001e,0x81970b35,0x83840016, +0x83270000,0x831bfef0,0x82f8fef4,0x02c7b819, +0x82170e28,0x83840065,0x300cb818,0xb4200002, +0x300bb817,0xb4000006,0x93390001,0xb0190020, +0xb480fff6,0x83270000,0x833cfef5,0x00ffb81b, +0x019fb390,0x017f2e44,0x033f2f25,0x83270001, +0x833cfef5,0x00ffb81b,0x0007b818,0x90000003, +0x00000000,0x015ff000,0x90000001,0x5949b80a, +0x013ff000,0x194ab809,0x84000002,0x994a0100, +0x017ff000,0x958b00f8,0x5981b80c,0x956b0007, +0x198cb80b,0x84000002,0x998c0008,0x017ff000, +0x90000001,0x5971b80b,0x198cb80b,0x017ff000, +0x5969b80b,0x198cb80b,0x81a70000,0x94d90003, +0x82a70000,0xb6260019,0xb6000818,0x5df0b80a, +0x5e02b80a,0x21efb810,0x95ef0001,0x5941b80a, +0x194ab80f,0x21efb816,0x5e18b80c,0x5e35b80c, +0x5e54b80c,0x5e6cb80c,0x2210b811,0x2252b813, +0x2210b812,0x96100001,0x5981b80c,0x198cb810, +0x2210b817,0x10afb810,0x10a5b80d,0x5da1b805, +0x94a50001,0x5aa1b815,0x1ab5b805,0x019fa7f5, +0x5cc2b819,0xb626001c,0x82870000,0xb6000419, +0xb6000818,0x5df0b80a,0x5e02b80a,0x21efb810, +0x95ef0001,0x5941b80a,0x194ab80f,0x21efb816, +0x5e18b80c,0x5e35b80c,0x5e54b80c,0x5e6cb80c, +0x2210b811,0x2252b813,0x2210b812,0x96100001, +0x5981b80c,0x198cb810,0x2210b817,0x10afb810, +0x10a5b80d,0x5da1b805,0x94a50001,0x5a81b814, +0x1a94b805,0x019fa7f4,0x00ffb81c,0x8257ffff, +0x808f0000,0x806f001f,0x80af001f,0x80270300, +0x81e778e0,0x5de2b80f,0xb6000208,0x00cfb801, +0x01ffb178,0x59e2b80f,0x01cfb80f,0x01ff9178, +0xb520ffff,0x91ef0020,0x90210020,0x80270340, +0x81e779e0,0x5de2b80f,0xb6000208,0x00cfb801, +0x01ffb178,0x59e2b80f,0x01cfb80f,0x01ff9178, +0xb520ffff,0x91ef0020,0x90210020,0x80270280, +0x81e77b00,0x5de2b80f,0xb6000208,0x00cfb801, +0x01ffb178,0x59e2b80f,0x01cfb80f,0x01ff9178, +0xb520ffff,0x91ef0020,0x90210020,0x806f0007, +0x80af0007,0x80270380,0x81e77ae0,0x5de2b80f, +0x00cfb801,0x01ffb178,0x59e2b80f,0x01cfb80f, +0x01ff9178,0xb520ffff,0x91ef0020,0x90210020, +0x80170b60,0x001f0b00,0x001fa020,0x001f0b01, +0x001fa020,0x001f0b02,0x001fa020,0x001f0b03, +0x001fa020,0x001f0b04,0x001fa000,0x80970b50, +0x81170b70,0x82a70b35,0x83a40060,0x001f87e4, +0xb6000405,0x86b50001,0x83a4005c,0x001f8004, +0x003f87e8,0x2080a7e1,0x80970b70,0x80170b50, +0x81170b50,0x81970b40,0x82a70b30,0x001f800c, +0x003f8008,0x2100a001,0x83a40050,0x001f87e4, +0xb6000405,0x86b50001,0x83a4004c,0x001f8004, +0x003f87e8,0x2080a7e1,0x80970b50,0x80170b70, +0x81170b70,0x81970b60,0x82a70b2b,0x001f800c, +0x003f8008,0x2100a001,0x83a40040,0x83a4004e, +0xb6000407,0x86b50001,0x83a4003c,0x001f8004, +0x003f87e8,0x2080a001,0x83a40047,0x00000000, +0x80970b70,0x80170b50,0x81170b50,0x81970b40, +0x82a70b26,0x001f800c,0x003f8008,0x2100a001, +0x83a4002e,0x83a4003c,0xb6000407,0x86b50001, +0x83a4002a,0x001f8004,0x003f87e8,0x2080a001, +0x83a40035,0x00000000,0x80970b50,0x80170b70, +0x81170b70,0x81970b60,0x82a70b21,0x001f800c, +0x003f8008,0x2100a001,0x83a4001c,0x001f87e4, +0xb6000405,0x86b50001,0x83a40018,0x001f8004, +0x003f87e8,0x2080a7e1,0x80970b70,0x80170b50, +0x81170b50,0x81970b40,0x82a70b1c,0x001f800c, +0x003f8008,0x2100a001,0x83a4000c,0x017f87e4, +0x81870000,0xb6000406,0x86b50001,0x83a40007, +0x001f87e4,0x200087e8,0x5988b80c,0x198cb800, +0x021fa02c,0x021fa00b,0x00ffb81c,0x005ff015, +0x90420a00,0x003f87e0,0x001ff002,0x2060b801, +0x90630c00,0x90960e00,0x001ff003,0x003ff004, +0x20a0b801,0x90a50d00,0x00000000,0x001ff005, +0x009fa000,0x00ffb81d,0x001f8004,0x5c21b800, +0x5847b800,0x1821b802,0x942100ff,0x2080a7e1, +0x00ffb81d,0x00000000,0x00000000,0x00000000, + +}; + +static u32 MPGI2SUcode1f5c00[] = { +0x00000000,0xfffff8c0,0x00003540,0xffff8d40, +0x0001fd40,0xfffaf7c0,0x00066b80,0xffdb63c0, +0x00494780,0x00249c40,0x00066b80,0x00050840, +0x0001fd40,0x000072c0,0x00003540,0x00000740, +0xffffffc0,0xfffff840,0x00003680,0xffff7e40, +0x0001f400,0xfffa9cc0,0x0005d1c0,0xffd99600, +0x00493c00,0x0022ce00,0x0006f780,0x0004ad00, +0x000203c0,0x00006440,0x00003400,0x00000680, +0xffffffc0,0xfffff740,0x00003780,0xffff6ec0, +0x0001e800,0xfffa4240,0x00052a00,0xffd7ca00, +0x00491a00,0x0020ffc0,0x00077600,0x00045240, +0x00020800,0x000056c0,0x00003280,0x00000600, +0xffffffc0,0xfffff680,0x00003840,0xffff5ec0, +0x0001d940,0xfff9e8c0,0x00047440,0xffd60080, +0x0048e180,0x001f32c0,0x0007e700,0x0003f7c0, +0x000209c0,0x00004980,0x00003100,0x00000540, +0xffffffc0,0xfffff5c0,0x000038c0,0xffff4e40, +0x0001c780,0xfff990c0,0x0003b000,0xffd43ac0, +0x00489240,0x001d6800,0x00084b00,0x00039e40, +0x00020940,0x00003d00,0x00002f80,0x000004c0, +0xffffffc0,0xfffff4c0,0x00003900,0xffff3d40, +0x0001b2c0,0xfff93a40,0x0002ddc0,0xffd279c0, +0x00482d00,0x001ba040,0x0008a200,0x000345c0, +0x000206c0,0x00003140,0x00002dc0,0x00000440, +0xffffffc0,0xfffff3c0,0x00003900,0xffff2c00, +0x00019b00,0xfff8e640,0x0001fd40,0xffd0be80, +0x0047b1c0,0x0019dc80,0x0008ecc0,0x0002ef00, +0x00020240,0x00002640,0x00002c00,0x00000400, +0xffffff80,0xfffff2c0,0x000038c0,0xffff1a40, +0x00017fc0,0xfff894c0,0x00010e80,0xffcf09c0, +0x004720c0,0x00181d80,0x00092b40,0x000299c0, +0x0001fc00,0x00001bc0,0x00002a40,0x00000380, +0xffffff80,0xfffff180,0x00003800,0xffff0840, +0x00016180,0xfff84680,0x00001180,0xffcd5cc0, +0x00467a40,0x00166440,0x00095e00,0x00024680, +0x0001f440,0x00001200,0x00002840,0x00000340, +0xffffff80,0xfffff040,0x00003740,0xfffef600, +0x00014000,0xfff7fbc0,0xffff0680,0xffcbb880, +0x0045bf00,0x0014b140,0x00098580,0x0001f580, +0x0001ea80,0x00000900,0x00002680,0x000002c0, +0xffffff80,0xffffef00,0x000035c0,0xfffee3c0, +0x00011ac0,0xfff7b540,0xfffded80,0xffca1d80, +0x0044ef80,0x00130580,0x0009a1c0,0x0001a700, +0x0001dfc0,0x00000080,0x000024c0,0x00000280, +0xffffff40,0xffffedc0,0x00003400,0xfffed180, +0x0000f280,0xfff77340,0xfffcc700,0xffc88d80, +0x00440bc0,0x001161c0,0x0009b3c0,0x00015b00, +0x0001d380,0xfffff8c0,0x000022c0,0x00000240, +0xffffff40,0xffffec40,0x00003200,0xfffebf40, +0x0000c680,0xfff73680,0xfffb92c0,0xffc708c0, +0x00431500,0x000fc6c0,0x0009bb80,0x000111c0, +0x0001c640,0xfffff1c0,0x00002100,0x00000200, +0xffffff00,0xffffeac0,0x00002f40,0xfffead00, +0x00009740,0xfff6ff40,0xfffa5180,0xffc59080, +0x00420b40,0x000e3500,0x0009b9c0,0x0000cb80, +0x0001b7c0,0xffffeb40,0x00001f40,0x000001c0, +0xffffff00,0xffffe940,0x00002c40,0xfffe9b00, +0x00006480,0xfff6ce00,0xfff90380,0xffc425c0, +0x0040ef80,0x000cad00,0x0009af00,0x00008840, +0x0001a880,0xffffe580,0x00001d40,0x000001c0, +0xfffffec0,0xffffe7c0,0x000028c0,0xfffe8980, +0x00002e40,0xfff6a3c0,0xfff7a900,0xffc2c900, +0x003fc280,0x000b2fc0,0x00099b80,0x00004800, +0x00019880,0xffffe040,0x00001bc0,0x00000180, +0xfffffec0,0xffffe600,0x00002480,0xfffe7840, +0xfffff4c0,0xfff68040,0xfff64240,0xffc17b40, +0x003e84c0,0x0009bdc0,0x00097fc0,0x00000b40, +0x000187c0,0xffffdb80,0x00001a00,0x00000140, +0xfffffe80,0xffffe440,0x00001fc0,0xfffe6780, +0xffffb800,0xfff66480,0xfff4d040,0xffc03d80, +0x003d3700,0x00085700,0x00095c40,0xffffd1c0, +0x00017680,0xffffd740,0x00001840,0x00000140, +0xfffffe40,0xffffe2c0,0x00001a80,0xfffe5780, +0xffff77c0,0xfff65100,0xfff35300,0xffbf1080, +0x003bda40,0x0006fc80,0x00093200,0xffff9b80, +0x00016500,0xffffd3c0,0x000016c0,0x00000100, +0xfffffe40,0xffffe0c0,0x000014c0,0xfffe4840, +0xffff3480,0xfff64640,0xfff1cb00,0xffbdf4c0, +0x003a6f80,0x0005ae80,0x000900c0,0xffff68c0, +0x00015300,0xffffd0c0,0x00001540,0x00000100, +0xfffffe00,0xffffdf00,0x00000e40,0xfffe39c0, +0xfffeee40,0xfff64480,0xfff03940,0xffbceb00, +0x0038f740,0x00046d40,0x0008c980,0xffff3980, +0x000140c0,0xffffce00,0x000013c0,0x000000c0, +0xfffffdc0,0xffffdd40,0x00000740,0xfffe2c80, +0xfffea500,0xfff64c40,0xffee9e40,0xffbbf440, +0x00377280,0x00033900,0x00088cc0,0xffff0d80, +0x00012e80,0xffffcc00,0x00001240,0x000000c0, +0xfffffd80,0xffffdb40,0xffffff80,0xfffe2040, +0xfffe5900,0xfff65e40,0xffecfa80,0xffbb1080, +0x0035e280,0x00021280,0x00084ac0,0xfffee540, +0x00011c40,0xffffca40,0x00001100,0x00000080, +0xfffffd40,0xffffd980,0xfffff700,0xfffe1580, +0xfffe0a80,0xfff67a80,0xffeb4ec0,0xffba4100, +0x00344780,0x0000f980,0x00080440,0xfffec000, +0x00010a00,0xffffc8c0,0x00000fc0,0x00000080, +0xfffffcc0,0xffffd7c0,0xffffee00,0xfffe0bc0, +0xfffdb980,0xfff6a200,0xffe99bc0,0xffb985c0, +0x0032a340,0xffffee80,0x0007b980,0xfffe9e80, +0x0000f7c0,0xffffc800,0x00000e80,0x00000080, +0xfffffc80,0xffffd5c0,0xffffe440,0xfffe0400, +0xfffd6640,0xfff6d4c0,0xffe7e280,0xffb8df40, +0x0030f640,0xfffef180,0x00076b40,0xfffe8040, +0x0000e5c0,0xffffc740,0x00000d40,0x00000080, +0xfffffc00,0xffffd400,0xffffd9c0,0xfffdfdc0, +0xfffd1100,0xfff71340,0xffe62380,0xffb84e40, +0x002f4180,0xfffe02c0,0x000719c0,0xfffe6500, +0x0000d400,0xffffc700,0x00000c40,0x00000040, +0xfffffbc0,0xffffd240,0xffffcec0,0xfffdf940, +0xfffcba40,0xfff75e00,0xffe45fc0,0xffb7d300, +0x002d8640,0xfffd2240,0x0006c5c0,0xfffe4d40, +0x0000c2c0,0xffffc700,0x00000b40,0x00000040, +0xfffffb40,0xffffd080,0xffffc300,0xfffdf6c0, +0xfffc61c0,0xfff7b500,0xffe29800,0xffb76dc0, +0x002bc540,0xfffc5000,0x00066f40,0xfffe3880, +0x0000b1c0,0xffffc740,0x00000a40,0x00000040, +0xfffffac0,0xffffcf00,0xffffb680,0xfffdf640, +0xfffc0840,0xfff81900,0xffe0cd40,0xffb71e80, +0x0029ff80,0xfffb8bc0,0x00061740,0xfffe26c0, +0x0000a140,0xffffc7c0,0x00000980,0x00000040, +0xfffffa00,0xffffcd80,0xffffa940,0xfffdf800, +0xfffbadc0,0xfff88a00,0xffdf0040,0xffb6e600, +0x00283600,0xfffad600,0x0005bdc0,0xfffe1800, +0x00009140,0xffffc880,0x000008c0,0x00000040, +0xfffff980,0xffffcc00,0xffff9bc0,0xfffdfc40, +0xfffb5300,0xfff90880,0xffdd3200,0xffb6c400, +0x00266a00,0xfffa2e40,0x00056340,0xfffe0c00, +0x000081c0,0xffffc980,0x000007c0,0x00000040, +0x004013c2,0x0040b346,0x0041fa2d,0x0043f934, +0x0046cc1c,0x004a9d9d,0x004fae37,0x0056601f, +0x005f4cf7,0x006b6fcf,0x007c7d1e,0x0115b035, +0x013df91b,0x0207655e,0x03342c83,0x0a185230, +0x00404f46,0x0042e13c,0x0048919f,0x0052cb0e, +0x0064e240,0x0107c449,0x015c7926,0x050cf270, +0x004140fb,0x004cf8df,0x0073326c,0x02480d9d, +0x004545ea,0x01273d75,0x005a827a,0x007fffff, +0x006597fb,0x0050a28c,0x00400000,0x0032cbfd, +0x00285146,0x00200000,0x001965ff,0x001428a3, +0x00100000,0x000cb2ff,0x000a1451,0x00080000, +0x00065980,0x00050a29,0x00040000,0x00032cc0, +0x00028514,0x00020000,0x00019660,0x0001428a, +0x00010000,0x0000cb30,0x0000a145,0x00008000, +0x00006598,0x000050a3,0x00004000,0x000032cc, +0x00002851,0x00002000,0x00001966,0x00001429, +0x00001000,0x00000cb3,0x00000a14,0x00000800, +0x00000659,0x0000050a,0x00000400,0x0000032d, +0x00000285,0x00000200,0x00000196,0x00000143, +0x00000100,0x000000cb,0x000000a1,0x00000080, +0x00000066,0x00000051,0x00000040,0x00000033, +0x00000028,0x00000020,0x00000019,0x00000014, +0x00000010,0x0000000d,0x0000000a,0x00000008, +0x00000006,0x00000005,0x00000000,0x00555555, +0x00666666,0x00492492,0x0071c71c,0x00444444, +0x00421084,0x00410410,0x00408102,0x00404040, +0x00402010,0x00401004,0x00400801,0x00400400, +0x00400200,0x00400100,0x00400080,0x00400040, +0x00400000,0x00400000,0x00200000,0x00400000, +0x00100000,0x00080000,0x00040000,0x00020000, +0x00010000,0x00008000,0x00004000,0x00002000, +0x00001000,0x00000800,0x00000400,0x00000200, +0x00000100,0x0003588d,0x0002b15e,0x0002056d, +0x00015600,0x0000a329,0xffffeed9,0xffff3960, +0xfffe8423,0xfffdd11c,0xfffd2048,0xfffc7353, +0xfffbcb6f,0xfffb29a6,0xfffa8f15,0x000494ae, +0x0003f991,0x00032dd1,0xfffd2d8f,0x0001eb47, +0xfffe9968,0x00009af6,0x000011de,0xffff4335, +0x00018d69,0xfffdecd4,0x000302f8,0xfffca0d7, +0x0004683d,0xfffb67f8,0x0005b36d,0x00045963, +0xfffbd51e,0x00030062,0xfffd0dee,0x0001d046, +0xfffe8a0a,0x00009258,0x000012b1,0xffff4d9e, +0x00019ec3,0xfffe0a44,0x0003245a,0xfffcd082, +0x000498f0,0xfffba919,0x0005f304,0x00041bf4, +0xfffba72a,0x0002d19e,0xfffcf060,0x0001b407, +0xfffe7c08,0x0000894a,0x0000138d,0xffff58ac, +0x0001afaf,0xfffe28fe,0x000343bf,0xfffd026f, +0x0004c6f6,0xfffbed06,0x00062e61,0x0003dc0e, +0xfffb7bf1,0x0002a17f,0xfffcd522,0x000196a0, +0xfffe6e70,0x00007ff6,0x00001439,0xffff63f6, +0x0001beb3,0xfffe4882,0x0003616d,0xfffd361b, +0x0004f1cf,0xfffc332a,0x0006658f,0x00039943, +0xfffb52c0,0x00026ec7,0xfffcbb94,0x0001789f, +0xfffe6160,0x00007677,0x000014d4,0xffff6f74, +0x0001cc9b,0xfffe694f,0x00037cbf,0xfffd6b41, +0x000519c2,0xfffc7baf,0x00069971,0x00035486, +0xfffb2d0c,0x00023ad8,0xfffca3ee,0x00015989, +0xfffe55af,0x00006ca7,0x00001570,0xffff7b71, +0x0001d9cb,0xfffe8b46,0x0003959e,0xfffda1fe, +0x00053ee6,0xfffcc6b4,0x0006c950,0x00030e08, +0xfffb0a7a,0x0002061e,0xfffc8ec0,0x00013911, +0xfffe4b1d,0x00006278,0x000015e8,0xffff87b6, +0x0001e577,0xfffeadd6,0x0003acc2,0xfffdda34, +0x00056059,0xfffd136d,0x0006f4b5,0x0002c562, +0xfffaea7c,0x0001cfa6,0xfffc7b14,0x0001182b, +0xfffe4159,0x00005817,0x0000165c,0xffff9417, +0x0001f00f,0xfffed14c,0x0003c199,0xfffe13f6, +0x00057e83,0xfffd61cd,0x00071ba1,0x00027ab5, +0xfffacdc3,0x00019833,0xfffc6989,0x0000f6ca, +0xfffe38da,0x00004d9d,0x000016ef,0xffffa103, +0x0001f98f,0xfffef5c0,0x0003d3d1,0xfffe4f00, +0x0005998c,0xfffdb21e,0x00073e77,0x00022e75, +0xfffab482,0x00015fd1,0xfffc5b13,0x0000d45d, +0xfffe318f,0x000042ed,0x0000176b,0xffffae8f, +0x0002018f,0xffff1a91,0x0003e40c,0xfffe8af2, +0x0005b0ca,0xfffe03b8,0x00075d14,0x0001e141, +0xfffa9e9b,0x0001262a,0xfffc4e31,0x0000b1af, +0xfffe2b26,0x00003805,0x000017b1,0xffffbc21, +0x000208b8,0xffff3fb6,0x0003f1d7,0xfffec7af, +0x0005c4c5,0xfffe5654,0x0007768a,0x000192fe, +0xfffa8bb0,0x0000ec3f,0xfffc4365,0x00008ec9, +0xfffe25f0,0x00002d05,0x000017ec,0xffffc984, +0x00020ec6,0xffff658d,0x0003fcba,0xffff0500, +0x0005d576,0xfffeaa37,0x00078bc6,0x00014367, +0xfffa7bec,0x0000b1f4,0xfffc3b82,0x00006b06, +0xfffe2201,0x000021eb,0x00001823,0xffffd704, +0x0002132a,0xffff8be7,0x00040534,0xffff4315, +0x0005e22e,0xfffeff0a,0x00079ce3,0x0000f33f, +0xfffa6fc9,0x000076ca,0xfffc3558,0x00004762, +0xfffe1ef3,0x000016a1,0x0000183f,0xffffe4a6, +0x00021664,0xffffb27d,0x00040b7b,0xffff81e5, +0x0005eb4e,0xffff5475,0x0007a857,0x0000a2cb, +0xfffa671b,0x00003b64,0xfffc31e2,0x00002416, +0xfffe1ce1,0x00000b46,0x00001850,0xfffff24d, +0x00021855,0xffffd93a,0x00040f75,0xffffc0e6, +0x0005f0e3,0xffffaa3e,0x0007af45,0x0000519f, +0xfffa6218,0x0003f991,0x0003588d,0x0002b15e, +0x0002056d,0x00015600,0x0000a329,0xffffeed9, +0xffff3960,0xfffe8423,0xfffdd11c,0xfffd2048, +0xfffc7353,0xfffbcb6f,0xfffb29a6,0xfffa8f15, +0x000494ae,0x0003c6b0,0xfffc7e8b,0x00028ef6, +0xfffde181,0x000144eb,0xffff5500,0xffffefb9, +0x0000d01d,0xfffe9755,0x000249a4,0xfffd453c, +0x0003b80e,0xfffc01aa,0x000511d6,0xfffad527, +0xfffb334e,0x0003916c,0xfffc5778,0x00026a92, +0xfffdc9f5,0x00013314,0xffff4d99,0xfffff0b6, +0x0000d911,0xfffeab80,0x00026369,0xfffd6c0a, +0x0003e17f,0xfffc39d8,0x000549df,0xfffb1eb2, +0xfffafe6c,0x00035929,0xfffc3321,0x000244a6, +0xfffdb402,0x00012035,0xffff46ac,0xfffff192, +0x0000e16a,0xfffebfe0,0x00027b3d,0xfffd9433, +0x0004087b,0xfffc74b7,0x00057e8d,0xfffb6a81, +0xfffacc1c,0x00031fbe,0xfffc10df,0x00021e0c, +0xfffd9f6d,0x00010cb7,0xffff402e,0xfffff279, +0x0000e965,0xfffed574,0x00029159,0xfffdbdc4, +0x00042c4c,0xfffcb1e7,0x0005b02d,0xfffbb942, +0xfffa9d38,0x0002e44a,0xfffbf0fd,0x0001f5b4, +0xfffd8c38,0x0000f8b1,0xffff3a21,0xfffff391, +0x0000f0e6,0xfffeec44,0x0002a642,0xfffde90e, +0x00044e32,0xfffcf0fb,0x0005de46,0xfffc0b18, +0xfffa71d1,0x0002a659,0xfffbd3de,0x0001cb90, +0xfffd7a97,0x0000e403,0xffff3490,0xfffff49c, +0x0000f7a8,0xffff0340,0x0002b95f,0xfffe1573, +0x00046dbe,0xfffd3284,0x00060888,0xfffc5f51, +0xfffa4996,0x00026786,0xfffbb8df,0x0001a0e1, +0xfffd6a4e,0x0000ced2,0xffff2f75,0xfffff593, +0x0000fdbe,0xffff1a53,0x0002ca87,0xfffe42f5, +0x0004898a,0xfffd7563,0x00062f0b,0xfffcb5de, +0xfffa2508,0x00022713,0xfffba0bf,0x0001754a, +0xfffd5b5f,0x0000b92c,0xffff2acd,0xfffff6b0, +0x0001034f,0xffff3241,0x0002da5c,0xfffe71c6, +0x0004a341,0xfffdb946,0x000651e8,0xfffd0e37, +0xfffa0402,0x0001e4d4,0xfffb8b9c,0x00014898, +0xfffd4e7d,0x0000a304,0xffff26b7,0xfffff7e1, +0x00010846,0xffff4b34,0x0002e897,0xfffea13f, +0x0004ba63,0xfffdff2d,0x00067115,0xfffd6839, +0xfff9e680,0x0001a1fa,0xfffb789e,0x00011b2e, +0xfffd43a4,0x00008c6e,0xffff2341,0xfffff8fd, +0x00010c9c,0xffff6469,0x0002f48f,0xfffed1a4, +0x0004cd6a,0xfffe4608,0x00068c1b,0xfffdc409, +0xfff9cd15,0x00015dfe,0xfffb68a0,0x0000ecee, +0xfffd3a2e,0x0000757d,0xffff204b,0xfffffa1e, +0x00011054,0xffff7da1,0x0002fe9c,0xffff033e, +0x0004de57,0xfffe8dc6,0x0006a2d5,0xfffe213e, +0xfff9b77d,0x000118d3,0xfffb5bde,0x0000be25, +0xfffd3224,0x00005e52,0xffff1dc1,0xfffffb4b, +0x00011353,0xffff9740,0x00030748,0xffff351c, +0x0004ec95,0xfffed755,0x0006b5b4,0xfffe7fc6, +0xfff9a599,0x0000d334,0xfffb519f,0x00008f08, +0xfffd2bbf,0x00004704,0xffff1bc1,0xfffffc71, +0x00011598,0xffffb135,0x00030e43,0xffff6720, +0x0004f6f3,0xffff2119,0x0006c46e,0xfffedf38, +0xfff997c7,0x00008d13,0xfffb4a55,0x00005fa5, +0xfffd273b,0x00002f76,0xffff1a63,0xfffffda0, +0x00011744,0xffffcb67,0x000312ff,0xffff99cf, +0x0004ff0c,0xffff6a9c,0x0006cebd,0xffff3f0a, +0xfff98dbe,0x00004691,0xfffb4620,0x00003010, +0xfffd24fc,0x000017b5,0xffff199d,0xfffffed8, +0x0001185a,0xffffe5c6,0x0003157e,0xffffcce3, +0x000503ae,0xffffb515,0x0006d537,0xffff9f5a, +0xfff98767,0xfffb44b0,0xfffc3131,0xfffd2475, +0xfffe1c28,0xffff195d,0x00001859,0x000118bd, +0x000218df,0x0003163a,0x000410e0,0x000504a7, +0x0005f2b3,0x0006d796,0x0007b1fe,0xfff98537, +0xfffa609b,0xfffc7e8b,0x00028ef6,0xfffde181, +0x000144eb,0xffff5500,0xffffefb9,0x0000d01d, +0xfffe9755,0x000249a4,0xfffd453c,0x0003b80e, +0xfffc01aa,0x000511d6,0xfffad527,0xfffb334e, +0x0003c6b0,0xfffc5778,0x00026a92,0xfffdc9f5, +0x00013314,0xffff4d99,0xfffff0b6,0x0000d911, +0xfffeab80,0x00026369,0xfffd6c0a,0x0003e17f, +0xfffc39d8,0x000549df,0xfffb1eb2,0xfffafe6c, +0x0003916c,0xfffc3321,0x000244a6,0xfffdb402, +0x00012035,0xffff46ac,0xfffff192,0x0000e16a, +0xfffebfe0,0x00027b3d,0xfffd9433,0x0004087b, +0xfffc74b7,0x00057e8d,0xfffb6a81,0xfffacc1c, +0x00035929,0xfffc10df,0x00021e0c,0xfffd9f6d, +0x00010cb7,0xffff402e,0xfffff279,0x0000e965, +0xfffed574,0x00029159,0xfffdbdc4,0x00042c4c, +0xfffcb1e7,0x0005b02d,0xfffbb942,0xfffa9d38, +0x00031fbe,0xfffbf0fd,0x0001f5b4,0xfffd8c38, +0x0000f8b1,0xffff3a21,0xfffff391,0x0000f0e6, +0xfffeec44,0x0002a642,0xfffde90e,0x00044e32, +0xfffcf0fb,0x0005de46,0xfffc0b18,0xfffa71d1, +0x0002e44a,0xfffbd3de,0x0001cb90,0xfffd7a97, +0x0000e403,0xffff3490,0xfffff49c,0x0000f7a8, +0xffff0340,0x0002b95f,0xfffe1573,0x00046dbe, +0xfffd3284,0x00060888,0xfffc5f51,0xfffa4996, +0x0002a659,0xfffbb8df,0x0001a0e1,0xfffd6a4e, +0x0000ced2,0xffff2f75,0xfffff593,0x0000fdbe, +0xffff1a53,0x0002ca87,0xfffe42f5,0x0004898a, +0xfffd7563,0x00062f0b,0xfffcb5de,0xfffa2508, +0x00026786,0xfffba0bf,0x0001754a,0xfffd5b5f, +0x0000b92c,0xffff2acd,0xfffff6b0,0x0001034f, +0xffff3241,0x0002da5c,0xfffe71c6,0x0004a341, +0xfffdb946,0x000651e8,0xfffd0e37,0xfffa0402, +0x00022713,0xfffb8b9c,0x00014898,0xfffd4e7d, +0x0000a304,0xffff26b7,0xfffff7e1,0x00010846, +0xffff4b34,0x0002e897,0xfffea13f,0x0004ba63, +0xfffdff2d,0x00067115,0xfffd6839,0xfff9e680, +0x0001e4d4,0xfffb789e,0x00011b2e,0xfffd43a4, +0x00008c6e,0xffff2341,0xfffff8fd,0x00010c9c, +0xffff6469,0x0002f48f,0xfffed1a4,0x0004cd6a, +0xfffe4608,0x00068c1b,0xfffdc409,0xfff9cd15, +0x0001a1fa,0xfffb68a0,0x0000ecee,0xfffd3a2e, +0x0000757d,0xffff204b,0xfffffa1e,0x00011054, +0xffff7da1,0x0002fe9c,0xffff033e,0x0004de57, +0xfffe8dc6,0x0006a2d5,0xfffe213e,0xfff9b77d, +0x00015dfe,0xfffb5bde,0x0000be25,0xfffd3224, +0x00005e52,0xffff1dc1,0xfffffb4b,0x00011353, +0xffff9740,0x00030748,0xffff351c,0x0004ec95, +0xfffed755,0x0006b5b4,0xfffe7fc6,0xfff9a599, +0x000118d3,0xfffb519f,0x00008f08,0xfffd2bbf, +0x00004704,0xffff1bc1,0xfffffc71,0x00011598, +0xffffb135,0x00030e43,0xffff6720,0x0004f6f3, +0xffff2119,0x0006c46e,0xfffedf38,0xfff997c7, +0x0000d334,0xfffb4a55,0x00005fa5,0xfffd273b, +0x00002f76,0xffff1a63,0xfffffda0,0x00011744, +0xffffcb67,0x000312ff,0xffff99cf,0x0004ff0c, +0xffff6a9c,0x0006cebd,0xffff3f0a,0xfff98dbe, +0x00008d13,0xfffb4620,0x00003010,0xfffd24fc, +0x000017b5,0xffff199d,0xfffffed8,0x0001185a, +0xffffe5c6,0x0003157e,0xffffcce3,0x000503ae, +0xffffb515,0x0006d537,0xffff9f5a,0xfff98767, +0x00004691,0xfffa609b,0xfffb44b0,0xfffc3131, +0xfffd2475,0xfffe1c28,0xffff195d,0x00001859, +0x000118bd,0x000218df,0x0003163a,0x000410e0, +0x000504a7,0x0005f2b3,0x0006d796,0x0007b1fe, +0xfff98537,0xfffbd51e,0x00032dd1,0xfffd2d8f, +0x0001eb47,0xfffe9968,0x00009af6,0x000011de, +0xffff4335,0x00018d69,0xfffdecd4,0x000302f8, +0xfffca0d7,0x0004683d,0xfffb67f8,0x0005b36d, +0x00045963,0xfffba72a,0x00030062,0xfffd0dee, +0x0001d046,0xfffe8a0a,0x00009258,0x000012b1, +0xffff4d9e,0x00019ec3,0xfffe0a44,0x0003245a, +0xfffcd082,0x000498f0,0xfffba919,0x0005f304, +0x00041bf4,0xfffb7bf1,0x0002d19e,0xfffcf060, +0x0001b407,0xfffe7c08,0x0000894a,0x0000138d, +0xffff58ac,0x0001afaf,0xfffe28fe,0x000343bf, +0xfffd026f,0x0004c6f6,0xfffbed06,0x00062e61, +0x0003dc0e,0xfffb52c0,0x0002a17f,0xfffcd522, +0x000196a0,0xfffe6e70,0x00007ff6,0x00001439, +0xffff63f6,0x0001beb3,0xfffe4882,0x0003616d, +0xfffd361b,0x0004f1cf,0xfffc332a,0x0006658f, +0x00039943,0xfffb2d0c,0x00026ec7,0xfffcbb94, +0x0001789f,0xfffe6160,0x00007677,0x000014d4, +0xffff6f74,0x0001cc9b,0xfffe694f,0x00037cbf, +0xfffd6b41,0x000519c2,0xfffc7baf,0x00069971, +0x00035486,0xfffb0a7a,0x00023ad8,0xfffca3ee, +0x00015989,0xfffe55af,0x00006ca7,0x00001570, +0xffff7b71,0x0001d9cb,0xfffe8b46,0x0003959e, +0xfffda1fe,0x00053ee6,0xfffcc6b4,0x0006c950, +0x00030e08,0xfffaea7c,0x0002061e,0xfffc8ec0, +0x00013911,0xfffe4b1d,0x00006278,0x000015e8, +0xffff87b6,0x0001e577,0xfffeadd6,0x0003acc2, +0xfffdda34,0x00056059,0xfffd136d,0x0006f4b5, +0x0002c562,0xfffacdc3,0x0001cfa6,0xfffc7b14, +0x0001182b,0xfffe4159,0x00005817,0x0000165c, +0xffff9417,0x0001f00f,0xfffed14c,0x0003c199, +0xfffe13f6,0x00057e83,0xfffd61cd,0x00071ba1, +0x00027ab5,0xfffab482,0x00019833,0xfffc6989, +0x0000f6ca,0xfffe38da,0x00004d9d,0x000016ef, +0xffffa103,0x0001f98f,0xfffef5c0,0x0003d3d1, +0xfffe4f00,0x0005998c,0xfffdb21e,0x00073e77, +0x00022e75,0xfffa9e9b,0x00015fd1,0xfffc5b13, +0x0000d45d,0xfffe318f,0x000042ed,0x0000176b, +0xffffae8f,0x0002018f,0xffff1a91,0x0003e40c, +0xfffe8af2,0x0005b0ca,0xfffe03b8,0x00075d14, +0x0001e141,0xfffa8bb0,0x0001262a,0xfffc4e31, +0x0000b1af,0xfffe2b26,0x00003805,0x000017b1, +0xffffbc21,0x000208b8,0xffff3fb6,0x0003f1d7, +0xfffec7af,0x0005c4c5,0xfffe5654,0x0007768a, +0x000192fe,0xfffa7bec,0x0000ec3f,0xfffc4365, +0x00008ec9,0xfffe25f0,0x00002d05,0x000017ec, +0xffffc984,0x00020ec6,0xffff658d,0x0003fcba, +0xffff0500,0x0005d576,0xfffeaa37,0x00078bc6, +0x00014367,0xfffa6fc9,0x0000b1f4,0xfffc3b82, +0x00006b06,0xfffe2201,0x000021eb,0x00001823, +0xffffd704,0x0002132a,0xffff8be7,0x00040534, +0xffff4315,0x0005e22e,0xfffeff0a,0x00079ce3, +0x0000f33f,0xfffa671b,0x000076ca,0xfffc3558, +0x00004762,0xfffe1ef3,0x000016a1,0x0000183f, +0xffffe4a6,0x00021664,0xffffb27d,0x00040b7b, +0xffff81e5,0x0005eb4e,0xffff5475,0x0007a857, +0x0000a2cb,0xfffa6218,0x00003b64,0xfffc31e2, +0x00002416,0xfffe1ce1,0x00000b46,0x00001850, +0xfffff24d,0x00021855,0xffffd93a,0x00040f75, +0xffffc0e6,0x0005f0e3,0xffffaa3e,0x0007af45, +0x0000519f,0x00030000,0x000f0007,0x003f001f, +0x00ff007f,0x03ff01ff,0x0fff07ff,0x3fff1fff, +0xffff7fff,0x00030000,0x00070005,0x000f0009, +0x003f001f,0x00ff007f,0x03ff01ff,0x0fff07ff, +0xffff1fff,0x00030000,0x00070005,0x000f0009, +0xffff001f,0x00030000,0xffff0005,0x04030504, +0x08070605,0x0c0b0a09,0x100f0e0d,0x03070504, +0x0605040a,0x0a090807,0x100d0c0b,0x03070503, +0x1005040a,0x10070502,0x03030100,0x03030303, +0x03030303,0x03030303,0x03010100,0x03030301, +0x03030303,0x03030303,0x03010100,0x03030301, +0x03010100,0x04020000,0x08070605,0x0c0b0a09, +0x100f0e0d,0x02010000,0x06050403,0x0a090807, +0x100d0c0b,0x02010000,0x10050403,0x10010000, +0x00030000,0x00090005,0x001f000f,0x007f003f, +0x01ff00ff,0x07ff03ff,0x1fff0fff,0x7fff3fff, +0x00030000,0x00090005,0x001f000f,0x007f003f, +0x0a070504,0x07060504,0x0b0a0908,0x0f0e0d0c, +0x0a070503,0x07060504,0x01010100,0x03030303, +0x03030303,0x03030303,0x01010100,0x03030303, +0x03010000,0x07060504,0x0b0a0908,0x0f0e0d0c, +0x03010000,0x07060504,0x00555555,0x002aaaab, +0x00249249,0x00124925,0x00111111,0x00088889, +0x00084210,0x00421084,0x00041041,0x00020821, +0x00020408,0x00081020,0x00010101,0x00008081, +0x00008040,0x00100804,0x00004010,0x00020080, +0x00002004,0x00004008,0x00001001,0x00000801, +0x00000800,0x00200100,0x00000400,0x00080020, +0x00000200,0x00020004,0x00200000,0x00600040, +0x00a00080,0x00e000c0,0x01200100,0x01600140, +0x01a00180,0x000001c0,0x00300020,0x00400038, +0x00600050,0x00800070,0x00c000a0,0x010000e0, +0x01800140,0x00200000,0x00300028,0x00400038, +0x00600050,0x00800070,0x00c000a0,0x010000e0, +0x00000140,0x00900000,0x00fc00d8,0x01680120, +0x01f801b0,0x02d00240,0x03f00360,0x05a00480, +0x000006c0,0x00680000,0x00b6009c,0x010500d0, +0x016d0139,0x020a01a1,0x02db0272,0x04140343, +0x000004e5,0x006c0000,0x00bd00a2,0x010e00d8, +0x017a0144,0x006301b0,0x013b00cf,0x00c601a7, +0x0000019e,0x00600000,0x00a80090,0x00f000c0, +0x01500120,0x01e00180,0x02a00240,0x03c00300, +0x00000480,0x10000000,0x10101010,0x20101010, +0x20202020,0x20202020,0x28202020,0x28282828, +0x00002828,0x10100000,0x10101010,0x10101010, +0x00000000,0x00000000,0x00000000,0x00000000, +0xcbcecdc4,0xcfcac9c8,0xc3c6c5cc,0xc7c2c1c0, +0x1b1e1d14,0x1f1a1918,0x1316151c,0x17121110, +0x2b2e2d24,0x2f2a2928,0x2326252c,0x27222120, +0x3b3e3d34,0x3f3a3938,0x3336353c,0x37323130, +0x0b0e0d04,0x0f0a0908,0x0306050c,0x07020100, +0xdbdeddd4,0xdfdad9d8,0xd3d6d5dc,0xd7d2d1d0, +0xebeeede4,0xefeae9e8,0xe3e6e5ec,0xe7e2e1e0, +0xfbfefdf4,0xfffaf9f8,0xf3f6f5fc,0xf7f2f1f0, +0x4b4e4d44,0x4f4a4948,0x4346454c,0x47424140, +0x9b9e9d94,0x9f9a9998,0x9396959c,0x97929190, +0xabaeada4,0xafaaa9a8,0xa3a6a5ac,0xa7a2a1a0, +0xbbbebdb4,0xbfbab9b8,0xb3b6b5bc,0xb7b2b1b0, +0x8b8e8d84,0x8f8a8988,0x8386858c,0x87828180, +0x5b5e5d54,0x5f5a5958,0x5356555c,0x57525150, +0x6b6e6d64,0x6f6a6968,0x6366656c,0x67626160, +0x7b7e7d74,0x7f7a7978,0x7376757c,0x77727170, +0x341424c4,0x3e1e2ece,0x3d1d2dcd,0x3b1b2bcb, +0xb494a444,0xbe9eae4e,0xbd9dad4d,0xbb9bab4b, +0xf4d4e404,0xfedeee0e,0xfddded0d,0xfbdbeb0b, +0x74546484,0x7e5e6e8e,0x7d5d6d8d,0x7b5b6b8b, +0x3c1c2ccc,0x361626c6,0x351525c5,0x331323c3, +0xbc9cac4c,0xb696a646,0xb595a545,0xb393a343, +0xfcdcec0c,0xf6d6e606,0xf5d5e505,0xf3d3e303, +0x7c5c6c8c,0x76566686,0x75556585,0x73536383, +0x381828c8,0x3a1a2aca,0x391929c9,0x3f1f2fcf, +0xb898a848,0xba9aaa4a,0xb999a949,0xbf9faf4f, +0xf8d8e808,0xfadaea0a,0xf9d9e909,0xffdfef0f, +0x78586888,0x7a5a6a8a,0x79596989,0x7f5f6f8f, +0x301020c0,0x321222c2,0x311121c1,0x371727c7, +0xb090a040,0xb292a242,0xb191a141,0xb797a747, +0xf0d0e000,0xf2d2e202,0xf1d1e101,0xf7d7e707, +0x70506080,0x72526282,0x71516181,0x77576787, +0x05040100,0x15141110,0x25242120,0x35343130, +0x85848180,0x95949190,0xa5a4a1a0,0xb5b4b1b0, +0xc0408000,0xe060a020,0xd0509010,0xf070b030, +0xc8488808,0xe868a828,0xd8589818,0xf878b838, +0xc4448404,0xe464a424,0xd4549414,0xf474b434, +0xcc4c8c0c,0xec6cac2c,0xdc5c9c1c,0xfc7cbc3c, +0xc2428202,0xe262a222,0xd2529212,0xf272b232, +0xca4a8a0a,0xea6aaa2a,0xda5a9a1a,0xfa7aba3a, +0xc6468606,0xe666a626,0xd6569616,0xf676b636, +0xce4e8e0e,0xee6eae2e,0xde5e9e1e,0xfe7ebe3e, +0xc1418101,0xe161a121,0xd1519111,0xf171b131, +0xc9498909,0xe969a929,0xd9599919,0xf979b939, +0xc5458505,0xe565a525,0xd5559515,0xf575b535, +0xcd4d8d0d,0xed6dad2d,0xdd5d9d1d,0xfd7dbd3d, +0xc3438303,0xe363a323,0xd3539313,0xf373b333, +0xcb4b8b0b,0xeb6bab2b,0xdb5b9b1b,0xfb7bbb3b, +0xc7478707,0xe767a727,0xd7579717,0xf777b737, +0xcf4f8f0f,0xef6faf2f,0xdf5f9f1f,0xff7fbf3f, +0x1045a3e2,0x000000f4,0x263b7333,0x766b2363, +0x2b367e3e,0x7b662e6e,0x06db93d3,0x964b0343, +0x0bd69ede,0x9b460e4e,0x825f1757,0x12cf87c7, +0x8f521a5a,0x1fc28aca,0x00d199d9,0x90410949, +0x01d098d8,0x91400848,0x24357d3d,0x74652d6d, +0x25347c3c,0x75642c6c,0x04d59ddd,0x94450d4d, +0x05d49cdc,0x95440c4c,0x80511959,0x10c189c9, +0x81501858,0x11c088c8,0x02df97d7,0x924f0747, +0x0fd29ada,0x9f420a4a,0x865b1353,0x16cb83c3, +0x8b561e5e,0x1bc68ece,0xa6bbf3b3,0xf6eba3e3, +0xabb6febe,0xfbe6aeee,0x223f7737,0x726f2767, +0x2f327a3a,0x7f622a6a,0xa0b1f9b9,0xf0e1a9e9, +0xa1b0f8b8,0xf1e0a8e8,0x84551d5d,0x14c58dcd, +0x85541c5c,0x15c48ccc,0xa4b5fdbd,0xf4e5aded, +0xa5b4fcbc,0xf5e4acec,0x20317939,0x70612969, +0x21307838,0x71602868,0xa2bff7b7,0xf2efa7e7, +0xafb2faba,0xffe2aaea,0x00000000,0x00000000, + +}; + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/pcm_240.h linux.20pre5-ac2/drivers/media/video/ls220/pcm_240.h --- linux.20pre5/drivers/media/video/ls220/pcm_240.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/pcm_240.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,868 @@ +static u32 PCM240Ucode1f1800[] = { + 0xb500000f, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xb50001fb, 0x00000000, 0x00000000, 0x00000000, + 0x820f001f, 0x802f001f, 0x029f9014, 0x829efef0, + 0x8286000f, 0x02bf0054, 0x82bcfef4, 0x82a6000e, + 0x80074000, 0x001f6193, 0x8013001f, 0x9020c000, + 0x003fb006, 0x803effe8, 0x803effec, 0x9020fa00, + 0x803effd0, 0x803effdc, 0x803effd8, 0x9020fe00, + 0x803effd4, 0x90400000, 0x804600a2, 0x90421800, + 0x804600a3, 0x80132000, 0x98000040, 0x800600a6, + 0x80050080, 0x98000002, 0x80060080, 0x80070001, + 0x001f2013, 0x80070000, 0x001f23f9, 0x801e4b0c, + 0x001f210c, 0x80070001, 0x001f2324, 0x80070800, + 0x001f600f, 0x001fb0cb, 0x001fb010, 0x801efff0, + 0x98004000, 0x001f600e, 0x83e4011b, 0x80070000, + 0x801e4b14, 0x800500a0, 0xb0000001, 0xb4000009, + 0x80070001, 0x800600a0, 0x80050080, 0x98000020, + 0x80060080, 0x9400ffdf, 0x80060080, 0x80070000, + 0x800600a0, 0x80074000, 0x801e4b04, 0x81df0004, + 0x801bfff0, 0x00000000, 0x940000ff, 0xb0000000, + 0xb4200033, 0x003f400e, 0x94010010, 0xb0000000, + 0xb400fff7, 0x003f0013, 0xb0010001, 0xb420001f, + 0x803bffe8, 0x801bffec, 0x805b4b04, 0x00000000, + 0x3001b800, 0xb4600001, 0x9021a000, 0x0421b800, + 0x3001b802, 0xb460000d, 0x80050086, 0x005f9044, + 0x0420b802, 0xb00101e0, 0xb4a0ffe5, 0x001fb010, + 0x001f010c, 0xb0000001, 0xb400ffe1, 0x80070001, + 0x001f210c, 0x83e400e8, 0xb500ffdd, 0x8007001f, + 0x94000003, 0x5810b800, 0x83e719ec, 0x1bffb800, + 0x003f9008, 0x1821b800, 0x00ffb801, 0x80270000, + 0x003f2013, 0x8007001f, 0x94000003, 0x5810b800, + 0x83671a14, 0x1b7bb800, 0x003f9009, 0x1821b800, + 0x00ffb801, 0x80070000, 0x001f210c, 0xb500ffc8, + 0x003f400e, 0xb0000086, 0xb4400051, 0xb0000084, + 0xb400003b, 0xb0000085, 0xb4000041, 0xb0000086, + 0xb4000043, 0xb0000083, 0xb4000000, 0x815bff7c, + 0x00000000, 0x940a0080, 0x5c07b800, 0xb0000001, + 0xb400006f, 0x81674b18, 0x940a0007, 0x5803b800, + 0x116bb800, 0x005bb80b, 0x916b0004, 0x001bb80b, + 0x806500d4, 0x1463b800, 0x1863b802, 0x806600d4, + 0x80073c21, 0x801e4b00, 0x800600a1, 0x80074000, + 0x801e4b04, 0x8013001f, 0x98405000, 0x805effe0, + 0x005fb006, 0x805effe8, 0x805effec, 0x9042a000, + 0x805effe4, 0x9040fa00, 0x805effd0, 0x805effdc, + 0x805effd8, 0x9040fe00, 0x805effd4, 0x8013007f, + 0x9800ffff, 0x001fb040, 0x80070001, 0x001f2013, + 0x80070000, 0x001f2324, 0x001fb0cb, 0x001fb010, + 0x001fb041, 0x001fb042, 0x80073370, 0x001fb008, + 0x80071e40, 0x001fb009, 0x98214000, 0xb5000010, + 0x94011000, 0xb0001000, 0xb4200001, 0x9421efff, + 0x98210010, 0xb500000a, 0x80070000, 0x001fb0cb, + 0x83e40099, 0x003f400e, 0x9421ffef, 0xb5000004, + 0x83e40095, 0x003f400e, 0x98211000, 0x9421ffef, + 0x003f600e, 0x80070100, 0x801efff0, 0xb500ff74, + 0xb000008b, 0xb4000018, 0xb0000087, 0xb400ffee, + 0xb0000088, 0xb4000016, 0xb000008a, 0xb4000016, + 0xb000008c, 0xb4000017, 0xb0000089, 0xb4000019, + 0xb00000a0, 0xb400001b, 0xb00000a1, 0xb4000047, + 0xb00000a2, 0xb4000054, 0xb00000a3, 0xb400004c, + 0xb00000a4, 0xb4000056, 0xb00000a5, 0xb400005a, + 0xb00000a6, 0xb400005e, 0x803efff8, 0xb500ffe1, + 0x9421ffdf, 0xb500ffde, 0x80270100, 0x803efff8, + 0xb500ffdc, 0x803bffb0, 0x00000000, 0x003fb040, + 0xb500ffd8, 0x803bff80, 0x00000000, 0x003f6001, + 0xb500ffd4, 0x003f90ba, 0x803efff8, 0xb500ffd1, + 0x81674b18, 0x940a0007, 0x5803b800, 0x116bb800, + 0x005bb80b, 0x916b0004, 0x001bb80b, 0x806500d4, + 0x1463b800, 0x1863b802, 0x806600d4, 0x80130001, + 0x98003d21, 0x800600a1, 0x801e4b00, 0x80074000, + 0x801e4b04, 0x8013001f, 0x98405000, 0x805effe0, + 0x005fb006, 0x805effe8, 0x805effec, 0x9042a000, + 0x805effe4, 0x9040fa00, 0x805effd0, 0x805effdc, + 0x805effd8, 0x9040fe00, 0x805effd4, 0x80070001, + 0x001f2013, 0x80070000, 0x001f2324, 0x001fb0cb, + 0x001fb010, 0x80073b60, 0x001fb008, 0x80074350, + 0x001fb009, 0x98214000, 0xb500ffa5, 0x80270000, + 0x8047fef0, 0x003eb802, 0x90420004, 0x003eb802, + 0x90420004, 0x003eb802, 0x90420004, 0x003eb802, + 0x81df0000, 0x00000000, 0x00000000, 0x83640443, + 0x81df0004, 0xb500ff97, 0x81df0000, 0x00000000, + 0x00000000, 0x836403ed, 0x81df0004, 0xb500ff91, + 0x81df0000, 0x00000000, 0x00000000, 0x836403a8, + 0x81df0004, 0xb500ff8b, 0x81df0000, 0x00000000, + 0x00000000, 0x8344030b, 0x81df0004, 0xb500ff85, + 0x81df0000, 0x00000000, 0x00000000, 0x834402f0, + 0x81df0004, 0xb500ff7f, 0x80070000, 0x80470000, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002003, + 0xb6003002, 0x001eb802, 0x90420004, 0x80171000, + 0x8057ffff, 0xb6002002, 0xb6001801, 0x001fa020, + 0x81df0004, 0x00ffb81f, 0x83a70000, 0x8057ffff, + 0x80770000, 0x8073007d, 0x98636d4a, 0x0207b803, + 0x81df0000, 0x00000000, 0x00000000, 0x80171000, + 0xb6000007, 0x003fc020, 0x005fc7e0, 0x40c1b810, + 0x4102b810, 0x001fe026, 0x001fe0a8, 0x4210b803, + 0x81df0004, 0x80270000, 0x003f2013, 0x8007001f, + 0x94000003, 0x5810b800, 0x83671e1c, 0x1b7bb800, + 0x003f9009, 0x1821b800, 0x00ffb801, 0x003f0013, + 0xb0010001, 0xb420fff3, 0x93bd0001, 0xb01d0004, + 0xb480ffe3, 0x00ffb81f, 0x00000000, 0x00000000, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815b4b0c, 0x81070000, 0x81270bf4, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x812717f4, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a00060, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200006, + 0x039f4193, 0x5b81b81c, 0x003f90cb, 0x1021b81c, + 0x003fb0cb, 0x83840266, 0x829bff80, 0x801300e0, + 0x1434b800, 0x5c35b801, 0x8013001f, 0x1454b800, + 0x5c50b802, 0x8073007f, 0x9863ffff, 0xb002000f, + 0xb4800001, 0x90210001, 0x84210004, 0xb0010000, + 0xb4a00001, 0x6861b803, 0x005f9040, 0x4082b803, + 0x80af001f, 0x808f0000, 0x806f0000, 0x8007ffff, + 0x8033ffff, 0x80171000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6001811, 0xb6002010, 0x14618000, + 0x6068b803, 0x40c4b803, 0x14608000, 0x00c8b806, + 0x5870b803, 0x6068b803, 0x4104b803, 0x58c8b806, + 0x0108b808, 0x14c6b801, 0x00000000, 0x00000000, + 0x5d08b808, 0x1508b800, 0x1806a028, 0x81df0004, + 0x80670400, 0x5d22b80a, 0x81df0000, 0x00000000, + 0x00000000, 0xb600180a, 0x00cfb803, 0x013fb0bc, + 0x5922b809, 0x01afb809, 0x013f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x91290020, + 0x81df0004, 0x808f0000, 0x801b4b14, 0x80270001, + 0xb0000001, 0xb4000002, 0x802600a0, 0x803e4b14, + 0x81270c00, 0xb00a0000, 0xb4000001, 0x81270000, + 0x813e4b0c, 0x80270001, 0x003f2013, 0x80050086, + 0x001fb044, 0x00ffb81b, 0x00000000, 0x00000000, + 0x029fb00a, 0x02bfb00b, 0x02dfb00c, 0x02ffb00d, + 0x031fb00e, 0x033fb00f, 0x033f400f, 0x0287b86f, + 0x029fb005, 0x8285009d, 0x82b30002, 0x9ab50040, + 0x1a94b815, 0x8286009d, 0x8285009c, 0x96b48000, + 0xb0158000, 0xb400019c, 0x96b40100, 0xb0150100, + 0xb40001b8, 0x96b40400, 0xb0150400, 0xb40001ca, + 0x96b40001, 0xb0150001, 0xb4000014, 0x96b40008, + 0xb0150008, 0xb40001a5, 0x96b44000, 0xb0154000, + 0xb40001c9, 0x96b40002, 0xb0150002, 0xb4000169, + 0x96b40040, 0xb0150040, 0xb40001dc, 0x82d30002, + 0x9ad60000, 0x16b6b814, 0x3015b816, 0xb40001da, + 0x00000000, 0x00000000, 0xb50001db, 0x02bf9017, + 0x92b50001, 0x02bfb017, 0x82850082, 0x83050081, + 0x82a5009a, 0x96b50001, 0xb0150001, 0xb4200014, + 0x82a70000, 0x02bfb017, 0x96b41840, 0xb0150800, + 0xb420000c, 0x96b40008, 0x5aa9b815, 0x96d46000, + 0x5ec3b816, 0x82f3000f, 0x9af7c00f, 0x1718b817, + 0x1ab5b818, 0x1ab5b816, 0x9ab50340, 0x82a60081, + 0xb5000140, 0x9b180180, 0x83060081, 0xb500013d, + 0x82a5009a, 0x96b50002, 0xb0150002, 0xb420001b, + 0x82a70000, 0x02bfb017, 0x96b41800, 0xb0151800, + 0xb4000013, 0x96b40040, 0xb0150040, 0xb4200004, + 0xa3180c00, 0x9b180340, 0x83060081, 0xb500012d, + 0x96b40008, 0x5aa9b815, 0x96d46000, 0x5ec3b816, + 0x82f3000f, 0x9af7c00f, 0x1718b817, 0x1ab5b818, + 0x1ab5b816, 0x9ab50340, 0x82a60081, 0xb5000121, + 0x9b180180, 0x83060081, 0xb500011e, 0x82a500c1, + 0x96b5000f, 0xb015000b, 0xb420000e, 0x96b40020, + 0xb0150020, 0xb400000b, 0x96b40200, 0xb0150200, + 0xb4000008, 0x82c50086, 0x82e50094, 0x3016b817, + 0xb4400004, 0x06f7b816, 0xb017ff00, 0xb4400001, + 0xb500010c, 0x96b46000, 0xb0156000, 0xb4000011, + 0x96b41820, 0xb0150820, 0xb4200004, 0x9b391000, + 0x82a5009a, 0x96b5feff, 0x82a6009a, 0x96b40040, + 0xb0150040, 0xb4200001, 0x9739efff, 0x96b91000, + 0xb0151000, 0xb4200003, 0x82a5009a, 0x9ab50100, + 0x82a6009a, 0x96b40040, 0xb0150040, 0xb4200019, + 0x96b41800, 0xb0151800, 0xb4200006, 0x96b98000, + 0xb0158000, 0xb4200003, 0x9b180180, 0x83060081, + 0xb50000ec, 0x96d80c00, 0x82b300ff, 0x9ab5f3ff, + 0x1718b815, 0xb0160c00, 0xb4000007, 0x82e50098, + 0x96f70400, 0xb0170400, 0xb4200002, 0x82c70c00, + 0xb5000001, 0xa2d60c00, 0x1b18b816, 0x9b180340, + 0xb50000d2, 0x96b40220, 0xb0150000, 0xb4e00033, + 0x82a5009d, 0x82f3ffff, 0x16b5b817, 0x82f33802, + 0x3015b817, 0xb420002d, 0x96f98000, 0xb0178000, + 0xb400002a, 0x82a70000, 0x02bfb017, 0x82c50081, + 0x9ab60020, 0x82a60081, 0x82a50086, 0x92b50bb8, + 0x82a60094, 0x82c60081, 0x82c5009d, 0x96d6ffff, + 0x82b3c802, 0x9ab50041, 0x82e500c1, 0x96f7000f, + 0xb017000b, 0xb4000002, 0x82b38802, 0x9ab50041, + 0x1ab5b816, 0x82c5009a, 0x96d60020, 0xb0160020, + 0xb4200002, 0x82b3c802, 0x9ab50041, 0x82a6009d, + 0x02ff9017, 0x00000000, 0xb0170040, 0xb480000b, + 0x96f41c00, 0xb0171c00, 0xb4200008, 0x82e50086, + 0x82c50094, 0x92d63000, 0x3016b817, 0xb4400003, + 0x9b180180, 0x83060081, 0xb50000a6, 0x5eb5b814, + 0x96b500f0, 0x96f46000, 0x5eedb817, 0x1ab5b817, + 0xb0170003, 0xb4000004, 0x96b500ef, 0x96f70001, + 0x5ae4b817, 0x1ab5b817, 0x96d41800, 0xb0161800, + 0xb400000a, 0x96f900ff, 0x96b500ff, 0x9739ff00, + 0x1b39b815, 0x02a7b817, 0x96b500f3, 0x96d40008, + 0x5ec1b816, 0x1ab5b816, 0xb500000c, 0x96f98000, + 0xb0178000, 0xb4200007, 0x5efeb814, 0x96f70001, + 0xb0170001, 0xb4000003, 0x9b180180, 0x83060081, + 0xb5000084, 0x96b500f3, 0x9ab50008, 0x9739fff3, + 0x96d40020, 0xb0160020, 0xb4200017, 0x9b398000, + 0x82c70000, 0x02dfb017, 0x96d40010, 0x5ac8b816, + 0x82f300ff, 0x9af7cfff, 0x1718b817, 0x1b18b816, + 0x9b180340, 0x82c5009d, 0x96d6ffff, 0x82f33802, + 0x9af70041, 0x1af7b816, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82f3c802, 0x9af70041, + 0x82e6009d, 0xb500005d, 0x97397fff, 0x96b500ff, + 0x5aaab815, 0x82f300fc, 0x9af703ff, 0x1718b817, + 0x1b18b815, 0x9b180340, 0x82c5009a, 0x96d60010, + 0xb0160010, 0xb4200024, 0x82c70000, 0x02dfb017, + 0x82c50086, 0x92d60bb8, 0x82c60086, 0x82c50094, + 0x5eefb818, 0x96f70003, 0xb0170003, 0xb4200002, + 0x82e70bb8, 0xb5000001, 0x82e70bb8, 0x12d6b817, + 0x82e50081, 0x9af70020, 0x82e60081, 0x82c60094, + 0xa2f70020, 0x82e60081, 0x82f30001, 0x16f7b818, + 0x5ef0b817, 0xb0170001, 0xb4000004, 0x96f84000, + 0x5ee4b817, 0x9718f3ff, 0x1b18b817, 0x82f32802, + 0x9af70040, 0x82e6009d, 0x83060081, 0x83070001, + 0x8306009f, 0xb50000b8, 0x82c5009d, 0x82f33802, + 0x9af70041, 0x3016b817, 0xb420000f, 0x82b3c802, + 0x9ab50041, 0x82e500c1, 0x96f7000f, 0xb017000b, + 0xb4000002, 0x82b38802, 0x9ab50041, 0x82c5009a, + 0x96d60020, 0xb0160020, 0xb4200002, 0x82b3c802, + 0x9ab50041, 0x82a6009d, 0x82c5009a, 0x96d60080, + 0xb0160080, 0xb4000014, 0x02df9017, 0x00000000, + 0xb0160010, 0xb4800010, 0x82c500c1, 0x96d6000f, + 0xb016000b, 0xb400000c, 0x82c50087, 0x96d60080, + 0x5ac7b816, 0x82c50098, 0x96d60800, 0x5ac3b816, + 0x96f84000, 0x3017b816, 0xb4200003, 0x033f400f, + 0x9b394000, 0xb500000b, 0x9739bfff, 0x82e50061, + 0x96f70008, 0xb0170008, 0xb4000005, 0x5eefb818, + 0x96f70003, 0xb0170003, 0xb4000001, 0x9718ffff, + 0x83060081, 0x83070001, 0x8306009f, 0x00000000, + 0xb500007d, 0x82850083, 0x96b400ff, 0xb015003c, + 0xb4200019, 0x96b92000, 0xb0152000, 0xb4000002, + 0x9b392000, 0xb5000014, 0x9739d3ff, 0x82870000, + 0x82860087, 0x82870008, 0x82860083, 0x829bff78, + 0x82a7001f, 0xb0140400, 0xb4000001, 0x82a70010, + 0x82a600c9, 0x829bff78, 0x00000000, 0x828600cb, + 0x8285009d, 0x82b3ffff, 0x9ab5fffd, 0x1694b815, + 0x8286009d, 0xb5000000, 0x83070002, 0x8306009f, + 0x00000000, 0xb500005c, 0x96b90800, 0xb0150800, + 0xb4200009, 0x9739f7ff, 0x82a703fd, 0x82a600cb, + 0x82a7003c, 0x82a60083, 0x8285009d, 0x9a940002, + 0x8286009d, 0xb5000004, 0x82850087, 0x5a82b814, + 0xa2940200, 0x82860087, 0xb5000000, 0x83078000, + 0x8306009f, 0x00000000, 0xb5000047, 0x82850086, + 0x82a50094, 0x3015b814, 0xb4800002, 0x86b50bb8, + 0x82a60086, 0x83070008, 0x8306009f, 0x00000000, + 0xb500003d, 0x83050069, 0x9718003f, 0x82e50064, + 0x12f7b818, 0x86f70088, 0x82feff74, 0x02e7b86f, + 0x9af74000, 0x01ffb817, 0x96f7bfff, 0x01ffb817, + 0x83050081, 0x82f3001c, 0x9af703ff, 0x1718b817, + 0x9b180140, 0x83060081, 0x83070100, 0x8306009f, + 0x00000000, 0xb5000028, 0x83070000, 0x83050081, + 0x9b180180, 0x83060081, 0x83070400, 0x8306009f, + 0x00000000, 0xb5000020, 0x82870000, 0x82850082, + 0x5eb7b814, 0x96b500fc, 0x96d40006, 0x5ec1b816, + 0x1ab5b816, 0x5aacb815, 0x83050081, 0x82d3001c, + 0x9ad600ff, 0x1718b816, 0x1b18b815, 0x9b180e00, + 0x83060081, 0x83074000, 0x8306009f, 0x8305009d, + 0x82d3ffff, 0x9ad6bfff, 0x1718b816, 0x8306009d, + 0x00000000, 0xb5000008, 0xb5000007, 0x83070040, + 0x8306009f, 0xb5000004, 0x83130002, 0x9b180000, + 0x8306009f, 0xb5000000, 0x029f9005, 0x01ffb814, + 0x033f600f, 0x029f900a, 0x02bf900b, 0x02df900c, + 0x02ff900d, 0x031f900e, 0x033f900f, 0x00ffb81e, + 0x02ff9010, 0x92f70b43, 0x02ffb010, 0x02ff90cb, + 0x82bbffdc, 0x829bffd8, 0x93150004, 0x3014b815, + 0xb4000010, 0x02dbb818, 0x029bb815, 0x3017b816, + 0xb480000c, 0x5a81b814, 0x029fb010, 0x82860095, + 0x8293001f, 0x9294fe00, 0x92b50008, 0x3015b814, + 0xb4800002, 0x82b3001f, 0x92b5fa00, 0x82beffdc, + 0xb500ffeb, 0x029f9010, 0x83250094, 0x06d4b819, + 0x02d6b816, 0xb016ffff, 0xb4a0000a, 0x82933802, + 0x9a940041, 0x82c5009d, 0x96d6ffff, 0x1a94b816, + 0x82c5009a, 0x96d60010, 0xb0160010, 0xb4000001, + 0x8286009d, 0x00ffb81c, 0x00000000, 0x00000000, + 0x001f9012, 0x001fb100, 0x001f004c, 0x001f2404, + 0x801bfef0, 0x8058fef4, 0x803bff68, 0x8078ff6c, + 0x2000b801, 0x2042b803, 0x001fb104, 0x005f2414, + 0x82e70001, 0x83640048, 0x029fb014, 0x829efef0, + 0x8286000f, 0x02bf2054, 0x82bcfef4, 0x82a6000e, + 0x00ffb81a, 0x80e70001, 0x801336e3, 0x9800eb76, + 0x001fb100, 0x800700ab, 0x001f2404, 0x801bc3e8, + 0x8058c3ec, 0x83640024, 0x82e70000, 0x83640036, + 0x029fb300, 0x029fb100, 0x02bf2c04, 0x02bf2404, + 0x801bc000, 0x8058c004, 0x8364001b, 0x82e70000, + 0x8364002d, 0x001f9300, 0x3000b814, 0xb420000a, + 0x001f0c04, 0x3000b815, 0xb4200007, 0x829efef0, + 0x82bcfef4, 0x029fb012, 0x02bf204c, 0x82870001, + 0x829cfef5, 0x00ffb81a, 0xb0070000, 0xb4000007, + 0x80e70000, 0x801399fa, 0x9800c92e, 0x001fb100, + 0x800700af, 0x001f2404, 0xb500ffdc, 0x82870000, + 0x829cfef5, 0x00ffb81a, 0x80c700ff, 0x803bff68, + 0x8078ff6c, 0x14a0b806, 0x2063b805, 0x007f2414, + 0x2021b802, 0x58c8b806, 0x14a0b806, 0x58b0b805, + 0x2021b805, 0x58c8b806, 0x14a0b806, 0x2021b805, + 0x58c8b806, 0x14a0b806, 0x5cb0b805, 0x2021b805, + 0x003fb104, 0x00ffb81b, 0x82c70000, 0x83070400, + 0x83270005, 0x8197040c, 0x81d7ffff, 0x83840126, + 0x83840001, 0x00ffb81b, 0x808f0000, 0x806f001f, + 0x80af001f, 0x80270140, 0x81e70228, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x80270180, 0x81e70120, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x8057ffff, 0x80170430, 0x80070410, + 0x80270408, 0xb6000509, 0x005ff000, 0x90420500, + 0x007ff001, 0x90630600, 0x009ff002, 0x00bff003, + 0x2004a025, 0x90000001, 0x90210001, 0x80070414, + 0x80d7ffff, 0x8097045c, 0x8017043c, 0xb6000404, + 0x005ff000, 0x007f87e0, 0x84000001, 0x2082a7e3, + 0x80970460, 0x80170440, 0x2082b803, 0x007f8000, + 0x2083a004, 0x80170430, 0x80970450, 0x80270408, + 0xb6000508, 0x005f8024, 0x90420500, 0x007ff001, + 0x90630600, 0x009ff002, 0x00bff003, 0x2004a025, + 0x90210001, 0x80170440, 0x00000000, 0x02bf87e0, + 0x80970460, 0x82870000, 0xb6000404, 0x005f87e4, + 0x5a88b814, 0x204287e0, 0x1a94b802, 0x00ffb81c, + 0x001f0a49, 0x001f2709, 0x001f0a41, 0x001f2708, + 0x001f0a46, 0x001f2707, 0x001f0a48, 0x001f2706, + 0x001f0a42, 0x001f2705, 0x001f0a47, 0x001f2704, + 0x001f0a45, 0x001f2703, 0x001f0a43, 0x001f2702, + 0x001f0a40, 0x001f2701, 0x001f0a44, 0x001f2700, + 0x001f0c25, 0xa020000c, 0x94400001, 0x94600002, + 0x94810004, 0x94a10008, 0x94c00010, 0x5943b802, + 0x5861b803, 0x5882b804, 0x5ca2b805, 0x5cc4b806, + 0x194ab803, 0x194ab804, 0x194ab805, 0x194ab806, + 0x015f2738, 0x801b0220, 0x003f91c1, 0x5c28b801, + 0x005f91c2, 0x5858b802, 0x1821b802, 0x2000b801, + 0x001fb1c4, 0x80180224, 0x003f0709, 0x2000b801, + 0x001f2714, 0x82c70001, 0x82e70001, 0x83070710, + 0x8327001e, 0x81970735, 0x8384009f, 0x02df0738, + 0x82170a30, 0x838400f1, 0x819efef0, 0x817cfef4, + 0x819eff68, 0x817cff6c, 0x00ffb81b, 0x820f001f, + 0x8018fef8, 0x8057ffff, 0x001f2709, 0x8018fef6, + 0x80d7ffff, 0x001f2708, 0x8018fefa, 0x8157ffff, + 0x001f2707, 0x8018fefd, 0x81d7ffff, 0x001f2706, + 0x8018fefb, 0x802f001f, 0x001f2705, 0x8018fefe, + 0x00000000, 0x001f2704, 0x8018fef9, 0x00000000, + 0x001f2703, 0x8018feff, 0x00000000, 0x001f2702, + 0x8018fef7, 0x00000000, 0x001f2701, 0x8018fefc, + 0x00000000, 0x001f2700, 0x001f0c25, 0xa0200011, + 0x94410001, 0x94600002, 0x94800004, 0x94a00008, + 0x94c10010, 0x5941b802, 0x5861b803, 0x5c82b804, + 0x58a1b805, 0x5cc1b806, 0x194ab803, 0x194ab804, + 0x194ab805, 0x194ab806, 0x015f2738, 0x801b0220, + 0x003f91c1, 0x5c28b801, 0x005f91c2, 0x5858b802, + 0x1821b802, 0x2000b801, 0x001fb1c4, 0x80180224, + 0x003f0709, 0x2000b801, 0x001f2714, 0x82c70001, + 0x82e70001, 0x83070710, 0x8327001e, 0x81970735, + 0x83840055, 0x02df0738, 0x82170a20, 0x838400a7, + 0x819efef0, 0x817cfef4, 0x5ac8b80c, 0x02ff0a44, + 0x1ad6b817, 0x02dfb291, 0x5ed8b80c, 0x5968b80b, + 0x1ad6b80b, 0x02df6524, 0x00ffb81b, 0x820f001f, + 0x8018fefe, 0x8057ffff, 0x001f2709, 0x8018fefa, + 0x80d7ffff, 0x001f2708, 0x8018fefc, 0x8157ffff, + 0x001f2707, 0x8018feff, 0x81d7ffff, 0x001f2706, + 0x8018fef8, 0x802f001f, 0x001f2705, 0x8018fefb, + 0x00000000, 0x001f2704, 0x8018fefd, 0x00000000, + 0x001f2703, 0x8018fef6, 0x00000000, 0x001f2702, + 0x8018fef9, 0x00000000, 0x001f2701, 0x8018fef7, + 0x00000000, 0x001f2700, 0x801b0220, 0x003f91c1, + 0x5c28b801, 0x005f91c2, 0x5858b802, 0x1821b802, + 0x2000b801, 0x001fb1c4, 0x80180224, 0x003f0709, + 0x2000b801, 0x001f2714, 0x82c70001, 0x82e70001, + 0x83070710, 0x8327001e, 0x81970735, 0x83840016, + 0x83270000, 0x831bfef0, 0x82f8fef4, 0x02c7b819, + 0x82170a28, 0x83840065, 0x300cb818, 0xb4200002, + 0x300bb817, 0xb4000006, 0x93390001, 0xb0190020, + 0xb480fff6, 0x83270000, 0x833cfef5, 0x00ffb81b, + 0x019fb290, 0x017f2a44, 0x033f2c25, 0x83270001, + 0x833cfef5, 0x00ffb81b, 0x0007b818, 0x90000003, + 0x00000000, 0x015ff000, 0x90000001, 0x5949b80a, + 0x013ff000, 0x194ab809, 0x84000002, 0x994a0100, + 0x017ff000, 0x958b00f8, 0x5981b80c, 0x956b0007, + 0x198cb80b, 0x84000002, 0x998c0008, 0x017ff000, + 0x90000001, 0x5971b80b, 0x198cb80b, 0x017ff000, + 0x5969b80b, 0x198cb80b, 0x81a70000, 0x94d90003, + 0x82a70000, 0xb6260019, 0xb6000818, 0x5df0b80a, + 0x5e02b80a, 0x21efb810, 0x95ef0001, 0x5941b80a, + 0x194ab80f, 0x21efb816, 0x5e18b80c, 0x5e35b80c, + 0x5e54b80c, 0x5e6cb80c, 0x2210b811, 0x2252b813, + 0x2210b812, 0x96100001, 0x5981b80c, 0x198cb810, + 0x2210b817, 0x10afb810, 0x10a5b80d, 0x5da1b805, + 0x94a50001, 0x5aa1b815, 0x1ab5b805, 0x019fa7f5, + 0x5cc2b819, 0xb626001c, 0x82870000, 0xb6000419, + 0xb6000818, 0x5df0b80a, 0x5e02b80a, 0x21efb810, + 0x95ef0001, 0x5941b80a, 0x194ab80f, 0x21efb816, + 0x5e18b80c, 0x5e35b80c, 0x5e54b80c, 0x5e6cb80c, + 0x2210b811, 0x2252b813, 0x2210b812, 0x96100001, + 0x5981b80c, 0x198cb810, 0x2210b817, 0x10afb810, + 0x10a5b80d, 0x5da1b805, 0x94a50001, 0x5a81b814, + 0x1a94b805, 0x019fa7f4, 0x00ffb81c, 0x8257ffff, + 0x808f0000, 0x806f001f, 0x80af001f, 0x80270200, + 0x81e7ff00, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270240, + 0x81e70000, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270180, + 0x81e70120, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x806f0007, + 0x80af0007, 0x80270280, 0x81e70100, 0x5de2b80f, + 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, + 0x01ff90bc, 0xb520ffff, 0x91ef0020, 0x90210020, + 0x80170760, 0x001f0700, 0x001fa020, 0x001f0701, + 0x001fa020, 0x001f0702, 0x001fa020, 0x001f0703, + 0x001fa020, 0x001f0704, 0x001fa000, 0x80970750, + 0x81170770, 0x82a70735, 0x83a40060, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4005c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a70730, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40050, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4004c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a7072b, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40040, 0x83a4004e, + 0xb6000407, 0x86b50001, 0x83a4003c, 0x001f8004, + 0x003f87e8, 0x2080a001, 0x83a40047, 0x00000000, + 0x80970770, 0x80170750, 0x81170750, 0x81970740, + 0x82a70726, 0x001f800c, 0x003f8008, 0x2100a001, + 0x83a4002e, 0x83a4003c, 0xb6000407, 0x86b50001, + 0x83a4002a, 0x001f8004, 0x003f87e8, 0x2080a001, + 0x83a40035, 0x00000000, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a70721, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4001c, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a40018, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a7071c, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4000c, 0x017f87e4, + 0x81870000, 0xb6000406, 0x86b50001, 0x83a40007, + 0x001f87e4, 0x200087e8, 0x5988b80c, 0x198cb800, + 0x021fa02c, 0x021fa00b, 0x00ffb81c, 0x005ff015, + 0x90420600, 0x003f87e0, 0x001ff002, 0x2060b801, + 0x90630800, 0x90960a00, 0x001ff003, 0x003ff004, + 0x20a0b801, 0x90a50900, 0x00000000, 0x001ff005, + 0x009fa000, 0x00ffb81d, 0x001f8004, 0x5c21b800, + 0x5847b800, 0x1821b802, 0x942100ff, 0x2080a7e1, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x829bff80, 0x80af001f, 0x808f0000, 0x806f0000, + 0x82bbffec, 0x82fbffe4, 0x00000000, 0x82beffb8, + 0x95540700, 0x5d48b80a, 0x914a0001, 0x0227b80a, + 0x94343000, 0x5c2cb801, 0xb0010000, 0xb4000001, + 0x5a21b811, 0x9574c000, 0x5d6eb80b, 0x918b4b08, + 0x01b8b80c, 0x96d5ffff, 0x5ec2b816, 0x96f7ffff, + 0x5ee2b817, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x81f3ff00, 0x99efff00, 0x821300ff, + 0x9a1000ff, 0x81971000, 0x82670000, 0x82470000, + 0x80270280, 0x81df0000, 0x00000000, 0x00000000, + 0xb62d000d, 0x3016b817, 0xb4800001, 0x86d62800, + 0x00cfb801, 0x02dfb0bc, 0x5ac2b816, 0x01cfb816, + 0x02df90bc, 0x0067b86f, 0xb0030001, 0xb4c0fffd, + 0x92d60020, 0x90210020, 0x81df0004, 0x80170a00, + 0x81df0000, 0x00000000, 0x00000000, 0xb62d0006, + 0xb6002005, 0x146f8000, 0x14908000, 0x5c68b803, + 0x5888b804, 0x1803a024, 0x81df0004, 0x80170a00, + 0x80970d00, 0xb00b0000, 0xb4000004, 0xb00b0001, + 0xb400000a, 0xb00b0002, 0xb4000027, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008002, 0x007f8020, + 0x009fa023, 0x81df0004, 0xb5000029, 0x80d3ffff, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002018, + 0x5c648000, 0x9463ffff, 0x5c888020, 0x58b88000, + 0x1884b805, 0x1484b806, 0x1883a024, 0x5c6c8020, + 0x9463ffff, 0x58908000, 0x1883a024, 0x5c748020, + 0x588c8000, 0x1863b804, 0x9463ffff, 0x58888000, + 0x1484b806, 0x1883a024, 0x5c7c8020, 0x58848000, + 0x1863b804, 0x9463ffff, 0x14868020, 0x1883a024, + 0x81df0004, 0xb500000a, 0x80d3ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004004, 0x007f8020, + 0x009fa023, 0x007f8040, 0x009fa023, 0x81df0004, + 0x00000000, 0x81170d00, 0x80070000, 0x94343000, + 0x5c2cb801, 0xb0010001, 0xb400008e, 0xb00a0001, + 0xb400000e, 0xb00a0002, 0xb400001c, 0xb00a0003, + 0xb4000024, 0xb00a0004, 0xb4000052, 0xb00a0005, + 0xb400005b, 0xb00a0006, 0xb400007f, 0xb00a0007, + 0xb400007d, 0xb00a0008, 0xb400007b, 0x81df0000, + 0x00000000, 0x00000000, 0xb600800a, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x5c708028, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x019fa020, 0x81df0004, 0xb500006b, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008004, 0x007f8028, + 0x019fa023, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000061, 0xb0130000, 0xb4000004, 0xb0130001, + 0xb4000009, 0xb0130002, 0xb400001a, 0x83a400fa, + 0x80170f00, 0x007f8028, 0x001fa023, 0x007f8028, + 0x001fa023, 0xb5000054, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8000, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708020, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a400e5, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000041, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8008, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a400d2, + 0xb5000031, 0x81df0000, 0x00000000, 0x00000000, + 0xb6004005, 0x007f8008, 0x019fa023, 0x007f8008, + 0x019fa023, 0x019fa020, 0x81df0004, 0xb5000026, + 0xb0130000, 0xb4000008, 0xb0130001, 0xb4000012, + 0xb0130002, 0xb400001f, 0xb0130003, 0xb400001d, + 0xb0130004, 0xb400001b, 0x83a400cd, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000010, 0x80170f00, 0x00000000, + 0x5c708020, 0x58908008, 0x1983a024, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x83a400b7, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000001, 0xb5000000, 0x00000000, 0x00000000, + 0xb5000086, 0xb00a0001, 0xb400000e, 0xb00a0002, + 0xb4000017, 0xb00a0003, 0xb400001f, 0xb00a0004, + 0xb400004d, 0xb00a0005, 0xb4000056, 0xb00a0006, + 0xb400007a, 0xb00a0007, 0xb4000078, 0xb00a0008, + 0xb4000076, 0x81df0000, 0x00000000, 0x00000000, + 0xb6008005, 0x007f8028, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x019fa020, 0x81df0004, 0xb500006b, + 0x81df0000, 0x00000000, 0x00000000, 0xb6004004, + 0x007f8048, 0x019fa023, 0x019fa020, 0x019fa020, + 0x81df0004, 0xb5000061, 0xb0130000, 0xb4000004, + 0xb0130001, 0xb4000009, 0xb0130002, 0xb400001a, + 0x83a40098, 0x80170f00, 0x007f8028, 0x001fa023, + 0x007f8028, 0x001fa023, 0xb5000054, 0x80170f00, + 0x00000000, 0x007f8020, 0x019fa023, 0x007f8000, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708020, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x83a40083, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000041, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a40070, 0xb5000031, 0x81df0000, 0x00000000, + 0x00000000, 0xb6004005, 0x007f8008, 0x019fa023, + 0x007f8008, 0x019fa023, 0x019fa020, 0x81df0004, + 0xb5000026, 0xb0130000, 0xb4000008, 0xb0130001, + 0xb4000012, 0xb0130002, 0xb400001f, 0xb0130003, + 0xb400001d, 0xb0130004, 0xb400001b, 0x83a4006b, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x80170f00, + 0x007f8028, 0x001fa023, 0xb5000010, 0x80170f00, + 0x00000000, 0x5c708020, 0x58908008, 0x1983a024, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x83a40055, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000001, 0xb5000000, 0x92730001, + 0x92520001, 0x3012b811, 0xb480fe89, 0x003f0324, + 0x90210001, 0xb0010006, 0xb4a00001, 0x80270001, + 0x003f2324, 0x2c8db811, 0x803bffe0, 0x805bffe4, + 0x5887b804, 0x1015b804, 0xad440003, 0x3000b802, + 0xb4800001, 0x8400a000, 0x801effec, 0x015f6193, + 0x809e4b04, 0x00ffb81f, 0x81df0000, 0x00000000, + 0x00000000, 0xb6002a0c, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x019fa020, 0x81df0004, 0x00ffb81d, + 0x81df0000, 0x00000000, 0x00000000, 0xb600190f, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x81df0004, + 0x00ffb81d, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002a0c, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x81df0004, 0x00ffb81d, 0x81df0000, + 0x00000000, 0x00000000, 0xb600190f, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x81df0004, 0x00ffb81d, + 0x829bff80, 0x80af001f, 0x808f0000, 0x806f0000, + 0x82bbffec, 0x82fbffe4, 0x00000000, 0x82beffb8, + 0x95540700, 0x5d48b80a, 0x914a0001, 0x0227b80a, + 0x94343000, 0x5c2cb801, 0xb0010000, 0xb4000001, + 0x5a21b811, 0x9574c000, 0x5d6eb80b, 0x918b4b08, + 0x01b8b80c, 0x96d5ffff, 0x5ec2b816, 0x96f7ffff, + 0x5ee2b817, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x81f3ff00, 0x99efff00, 0x821300ff, + 0x9a1000ff, 0x81971000, 0x82670000, 0x82470000, + 0x80270280, 0x81df0000, 0x00000000, 0x00000000, + 0xb62d000d, 0x3016b817, 0xb4800001, 0x86d62800, + 0x00cfb801, 0x02dfb0bc, 0x5ac2b816, 0x01cfb816, + 0x02df90bc, 0x0067b86f, 0xb0030001, 0xb4c0fffd, + 0x92d60020, 0x90210020, 0x81df0004, 0x80170a00, + 0x81df0000, 0x00000000, 0x00000000, 0xb62d0006, + 0xb6002005, 0x146f8000, 0x14908000, 0x5c68b803, + 0x5888b804, 0x1803a024, 0x81df0004, 0x80170a00, + 0x80970d00, 0xb00b0000, 0xb4000004, 0xb00b0001, + 0xb400000a, 0xb00b0002, 0xb4000027, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008002, 0x007f8020, + 0x009fa023, 0x81df0004, 0xb5000029, 0x80d3ffff, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002018, + 0x5c648000, 0x9463ffff, 0x5c888020, 0x58b88000, + 0x1884b805, 0x1484b806, 0x1883a024, 0x5c6c8020, + 0x9463ffff, 0x58908000, 0x1883a024, 0x5c748020, + 0x588c8000, 0x1863b804, 0x9463ffff, 0x58888000, + 0x1484b806, 0x1883a024, 0x5c7c8020, 0x58848000, + 0x1863b804, 0x9463ffff, 0x14868020, 0x1883a024, + 0x81df0004, 0xb500000a, 0x80d3ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004004, 0x007f8020, + 0x009fa023, 0x007f8040, 0x009fa023, 0x81df0004, + 0x00000000, 0x81170d00, 0x80070000, 0x94343000, + 0x5c2cb801, 0xb0010001, 0xb400008e, 0xb00a0001, + 0xb400000e, 0xb00a0002, 0xb400001c, 0xb00a0003, + 0xb4000024, 0xb00a0004, 0xb4000052, 0xb00a0005, + 0xb400005b, 0xb00a0006, 0xb400007f, 0xb00a0007, + 0xb400007d, 0xb00a0008, 0xb400007b, 0x81df0000, + 0x00000000, 0x00000000, 0xb600800a, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x5c708028, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x019fa020, 0x81df0004, 0xb500006b, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008004, 0x007f8028, + 0x019fa023, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000061, 0xb0130000, 0xb4000004, 0xb0130001, + 0xb4000009, 0xb0130002, 0xb400001a, 0x83a400fa, + 0x80170f00, 0x007f8028, 0x001fa023, 0x007f8028, + 0x001fa023, 0xb5000054, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8000, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708020, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a400e5, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000041, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8008, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a400d2, + 0xb5000031, 0x81df0000, 0x00000000, 0x00000000, + 0xb6004005, 0x007f8008, 0x019fa023, 0x007f8008, + 0x019fa023, 0x019fa020, 0x81df0004, 0xb5000026, + 0xb0130000, 0xb4000008, 0xb0130001, 0xb4000012, + 0xb0130002, 0xb400001f, 0xb0130003, 0xb400001d, + 0xb0130004, 0xb400001b, 0x83a400cd, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000010, 0x80170f00, 0x00000000, + 0x5c708020, 0x58908008, 0x1983a024, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x83a400b7, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000001, 0xb5000000, 0x00000000, 0x00000000, + 0xb5000086, 0xb00a0001, 0xb400000e, 0xb00a0002, + 0xb4000017, 0xb00a0003, 0xb400001f, 0xb00a0004, + 0xb400004d, 0xb00a0005, 0xb4000056, 0xb00a0006, + 0xb400007a, 0xb00a0007, 0xb4000078, 0xb00a0008, + 0xb4000076, 0x81df0000, 0x00000000, 0x00000000, + 0xb6008005, 0x007f8028, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x019fa020, 0x81df0004, 0xb500006b, + 0x81df0000, 0x00000000, 0x00000000, 0xb6004004, + 0x007f8048, 0x019fa023, 0x019fa020, 0x019fa020, + 0x81df0004, 0xb5000061, 0xb0130000, 0xb4000004, + 0xb0130001, 0xb4000009, 0xb0130002, 0xb400001a, + 0x83a40098, 0x80170f00, 0x007f8028, 0x001fa023, + 0x007f8028, 0x001fa023, 0xb5000054, 0x80170f00, + 0x00000000, 0x007f8020, 0x019fa023, 0x007f8000, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708020, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x83a40083, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000041, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a40070, 0xb5000031, 0x81df0000, 0x00000000, + 0x00000000, 0xb6004005, 0x007f8008, 0x019fa023, + 0x007f8008, 0x019fa023, 0x019fa020, 0x81df0004, + 0xb5000026, 0xb0130000, 0xb4000008, 0xb0130001, + 0xb4000012, 0xb0130002, 0xb400001f, 0xb0130003, + 0xb400001d, 0xb0130004, 0xb400001b, 0x83a4006b, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x80170f00, + 0x007f8028, 0x001fa023, 0xb5000010, 0x80170f00, + 0x00000000, 0x5c708020, 0x58908008, 0x1983a024, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x83a40055, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000001, 0xb5000000, 0x92730001, + 0x92520001, 0x3012b811, 0xb480fe89, 0x003f0324, + 0x90210001, 0xb0010006, 0xb4a00001, 0x80270001, + 0x003f2324, 0x2c8db811, 0x803bffe0, 0x805bffe4, + 0x5887b804, 0x1015b804, 0xad440003, 0x3000b802, + 0xb4800001, 0x8400a000, 0x801effec, 0x015f6193, + 0x809e4b04, 0x00ffb81f, 0x81df0000, 0x00000000, + 0x00000000, 0xb6002a0c, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x019fa020, 0x81df0004, 0x00ffb81d, + 0x81df0000, 0x00000000, 0x00000000, 0xb600190f, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x81df0004, + 0x00ffb81d, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002a0c, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x81df0004, 0x00ffb81d, 0x81df0000, + 0x00000000, 0x00000000, 0xb600190f, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x81df0004, 0x00ffb81d, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815b4b0c, 0x81070000, 0x81270bf4, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x812717f4, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a00060, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200006, + 0x039f4193, 0x5b81b81c, 0x003f90cb, 0x1021b81c, + 0x003fb0cb, 0x8384f922, 0x829bff80, 0x801300e0, + 0x1434b800, 0x5c35b801, 0x8013001f, 0x1454b800, + 0x5c50b802, 0x8073007f, 0x9863ffff, 0xb002000f, + 0xb4800001, 0x90210001, 0x84210004, 0xb0010000, + 0xb4a00001, 0x6861b803, 0x005f9040, 0x4082b803, + 0x80af001f, 0x808f0000, 0x806f0000, 0x8007ffff, + 0x8033ffff, 0x80171000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6001811, 0xb6002010, 0x14618000, + 0x6068b803, 0x40c4b803, 0x14608000, 0x00c8b806, + 0x5870b803, 0x6068b803, 0x4104b803, 0x58c8b806, + 0x0108b808, 0x14c6b801, 0x00000000, 0x00000000, + 0x5d08b808, 0x1508b800, 0x1806a028, 0x81df0004, + 0x80670400, 0x5d22b80a, 0x81df0000, 0x00000000, + 0x00000000, 0xb600180a, 0x00cfb803, 0x013fb0bc, + 0x5922b809, 0x01afb809, 0x013f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x91290020, + 0x81df0004, 0x808f0000, 0x801b4b14, 0x80270001, + 0xb0000001, 0xb4000002, 0x802600a0, 0x803e4b14, + 0x81270c00, 0xb00a0000, 0xb4000001, 0x81270000, + 0x813e4b0c, 0x80270001, 0x003f2013, 0x80050086, + 0x001fb044, 0x00ffb81b, 0x00000000, 0x00000000, +}; + +static u32 PCM240Ucode1f4b00[] = { + 0x00000000, 0x00000000, 0x00060504, 0x00000000, + 0x00000000, 0x00000000, 0x00300000, 0xffcfcfff, + 0x00302000, 0xffcfcfff, 0x00380000, 0xffc7c7ff, + 0xcbcecdc4, 0xcfcac9c8, 0xc3c6c5cc, 0xc7c2c1c0, + 0x1b1e1d14, 0x1f1a1918, 0x1316151c, 0x17121110, + 0x2b2e2d24, 0x2f2a2928, 0x2326252c, 0x27222120, + 0x3b3e3d34, 0x3f3a3938, 0x3336353c, 0x37323130, + 0x0b0e0d04, 0x0f0a0908, 0x0306050c, 0x07020100, + 0xdbdeddd4, 0xdfdad9d8, 0xd3d6d5dc, 0xd7d2d1d0, + 0xebeeede4, 0xefeae9e8, 0xe3e6e5ec, 0xe7e2e1e0, + 0xfbfefdf4, 0xfffaf9f8, 0xf3f6f5fc, 0xf7f2f1f0, + 0x4b4e4d44, 0x4f4a4948, 0x4346454c, 0x47424140, + 0x9b9e9d94, 0x9f9a9998, 0x9396959c, 0x97929190, + 0xabaeada4, 0xafaaa9a8, 0xa3a6a5ac, 0xa7a2a1a0, + 0xbbbebdb4, 0xbfbab9b8, 0xb3b6b5bc, 0xb7b2b1b0, + 0x8b8e8d84, 0x8f8a8988, 0x8386858c, 0x87828180, + 0x5b5e5d54, 0x5f5a5958, 0x5356555c, 0x57525150, + 0x6b6e6d64, 0x6f6a6968, 0x6366656c, 0x67626160, + 0x7b7e7d74, 0x7f7a7978, 0x7376757c, 0x77727170, + 0x341424c4, 0x3e1e2ece, 0x3d1d2dcd, 0x3b1b2bcb, + 0xb494a444, 0xbe9eae4e, 0xbd9dad4d, 0xbb9bab4b, + 0xf4d4e404, 0xfedeee0e, 0xfddded0d, 0xfbdbeb0b, + 0x74546484, 0x7e5e6e8e, 0x7d5d6d8d, 0x7b5b6b8b, + 0x3c1c2ccc, 0x361626c6, 0x351525c5, 0x331323c3, + 0xbc9cac4c, 0xb696a646, 0xb595a545, 0xb393a343, + 0xfcdcec0c, 0xf6d6e606, 0xf5d5e505, 0xf3d3e303, + 0x7c5c6c8c, 0x76566686, 0x75556585, 0x73536383, + 0x381828c8, 0x3a1a2aca, 0x391929c9, 0x3f1f2fcf, + 0xb898a848, 0xba9aaa4a, 0xb999a949, 0xbf9faf4f, + 0xf8d8e808, 0xfadaea0a, 0xf9d9e909, 0xffdfef0f, + 0x78586888, 0x7a5a6a8a, 0x79596989, 0x7f5f6f8f, + 0x301020c0, 0x321222c2, 0x311121c1, 0x371727c7, + 0xb090a040, 0xb292a242, 0xb191a141, 0xb797a747, + 0xf0d0e000, 0xf2d2e202, 0xf1d1e101, 0xf7d7e707, + 0x70506080, 0x72526282, 0x71516181, 0x77576787, + 0x05040100, 0x15141110, 0x25242120, 0x35343130, + 0x85848180, 0x95949190, 0xa5a4a1a0, 0xb5b4b1b0, + 0xc0408000, 0xe060a020, 0xd0509010, 0xf070b030, + 0xc8488808, 0xe868a828, 0xd8589818, 0xf878b838, + 0xc4448404, 0xe464a424, 0xd4549414, 0xf474b434, + 0xcc4c8c0c, 0xec6cac2c, 0xdc5c9c1c, 0xfc7cbc3c, + 0xc2428202, 0xe262a222, 0xd2529212, 0xf272b232, + 0xca4a8a0a, 0xea6aaa2a, 0xda5a9a1a, 0xfa7aba3a, + 0xc6468606, 0xe666a626, 0xd6569616, 0xf676b636, + 0xce4e8e0e, 0xee6eae2e, 0xde5e9e1e, 0xfe7ebe3e, + 0xc1418101, 0xe161a121, 0xd1519111, 0xf171b131, + 0xc9498909, 0xe969a929, 0xd9599919, 0xf979b939, + 0xc5458505, 0xe565a525, 0xd5559515, 0xf575b535, + 0xcd4d8d0d, 0xed6dad2d, 0xdd5d9d1d, 0xfd7dbd3d, + 0xc3438303, 0xe363a323, 0xd3539313, 0xf373b333, + 0xcb4b8b0b, 0xeb6bab2b, 0xdb5b9b1b, 0xfb7bbb3b, + 0xc7478707, 0xe767a727, 0xd7579717, 0xf777b737, + 0xcf4f8f0f, 0xef6faf2f, 0xdf5f9f1f, 0xff7fbf3f, + 0x1045a3e2, 0x000000f4, 0x263b7333, 0x766b2363, + 0x2b367e3e, 0x7b662e6e, 0x06db93d3, 0x964b0343, + 0x0bd69ede, 0x9b460e4e, 0x825f1757, 0x12cf87c7, + 0x8f521a5a, 0x1fc28aca, 0x00d199d9, 0x90410949, + 0x01d098d8, 0x91400848, 0x24357d3d, 0x74652d6d, + 0x25347c3c, 0x75642c6c, 0x04d59ddd, 0x94450d4d, + 0x05d49cdc, 0x95440c4c, 0x80511959, 0x10c189c9, + 0x81501858, 0x11c088c8, 0x02df97d7, 0x924f0747, + 0x0fd29ada, 0x9f420a4a, 0x865b1353, 0x16cb83c3, + 0x8b561e5e, 0x1bc68ece, 0xa6bbf3b3, 0xf6eba3e3, + 0xabb6febe, 0xfbe6aeee, 0x223f7737, 0x726f2767, + 0x2f327a3a, 0x7f622a6a, 0xa0b1f9b9, 0xf0e1a9e9, + 0xa1b0f8b8, 0xf1e0a8e8, 0x84551d5d, 0x14c58dcd, + 0x85541c5c, 0x15c48ccc, 0xa4b5fdbd, 0xf4e5aded, + 0xa5b4fcbc, 0xf5e4acec, 0x20317939, 0x70612969, + 0x21307838, 0x71602868, 0xa2bff7b7, 0xf2efa7e7, + 0xafb2faba, 0xffe2aaea, 0x00000000, 0x00000000, +}; + +static u32 PCM240Ucode1fff00[] = { + 0xcbcecdc4, 0xcfcac9c8, 0xc3c6c5cc, 0xc7c2c1c0, + 0x1b1e1d14, 0x1f1a1918, 0x1316151c, 0x17121110, + 0x2b2e2d24, 0x2f2a2928, 0x2326252c, 0x27222120, + 0x3b3e3d34, 0x3f3a3938, 0x3336353c, 0x37323130, + 0x0b0e0d04, 0x0f0a0908, 0x0306050c, 0x07020100, + 0xdbdeddd4, 0xdfdad9d8, 0xd3d6d5dc, 0xd7d2d1d0, + 0xebeeede4, 0xefeae9e8, 0xe3e6e5ec, 0xe7e2e1e0, + 0xfbfefdf4, 0xfffaf9f8, 0xf3f6f5fc, 0xf7f2f1f0, + 0x4b4e4d44, 0x4f4a4948, 0x4346454c, 0x47424140, + 0x9b9e9d94, 0x9f9a9998, 0x9396959c, 0x97929190, + 0xabaeada4, 0xafaaa9a8, 0xa3a6a5ac, 0xa7a2a1a0, + 0xbbbebdb4, 0xbfbab9b8, 0xb3b6b5bc, 0xb7b2b1b0, + 0x8b8e8d84, 0x8f8a8988, 0x8386858c, 0x87828180, + 0x5b5e5d54, 0x5f5a5958, 0x5356555c, 0x57525150, + 0x6b6e6d64, 0x6f6a6968, 0x6366656c, 0x67626160, + 0x7b7e7d74, 0x7f7a7978, 0x7376757c, 0x77727170, + 0x341424c4, 0x3e1e2ece, 0x3d1d2dcd, 0x3b1b2bcb, + 0xb494a444, 0xbe9eae4e, 0xbd9dad4d, 0xbb9bab4b, + 0xf4d4e404, 0xfedeee0e, 0xfddded0d, 0xfbdbeb0b, + 0x74546484, 0x7e5e6e8e, 0x7d5d6d8d, 0x7b5b6b8b, + 0x3c1c2ccc, 0x361626c6, 0x351525c5, 0x331323c3, + 0xbc9cac4c, 0xb696a646, 0xb595a545, 0xb393a343, + 0xfcdcec0c, 0xf6d6e606, 0xf5d5e505, 0xf3d3e303, + 0x7c5c6c8c, 0x76566686, 0x75556585, 0x73536383, + 0x381828c8, 0x3a1a2aca, 0x391929c9, 0x3f1f2fcf, + 0xb898a848, 0xba9aaa4a, 0xb999a949, 0xbf9faf4f, + 0xf8d8e808, 0xfadaea0a, 0xf9d9e909, 0xffdfef0f, + 0x78586888, 0x7a5a6a8a, 0x79596989, 0x7f5f6f8f, + 0x301020c0, 0x321222c2, 0x311121c1, 0x371727c7, + 0xb090a040, 0xb292a242, 0xb191a141, 0xb797a747, + 0xf0d0e000, 0xf2d2e202, 0xf1d1e101, 0xf7d7e707, + 0x70506080, 0x72526282, 0x71516181, 0x77576787, + 0x05040100, 0x15141110, 0x25242120, 0x35343130, + 0x85848180, 0x95949190, 0xa5a4a1a0, 0xb5b4b1b0, + 0xc0408000, 0xe060a020, 0xd0509010, 0xf070b030, + 0xc8488808, 0xe868a828, 0xd8589818, 0xf878b838, + 0xc4448404, 0xe464a424, 0xd4549414, 0xf474b434, + 0xcc4c8c0c, 0xec6cac2c, 0xdc5c9c1c, 0xfc7cbc3c, + 0xc2428202, 0xe262a222, 0xd2529212, 0xf272b232, + 0xca4a8a0a, 0xea6aaa2a, 0xda5a9a1a, 0xfa7aba3a, + 0xc6468606, 0xe666a626, 0xd6569616, 0xf676b636, + 0xce4e8e0e, 0xee6eae2e, 0xde5e9e1e, 0xfe7ebe3e, + 0xc1418101, 0xe161a121, 0xd1519111, 0xf171b131, + 0xc9498909, 0xe969a929, 0xd9599919, 0xf979b939, + 0xc5458505, 0xe565a525, 0xd5559515, 0xf575b535, + 0xcd4d8d0d, 0xed6dad2d, 0xdd5d9d1d, 0xfd7dbd3d, + 0xc3438303, 0xe363a323, 0xd3539313, 0xf373b333, + 0xcb4b8b0b, 0xeb6bab2b, 0xdb5b9b1b, 0xfb7bbb3b, + 0xc7478707, 0xe767a727, 0xd7579717, 0xf777b737, + 0xcf4f8f0f, 0xef6faf2f, 0xdf5f9f1f, 0xff7fbf3f, + 0x1045a3e2, 0x000000f4, 0x263b7333, 0x766b2363, + 0x2b367e3e, 0x7b662e6e, 0x06db93d3, 0x964b0343, + 0x0bd69ede, 0x9b460e4e, 0x825f1757, 0x12cf87c7, + 0x8f521a5a, 0x1fc28aca, 0x00d199d9, 0x90410949, + 0x01d098d8, 0x91400848, 0x24357d3d, 0x74652d6d, + 0x25347c3c, 0x75642c6c, 0x04d59ddd, 0x94450d4d, + 0x05d49cdc, 0x95440c4c, 0x80511959, 0x10c189c9, + 0x81501858, 0x11c088c8, 0x02df97d7, 0x924f0747, + 0x0fd29ada, 0x9f420a4a, 0x865b1353, 0x16cb83c3, + 0x8b561e5e, 0x1bc68ece, 0xa6bbf3b3, 0xf6eba3e3, + 0xabb6febe, 0xfbe6aeee, 0x223f7737, 0x726f2767, + 0x2f327a3a, 0x7f622a6a, 0xa0b1f9b9, 0xf0e1a9e9, + 0xa1b0f8b8, 0xf1e0a8e8, 0x84551d5d, 0x14c58dcd, + 0x85541c5c, 0x15c48ccc, 0xa4b5fdbd, 0xf4e5aded, + 0xa5b4fcbc, 0xf5e4acec, 0x20317939, 0x70612969, + 0x21307838, 0x71602868, 0xa2bff7b7, 0xf2efa7e7, + 0xafb2faba, 0xffe2aaea, 0x00000000, 0x00000000, +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/pcm.h linux.20pre5-ac2/drivers/media/video/ls220/pcm.h --- linux.20pre5/drivers/media/video/ls220/pcm.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/pcm.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,792 @@ +static u32 PCMUcode1f1800[] = { + 0xb500000f, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xb50001fb, 0x00000000, 0x00000000, 0x00000000, + 0x820f001f, 0x802f001f, 0x029f9014, 0x829efef0, + 0x8286000f, 0x02bf0054, 0x82bcfef4, 0x82a6000e, + 0x80074000, 0x001f6193, 0x8013001f, 0x9020c000, + 0x003fb006, 0x803effe8, 0x803effec, 0x9020fa00, + 0x803effd0, 0x803effdc, 0x803effd8, 0x9020fe00, + 0x803effd4, 0x90400000, 0x804600a2, 0x90421800, + 0x804600a3, 0x80132000, 0x98000040, 0x800600a6, + 0x80050080, 0x98000002, 0x80060080, 0x80070001, + 0x001f2013, 0x80070000, 0x001f23f9, 0x801e4b0c, + 0x001f210c, 0x80070001, 0x001f2324, 0x80070800, + 0x001f600f, 0x001fb0cb, 0x001fb010, 0x801efff0, + 0x98004000, 0x001f600e, 0x83e4011b, 0x80070000, + 0x801e4b14, 0x800500a0, 0xb0000001, 0xb4000009, + 0x80070001, 0x800600a0, 0x80050080, 0x98000020, + 0x80060080, 0x9400ffdf, 0x80060080, 0x80070000, + 0x800600a0, 0x80074000, 0x801e4b04, 0x81df0004, + 0x801bfff0, 0x00000000, 0x940000ff, 0xb0000000, + 0xb4200033, 0x003f400e, 0x94010010, 0xb0000000, + 0xb400fff7, 0x003f0013, 0xb0010001, 0xb420001f, + 0x803bffe8, 0x801bffec, 0x805b4b04, 0x00000000, + 0x3001b800, 0xb4600001, 0x9021a000, 0x0421b800, + 0x3001b802, 0xb460000d, 0x80050086, 0x005f9044, + 0x0420b802, 0xb00101e0, 0xb4a0ffe5, 0x001fb010, + 0x001f010c, 0xb0000001, 0xb400ffe1, 0x80070001, + 0x001f210c, 0x83e400e8, 0xb500ffdd, 0x8007001f, + 0x94000003, 0x5810b800, 0x83e719ec, 0x1bffb800, + 0x003f9008, 0x1821b800, 0x00ffb801, 0x80270000, + 0x003f2013, 0x8007001f, 0x94000003, 0x5810b800, + 0x83671a14, 0x1b7bb800, 0x003f9009, 0x1821b800, + 0x00ffb801, 0x80070000, 0x001f210c, 0xb500ffc8, + 0x003f400e, 0xb0000086, 0xb4400051, 0xb0000084, + 0xb400003b, 0xb0000085, 0xb4000041, 0xb0000086, + 0xb4000043, 0xb0000083, 0xb4000000, 0x815bff7c, + 0x00000000, 0x940a0080, 0x5c07b800, 0xb0000001, + 0xb400006f, 0x81674b18, 0x940a0007, 0x5803b800, + 0x116bb800, 0x005bb80b, 0x916b0004, 0x001bb80b, + 0x806500d4, 0x1463b800, 0x1863b802, 0x806600d4, + 0x80073c21, 0x801e4b00, 0x800600a1, 0x80074000, + 0x801e4b04, 0x8013001f, 0x98405000, 0x805effe0, + 0x005fb006, 0x805effe8, 0x805effec, 0x9042a000, + 0x805effe4, 0x9040fa00, 0x805effd0, 0x805effdc, + 0x805effd8, 0x9040fe00, 0x805effd4, 0x8013007f, + 0x9800ffff, 0x001fb040, 0x80070001, 0x001f2013, + 0x80070000, 0x001f2324, 0x001fb0cb, 0x001fb010, + 0x001fb041, 0x001fb042, 0x80073310, 0x001fb008, + 0x80071e40, 0x001fb009, 0x98214000, 0xb5000010, + 0x94011000, 0xb0001000, 0xb4200001, 0x9421efff, + 0x98210010, 0xb500000a, 0x80070000, 0x001fb0cb, + 0x83e40099, 0x003f400e, 0x9421ffef, 0xb5000004, + 0x83e40095, 0x003f400e, 0x98211000, 0x9421ffef, + 0x003f600e, 0x80070100, 0x801efff0, 0xb500ff74, + 0xb000008b, 0xb4000018, 0xb0000087, 0xb400ffee, + 0xb0000088, 0xb4000016, 0xb000008a, 0xb4000016, + 0xb000008c, 0xb4000017, 0xb0000089, 0xb4000019, + 0xb00000a0, 0xb400001b, 0xb00000a1, 0xb4000047, + 0xb00000a2, 0xb4000054, 0xb00000a3, 0xb400004c, + 0xb00000a4, 0xb4000056, 0xb00000a5, 0xb400005a, + 0xb00000a6, 0xb400005e, 0x803efff8, 0xb500ffe1, + 0x9421ffdf, 0xb500ffde, 0x80270100, 0x803efff8, + 0xb500ffdc, 0x803bffb0, 0x00000000, 0x003fb040, + 0xb500ffd8, 0x803bff80, 0x00000000, 0x003f6001, + 0xb500ffd4, 0x003f90ba, 0x803efff8, 0xb500ffd1, + 0x81674b18, 0x940a0007, 0x5803b800, 0x116bb800, + 0x005bb80b, 0x916b0004, 0x001bb80b, 0x806500d4, + 0x1463b800, 0x1863b802, 0x806600d4, 0x80130001, + 0x98003d21, 0x800600a1, 0x801e4b00, 0x80074000, + 0x801e4b04, 0x8013001f, 0x98405000, 0x805effe0, + 0x005fb006, 0x805effe8, 0x805effec, 0x9042a000, + 0x805effe4, 0x9040fa00, 0x805effd0, 0x805effdc, + 0x805effd8, 0x9040fe00, 0x805effd4, 0x80070001, + 0x001f2013, 0x80070000, 0x001f2324, 0x001fb0cb, + 0x001fb010, 0x80073b00, 0x001fb008, 0x800742f0, + 0x001fb009, 0x98214000, 0xb500ffa5, 0x80270000, + 0x8047fef0, 0x003eb802, 0x90420004, 0x003eb802, + 0x90420004, 0x003eb802, 0x90420004, 0x003eb802, + 0x81df0000, 0x00000000, 0x00000000, 0x8364042b, + 0x81df0004, 0xb500ff97, 0x81df0000, 0x00000000, + 0x00000000, 0x836403d5, 0x81df0004, 0xb500ff91, + 0x81df0000, 0x00000000, 0x00000000, 0x83640390, + 0x81df0004, 0xb500ff8b, 0x81df0000, 0x00000000, + 0x00000000, 0x834402f3, 0x81df0004, 0xb500ff85, + 0x81df0000, 0x00000000, 0x00000000, 0x834402d8, + 0x81df0004, 0xb500ff7f, 0x80070000, 0x80470000, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002003, + 0xb6003002, 0x001eb802, 0x90420004, 0x80171000, + 0x8057ffff, 0xb6002002, 0xb6001801, 0x001fa020, + 0x81df0004, 0x00ffb81f, 0x83a70000, 0x8057ffff, + 0x80770000, 0x8073007d, 0x98636d4a, 0x0207b803, + 0x81df0000, 0x00000000, 0x00000000, 0x80171000, + 0xb6000007, 0x003fc020, 0x005fc7e0, 0x40c1b810, + 0x4102b810, 0x001fe026, 0x001fe0a8, 0x4210b803, + 0x81df0004, 0x80270000, 0x003f2013, 0x8007001f, + 0x94000003, 0x5810b800, 0x83671e1c, 0x1b7bb800, + 0x003f9009, 0x1821b800, 0x00ffb801, 0x003f0013, + 0xb0010001, 0xb420fff3, 0x93bd0001, 0xb01d0004, + 0xb480ffe3, 0x00ffb81f, 0x00000000, 0x00000000, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815b4b0c, 0x81070000, 0x81270bf4, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x812717f4, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a00060, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200006, + 0x039f4193, 0x5b81b81c, 0x003f90cb, 0x1021b81c, + 0x003fb0cb, 0x8384024e, 0x829bff80, 0x801300e0, + 0x1434b800, 0x5c35b801, 0x8013001f, 0x1454b800, + 0x5c50b802, 0x8073007f, 0x9863ffff, 0xb002000f, + 0xb4800001, 0x90210001, 0x84210004, 0xb0010000, + 0xb4a00001, 0x6861b803, 0x005f9040, 0x4082b803, + 0x80af001f, 0x808f0000, 0x806f0000, 0x8007ffff, + 0x8033ffff, 0x80171000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6001811, 0xb6002010, 0x14618000, + 0x6068b803, 0x40c4b803, 0x14608000, 0x00c8b806, + 0x5870b803, 0x6068b803, 0x4104b803, 0x58c8b806, + 0x0108b808, 0x14c6b801, 0x00000000, 0x00000000, + 0x5d08b808, 0x1508b800, 0x1806a028, 0x81df0004, + 0x80670400, 0x5d22b80a, 0x81df0000, 0x00000000, + 0x00000000, 0xb600180a, 0x00cfb803, 0x013fb0bc, + 0x5922b809, 0x01afb809, 0x013f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x91290020, + 0x81df0004, 0x808f0000, 0x801b4b14, 0x80270001, + 0xb0000001, 0xb4000002, 0x802600a0, 0x803e4b14, + 0x81270c00, 0xb00a0000, 0xb4000001, 0x81270000, + 0x813e4b0c, 0x80270001, 0x003f2013, 0x80050086, + 0x001fb044, 0x00ffb81b, 0x00000000, 0x00000000, + 0x029fb00a, 0x02bfb00b, 0x02dfb00c, 0x02ffb00d, + 0x031fb00e, 0x033fb00f, 0x033f400f, 0x0287b86f, + 0x029fb005, 0x8285009c, 0x96b48000, 0xb0158000, + 0xb4000191, 0x96b40100, 0xb0150100, 0xb40001ad, + 0x96b40400, 0xb0150400, 0xb40001bf, 0x96b40001, + 0xb0150001, 0xb400000c, 0x96b40008, 0xb0150008, + 0xb400019a, 0x96b44000, 0xb0154000, 0xb40001be, + 0x96b40002, 0xb0150002, 0xb400015e, 0x00000000, + 0x00000000, 0xb50001d0, 0x02bf9017, 0x92b50001, + 0x02bfb017, 0x82850082, 0x83050081, 0x82a5009a, + 0x96b50001, 0xb0150001, 0xb4200014, 0x82a70000, + 0x02bfb017, 0x96b41840, 0xb0150800, 0xb420000c, + 0x96b40008, 0x5aa9b815, 0x96d46000, 0x5ec3b816, + 0x82f3000f, 0x9af7c00f, 0x1718b817, 0x1ab5b818, + 0x1ab5b816, 0x9ab50340, 0x82a60081, 0xb500013d, + 0x9b180180, 0x83060081, 0xb500013a, 0x82a5009a, + 0x96b50002, 0xb0150002, 0xb420001b, 0x82a70000, + 0x02bfb017, 0x96b41800, 0xb0151800, 0xb4000013, + 0x96b40040, 0xb0150040, 0xb4200004, 0xa3180c00, + 0x9b180340, 0x83060081, 0xb500012a, 0x96b40008, + 0x5aa9b815, 0x96d46000, 0x5ec3b816, 0x82f3000f, + 0x9af7c00f, 0x1718b817, 0x1ab5b818, 0x1ab5b816, + 0x9ab50340, 0x82a60081, 0xb500011e, 0x9b180180, + 0x83060081, 0xb500011b, 0x82a500c1, 0x96b5000f, + 0xb015000b, 0xb420000e, 0x96b40020, 0xb0150020, + 0xb400000b, 0x96b40200, 0xb0150200, 0xb4000008, + 0x82c50086, 0x82e50094, 0x3016b817, 0xb4400004, + 0x06f7b816, 0xb017ff00, 0xb4400001, 0xb5000109, + 0x96b46000, 0xb0156000, 0xb4000011, 0x96b41820, + 0xb0150820, 0xb4200004, 0x9b391000, 0x82a5009a, + 0x96b5feff, 0x82a6009a, 0x96b40040, 0xb0150040, + 0xb4200001, 0x9739efff, 0x96b91000, 0xb0151000, + 0xb4200003, 0x82a5009a, 0x9ab50100, 0x82a6009a, + 0x96b40040, 0xb0150040, 0xb4200019, 0x96b41800, + 0xb0151800, 0xb4200006, 0x96b98000, 0xb0158000, + 0xb4200003, 0x9b180180, 0x83060081, 0xb50000e9, + 0x96d80c00, 0x82b300ff, 0x9ab5f3ff, 0x1718b815, + 0xb0160c00, 0xb4000007, 0x82e50098, 0x96f70400, + 0xb0170400, 0xb4200002, 0x82c70c00, 0xb5000001, + 0xa2d60c00, 0x1b18b816, 0x9b180340, 0xb50000cf, + 0x96b40220, 0xb0150000, 0xb4e00033, 0x82a5009d, + 0x82f3ffff, 0x16b5b817, 0x82f3000e, 0x3015b817, + 0xb420002d, 0x96f98000, 0xb0178000, 0xb400002a, + 0x82a70000, 0x02bfb017, 0x82c50081, 0x9ab60020, + 0x82a60081, 0x82a50086, 0x92b50bb8, 0x82a60094, + 0x82c60081, 0x82c5009d, 0x96d6ffff, 0x82b30032, + 0x9ab58001, 0x82e500c1, 0x96f7000f, 0xb017000b, + 0xb4000002, 0x82b30022, 0x9ab58001, 0x1ab5b816, + 0x82c5009a, 0x96d60020, 0xb0160020, 0xb4200002, + 0x82b30032, 0x9ab58001, 0x82a6009d, 0x02ff9017, + 0x00000000, 0xb0170040, 0xb480000b, 0x96f41c00, + 0xb0171c00, 0xb4200008, 0x82e50086, 0x82c50094, + 0x92d63000, 0x3016b817, 0xb4400003, 0x9b180180, + 0x83060081, 0xb50000a3, 0x5eb5b814, 0x96b500f0, + 0x96f46000, 0x5eedb817, 0x1ab5b817, 0xb0170003, + 0xb4000004, 0x96b500ef, 0x96f70001, 0x5ae4b817, + 0x1ab5b817, 0x96d41800, 0xb0161800, 0xb400000a, + 0x96f900ff, 0x96b500ff, 0x9739ff00, 0x1b39b815, + 0x02a7b817, 0x96b500f3, 0x96d40008, 0x5ec1b816, + 0x1ab5b816, 0xb500000c, 0x96f98000, 0xb0178000, + 0xb4200007, 0x5efeb814, 0x96f70001, 0xb0170001, + 0xb4000003, 0x9b180180, 0x83060081, 0xb5000081, + 0x96b500f3, 0x9ab50008, 0x9739fff3, 0x96d40020, + 0xb0160020, 0xb4200017, 0x9b398000, 0x82c70000, + 0x02dfb017, 0x96d40010, 0x5ac8b816, 0x82f300ff, + 0x9af7cfff, 0x1718b817, 0x1b18b816, 0x9b180340, + 0x82c5009d, 0x96d6ffff, 0x82f3000e, 0x9af78001, + 0x1af7b816, 0x82c5009a, 0x96d60020, 0xb0160020, + 0xb4200002, 0x82f30032, 0x9af78001, 0x82e6009d, + 0xb500005a, 0x97397fff, 0x96b500ff, 0x5aaab815, + 0x82f300fc, 0x9af703ff, 0x1718b817, 0x1b18b815, + 0x9b180340, 0x82c5009a, 0x96d60010, 0xb0160010, + 0xb4200024, 0x82c70000, 0x02dfb017, 0x82c50086, + 0x92d60bb8, 0x82c60086, 0x82c50094, 0x5eefb818, + 0x96f70003, 0xb0170003, 0xb4200002, 0x82e70bb8, + 0xb5000001, 0x82e70bb8, 0x12d6b817, 0x82e50081, + 0x9af70020, 0x82e60081, 0x82c60094, 0xa2f70020, + 0x82e60081, 0x82f30001, 0x16f7b818, 0x5ef0b817, + 0xb0170001, 0xb4000004, 0x96f84000, 0x5ee4b817, + 0x9718f3ff, 0x1b18b817, 0x82f3000a, 0x9af78000, + 0x82e6009d, 0x83060081, 0x83070001, 0x8306009f, + 0xb50000ad, 0x82c5009d, 0x82f3000e, 0x9af78001, + 0x3016b817, 0xb420000f, 0x82b30032, 0x9ab58001, + 0x82e500c1, 0x96f7000f, 0xb017000b, 0xb4000002, + 0x82b30022, 0x9ab58001, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82b30032, 0x9ab58001, + 0x82a6009d, 0x82c5009a, 0x96d60080, 0xb0160080, + 0xb4000011, 0x02df9017, 0x00000000, 0xb0160010, + 0xb480000d, 0x82c500c1, 0x96d6000f, 0xb016000b, + 0xb4000009, 0x82c50087, 0x96d60080, 0x5ac7b816, + 0x96f84000, 0x3017b816, 0xb4200003, 0x033f400f, + 0x9b394000, 0xb500000b, 0x9739bfff, 0x82e50061, + 0x96f70008, 0xb0170008, 0xb4000005, 0x5eefb818, + 0x96f70003, 0xb0170003, 0xb4000001, 0x9718ffff, + 0x83060081, 0x83070001, 0x8306009f, 0x00000000, + 0xb5000075, 0x82850083, 0x96b400ff, 0xb015003c, + 0xb4200019, 0x96b92000, 0xb0152000, 0xb4000002, + 0x9b392000, 0xb5000014, 0x9739d3ff, 0x82870000, + 0x82860087, 0x82870008, 0x82860083, 0x829bff78, + 0x82a7001f, 0xb0140400, 0xb4000001, 0x82a70010, + 0x82a600c9, 0x829bff78, 0x00000000, 0x828600cb, + 0x8285009d, 0x82b3ffff, 0x9ab5fffd, 0x1694b815, + 0x8286009d, 0xb5000000, 0x83070002, 0x8306009f, + 0x00000000, 0xb5000054, 0x96b90800, 0xb0150800, + 0xb4200009, 0x9739f7ff, 0x82a703fd, 0x82a600cb, + 0x82a7003c, 0x82a60083, 0x8285009d, 0x9a940002, + 0x8286009d, 0xb5000004, 0x82850087, 0x5a82b814, + 0xa2940200, 0x82860087, 0xb5000000, 0x83078000, + 0x8306009f, 0x00000000, 0xb500003f, 0x82850086, + 0x82a50094, 0x3015b814, 0xb4800002, 0x86b50bb8, + 0x82a60086, 0x83070008, 0x8306009f, 0x00000000, + 0xb5000035, 0x83050069, 0x9718003f, 0x82e50064, + 0x12f7b818, 0x86f70088, 0x82feff74, 0x02e7b86f, + 0x9af74000, 0x01ffb817, 0x96f7bfff, 0x01ffb817, + 0x83050081, 0x82f3001c, 0x9af703ff, 0x1718b817, + 0x9b180140, 0x83060081, 0x83070100, 0x8306009f, + 0x00000000, 0xb5000020, 0x83070000, 0x83050081, + 0x9b180180, 0x83060081, 0x83070400, 0x8306009f, + 0x00000000, 0xb5000018, 0x82870000, 0x82850082, + 0x5eb7b814, 0x96b500fc, 0x96d40006, 0x5ec1b816, + 0x1ab5b816, 0x5aacb815, 0x83050081, 0x82d3001c, + 0x9ad600ff, 0x1718b816, 0x1b18b815, 0x9b180e00, + 0x83060081, 0x83074000, 0x8306009f, 0x8305009d, + 0x82d300ff, 0x9ad6bfff, 0x1718b816, 0x8306009d, + 0x00000000, 0xb5000000, 0x029f9005, 0x01ffb814, + 0x033f600f, 0x029f900a, 0x02bf900b, 0x02df900c, + 0x02ff900d, 0x031f900e, 0x033f900f, 0x00ffb81e, + 0x02ff9010, 0x92f70b43, 0x02ffb010, 0x02ff90cb, + 0x82bbffdc, 0x829bffd8, 0x93150004, 0x3014b815, + 0xb4000010, 0x02dbb818, 0x029bb815, 0x3017b816, + 0xb480000c, 0x5a81b814, 0x029fb010, 0x82860095, + 0x8293001f, 0x9294fe00, 0x92b50008, 0x3015b814, + 0xb4800002, 0x82b3001f, 0x92b5fa00, 0x82beffdc, + 0xb500ffeb, 0x029f9010, 0x83250094, 0x06d4b819, + 0x02d6b816, 0xb016ffff, 0xb4a0000a, 0x8293000e, + 0x9a948001, 0x82c5009d, 0x96d6ffff, 0x1a94b816, + 0x82c5009a, 0x96d60010, 0xb0160010, 0xb4000001, + 0x8286009d, 0x00ffb81c, 0x00000000, 0x00000000, + 0x001f9012, 0x001fb100, 0x001f004c, 0x001f2404, + 0x801bfef0, 0x8058fef4, 0x803bff68, 0x8078ff6c, + 0x2000b801, 0x2042b803, 0x001fb104, 0x005f2414, + 0x82e70001, 0x83640048, 0x029fb014, 0x829efef0, + 0x8286000f, 0x02bf2054, 0x82bcfef4, 0x82a6000e, + 0x00ffb81a, 0x80e70001, 0x801336e3, 0x9800eb76, + 0x001fb100, 0x800700ab, 0x001f2404, 0x801bc3e8, + 0x8058c3ec, 0x83640024, 0x82e70000, 0x83640036, + 0x029fb300, 0x029fb100, 0x02bf2c04, 0x02bf2404, + 0x801bc000, 0x8058c004, 0x8364001b, 0x82e70000, + 0x8364002d, 0x001f9300, 0x3000b814, 0xb420000a, + 0x001f0c04, 0x3000b815, 0xb4200007, 0x829efef0, + 0x82bcfef4, 0x029fb012, 0x02bf204c, 0x82870001, + 0x829cfef5, 0x00ffb81a, 0xb0070000, 0xb4000007, + 0x80e70000, 0x801399fa, 0x9800c92e, 0x001fb100, + 0x800700af, 0x001f2404, 0xb500ffdc, 0x82870000, + 0x829cfef5, 0x00ffb81a, 0x80c700ff, 0x803bff68, + 0x8078ff6c, 0x14a0b806, 0x2063b805, 0x007f2414, + 0x2021b802, 0x58c8b806, 0x14a0b806, 0x58b0b805, + 0x2021b805, 0x58c8b806, 0x14a0b806, 0x2021b805, + 0x58c8b806, 0x14a0b806, 0x5cb0b805, 0x2021b805, + 0x003fb104, 0x00ffb81b, 0x82c70000, 0x83070400, + 0x83270005, 0x8197040c, 0x81d7ffff, 0x83840126, + 0x83840001, 0x00ffb81b, 0x808f0000, 0x806f001f, + 0x80af001f, 0x80270140, 0x81e70228, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x80270180, 0x81e70120, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x8057ffff, 0x80170430, 0x80070410, + 0x80270408, 0xb6000509, 0x005ff000, 0x90420500, + 0x007ff001, 0x90630600, 0x009ff002, 0x00bff003, + 0x2004a025, 0x90000001, 0x90210001, 0x80070414, + 0x80d7ffff, 0x8097045c, 0x8017043c, 0xb6000404, + 0x005ff000, 0x007f87e0, 0x84000001, 0x2082a7e3, + 0x80970460, 0x80170440, 0x2082b803, 0x007f8000, + 0x2083a004, 0x80170430, 0x80970450, 0x80270408, + 0xb6000508, 0x005f8024, 0x90420500, 0x007ff001, + 0x90630600, 0x009ff002, 0x00bff003, 0x2004a025, + 0x90210001, 0x80170440, 0x00000000, 0x02bf87e0, + 0x80970460, 0x82870000, 0xb6000404, 0x005f87e4, + 0x5a88b814, 0x204287e0, 0x1a94b802, 0x00ffb81c, + 0x001f0a49, 0x001f2709, 0x001f0a41, 0x001f2708, + 0x001f0a46, 0x001f2707, 0x001f0a48, 0x001f2706, + 0x001f0a42, 0x001f2705, 0x001f0a47, 0x001f2704, + 0x001f0a45, 0x001f2703, 0x001f0a43, 0x001f2702, + 0x001f0a40, 0x001f2701, 0x001f0a44, 0x001f2700, + 0x001f0c25, 0xa020000c, 0x94400001, 0x94600002, + 0x94810004, 0x94a10008, 0x94c00010, 0x5943b802, + 0x5861b803, 0x5882b804, 0x5ca2b805, 0x5cc4b806, + 0x194ab803, 0x194ab804, 0x194ab805, 0x194ab806, + 0x015f2738, 0x801b0220, 0x003f91c1, 0x5c28b801, + 0x005f91c2, 0x5858b802, 0x1821b802, 0x2000b801, + 0x001fb1c4, 0x80180224, 0x003f0709, 0x2000b801, + 0x001f2714, 0x82c70001, 0x82e70001, 0x83070710, + 0x8327001e, 0x81970735, 0x8384009f, 0x02df0738, + 0x82170a30, 0x838400f1, 0x819efef0, 0x817cfef4, + 0x819eff68, 0x817cff6c, 0x00ffb81b, 0x820f001f, + 0x8018fef8, 0x8057ffff, 0x001f2709, 0x8018fef6, + 0x80d7ffff, 0x001f2708, 0x8018fefa, 0x8157ffff, + 0x001f2707, 0x8018fefd, 0x81d7ffff, 0x001f2706, + 0x8018fefb, 0x802f001f, 0x001f2705, 0x8018fefe, + 0x00000000, 0x001f2704, 0x8018fef9, 0x00000000, + 0x001f2703, 0x8018feff, 0x00000000, 0x001f2702, + 0x8018fef7, 0x00000000, 0x001f2701, 0x8018fefc, + 0x00000000, 0x001f2700, 0x001f0c25, 0xa0200011, + 0x94410001, 0x94600002, 0x94800004, 0x94a00008, + 0x94c10010, 0x5941b802, 0x5861b803, 0x5c82b804, + 0x58a1b805, 0x5cc1b806, 0x194ab803, 0x194ab804, + 0x194ab805, 0x194ab806, 0x015f2738, 0x801b0220, + 0x003f91c1, 0x5c28b801, 0x005f91c2, 0x5858b802, + 0x1821b802, 0x2000b801, 0x001fb1c4, 0x80180224, + 0x003f0709, 0x2000b801, 0x001f2714, 0x82c70001, + 0x82e70001, 0x83070710, 0x8327001e, 0x81970735, + 0x83840055, 0x02df0738, 0x82170a20, 0x838400a7, + 0x819efef0, 0x817cfef4, 0x5ac8b80c, 0x02ff0a44, + 0x1ad6b817, 0x02dfb291, 0x5ed8b80c, 0x5968b80b, + 0x1ad6b80b, 0x02df6524, 0x00ffb81b, 0x820f001f, + 0x8018fefe, 0x8057ffff, 0x001f2709, 0x8018fefa, + 0x80d7ffff, 0x001f2708, 0x8018fefc, 0x8157ffff, + 0x001f2707, 0x8018feff, 0x81d7ffff, 0x001f2706, + 0x8018fef8, 0x802f001f, 0x001f2705, 0x8018fefb, + 0x00000000, 0x001f2704, 0x8018fefd, 0x00000000, + 0x001f2703, 0x8018fef6, 0x00000000, 0x001f2702, + 0x8018fef9, 0x00000000, 0x001f2701, 0x8018fef7, + 0x00000000, 0x001f2700, 0x801b0220, 0x003f91c1, + 0x5c28b801, 0x005f91c2, 0x5858b802, 0x1821b802, + 0x2000b801, 0x001fb1c4, 0x80180224, 0x003f0709, + 0x2000b801, 0x001f2714, 0x82c70001, 0x82e70001, + 0x83070710, 0x8327001e, 0x81970735, 0x83840016, + 0x83270000, 0x831bfef0, 0x82f8fef4, 0x02c7b819, + 0x82170a28, 0x83840065, 0x300cb818, 0xb4200002, + 0x300bb817, 0xb4000006, 0x93390001, 0xb0190020, + 0xb480fff6, 0x83270000, 0x833cfef5, 0x00ffb81b, + 0x019fb290, 0x017f2a44, 0x033f2c25, 0x83270001, + 0x833cfef5, 0x00ffb81b, 0x0007b818, 0x90000003, + 0x00000000, 0x015ff000, 0x90000001, 0x5949b80a, + 0x013ff000, 0x194ab809, 0x84000002, 0x994a0100, + 0x017ff000, 0x958b00f8, 0x5981b80c, 0x956b0007, + 0x198cb80b, 0x84000002, 0x998c0008, 0x017ff000, + 0x90000001, 0x5971b80b, 0x198cb80b, 0x017ff000, + 0x5969b80b, 0x198cb80b, 0x81a70000, 0x94d90003, + 0x82a70000, 0xb6260019, 0xb6000818, 0x5df0b80a, + 0x5e02b80a, 0x21efb810, 0x95ef0001, 0x5941b80a, + 0x194ab80f, 0x21efb816, 0x5e18b80c, 0x5e35b80c, + 0x5e54b80c, 0x5e6cb80c, 0x2210b811, 0x2252b813, + 0x2210b812, 0x96100001, 0x5981b80c, 0x198cb810, + 0x2210b817, 0x10afb810, 0x10a5b80d, 0x5da1b805, + 0x94a50001, 0x5aa1b815, 0x1ab5b805, 0x019fa7f5, + 0x5cc2b819, 0xb626001c, 0x82870000, 0xb6000419, + 0xb6000818, 0x5df0b80a, 0x5e02b80a, 0x21efb810, + 0x95ef0001, 0x5941b80a, 0x194ab80f, 0x21efb816, + 0x5e18b80c, 0x5e35b80c, 0x5e54b80c, 0x5e6cb80c, + 0x2210b811, 0x2252b813, 0x2210b812, 0x96100001, + 0x5981b80c, 0x198cb810, 0x2210b817, 0x10afb810, + 0x10a5b80d, 0x5da1b805, 0x94a50001, 0x5a81b814, + 0x1a94b805, 0x019fa7f4, 0x00ffb81c, 0x8257ffff, + 0x808f0000, 0x806f001f, 0x80af001f, 0x80270200, + 0x81e7ff00, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270240, + 0x81e70000, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270180, + 0x81e70120, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x806f0007, + 0x80af0007, 0x80270280, 0x81e70100, 0x5de2b80f, + 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, + 0x01ff90bc, 0xb520ffff, 0x91ef0020, 0x90210020, + 0x80170760, 0x001f0700, 0x001fa020, 0x001f0701, + 0x001fa020, 0x001f0702, 0x001fa020, 0x001f0703, + 0x001fa020, 0x001f0704, 0x001fa000, 0x80970750, + 0x81170770, 0x82a70735, 0x83a40060, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4005c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a70730, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40050, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4004c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a7072b, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40040, 0x83a4004e, + 0xb6000407, 0x86b50001, 0x83a4003c, 0x001f8004, + 0x003f87e8, 0x2080a001, 0x83a40047, 0x00000000, + 0x80970770, 0x80170750, 0x81170750, 0x81970740, + 0x82a70726, 0x001f800c, 0x003f8008, 0x2100a001, + 0x83a4002e, 0x83a4003c, 0xb6000407, 0x86b50001, + 0x83a4002a, 0x001f8004, 0x003f87e8, 0x2080a001, + 0x83a40035, 0x00000000, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a70721, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4001c, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a40018, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a7071c, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4000c, 0x017f87e4, + 0x81870000, 0xb6000406, 0x86b50001, 0x83a40007, + 0x001f87e4, 0x200087e8, 0x5988b80c, 0x198cb800, + 0x021fa02c, 0x021fa00b, 0x00ffb81c, 0x005ff015, + 0x90420600, 0x003f87e0, 0x001ff002, 0x2060b801, + 0x90630800, 0x90960a00, 0x001ff003, 0x003ff004, + 0x20a0b801, 0x90a50900, 0x00000000, 0x001ff005, + 0x009fa000, 0x00ffb81d, 0x001f8004, 0x5c21b800, + 0x5847b800, 0x1821b802, 0x942100ff, 0x2080a7e1, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x829bff80, 0x80af001f, 0x808f0000, 0x806f0000, + 0x82bbffec, 0x82fbffe4, 0x00000000, 0x82beffb8, + 0x95540700, 0x5d48b80a, 0x914a0001, 0x0227b80a, + 0x94343000, 0x5c2cb801, 0xb0010000, 0xb4000001, + 0x5a21b811, 0x9574c000, 0x5d6eb80b, 0x918b4b08, + 0x01b8b80c, 0x96d5ffff, 0x5ec2b816, 0x96f7ffff, + 0x5ee2b817, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x81f3ff00, 0x99efff00, 0x821300ff, + 0x9a1000ff, 0x81971000, 0x82670000, 0x82470000, + 0x80270280, 0x81df0000, 0x00000000, 0x00000000, + 0xb62d000d, 0x3016b817, 0xb4800001, 0x86d62800, + 0x00cfb801, 0x02dfb0bc, 0x5ac2b816, 0x01cfb816, + 0x02df90bc, 0x0067b86f, 0xb0030001, 0xb4c0fffd, + 0x92d60020, 0x90210020, 0x81df0004, 0x80170a00, + 0x81df0000, 0x00000000, 0x00000000, 0xb62d0006, + 0xb6002005, 0x146f8000, 0x14908000, 0x5c68b803, + 0x5888b804, 0x1803a024, 0x81df0004, 0x80170a00, + 0x80970d00, 0xb00b0000, 0xb4000004, 0xb00b0001, + 0xb400000a, 0xb00b0002, 0xb4000027, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008002, 0x007f8020, + 0x009fa023, 0x81df0004, 0xb5000029, 0x80d3ffff, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002018, + 0x5c648000, 0x9463ffff, 0x5c888020, 0x58b88000, + 0x1884b805, 0x1484b806, 0x1883a024, 0x5c6c8020, + 0x9463ffff, 0x58908000, 0x1883a024, 0x5c748020, + 0x588c8000, 0x1863b804, 0x9463ffff, 0x58888000, + 0x1484b806, 0x1883a024, 0x5c7c8020, 0x58848000, + 0x1863b804, 0x9463ffff, 0x14868020, 0x1883a024, + 0x81df0004, 0xb500000a, 0x80d3ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004004, 0x007f8020, + 0x009fa023, 0x007f8040, 0x009fa023, 0x81df0004, + 0x00000000, 0x81170d00, 0x80070000, 0x94343000, + 0x5c2cb801, 0xb0010001, 0xb400008e, 0xb00a0001, + 0xb400000e, 0xb00a0002, 0xb400001c, 0xb00a0003, + 0xb4000024, 0xb00a0004, 0xb4000052, 0xb00a0005, + 0xb400005b, 0xb00a0006, 0xb400007f, 0xb00a0007, + 0xb400007d, 0xb00a0008, 0xb400007b, 0x81df0000, + 0x00000000, 0x00000000, 0xb600800a, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x5c708028, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x019fa020, 0x81df0004, 0xb500006b, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008004, 0x007f8028, + 0x019fa023, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000061, 0xb0130000, 0xb4000004, 0xb0130001, + 0xb4000009, 0xb0130002, 0xb400001a, 0x83a400fa, + 0x80170f00, 0x007f8028, 0x001fa023, 0x007f8028, + 0x001fa023, 0xb5000054, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8000, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708020, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a400e5, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000041, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8008, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a400d2, + 0xb5000031, 0x81df0000, 0x00000000, 0x00000000, + 0xb6004005, 0x007f8008, 0x019fa023, 0x007f8008, + 0x019fa023, 0x019fa020, 0x81df0004, 0xb5000026, + 0xb0130000, 0xb4000008, 0xb0130001, 0xb4000012, + 0xb0130002, 0xb400001f, 0xb0130003, 0xb400001d, + 0xb0130004, 0xb400001b, 0x83a400cd, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000010, 0x80170f00, 0x00000000, + 0x5c708020, 0x58908008, 0x1983a024, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x83a400b7, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000001, 0xb5000000, 0x00000000, 0x00000000, + 0xb5000086, 0xb00a0001, 0xb400000e, 0xb00a0002, + 0xb4000017, 0xb00a0003, 0xb400001f, 0xb00a0004, + 0xb400004d, 0xb00a0005, 0xb4000056, 0xb00a0006, + 0xb400007a, 0xb00a0007, 0xb4000078, 0xb00a0008, + 0xb4000076, 0x81df0000, 0x00000000, 0x00000000, + 0xb6008005, 0x007f8028, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x019fa020, 0x81df0004, 0xb500006b, + 0x81df0000, 0x00000000, 0x00000000, 0xb6004004, + 0x007f8048, 0x019fa023, 0x019fa020, 0x019fa020, + 0x81df0004, 0xb5000061, 0xb0130000, 0xb4000004, + 0xb0130001, 0xb4000009, 0xb0130002, 0xb400001a, + 0x83a40098, 0x80170f00, 0x007f8028, 0x001fa023, + 0x007f8028, 0x001fa023, 0xb5000054, 0x80170f00, + 0x00000000, 0x007f8020, 0x019fa023, 0x007f8000, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708020, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x83a40083, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000041, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a40070, 0xb5000031, 0x81df0000, 0x00000000, + 0x00000000, 0xb6004005, 0x007f8008, 0x019fa023, + 0x007f8008, 0x019fa023, 0x019fa020, 0x81df0004, + 0xb5000026, 0xb0130000, 0xb4000008, 0xb0130001, + 0xb4000012, 0xb0130002, 0xb400001f, 0xb0130003, + 0xb400001d, 0xb0130004, 0xb400001b, 0x83a4006b, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x80170f00, + 0x007f8028, 0x001fa023, 0xb5000010, 0x80170f00, + 0x00000000, 0x5c708020, 0x58908008, 0x1983a024, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x83a40055, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000001, 0xb5000000, 0x92730001, + 0x92520001, 0x3012b811, 0xb480fe89, 0x003f0324, + 0x90210001, 0xb0010006, 0xb4a00001, 0x80270001, + 0x003f2324, 0x2c8db811, 0x803bffe0, 0x805bffe4, + 0x5887b804, 0x1015b804, 0xad440003, 0x3000b802, + 0xb4800001, 0x8400a000, 0x801effec, 0x015f6193, + 0x809e4b04, 0x00ffb81f, 0x81df0000, 0x00000000, + 0x00000000, 0xb6002a0c, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x019fa020, 0x81df0004, 0x00ffb81d, + 0x81df0000, 0x00000000, 0x00000000, 0xb600190f, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x81df0004, + 0x00ffb81d, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002a0c, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x81df0004, 0x00ffb81d, 0x81df0000, + 0x00000000, 0x00000000, 0xb600190f, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x81df0004, 0x00ffb81d, + 0x829bff80, 0x80af001f, 0x808f0000, 0x806f0000, + 0x82bbffec, 0x82fbffe4, 0x00000000, 0x82beffb8, + 0x95540700, 0x5d48b80a, 0x914a0001, 0x0227b80a, + 0x94343000, 0x5c2cb801, 0xb0010000, 0xb4000001, + 0x5a21b811, 0x9574c000, 0x5d6eb80b, 0x918b4b08, + 0x01b8b80c, 0x96d5ffff, 0x5ec2b816, 0x96f7ffff, + 0x5ee2b817, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x81f3ff00, 0x99efff00, 0x821300ff, + 0x9a1000ff, 0x81971000, 0x82670000, 0x82470000, + 0x80270280, 0x81df0000, 0x00000000, 0x00000000, + 0xb62d000d, 0x3016b817, 0xb4800001, 0x86d62800, + 0x00cfb801, 0x02dfb0bc, 0x5ac2b816, 0x01cfb816, + 0x02df90bc, 0x0067b86f, 0xb0030001, 0xb4c0fffd, + 0x92d60020, 0x90210020, 0x81df0004, 0x80170a00, + 0x81df0000, 0x00000000, 0x00000000, 0xb62d0006, + 0xb6002005, 0x146f8000, 0x14908000, 0x5c68b803, + 0x5888b804, 0x1803a024, 0x81df0004, 0x80170a00, + 0x80970d00, 0xb00b0000, 0xb4000004, 0xb00b0001, + 0xb400000a, 0xb00b0002, 0xb4000027, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008002, 0x007f8020, + 0x009fa023, 0x81df0004, 0xb5000029, 0x80d3ffff, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002018, + 0x5c648000, 0x9463ffff, 0x5c888020, 0x58b88000, + 0x1884b805, 0x1484b806, 0x1883a024, 0x5c6c8020, + 0x9463ffff, 0x58908000, 0x1883a024, 0x5c748020, + 0x588c8000, 0x1863b804, 0x9463ffff, 0x58888000, + 0x1484b806, 0x1883a024, 0x5c7c8020, 0x58848000, + 0x1863b804, 0x9463ffff, 0x14868020, 0x1883a024, + 0x81df0004, 0xb500000a, 0x80d3ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004004, 0x007f8020, + 0x009fa023, 0x007f8040, 0x009fa023, 0x81df0004, + 0x00000000, 0x81170d00, 0x80070000, 0x94343000, + 0x5c2cb801, 0xb0010001, 0xb400008e, 0xb00a0001, + 0xb400000e, 0xb00a0002, 0xb400001c, 0xb00a0003, + 0xb4000024, 0xb00a0004, 0xb4000052, 0xb00a0005, + 0xb400005b, 0xb00a0006, 0xb400007f, 0xb00a0007, + 0xb400007d, 0xb00a0008, 0xb400007b, 0x81df0000, + 0x00000000, 0x00000000, 0xb600800a, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x5c708028, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x019fa020, 0x81df0004, 0xb500006b, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008004, 0x007f8028, + 0x019fa023, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000061, 0xb0130000, 0xb4000004, 0xb0130001, + 0xb4000009, 0xb0130002, 0xb400001a, 0x83a400fa, + 0x80170f00, 0x007f8028, 0x001fa023, 0x007f8028, + 0x001fa023, 0xb5000054, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8000, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708020, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a400e5, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000041, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8008, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a400d2, + 0xb5000031, 0x81df0000, 0x00000000, 0x00000000, + 0xb6004005, 0x007f8008, 0x019fa023, 0x007f8008, + 0x019fa023, 0x019fa020, 0x81df0004, 0xb5000026, + 0xb0130000, 0xb4000008, 0xb0130001, 0xb4000012, + 0xb0130002, 0xb400001f, 0xb0130003, 0xb400001d, + 0xb0130004, 0xb400001b, 0x83a400cd, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000010, 0x80170f00, 0x00000000, + 0x5c708020, 0x58908008, 0x1983a024, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x83a400b7, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000001, 0xb5000000, 0x00000000, 0x00000000, + 0xb5000086, 0xb00a0001, 0xb400000e, 0xb00a0002, + 0xb4000017, 0xb00a0003, 0xb400001f, 0xb00a0004, + 0xb400004d, 0xb00a0005, 0xb4000056, 0xb00a0006, + 0xb400007a, 0xb00a0007, 0xb4000078, 0xb00a0008, + 0xb4000076, 0x81df0000, 0x00000000, 0x00000000, + 0xb6008005, 0x007f8028, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x019fa020, 0x81df0004, 0xb500006b, + 0x81df0000, 0x00000000, 0x00000000, 0xb6004004, + 0x007f8048, 0x019fa023, 0x019fa020, 0x019fa020, + 0x81df0004, 0xb5000061, 0xb0130000, 0xb4000004, + 0xb0130001, 0xb4000009, 0xb0130002, 0xb400001a, + 0x83a40098, 0x80170f00, 0x007f8028, 0x001fa023, + 0x007f8028, 0x001fa023, 0xb5000054, 0x80170f00, + 0x00000000, 0x007f8020, 0x019fa023, 0x007f8000, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708020, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x83a40083, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000041, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a40070, 0xb5000031, 0x81df0000, 0x00000000, + 0x00000000, 0xb6004005, 0x007f8008, 0x019fa023, + 0x007f8008, 0x019fa023, 0x019fa020, 0x81df0004, + 0xb5000026, 0xb0130000, 0xb4000008, 0xb0130001, + 0xb4000012, 0xb0130002, 0xb400001f, 0xb0130003, + 0xb400001d, 0xb0130004, 0xb400001b, 0x83a4006b, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x80170f00, + 0x007f8028, 0x001fa023, 0xb5000010, 0x80170f00, + 0x00000000, 0x5c708020, 0x58908008, 0x1983a024, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x83a40055, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000001, 0xb5000000, 0x92730001, + 0x92520001, 0x3012b811, 0xb480fe89, 0x003f0324, + 0x90210001, 0xb0010006, 0xb4a00001, 0x80270001, + 0x003f2324, 0x2c8db811, 0x803bffe0, 0x805bffe4, + 0x5887b804, 0x1015b804, 0xad440003, 0x3000b802, + 0xb4800001, 0x8400a000, 0x801effec, 0x015f6193, + 0x809e4b04, 0x00ffb81f, 0x81df0000, 0x00000000, + 0x00000000, 0xb6002a0c, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x019fa020, 0x81df0004, 0x00ffb81d, + 0x81df0000, 0x00000000, 0x00000000, 0xb600190f, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x81df0004, + 0x00ffb81d, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002a0c, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x81df0004, 0x00ffb81d, 0x81df0000, + 0x00000000, 0x00000000, 0xb600190f, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x81df0004, 0x00ffb81d, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815b4b0c, 0x81070000, 0x81270bf4, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x812717f4, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a00060, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200006, + 0x039f4193, 0x5b81b81c, 0x003f90cb, 0x1021b81c, + 0x003fb0cb, 0x8384f922, 0x829bff80, 0x801300e0, + 0x1434b800, 0x5c35b801, 0x8013001f, 0x1454b800, + 0x5c50b802, 0x8073007f, 0x9863ffff, 0xb002000f, + 0xb4800001, 0x90210001, 0x84210004, 0xb0010000, + 0xb4a00001, 0x6861b803, 0x005f9040, 0x4082b803, + 0x80af001f, 0x808f0000, 0x806f0000, 0x8007ffff, + 0x8033ffff, 0x80171000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6001811, 0xb6002010, 0x14618000, + 0x6068b803, 0x40c4b803, 0x14608000, 0x00c8b806, + 0x5870b803, 0x6068b803, 0x4104b803, 0x58c8b806, + 0x0108b808, 0x14c6b801, 0x00000000, 0x00000000, + 0x5d08b808, 0x1508b800, 0x1806a028, 0x81df0004, + 0x80670400, 0x5d22b80a, 0x81df0000, 0x00000000, + 0x00000000, 0xb600180a, 0x00cfb803, 0x013fb0bc, + 0x5922b809, 0x01afb809, 0x013f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x91290020, + 0x81df0004, 0x808f0000, 0x801b4b14, 0x80270001, + 0xb0000001, 0xb4000002, 0x802600a0, 0x803e4b14, + 0x81270c00, 0xb00a0000, 0xb4000001, 0x81270000, + 0x813e4b0c, 0x80270001, 0x003f2013, 0x80050086, + 0x001fb044, 0x00ffb81b, 0x00000000, 0x00000000, +}; + +static u32 PCMUcode1f4b00[] = { + 0x00000000, 0x00000000, 0x00060504, 0x00000000, + 0x00000000, 0x00000000, 0x00300000, 0xffcfcfff, + 0x00302000, 0xffcfcfff, 0x00380000, 0xffc7c7ff, + 0xcbcecdc4, 0xcfcac9c8, 0xc3c6c5cc, 0xc7c2c1c0, + 0x1b1e1d14, 0x1f1a1918, 0x1316151c, 0x17121110, + 0x2b2e2d24, 0x2f2a2928, 0x2326252c, 0x27222120, + 0x3b3e3d34, 0x3f3a3938, 0x3336353c, 0x37323130, + 0x0b0e0d04, 0x0f0a0908, 0x0306050c, 0x07020100, + 0xdbdeddd4, 0xdfdad9d8, 0xd3d6d5dc, 0xd7d2d1d0, + 0xebeeede4, 0xefeae9e8, 0xe3e6e5ec, 0xe7e2e1e0, + 0xfbfefdf4, 0xfffaf9f8, 0xf3f6f5fc, 0xf7f2f1f0, + 0x4b4e4d44, 0x4f4a4948, 0x4346454c, 0x47424140, + 0x9b9e9d94, 0x9f9a9998, 0x9396959c, 0x97929190, + 0xabaeada4, 0xafaaa9a8, 0xa3a6a5ac, 0xa7a2a1a0, + 0xbbbebdb4, 0xbfbab9b8, 0xb3b6b5bc, 0xb7b2b1b0, + 0x8b8e8d84, 0x8f8a8988, 0x8386858c, 0x87828180, + 0x5b5e5d54, 0x5f5a5958, 0x5356555c, 0x57525150, + 0x6b6e6d64, 0x6f6a6968, 0x6366656c, 0x67626160, + 0x7b7e7d74, 0x7f7a7978, 0x7376757c, 0x77727170, + 0x341424c4, 0x3e1e2ece, 0x3d1d2dcd, 0x3b1b2bcb, + 0xb494a444, 0xbe9eae4e, 0xbd9dad4d, 0xbb9bab4b, + 0xf4d4e404, 0xfedeee0e, 0xfddded0d, 0xfbdbeb0b, + 0x74546484, 0x7e5e6e8e, 0x7d5d6d8d, 0x7b5b6b8b, + 0x3c1c2ccc, 0x361626c6, 0x351525c5, 0x331323c3, + 0xbc9cac4c, 0xb696a646, 0xb595a545, 0xb393a343, + 0xfcdcec0c, 0xf6d6e606, 0xf5d5e505, 0xf3d3e303, + 0x7c5c6c8c, 0x76566686, 0x75556585, 0x73536383, + 0x381828c8, 0x3a1a2aca, 0x391929c9, 0x3f1f2fcf, + 0xb898a848, 0xba9aaa4a, 0xb999a949, 0xbf9faf4f, + 0xf8d8e808, 0xfadaea0a, 0xf9d9e909, 0xffdfef0f, + 0x78586888, 0x7a5a6a8a, 0x79596989, 0x7f5f6f8f, + 0x301020c0, 0x321222c2, 0x311121c1, 0x371727c7, + 0xb090a040, 0xb292a242, 0xb191a141, 0xb797a747, + 0xf0d0e000, 0xf2d2e202, 0xf1d1e101, 0xf7d7e707, + 0x70506080, 0x72526282, 0x71516181, 0x77576787, + 0x05040100, 0x15141110, 0x25242120, 0x35343130, + 0x85848180, 0x95949190, 0xa5a4a1a0, 0xb5b4b1b0, + 0xc0408000, 0xe060a020, 0xd0509010, 0xf070b030, + 0xc8488808, 0xe868a828, 0xd8589818, 0xf878b838, + 0xc4448404, 0xe464a424, 0xd4549414, 0xf474b434, + 0xcc4c8c0c, 0xec6cac2c, 0xdc5c9c1c, 0xfc7cbc3c, + 0xc2428202, 0xe262a222, 0xd2529212, 0xf272b232, + 0xca4a8a0a, 0xea6aaa2a, 0xda5a9a1a, 0xfa7aba3a, + 0xc6468606, 0xe666a626, 0xd6569616, 0xf676b636, + 0xce4e8e0e, 0xee6eae2e, 0xde5e9e1e, 0xfe7ebe3e, + 0xc1418101, 0xe161a121, 0xd1519111, 0xf171b131, + 0xc9498909, 0xe969a929, 0xd9599919, 0xf979b939, + 0xc5458505, 0xe565a525, 0xd5559515, 0xf575b535, + 0xcd4d8d0d, 0xed6dad2d, 0xdd5d9d1d, 0xfd7dbd3d, + 0xc3438303, 0xe363a323, 0xd3539313, 0xf373b333, + 0xcb4b8b0b, 0xeb6bab2b, 0xdb5b9b1b, 0xfb7bbb3b, + 0xc7478707, 0xe767a727, 0xd7579717, 0xf777b737, + 0xcf4f8f0f, 0xef6faf2f, 0xdf5f9f1f, 0xff7fbf3f, + 0x1045a3e2, 0x000000f4, 0x263b7333, 0x766b2363, + 0x2b367e3e, 0x7b662e6e, 0x06db93d3, 0x964b0343, + 0x0bd69ede, 0x9b460e4e, 0x825f1757, 0x12cf87c7, + 0x8f521a5a, 0x1fc28aca, 0x00d199d9, 0x90410949, + 0x01d098d8, 0x91400848, 0x24357d3d, 0x74652d6d, + 0x25347c3c, 0x75642c6c, 0x04d59ddd, 0x94450d4d, + 0x05d49cdc, 0x95440c4c, 0x80511959, 0x10c189c9, + 0x81501858, 0x11c088c8, 0x02df97d7, 0x924f0747, + 0x0fd29ada, 0x9f420a4a, 0x865b1353, 0x16cb83c3, + 0x8b561e5e, 0x1bc68ece, 0xa6bbf3b3, 0xf6eba3e3, + 0xabb6febe, 0xfbe6aeee, 0x223f7737, 0x726f2767, + 0x2f327a3a, 0x7f622a6a, 0xa0b1f9b9, 0xf0e1a9e9, + 0xa1b0f8b8, 0xf1e0a8e8, 0x84551d5d, 0x14c58dcd, + 0x85541c5c, 0x15c48ccc, 0xa4b5fdbd, 0xf4e5aded, + 0xa5b4fcbc, 0xf5e4acec, 0x20317939, 0x70612969, + 0x21307838, 0x71602868, 0xa2bff7b7, 0xf2efa7e7, + 0xafb2faba, 0xffe2aaea, 0x00000000, 0x00000000, +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/pcmi2s_240.h linux.20pre5-ac2/drivers/media/video/ls220/pcmi2s_240.h --- linux.20pre5/drivers/media/video/ls220/pcmi2s_240.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/pcmi2s_240.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,877 @@ +static u32 PCMI2S240Ucode1f1800[] = { + 0xb500000f, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xb500020b, 0x00000000, 0x00000000, 0x00000000, + 0x820f001f, 0x802f001f, 0x029f9014, 0x829efef0, + 0x8286000f, 0x02bf0054, 0x82bcfef4, 0x82a6000e, + 0x80074000, 0x001f6193, 0x8013001f, 0x9020c000, + 0x003fb006, 0x803effe8, 0x803effec, 0x9020fa00, + 0x803effd0, 0x803effdc, 0x803effd8, 0x9020fe00, + 0x803effd4, 0x90400000, 0x804600a2, 0x90421800, + 0x804600a3, 0x80132000, 0x98000040, 0x800600a6, + 0x80050080, 0x98000002, 0x80060080, 0x80070001, + 0x001f2013, 0x80070000, 0x001f23f9, 0x801e4b0c, + 0x001f210c, 0x80070001, 0x001f2324, 0x80070800, + 0x001f600f, 0x001fb0cb, 0x001fb010, 0x801efff0, + 0x98004000, 0x001f600e, 0x83e4011f, 0x80070000, + 0x801e4b14, 0x800500a0, 0xb0000001, 0xb4000009, + 0x80070001, 0x800600a0, 0x80050080, 0x98000020, + 0x80060080, 0x9400ffdf, 0x80060080, 0x80070000, + 0x800600a0, 0x80074000, 0x801e4b04, 0x81df0004, + 0x801bfff0, 0x00000000, 0x940000ff, 0xb0000000, + 0xb4200033, 0x003f400e, 0x94010010, 0xb0000000, + 0xb400fff7, 0x003f0013, 0xb0010001, 0xb420001f, + 0x803bffe8, 0x801bffec, 0x805b4b04, 0x00000000, + 0x3001b800, 0xb4600001, 0x9021a000, 0x0421b800, + 0x3001b802, 0xb460000d, 0x80050086, 0x005f9044, + 0x0420b802, 0xb00101e0, 0xb4a0ffe5, 0x001fb010, + 0x001f010c, 0xb0000001, 0xb400ffe1, 0x80070001, + 0x001f210c, 0x83e400ec, 0xb500ffdd, 0x8007001f, + 0x94000003, 0x5810b800, 0x83e719ec, 0x1bffb800, + 0x003f9008, 0x1821b800, 0x00ffb801, 0x80270000, + 0x003f2013, 0x8007001f, 0x94000003, 0x5810b800, + 0x83671a14, 0x1b7bb800, 0x003f9009, 0x1821b800, + 0x00ffb801, 0x80070000, 0x001f210c, 0xb500ffc8, + 0x003f400e, 0xb0000086, 0xb4400055, 0xb0000084, + 0xb400003f, 0xb0000085, 0xb4000045, 0xb0000086, + 0xb4000047, 0xb0000083, 0xb4000000, 0x815bff7c, + 0x00000000, 0x940a0080, 0x5c07b800, 0xb0000001, + 0xb4000073, 0x81674b18, 0x940a0007, 0x5803b800, + 0x116bb800, 0x005bb80b, 0x916b0004, 0x001bb80b, + 0x80530030, 0x98422000, 0x8013ffcf, 0x9800cfff, + 0x806500d4, 0x1463b800, 0x1863b802, 0x806600d4, + 0x80073cfb, 0x801e4b00, 0x800600a1, 0x80074000, + 0x801e4b04, 0x8013001f, 0x98405000, 0x805effe0, + 0x005fb006, 0x805effe8, 0x805effec, 0x9042a000, + 0x805effe4, 0x9040fa00, 0x805effd0, 0x805effdc, + 0x805effd8, 0x9040fe00, 0x805effd4, 0x8013007f, + 0x9800ffff, 0x001fb040, 0x80070001, 0x001f2013, + 0x80070000, 0x001f2324, 0x001fb0cb, 0x001fb010, + 0x001fb041, 0x001fb042, 0x800733b0, 0x001fb008, + 0x80071ea0, 0x001fb009, 0x98214000, 0xb5000010, + 0x94011000, 0xb0001000, 0xb4200001, 0x9421efff, + 0x98210010, 0xb500000a, 0x80070000, 0x001fb0cb, + 0x83e40099, 0x003f400e, 0x9421ffef, 0xb5000004, + 0x83e40095, 0x003f400e, 0x98211000, 0x9421ffef, + 0x003f600e, 0x80070100, 0x801efff0, 0xb500ff70, + 0xb000008b, 0xb4000018, 0xb0000087, 0xb400ffee, + 0xb0000088, 0xb4000016, 0xb000008a, 0xb4000016, + 0xb000008c, 0xb4000017, 0xb0000089, 0xb4000019, + 0xb00000a0, 0xb400001b, 0xb00000a1, 0xb4000047, + 0xb00000a2, 0xb4000054, 0xb00000a3, 0xb400004c, + 0xb00000a4, 0xb4000056, 0xb00000a5, 0xb400005a, + 0xb00000a6, 0xb400005e, 0x803efff8, 0xb500ffe1, + 0x9421ffdf, 0xb500ffde, 0x80270100, 0x803efff8, + 0xb500ffdc, 0x803bffb0, 0x00000000, 0x003fb040, + 0xb500ffd8, 0x803bff80, 0x00000000, 0x003f6001, + 0xb500ffd4, 0x003f90ba, 0x803efff8, 0xb500ffd1, + 0x81674b18, 0x940a0007, 0x5803b800, 0x116bb800, + 0x005bb80b, 0x916b0004, 0x001bb80b, 0x806500d4, + 0x1463b800, 0x1863b802, 0x806600d4, 0x80130001, + 0x98003d21, 0x800600a1, 0x801e4b00, 0x80074000, + 0x801e4b04, 0x8013001f, 0x98405000, 0x805effe0, + 0x005fb006, 0x805effe8, 0x805effec, 0x9042a000, + 0x805effe4, 0x9040fa00, 0x805effd0, 0x805effdc, + 0x805effd8, 0x9040fe00, 0x805effd4, 0x80070001, + 0x001f2013, 0x80070000, 0x001f2324, 0x001fb0cb, + 0x001fb010, 0x80073bf0, 0x001fb008, 0x800743e0, + 0x001fb009, 0x98214000, 0xb500ffa5, 0x80270000, + 0x8047fef0, 0x003eb802, 0x90420004, 0x003eb802, + 0x90420004, 0x003eb802, 0x90420004, 0x003eb802, + 0x81df0000, 0x00000000, 0x00000000, 0x8364044f, + 0x81df0004, 0xb500ff97, 0x81df0000, 0x00000000, + 0x00000000, 0x836403f9, 0x81df0004, 0xb500ff91, + 0x81df0000, 0x00000000, 0x00000000, 0x836403b4, + 0x81df0004, 0xb500ff8b, 0x81df0000, 0x00000000, + 0x00000000, 0x83440317, 0x81df0004, 0xb500ff85, + 0x81df0000, 0x00000000, 0x00000000, 0x834402fc, + 0x81df0004, 0xb500ff7f, 0x80070000, 0x80470000, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002003, + 0xb6003002, 0x001eb802, 0x90420004, 0x80171000, + 0x8057ffff, 0xb6002002, 0xb6001801, 0x001fa020, + 0x81df0004, 0x00ffb81f, 0x817bff7c, 0x00000000, + 0x956b0080, 0x5d67b80b, 0x83a70000, 0x8057ffff, + 0x80770000, 0x8073007a, 0x9863e7d2, 0xb00b0001, + 0xb4200002, 0x8073007d, 0x98636d4a, 0x0207b803, + 0x81df0000, 0x00000000, 0x00000000, 0xb00b0001, + 0xb400000a, 0x80171000, 0xb6008007, 0x003fc0c0, + 0x005fc740, 0x40c1b810, 0x4102b810, 0x001fe0c6, + 0x001fe0c8, 0x4210b803, 0xb5000009, 0x80171000, + 0xb6000007, 0x003fc020, 0x005fc7e0, 0x40c1b810, + 0x4102b810, 0x001fe026, 0x001fe0a8, 0x4210b803, + 0x81df0004, 0x80270000, 0x003f2013, 0x8007001f, + 0x94000003, 0x5810b800, 0x83671e7c, 0x1b7bb800, + 0x003f9009, 0x1821b800, 0x00ffb801, 0x003f0013, + 0xb0010001, 0xb420fff3, 0x93bd0001, 0xb01d0004, + 0xb480ffd7, 0x00ffb81f, 0x00000000, 0x00000000, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815b4b0c, 0x81070000, 0x81270be8, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x812717e8, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a00059, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200006, + 0x039f4193, 0x5b81b81c, 0x003f90cb, 0x1021b81c, + 0x003fb0cb, 0x8384025e, 0x829bff80, 0x801300e0, + 0x1434b800, 0x5c35b801, 0x8013001f, 0x1454b800, + 0x5c50b802, 0x8073007f, 0x9863ffff, 0xb002000f, + 0xb4800001, 0x90210001, 0x84210004, 0xb0010000, + 0xb4a00001, 0x6861b803, 0x005f9040, 0x4082b803, + 0x80af001f, 0x808f0000, 0x806f0000, 0x8007ffff, + 0x8033ffff, 0x80171000, 0x81df0000, 0x00000000, + 0x00000000, 0xb600180a, 0xb6002009, 0x58708000, + 0x6068b803, 0x40c4b803, 0x00000000, 0x00c8b806, + 0x00000000, 0x00000000, 0x00000000, 0x5807a026, + 0x81df0004, 0x80670400, 0x5d22b80a, 0x81df0000, + 0x00000000, 0x00000000, 0xb600180a, 0x00cfb803, + 0x013fb0bc, 0x5922b809, 0x01afb809, 0x013f90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x90630020, + 0x91290020, 0x81df0004, 0x808f0000, 0x801b4b14, + 0x80270001, 0xb0000001, 0xb4000002, 0x802600a0, + 0x803e4b14, 0x81270c00, 0xb00a0000, 0xb4000001, + 0x81270000, 0x813e4b0c, 0x80270001, 0x003f2013, + 0x80050086, 0x001fb044, 0x00ffb81b, 0x00000000, + 0x029fb00a, 0x02bfb00b, 0x02dfb00c, 0x02ffb00d, + 0x031fb00e, 0x033fb00f, 0x033f400f, 0x0287b86f, + 0x029fb005, 0x8285009d, 0x82b30002, 0x9ab50040, + 0x1a94b815, 0x8286009d, 0x8285009c, 0x96b48000, + 0xb0158000, 0xb400019c, 0x96b40100, 0xb0150100, + 0xb40001b8, 0x96b40400, 0xb0150400, 0xb40001ca, + 0x96b40001, 0xb0150001, 0xb4000014, 0x96b40008, + 0xb0150008, 0xb40001a5, 0x96b44000, 0xb0154000, + 0xb40001c9, 0x96b40002, 0xb0150002, 0xb4000169, + 0x96b40040, 0xb0150040, 0xb40001dc, 0x82d30002, + 0x9ad60000, 0x16b6b814, 0x3015b816, 0xb40001da, + 0x00000000, 0x00000000, 0xb50001db, 0x02bf9017, + 0x92b50001, 0x02bfb017, 0x82850082, 0x83050081, + 0x82a5009a, 0x96b50001, 0xb0150001, 0xb4200014, + 0x82a70000, 0x02bfb017, 0x96b41840, 0xb0150800, + 0xb420000c, 0x96b40008, 0x5aa9b815, 0x96d46000, + 0x5ec3b816, 0x82f3000f, 0x9af7c00f, 0x1718b817, + 0x1ab5b818, 0x1ab5b816, 0x9ab50340, 0x82a60081, + 0xb5000140, 0x9b180180, 0x83060081, 0xb500013d, + 0x82a5009a, 0x96b50002, 0xb0150002, 0xb420001b, + 0x82a70000, 0x02bfb017, 0x96b41800, 0xb0151800, + 0xb4000013, 0x96b40040, 0xb0150040, 0xb4200004, + 0xa3180c00, 0x9b180340, 0x83060081, 0xb500012d, + 0x96b40008, 0x5aa9b815, 0x96d46000, 0x5ec3b816, + 0x82f3000f, 0x9af7c00f, 0x1718b817, 0x1ab5b818, + 0x1ab5b816, 0x9ab50340, 0x82a60081, 0xb5000121, + 0x9b180180, 0x83060081, 0xb500011e, 0x82a500c1, + 0x96b5000f, 0xb015000b, 0xb420000e, 0x96b40020, + 0xb0150020, 0xb400000b, 0x96b40200, 0xb0150200, + 0xb4000008, 0x82c50086, 0x82e50094, 0x3016b817, + 0xb4400004, 0x06f7b816, 0xb017ff00, 0xb4400001, + 0xb500010c, 0x96b46000, 0xb0156000, 0xb4000011, + 0x96b41820, 0xb0150820, 0xb4200004, 0x9b391000, + 0x82a5009a, 0x96b5feff, 0x82a6009a, 0x96b40040, + 0xb0150040, 0xb4200001, 0x9739efff, 0x96b91000, + 0xb0151000, 0xb4200003, 0x82a5009a, 0x9ab50100, + 0x82a6009a, 0x96b40040, 0xb0150040, 0xb4200019, + 0x96b41800, 0xb0151800, 0xb4200006, 0x96b98000, + 0xb0158000, 0xb4200003, 0x9b180180, 0x83060081, + 0xb50000ec, 0x96d80c00, 0x82b300ff, 0x9ab5f3ff, + 0x1718b815, 0xb0160c00, 0xb4000007, 0x82e50098, + 0x96f70400, 0xb0170400, 0xb4200002, 0x82c70c00, + 0xb5000001, 0xa2d60c00, 0x1b18b816, 0x9b180340, + 0xb50000d2, 0x96b40220, 0xb0150000, 0xb4e00033, + 0x82a5009d, 0x82f3ffff, 0x16b5b817, 0x82f33802, + 0x3015b817, 0xb420002d, 0x96f98000, 0xb0178000, + 0xb400002a, 0x82a70000, 0x02bfb017, 0x82c50081, + 0x9ab60020, 0x82a60081, 0x82a50086, 0x92b50bb8, + 0x82a60094, 0x82c60081, 0x82c5009d, 0x96d6ffff, + 0x82b3c802, 0x9ab50041, 0x82e500c1, 0x96f7000f, + 0xb017000b, 0xb4000002, 0x82b38802, 0x9ab50041, + 0x1ab5b816, 0x82c5009a, 0x96d60020, 0xb0160020, + 0xb4200002, 0x82b3c802, 0x9ab50041, 0x82a6009d, + 0x02ff9017, 0x00000000, 0xb0170040, 0xb480000b, + 0x96f41c00, 0xb0171c00, 0xb4200008, 0x82e50086, + 0x82c50094, 0x92d63000, 0x3016b817, 0xb4400003, + 0x9b180180, 0x83060081, 0xb50000a6, 0x5eb5b814, + 0x96b500f0, 0x96f46000, 0x5eedb817, 0x1ab5b817, + 0xb0170003, 0xb4000004, 0x96b500ef, 0x96f70001, + 0x5ae4b817, 0x1ab5b817, 0x96d41800, 0xb0161800, + 0xb400000a, 0x96f900ff, 0x96b500ff, 0x9739ff00, + 0x1b39b815, 0x02a7b817, 0x96b500f3, 0x96d40008, + 0x5ec1b816, 0x1ab5b816, 0xb500000c, 0x96f98000, + 0xb0178000, 0xb4200007, 0x5efeb814, 0x96f70001, + 0xb0170001, 0xb4000003, 0x9b180180, 0x83060081, + 0xb5000084, 0x96b500f3, 0x9ab50008, 0x9739fff3, + 0x96d40020, 0xb0160020, 0xb4200017, 0x9b398000, + 0x82c70000, 0x02dfb017, 0x96d40010, 0x5ac8b816, + 0x82f300ff, 0x9af7cfff, 0x1718b817, 0x1b18b816, + 0x9b180340, 0x82c5009d, 0x96d6ffff, 0x82f33802, + 0x9af70041, 0x1af7b816, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82f3c802, 0x9af70041, + 0x82e6009d, 0xb500005d, 0x97397fff, 0x96b500ff, + 0x5aaab815, 0x82f300fc, 0x9af703ff, 0x1718b817, + 0x1b18b815, 0x9b180340, 0x82c5009a, 0x96d60010, + 0xb0160010, 0xb4200024, 0x82c70000, 0x02dfb017, + 0x82c50086, 0x92d60bb8, 0x82c60086, 0x82c50094, + 0x5eefb818, 0x96f70003, 0xb0170003, 0xb4200002, + 0x82e70bb8, 0xb5000001, 0x82e70bb8, 0x12d6b817, + 0x82e50081, 0x9af70020, 0x82e60081, 0x82c60094, + 0xa2f70020, 0x82e60081, 0x82f30001, 0x16f7b818, + 0x5ef0b817, 0xb0170001, 0xb4000004, 0x96f84000, + 0x5ee4b817, 0x9718f3ff, 0x1b18b817, 0x82f32802, + 0x9af70040, 0x82e6009d, 0x83060081, 0x83070001, + 0x8306009f, 0xb50000b8, 0x82c5009d, 0x82f33802, + 0x9af70041, 0x3016b817, 0xb420000f, 0x82b3c802, + 0x9ab50041, 0x82e500c1, 0x96f7000f, 0xb017000b, + 0xb4000002, 0x82b38802, 0x9ab50041, 0x82c5009a, + 0x96d60020, 0xb0160020, 0xb4200002, 0x82b3c802, + 0x9ab50041, 0x82a6009d, 0x82c5009a, 0x96d60080, + 0xb0160080, 0xb4000014, 0x02df9017, 0x00000000, + 0xb0160010, 0xb4800010, 0x82c500c1, 0x96d6000f, + 0xb016000b, 0xb400000c, 0x82c50087, 0x96d60080, + 0x5ac7b816, 0x82c50098, 0x96d60800, 0x5ac3b816, + 0x96f84000, 0x3017b816, 0xb4200003, 0x033f400f, + 0x9b394000, 0xb500000b, 0x9739bfff, 0x82e50061, + 0x96f70008, 0xb0170008, 0xb4000005, 0x5eefb818, + 0x96f70003, 0xb0170003, 0xb4000001, 0x9718ffff, + 0x83060081, 0x83070001, 0x8306009f, 0x00000000, + 0xb500007d, 0x82850083, 0x96b400ff, 0xb015003c, + 0xb4200019, 0x96b92000, 0xb0152000, 0xb4000002, + 0x9b392000, 0xb5000014, 0x9739d3ff, 0x82870000, + 0x82860087, 0x82870008, 0x82860083, 0x829bff78, + 0x82a7001f, 0xb0140400, 0xb4000001, 0x82a70010, + 0x82a600c9, 0x829bff78, 0x00000000, 0x828600cb, + 0x8285009d, 0x82b3ffff, 0x9ab5fffd, 0x1694b815, + 0x8286009d, 0xb5000000, 0x83070002, 0x8306009f, + 0x00000000, 0xb500005c, 0x96b90800, 0xb0150800, + 0xb4200009, 0x9739f7ff, 0x82a703fd, 0x82a600cb, + 0x82a7003c, 0x82a60083, 0x8285009d, 0x9a940002, + 0x8286009d, 0xb5000004, 0x82850087, 0x5a82b814, + 0xa2940200, 0x82860087, 0xb5000000, 0x83078000, + 0x8306009f, 0x00000000, 0xb5000047, 0x82850086, + 0x82a50094, 0x3015b814, 0xb4800002, 0x86b50bb8, + 0x82a60086, 0x83070008, 0x8306009f, 0x00000000, + 0xb500003d, 0x83050069, 0x9718003f, 0x82e50064, + 0x12f7b818, 0x86f70088, 0x82feff74, 0x02e7b86f, + 0x9af74000, 0x01ffb817, 0x96f7bfff, 0x01ffb817, + 0x83050081, 0x82f3001c, 0x9af703ff, 0x1718b817, + 0x9b180140, 0x83060081, 0x83070100, 0x8306009f, + 0x00000000, 0xb5000028, 0x83070000, 0x83050081, + 0x9b180180, 0x83060081, 0x83070400, 0x8306009f, + 0x00000000, 0xb5000020, 0x82870000, 0x82850082, + 0x5eb7b814, 0x96b500fc, 0x96d40006, 0x5ec1b816, + 0x1ab5b816, 0x5aacb815, 0x83050081, 0x82d3001c, + 0x9ad600ff, 0x1718b816, 0x1b18b815, 0x9b180e00, + 0x83060081, 0x83074000, 0x8306009f, 0x8305009d, + 0x82d3ffff, 0x9ad6bfff, 0x1718b816, 0x8306009d, + 0x00000000, 0xb5000008, 0xb5000007, 0x83070040, + 0x8306009f, 0xb5000004, 0x83130002, 0x9b180000, + 0x8306009f, 0xb5000000, 0x029f9005, 0x01ffb814, + 0x033f600f, 0x029f900a, 0x02bf900b, 0x02df900c, + 0x02ff900d, 0x031f900e, 0x033f900f, 0x00ffb81e, + 0x02ff9010, 0x92f70b43, 0x02ffb010, 0x02ff90cb, + 0x82bbffdc, 0x829bffd8, 0x93150004, 0x3014b815, + 0xb4000010, 0x02dbb818, 0x029bb815, 0x3017b816, + 0xb480000c, 0x5a81b814, 0x029fb010, 0x82860095, + 0x8293001f, 0x9294fe00, 0x92b50008, 0x3015b814, + 0xb4800002, 0x82b3001f, 0x92b5fa00, 0x82beffdc, + 0xb500ffeb, 0x029f9010, 0x83250094, 0x06d4b819, + 0x02d6b816, 0xb016ffff, 0xb4a0000a, 0x82933802, + 0x9a940041, 0x82c5009d, 0x96d6ffff, 0x1a94b816, + 0x82c5009a, 0x96d60010, 0xb0160010, 0xb4000001, + 0x8286009d, 0x00ffb81c, 0x00000000, 0x00000000, + 0x001f9012, 0x001fb100, 0x001f004c, 0x001f2404, + 0x801bfef0, 0x8058fef4, 0x803bff68, 0x8078ff6c, + 0x2000b801, 0x2042b803, 0x001fb104, 0x005f2414, + 0x82e70001, 0x83640048, 0x029fb014, 0x829efef0, + 0x8286000f, 0x02bf2054, 0x82bcfef4, 0x82a6000e, + 0x00ffb81a, 0x80e70001, 0x801336e3, 0x9800eb76, + 0x001fb100, 0x800700ab, 0x001f2404, 0x801bc3e8, + 0x8058c3ec, 0x83640024, 0x82e70000, 0x83640036, + 0x029fb300, 0x029fb100, 0x02bf2c04, 0x02bf2404, + 0x801bc000, 0x8058c004, 0x8364001b, 0x82e70000, + 0x8364002d, 0x001f9300, 0x3000b814, 0xb420000a, + 0x001f0c04, 0x3000b815, 0xb4200007, 0x829efef0, + 0x82bcfef4, 0x029fb012, 0x02bf204c, 0x82870001, + 0x829cfef5, 0x00ffb81a, 0xb0070000, 0xb4000007, + 0x80e70000, 0x801399fa, 0x9800c92e, 0x001fb100, + 0x800700af, 0x001f2404, 0xb500ffdc, 0x82870000, + 0x829cfef5, 0x00ffb81a, 0x80c700ff, 0x803bff68, + 0x8078ff6c, 0x14a0b806, 0x2063b805, 0x007f2414, + 0x2021b802, 0x58c8b806, 0x14a0b806, 0x58b0b805, + 0x2021b805, 0x58c8b806, 0x14a0b806, 0x2021b805, + 0x58c8b806, 0x14a0b806, 0x5cb0b805, 0x2021b805, + 0x003fb104, 0x00ffb81b, 0x82c70000, 0x83070400, + 0x83270005, 0x8197040c, 0x81d7ffff, 0x83840126, + 0x83840001, 0x00ffb81b, 0x808f0000, 0x806f001f, + 0x80af001f, 0x80270140, 0x81e70228, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x80270180, 0x81e70120, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x8057ffff, 0x80170430, 0x80070410, + 0x80270408, 0xb6000509, 0x005ff000, 0x90420500, + 0x007ff001, 0x90630600, 0x009ff002, 0x00bff003, + 0x2004a025, 0x90000001, 0x90210001, 0x80070414, + 0x80d7ffff, 0x8097045c, 0x8017043c, 0xb6000404, + 0x005ff000, 0x007f87e0, 0x84000001, 0x2082a7e3, + 0x80970460, 0x80170440, 0x2082b803, 0x007f8000, + 0x2083a004, 0x80170430, 0x80970450, 0x80270408, + 0xb6000508, 0x005f8024, 0x90420500, 0x007ff001, + 0x90630600, 0x009ff002, 0x00bff003, 0x2004a025, + 0x90210001, 0x80170440, 0x00000000, 0x02bf87e0, + 0x80970460, 0x82870000, 0xb6000404, 0x005f87e4, + 0x5a88b814, 0x204287e0, 0x1a94b802, 0x00ffb81c, + 0x001f0a49, 0x001f2709, 0x001f0a41, 0x001f2708, + 0x001f0a46, 0x001f2707, 0x001f0a48, 0x001f2706, + 0x001f0a42, 0x001f2705, 0x001f0a47, 0x001f2704, + 0x001f0a45, 0x001f2703, 0x001f0a43, 0x001f2702, + 0x001f0a40, 0x001f2701, 0x001f0a44, 0x001f2700, + 0x001f0c25, 0xa020000c, 0x94400001, 0x94600002, + 0x94810004, 0x94a10008, 0x94c00010, 0x5943b802, + 0x5861b803, 0x5882b804, 0x5ca2b805, 0x5cc4b806, + 0x194ab803, 0x194ab804, 0x194ab805, 0x194ab806, + 0x015f2738, 0x801b0220, 0x003f91c1, 0x5c28b801, + 0x005f91c2, 0x5858b802, 0x1821b802, 0x2000b801, + 0x001fb1c4, 0x80180224, 0x003f0709, 0x2000b801, + 0x001f2714, 0x82c70001, 0x82e70001, 0x83070710, + 0x8327001e, 0x81970735, 0x8384009f, 0x02df0738, + 0x82170a30, 0x838400f1, 0x819efef0, 0x817cfef4, + 0x819eff68, 0x817cff6c, 0x00ffb81b, 0x820f001f, + 0x8018fef8, 0x8057ffff, 0x001f2709, 0x8018fef6, + 0x80d7ffff, 0x001f2708, 0x8018fefa, 0x8157ffff, + 0x001f2707, 0x8018fefd, 0x81d7ffff, 0x001f2706, + 0x8018fefb, 0x802f001f, 0x001f2705, 0x8018fefe, + 0x00000000, 0x001f2704, 0x8018fef9, 0x00000000, + 0x001f2703, 0x8018feff, 0x00000000, 0x001f2702, + 0x8018fef7, 0x00000000, 0x001f2701, 0x8018fefc, + 0x00000000, 0x001f2700, 0x001f0c25, 0xa0200011, + 0x94410001, 0x94600002, 0x94800004, 0x94a00008, + 0x94c10010, 0x5941b802, 0x5861b803, 0x5c82b804, + 0x58a1b805, 0x5cc1b806, 0x194ab803, 0x194ab804, + 0x194ab805, 0x194ab806, 0x015f2738, 0x801b0220, + 0x003f91c1, 0x5c28b801, 0x005f91c2, 0x5858b802, + 0x1821b802, 0x2000b801, 0x001fb1c4, 0x80180224, + 0x003f0709, 0x2000b801, 0x001f2714, 0x82c70001, + 0x82e70001, 0x83070710, 0x8327001e, 0x81970735, + 0x83840055, 0x02df0738, 0x82170a20, 0x838400a7, + 0x819efef0, 0x817cfef4, 0x5ac8b80c, 0x02ff0a44, + 0x1ad6b817, 0x02dfb291, 0x5ed8b80c, 0x5968b80b, + 0x1ad6b80b, 0x02df6524, 0x00ffb81b, 0x820f001f, + 0x8018fefe, 0x8057ffff, 0x001f2709, 0x8018fefa, + 0x80d7ffff, 0x001f2708, 0x8018fefc, 0x8157ffff, + 0x001f2707, 0x8018feff, 0x81d7ffff, 0x001f2706, + 0x8018fef8, 0x802f001f, 0x001f2705, 0x8018fefb, + 0x00000000, 0x001f2704, 0x8018fefd, 0x00000000, + 0x001f2703, 0x8018fef6, 0x00000000, 0x001f2702, + 0x8018fef9, 0x00000000, 0x001f2701, 0x8018fef7, + 0x00000000, 0x001f2700, 0x801b0220, 0x003f91c1, + 0x5c28b801, 0x005f91c2, 0x5858b802, 0x1821b802, + 0x2000b801, 0x001fb1c4, 0x80180224, 0x003f0709, + 0x2000b801, 0x001f2714, 0x82c70001, 0x82e70001, + 0x83070710, 0x8327001e, 0x81970735, 0x83840016, + 0x83270000, 0x831bfef0, 0x82f8fef4, 0x02c7b819, + 0x82170a28, 0x83840065, 0x300cb818, 0xb4200002, + 0x300bb817, 0xb4000006, 0x93390001, 0xb0190020, + 0xb480fff6, 0x83270000, 0x833cfef5, 0x00ffb81b, + 0x019fb290, 0x017f2a44, 0x033f2c25, 0x83270001, + 0x833cfef5, 0x00ffb81b, 0x0007b818, 0x90000003, + 0x00000000, 0x015ff000, 0x90000001, 0x5949b80a, + 0x013ff000, 0x194ab809, 0x84000002, 0x994a0100, + 0x017ff000, 0x958b00f8, 0x5981b80c, 0x956b0007, + 0x198cb80b, 0x84000002, 0x998c0008, 0x017ff000, + 0x90000001, 0x5971b80b, 0x198cb80b, 0x017ff000, + 0x5969b80b, 0x198cb80b, 0x81a70000, 0x94d90003, + 0x82a70000, 0xb6260019, 0xb6000818, 0x5df0b80a, + 0x5e02b80a, 0x21efb810, 0x95ef0001, 0x5941b80a, + 0x194ab80f, 0x21efb816, 0x5e18b80c, 0x5e35b80c, + 0x5e54b80c, 0x5e6cb80c, 0x2210b811, 0x2252b813, + 0x2210b812, 0x96100001, 0x5981b80c, 0x198cb810, + 0x2210b817, 0x10afb810, 0x10a5b80d, 0x5da1b805, + 0x94a50001, 0x5aa1b815, 0x1ab5b805, 0x019fa7f5, + 0x5cc2b819, 0xb626001c, 0x82870000, 0xb6000419, + 0xb6000818, 0x5df0b80a, 0x5e02b80a, 0x21efb810, + 0x95ef0001, 0x5941b80a, 0x194ab80f, 0x21efb816, + 0x5e18b80c, 0x5e35b80c, 0x5e54b80c, 0x5e6cb80c, + 0x2210b811, 0x2252b813, 0x2210b812, 0x96100001, + 0x5981b80c, 0x198cb810, 0x2210b817, 0x10afb810, + 0x10a5b80d, 0x5da1b805, 0x94a50001, 0x5a81b814, + 0x1a94b805, 0x019fa7f4, 0x00ffb81c, 0x8257ffff, + 0x808f0000, 0x806f001f, 0x80af001f, 0x80270200, + 0x81e7ff00, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270240, + 0x81e70000, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270180, + 0x81e70120, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x806f0007, + 0x80af0007, 0x80270280, 0x81e70100, 0x5de2b80f, + 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, + 0x01ff90bc, 0xb520ffff, 0x91ef0020, 0x90210020, + 0x80170760, 0x001f0700, 0x001fa020, 0x001f0701, + 0x001fa020, 0x001f0702, 0x001fa020, 0x001f0703, + 0x001fa020, 0x001f0704, 0x001fa000, 0x80970750, + 0x81170770, 0x82a70735, 0x83a40060, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4005c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a70730, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40050, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4004c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a7072b, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40040, 0x83a4004e, + 0xb6000407, 0x86b50001, 0x83a4003c, 0x001f8004, + 0x003f87e8, 0x2080a001, 0x83a40047, 0x00000000, + 0x80970770, 0x80170750, 0x81170750, 0x81970740, + 0x82a70726, 0x001f800c, 0x003f8008, 0x2100a001, + 0x83a4002e, 0x83a4003c, 0xb6000407, 0x86b50001, + 0x83a4002a, 0x001f8004, 0x003f87e8, 0x2080a001, + 0x83a40035, 0x00000000, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a70721, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4001c, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a40018, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a7071c, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4000c, 0x017f87e4, + 0x81870000, 0xb6000406, 0x86b50001, 0x83a40007, + 0x001f87e4, 0x200087e8, 0x5988b80c, 0x198cb800, + 0x021fa02c, 0x021fa00b, 0x00ffb81c, 0x005ff015, + 0x90420600, 0x003f87e0, 0x001ff002, 0x2060b801, + 0x90630800, 0x90960a00, 0x001ff003, 0x003ff004, + 0x20a0b801, 0x90a50900, 0x00000000, 0x001ff005, + 0x009fa000, 0x00ffb81d, 0x001f8004, 0x5c21b800, + 0x5847b800, 0x1821b802, 0x942100ff, 0x2080a7e1, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x829bff80, 0x80af000f, 0x808f0000, 0x806f0000, + 0x82bbffec, 0x82fbffe4, 0x00000000, 0x82beffb8, + 0x95540700, 0x5d48b80a, 0x914a0001, 0x0227b80a, + 0x94343000, 0x5c2cb801, 0xb0010000, 0xb4000001, + 0x5a21b811, 0x9574c000, 0x5d6eb80b, 0x918b4b08, + 0x01b8b80c, 0x96d5ffff, 0x5ec2b816, 0x96f7ffff, + 0x5ee2b817, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x81f3ff00, 0x99efff00, 0x821300ff, + 0x9a1000ff, 0x81971000, 0x82670000, 0x82470000, + 0x80270280, 0x81df0000, 0x00000000, 0x00000000, + 0xb62d000d, 0x3016b817, 0xb4800001, 0x86d62800, + 0x00cfb801, 0x02dfb0bc, 0x5ac2b816, 0x01cfb816, + 0x02df90bc, 0x0067b86f, 0xb0030001, 0xb4c0fffd, + 0x92d60010, 0x90210010, 0x81df0004, 0x80170a00, + 0x81df0000, 0x00000000, 0x00000000, 0xb62d0006, + 0xb6001005, 0x146f8000, 0x14908000, 0x5c68b803, + 0x5888b804, 0x1803a024, 0x81df0004, 0x80170a00, + 0x80970d00, 0xb00b0000, 0xb4000004, 0xb00b0001, + 0xb400000a, 0xb00b0002, 0xb4000027, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004002, 0x007f8020, + 0x009fa023, 0x81df0004, 0xb5000029, 0x80d3ffff, + 0x81df0000, 0x00000000, 0x00000000, 0xb6001018, + 0x5c648000, 0x9463ffff, 0x5c888020, 0x58b88000, + 0x1884b805, 0x1484b806, 0x1883a024, 0x5c6c8020, + 0x9463ffff, 0x58908000, 0x1883a024, 0x5c748020, + 0x588c8000, 0x1863b804, 0x9463ffff, 0x58888000, + 0x1484b806, 0x1883a024, 0x5c7c8020, 0x58848000, + 0x1863b804, 0x9463ffff, 0x14868020, 0x1883a024, + 0x81df0004, 0xb500000a, 0x80d3ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6002004, 0x007f8020, + 0x009fa023, 0x007f8040, 0x009fa023, 0x81df0004, + 0x00000000, 0x81170d00, 0x80070000, 0x94343000, + 0x5c2cb801, 0xb0010001, 0xb4000099, 0xb00a0001, + 0xb400000e, 0xb00a0002, 0xb4000022, 0xb00a0003, + 0xb400002f, 0xb00a0004, 0xb400005d, 0xb00a0005, + 0xb4000066, 0xb00a0006, 0xb400008a, 0xb00a0007, + 0xb4000088, 0xb00a0008, 0xb4000086, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004010, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x019fa020, 0x019fa020, 0x019fa020, 0x5c708028, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x019fa020, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000070, 0x81df0000, 0x00000000, 0x00000000, + 0x8027ffff, 0xb6004008, 0x14618008, 0x019fa023, + 0x019fa020, 0x019fa020, 0x5c708028, 0x019fa023, + 0x019fa020, 0x019fa020, 0x81df0004, 0xb5000061, + 0xb0130000, 0xb4000004, 0xb0130001, 0xb4000009, + 0xb0130002, 0xb400001a, 0x83a40102, 0x80170f00, + 0x007f8028, 0x001fa023, 0x007f8028, 0x001fa023, + 0xb5000054, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8000, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708020, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a400ed, + 0x80170f00, 0x007f8028, 0x001fa023, 0xb5000041, + 0x80170f00, 0x00000000, 0x007f8020, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x019fa020, 0x83a400da, 0xb5000031, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002005, + 0x007f8008, 0x019fa023, 0x007f8008, 0x019fa023, + 0x019fa020, 0x81df0004, 0xb5000026, 0xb0130000, + 0xb4000008, 0xb0130001, 0xb4000012, 0xb0130002, + 0xb400001f, 0xb0130003, 0xb400001d, 0xb0130004, + 0xb400001b, 0x83a400d5, 0x007f8028, 0x019fa023, + 0x007f8028, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000010, 0x80170f00, 0x00000000, 0x5c708020, + 0x58908008, 0x1983a024, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x83a400bf, + 0x80170f00, 0x007f8028, 0x001fa023, 0xb5000001, + 0xb5000000, 0x00000000, 0x00000000, 0xb500008e, + 0xb00a0001, 0xb400000e, 0xb00a0002, 0xb400001a, + 0xb00a0003, 0xb4000027, 0xb00a0004, 0xb4000055, + 0xb00a0005, 0xb400005e, 0xb00a0006, 0xb4000082, + 0xb00a0007, 0xb4000080, 0xb00a0008, 0xb400007e, + 0x81df0000, 0x00000000, 0x00000000, 0xb6004008, + 0x007f8028, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x019fa020, 0x019fa020, 0x019fa020, 0x019fa020, + 0x81df0004, 0xb5000070, 0x81df0000, 0x00000000, + 0x00000000, 0x8027ffff, 0xb6002008, 0x14618008, + 0x019fa023, 0x019fa020, 0x019fa020, 0x5c708048, + 0x019fa023, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000061, 0xb0130000, 0xb4000004, 0xb0130001, + 0xb4000009, 0xb0130002, 0xb400001a, 0x83a40098, + 0x80170f00, 0x007f8028, 0x001fa023, 0x007f8028, + 0x001fa023, 0xb5000054, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8000, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708020, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a40083, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000041, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8008, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a40070, + 0xb5000031, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002005, 0x007f8008, 0x019fa023, 0x007f8008, + 0x019fa023, 0x019fa020, 0x81df0004, 0xb5000026, + 0xb0130000, 0xb4000008, 0xb0130001, 0xb4000012, + 0xb0130002, 0xb400001f, 0xb0130003, 0xb400001d, + 0xb0130004, 0xb400001b, 0x83a4006b, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000010, 0x80170f00, 0x00000000, + 0x5c708020, 0x58908008, 0x1983a024, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x83a40055, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000001, 0xb5000000, 0x92730001, 0x92520001, + 0x3012b811, 0xb480fe76, 0x003f0324, 0x90210001, + 0xb0010006, 0xb4a00001, 0x80270001, 0x003f2324, + 0x2c8db811, 0x803bffe0, 0x805bffe4, 0x5886b804, + 0x1015b804, 0xad440003, 0x3000b802, 0xb4800001, + 0x8400a000, 0x801effec, 0x015f6193, 0x809e4b04, + 0x00ffb81f, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002a0c, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x81df0004, 0x00ffb81d, 0x81df0000, + 0x00000000, 0x00000000, 0xb600190f, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x81df0004, 0x00ffb81d, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002a0c, + 0x007f8028, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x81df0004, 0x00ffb81d, 0x81df0000, 0x00000000, + 0x00000000, 0xb600190f, 0x007f8028, 0x019fa023, + 0x007f8028, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x81df0004, 0x00ffb81d, 0x00000000, + 0x829bff80, 0x80af001f, 0x808f0000, 0x806f0000, + 0x82bbffec, 0x82fbffe4, 0x00000000, 0x82beffb8, + 0x95540700, 0x5d48b80a, 0x914a0001, 0x0227b80a, + 0x94343000, 0x5c2cb801, 0xb0010000, 0xb4000001, + 0x5a21b811, 0x9574c000, 0x5d6eb80b, 0x918b4b08, + 0x01b8b80c, 0x96d5ffff, 0x5ec2b816, 0x96f7ffff, + 0x5ee2b817, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x81f3ff00, 0x99efff00, 0x821300ff, + 0x9a1000ff, 0x81971000, 0x82670000, 0x82470000, + 0x80270280, 0x81df0000, 0x00000000, 0x00000000, + 0xb62d000d, 0x3016b817, 0xb4800001, 0x86d62800, + 0x00cfb801, 0x02dfb0bc, 0x5ac2b816, 0x01cfb816, + 0x02df90bc, 0x0067b86f, 0xb0030001, 0xb4c0fffd, + 0x92d60020, 0x90210020, 0x81df0004, 0x80170a00, + 0x81df0000, 0x00000000, 0x00000000, 0xb62d0006, + 0xb6002005, 0x146f8000, 0x14908000, 0x5c68b803, + 0x5888b804, 0x1803a024, 0x81df0004, 0x80170a00, + 0x80970d00, 0xb00b0000, 0xb4000004, 0xb00b0001, + 0xb400000a, 0xb00b0002, 0xb4000027, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008002, 0x007f8020, + 0x009fa023, 0x81df0004, 0xb5000029, 0x80d3ffff, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002018, + 0x5c648000, 0x9463ffff, 0x5c888020, 0x58b88000, + 0x1884b805, 0x1484b806, 0x1883a024, 0x5c6c8020, + 0x9463ffff, 0x58908000, 0x1883a024, 0x5c748020, + 0x588c8000, 0x1863b804, 0x9463ffff, 0x58888000, + 0x1484b806, 0x1883a024, 0x5c7c8020, 0x58848000, + 0x1863b804, 0x9463ffff, 0x14868020, 0x1883a024, + 0x81df0004, 0xb500000a, 0x80d3ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004004, 0x007f8020, + 0x009fa023, 0x007f8040, 0x009fa023, 0x81df0004, + 0x00000000, 0x81170d00, 0x80070000, 0x94343000, + 0x5c2cb801, 0xb0010001, 0xb400008e, 0xb00a0001, + 0xb400000e, 0xb00a0002, 0xb400001c, 0xb00a0003, + 0xb4000024, 0xb00a0004, 0xb4000052, 0xb00a0005, + 0xb400005b, 0xb00a0006, 0xb400007f, 0xb00a0007, + 0xb400007d, 0xb00a0008, 0xb400007b, 0x81df0000, + 0x00000000, 0x00000000, 0xb600800a, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x5c708028, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x019fa020, 0x81df0004, 0xb500006b, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008004, 0x007f8028, + 0x019fa023, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000061, 0xb0130000, 0xb4000004, 0xb0130001, + 0xb4000009, 0xb0130002, 0xb400001a, 0x83a400fa, + 0x80170f00, 0x007f8028, 0x001fa023, 0x007f8028, + 0x001fa023, 0xb5000054, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8000, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708020, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a400e5, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000041, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8008, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a400d2, + 0xb5000031, 0x81df0000, 0x00000000, 0x00000000, + 0xb6004005, 0x007f8008, 0x019fa023, 0x007f8008, + 0x019fa023, 0x019fa020, 0x81df0004, 0xb5000026, + 0xb0130000, 0xb4000008, 0xb0130001, 0xb4000012, + 0xb0130002, 0xb400001f, 0xb0130003, 0xb400001d, + 0xb0130004, 0xb400001b, 0x83a400cd, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000010, 0x80170f00, 0x00000000, + 0x5c708020, 0x58908008, 0x1983a024, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x83a400b7, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000001, 0xb5000000, 0x00000000, 0x00000000, + 0xb5000086, 0xb00a0001, 0xb400000e, 0xb00a0002, + 0xb4000017, 0xb00a0003, 0xb400001f, 0xb00a0004, + 0xb400004d, 0xb00a0005, 0xb4000056, 0xb00a0006, + 0xb400007a, 0xb00a0007, 0xb4000078, 0xb00a0008, + 0xb4000076, 0x81df0000, 0x00000000, 0x00000000, + 0xb6008005, 0x007f8028, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x019fa020, 0x81df0004, 0xb500006b, + 0x81df0000, 0x00000000, 0x00000000, 0xb6004004, + 0x007f8048, 0x019fa023, 0x019fa020, 0x019fa020, + 0x81df0004, 0xb5000061, 0xb0130000, 0xb4000004, + 0xb0130001, 0xb4000009, 0xb0130002, 0xb400001a, + 0x83a40098, 0x80170f00, 0x007f8028, 0x001fa023, + 0x007f8028, 0x001fa023, 0xb5000054, 0x80170f00, + 0x00000000, 0x007f8020, 0x019fa023, 0x007f8000, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708020, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x83a40083, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000041, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a40070, 0xb5000031, 0x81df0000, 0x00000000, + 0x00000000, 0xb6004005, 0x007f8008, 0x019fa023, + 0x007f8008, 0x019fa023, 0x019fa020, 0x81df0004, + 0xb5000026, 0xb0130000, 0xb4000008, 0xb0130001, + 0xb4000012, 0xb0130002, 0xb400001f, 0xb0130003, + 0xb400001d, 0xb0130004, 0xb400001b, 0x83a4006b, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x80170f00, + 0x007f8028, 0x001fa023, 0xb5000010, 0x80170f00, + 0x00000000, 0x5c708020, 0x58908008, 0x1983a024, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x83a40055, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000001, 0xb5000000, 0x92730001, + 0x92520001, 0x3012b811, 0xb480fe89, 0x003f0324, + 0x90210001, 0xb0010006, 0xb4a00001, 0x80270001, + 0x003f2324, 0x2c8db811, 0x803bffe0, 0x805bffe4, + 0x5887b804, 0x1015b804, 0xad440003, 0x3000b802, + 0xb4800001, 0x8400a000, 0x801effec, 0x015f6193, + 0x809e4b04, 0x00ffb81f, 0x81df0000, 0x00000000, + 0x00000000, 0xb6002a0c, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x019fa020, 0x81df0004, 0x00ffb81d, + 0x81df0000, 0x00000000, 0x00000000, 0xb600190f, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x81df0004, + 0x00ffb81d, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002a0c, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x81df0004, 0x00ffb81d, 0x81df0000, + 0x00000000, 0x00000000, 0xb600190f, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x81df0004, 0x00ffb81d, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815b4b0c, 0x81070000, 0x81270be8, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x812717e8, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a00060, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200006, + 0x039f4193, 0x5b81b81c, 0x003f90cb, 0x1021b81c, + 0x003fb0cb, 0x8384f90e, 0x829bff80, 0x801300e0, + 0x1434b800, 0x5c35b801, 0x8013001f, 0x1454b800, + 0x5c50b802, 0x8073007f, 0x9863ffff, 0xb002000f, + 0xb4800001, 0x90210001, 0x84210004, 0xb0010000, + 0xb4a00001, 0x6861b803, 0x005f9040, 0x4082b803, + 0x80af001f, 0x808f0000, 0x806f0000, 0x8007ffff, + 0x8033ffff, 0x80171000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6001811, 0xb6002010, 0x14618000, + 0x6068b803, 0x40c4b803, 0x14608000, 0x00c8b806, + 0x5870b803, 0x6068b803, 0x4104b803, 0x58c8b806, + 0x0108b808, 0x14c6b801, 0x00000000, 0x00000000, + 0x5d08b808, 0x1508b800, 0x1806a028, 0x81df0004, + 0x80670400, 0x5d22b80a, 0x81df0000, 0x00000000, + 0x00000000, 0xb600180a, 0x00cfb803, 0x013fb0bc, + 0x5922b809, 0x01afb809, 0x013f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x91290020, + 0x81df0004, 0x808f0000, 0x801b4b14, 0x80270001, + 0xb0000001, 0xb4000002, 0x802600a0, 0x803e4b14, + 0x81270c00, 0xb00a0000, 0xb4000001, 0x81270000, + 0x813e4b0c, 0x80270001, 0x003f2013, 0x80050086, + 0x001fb044, 0x00ffb81b, 0x00000000, 0x00000000, +}; + +static u32 PCMI2S240Ucode1f4b00[] = { + 0x00000000, 0x00000000, 0x00060504, 0x00000000, + 0x00000000, 0x00000000, 0x00300000, 0xffcfcfff, + 0x00302000, 0xffcfcfff, 0x00380000, 0xffc7c7ff, + 0xcbcecdc4, 0xcfcac9c8, 0xc3c6c5cc, 0xc7c2c1c0, + 0x1b1e1d14, 0x1f1a1918, 0x1316151c, 0x17121110, + 0x2b2e2d24, 0x2f2a2928, 0x2326252c, 0x27222120, + 0x3b3e3d34, 0x3f3a3938, 0x3336353c, 0x37323130, + 0x0b0e0d04, 0x0f0a0908, 0x0306050c, 0x07020100, + 0xdbdeddd4, 0xdfdad9d8, 0xd3d6d5dc, 0xd7d2d1d0, + 0xebeeede4, 0xefeae9e8, 0xe3e6e5ec, 0xe7e2e1e0, + 0xfbfefdf4, 0xfffaf9f8, 0xf3f6f5fc, 0xf7f2f1f0, + 0x4b4e4d44, 0x4f4a4948, 0x4346454c, 0x47424140, + 0x9b9e9d94, 0x9f9a9998, 0x9396959c, 0x97929190, + 0xabaeada4, 0xafaaa9a8, 0xa3a6a5ac, 0xa7a2a1a0, + 0xbbbebdb4, 0xbfbab9b8, 0xb3b6b5bc, 0xb7b2b1b0, + 0x8b8e8d84, 0x8f8a8988, 0x8386858c, 0x87828180, + 0x5b5e5d54, 0x5f5a5958, 0x5356555c, 0x57525150, + 0x6b6e6d64, 0x6f6a6968, 0x6366656c, 0x67626160, + 0x7b7e7d74, 0x7f7a7978, 0x7376757c, 0x77727170, + 0x341424c4, 0x3e1e2ece, 0x3d1d2dcd, 0x3b1b2bcb, + 0xb494a444, 0xbe9eae4e, 0xbd9dad4d, 0xbb9bab4b, + 0xf4d4e404, 0xfedeee0e, 0xfddded0d, 0xfbdbeb0b, + 0x74546484, 0x7e5e6e8e, 0x7d5d6d8d, 0x7b5b6b8b, + 0x3c1c2ccc, 0x361626c6, 0x351525c5, 0x331323c3, + 0xbc9cac4c, 0xb696a646, 0xb595a545, 0xb393a343, + 0xfcdcec0c, 0xf6d6e606, 0xf5d5e505, 0xf3d3e303, + 0x7c5c6c8c, 0x76566686, 0x75556585, 0x73536383, + 0x381828c8, 0x3a1a2aca, 0x391929c9, 0x3f1f2fcf, + 0xb898a848, 0xba9aaa4a, 0xb999a949, 0xbf9faf4f, + 0xf8d8e808, 0xfadaea0a, 0xf9d9e909, 0xffdfef0f, + 0x78586888, 0x7a5a6a8a, 0x79596989, 0x7f5f6f8f, + 0x301020c0, 0x321222c2, 0x311121c1, 0x371727c7, + 0xb090a040, 0xb292a242, 0xb191a141, 0xb797a747, + 0xf0d0e000, 0xf2d2e202, 0xf1d1e101, 0xf7d7e707, + 0x70506080, 0x72526282, 0x71516181, 0x77576787, + 0x05040100, 0x15141110, 0x25242120, 0x35343130, + 0x85848180, 0x95949190, 0xa5a4a1a0, 0xb5b4b1b0, + 0xc0408000, 0xe060a020, 0xd0509010, 0xf070b030, + 0xc8488808, 0xe868a828, 0xd8589818, 0xf878b838, + 0xc4448404, 0xe464a424, 0xd4549414, 0xf474b434, + 0xcc4c8c0c, 0xec6cac2c, 0xdc5c9c1c, 0xfc7cbc3c, + 0xc2428202, 0xe262a222, 0xd2529212, 0xf272b232, + 0xca4a8a0a, 0xea6aaa2a, 0xda5a9a1a, 0xfa7aba3a, + 0xc6468606, 0xe666a626, 0xd6569616, 0xf676b636, + 0xce4e8e0e, 0xee6eae2e, 0xde5e9e1e, 0xfe7ebe3e, + 0xc1418101, 0xe161a121, 0xd1519111, 0xf171b131, + 0xc9498909, 0xe969a929, 0xd9599919, 0xf979b939, + 0xc5458505, 0xe565a525, 0xd5559515, 0xf575b535, + 0xcd4d8d0d, 0xed6dad2d, 0xdd5d9d1d, 0xfd7dbd3d, + 0xc3438303, 0xe363a323, 0xd3539313, 0xf373b333, + 0xcb4b8b0b, 0xeb6bab2b, 0xdb5b9b1b, 0xfb7bbb3b, + 0xc7478707, 0xe767a727, 0xd7579717, 0xf777b737, + 0xcf4f8f0f, 0xef6faf2f, 0xdf5f9f1f, 0xff7fbf3f, + 0x1045a3e2, 0x000000f4, 0x263b7333, 0x766b2363, + 0x2b367e3e, 0x7b662e6e, 0x06db93d3, 0x964b0343, + 0x0bd69ede, 0x9b460e4e, 0x825f1757, 0x12cf87c7, + 0x8f521a5a, 0x1fc28aca, 0x00d199d9, 0x90410949, + 0x01d098d8, 0x91400848, 0x24357d3d, 0x74652d6d, + 0x25347c3c, 0x75642c6c, 0x04d59ddd, 0x94450d4d, + 0x05d49cdc, 0x95440c4c, 0x80511959, 0x10c189c9, + 0x81501858, 0x11c088c8, 0x02df97d7, 0x924f0747, + 0x0fd29ada, 0x9f420a4a, 0x865b1353, 0x16cb83c3, + 0x8b561e5e, 0x1bc68ece, 0xa6bbf3b3, 0xf6eba3e3, + 0xabb6febe, 0xfbe6aeee, 0x223f7737, 0x726f2767, + 0x2f327a3a, 0x7f622a6a, 0xa0b1f9b9, 0xf0e1a9e9, + 0xa1b0f8b8, 0xf1e0a8e8, 0x84551d5d, 0x14c58dcd, + 0x85541c5c, 0x15c48ccc, 0xa4b5fdbd, 0xf4e5aded, + 0xa5b4fcbc, 0xf5e4acec, 0x20317939, 0x70612969, + 0x21307838, 0x71602868, 0xa2bff7b7, 0xf2efa7e7, + 0xafb2faba, 0xffe2aaea, 0x00000000, 0x00000000, +}; + +static u32 PCMI2S240Ucode1fff00[] = { + 0xcbcecdc4, 0xcfcac9c8, 0xc3c6c5cc, 0xc7c2c1c0, + 0x1b1e1d14, 0x1f1a1918, 0x1316151c, 0x17121110, + 0x2b2e2d24, 0x2f2a2928, 0x2326252c, 0x27222120, + 0x3b3e3d34, 0x3f3a3938, 0x3336353c, 0x37323130, + 0x0b0e0d04, 0x0f0a0908, 0x0306050c, 0x07020100, + 0xdbdeddd4, 0xdfdad9d8, 0xd3d6d5dc, 0xd7d2d1d0, + 0xebeeede4, 0xefeae9e8, 0xe3e6e5ec, 0xe7e2e1e0, + 0xfbfefdf4, 0xfffaf9f8, 0xf3f6f5fc, 0xf7f2f1f0, + 0x4b4e4d44, 0x4f4a4948, 0x4346454c, 0x47424140, + 0x9b9e9d94, 0x9f9a9998, 0x9396959c, 0x97929190, + 0xabaeada4, 0xafaaa9a8, 0xa3a6a5ac, 0xa7a2a1a0, + 0xbbbebdb4, 0xbfbab9b8, 0xb3b6b5bc, 0xb7b2b1b0, + 0x8b8e8d84, 0x8f8a8988, 0x8386858c, 0x87828180, + 0x5b5e5d54, 0x5f5a5958, 0x5356555c, 0x57525150, + 0x6b6e6d64, 0x6f6a6968, 0x6366656c, 0x67626160, + 0x7b7e7d74, 0x7f7a7978, 0x7376757c, 0x77727170, + 0x341424c4, 0x3e1e2ece, 0x3d1d2dcd, 0x3b1b2bcb, + 0xb494a444, 0xbe9eae4e, 0xbd9dad4d, 0xbb9bab4b, + 0xf4d4e404, 0xfedeee0e, 0xfddded0d, 0xfbdbeb0b, + 0x74546484, 0x7e5e6e8e, 0x7d5d6d8d, 0x7b5b6b8b, + 0x3c1c2ccc, 0x361626c6, 0x351525c5, 0x331323c3, + 0xbc9cac4c, 0xb696a646, 0xb595a545, 0xb393a343, + 0xfcdcec0c, 0xf6d6e606, 0xf5d5e505, 0xf3d3e303, + 0x7c5c6c8c, 0x76566686, 0x75556585, 0x73536383, + 0x381828c8, 0x3a1a2aca, 0x391929c9, 0x3f1f2fcf, + 0xb898a848, 0xba9aaa4a, 0xb999a949, 0xbf9faf4f, + 0xf8d8e808, 0xfadaea0a, 0xf9d9e909, 0xffdfef0f, + 0x78586888, 0x7a5a6a8a, 0x79596989, 0x7f5f6f8f, + 0x301020c0, 0x321222c2, 0x311121c1, 0x371727c7, + 0xb090a040, 0xb292a242, 0xb191a141, 0xb797a747, + 0xf0d0e000, 0xf2d2e202, 0xf1d1e101, 0xf7d7e707, + 0x70506080, 0x72526282, 0x71516181, 0x77576787, + 0x05040100, 0x15141110, 0x25242120, 0x35343130, + 0x85848180, 0x95949190, 0xa5a4a1a0, 0xb5b4b1b0, + 0xc0408000, 0xe060a020, 0xd0509010, 0xf070b030, + 0xc8488808, 0xe868a828, 0xd8589818, 0xf878b838, + 0xc4448404, 0xe464a424, 0xd4549414, 0xf474b434, + 0xcc4c8c0c, 0xec6cac2c, 0xdc5c9c1c, 0xfc7cbc3c, + 0xc2428202, 0xe262a222, 0xd2529212, 0xf272b232, + 0xca4a8a0a, 0xea6aaa2a, 0xda5a9a1a, 0xfa7aba3a, + 0xc6468606, 0xe666a626, 0xd6569616, 0xf676b636, + 0xce4e8e0e, 0xee6eae2e, 0xde5e9e1e, 0xfe7ebe3e, + 0xc1418101, 0xe161a121, 0xd1519111, 0xf171b131, + 0xc9498909, 0xe969a929, 0xd9599919, 0xf979b939, + 0xc5458505, 0xe565a525, 0xd5559515, 0xf575b535, + 0xcd4d8d0d, 0xed6dad2d, 0xdd5d9d1d, 0xfd7dbd3d, + 0xc3438303, 0xe363a323, 0xd3539313, 0xf373b333, + 0xcb4b8b0b, 0xeb6bab2b, 0xdb5b9b1b, 0xfb7bbb3b, + 0xc7478707, 0xe767a727, 0xd7579717, 0xf777b737, + 0xcf4f8f0f, 0xef6faf2f, 0xdf5f9f1f, 0xff7fbf3f, + 0x1045a3e2, 0x000000f4, 0x263b7333, 0x766b2363, + 0x2b367e3e, 0x7b662e6e, 0x06db93d3, 0x964b0343, + 0x0bd69ede, 0x9b460e4e, 0x825f1757, 0x12cf87c7, + 0x8f521a5a, 0x1fc28aca, 0x00d199d9, 0x90410949, + 0x01d098d8, 0x91400848, 0x24357d3d, 0x74652d6d, + 0x25347c3c, 0x75642c6c, 0x04d59ddd, 0x94450d4d, + 0x05d49cdc, 0x95440c4c, 0x80511959, 0x10c189c9, + 0x81501858, 0x11c088c8, 0x02df97d7, 0x924f0747, + 0x0fd29ada, 0x9f420a4a, 0x865b1353, 0x16cb83c3, + 0x8b561e5e, 0x1bc68ece, 0xa6bbf3b3, 0xf6eba3e3, + 0xabb6febe, 0xfbe6aeee, 0x223f7737, 0x726f2767, + 0x2f327a3a, 0x7f622a6a, 0xa0b1f9b9, 0xf0e1a9e9, + 0xa1b0f8b8, 0xf1e0a8e8, 0x84551d5d, 0x14c58dcd, + 0x85541c5c, 0x15c48ccc, 0xa4b5fdbd, 0xf4e5aded, + 0xa5b4fcbc, 0xf5e4acec, 0x20317939, 0x70612969, + 0x21307838, 0x71602868, 0xa2bff7b7, 0xf2efa7e7, + 0xafb2faba, 0xffe2aaea, 0x00000000, 0x00000000, +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/ls220/pcmi2s.h linux.20pre5-ac2/drivers/media/video/ls220/pcmi2s.h --- linux.20pre5/drivers/media/video/ls220/pcmi2s.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/ls220/pcmi2s.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,801 @@ +static u32 PCMI2SUcode1f1800[] = { + 0xb500000f, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0x00000000, 0x00000000, 0x00000000, 0x00000000, + 0xb500020b, 0x00000000, 0x00000000, 0x00000000, + 0x820f001f, 0x802f001f, 0x029f9014, 0x829efef0, + 0x8286000f, 0x02bf0054, 0x82bcfef4, 0x82a6000e, + 0x80074000, 0x001f6193, 0x8013001f, 0x9020c000, + 0x003fb006, 0x803effe8, 0x803effec, 0x9020fa00, + 0x803effd0, 0x803effdc, 0x803effd8, 0x9020fe00, + 0x803effd4, 0x90400000, 0x804600a2, 0x90421800, + 0x804600a3, 0x80132000, 0x98000040, 0x800600a6, + 0x80050080, 0x98000002, 0x80060080, 0x80070001, + 0x001f2013, 0x80070000, 0x001f23f9, 0x801e4b0c, + 0x001f210c, 0x80070001, 0x001f2324, 0x80070800, + 0x001f600f, 0x001fb0cb, 0x001fb010, 0x801efff0, + 0x98004000, 0x001f600e, 0x83e4011f, 0x80070000, + 0x801e4b14, 0x800500a0, 0xb0000001, 0xb4000009, + 0x80070001, 0x800600a0, 0x80050080, 0x98000020, + 0x80060080, 0x9400ffdf, 0x80060080, 0x80070000, + 0x800600a0, 0x80074000, 0x801e4b04, 0x81df0004, + 0x801bfff0, 0x00000000, 0x940000ff, 0xb0000000, + 0xb4200033, 0x003f400e, 0x94010010, 0xb0000000, + 0xb400fff7, 0x003f0013, 0xb0010001, 0xb420001f, + 0x803bffe8, 0x801bffec, 0x805b4b04, 0x00000000, + 0x3001b800, 0xb4600001, 0x9021a000, 0x0421b800, + 0x3001b802, 0xb460000d, 0x80050086, 0x005f9044, + 0x0420b802, 0xb00101e0, 0xb4a0ffe5, 0x001fb010, + 0x001f010c, 0xb0000001, 0xb400ffe1, 0x80070001, + 0x001f210c, 0x83e400ec, 0xb500ffdd, 0x8007001f, + 0x94000003, 0x5810b800, 0x83e719ec, 0x1bffb800, + 0x003f9008, 0x1821b800, 0x00ffb801, 0x80270000, + 0x003f2013, 0x8007001f, 0x94000003, 0x5810b800, + 0x83671a14, 0x1b7bb800, 0x003f9009, 0x1821b800, + 0x00ffb801, 0x80070000, 0x001f210c, 0xb500ffc8, + 0x003f400e, 0xb0000086, 0xb4400055, 0xb0000084, + 0xb400003f, 0xb0000085, 0xb4000045, 0xb0000086, + 0xb4000047, 0xb0000083, 0xb4000000, 0x815bff7c, + 0x00000000, 0x940a0080, 0x5c07b800, 0xb0000001, + 0xb4000073, 0x81674b18, 0x940a0007, 0x5803b800, + 0x116bb800, 0x005bb80b, 0x916b0004, 0x001bb80b, + 0x80530030, 0x98422000, 0x8013ffcf, 0x9800cfff, + 0x806500d4, 0x1463b800, 0x1863b802, 0x806600d4, + 0x80073cfb, 0x801e4b00, 0x800600a1, 0x80074000, + 0x801e4b04, 0x8013001f, 0x98405000, 0x805effe0, + 0x005fb006, 0x805effe8, 0x805effec, 0x9042a000, + 0x805effe4, 0x9040fa00, 0x805effd0, 0x805effdc, + 0x805effd8, 0x9040fe00, 0x805effd4, 0x8013007f, + 0x9800ffff, 0x001fb040, 0x80070001, 0x001f2013, + 0x80070000, 0x001f2324, 0x001fb0cb, 0x001fb010, + 0x001fb041, 0x001fb042, 0x80073350, 0x001fb008, + 0x80071ea0, 0x001fb009, 0x98214000, 0xb5000010, + 0x94011000, 0xb0001000, 0xb4200001, 0x9421efff, + 0x98210010, 0xb500000a, 0x80070000, 0x001fb0cb, + 0x83e40099, 0x003f400e, 0x9421ffef, 0xb5000004, + 0x83e40095, 0x003f400e, 0x98211000, 0x9421ffef, + 0x003f600e, 0x80070100, 0x801efff0, 0xb500ff70, + 0xb000008b, 0xb4000018, 0xb0000087, 0xb400ffee, + 0xb0000088, 0xb4000016, 0xb000008a, 0xb4000016, + 0xb000008c, 0xb4000017, 0xb0000089, 0xb4000019, + 0xb00000a0, 0xb400001b, 0xb00000a1, 0xb4000047, + 0xb00000a2, 0xb4000054, 0xb00000a3, 0xb400004c, + 0xb00000a4, 0xb4000056, 0xb00000a5, 0xb400005a, + 0xb00000a6, 0xb400005e, 0x803efff8, 0xb500ffe1, + 0x9421ffdf, 0xb500ffde, 0x80270100, 0x803efff8, + 0xb500ffdc, 0x803bffb0, 0x00000000, 0x003fb040, + 0xb500ffd8, 0x803bff80, 0x00000000, 0x003f6001, + 0xb500ffd4, 0x003f90ba, 0x803efff8, 0xb500ffd1, + 0x81674b18, 0x940a0007, 0x5803b800, 0x116bb800, + 0x005bb80b, 0x916b0004, 0x001bb80b, 0x806500d4, + 0x1463b800, 0x1863b802, 0x806600d4, 0x80130001, + 0x98003d21, 0x800600a1, 0x801e4b00, 0x80074000, + 0x801e4b04, 0x8013001f, 0x98405000, 0x805effe0, + 0x005fb006, 0x805effe8, 0x805effec, 0x9042a000, + 0x805effe4, 0x9040fa00, 0x805effd0, 0x805effdc, + 0x805effd8, 0x9040fe00, 0x805effd4, 0x80070001, + 0x001f2013, 0x80070000, 0x001f2324, 0x001fb0cb, + 0x001fb010, 0x80073b90, 0x001fb008, 0x80074380, + 0x001fb009, 0x98214000, 0xb500ffa5, 0x80270000, + 0x8047fef0, 0x003eb802, 0x90420004, 0x003eb802, + 0x90420004, 0x003eb802, 0x90420004, 0x003eb802, + 0x81df0000, 0x00000000, 0x00000000, 0x83640437, + 0x81df0004, 0xb500ff97, 0x81df0000, 0x00000000, + 0x00000000, 0x836403e1, 0x81df0004, 0xb500ff91, + 0x81df0000, 0x00000000, 0x00000000, 0x8364039c, + 0x81df0004, 0xb500ff8b, 0x81df0000, 0x00000000, + 0x00000000, 0x834402ff, 0x81df0004, 0xb500ff85, + 0x81df0000, 0x00000000, 0x00000000, 0x834402e4, + 0x81df0004, 0xb500ff7f, 0x80070000, 0x80470000, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002003, + 0xb6003002, 0x001eb802, 0x90420004, 0x80171000, + 0x8057ffff, 0xb6002002, 0xb6001801, 0x001fa020, + 0x81df0004, 0x00ffb81f, 0x817bff7c, 0x00000000, + 0x956b0080, 0x5d67b80b, 0x83a70000, 0x8057ffff, + 0x80770000, 0x8073007a, 0x9863e7d2, 0xb00b0001, + 0xb4200002, 0x8073007d, 0x98636d4a, 0x0207b803, + 0x81df0000, 0x00000000, 0x00000000, 0xb00b0001, + 0xb400000a, 0x80171000, 0xb6008007, 0x003fc0c0, + 0x005fc740, 0x40c1b810, 0x4102b810, 0x001fe0c6, + 0x001fe0c8, 0x4210b803, 0xb5000009, 0x80171000, + 0xb6000007, 0x003fc020, 0x005fc7e0, 0x40c1b810, + 0x4102b810, 0x001fe026, 0x001fe0a8, 0x4210b803, + 0x81df0004, 0x80270000, 0x003f2013, 0x8007001f, + 0x94000003, 0x5810b800, 0x83671e7c, 0x1b7bb800, + 0x003f9009, 0x1821b800, 0x00ffb801, 0x003f0013, + 0xb0010001, 0xb420fff3, 0x93bd0001, 0xb01d0004, + 0xb480ffd7, 0x00ffb81f, 0x00000000, 0x00000000, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815b4b0c, 0x81070000, 0x81270be8, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x812717e8, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a00059, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200006, + 0x039f4193, 0x5b81b81c, 0x003f90cb, 0x1021b81c, + 0x003fb0cb, 0x83840246, 0x829bff80, 0x801300e0, + 0x1434b800, 0x5c35b801, 0x8013001f, 0x1454b800, + 0x5c50b802, 0x8073007f, 0x9863ffff, 0xb002000f, + 0xb4800001, 0x90210001, 0x84210004, 0xb0010000, + 0xb4a00001, 0x6861b803, 0x005f9040, 0x4082b803, + 0x80af001f, 0x808f0000, 0x806f0000, 0x8007ffff, + 0x8033ffff, 0x80171000, 0x81df0000, 0x00000000, + 0x00000000, 0xb600180a, 0xb6002009, 0x58708000, + 0x6068b803, 0x40c4b803, 0x00000000, 0x00c8b806, + 0x00000000, 0x00000000, 0x00000000, 0x5807a026, + 0x81df0004, 0x80670400, 0x5d22b80a, 0x81df0000, + 0x00000000, 0x00000000, 0xb600180a, 0x00cfb803, + 0x013fb0bc, 0x5922b809, 0x01afb809, 0x013f90bc, + 0x0047b86f, 0xb0020001, 0xb4c0fffd, 0x90630020, + 0x91290020, 0x81df0004, 0x808f0000, 0x801b4b14, + 0x80270001, 0xb0000001, 0xb4000002, 0x802600a0, + 0x803e4b14, 0x81270c00, 0xb00a0000, 0xb4000001, + 0x81270000, 0x813e4b0c, 0x80270001, 0x003f2013, + 0x80050086, 0x001fb044, 0x00ffb81b, 0x00000000, + 0x029fb00a, 0x02bfb00b, 0x02dfb00c, 0x02ffb00d, + 0x031fb00e, 0x033fb00f, 0x033f400f, 0x0287b86f, + 0x029fb005, 0x8285009c, 0x96b48000, 0xb0158000, + 0xb4000191, 0x96b40100, 0xb0150100, 0xb40001ad, + 0x96b40400, 0xb0150400, 0xb40001bf, 0x96b40001, + 0xb0150001, 0xb400000c, 0x96b40008, 0xb0150008, + 0xb400019a, 0x96b44000, 0xb0154000, 0xb40001be, + 0x96b40002, 0xb0150002, 0xb400015e, 0x00000000, + 0x00000000, 0xb50001d0, 0x02bf9017, 0x92b50001, + 0x02bfb017, 0x82850082, 0x83050081, 0x82a5009a, + 0x96b50001, 0xb0150001, 0xb4200014, 0x82a70000, + 0x02bfb017, 0x96b41840, 0xb0150800, 0xb420000c, + 0x96b40008, 0x5aa9b815, 0x96d46000, 0x5ec3b816, + 0x82f3000f, 0x9af7c00f, 0x1718b817, 0x1ab5b818, + 0x1ab5b816, 0x9ab50340, 0x82a60081, 0xb500013d, + 0x9b180180, 0x83060081, 0xb500013a, 0x82a5009a, + 0x96b50002, 0xb0150002, 0xb420001b, 0x82a70000, + 0x02bfb017, 0x96b41800, 0xb0151800, 0xb4000013, + 0x96b40040, 0xb0150040, 0xb4200004, 0xa3180c00, + 0x9b180340, 0x83060081, 0xb500012a, 0x96b40008, + 0x5aa9b815, 0x96d46000, 0x5ec3b816, 0x82f3000f, + 0x9af7c00f, 0x1718b817, 0x1ab5b818, 0x1ab5b816, + 0x9ab50340, 0x82a60081, 0xb500011e, 0x9b180180, + 0x83060081, 0xb500011b, 0x82a500c1, 0x96b5000f, + 0xb015000b, 0xb420000e, 0x96b40020, 0xb0150020, + 0xb400000b, 0x96b40200, 0xb0150200, 0xb4000008, + 0x82c50086, 0x82e50094, 0x3016b817, 0xb4400004, + 0x06f7b816, 0xb017ff00, 0xb4400001, 0xb5000109, + 0x96b46000, 0xb0156000, 0xb4000011, 0x96b41820, + 0xb0150820, 0xb4200004, 0x9b391000, 0x82a5009a, + 0x96b5feff, 0x82a6009a, 0x96b40040, 0xb0150040, + 0xb4200001, 0x9739efff, 0x96b91000, 0xb0151000, + 0xb4200003, 0x82a5009a, 0x9ab50100, 0x82a6009a, + 0x96b40040, 0xb0150040, 0xb4200019, 0x96b41800, + 0xb0151800, 0xb4200006, 0x96b98000, 0xb0158000, + 0xb4200003, 0x9b180180, 0x83060081, 0xb50000e9, + 0x96d80c00, 0x82b300ff, 0x9ab5f3ff, 0x1718b815, + 0xb0160c00, 0xb4000007, 0x82e50098, 0x96f70400, + 0xb0170400, 0xb4200002, 0x82c70c00, 0xb5000001, + 0xa2d60c00, 0x1b18b816, 0x9b180340, 0xb50000cf, + 0x96b40220, 0xb0150000, 0xb4e00033, 0x82a5009d, + 0x82f3ffff, 0x16b5b817, 0x82f3000e, 0x3015b817, + 0xb420002d, 0x96f98000, 0xb0178000, 0xb400002a, + 0x82a70000, 0x02bfb017, 0x82c50081, 0x9ab60020, + 0x82a60081, 0x82a50086, 0x92b50bb8, 0x82a60094, + 0x82c60081, 0x82c5009d, 0x96d6ffff, 0x82b30032, + 0x9ab58001, 0x82e500c1, 0x96f7000f, 0xb017000b, + 0xb4000002, 0x82b30022, 0x9ab58001, 0x1ab5b816, + 0x82c5009a, 0x96d60020, 0xb0160020, 0xb4200002, + 0x82b30032, 0x9ab58001, 0x82a6009d, 0x02ff9017, + 0x00000000, 0xb0170040, 0xb480000b, 0x96f41c00, + 0xb0171c00, 0xb4200008, 0x82e50086, 0x82c50094, + 0x92d63000, 0x3016b817, 0xb4400003, 0x9b180180, + 0x83060081, 0xb50000a3, 0x5eb5b814, 0x96b500f0, + 0x96f46000, 0x5eedb817, 0x1ab5b817, 0xb0170003, + 0xb4000004, 0x96b500ef, 0x96f70001, 0x5ae4b817, + 0x1ab5b817, 0x96d41800, 0xb0161800, 0xb400000a, + 0x96f900ff, 0x96b500ff, 0x9739ff00, 0x1b39b815, + 0x02a7b817, 0x96b500f3, 0x96d40008, 0x5ec1b816, + 0x1ab5b816, 0xb500000c, 0x96f98000, 0xb0178000, + 0xb4200007, 0x5efeb814, 0x96f70001, 0xb0170001, + 0xb4000003, 0x9b180180, 0x83060081, 0xb5000081, + 0x96b500f3, 0x9ab50008, 0x9739fff3, 0x96d40020, + 0xb0160020, 0xb4200017, 0x9b398000, 0x82c70000, + 0x02dfb017, 0x96d40010, 0x5ac8b816, 0x82f300ff, + 0x9af7cfff, 0x1718b817, 0x1b18b816, 0x9b180340, + 0x82c5009d, 0x96d6ffff, 0x82f3000e, 0x9af78001, + 0x1af7b816, 0x82c5009a, 0x96d60020, 0xb0160020, + 0xb4200002, 0x82f30032, 0x9af78001, 0x82e6009d, + 0xb500005a, 0x97397fff, 0x96b500ff, 0x5aaab815, + 0x82f300fc, 0x9af703ff, 0x1718b817, 0x1b18b815, + 0x9b180340, 0x82c5009a, 0x96d60010, 0xb0160010, + 0xb4200024, 0x82c70000, 0x02dfb017, 0x82c50086, + 0x92d60bb8, 0x82c60086, 0x82c50094, 0x5eefb818, + 0x96f70003, 0xb0170003, 0xb4200002, 0x82e70bb8, + 0xb5000001, 0x82e70bb8, 0x12d6b817, 0x82e50081, + 0x9af70020, 0x82e60081, 0x82c60094, 0xa2f70020, + 0x82e60081, 0x82f30001, 0x16f7b818, 0x5ef0b817, + 0xb0170001, 0xb4000004, 0x96f84000, 0x5ee4b817, + 0x9718f3ff, 0x1b18b817, 0x82f3000a, 0x9af78000, + 0x82e6009d, 0x83060081, 0x83070001, 0x8306009f, + 0xb50000ad, 0x82c5009d, 0x82f3000e, 0x9af78001, + 0x3016b817, 0xb420000f, 0x82b30032, 0x9ab58001, + 0x82e500c1, 0x96f7000f, 0xb017000b, 0xb4000002, + 0x82b30022, 0x9ab58001, 0x82c5009a, 0x96d60020, + 0xb0160020, 0xb4200002, 0x82b30032, 0x9ab58001, + 0x82a6009d, 0x82c5009a, 0x96d60080, 0xb0160080, + 0xb4000011, 0x02df9017, 0x00000000, 0xb0160010, + 0xb480000d, 0x82c500c1, 0x96d6000f, 0xb016000b, + 0xb4000009, 0x82c50087, 0x96d60080, 0x5ac7b816, + 0x96f84000, 0x3017b816, 0xb4200003, 0x033f400f, + 0x9b394000, 0xb500000b, 0x9739bfff, 0x82e50061, + 0x96f70008, 0xb0170008, 0xb4000005, 0x5eefb818, + 0x96f70003, 0xb0170003, 0xb4000001, 0x9718ffff, + 0x83060081, 0x83070001, 0x8306009f, 0x00000000, + 0xb5000075, 0x82850083, 0x96b400ff, 0xb015003c, + 0xb4200019, 0x96b92000, 0xb0152000, 0xb4000002, + 0x9b392000, 0xb5000014, 0x9739d3ff, 0x82870000, + 0x82860087, 0x82870008, 0x82860083, 0x829bff78, + 0x82a7001f, 0xb0140400, 0xb4000001, 0x82a70010, + 0x82a600c9, 0x829bff78, 0x00000000, 0x828600cb, + 0x8285009d, 0x82b3ffff, 0x9ab5fffd, 0x1694b815, + 0x8286009d, 0xb5000000, 0x83070002, 0x8306009f, + 0x00000000, 0xb5000054, 0x96b90800, 0xb0150800, + 0xb4200009, 0x9739f7ff, 0x82a703fd, 0x82a600cb, + 0x82a7003c, 0x82a60083, 0x8285009d, 0x9a940002, + 0x8286009d, 0xb5000004, 0x82850087, 0x5a82b814, + 0xa2940200, 0x82860087, 0xb5000000, 0x83078000, + 0x8306009f, 0x00000000, 0xb500003f, 0x82850086, + 0x82a50094, 0x3015b814, 0xb4800002, 0x86b50bb8, + 0x82a60086, 0x83070008, 0x8306009f, 0x00000000, + 0xb5000035, 0x83050069, 0x9718003f, 0x82e50064, + 0x12f7b818, 0x86f70088, 0x82feff74, 0x02e7b86f, + 0x9af74000, 0x01ffb817, 0x96f7bfff, 0x01ffb817, + 0x83050081, 0x82f3001c, 0x9af703ff, 0x1718b817, + 0x9b180140, 0x83060081, 0x83070100, 0x8306009f, + 0x00000000, 0xb5000020, 0x83070000, 0x83050081, + 0x9b180180, 0x83060081, 0x83070400, 0x8306009f, + 0x00000000, 0xb5000018, 0x82870000, 0x82850082, + 0x5eb7b814, 0x96b500fc, 0x96d40006, 0x5ec1b816, + 0x1ab5b816, 0x5aacb815, 0x83050081, 0x82d3001c, + 0x9ad600ff, 0x1718b816, 0x1b18b815, 0x9b180e00, + 0x83060081, 0x83074000, 0x8306009f, 0x8305009d, + 0x82d300ff, 0x9ad6bfff, 0x1718b816, 0x8306009d, + 0x00000000, 0xb5000000, 0x029f9005, 0x01ffb814, + 0x033f600f, 0x029f900a, 0x02bf900b, 0x02df900c, + 0x02ff900d, 0x031f900e, 0x033f900f, 0x00ffb81e, + 0x02ff9010, 0x92f70b43, 0x02ffb010, 0x02ff90cb, + 0x82bbffdc, 0x829bffd8, 0x93150004, 0x3014b815, + 0xb4000010, 0x02dbb818, 0x029bb815, 0x3017b816, + 0xb480000c, 0x5a81b814, 0x029fb010, 0x82860095, + 0x8293001f, 0x9294fe00, 0x92b50008, 0x3015b814, + 0xb4800002, 0x82b3001f, 0x92b5fa00, 0x82beffdc, + 0xb500ffeb, 0x029f9010, 0x83250094, 0x06d4b819, + 0x02d6b816, 0xb016ffff, 0xb4a0000a, 0x8293000e, + 0x9a948001, 0x82c5009d, 0x96d6ffff, 0x1a94b816, + 0x82c5009a, 0x96d60010, 0xb0160010, 0xb4000001, + 0x8286009d, 0x00ffb81c, 0x00000000, 0x00000000, + 0x001f9012, 0x001fb100, 0x001f004c, 0x001f2404, + 0x801bfef0, 0x8058fef4, 0x803bff68, 0x8078ff6c, + 0x2000b801, 0x2042b803, 0x001fb104, 0x005f2414, + 0x82e70001, 0x83640048, 0x029fb014, 0x829efef0, + 0x8286000f, 0x02bf2054, 0x82bcfef4, 0x82a6000e, + 0x00ffb81a, 0x80e70001, 0x801336e3, 0x9800eb76, + 0x001fb100, 0x800700ab, 0x001f2404, 0x801bc3e8, + 0x8058c3ec, 0x83640024, 0x82e70000, 0x83640036, + 0x029fb300, 0x029fb100, 0x02bf2c04, 0x02bf2404, + 0x801bc000, 0x8058c004, 0x8364001b, 0x82e70000, + 0x8364002d, 0x001f9300, 0x3000b814, 0xb420000a, + 0x001f0c04, 0x3000b815, 0xb4200007, 0x829efef0, + 0x82bcfef4, 0x029fb012, 0x02bf204c, 0x82870001, + 0x829cfef5, 0x00ffb81a, 0xb0070000, 0xb4000007, + 0x80e70000, 0x801399fa, 0x9800c92e, 0x001fb100, + 0x800700af, 0x001f2404, 0xb500ffdc, 0x82870000, + 0x829cfef5, 0x00ffb81a, 0x80c700ff, 0x803bff68, + 0x8078ff6c, 0x14a0b806, 0x2063b805, 0x007f2414, + 0x2021b802, 0x58c8b806, 0x14a0b806, 0x58b0b805, + 0x2021b805, 0x58c8b806, 0x14a0b806, 0x2021b805, + 0x58c8b806, 0x14a0b806, 0x5cb0b805, 0x2021b805, + 0x003fb104, 0x00ffb81b, 0x82c70000, 0x83070400, + 0x83270005, 0x8197040c, 0x81d7ffff, 0x83840126, + 0x83840001, 0x00ffb81b, 0x808f0000, 0x806f001f, + 0x80af001f, 0x80270140, 0x81e70228, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x80270180, 0x81e70120, 0x5de2b80f, + 0xb6000208, 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, + 0x01cfb80f, 0x01ff90bc, 0xb520ffff, 0x91ef0020, + 0x90210020, 0x8057ffff, 0x80170430, 0x80070410, + 0x80270408, 0xb6000509, 0x005ff000, 0x90420500, + 0x007ff001, 0x90630600, 0x009ff002, 0x00bff003, + 0x2004a025, 0x90000001, 0x90210001, 0x80070414, + 0x80d7ffff, 0x8097045c, 0x8017043c, 0xb6000404, + 0x005ff000, 0x007f87e0, 0x84000001, 0x2082a7e3, + 0x80970460, 0x80170440, 0x2082b803, 0x007f8000, + 0x2083a004, 0x80170430, 0x80970450, 0x80270408, + 0xb6000508, 0x005f8024, 0x90420500, 0x007ff001, + 0x90630600, 0x009ff002, 0x00bff003, 0x2004a025, + 0x90210001, 0x80170440, 0x00000000, 0x02bf87e0, + 0x80970460, 0x82870000, 0xb6000404, 0x005f87e4, + 0x5a88b814, 0x204287e0, 0x1a94b802, 0x00ffb81c, + 0x001f0a49, 0x001f2709, 0x001f0a41, 0x001f2708, + 0x001f0a46, 0x001f2707, 0x001f0a48, 0x001f2706, + 0x001f0a42, 0x001f2705, 0x001f0a47, 0x001f2704, + 0x001f0a45, 0x001f2703, 0x001f0a43, 0x001f2702, + 0x001f0a40, 0x001f2701, 0x001f0a44, 0x001f2700, + 0x001f0c25, 0xa020000c, 0x94400001, 0x94600002, + 0x94810004, 0x94a10008, 0x94c00010, 0x5943b802, + 0x5861b803, 0x5882b804, 0x5ca2b805, 0x5cc4b806, + 0x194ab803, 0x194ab804, 0x194ab805, 0x194ab806, + 0x015f2738, 0x801b0220, 0x003f91c1, 0x5c28b801, + 0x005f91c2, 0x5858b802, 0x1821b802, 0x2000b801, + 0x001fb1c4, 0x80180224, 0x003f0709, 0x2000b801, + 0x001f2714, 0x82c70001, 0x82e70001, 0x83070710, + 0x8327001e, 0x81970735, 0x8384009f, 0x02df0738, + 0x82170a30, 0x838400f1, 0x819efef0, 0x817cfef4, + 0x819eff68, 0x817cff6c, 0x00ffb81b, 0x820f001f, + 0x8018fef8, 0x8057ffff, 0x001f2709, 0x8018fef6, + 0x80d7ffff, 0x001f2708, 0x8018fefa, 0x8157ffff, + 0x001f2707, 0x8018fefd, 0x81d7ffff, 0x001f2706, + 0x8018fefb, 0x802f001f, 0x001f2705, 0x8018fefe, + 0x00000000, 0x001f2704, 0x8018fef9, 0x00000000, + 0x001f2703, 0x8018feff, 0x00000000, 0x001f2702, + 0x8018fef7, 0x00000000, 0x001f2701, 0x8018fefc, + 0x00000000, 0x001f2700, 0x001f0c25, 0xa0200011, + 0x94410001, 0x94600002, 0x94800004, 0x94a00008, + 0x94c10010, 0x5941b802, 0x5861b803, 0x5c82b804, + 0x58a1b805, 0x5cc1b806, 0x194ab803, 0x194ab804, + 0x194ab805, 0x194ab806, 0x015f2738, 0x801b0220, + 0x003f91c1, 0x5c28b801, 0x005f91c2, 0x5858b802, + 0x1821b802, 0x2000b801, 0x001fb1c4, 0x80180224, + 0x003f0709, 0x2000b801, 0x001f2714, 0x82c70001, + 0x82e70001, 0x83070710, 0x8327001e, 0x81970735, + 0x83840055, 0x02df0738, 0x82170a20, 0x838400a7, + 0x819efef0, 0x817cfef4, 0x5ac8b80c, 0x02ff0a44, + 0x1ad6b817, 0x02dfb291, 0x5ed8b80c, 0x5968b80b, + 0x1ad6b80b, 0x02df6524, 0x00ffb81b, 0x820f001f, + 0x8018fefe, 0x8057ffff, 0x001f2709, 0x8018fefa, + 0x80d7ffff, 0x001f2708, 0x8018fefc, 0x8157ffff, + 0x001f2707, 0x8018feff, 0x81d7ffff, 0x001f2706, + 0x8018fef8, 0x802f001f, 0x001f2705, 0x8018fefb, + 0x00000000, 0x001f2704, 0x8018fefd, 0x00000000, + 0x001f2703, 0x8018fef6, 0x00000000, 0x001f2702, + 0x8018fef9, 0x00000000, 0x001f2701, 0x8018fef7, + 0x00000000, 0x001f2700, 0x801b0220, 0x003f91c1, + 0x5c28b801, 0x005f91c2, 0x5858b802, 0x1821b802, + 0x2000b801, 0x001fb1c4, 0x80180224, 0x003f0709, + 0x2000b801, 0x001f2714, 0x82c70001, 0x82e70001, + 0x83070710, 0x8327001e, 0x81970735, 0x83840016, + 0x83270000, 0x831bfef0, 0x82f8fef4, 0x02c7b819, + 0x82170a28, 0x83840065, 0x300cb818, 0xb4200002, + 0x300bb817, 0xb4000006, 0x93390001, 0xb0190020, + 0xb480fff6, 0x83270000, 0x833cfef5, 0x00ffb81b, + 0x019fb290, 0x017f2a44, 0x033f2c25, 0x83270001, + 0x833cfef5, 0x00ffb81b, 0x0007b818, 0x90000003, + 0x00000000, 0x015ff000, 0x90000001, 0x5949b80a, + 0x013ff000, 0x194ab809, 0x84000002, 0x994a0100, + 0x017ff000, 0x958b00f8, 0x5981b80c, 0x956b0007, + 0x198cb80b, 0x84000002, 0x998c0008, 0x017ff000, + 0x90000001, 0x5971b80b, 0x198cb80b, 0x017ff000, + 0x5969b80b, 0x198cb80b, 0x81a70000, 0x94d90003, + 0x82a70000, 0xb6260019, 0xb6000818, 0x5df0b80a, + 0x5e02b80a, 0x21efb810, 0x95ef0001, 0x5941b80a, + 0x194ab80f, 0x21efb816, 0x5e18b80c, 0x5e35b80c, + 0x5e54b80c, 0x5e6cb80c, 0x2210b811, 0x2252b813, + 0x2210b812, 0x96100001, 0x5981b80c, 0x198cb810, + 0x2210b817, 0x10afb810, 0x10a5b80d, 0x5da1b805, + 0x94a50001, 0x5aa1b815, 0x1ab5b805, 0x019fa7f5, + 0x5cc2b819, 0xb626001c, 0x82870000, 0xb6000419, + 0xb6000818, 0x5df0b80a, 0x5e02b80a, 0x21efb810, + 0x95ef0001, 0x5941b80a, 0x194ab80f, 0x21efb816, + 0x5e18b80c, 0x5e35b80c, 0x5e54b80c, 0x5e6cb80c, + 0x2210b811, 0x2252b813, 0x2210b812, 0x96100001, + 0x5981b80c, 0x198cb810, 0x2210b817, 0x10afb810, + 0x10a5b80d, 0x5da1b805, 0x94a50001, 0x5a81b814, + 0x1a94b805, 0x019fa7f4, 0x00ffb81c, 0x8257ffff, + 0x808f0000, 0x806f001f, 0x80af001f, 0x80270200, + 0x81e7ff00, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270240, + 0x81e70000, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x80270180, + 0x81e70120, 0x5de2b80f, 0xb6000208, 0x00cfb801, + 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, 0x01ff90bc, + 0xb520ffff, 0x91ef0020, 0x90210020, 0x806f0007, + 0x80af0007, 0x80270280, 0x81e70100, 0x5de2b80f, + 0x00cfb801, 0x01ffb0bc, 0x59e2b80f, 0x01cfb80f, + 0x01ff90bc, 0xb520ffff, 0x91ef0020, 0x90210020, + 0x80170760, 0x001f0700, 0x001fa020, 0x001f0701, + 0x001fa020, 0x001f0702, 0x001fa020, 0x001f0703, + 0x001fa020, 0x001f0704, 0x001fa000, 0x80970750, + 0x81170770, 0x82a70735, 0x83a40060, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4005c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a70730, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40050, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a4004c, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a7072b, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a40040, 0x83a4004e, + 0xb6000407, 0x86b50001, 0x83a4003c, 0x001f8004, + 0x003f87e8, 0x2080a001, 0x83a40047, 0x00000000, + 0x80970770, 0x80170750, 0x81170750, 0x81970740, + 0x82a70726, 0x001f800c, 0x003f8008, 0x2100a001, + 0x83a4002e, 0x83a4003c, 0xb6000407, 0x86b50001, + 0x83a4002a, 0x001f8004, 0x003f87e8, 0x2080a001, + 0x83a40035, 0x00000000, 0x80970750, 0x80170770, + 0x81170770, 0x81970760, 0x82a70721, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4001c, 0x001f87e4, + 0xb6000405, 0x86b50001, 0x83a40018, 0x001f8004, + 0x003f87e8, 0x2080a7e1, 0x80970770, 0x80170750, + 0x81170750, 0x81970740, 0x82a7071c, 0x001f800c, + 0x003f8008, 0x2100a001, 0x83a4000c, 0x017f87e4, + 0x81870000, 0xb6000406, 0x86b50001, 0x83a40007, + 0x001f87e4, 0x200087e8, 0x5988b80c, 0x198cb800, + 0x021fa02c, 0x021fa00b, 0x00ffb81c, 0x005ff015, + 0x90420600, 0x003f87e0, 0x001ff002, 0x2060b801, + 0x90630800, 0x90960a00, 0x001ff003, 0x003ff004, + 0x20a0b801, 0x90a50900, 0x00000000, 0x001ff005, + 0x009fa000, 0x00ffb81d, 0x001f8004, 0x5c21b800, + 0x5847b800, 0x1821b802, 0x942100ff, 0x2080a7e1, + 0x00ffb81d, 0x00000000, 0x00000000, 0x00000000, + 0x829bff80, 0x80af000f, 0x808f0000, 0x806f0000, + 0x82bbffec, 0x82fbffe4, 0x00000000, 0x82beffb8, + 0x95540700, 0x5d48b80a, 0x914a0001, 0x0227b80a, + 0x94343000, 0x5c2cb801, 0xb0010000, 0xb4000001, + 0x5a21b811, 0x9574c000, 0x5d6eb80b, 0x918b4b08, + 0x01b8b80c, 0x96d5ffff, 0x5ec2b816, 0x96f7ffff, + 0x5ee2b817, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x81f3ff00, 0x99efff00, 0x821300ff, + 0x9a1000ff, 0x81971000, 0x82670000, 0x82470000, + 0x80270280, 0x81df0000, 0x00000000, 0x00000000, + 0xb62d000d, 0x3016b817, 0xb4800001, 0x86d62800, + 0x00cfb801, 0x02dfb0bc, 0x5ac2b816, 0x01cfb816, + 0x02df90bc, 0x0067b86f, 0xb0030001, 0xb4c0fffd, + 0x92d60010, 0x90210010, 0x81df0004, 0x80170a00, + 0x81df0000, 0x00000000, 0x00000000, 0xb62d0006, + 0xb6001005, 0x146f8000, 0x14908000, 0x5c68b803, + 0x5888b804, 0x1803a024, 0x81df0004, 0x80170a00, + 0x80970d00, 0xb00b0000, 0xb4000004, 0xb00b0001, + 0xb400000a, 0xb00b0002, 0xb4000027, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004002, 0x007f8020, + 0x009fa023, 0x81df0004, 0xb5000029, 0x80d3ffff, + 0x81df0000, 0x00000000, 0x00000000, 0xb6001018, + 0x5c648000, 0x9463ffff, 0x5c888020, 0x58b88000, + 0x1884b805, 0x1484b806, 0x1883a024, 0x5c6c8020, + 0x9463ffff, 0x58908000, 0x1883a024, 0x5c748020, + 0x588c8000, 0x1863b804, 0x9463ffff, 0x58888000, + 0x1484b806, 0x1883a024, 0x5c7c8020, 0x58848000, + 0x1863b804, 0x9463ffff, 0x14868020, 0x1883a024, + 0x81df0004, 0xb500000a, 0x80d3ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6002004, 0x007f8020, + 0x009fa023, 0x007f8040, 0x009fa023, 0x81df0004, + 0x00000000, 0x81170d00, 0x80070000, 0x94343000, + 0x5c2cb801, 0xb0010001, 0xb4000099, 0xb00a0001, + 0xb400000e, 0xb00a0002, 0xb4000022, 0xb00a0003, + 0xb400002f, 0xb00a0004, 0xb400005d, 0xb00a0005, + 0xb4000066, 0xb00a0006, 0xb400008a, 0xb00a0007, + 0xb4000088, 0xb00a0008, 0xb4000086, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004010, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x019fa020, 0x019fa020, 0x019fa020, 0x5c708028, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x019fa020, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000070, 0x81df0000, 0x00000000, 0x00000000, + 0x8027ffff, 0xb6004008, 0x14618008, 0x019fa023, + 0x019fa020, 0x019fa020, 0x5c708028, 0x019fa023, + 0x019fa020, 0x019fa020, 0x81df0004, 0xb5000061, + 0xb0130000, 0xb4000004, 0xb0130001, 0xb4000009, + 0xb0130002, 0xb400001a, 0x83a40102, 0x80170f00, + 0x007f8028, 0x001fa023, 0x007f8028, 0x001fa023, + 0xb5000054, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8000, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708020, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a400ed, + 0x80170f00, 0x007f8028, 0x001fa023, 0xb5000041, + 0x80170f00, 0x00000000, 0x007f8020, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x019fa020, 0x83a400da, 0xb5000031, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002005, + 0x007f8008, 0x019fa023, 0x007f8008, 0x019fa023, + 0x019fa020, 0x81df0004, 0xb5000026, 0xb0130000, + 0xb4000008, 0xb0130001, 0xb4000012, 0xb0130002, + 0xb400001f, 0xb0130003, 0xb400001d, 0xb0130004, + 0xb400001b, 0x83a400d5, 0x007f8028, 0x019fa023, + 0x007f8028, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000010, 0x80170f00, 0x00000000, 0x5c708020, + 0x58908008, 0x1983a024, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x83a400bf, + 0x80170f00, 0x007f8028, 0x001fa023, 0xb5000001, + 0xb5000000, 0x00000000, 0x00000000, 0xb500008e, + 0xb00a0001, 0xb400000e, 0xb00a0002, 0xb400001a, + 0xb00a0003, 0xb4000027, 0xb00a0004, 0xb4000055, + 0xb00a0005, 0xb400005e, 0xb00a0006, 0xb4000082, + 0xb00a0007, 0xb4000080, 0xb00a0008, 0xb400007e, + 0x81df0000, 0x00000000, 0x00000000, 0xb6004008, + 0x007f8028, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x019fa020, 0x019fa020, 0x019fa020, 0x019fa020, + 0x81df0004, 0xb5000070, 0x81df0000, 0x00000000, + 0x00000000, 0x8027ffff, 0xb6002008, 0x14618008, + 0x019fa023, 0x019fa020, 0x019fa020, 0x5c708048, + 0x019fa023, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000061, 0xb0130000, 0xb4000004, 0xb0130001, + 0xb4000009, 0xb0130002, 0xb400001a, 0x83a40098, + 0x80170f00, 0x007f8028, 0x001fa023, 0x007f8028, + 0x001fa023, 0xb5000054, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8000, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708020, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a40083, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000041, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8008, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a40070, + 0xb5000031, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002005, 0x007f8008, 0x019fa023, 0x007f8008, + 0x019fa023, 0x019fa020, 0x81df0004, 0xb5000026, + 0xb0130000, 0xb4000008, 0xb0130001, 0xb4000012, + 0xb0130002, 0xb400001f, 0xb0130003, 0xb400001d, + 0xb0130004, 0xb400001b, 0x83a4006b, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000010, 0x80170f00, 0x00000000, + 0x5c708020, 0x58908008, 0x1983a024, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x83a40055, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000001, 0xb5000000, 0x92730001, 0x92520001, + 0x3012b811, 0xb480fe76, 0x003f0324, 0x90210001, + 0xb0010006, 0xb4a00001, 0x80270001, 0x003f2324, + 0x2c8db811, 0x803bffe0, 0x805bffe4, 0x5886b804, + 0x1015b804, 0xad440003, 0x3000b802, 0xb4800001, + 0x8400a000, 0x801effec, 0x015f6193, 0x809e4b04, + 0x00ffb81f, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002a0c, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x81df0004, 0x00ffb81d, 0x81df0000, + 0x00000000, 0x00000000, 0xb600190f, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x81df0004, 0x00ffb81d, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002a0c, + 0x007f8028, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x81df0004, 0x00ffb81d, 0x81df0000, 0x00000000, + 0x00000000, 0xb600190f, 0x007f8028, 0x019fa023, + 0x007f8028, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x81df0004, 0x00ffb81d, 0x00000000, + 0x829bff80, 0x80af001f, 0x808f0000, 0x806f0000, + 0x82bbffec, 0x82fbffe4, 0x00000000, 0x82beffb8, + 0x95540700, 0x5d48b80a, 0x914a0001, 0x0227b80a, + 0x94343000, 0x5c2cb801, 0xb0010000, 0xb4000001, + 0x5a21b811, 0x9574c000, 0x5d6eb80b, 0x918b4b08, + 0x01b8b80c, 0x96d5ffff, 0x5ec2b816, 0x96f7ffff, + 0x5ee2b817, 0x8057ffff, 0x80d7ffff, 0x8157ffff, + 0x81d7ffff, 0x81f3ff00, 0x99efff00, 0x821300ff, + 0x9a1000ff, 0x81971000, 0x82670000, 0x82470000, + 0x80270280, 0x81df0000, 0x00000000, 0x00000000, + 0xb62d000d, 0x3016b817, 0xb4800001, 0x86d62800, + 0x00cfb801, 0x02dfb0bc, 0x5ac2b816, 0x01cfb816, + 0x02df90bc, 0x0067b86f, 0xb0030001, 0xb4c0fffd, + 0x92d60020, 0x90210020, 0x81df0004, 0x80170a00, + 0x81df0000, 0x00000000, 0x00000000, 0xb62d0006, + 0xb6002005, 0x146f8000, 0x14908000, 0x5c68b803, + 0x5888b804, 0x1803a024, 0x81df0004, 0x80170a00, + 0x80970d00, 0xb00b0000, 0xb4000004, 0xb00b0001, + 0xb400000a, 0xb00b0002, 0xb4000027, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008002, 0x007f8020, + 0x009fa023, 0x81df0004, 0xb5000029, 0x80d3ffff, + 0x81df0000, 0x00000000, 0x00000000, 0xb6002018, + 0x5c648000, 0x9463ffff, 0x5c888020, 0x58b88000, + 0x1884b805, 0x1484b806, 0x1883a024, 0x5c6c8020, + 0x9463ffff, 0x58908000, 0x1883a024, 0x5c748020, + 0x588c8000, 0x1863b804, 0x9463ffff, 0x58888000, + 0x1484b806, 0x1883a024, 0x5c7c8020, 0x58848000, + 0x1863b804, 0x9463ffff, 0x14868020, 0x1883a024, + 0x81df0004, 0xb500000a, 0x80d3ffff, 0x81df0000, + 0x00000000, 0x00000000, 0xb6004004, 0x007f8020, + 0x009fa023, 0x007f8040, 0x009fa023, 0x81df0004, + 0x00000000, 0x81170d00, 0x80070000, 0x94343000, + 0x5c2cb801, 0xb0010001, 0xb400008e, 0xb00a0001, + 0xb400000e, 0xb00a0002, 0xb400001c, 0xb00a0003, + 0xb4000024, 0xb00a0004, 0xb4000052, 0xb00a0005, + 0xb400005b, 0xb00a0006, 0xb400007f, 0xb00a0007, + 0xb400007d, 0xb00a0008, 0xb400007b, 0x81df0000, + 0x00000000, 0x00000000, 0xb600800a, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x019fa020, + 0x5c708028, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x019fa020, 0x81df0004, 0xb500006b, 0x81df0000, + 0x00000000, 0x00000000, 0xb6008004, 0x007f8028, + 0x019fa023, 0x019fa020, 0x019fa020, 0x81df0004, + 0xb5000061, 0xb0130000, 0xb4000004, 0xb0130001, + 0xb4000009, 0xb0130002, 0xb400001a, 0x83a400fa, + 0x80170f00, 0x007f8028, 0x001fa023, 0x007f8028, + 0x001fa023, 0xb5000054, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8000, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708020, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a400e5, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000041, 0x80170f00, 0x00000000, 0x007f8020, + 0x019fa023, 0x007f8008, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x019fa020, 0x83a400d2, + 0xb5000031, 0x81df0000, 0x00000000, 0x00000000, + 0xb6004005, 0x007f8008, 0x019fa023, 0x007f8008, + 0x019fa023, 0x019fa020, 0x81df0004, 0xb5000026, + 0xb0130000, 0xb4000008, 0xb0130001, 0xb4000012, + 0xb0130002, 0xb400001f, 0xb0130003, 0xb400001d, + 0xb0130004, 0xb400001b, 0x83a400cd, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000010, 0x80170f00, 0x00000000, + 0x5c708020, 0x58908008, 0x1983a024, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x83a400b7, 0x80170f00, 0x007f8028, 0x001fa023, + 0xb5000001, 0xb5000000, 0x00000000, 0x00000000, + 0xb5000086, 0xb00a0001, 0xb400000e, 0xb00a0002, + 0xb4000017, 0xb00a0003, 0xb400001f, 0xb00a0004, + 0xb400004d, 0xb00a0005, 0xb4000056, 0xb00a0006, + 0xb400007a, 0xb00a0007, 0xb4000078, 0xb00a0008, + 0xb4000076, 0x81df0000, 0x00000000, 0x00000000, + 0xb6008005, 0x007f8028, 0x9463ffff, 0x019fa023, + 0x019fa020, 0x019fa020, 0x81df0004, 0xb500006b, + 0x81df0000, 0x00000000, 0x00000000, 0xb6004004, + 0x007f8048, 0x019fa023, 0x019fa020, 0x019fa020, + 0x81df0004, 0xb5000061, 0xb0130000, 0xb4000004, + 0xb0130001, 0xb4000009, 0xb0130002, 0xb400001a, + 0x83a40098, 0x80170f00, 0x007f8028, 0x001fa023, + 0x007f8028, 0x001fa023, 0xb5000054, 0x80170f00, + 0x00000000, 0x007f8020, 0x019fa023, 0x007f8000, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708020, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x83a40083, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000041, 0x80170f00, 0x00000000, + 0x007f8020, 0x019fa023, 0x007f8008, 0x9463ffff, + 0x019fa023, 0x019fa020, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x019fa020, + 0x83a40070, 0xb5000031, 0x81df0000, 0x00000000, + 0x00000000, 0xb6004005, 0x007f8008, 0x019fa023, + 0x007f8008, 0x019fa023, 0x019fa020, 0x81df0004, + 0xb5000026, 0xb0130000, 0xb4000008, 0xb0130001, + 0xb4000012, 0xb0130002, 0xb400001f, 0xb0130003, + 0xb400001d, 0xb0130004, 0xb400001b, 0x83a4006b, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x80170f00, + 0x007f8028, 0x001fa023, 0xb5000010, 0x80170f00, + 0x00000000, 0x5c708020, 0x58908008, 0x1983a024, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x83a40055, 0x80170f00, 0x007f8028, + 0x001fa023, 0xb5000001, 0xb5000000, 0x92730001, + 0x92520001, 0x3012b811, 0xb480fe89, 0x003f0324, + 0x90210001, 0xb0010006, 0xb4a00001, 0x80270001, + 0x003f2324, 0x2c8db811, 0x803bffe0, 0x805bffe4, + 0x5887b804, 0x1015b804, 0xad440003, 0x3000b802, + 0xb4800001, 0x8400a000, 0x801effec, 0x015f6193, + 0x809e4b04, 0x00ffb81f, 0x81df0000, 0x00000000, + 0x00000000, 0xb6002a0c, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x019fa020, + 0x5c708028, 0x58908008, 0x1983a024, 0x5c708028, + 0x019fa023, 0x019fa020, 0x81df0004, 0x00ffb81d, + 0x81df0000, 0x00000000, 0x00000000, 0xb600190f, + 0x007f8028, 0x019fa023, 0x007f8028, 0x019fa023, + 0x007f8008, 0x9463ffff, 0x019fa023, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x019fa023, 0x81df0004, + 0x00ffb81d, 0x81df0000, 0x00000000, 0x00000000, + 0xb6002a0c, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x019fa020, 0x5c708028, + 0x58908008, 0x1983a024, 0x5c708028, 0x019fa023, + 0x019fa020, 0x81df0004, 0x00ffb81d, 0x81df0000, + 0x00000000, 0x00000000, 0xb600190f, 0x007f8028, + 0x019fa023, 0x007f8028, 0x019fa023, 0x007f8008, + 0x9463ffff, 0x019fa023, 0x5c708028, 0x58908008, + 0x1983a024, 0x5c708028, 0x58908008, 0x1983a024, + 0x5c708028, 0x019fa023, 0x81df0004, 0x00ffb81d, + 0x003f03f9, 0x009f0324, 0x84840001, 0xb0010000, + 0xb4000011, 0x815b4b0c, 0x81070000, 0x81270be8, + 0xb00a0000, 0xb4000002, 0x81070c00, 0x812717e8, + 0x802500a5, 0x806500a5, 0x3001b803, 0xb420fffc, + 0x9421ffff, 0x3001b808, 0xb480000b, 0x3001b809, + 0xb4a00060, 0xb5000008, 0xb0040000, 0xb4200003, + 0x802717ff, 0x81470000, 0xb5000003, 0x80270001, + 0x003f23f9, 0x81470c00, 0xb0040000, 0xb4200006, + 0x039f4193, 0x5b81b81c, 0x003f90cb, 0x1021b81c, + 0x003fb0cb, 0x8384f90e, 0x829bff80, 0x801300e0, + 0x1434b800, 0x5c35b801, 0x8013001f, 0x1454b800, + 0x5c50b802, 0x8073007f, 0x9863ffff, 0xb002000f, + 0xb4800001, 0x90210001, 0x84210004, 0xb0010000, + 0xb4a00001, 0x6861b803, 0x005f9040, 0x4082b803, + 0x80af001f, 0x808f0000, 0x806f0000, 0x8007ffff, + 0x8033ffff, 0x80171000, 0x81df0000, 0x00000000, + 0x00000000, 0xb6001811, 0xb6002010, 0x14618000, + 0x6068b803, 0x40c4b803, 0x14608000, 0x00c8b806, + 0x5870b803, 0x6068b803, 0x4104b803, 0x58c8b806, + 0x0108b808, 0x14c6b801, 0x00000000, 0x00000000, + 0x5d08b808, 0x1508b800, 0x1806a028, 0x81df0004, + 0x80670400, 0x5d22b80a, 0x81df0000, 0x00000000, + 0x00000000, 0xb600180a, 0x00cfb803, 0x013fb0bc, + 0x5922b809, 0x01afb809, 0x013f90bc, 0x0047b86f, + 0xb0020001, 0xb4c0fffd, 0x90630020, 0x91290020, + 0x81df0004, 0x808f0000, 0x801b4b14, 0x80270001, + 0xb0000001, 0xb4000002, 0x802600a0, 0x803e4b14, + 0x81270c00, 0xb00a0000, 0xb4000001, 0x81270000, + 0x813e4b0c, 0x80270001, 0x003f2013, 0x80050086, + 0x001fb044, 0x00ffb81b, 0x00000000, 0x00000000, +}; + +static u32 PCMI2SUcode1f4b00[] = { + 0x00000000, 0x00000000, 0x00060504, 0x00000000, + 0x00000000, 0x00000000, 0x00300000, 0xffcfcfff, + 0x00302000, 0xffcfcfff, 0x00380000, 0xffc7c7ff, + 0xcbcecdc4, 0xcfcac9c8, 0xc3c6c5cc, 0xc7c2c1c0, + 0x1b1e1d14, 0x1f1a1918, 0x1316151c, 0x17121110, + 0x2b2e2d24, 0x2f2a2928, 0x2326252c, 0x27222120, + 0x3b3e3d34, 0x3f3a3938, 0x3336353c, 0x37323130, + 0x0b0e0d04, 0x0f0a0908, 0x0306050c, 0x07020100, + 0xdbdeddd4, 0xdfdad9d8, 0xd3d6d5dc, 0xd7d2d1d0, + 0xebeeede4, 0xefeae9e8, 0xe3e6e5ec, 0xe7e2e1e0, + 0xfbfefdf4, 0xfffaf9f8, 0xf3f6f5fc, 0xf7f2f1f0, + 0x4b4e4d44, 0x4f4a4948, 0x4346454c, 0x47424140, + 0x9b9e9d94, 0x9f9a9998, 0x9396959c, 0x97929190, + 0xabaeada4, 0xafaaa9a8, 0xa3a6a5ac, 0xa7a2a1a0, + 0xbbbebdb4, 0xbfbab9b8, 0xb3b6b5bc, 0xb7b2b1b0, + 0x8b8e8d84, 0x8f8a8988, 0x8386858c, 0x87828180, + 0x5b5e5d54, 0x5f5a5958, 0x5356555c, 0x57525150, + 0x6b6e6d64, 0x6f6a6968, 0x6366656c, 0x67626160, + 0x7b7e7d74, 0x7f7a7978, 0x7376757c, 0x77727170, + 0x341424c4, 0x3e1e2ece, 0x3d1d2dcd, 0x3b1b2bcb, + 0xb494a444, 0xbe9eae4e, 0xbd9dad4d, 0xbb9bab4b, + 0xf4d4e404, 0xfedeee0e, 0xfddded0d, 0xfbdbeb0b, + 0x74546484, 0x7e5e6e8e, 0x7d5d6d8d, 0x7b5b6b8b, + 0x3c1c2ccc, 0x361626c6, 0x351525c5, 0x331323c3, + 0xbc9cac4c, 0xb696a646, 0xb595a545, 0xb393a343, + 0xfcdcec0c, 0xf6d6e606, 0xf5d5e505, 0xf3d3e303, + 0x7c5c6c8c, 0x76566686, 0x75556585, 0x73536383, + 0x381828c8, 0x3a1a2aca, 0x391929c9, 0x3f1f2fcf, + 0xb898a848, 0xba9aaa4a, 0xb999a949, 0xbf9faf4f, + 0xf8d8e808, 0xfadaea0a, 0xf9d9e909, 0xffdfef0f, + 0x78586888, 0x7a5a6a8a, 0x79596989, 0x7f5f6f8f, + 0x301020c0, 0x321222c2, 0x311121c1, 0x371727c7, + 0xb090a040, 0xb292a242, 0xb191a141, 0xb797a747, + 0xf0d0e000, 0xf2d2e202, 0xf1d1e101, 0xf7d7e707, + 0x70506080, 0x72526282, 0x71516181, 0x77576787, + 0x05040100, 0x15141110, 0x25242120, 0x35343130, + 0x85848180, 0x95949190, 0xa5a4a1a0, 0xb5b4b1b0, + 0xc0408000, 0xe060a020, 0xd0509010, 0xf070b030, + 0xc8488808, 0xe868a828, 0xd8589818, 0xf878b838, + 0xc4448404, 0xe464a424, 0xd4549414, 0xf474b434, + 0xcc4c8c0c, 0xec6cac2c, 0xdc5c9c1c, 0xfc7cbc3c, + 0xc2428202, 0xe262a222, 0xd2529212, 0xf272b232, + 0xca4a8a0a, 0xea6aaa2a, 0xda5a9a1a, 0xfa7aba3a, + 0xc6468606, 0xe666a626, 0xd6569616, 0xf676b636, + 0xce4e8e0e, 0xee6eae2e, 0xde5e9e1e, 0xfe7ebe3e, + 0xc1418101, 0xe161a121, 0xd1519111, 0xf171b131, + 0xc9498909, 0xe969a929, 0xd9599919, 0xf979b939, + 0xc5458505, 0xe565a525, 0xd5559515, 0xf575b535, + 0xcd4d8d0d, 0xed6dad2d, 0xdd5d9d1d, 0xfd7dbd3d, + 0xc3438303, 0xe363a323, 0xd3539313, 0xf373b333, + 0xcb4b8b0b, 0xeb6bab2b, 0xdb5b9b1b, 0xfb7bbb3b, + 0xc7478707, 0xe767a727, 0xd7579717, 0xf777b737, + 0xcf4f8f0f, 0xef6faf2f, 0xdf5f9f1f, 0xff7fbf3f, + 0x1045a3e2, 0x000000f4, 0x263b7333, 0x766b2363, + 0x2b367e3e, 0x7b662e6e, 0x06db93d3, 0x964b0343, + 0x0bd69ede, 0x9b460e4e, 0x825f1757, 0x12cf87c7, + 0x8f521a5a, 0x1fc28aca, 0x00d199d9, 0x90410949, + 0x01d098d8, 0x91400848, 0x24357d3d, 0x74652d6d, + 0x25347c3c, 0x75642c6c, 0x04d59ddd, 0x94450d4d, + 0x05d49cdc, 0x95440c4c, 0x80511959, 0x10c189c9, + 0x81501858, 0x11c088c8, 0x02df97d7, 0x924f0747, + 0x0fd29ada, 0x9f420a4a, 0x865b1353, 0x16cb83c3, + 0x8b561e5e, 0x1bc68ece, 0xa6bbf3b3, 0xf6eba3e3, + 0xabb6febe, 0xfbe6aeee, 0x223f7737, 0x726f2767, + 0x2f327a3a, 0x7f622a6a, 0xa0b1f9b9, 0xf0e1a9e9, + 0xa1b0f8b8, 0xf1e0a8e8, 0x84551d5d, 0x14c58dcd, + 0x85541c5c, 0x15c48ccc, 0xa4b5fdbd, 0xf4e5aded, + 0xa5b4fcbc, 0xf5e4acec, 0x20317939, 0x70612969, + 0x21307838, 0x71602868, 0xa2bff7b7, 0xf2efa7e7, + 0xafb2faba, 0xffe2aaea, 0x00000000, 0x00000000, +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/luxsonor.c linux.20pre5-ac2/drivers/media/video/luxsonor.c --- linux.20pre5/drivers/media/video/luxsonor.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/luxsonor.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,2123 @@ +/* + * Luxsonor LS220/LS240 series DVD/Mpeg card drivers + * + * (c) Copyright 2002 Red Hat + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Made possible by Luxsonor's rather nice gesture of publishing their + * windows code to allow people to write new drivers based on it. + * + * The firmware is (c) Copyright Luxsonor and a seperate program run + * on the dsp not part of Linux itself. + * + * Note: the hardware css is not supported as Luxsonor decided not to + * document it even though the chip can do all the work. The citizens + * of free countries will need to use software decryption to play such + * films via the card. US citizens should simply report to the district + * attorney for termination. + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/* + * Firmware modules + */ + +#include "ls220/ac3.h" +#include "ls220/ac3_240.h" +#include "ls220/ac3i2s.h" +#include "ls220/ac3i2s_240.h" + +#include "ls220/mpg.h" +#include "ls220/mpg_240.h" +#include "ls220/mpgi2s.h" +#include "ls220/mpgi2s_240.h" + +#include "ls220/pcm.h" +#include "ls220/pcm_240.h" +#include "ls220/pcmi2s.h" +#include "ls220/pcmi2s_240.h" + +/* + * Board types + */ + +#define LS220C 0 +#define LS220D 1 +#define LS240 2 + +static char *lux_names[3] = { "LS220C", "LS220D", "LS240" }; + +/* + * TV encoder types + */ + +#define BT865 0 +#define BT864 1 +#define SAA7120 2 +#define SAA7121 3 +#define AD7175 4 +#define AD7176 5 +#define CS4953 6 +#define CS4952 7 +#define HS8171 8 +#define HS8170 9 + +static char *lux_tv_names[10] = { + "BT865", "BT864", "SAA7120", "SAA7121", "AD7175", + "AD7176", "CS4953", "CS4952", "HS8171", "HS8170" +}; + +/* + * EEPROM bytes + */ + +#define EPROM_REGION 0x4 +#define EPROM_REGION_COUNT 0x5 +#define EPROM_PARENTAL 0x6 +#define EPROM_BOARDTYPE 0x7 +#define EPROM_CLOCKTYPE 0x8 +#define EPROM_I2S 0x9 +#define EPROM_SPDIF_CH 0xa +#define EPROM_SPDIF_ONOFF 0xb +#define EPROM_TVOUT 0xc +#define EPROM_LEFT_CH_POL 0xf + +/* + * Registers + */ + +/* -- for field lock use -- */ +#define CHANGE_MPGVID_CONTROL +#define CHANGE_REG274 +#define DO_NOT_TOUCH_REG324 + + +#define LS220_DRAM_BASE 0x200000L +#define LS240_DRAM_BASE 0x400000L + +#define DRAM_BASE(dev) ((dev)->dram_base) + +#define VID_FIFO_OFF 0x1a3000L +#define VID_FIFO_LEN 0x3e000L +#define PTS_FIFO_OFF 0x1a2800L +#define PTS_FIFO_LEN 0x800L +#define SUB_FIFO_OFF 0x1e2000L +#define OSD_FIFO_OFF 0x1e1000L +#define OSD_FIFO_LEN 0x1000L +#define LS220_VID_FIFO(dev) (dev->dram_base+VID_FIFO_OFF) + +#define DSPMEM_BASE(dev) (dev->dram_base+0x1f0000L) +#define DSPPROG_BASE(dev) (DSPMEM_BASE(dev)-dev->dram_base) +#define DSPPROG_OFF 0x1800L +#define DSPPROG_SIZE 0x6000L + + +#define AUD_FIFO_LEN 0x2000L +#define AUD_FIFO_OFF 0x1fc000L +#define AUD_PTS_LEN 0x400L +#define AUD_PTS_OFF 0x1ffa00L + +/* Subpict definition */ +#define FIFO_SIZE 8 /* PTS FIFO entry count */ +#define HIGH_FIFO 32 /* HighLight Fifo size */ +#define SCRM_FIFO 0x800 /* Scramble buffer size */ +#define SPBLOCK ( 0xE000 - HIGH_FIFO - SCRM_FIFO ) /* 56K - 32 bytes - 2k */ +#define SubBLOCK 0xE00 /* PTS + DCI = 3.5K */ +#define DCIBLOCK ( SubBLOCK - 8*FIFO_SIZE ) +#define PxdBLOCK ( SPBLOCK - SubBLOCK ) +#define FStart 0x20 /* PTS FIFO Start Address */ + +#define SUBBASE(dev) ( DRAM_BASE(dev) + SUB_FIFO_OFF ) + +#define LS220_DSP_REG 0x100L +#define LS220_MPG_REG 0x180L +#define LS220_SYNC_REG 0x200L +#define LS220_PCM_REG 0x280L +#define LS220_VID_REG 0x300L + +/* SYNC REGS */ +#define SYNC_AUD_CONTROL (LS220_SYNC_REG+0x00) +#define SYNC_VID_CONTROL (LS220_SYNC_REG+0x04) +#define SYNC_WAIT_LINE (LS220_SYNC_REG+0x0c) +#define SYNC_FRAME_PERIOD (LS220_SYNC_REG+0x10) +#define SYNC_STC (LS220_SYNC_REG+0x18) +#define PTS_FIFO_START (LS220_SYNC_REG+0x20) +#define PTS_FIFO_END (LS220_SYNC_REG+0x24) +#define PTS_FIFO_WRITE (LS220_SYNC_REG+0x28) +#define PTS_FIFO_READ (LS220_SYNC_REG+0x2c) +#define SYNC_VIDEO_PTS (LS220_SYNC_REG+0x50) +#define SYNC_INT_CTRL (LS220_SYNC_REG+0x74) +#define SYNC_INT_FORCE (LS220_SYNC_REG+0x78) + +/* MPEG VIDEO REGS */ +#define MPGVID_CONTROL (LS220_MPG_REG+0x0) +#define MPGVID_SETUP (LS220_MPG_REG+0x4) +#define MPGVID_FIFO_START (LS220_MPG_REG+0x8) +#define MPGVID_FIFO_END (LS220_MPG_REG+0xc) +#define MPGVID_FIFO_POS (LS220_MPG_REG+0x10) +#define MPGVID_FIFO_FORCE (LS220_MPG_REG+0x14) +#define MPGVID_FIFO_ADDBLOCK (LS220_MPG_REG+0x18) +#define MPGVID_FIFO_BYTES (LS220_MPG_REG+0x1c) +#define MPGVID_FIFO_INTLEVEL (LS220_MPG_REG+0x20) +#define MPGVID_TOTAL_BYTES (LS220_MPG_REG+0x24) +#define MPGVID_ERROR (LS220_MPG_REG+0x28) +#define MPGVID_MB_WIDTH (LS220_MPG_REG+0x2c) +#define MPGVID_MB_HEIGHT (LS220_MPG_REG+0x30) +#define MPGVID_DEBUG1 (LS220_MPG_REG+0x38) +#define MPGVID_DEBUG2 (LS220_MPG_REG+0x3c) + +/* VID_REG */ +#define VIDP_GPIO (LS220_VID_REG+0x50) + +/* PCM REG */ +#define PCM_FREQ_CONTROL (LS220_PCM_REG+0x0) +#define PCM_OUTPUT_CONTROL (LS220_PCM_REG+0x4) +#define PCM_FIFO_START (LS220_PCM_REG+0x8) +#define PCM_FIFO_END (LS220_PCM_REG+0xc) + +/* DSP REGS */ +#define DSP_CODE_ADDR (LS220_DSP_REG+0x0) + +/* DSP INTERAL MEMORY */ + +#define DSPMEM_DRV_RET(dev) (DSPMEM_BASE(dev)+0xfef0L) +#define DSPMEM_ACC(dev) (DSPMEM_BASE(dev)+0xfef5L) +#define DSPMEM_ACC4(dev) (DSPMEM_BASE(dev)+0xfef4L) +#define DSPMEM_CHAL_KEY(dev) (DSPMEM_BASE(dev)+0xfef6L) + +#define DSPMEM_LOCK(dev) (DSPMEM_BASE(dev)+0xff78L) + +#define DSPMEM_AUDIO_CONF(dev) (DSPMEM_BASE(dev)+0xff7cL) +#define DSPMEM_AC3_CONF(dev) (DSPMEM_BASE(dev)+0xff80L) + +#define DSPMEM_KARAOKE(dev) (DSPMEM_BASE(dev)+0xff8c) + +#define DSPMEM_INT_MASK(dev) (DSPMEM_BASE(dev)+0xffa4L) +#define DSPMEM_INT_STATUS(dev) (DSPMEM_BASE(dev)+0xffa8L) +#define DSPMEM_INT_THREHOLD(dev) (DSPMEM_BASE(dev)+0xffacL) + +#define DSPMEM_VOLUME_LEVEL(dev) (DSPMEM_BASE(dev)+0xffb0L) + +#define DSPMEM_PTS_START(dev) (DSPMEM_BASE(dev)+0xffd0L) +#define DSPMEM_PTS_END(dev) (DSPMEM_BASE(dev)+0xffd4L) +#define DSPMEM_PTS_WR(dev) (DSPMEM_BASE(dev)+0xffd8L) +#define DSPMEM_PTS_RD(dev) (DSPMEM_BASE(dev)+0xffdcL) + +#define DSPMEM_FIFO_START(dev) (DSPMEM_BASE(dev)+0xffe0L) +#define DSPMEM_FIFO_END(dev) (DSPMEM_BASE(dev)+0xffe4L) +#define DSPMEM_FIFO_WR(dev) (DSPMEM_BASE(dev)+0xffe8L) +#define DSPMEM_FIFO_RD(dev) (DSPMEM_BASE(dev)+0xffecL) + + +#define DSPMEM_CMD(dev) (DSPMEM_BASE(dev)+0xfff0L) +#define DSPMEM_STATUS(dev) (DSPMEM_BASE(dev)+0xfff8L) + + +#define DSP_CMD_NOP 0x00 +#define DSP_CMD_AC3 0x80 +#define DSP_CMD_MPEG1 0x81 +#define DSP_CMD_MPEG2 0x82 +#define DSP_CMD_PCM 0x83 + +#define DSP_CMD_PLAY 0x84 +#define DSP_CMD_STOPF 0x85 +#define DSP_CMD_PAUSE 0x86 +#define DSP_CMD_MUTE 0x87 +#define DSP_CMD_UNMUTE 0x88 +#define DSP_CMD_CONFIG 0x89 +#define DSP_CMD_VER 0x8a +#define DSP_CMD_STATUS 0x8b + +#define DSP_CMD_VOLUME 0x8c +#define DSP_CMD_INITDONE 0x8d + +#define DSP_CMD_FRAME 0xa0 +#define DSP_CMD_CLRAUTH 0xa1 +#define DSP_CMD_DECAUTH 0xa2 +#define DSP_CMD_DRVAUTH 0xa3 +#define DSP_CMD_KEYSHARE 0xa4 +#define DSP_CMD_DISCKEY 0xa5 +#define DSP_CMD_TITLEKEY 0xa6 + + +#define I2C_CLIENTS_MAX 16 + + +struct ls220_dev +{ + struct ls220_dev *next; + struct pci_dev *pdev; + void *membase; + int type; + u8 eprom[16]; + int has_eprom; + int tvencoder; + + u32 dram_base; + + u32 audio_fifo_off; + u32 audio_fifo_len; + + u32 audio_m_vol; + u32 audio_m_adj; + int audio_mute; + int audio_ac3; + + u32 audio_pts; + u32 audio_ptscount; + u32 audio_m_total; + u32 audio_speed; + + int audio_spdif; + + int spdif_first_play; + int stop_read; + + /* Buffer management */ + u8 audio_buffer[2048]; + u8 *audio_p; + u8 *audio_cp; + u16 audio_dlen; + + int video_mode; +#define VIDEO_PAL 0 +#define VIDEO_NTSC 1 + int video_mpeg1; + int video_hw_wrap; + int video_letter; + int video_zoomin; + int video_speed; + int video_pts; + int video_total; + int video_remainder; + int video_wptr; + int vga_mode; + + struct i2c_adapter i2c_adap; + struct i2c_algo_bit_data i2c_algo; + struct i2c_client i2c_client; + int i2c_rc; + struct i2c_client *i2c_clients[I2C_CLIENTS_MAX]; +}; + +/* FIXME - spinlock the list */ +static struct ls220_dev *ls_devs; + +static int old = 1; /* Old v new style board */ + +/* + * Hardware access + */ + +static void ls220_dv_write(struct ls220_dev *dev, u32 offset, u32 data) +{ + writel(data, dev->membase+offset); +} + +static u32 ls220_dv_read(struct ls220_dev *dev, u32 offset) +{ + return readl(dev->membase+offset); +} + +static void ls220_write_dram(struct ls220_dev *dev, u32 offset, u32 data) +{ + writel(data, dev->membase+offset); +} + +static u32 ls220_read_dram(struct ls220_dev *dev, u32 offset) +{ + return readl(dev->membase+offset); +} + +static void ls220_memsetl(struct ls220_dev *dev, u32 offset, u32 fill, int len) +{ + int i; + for(i=0;idstoff, f->length); + if(f->dstoff) + { + for(i=0; ilength; i++) + { + ls220_write_dram(dev, DRAM_BASE(dev) + f->dstoff + 4 * i, f->firmware[i]); + if(ls220_read_dram(dev, DRAM_BASE(dev) + f->dstoff + 4 * i)!=f->firmware[i]) + { + printk("luxsonor: firmware upload error.\n"); + printk("%d: Got 0x%X want 0x%X\n", + i, ls220_read_dram(dev, DRAM_BASE(dev) + f->dstoff + 4 * i), + f->firmware[i]); + return; + } + } + } +} + +static void load_firmware_set(struct ls220_dev *dev, int card, int mode) +{ + int i; + for(i=0;i<3;i++) + load_firmware_block(dev, &firmware[card][mode][i]); +} + +static void ls220_load_firmware(struct ls220_dev *dev, int format) +{ + int card = 0; + if(dev->type==LS240) + card = 1; + + if(dev->eprom[EPROM_I2S]==0x03) + format += 3; /* Second table for i2s */ + + format--; /* Numbered 1 to 3 */ + + load_firmware_set(dev, card, format); +} + +/* + * LS220 I2C bus implementation + */ + +static void ls220_i2c_init(struct ls220_dev *dev) +{ + if(!dev->eprom[EPROM_BOARDTYPE]) + ls220_dv_write(dev, 0x350, 0x4f70100); + else + ls220_dv_write(dev, 0x350, 0x4f70f00); + ls220_dv_write(dev, 0x364, 0xff031f); +} + +static void ls220_bit_setscl(void *data, int state) +{ + struct ls220_dev *dev = data; + u32 reg; + + reg = ls220_dv_read(dev, 0x350); + reg &= 0x7FFFFF; + if(state == 0) + reg |= 0x00800000; + ls220_dv_write(dev, 0x350, reg); +// printk("SCL = %d\n", state); + ls220_dv_read(dev, 0x350); +} + +static void ls220_bit_setsda(void *data, int state) +{ + struct ls220_dev *dev = data; + u32 reg; + + reg = ls220_dv_read(dev, 0x350); + reg &= 0xBFFFFF; + if(state == 0) + reg |= 0x00400000; + ls220_dv_write(dev, 0x350, reg); +// printk("SDA = %d\n", state); + ls220_dv_read(dev, 0x350); +} + +static int ls220_bit_getsda(void *data) +{ + struct ls220_dev *dev = data; + if(ls220_dv_read(dev, 0x350)&0x40) + { +// printk("get SDA=0\n"); + return 0; + } +// printk("get SDA=1\n"); + return 1; +} + +static void ls220_i2c_use(struct i2c_adapter *adap) +{ + MOD_INC_USE_COUNT; +} + +static void ls220_i2c_unuse(struct i2c_adapter *adap) +{ + MOD_DEC_USE_COUNT; +} + +static int ls220_attach_inform(struct i2c_client *client) +{ + struct ls220_dev *dev = client->adapter->data; + return 0; +} + +static int ls220_detach_inform(struct i2c_client *client) +{ + struct ls220_dev *dev = client->adapter->data; + return 0; +} + +static int ls220_call_i2c_clients(struct ls220_dev *dev, unsigned int cmd, void *arg) +{ + return 0; +} + +/* + * Structures to define our hardware with the i2c core code. It + * will do all the i2c bus management and locking for us. + */ + +static struct i2c_algo_bit_data ls220_i2c_algo_template = { + setsda: ls220_bit_setsda, + setscl: ls220_bit_setscl, + getsda: ls220_bit_getsda, + udelay: 30, + mdelay: 10, + timeout: 200, +}; + +static struct i2c_adapter ls220_i2c_adap_template = { + name: "ls220", + id: I2C_HW_B_BT848, /* FIXME */ + inc_use: ls220_i2c_use, + dec_use: ls220_i2c_unuse, + client_register: ls220_attach_inform, + client_unregister: ls220_detach_inform, +}; + +static struct i2c_client ls220_i2c_client_template = { + name: "ls220 internal", + id: -1, +}; + +/* + * Register our i2c bus + */ + +static int ls220_i2c_register(struct ls220_dev *dev) +{ + /* Copy template */ + memcpy(&dev->i2c_adap, &ls220_i2c_adap_template, sizeof(struct i2c_adapter)); + memcpy(&dev->i2c_algo, &ls220_i2c_algo_template, sizeof(struct i2c_algo_bit_data)); + memcpy(&dev->i2c_client, &ls220_i2c_client_template, sizeof(struct i2c_client)); + /* Device backlinks */ + dev->i2c_algo.data = dev; + dev->i2c_adap.data = dev; + /* Fix up links */ + dev->i2c_adap.algo_data = &dev->i2c_algo; + dev->i2c_client.adapter = &dev->i2c_adap; + /* Set up */ + ls220_bit_setscl(dev, 1); + ls220_bit_setsda(dev, 1); + dev->i2c_rc = i2c_bit_add_bus(&dev->i2c_adap); + return dev->i2c_rc; +} + +/* + * I2C read interfaces + */ + +static int ls220_new_i2c_read(struct ls220_dev *dev, u8 addr) +{ + u8 buffer; + + if(dev->i2c_rc == -1) + BUG(); + printk("i2c recv from 0x%02X\n", addr); + + dev->i2c_client.addr = addr>>1; + if(i2c_master_recv(&dev->i2c_client, &buffer, 1)) + { + printk("i2c - read error.\n"); + return -EIO; + } + printk("Received %d\n", buffer); + return buffer; +} + +static int ls220_new_i2c_probe(struct ls220_dev *dev, u8 addr) +{ + u8 buffer; + int err; + + if(dev->i2c_rc == -1) + BUG(); + printk("i2c probe for 0x%02X\n", addr); + + dev->i2c_client.addr = addr>>1; + if((err=i2c_master_send(&dev->i2c_client, &buffer, 0))) + { + printk(" - probe failed (%d).\n", err); + return 0; + } + printk(" - found.\n"); + return 1; +} + +/*=================----------------*/ + +/* + * Old built in i2c code - this is here until I find why the generic + * kernel code won't play + */ + +static void iic_delay(struct ls220_dev *dev) +{ + udelay(30); +} + +static void iic_startcode(struct ls220_dev *dev) +{ + u32 tmp; + + tmp = ls220_dv_read(dev, 0x350) & 0x3fffffL; + ls220_dv_write(dev, 0x350, tmp); // both = 1 + iic_delay(dev); + + ls220_dv_write(dev, 0x350, tmp | 0x400000L); // SDA = 0 + + iic_delay(dev); + + ls220_dv_write(dev, 0x350, tmp | 0xc00000L); // SCL = 0 + iic_delay(dev); +} + +////////////////////////////////////////////////////////////////////////// + +static void iic_dataxfer(struct ls220_dev *dev, u8 val) +{ + u32 tmp; + u8 data; + int i; + + data = ~val; + for (i = 0; i < 8; i++) { + tmp = ls220_dv_read(dev, 0x350) & 0xbfffffL; + tmp |= (u32) ((data >> (7 - i)) & 0x1) << 22; // set SDA + ls220_dv_write(dev, 0x350, tmp); + iic_delay(dev); + tmp = ls220_dv_read(dev, 0x350); + ls220_dv_write(dev, 0x350, tmp & 0x7fffffL); // set SCL = 1 + iic_delay(dev); + ls220_dv_write(dev, 0x350, tmp | 0x800000L); // set SCL = 0 + iic_delay(dev); + } +} + +////////////////////////////////////////////////////////////////////////// + +static int iic_ack(struct ls220_dev *dev) +{ + u32 tmp, ack; + + tmp = ls220_dv_read(dev, 0x350); + ls220_dv_write(dev, 0x350, tmp & 0xbfffffL); // disable SDA = 1 + iic_delay(dev); + ack = ls220_dv_read(dev, 0x350) & 0x40; + ls220_dv_write(dev, 0x350, tmp & 0x3fffffL); // SCL = 1 + iic_delay(dev); + tmp = ls220_dv_read(dev, 0x350); + ls220_dv_write(dev, 0x350, tmp | 0x800000L); // set SCL = 0 + iic_delay(dev); + + if (!ack) + return 1; + else + return 0; +} + +////////////////////////////////////////////////////////////////////////// + +static void iic_endcode(struct ls220_dev *dev) +{ + u32 tmp; + + tmp = ls220_dv_read(dev, 0x350); + ls220_dv_write(dev, 0x350, tmp | 0x400000L); // SDA = 0 + iic_delay(dev); + tmp = ls220_dv_read(dev, 0x350); + ls220_dv_write(dev, 0x350, tmp & 0x7fffffL); // set SCL = 1 + iic_delay(dev); + ls220_dv_write(dev, 0x350, tmp & 0x3fffffL); // SDA = 1 + iic_delay(dev); +} + +////////////////////////////////////////////////////////////////////////// + +static u8 iic_dataget(struct ls220_dev *dev) +{ + u8 val, i; + u32 tmp; + + val = 0; + for (i = 0; i < 8; i++) { + iic_delay(dev); + tmp = ls220_dv_read(dev, 0x350); + val <<= 1; + if (tmp & 0x40) + val = val | 0x1; + + tmp = tmp & 0x3fffffL; + ls220_dv_write(dev, 0x350, tmp); // set SCL = 1 + iic_delay(dev); + ls220_dv_write(dev, 0x350, tmp | 0x800000L); // set SCL = 0 + iic_delay(dev); + } + + return val; +} + +////////////////////////////////////////////////////////////////////////// + +static void send_ack(struct ls220_dev *dev) +{ + u32 tmp; + + tmp = ls220_dv_read(dev, 0x350); + tmp = tmp | 0xc00000L; // SCLK SDA + ls220_dv_write(dev, 0x350, tmp); // set 00 + iic_delay(dev); + tmp = tmp & 0x7fffffL; + ls220_dv_write(dev, 0x350, tmp); // set 10 + iic_delay(dev); + tmp = tmp | 0xc00000L; + ls220_dv_write(dev, 0x350, tmp); // set 00 + iic_delay(dev); + tmp = tmp & 0xb00000L; + ls220_dv_write(dev, 0x350, tmp); // set 01 + iic_delay(dev); +} + +static int i2c_readeprom(struct ls220_dev *dev, u8 addr, u8 subaddr, u8 num, u8 * pb) +{ + u8 val; + int i; + + iic_startcode(dev); + iic_dataxfer(dev, addr); // write command + iic_ack(dev); + iic_dataxfer(dev, subaddr); + iic_ack(dev); + iic_startcode(dev); + iic_dataxfer(dev, (u8) (addr | 0x1)); // read command + iic_ack(dev); + + for (i = 0; i < num; i++) { + pb[i] = iic_dataget(dev); // load array here + if (i < (num - 1)) + send_ack(dev); + else + iic_endcode(dev); + } + return 1; +} + +static int ls220_i2c_probe(struct ls220_dev *dev, u8 addr) +{ + int val; +// return ls220_new_i2c_probe(dev,addr); + iic_startcode(dev); + iic_dataxfer(dev, addr); // write command + val = iic_ack(dev); + iic_endcode(dev); + return val; +} + +////////////////////////////////////////////////////////////////////////// + +static int read_i2c(struct ls220_dev *dev, u8 addr) +{ + u32 tmp, val; + u32 dwcnt = 0; + + val = 0xff; + tmp = ls220_dv_read(dev, 0x350); + ls220_dv_write(dev, 0x350, tmp | 0x4000000); // set bit 26=1 + iic_delay(dev); + ls220_dv_write(dev, 0x354, addr << 24 | 0x1000000L); + iic_delay(dev); + + while (!(ls220_dv_read(dev, 0x368) & 0x1000)) { + iic_delay(dev); + if (dwcnt++ > 0xffff) + break; + } + val = (u8) ls220_dv_read(dev, 0x36c); + ls220_dv_write(dev, 0x350, tmp); + iic_delay(dev); + return val; +} + +static void send_i2c(struct ls220_dev *dev, u8 addr,u8 subaddr,u8 data) +{ + iic_startcode(dev); + iic_dataxfer(dev, addr); + iic_ack(dev); + iic_dataxfer(dev, subaddr); + iic_ack(dev); + iic_dataxfer(dev, data); + iic_ack(dev); + iic_endcode(dev); +} + +/*=================----------------*/ + +static int ls220_i2c_read(struct ls220_dev *dev, u8 addr) +{ +// return ls220_new_i2c_read(dev, addr); + return read_i2c(dev, addr); +} + + +static int ls220_i2c_write(struct ls220_dev *dev, u8 addr, u8 b1, u8 b2, int both) +{ + u8 buffer[2]; + int bytes = both ? 2 : 1; + if(dev->i2c_rc == -1) + BUG(); + +// printk("Write to i2c client 0x%02X - 0x%2X (0x%02X, %d)\n", addr, b1, b2, both); + dev->i2c_client.addr = addr >> 1; + buffer[0] = b1; + buffer[1] = b2; + if(i2c_master_send(&dev->i2c_client, buffer, bytes)!=bytes) + { + printk(KERN_ERR "i2c write failed.\n"); + return -EIO; + } + return 0; +} + +static int ls220_load_eeprom(struct ls220_dev *dev, u8 addr, u8 subaddr, u8 len, u8 *buf) +{ + int i; + + i2c_readeprom(dev, addr, subaddr, len, buf); +#if 0 + if(ls220_i2c_write(dev, addr, subaddr, -1, 0)<0) + return -EIO; + dev->i2c_client.addr = addr >> 1; + + if(i2c_master_recv(&dev->i2c_client, buf, 16)!=16) + return -EIO; +#endif +#if 0 + printk("luxsonor: EEPROM "); + for(i=0;i<16;i++) + printk("%02X ", buf[i]); + printk("\n"); +#endif + return 0; +} + +static int ls220_detect_tvencoder(struct ls220_dev *dev) +{ + int type; + u8 id; + + if(ls220_i2c_write(dev, 0x00, 0x0f, 0x40, 1)) + printk("i2c_write failed.\n"); + if(ls220_i2c_probe(dev, 0x80)) + { + u8 id; + ls220_load_eeprom(dev, 0x80, 0x3d, 1, &id); + if(id & 0xf0) + type = CS4953; + else + type = CS4952; + return type; + } + if(ls220_i2c_probe(dev, 0x8A)) + { + id = ls220_i2c_read(dev, 0x8A); + if(((id>>5)&7) == 5) + type = BT865; + else + type = BT864; + return type; + } + if(ls220_i2c_probe(dev, 0x42)) + { + ls220_load_eeprom(dev, 0x42, 0x00, 1, &id); + if(id & 0x0f) + type = HS8171; + else + type = HS8170; + return type; + } + if(ls220_i2c_probe(dev, 0x8c)) + return SAA7120; + if(ls220_i2c_probe(dev, 0xd4)) + return AD7175; + if(ls220_i2c_probe(dev, 0x54)) + return AD7176; + printk("No TV encoder ??\n"); + return -ENODEV; +} + +/* + * The LS220 also has some other i2c like stuff on the same + * registers, so we have to watch our locking. + * + * FIXME:pci posting.. + */ + +#define G_EN 0x60000 +#define G_SC 0x0200 +#define G_SD 0x0400 + +static void ls220_gpio_startcode(struct ls220_dev *dev) +{ + u32 r350 = ls220_dv_read(dev, 0x350); + r350&=0xFF000000; + r350|=G_EN; + ls220_dv_write(dev, 0x350, r350|G_SC|G_SD); + udelay(100); + ls220_dv_write(dev, 0x350, r350|G_SC); + udelay(100); + ls220_dv_write(dev, 0x350, r350); + udelay(100); +} + +static void ls220_gpio_endcode(struct ls220_dev *dev) +{ + u32 r350 = ls220_dv_read(dev, 0x350); + r350&=0xFF000000; + r350|=G_EN; + ls220_dv_write(dev, 0x350, r350); + udelay(10); + ls220_dv_write(dev, 0x350, r350|G_SC); + udelay(10); + ls220_dv_write(dev, 0x350, r350); + udelay(10); + ls220_dv_write(dev, 0x350, r350|G_SC); + udelay(10); + ls220_dv_write(dev, 0x350, r350|G_SC|G_SD); +} + +static void ls220_gpio_addr(struct ls220_dev *dev, u8 addr) +{ + int i; + int sd; + u32 r350 = ls220_dv_read(dev, 0x350); + r350&=0xFF000000; + r350|=G_EN; + + for(i=2;i>=0;i--) + { + if(addr&(1<=0;i--) + { + if(data&(1<type == LS240) + { + ls220_dv_write(dev, 0x10, 1); + ls220_dv_write(dev, 0x10, 0x30); + ls220_dv_write(dev, 0x300, 0); + ls220_dv_write(dev, 0x84, 0x04400000); + udelay(10); + ls220_dv_write(dev, 0x80, 0x66a428ec); + udelay(10); + ls220_dv_write(dev, 0x84, 0x80400000); + ls220_dv_write(dev, 0x30, 0x12c5); + } + else + { + ls220_dv_write(dev, 0x10, 1); + ls220_dv_write(dev, 0x10, 0); + } + + ls220_i2c_init(dev); +} + +/* + * LS220 Audio drivers + */ + +static void ls240_dsp_poke(struct ls220_dev *dev) +{ + if(dev->type == LS240) + { + u32 reg = ls220_dv_read(dev, 0x10); + reg &= ~8; + reg |= 0x30; + ls220_dv_write(dev, 0x10,reg); + } +} + +static int ls220_dsp_wait(struct ls220_dev *dev) +{ + int count; + + ls240_dsp_poke(dev); + + ls220_dv_read(dev, 0x250); + + for(count = 0; count < 4096; count ++) + { + if(ls220_read_dram(dev, DSPMEM_CMD(dev)) == 0x100) + return 0; + ls240_dsp_poke(dev); + udelay(50); + } + printk(KERN_ERR "ls220: dsp not responding.\n"); + return -ETIMEDOUT; +} + +static u32 vol_table[16] = { + 0x7fffff, 0x6046c5, 0x4c79a0, 0x3cbf0f, + 0x3040a5, 0x26540e, 0x1e71fe, 0x182efd, + 0x1335ad, 0xf4240, 0xc1ed8, 0x9a0ad, + 0x7a5c3, 0x6131b, 0x4d343, 0x0 +}; + +static void ls220_audio_set_volume(struct ls220_dev *dev, int vol) +{ + if(dev->audio_mute) + return; + if(vol == 0xFF) + { + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_MUTE); + ls220_dsp_wait(dev); + vol = 0; + } + else + dev->audio_m_vol = vol; + if(vol > 15 || vol < 0) + BUG(); + ls220_write_dram(dev, DSPMEM_VOLUME_LEVEL(dev), vol_table[15-vol]); + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_VOLUME); +} + +static void ls220_dsp_init(struct ls220_dev *dev, int type) +{ + ls220_write_dram(dev, DSPMEM_AC3_CONF(dev) ,0x3400); + + if(type == 1) /* AC3 */ + { + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_AC3); + dev->audio_m_adj = 0x600; + } + else if(type == 0) /* PCM */ + { + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_PCM); + dev->audio_m_adj = 0x600; + } + else if(type == 2) /* MPG1 */ + { + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_MPEG1); + dev->audio_m_adj = 0x0; + } + ls220_dsp_wait(dev); + ls220_audio_set_volume(dev, dev->audio_m_vol); + + dev->audio_fifo_off = ls220_read_dram(dev, DSPMEM_FIFO_START(dev)); + dev->audio_fifo_len = ls220_read_dram(dev, DSPMEM_FIFO_END(dev)) - dev->audio_fifo_off; +// printk("FIFO at 0x%X, size %d.\n", dev->audio_fifo_off, dev->audio_fifo_len); +} + +static void ls220_audio_init(struct ls220_dev *dev, int type) +{ + dev->audio_mute = 0; + dev->audio_m_vol = 15; + dev->audio_ac3 = 1; + dev->audio_m_total = 0; + dev->audio_pts = 0; + dev->audio_ptscount = 0; + dev->audio_speed = 1000; + dev->stop_read = 0; + ls220_dv_write(dev, 0x24, 0); + + if(old) + { + ls220_dv_write(dev, 0x104, 0); + ls220_dv_write(dev, 0x100, 0x7C600); + ls220_dv_write(dev, 0x104, 1); + udelay(200); + ls220_write_dram(dev, DSPMEM_FIFO_WR(dev), AUD_FIFO_OFF); + ls220_write_dram(dev, DSPMEM_FIFO_RD(dev), AUD_FIFO_OFF); + ls220_write_dram(dev, DSPMEM_PTS_WR(dev), AUD_PTS_OFF); + ls220_write_dram(dev, DSPMEM_PTS_RD(dev), AUD_PTS_OFF); + } + ls220_dsp_init(dev, type); + dev->audio_m_total = 0; + dev->audio_pts = 0; + dev->audio_ptscount = 0; + + if(type == 2) /* Mpeg audio */ + dev->audio_ptscount = 1; +} + +static void ls240_audiopcm_enable_tristate(struct ls220_dev *dev) +{ + ls220_dv_write(dev, 0x284, ls220_dv_read(dev, 0x284)|0x200000); +} + +static void ls220_audio_set_info(struct ls220_dev *dev) +{ + u16 clock_chip; /* clock chip defition */ + u16 left_ch; /* left channel polarity */ + u16 pcm_size; /* PCM ( output ) size */ + u16 i2s_pin; /* I2S pin */ + + clock_chip = (u16)dev->eprom[EPROM_CLOCKTYPE]; + left_ch = (u16)dev->eprom[EPROM_LEFT_CH_POL]<<3; + pcm_size = 0; + + if(dev->eprom[EPROM_I2S] == 0x3) + i2s_pin = 0x40; + else + i2s_pin = 0; + + ls220_write_dram(dev, DSPMEM_AUDIO_CONF(dev), i2s_pin|pcm_size|left_ch|clock_chip); +} + +static void ls220_audio_set_spdif(struct ls220_dev *dev, int onoff) +{ + u32 data; + + dev->audio_spdif = onoff; + + data = ls220_read_dram(dev, DSPMEM_AUDIO_CONF(dev)); + data &= 0x7F; + if(onoff) + data |= 0x80; + ls220_write_dram(dev, DSPMEM_AUDIO_CONF(dev), data); +} + +static int ls220_audio_write(struct ls220_dev *dev, const char *buf, int len) +{ + return 0; +} + +static void ls220_play_audio(struct ls220_dev *dev, int speed) +{ + dev->audio_speed = speed; + if(speed == 1000) + { + /* + * Normal speed - engage hardware synchronization + */ + if(dev->type == LS240) + { + ls220_dv_write(dev, 0x280, 0x8); + ls220_dv_write(dev, 0x280, 0x9); + ls220_dv_write(dev, 0x29C, 0x30008235); + ls220_dv_write(dev, 0x200, 0x419); + ls220_dv_write(dev, 0x200, 0x3b); + } + else + { + u32 tmp = ls220_dv_read(dev, SYNC_AUD_CONTROL); + ls220_dv_write(dev, SYNC_AUD_CONTROL, tmp|0x20); + } + ls220_dv_write(dev, DSPMEM_CMD(dev), DSP_CMD_PLAY); + ls220_dsp_wait(dev); + /* Locking needed on 0x350 */ + if(dev->eprom[EPROM_BOARDTYPE] == 3 && !dev->audio_spdif) + ls220_dv_write(dev, 0x350, ls220_dv_read(dev, 0x350)|0x010100); + if(!(dev->eprom[EPROM_SPDIF_CH]&0x02) && dev->audio_spdif && dev->spdif_first_play) + { + dev->spdif_first_play = 0; + ls220_dv_write(dev, DSPMEM_CMD(dev), DSP_CMD_INITDONE); + ls220_dsp_wait(dev); + } + } +} + +static void ls220_audio_set_speed(struct ls220_dev *dev, int speed) +{ + dev->audio_speed = speed; +} + +static void ls220_audio_set_config(struct ls220_dev *dev, int sixchannel) +{ + if(dev->audio_ac3) + { + if(sixchannel && !(dev->eprom[EPROM_SPDIF_CH]&0x1)) + ls220_write_dram(dev, DSPMEM_AC3_CONF(dev), 0x340F); + else + { + switch(sixchannel) + { + case 0: /* Want prologic */ + case 1: /* Board doesnt do 6 */ + case 3: /* Default to prologic */ + ls220_write_dram(dev, DSPMEM_AC3_CONF(dev), 0x3400); + break; + case 2: /* No six channels but use 2 channel scheme */ + ls220_write_dram(dev, DSPMEM_AC3_CONF(dev), 0x3402); + break; + } + } + } + else + { + /* PCM mode */ + if(sixchannel > 1) + ls220_write_dram(dev, DSPMEM_AC3_CONF(dev), sixchannel); + } +} + +static void ls220_audio_set_type(struct ls220_dev *dev, int type) +{ + dev->audio_ac3 = type; +} + + +static void ls220_audio_stop(struct ls220_dev *dev) +{ + dev->stop_read = 0; + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_MUTE); + ls220_dsp_wait(dev); + ls220_write_dram(dev, DSPMEM_PTS_WR(dev), AUD_PTS_OFF); + ls220_write_dram(dev, DSPMEM_PTS_RD(dev), AUD_PTS_OFF); + + if(dev->audio_ac3 == 1) + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_AC3); + else if(dev->audio_ac3 == 0) + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_PCM); + else if(dev->audio_ac3 == 2) + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_MPEG1); + ls220_dsp_wait(dev); + ls220_audio_set_volume(dev, dev->audio_m_vol); + + dev->audio_m_total = 0; + dev->audio_pts = 0; + dev->audio_ptscount = 0; + if(dev->audio_ac3 == 2) + dev->audio_ptscount = 1; +} + +static void ls220_audio_mute(struct ls220_dev *dev) +{ + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_STOPF); + ls220_dsp_wait(dev); +} + +static void ls220_audio_pause(struct ls220_dev *dev) +{ + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_PAUSE); + ls220_dsp_wait(dev); +} + +static void ls220_audio_continue(struct ls220_dev *dev) +{ + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_PLAY); + ls220_dsp_wait(dev); +} + +static u32 ls220_audio_report_frame(struct ls220_dev *dev) +{ + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_FRAME); + ls220_dsp_wait(dev); + return ls220_read_dram(dev, DSPMEM_STATUS(dev)); +} + +static u32 ls220_audio_report_status(struct ls220_dev *dev) +{ + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_STATUS); + ls220_dsp_wait(dev); + return ls220_read_dram(dev, DSPMEM_STATUS(dev)); +} + +static void ls220_audio_onoff(struct ls220_dev *dev, int onoff) +{ + dev->audio_mute = onoff; + if(!dev->audio_mute) + ls220_audio_set_volume(dev, dev->audio_m_vol); + else + { + ls220_write_dram(dev, DSPMEM_VOLUME_LEVEL(dev), vol_table[15]); + ls220_write_dram(dev, DSPMEM_CMD(dev), DSP_CMD_VOLUME); + ls220_dsp_wait(dev); + } +} + +static void ls220_audio_after_seek(struct ls220_dev *dev) +{ + if(old) + { + ls220_write_dram(dev, DSPMEM_FIFO_WR(dev), AUD_FIFO_OFF); + ls220_write_dram(dev, DSPMEM_FIFO_RD(dev), AUD_FIFO_OFF); + } + ls220_write_dram(dev, DSPMEM_FIFO_WR(dev), dev->audio_fifo_off); + ls220_write_dram(dev, DSPMEM_FIFO_RD(dev), dev->audio_fifo_off); + ls220_write_dram(dev, DSPMEM_PTS_WR(dev), AUD_PTS_OFF); + ls220_write_dram(dev, DSPMEM_PTS_RD(dev), AUD_PTS_OFF); +} + +int ls220_audio_write_pts(struct ls220_dev *dev, u32 pts, u16 aoff) +{ + u32 rdptr; + u32 wrptr; + u32 space; + u32 val; + + rdptr = ls220_dv_read(dev, DSPMEM_PTS_RD(dev)); + wrptr = ls220_dv_read(dev, DSPMEM_PTS_WR(dev)); + space = (wrptr > rdptr) ? (AUD_PTS_LEN + rdptr - wrptr) : (rdptr - wrptr); + + if(space < 0x8) + return 0; + + if(dev->type != LS240) + { + if(!dev->audio_pts) + { + val = ls220_dv_read(dev, 0x200); + ls220_dv_write(dev, 0x200, val&0xFBF); /* Audio master */ + } + } + ls220_write_dram(dev, DRAM_BASE(dev)+wrptr, pts); + wrptr+=4; + ls220_write_dram(dev, DRAM_BASE(dev)+wrptr, dev->audio_m_total+aoff); + wrptr+=4; + if(wrptr >= AUD_PTS_OFF+AUD_PTS_LEN) + wrptr -= AUD_PTS_LEN; + ls220_dv_write(dev, DSPMEM_PTS_WR(dev), wrptr); + dev->audio_pts = pts; + return 1; +} + +static void ls220_audio_stop_dsp(struct ls220_dev *dev) +{ + ls220_dv_write(dev, 0x104, 0); + ls220_dv_write(dev, SYNC_INT_CTRL, 0x8000); +} + +static void ls220_audio_enable_dsp(struct ls220_dev *dev) +{ + ls220_dv_write(dev, 0x100, 0x7c600); + ls220_dv_write(dev, 0x104, 0x1); + udelay(100); + if(dev->type == LS240) + ls220_dv_write(dev, SYNC_INT_CTRL, 0x38000001); + else + ls220_dv_write(dev, SYNC_INT_CTRL, 0xE8001); +} + +static void ls220_audio_setuclock(struct ls220_dev *dev, int type) +{ + if(!old) + return; +#if 0 + if(type && dev->eprom[EPROM_CLOCKTYPE]==1) + ls220_write_dram(dev, DSPMEM_UCLOCK(dev), 1); + else + ls220_write_dram(dev, DSPMEM_UCLOCK(dev), 0); +#endif +} + +static void ls220_audio_set_karaoke(struct ls220_dev *dev, int mode) +{ + if(mode < 0 || mode > 3) + BUG(); + /* bit 0 = vocal 1 enable bit 1 = vocal 2 enable */ + ls220_write_dram(dev, DSPMEM_KARAOKE(dev), mode); +} + +static u32 ls220_audio_send_data(struct ls220_dev *dev, u8 *p, u32 len, u16 pts, int scramble, u16 aoff) +{ + if(dev->audio_speed != 1000) + return len; + /* TODO */ + return 0; +} + +static u32 ls220_audio_mpeg_packet(struct ls220_dev *dev, u8 *mbuf, u8 *pp, u32 used) +{ + /* mbuf is a 2K packet, pp is a pes len ptr */ + u8 aid; + u16 pes_len; + u32 curpts = 0; + u8 scramble; + int m_ext = 0; + u16 ext_pes_len = 0; + int m_exthead = 0; + + memcpy(dev->audio_buffer, mbuf, 2048); + dev->audio_p = dev->audio_buffer + (pp - mbuf); + + aid = dev->audio_p[-1]&7; + + if(dev->stop_read) + { + dev->audio_p+=2; + scramble = dev->audio_p[0]&0x30; + pes_len = dev->audio_p[2]; + dev->audio_p+=3; + if((dev->audio_p[0] & 0xf0)==0x20 && pes_len > 0) /* Found PTS */ + { + curpts = dev->audio_p[1]<<8 | dev->audio_p[2]; + curpts = (curpts << 14) | ((dev->audio_p[3]<<8 | dev->audio_p[4])>>2); + curpts |= (dev->audio_p[0] & 0xE) << 28; + } + dev->audio_p += pes_len; + goto tryit; + } + if((dev->audio_p[-1]&0xF0) == 0xD0) + { + m_exthead = 1; + m_ext = 1; + } + dev->audio_dlen = dev->audio_p[0]<<8 | dev->audio_p[1]; + dev->audio_p+=2; + dev->audio_cp = dev->audio_p+dev->audio_dlen; /* Find A_PKT end */ + if (dev->audio_cp < dev->audio_buffer + 0x0800) + { + if((((dev->audio_cp[0]<<8) | dev->audio_cp[1])&0xFFFFFFF0) != 0x01c0) + m_ext = 1; + } + scramble = dev->audio_p[0]&0x30; + pes_len = dev->audio_p[2]; + dev->audio_p+=3; + + dev->audio_dlen = dev->audio_dlen -3 - pes_len; + + if(((*dev->audio_p & 0xf0) == 0x20) && (pes_len > 0)) + { + curpts = dev->audio_p[1]<<8|dev->audio_p[2]; + curpts <<= 14; + curpts |= (dev->audio_p[3]<< 8 | dev->audio_p[4])>>2; + curpts |= (dev->audio_p[0]&0x0E)<<28; + } + + dev->audio_p+=pes_len; + + if(m_exthead) + { + dev->audio_cp = dev->audio_p; + dev->audio_dlen = 0; + curpts = 0; + } + + if(m_ext) + { + dev->audio_p = dev->audio_cp; + while(dev->audio_p < dev->audio_buffer + 0x800) + { + while(((dev->audio_p[0]<<8 | dev->audio_p[1]) & 0xFFFF00) != 0x100) + { + if(dev->audio_p++ >= dev->audio_buffer + 0x800) + goto tryit; + } + + if((dev->audio_p[3]&0xF0) != 0xC0) + { + dev->audio_p += 4; + ext_pes_len = dev->audio_p[0]<<8 | dev->audio_p[1]; + dev->audio_p += ext_pes_len; + continue; + } + if((((dev->audio_p[0]<<24)|(dev->audio_p[1]<<1)|(dev->audio_p[2]<<8)|dev->audio_p[3]) & 0xFFFFFFF0) != 0x1c0) + { + dev->audio_p+=4; + ext_pes_len = dev->audio_p[0] << 8 | dev->audio_p[1]; + dev->audio_p+=2; + pes_len = dev->audio_p[2]; + dev->audio_p+=3; + ext_pes_len = ext_pes_len - 3 - pes_len; + + if(m_exthead) + { + if((dev->audio_p[0]&0xF0) == 0x20 && pes_len > 0) + { + curpts = dev->audio_p[1]<<8|dev->audio_p[2]; + curpts <<= 14; + curpts |= dev->audio_p[3]<<8|dev->audio_p[4]; + curpts |= (dev->audio_p[0]&0xE)<<28; + } + m_exthead = 0; + } + + dev->audio_p += pes_len; + + memmove(dev->audio_cp, dev->audio_p, ext_pes_len); + dev->audio_dlen += ext_pes_len; + dev->audio_cp += ext_pes_len; + dev->audio_p += ext_pes_len; + } + } + } +tryit: + if(dev->audio_dlen == 0) + { + dev->stop_read = 0; + return used; + } + if(ls220_audio_send_data(dev, dev->audio_p, dev->audio_dlen, curpts, scramble, 0)) + { + dev->stop_read = 0; + return used; + } + else + { + dev->stop_read = 1; + return 0; + } +} + +/* + * Video side drivers + */ + +static void ls240_zoomvideo_enable_tristate(struct ls220_dev *dev) +{ + ls220_dv_write(dev, 0x37c, ls220_dv_read(dev, 0x37c)&0xe0ffffff); +} + +static void ls220_video_set_vpm(struct ls220_dev *dev, int type) +{ + /* TODO */ +} + +static void ls220_configure_tvout(struct ls220_dev *dev, int tvmode) +{ + static u8 bt865_pal[]={ + 0x00, 0x60, 0x7e, 0xfe, 0x54, 0x01, 0xff, 0x01, + 0xd5, 0x73, 0xa8, 0x22, 0x55, 0xa4, 0x05, 0x55, + 0x27, 0x40 + }; + int i; + + switch(dev->tvencoder) + { + case BT865: + for(i=0;i<18;i++) + send_i2c(dev, 0x8A, 0xD8+2*i, bt865_pal[i]); + break; + default: + printk("Sorry only PAL BT865 is supported right now.\n"); + } +} + +/* + * Video gamma table from Luxsonor + */ + +static u32 gamma[][8] = { + {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0}, + {0x0,0x0,0x1000000,0x05040302,0x07070606,0x0b0a0908,0x0b0c0b0b,0xe0e0d}, + {0x0,0x03020200,0x07060505,0x0a090808,0x0b0b0b0a,0x0d0d0c0c,0x0e0e0e0d,0x010f0f0f}, + {0x03000000,0x09080706,0x0c0b0b0b,0x0e0e0d0d,0x0f0f0f0f,0x10100f0f,0x1010100f,0x010f1010}, + {0x08050100,0x0e0d0d0b,0x11101010,0x12121112,0x12121212,0x12121212,0x11111111,0x020f1011}, + {0x0d0a0500,0x13121210,0x15151515,0x16161616,0x15151616,0x14141415,0x12131313,0x020f1112}, + {0x120e0900,0x18171615,0x19191919,0x1919191a,0x17181919,0x16161617,0x13141415,0x020f1212}, + {0x16130d00,0x1c1c1b19,0x1d1d1d1e,0x1d1d1d1e,0x1a1b1c1c,0x1818191a,0x14151616,0x020f1213}, + {0x1b171000,0x21201f1e,0x21212122,0x20202021,0x1c1d1e1f,0x191a1a1c,0x15161718,0x020f1314}, + {0x1f1b1400,0x24242322,0x24252525,0x22232324,0x1e1f2121,0x1b1c1c1e,0x16171819,0x020f1315} +}; + +/* + * U chroma values from Luxsonor + */ + +static u32 chroma_U[][7] = { + {0x2,0x0,0x0,0x0,0x0,0x0,0x0}, + {0x3f3f3f02,0x3f3f3f3f,0x0,0x0,0x0,0x01010100,0x02020201}, + {0x3e3d3d02,0x3e3e3e3e,0x3f3f3f3f,0x0,0x01000000,0x03020201,0x04040403}, + {0x3c3c3b02,0x3d3d3d3c,0x3f3e3e3e,0x3f3f,0x02010000,0x04040302,0x07060605}, + {0x3b3a3a02,0x3c3c3c3b,0x3e3e3d3d,0x3f3f,0x02010000,0x06050403,0x09080807}, + {0x39393a02,0x3b3b3a3a,0x3e3d3d3c,0x3f3f3e,0x03020100,0x07060504,0x0c0b0a08}, + {0x38373a02,0x3a3a3938,0x3d3c3c3b,0x3f3e3e,0x04020100,0x09080605,0x0e0d0c0a}, + {0x36363a02,0x39393837,0x3d3c3b3a,0x3f3e3d,0x04030100,0x0a090706,0x100f0e0c}, + {0x35343a02,0x38383736,0x3c3b3a39,0x3f3e3d,0x05030100,0x0c0a0807,0x1011100e}, + {0x33323a02,0x37363534,0x3b3a3938,0x3f3e3d3c,0x06040200,0x0e0c0a08,0x10141210} +}; + +/* + * V chroma values from Luxsonor (remember mpeg is YUV) + */ +static u32 chroma_V[][7] = { + {0x023a0202,0x02020202,0x02020202,0x02020202,0x02020202,0x02020202,0x02020202}, + {0x380002,0x0,0x01010101,0x02020101,0x03030202,0x04040303,0x05050404}, + {0x3f3e3e07,0x3f3f,0x01000000,0x02020101,0x04040302,0x06060505,0x08080707}, + {0x3d3c3c0a,0x3f3e3e3d,0x3f,0x02020101,0x06050403,0x09080706,0x0c0b0a0a}, + {0x3b3a3a0a,0x3e3d3c3c,0x3f3e,0x02020100,0x07060503,0x0b0a0908,0x0f0e0d0c}, + {0x39383a0a,0x3d3c3b3a,0x3f3e3d,0x02020100,0x08070603,0x0e0c0b0a,0x1012100f}, + {0x373e3a0a,0x3b3a3938,0x3f3e3d3c,0x03020100,0x0a080604,0x100e0d0b,0x10151312}, + {0x363c3a0a,0x3a393837,0x3f3e3d3b,0x03020000,0x0b090704,0x12100f0d,0x10181614}, + {0x343a3a0a,0x39383635,0x3e3d3c3a,0x03020000,0x0c0a0804,0x1513100e,0x10181917}, + {0x323a3a0a,0x38363533,0x3e3c3b39,0x0302003f,0x0e0b0905,0x17151210,0x10181c1a} +}; + +static void ls220_video_clear_screen(struct ls220_dev *dev) +{ + ls220_dv_write(dev, 0x3D0, 0); /* Wipe OSD */ + if(dev->video_mode == VIDEO_NTSC || dev->video_mpeg1) + { + ls220_memsetl(dev, 0x200000, 0x0, 0x54600); + ls220_memsetl(dev, 0x254600, 0x80808080, 0x2a300); + ls220_memsetl(dev, 0x27e900, 0x0, 0x54600); + ls220_memsetl(dev, 0x2d2f00, 0x80808080, 0x2a300); + ls220_memsetl(dev, 0x2fd200, 0x0, 0x54600); + ls220_memsetl(dev, 0x351800, 0x80808080, 0x2a300); + } + else + { + ls220_memsetl(dev, 0x200000, 0x0, 0x65400); + ls220_memsetl(dev, 0x265400, 0x80808080, 0x32a00); + ls220_memsetl(dev, 0x297e00, 0x0, 0x65400); + ls220_memsetl(dev, 0x2fd200, 0x80808080, 0x32a00); + ls220_memsetl(dev, 0x32fc00, 0x0, 0x65400); + ls220_memsetl(dev, 0x395000, 0x80808080, 0x32a00); + } +} + +static void ls220_video_init(struct ls220_dev *dev) +{ + dev->video_hw_wrap = 0xF00000; +// ls220_video_set(dev); + ls220_video_clear_screen(dev); +// ls220_video_set_gamma(dev, 1); +} + +static void ls220_video_reset(struct ls220_dev *dev) +{ +// FILL ME IN +} + +static void ls220_video_set_letter(struct ls220_dev *dev, int onoff) +{ +} + +static void ls220_video_set_speed(struct ls220_dev *dev, int speed) +{ +} + +static void ls220_video_release(struct ls220_dev *dev) +{ + ls220_video_clear_screen(dev); + ls220_video_reset(dev); +} + +static void ls220_video_still(struct ls220_dev *dev) +{ + u32 r180; + + ls220_dv_write(dev, 0x200, 0x7b); + r180 = ls220_dv_read(dev, MPGVID_CONTROL) & 0x1E0; + ls220_dv_write(dev, MPGVID_CONTROL, r180|4); /* Start pointer */ + ls220_video_set_vpm(dev, dev->vga_mode); + ls220_video_set_letter(dev, dev->video_letter); + if(dev->type == LS240) + ls220_dv_write(dev, SYNC_INT_CTRL, 0x88004401); + else + ls220_dv_write(dev, SYNC_INT_CTRL, 0x224401); + ls220_dv_write(dev, 0x278, 0x4000); +} + +static void ls220_video_play(struct ls220_dev *dev, int speed) +{ + u32 reg; + + if(dev->type < LS240) /* might be wrong */ + { + if(/* ?? MENU ?> */ !dev->video_mpeg1) + { + if(ls220_dv_read(dev, 0x145fc) == 0x01) + ls220_dv_write(dev, 0x145fc, 0x02); + } + } + + reg = ls220_dv_read(dev, 0x200); + ls220_dv_write(dev, 0x200, reg |0x01); + + reg = ls220_dv_read(dev, MPGVID_CONTROL); + reg &= 0x1E0; + ls220_dv_write(dev, MPGVID_CONTROL, reg|6); + + ls220_video_set_vpm(dev, dev->vga_mode); + + if(!dev->video_zoomin) + { + ls220_video_set_letter(dev, dev->video_letter); + if(dev->type == LS240) + ls220_dv_write(dev, SYNC_INT_CTRL, 0x38000001); + else + ls220_dv_write(dev, SYNC_INT_CTRL, 0x0e8001); + } + else + { + if(dev->type == LS240) + ls220_dv_write(dev, SYNC_INT_CTRL, 0xc8000001); + else + ls220_dv_write(dev, SYNC_INT_CTRL, 0x328001); + } + ls220_video_set_speed(dev, dev->video_speed); +} + +static void ls220_video_stop(struct ls220_dev *dev) +{ + u32 reg; + + reg = ls220_dv_read(dev, SYNC_INT_CTRL); + + if(dev->type == LS240) + ls220_dv_write(dev, SYNC_INT_CTRL, reg&0xFFFFFFFE); + else + ls220_dv_write(dev, SYNC_INT_CTRL, reg&0xFFFFFE); + + reg = ls220_dv_read(dev, 0x200); + ls220_dv_write(dev, 0x200, reg & 0xFFFE); + + reg = ls220_dv_read(dev, MPGVID_CONTROL); + ls220_dv_write(dev, MPGVID_CONTROL, reg & 0x1E0); + + ls220_dv_write(dev, 0x194, VID_FIFO_OFF); + + dev->video_total = 0; + dev->video_remainder = 0; + dev->video_wptr = VID_FIFO_OFF; + dev->video_pts = 0; + + reg = ls220_dv_read(dev, MPGVID_CONTROL); + ls220_dv_write(dev, MPGVID_CONTROL, (reg&0x1E0) | 1); +} + +static void ls220_video_pause(struct ls220_dev *dev) +{ + u32 reg; + + if(dev->video_speed != 1000) + ls220_dv_write(dev, 0x19C, 0x02); + reg = ls220_dv_read(dev, 0x200); + ls220_dv_write(dev, 0x200, reg&0xFFFE); + ls220_dv_write(dev, SYNC_INT_CTRL, 0x28000); +} + +static unsigned long ls220_video_stc(struct ls220_dev *dev) +{ + return ls220_dv_read(dev, 0x218); +} + +static void ls220_video_fastforward(struct ls220_dev *dev) +{ + u32 reg; + + dev->video_speed = 2000; + if(dev->type == LS240) + { + ls220_dv_write(dev, 0x274, 0x28000001); + ls220_dv_write(dev, 0x268, (ls220_dv_read(dev, 0x268) & 0xA0)|1); + } + else + { + ls220_dv_write(dev, 0x274, 0xa8001); + ls220_dv_write(dev, 0x268, (ls220_dv_read(dev, 0x268) & 0x20)|1); + } +} + +/* + * Called when we reset and reload the DSP + */ +static void ls220_change_dsp(struct ls220_dev *dev, int audio, int vga) +{ + ls220_audio_init(dev, audio); + /* FIXME - reset video vars */ + ls220_video_reset(dev); + ls220_video_set_vpm(dev, vga); + ls220_load_firmware(dev, audio); + ls220_audio_set_info(dev); + + if(dev->eprom[EPROM_SPDIF_CH/*CHECK ME*/] && !(dev->eprom[EPROM_SPDIF_CH]&0x2)) + { + /* SPDIF */ + ls220_audio_set_spdif(dev, 1); + } + else + ls220_audio_set_spdif(dev, 0); + ls220_video_reset(dev); + ls220_video_init(dev); + ls220_audio_init(dev, 1); +} + +/* + * IRQ handling + */ + +static void ls220_intr(int irq, void *dev_id, struct pt_regs *unused) +{ + struct ls220_dev *dev = dev_id; + u32 r20, r14; + + r20 = ls220_dv_read(dev, 0x20); + if(r20 == 0) + return; + + r14 = ls220_dv_read(dev, 0x14); + if(!(r14 & 0x0104)) + return; + + ls220_dv_write(dev, 0x20, r20&0xfffffefb); + + if(r14 & 0x4) + { + ; /* User event */ + } + if(r14 & 0x100) + { + ; /* Video line reached */ + } + + /* Check - should we clear both bits or clear the r14 value ?? */ + ls220_dv_write(dev, 0x18, ls220_dv_read(dev, 0x18)|0x0104); + ls220_dv_write(dev, 0x20, r20 | 0x0104); +} + +/* + * Hardware setup + */ + +static int ls220_hw_init(struct ls220_dev *dev) +{ + /* Set up base registers */ + if(dev->type == LS240) + dev->dram_base = LS240_DRAM_BASE; + else + dev->dram_base = LS220_DRAM_BASE; + if(ls220_i2c_register(dev)) + return -ENODEV; + /* Initialise video side */ + if(ls220_i2c_probe(dev, 0xA0)) + ls220_load_eeprom(dev, 0xA0, 0, 16, dev->eprom); + ls220_video_reset(dev); + if((dev->tvencoder = ls220_detect_tvencoder(dev))<0) + { + i2c_bit_del_bus(&dev->i2c_adap); + return -ENODEV; + } + printk(KERN_INFO "luxsonor: Found attached %s TV encoder.\n", + lux_tv_names[dev->tvencoder]); + /* Initialise audio side */ + ls220_audio_init(dev, 1); + /* Now reset and bring up */ + ls220_reset(dev); + /* Set up the VMI */ + ls220_video_set_vpm(dev, 0/* For now.. */); + if(ls220_i2c_probe(dev, 0xA0)) + { + ls220_load_eeprom(dev, 0xA0, 0, 16, dev->eprom); + dev->has_eprom = 1; + if(dev->eprom[EPROM_BOARDTYPE] == 1) + { + ls220_send_gpio(dev, 6, 5); /* chrontel setup */ + ls220_send_gpio(dev, 3, 0xf); + } + } + else + { + dev->has_eprom = 0; + dev->eprom[EPROM_TVOUT] = 0; /* NTSC default */ + } + + ls220_load_firmware(dev, 1); /* Default Microcode */ + + ls220_audio_set_info(dev); + + if(dev->eprom[EPROM_SPDIF_CH/*CHECK ME*/] && !(dev->eprom[EPROM_SPDIF_CH]&0x2)) + { + /* SPDIF */ + ls220_audio_set_spdif(dev, 1); + } + else + ls220_audio_set_spdif(dev, 0); + /* Reset again */ + ls220_video_reset(dev); + ls220_audio_init(dev, 1); + ls220_configure_tvout(dev, 0); + return 0; +} + +static int ls220_init_one(struct pci_dev *pdev, const struct pci_device_id *ident) +{ + struct ls220_dev *dev = kmalloc(sizeof(struct ls220_dev), GFP_KERNEL); + if(dev == NULL) + return -ENOMEM; + memset(dev, 0, sizeof(*dev)); + dev->pdev = pdev; + dev->type = ident->driver_data; + + dev->i2c_rc = -1; + + if(pci_enable_device(pdev)<0) + { + kfree(pdev); + return -ENODEV; + } + + pci_set_drvdata(pdev, dev); + + if(request_irq(pdev->irq, ls220_intr, SA_SHIRQ, "ls220", dev)<0) + { + printk(KERN_ERR "ls220: unable to obtain interrupt.\n"); + pci_set_drvdata(pdev, NULL); + kfree(dev); + return -EBUSY; + } + dev->membase = ioremap(pdev->resource[0].start, pci_resource_len(pdev, 0)); + if(dev->membase == NULL) + { + printk(KERN_ERR "ls220: unable to map device.\n"); + free_irq(pdev->irq, dev); + pci_set_drvdata(pdev, NULL); + kfree(dev); + return -ENOMEM; + } + + pci_set_master(pdev); + + printk(KERN_INFO "luxsonor %s at 0x%lX for %ld bytes, IRQ %d.\n", + lux_names[dev->type], pdev->resource[0].start, + pci_resource_len(pdev, 0), pdev->irq); + + if(ls220_hw_init(dev) < 0) + { + free_irq(pdev->irq, dev); + if(dev->i2c_rc != -1) + i2c_bit_del_bus(&dev->i2c_adap); + pci_set_drvdata(pdev, NULL); + kfree(dev); + return -ENODEV; + } + if(dev->type == LS240) + { + ls240_zoomvideo_enable_tristate(dev); + ls240_audiopcm_enable_tristate(dev); + } + + + dev->next = ls_devs; + ls_devs = dev; + + return 0; +} + +static void __devexit ls220_remove_one(struct pci_dev *pdev) +{ + struct ls220_dev *dev = pci_get_drvdata(pdev); + free_irq(dev->pdev->irq, dev); + if(dev->i2c_rc != -1) + i2c_bit_del_bus(&dev->i2c_adap); + iounmap(dev->membase); + pci_disable_device(dev->pdev); +} + +/* + * This code and tables ensures we are notified if there is a + * luxsonor card, either at boot or in the event of a PCI hotplug + */ + +static struct pci_device_id luxsonor_table[] __devinitdata = { + { 0x1287, 0x001F, PCI_ANY_ID, PCI_ANY_ID, LS220C }, /* 220C */ + { 0x1287, 0x001E, PCI_ANY_ID, PCI_ANY_ID, LS220D }, /* 220D */ + { 0x1287, 0x0020, PCI_ANY_ID, PCI_ANY_ID, LS240 }, /* 240 */ + { 0, } +}; + +MODULE_DEVICE_TABLE(pci, luxsonor_table); + +static struct pci_driver luxsonor_driver = +{ + name: "ls220", + id_table: luxsonor_table, + probe: ls220_init_one, + remove: __devexit_p(ls220_remove_one), + /* No power management yet */ +}; + +static int __init luxsonor_init_module(void) +{ + return pci_module_init(&luxsonor_driver); +} + +static void __exit luxsonor_cleanup_module(void) +{ + pci_unregister_driver(&luxsonor_driver); +} + +module_init(luxsonor_init_module); +module_exit(luxsonor_cleanup_module); + +MODULE_AUTHOR("Alan Cox "); +MODULE_LICENSE("GPL"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/Makefile linux.20pre5-ac2/drivers/media/video/Makefile --- linux.20pre5/drivers/media/video/Makefile 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/Makefile 2002-08-06 15:42:12.000000000 +0100 @@ -1,5 +1,5 @@ # -# Makefile for the kernel character device drivers. +# Makefile for the video capture/playback device drivers. # # Note! Dependencies are done automagically by 'make dep', which also # removes any old dependencies. DON'T put your own dependencies here @@ -16,10 +16,6 @@ obj-n := obj- := -SUB_DIRS := -MOD_SUB_DIRS := $(SUB_DIRS) -ALL_SUB_DIRS := $(SUB_DIRS) - O_TARGET := video.o # All of the (potential) objects that export symbols. @@ -31,8 +27,16 @@ bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o +mod-subdirs := margi + obj-$(CONFIG_VIDEO_DEV) += videodev.o +ifeq ($(CONFIG_VIDEO_MARGI),y) + obj-y += margi/margi_cs.o +endif + +subdir-$(CONFIG_VIDEO_MARGI) += margi + obj-$(CONFIG_BUS_I2C) += i2c-old.o obj-$(CONFIG_VIDEO_BT848) += bttv.o msp3400.o tvaudio.o \ tda7432.o tda9875.o tuner.o @@ -58,6 +62,7 @@ obj-$(CONFIG_VIDEO_CPIA_USB) += cpia_usb.o obj-$(CONFIG_VIDEO_MEYE) += meye.o obj-$(CONFIG_TUNER_3036) += tuner-3036.o +obj-$(CONFIG_VIDEO_LS220) += luxsonor.o # Extract lists of the multi-part drivers. # The 'int-*' lists are the intermediate files used to build the multi's. @@ -78,8 +83,6 @@ include $(TOPDIR)/Rules.make -fastdep: - zoran.o: zr36120.o zr36120_i2c.o zr36120_mem.o $(LD) $(LD_RFLAG) -r -o $@ zr36120.o zr36120_i2c.o zr36120_mem.o diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/audio.c linux.20pre5-ac2/drivers/media/video/margi/audio.c --- linux.20pre5/drivers/media/video/margi/audio.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/audio.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,248 @@ +/* + audio.c + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +// +// Audio Decoder +// +#define __NO_VERSION__ + +#include "audio.h" +#include "l64021.h" + +// mode=0 pause +// mode=1 normal speed play +// mode=2 fast play, 16/15 +// mode=3 slow play, 16/17 + +void AudioSetPlayMode(struct cvdv_cards *card, int mode) +{ + DecoderMaskByte(card, 0x163, 0x60, (mode & 0x03) << 5); + // audio decoder play mode + DecoderMaskByte(card, 0x164, 0x60, (((mode) ? 1 : 0) & 0x03) << 5); + // S/PDIF formatter play mode +} + +void AudioStartDecode(struct cvdv_cards *card) +{ + DecoderSetByte(card, 0x163, 0x80); +} + +// Stop Decode flushes the Audio ES channel buffer +void AudioStopDecode(struct cvdv_cards *card) +{ + DecoderDelByte(card, 0x163, 0x80); +} + +void AudioStartFormat(struct cvdv_cards *card) +{ + DecoderSetByte(card, 0x164, 0x80); +} + +void AudioStopFormat(struct cvdv_cards *card) +{ + DecoderDelByte(card, 0x164, 0x80); +} + +// Audio source: S/PDIF out: +// mode 0: MPEG IEC958 +// mode 1: AC3 IEC958 +// mode 2: MPEG MPEG +// mode 3: AC3 AC3 +// mode 4: PCM IEC958 (max. 48kHz) +// mode 5: PCM 96->48kHz IEC958 (48kHz) +// mode 6: CD Bypass S/PDIF Bypass +// mode 7: PCM FIFO PCM FIFO +void AudioSetMode(struct cvdv_cards *card, int mode) +{ + mode &= 0x07; + AudioSetPlayMode(card, MAUDIO_PAUSE); + AudioStopFormat(card); + DecoderMaskByte(card, 0x165, 0xE0, mode << 5); + if ((mode == 2) || (mode == 3)) + AudioStartFormat(card); +} + + +// volume: 0..255 +void AudioSetVolume(struct cvdv_cards *card, int volume) +{ + DecoderWriteByte(card, 0x16A, volume); // Set PCM scale to volume +} + +// mute=1: mute audio +void AudioMute(struct cvdv_cards *card, int mute) +{ + DecoderMaskByte(card, 0x166, 0x40, (mute ? 0x40 : 0x00)); + // mute PCM + DecoderMaskByte(card, 0x16E, 0x10, (mute ? 0x10 : 0x00)); + // mute S/PDIF +} + +// mode=0: stereo +// mode=1: surround +void AudioAC3Mode(struct cvdv_cards *card, int mode) +{ + DecoderMaskByte(card, 0x166, 0x10, (mode ? 0x10 : 0x00)); +} + +// mode=0: custom analog +// mode=1: custom digital +// mode=2: line-out (default) +// mode=3: RF mode +void AudioAC3Compression(struct cvdv_cards *card, int mode) +{ + DecoderMaskByte(card, 0x166, 0x03, mode & 0x03); +} + +// mode=0: AC3 +// mode=1: ES1 +void AudioAC3Formatter(struct cvdv_cards *card, int mode) +{ + DecoderMaskByte(card, 0x166, 0x03, mode & 0x03); +} + +// mode=0: Stereo +// mode=1: Right channel only +// mode=2: Left channel only +// mode=3: Mono Mix +void AudioDualMono(struct cvdv_cards *card, int mode) +{ + DecoderMaskByte(card, 0x166, 0x0C, (mode & 0x03) << 2); +} + +// swap=0: L->L, R->R +// swap=1: L->R, R->L +void AudioSwap(struct cvdv_cards *card, int swap) +{ + DecoderMaskByte(card, 0x16B, 0x04, (swap ? 0x00 : 0x04)); +} + +// select=0: use clock from ACLK_441 pin -> ACLK=44.1kHz*N +// select=1: use clock from ACLK_48 pin -> ACLK=48.0kHz*N +// select=2: use clock from ACLK_32 pin -> ACLK=32.0kHz*N +// Since the programmable sample rate generator of the PCM1723 is connected to +// all 3 of them, it doen't matter wich one you choose. +// divider=0: ACLK=768*Fs / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/12 / DAC-A_ACLK=ACLK/3 +// divider=1: ACLK=768*Fs / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/12 / DAC-A_ACLK=ACLK/2 +// divider=2: ACLK=512*Fs / S/PDIF-BCLK=ACLK/4 / DAC-BCLK=ACLK/8 / DAC-A_ACLK=ACLK/2 +// divider=3: ACLK=384*Fs / S/PDIF-BCLK=ACLK/3 / DAC-BCLK=ACLK/6 / DAC-A_ACLK=ACLK/1 +// divider=4: ACLK=256*Fs / S/PDIF-BCLK=ACLK/2 / DAC-BCLK=ACLK/4 / DAC-A_ACLK=ACLK/1 +// divider=5: ACLK=768*48kHz / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/6 / DAC-A_ACLK=ACLK/1 +// divider=6: ACLK=512*48kHz / S/PDIF-BCLK=ACLK/4 / DAC-BCLK=ACLK/4 / DAC-A_ACLK=ACLK/1 +// divider=C: ACLK=768*48kHz / S/PDIF-BCLK=ACLK/9 / DAC-BCLK=ACLK/18 / DAC-A_ACLK=ACLK/3 +// divider=D: ACLK=512*48kHz / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/12 / DAC-A_ACLK=ACLK/3 +// divider=E: ACLK=512*48kHz / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/12 / DAC-A_ACLK=ACLK/2 +// divider=F: ACLK=256*48kHz / S/PDIF-BCLK=ACLK/3 / DAC-BCLK=ACLK/6 / DAC-A_ACLK=ACLK/1 +// Fs is the audio sample frequency +// For the normal cases, (32, 44.1, and 48 kHz) select divider 0 through 4 and set +// sample frequency in PCM1723 accordingly +// For 96 kHz, select divider 5 or 6, and set PCM1723 to 48kHz*768 or *512 resp. +// Divider C through F are for 32 kHz sample frequency with a 48kHz*x ACLK +void AudioSetACLK(struct cvdv_cards *card, int select, int divider) +{ + DecoderMaskByte(card, 0x16B, 0x03, select & 0x03); + DecoderMaskByte(card, 0x16C, 0x0F, divider & 0x0F); +} + +int AudioOpen(struct cvdv_cards *card) +{ + // initialize the audio card + MDEBUG(1, ": -- AudioOpen\n"); + write_indexed_register(card, IIO_OSC_AUD, 0x10); + return 0; +} + +int AudioClose(struct cvdv_cards *card) +{ + MDEBUG(1, ": -- AudioClose\n"); + card->AudioInitialized = 0; + return 0; +} + +// audiorate: 16, 32, 64, 22(.05), 44(.1), 88(.2), 24, 48, 96 kHz +// surround=0: Stereo +// surround=1: Surround +int AudioInit(struct cvdv_cards *card, int audiorate, int surround) +{ + //if ((audiorate!=44) && (audiorate!=32)) audiorate=48; + MDEBUG(1, ": -- AudioInit %d\n", audiorate); + + DACSetFrequency(card, audiorate, 256); // put Fs*256 on ACLK inputs + + if (audiorate == 96) + AudioSetACLK(card, 1, 0x06); // 512*48kHz at ACLK + else + AudioSetACLK(card, 1, 0x04); // 256 times Fs at ACLK + + DecoderDelByte(card, 0x166, 80); // no mute on error + DecoderWriteByte(card, 0x168, 0xFF); // dynscalehigh + DecoderWriteByte(card, 0x169, 0xFF); // dynscalelow + DecoderWriteByte(card, 0x16A, 0xFF); // PCM scale + + // IEC958 Setup + DecoderDelByte(card, 0x16D, 0x20); // Overwrite Emphasis off + DecoderSetByte(card, 0x16D, 0x40); // Copyright Override + DecoderDelByte(card, 0x16D, 0x80); // Copyright Bit off + DecoderDelByte(card, 0x16E, 0x01); // Overwrite Category off + DecoderDelByte(card, 0x16E, 0x08); // Overwrite Quatization off + DecoderSetByte(card, 0x170, 0x08); // Musicam Stream Debug + + AudioAC3Mode(card, (surround ? 1 : 0)); + AudioAC3Compression(card, 2); + AudioAC3Formatter(card, 0); + + AudioDualMono(card, 0); + AudioSwap(card, 0); + + AudioMute(card, 0); +// AudioSetPlayMode(card,MAUDIO_PLAY); + + card->AudioInitialized = 1; + return 0; +} + + +// returns size of the Video ES Buffer in bytes or 0=error +u32 DecoderGetAudioESSize(struct cvdv_cards * card) +{ + if (!card->ChannelBuffersAllocated) + return 0; // buffer not initialised + return (u32) ((DecoderReadWord(card, 0x04E) & 0x3FFF) - + (DecoderReadWord(card, 0x04C) & 0x3FFF)) * 256; // bytes +} + +// returns level of fullness in bytes +u32 DecoderGetAudioESLevel(struct cvdv_cards * card) +{ + u32 items; + items = DecoderReadByte(card, 0x089); + items |= ((DecoderReadWord(card, 0x08A) & 0x07FF) << 8); + items *= 8; // 64 bit per item + return items; +} + +int DecoderKaraoke(struct cvdv_cards *card, int vocal1, int vocal2, + int melody) +{ + DecoderMaskByte(card, 0x18C, 0x40, ((vocal1) ? 0x40 : 0x00)); + DecoderMaskByte(card, 0x18C, 0x80, ((vocal2) ? 0x80 : 0x00)); + DecoderMaskByte(card, 0x18C, 0x20, ((melody) ? 0x20 : 0x00)); + return 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/audio.h linux.20pre5-ac2/drivers/media/video/margi/audio.h --- linux.20pre5/drivers/media/video/margi/audio.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/audio.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,136 @@ +/* + audio.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + +#ifndef CVDV_AUDIO_H +#define CVDV_AUDIO_H + + // + // Audio Decoder +// +#define __NO_VERSION__ + +#include "cardbase.h" + +#define MAUDIO_PAUSE 0 +#define MAUDIO_PLAY 1 +#define MAUDIO_FAST 2 +#define MAUDIO_SLOW 3 + +// mode=0 pause +// mode=1 normal speed play +// mode=2 fast play, 16/15 +// mode=3 slow play, 16/17 +void AudioSetPlayMode(struct cvdv_cards *card, int mode); + +void AudioStartDecode(struct cvdv_cards *card); + +// Stop Decode flushes the Audio ES channel buffer +void AudioStopDecode(struct cvdv_cards *card); + +void AudioStartFormat(struct cvdv_cards *card); + +void AudioStopFormat(struct cvdv_cards *card); + +// Audio source: S/PDIF out: +// mode 0: MPEG IEC958 +// mode 1: AC3 IEC958 +// mode 2: MPEG MPEG +// mode 3: AC3 AC3 +// mode 4: PCM IEC958 (max. 48kHz) +// mode 5: PCM 96->48kHz IEC958 (48kHz) +// mode 6: CD Bypass S/PDIF Bypass +// mode 7: PCM FIFO PCM FIFO +void AudioSetMode(struct cvdv_cards *card, int mode); + + +// volume: 0..255 +void AudioSetVolume(struct cvdv_cards *card, int volume); + +// mute=1: mute audio +void AudioMute(struct cvdv_cards *card, int mute); + +// mode=0: stereo +// mode=1: surround +void AudioAC3Mode(struct cvdv_cards *card, int mode); + +// mode=0: custom analog +// mode=1: custom digital +// mode=2: line-out (default) +// mode=3: RF mode +void AudioAC3Compression(struct cvdv_cards *card, int mode); + +// mode=0: AC3 +// mode=1: ES1 +void AudioAC3Formatter(struct cvdv_cards *card, int mode); + +// mode=0: Stereo +// mode=1: Right channel only +// mode=2: Left channel only +// mode=3: Mono Mix +void AudioDualMono(struct cvdv_cards *card, int mode); + +// swap=0: L->L, R->R +// swap=1: L->R, R->L +void AudioSwap(struct cvdv_cards *card, int swap); + +// select=0: use clock from ACLK_441 pin -> ACLK=44.1kHz*N +// select=1: use clock from ACLK_48 pin -> ACLK=48.0kHz*N +// select=2: use clock from ACLK_32 pin -> ACLK=32.0kHz*N +// Since the programmable sample rate generator of the PCM1723 is connected to +// all 3 of them, it doen't matter wich one you choose. +// divider=0: ACLK=768*Fs / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/12 / DAC-A_ACLK=ACLK/3 +// divider=1: ACLK=768*Fs / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/12 / DAC-A_ACLK=ACLK/2 +// divider=2: ACLK=512*Fs / S/PDIF-BCLK=ACLK/4 / DAC-BCLK=ACLK/8 / DAC-A_ACLK=ACLK/2 +// divider=3: ACLK=384*Fs / S/PDIF-BCLK=ACLK/3 / DAC-BCLK=ACLK/6 / DAC-A_ACLK=ACLK/1 +// divider=4: ACLK=256*Fs / S/PDIF-BCLK=ACLK/2 / DAC-BCLK=ACLK/4 / DAC-A_ACLK=ACLK/1 +// divider=5: ACLK=768*48kHz / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/6 / DAC-A_ACLK=ACLK/1 +// divider=6: ACLK=512*48kHz / S/PDIF-BCLK=ACLK/4 / DAC-BCLK=ACLK/4 / DAC-A_ACLK=ACLK/1 +// divider=C: ACLK=768*48kHz / S/PDIF-BCLK=ACLK/9 / DAC-BCLK=ACLK/18 / DAC-A_ACLK=ACLK/3 +// divider=D: ACLK=512*48kHz / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/12 / DAC-A_ACLK=ACLK/3 +// divider=E: ACLK=512*48kHz / S/PDIF-BCLK=ACLK/6 / DAC-BCLK=ACLK/12 / DAC-A_ACLK=ACLK/2 +// divider=F: ACLK=256*48kHz / S/PDIF-BCLK=ACLK/3 / DAC-BCLK=ACLK/6 / DAC-A_ACLK=ACLK/1 +// Fs is the audio sample frequency +// For the normal cases, (32, 44.1, and 48 kHz) select divider 0 through 4 and set +// sample frequency in PCM1723 accordingly +// For 96 kHz, select divider 5 or 6, and set PCM1723 to 48kHz*768 or *512 resp. +// Divider C through F are for 32 kHz sample frequency with a 48kHz*x ACLK +void AudioSetACLK(struct cvdv_cards *card, int select, int divider); + +int AudioOpen(struct cvdv_cards *card); + +int AudioClose(struct cvdv_cards *card); + +// audiorate: 16, 32, 64, 22(.05), 44(.1), 88(.2), 24, 48, 96 kHz +// surround=0: Stereo +// surround=1: Surround +int AudioInit(struct cvdv_cards *card, int audiorate, int surround); + + +// returns size of the Video ES Buffer in bytes or 0=error +u32 DecoderGetAudioESSize(struct cvdv_cards *card); + +// returns level of fullness in bytes +u32 DecoderGetAudioESLevel(struct cvdv_cards *card); + +int DecoderKaraoke(struct cvdv_cards *card, int vocal1, int vocal2, + int melody); + +#endif /* CVDV_AUDIO_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/AUTHORS linux.20pre5-ac2/drivers/media/video/margi/AUTHORS --- linux.20pre5/drivers/media/video/margi/AUTHORS 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/AUTHORS 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,6 @@ +Christian Wolff scarabaeus@convergence.de +Marcus Metzler mocm@convergence.de + +Many thanks to +Shigehiro Nomura s.nomura@mba.nifty.ne.jp +for his ZV-patches for Libretto diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/cardbase.c linux.20pre5-ac2/drivers/media/video/margi/cardbase.c --- linux.20pre5/drivers/media/video/margi/cardbase.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/cardbase.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,234 @@ +/* + cardbase.c + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#define __NO_VERSION__ + +#include "cardbase.h" + +// List of pci cards in the system +struct cvdv_cards *first_card = NULL; +struct cvdv_cards *minorlist[MAXDEV]; + +u8 FlushPacket[32] = { + 0x00, 0x00, 0x01, 0xE0, // video stream start code + 0x00, 0x1a, // 26 more bytes + 0x81, 0xC1, // flags: copy=1, PTS_DTS=11, PES_extension=1 + 0x0D, // 13 more header bytes + 0x31, 0x00, 0x03, 0x5F, 0xEB, // PTS + 0x11, 0x00, 0x03, 0x48, 0x75, // DTS + 0x1E, // flags: P-STD_buffer=1, + 0x60, 0xE8, // P-STD_buffer_scale=1, P-STD_buffer_size=232(kByte) + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + +void DecoderStreamReset(struct cvdv_cards *card) +{ + card->stream.valid = 0; + card->stream.sh.valid = 0; + card->stream.se.valid = 0; + card->stream.gop.valid = 0; + card->stream.MPEG2 = 0; + card->stream.audio.valid = 0; + memset(&card->stream.audio.mpeg,0,sizeof(struct AudioMPEG)); + memset(&card->stream.audio.ac3,0,sizeof(struct AudioAC3)); + memset(&card->stream.audio.pcm,0,sizeof(struct AudioPCM)); + card->AuxFifoExt = 0; + card->AuxFifoLayer = -1; +} +void PTSStoreInit(PTSStorage * store, int size) +{ + int i; + if (size > MAX_PTS) + size = MAX_PTS; + store->size = size; + store->begin = 0; + store->end = 0; + store->LastAddr = 0; + for (i = 0; i < store->size; i++) { + store->AddrB[i] = 0; + store->AddrE[i] = 0; + store->PTS[i] = 0; + } +} + +void DecoderCSSReset(struct cvdv_cards *card) +{ + card->css.status = 0; + card->css.ChallengeReady = 0; + card->css.ResponseReady = 0; + card->css.DiskKey = 0; + card->css.TitleKey = 0; + card->css.Error = 0; + card->css.TitleKeyDiff = 0; + card->LastAddr = 0; // last used address in PES buffer + card->VPTS = 0; + card->oldVPTS = 0; + card->VSCR = 0; + card->APTS = 0; + card->oldAPTS = 0; + card->ASCR = 0; + card->SyncTime = 0; + card->paused = 0; // pause status + card->lastvattr = 0; // last set dvd video attribute + card->lastaattr = 0; // last set dvd audio attribute + card->nonblock = 0; +} + +void DecoderSetupReset(struct cvdv_cards *card) +{ + card->DecoderOpen = 0; + card->closing = 0; + card->channelrun = 0; + card->setup.streamtype = stream_none; + card->setup.audioselect = audio_none; + card->setup.videoID = 0; + card->setup.audioID = 0; + card->setup.audioIDext = -1; + card->setup.SPDIFmode = 0; + card->startingV = 0; + card->startingA = 0; + card->startingDVDV = 0; + card->startingDVDA = 0; + card->videodelay = 0; + card->videodelay_last = 0; + card->videoslow_last = 0; + card->videoslow = 0; + card->videoffwd = 0; + card->videoffwd_last = 0; + card->videoskip = 0; + card->videoskip_last = 0; + card->videosync = 0; + card->paused = 0; + PTSStoreInit(&card->VideoPTSStore, MAX_PTS); + PTSStoreInit(&card->AudioPTSStore, MAX_PTS); +#ifdef DVB + card->audiostate.AVSyncState=true; +#endif +} + + + +void card_init(struct cvdv_cards *card, unsigned int minor) +{ + card->DRAMFirstBlock = NULL; + card->DRAMSize = 0; + card->OSD.open = 0; + card->DMAABusy = 0; + card->DMABBusy = 0; + card->IntInstalled = 0; + card->ChannelBuffersAllocated = 0; + card->VideoES = BLANK; + card->AudioES = BLANK; + card->VideoPES = BLANK; + card->DataDump = BLANK; + card->AudioPES = BLANK; + card->NaviBank = BLANK; + card->FrameBuffersAllocated = 0; + card->FrameStoreLuma1 = BLANK; + card->FrameStoreChroma1 = BLANK; + card->FrameStoreLuma2 = BLANK; + card->FrameStoreChroma2 = BLANK; + card->FrameStoreLumaB = BLANK; + card->FrameStoreChromaB = BLANK; + card->DecoderOpen = 0; + card->AuxFifoHead = 0; + card->AuxFifoTail = 0; + card->DataFifoHead = 0; + card->DataFifoTail = 0; + card->FifoALast = -1; + card->FifoBLast = -1; + //reset_stream(card); + DecoderStreamReset(card); + DecoderSetupReset(card); + card->AudioInitialized = 0; + card->AudioOldMode = -1; + card->closing = 0; + card->startingV = 0; + card->startingA = 0; + card->startingDVDV = 0; + card->startingDVDA = 0; + card->channelrun = 0; + card->fields = 0; + DecoderCSSReset(card); + card->NaviPackAddress = 0; + init_waitqueue_head(&card->wqA); + init_waitqueue_head(&card->wqB); + card->navihead = 0; // write pointer for navi ring buffer + card->navitail = 0; // read pointer for navi ring buffer + card->intdecodestatus = 0; // last status of decode interrupt + card->showvideo = 0; // show video instead black as soon as picture slice is there + card->videodelay = 0; // slow counter + card->videodelay_last = 0; // slow counter + card->videoffwd = 0; // fast playback + card->videoffwd_last = 0; // fast playback + card->videoskip = 0; // fast counter + card->videoskip_last = 0; // fast counter + card->videoslow_last = 0; + card->videoslow = 0; + card->videosync = 0; // do audio/video sync basen on PTS? + PTSStoreInit(&card->VideoPTSStore, MAX_PTS); + PTSStoreInit(&card->AudioPTSStore, MAX_PTS); + card->LastAddr = 0; // last used address in PES buffer + card->VPTS = 0; + card->oldVPTS = 0; + card->VSCR = 0; + card->APTS = 0; + card->oldAPTS = 0; + card->ASCR = 0; + card->SyncTime = 0; + card->paused = 0; // pause status + card->lastvattr = 0; // last set dvd video attribute + card->lastaattr = 0; // last set dvd audio attribute + card->reg08F = 0; // mirror of decoder registers + card->reg090 = 0; + card->reg091 = 0; + card->reg092 = 0; + card->reg093 = 0; + card->highlight_valid = 0; // SPU highlight info available for next BAV int + card->do_flush = 0; + + card->open = 0; + + card->VideoESSize = 0; + card->AudioESSize = 0; + card->VideoPESSize = 0; + card->DataDumpSize = 0; + card->AudioPESSize = 0; + card->NaviBankSize = 0; + card->currentType = -1; + card->rbufA.buffy = NULL; + card->rbufB.buffy = NULL; + card->use_ringA = 0; + card->use_ringB = 0; + card->minor = minor; + card->hasZV = 0; +#ifdef NOINT + init_timer(&card->timer); + spin_lock_init(&card->timelock); +#endif +#ifdef DVB + card->dvb_registered = 0; + card->audiostate.AVSyncState=true; + card->nonblock = 0; +#endif + card->svhs = 0; + card->composite = 0; +} + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/cardbase.h linux.20pre5-ac2/drivers/media/video/margi/cardbase.h --- linux.20pre5/drivers/media/video/margi/cardbase.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/cardbase.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,454 @@ +/* + cardbase.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef CARDBASE_H +#define CARDBASE_H + +#define __DVB_PACK__ +#define USE_OSD +#define NOINT +#define DVB +#define USE_ZV + +#ifdef PCMCIA_DEBUG +static int pc_debug = PCMCIA_DEBUG; +MODULE_PARM(pc_debug, "i"); +#define MARGI_DEBUG (pc_debug) +#else +#define MARGI_DEBUG 2 +#endif + +// all the internal structs + +#include + +#include "ringbuffy.h" + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef DVB +#include "dvbdev.h" +#ifdef __DVB_PACK__ +#include "ost/video.h" +#include "ost/audio.h" +#include "ost/demux.h" +#include "ost/dmx.h" +#include "ost/sec.h" +#include "ost/frontend.h" +#include "ost/ca.h" +#include "ost/osd.h" +#else +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#include "dvb_demux.h" +#include "dmxdev.h" +#include "dvb_filter.h" +#endif +// List of pci cards in the system + +#include "cvdvtypes.h" + +#define DVERSION "0.6.0" +#define SHORTDEVNAME "ConvDVD" +#define MEDDEVNAME "convergence DVD" +#define LONGDEVNAME "convergence DVD Video Decoder" +#define LOGNAME "convdvd " +#define NBBUF 8 + + +#ifdef MARGI_DEBUG +#define MDEBUG(n, args...) if (MARGI_DEBUG>(n)) printk(KERN_ERR LOGNAME args) +#else +#define MDEBUG(n, args...) +#endif + + +#define VID_PAN_SCAN_PREF 0x01 /* Pan and Scan Display preferred */ +#define VID_VERT_COMP_PREF 0x02 /* Vertical compression display preferred */ +#define VID_VC_AND_PS_PREF 0x03 /* PanScan and vertical Compression if allowed */ +#define VID_CENTRE_CUT_PREF 0x05 /* PanScan with zero vector */ + + +// Character device definitions +// char dev name +#define CVDV_PROCNAME "msc" // Media Stream Consumer +// got to get another number +#define CVDV_MAJOR 200 // 0=dynamic assignment + +// Author definitions +#define NAME "Christian Wolff" +#define EMAIL "scarabaeus@convergence.de" +#define COMPANY "convergence integrated media GmbH" +#define AUTHOR NAME " <" EMAIL "> " COMPANY + +#define MAXDEV 1 // maximum number of cards, distance between minor devices + +#define MINORNUM (256/MAXDEV) // number of minor devices + +#define NAVISIZE 1024 // size of one navi block +#define NAVIBUFFERSIZE NAVISIZE*10 // size of ten navi blocks + +#define BLANK 0xFFFFFFFF + +#define FIFO_MASK 1023 + +#define CCIR601Lines(system) (((system==NTSC) || (system==NTSC60) || (system==PALM) || (system==PALM60) || (system==PAL60))?525:625) + +// default video mode +#define VIDEO_MODE PAL +//#define VIDEO_MODE NTSC + +struct DRAMBlock { + u32 start; // start address of the block; (21 bit word address, 64 bit aligned) + u32 length; // length of the block (in 16 bit words) + struct DRAMBlock *next; // chain link +}; + +struct CSS { + u8 status; // interrupt status from Register 0x0B0 + int ChallengeReady; // 1 if challenge data valid + u8 challenge[10]; // challenge data + int ResponseReady; // 1 if response data valid + u8 response[5]; // response data + int DiskKey; // 1 if disk key extraction complete + int TitleKey; // 1 if title key decryption complete + int Error; // 1 if authentication or disc key extraction + int TitleKeyDiff; // 1 if title key different from previous +}; + +struct GOPHeader { + int valid; // 1: struct contains valid data + int timecode; + int closedgop; + int brokenlink; +}; + +struct SequenceHeader { + int valid; // 1: struct contains valid data + int hsize; + int vsize; + int aspectratio; + int frameratecode; + int bitrate; + int vbvbuffersize; + int constrained; +}; + +struct SequenceExtension { + int valid; // 1: struct contains valid data + int profilelevel; + int progressive; + int chroma; + int hsizeext; + int vsizeext; + int bitrateext; + int vbvbuffersizeext; + int lowdelay; + int frextn; + int frextd; +}; + +struct AudioMPEG { + int present; // true: MPEG audio stream present + int MPEG2; // 0:MPEG1 Audio + int layer; // 1..3 (I..III) + int bitrate; // 0=free, 32-448 kbps + int samplefreq; // 32,44,48 (44 eq. 44.1) + int mode; // 0=stereo 1=joint-stereo 2=dualchannel 3=single channel (just right channel) + int modeext; // Layer I&II: intensity stereo subbands Layer III: bit 0=intensity stereo, bit 1=ms-stereo + int copyright; // true=copyrighted material + int original; // 0=copy true=original + int emphasis; // 0=no emph. 1=50/15usec 3=CCITT J.17 +}; + +struct AudioAC3 { + int present; // 1: AC3 audio stream present + int acmod; // parameters from the AC3 documentation + int bsmod; + int dialnorm; + int dialnorm2; + int surmixlev; + int mixlevel; + int cmixlev; + int mixlevel2; + int fscod; + int lfeon; + int bsid; + int dsurmod; + int frmsizecod; + int langcod; + int langcod2; + int timecod; + int roomtyp; + int timecod2; + int roomtyp2; +}; + +struct AudioPCM { + int present; // 1: PCM audio stream present + int audio_frm_num; + int num_of_audio_ch; + int Fs; + int quantization; + int emphasis; + int mute_bit; +}; + +struct AudioParam { + int valid; + struct AudioMPEG mpeg; + struct AudioAC3 ac3; + struct AudioPCM pcm; +}; + +struct OSDPicture { // all u32 pointers are 21 bit word addresses + int open; // are the buffers initialized? + int width; // frame width + int height; // frame height + int bpp; // bit per pixel + int evenfirst; // first line is in even field + int aspectratio; // pixel aspect ratio: 11/aspectratio + int oddheight; // height of the odd field + u32 oddmem; // DRAM address of allocated memory + u32 odddata; // data (=header) pointer + u32 oddpalette; // pointer to palette inside data + u32 oddbitmap; // pointer to bitmap inside data + u32 oddterm; // pointer to termination header + int evenheight; // height of the even field + u32 evenmem; // DRAM address of allocated memory + u32 evendata; // data (=header) pointer + u32 evenpalette; // pointer to palette inside data + u32 evenbitmap; // pointer to bitmap inside data + u32 eventerm; // pointer to termination header +}; + +struct StreamInfo { + int valid; // 1: struct contains valid data + int MPEG2; // 0: MPEG1/ISO11172 1: MPEG2/ISO13818 + int hsize; // overall hsize (hsize&hsizeext) + int vsize; // overall vsize (vsize&vsizeext) + int bitrate; // overall bitrate (bitrate&bitrateext) + int vbvbuffersize; // overall... + struct GOPHeader gop; + struct SequenceHeader sh; + struct SequenceExtension se; + struct AudioParam audio; +}; + +struct StreamSetup { // user selected parameters for the stream playback + stream_type streamtype; // what is the type of our input stream? + audio_type audioselect; // 0=auto/unknown 1=MPEG 2=LPCM 3=AC3 + int videoID; // stream ID of the video ES, -1 for any + int audioID; // stream ID of the audio ES, -1 for any + int audioIDext; // stream ID of the audio extension ES, -1 for none + int SPDIFmode; // 0:MPEG/AC3 data on digital S/PDIF out 1:IEC956 data on digital S/PDIF out +}; + +#define MAX_PTS 256 + +typedef struct PTSRecord { + int begin; + int end; + int size; + u32 LastAddr; + u32 AddrB[MAX_PTS]; + u32 AddrE[MAX_PTS]; + u32 PTS[MAX_PTS]; +} PTSStorage; + +#define DVB_DEVS_MAX 9 + +typedef struct dvb_devs_s { + int num; + int tab[DVB_DEVS_MAX]; + int max_users[DVB_DEVS_MAX]; + int max_writers[DVB_DEVS_MAX]; +} dvb_devs_t; + +struct cvdv_cards { +#ifdef DVB + struct dvb_device dvb_dev; + dvb_demux_t demux; +#endif + struct cvdv_cards *next; + void *margi; + struct bus_operations *bus; + u_char scl; + u_char sda; + int i2c_addr; + u32 VideoESSize; + u32 AudioESSize; + u32 VideoPESSize; + u32 DataDumpSize; + u32 AudioPESSize; + u32 NaviBankSize; + int currentType; + ringbuffy rbufA; + ringbuffy rbufB; + int use_ringA; + int use_ringB; + int nonblock; + u8 *addr; + unsigned int size; + unsigned int minor; + struct DRAMBlock *DRAMFirstBlock; + u32 DRAMSize; + struct OSDPicture OSD; + int DMAABusy; // Is the DMA A currently in use? + int DMABBusy; // Is the DMA B currently in use? + int IntInstalled; // is the card interrupt routine installed? + int ChannelBuffersAllocated; // Are the channel buffers for the decoder allocated? + u32 VideoES; // 21 bit word address of the allocated channel + u32 AudioES; // 21 bit word address of the allocated channel + u32 VideoPES; // 21 bit word address of the allocated channel + u32 DataDump; // 21 bit word address of the allocated channel + u32 AudioPES; // 21 bit word address of the allocated channel + u32 NaviBank; // 21 bit word address of the allocated channel + int FrameBuffersAllocated; // Are the frame buffers for the decoder allocated? + u32 FrameStoreLuma1; // 21 bit word address of the allocated frame + u32 FrameStoreChroma1; // 21 bit word address of the allocated frame + u32 FrameStoreLuma2; // 21 bit word address of the allocated frame + u32 FrameStoreChroma2; // 21 bit word address of the allocated frame + u32 FrameStoreLumaB; // 21 bit word address of the allocated frame + u32 FrameStoreChromaB; // 21 bit word address of the allocated frame + int DecoderOpen; // Is the Decoder initialized? + u16 AuxFifo[FIFO_MASK + 1]; // Auxiliary Fifo Data + int AuxFifoHead; // Auxiliary Fifo Position + int AuxFifoTail; // Auxiliary Fifo Position + u16 DataFifo[FIFO_MASK + 1]; // Data Fifo Data + int DataFifoHead; // Data Fifo Position + int DataFifoTail; // Data Fifo Position + int FifoALast; // last used thread of FIFO A + int FifoBLast; // last used thread of FIFO B + videosystem videomode; // current video output mode, PAL or NTSC + struct StreamInfo stream; // header information of the current stream + struct StreamSetup setup; // should be filled bevor sending data, but default is OK + int AuxFifoExt; // used by Aux FIFO parser + int AuxFifoLayer; // " " " " " + int AudioInitialized; // Is the Audio set up? + int AudioOldMode; // remainder of the previous mode while trickmodes, or -1 + int open; // is the 64017 initialized and the video out active? + int closing; // 1 if char device closed, but DMA still running + int startingV; // 1 if card is waiting for the Video ES buffer to fill up, to start the decoder + int startingA; // 1 if card is waiting for the Audio ES buffer to fill up, to start the decoder + int startingDVDV; // 1 if card is waiting for the Video ES buffer to fill up, to start the decoder + int startingDVDA; // 1 if card is waiting for the Audio ES buffer to fill up, to start the decoder + int channelrun; // 1 if channel has been started by the host + int fields; // counter of video fields, debugging only + struct CSS css; // CSS data + u32 NaviPackAddress; // Read address of the Navi Pack Buffer + wait_queue_head_t wqA; + wait_queue_head_t wqB; + u8 navibuffer[NAVIBUFFERSIZE]; + int navihead; + int navitail; + int intdecodestatus; + int showvideo; + int videodelay; + int videodelay_last; + int videoskip; + int videoskip_last; + int videosync; + int videoslow; + int videoslow_last; + int videoffwd; + int videoffwd_last; + PTSStorage VideoPTSStore; + PTSStorage AudioPTSStore; + u32 LastAddr; + u32 VPTS; + u32 oldVPTS; + long VSCR; + u32 APTS; + u32 oldAPTS; + int scrset; + long ASCR; + long SyncTime; + int paused; + u16 lastvattr; + u16 lastaattr; + u8 reg07B; // mirrors of write-only register + u8 reg08F; + u8 reg090; + u8 reg091; + u8 reg092; + u8 reg093; + u8 highlight[10]; // content of registers 1C0 thru 1C0, to be written after next BAV int. + int highlight_valid; // if 1 + int do_flush; // if 1, send flush packet after last transfer done + int hasZV; +#ifdef NOINT + struct timer_list timer; + spinlock_t timelock; +#endif + +#ifdef DVB + dvb_devs_t *dvb_devs; + int users[DVB_DEVS_MAX]; + int writers[DVB_DEVS_MAX]; + + dmxdev_t dmxdev; + boolean video_blank; + struct videoStatus videostate; + struct audioStatus audiostate; + int dvb_registered; + char demux_id[16]; + dmx_frontend_t mem_frontend; + ipack tsa; + ipack tsv; +#endif + + int svhs; + int composite; +}; + +extern u8 FlushPacket[32]; + +extern struct cvdv_cards *first_card; +extern struct cvdv_cards *minorlist[MAXDEV]; + +void DecoderStreamReset(struct cvdv_cards *card); + +void DecoderSetupReset(struct cvdv_cards *card); + +void DecoderCSSReset(struct cvdv_cards *card); + +void card_init(struct cvdv_cards *card, unsigned int minor); + +#endif /* CARDBASE_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/CHANGES linux.20pre5-ac2/drivers/media/video/margi/CHANGES --- linux.20pre5/drivers/media/video/margi/CHANGES 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/CHANGES 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,30 @@ +version 0.6 +- added ZV initialisation +- added diff for ZV support in pcmcia-cs version <= 3.1.25 +- added v4l device +- added dvb api devices +- tested it with powerbook g4 and pcmcia-cs-3.1.24 +- WARNING, on some computers using FFWD and slow motion may cause hangups + +version 0.5 +- should work with 2.4.0-test12 +- added driver to public CVS at linuxtv.org + http://linuxtv.org/cgi-bin/cvsweb.cgi/ +- added 32kHz audio support +- fixed problem with PAL MPEG1 playback +- fixed problem with playback of MPEGs with lots of PTS +- fixed switching audio channels + +version 0.4.3 +- it is now working with 2.4.0-test10 and later kernels. Use pcmcia-cs-3.1.22 + and later.(Don't use kernel pcmcia,it's not tested with that. ) +- added playfile to the testsuite + +version 0.4.2 +- changed major device number to 200 until we get a new one +- changed some buffer settings for DVD playback +- added some programming examples in testsuit directory +- some other minor improvements + +version 0.4.1 +- corrected makefile error diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/COPYING linux.20pre5-ac2/drivers/media/video/margi/COPYING --- linux.20pre5/drivers/media/video/margi/COPYING 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/COPYING 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/crc.c linux.20pre5-ac2/drivers/media/video/margi/crc.c --- linux.20pre5/drivers/media/video/margi/crc.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/crc.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,78 @@ +/* + crc.c + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/*--------------------------------------------------------- + +Cyclic Redundancy Check 16 and 32 Bit + +Christian Wolff, 19990122 + +---------------------------------------------------------*/ + +#define __NO_VERSION__ + +#include "crc.h" + +unsigned short crc_16_table[256]; +unsigned long crc_32_table[256]; + +// generate the tables of CRC-16 and CRC-32 remainders for all possible bytes +void gen_crc_table() +{ + register int i, j; + register unsigned short crc16; + register unsigned long crc32; + for (i = 0; i < 256; i++) { + crc16 = (unsigned short) i << 8; + crc32 = (unsigned long) i << 24; + for (j = 0; j < 8; j++) { + if (crc16 & 0x8000) + crc16 = (crc16 << 1) ^ POLYNOMIAL_16; + else + crc16 = (crc16 << 1); + if (crc32 & 0x80000000L) + crc32 = (crc32 << 1) ^ POLYNOMIAL_32; + else + crc32 = (crc32 << 1); + } + crc_16_table[i] = crc16; + crc_32_table[i] = crc32; + } +} + +// update the CRC on the data block one byte at a time +unsigned short update_crc_16_block(unsigned short crc, + char *data_block_ptr, + int data_block_size) +{ + register int i; + for (i = 0; i < data_block_size; i++) + crc = update_crc_16(crc, *data_block_ptr++); + return crc; +} + +unsigned long update_crc_32_block(unsigned long crc, char *data_block_ptr, + int data_block_size) +{ + register int i; + for (i = 0; i < data_block_size; i++) + crc = update_crc_32(crc, *data_block_ptr++); + return crc; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/crc.h linux.20pre5-ac2/drivers/media/video/margi/crc.h --- linux.20pre5/drivers/media/video/margi/crc.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/crc.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,56 @@ +/* + crc.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +/*--------------------------------------------------------- + +Cyclic Redundancy Check 16 and 32 Bit - Header File + +Christian Wolff, 19990122 + +---------------------------------------------------------*/ + +#ifndef _CRC_H_ +#define _CRC_H_ + +// 16 Bit CCITT standard polynomial x^16 + x^12 + x^5 + x^1 + x^0 +#define POLYNOMIAL_16 0x1021 +// 32 Bit standard polynomial x^32 + x^26 + x^23 + x^22 + x^16 + +// x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + x^0 +#define POLYNOMIAL_32 0x04C11DB7L + +#define CRC_INIT_16 0xFFFF +#define CRC_INIT_32 0xFFFFFFFFL + +#define update_crc_16(crc, data) ((crc << 8) ^ crc_16_table[((int)(crc >> 8 ) ^ (data)) & 0xFF]) +#define update_crc_32(crc, data) ((crc << 8) ^ crc_32_table[((int)(crc >> 24) ^ (data)) & 0xFF]) + +extern unsigned short crc_16_table[256]; +extern unsigned long crc_32_table[256]; + +extern void gen_crc_table(void); + +extern unsigned short update_crc_16_block(unsigned short crc, + char *data_block_ptr, + int data_block_size); +extern unsigned long update_crc_32_block(unsigned long crc, + char *data_block_ptr, + int data_block_size); + +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/cvdv.c linux.20pre5-ac2/drivers/media/video/margi/cvdv.c --- linux.20pre5/drivers/media/video/margi/cvdv.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/cvdv.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,1985 @@ +/* + cvdv.c + + Copyright (C) Christian Wolff + Marcus Metzler for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + ///////////////////////////////////////////////////////////////////// + // // + // Driver for the Convergence Digital Video decoder card (pci) // + // with L64017, L64021, PCM1723, and Bt864/Bt865 chipset // + // (c) Christian Wolff 19990209 for convergence integrated media // + // // +///////////////////////////////////////////////////////////////////// + +// Convergence CV2300i +#define __NO_VERSION__ + +#include +#include "cvdv.h" +#include "ost/osd.h" +#include "i2c.h" + + ////////////////////// + // global variables // +////////////////////// + +// Our major device number +unsigned int major_device_number; + + +// my little random function for memory test +uint16_t rnd_seed; +uint16_t rnd(uint16_t range) +{ // returns random 0..(range-1) range<=872 + uint32_t b = 75 * (rnd_seed + 1) - 1; + rnd_seed = (uint16_t) (b & 0xFFFF); + return ((b * range) / 0xFFFF) - ((b / 0xFFFF) * range); +} +void rnd_omize(void) +{ + rnd_seed = (uint16_t) jiffies; +} + +static char *cimlogo[] = { +".............................................", +".............................................", +"......................###....................", +".....................#####...................", +".....................######..................", +"..............#......#####...................", +"...........#####....######...................", +".........########...######...................", +"........########....######...................", +".......#########...######....................", +"......########.....######...####.............", +".....#######.......#####...#####.............", +".....######.......######...######............", +"....#######.......######....######...........", +"....######........######....######...........", +"....#####........######......#####...........", +"...######........######......#####...........", +"...#####.........######......######..........", +"...#####.........#####.......######..........", +"...#####........######........#####..........", +"...#####........######.......######..........", +"...#####........#####.........#####..........", +"...#####.......######........######..........", +"...#####.......######........#####...........", +"...######.......####.........#####...........", +"....#####........##.........######...........", +"....######..................######...........", +"....######.................######............", +".....#######..............######.....#####...", +".....########............#######....#######..", +"......#########........########.....#######..", +".......#######################......########.", +"........#####################.......#######..", +"..........#################.........#######..", +"............#############............#####...", +"...............#.#####.................##....", +".............................................", +"............................................." +}; + + ///////////////////////////////////////////// + // // + // Controlling the L64021 MPEG-2 Decoder // + // // +///////////////////////////////////////////// + +int OSDTest(struct cvdv_cards *card) +{ + int i, j, col, x0, y0, x1, y1,aspx; + uint8_t b; + + + if (!card->OSD.open) + return -2; + + OSDQuery(card, &x0, &y0, &x1, &y1, &aspx); + OSDShow(card); + OSDSetColor(card, 0, 0, 0, 0, 0, 0, 0); + OSDSetColor(card, 1, 128, 255, 255, 0, 0, 0); + for ( i = 0; i < cimlogo_width; i++){ + for ( j = 0; j < cimlogo_height; j++){ + b = cimlogo[j][i]; + col = (b == '#') ? 1: 0; + OSDSetPixel(card, x0+i, y0+j, col); + } + } + + return 0; +} + + +void SetVideoSystem(struct cvdv_cards *card) +{ + uint8_t reg; + + // set the hsync and vsync generators in the L64017 according to the video standard + reg = read_indexed_register(card, IIO_VIDEO_CONTROL1); + reg &= ~0x03; + switch (card->videomode) { + case PAL: // 864*625*50Hz = 27MHz, 25fps + I2CWrite(card, card->i2c_addr, CS_CONTROL0, 0x41 | 0x0a); + I2CWrite(card, card->i2c_addr, CS_CONTROL1, 0x04); + I2CWrite(card, card->i2c_addr, CS_SC_AMP, 0x15); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH0, 0x96); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH1, 0x15); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH2, 0x13); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH3, 0x54); + reg |= VMS_PAL; + break; + case PALN: + I2CWrite(card, card->i2c_addr, CS_CONTROL0, 0xa1 | 0x0a); + I2CWrite(card, card->i2c_addr, CS_CONTROL1, 0x04); + I2CWrite(card, card->i2c_addr, CS_SC_AMP, 0x15); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH0, 0x96); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH1, 0x15); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH2, 0x13); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH3, 0x54); + reg |= VMS_PAL; + break; + + case PALNc: + I2CWrite(card, card->i2c_addr, CS_CONTROL0, 0x81 | 0x0a); + I2CWrite(card, card->i2c_addr, CS_CONTROL1, 0x04); + I2CWrite(card, card->i2c_addr, CS_SC_AMP, 0x15); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH0, 0x8c); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH1, 0x28); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH2, 0xed); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH3, 0x43); + reg |= VMS_PAL; + break; + + case NTSC: // 858*525*59.94006Hz = 27MHz, 29.97fps + I2CWrite(card, card->i2c_addr, CS_CONTROL0, 0x01 | 0x0a); + I2CWrite(card, card->i2c_addr, CS_CONTROL1, 0x04); + I2CWrite(card, card->i2c_addr, CS_SC_AMP, 0x1c); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH0, 0x3e); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH1, 0xf8); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH2, 0xe0); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH3, 0x43); + reg |= VMS_NTSC; + break; + + case PALM: + I2CWrite(card, card->i2c_addr, CS_CONTROL0, 0x01 | 0x0a); + I2CWrite(card, card->i2c_addr, CS_CONTROL1, 0x04); + I2CWrite(card, card->i2c_addr, CS_SC_AMP, 0x15); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH0, 0x4e); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH1, 0x4a); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH2, 0xe1); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH3, 0x43); + reg |= VMS_PAL; + break; + + case NTSC60: // 857*525*60.010002Hz = 27MHz, 30fps + I2CWrite(card, card->i2c_addr, CS_CONTROL0, 0x21 | 0x0a); + I2CWrite(card, card->i2c_addr, CS_CONTROL1, 0x04); + I2CWrite(card, card->i2c_addr, CS_SC_AMP, 0x1c); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH0, 0x3e); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH1, 0xf8); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH2, 0xe0); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH3, 0x43); + reg |= VMS_NTSC; + break; + + case PALM60: + I2CWrite(card, card->i2c_addr, CS_CONTROL0, 0x61 | 0x0a); + I2CWrite(card, card->i2c_addr, CS_CONTROL1, 0x04); + I2CWrite(card, card->i2c_addr, CS_SC_AMP, 0x15); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH0, 0x4e); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH1, 0x4a); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH2, 0xe1); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH3, 0x43); + reg |= VMS_PAL; + break; + + case PAL60: + break; + } + write_indexed_register(card, IIO_VIDEO_CONTROL1, reg); + // set the pixel generators according to the video standard + L64021Setup(card); +} + +int SetVideoAttr(struct cvdv_cards *card, uint16_t vattr) +{ + uint8_t video_compression_mode; + uint8_t tv_system; + uint8_t aspect_ratio; + uint8_t display_mode; + uint8_t line_21_switch_1; + uint8_t line_21_switch_2; + uint8_t source_picture_resolution; + uint8_t source_picture_letterboxed; + uint8_t reserved; + uint8_t film_camera_mode; + uint16_t hsize, vsize; + if (vattr != card->lastvattr) { + video_compression_mode = (vattr >> 14) & 0x03; + tv_system = (vattr >> 12) & 0x03; + aspect_ratio = (vattr >> 10) & 0x03; + display_mode = (vattr >> 8) & 0x03; + line_21_switch_1 = (vattr >> 7) & 0x01; + line_21_switch_2 = (vattr >> 6) & 0x01; + source_picture_resolution = (vattr >> 3) & 0x07; + source_picture_letterboxed = (vattr >> 2) & 0x01; + reserved = (vattr >> 1) & 0x01; + film_camera_mode = (vattr >> 0) & 0x01; + card->videomode = + ((tv_system == 0) ? NTSC : ((tv_system == 1) ? + PAL : PAL)); + SetVideoSystem(card); + hsize = + ((source_picture_resolution == 0) ? 720 + : ((source_picture_resolution == 1) ? 702 : 352)); + vsize = ((source_picture_resolution == 3) + ? ((tv_system == 0) ? 240 : 288) + : ((tv_system == 0) ? 480 : 576)); + if (DecoderOpen + (card, hsize, vsize, ((aspect_ratio) ? 3 : 2), + ((video_compression_mode) ? 0 : 1), + source_picture_letterboxed, tv_system)) { + MDEBUG(0, + ": Video Decoder Open failed: On-card memory insufficient for frame stores\n"); + } + card->lastvattr = vattr; + } else { + MDEBUG(0, + ": Video attribute not set, equal to previous one.\n"); + } + return 0; +} + +int SetAudioAttr(struct cvdv_cards *card, uint16_t aattr) +{ + uint8_t audio_coding_mode; + uint8_t multichannel_extension; + uint8_t audio_type; + uint8_t audio_application_mode; + uint8_t quantization_drc; + uint8_t fs; + uint8_t reserved; + uint8_t num_audio_ch; + if (aattr) { + if (aattr != card->lastaattr) { + audio_coding_mode = (aattr >> 13) & 0x07; + multichannel_extension = (aattr >> 12) & 0x01; + audio_type = (aattr >> 10) & 0x03; + audio_application_mode = (aattr >> 8) & 0x03; + quantization_drc = (aattr >> 6) & 0x03; + fs = (aattr >> 4) & 0x03; + reserved = (aattr >> 3) & 0x01; + num_audio_ch = (aattr >> 0) & 0x07; + switch (audio_coding_mode) { + case 0: // AC-3 + card->setup.audioselect = audio_AC3; + break; + case 2: // MPEG Audio + card->setup.audioselect = audio_MPEG; + break; + case 3: // MPEG Audio with ext. + card->setup.audioselect = audio_MPEG_EXT; + break; + case 4: // Linear Pulse Code Modulation LPCM + card->setup.audioselect = audio_LPCM; + break; + case 6: // DTS + card->setup.audioselect = audio_DTS; + break; + case 7: // SDDS + card->setup.audioselect = audio_SDDS; + break; + } + DecoderPrepareAudio(card); + AudioInit(card, ((fs) ? 96 : 48), + ((audio_application_mode == 2) ? 1 : 0)); + } else { + MDEBUG(0, + ": Audio attribute not set, equal to previous one.\n"); + } + } else { + card->setup.audioselect = audio_none; + DecoderPrepareAudio(card); + } + card->lastaattr = aattr; + return 0; +} + +int Prepare(struct cvdv_cards *card) +{ + int err, h; + struct StreamSetup *setup = &card->setup; + + if (!card->ChannelBuffersAllocated) { + + DecoderStreamReset(card); + if (setup->streamtype == stream_none) { + setup->streamtype = stream_PS; + } + + if (setup->audioselect == audio_none) { + setup->audioselect = audio_MPEG; + } + + DecoderPrepareAudio(card); + AudioMute(card, 1); + DecoderPrepareVideo(card); + VideoSetBackground(card, 1, 0, 0, 0); // black + + switch (setup->streamtype) { + default: + case stream_none: // unknown stream! + MDEBUG(0, + ": Video Decoder Prepare failed: unknown stream type\n"); + return -ENODEV; // not an MPEG stream! + case stream_ES: // Elementary Stream + err = DecoderPrepareES(card); + break; + case stream_PES: // Packetized Elementary Stream + err = DecoderPreparePES(card); + break; + case stream_PS: // MPEG-1 System Stream / MPEG-2 Program Stream + err = DecoderPreparePS(card, -1, 0, 0, 0, 0, 0); + break; + case stream_DVD: // DVD Stream + err = DecoderPreparePS(card, 0, 0, 0, 0, 3, 1); + break; + } + if (err) { // insufficient memory + MDEBUG(0, + ": Video Decoder Prepare failed: no kernel memory, please reboot if possible\n"); + CloseCard(card); + return -ENODEV; + } + } + + // Set up the Video Decoder as we have the stream information + if ((!card->FrameBuffersAllocated) + && (card->ChannelBuffersAllocated) && (card->stream.sh.valid)) { + // Automatic PAL/NTSC-switch according to MPEG-Source + h = card->stream.vsize; + if (h < 480) + h *= 2; // catch quarter sized images + printk(KERN_INFO LOGNAME ": Video mode: %s\n", + ((h == 480) ? "NTSC" : "PAL")); + card->videomode = ((h == 480) ? NTSC : PAL); + SetVideoSystem(card); + // Open the Video Decoder with the parameters retreived from the stream + if ( + (err = + DecoderOpen(card, card->stream.hsize, + card->stream.vsize, + card->stream.sh.aspectratio, + !card->stream.MPEG2, 0, + (card->stream.hsize > 480)))) { // TODO: include vbvbuffersize + MDEBUG(0, + ": Video Decoder Open failed: %s\n", + ((err == 1) ? + "Picture size too big (>1440 pixel wide)" : + "On-card memory insufficient for frame stores")); + CloseCard(card); + return -ENODEV; // picture too big or insufficient memory + } + MDEBUG(1, ": Ready to go\n"); + card->startingV = 1; // tell the card to start playing as soon as ES-buffers are sufficiently full + card->startingA = 1; // tell the card to start playing as soon as ES-buffers are sufficiently full + } + + + return 0; +} + +int SetSCRstart(struct cvdv_cards *card, uint32_t SCR_base) +{ + uint32_t SCR_compare; + uint32_t SCR_compareA; + uint32_t SCR_compareV; + if (card->startingV) { + MDEBUG(0, ": SCR in DVD Pack: 0x%08X\n", + SCR_base); + card->startingV = 0; + card->startingA = 0; + DecoderMaskByte(card, 0x007, 0xD2, 0xD2); // Set 0x010, halt SCR counter + SCR_compare = SCR_base + 000; + if (SCR_base < 900) + SCR_base = 0; + else + SCR_base -= 900; + //DecoderWriteDWord(card,0x009,SCR_base); // Set SCR counter + DecoderWriteByte(card, 0x009, SCR_base & 0xFF); // Set SCR counter + DecoderWriteByte(card, 0x00A, (SCR_base >> 8) & 0xFF); + DecoderWriteByte(card, 0x00B, (SCR_base >> 16) & 0xFF); + DecoderWriteByte(card, 0x00C, (SCR_base >> 24) & 0xFF); + DecoderMaskByte(card, 0x011, 0x03, 0x02); // compare, not capture + MDEBUG(0, ": SCR compare value: 0x%08X\n", + SCR_compare); + //DecoderWriteDWord(card,0x00D,SCR_compare); // Set Compare register + DecoderWriteByte(card, 0x00D, SCR_compare & 0xFF); // Set Compare register + DecoderWriteByte(card, 0x00E, (SCR_compare >> 8) & 0xFF); + DecoderWriteByte(card, 0x00F, (SCR_compare >> 16) & 0xFF); + DecoderWriteByte(card, 0x010, (SCR_compare >> 24) & 0xFF); + //DecoderWriteDWord(card,0x014,SCR_compare); // Set audio compare reg. + DecoderWriteByte(card, 0x014, SCR_compare & 0xFF); // Set audio compare reg. + DecoderWriteByte(card, 0x015, (SCR_compare >> 8) & 0xFF); + DecoderWriteByte(card, 0x016, (SCR_compare >> 16) & 0xFF); + DecoderWriteByte(card, 0x017, (SCR_compare >> 24) & 0xFF); + DecoderSetByte(card, 0x013, 0x03); // Video and Audio start on cmp. + //DecoderSetVideoPanic(card,0,DecoderGetVideoESSize(card)/4); // video panic at 25 percent + VideoSetBackground(card, 1, 0, 0, 0); // black + SCR_base = DecoderReadByte(card, 0x009); + SCR_base = + SCR_base | ((uint32_t) DecoderReadByte(card, 0x00A) << 8); + SCR_base = + SCR_base | ((uint32_t) DecoderReadByte(card, 0x00B) << 16); + SCR_base = + SCR_base | ((uint32_t) DecoderReadByte(card, 0x00C) << 24); + SCR_compareA = DecoderReadByte(card, 0x014); + SCR_compareA = + SCR_compareA | ((uint32_t) DecoderReadByte(card, 0x015) << + 8); + SCR_compareA = + SCR_compareA | ((uint32_t) DecoderReadByte(card, 0x016) << + 16); + SCR_compareA = + SCR_compareA | ((uint32_t) DecoderReadByte(card, 0x017) << + 24); + SCR_compareV = DecoderReadByte(card, 0x00D); + SCR_compareV = + SCR_compareV | ((uint32_t) DecoderReadByte(card, 0x00E) << + 8); + SCR_compareV = + SCR_compareV | ((uint32_t) DecoderReadByte(card, 0x00F) << + 16); + SCR_compareV = + SCR_compareV | ((uint32_t) DecoderReadByte(card, 0x010) << + 24); + if (DecoderReadByte(card, 0x013) & 0x03) + MDEBUG(1,": SCR 0x%08X, videocmp=0x%08X, audiocmp=0x%08X %02X\n", + SCR_base, SCR_compareV, SCR_compareA, + DecoderReadByte(card, 0x013)); + DecoderMaskByte(card, 0x007, 0xD2, 0xC2); // Del 0x010, SCR counter run + } + return 0; +} + +int DecoderWriteBlock(struct cvdv_cards *card, uint8_t * data, int size, + int initial, int setSCR) +{ + //int a,v,as,vs,ap,vp; + int res; + uint32_t SCR_base; + int co = 0; + // uint32_t SCR_compare; + res = 0; + + Prepare(card); + + if (size > 0) { + + if (!card->use_ringA) + MargiSetBuffers(card, NBBUF*CHANNELBUFFERSIZE,0); + + if (card->startingDVDV || card->startingDVDA) + setSCR = 1; + + if (initial) { + DecoderStreamReset(card); + //TODO stop and start channel interface + setSCR = 1; + } + + if (setSCR) { + SCR_base = ParseSCR(data); + SetSCR(card, SCR_base); + } + card->DMAABusy = 0; + while (((res = MargiPushA(card, size, data)) < size) + && co < 1000) { + data+=res; + size-=res; + co++; + MDEBUG(2, + ": DecoderWriteBlock - buffers only filled with %d instead of %d bytes\n",res, size); + if (card->DMAABusy){ + interruptible_sleep_on(&card->wqA); + } + } + + if (card->startingDVDV) { + card->startingDVDV = 0; + card->startingV = 1; + DecoderStartDecode(card); + } + if (card->startingDVDA) { + card->startingDVDA = 0; + card->startingA = 1; + AudioSetPlayMode(card, MAUDIO_PLAY); + } + } + return 0; +} + + + + + + ////////////////////////////// + // // + // Char Device Procedures // + // // +////////////////////////////// +static long margi_write(struct cvdv_cards *card, const char *data, + unsigned long count, int nonblock) +{ + + int res; + long int out=0; + int free; + + free = ring_write_rest(&(card->rbufA)); + + if (card != NULL) { + card->nonblock = nonblock; + if (count > 0) { // Do we have data? + if ((res = Prepare(card))) + return res; + if (!card->use_ringA) + MargiSetBuffers(card, NBBUF*CHANNELBUFFERSIZE, + 0); + if (!nonblock && + !wait_event_interruptible( + card->wqA, + ring_write_rest(&(card->rbufA)) >count )){ + + out = MargiPushA(card, count, + data); + } else { + out = MargiPushA(card, count, data); + } + } + return out; + } else { + MDEBUG(0, + ": Video Decoder Prepare failed: device with this minor number not found\n"); + return -ENODEV; // device with this minor number not found + } +} + + +static long margi_write_audio(struct cvdv_cards *card, const char *data, + unsigned long count, int nonblock) +{ + struct StreamSetup *setup = &card->setup; + + int res; + long int out=0; + int free; + + free = ring_write_rest(&(card->rbufB)); + + if (card != NULL) { + card->nonblock = nonblock; + + if (count > 0) { // Do we have data? + if ((res = Prepare(card))) + return res; + if ((setup->streamtype == stream_ES) + || (setup->streamtype == stream_PES)){ + if (!card->use_ringB) + MargiSetBuffers(card, NBBUF* + CHANNELBUFFERSIZE,1); + if (!nonblock && + !wait_event_interruptible( + card->wqB, + ring_write_rest(&(card->rbufB)) + > count)){ + out = MargiPushB(card, count, + data); + } else { + out = MargiPushB(card, count, data); + } + } + } + return out; + } else { + MDEBUG(0, + ": Video Decoder Prepare failed: device with this minor number not found\n"); + return -ENODEV; // device with this minor number not found + } +} + +void pes_write(uint8_t *buf, int count, void *priv) +{ + struct cvdv_cards *card = (struct cvdv_cards *) priv; + + margi_write(card, buf, count, 0); +} + + +static ssize_t PSwrite(struct file *file, const char *data, size_t count, + loff_t * offset) +{ + struct cvdv_cards *card = + minorlist[MINOR(file->f_dentry->d_inode->i_rdev) % MAXDEV]; // minor number modulo 16 + return margi_write(card, data, count, file->f_flags&O_NONBLOCK); +} + +static unsigned int PSpoll(struct file *file, poll_table * table) +{ + struct cvdv_cards *card = + minorlist[MINOR(file->f_dentry->d_inode->i_rdev) % MAXDEV]; // minor number modulo 16 + if (card != NULL) { + poll_wait(file, &card->wqA , table); + if ( !card->rbufA.buffy || ring_write_rest(&(card->rbufA)) ) + return (POLLOUT | POLLWRNORM); + else { + return 0; + } + } else + return POLLERR; +} + +static unsigned int poll_audio(struct file *file, poll_table * table) +{ + struct cvdv_cards *card = + minorlist[MINOR(file->f_dentry->d_inode->i_rdev) % MAXDEV]; // minor number modulo 16 + if (card != NULL) { + poll_wait(file, &card->wqB, table); + if ( !card->rbufB.buffy || ring_write_rest(&(card->rbufB)) ) + return (POLLOUT | POLLWRNORM); + else { + return 0; + } + } else + return POLLERR; +} + +static int +OSD_DrawCommand(struct cvdv_cards *card,osd_cmd_t *dc) +{ + + switch (dc->cmd) { + case OSD_Close: + MDEBUG(1,": OSD Close\n"); + return OSDClose(card); + case OSD_Open: // Open(x0,y0,x1,y1,BitPerPixel(2/4/8),mix(0..15)) + return OSDOpen(card, dc->x0, + dc->y0, dc->x1, + dc->y1, + dc->color & 0x0F, + (dc->color >> 4) & + 0x0F); + case OSD_Show: + return OSDShow(card); + case OSD_Hide: + return OSDHide(card); + case OSD_Clear: + return OSDClear(card); + case OSD_Fill: // Fill(color) + return OSDFill(card, dc->color); + case OSD_SetColor: // SetColor(color,R(x0),G(y0),B(x1),opacity(y1)) + return (OSDSetColor + (card, dc->color, dc->x0, + dc->y0, dc->x1, 0, + (dc->y1 != 255), + (dc->y1 == 0)) >= 0); + case OSD_SetPalette:// SetPalette(firstcolor{color},lastcolor{x0},data) + return OSDSetPalette(card, + dc->color, + dc->x0, (uint8_t *) + dc->data); + case OSD_SetTrans: // SetTrans(transparency{color}) + return OSDSetTrans(card, + (dc->color >> 4) + & 0x0F); + case OSD_SetPixel: // SetPixel(x0,y0,color) + return OSDSetPixel(card, dc->x0, + dc->y0, + dc->color); + case OSD_GetPixel: // GetPixel(x0,y0); + return OSDGetPixel(card, dc->x0, + dc->y0); + case OSD_SetRow: // SetRow(x0,y0,x1,(uint8_t*)data) + return OSDSetRow(card, dc->x0, + dc->y0, dc->x1, + (uint8_t *) dc->data); + case OSD_SetBlock: // SetBlock(x0,y0,x1,y1,(uint8_t*)data) + return OSDSetBlock(card, dc->x0, + dc->y0, dc->x1, + dc->y1, + dc->color, + (uint8_t *) + dc->data); + case OSD_FillRow: // FillRow(x0,y0,x1,color) + return OSDFillRow(card, dc->x0, + dc->y0, dc->x1, + dc->color); + case OSD_FillBlock: // FillRow(x0,y0,x1,y1,color) + return OSDFillBlock(card, dc->x0, + dc->y0, dc->x1, + dc->y1, + dc->color); + case OSD_Line: // Line(x0,y0,x1,y1,color); + return OSDLine(card, dc->x0, + dc->y0, dc->x1, + dc->y1, dc->color); + case OSD_Query: // Query(x0,y0,x1,y1,aspect(color:11) + return OSDQuery(card, &dc->x0, + &dc->y0, &dc->x1, + &dc->y1, + &dc->color); + case OSD_Test: + return OSDTest(card); + default: + return -EINVAL; + } +} + + +static int PSioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + struct cvdv_cards *card = minorlist[MINOR(inode->i_rdev) % MAXDEV]; // minor number modulo 16 + osd_cmd_t *dc; + struct decodercmd *command; + uint16_t attr; + + if (card != NULL) { + if (_IOC_TYPE(cmd) == CVDV_IOCTL_MAGIC) + switch (_IOC_NR(cmd)) { + case IOCTL_DRAW: // Drawing commands + dc = (osd_cmd_t *) arg; + return OSD_DrawCommand(card,dc); + break; + case IOCTL_DECODER: + command = (struct decodercmd *) arg; + switch (command->cmd) { + + case Decoder_CSS: + /* + return DecoderCSS(card, + command->param1, + command->data1); + */ + break; + + case Decoder_Set_Videosystem: + MDEBUG(1,": -- Decoder_Set_Videosystem\n"); + card->videomode = + (videosystem) command->param1; + SetVideoSystem(card); + return 0; + break; + + case Decoder_Set_Streamtype: + MDEBUG(1,": -- Decoder_Set_Streamtype\n"); + card->setup.streamtype = + (stream_type) command->param1; + return 0; + break; + + case Decoder_Set_Audiotype: + MDEBUG(1,": -- Decoder_Set_Audiotype\n"); + card->setup.audioselect = + (audio_type) command->param1; + DecoderPrepareAudio(card); + return 0; + break; + + case Decoder_Set_VideoStreamID: + MDEBUG(1,": -- Decoder_Set_VideoStreamID\n"); + card->setup.videoID = + command->param1; + DecoderPrepareVideo(card); + return 0; + break; + + case Decoder_Set_AudioStreamID: + MDEBUG(1,": -- Decoder_Set_AudioStreamID 0x%02X 0x%02X\n", + command->param1,command->param2); + card->setup.audioID = + command->param1; + card->setup.audioIDext = + command->param2; + attr = card->lastaattr; + DecoderSelectAudioID(card); + card->lastaattr = attr; + return 0; + break; + + case Decoder_Still_Put: + return DecoderShowStill(card, + command-> + param1, + command-> + param2, + command-> + data1, + command-> + data2); + break; + + case Decoder_Still_Get: + return DecoderGetStill(card, + &command-> + param1, + &command-> + param2, + command-> + data1, + command-> + data2); + break; + + case Decoder_Pause: // pause{param1} 0=run 1=pause 2=toggle + if (command->param1 == 2) { + if (card->paused) + DecoderUnPause + (card); + else + DecoderPause(card); + } else { + if (!command->param1) + DecoderUnPause + (card); + else + DecoderPause(card); + } + return 0; + + /* Too buggy + case Decoder_FFWD: // pause{param1} =normal 1=ffwd 2=toggle + if (command->param1 == 2) { + if (card->videoffwd) + card->videoffwd = 0; + else + card->videoffwd = 3; + } else { + if (!command->param1) + card->videoffwd = 0; + else + card->videoffwd = 3; + } + return 0; + + case Decoder_Slow: // pause{param1} =normal 1=slow 2=toggle + if (command->param1 == 2) { + if (card->videoslow) + card->videoslow = 0; + else + card->videoslow = 4; + } else { + if (!command->param1) + card->videoslow = 0; + else + card->videoslow = 4; + } + return 0; + */ + case Decoder_Highlight: // active{param1}, color information(SL_COLI or AC_COLI){data1[4]}, button position(BTN_POSI){data2[6]} + return DecoderHighlight(card, + command-> + param1, + command-> + data1, + command-> + data2); + case Decoder_SPU: // stream{param1}, active{param2} + return DecoderSPUStream(card, + command-> + param1, + command-> + param2); + case Decoder_SPU_Palette: // length{param1}, palette{data1} + return DecoderSPUPalette(card, + command-> + param1, + command-> + data1); + case Decoder_GetNavi: // data1 will be filled with PCI or DSI pack, and 1024 will be returned + return DecoderGetNavi(card, + command-> + data1); + case Decoder_SetKaraoke: // Vocal1{param1}, Vocal2{param2}, Melody{param3} + return DecoderKaraoke(card, + command-> + param1, + command-> + param2, + command-> + param3); + case Decoder_Set_Videoattribute: + MDEBUG(1,": -- Decoder_Set_Videoattribute\n"); + if (!card->ChannelBuffersAllocated) { + DecoderStreamReset(card); + MargiFlush(card); + + card->setup.streamtype = + stream_DVD; + card->setup.videoID = 0; + DecoderPrepareVideo(card); + DecoderPreparePS(card, 0, + 0, 2, 2, + 3, 1); + } + + SetVideoAttr(card, + command->param1); + card->startingDVDV = 1; +// tell the card to start playing as soon as ES-buffers are sufficiently full + return 0; + case Decoder_Set_Audioattribute: + MDEBUG(1,": -- Decoder_Set_Audioattribute\n"); + SetAudioAttr(card, + command->param1); + card->startingDVDA = + ((card->setup.audioselect != + audio_none) + && (card->setup.audioselect != audio_disable)); // tell the card to start playing as soon as ES-buffers are sufficiently full + return 0; + case Decoder_WriteBlock: // DVD-Sector{data1}, sectorsize{param1{2048}}, initialsector{param2{bool}}, set_SCR{param3} + return DecoderWriteBlock(card, + command-> + data1, + command-> + param1, + command-> + param2, + command-> + param3); + default: + return -EINVAL; + } + default: + return -EINVAL; + } else + return -EINVAL; + } else { + MDEBUG(0, + ": Video Decoder Prepare failed: device with this minor number not found\n"); + return -ENODEV; // device with this minor number not found + } +} + + +static int PSmmap(struct file *file, struct vm_area_struct *vm) +{ + return -ENODEV; +} + + + +static int margi_open(struct cvdv_cards *card, int flags) +{ + int closed; + + printk("Open card = %p\n", card); + + if (card != NULL) { + MDEBUG(1, ": -- open \n"); + CloseCard(card); + OSDClose(card); + + printk("Card and OSD closed.\n"); +#ifdef NOINT + card->timer.function = Timerfunction; + card->timer.data=(unsigned long) card; + card->timer.expires=jiffies+1; + add_timer(&card->timer); +#endif + printk("Timer added.\n"); + + if (card->open) + MDEBUG(0,": PSopen - already open\n"); + closed = 1; + if (card->open) + closed = 0; + if (closed) { // first open() for this card? + printk("Freeing buffers.\n"); + MargiFreeBuffers(card); + printk("Fade to black.\n"); + VideoSetBackground(card, 1, 0, 0, 0); // black + } + printk("Go\n"); + card->open++; + return 0; + } else { + MDEBUG(0, + ": Video Decoder Prepare failed: device with this minor number not found\n"); + return -ENODEV; // device with this minor number not found + } + +} + + +static int PSopen(struct inode *inode, struct file *file) +{ + struct cvdv_cards *card = minorlist[MINOR(inode->i_rdev) % MAXDEV]; +#ifdef DVB + if(card) + card->audiostate.AVSyncState=true; +#endif + return margi_open(card, file->f_flags); +} + + +static int all_margi_close(struct cvdv_cards *card) +{ + + if (card != NULL) { + MDEBUG(1, ": -- PSrelease\n"); + if (card->open <= 0) + MDEBUG(1,": PSrelease - not open\n"); + card->open--; + + if (!card->open) { + MDEBUG(1,": PSrelease - last close\n"); + CloseCard(card); // close immediately + } + return 0; + } else { + MDEBUG(0,": Video Decoder Prepare failed:\n"); + return -ENODEV; // device with this minor number not found + } + +} + +static int PSrelease(struct inode *inode, struct file *file) +{ + struct cvdv_cards *card = minorlist[MINOR(inode->i_rdev) % MAXDEV]; // minor number modulo 16 + return all_margi_close(card); +} + + ////////////////////////// + // // + // Char Device Hookup // + // // +////////////////////////// + +// Hookups for a write-only device, that accepts MPEG-2 Program Stream +struct file_operations cvdv_fileops = { + owner: THIS_MODULE, + write: PSwrite, + poll: PSpoll, + ioctl: PSioctl, + mmap: PSmmap, + open: PSopen, + release: PSrelease, +}; + + +#ifdef DVB + +static inline int +num2type(struct cvdv_cards *card, int num) +{ + if (!card->dvb_devs) + return -2; + if (num>=card->dvb_devs->num) + return -2; + return card->dvb_devs->tab[num]; +} + +static int +dvbdev_open(struct dvb_device *dvbdev, int num, + struct inode *inode, struct file *file) +{ + struct cvdv_cards *card=(struct cvdv_cards *) dvbdev->priv; + int type=num2type(card, num); + int ret=0; + + if (type<0) + return -EINVAL; + + if (card->users[num] >= card->dvb_devs->max_users[num]) + return -EBUSY; + + if ((file->f_flags&O_ACCMODE)!=O_RDONLY) + if (card->writers[num] >= card->dvb_devs->max_writers[num]) + return -EBUSY; + + switch (type) { + case DVB_DEVICE_VIDEO_0: + card->video_blank=true; + card->audiostate.AVSyncState=true; + card->videostate.streamSource=VIDEO_SOURCE_DEMUX; + margi_open(card, file->f_flags); + break; + + case DVB_DEVICE_AUDIO_0: + card->audiostate.AVSyncState=true; + card->audiostate.streamSource=AUDIO_SOURCE_DEMUX; + break; + + case DVB_DEVICE_DEMUX_0: + if ((file->f_flags&O_ACCMODE)!=O_RDWR) + return -EINVAL; + ret=DmxDevFilterAlloc(&card->dmxdev, file); + break; + + case DVB_DEVICE_DVR_0: + card->audiostate.AVSyncState=true; + card->setup.streamtype = stream_PES; + margi_open(card, file->f_flags); + ret=DmxDevDVROpen(&card->dmxdev, file); + break; + + case DVB_DEVICE_OSD_0: + break; + default: + return -EINVAL; + } + if (ret<0) + return ret; + if ((file->f_flags&O_ACCMODE)!=O_RDONLY) + card->writers[num]++; + card->users[num]++; + return ret; +} + +static int +dvbdev_close(struct dvb_device *dvbdev, int num, + struct inode *inode, struct file *file) +{ + struct cvdv_cards *card=(struct cvdv_cards *) dvbdev->priv; + int type=num2type(card, num); + int ret=0; + + if (type<0) + return -EINVAL; + + switch (type) { + case DVB_DEVICE_VIDEO_0: + case DVB_DEVICE_AUDIO_0: + if (card->open) + all_margi_close(card); + break; + + case DVB_DEVICE_DEMUX_0: + ret=DmxDevFilterFree(&card->dmxdev, file); + break; + + case DVB_DEVICE_DVR_0: + ret=DmxDevDVRClose(&card->dmxdev, file); + if (card->open) + all_margi_close(card); + break; + case DVB_DEVICE_OSD_0: + break; + default: + return -EINVAL; + } + if (ret<0) + return ret; + if ((file->f_flags&O_ACCMODE)!=O_RDONLY) + card->writers[num]--; + card->users[num]--; + return ret; +} + + +static ssize_t +dvbdev_write(struct dvb_device *dvbdev, int num, + struct file *file, + const char *buf, size_t count, loff_t *ppos) +{ + struct cvdv_cards *card=(struct cvdv_cards *) dvbdev->priv; + int type=num2type(card, num); + + switch (type) { + case DVB_DEVICE_VIDEO_0: + if (card->videostate.streamSource!=VIDEO_SOURCE_MEMORY) + return -EPERM; + return margi_write(card, buf, count, + file->f_flags&O_NONBLOCK); + + case DVB_DEVICE_AUDIO_0: + if (card->audiostate.streamSource!=AUDIO_SOURCE_MEMORY) + return -EPERM; + if ( card->setup.streamtype != stream_PES ) + return -EPERM; + + return margi_write_audio(card, buf, count, + file->f_flags&O_NONBLOCK); + + case DVB_DEVICE_DVR_0: + return DmxDevDVRWrite(&card->dmxdev, file, buf, count, ppos); + default: + return -EOPNOTSUPP; + } + return 0; +} + +static ssize_t +dvbdev_read(struct dvb_device *dvbdev, int num, + struct file *file, char *buf, size_t count, loff_t *ppos) +{ + struct cvdv_cards *card=(struct cvdv_cards *) dvbdev->priv; + int type=num2type(card, num); + + switch (type) { + case DVB_DEVICE_VIDEO_0: + break; + case DVB_DEVICE_AUDIO_0: + break; + case DVB_DEVICE_DEMUX_0: + return DmxDevRead(&card->dmxdev, file, buf, count, ppos); + case DVB_DEVICE_DVR_0: + return DmxDevDVRRead(&card->dmxdev, file, buf, count, ppos); + case DVB_DEVICE_CA_0: + break; + default: + return -EOPNOTSUPP; + } + return 0; +} + + + + +static int +dvbdev_ioctl(struct dvb_device *dvbdev, int num, + struct file *file, unsigned int cmd, unsigned long arg) +{ + struct cvdv_cards *card=(struct cvdv_cards *) dvbdev->priv; + void *parg=(void *)arg; + int type=num2type(card, num); + uint16_t attr; + + switch (type) { + case DVB_DEVICE_VIDEO_0: + if (((file->f_flags&O_ACCMODE)==O_RDONLY) && + (cmd!=VIDEO_GET_STATUS)) + return -EPERM; + + switch (cmd) { + + case VIDEO_STOP: + DecoderPause(card); + card->videostate.playState = VIDEO_STOPPED; + if (card->videostate.videoBlank) + VideoSetBackground(card, 1, 0, 0, 0); + + + return 0; + + case VIDEO_PLAY: + + if (card->videostate.streamSource== + VIDEO_SOURCE_MEMORY) { + if (card->videostate.playState==VIDEO_FREEZED){ + DecoderUnPause(card); + } else { + DecoderUnPause(card); + } + } + break; + + case VIDEO_FREEZE: + DecoderPause(card); + break; + + case VIDEO_CONTINUE: + if (card->videostate.playState==VIDEO_FREEZED) { + DecoderUnPause(card); + } + break; + + case VIDEO_SELECT_SOURCE: + card->videostate.streamSource=(videoStreamSource_t) arg; + break; + + case VIDEO_SET_BLANK: + card->videostate.videoBlank=(boolean) arg; + break; + + case VIDEO_GET_STATUS: + if(copy_to_user(parg, &card->videostate, + sizeof(struct videoStatus))) + return -EFAULT; + break; + + case VIDEO_GET_EVENT: + return -EOPNOTSUPP; + + case VIDEO_SET_DISPLAY_FORMAT: + { + videoDisplayFormat_t format=(videoDisplayFormat_t) arg; + uint16_t val=0; + + switch(format) { + case VIDEO_PAN_SCAN: + val=VID_PAN_SCAN_PREF; + break; + + case VIDEO_LETTER_BOX: + val=VID_VC_AND_PS_PREF; + break; + + case VIDEO_CENTER_CUT_OUT: + val=VID_CENTRE_CUT_PREF; + break; + + default: + return -EINVAL; + } + + card->videostate.videoFormat=format; + return 0; + } + + case VIDEO_STILLPICTURE: + { + struct videoDisplayStillPicture pic; + + if(copy_from_user(&pic, parg, + sizeof(struct videoDisplayStillPicture))) + return -EFAULT; + + break; + } + + case VIDEO_FAST_FORWARD: + if (card->videostate.streamSource != + VIDEO_SOURCE_MEMORY) + return -EPERM; + card->videoffwd = 3; + break; + + case VIDEO_SLOWMOTION: + if (card->videostate.streamSource!=VIDEO_SOURCE_MEMORY) + return -EPERM; + card->videoslow = arg; + + break; + + case VIDEO_GET_CAPABILITIES: + { + int cap=VIDEO_CAP_MPEG1| + VIDEO_CAP_MPEG2| + VIDEO_CAP_SYS| + VIDEO_CAP_PROG| + VIDEO_CAP_SPU| + VIDEO_CAP_NAVI| + VIDEO_CAP_CSS; + + + if (copy_to_user(parg, &cap, + sizeof(cap))) + return -EFAULT; + break; + } + + case VIDEO_SET_STREAMTYPE: + { + int f = -1; + switch(arg){ + case VIDEO_CAP_MPEG1: + case VIDEO_CAP_MPEG2: + f = stream_PES; + break; + + case VIDEO_CAP_SYS: + case VIDEO_CAP_PROG: + f = stream_PS; + break; + + case VIDEO_CAP_SPU: + case VIDEO_CAP_NAVI: + case VIDEO_CAP_CSS: + f = stream_DVD; + } + card->setup.streamtype = f; + + } + break; + + case VIDEO_SET_ID: + card->setup.videoID = arg; + DecoderPrepareVideo(card); + break; + + case VIDEO_SET_SYSTEM: + card->videomode = (videosystem) arg; + SetVideoSystem(card); + break; + + case VIDEO_SET_HIGHLIGHT: + { + uint8_t data1[4]; + uint8_t data2[6]; + videoHighlight_t vh; + + if(copy_from_user(&vh, parg, sizeof(videoHighlight_t))) + return -EFAULT; + + data1[0] = vh.contrast1; + data1[1] = vh.contrast2; + data1[2] = vh.color1; + data1[3] = vh.color2; + data2[0] = vh.ypos & 0xFF; + data2[1] = (uint8_t) ((vh.ypos >> 1) & 0xFF); + data2[2] = (uint8_t) ((vh.ypos >> 2) & 0xFF); + data2[3] = vh.xpos & 0xFF; + data2[4] = (uint8_t) ((vh.xpos >> 1) & 0xFF); + data2[5] = (uint8_t) ((vh.xpos >> 2) & 0xFF); + return DecoderHighlight(card, vh.active, data1, data2); + break; + } + + case VIDEO_SET_SPU: + { + videoSPU_t spu; + + if(copy_from_user(&spu, parg, sizeof(videoSPU_t))) + return -EFAULT; + + return DecoderSPUStream(card, spu.streamID, spu.active); + break; + } + + case VIDEO_SET_SPU_PALETTE: + { + videoSPUPalette_t spup; + + if(copy_from_user(&spup, parg, sizeof(videoSPUPalette_t))) + return -EFAULT; + + return DecoderSPUPalette(card, spup.length, spup.palette); + break; + } + + case VIDEO_GET_NAVI: + { + videoNaviPack_t navi; + + navi.length = DecoderGetNavi(card, (u8 *)&(navi.data)); + if(copy_to_user(parg, &navi, sizeof(videoNaviPack_t))) + return -EFAULT; + } + break; + + case VIDEO_SET_ATTRIBUTES: + { + if (!card->ChannelBuffersAllocated) { + DecoderStreamReset(card); + MargiFlush(card); + + card->setup.streamtype = stream_DVD; + card->setup.videoID = 0; + DecoderPrepareVideo(card); + DecoderPreparePS(card, 0, 0, 2, 2, 3, 1); + } + + SetVideoAttr(card, arg); + card->startingDVDV = 1; + } + break; + + default: + return -ENOIOCTLCMD; + } + return 0; + + case DVB_DEVICE_AUDIO_0: + if (((file->f_flags&O_ACCMODE)==O_RDONLY) && + (cmd!=AUDIO_GET_STATUS)) + return -EPERM; + + switch (cmd) { + + case AUDIO_STOP: + if (card->audiostate.streamSource!=AUDIO_SOURCE_MEMORY) + break; + AudioStopDecode(card); + card->audiostate.playState=AUDIO_STOPPED; + break; + + case AUDIO_PLAY: + if (card->audiostate.streamSource!=AUDIO_SOURCE_MEMORY) + break; + AudioSetPlayMode(card, MAUDIO_PLAY); + card->audiostate.playState=AUDIO_PLAYING; + break; + + case AUDIO_PAUSE: + card->audiostate.playState=AUDIO_PAUSED; + AudioSetPlayMode(card, MAUDIO_PAUSE); + break; + + case AUDIO_CONTINUE: + if (card->audiostate.playState==AUDIO_PAUSED) { + card->audiostate.playState=AUDIO_PLAYING; + AudioSetPlayMode(card, MAUDIO_PLAY); + } + break; + + case AUDIO_SELECT_SOURCE: + card->audiostate.streamSource= + (audioStreamSource_t) arg; + break; + + case AUDIO_SET_MUTE: + { + AudioMute(card, arg); + card->audiostate.muteState=(boolean) arg; + break; + } + + case AUDIO_SET_AV_SYNC: + card->videosync=(boolean) arg; + card->audiostate.AVSyncState=(boolean) arg; + break; + + case AUDIO_SET_BYPASS_MODE: + return -EINVAL; + + case AUDIO_CHANNEL_SELECT: + card->audiostate.channelSelect=(audioChannelSelect_t) arg; + + switch(card->audiostate.channelSelect) { + case AUDIO_STEREO: + break; + + case AUDIO_MONO_LEFT: + break; + + case AUDIO_MONO_RIGHT: + break; + + default: + return -EINVAL; + } + return 0; + + case AUDIO_GET_STATUS: + if(copy_to_user(parg, &card->audiostate, + sizeof(struct audioStatus))) + return -EFAULT; + break; + + case AUDIO_GET_CAPABILITIES: + { + int cap=AUDIO_CAP_LPCM| + AUDIO_CAP_MP1| + AUDIO_CAP_MP2| + AUDIO_CAP_AC3; + + if (copy_to_user(parg, &cap, + sizeof(cap))) + return -EFAULT; + } + break; + + + case AUDIO_SET_STREAMTYPE: + { + int f = -1; + + switch(arg){ + case AUDIO_CAP_DTS: + case AUDIO_CAP_MP3: + case AUDIO_CAP_AAC: + case AUDIO_CAP_SDDS: + case AUDIO_CAP_OGG: + f = audio_none; + break; + + case AUDIO_CAP_LPCM: + f = audio_LPCM; + break; + + case AUDIO_CAP_MP1: + case AUDIO_CAP_MP2: + f = audio_MPEG; + break; + + case AUDIO_CAP_AC3: + f = audio_AC3; + break; + } + + card->setup.audioselect = (audio_type) f; + DecoderPrepareAudio(card); + break; + } + + case AUDIO_SET_ID: + if (arg < 0 || arg >32) arg = 0; + card->setup.audioID = arg; + arg = 0; + case AUDIO_SET_EXT_ID: + if (arg < 0 || arg >32) arg = 0; + card->setup.audioIDext = arg; + + attr = card->lastaattr; + DecoderSelectAudioID(card); + card->lastaattr = attr; + break; + + case AUDIO_SET_MIXER: + return -EINVAL; + + case AUDIO_SET_ATTRIBUTES: + SetAudioAttr(card,arg); + card->startingDVDA = ((card->setup.audioselect != audio_none) + && (card->setup.audioselect != + audio_disable)); + break; + + + case AUDIO_SET_KARAOKE: + { + break; + } + + default: + return -ENOIOCTLCMD; + } + break; + + case DVB_DEVICE_DEMUX_0: + return DmxDevIoctl(&card->dmxdev, file, cmd, arg); + break; + + case DVB_DEVICE_OSD_0: + { + switch (cmd) { + case OSD_SEND_CMD: + { + osd_cmd_t doc; + + if(copy_from_user(&doc, parg, + sizeof(osd_cmd_t))) + return -EFAULT; + return OSD_DrawCommand(card, &doc); + } + default: + return -EINVAL; + } + break; + } + default: + return -EOPNOTSUPP; + } + return 0; +} + +static unsigned int +dvbdev_poll(struct dvb_device *dvbdev, int num, + struct file *file, poll_table * wait) +{ + struct cvdv_cards *card=(struct cvdv_cards *) dvbdev->priv; + int type=num2type(card, num); + + switch (type) { + case DVB_DEVICE_DEMUX_0: + return DmxDevPoll(&card->dmxdev, file, wait); + + case DVB_DEVICE_VIDEO_0: + return PSpoll(file, wait); + + case DVB_DEVICE_AUDIO_0: + return poll_audio(file, wait); + + case DVB_DEVICE_CA_0: + break; + + default: + return -EOPNOTSUPP; + } + + return 0; +} + + +static int +dvbdev_device_type(struct dvb_device *dvbdev, unsigned int num) +{ + struct cvdv_cards *card=(struct cvdv_cards *) dvbdev->priv; + + return num2type(card, num); +} +#endif + +/****************************************************************************** + * driver registration + ******************************************************************************/ + + +#ifdef DVB + +#define INFU 32768 + + + +static dvb_devs_t mdvb_devs = { + 9, + { + DVB_DEVICE_VIDEO_0, DVB_DEVICE_AUDIO_0, + -1, -1, + DVB_DEVICE_DEMUX_0, DVB_DEVICE_DVR_0, + -1, -1, + DVB_DEVICE_OSD_0, + }, + { INFU, INFU, INFU, INFU, INFU, 1, 1, INFU, 1 }, + { 1, 1, 1, 1, INFU, 1, 1, 1, 1} +}; + + +static int +dvb_start_feed(dvb_demux_feed_t *dvbdmxfeed) +{ + dvb_demux_t *dvbdmx=dvbdmxfeed->demux; + struct cvdv_cards * card = (struct cvdv_cards *)dvbdmx->priv; + + if (!dvbdmx->dmx.frontend || !card) + return -EINVAL; + + if (dvbdmxfeed->type == DMX_TYPE_TS) { + if ((dvbdmxfeed->ts_type & TS_DECODER) + && (dvbdmxfeed->pes_typedmx.frontend->source) { + case DMX_MEMORY_FE: + if (dvbdmxfeed->ts_type & TS_DECODER) + if (dvbdmxfeed->pes_type<2 && + dvbdmx->pids[0]!=0xffff && + dvbdmx->pids[1]!=0xffff) { + + setup_ts2pes( &card->tsa, + &card->tsv, + dvbdmx->pids, + dvbdmx->pids+1, + pes_write, + (void *)card); + + dvbdmx->playing=1; + } + break; + default: + return -EINVAL; + break; + } + } + } + + if (dvbdmxfeed->type == DMX_TYPE_SEC) { + int i; + + for (i=0; ifilternum; i++) { + if (dvbdmx->filter[i].state!=DMX_STATE_READY) + continue; + if (dvbdmx->filter[i].type!=DMX_TYPE_SEC) + continue; + if (dvbdmx->filter[i].filter.parent!= + &dvbdmxfeed->feed.sec) + continue; + + dvbdmxfeed->feed.sec.is_filtering=1; + dvbdmx->filter[i].state=DMX_STATE_GO; + } + } + + return 0; +} + + +static int +dvb_stop_feed(dvb_demux_feed_t *dvbdmxfeed) +{ + dvb_demux_t *dvbdmx=dvbdmxfeed->demux; + struct cvdv_cards * card = (struct cvdv_cards *)dvbdmx->priv; + if (!card) + return -EINVAL; + + if (dvbdmxfeed->type == DMX_TYPE_TS) { + if ((dvbdmxfeed->ts_type & TS_DECODER) + && (dvbdmxfeed->pes_type<=1)) { + if (dvbdmx->playing) { + free_ipack(&card->tsa); + free_ipack(&card->tsv); + DecoderPause(card); + dvbdmx->playing=0; + } + } + + } + if (dvbdmxfeed->type == DMX_TYPE_SEC) { + int i; + + for (i=0; ifilternum; i++) + if (dvbdmx->filter[i].state==DMX_STATE_GO && + dvbdmx->filter[i].filter.parent== + &dvbdmxfeed->feed.sec) { + dvbdmx->filter[i].state=DMX_STATE_READY; + } + + } + return 0; +} + +static uint16_t get_pid(uint8_t *pid) +{ + uint16_t pp = 0; + + pp = (pid[0] & PID_MASK_HI)<<8; + pp |= pid[1]; + + return pp; +} + + +static int +dvb_write_to_decoder(dvb_demux_feed_t *dvbdmxfeed, uint8_t *buf, size_t count) +{ + dvb_demux_t *dvbdmx=dvbdmxfeed->demux; + struct cvdv_cards * card = (struct cvdv_cards *)dvbdmx->priv; + uint16_t pid = 0; + int off = 0; + + ipack *p; + + if (!card) + return -EINVAL; + + pid = get_pid(buf+1); + + if (pid == *(card->tsa.pid)) p = &(card->tsa); + else if (pid == *(card->tsv.pid)) p = &(card->tsv); + else return 0; + + if (dvbdmxfeed->pes_type>1) + return -1; + if (!(buf[3]&0x10)) // no payload? + return -1; + + if (count != TS_SIZE) return -1; + + if ( buf[3] & ADAPT_FIELD) { // adaptation field? + off = buf[4] + 1; + } + + + if (pid == *(card->tsa.pid)){ + MDEBUG(0,"AUDIO count: %d off: %d\n",count,off); + margi_write_audio(card, buf+off+4, TS_SIZE-4-off, 0); + } else { + MDEBUG(0,"VIDEO count: %d off: %d\n",count,off); + margi_write(card, buf+off+4, TS_SIZE-4-off, 0); + } + +// ts_to_pes( p, buf); // don't need count (=188) + return 0; +} + +int dvb_register(struct cvdv_cards *card) +{ + int i,ret; + struct dvb_device *dvbd=&card->dvb_dev; + + dvb_demux_t *dvbdemux = (dvb_demux_t *)&card->demux; + + if (card->dvb_registered) + return -1; + card->dvb_registered=1; + + card->audiostate.AVSyncState=0; + card->audiostate.muteState=0; + card->audiostate.playState=AUDIO_STOPPED; + card->audiostate.streamSource=AUDIO_SOURCE_MEMORY; + card->audiostate.channelSelect=AUDIO_STEREO; + card->audiostate.bypassMode=0; + + card->videostate.videoBlank=0; + card->videostate.playState=VIDEO_STOPPED; + card->videostate.streamSource=VIDEO_SOURCE_MEMORY; + card->videostate.videoFormat=VIDEO_FORMAT_4_3; + card->videostate.displayFormat=VIDEO_CENTER_CUT_OUT; + + // init and register demuxes + memcpy(card->demux_id, "demux0_0", 9); + card->demux_id[7] = 1+0x30; + dvbdemux->priv = (void *) card; + dvbdemux->filternum = 32; + dvbdemux->feednum = 32; + dvbdemux->start_feed = dvb_start_feed; + dvbdemux->stop_feed = dvb_stop_feed; + dvbdemux->write_to_decoder = dvb_write_to_decoder; + + dvbdemux->dmx.vendor="CIM"; + dvbdemux->dmx.model="sw"; + dvbdemux->dmx.id=card->demux_id; + dvbdemux->dmx.capabilities=(DMX_TS_FILTERING| + DMX_SECTION_FILTERING| + DMX_MEMORY_BASED_FILTERING); + + DvbDmxInit(&card->demux); + + card->dmxdev.filternum=32; + card->dmxdev.demux=&dvbdemux->dmx; + card->dmxdev.capabilities=0; + + DmxDevInit(&card->dmxdev); + + card->mem_frontend.id="mem_frontend"; + card->mem_frontend.vendor="memory"; + card->mem_frontend.model="sw"; + card->mem_frontend.source=DMX_MEMORY_FE; + ret=dvbdemux->dmx.add_frontend(&dvbdemux->dmx, + &card->mem_frontend); + if (ret<0) + return ret; + ret=dvbdemux->dmx.connect_frontend(&dvbdemux->dmx, + &card->mem_frontend); + if (ret<0) + return ret; + + // init and register dvb device structure + dvbd->priv=(void *) card; + dvbd->open=dvbdev_open; + dvbd->close=dvbdev_close; + dvbd->write=dvbdev_write; + dvbd->read=dvbdev_read; + dvbd->ioctl=dvbdev_ioctl; + dvbd->poll=dvbdev_poll; + dvbd->device_type=dvbdev_device_type; + + for (i=0; iusers[i]=card->writers[i]=0; + + card->dvb_devs=0; + card->dvb_devs=&mdvb_devs; + + return dvb_register_device(dvbd); +} + +void dvb_unregister(struct cvdv_cards *card) +{ + dvb_demux_t *dvbdemux=&card->demux; + + dvbdemux->dmx.close(&dvbdemux->dmx); + dvbdemux->dmx.remove_frontend(&dvbdemux->dmx, &card->mem_frontend); + DmxDevRelease(&card->dmxdev); + DvbDmxRelease(&card->demux); + dvb_unregister_device(&card->dvb_dev); +} +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/cvdvext.h linux.20pre5-ac2/drivers/media/video/margi/cvdvext.h --- linux.20pre5/drivers/media/video/margi/cvdvext.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/cvdvext.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,30 @@ +/* + cvdvtypes.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _CVDVEXT_H_ +#define _CVDVEXT_H_ + +#include +#include "cvdvtypes.h" + +#define OSD_Draw(file,cmd) ioctl(fileno(file),_IO(CVDV_IOCTL_MAGIC,IOCTL_DRAW),&cmd) +#define DecoderCommand(file,cmd) ioctl(fileno(file),_IO(CVDV_IOCTL_MAGIC,IOCTL_DECODER),&cmd) + +#endif // _CVDVEXT_H_ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/cvdv.h linux.20pre5-ac2/drivers/media/video/margi/cvdv.h --- linux.20pre5/drivers/media/video/margi/cvdv.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/cvdv.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,58 @@ +/* + cvdv.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _CVDV_H_ +#define _CVDV_H_ + + ////////////////////////////////////////////////////////// + // // + // Convergence Digital Video Decoder Card // + // Definitions for the PCI-Card and the Char-Driver // + // // +////////////////////////////////////////////////////////// + + +#include "cardbase.h" +#include "dram.h" +#include "osd.h" +#include "crc.h" +#include "l64021.h" +#include "audio.h" +#include "video.h" +#include "streams.h" +#include "decoder.h" +#include "spu.h" + +void SetVideoSystem(struct cvdv_cards *card); +u16 rnd(u16 range); +// debugging of the card: 0=normal, 1=color bars, 2=sync out +#define USE_DEBUG 0 + +#define cimlogo_width 45 +#define cimlogo_height 38 + +#define CHANNELBUFFERSIZE 32768*8 + +int Prepare(struct cvdv_cards *card); +int OSDTest(struct cvdv_cards *card); +void v4l_init(struct cvdv_cards *card); +int dvb_register(struct cvdv_cards *card); +void dvb_unregister(struct cvdv_cards *card); +#endif // _CVDV_H_ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/cvdvtypes.h linux.20pre5-ac2/drivers/media/video/margi/cvdvtypes.h --- linux.20pre5/drivers/media/video/margi/cvdvtypes.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/cvdvtypes.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,281 @@ +/* + cvdvtypes.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + ///////////////////////////////////////////////// + // // + // Convergence Digital Video Decoder Card // + // External Definitions for the Char-Driver // + // Copyright (c) 1999 Christian Wolff / // + // convergence integrated media GmbH Berlin // + // // +///////////////////////////////////////////////// + +// As of 1999-11-09 + +#ifndef _CVDVTYPE_H_ +#define _CVDVTYPE_H_ + +// our ioctl number: _IOC_TYPE() is 0xA2 (162) and the range of _IOC_NR() is 0x00 to 0x0F. +// submitted 99/10/15 to mec@shout.net +#define CVDV_IOCTL_MAGIC 0xA2 + +// command numbers _IOC_NR() for ioctl +typedef enum { + IOCTL_DRAW = 0x01, + IOCTL_DECODER = 0x02 +} IOCTL_Command; + + +// supported Videosystems +// everything but PAL and NTSC is untested and probably won't work. +typedef enum { + NTSC = 1, // NTSC 29.97 fps + NTSC60, // NTSC 30 fps + PAL, // PAL-B, D, G, H, I, 25 fps + PALM, // PAL-M 29.97 fps + PALM60, // PAL-M 30 fps + PALN, // PAL-N 25 fps + PALNc, // PAL-Nc 25 fps + PAL60 // PAL 30 fps (doesn't work, yet...) +} videosystem; + +typedef enum { + stream_none = 0, // unknown + stream_ES, + stream_PES, + stream_PS, + stream_DVD +} stream_type; + +typedef enum { + audio_disable = -1, + audio_none = 0, // unknown + audio_MPEG, + audio_MPEG_EXT, + audio_LPCM, + audio_AC3, + audio_DTS, + audio_SDDS +} audio_type; + +#if 0 +typedef enum { + // All functions return -2 on "not open" + OSD_Close = 1, // () + // Disables OSD and releases the buffers + // returns 0 on success + OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0)) + // Opens OSD with this size and bit depth + // returns 0 on success, -1 on DRAM allocation error, -2 on "already open" + OSD_Show, // () + // enables OSD mode + // returns 0 on success + OSD_Hide, // () + // disables OSD mode + // returns 0 on success + OSD_Clear, // () + // Sets all pixel to color 0 + // returns 0 on success + OSD_Fill, // (color) + // Sets all pixel to color + // returns 0 on success + OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1}) + // set palette entry to , and apply + // R,G,B: 0..255 + // R=Red, G=Green, B=Blue + // opacity=0: pixel opacity 0% (only video pixel shows) + // opacity=1..254: pixel opacity as specified in header + // opacity=255: pixel opacity 100% (only OSD pixel shows) + // returns 0 on success, -1 on error + OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data) + // Set a number of entries in the palette + // sets the entries "firstcolor" through "lastcolor" from the array "data" + // data has 4 byte for each color: + // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel + OSD_SetTrans, // (transparency{color}) + // Sets transparency of mixed pixel (0..15) + // returns 0 on success + OSD_SetPixel, // (x0,y0,color) + // sets pixel , to color number + // returns 0 on success, -1 on error + OSD_GetPixel, // (x0,y0) + // returns color number of pixel ,, or -1 + OSD_SetRow, // (x0,y0,x1,data) + // fills pixels x0,y through x1,y with the content of data[] + // returns 0 on success, -1 on clipping all pixel (no pixel drawn) + OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data) + // fills pixels x0,y0 through x1,y1 with the content of data[] + // inc contains the width of one line in the data block, + // inc<=0 uses blockwidth as linewidth + // returns 0 on success, -1 on clipping all pixel + OSD_FillRow, // (x0,y0,x1,color) + // fills pixels x0,y through x1,y with the color + // returns 0 on success, -1 on clipping all pixel + OSD_FillBlock, // (x0,y0,x1,y1,color) + // fills pixels x0,y0 through x1,y1 with the color + // returns 0 on success, -1 on clipping all pixel + OSD_Line, // (x0,y0,x1,y1,color) + // draw a line from x0,y0 to x1,y1 with the color + // returns 0 on success + OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=11 + // fills parameters with the picture dimensions and the pixel aspect ratio + // returns 0 on success + OSD_Test // () + // draws a test picture. for debugging purposes only + // returns 0 on success +// TODO: remove "test" in final version +} OSD_Command; + +struct drawcmd { + OSD_Command cmd; + int x0; + int y0; + int x1; + int y1; + int color; + void *data; +}; +#endif + +typedef enum { + Decoder_Pause, // pause{param1} 0=run 1=pause 2=toggle + Decoder_Still_Put, // (width{param1}, height{param2}, luma{data1}, chroma{data2}) + // show still picture of specified size + // width; width of the image + // height; height of the image + // luma; Y values, one byte per pixel, width*height bytes + // chroma; 4:2:0 U and V values, interlaced, one byte each U, one byte each V, width*height/2 bytes + Decoder_Still_Get, // (width{param1}, height{param2}, luma{data1}, chroma{data2}) + // grab current showing image + // width and height will be set to current picture size + // if luma and croma are NULL, only width and height will be reported + // otherwise the pixel data is filled in there, same format as Still_put + Decoder_Set_Videosystem, // (videosystem{param1}) + // videosystem: see enum {} videosystem; + Decoder_Set_Streamtype, // (streamtype{param1}) + // streamtype: according to enum {} stream_type; + // This has to be set BEFORE you send data to the device + // For ES and PES streams, Audio has to go into the first device (e.g.minor 0) and video into the second (e.g.minor 16) + Decoder_Set_Audiotype, // (audiotype{param1}) + // audiotype: see enum {} audio_type, +16 for IEC956 on S/PDIF out + Decoder_Set_VideoStreamID, // (video stream ID {param1}) + // video stream ID: MPEG ID 0..15 of video stream to display (E0..EF), -1 for any/auto + Decoder_Set_AudioStreamID, // (audio stream ID {param1}, audio extension stream ID {param2}) + // audio stream ID: MPEG ID 0..31 of audio stream to display (C0..DF), -1 for any/auto + // audio extension stream ID: MPEG ID 0..31 of audio extension stream (C0..DF), -1 for none + Decoder_CSS, // Passes CSS information to and from the decoder + // action{param1}, + // data block{data1} MSB first + // execute 1 to 4 once for each disc, then 5 to 8 for each title + // returns 0 on success, <0 on error + // -1: timeout reading data from card + // -2: data pointer not initialized + // -3: invalid action number + // action=0 -> disable and bypass CSS + // Disk key: + // action=1 -> retreive drive challenge (10 byte) from card + // action=2 -> post drive response (5 byte) to card + // action=3 -> post card challenge (10 byte) and retreive card response (5 byte) + // action=4 -> post disk key (2048 byte) into the card + // Title key: + // action=5 -> retreive title challenge (10 byte) from card + // action=6 -> post title response (5 byte) to card + // action=7 -> post card challenge (10 byte) and retreive card response (5 byte) + // action=8 -> post encrypted title key (5 byte) into the card + Decoder_Highlight, // post SPU Highlight information, + // active{param1} + // 1=show highlight, 0=hide highlight + // color information(SL_COLI or AC_COLI){data1[4]} MSB first + // bits: descr. + // 31-28 Emphasis pixel-2 color + // 27-24 Emphasis pixel-1 color + // 23-20 Pattern pixel color + // 19-16 Background pixel color + // 15-12 Emphasis pixel-2 contrast + // 11- 8 Emphasis pixel-1 contrast + // 7- 4 Pattern pixel contrast + // 3- 0 Background pixel contrast + // button position(BTN_POSI){data2[6]} MSB first + // bits: descr. + // 47-46 button color number + // 45-36 start x + // 33-24 end x + // 23-22 auto action mode + // 21-12 start y + // 9- 0 end y + Decoder_SPU, // Activate SPU decoding and select SPU stream ID + // stream{param1} + // active{param2} + Decoder_SPU_Palette, // post SPU Palette information + // length{param1} + // palette{data1} + Decoder_GetNavi, // Retreives CSS-decrypted navigational information from the stream. + // data1 will be filled with PCI or DSI pack (private stream 2 stream_id), + // and the length of data1 (1024 or 0) will be returned + Decoder_SetKaraoke, // Vocal1{param1}, Vocal2{param2}, Melody{param3} + // if Vocal1 or Vocal2 are non-zero, they get mixed into left and right at 70% each + // if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets mixed into the left channel and + // Vocal2 into the right channel at 100% each. + // if Melody is non-zero, the melody channel gets mixed into left and right + Decoder_Set_Videoattribute, // Set the video parameters + // attribute{param1} (2 byte V_ATR) + // bits: descr. + // 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) + // 13-12 TV system (0=525/60, 1=625/50) + // 11-10 Aspect ratio (0=4:3, 3=16:9) + // 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-scan, 2=only letterbox) + // 7 line 21-1 data present in GOP (1=yes, 0=no) + // 6 line 21-2 data present in GOP (1=yes, 0=no) + // 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/576, 3=352x240/288) + // 2 source letterboxed (1=yes, 0=no) + // 0 film/camera mode (0=camera, 1=film (625/50 only)) + Decoder_Set_Audioattribute, // Set the audio parameters + // attribute{param1} (2 most significan bytes of A_ATR (bit 63 through 48)) + // bits: descr. + // 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, 7=SDDS) + // 12 multichannel extension + // 11-10 audio type (0=not spec, 1=language included) + // 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) + // 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, 1=20bit, 2=24bit) + // 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) + // 2- 0 number of audio channels (n+1 channels) + Decoder_WriteBlock, // Post one block of data, e.g. one DVD sector of 2048 byte, into the decoder queue + // sectordata{data1} + // length{param1} + // is_initial_block{param2} + // set_SCR{param3} + /* + Decoder_FFWD, // ffwd{param1} 0=normal 1=ffwd 2=toggle + Decoder_Slow // slow{param1} 0=normal 1=slow 2=toggle + */ +} Decoder_Command; + +struct decodercmd { + Decoder_Command cmd; + int param1; + int param2; + int param3; + int param4; + int param5; + void *data1; + void *data2; +}; + +#endif // _CVDVTYPE_H_ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/decoder.c linux.20pre5-ac2/drivers/media/video/margi/decoder.c --- linux.20pre5/drivers/media/video/margi/decoder.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/decoder.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,1536 @@ +/* + decoder.c + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#define __NO_VERSION__ + +#include "decoder.h" +#include "l64021.h" +#include "video.h" +#include "audio.h" +#include "streams.h" +#include "osd.h" +#include "dram.h" +#include "cvdv.h" + +int DecoderGetNavi(struct cvdv_cards *card, u8 *navidata) +{ + if (card->navihead == card->navitail) return 0; + MDEBUG(3, ": Retreiving NaviPack\n"); + memcpy(navidata, &card->navibuffer[card->navitail], NAVISIZE); + card->navitail += NAVISIZE; + if (card->navitail >= NAVIBUFFERSIZE) card->navitail = 0; + return NAVISIZE; +} + +// returns 1 on overrun, 0 on no error +int DecoderQueueNavi(struct cvdv_cards *card, u8 *navidata) +{ + memcpy(&card->navibuffer[card->navihead], navidata, NAVISIZE); + card->navihead += NAVISIZE; + if (card->navihead >= NAVIBUFFERSIZE) card->navihead = 0; + if (card->navihead == card->navitail) { + MDEBUG(3, ": NaviPack buffer overflow\n"); + card->navitail += NAVISIZE; + if (card->navitail >= NAVIBUFFERSIZE) card->navitail = 0; + return 1; + } + return 0; +} + +u32 ParseSCR(const u8 *data) +{ + u32 SCR_base=0; + u8 scrdata[9]; + copy_from_user (scrdata, data, 9); + + if ((!scrdata[0]) && (!scrdata[1]) && (scrdata[2]==1) + && (scrdata[3]==0xBA) && ((scrdata[4]&0xC0)==0x40)) { + SCR_base=((scrdata[4]>>3)&0x07); + SCR_base=(SCR_base<<2) | (scrdata[4]&0x03); + SCR_base=(SCR_base<<8) | scrdata[5]; + SCR_base=(SCR_base<<5) | ((scrdata[6]>>3)&0x1F); + SCR_base=(SCR_base<<2) | (scrdata[6]&0x03); + SCR_base=(SCR_base<<8) | scrdata[7]; + SCR_base=(SCR_base<<5) | ((scrdata[8]>>3)&0x1F); + } + return SCR_base; +} + +u32 SetSCR(struct cvdv_cards *card, u32 SCR_base) +{ + MDEBUG(3, ": SCR in DVD Pack: 0x%08X\n",SCR_base); + if (DecoderReadByte(card, 0x007) & 0x10) { // SCR already stopped + DecoderWriteByte(card,0x009,SCR_base&0xFF); // Set SCR counter + DecoderWriteByte(card,0x00A,(SCR_base>>8)&0xFF); + DecoderWriteByte(card,0x00B,(SCR_base>>16)&0xFF); + DecoderWriteByte(card,0x00C,(SCR_base>>24)&0xFF); + } else { + DecoderMaskByte(card,0x007,0xD2,0xD2); + // Set 0x10, halt SCR counter + DecoderWriteByte(card,0x009,SCR_base&0xFF); // Set SCR counter + DecoderWriteByte(card,0x00A,(SCR_base>>8)&0xFF); + DecoderWriteByte(card,0x00B,(SCR_base>>16)&0xFF); + DecoderWriteByte(card,0x00C,(SCR_base>>24)&0xFF); + DecoderMaskByte(card,0x007,0xD2,0xC2); + // Del 0x10, SCR counter run + } + return SCR_base; +} + +void DecoderPause(struct cvdv_cards *card) +{ + DecoderMaskByte(card, 0x007, 0xD2, 0xD2); + // Set 0x010, halt SCR counter + AudioSetPlayMode(card, MAUDIO_PAUSE); + DecoderStopDecode(card); +#ifdef DVB + card->videostate.playState=VIDEO_FREEZED; +#endif + card->videoffwd = 0; + card->videoslow = 0; +} + +void DecoderUnPause(struct cvdv_cards *card) +{ + DecoderStartDecode(card); + card->videoffwd = 0; + AudioSetPlayMode(card, MAUDIO_PLAY); + DecoderMaskByte(card, 0x007, 0xD2, 0xC2); + // Del 0x010, SCR counter run +#ifdef DVB + card->videostate.playState=VIDEO_PLAYING;; +#endif + card->videoslow = 0; +} + +void CloseCard(struct cvdv_cards *card) +{ +#ifdef NOINT + spin_lock(&card->timelock); + del_timer(&card->timer); + spin_unlock(&card->timelock); +#endif + MargiFlush(card); + MDEBUG(1, ": Closing card\n"); + card->DecoderOpen = 1; + DecoderClose(card); + DecoderUnPrepare(card); + DecoderStreamReset(card); + DecoderSetupReset(card); + VideoSetBackground(card, 1, 0, 0, 0); + + AudioClose(card); + OSDClose(card); + L64021Init(card); + MargiFreeBuffers(card); + + OSDOpen(card, 50, 50, 150, 150, 2, 1); + OSDTest(card); +} + + +void DecoderReadAudioInfo(struct cvdv_cards *card) +{ + u8 data; + static int bitrates[17] = {0, 32, 40, 48, 56, 64, 80, 96, 112, + 128, 160, 192, 224, 256, 320, 384, 0}; + struct AudioParam *audio = &card->stream.audio; + data = DecoderReadByte(card, 0x150); + audio->mpeg.present = data & 0x60; + // MPEG Layer Code 00 reserverd, we can assume valid MPEG params + if (audio->mpeg.present) { + audio->mpeg.MPEG2 = data & 0x80; + audio->mpeg.layer = 4 - ((data >> 5) & 0x03); + if (data & 0x0F) { + if ((data & 0x0F) == 1) audio->mpeg.bitrate = 32; + else switch (audio->mpeg.layer) { + case 1: + audio->mpeg.bitrate = 32 * (data & 0x0F); + break; // Layer I + case 2: + audio->mpeg.bitrate = bitrates[(data & 0x0F) + + 1]; + break; // Layer II + default: + audio->mpeg.bitrate = bitrates[data & 0x0F]; + // Layer III + } + } else audio->mpeg.bitrate = 0; + data = DecoderReadByte(card, 0x151); + switch ((data >> 6) & 0x03) { + case 0: + audio->mpeg.samplefreq = 44; + break; + case 1: + audio->mpeg.samplefreq = 48; + break; + case 2: + audio->mpeg.samplefreq = 32; + break; + default: + audio->mpeg.samplefreq = 0; // invalid + } + audio->mpeg.mode = (data >> 3) & 0x03; + audio->mpeg.modeext = (data >> 1) & 0x03; + audio->mpeg.copyright = data & 0x01; + data=DecoderReadByte(card, 0x152); + audio->mpeg.original = data & 0x80; + audio->mpeg.emphasis = (data >> 5) & 0x03; + } + data = DecoderReadByte(card, 0x153); + audio->ac3.present = (data != 0); + // value 0 for bits 0..5 forbidden, we can assume valid ac3 params + if (audio->ac3.present) { + audio->ac3.acmod = (data >> 5) & 0x07; + audio->ac3.dialnorm = data & 0x1F; + data = DecoderReadByte(card, 0x154); + audio->ac3.bsmod = (data >> 5) & 0x07; + audio->ac3.dialnorm2 = data > 0x1F; + data = DecoderReadByte(card, 0x155); + audio->ac3.surmixlev = (data >> 6) & 0x03; + audio->ac3.mixlevel = (data >> 1) & 0x1F; + data = DecoderReadByte(card, 0x156); + audio->ac3.cmixlev = (data >> 6) & 0x03; + audio->ac3.mixlevel2 = (data >> 1) & 0x1F; + data = DecoderReadByte(card, 0x157); + audio->ac3.fscod = (data >> 6) & 0x03; + audio->ac3.lfeon = (data >> 5) & 0x01; + audio->ac3.bsid = data & 0x1F; + data = DecoderReadByte(card, 0x158); + audio->ac3.dsurmod = (data >> 6) & 0x03; + audio->ac3.frmsizecod = data & 0x3F; + audio->ac3.langcod = DecoderReadByte(card, 0x159); + audio->ac3.langcod2 = DecoderReadByte(card, 0x15A); + audio->ac3.timecod = DecoderReadByte(card, 0x15B); + data = DecoderReadByte(card, 0x15C); + audio->ac3.timecod = (audio->ac3.timecod << 6) | + ((data >> 2) & 0x3F); + audio->ac3.roomtyp = data & 0x03; + audio->ac3.timecod2 = DecoderReadByte(card, 0x15D); + data = DecoderReadByte(card, 0x15E); + audio->ac3.timecod2 = (audio->ac3.timecod2 << 6) | + ((data >> 2) & 0x3F); + audio->ac3.roomtyp2 = data & 0x03; + } + audio->pcm.present =! (DecoderReadByte(card, 0x161) & 0x20); + // PCM FIFO not empty? Then, we can assume valid LPCM params + if (audio->pcm.present) { + data = DecoderReadByte(card, 0x15F); + audio->pcm.audio_frm_num = (data >> 3) & 0x1F; + audio->pcm.num_of_audio_ch = data & 0x07; + data = DecoderReadByte(card, 0x160); + audio->pcm.Fs = (data >> 6) & 0x03; + audio->pcm.quantization = (data >> 4) & 0x03; + audio->pcm.emphasis = (data >> 2) & 0x03; + audio->pcm.mute_bit = (data >> 1) & 0x01; + } + switch (card->setup.audioselect) { + case audio_disable: + audio->valid = 0; + break; + case audio_none: + case audio_DTS: + case audio_SDDS: + if ((audio->valid = (audio->ac3.present || + audio->pcm.present || + audio->mpeg.present))) { + if (audio->mpeg.present) { + card->setup.audioselect = audio_MPEG; + } else if (audio->pcm.present) { + card->setup.audioselect = audio_LPCM; + } else if (audio->ac3.present) { + card->setup.audioselect = audio_AC3; + } + } else { + audio->valid = 0; + card->setup.audioselect = audio_none; + } + break; + case audio_MPEG: // MPEG Audio + case audio_MPEG_EXT: // MPEG Audio with extension stream + audio->valid = audio->mpeg.present; + break; + case audio_LPCM: // Linear Pulse Code Modulation LPCM + audio->valid = audio->pcm.present; + break; + case audio_AC3: // AC-3 + audio->valid = audio->ac3.present; + break; + } + MDEBUG(1, ": -- DecoderReadAudioInfo - type/valid %d/%d:\n", card->setup.audioselect, audio->valid); + if (audio->mpeg.present || audio->ac3.present || audio->pcm.present) + MDEBUG(1, ": Audio - Decoded parameters:\n"); + if (audio->mpeg.present) MDEBUG(1, ": MPEG%s Layer %d, %d kHz, %d kbps, %s, %s%s, %s emphasis\n", + ((audio->mpeg.MPEG2) ? "2" : "1"), + audio->mpeg.layer, + audio->mpeg.samplefreq, + audio->mpeg.bitrate, + ((audio->mpeg.mode == 0) ? "stereo" : ((audio->mpeg.mode == 1) ? "joint stereo" : ((audio->mpeg.mode == 2) ? "dual channel" : "single channel"))), + ((audio->mpeg.copyright) ? "copyrighted " : ""), + ((audio->mpeg.original) ? "original" : "copy"), + ((audio->mpeg.emphasis == 0) ? "no" : ((audio->mpeg.emphasis == 1) ? "50/15 usec." : ((audio->mpeg.emphasis == 2) ? "invalid" : "J.17"))) + ); + if (audio->ac3.present) MDEBUG(1, ": AC3 acmod=%d bsmod=%d dialnorm=%d dialnorm2=%d surmixlev=%d mixlevel=%d cmixlev=%d mixlevel2=%d fscod=%d lfeon=%d bsid=%d dsurmod=%d frmsizecod=%d langcod=%d langcod2=%d timecod=%d roomtyp=%d timecod2=%d roomtyp2=%d\n", + audio->ac3.acmod, + audio->ac3.bsmod, + audio->ac3.dialnorm, + audio->ac3.dialnorm2, + audio->ac3.surmixlev, + audio->ac3.mixlevel, + audio->ac3.cmixlev, + audio->ac3.mixlevel2, + audio->ac3.fscod, + audio->ac3.lfeon, + audio->ac3.bsid, + audio->ac3.dsurmod, + audio->ac3.frmsizecod, + audio->ac3.langcod, + audio->ac3.langcod2, + audio->ac3.timecod, + audio->ac3.roomtyp, + audio->ac3.timecod2, + audio->ac3.roomtyp2); + if (audio->pcm.present) MDEBUG(1, ": LPCM audio_frm_num=%d num_of_audio_ch=%d Fs=%d quantization=%d emphasis=%d mute_bit=%d\n", + audio->pcm.audio_frm_num, + audio->pcm.num_of_audio_ch, + audio->pcm.Fs, + audio->pcm.quantization, + audio->pcm.emphasis, + audio->pcm.mute_bit); +} + +void DecoderReadAuxFifo(struct cvdv_cards *card) +{ + int i = 0; + u8 data; + int layer; + + struct StreamInfo *stream = &card->stream; + MDEBUG(3, ": AUX - %03X ", card->AuxFifo[card->AuxFifoTail]); + while (card->AuxFifoHead != card->AuxFifoTail) { + + layer = (card->AuxFifo[card->AuxFifoTail] >> 8) & 0x07; + data = card->AuxFifo[card->AuxFifoTail] & 0xFF; + card->AuxFifoTail = (card->AuxFifoTail + 1) & FIFO_MASK; + if (layer != card->AuxFifoLayer) { // start of a new layer? + i = 0; + card->AuxFifoLayer = layer; + } else i++; + switch (layer) { // layer code + case 0: // sequence header + if (! stream->sh.valid) switch (i) { + case 0: + stream->sh.hsize = data & 0x0F; + break; + case 1: + stream->sh.hsize = (stream->sh.hsize << 8) + | data; + stream->hsize = stream->sh.hsize; + break; + case 2: + stream->sh.vsize = data & 0x0F; + break; + case 3: + stream->sh.vsize = (stream->sh.vsize << 8) | + data; + stream->vsize = stream->sh.vsize; + break; + case 4: + stream->sh.aspectratio = data & 0x0F; + break; + case 5: + stream->sh.frameratecode = data & 0x0F; + break; + case 6: + stream->sh.bitrate = data & 0x03; + break; + case 7: + stream->sh.bitrate = (stream->sh.bitrate << 8) + | data; + break; + case 8: + stream->sh.bitrate = (stream->sh.bitrate << 8) + | data; + stream->bitrate = stream->sh.bitrate; + break; + case 9: + stream->sh.vbvbuffersize = data & 0x03; + break; + case 10: + stream->sh.vbvbuffersize = + (stream->sh.vbvbuffersize << 8) | + data; + stream->vbvbuffersize = + stream->sh.vbvbuffersize; + break; + case 11: + stream->sh.constrained = data & 0x01; + stream->sh.valid = 1; + MDEBUG(1, ": AUX - MPEG1 - %dx%d %s %s fps, %d bps, %d kByte vbv%s\n", stream->sh.hsize, stream->sh.vsize, + ((stream->sh.aspectratio == 1) ? "1:1" : + ((stream->sh.aspectratio == 2) ? "3:4" : + ((stream->sh.aspectratio == 3) ? "9:16" : + ((stream->sh.aspectratio == 4) ? "1:2.21" : + "?:?")))), + ((stream->sh.frameratecode == 1) ? "23.976" : + ((stream->sh.frameratecode == 2) ? "24" : + ((stream->sh.frameratecode == 3) ? "25" : + ((stream->sh.frameratecode == 4) ? "29.97" : + ((stream->sh.frameratecode == 5) ? "30" : + ((stream->sh.frameratecode == 6) ? "50" : + ((stream->sh.frameratecode == 7) ? "59.94" : + ((stream->sh.frameratecode == 8) ? "60" : + "?")))))))), + stream->sh.bitrate * 400, + stream->sh.vbvbuffersize * 16, + ((stream->sh.constrained) ? ", constrained" : "") + ); + break; + } + break; + case 1: // group of pictures + if (! stream->gop.valid) + switch (i) { + case 0: + stream->gop.timecode = data & 0x01; + break; + case 1: + stream->gop.timecode = + (stream->gop.timecode << 8) | + data; + break; + case 2: + stream->gop.timecode = + (stream->gop.timecode << 8) | + data; + break; + case 3: + stream->gop.timecode = + (stream->gop.timecode << 8) | + data; + break; + case 4: + stream->gop.closedgop = data & 0x01; + break; + case 5: + stream->gop.brokenlink = data & 0x01; + stream->gop.valid = 1; + break; + } + break; + case 2: // picture + if (0) + switch (i) { + case 0: + break; + } + break; + case 7: // extension layer + if (i == 0) card->AuxFifoExt = data; + else + switch (card->AuxFifoExt) { // extension code + case 1: // sequence extension + if ((stream->sh.valid) && + (! stream->se.valid)) + switch (i) { + case 1: + stream->se.profilelevel + = data; + break; + case 2: + stream->se.progressive + = data & 0x01; + break; + case 3: + stream->se.chroma = + (data >> 4) & + 0x03; + stream->se.hsizeext = + (data >> 2) & + 0x03; + stream->se.vsizeext = + data & 0x03; + stream->hsize |= + (stream->se.hsizeext << 12); + stream->vsize |= + (stream->se.vsizeext << 12); + break; + case 4: + stream->se.bitrateext = + data & 0x0F; + break; + case 5: + stream->se.bitrateext = + (stream->se.bitrateext << 8) | data; + stream->bitrate |= + (stream->se.bitrateext << 18); + break; + case 6: + stream->se.vbvbuffersizeext = data; + stream->vbvbuffersize |= (stream->se.vbvbuffersizeext << 10); + break; + case 7: + stream->se.lowdelay = + (data >> 7) & + 0x01; + stream->se.frextn = + (data >> 5) & + 0x03; + stream->se.frextd = + data & 0x1F; + stream->se.valid = 1; + stream->MPEG2 = 1; + MDEBUG(1, ": AUX - MPEG2 - %dx%d %s %s*%d/%d fps, %d bps, %d kByte vbv%s%s\n", stream->hsize, stream->vsize, + ((stream->sh.aspectratio == 1) ? "1:1" : + ((stream->sh.aspectratio == 2) ? "3:4" : + ((stream->sh.aspectratio == 3) ? "9:16" : + ((stream->sh.aspectratio == 4) ? "1:2.21" : + "?:?")))), + ((stream->sh.frameratecode == 1) ? "23.976" : + ((stream->sh.frameratecode == 2) ? "24" : + ((stream->sh.frameratecode == 3) ? "25" : + ((stream->sh.frameratecode == 4) ? "29.97" : + ((stream->sh.frameratecode == 5) ? "30" : + ((stream->sh.frameratecode == 6) ? "50" : + ((stream->sh.frameratecode == 7) ? "59.94" : + ((stream->sh.frameratecode == 8) ? "60" : + "?")))))))), + stream->se.frextn + 1, + stream->se.frextd + 1, + stream->bitrate * 400, + stream->vbvbuffersize * 16, + ((stream->sh.constrained) ? ", constrained" : ""), + ((stream->se.lowdelay) ? ", low delay" : "") + ); + break; + } + break; + case 2: // sequence display extension + if (0) + switch (i) { + case 0: + break; + } + break; + case 3: // quant matrix extension + if (0) + switch (i) { + case 0: + break; + } + break; + case 4: // copyright extension + if (0) + switch (i) { + case 0: + break; + } + break; + case 7: // picture display extension + if (0) switch (i) { + case 0: + break; + } + break; + case 8: // picture coding extension + if (0) + switch (i) { + case 0: + break; + } + break; + default: + break; + } + break; + default:break; + } + + } +} + +void DecoderReadDataFifo(struct cvdv_cards *card) +{ + MDEBUG(3, ": DATA - "); + while (card->DataFifoHead != card->DataFifoTail) { + MDEBUG(3,"%03X ", card->DataFifo[card->DataFifoTail]); + card->DataFifoTail = (card->DataFifoTail + 1) & FIFO_MASK; + } + MDEBUG(3,"\n"); +} + +int DecoderReadNavipack(struct cvdv_cards *card) +{ + u32 startaddr, endaddr, writeaddr; + u8 navipack[1024]; + u16 PacketLength; + u8 SubStreamID; + //struct Navi navi; + int i; + startaddr = (DecoderReadWord(card, 0x05C) & 0x3FFF) << 7; + // 21 bit word address + endaddr = (DecoderReadWord(card, 0x05E) & 0x3FFF) << 7; + // 21 bit word address + writeaddr = DecoderReadByte(card, 0x075) & 0xFF; + writeaddr |= (DecoderReadWord(card, 0x077) & 0x0FFF) << 8; + //writeaddr <<= 3; + MDEBUG(3, ": -- DecoderReadNavipack 0x%08X-0x%08X, ->0x%08X <-0x%08X\n", + startaddr, endaddr, writeaddr, card->NaviPackAddress); + + if (DecoderReadByte(card, 0x07B) & 0xC0) { // navi pack available? + DRAMReadByte(card, card->NaviPackAddress, 1024, navipack, 0); + card->reg07B |= 0x20; // decrement navi counter + DecoderWriteByte(card, 0x07B, card->reg07B); + card->reg07B &= ~0x20; + //DecoderSetByte(card, 0x07B, 0x20); // decrement navi counter + card->NaviPackAddress += 512; // increment in words + if (card->NaviPackAddress >= endaddr) + card->NaviPackAddress = startaddr; + MDEBUG(4, ": Navipack %02X %02X %02X %02X %02X %02X %02X %02X\n", + navipack[0], navipack[1], navipack[2], navipack[3], navipack[4], + navipack[5], navipack[6], navipack[7]); + if ((!navipack[0]) && (!navipack[1]) && (navipack[2] == 1) && + (navipack[3] == 0xBF)) { + PacketLength = (navipack[4] << 8) | navipack[5]; + SubStreamID = navipack[6]; + MDEBUG(4, ": Navipack Len=%d, ID=%d\n", PacketLength, SubStreamID); + i = 7; // start of payload data in navipack[] + switch (SubStreamID) { + case 0: // Presentation Control Information (PCI) + if (PacketLength < 980) return 1; // Packet too small + DecoderQueueNavi(card, navipack); + break; + case 1: // Data Search Information (DSI) + if (PacketLength < 1018) return 1; // Packet too small + DecoderQueueNavi(card, navipack); + break; + default: + break; + } + } else { + MDEBUG(4, "navipack format error:%02X %02X %02X %02X %02X %02X %02X %02X\n", + navipack[0], navipack[1], navipack[2], navipack[3], navipack[4], + navipack[5], navipack[6], navipack[7]); + } + } else { + MDEBUG(4, ": no navi pack avail.\n"); + } + return 0; +} + +int AudioStart(struct cvdv_cards *card) +{ + DecoderReadAudioInfo(card); // detect audio type + if (card->stream.audio.valid) { + MDEBUG(1, ": Audio Init in delayed decoder start\n"); + if (card->AudioInitialized) AudioClose(card); + switch (card->setup.audioselect) { + case audio_MPEG: // MPEG Audio + case audio_MPEG_EXT: // MPEG Audio with ext. + MDEBUG(1, ": Using MPEG Audio\n"); + AudioInit(card, card->stream.audio.mpeg.samplefreq, 0); + if (card->stream.audio.mpeg.mode == 3) AudioDualMono(card, 2); // left channel only + else AudioDualMono(card, 0); + break; + case audio_DTS: + case audio_LPCM: // Linear Pulse Code Modulation LPCM + MDEBUG(1, ": Using LPCM Audio\n"); + AudioInit(card, 48, 0); // or 96 + break; + case audio_AC3: // AC-3 + MDEBUG(1, ": Using AC-3 Audio\n"); + switch (card->stream.audio.ac3.fscod) { + case 0:AudioInit(card, 48, 0); break; + case 1:AudioInit(card, 44, 0); break; + case 2:AudioInit(card, 32, 0); break; + } + break; + case audio_none: + case audio_disable: + case audio_SDDS: + } + } else return 1; + return 0; +} + +u32 DecoderReadSCR(struct cvdv_cards *card, u16 address) +{ + u32 SCR; + SCR = DecoderReadByte(card, address); + SCR |= ((u32)DecoderReadByte(card, address+1) << 8); + SCR |= ((u32)DecoderReadByte(card, address+2) << 16); + SCR |= ((u32)DecoderReadByte(card, address+3) << 24); + return SCR; +} + +u32 DecoderReadRWAddr(struct cvdv_cards *card, u16 address) +{ + u32 addr; + addr = DecoderReadByte(card, address) & 0xFF; + addr |= (((u32)DecoderReadByte(card, address+1) & 0xFF) << 8); + addr |= (((u32)DecoderReadByte(card, address+2) & 0x0F) << 16); + return addr; +} + +int PTSGetFirstPTS(PTSStorage *store, u32 *PTS) +{ + if ( store->end == store->begin ) { + return 0; + } else { + *PTS = store->PTS[store->begin]; + return 1; + } +} + +void PTSStoreAdd(PTSStorage *store, u32 PTS, u32 AddrB, u32 AddrE) +{ + int new; + MDEBUG(3, ": PTSStoreAdd - store in [%d] %08X - %08X\n", store->end, AddrB, AddrE); + + // cheap fix: don't store if address rollover + if ((AddrB & 0x00080000) != (AddrE & 0x00080000)) return; + + new = store->end; + + store->end++; + if (store->end >= store->size) store->end = 0; + if (store->end == store->begin) { + store->begin++; + if (store->begin >= store->size) store->begin = 0; + } + + store->AddrB[new] = AddrB; + store->AddrE[new] = AddrE; + store->PTS[new] = PTS; +} + +int PTSGetPTS (PTSStorage *store, u32 Addr, u32 *PTS ) +{ + u32 AddrB; + u32 AddrE; + int i; + int found; + int search; + + MDEBUG(3, ": PTSGetPTS - search %08X\n", Addr); + + if (store->end == store->begin) { + store->LastAddr = Addr; + return 0; + } + + // Search for the PTS in the array + found = 0; + search = 1; + while (search && !found) { + // Get the first value + i = store->begin; + AddrB = store->AddrB[i]; + AddrE = store->AddrE[i]; + + MDEBUG(3, ": PTSGetPTS - search in [%d] %08X - %08X\n", i, AddrB, AddrE); + + //If in range, keep it + if ((Addr >= AddrB) && (Addr <= AddrE)) { + *PTS = store->PTS[i]; + found = 1; + } else { + if ((Addr & 0x00080000) == (AddrB & 0x00080000)) { + if (Addr < AddrB ) search = 0; + } else { + if ((store->LastAddr & 0x00080000) == (Addr & 0x00080000)) search = 0; + } + } + if (search) { + store->begin++; + if (store->begin >= store->size) store->begin = 0; + if (store->end == store->begin ) search = 0; + } + } + store->LastAddr = Addr; + return found; +} + + +u32 GetPTS(u8 *data, u32* MediaPointer, int mpeg, int hlength,int off) +{ + u32 PTS = 0xFFFFFFFFUL; + int p = 0; + + // Read PTS, if present + if ((mpeg == 2 && data[p + 7] & 0x80) || + (mpeg == 1 && off)) { + if (mpeg == 1) p = off-9; + PTS = (data[p + 9] >> 1) & 0x03UL; + PTS = (PTS << 8) | (data[p + 10] & 0xFFUL); + PTS = (PTS << 7) | ((data[p + 11] >> 1) & 0x7FUL); + PTS = (PTS << 8) | (data[p + 12] & 0xFFULL); + PTS = (PTS << 7) | ((data[p + 13] >> 1) & 0x7FUL); + } + // Now, skip rest of PES header and stuffing + if (mpeg == 2){ + p += (9 + (data[p + 8] & 0xFF)); + p = ((p + 7) / 8) * 8; + } else p = hlength+7; + if (!(data[p++] | data[p++] | data[p++] | data[p++])) { + *MediaPointer = (u32)data[p++] & 0xFF; + *MediaPointer = (*MediaPointer << 8) | ((u32)data[p++] & 0xFF); + *MediaPointer = (*MediaPointer << 8) | ((u32)data[p++] & 0xFF); + *MediaPointer = (*MediaPointer << 8) | ((u32)data[p++] & 0xFF); + } else { + *MediaPointer = 0xFFFFFFFFUL; + } + return PTS; +} + +int ReadPESChunk(struct cvdv_cards *card, u32 *addr, u8 *data, u32 start, u32 end) +{ + int i = 5, err = -1; + while (err && (i--)) err &= DRAMReadByte(card, *addr << 2, 8, &data[0], 0); + if (err) return 1; + (*addr)++; + if (*addr >= end) *addr = start; + return 0; +} + +void ReadPESHeaders(struct cvdv_cards *card) +{ + u8 startcode[] = {0x00, 0x00, 0x01}; + int LoopCount; + u32 LastVAddr; // Current Video Address + u32 LastAAddr; // Current Audio Address + u32 Addr; // Current Header Address + u32 PESAddr; // Pointer from Header Block + u32 PTS; // PTS from Header Block + u8 Data[32]; + u32 AudioPESStart; + u32 AudioPESEnd; + int i, j, p, fail; + u32 FailAddr; + int hlength=0; + int mpeg=0; + int check; + int mp=0; + int off=0; + + AudioPESStart = (DecoderReadWord(card, 0x058) & 0x3FFF) << 5; + AudioPESEnd = ((DecoderReadWord(card, 0x05A) & 0x3FFF) + 1) << 5; + + LastVAddr = DecoderReadRWAddr(card, 0x060); + LastAAddr = DecoderReadRWAddr(card, 0x063); + + if (card->LastAddr == 0) card->LastAddr = AudioPESStart; + + //Read the PES header buffer + Addr = DecoderReadRWAddr(card, 0x072) & 0x0007FFFF; + if (Addr >= AudioPESEnd) { + Addr = card->LastAddr = AudioPESStart; + } + + LoopCount = 0; + while ((card->LastAddr != Addr) && (LoopCount++ < 200)) { + FailAddr = card->LastAddr; + fail = 0; + p = 0; + + if (ReadPESChunk(card, &card->LastAddr, &Data[p], + AudioPESStart, AudioPESEnd)) continue; + p+=8; + j=1; + + if (memcmp(Data, startcode, 3)) continue; + if ((Data[3] == 0xE0) || (Data[3] == 0xBD) + || ((Data[3] & 0xE0) == 0xC0)) { + + fail |= ReadPESChunk(card, &card->LastAddr, + &Data[p], AudioPESStart, + AudioPESEnd); + + + p+=8; + j++; + if ( (Data[6] & 0xC0) == 0x80 ){ + hlength = 9+Data[8]; + mpeg = 2; + } else { + mpeg = 1; + mp = 6; + check = Data[mp]; + mp++; + while (check == 0xFF){ + if (!fail && mp == p) { + fail |= ReadPESChunk( + card, + &card->LastAddr, + &Data[p], + AudioPESStart, + AudioPESEnd); + p+=8; + j++; + } + check = Data[mp]; + mp++; + } + if (!fail && mp == p) { + fail |= ReadPESChunk( + card, + &card->LastAddr, + &Data[p], + AudioPESStart, + AudioPESEnd); + p+=8; + j++; + } + + if ( !fail && (check & 0xC0) == 0x40){ + check = Data[mp]; + mp++; + if (!fail && mp == p) { + fail |= ReadPESChunk( + card, + &card->LastAddr, + &Data[p], + AudioPESStart, + AudioPESEnd); + p+=8; + j++; + } + check = Data[mp]; + mp++; + } + if ( !fail && (check & 0x20)){ + if (check & 0x30) hlength = mp+10; + else hlength = mp+5; + off = mp-1; + } + } + + for (i = 1; (i < ((hlength+7) / 8)) && (!fail); + i++) { + fail |= ReadPESChunk(card, &card->LastAddr, + &Data[p], AudioPESStart, + AudioPESEnd); + p+=8; + j++; + } + + if (!fail) { + PTS = GetPTS(Data, &PESAddr, + mpeg, hlength,off); + if ((PTS != 0xFFFFFFFF) && + (PESAddr != 0xFFFFFFFF)) { + if (Data[3] == 0xE0) { // Video + PTSStoreAdd(&card->VideoPTSStore, PTS, PESAddr, LastVAddr); + } else { // Audio + PTSStoreAdd(&card->AudioPTSStore, PTS, PESAddr, LastAAddr); + } + } + } + } else { + //card->LastAddr = Addr; + } + // In case of error, rewind and try again + if (fail) card->LastAddr = FailAddr; + } +} + +void L64021Intr(struct cvdv_cards *card) +{ + u32 SCR_base, SCR_compareV, SCR_compareA; + u32 VideoAddr, AudioAddr, PTS; + int i, a, v, as, vs, ap, vp; + u8 intr[5]; + u8 layer; + long ISRTime, DeltaSyncTime, Offset; + + int used = 0; + u8 err; + + err = DecoderReadByte(card, 0x095); + if (err & 0x17) { + MDEBUG(0, ": Packet Error: 0x%02X\n", err); + } + + ISRTime = 0; // TODO system time + + for (i = 0; i < 5; i++) + if ((intr[i] = DecoderReadByte(card, i))) used = 1; + if (used) { + if (intr[0] & 0x80) { // new field + card->fields++; + + if (card->videoffwd){ + if (!card->videoffwd_last){ + AudioStopDecode(card); + card->videosync = 0; + card->videoskip = card->videoffwd; + card->videoskip = 0; + card->videoffwd_last = 1; + card->videoskip_last = 0; + } else { + if (card->videoskip_last == -1){ + card->videoskip = + card->videoffwd; + } + + if (!card->videoskip) + card->videoskip_last = -1; + else + card->videoffwd_last = + card->videoffwd; + } + } else if( card->videoffwd_last ){ + card->videoffwd_last = 0; +#ifdef DVB + if (card->audiostate.AVSyncState) +#endif + card->videosync = 1; + AudioStartDecode(card); + } + + + if (card->videoslow){ + if (!card->videoslow_last){ + AudioStopDecode(card); + card->videosync = 0; + card->videodelay = card->videoslow; + card->videoskip = 0; + card->videoslow_last = 1; + card->videodelay_last = 0; + } else { + if (card->videodelay_last == -1){ + card->videodelay = + card->videoslow; + } + + if (!card->videodelay) + card->videodelay_last = -1; + else + card->videodelay_last = + card->videodelay; + } + } else if( card->videoslow_last ){ + card->videoslow_last = 0; +#ifdef DVB + if (card->audiostate.AVSyncState) +#endif + card->videosync = 1; + AudioStartDecode(card); + } + + + if (card->videodelay > 0) { + if( (DecoderReadByte(card, 0x0ED) & 0x03) + == 0x00) { + card->videodelay--; + if(card->videodelay){ + DecoderWriteByte(card, 0x0ED, + 0x01); + } else { + DecoderWriteByte(card, 0x0ED, + 0x00); + } + } else { + card->videodelay--; + if(!card->videodelay){ + DecoderWriteByte(card, 0x0ED, + 0x00); + } + } + } else if (card->videoskip > 0) { + if ((DecoderReadByte(card, 0x0EC) & 0x03) + == 0x00) { + if (DecoderReadWord(card, 0x096) > 5){ + // pictures in video ES channel + card->videoskip--; + if(card->videoskip) { + DecoderWriteByte(card, + 0x0EC + ,0x03); + } else { + DecoderWriteByte(card, + 0x0EC + ,0x00); + } + } else { + card->videoskip = 0; + DecoderWriteByte (card, 0x0EC, + 0x00); + } + } + } + + + i = (DecoderReadByte(card, 0x113) & 0xFC) | + (DecoderReadByte(card, 0x114) & 0x01); + v = DecoderGetVideoESLevel(card); + if (card->startingV) { + vs = card->VideoESSize; + if (vs > 0) vp = (100 * v) / vs; + else vp = 0; + if (vp > 90) { + MDEBUG(0,": Delayed Video Decoder start\n"); + card->startingV = 0; + DecoderStartDecode(card); + //DecoderSetVideoPanic(card, 1, 3); + // video panic at 3 pictures + //DecoderSetVideoPanic(card, 0, DecoderGetVideoESSize(card) / 4); // video panic at 25 percent + } + } + a = DecoderGetAudioESLevel(card); + if (card->startingA) { + as = card->AudioESSize; + if (as > 0) ap = (100 * a) / as; + else ap = 0; + if (ap > 90) { + MDEBUG(0,": Delayed Audio Decoder start\n"); + AudioSetPlayMode(card, MAUDIO_PLAY); + if (!AudioStart(card)) { + card->startingA = 0; + } + } + } + if (card->fields >= 250) { // 5 seconds (PAL) + SCR_base = DecoderReadSCR(card, 0x009); + SCR_compareA = DecoderReadSCR(card, 0x014); + SCR_compareV = DecoderReadSCR(card, 0x00D); + if (DecoderReadByte(card, 0x013) & 0x03) + card->fields = 0; + } + } + + if (intr[0] & 0x04) { // First Slice Start Code + if (card->showvideo) { + // Unmute card video if first picture slice detected + VideoSetBackground(card, 0, 0, 0, 0); // Video on black + card->showvideo = 0; + } + } + + if (intr[0] & 0x02 ) { // Aux/User Data Fifo + used = 0; + while ( (used++ < 1000) && + (layer = DecoderReadByte(card, 0x040)) & 0x03){ + card->AuxFifo[card->AuxFifoHead] = + ((layer << 6) & 0x0700) | + DecoderReadByte(card, 0x043); + card->AuxFifoHead = (card->AuxFifoHead + 1) & + FIFO_MASK; + } + if (used < 1000) DecoderReadAuxFifo(card); + used = 0; + + while ( (used++ < 1000) && + (layer = DecoderReadByte(card, 0x041)) & 0x03){ + card->DataFifo[card->DataFifoHead] = + ((layer << 6) & 0x0300) | + DecoderReadByte(card, 0x043); + card->DataFifoHead = (card->DataFifoHead + 1) + & FIFO_MASK; + } + if (used < 1000 ) DecoderReadDataFifo(card); + } + + if ((intr[0] & 0x01) != card->intdecodestatus) { + // decode status + card->intdecodestatus = intr[0] & 0x01; + MDEBUG(0, ": Int - decode status now %s\n", + ((card->intdecodestatus) ? + "running" : "stopped")); + if (card->intdecodestatus) { // now running + //DecoderSetVideoPanic(card, 1, 3); + // video panic at 3 pictures + card->showvideo = 1; + } else { // now stopped + if (card->closing) { + card->closing = 0; + CloseCard(card); + } + } + + } + + if (intr[1] & 0x10) { // Begin Active Video + if (card->highlight_valid) { + for (i = 0; i < 10; i++) + DecoderWriteByte(card, 0x1C0 + i, + card->highlight[i]); + card->highlight_valid = 0; + } + } + if (intr[1] & 0x08) { // SPU Start Code Detected + MDEBUG(0, ": Int - SPU Start Code Detected\n"); + } + + if (intr[1] & 0x04) { // SCR compare audio + MDEBUG(0, ": Int - SCR compare audio\n"); + DecoderDelByte(card, 0x013, 0x01); + AudioStart(card); + } + + if (intr[2] & 0x20) { // DSI PES data ready + DecoderReadNavipack(card); + } + + if (intr[2] & 0x06) { // Audio / Video PES data ready + ReadPESHeaders(card); + } + + if (intr[3] & 0x40) { // CSS + card->css.status = DecoderReadByte(card, 0x0B0); + if (card->css.status&0x01) + card->css.ChallengeReady = 1; + // challenge ready + if (card->css.status&0x02) + card->css.ResponseReady = 1; + // response ready + if (card->css.status&0x04) + card->css.DiskKey = 1; + // Disk key ready + if (card->css.status&0x08) + card->css.Error = 1; + // Disk key error + if (card->css.status&0x10) + card->css.TitleKey = 1; + // Title key ready + if (card->css.status&0x20) + card->css.TitleKeyDiff = 1; + // Title key error + } + + + if (intr[3] & 0x30) { + // Audio/Video ES channel buffer underflow + MDEBUG(1,": Int - ES channel buffer underflow\n"); + if (card->closing) { + card->closing = 0; + CloseCard(card); + } + } + + if (intr[4] & 0x10 ) { // SPU decode error + MDEBUG(1,": Int - SPU decode error: (1CA)=0x%02X\n", + DecoderReadByte(card, 0x1CA)); + DecoderDelByte(card, 0x1A0, 0x01); // SPU decode stop + DecoderSetByte(card, 0x1A0, 0x01); // SPU decode start + } + + // Audio / Video Syncronisation + + if (card->videosync && !card->videoskip && !card->videodelay) { + SCR_base = DecoderReadSCR(card, 0x009); + SCR_compareV = DecoderReadSCR(card, 0x00D); + if (intr[1] & 0x02) { // picture start code detected + DecoderMaskByte(card, 0x011, 0x03, 0x01); + // Set SCR compare/capture mode to capture + DecoderSetByte(card, 0x11, 0x04); + // Set "capture on picture start" + if (intr[1] & 0x01) { + // audio sync code detected + DecoderSetByte(card, 0x11, 0x08); + // Set "capture on audio sync code" + } + VideoAddr = DecoderReadRWAddr(card,0x080); + if (PTSGetPTS(&card->VideoPTSStore, VideoAddr, + &PTS)) { + card->oldVPTS = card->VPTS; + card->VPTS = PTS; + card->VSCR = ((long)SCR_compareV + - (long)PTS) / 2; +// card->VideoTime = ISRTime; + } + } else if (intr[1] & 0x01) { + // audio sync code detected + DecoderMaskByte(card, 0x011, 0x03, 0x01); + // Set SCR compare/capture mode to capture + DecoderSetByte(card, 0x11, 0x08); + // Set "capture on audio sync code" + AudioAddr = DecoderReadRWAddr(card,0x083); + if (PTSGetPTS(&card->AudioPTSStore, AudioAddr, + &PTS)) { + card->oldAPTS = card->APTS; + card->APTS = PTS; + card->ASCR = ((long)SCR_compareV - + (long)PTS) / 2; + } else { + card->ASCR = 0x7FFFFFFF; + } + + if (card->VSCR != 0x7FFFFFFF) { + if (card->ASCR != 0x7FFFFFFF) { + DeltaSyncTime = ISRTime - + card->SyncTime; + card->SyncTime = ISRTime; + + // Calculate Audio and Video SCR difference + Offset = (card->ASCR - + card->VSCR - + (10 * 736)) / 736; + + // if the APTS and SCR are off update SCR to keep SubPic synced + if ((SCR_compareV > card->APTS) + || ((card->APTS - + SCR_compareV) > + 10000)) { + Offset = 0; + SetSCR(card, + card->APTS); + } + + // if more than 3 frames away + if ((Offset > 3) || + (Offset < -3)) { + if (Offset > 0 ) { + card->videodelay = 0; + if (Offset < 100) { + if (Offset < 10) { + card->videodelay = 1; + } else { + card->videodelay = Offset / 2; + if (card->videodelay > 20) { + card->videodelay = 20; + } + } + MDEBUG(0,": <<< Pausing %d\n", card->videodelay); + } else { + } + } else { + card->videoskip = 0; + if (Offset > -100) { + if (Offset < -10) { + card->videoskip = 10; + } else { + card->videoskip = 3; + } + MDEBUG(0, ": >>> FForward %d\n", card->videoskip); + } + } + } else { + } + card->VSCR = 0x7FFFFFFF; + } + } + } + } + } + DecoderWriteByte(card, 0x006, 0x01); // Clear Interrupt Pin +} + +// Enable the IRQ Masks +void L64021InstallIntr(struct cvdv_cards *card) { + u8 data; + + data=0; + data |= 0x80; // new field + data |= 0x40; // audio sync recovery + data |= 0x20; // SPU SCR compare + // data |= 0x10; // SDRAM Transfer Done + // data |= 0x08; // Sequence End Code Detect + data |= 0x04; // First Slice Start Code + data |= 0x02; // Aux/User Data Fifo + data |= 0x01; // decode status + DecoderWriteByte(card, 0x000, (~data) & 0xFF); + + data = 0; + // data |= 0x80; // SCR compare + // data |= 0x40; // SCR Overflow + // data |= 0x20; // Begin Vertical Blank + data |= 0x10; // Begin Active Video + data |= 0x08; // SPU Start Code Detected + data |= 0x04; // SCR compare audio + data |= 0x02; // picture start code detected + data |= 0x01; // audio sync code detected + DecoderWriteByte(card, 0x001, (~data) & 0xFF); + + data = 0; + // data |= 0x80; // DTS video event + // data |= 0x40; // DTS audio event + data |= 0x20; // DSI PES data ready + // data |= 0x10; // Seq end code in video channel + data |= 0x08; // SPU PES data ready + data |= 0x04; // Video PES data ready + data |= 0x02; // Audio PES data ready + // data |= 0x01; // Pack data ready + DecoderWriteByte(card, 0x002, (~data) & 0xFF); + + data = 0; + // data |= 0x80; // Reserved + data |= 0x40; // CSS + data |= 0x20; // Video ES channel buffer underflow + data |= 0x10; // Audio ES channel buffer underflow + // data |= 0x08; // Data Dump channel PES data ready + data |= 0x04; // SPU channel buffer overflow + //data |= 0x02; // Video ES channel buffer overflow + //data |= 0x01; // Audio ES channel buffer overflow + DecoderWriteByte(card, 0x003, (~data) & 0xFF); + + data = 0; +// data |= 0x80; // S/PDIF channel buffer underflow + // data |= 0x40; // packet error + // data |= 0x20; // reserved + data |= 0x10; // SPU decode error +// data |= 0x08; // Audio Sync error +// data |= 0x04; // Audio CRC or illegal bit error +// data |= 0x02; // context error +// data |= 0x01; // VLC or Run length error + DecoderWriteByte(card, 0x004, (~data) & 0xFF); + card->IntInstalled = 1; +} + +int L64021RemoveIntr(struct cvdv_cards *card) { + // Disable the IRQ Masks + DecoderWriteByte(card, 0x000, 0xFF); // No ints + DecoderWriteByte(card, 0x001, 0xFF); // No ints + DecoderWriteByte(card, 0x002, 0xFF); // No ints + DecoderWriteByte(card, 0x003, 0xFF); // No ints + DecoderWriteByte(card, 0x004, 0xFF); // No ints + card->IntInstalled = 0; + return 0; +} + +int L64021Reset(struct cvdv_cards *card) { + L64021RemoveIntr(card); // Stop interrupts + // Reset + MDEBUG(1, ": L64021 Software reset...\n"); + //DecoderSetByte(card, 0x007, 0x20); // reset on + DecoderMaskByte(card, 0x007, 0xE2, 0xE2); // reset on + while (!(DecoderReadByte(card, 0x007) & 0x02)) ; // wait until reset is done + //DecoderDelByte(card, 0x007, 0x20); // reset off + DecoderMaskByte(card, 0x007, 0xE2, 0xC2); // reset off + MDEBUG(1, ": L64021 Software reset done.\n"); + DecoderStopChannel(card); + DecoderStopDecode(card); + DecoderStreamReset(card); + DecoderSetupReset(card); + printk(KERN_INFO LOGNAME ": L64021 Rev. 0x%02X reset successfully.\n", +DecoderReadByte(card, 0x0F5)); + return 0; +} + +int L64021Setup(struct cvdv_cards *card) { + MDEBUG(1, ": -- L64021Setup\n"); + DecoderWriteByte(card, 0x0C1, 0x88); // + switch (card->videomode) { + case NTSC: // NTSC M, N. America, Taiwan, Japan + DecoderMaskByte(card, 0x122, 0x03, 0x01); // Television Standard: NTSC + /* Default values: + DecoderWriteByte(card, 0x116, 90); // Main Reads per Line + DecoderWriteByte(card, 0x11A, 4); // Vline Count Init + DecoderWriteByte(card, 0x11C, 0x13); // Pixel State Reset Value / BT.656 Mode / Sync Active Low + DecoderWriteByte(card, 0x129, 23); // Start- and End Row + DecoderWriteByte(card, 0x12A, 262 & 0xFF); + DecoderWriteByte(card, 0x12B, (262>>4)&0x70); + DecoderWriteByte(card, 0x12C, 244 & 0xFF); // Start- and End Column + DecoderWriteByte(card, 0x12D, 1683 & 0xFF); + DecoderWriteByte(card, 0x12E, ((1683>>4)&0x70)|((244>>8)&0x07)); + DecoderWriteByte(card, 0x132, 240 & 0xFF); // SAV Column + DecoderWriteByte(card, 0x133, 1684 & 0xFF); // EAV Column + DecoderWriteByte(card, 0x134, ((1684>>4)&0x70)|((240>>8)&0x07)); + DecoderWriteByte(card, 0x12F, (21&0x1F)|((262>>3)&0x20)|(1<<6)|((265>>1)&0x80)); // VCode Zero... + DecoderWriteByte(card, 0x130, 262&0xFF); // ... and VCode Even + DecoderWriteByte(card, 0x131, 265&0xFF); // ... and FCode + */ + break; + case PAL: // PAL-B, D, G, H, I, Europe, Asia + DecoderMaskByte(card, 0x122, 0x03, 0x02); // Television Standard: PAL + /* Default values: + DecoderWriteByte(card, 0x116, 90); // Main Reads per Line + DecoderWriteByte(card, 0x11A, 1); // Vline Count Init + DecoderWriteByte(card, 0x11C, 0x13); // Pixel State Reset Value / BT.656 Mode / Sync Active Low + DecoderWriteByte(card, 0x129, 23); // Start- and End Row + DecoderWriteByte(card, 0x12A, 310 & 0xFF); + DecoderWriteByte(card, 0x12B, (310>>4)&0x70); + DecoderWriteByte(card, 0x12C, 264 & 0xFF); // Start- and End Column + DecoderWriteByte(card, 0x12D, 1703 & 0xFF); + DecoderWriteByte(card, 0x12E, ((1703>>4)&0x70)|((264>>8)&0x07)); + DecoderWriteByte(card, 0x132, 260 & 0xFF); // SAV Column + DecoderWriteByte(card, 0x133, 1704 & 0xFF); // EAV Column + DecoderWriteByte(card, 0x134, ((1704>>4)&0x70)|((260>>8)&0x07)); + DecoderWriteByte(card, 0x12F, (21&0x1F)|((310>>3)&0x20)|(0<<6)|((312>>1)&0x80)); // VCode Zero... + DecoderWriteByte(card, 0x130, 310&0xFF); // ... and VCode Even + DecoderWriteByte(card, 0x131, 312&0xFF); // ... and FCode + */ + break; + case PAL60: // PAL 60Hz + case NTSC60: // NTSC 60Hz, USA HDTV + case PALM: // PAL-M normal, Brazil + case PALM60: // PAL-M HDTV, Brazil + case PALN: // PAL-N, Uruguay, Paraguay + case PALNc: // PAL-Nc, Argentinia + default: // TODO: set mode according to other standards + DecoderMaskByte(card, 0x122, 0x03, 0x00); // Television Standard: User programmed + DecoderWriteByte(card, 0x116, 90); // Main Reads per Line + DecoderWriteByte(card, 0x11A, 1); // Vline Count Init + DecoderWriteByte(card, 0x11C, 0x13); // Pixel State Reset Value / BT.656 Mode / Sync Active Low + DecoderWriteByte(card, 0x129, 23); // Start- and End Row + DecoderWriteByte(card, 0x12A, 310 & 0xFF); + DecoderWriteByte(card, 0x12B, (310>>4)&0x70); + DecoderWriteByte(card, 0x12C, 264 & 0xFF); // Start- and End Column + DecoderWriteByte(card, 0x12D, 1703 & 0xFF); + DecoderWriteByte(card, 0x12E, ((1703>>4)&0x70)|((264>>8)&0x07)); + DecoderWriteByte(card, 0x132, 260 & 0xFF); // SAV Column + DecoderWriteByte(card, 0x133, 1704 & 0xFF); // EAV Column + DecoderWriteByte(card, 0x134, ((1704>>4)&0x70)|((260>>8)&0x07)); + DecoderWriteByte(card, 0x12F, (21&0x1F)|((310>>3)&0x20)|(0<<6)|((312>>1)&0x80)); // VCode Zero... + DecoderWriteByte(card, 0x130, 310&0xFF); // ... and VCode Even + DecoderWriteByte(card, 0x131, 312&0xFF); // ... and FCode + break; + } + DecoderWriteByte(card, 0x045, 0x00); // disable compares and panic mode + DecoderWriteByte(card, 0x094, 0x00); // disable TOS Detect + DecoderMaskByte(card, 0x109, 0x30, 0x00); // Display Override off, don't change OSD, Background + DecoderWriteByte(card, 0x112, 0x00); // Disable Horizontal 2:1 Filter + DecoderWriteByte(card, 0x113, 0x14); // FreezeMode 1 / 3:2 Pulldown / Repeat First Field / Top Field First + DecoderWriteByte(card, 0x114, ( 5 <<3)|( 0 <<1)|( 0 <<2)|( 1 <<7)); // VideoMode/FilterEnable/FilterAB/FieldSyncEnable + DecoderWriteByte(card, 0x115, 0); // Horizontal Filter Scale + DecoderWriteByte(card, 0x117, 0x80); // Automatic Field Inversion Correction +// DecoderWriteByte(card, 0x117, 0x00); // no Automatic Field Inversion Correction + DecoderWriteByte(card, 0x118, 0); // Horizontal Pan and Scan Word Offset (signed) + DecoderWriteByte(card, 0x119, 0); // Vertical Pan and Scan Line Offset + DecoderWriteByte(card, 0x11B, 0x00); // Override Picture Width +// if (0) { // letterbox +// DecoderWriteByte(card, 0x114, (DecoderReadByte(card, 0x114) & ~0x78) | 0x40); // mode 8 +// DecoderWriteByte(card, 0x129, 0x35); +// DecoderWriteByte(card, 0x12A, 0xE7); +// DecoderWriteByte(card, 0x114, DecoderReadByte(card, 0x114) & ~0x77); // ??? +// } else { +// if (0) { // MPEG-1 +// DecoderWriteByte(card, 0x114, (DecoderReadByte(card, 0x114) & ~0x78) | 0x10); // mode 2 +// } else { // MPEG-2 +// DecoderWriteByte(card, 0x114, (DecoderReadByte(card, 0x114) & ~0x78) | 0x28); // mode 5 +// } +// } + L64021InstallIntr(card); // Set the interrupt masks, again + + return 0; +} + +int L64021Init(struct cvdv_cards *card) { +MDEBUG(1, ": -- L64021Init\n"); + L64021Reset(card); + L64021Setup(card); + VideoSetBackground(card, 1, 0, 0, 0); // black + DecoderWriteByte(card, 0x135, 0x01); // Enable Video Out, Disable SPU Mix + DecoderWriteByte(card,0x11C,0x13); // Pixel State Reset Value / BT.656 Mode / Sync Active Low + L64021InstallIntr(card); + return 0; +} + + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/decoder.h linux.20pre5-ac2/drivers/media/video/margi/decoder.h --- linux.20pre5/drivers/media/video/margi/decoder.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/decoder.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,70 @@ +/* + decoder.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef CVDV_DECODER_H +#define CVDV_DECODER_H + +#include "cardbase.h" + + +int DecoderGetNavi(struct cvdv_cards *card, u8 * navidata); + +// returns 1 on overrun, 0 on no error +int DecoderQueueNavi(struct cvdv_cards *card, u8 * navidata); + +u32 ParseSCR(const u8 * scrdata); + +u32 SetSCR(struct cvdv_cards *card, u32 SCR_base); + +void DecoderPause(struct cvdv_cards *card); + +void DecoderUnPause(struct cvdv_cards *card); + +void CloseCard(struct cvdv_cards *card); + + +void DecoderReadAudioInfo(struct cvdv_cards *card); + +void DecoderReadAuxFifo(struct cvdv_cards *card); + +void DecoderReadDataFifo(struct cvdv_cards *card); + +int DecoderReadNavipack(struct cvdv_cards *card); + +int AudioStart(struct cvdv_cards *card); + +// Puts decoder in pause after so many fields +void StepsToPause(struct cvdv_cards *card, int steps); + +void L64021Intr(struct cvdv_cards *card); +//static void L64021Intr(struct cvdv_cards *card); + +// Enable the IRQ Masks +void L64021InstallIntr(struct cvdv_cards *card); + +int L64021RemoveIntr(struct cvdv_cards *card); + +int L64021Reset(struct cvdv_cards *card); + +int L64021Setup(struct cvdv_cards *card); + +int L64021Init(struct cvdv_cards *card); + +#endif /* CVDV_DECODER_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/dmxdev.c linux.20pre5-ac2/drivers/media/video/margi/dmxdev.c --- linux.20pre5/drivers/media/video/margi/dmxdev.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/dmxdev.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,1065 @@ +/* + * dmxdev.c - DVB demultiplexer device + * + * Copyright (C) 2000 Ralph Metzler + * & Marcus Metzler + for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#include +#include +#include +#include + +#include "cardbase.h" +#include "dmxdev.h" + +#ifdef MODULE +MODULE_DESCRIPTION(""); +MODULE_AUTHOR("Ralph Metzler, Marcus Metzler"); +#ifdef MODULE_LICENSE +MODULE_LICENSE("GPL"); +#endif +MODULE_PARM(debug,"i"); +#endif +static int debug = 0; + +#define dprintk if (debug) printk + +inline dmxdev_filter_t * +DmxDevFile2Filter(dmxdev_t *dmxdev, struct file *file) +{ + return (dmxdev_filter_t *) file->private_data; +} + +inline dmxdev_dvr_t * +DmxDevFile2DVR(dmxdev_t *dmxdev, struct file *file) +{ + return (dmxdev_dvr_t *) file->private_data; +} + +static inline void +DmxDevBufferInit(dmxdev_buffer_t *buffer) +{ + buffer->data=0; + buffer->size=8192; + buffer->pread=0; + buffer->pwrite=0; + buffer->error=0; + init_waitqueue_head(&buffer->queue); +} + +static inline int +DmxDevBufferWrite(dmxdev_buffer_t *buf, uint8_t *src, int len) +{ + int split; + int free; + int todo; + + if (!len) + return 0; + if (!buf->data) + return 0; + + free=buf->pread-buf->pwrite; + split=0; + if (free<=0) { + free+=buf->size; + split=buf->size-buf->pwrite; + } + if (len>=free) { + dprintk("dmxdev: buffer overflow\n"); + return -1; + } + if (split>=len) + split=0; + todo=len; + if (split) { + memcpy(buf->data + buf->pwrite, src, split); + todo-=split; + buf->pwrite=0; + } + memcpy(buf->data + buf->pwrite, src+split, todo); + buf->pwrite=(buf->pwrite+todo)%buf->size; + return len; +} + +static ssize_t +DmxDevBufferRead(dmxdev_buffer_t *src, int non_blocking, + char *buf, size_t count, loff_t *ppos) +{ + unsigned long todo=count; + int split, avail, error; + + if (!src->data) + return 0; + if ((error=src->error)) { + src->error=0; + return error; + } + + if (non_blocking && (src->pwrite==src->pread)) + return -EWOULDBLOCK; + + while (todo>0) { + if (non_blocking && (src->pwrite==src->pread)) + return (count-todo) ? (count-todo) : -EWOULDBLOCK; + + if (wait_event_interruptible(src->queue, + (src->pread!=src->pwrite) || + (src->error))<0) + return count-todo; + + if ((error=src->error)) { + src->error=0; + return error; + } + + split=src->size; + avail=src->pwrite - src->pread; + if (avail<0) { + avail+=src->size; + split=src->size - src->pread; + } + if (avail>todo) + avail=todo; + if (splitdata+src->pread, split)) + return -EFAULT; + buf+=split; + src->pread=0; + todo-=split; + avail-=split; + } + if (avail) { + if (copy_to_user(buf, src->data+src->pread, avail)) + return -EFAULT; + src->pread = (src->pread + avail) % src->size; + todo-=avail; + buf+=avail; + } + } + return count; +} + +static dmx_frontend_t * +get_fe(dmx_demux_t *demux, int type) +{ + struct list_head *head, *pos; + + head=demux->get_frontends(demux); + if (!head) + return 0; + list_for_each(pos, head) + if (DMX_FE_ENTRY(pos)->source==type) + return DMX_FE_ENTRY(pos); + + return 0; +} + +static inline void +DmxDevDVRStateSet(dmxdev_dvr_t *dmxdevdvr, int state) +{ + spin_lock_irq(&dmxdevdvr->dev->lock); + dmxdevdvr->state=state; + spin_unlock_irq(&dmxdevdvr->dev->lock); +} + +int +DmxDevDVROpen(dmxdev_t *dmxdev, struct file *file) +{ + dmx_frontend_t *front; + + down(&dmxdev->mutex); + if ((file->f_flags&O_ACCMODE)==O_RDWR) { + if (!(dmxdev->capabilities&DMXDEV_CAP_DUPLEX)) { + up(&dmxdev->mutex); + return -EOPNOTSUPP; + } + } + + if ((file->f_flags&O_ACCMODE)==O_RDONLY) { + DmxDevBufferInit(&dmxdev->dvr_buffer); + dmxdev->dvr_buffer.size=DVR_BUFFER_SIZE; + dmxdev->dvr_buffer.data=vmalloc(DVR_BUFFER_SIZE); + if (!dmxdev->dvr_buffer.data) { + up(&dmxdev->mutex); + return -ENOMEM; + } + } + + if ((file->f_flags&O_ACCMODE)==O_WRONLY) { + dmxdev->dvr_orig_fe=dmxdev->demux->frontend; + + if (!dmxdev->demux->write) { + up(&dmxdev->mutex); + return -EOPNOTSUPP; + } + + front=get_fe(dmxdev->demux, DMX_MEMORY_FE); + + if (!front) { + up(&dmxdev->mutex); + return -EINVAL; + } + dmxdev->demux->disconnect_frontend(dmxdev->demux); + dmxdev->demux->connect_frontend(dmxdev->demux, front); + } + up(&dmxdev->mutex); + return 0; +} + +int +DmxDevDVRClose(dmxdev_t *dmxdev, struct file *file) +{ + down(&dmxdev->mutex); + if ((file->f_flags&O_ACCMODE)==O_WRONLY) { + dmxdev->demux->disconnect_frontend(dmxdev->demux); + dmxdev->demux->connect_frontend(dmxdev->demux, + dmxdev->dvr_orig_fe); + } + if ((file->f_flags&O_ACCMODE)==O_RDONLY) { + if (dmxdev->dvr_buffer.data) { + void *mem=dmxdev->dvr_buffer.data; + mb(); + spin_lock_irq(&dmxdev->lock); + dmxdev->dvr_buffer.data=0; + spin_unlock_irq(&dmxdev->lock); + vfree(mem); + } + } + up(&dmxdev->mutex); + return 0; +} + +ssize_t +DmxDevDVRWrite(dmxdev_t *dmxdev, struct file *file, + const char *buf, size_t count, loff_t *ppos) +{ + int ret; + + if (!dmxdev->demux->write) + return -EOPNOTSUPP; + if ((file->f_flags&O_ACCMODE)!=O_WRONLY) + return -EINVAL; + down(&dmxdev->mutex); + ret=dmxdev->demux->write(dmxdev->demux, buf, count); + up(&dmxdev->mutex); + return ret; +} + +ssize_t +DmxDevDVRRead(dmxdev_t *dmxdev, struct file *file, + char *buf, size_t count, loff_t *ppos) +{ + int ret; + + down(&dmxdev->mutex); + ret= DmxDevBufferRead(&dmxdev->dvr_buffer, + file->f_flags&O_NONBLOCK, + buf, count, ppos); + up(&dmxdev->mutex); + return ret; +} + +static inline void +DmxDevFilterStateSet(dmxdev_filter_t *dmxdevfilter, int state) +{ + spin_lock_irq(&dmxdevfilter->dev->lock); + dmxdevfilter->state=state; + spin_unlock_irq(&dmxdevfilter->dev->lock); +} + +static int +DmxDevSetBufferSize(dmxdev_filter_t *dmxdevfilter, unsigned long size) +{ + dmxdev_buffer_t *buf=&dmxdevfilter->buffer; + + if (buf->size==size) + return 0; + if (dmxdevfilter->state>=DMXDEV_STATE_GO) + return -EBUSY; + spin_lock_irq(&dmxdevfilter->dev->lock); + if (buf->data) + vfree(buf->data); + buf->data=0; + buf->size=size; + buf->pwrite=buf->pread=0; + spin_unlock_irq(&dmxdevfilter->dev->lock); + + if (buf->size) { + void *mem=vmalloc(dmxdevfilter->buffer.size); + + if (!mem) + return -ENOMEM; + spin_lock_irq(&dmxdevfilter->dev->lock); + buf->data=mem; + spin_unlock_irq(&dmxdevfilter->dev->lock); + } + return 0; +} + +static void +DmxDevFilterTimeout(unsigned long data) +{ + dmxdev_filter_t *dmxdevfilter=(dmxdev_filter_t *)data; + + dmxdevfilter->buffer.error=-ETIMEDOUT; + spin_lock_irq(&dmxdevfilter->dev->lock); + dmxdevfilter->state=DMXDEV_STATE_TIMEDOUT; + spin_unlock_irq(&dmxdevfilter->dev->lock); + wake_up(&dmxdevfilter->buffer.queue); +} + +static void +DmxDevFilterTimer(dmxdev_filter_t *dmxdevfilter) +{ + struct dmxSctFilterParams *para=&dmxdevfilter->params.sec; + + del_timer(&dmxdevfilter->timer); + if (para->timeout) { + dmxdevfilter->timer.function=DmxDevFilterTimeout; + dmxdevfilter->timer.data=(unsigned long) dmxdevfilter; + dmxdevfilter->timer.expires=jiffies+1+(HZ/2+HZ*para->timeout)/1000; + add_timer(&dmxdevfilter->timer); + } +} + +static int +DmxDevSectionCallback(u8 *buffer1, size_t buffer1_len, + u8 *buffer2, size_t buffer2_len, + dmx_section_filter_t *filter, + dmx_success_t success) +{ + dmxdev_filter_t *dmxdevfilter=(dmxdev_filter_t *) filter->priv; + int ret; + + if (dmxdevfilter->buffer.error) + return 0; + spin_lock(&dmxdevfilter->dev->lock); + if (dmxdevfilter->state!=DMXDEV_STATE_GO) { + spin_unlock(&dmxdevfilter->dev->lock); + return 0; + } + del_timer(&dmxdevfilter->timer); + dprintk("dmxdev: section callback %02x %02x %02x %02x %02x %02x\n", + buffer1[0], buffer1[1], + buffer1[2], buffer1[3], + buffer1[4], buffer1[5]); + ret=DmxDevBufferWrite(&dmxdevfilter->buffer, buffer1, buffer1_len); + if (ret==buffer1_len) { + ret=DmxDevBufferWrite(&dmxdevfilter->buffer, buffer2, buffer2_len); + } + if (ret<0) { + dmxdevfilter->buffer.pwrite=dmxdevfilter->buffer.pread; + dmxdevfilter->buffer.error=-EBUFFEROVERFLOW; + } + if (dmxdevfilter->params.sec.flags&DMX_ONESHOT) + dmxdevfilter->state=DMXDEV_STATE_DONE; + spin_unlock(&dmxdevfilter->dev->lock); + wake_up(&dmxdevfilter->buffer.queue); + return 0; +} + +static int +DmxDevTSCallback(u8 *buffer1, size_t buffer1_len, + u8 *buffer2, size_t buffer2_len, + dmx_ts_feed_t *feed, + dmx_success_t success) +{ + dmxdev_filter_t *dmxdevfilter=(dmxdev_filter_t *) feed->priv; + dmxdev_buffer_t *buffer; + int ret; + + if (dmxdevfilter->params.pes.output==DMX_OUT_DECODER) + return 0; + + if (dmxdevfilter->params.pes.output==DMX_OUT_TAP) + buffer=&dmxdevfilter->buffer; + else + buffer=&dmxdevfilter->dev->dvr_buffer; + if (buffer->error) { + wake_up(&buffer->queue); + return 0; + } + ret=DmxDevBufferWrite(buffer, buffer1, buffer1_len); + if (ret==buffer1_len) + ret=DmxDevBufferWrite(buffer, buffer2, buffer2_len); + if (ret<0) { + buffer->pwrite=buffer->pread; + buffer->error=-EBUFFEROVERFLOW; + } + wake_up(&buffer->queue); + return 0; +} + + +/* stop feed but only mark the specified filter as stopped (state set) */ + +static int +DmxDevFeedStop(dmxdev_filter_t *dmxdevfilter) +{ + DmxDevFilterStateSet(dmxdevfilter, DMXDEV_STATE_SET); + + switch (dmxdevfilter->type) { + case DMXDEV_TYPE_SEC: + del_timer(&dmxdevfilter->timer); + dmxdevfilter->feed.sec->stop_filtering(dmxdevfilter->feed.sec); + break; + case DMXDEV_TYPE_PES: + dmxdevfilter->feed.ts->stop_filtering(dmxdevfilter->feed.ts); + break; + default: + return -EINVAL; + } + return 0; +} + + +/* start feed associated with the specified filter */ + +static int +DmxDevFeedStart(dmxdev_filter_t *dmxdevfilter) +{ + DmxDevFilterStateSet(dmxdevfilter, DMXDEV_STATE_GO); + + switch (dmxdevfilter->type) { + case DMXDEV_TYPE_SEC: + dmxdevfilter->feed.sec->start_filtering(dmxdevfilter->feed.sec); + break; + case DMXDEV_TYPE_PES: + dmxdevfilter->feed.ts->start_filtering(dmxdevfilter->feed.ts); + break; + default: + return -EINVAL; + } + return 0; +} + + +/* restart section feed if it has filters left associated with it, + otherwise release the feed */ + +static int +DmxDevFeedRestart(dmxdev_filter_t *dmxdevfilter) +{ + int i; + dmxdev_t *dmxdev=dmxdevfilter->dev; + dvb_pid_t pid=dmxdevfilter->params.sec.pid; + + for (i=0; ifilternum; i++) + if (dmxdev->filter[i].state>=DMXDEV_STATE_GO && + dmxdev->filter[i].type==DMXDEV_TYPE_SEC && + dmxdev->filter[i].pid==pid) { + DmxDevFeedStart(&dmxdev->filter[i]); + return 0; + } + + dmxdevfilter->dev->demux-> + release_section_feed(dmxdev->demux, + dmxdevfilter->feed.sec); + + return 0; +} + +static int +DmxDevFilterStop(dmxdev_filter_t *dmxdevfilter) +{ + if (dmxdevfilter->statetype) { + case DMXDEV_TYPE_SEC: + if (!dmxdevfilter->feed.sec) + break; + DmxDevFeedStop(dmxdevfilter); + if (dmxdevfilter->filter.sec) + dmxdevfilter->feed.sec-> + release_filter(dmxdevfilter->feed.sec, + dmxdevfilter->filter.sec); + DmxDevFeedRestart(dmxdevfilter); + dmxdevfilter->feed.sec=0; + break; + case DMXDEV_TYPE_PES: + if (!dmxdevfilter->feed.ts) + break; + DmxDevFeedStop(dmxdevfilter); + dmxdevfilter->dev->demux-> + release_ts_feed(dmxdevfilter->dev->demux, + dmxdevfilter->feed.ts); + dmxdevfilter->feed.ts=0; + break; + default: + if (dmxdevfilter->state==DMXDEV_STATE_ALLOCATED) + return 0; + return -EINVAL; + } + dmxdevfilter->buffer.pwrite=dmxdevfilter->buffer.pread=0; + return 0; +} + +static inline int +DmxDevFilterReset(dmxdev_filter_t *dmxdevfilter) +{ + if (dmxdevfilter->statetype=DMXDEV_TYPE_NONE; + dmxdevfilter->pid=0xffff; + DmxDevFilterStateSet(dmxdevfilter, DMXDEV_STATE_ALLOCATED); + return 0; +} + +static int +DmxDevFilterStart(dmxdev_filter_t *dmxdevfilter) +{ + dmxdev_t *dmxdev=dmxdevfilter->dev; + void *mem; + int ret, i; + + if (dmxdevfilter->statestate>=DMXDEV_STATE_GO) + DmxDevFilterStop(dmxdevfilter); + + mem=dmxdevfilter->buffer.data; + if (!mem) { + mem=vmalloc(dmxdevfilter->buffer.size); + spin_lock_irq(&dmxdevfilter->dev->lock); + dmxdevfilter->buffer.data=mem; + spin_unlock_irq(&dmxdevfilter->dev->lock); + if (!dmxdevfilter->buffer.data) + return -ENOMEM; + } + + switch (dmxdevfilter->type) { + case DMXDEV_TYPE_SEC: + { + struct dmxSctFilterParams *para=&dmxdevfilter->params.sec; + dmx_section_filter_t **secfilter=&dmxdevfilter->filter.sec; + dmx_section_feed_t **secfeed=&dmxdevfilter->feed.sec; + + *secfilter=0; + *secfeed=0; + + /* find active filter/feed with same PID */ + for (i=0; ifilternum; i++) + if (dmxdev->filter[i].state>=DMXDEV_STATE_GO && + dmxdev->filter[i].pid==para->pid) { + if (dmxdev->filter[i].type!=DMXDEV_TYPE_SEC) + return -EBUSY; + *secfeed=dmxdev->filter[i].feed.sec; + break; + } + + /* if no feed found, try to allocate new one */ + if (!*secfeed) { + ret=dmxdev->demux-> + allocate_section_feed(dmxdev->demux, + secfeed, + DmxDevSectionCallback); + if (ret<0) { + printk ("could not alloc feed\n"); + return ret; + } + + ret=(*secfeed)->set(*secfeed, para->pid, 32768, 0, + (para->flags & DMX_CHECK_CRC) ? 1 : 0); + + if (ret<0) { + printk ("could not set feed\n"); + DmxDevFeedRestart(dmxdevfilter); + return ret; + } + } + else + DmxDevFeedStop(dmxdevfilter); + + ret=(*secfeed)->allocate_filter(*secfeed, secfilter); + if (ret<0) { + DmxDevFeedRestart(dmxdevfilter); + dmxdevfilter->feed.sec-> + start_filtering(*secfeed); + dprintk ("could not get filter\n"); + return ret; + } + + (*secfilter)->priv=(void *) dmxdevfilter; + memcpy(&((*secfilter)->filter_value[3]), + &(para->filter.filter[1]), DMX_FILTER_SIZE-1); + memcpy(&(*secfilter)->filter_mask[3], + ¶->filter.mask[1], DMX_FILTER_SIZE-1); + (*secfilter)->filter_value[0]=para->filter.filter[0]; + (*secfilter)->filter_mask[0]=para->filter.mask[0]; + (*secfilter)->filter_mask[1]=0; + (*secfilter)->filter_mask[2]=0; + + dmxdevfilter->todo=0; + dmxdevfilter->feed.sec-> + start_filtering(dmxdevfilter->feed.sec); + DmxDevFilterTimer(dmxdevfilter); + break; + } + + case DMXDEV_TYPE_PES: + { + struct timespec timeout = {0 }; + struct dmxPesFilterParams *para=&dmxdevfilter->params.pes; + dmxOutput_t otype; + int ret; + int ts_type; + dmx_ts_pes_t ts_pes; + dmx_ts_feed_t **tsfeed=&dmxdevfilter->feed.ts; + + dmxdevfilter->feed.ts=0; + otype=para->output; + + ts_pes=(dmx_ts_pes_t) para->pesType; + + if (ts_pesdemux->allocate_ts_feed(dmxdev->demux, + tsfeed, + DmxDevTSCallback); + if (ret<0) + return ret; + + (*tsfeed)->priv=(void *) dmxdevfilter; + ret=(*tsfeed)->set(*tsfeed, para->pid, 188, 32768, 0, timeout); + if (ret<0) { + dmxdev->demux-> + release_ts_feed(dmxdev->demux, *tsfeed); + return ret; + } + if ((*tsfeed)->set_type) + ret=(*tsfeed)->set_type(*tsfeed, ts_type, ts_pes); + if (ret<0) { + dmxdev->demux-> + release_ts_feed(dmxdev->demux, *tsfeed); + return ret; + } + dmxdevfilter->feed.ts-> + start_filtering(dmxdevfilter->feed.ts); + break; + } + default: + return -EINVAL; + } + DmxDevFilterStateSet(dmxdevfilter, DMXDEV_STATE_GO); + return 0; +} + +int +DmxDevFilterNum(dmxdev_t *dmxdev) +{ + int i, num; + + if (!dmxdev->filter) + return 0; + down(&dmxdev->mutex); + for (i=0, num=0; ifilternum; i++) + if (dmxdev->filter[i].state==DMXDEV_STATE_FREE) + num++; + up(&dmxdev->mutex); + return num; +} + +int +DmxDevFilterAlloc(dmxdev_t *dmxdev, struct file *file) +{ + int i; + dmxdev_filter_t *dmxdevfilter; + + if (!dmxdev->filter) + return -EINVAL; + down(&dmxdev->mutex); + for (i=0; ifilternum; i++) + if (dmxdev->filter[i].state==DMXDEV_STATE_FREE) + break; + if (i==dmxdev->filternum) { + up(&dmxdev->mutex); + return -EMFILE; + } + dmxdevfilter=&dmxdev->filter[i]; + file->private_data=dmxdevfilter; + + DmxDevBufferInit(&dmxdevfilter->buffer); + dmxdevfilter->type=DMXDEV_TYPE_NONE; + DmxDevFilterStateSet(dmxdevfilter, DMXDEV_STATE_ALLOCATED); + dmxdevfilter->feed.ts=0; + init_timer(&dmxdevfilter->timer); + + up(&dmxdev->mutex); + //printk("free filters = %d\n", DmxDevFilterNum(dmxdev)); + return 0; +} + +int +DmxDevFilterFree(dmxdev_t *dmxdev, struct file *file) +{ + dmxdev_filter_t *dmxdevfilter; + + down(&dmxdev->mutex); + + if (!(dmxdevfilter=DmxDevFile2Filter(dmxdev, file))) { + up(&dmxdev->mutex); + return -EINVAL; + } + + DmxDevFilterStop(dmxdevfilter); + DmxDevFilterReset(dmxdevfilter); + + if (dmxdevfilter->buffer.data) { + void *mem=dmxdevfilter->buffer.data; + + spin_lock_irq(&dmxdev->lock); + dmxdevfilter->buffer.data=0; + spin_unlock_irq(&dmxdev->lock); + vfree(mem); + } + DmxDevFilterStateSet(dmxdevfilter, DMXDEV_STATE_FREE); + wake_up(&dmxdevfilter->buffer.queue); + up(&dmxdev->mutex); + //printk("free filters = %d\n", DmxDevFilterNum(dmxdev)); + return 0; +} + + +static int +DmxDevFilterSet(dmxdev_t *dmxdev, + dmxdev_filter_t *dmxdevfilter, + struct dmxSctFilterParams *params) +{ + dprintk ("function : %s\n", __FUNCTION__); + + DmxDevFilterStop(dmxdevfilter); + + dmxdevfilter->type=DMXDEV_TYPE_SEC; + dmxdevfilter->pid=params->pid; + memcpy(&dmxdevfilter->params.sec, + params, sizeof(struct dmxSctFilterParams)); + + DmxDevFilterStateSet(dmxdevfilter, DMXDEV_STATE_SET); + + if (params->flags&DMX_IMMEDIATE_START) + return DmxDevFilterStart(dmxdevfilter); + + return 0; +} + +static int +DmxDevPesFilterSet(dmxdev_t *dmxdev, + dmxdev_filter_t *dmxdevfilter, + struct dmxPesFilterParams *params) +{ + DmxDevFilterStop(dmxdevfilter); + + if (params->pesType>DMX_PES_OTHER || params->pesType<0) + return -EINVAL; + + dmxdevfilter->type=DMXDEV_TYPE_PES; + dmxdevfilter->pid=params->pid; + memcpy(&dmxdevfilter->params, params, sizeof(struct dmxPesFilterParams)); + + DmxDevFilterStateSet(dmxdevfilter, DMXDEV_STATE_SET); + + if (params->flags&DMX_IMMEDIATE_START) + return DmxDevFilterStart(dmxdevfilter); + + return 0; +} + +int +DmxDevInit(dmxdev_t *dmxdev) +{ + int i; + + if (dmxdev->demux->open(dmxdev->demux)<0) + return -EUSERS; + + dmxdev->filter=vmalloc(dmxdev->filternum*sizeof(dmxdev_filter_t)); + if (!dmxdev->filter) + return -ENOMEM; + + dmxdev->dvr=vmalloc(dmxdev->filternum*sizeof(dmxdev_dvr_t)); + if (!dmxdev->dvr) { + vfree(dmxdev->filter); + dmxdev->filter=0; + return -ENOMEM; + } + sema_init(&dmxdev->mutex, 1); + spin_lock_init(&dmxdev->lock); + for (i=0; ifilternum; i++) { + dmxdev->filter[i].dev=dmxdev; + dmxdev->filter[i].buffer.data=0; + DmxDevFilterStateSet(&dmxdev->filter[i], DMXDEV_STATE_FREE); + dmxdev->dvr[i].dev=dmxdev; + dmxdev->dvr[i].buffer.data=0; + DmxDevFilterStateSet(&dmxdev->filter[i], DMXDEV_STATE_FREE); + DmxDevDVRStateSet(&dmxdev->dvr[i], DMXDEV_STATE_FREE); + } + DmxDevBufferInit(&dmxdev->dvr_buffer); + MOD_INC_USE_COUNT; + return 0; +} + +void +DmxDevRelease(dmxdev_t *dmxdev) +{ + if (dmxdev->filter) { + vfree(dmxdev->filter); + dmxdev->filter=0; + } + if (dmxdev->dvr) { + vfree(dmxdev->dvr); + dmxdev->dvr=0; + } + dmxdev->demux->close(dmxdev->demux); + MOD_DEC_USE_COUNT; +} + +static ssize_t +DmxDevReadSec(dmxdev_filter_t *dfil, struct file *file, + char *buf, size_t count, loff_t *ppos) +{ + int result, hcount; + int done=0; + + if (dfil->todo<=0) { + hcount=3+dfil->todo; + if (hcount>count) + hcount=count; + result=DmxDevBufferRead(&dfil->buffer, file->f_flags&O_NONBLOCK, + buf, hcount, ppos); + if (result<0) { + dfil->todo=0; + return result; + } + if (copy_from_user(dfil->secheader-dfil->todo, buf, result)) + return -EFAULT; + buf+=result; + done=result; + count-=result; + dfil->todo-=result; + if (dfil->todo>-3) + return done; + dfil->todo=((dfil->secheader[1]<<8)|dfil->secheader[2])&0xfff; + if (!count) + return done; + } + if (count>dfil->todo) + count=dfil->todo; + result=DmxDevBufferRead(&dfil->buffer, file->f_flags&O_NONBLOCK, + buf, count, ppos); + if (result<0) + return result; + dfil->todo-=result; + return (result+done); +} + + +ssize_t +DmxDevRead(dmxdev_t *dmxdev, struct file *file, + char *buf, size_t count, loff_t *ppos) +{ + dmxdev_filter_t *dmxdevfilter=DmxDevFile2Filter(dmxdev, file); + int ret=0; + + down(&dmxdev->mutex); + if (dmxdevfilter->type==DMXDEV_TYPE_SEC) + ret=DmxDevReadSec(dmxdevfilter, file, buf, count, ppos); + else + ret=DmxDevBufferRead(&dmxdevfilter->buffer, + file->f_flags&O_NONBLOCK, + buf, count, ppos); + up(&dmxdev->mutex); + return ret; +} + + +int DmxDevIoctl(dmxdev_t *dmxdev, struct file *file, + unsigned int cmd, unsigned long arg) +{ + void *parg=(void *)arg; + int ret=0; + + dmxdev_filter_t *dmxdevfilter=DmxDevFile2Filter(dmxdev, file); + + if (!dmxdevfilter) + return -EINVAL; + + down(&dmxdev->mutex); + switch (cmd) { + case DMX_START: + if (dmxdevfilter->statedemux->get_pes_pids) { + ret=-EINVAL; + break; + } + dmxdev->demux->get_pes_pids(dmxdev->demux, pids); + if (copy_to_user(parg, pids, 5*sizeof(dvb_pid_t))) + ret=-EFAULT; + break; + } + + default: + ret=-EINVAL; + } + up(&dmxdev->mutex); + return ret; +} + +unsigned int +DmxDevPoll(dmxdev_t *dmxdev, struct file *file, poll_table * wait) +{ + dmxdev_filter_t *dmxdevfilter=DmxDevFile2Filter(dmxdev, file); + + if (!dmxdevfilter) + return -EINVAL; + + if (dmxdevfilter->state==DMXDEV_STATE_FREE) + return 0; + + if (dmxdevfilter->buffer.pread!=dmxdevfilter->buffer.pwrite || + dmxdevfilter->buffer.error) + return (POLLIN | POLLRDNORM | POLLPRI); + + if (dmxdevfilter->state!=DMXDEV_STATE_GO) + return 0; + + poll_wait(file, &dmxdevfilter->buffer.queue, wait); + + if (dmxdevfilter->state==DMXDEV_STATE_FREE) + return 0; + + if (dmxdevfilter->buffer.pread!=dmxdevfilter->buffer.pwrite || + dmxdevfilter->buffer.error) + return (POLLIN | POLLRDNORM | POLLPRI); + + return 0; +} + +int DmxDevDVRIoctl(dmxdev_t *dmxdev, struct file *file, + unsigned int cmd, unsigned long arg) +{ + //void *parg=(void *)arg; + int ret=0; + + down(&dmxdev->mutex); + switch (cmd) { + case DMX_SET_BUFFER_SIZE: + // FIXME: implement + ret=0; + break; + + default: + ret=-EINVAL; + } + up(&dmxdev->mutex); + return ret; +} + +unsigned int +DmxDevDVRPoll(dmxdev_t *dmxdev, struct file *file, poll_table * wait) +{ + if ((file->f_flags&O_ACCMODE)==O_RDONLY) { + if (dmxdev->dvr_buffer.pread!=dmxdev->dvr_buffer.pwrite) + return (POLLIN | POLLRDNORM | POLLPRI); + + poll_wait(file, &dmxdev->dvr_buffer.queue, wait); + + if (dmxdev->dvr_buffer.pread!=dmxdev->dvr_buffer.pwrite) + return (POLLIN | POLLRDNORM | POLLPRI); + + return 0; + } else + return (POLLOUT | POLLWRNORM | POLLPRI); +} + + +#ifdef MODULE +#ifdef EXPORT_SYMTAB +EXPORT_SYMBOL(DmxDevInit); +EXPORT_SYMBOL(DmxDevRelease); + +EXPORT_SYMBOL(DmxDevDVROpen); +EXPORT_SYMBOL(DmxDevDVRClose); +EXPORT_SYMBOL(DmxDevDVRRead); +EXPORT_SYMBOL(DmxDevDVRWrite); +EXPORT_SYMBOL(DmxDevDVRIoctl); +EXPORT_SYMBOL(DmxDevDVRPoll); + +EXPORT_SYMBOL(DmxDevFilterAlloc); +EXPORT_SYMBOL(DmxDevFilterFree); +EXPORT_SYMBOL(DmxDevRead); +EXPORT_SYMBOL(DmxDevIoctl); +EXPORT_SYMBOL(DmxDevPoll); +#endif +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/dmxdev.h linux.20pre5-ac2/drivers/media/video/margi/dmxdev.h --- linux.20pre5/drivers/media/video/margi/dmxdev.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/dmxdev.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,154 @@ +/* + * dmxdev.h + * + * Copyright (C) 2000 Ralph Metzler + * & Marcus Metzler + for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _DMXDEV_H_ +#define _DMXDEV_H_ + +#ifndef __KERNEL__ +#define __KERNEL__ +#endif + +#ifdef __DVB_PACK__ +#include "ost/demux.h" +#include "ost/dmx.h" +#else +#include +#include +#endif +#include +#include +#include +#include + +#if LINUX_VERSION_CODE < 0x020300 +#define WAIT_QUEUE struct wait_queue* +#define init_waitqueue_head(wq) *(wq) = NULL; +#define DECLARE_WAITQUEUE(wait, current) struct wait_queue wait = { current, NULL } +#define list_for_each(pos, head) \ + for (pos = (head)->next; pos != (head); pos = pos->next) +#else +#define WAIT_QUEUE wait_queue_head_t +#endif + +typedef enum { + DMXDEV_TYPE_NONE, + DMXDEV_TYPE_SEC, + DMXDEV_TYPE_PES, +} dmxdev_type_t; + +typedef enum { + DMXDEV_STATE_FREE, + DMXDEV_STATE_ALLOCATED, + DMXDEV_STATE_SET, + DMXDEV_STATE_GO, + DMXDEV_STATE_DONE, + DMXDEV_STATE_TIMEDOUT +} dmxdev_state_t; + +typedef struct dmxdev_buffer_s { + uint8_t *data; + uint32_t size; + int32_t pread; + int32_t pwrite; + WAIT_QUEUE queue; + int error; +} dmxdev_buffer_t; + + +typedef struct dmxdev_filter_s { + union { + dmx_pes_filter_t *pes; + dmx_section_filter_t *sec; + } filter; + + union { + dmx_ts_feed_t *ts; + dmx_section_feed_t *sec; + } feed; + + union { + struct dmxSctFilterParams sec; + struct dmxPesFilterParams pes; + } params; + + int type; + dmxdev_state_t state; + struct dmxdev_s *dev; + dmxdev_buffer_t buffer; + + // only for sections + struct timer_list timer; + int todo; + uint8_t secheader[3]; + + u16 pid; +} dmxdev_filter_t; + + +typedef struct dmxdev_dvr_s { + int state; + struct dmxdev_s *dev; + dmxdev_buffer_t buffer; +} dmxdev_dvr_t; + + +typedef struct dmxdev_s { + dmxdev_filter_t *filter; + dmxdev_dvr_t *dvr; + dmx_demux_t *demux; + + int filternum; + int capabilities; +#define DMXDEV_CAP_DUPLEX 1 + dmx_frontend_t *dvr_orig_fe; + + dmxdev_buffer_t dvr_buffer; +#define DVR_BUFFER_SIZE (512*1024) + + struct semaphore mutex; + spinlock_t lock; +} dmxdev_t; + + +int DmxDevInit(dmxdev_t *dmxdev); +void DmxDevRelease(dmxdev_t *dmxdev); + +int DmxDevFilterAlloc(dmxdev_t *dmxdev, struct file *file); +int DmxDevFilterFree(dmxdev_t *dmxdev, struct file *file); +int DmxDevIoctl(dmxdev_t *dmxdev, struct file *file, + unsigned int cmd, unsigned long arg); +unsigned int DmxDevPoll(dmxdev_t *dmxdev, struct file *file, poll_table * wait); +ssize_t DmxDevRead(dmxdev_t *dmxdev, struct file *file, + char *buf, size_t count, loff_t *ppos); + +int DmxDevDVROpen(dmxdev_t *dmxdev, struct file *file); +int DmxDevDVRClose(dmxdev_t *dmxdev, struct file *file); +ssize_t DmxDevDVRWrite(dmxdev_t *dmxdev, struct file *file, + const char *buf, size_t count, loff_t *ppos); +ssize_t DmxDevDVRRead(dmxdev_t *dmxdev, struct file *file, + char *buf, size_t count, loff_t *ppos); +int DmxDevDVRIoctl(dmxdev_t *dmxdev, struct file *file, + unsigned int cmd, unsigned long arg); +unsigned int DmxDevDVRPoll(dmxdev_t *dmxdev, struct file *file, poll_table * wait); + +#endif /* _DMXDEV_H_ */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/dram.c linux.20pre5-ac2/drivers/media/video/margi/dram.c --- linux.20pre5/drivers/media/video/margi/dram.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/dram.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,515 @@ +/* + dram.c + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + ///////////////////////////////// + // // + // L64021 DRAM Memory Access // + // // +///////////////////////////////// + +#define __NO_VERSION__ + +#include "dram.h" +#include "l64021.h" + +#define EMERGENCYCOUNTER 5 + + // where: 21 bit DRAM Word-Address, 4 word aligned + // size: bytes (8 byte aligned, remainder will be filled with fill value) + // data: fill value +// returns 0 on success, -1 on collision with DMA transfer +int DRAMFillByte(struct cvdv_cards *card, u32 where, int size, u8 data) +{ + int i, j, k, n; + u8 volatile flag; + + size = (size >> 3) + ((size & 7) ? 1 : 0); // 8 bytes at a time, padding with garbage + where >>= 2; // 8 byte aligned data + DecoderSetByte(card, 0x0C1, 0x08); +//TODO: 0x80? + + DecoderWriteByte(card, 0x0C6, (u8) ((where >> 16) & 0x00000007L)); + DecoderWriteByte(card, 0x0C5, (u8) ((where >> 8) & 0x000000FFL)); + DecoderWriteByte(card, 0x0C4, (u8) (where & 0x000000FFL)); + i = 0; + for (j = 0; j < size; j++) { + for (k = 0; k < 8; k++) { + n = EMERGENCYCOUNTER; + do { // wait if FIFO full + flag = DecoderReadByte(card, 0x0C0); + } while ((flag & 0x08) && n--); + if (n<0) + return -1; + DecoderWriteByte(card, 0x0C3, data); + } + } + flag = DecoderReadByte(card, 0x0C0); + n = EMERGENCYCOUNTER; + do { // wait for FIFO empty + flag = DecoderReadByte(card, 0x0C0); + } while (!(flag & 0x04) && n--); + return ((n>=0) ? 0 : -1); +} + + // where: 21 bit DRAM Word-Address, 8 byte aligned + // size: bytes (8 byte aligned, remainder will be filled with garbage) + // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.) +// returns 0 on success, -1 on collision with DMA transfer +int DRAMWriteByte(struct cvdv_cards *card, u32 where, int size, u8 * data, + int swapburst) +{ + int i, j, k, n; + u8 volatile flag; + + size = (size >> 3) + ((size & 7) ? 1 : 0); // 8 bytes at a time, padding with garbage + where >>= 2; // 8 byte aligned data + MDEBUG(4, ": Moving %d 64-bit-words to DRAM 0x%08X\n",size,where); + //if (swap) DecoderDelByte(card,0x0C1,0x08); // byte swapping of 8 byte bursts + //else DecoderSetByte(card,0x0C1,0x08); // no byte swapping + DecoderSetByte(card, 0x0C1, 0x08); // no byte swapping + + DecoderWriteByte(card, 0x0C6, (u8) ((where >> 16) & 0x00000007L)); + DecoderWriteByte(card, 0x0C5, (u8) ((where >> 8) & 0x000000FFL)); + DecoderWriteByte(card, 0x0C4, (u8) (where & 0x000000FFL)); + i = 0; + if (swapburst) { + for (j = 0; j < size; j++) { + for (k = 7; k >= 0; k--) { + n = EMERGENCYCOUNTER; + do { // wait if FIFO full + flag = + DecoderReadByte(card, 0x0C0); + } while ((flag & 0x08) && n--); + if (n<0) + return -1; + DecoderWriteByte(card, 0x0C3, data[i + k]); + } + i += 8; + } + } else { + for (j = 0; j < size; j++) { + for (k = 0; k < 8; k++) { + n = EMERGENCYCOUNTER; + do { // wait if FIFO full + flag = + DecoderReadByte(card, 0x0C0); + } while ((flag & 0x08) && n--); + if (n<0) + return -1; + DecoderWriteByte(card, 0x0C3, data[i++]); + } + } + } + flag = DecoderReadByte(card, 0x0C0); + n = EMERGENCYCOUNTER; + do { // wait for FIFO empty + flag = DecoderReadByte(card, 0x0C0); + } while (!(flag & 0x04) && n--); + return ((n>=0) ? 0 : -1); +} + + // where: 21 bit DRAM Word-Address, 4 word aligned + // size: words (4 word aligned, remainder will be filled with garbage) + // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.) +// returns 0 on success, -1 on collision with DMA transfer +int DRAMWriteWord(struct cvdv_cards *card, u32 where, int size, u16 * data, + int swap) +{ + int i, j, k, n; + u8 volatile flag; + + size = (size >> 2) + ((size & 3) ? 1 : 0); // 4 words at a time, padding with garbage + where >>= 2; // 8 byte aligned data + MDEBUG(4, ": Moving %d 64-bit-words to DRAM 0x%08X\n",size,where); +//TODO: swap manually + if (swap) + DecoderDelByte(card, 0x0C1, 0x08); // byte swapping of 8 byte bursts + else + DecoderSetByte(card, 0x0C1, 0x08); // no byte swapping + + DecoderWriteByte(card, 0x0C6, (u8) ((where >> 16) & 0x00000007L)); + DecoderWriteByte(card, 0x0C5, (u8) ((where >> 8) & 0x000000FFL)); + DecoderWriteByte(card, 0x0C4, (u8) (where & 0x000000FFL)); + i = 0; + for (j = 0; j < size; j++) { + for (k = 0; k < 4; k++) { + n = EMERGENCYCOUNTER; + do { // wait if FIFO full + flag = DecoderReadByte(card, 0x0C0); + } while ((flag & 0x08) && n--); + if (n<0) + return -1; + DecoderWriteByte(card, 0x0C3, data[i] >> 8); + n = EMERGENCYCOUNTER; + do { // wait if FIFO full + flag = DecoderReadByte(card, 0x0C0); + } while ((flag & 0x08) && n--); + if (n<0) + return -1; + DecoderWriteByte(card, 0x0C3, data[i++]); + } + } + flag = DecoderReadByte(card, 0x0C0); + n = EMERGENCYCOUNTER; + do { // wait for FIFO empty + flag = DecoderReadByte(card, 0x0C0); + } while (!(flag & 0x04) && n--); + return ((n>=0) ? 0 : -1); +} + + // where: 21 bit DRAM Word-Address, 8 byte aligned + // size: bytes + // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.) +// returns 0 on success, -1 on collision with DMA transfer +int DRAMReadByte(struct cvdv_cards *card, u32 where, int size, u8 * data, + int swap) +{ + int i, j, rsize, n; + u8 volatile flag; + + rsize = size & 7; // padding bytes + size = size >> 3; // 8 bytes at a time + where >>= 2; // 8 byte aligned data + MDEBUG(4, ": Moving %d 64-bit-words to DRAM 0x%08X\n",size,where); +//TODO: swap manually + if (swap) + DecoderDelByte(card, 0x0C1, 0x08); // byte swapping of 8 byte bursts + else + DecoderSetByte(card, 0x0C1, 0x08); // no byte swapping + + DecoderWriteByte(card, 0x0C9, (u8) ((where >> 16) & 0x00000007L)); + DecoderWriteByte(card, 0x0C8, (u8) ((where >> 8) & 0x000000FFL)); + DecoderWriteByte(card, 0x0C7, (u8) (where & 0x000000FFL)); + i = 0; + for (j = 0; j < size; j++) { + n = EMERGENCYCOUNTER; + do { // wait if FIFO empty + flag = DecoderReadByte(card, 0x0C0); + } while ((flag & 0x01) && n--); + if (n<0) // WARNING nicht if(!n) + return -1; + data[i++] = DecoderReadByte(card, 0x0C2); + data[i++] = DecoderReadByte(card, 0x0C2); + data[i++] = DecoderReadByte(card, 0x0C2); + data[i++] = DecoderReadByte(card, 0x0C2); + data[i++] = DecoderReadByte(card, 0x0C2); + data[i++] = DecoderReadByte(card, 0x0C2); + data[i++] = DecoderReadByte(card, 0x0C2); + data[i++] = DecoderReadByte(card, 0x0C2); + } + n = EMERGENCYCOUNTER; + do { // wait if FIFO empty + flag = DecoderReadByte(card, 0x0C0); + } while ((flag & 0x01) && n--); + if (n<0) + return -1; + for (j = 0; j < rsize; j++) + data[i++] = DecoderReadByte(card, 0x0C2); + flag = DecoderReadByte(card, 0x0C0); + n = EMERGENCYCOUNTER; + do { // wait for FIFO full + flag = DecoderReadByte(card, 0x0C0); + } while (!(flag & 0x02) && n--); + return ((n>=0) ? 0 : -1); +} + + + // where: 21 bit DRAM Word-Address, 4 word aligned + // size: words + // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.) +// returns 0 on success, -1 on collision with DMA transfer +int DRAMReadWord(struct cvdv_cards *card, u32 where, int size, u16 * data, + int swap) +{ + int i, j, rsize, n; + u8 volatile flag; + u8 b; + + rsize = size & 3; // padding words + size >>= 2; // 4 words at a time + where >>= 2; // 8 byte aligned data + MDEBUG(4, ": Reading %d 64-bit-words and %d 16-bit-words from DRAM 0x%08X\n", + size,rsize,where); +//TODO: swap manually + if (swap) + DecoderDelByte(card, 0x0C1, 0x08); // byte swapping of 8 byte bursts + else + DecoderSetByte(card, 0x0C1, 0x08); // no byte swapping + + DecoderWriteByte(card, 0x0C9, (u8) ((where >> 16) & 0x00000007L)); + DecoderWriteByte(card, 0x0C8, (u8) ((where >> 8) & 0x000000FFL)); + DecoderWriteByte(card, 0x0C7, (u8) (where & 0x000000FFL)); + i = 0; + for (j = 0; j < size; j++) { + n = EMERGENCYCOUNTER; + do { // wait if FIFO empty + flag = DecoderReadByte(card, 0x0C0); + } while ((flag & 0x01) && n--); + if (n<0) + return -1; + b = DecoderReadByte(card, 0x0C2); + data[i++] = ((b << 8) | DecoderReadByte(card, 0x0C2)); + b = DecoderReadByte(card, 0x0C2); + data[i++] = ((b << 8) | DecoderReadByte(card, 0x0C2)); + b = DecoderReadByte(card, 0x0C2); + data[i++] = ((b << 8) | DecoderReadByte(card, 0x0C2)); + b = DecoderReadByte(card, 0x0C2); + data[i++] = ((b << 8) | DecoderReadByte(card, 0x0C2)); + } + n = EMERGENCYCOUNTER; + do { // wait if FIFO empty + flag = DecoderReadByte(card, 0x0C0); + } while ((flag & 0x01) && n--); + if (n<0) + return -1; + for (j = 0; j < rsize; j++) { + b = DecoderReadByte(card, 0x0C2); + data[i++] = ((b << 8) | DecoderReadByte(card, 0x0C2)); + } + flag = DecoderReadByte(card, 0x0C0); + n = EMERGENCYCOUNTER; + do { // wait for FIFO full + flag = DecoderReadByte(card, 0x0C0); + } while (!(flag & 0x02) && n--); + return ((n>=0) ? 0 : -1); +} + + // where: 21 bit DRAM Word-Address, 4 word aligned + // size: words + // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.) + // returns -1 on success (equal content), + // word position on error (compare failure), +// -2 on collision with DMA transfer +int DRAMVerifyWord(struct cvdv_cards *card, u32 where, int size, + u16 * data, int swap) +{ + int i, j, rsize, n; + u8 volatile flag, b; + + rsize = size & 3; // padding words + size >>= 2; // 4 words at a time + where >>= 2; // 8 byte aligned data, now 19 bit 64-bit-word-address +//TODO: swap manually + if (swap) + DecoderDelByte(card, 0x0C1, 0x08); // byte swapping of 8 byte bursts + else + DecoderSetByte(card, 0x0C1, 0x08); // no byte swapping + + DecoderWriteByte(card, 0x0C9, (u8) ((where >> 16) & 0x00000007L)); + DecoderWriteByte(card, 0x0C8, (u8) ((where >> 8) & 0x000000FFL)); + DecoderWriteByte(card, 0x0C7, (u8) (where & 0x000000FFL)); + i = 0; + for (j = 0; j < size; j++) { + n = EMERGENCYCOUNTER; + do { // wait if FIFO empty + flag = DecoderReadByte(card, 0x0C0); + } while ((flag & 0x01) && n--); + b = DecoderReadByte(card, 0x0C2); + if (data[i++] != ((b << 8) | DecoderReadByte(card, 0x0C2))) + return i; + b = DecoderReadByte(card, 0x0C2); + if (data[i++] != ((b << 8) | DecoderReadByte(card, 0x0C2))) + return i; + b = DecoderReadByte(card, 0x0C2); + if (data[i++] != ((b << 8) | DecoderReadByte(card, 0x0C2))) + return i; + b = DecoderReadByte(card, 0x0C2); + if (data[i++] != ((b << 8) | DecoderReadByte(card, 0x0C2))) + return i; + } + n = EMERGENCYCOUNTER; + do { // wait if FIFO empty + flag = DecoderReadByte(card, 0x0C0); + } while ((flag & 0x01) && n--); + for (j = 0; j < rsize; j++) { + b = DecoderReadByte(card, 0x0C2); + if (data[i++] != ((b << 8) | DecoderReadByte(card, 0x0C2))) + return i; + } + flag = DecoderReadByte(card, 0x0C0); + n = EMERGENCYCOUNTER; + do { // wait for FIFO full + flag = DecoderReadByte(card, 0x0C0); + } while (!(flag & 0x02) && n--); + return -1; +} + + // WARNING: better not use this one. It can collide with normal DRAM access and other DMA transfers + // If you want to use it, implement card->DMAMoveBusy in all other DMA functions, initialisation, and header file + // source, destination: 21 bit DRAM Word-Address, 4 word aligned + // size: byte (8 byte aligned, hang over bytes will NOT be moved) + // returns 0 on success on success, + // -1 on collision with DMA transfer, +// -2 on interrupt handler not installed +int DRAMMove(struct cvdv_cards *card, u32 source, u32 destination, + int size) +{ + if (!card->IntInstalled) + return -2; + if (card->DMAABusy || card->DMABBusy) + return -1; + + size >>= 3; // 64-bit-words + source >>= 2; // 8 byte aligned data, + destination >>= 2; // now 19 bit 64-bit-word-address + + DecoderDelByte(card, 0x0C1, 0x06); // DMA idle + + DecoderWriteByte(card, 0x0DA, (u8) ((source >> 16) & 0x00000007L)); + DecoderWriteByte(card, 0x0D9, (u8) ((source >> 8) & 0x000000FFL)); + DecoderWriteByte(card, 0x0D8, (u8) (source & 0x000000FFL)); + DecoderWriteByte(card, 0x0D7, + (u8) ((destination >> 16) & 0x00000007L)); + DecoderWriteByte(card, 0x0D6, + (u8) ((destination >> 8) & 0x000000FFL)); + DecoderWriteByte(card, 0x0D5, (u8) (destination & 0x000000FFL)); + + //card->DMAMoveBusy=1; // would have to catch that in all the other DMA routines + DecoderSetByte(card, 0x0C1, 0x06); // DMA block move + + return 0; +} + + // size in words + // align: number of words on wich start of block will be aligned +// return value is 21 bit word address, or 0xFFFFFFFF on error +u32 DRAMAlloc(struct cvdv_cards * card, u32 size, int align) +{ + struct DRAMBlock *ptr, *ptr2; + u32 addr = 0; + u32 alignmask = align - 1; + int valid = 0; + + printk("DRAMAlloc %d bytes (from %d).\n", size, card->DRAMSize); + + if (size == 0) + { + printk("DRAMAlloc - 0 size.\n"); + return BLANK; + } + + if (size & 3) + size = (size & ~3) + 4; // increase size if not 64 bit aligned + + printk("DRAMAlloc %d bytes.\n", size); + if (card->DRAMFirstBlock == NULL) { // virgin territory? + valid = ((addr + size) <= card->DRAMSize); // does it fit at all? + } else { + addr = 0; + valid = ((addr + size) <= card->DRAMSize); // does it fit at all? + for (ptr2 = card->DRAMFirstBlock; + (ptr2 != NULL) && (valid); ptr2 = ptr2->next) { // check against all existing blocks + if ((ptr2->start >= addr) + && (ptr2->start < (addr + size))) + valid = 0; // existing block start inside new block? + else if (((ptr2->start + ptr2->length) > addr) + && ((ptr2->start + ptr2->length) <= + (addr + size))) + valid = 0; // existing block end inside new block? + else if ((ptr2->start < addr) + && ((ptr2->start + ptr2->length) > + (addr + size))) valid = 0; // new block inside existing block? + } + for (ptr = card->DRAMFirstBlock; (ptr != NULL) && (!valid); + ptr = ptr->next) { // check all existing blocks + addr = ptr->start + ptr->length; // assume, after this block is free space + if (addr & alignmask) + addr = (addr & ~alignmask) + align; // round up to alignation border + valid = ((addr + size) <= card->DRAMSize); // does it fit at all? + for (ptr2 = card->DRAMFirstBlock; + (ptr2 != NULL) && (valid); ptr2 = ptr2->next) { // check against all existing blocks + if ((ptr2->start >= addr) + && (ptr2->start < (addr + size))) + valid = 0; // existing block start inside new block? + else + if ( + ((ptr2->start + ptr2->length) > + addr) + && ((ptr2->start + ptr2->length) <= + (addr + size))) + valid = 0; // existing block end inside new block? + else if ((ptr2->start < addr) + && ((ptr2->start + ptr2->length) > + (addr + size))) + valid = 0; // new block inside existing block? + } + } + } + if (valid) { // The new block fits + ptr = (struct DRAMBlock *) kmalloc(sizeof(struct DRAMBlock), GFP_KERNEL); + if (ptr == NULL) { + printk(KERN_INFO LOGNAME ": ERROR: out of kernel memory for block info. Please reboot if possible.\n"); + return BLANK; // out of kernel mem + } + if (card->DRAMFirstBlock == NULL) { + card->DRAMFirstBlock = ptr; + } else { + ptr2 = card->DRAMFirstBlock; + while (ptr2->next != NULL) + ptr2 = ptr2->next; + ptr2->next = ptr; + } + ptr->next = NULL; + ptr->start = addr; + ptr->length = size; + MDEBUG(1,": DRAM Allocate 0x%08X-0x%08X\n", addr, + addr + size - 1); + + printk("DRAMAlloc ok\n"); + return addr; + } + printk(KERN_ERR "DRAMAlloc: No card memory.\n"); + return BLANK; +} + + // addr is the return value of that resp. DRAMAlloc call +// returns 0 on success (always) +int DRAMFree(struct cvdv_cards *card, u32 addr) +{ + struct DRAMBlock *ptr, *ptr2; + ptr2 = NULL; + for (ptr = card->DRAMFirstBlock; ptr != NULL; ptr = ptr->next) { // check all existent blocks + if (addr == ptr->start) { // this is our block to be removed + if (ptr2 == NULL) + card->DRAMFirstBlock = ptr->next; + else + ptr2->next = ptr->next; + kfree(ptr); + MDEBUG(1, ": DRAM Free 0x%08X\n", addr); + } else + ptr2 = ptr; + } + return 0; +} + + // free all blocks +// returns 0 on success (always) +int DRAMRelease(struct cvdv_cards *card) +{ + struct DRAMBlock *ptr, *ptr2; + MDEBUG(1, ": -- DRAMRelease\n"); + for (ptr = card->DRAMFirstBlock; ptr != NULL; ptr = ptr2) { // check all existent blocks + ptr2 = ptr->next; + MDEBUG(4, ": kfree(0x%08X)\n",(int)ptr); + kfree(ptr); + } + card->DRAMFirstBlock = NULL; + return 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/dram.h linux.20pre5-ac2/drivers/media/video/margi/dram.h --- linux.20pre5/drivers/media/video/margi/dram.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/dram.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,99 @@ +/* + dram.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef DRAM_H +#define DRAM_H + + ///////////////////////////////// + // // + // L64021 DRAM Memory Access // + // // +///////////////////////////////// + +#include "cardbase.h" + + // where: 21 bit DRAM Word-Address, 4 word aligned + // size: bytes (8 byte aligned, remainder will be filled with fill value) + // data: fill value +// returns 0 on success, -1 on collision with DMA transfer +int DRAMFillByte(struct cvdv_cards *card, u32 where, int size, u8 data); + + // where: 21 bit DRAM Word-Address, 8 byte aligned + // size: bytes (8 byte aligned, remainder will be filled with garbage) + // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.) +// returns 0 on success, -1 on collision with DMA transfer +int DRAMWriteByte(struct cvdv_cards *card, u32 where, int size, u8 * data, + int swapburst); + + // where: 21 bit DRAM Word-Address, 4 word aligned + // size: words (4 word aligned, remainder will be filled with garbage) + // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.) +// returns 0 on success, -1 on collision with DMA transfer +int DRAMWriteWord(struct cvdv_cards *card, u32 where, int size, u16 * data, + int swap); + + // where: 21 bit DRAM Word-Address, 8 byte aligned + // size: bytes + // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.) +// returns 0 on success, -1 on collision with DMA transfer +int DRAMReadByte(struct cvdv_cards *card, u32 where, int size, u8 * data, + int swap); + + + // where: 21 bit DRAM Word-Address, 4 word aligned + // size: words + // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.) +// returns 0 on success, -1 on collision with DMA transfer +int DRAMReadWord(struct cvdv_cards *card, u32 where, int size, u16 * data, + int swap); + + // where: 21 bit DRAM Word-Address, 4 word aligned + // size: words + // swap: 0=normal mode, 1=write each 8 bytes on reverse order (7,6,5,4,3,2,1,0,15,14,13,etc.) + // returns -1 on success (equal content), + // word position on error (compare failure), +// -2 on collision with DMA transfer +int DRAMVerifyWord(struct cvdv_cards *card, u32 where, int size, + u16 * data, int swap); + + // WARNING: better not use this one. It can collide with normal DRAM access and other DMA transfers + // If you want to use it, implement card->DMAMoveBusy in all other DMA functions, initialisation, and header file + // source, destination: 21 bit DRAM Word-Address, 4 word aligned + // size: byte (8 byte aligned, hang over bytes will NOT be moved) + // returns 0 on success on success, + // -1 on collision with DMA transfer, +// -2 on interrupt handler not installed +int DRAMMove(struct cvdv_cards *card, u32 source, u32 destination, + int size); + + // size in words + // align: number of words on wich start of block will be aligned +// return value is 21 bit word address, or 0xFFFFFFFF on error +u32 DRAMAlloc(struct cvdv_cards *card, u32 size, int align); + + // addr is the return value of that resp. DRAMAlloc call +// returns 0 on success (always) +int DRAMFree(struct cvdv_cards *card, u32 addr); + + // free all blocks +// returns 0 on success (always) +int DRAMRelease(struct cvdv_cards *card); + +#endif /* DRAM_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/dvb_demux.c linux.20pre5-ac2/drivers/media/video/margi/dvb_demux.c --- linux.20pre5/drivers/media/video/margi/dvb_demux.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/dvb_demux.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,1169 @@ +/* + * dvb_demux.c - DVB kernel demux API + * + * Copyright (C) 2000-2001 Ralph Metzler + * & Marcus Metzler + * for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#include +#include +#include +#include + +#include "dvb_demux.h" + +#ifdef MODULE +MODULE_DESCRIPTION(""); +MODULE_AUTHOR("Ralph Metzler, Marcus Metzler"); +#ifdef MODULE_LICENSE +MODULE_LICENSE("GPL"); +#endif +#endif + +#define NOBUFS + +LIST_HEAD(dmx_muxs); + +int dmx_register_demux(dmx_demux_t *demux) +{ + struct list_head *pos, *head=&dmx_muxs; + + if (!(demux->id && demux->vendor && demux->model)) + return -EINVAL; + list_for_each(pos, head) + { + if (!strcmp(DMX_DIR_ENTRY(pos)->id, demux->id)) + return -EEXIST; + } + demux->users=0; + list_add(&(demux->reg_list), head); + MOD_INC_USE_COUNT; + return 0; +} + +int dmx_unregister_demux(dmx_demux_t* demux) +{ + struct list_head *pos, *head=&dmx_muxs; + + list_for_each(pos, head) + { + if (DMX_DIR_ENTRY(pos)==demux) + { + if (demux->users>0) + return -EINVAL; + list_del(pos); + MOD_DEC_USE_COUNT; + return 0; + } + } + return -ENODEV; +} + + +struct list_head *dmx_get_demuxes(void) +{ + if (list_empty(&dmx_muxs)) + return NULL; + + return &dmx_muxs; +} + +/****************************************************************************** + * static inlined helper functions + ******************************************************************************/ + +static inline u16 +section_length(const u8 *buf) +{ + return 3+((buf[1]&0x0f)<<8)+buf[2]; +} + +static inline u16 +ts_pid(const u8 *buf) +{ + return ((buf[1]&0x1f)<<8)+buf[2]; +} + +static inline int +payload(const u8 *tsp) +{ + if (!(tsp[3]&0x10)) // no payload? + return 0; + if (tsp[3]&0x20) { // adaptation field? + if (tsp[4]>183) // corrupted data? + return 0; + else + return 184-1-tsp[4]; + } + return 184; +} + + +static u32 +dvb_crc_table[256] = { + 0x00000000, 0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b, + 0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6, 0x2b4bcb61, + 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd, 0x4c11db70, 0x48d0c6c7, + 0x4593e01e, 0x4152fda9, 0x5f15adac, 0x5bd4b01b, 0x569796c2, 0x52568b75, + 0x6a1936c8, 0x6ed82b7f, 0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, + 0x709f7b7a, 0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039, + 0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58, 0xbaea46ef, + 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033, 0xa4ad16ea, 0xa06c0b5d, + 0xd4326d90, 0xd0f37027, 0xddb056fe, 0xd9714b49, 0xc7361b4c, 0xc3f706fb, + 0xceb42022, 0xca753d95, 0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, + 0xe13ef6f4, 0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0, + 0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5, 0x2ac12072, + 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16, 0x018aeb13, 0x054bf6a4, + 0x0808d07d, 0x0cc9cdca, 0x7897ab07, 0x7c56b6b0, 0x71159069, 0x75d48dde, + 0x6b93dddb, 0x6f52c06c, 0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, + 0x571d7dd1, 0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba, + 0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b, 0xbb60adfc, + 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698, 0x832f1041, 0x87ee0df6, + 0x99a95df3, 0x9d684044, 0x902b669d, 0x94ea7b2a, 0xe0b41de7, 0xe4750050, + 0xe9362689, 0xedf73b3e, 0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, + 0xc6bcf05f, 0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34, + 0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80, 0x644fc637, + 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb, 0x4f040d56, 0x4bc510e1, + 0x46863638, 0x42472b8f, 0x5c007b8a, 0x58c1663d, 0x558240e4, 0x51435d53, + 0x251d3b9e, 0x21dc2629, 0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, + 0x3f9b762c, 0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff, + 0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e, 0xf5ee4bb9, + 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65, 0xeba91bbc, 0xef68060b, + 0xd727bbb6, 0xd3e6a601, 0xdea580d8, 0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, + 0xcda1f604, 0xc960ebb3, 0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, + 0xae3afba2, 0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71, + 0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74, 0x857130c3, + 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640, 0x4e8ee645, 0x4a4ffbf2, + 0x470cdd2b, 0x43cdc09c, 0x7b827d21, 0x7f436096, 0x7200464f, 0x76c15bf8, + 0x68860bfd, 0x6c47164a, 0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, + 0x18197087, 0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec, + 0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d, 0x2056cd3a, + 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce, 0xcc2b1d17, 0xc8ea00a0, + 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb, 0xdbee767c, 0xe3a1cbc1, 0xe760d676, + 0xea23f0af, 0xeee2ed18, 0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, + 0x89b8fd09, 0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662, + 0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf, 0xa2f33668, + 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4}; + +u32 dvb_crc32(u8 *data, int len) +{ + int i; + u32 crc = 0xffffffff; + + for (i=0; i> 24) ^ *data++) & 0xff]; + return crc; +} + +void dvb_set_crc32(u8 *data, int length) +{ + u32 crc; + + crc=dvb_crc32(data,length); + data[length] = (crc>>24)&0xff; + data[length+1] = (crc>>16)&0xff; + data[length+2] = (crc>>8)&0xff; + data[length+3] = (crc)&0xff; +} + + +/****************************************************************************** + * Software filter functions + ******************************************************************************/ + +static inline int +DvbDmxSWFilterPayload(dvb_demux_feed_t *dvbdmxfeed, const u8 *buf) +{ + int p, count; + //int ccok; + //u8 cc; + + if (!(count=payload(buf))) + return -1; + p=188-count; + /* + cc=buf[3]&0x0f; + ccok=((dvbdmxfeed->cc+1)&0x0f)==cc ? 1 : 0; + dvbdmxfeed->cc=cc; + if (!ccok) + printk("missed packet!\n"); + */ + if (buf[1]&0x40) // PUSI ? + dvbdmxfeed->peslen=0xfffa; + dvbdmxfeed->peslen+=count; + + return dvbdmxfeed->cb.ts((u8 *)&buf[p], count, 0, 0, + &dvbdmxfeed->feed.ts, DMX_OK); +} + + +static int +DvbDmxSWFilterSectionFilter(dvb_demux_feed_t *dvbdmxfeed, + dvb_demux_filter_t *dvbdmxfilter) +{ + dmx_section_filter_t *filter=&dvbdmxfilter->filter; +#if 1 + int i; + + for (i=0; ifilter_mask[i]& + (filter->filter_value[i]^dvbdmxfeed->secbuf[i])) + return 0; +#else + u32 res; + u32 *val=(u32 *)(filter->filter_value); + u32 *mask=(u32 *)(filter->filter_mask); + u32 *data=(u32 *)(dvbdmxfeed->secbuf); + + res=mask[0]&(val[0]^data[0]); + if (res) return 0; + + res=mask[1]&(val[1]^data[1]); + if (res) return 0; + + res=mask[2]&(val[2]^data[2]); + if (res) return 0; + + res=mask[3]&(val[3]^data[3]); + if (res) return 0; + + res=*(u16 *)(4+mask) & (*(u16 *)(4+val) ^ *(u16 *)(4+data)); + if (res) return 0; +#endif + + return dvbdmxfeed->cb.sec(dvbdmxfeed->secbuf, dvbdmxfeed->seclen, + 0, 0, filter, DMX_OK); +} + +static inline int +DvbDmxSWFilterSectionFeed(dvb_demux_feed_t *dvbdmxfeed) +{ + u8 *buf=dvbdmxfeed->secbuf; + dvb_demux_filter_t *f; + + if (dvbdmxfeed->secbufp!=dvbdmxfeed->seclen) + return -1; + if (!dvbdmxfeed->feed.sec.is_filtering) + return 0; + if (!(f=dvbdmxfeed->filter)) + return 0; + do + if (DvbDmxSWFilterSectionFilter(dvbdmxfeed, f)<0) + return -1; + while ((f=f->next) && dvbdmxfeed->feed.sec.is_filtering); + + dvbdmxfeed->secbufp=dvbdmxfeed->seclen=0; + memset(buf, 0, DVB_DEMUX_MASK_MAX); + return 0; +} + +static inline int +DvbDmxSWFilterSectionPacket(dvb_demux_feed_t *dvbdmxfeed, const u8 *buf) +{ + int p, count; + int ccok, rest; + u8 cc; + + if (!(count=payload(buf))) + return -1; + p=188-count; + + cc=buf[3]&0x0f; + ccok=((dvbdmxfeed->cc+1)&0x0f)==cc ? 1 : 0; + dvbdmxfeed->cc=cc; + + if (buf[1]&0x40) { // PUSI set + // offset to start of first section is in buf[p] + if (p+buf[p]>187) // trash if it points beyond packet + return -1; + if (buf[p] && ccok) { // rest of previous section? + // did we have enough data in last packet to calc length? + if (dvbdmxfeed->secbufp && dvbdmxfeed->secbufp<3) { + memcpy(dvbdmxfeed->secbuf+dvbdmxfeed->secbufp, + buf+p+1, + 3-dvbdmxfeed->secbufp); + dvbdmxfeed->seclen=section_length(dvbdmxfeed->secbuf); + if (dvbdmxfeed->seclen>4096) + return -1; + } + rest=dvbdmxfeed->seclen-dvbdmxfeed->secbufp; + if (rest==buf[p] && dvbdmxfeed->seclen) { + memcpy(dvbdmxfeed->secbuf+dvbdmxfeed->secbufp, + buf+p+1, buf[p]); + dvbdmxfeed->secbufp+=buf[p]; + DvbDmxSWFilterSectionFeed(dvbdmxfeed); + } + } + p+=buf[p]+1; // skip rest of last section + count=188-p; + while (count>0) { + if ((count>2) && // enough data to determine sec length? + ((dvbdmxfeed->seclen=section_length(buf+p))<=count)) { + if (dvbdmxfeed->seclen>4096) + return -1; + memcpy(dvbdmxfeed->secbuf, buf+p, + dvbdmxfeed->seclen); + dvbdmxfeed->secbufp=dvbdmxfeed->seclen; + p+=dvbdmxfeed->seclen; + count=188-p; + DvbDmxSWFilterSectionFeed(dvbdmxfeed); + + // filling bytes until packet end? + if (count && buf[p]==0xff) + count=0; + } else { // section continues to following TS packet + memcpy(dvbdmxfeed->secbuf, buf+p, count); + dvbdmxfeed->secbufp+=count; + count=0; + } + } + } else { // section continued below + if (!ccok) + return -1; + if (!dvbdmxfeed->secbufp) // any data in last ts packet? + return -1; + // did we have enough data in last packet to calc section length? + if (dvbdmxfeed->secbufp<3) { + memcpy(dvbdmxfeed->secbuf+dvbdmxfeed->secbufp, buf+p, + 3-dvbdmxfeed->secbufp); + dvbdmxfeed->seclen=section_length(dvbdmxfeed->secbuf); + if (dvbdmxfeed->seclen>4096) + return -1; + } + rest=dvbdmxfeed->seclen-dvbdmxfeed->secbufp; + if (rest<0) + return -1; + if (rest<=count) { // section completed in this TS packet + memcpy(dvbdmxfeed->secbuf+dvbdmxfeed->secbufp, buf+p, rest); + dvbdmxfeed->secbufp+=rest; + DvbDmxSWFilterSectionFeed(dvbdmxfeed); + } else { // section continues in following ts block + memcpy(dvbdmxfeed->secbuf+dvbdmxfeed->secbufp, buf+p, count); + dvbdmxfeed->secbufp+=count; + } + + } + return 0; +} + +static inline void +DvbDmxSWFilterPacketType(dvb_demux_feed_t *dvbdmxfeed, const u8 *buf) +{ + switch(dvbdmxfeed->type) { + case DMX_TYPE_TS: + if (!dvbdmxfeed->feed.ts.is_filtering) + break; + if (dvbdmxfeed->ts_type & TS_PACKET) { + if (dvbdmxfeed->ts_type & TS_PAYLOAD_ONLY) + DvbDmxSWFilterPayload(dvbdmxfeed, buf); + else + dvbdmxfeed->cb.ts((u8 *)buf, 188, 0, 0, + &dvbdmxfeed->feed.ts, DMX_OK); + } + if (dvbdmxfeed->ts_type & TS_DECODER) + if (dvbdmxfeed->demux->write_to_decoder) + dvbdmxfeed->demux-> + write_to_decoder(dvbdmxfeed, (u8 *)buf, 188); + break; + + case DMX_TYPE_SEC: + if (!dvbdmxfeed->feed.sec.is_filtering) + break; + if (DvbDmxSWFilterSectionPacket(dvbdmxfeed, buf)<0) + dvbdmxfeed->seclen=dvbdmxfeed->secbufp=0; + break; + + default: + break; + } +} + +void inline +DvbDmxSWFilterPacket(dvb_demux_t *dvbdmx, const u8 *buf) +{ + dvb_demux_feed_t *dvbdmxfeed; + + if (!(dvbdmxfeed=dvbdmx->pid2feed[ts_pid(buf)])) + return; + DvbDmxSWFilterPacketType(dvbdmxfeed, buf); +} + +void +DvbDmxSWFilterPackets(dvb_demux_t *dvbdmx, const u8 *buf, int count) +{ + dvb_demux_feed_t *dvbdmxfeed; + + if ((dvbdmxfeed=dvbdmx->pid2feed[0x2000])) + dvbdmxfeed->cb.ts((u8 *)buf, count*188, 0, 0, + &dvbdmxfeed->feed.ts, DMX_OK); + while (count) { + DvbDmxSWFilterPacket(dvbdmx, buf); + count--; + buf+=188; + } +} + +static inline void +DvbDmxSWFilter(dvb_demux_t *dvbdmx, const u8 *buf, size_t count) +{ + int p=0,i, j; + + if ((i=dvbdmx->tsbufp)) { + if (count<(j=188-i)) { + memcpy(&dvbdmx->tsbuf[i], buf, count); + dvbdmx->tsbufp+=count; + return; + } + memcpy(&dvbdmx->tsbuf[i], buf, j); + DvbDmxSWFilterPacket(dvbdmx, dvbdmx->tsbuf); + dvbdmx->tsbufp=0; + p+=j; + } + + while (p=188) { + DvbDmxSWFilterPacket(dvbdmx, buf+p); + p+=188; + } else { + i=count-p; + memcpy(dvbdmx->tsbuf, buf+p, i); + dvbdmx->tsbufp=i; + return; + } + } else + p++; + } +} + + +/****************************************************************************** + ****************************************************************************** + * DVB DEMUX API LEVEL FUNCTIONS + ****************************************************************************** + ******************************************************************************/ + +static dvb_demux_filter_t * +DvbDmxFilterAlloc(dvb_demux_t *dvbdmx) +{ + int i; + + for (i=0; ifilternum; i++) + if (dvbdmx->filter[i].state==DMX_STATE_FREE) + break; + if (i==dvbdmx->filternum) + return 0; + dvbdmx->filter[i].state=DMX_STATE_ALLOCATED; + return &dvbdmx->filter[i]; +} + +static dvb_demux_feed_t * +DvbDmxFeedAlloc(dvb_demux_t *dvbdmx) +{ + int i; + + for (i=0; ifeednum; i++) + if (dvbdmx->feed[i].state==DMX_STATE_FREE) + break; + if (i==dvbdmx->feednum) + return 0; + dvbdmx->feed[i].state=DMX_STATE_ALLOCATED; + return &dvbdmx->feed[i]; +} + + +/****************************************************************************** + * dmx_ts_feed API calls + ******************************************************************************/ + +static int +dmx_ts_feed_set_type(dmx_ts_feed_t *feed, int type, dmx_ts_pes_t pes_type) +{ + dvb_demux_feed_t *dvbdmxfeed=(dvb_demux_feed_t *) feed; + dvb_demux_t *dvbdmx=dvbdmxfeed->demux; + + down(&dvbdmx->mutex); + dvbdmxfeed->ts_type=type; + dvbdmxfeed->pes_type=pes_type; + + if (dvbdmxfeed->ts_type & TS_DECODER) { + if (pes_type >= DMX_TS_PES_OTHER) { + up(&dvbdmx->mutex); + return -EINVAL; + } + if (dvbdmx->pesfilter[pes_type] && + (dvbdmx->pesfilter[pes_type]!=dvbdmxfeed)) { + up(&dvbdmx->mutex); + return -EINVAL; + } + dvbdmx->pesfilter[pes_type]=dvbdmxfeed; + dvbdmx->pids[pes_type]=dvbdmxfeed->pid; + } + up(&dvbdmx->mutex); + return 0; +} + +static int +dmx_pid_set(u16 pid, dvb_demux_feed_t *dvbdmxfeed) +{ + dvb_demux_t *dvbdmx=dvbdmxfeed->demux; + dvb_demux_feed_t **pid2feed=dvbdmx->pid2feed; + + if (pid>DMX_MAX_PID) + return -EINVAL; + if (dvbdmxfeed->pid!=0xffff) { + if (dvbdmxfeed->pid<=DMX_MAX_PID) + pid2feed[dvbdmxfeed->pid]=0; + dvbdmxfeed->pid=0xffff; + } + if (pid2feed[pid]) { + return -EBUSY; + } + pid2feed[pid]=dvbdmxfeed; + dvbdmxfeed->pid=pid; + return 0; +} + + +static int +dmx_ts_feed_set(struct dmx_ts_feed_s* feed, + u16 pid, + size_t callback_length, + size_t circular_buffer_size, + int descramble, + struct timespec timeout + ) +{ + dvb_demux_feed_t *dvbdmxfeed=(dvb_demux_feed_t *) feed; + dvb_demux_t *dvbdmx=dvbdmxfeed->demux; + int ret; + + down(&dvbdmx->mutex); + ret=dmx_pid_set(pid, dvbdmxfeed); + if (ret<0) { + up(&dvbdmx->mutex); + return ret; + } + dvbdmxfeed->buffer_size=circular_buffer_size; + dvbdmxfeed->descramble=descramble; + dvbdmxfeed->timeout=timeout; + dvbdmxfeed->cb_length=callback_length; + dvbdmxfeed->ts_type=TS_PACKET; + + if (dvbdmxfeed->descramble) { + up(&dvbdmx->mutex); + return -ENOSYS; + } + + if (dvbdmxfeed->buffer_size) { +#ifdef NOBUFS + dvbdmxfeed->buffer=0; +#else + dvbdmxfeed->buffer=vmalloc(dvbdmxfeed->buffer_size); + if (!dvbdmxfeed->buffer) { + up(&dvbdmx->mutex); + return -ENOMEM; + } +#endif + } + dvbdmxfeed->state=DMX_STATE_READY; + up(&dvbdmx->mutex); + return 0; +} + +static int +dmx_ts_feed_start_filtering(struct dmx_ts_feed_s* feed) +{ + dvb_demux_feed_t *dvbdmxfeed=(dvb_demux_feed_t *) feed; + dvb_demux_t *dvbdmx=dvbdmxfeed->demux; + int ret; + + down(&dvbdmx->mutex); + if (dvbdmxfeed->state!=DMX_STATE_READY || + dvbdmxfeed->type!=DMX_TYPE_TS) { + up(&dvbdmx->mutex); + return -EINVAL; + } + if (!dvbdmx->start_feed) { + up(&dvbdmx->mutex); + return -1; + } + ret=dvbdmx->start_feed(dvbdmxfeed); + if (ret<0) { + up(&dvbdmx->mutex); + return ret; + } + feed->is_filtering=1; + dvbdmxfeed->state=DMX_STATE_GO; + up(&dvbdmx->mutex); + return 0; +} + +static int +dmx_ts_feed_stop_filtering(struct dmx_ts_feed_s* feed) +{ + dvb_demux_feed_t *dvbdmxfeed=(dvb_demux_feed_t *) feed; + dvb_demux_t *dvbdmx=dvbdmxfeed->demux; + int ret; + + down(&dvbdmx->mutex); + if (dvbdmxfeed->statemutex); + return -EINVAL; + } + if (!dvbdmx->stop_feed) { + up(&dvbdmx->mutex); + return -1; + } + ret=dvbdmx->stop_feed(dvbdmxfeed); + feed->is_filtering=0; + dvbdmxfeed->state=DMX_STATE_ALLOCATED; + + up(&dvbdmx->mutex); + return ret; +} + +static int dvbdmx_allocate_ts_feed(dmx_demux_t *demux, + dmx_ts_feed_t **feed, + dmx_ts_cb callback) +{ + dvb_demux_t *dvbdmx=(dvb_demux_t *) demux; + dvb_demux_feed_t *dvbdmxfeed; + + down(&dvbdmx->mutex); + if (!(dvbdmxfeed=DvbDmxFeedAlloc(dvbdmx))) { + up(&dvbdmx->mutex); + return -EBUSY; + } + dvbdmxfeed->type=DMX_TYPE_TS; + dvbdmxfeed->cb.ts=callback; + dvbdmxfeed->demux=dvbdmx; + dvbdmxfeed->pid=0xffff; + dvbdmxfeed->peslen=0xfffa; + dvbdmxfeed->buffer=0; + + (*feed)=&dvbdmxfeed->feed.ts; + (*feed)->is_filtering=0; + (*feed)->parent=demux; + (*feed)->priv=0; + (*feed)->set=dmx_ts_feed_set; + (*feed)->set_type=dmx_ts_feed_set_type; + (*feed)->start_filtering=dmx_ts_feed_start_filtering; + (*feed)->stop_filtering=dmx_ts_feed_stop_filtering; + + + if (!(dvbdmxfeed->filter=DvbDmxFilterAlloc(dvbdmx))) { + dvbdmxfeed->state=DMX_STATE_FREE; + up(&dvbdmx->mutex); + return -EBUSY; + } + + dvbdmxfeed->filter->type=DMX_TYPE_TS; + dvbdmxfeed->filter->feed=dvbdmxfeed; + dvbdmxfeed->filter->state=DMX_STATE_READY; + + up(&dvbdmx->mutex); + return 0; +} + +static int dvbdmx_release_ts_feed(dmx_demux_t *demux, dmx_ts_feed_t *feed) +{ + dvb_demux_t *dvbdmx=(dvb_demux_t *) demux; + dvb_demux_feed_t *dvbdmxfeed=(dvb_demux_feed_t *) feed; + + down(&dvbdmx->mutex); + if (dvbdmxfeed->state==DMX_STATE_FREE) { + up(&dvbdmx->mutex); + return -EINVAL; + } +#ifndef NOBUFS + if (dvbdmxfeed->buffer) { + vfree(dvbdmxfeed->buffer); + dvbdmxfeed->buffer=0; + } +#endif + dvbdmxfeed->state=DMX_STATE_FREE; + dvbdmxfeed->filter->state=DMX_STATE_FREE; + if (dvbdmxfeed->pid!=0xffff) { + if (dvbdmxfeed->pid<=DMX_MAX_PID) + dvbdmxfeed->demux->pid2feed[dvbdmxfeed->pid]=0; + dvbdmxfeed->pid=0xffff; + } + + up(&dvbdmx->mutex); + return 0; +} + + +/****************************************************************************** + * dmx_pes_feed API calls + ******************************************************************************/ +/* +static int +dmx_pes_feed_set(struct dmx_pes_feed_s* feed, + u16 pid, + size_t circular_buffer_size, + int descramble, + struct timespec timeout) +{ + return 0; +} + +static int +dmx_pes_feed_start_filtering(struct dmx_pes_feed_s* feed) +{ + return 0; +} + +static int +dmx_pes_feed_stop_filtering(struct dmx_pes_feed_s* feed) +{ + return 0; +} +*/ + +static int dvbdmx_allocate_pes_feed(dmx_demux_t *demux, + dmx_pes_feed_t **feed, + dmx_pes_cb callback) +{ + return 0; +} + +static int dvbdmx_release_pes_feed(dmx_demux_t *demux, + dmx_pes_feed_t *feed) +{ + return 0; +} + + +/****************************************************************************** + * dmx_section_feed API calls + ******************************************************************************/ + +static int +dmx_section_feed_allocate_filter(struct dmx_section_feed_s* feed, + dmx_section_filter_t** filter) +{ + dvb_demux_feed_t *dvbdmxfeed=(dvb_demux_feed_t *) feed; + dvb_demux_t *dvbdemux=dvbdmxfeed->demux; + dvb_demux_filter_t *dvbdmxfilter; + + down(&dvbdemux->mutex); + dvbdmxfilter=DvbDmxFilterAlloc(dvbdemux); + if (!dvbdmxfilter) { + up(&dvbdemux->mutex); + return -ENOSPC; + } + *filter=&dvbdmxfilter->filter; + (*filter)->parent=feed; + (*filter)->priv=0; + dvbdmxfilter->feed=dvbdmxfeed; + dvbdmxfilter->pid=dvbdmxfeed->pid; + dvbdmxfilter->type=DMX_TYPE_SEC; + dvbdmxfilter->state=DMX_STATE_READY; + + dvbdmxfilter->next=dvbdmxfeed->filter; + dvbdmxfeed->filter=dvbdmxfilter; + up(&dvbdemux->mutex); + return 0; +} + +static int +dmx_section_feed_set(struct dmx_section_feed_s* feed, + u16 pid, size_t circular_buffer_size, + int descramble, int check_crc) +{ + dvb_demux_feed_t *dvbdmxfeed=(dvb_demux_feed_t *) feed; + dvb_demux_t *dvbdmx=dvbdmxfeed->demux; + + if (pid>0x1fff) + return -EINVAL; + down(&dvbdmx->mutex); + if (dvbdmxfeed->pid!=0xffff) { + dvbdmx->pid2feed[dvbdmxfeed->pid]=0; + dvbdmxfeed->pid=0xffff; + } + if (dvbdmx->pid2feed[pid]) { + up(&dvbdmx->mutex); + return -EBUSY; + } + dvbdmx->pid2feed[pid]=dvbdmxfeed; + dvbdmxfeed->pid=pid; + + dvbdmxfeed->buffer_size=circular_buffer_size; + dvbdmxfeed->descramble=descramble; + if (dvbdmxfeed->descramble) { + up(&dvbdmx->mutex); + return -ENOSYS; + } + + dvbdmxfeed->check_crc=check_crc; +#ifdef NOBUFS + dvbdmxfeed->buffer=0; +#else + dvbdmxfeed->buffer=vmalloc(dvbdmxfeed->buffer_size); + if (!dvbdmxfeed->buffer) { + up(&dvbdmx->mutex); + return -ENOMEM; + } +#endif + dvbdmxfeed->state=DMX_STATE_READY; + up(&dvbdmx->mutex); + return 0; +} + +static int +dmx_section_feed_start_filtering(dmx_section_feed_t *feed) +{ + dvb_demux_feed_t *dvbdmxfeed=(dvb_demux_feed_t *) feed; + dvb_demux_t *dvbdmx=dvbdmxfeed->demux; + int ret; + + down(&dvbdmx->mutex); + if (feed->is_filtering) { + up(&dvbdmx->mutex); + return -EBUSY; + } + if (!dvbdmxfeed->filter) { + up(&dvbdmx->mutex); + return -EINVAL; + } + dvbdmxfeed->secbufp=0; + dvbdmxfeed->seclen=0; + + if (!dvbdmx->start_feed) { + up(&dvbdmx->mutex); + return -1; + } + ret=dvbdmx->start_feed(dvbdmxfeed); + if (ret<0) { + up(&dvbdmx->mutex); + return ret; + } + feed->is_filtering=1; + dvbdmxfeed->state=DMX_STATE_GO; + up(&dvbdmx->mutex); + return 0; +} + +static int +dmx_section_feed_stop_filtering(struct dmx_section_feed_s* feed) +{ + dvb_demux_feed_t *dvbdmxfeed=(dvb_demux_feed_t *) feed; + dvb_demux_t *dvbdmx=dvbdmxfeed->demux; + int ret; + + down(&dvbdmx->mutex); + if (!dvbdmx->stop_feed) { + up(&dvbdmx->mutex); + return -1; + } + ret=dvbdmx->stop_feed(dvbdmxfeed); + + dvbdmxfeed->state=DMX_STATE_READY; + feed->is_filtering=0; + up(&dvbdmx->mutex); + return ret; +} + +static int +dmx_section_feed_release_filter(dmx_section_feed_t *feed, + dmx_section_filter_t* filter) +{ + dvb_demux_filter_t *dvbdmxfilter=(dvb_demux_filter_t *) filter, *f; + dvb_demux_feed_t *dvbdmxfeed=(dvb_demux_feed_t *) feed; + dvb_demux_t *dvbdmx=dvbdmxfeed->demux; + + down(&dvbdmx->mutex); + if (dvbdmxfilter->feed!=dvbdmxfeed) { + up(&dvbdmx->mutex); + return -EINVAL; + } + if (feed->is_filtering) + feed->stop_filtering(feed); + + f=dvbdmxfeed->filter; + if (f==dvbdmxfilter) + dvbdmxfeed->filter=dvbdmxfilter->next; + else { + while(f->next!=dvbdmxfilter) + f=f->next; + f->next=f->next->next; + } + dvbdmxfilter->state=DMX_STATE_FREE; + up(&dvbdmx->mutex); + return 0; +} + +static int dvbdmx_allocate_section_feed(dmx_demux_t *demux, + dmx_section_feed_t **feed, + dmx_section_cb callback) +{ + dvb_demux_t *dvbdmx=(dvb_demux_t *) demux; + dvb_demux_feed_t *dvbdmxfeed; + + down(&dvbdmx->mutex); + if (!(dvbdmxfeed=DvbDmxFeedAlloc(dvbdmx))) { + up(&dvbdmx->mutex); + return -EBUSY; + } + dvbdmxfeed->type=DMX_TYPE_SEC; + dvbdmxfeed->cb.sec=callback; + dvbdmxfeed->demux=dvbdmx; + dvbdmxfeed->pid=0xffff; + dvbdmxfeed->secbufp=0; + dvbdmxfeed->filter=0; + dvbdmxfeed->buffer=0; + + (*feed)=&dvbdmxfeed->feed.sec; + (*feed)->is_filtering=0; + (*feed)->parent=demux; + (*feed)->priv=0; + (*feed)->set=dmx_section_feed_set; + (*feed)->allocate_filter=dmx_section_feed_allocate_filter; + (*feed)->release_filter=dmx_section_feed_release_filter; + (*feed)->start_filtering=dmx_section_feed_start_filtering; + (*feed)->stop_filtering=dmx_section_feed_stop_filtering; + + up(&dvbdmx->mutex); + return 0; +} + +static int dvbdmx_release_section_feed(dmx_demux_t *demux, + dmx_section_feed_t *feed) +{ + dvb_demux_feed_t *dvbdmxfeed=(dvb_demux_feed_t *) feed; + dvb_demux_t *dvbdmx=(dvb_demux_t *) demux; + + down(&dvbdmx->mutex); + if (dvbdmxfeed->state==DMX_STATE_FREE) { + up(&dvbdmx->mutex); + return -EINVAL; + } +#ifndef NOBUFS + if (dvbdmxfeed->buffer) { + vfree(dvbdmxfeed->buffer); + dvbdmxfeed->buffer=0; + } +#endif + dvbdmxfeed->state=DMX_STATE_FREE; + dvbdmxfeed->demux->pid2feed[dvbdmxfeed->pid]=0; + if (dvbdmxfeed->pid!=0xffff) + dvbdmxfeed->demux->pid2feed[dvbdmxfeed->pid]=0; + up(&dvbdmx->mutex); + return 0; +} + + +/****************************************************************************** + * dvb_demux kernel data API calls + ******************************************************************************/ + +static int dvbdmx_open(dmx_demux_t *demux) +{ + dvb_demux_t *dvbdemux=(dvb_demux_t *) demux; + + if (dvbdemux->users>=MAX_DVB_DEMUX_USERS) + return -EUSERS; + dvbdemux->users++; + return 0; +} + +static int dvbdmx_close(struct dmx_demux_s *demux) +{ + dvb_demux_t *dvbdemux=(dvb_demux_t *) demux; + + if (dvbdemux->users==0) + return -ENODEV; + dvbdemux->users--; + //FIXME: release any unneeded resources if users==0 + return 0; +} + +static int dvbdmx_write(dmx_demux_t *demux, const char *buf, size_t count) +{ + dvb_demux_t *dvbdemux=(dvb_demux_t *) demux; + + if ((!demux->frontend) || + (demux->frontend->source!=DMX_MEMORY_FE)) + return -EINVAL; + + down(&dvbdemux->mutex); + DvbDmxSWFilter(dvbdemux, buf, count); + up(&dvbdemux->mutex); + return count; +} + + +static int dvbdmx_add_frontend(dmx_demux_t *demux, + dmx_frontend_t *frontend) +{ + dvb_demux_t *dvbdemux=(dvb_demux_t *) demux; + struct list_head *pos, *head=&dvbdemux->frontend_list; + + //printk ("function : %s\n", __FUNCTION__); + + if (!(frontend->id && frontend->vendor && frontend->model)) + return -EINVAL; + list_for_each(pos, head) + { + if (!strcmp(DMX_FE_ENTRY(pos)->id, frontend->id)) + return -EEXIST; + } + + list_add(&(frontend->connectivity_list), head); + return 0; +} + +static int +dvbdmx_remove_frontend(dmx_demux_t *demux, + dmx_frontend_t *frontend) +{ + dvb_demux_t *dvbdemux=(dvb_demux_t *) demux; + struct list_head *pos, *head=&dvbdemux->frontend_list; + + list_for_each(pos, head) + { + if (DMX_FE_ENTRY(pos)==frontend) + { + list_del(pos); + return 0; + } + } + return -ENODEV; +} + +static struct list_head * +dvbdmx_get_frontends(dmx_demux_t *demux) +{ + dvb_demux_t *dvbdemux=(dvb_demux_t *) demux; + + if (list_empty(&dvbdemux->frontend_list)) + return NULL; + return &dvbdemux->frontend_list; +} + +static int dvbdmx_connect_frontend(dmx_demux_t *demux, + dmx_frontend_t *frontend) +{ + dvb_demux_t *dvbdemux=(dvb_demux_t *) demux; + + if (demux->frontend) + return -EINVAL; + + down(&dvbdemux->mutex); + demux->frontend=frontend; + up(&dvbdemux->mutex); + return 0; +} + +static int dvbdmx_disconnect_frontend(dmx_demux_t *demux) +{ + dvb_demux_t *dvbdemux=(dvb_demux_t *) demux; + + down(&dvbdemux->mutex); + demux->frontend=NULL; + up(&dvbdemux->mutex); + return 0; +} + +static int dvbdmx_get_pes_pids(dmx_demux_t *demux, u16 *pids) +{ + dvb_demux_t *dvbdemux=(dvb_demux_t *) demux; + + memcpy(pids, dvbdemux->pids, 5*sizeof(u16)); + return 0; +} + +int +DvbDmxInit(dvb_demux_t *dvbdemux) +{ + int i; + dmx_demux_t *dmx=&dvbdemux->dmx; + + dvbdemux->users=0; + dvbdemux->filter=vmalloc(dvbdemux->filternum*sizeof(dvb_demux_filter_t)); + if (!dvbdemux->filter) + return -ENOMEM; + + dvbdemux->feed=vmalloc(dvbdemux->feednum*sizeof(dvb_demux_feed_t)); + if (!dvbdemux->feed) { + vfree(dvbdemux->filter); + return -ENOMEM; + } + for (i=0; ifilternum; i++) { + dvbdemux->filter[i].state=DMX_STATE_FREE; + dvbdemux->filter[i].index=i; + } + for (i=0; ifeednum; i++) + dvbdemux->feed[i].state=DMX_STATE_FREE; + dvbdemux->frontend_list.next= + dvbdemux->frontend_list.prev= + &dvbdemux->frontend_list; + for (i=0; ipesfilter[i]=NULL; + dvbdemux->pids[i]=0xffff; + } + dvbdemux->playing=dvbdemux->recording=0; + memset(dvbdemux->pid2feed, 0, (DMX_MAX_PID+1)*sizeof(dvb_demux_feed_t *)); + dvbdemux->tsbufp=0; + + dmx->frontend=0; + dmx->reg_list.next=dmx->reg_list.prev=&dmx->reg_list; + dmx->priv=(void *) dvbdemux; + //dmx->users=0; // reset in dmx_register_demux() + dmx->open=dvbdmx_open; + dmx->close=dvbdmx_close; + dmx->write=dvbdmx_write; + dmx->allocate_ts_feed=dvbdmx_allocate_ts_feed; + dmx->release_ts_feed=dvbdmx_release_ts_feed; + dmx->allocate_pes_feed=dvbdmx_allocate_pes_feed; + dmx->release_pes_feed=dvbdmx_release_pes_feed; + dmx->allocate_section_feed=dvbdmx_allocate_section_feed; + dmx->release_section_feed=dvbdmx_release_section_feed; + + dmx->descramble_mac_address=NULL; + dmx->descramble_section_payload=NULL; + + dmx->add_frontend=dvbdmx_add_frontend; + dmx->remove_frontend=dvbdmx_remove_frontend; + dmx->get_frontends=dvbdmx_get_frontends; + dmx->connect_frontend=dvbdmx_connect_frontend; + dmx->disconnect_frontend=dvbdmx_disconnect_frontend; + dmx->get_pes_pids=dvbdmx_get_pes_pids; + sema_init(&dvbdemux->mutex, 1); + + if (dmx_register_demux(dmx)<0) + return -1; + + return 0; +} + +int +DvbDmxRelease(dvb_demux_t *dvbdemux) +{ + dmx_demux_t *dmx=&dvbdemux->dmx; + + dmx_unregister_demux(dmx); + if (dvbdemux->filter) + vfree(dvbdemux->filter); + if (dvbdemux->feed) + vfree(dvbdemux->feed); + return 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/dvb_demux.h linux.20pre5-ac2/drivers/media/video/margi/dvb_demux.h --- linux.20pre5/drivers/media/video/margi/dvb_demux.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/dvb_demux.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,141 @@ +/* + * dvb_demux.h - DVB kernel demux API + * + * Copyright (C) 2000-2001 Marcus Metzler + * & Ralph Metzler + * for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _DVB_DEMUX_H_ +#define _DVB_DEMUX_H_ + +#if LINUX_VERSION_CODE < 0x020300 +#define WAIT_QUEUE struct wait_queue* +#define init_waitqueue_head(wq) *(wq) = NULL; +#define DECLARE_WAITQUEUE(wait, current) struct wait_queue wait = { current, NULL } +#define list_for_each(pos, head) \ + for (pos = (head)->next; pos != (head); pos = pos->next) +#else +#define WAIT_QUEUE wait_queue_head_t +#endif + +#include "ost/demux.h" + +#define DMX_TYPE_TS 0 +#define DMX_TYPE_SEC 1 +#define DMX_TYPE_PES 2 + +#define DMX_STATE_FREE 0 +#define DMX_STATE_ALLOCATED 1 +#define DMX_STATE_SET 2 +#define DMX_STATE_READY 3 +#define DMX_STATE_GO 4 + +#define DVB_DEMUX_MASK_MAX 18 + +typedef struct dvb_demux_filter_s { + dmx_section_filter_t filter; + struct dvb_demux_filter_s *next; + struct dvb_demux_feed_s *feed; + int index; + int state; + int type; + int pesto; + + u32 flags; + u16 handle; + u16 hw_handle; + struct timer_list timer; + int ts_state; + + u16 pid; //to be removed +} dvb_demux_filter_t; + +typedef struct dvb_demux_feed_s { + union { + dmx_ts_feed_t ts; + dmx_section_feed_t sec; + dmx_pes_feed_t pes; + } feed; + + union { + dmx_ts_cb ts; + dmx_section_cb sec; + dmx_pes_cb pes; + } cb; + + struct dvb_demux_s *demux; + int type; + int state; + u16 pid; + u8 *buffer; + int buffer_size; + int descramble; + int check_crc; + + struct timespec timeout; + dvb_demux_filter_t *filter; + int cb_length; + + int ts_type; + dmx_ts_pes_t pes_type; + + u8 secbuf[4096]; + int secbufp; + int seclen; + int cc; + + u16 peslen; +} dvb_demux_feed_t; + +typedef struct dvb_demux_s { + dmx_demux_t dmx; + void *priv; + int filternum; + int feednum; + int (*start_feed)(dvb_demux_feed_t *); + int (*stop_feed)(dvb_demux_feed_t *); + int (*write_to_decoder)(dvb_demux_feed_t *, u8 *, size_t); + + + int users; +#define MAX_DVB_DEMUX_USERS 10 + dvb_demux_filter_t *filter; + dvb_demux_feed_t *feed; + + struct list_head frontend_list; + + dvb_demux_feed_t *pesfilter[DMX_TS_PES_OTHER]; + u16 pids[DMX_TS_PES_OTHER]; + int playing; + int recording; + +#define DMX_MAX_PID 0x2000 + dvb_demux_feed_t *pid2feed[DMX_MAX_PID+1]; + u8 tsbuf[188]; + int tsbufp; + + struct semaphore mutex; +} dvb_demux_t; + + +int DvbDmxInit(dvb_demux_t *dvbdemux); +int DvbDmxRelease(dvb_demux_t *dvbdemux); +void DvbDmxSWFilterPackets(dvb_demux_t *dvbdmx, const u8 *buf, int count); + +#endif /* _DVB_DEMUX_H_ */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/dvbdev.c linux.20pre5-ac2/drivers/media/video/margi/dvbdev.c --- linux.20pre5/drivers/media/video/margi/dvbdev.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/dvbdev.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,233 @@ +/* + * dvbdev.c + * + * Copyright (C) 2000 Ralph Metzler + * & Marcus Metzler + for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "dvbdev.h" + +#ifdef MODULE +MODULE_DESCRIPTION("Device registrar for DVB drivers"); +MODULE_AUTHOR("Marcus Metzler, Ralph Metzler"); +#ifdef MODULE_LICENSE +MODULE_LICENSE("LGPL"); +#endif +#endif + +#define DVB_MAJOR 250 + +static struct dvb_device *dvb_device[DVB_NUM_DEVICES]; +static devfs_handle_t dvb_devfs_handle; + +static inline struct dvb_device * +inode2dev (struct inode *inode) +{ + int minor=(MINOR(inode->i_rdev)>>6); + + return dvb_device[minor]; +} + +static inline int +inode2num(struct inode *inode) +{ + return (0x3f&MINOR(inode->i_rdev)); +} + +static ssize_t +dvb_device_read(struct file *file, char *buf, size_t count, loff_t *ppos) +{ + struct inode *inode=file->f_dentry->d_inode; + struct dvb_device *dvbdev=inode2dev(inode); + + if (!dvbdev) + return -ENODEV; + return dvbdev->read(dvbdev, inode2num(inode), file, buf, count, ppos); +} + +static ssize_t +dvb_device_write(struct file *file, const char *buf, + size_t count, loff_t *ppos) +{ + struct inode *inode=file->f_dentry->d_inode; + struct dvb_device *dvbdev=inode2dev(inode); + + if (!dvbdev) + return -ENODEV; + return dvbdev->write(dvbdev, inode2num(inode), file, buf, count, ppos); +} + +static int +dvb_device_open(struct inode *inode, struct file *file) +{ + struct dvb_device *dvbdev=inode2dev(inode); + + if (!dvbdev) + return -ENODEV; + return dvbdev->open(dvbdev, inode2num(inode), inode, file); +} + +static int +dvb_device_release(struct inode *inode, struct file *file) +{ + struct dvb_device *dvbdev=inode2dev(inode); + + if (!dvbdev) + return -ENODEV; + return dvbdev->close(dvbdev, inode2num(inode), inode, file); +} + +static int +dvb_device_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + struct dvb_device *dvbdev=inode2dev(inode); + + if (!dvbdev) + return -ENODEV; + return dvbdev->ioctl(dvbdev, inode2num(inode), file, cmd, arg); +} + +static unsigned int +dvb_device_poll(struct file *file, poll_table *wait) +{ + struct inode *inode=file->f_dentry->d_inode; + struct dvb_device *dvbdev=inode2dev(inode); + + if (!dvbdev) + return -ENODEV; + return dvbdev->poll(dvbdev, inode2num(inode), file, wait); +} + + +static struct file_operations dvb_device_fops = +{ + owner: THIS_MODULE, + read: dvb_device_read, + write: dvb_device_write, + ioctl: dvb_device_ioctl, + open: dvb_device_open, + release: dvb_device_release, + poll: dvb_device_poll, +}; + + +static char *dnames[] = { + "video", "audio", "sec", "frontend", "demux", "dvr", "ca", + "net", "osd" +}; + + +static void dvb_init_device(dvb_device_t *dev) +{ + int i, type; + char name[64]; + + sprintf(name, "card%d", dev->minor); + dev->devfsh = devfs_mk_dir (dvb_devfs_handle, name, NULL); + + for (i=0; (type=dev->device_type(dev,i))>-2; i++) { + if (type==-1) + continue; + + sprintf(name, "%s%d", dnames[type>>2], type&3); + devfs_register(dev->devfsh, name, DEVFS_FL_DEFAULT, + DVB_MAJOR, (dev->minor<<6)+i, + S_IFCHR | S_IRUSR | S_IWUSR, + &dvb_device_fops, NULL); + } + +} + +int dvb_register_device(dvb_device_t *dev) +{ + int i=0; + + for (i=0; iminor=i; + dvb_init_device(dev); + MOD_INC_USE_COUNT; + return 0; + } + } + return -ENFILE; +} + +void dvb_unregister_device(dvb_device_t *dev) +{ + if (dvb_device[dev->minor]!=dev) { + printk("dvbdev: bad unregister\n"); + return; + } + devfs_unregister(dev->devfsh); + dvb_device[dev->minor]=NULL; + MOD_DEC_USE_COUNT; +} + +int __init dvbdev_init(void) +{ + int i=0; + + for(i=0; i + * & Marcus Metzler + for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Lesser Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _DVBDEV_H_ +#define _DVBDEV_H_ + +#include +#include +#include +#include + +#define DVB_NUM_DEVICES 16 + +struct dvb_device +{ + char name[32]; + int type; + int hardware; + + void *priv; + int minor; + devfs_handle_t devfs_handle; + + int (*open)(struct dvb_device *, int, struct inode *, struct file *); + int (*close)(struct dvb_device *, int, struct inode *, struct file *); + ssize_t (*read)(struct dvb_device *, int, struct file *, char *, + size_t, loff_t *); + ssize_t (*write)(struct dvb_device *, int, struct file *, const char *, + size_t, loff_t *); + int (*ioctl)(struct dvb_device *, int, struct file *, + unsigned int , unsigned long); + unsigned int (*poll)(struct dvb_device *, int type, + struct file *file, poll_table * wait); + + int (*device_type)(struct dvb_device *, unsigned int device_num); +#define DVB_DEVICE_VIDEO_0 0 +#define DVB_DEVICE_AUDIO_0 4 +#define DVB_DEVICE_SEC_0 8 +#define DVB_DEVICE_FRONTEND_0 12 +#define DVB_DEVICE_DEMUX_0 16 +#define DVB_DEVICE_DEMUX_1 17 +#define DVB_DEVICE_DEMUX_2 18 +#define DVB_DEVICE_DEMUX_3 19 +#define DVB_DEVICE_DVR_0 20 +#define DVB_DEVICE_CA_0 24 +#define DVB_DEVICE_NET_0 28 +#define DVB_DEVICE_OSD_0 32 + devfs_handle_t devfsh; +}; + +typedef struct dvb_device dvb_device_t; + +int dvb_register_device(struct dvb_device *); +void dvb_unregister_device(struct dvb_device *); + +#endif /* #ifndef __DVBDEV_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/dvb_filter.c linux.20pre5-ac2/drivers/media/video/margi/dvb_filter.c --- linux.20pre5/drivers/media/video/margi/dvb_filter.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/dvb_filter.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,769 @@ +#include +#include +#include "dvb_filter.h" +#if 0 +#ifdef MODULE +MODULE_DESCRIPTION(""); +MODULE_AUTHOR("Marcus Metzler, Ralph Metzler"); +#ifdef MODULE_LICENSE +MODULE_LICENSE("GPL"); +#endif +#endif +#endif + +unsigned int bitrates[3][16] = +{{0,32,64,96,128,160,192,224,256,288,320,352,384,416,448,0}, + {0,32,48,56,64,80,96,112,128,160,192,224,256,320,384,0}, + {0,32,40,48,56,64,80,96,112,128,160,192,224,256,320,0}}; + +uint32_t freq[4] = {441, 480, 320, 0}; + +unsigned int ac3_bitrates[32] = + {32,40,48,56,64,80,96,112,128,160,192,224,256,320,384,448,512,576,640, + 0,0,0,0,0,0,0,0,0,0,0,0,0}; + +uint32_t ac3_freq[4] = {480, 441, 320, 0}; +uint32_t ac3_frames[3][32] = + {{64,80,96,112,128,160,192,224,256,320,384,448,512,640,768,896,1024, + 1152,1280,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {69,87,104,121,139,174,208,243,278,348,417,487,557,696,835,975,1114, + 1253,1393,0,0,0,0,0,0,0,0,0,0,0,0,0}, + {96,120,144,168,192,240,288,336,384,480,576,672,768,960,1152,1344, + 1536,1728,1920,0,0,0,0,0,0,0,0,0,0,0,0,0}}; + + + +void pes2ts_init(pes2ts_t *p2ts, unsigned short pid, + pes2ts_cb_t *cb, void *priv) +{ + unsigned char *buf=p2ts->buf; + + buf[0]=0x47; + buf[1]=(pid>>8); + buf[2]=pid&0xff; + p2ts->cc=0; + p2ts->cb=cb; + p2ts->priv=priv; +} + +int pes2ts(pes2ts_t *p2ts, unsigned char *pes, int len) +{ + unsigned char *buf=p2ts->buf; + int ret=0, rest; + + //len=6+((pes[4]<<8)|pes[5]); + + buf[1]|=0x40; + while (len>=184) { + buf[3]=0x10|((p2ts->cc++)&0x0f); + memcpy(buf+4, pes, 184); + if ((ret=p2ts->cb(p2ts->priv, buf))) + return ret; + len-=184; pes+=184; + buf[1]&=~0x40; + } + if (!len) + return 0; + buf[3]=0x30|((p2ts->cc++)&0x0f); + rest=183-len; + if (rest) { + buf[5]=0x00; + if (rest-1) + memset(buf+6, 0xff, rest-1); + } + buf[4]=rest; + memcpy(buf+5+rest, pes, len); + return p2ts->cb(p2ts->priv, buf); +} + +void reset_ipack(ipack *p) +{ + p->found = 0; + p->cid = 0; + p->plength = 0; + p->flag1 = 0; + p->flag2 = 0; + p->hlength = 0; + p->mpeg = 0; + p->check = 0; + p->which = 0; + p->done = 0; + p->count = 0; +} + +void init_ipack(ipack *p, int size, + void (*func)(u8 *buf, int size, void *priv)) +{ + if ( !(p->buf = vmalloc(size*sizeof(u8))) ){ + printk ("Couldn't allocate memory for ipack\n"); + } + p->size = size; + p->func = func; + p->repack_subids = 0; + reset_ipack(p); +} + +void free_ipack(ipack * p) +{ + if (p->buf) vfree(p->buf); +} + +void send_ipack(ipack *p) +{ + int off; + AudioInfo ai; + int ac3_off = 0; + int streamid=0; + int nframes= 0; + int f=0; + + switch ( p->mpeg ){ + case 2: + if (p->count < 10) return; + p->buf[3] = p->cid; + + p->buf[4] = (u8)(((p->count-6) & 0xFF00) >> 8); + p->buf[5] = (u8)((p->count-6) & 0x00FF); + if (p->repack_subids && p->cid == PRIVATE_STREAM1){ + + off = 9+p->buf[8]; + streamid = p->buf[off]; + if ((streamid & 0xF8) == 0x80){ + ai.off = 0; + ac3_off = ((p->buf[off+2] << 8)| + p->buf[off+3]); + if (ac3_off < p->count) + f=get_ac3info(p->buf+off+3+ac3_off, + p->count-ac3_off, &ai,0); + if ( !f ){ + nframes = (p->count-off-3-ac3_off)/ + ai.framesize + 1; + p->buf[off+2] = (ac3_off >> 8)& 0xFF; + p->buf[off+3] = (ac3_off)& 0xFF; + p->buf[off+1] = nframes; + + ac3_off += nframes * ai.framesize - + p->count; + } + } + } + p->func(p->buf, p->count, p->data); + + p->buf[6] = 0x80; + p->buf[7] = 0x00; + p->buf[8] = 0x00; + p->count = 9; + if (p->repack_subids && p->cid == PRIVATE_STREAM1 + && (streamid & 0xF8)==0x80 ){ + p->count += 4; + p->buf[9] = streamid; + p->buf[10] = (ac3_off >> 8)& 0xFF; + p->buf[11] = (ac3_off)& 0xFF; + p->buf[12] = 0; + } + + break; + case 1: + if (p->count < 8) return; + p->buf[3] = p->cid; + + p->buf[4] = (u8)(((p->count-6) & 0xFF00) >> 8); + p->buf[5] = (u8)((p->count-6) & 0x00FF); + p->func(p->buf, p->count, p->data); + + p->buf[6] = 0x0F; + p->count = 7; + break; + } +} + +void send_ipack_rest(ipack *p) +{ + if (p->plength != MMAX_PLENGTH-6 || p->found<=6) + return; + p->plength = p->found-6; + p->found = 0; + send_ipack(p); + reset_ipack(p); +} + +static void write_ipack(ipack *p, u8 *data, int count) +{ + u8 headr[3] = { 0x00, 0x00, 0x01} ; + + if (p->count < 6){ + memcpy(p->buf, headr, 3); + p->count = 6; + } + + if (p->count + count < p->size){ + memcpy(p->buf+p->count, data, count); + p->count += count; + } else { + int rest = p->size - p->count; + memcpy(p->buf+p->count, data, rest); + p->count += rest; + send_ipack(p); + if (count - rest > 0) + write_ipack(p, data+rest, count-rest); + } +} + +int instant_repack(u8 *buf, int count, ipack *p) +{ + int l; + int c=0; + + while (c < count && (p->mpeg == 0 || + (p->mpeg == 1 && p->found < 7) || + (p->mpeg == 2 && p->found < 9)) + && (p->found < 5 || !p->done)){ + switch ( p->found ){ + case 0: + case 1: + if (buf[c] == 0x00) p->found++; + else p->found = 0; + c++; + break; + case 2: + if (buf[c] == 0x01) p->found++; + else if (buf[c] == 0) { + p->found = 2; + } else p->found = 0; + c++; + break; + case 3: + p->cid = 0; + switch (buf[c]){ + case PROG_STREAM_MAP: + case PRIVATE_STREAM2: + case PROG_STREAM_DIR: + case ECM_STREAM : + case EMM_STREAM : + case PADDING_STREAM : + case DSM_CC_STREAM : + case ISO13522_STREAM: + p->done = 1; + case PRIVATE_STREAM1: + case VIDEO_STREAM_S ... VIDEO_STREAM_E: + case AUDIO_STREAM_S ... AUDIO_STREAM_E: + p->found++; + p->cid = buf[c]; + c++; + break; + default: + p->found = 0; + break; + } + break; + + case 4: + if (count-c > 1){ + p->plen[0] = buf[c]; + c++; + p->plen[1] = buf[c]; + c++; + p->found+=2; + p->plength=(p->plen[0]<<8)|p->plen[1]; + } else { + p->plen[0] = buf[c]; + p->found++; + return count; + } + break; + case 5: + p->plen[1] = buf[c]; + c++; + p->found++; + p->plength=(p->plen[0]<<8)|p->plen[1]; + break; + case 6: + if (!p->done){ + p->flag1 = buf[c]; + c++; + p->found++; + if ( (p->flag1 & 0xC0) == 0x80 ) p->mpeg = 2; + else { + p->hlength = 0; + p->which = 0; + p->mpeg = 1; + p->flag2 = 0; + } + } + break; + + case 7: + if ( !p->done && p->mpeg == 2) { + p->flag2 = buf[c]; + c++; + p->found++; + } + break; + + case 8: + if ( !p->done && p->mpeg == 2) { + p->hlength = buf[c]; + c++; + p->found++; + } + break; + + default: + + break; + } + } + + if (c == count) return count; + + if (!p->plength) p->plength = MMAX_PLENGTH-6; + + if ( p->done || ((p->mpeg == 2 && p->found >= 9) || + (p->mpeg == 1 && p->found >= 7)) ){ + switch (p->cid){ + + case AUDIO_STREAM_S ... AUDIO_STREAM_E: + case VIDEO_STREAM_S ... VIDEO_STREAM_E: + case PRIVATE_STREAM1: + + if (p->mpeg == 2 && p->found == 9) { + write_ipack(p, &p->flag1, 1); + write_ipack(p, &p->flag2, 1); + write_ipack(p, &p->hlength, 1); + } + + if (p->mpeg == 1 && p->found == 7) + write_ipack(p, &p->flag1, 1); + + if (p->mpeg == 2 && (p->flag2 & PTS_ONLY) && + p->found < 14) { + while (c < count && p->found < 14) { + p->pts[p->found-9] = buf[c]; + write_ipack(p, buf+c, 1); + c++; + p->found++; + } + if (c == count) return count; + } + + if (p->mpeg == 1 && p->which < 2000) { + + if (p->found == 7) { + p->check = p->flag1; + p->hlength = 1; + } + + while (!p->which && c < count && + p->check == 0xFF){ + p->check = buf[c]; + write_ipack(p, buf+c, 1); + c++; + p->found++; + p->hlength++; + } + + if ( c == count) return count; + + if ( (p->check & 0xC0) == 0x40 && !p->which){ + p->check = buf[c]; + write_ipack(p, buf+c, 1); + c++; + p->found++; + p->hlength++; + + p->which = 1; + if ( c == count) return count; + p->check = buf[c]; + write_ipack(p, buf+c, 1); + c++; + p->found++; + p->hlength++; + p->which = 2; + if ( c == count) return count; + } + + if (p->which == 1){ + p->check = buf[c]; + write_ipack(p, buf+c, 1); + c++; + p->found++; + p->hlength++; + p->which = 2; + if ( c == count) return count; + } + + if ( (p->check & 0x30) && p->check != 0xFF){ + p->flag2 = (p->check & 0xF0) << 2; + p->pts[0] = p->check; + p->which = 3; + } + + if ( c == count) return count; + if (p->which > 2){ + if ((p->flag2 & PTS_DTS_FLAGS) + == PTS_ONLY){ + while (c < count && + p->which < 7){ + p->pts[p->which-2] = + buf[c]; + write_ipack(p,buf+c,1); + c++; + p->found++; + p->which++; + p->hlength++; + } + if ( c == count) return count; + } else if ((p->flag2 & PTS_DTS_FLAGS) + == PTS_DTS){ + while (c < count && + p->which< 12){ + if (p->which< 7) + p->pts[p->which + -2] = + buf[c]; + write_ipack(p,buf+c,1); + c++; + p->found++; + p->which++; + p->hlength++; + } + if ( c == count) return count; + } + p->which = 2000; + } + + } + + while (c < count && p->found < p->plength+6){ + l = count -c; + if (l+p->found > p->plength+6) + l = p->plength+6-p->found; + write_ipack(p, buf+c, l); + p->found += l; + c += l; + } + + break; + } + + + if ( p->done ){ + if( p->found + count - c < p->plength+6){ + p->found += count-c; + c = count; + } else { + c += p->plength+6 - p->found; + p->found = p->plength+6; + } + } + + if (p->plength && p->found == p->plength+6) { + send_ipack(p); + reset_ipack(p); + if (c < count) + instant_repack(buf+c, count-c, p); + } + } + return count; +} + + + +void setup_ts2pes(ipack *pa, ipack *pv, u16 *pida, u16 *pidv, + void (*pes_write)(u8 *buf, int count, void *data), + void *priv) +{ + init_ipack(pa, IPACKS, pes_write); + init_ipack(pv, IPACKS, pes_write); + pa->pid = pida; + pv->pid = pidv; + pa->data = priv; + pv->data = priv; +} + +void ts_to_pes(ipack *p, u8 *buf) // don't need count (=188) +{ + u8 off = 0; + + if (!buf || !p ){ + printk("NULL POINTER IDIOT\n"); + return; + } + if (buf[1]&PAY_START) { + if (p->plength == MMAX_PLENGTH-6 && p->found>6){ + p->plength = p->found-6; + p->found = 0; + send_ipack(p); + reset_ipack(p); + } + } + if (buf[3] & ADAPT_FIELD) { // adaptation field? + off = buf[4] + 1; + if (off+4 > 187) return; + } + instant_repack(buf+4+off, TS_SIZE-4-off, p); +} + +int get_vinfo(uint8_t *mbuf, int count, VideoInfo *vi, int pr) +{ + uint8_t *headr; + int found = 0; + int sw; + int form = -1; + int c = 0; + + while (found < 4 && c+4 < count){ + uint8_t *b; + + b = mbuf+c; + if ( b[0] == 0x00 && b[1] == 0x00 && b[2] == 0x01 + && b[3] == 0xb3) found = 4; + else { + c++; + } + } + + if (! found) return -1; + c += 4; + if (c+12 >= count) return -1; + headr = mbuf+c; + + vi->horizontal_size = ((headr[1] &0xF0) >> 4) | (headr[0] << 4); + vi->vertical_size = ((headr[1] &0x0F) << 8) | (headr[2]); + + sw = (int)((headr[3]&0xF0) >> 4) ; + + switch( sw ){ + case 1: + if (pr) + printk("Videostream: ASPECT: 1:1"); + vi->aspect_ratio = 100; + break; + case 2: + if (pr) + printk("Videostream: ASPECT: 4:3"); + vi->aspect_ratio = 133; + break; + case 3: + if (pr) + printk("Videostream: ASPECT: 16:9"); + vi->aspect_ratio = 177; + break; + case 4: + if (pr) + printk("Videostream: ASPECT: 2.21:1"); + vi->aspect_ratio = 221; + break; + + case 5 ... 15: + if (pr) + printk("Videostream: ASPECT: reserved"); + vi->aspect_ratio = 0; + break; + + default: + vi->aspect_ratio = 0; + return -1; + } + + if (pr) + printk(" Size = %dx%d",vi->horizontal_size,vi->vertical_size); + + sw = (int)(headr[3]&0x0F); + + switch ( sw ) { + case 1: + if (pr) + printk(" FRate: 23.976 fps"); + vi->framerate = 24000/1001.; + form = -1; + break; + case 2: + if (pr) + printk(" FRate: 24 fps"); + vi->framerate = 24; + form = -1; + break; + case 3: + if (pr) + printk(" FRate: 25 fps"); + vi->framerate = 25; + form = VIDEO_MODE_PAL; + break; + case 4: + if (pr) + printk(" FRate: 29.97 fps"); + vi->framerate = 30000/1001.; + form = VIDEO_MODE_NTSC; + break; + case 5: + if (pr) + printk(" FRate: 30 fps"); + vi->framerate = 30; + form = VIDEO_MODE_NTSC; + break; + case 6: + if (pr) + printk(" FRate: 50 fps"); + vi->framerate = 50; + form = VIDEO_MODE_PAL; + break; + case 7: + if (pr) + printk(" FRate: 60 fps"); + vi->framerate = 60; + form = VIDEO_MODE_NTSC; + break; + } + + vi->bit_rate = 400*(((headr[4] << 10) & 0x0003FC00UL) + | ((headr[5] << 2) & 0x000003FCUL) | + (((headr[6] & 0xC0) >> 6) & 0x00000003UL)); + + if (pr){ + printk(" BRate: %d Mbit/s",(vi->bit_rate)); + printk("\n"); + } + vi->video_format = form; + + vi->off = c-4; + return 0; +} + +int get_ainfo(uint8_t *mbuf, int count, AudioInfo *ai, int pr) +{ + uint8_t *headr; + int found = 0; + int c = 0; + int fr = 0; + + while (found < 2 && c < count){ + uint8_t b[2]; + memcpy( b, mbuf+c, 2); + + if ( b[0] == 0xff && (b[1] & 0xf8) == 0xf8) + found = 2; + else { + c++; + } + } + + if (!found) return -1; + + if (c+3 >= count) return -1; + headr = mbuf+c; + + ai->layer = (headr[1] & 0x06) >> 1; + + if (pr) + printk("Audiostream: Layer: %d", 4-ai->layer); + + + ai->bit_rate = bitrates[(3-ai->layer)][(headr[2] >> 4 )]*1000; + + if (pr){ + if (ai->bit_rate == 0) + printk(" Bit rate: free"); + else if (ai->bit_rate == 0xf) + printk(" BRate: reserved"); + else + printk(" BRate: %d kb/s", ai->bit_rate/1000); + } + + fr = (headr[2] & 0x0c ) >> 2; + ai->frequency = freq[fr]*100; + if (pr){ + if (ai->frequency == 3) + printk(" Freq: reserved\n"); + else + printk(" Freq: %d kHz\n",ai->frequency); + + } + ai->off = c; + return 0; +} + +int get_ac3info(uint8_t *mbuf, int count, AudioInfo *ai, int pr) +{ + uint8_t *headr; + int found = 0; + int c = 0; + uint8_t frame = 0; + int fr = 0; + + while ( !found && c < count){ + uint8_t *b = mbuf+c; + + if ( b[0] == 0x0b && b[1] == 0x77 ) + found = 1; + else { + c++; + } + } + + if (!found) return -1; + if (pr) + printk("Audiostream: AC3"); + + ai->off = c; + if (c+5 >= count) return -1; + + ai->layer = 0; // 0 for AC3 + headr = mbuf+c+2; + + frame = (headr[2]&0x3f); + ai->bit_rate = ac3_bitrates[frame >> 1]*1000; + + if (pr) + printk(" BRate: %d kb/s", ai->bit_rate/1000); + + ai->frequency = (headr[2] & 0xc0 ) >> 6; + fr = (headr[2] & 0xc0 ) >> 6; + ai->frequency = freq[fr]*100; + if (pr) printk (" Freq: %d Hz\n", ai->frequency); + + + ai->framesize = ac3_frames[fr][frame >> 1]; + if ((frame & 1) && (fr == 1)) ai->framesize++; + ai->framesize = ai->framesize << 1; + if (pr) printk (" Framesize %d\n", ai->framesize); + + + return 0; +} + +uint8_t *skip_pes_header(uint8_t **bufp) +{ + uint8_t *inbuf = *bufp; + uint8_t *buf = inbuf; + uint8_t *pts = NULL; + int skip = 0; + +int mpeg1_skip_table[16] = { + 1, 0xffff, 5, 10, 0xffff, 0xffff, 0xffff, 0xffff, + 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff +}; + + + if ((inbuf[6] & 0xc0) == 0x80){ /* mpeg2 */ + if (buf[7] & PTS_ONLY) + pts = buf+9; + else pts = NULL; + buf = inbuf + 9 + inbuf[8]; + } else { /* mpeg1 */ + for (buf = inbuf + 6; *buf == 0xff; buf++) + if (buf == inbuf + 6 + 16) { + break; + } + if ((*buf & 0xc0) == 0x40) + buf += 2; + skip = mpeg1_skip_table [*buf >> 4]; + if (skip == 5 || skip == 10) pts = buf; + else pts = NULL; + + buf += mpeg1_skip_table [*buf >> 4]; + } + + *bufp = buf; + return pts; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/dvb_filter.h linux.20pre5-ac2/drivers/media/video/margi/dvb_filter.h --- linux.20pre5/drivers/media/video/margi/dvb_filter.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/dvb_filter.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,146 @@ +#ifndef _DVB_FILTER_H_ +#define _DVB_FILTER_H_ + +#include +#include + +#include "ost/demux.h" + +typedef int (pes2ts_cb_t) (void *, unsigned char *); + +typedef struct pes2ts_s { + unsigned char buf[188]; + unsigned char cc; + pes2ts_cb_t *cb; + void *priv; +} pes2ts_t; + +void pes2ts_init(pes2ts_t *p2ts, unsigned short pid, + pes2ts_cb_t *cb, void *priv); +int pes2ts(pes2ts_t *p2ts, unsigned char *pes, int len); + + +#define PROG_STREAM_MAP 0xBC +#define PRIVATE_STREAM1 0xBD +#define PADDING_STREAM 0xBE +#define PRIVATE_STREAM2 0xBF +#define AUDIO_STREAM_S 0xC0 +#define AUDIO_STREAM_E 0xDF +#define VIDEO_STREAM_S 0xE0 +#define VIDEO_STREAM_E 0xEF +#define ECM_STREAM 0xF0 +#define EMM_STREAM 0xF1 +#define DSM_CC_STREAM 0xF2 +#define ISO13522_STREAM 0xF3 +#define PROG_STREAM_DIR 0xFF + +//flags2 +#define PTS_DTS_FLAGS 0xC0 +#define ESCR_FLAG 0x20 +#define ES_RATE_FLAG 0x10 +#define DSM_TRICK_FLAG 0x08 +#define ADD_CPY_FLAG 0x04 +#define PES_CRC_FLAG 0x02 +#define PES_EXT_FLAG 0x01 + +//pts_dts flags +#define PTS_ONLY 0x80 +#define PTS_DTS 0xC0 + +#define TS_SIZE 188 +#define TRANS_ERROR 0x80 +#define PAY_START 0x40 +#define TRANS_PRIO 0x20 +#define PID_MASK_HI 0x1F +//flags +#define TRANS_SCRMBL1 0x80 +#define TRANS_SCRMBL2 0x40 +#define ADAPT_FIELD 0x20 +#define PAYLOAD 0x10 +#define COUNT_MASK 0x0F + +// adaptation flags +#define DISCON_IND 0x80 +#define RAND_ACC_IND 0x40 +#define ES_PRI_IND 0x20 +#define PCR_FLAG 0x10 +#define OPCR_FLAG 0x08 +#define SPLICE_FLAG 0x04 +#define TRANS_PRIV 0x02 +#define ADAP_EXT_FLAG 0x01 + +// adaptation extension flags +#define LTW_FLAG 0x80 +#define PIECE_RATE 0x40 +#define SEAM_SPLICE 0x20 + + +#define MAX_PLENGTH 0xFFFF +#define MMAX_PLENGTH (256*MAX_PLENGTH) + +#ifndef IPACKS +#define IPACKS 2048 +#endif + +typedef struct ipack_s { + int size; + int found; + u8 *buf; + u8 cid; + uint32_t plength; + u8 plen[2]; + u8 flag1; + u8 flag2; + u8 hlength; + u8 pts[5]; + u16 *pid; + int mpeg; + u8 check; + int which; + int done; + void *data; + void (*func)(u8 *buf, int size, void *priv); + int count; + int repack_subids; +} ipack; + +typedef struct video_i{ + u32 horizontal_size; + u32 vertical_size ; + u32 aspect_ratio ; + double framerate ; + u32 video_format; + u32 bit_rate ; + u32 comp_bit_rate ; + u32 vbv_buffer_size; + u32 CSPF ; + u32 off; +} VideoInfo; + +typedef struct audio_i{ + int layer ; + u32 bit_rate ; + u32 frequency ; + u32 mode ; + u32 mode_extension ; + u32 emphasis ; + u32 framesize; + u32 off; +} AudioInfo; + +void reset_ipack(ipack *p); +int instant_repack(u8 *buf, int count, ipack *p); +void init_ipack(ipack *p, int size, + void (*func)(u8 *buf, int size, void *priv)); +void free_ipack(ipack * p); +void setup_ts2pes(ipack *pa, ipack *pv, u16 *pida, u16 *pidv, + void (*pes_write)(u8 *buf, int count, void *data), + void *priv); +void ts_to_pes(ipack *p, u8 *buf); +void send_ipack(ipack *p); +void send_ipack_rest(ipack *p); +int get_ainfo(uint8_t *mbuf, int count, AudioInfo *ai, int pr); +int get_ac3info(uint8_t *mbuf, int count, AudioInfo *ai, int pr); +int get_vinfo(uint8_t *mbuf, int count, VideoInfo *vi, int pr); +uint8_t *skip_pes_header(uint8_t **bufp); +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/dvb_formats.h linux.20pre5-ac2/drivers/media/video/margi/dvb_formats.h --- linux.20pre5/drivers/media/video/margi/dvb_formats.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/dvb_formats.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,152 @@ +/* + * + * Copyright (C) 2000, 2001 Marcus Metzler + * for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Or, point your browser to http://www.gnu.org/copyleft/gpl.html + * + + * The author can be reached at marcus@convergence.de, + + * the project's page is at http://linuxtv.org/dvb/ + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef _DVB_FORMATS_H_ +#define _DVB_FORMATS_H_ + + +#define PROG_STREAM_MAP 0xBC +#ifndef PRIVATE_STREAM1 +#define PRIVATE_STREAM1 0xBD +#endif +#define PADDING_STREAM 0xBE +#ifndef PRIVATE_STREAM2 +#define PRIVATE_STREAM2 0xBF +#endif +#define AUDIO_STREAM_S 0xC0 +#define AUDIO_STREAM_E 0xDF +#define VIDEO_STREAM_S 0xE0 +#define VIDEO_STREAM_E 0xEF +#define ECM_STREAM 0xF0 +#define EMM_STREAM 0xF1 +#define DSM_CC_STREAM 0xF2 +#define ISO13522_STREAM 0xF3 +#define PROG_STREAM_DIR 0xFF + +#define BUFFYSIZE 10*MAX_PLENGTH +//#define MAX_PTS 8192 +#define MAX_FRAME 8192 +#define MAX_PACK_L 4096 +#define PS_HEADER_L1 14 +#define PS_HEADER_L2 (PS_HEADER_L1+18) +#define MAX_H_SIZE (PES_H_MIN + PS_HEADER_L1 + 5) +#define PES_MIN 7 +#define PES_H_MIN 9 + +//flags2 +#define PTS_DTS_FLAGS 0xC0 +#define ESCR_FLAG 0x20 +#define ES_RATE_FLAG 0x10 +#define DSM_TRICK_FLAG 0x08 +#define ADD_CPY_FLAG 0x04 +#define PES_CRC_FLAG 0x02 +#define PES_EXT_FLAG 0x01 + +//pts_dts flags +#define PTS_ONLY 0x80 +#define PTS_DTS 0xC0 + +#define TS_SIZE 188 +#define TRANS_ERROR 0x80 +#define PAY_START 0x40 +#define TRANS_PRIO 0x20 +#define PID_MASK_HI 0x1F +//flags +#define TRANS_SCRMBL1 0x80 +#define TRANS_SCRMBL2 0x40 +#define ADAPT_FIELD 0x20 +#define PAYLOAD 0x10 +#define COUNT_MASK 0x0F + +// adaptation flags +#define DISCON_IND 0x80 +#define RAND_ACC_IND 0x40 +#define ES_PRI_IND 0x20 +#define PCR_FLAG 0x10 +#define OPCR_FLAG 0x08 +#define SPLICE_FLAG 0x04 +#define TRANS_PRIV 0x02 +#define ADAP_EXT_FLAG 0x01 + +// adaptation extension flags +#define LTW_FLAG 0x80 +#define PIECE_RATE 0x40 +#define SEAM_SPLICE 0x20 + + +#define MAX_PLENGTH 0xFFFF +#define MMAX_PLENGTH (4*MAX_PLENGTH) + +#define IPACKS 2048 + +typedef struct ipack_s { + int size; + int found; + uint8_t *buf; + uint8_t cid; + uint32_t plength; + uint8_t plen[2]; + uint8_t flag1; + uint8_t flag2; + uint8_t hlength; + uint8_t pts[5]; + uint16_t *pid; + int mpeg; + uint8_t check; + int which; + int done; + void *data; + void (*func)(uint8_t *buf, int size, void *priv); + int count; +} ipack; + +void instant_repack (uint8_t *buf, int count, ipack *p); +void init_ipack(ipack *p, int size, + void (*func)(uint8_t *buf, int size, void *priv)); +void free_ipack(ipack * p); +void setup_ts2pes( ipack *pa, ipack *pv, uint16_t *pida, uint16_t *pidv, + void (*pes_write)(uint8_t *buf, int count, void *data), + void *priv); +void ts_to_pes( ipack *p, uint8_t *buf); // don't need count (=188) +uint16_t get_pid(uint8_t *pid); + + +#endif /* _DVB_FORMATS_H_*/ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/i2c.c linux.20pre5-ac2/drivers/media/video/margi/i2c.c --- linux.20pre5/drivers/media/video/margi/i2c.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/i2c.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,186 @@ +/* + i2c.h + + Copyright (C) Marcus Metzler for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#define __NO_VERSION__ + +#include "i2c.h" + +void out(struct cvdv_cards *card) +{ + write_indexed_register(card, IIO_GPIO_PINS, + (card->scl ? SCL : 0) | + (card->sda ? SDA : 0) | 1); + udelay(10); +} + +void clkon(struct cvdv_cards *card) +{ + card->scl = 1; +} + +void clkoff(struct cvdv_cards *card) +{ + card->scl = 0; +} + +void dat(struct cvdv_cards *card, u_char data) +{ + card->sda = data; +} + +int rdat(struct cvdv_cards *card) +{ + return ((read_indexed_register(card, IIO_GPIO_PINS) & SDA) ? 1 : + 0); +} + + +void I2CStart(struct cvdv_cards *card) +{ + dat(card, 1); + out(card); + clkon(card); + out(card); + dat(card, 0); + out(card); + clkoff(card); + out(card); +} + +void I2CStop(struct cvdv_cards *card) +{ + dat(card, 0); + out(card); + clkon(card); + out(card); + dat(card, 1); + out(card); + clkoff(card); + out(card); +} + +int I2CAck(struct cvdv_cards *card, int ack) +{ + dat(card, ack); + out(card); + write_indexed_register(card, IIO_GPIO_CONTROL, (~SDA) & 0x07); + clkon(card); + out(card); + ack = rdat(card); + clkoff(card); + out(card); + write_indexed_register(card, IIO_GPIO_CONTROL, 0x07); + out(card); + return ack; +} + +u_char I2CReadByte(struct cvdv_cards * card, int ack) +{ + int i; + u_char data = 0; + + clkoff(card); + dat(card, 1); + out(card); + write_indexed_register(card, IIO_GPIO_CONTROL, (~SDA) & 0x07); + for (i = 7; i >= 0; i--) { + clkon(card); + out(card); + data |= (rdat(card) << i); + clkoff(card); + out(card); + } + write_indexed_register(card, IIO_GPIO_CONTROL, 0x07); + I2CAck(card, ack); + return data; +} + + +int I2CSendByte(struct cvdv_cards *card, u_char data) +{ + int i; + + for (i = 7; i >= 0; i--) { + dat(card, data & (1 << i)); + out(card); + clkon(card); + out(card); + clkoff(card); + out(card); + } + i = I2CAck(card, 1); + return i; +} + +void I2CWrite(struct cvdv_cards *card, int adr, int reg, int val) +{ + I2CStart(card); + I2CSendByte(card, adr); + I2CSendByte(card, reg); + I2CSendByte(card, val); + I2CStop(card); +} + + +u_char I2CRead(struct cvdv_cards *card, int adr, int reg) +{ + u_char c; + + I2CStart(card); + I2CSendByte(card, adr); + I2CSendByte(card, reg); + I2CStart(card); + I2CSendByte(card, adr | 1); + c = I2CReadByte(card, 1); + I2CStop(card); + return c; +} + + +int I2CScan(struct cvdv_cards *card, int adr) +{ + int result; + I2CStart(card); + result = I2CSendByte(card, adr); + I2CStop(card); + return result; +} + +void I2CScanBus(struct cvdv_cards *card) +{ + int i; + + for (i = 0; i < 0xff; i += 2) { + if (!I2CScan(card, i)) + MDEBUG(0,"Found i2c device at %d\n", i); + } +} + +void I2CSend(struct cvdv_cards *card, int adr, u_char * vals) +{ + int reg, val; + while (*vals != 0xff) { + reg = *vals; + vals++; + val = *vals; + vals++; + I2CWrite(card, adr, reg, val); + } +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/i2c.h linux.20pre5-ac2/drivers/media/video/margi/i2c.h --- linux.20pre5/drivers/media/video/margi/i2c.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/i2c.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,43 @@ +/* + i2c.h + + Copyright (C) Marcus Metzler for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef I2C_H +#define I2C_H +#include "cardbase.h" +#include "l64014.h" +#include "margi.h" + +void out(struct cvdv_cards *card); +void clkon(struct cvdv_cards *card); +void clkoff(struct cvdv_cards *card); +void dat(struct cvdv_cards *card, u_char data); +int rdat(struct cvdv_cards *card); +void I2CStart(struct cvdv_cards *card); +void I2CStop(struct cvdv_cards *card); +int I2CAck(struct cvdv_cards *card, int ack); +u_char I2CReadByte(struct cvdv_cards *card, int ack); +int I2CSendByte(struct cvdv_cards *card, u_char data); +void I2CWrite(struct cvdv_cards *card, int adr, int reg, int val); +u_char I2CRead(struct cvdv_cards *card, int adr, int reg); +int I2CScan(struct cvdv_cards *card, int adr); +void I2CScanBus(struct cvdv_cards *card); +void I2CSend(struct cvdv_cards *card, int adr, u_char * vals); + +#endif /* I2C_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/l64014.h linux.20pre5-ac2/drivers/media/video/margi/l64014.h --- linux.20pre5/drivers/media/video/margi/l64014.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/l64014.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,188 @@ +/* + l64014.h + + Copyright (C) Marcus Metzler for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef L64014_h +#define L64014_h + +#include +#include +#include + + +#define DIO_CONTROL_INDEX 0x00 +#define DIO_CONTROL_DATA 0x02 +#define DIO_LSI_STATUS 0x04 +#define DIO_LSI_CHANNEL_DATA 0x04 +#define DIO_LSI_INDEX_LOW 0x08 +#define DIO_LSI_DATA 0x0A +#define DIO_LSI_INDEX_HIGH 0x0C + +#define LSI_READY 0x08 +#define LSI_WAIT 0x04 +#define LSI_ARQ 0x02 +#define LSI_VRQ 0x01 + +#define IIO_ID 0x00 +#define IIO_MODE 0x01 +#define IIO_IRQ_CONTROL 0x02 +#define IIO_IRQ_STATUS 0x03 +#define IIO_LSI_CONTROL 0x06 +#define IIO_OSC_AUD 0x08 +#define IIO_VIDEO_CONTROL0 0x09 +#define IIO_VIDEO_CONTROL1 0x0A +#define IIO_VIDEO_LOOKUP 0x0B +#define IIO_EEPROM_CONTROL 0x0C +#define IIO_VIDEO_HOR_DELAY 0x0D +#define IIO_VIDEO_HOR_ACTIVE 0x0E +#define IIO_VIDEO_HOR_HIGH 0x0F +#define IIO_GPIO_CONTROL 0x10 +#define IIO_GPIO_PINS 0x11 +#define IIO_CSS_COMMAND 0x12 +#define IIO_CSS_STATUS 0x13 +#define IIO_CSS_KEY 0x14 + +#define SCL 0x02 +#define SDA 0x04 + +#define CS_CONTROL0 0x00 +#define CS_CONTROL1 0x01 +#define CS_CONTROL2 0x02 +#define CS_DAC 0x04 +#define CS_STATUS 0x07 +#define CS_BKG_COL 0x08 +#define CS_GPIO_CTRL 0x09 +#define CS_GPIO_DATA 0x0A +#define CS_C_AMP 0x0D +#define CS_Y_AMP 0x0E +#define CS_I2C_ADR 0x0F +#define CS_SC_AMP 0x10 +#define CS_SC_SYNTH0 0x11 +#define CS_SC_SYNTH1 0x12 +#define CS_SC_SYNTH2 0x13 +#define CS_SC_SYNTH3 0x14 +#define CS_HUE_LSB 0x15 +#define CS_HUE_MSB 0x16 +#define CS_CC_EN 0x18 +#define CS_CC_21_1 0x19 +#define CS_CC_21_2 0x1A +#define CS_CC_284_1 0x1B +#define CS_CC_284_2 0x1C +#define CS_INT_EN 0x3B +#define CS_INT_CLR 0x3C +#define CS_ID_REG 0x3D + + +#define CSS_COMMAND 0x12 +#define CSS_STATUS 0x13 +#define CSS_KEY 0x14 + +#define L14_CSS_NONE 0x00 +#define L14_CSS_PASSTHRU 0x01 +#define L14_CSS_DESCRAM 0x05 +#define L14_CSS_GEN_CH 0x08 +#define L14_CSS_RD_CH 0x09 +#define L14_CSS_WR_CH 0x0a +#define L14_CSS_WR_DRVREF 0x0b +#define L14_CSS_DRVAUTH 0x0c +#define L14_CSS_DECAUTH 0x0d +#define L14_CSS_DISCKEY 0x0e +#define L14_CSS_TITLEKEY 0x0f +#define L14_CSS_CMD_START 0x10 + +#define L14_CSS_BUSY 0x01 +#define L14_CSS_SUCCESS 0x02 + +#define DSVC 0x40 +#define RR 0x20 +#define DR 0x01 +#define AF1 0x20 +#define AF0 0x10 +#define SLEEP 0x08 +#define AFS2 0x04 +#define AFS1 0x02 +#define AFS0 0x01 + +#define ZVCLK13 0x04 +#define ZVCLKINV 0x08 +#define ZV16BIT 0x10 +#define ZVVREF_INVERT 0x08 +#define ZVHREF_INVERT 0x10 +#define HSYNC_INVERT 0x20 +#define ZV_OVERRIDE 0x40 +#define ZV_ENABLE 0x80 + + +#define IRQ_EN 0x04 +#define IRQ_MSK 0x08 +#define IRQ_POL 0x10 +#define DEC_EN 0x20 +#define DEC_INT 0x10 +#define VSYNC_EN 0x80 +#define VSYNC_INT 0x40 + +#define VMS_NOSY 0x00 +#define VMS_NTSC 0x01 +#define VMS_PAL 0x02 +#define VMS_PAL24 0x03 + +#define MAUDIO_PAUSE 0 +#define MAUDIO_PLAY 1 +#define MAUDIO_FAST 2 +#define MAUDIO_SLOW 3 + + +#define RegisterReadByte(card,where) read_indexed_register(&(card->link),(where)) +#define RegisterWriteByte(card,where,what) write_indexed_register(&(card->link),where,what) +#define RegisterMaskByte(card,where,mask,bits) RegisterWriteByte(card,where,(RegisterReadByte(card,where)&~(mask))|(bits)) +#define RegisterSetByte(card,where,bits) RegisterWriteByte(card,where,RegisterReadByte(card,where)|(bits)) +#define RegisterDelByte(card,where,mask) RegisterWriteByte(card,where,RegisterReadByte(card,where)&~(mask)) + +#define RegisterReadWord(card,where) (\ + (u16)RegisterReadByte(card,where)|\ + ((u16)RegisterReadByte(card,(where)+1)<<8)) +#define RegisterWriteWord(card,where,what) {\ + RegisterWriteByte(card,where,(what) & 0xFF);\ + RegisterWriteByte(card,(where)+1,((what)>>8) & 0xFF);} + +// 3-byte-wide (medium word, 24 Bit) access to the card's registers, LSB first +#define RegisterReadMWord(card,where) (\ + (u32)RegisterReadByte(card,where)|\ + ((u32)RegisterReadByte(card,(where)+1)<<8)|\ + ((u32)RegisterReadByte(card,(where)+2)<<16)) +#define RegisterWriteMWord(card,where,what) {\ + RegisterWriteByte(card,where,(what) & 0xFF);\ + RegisterWriteByte(card,(where)+1,((what)>>8) & 0xFF);\ + RegisterWriteByte(card,(where)+2,((what)>>16) & 0xFF);} + +// double-word-wide access to the card's registers, LSB first +//#define RegisterReadDWord(card,where) le32_to_cpu(readl(card->addr+(where))) +//#define RegisterWriteDWord(card,where,what) writel(cpu_to_le32(what),card->addr+(where)) +#define RegisterReadDWord(card,where) (\ + (u32)RegisterReadByte(card,where)|\ + ((u32)RegisterReadByte(card,(where)+1)<<8)|\ + ((u32)RegisterReadByte(card,(where)+2)<<16)|\ + ((u32)RegisterReadByte(card,(where)+3)<<24)) +#define RegisterWriteDWord(card,where,what) {\ + RegisterWriteByte(card,where,(what) & 0xFF);\ + RegisterWriteByte(card,(where)+1,((what)>>8) & 0xFF);\ + RegisterWriteByte(card,(where)+2,((what)>>16) & 0xFF);\ + RegisterWriteByte(card,(where)+3,((what)>>24) & 0xFF);} + +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/l64021.h linux.20pre5-ac2/drivers/media/video/margi/l64021.h --- linux.20pre5/drivers/media/video/margi/l64021.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/l64021.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,108 @@ +/* + l64021.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef _L64021_H_ +#define _L64021_H_ + +#include "margi.h" +#include "l64014.h" +// L64021 DRAM definitions + +#define DRAMMaxSize 0x00200000 // 2 MWords of DRAM + +// definitions for the L64021 + +#define DECODER_OFFSET 0x400 + +#define L21INTR0 0x000 +#define L21INTR1 0x001 +#define L21INTR2 0x002 +#define L21INTR3 0x003 +#define L21INTR4 0x004 + + +// Host interface registers + +// Video Decoder Registers + +// CSS Regs + +// Memory Interface + +// Microcontroller + +// Video Interface + +// Audio Decoder + +// RAM Test + +// SPU Decoder + + + + + //////////////////////////////////////////////////// + // // + // Access to the L64021 registers (0x400-0x7FF) // + // // +//////////////////////////////////////////////////// + +#define DecoderWriteByte(card,where,what) WriteByte(card,where,what) +#define DecoderReadByte(card,where) ReadByte(card,where) +#define DecoderMaskByte(card,where,mask,bits) MaskByte(card,where,mask,bits) +#define DecoderSetByte(card,addr,bits) DecoderWriteByte(card,addr,DecoderReadByte(card,addr)|(bits)) +#define DecoderDelByte(card,addr,mask) DecoderWriteByte(card,addr,DecoderReadByte(card,addr)&~(mask)) + +#define DecoderReadWord(card,addr) ((u16)DecoderReadByte(card,addr)|\ + ((u16)DecoderReadByte(card,(addr)+1)<<8)) + +#define DecoderWriteWord(card,addr,data) {\ + DecoderWriteByte(card,addr,(data) & 0xFF);\ + DecoderWriteByte(card,(addr)+1,((data)>>8) & 0xFF);} + + +#define DecoderReadMWord(card, addr)(\ + (u32)DecoderReadByte(card,addr)|\ + ((u32)DecoderReadByte(card,(addr)+1)<<8)|\ + ((u32)DecoderReadByte(card,(addr)+2)<<16)) + +#define DecoderWriteMWord(card,addr,data) {\ + DecoderWriteByte(card,addr,(data) & 0xFF);\ + DecoderWriteByte(card,(addr)+1,((data)>>8) & 0xFF);\ + DecoderWriteByte(card,(addr)+2,((data)>>16) & 0xFF);} + +#define DecoderReadDWord(card,addr) (\ + (u32)DecoderReadByte(card,addr)|\ + ((u32)DecoderReadByte(card,(addr)+1)<<8)|\ + ((u32)DecoderReadByte(card,(addr)+2)<<16)|\ + ((u32)DecoderReadByte(card,(addr)+3)<<24)) + +#define DecoderWriteDWord(card,addr,data) {\ + DecoderWriteByte(card,addr,(data) & 0xFF);\ + DecoderWriteByte(card,(addr)+1,((data)>>8) & 0xFF);\ + DecoderWriteByte(card,(addr)+2,((data)>>16) & 0xFF);\ + DecoderWriteByte(card,(addr)+3,((data)>>24) & 0xFF);} + + +void l64020Reset(struct cvdv_cards *card); + + +#endif // _L64021_H_ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/makedev.napi linux.20pre5-ac2/drivers/media/video/margi/makedev.napi --- linux.20pre5/drivers/media/video/margi/makedev.napi 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/makedev.napi 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,28 @@ +mkdir /dev/ost +chmod 755 /dev/ost +mknod -m 0666 /dev/ost/video0 c 250 0 +mknod -m 0666 /dev/ost/audio0 c 250 1 +mknod -m 0666 /dev/ost/sec0 c 250 2 +mknod -m 0666 /dev/ost/qpskfe0 c 250 3 +mknod -m 0666 /dev/ost/qamfe0 c 250 7 +mknod -m 0666 /dev/ost/demux0 c 250 4 +mknod -m 0666 /dev/ost/dvr0 c 250 5 +mknod -m 0666 /dev/ost/ca0 c 250 6 + +mknod -m 0666 /dev/ost/video1 c 250 64 +mknod -m 0666 /dev/ost/audio1 c 250 65 +mknod -m 0666 /dev/ost/sec1 c 250 66 +mknod -m 0666 /dev/ost/qpskfe1 c 250 67 +mknod -m 0666 /dev/ost/qamfe1 c 250 71 +mknod -m 0666 /dev/ost/demux1 c 250 68 +mknod -m 0666 /dev/ost/dvr1 c 250 69 +mknod -m 0666 /dev/ost/ca1 c 250 70 + +cd /dev/ost +ln -sf ca0 ca +ln -sf video0 video +ln -sf sec0 sec +ln -sf audio0 audio +ln -sf qpskfe0 qpskfe +ln -sf demux0 demux +ln -sf dvr0 dvr diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/Makefile linux.20pre5-ac2/drivers/media/video/margi/Makefile --- linux.20pre5/drivers/media/video/margi/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/Makefile 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,33 @@ +# +# Makefile for the Margi DVD-to-Go driver +# +# Note! Dependencies are done automagically by 'make dep', which also +# removes any old dependencies. DON'T put your own dependencies here +# unless it's something special (ie not a .c file). +# +# Note 2! The CFLAGS definitions are now in the main makefile... + +O_TARGET := margilib.o + +CFLAGS_margi_cs.o = -DUSE_OSD -DNOINT -DDVB -DUSE_ZV + +obj-y := +obj-m := +obj-n := +obj- := + +list-multi := margi_cs.o + +margi_cs-objs := margi.o cardbase.o i2c.o dram.o osd.o audio.o \ + video.o streams.o decoder.o spu.o crc.o ringbuffy.o \ + dvb_filter.o cvdv.o + +export-objs := dvbdev.o + +obj-m += margi_cs.o dvbdev.o dmxdev.o dvb_demux.o + +include $(TOPDIR)/Rules.make + +margi_cs.o: $(margi_cs-objs) + $(LD) $(LD_RFLAG) -r -o $@ $(margi_cs-objs) + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/margi linux.20pre5-ac2/drivers/media/video/margi/margi --- linux.20pre5/drivers/media/video/margi/margi 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/margi 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,5 @@ +#!/bin/sh +# +# + +exit 0 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/margi.c linux.20pre5-ac2/drivers/media/video/margi/margi.c --- linux.20pre5/drivers/media/video/margi/margi.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/margi.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,1493 @@ +/* + margi.c + + Copyright (C) Marcus Metzler for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "margi.h" + +#include +#include +#include +#include +#include +#include +#include + + + +#include "l64014.h" +#include "l64021.h" +#include "i2c.h" +#include "decoder.h" +#include "dram.h" +#include "video.h" +#include "cvdv.h" + + +static char *version = "margi_cs.c 0.6 02/04/2000 (Marcus Metzler)"; + +//#define USE_BH 1 +#ifdef USE_BH +#define MARGI_BH 31 +// shouldn't be a number, but then MARGI_BH must be entered into interrupt.h +#endif + +MODULE_AUTHOR(AUTHOR); +MODULE_DESCRIPTION(MEDDEVNAME " Driver V." DVERSION); +#ifdef MODULE_LICENSE +MODULE_LICENSE("GPL"); +#endif + +#define MAX_DEV 4 +#define DEVICE_NR(minor) ((minor)>>4) + +/*====================================================================*/ + +/* Parameters that can be set with 'insmod' */ +static int svhs = 1; +MODULE_PARM(svhs,"i"); +static int composite = 1; +MODULE_PARM(composite,"i"); +static int use_zv = 1; +MODULE_PARM(use_zv,"i"); + +/* Release IO ports after configuration? */ +static int free_ports = 0; + +/* The old way: bit map of interrupts to choose from */ +/* This means pick from 15, 14, 12, 11, 10, 9, 7, 5, 4, and 3 */ +static u_int irq_mask = 0xdeb8; +/* Newer, simpler way of listing specific interrupts */ +static int irq_list[4] = { -1 }; + +MODULE_PARM(free_ports, "i"); +MODULE_PARM(irq_mask, "i"); +MODULE_PARM(irq_list, "1-4i"); + +extern unsigned int major_device_number; +extern struct file_operations cvdv_fileops; + +typedef struct margi_info_t { + dev_link_t link; + dev_node_t node; + struct cvdv_cards card; + int stop; +} margi_info_t; + + + +/* + The event() function is this driver's Card Services event handler. + It will be called by Card Services when an appropriate card status + event is received. The config() and release() entry points are + used to configure or release a socket, in response to card + insertion and ejection events. They are invoked from the margi + event handler. +*/ + +static void margi_config(dev_link_t * link); +static void margi_release(u_long arg); +static int margi_event(event_t event, int priority, + event_callback_args_t * args); +/* + The attach() and detach() entry points are used to create and destroy + "instances" of the driver, where each instance represents everything + needed to manage one actual PCMCIA card. +*/ + +static dev_link_t *margi_attach(void); +static void margi_detach(dev_link_t *); +static u_char read_lsi_status(struct cvdv_cards *card); + +/* + You'll also need to prototype all the functions that will actually + be used to talk to your device. See 'memory_cs' for a good example + of a fully self-sufficient driver; the other drivers rely more or + less on other parts of the kernel. +*/ + +/* + The dev_info variable is the "key" that is used to match up this + device driver with appropriate cards, through the card configuration + database. +*/ + +static dev_link_t *dev_table[MAX_DEV] = { NULL, /* ... */ }; + +static dev_info_t dev_info = "margi_cs"; + +/* + A linked list of "instances" of the margi device. Each actual + PCMCIA card corresponds to one device instance, and is described + by one dev_link_t structure (defined in ds.h). + + You may not want to use a linked list for this -- for example, the + memory card driver uses an array of dev_link_t pointers, where minor + device numbers are used to derive the corresponding array index. +*/ + +static dev_link_t *dev_list = NULL; + +/* + A dev_link_t structure has fields for most things that are needed + to keep track of a socket, but there will usually be some device + specific information that also needs to be kept track of. The + 'priv' pointer in a dev_link_t structure can be used to point to + a device-specific private data structure, like this. + + To simplify the data structure handling, we actually include the + dev_link_t structure in the device's private data structure. + + A driver needs to provide a dev_node_t structure for each device + on a card. In some cases, there is only one device per card (for + example, ethernet cards, modems). In other cases, there may be + many actual or logical devices (SCSI adapters, memory cards with + multiple partitions). The dev_node_t structures need to be kept + in a linked list starting at the 'dev' field of a dev_link_t + structure. We allocate them in the card's private data structure, + because they generally shouldn't be allocated dynamically. + + In this case, we also provide a flag to indicate if a device is + "stopped" due to a power management event, or card ejection. The + device IO routines can use a flag like this to throttle IO to a + card that is not ready to accept it. + + The bus_operations pointer is used on platforms for which we need + to use special socket-specific versions of normal IO primitives + (inb, outb, readb, writeb, etc) for card IO. +*/ + +void DACSetFrequency(struct cvdv_cards *card, int khz, int multiple) { + uint8_t b = read_indexed_register(card, IIO_OSC_AUD); + + b &= 0xf8; + + switch (khz){ + case 32: + b |= 0x04; + break; + case 48: + b |= 0x00; + break; + case 44: + b |= 0x01; + break; + case 96: + b |= 0x02; + break; + default: + b |= 0x00; + break; + } + write_indexed_register(card, IIO_OSC_AUD, b); + +} + +int MargiFreeBuffers(struct cvdv_cards *card) +{ + MDEBUG(1, ": -- MargiFreeBuffers\n"); + + ring_destroy(&(card->rbufB)); + card->use_ringB = 0; + ring_destroy(&(card->rbufA)); + card->use_ringA = 0; + + return 0; +} + + +int MargiSetBuffers(struct cvdv_cards *card, uint32_t size, int isB) +{ + int err = 0; + + MDEBUG(0, ": -- MargiSetBuffers(%d) %d\n", + size, isB); + + if (isB){ + err = ring_init(&(card->rbufB),size); + if (!err) card->use_ringB = 1; + } else { + err = ring_init(&(card->rbufA),size); + if (!err) card->use_ringA = 1; + } + + MDEBUG(0,"set buffers: %d use_ringA: %d use_ringB: %d\n",err, +card->use_ringA,card->use_ringB); + return err; +} + + +int MargiFlush (struct cvdv_cards *card) +{ + int co = 0; + int i; + for (i=0;i<100;i++){ + MargiPushA(card, 32, FlushPacket); + MargiPushB(card, 32, FlushPacket); + } + while ( (ring_write_rest(&(card->rbufA))|| ring_write_rest(&(card->rbufB))) && co<100) + co++; + VideoSetBackground(card, 1, 0, 0, 0); // black + + if (card->use_ringA) ring_flush(&(card->rbufA)); + if (card->use_ringB) ring_flush(&(card->rbufB)); + card->DMAABusy = 0; + card->DMABBusy = 0; + + + DecoderStopChannel(card); + DecoderStreamReset(card); + DecoderSetupReset(card); + card->channelrun = 0; + + MDEBUG(1, ": Margi Flush \n"); + return 0; +} + + +int MargiPushA(struct cvdv_cards *card, int count, const char *data) +{ + int fill; + + fill = ring_read_rest(&(card->rbufA)); + + if (!card->use_ringA) + return 0; + if ((count>fill || fill > 3*card->rbufA.size/4) + && !card->channelrun){ + DecoderStartChannel(card); + card->DMAABusy = 1; + } + + count = ring_write(&(card->rbufA),data,count); + + return count; +} + +int MargiPushB(struct cvdv_cards *card, int count, const char *data) +{ + int fill; + + fill = ring_read_rest(&(card->rbufB)); + + if (!card->use_ringB) + return 0; + if ((count>fill || fill > 3*card->rbufB.size/4) + && !card->channelrun){ + DecoderStartChannel(card); + card->DMABBusy = 1; + } + + count = ring_write(&(card->rbufB),data,count); + + return count; +} + +int DecoderStartChannel(struct cvdv_cards *card) +{ + DecoderMaskByte(card, 0x007, 0xC3, 0xC3); // channel start + +#ifdef BYPASS + DecoderMaskByte(card,0x005,0x0F,0x08); +#else + DecoderMaskByte(card,0x005,0x0F,0x01); +#endif + card->channelrun = 1; + return 0; +} + +int DecoderStopChannel(struct cvdv_cards *card) +{ + DecoderMaskByte(card, 0x007, 0xC3, 0xC2); // channel reset + DecoderSetByte(card, 0x005, 0x04); // channel pause + card->channelrun = 0; + return 0; +} + +uint32_t DecoderGetAudioBufferSpace(struct cvdv_cards *card) +{ + + uint32_t MaxSize, Size; + + MaxSize = card->AudioESSize; + Size = DecoderGetAudioESLevel(card); + + if (Size>MaxSize) + return 0; + return (MaxSize - Size); + +} + +uint32_t DecoderGetVideoBufferSpace(struct cvdv_cards *card) +{ + + uint32_t MaxSize, Size; + + MaxSize = card->VideoESSize; + Size = DecoderGetVideoESLevel(card); + + if (Size>MaxSize) + return 0; + return (MaxSize - Size); + +} + +uint32_t DecoderGetBufferSpace(struct cvdv_cards *card) +{ + uint32_t audio,video; + + audio = DecoderGetAudioBufferSpace(card); + video = DecoderGetVideoBufferSpace(card); + + if (audio > 2048) audio -= 2048; + if (video > 2048) video -= 2048; + + if (audio < video) return audio; + return video; +} + + + +static int ringDMA (struct cvdv_cards *card){ + + uint32_t size = 0; + u_char stat; + dev_link_t *link = &(((margi_info_t *) card->margi)->link); + uint32_t acount=0; + uint32_t vcount=0; + uint8_t data; + ringbuffy *buffy; + int stype; + wait_queue_head_t *wq; + stat = read_lsi_status(card); + + + stype = card->setup.streamtype; + + if (stat & LSI_ARQ) { + stat = read_lsi_status(card); + } + + if (stat & LSI_READY){ + data = read_indexed_register(card, IIO_LSI_CONTROL); + data |= RR; + write_indexed_register(card, IIO_LSI_CONTROL, data); + return 0; + } + + if ((stat & LSI_ARQ) == 0) { + switch(stype){ + case stream_PES: + case stream_ES: + data = read_indexed_register(card, IIO_LSI_CONTROL); + data &= ~DSVC; + write_indexed_register(card, IIO_LSI_CONTROL, data); + buffy = &card->rbufB; + wq = &(card->wqB); + acount = ring_read_rest(buffy); + size = DecoderGetAudioBufferSpace(card); + if (size > 2048) size -= 2048; + break; + default: + buffy = &card->rbufA; + wq = &(card->wqA); + acount = ring_read_rest(buffy); + size = DecoderGetBufferSpace(card); + break; + } + if (acount > size) acount = size & 0xfffffffc; + if (acount>=2048) acount &=0xfffff800; + acount &=0xfffffffc; + + if (acount > size) acount = size & 0xfffffffc; + if (acount) { + ring_read_direct(buffy, + link->io.BasePort1+DIO_LSI_STATUS, + acount); + } else { + wake_up_interruptible(wq); + acount = 0; + } + } else { + acount = 0; + } + + if ((stat & LSI_VRQ) == 0 && + (stype == stream_PES || stype == stream_ES)) { + data = read_indexed_register(card, IIO_LSI_CONTROL); + data |= DSVC; + write_indexed_register(card, IIO_LSI_CONTROL, data); + buffy = &card->rbufA; + wq = &(card->wqA); + vcount = ring_read_rest(buffy); + + size = DecoderGetVideoBufferSpace(card); + if (size > 2048) size -= 2048; + if (vcount > size) vcount = size & 0xfffffffc; + if (vcount>=2048) vcount &=0xfffff800; + vcount &=0xfffffffc; + + if (vcount > size) vcount = size & 0xfffffffc; + if (vcount) { + ring_read_direct(buffy, + link->io.BasePort1+DIO_LSI_STATUS, + vcount); + } else { + wake_up_interruptible(wq); + vcount = 0; + } + } else { + vcount = 0; + } + + return vcount+acount; +} + + +u_char read_indexed_register(struct cvdv_cards * card, int addr) +{ + dev_link_t *link = &(((margi_info_t *) card->margi)->link); + u_char data; +#ifdef NOINT + spin_lock(&card->timelock); +#endif + outb(addr, link->io.BasePort1 + DIO_CONTROL_INDEX); + data = (inb(link->io.BasePort1 + DIO_CONTROL_DATA)); +#ifdef NOINT + spin_unlock(&card->timelock); +#endif + return data; +} + + +void write_indexed_register(struct cvdv_cards *card, int addr, u_char data) +{ + dev_link_t *link = &(((margi_info_t *) card->margi)->link); +#ifdef NOINT + spin_lock(&card->timelock); +#endif + outb(addr, link->io.BasePort1 + DIO_CONTROL_INDEX); + outb(data, link->io.BasePort1 + DIO_CONTROL_DATA); + +#ifdef NOINT + spin_unlock(&card->timelock); +#endif +} + +void WriteByte(struct cvdv_cards *card, int addr, u_char data) +{ + dev_link_t *link = &(((margi_info_t *) card->margi)->link); + +#ifdef NOINT + spin_lock(&card->timelock); +#endif + outb((u_char) (addr & 255), + link->io.BasePort1 + DIO_LSI_INDEX_LOW); + outb(((addr & 256) ? 1 : 0), + link->io.BasePort1 + DIO_LSI_INDEX_HIGH); + outb(data, link->io.BasePort1 + DIO_LSI_DATA); +#ifdef NOINT + spin_unlock(&card->timelock); +#endif +} + +u_char ReadByte(struct cvdv_cards *card, int addr) +{ + dev_link_t *link = &(((margi_info_t *) card->margi)->link); + u_char data; + +#ifdef NOINT + spin_lock(&card->timelock); +#endif + outb((u_char) (addr & 255), + link->io.BasePort1 + DIO_LSI_INDEX_LOW); + outb(((addr & 256) ? 1 : 0), + link->io.BasePort1 + DIO_LSI_INDEX_HIGH); + data = inb(link->io.BasePort1 + DIO_LSI_DATA); +#ifdef NOINT + spin_unlock(&card->timelock); +#endif + return data; +} + +void MaskByte(struct cvdv_cards *card, int addr, u_char mask, u_char bits) +{ + WriteByte(card, addr, (ReadByte(card, addr) & ~(mask)) | (bits)); +} + + + +#define MAXWRITE CHANNELBUFFERSIZE/2 +#define MAX_COUNT 400 + +#ifdef USE_BH +struct cvdv_cards *bh_card; + +static void do_margi_bh(void) +{ + struct cvdv_cards *card = bh_card; +#else + +static void do_margi(struct cvdv_cards *card) +{ + +#endif + int countA; + int try; + int stype = card->setup.streamtype; + + countA = 0; + + card->currentType = 0; + for ( try = 0; try < MAX_COUNT ;try++) + if (countA < MAXWRITE){ + int count = 0; + switch (stype){ + case stream_PES: + case stream_ES: + count = ringDMA(card); + countA += count; + if (!count) + try=MAX_COUNT; + break; + case stream_PS: + case stream_DVD: + count = ringDMA(card); + countA += count; + if (!count) + try=MAX_COUNT; + break; + } + } else break; + +} + + + + +void L64014Intr_function(struct cvdv_cards *card) +{ + uint8_t control,mask,stat; + int try; + + + control= read_indexed_register(card, IIO_IRQ_CONTROL); + if (control & IRQ_EN){ + mask = 0; + if ( control & DEC_EN ) mask |= DEC_INT; + if ( control & VSYNC_EN ) mask |= VSYNC_INT; + stat = read_indexed_register(card, IIO_IRQ_STATUS); + try = 0; + while ( (try++ < 100) && (stat & mask) ){ + + if (stat & VSYNC_INT) { + + write_indexed_register(card,IIO_IRQ_CONTROL, + control & (~VSYNC_EN)); + write_indexed_register(card,IIO_IRQ_CONTROL, + control); + + + if (card->DMAABusy || card->DMABBusy){ + +#ifdef USE_BH + bh_card = card; + mark_bh(MARGI_BH); +#else + do_margi(card); +#endif + if(card->use_ringA || card->use_ringB){ + L64021Intr(card); + } + } + } + + if (stat & DEC_INT) { + write_indexed_register(card,IIO_IRQ_CONTROL, + control & (~DEC_EN)); + write_indexed_register(card,IIO_IRQ_CONTROL, + control); + + if(card->use_ringA || card->use_ringB){ + L64021Intr(card); + } + } + + stat = read_indexed_register(card, IIO_IRQ_STATUS); + } + } + +} + + +#ifdef NOINT +void Timerfunction(unsigned long data) +{ + struct cvdv_cards *card = (struct cvdv_cards *) data; + + L64014Intr_function(card); + + card->timer.function = Timerfunction; + card->timer.data=(unsigned long) card; + card->timer.expires=jiffies+10; + if ( card->open) + add_timer(&card->timer); + +} +#endif + + +void L64014Intr(int irq, void *dev_id, struct pt_regs *regs) +{ + margi_info_t *margi = dev_id; + struct cvdv_cards *card = &(margi->card); + u_char dio_index, lsi_index_low, lsi_index_high; + +#ifdef NOINT + spin_lock(&card->timelock); +#endif + //save registers + dio_index = inb(margi->link.io.BasePort1 + DIO_CONTROL_INDEX); + lsi_index_low = inb(margi->link.io.BasePort1 + DIO_LSI_INDEX_LOW); + lsi_index_high = inb(margi->link.io.BasePort1 + DIO_LSI_INDEX_HIGH); + + + L64014Intr_function(card); + + //load registers + outb(dio_index, margi->link.io.BasePort1 + DIO_CONTROL_INDEX); + outb(lsi_index_low, margi->link.io.BasePort1 + DIO_LSI_INDEX_LOW); + outb(lsi_index_high,margi->link.io.BasePort1 + DIO_LSI_INDEX_HIGH); +#ifdef NOINT + spin_unlock(&card->timelock); +#endif +} + +int L64014RemoveIntr(struct cvdv_cards *card) +{ + MDEBUG(1, ": -- L64014RemoveIntr\n"); + // Disable the IRQ's + write_indexed_register(card, IIO_IRQ_CONTROL, 0x00); + if (!card->IntInstalled) + return 1; + L64021RemoveIntr(card); + return 0; +} + +void l64020Reset(struct cvdv_cards *card){ + uint8_t data; + + + data = read_indexed_register(card, IIO_LSI_CONTROL); + data &= ~(RR | DR); + write_indexed_register(card, IIO_LSI_CONTROL, data); + mdelay(100); + data = read_indexed_register(card, IIO_LSI_CONTROL); + data |= DR; + write_indexed_register(card, IIO_LSI_CONTROL, data); + + data = read_indexed_register(card,IIO_GPIO_PINS); + data &= ~0x01; + write_indexed_register(card,IIO_GPIO_PINS,data); + data |= 0x01; + write_indexed_register(card,IIO_GPIO_PINS,data); + + //write_indexed_register(card, IIO_LSI_CONTROL, DR); + + data = read_indexed_register(card, IIO_LSI_CONTROL); + data &= ~DSVC; + write_indexed_register(card, IIO_LSI_CONTROL, data); + +} + +void ZV_init(struct cvdv_cards *card) +{ + uint32_t delay, activel; + uint8_t reg; + delay = 235; + activel = delay + 1448; + + // init delay and active lines + write_indexed_register(card, IIO_VIDEO_HOR_DELAY, + (uint8_t)(delay & 0x00FF)); + write_indexed_register(card, IIO_VIDEO_HOR_ACTIVE, + (uint8_t)(activel & 0x00FF)); + reg = ((uint8_t)((activel >> 4) & 0x0070))|((uint8_t)((delay >> 8) & 0x0007)); + write_indexed_register(card, IIO_VIDEO_HOR_HIGH, reg); + + //init video + reg = read_indexed_register(card, IIO_VIDEO_CONTROL0); + reg |= (ZVCLK13 | ZV16BIT | ZVCLKINV); + write_indexed_register(card, IIO_VIDEO_CONTROL0, reg); + reg = read_indexed_register(card, IIO_VIDEO_CONTROL1); + reg |= (ZV_OVERRIDE | ZV_ENABLE); + write_indexed_register(card, IIO_VIDEO_CONTROL1, reg); +} + +void set_svhs(struct cvdv_cards *card, int onoff) +{ + uint8_t val; + + val = I2CRead(card, card->i2c_addr, CS_DAC)&0x0f; + MDEBUG(1, ": --svhs val 0x%02x\n",val); + + if (onoff){ + if (!card->svhs){ + I2CWrite(card, card->i2c_addr, CS_DAC, val|0x03); + card->svhs = 1; + } + } else { + if (!card->svhs){ + I2CWrite(card, card->i2c_addr, CS_DAC, val|0x30); + card->svhs = 1; + } + } + +} + +void set_composite(struct cvdv_cards *card, int onoff) +{ + uint8_t val; + + val = I2CRead(card, card->i2c_addr, CS_DAC)&0x0f; + MDEBUG(1, ": --composite val 0x%02x\n",val); + + + if (onoff){ + if (!card->composite){ + I2CWrite(card, card->i2c_addr, CS_DAC, val|0x84); + card->composite = 1; + } + } else { + if (!card->svhs){ + I2CWrite(card, card->i2c_addr, CS_DAC, val|0xE0); + card->composite = 1; + } + } + +} + + +int L64014Init(struct cvdv_cards *card) +{ + uint16_t testram[16]; + int i, err; + + MDEBUG(1, ": -- L64014Init\n"); + card->videomode = VIDEO_MODE; + + /* Reset 64020 */ + write_indexed_register(card, IIO_GPIO_CONTROL, 0x01); + l64020Reset(card); + /* init GPIO */ + write_indexed_register(card, IIO_GPIO_CONTROL, 0x01); + write_indexed_register(card, IIO_GPIO_PINS, 0xff); + + /* Set to PAL */ + write_indexed_register(card, IIO_VIDEO_CONTROL0, 0); + write_indexed_register(card, IIO_VIDEO_CONTROL1, VMS_PAL); + + /* Set Audio freq */ + write_indexed_register(card, IIO_OSC_AUD, 0x12); + + write_indexed_register(card, CSS_COMMAND, 0x01); + + + MDEBUG(0, "CSID: %02x\n", I2CRead(card, 0, 0x3d)); + card->i2c_addr = I2CRead(card, 0, 0x0f); + MDEBUG(0, "I2CADDR: %02x\n", card->i2c_addr); + + I2CWrite(card, card->i2c_addr, CS_CONTROL0, 0x4a); + I2CWrite(card, card->i2c_addr, CS_CONTROL1, 0x04); + I2CWrite(card, card->i2c_addr, CS_SC_AMP, 0x15); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH0, 0x96); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH1, 0x15); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH2, 0x13); + I2CWrite(card, card->i2c_addr, CS_SC_SYNTH3, 0x54); + +// I2CWrite(card, card->i2c_addr, CS_DAC, 0x87); + if (svhs) set_svhs(card, 1); + if (composite) set_composite(card, 1); + I2CWrite(card, card->i2c_addr, CS_BKG_COL, 0x03); + + MDEBUG(0,"Decoder Status: %d\n", read_lsi_status(card)); + MDEBUG(0,"lsi stat %d\n", DecoderReadByte(card, 0x005)); + + if (use_zv) ZV_init(card); + L64021Init(card); + + // Find out how much DRAM we have + card->DRAMSize = 0x00100000; // maximum size + do { + MDEBUG(0, + ": Probing DRAM Size: 0x%08X (%d kByte) ... ", + card->DRAMSize, card->DRAMSize / 512); + for (i = 0; i < 8; i++) + testram[i] = rnd(0x100) | (rnd(0x100) << 8); + if (DRAMWriteWord(card, 0, 4, &testram[0], 0)) + MDEBUG(0, ": DRAM Write error.\n"); + if (DRAMWriteWord + (card, card->DRAMSize - 4, 4, &testram[4], + 0)) MDEBUG(0, + ": DRAM Write error.\n"); + if (DRAMReadWord(card, 0, 4, &testram[8], 0)) + MDEBUG(0, ": DRAM Read error.\n"); + if (DRAMReadWord + (card, card->DRAMSize - 4, 4, &testram[12], + 0)) MDEBUG(0, ": DRAM Read error.\n"); + err = 0; + for (i = 0; (!err) && (i < 8); i++) + if (testram[i] != testram[i + 8]) + err = i + 1; + if (err) { + MDEBUG(0," failed\n"); + } else { + MDEBUG(0," ok\n"); + } + if (err) + MDEBUG(2,": DRAM compare error at cell %d: 0x%04X %04X %04X %04X->0x%04X %04X %04X %04X / 0x%04X %04X %04X %04X->0x%04X %04X %04X %04X\n", + err, testram[0], testram[1], testram[2], + testram[3], testram[8], testram[9], + testram[10], testram[11], testram[4], + testram[5], testram[6], testram[7], + testram[12], testram[13], testram[14], + testram[15]); + if (err) + card->DRAMSize >>= 1; + } while (err && (card->DRAMSize >= 0x00100000)); + printk(KERN_INFO LOGNAME ": DRAM Size: 0x%08X (%d kByte)\n", + card->DRAMSize, card->DRAMSize / 512); + if (card->DRAMSize < 0x00100000) { // minimum size + printk(KERN_INFO LOGNAME + ": DRAM ERROR: Not enough memory on card!\n"); + return 1; + } + return 0; +} + + +void CardDeInit(struct cvdv_cards *card) +{ + CloseCard(card); + MargiFlush(card); + MargiFreeBuffers(card); + + L64014RemoveIntr(card); + card_init(card, 0); +} + + +static u_char read_lsi_status(struct cvdv_cards *card) +{ + margi_info_t *margi = (margi_info_t *) card->margi; + return (inb(margi->link.io.BasePort1 + DIO_LSI_STATUS) & 15); + +} + +/*====================================================================*/ + +static void cs_error(client_handle_t handle, int func, int ret) +{ + error_info_t err = { func, ret }; + CardServices(ReportError, handle, &err); +} + +/*====================================================================== + + margi_attach() creates an "instance" of the driver, allocating + local data structures for one device. The device is registered + with Card Services. + + The dev_link structure is initialized, but we don't actually + configure the card at this point -- we wait until we receive a + card insertion event. + +======================================================================*/ + +static dev_link_t *margi_attach(void) +{ + margi_info_t *local; + dev_link_t *link; + client_reg_t client_reg; + int ret, i; + + MDEBUG(0, "margi_attach()\n"); + + for (i = 0; i < MAX_DEV; i++) + if (dev_table[i] == NULL) + break; + if (i == MAX_DEV) { + printk(KERN_NOTICE "margi_cs: no devices available\n"); + return NULL; + } + + /* Allocate space for private device-specific data */ + local = kmalloc(sizeof(margi_info_t), GFP_KERNEL); + if (!local) + return NULL; + memset(local, 0, sizeof(margi_info_t)); + link = &local->link; + link->priv = local; + local->card.margi = (void *) local; + dev_table[i] = link; + + /* Initialize the dev_link_t structure */ + link->release.function = &margi_release; + link->release.data = (u_long) link; + + /* Interrupt setup */ + link->irq.Attributes = IRQ_TYPE_EXCLUSIVE; + link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; + if (irq_list[0] == -1) + link->irq.IRQInfo2 = irq_mask; + else + for (i = 0; i < 4; i++) + link->irq.IRQInfo2 |= 1 << irq_list[i]; + link->irq.Handler = NULL; + + /* + General socket configuration defaults can go here. In this + client, we assume very little, and rely on the CIS for almost + everything. In most clients, many details (i.e., number, sizes, + and attributes of IO windows) are fixed by the nature of the + device, and can be hard-wired here. + */ + link->conf.Attributes = 0; + link->conf.Vcc = 50; + + if(use_zv==0) + link->conf.IntType = INT_MEMORY_AND_IO; + else + link->conf.IntType = INT_ZOOMED_VIDEO; + + /* Register with Card Services */ + link->next = dev_list; + dev_list = link; + client_reg.dev_info = &dev_info; + client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE; + client_reg.EventMask = + CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL | + CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET | + CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME; + client_reg.event_handler = &margi_event; + client_reg.Version = 0x0210; + client_reg.event_callback_args.client_data = link; + ret = CardServices(RegisterClient, &link->handle, &client_reg); + if (ret != CS_SUCCESS) { + cs_error(link->handle, RegisterClient, ret); + margi_detach(link); + return NULL; + } + + return link; +} /* margi_attach */ + +/*====================================================================== + + This deletes a driver "instance". The device is de-registered + with Card Services. If it has been released, all local data + structures are freed. Otherwise, the structures will be freed + when the device is released. + +======================================================================*/ + +static void margi_detach(dev_link_t * link) +{ + dev_link_t **linkp; + + int nd; + + MDEBUG(0, "margi_detach(0x%p)\n", link); + + for (nd = 0; nd < MAX_DEV; nd++) + if (dev_table[nd] == link) + break; + if (nd == MAX_DEV) + return; + + /* Locate device structure */ + for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next) + if (*linkp == link) + break; + if (*linkp == NULL) + return; + + /* + If the device is currently configured and active, we won't + actually delete it yet. Instead, it is marked so that when + the release() function is called, that will trigger a proper + detach(). + */ + if (link->state & DEV_CONFIG) { + MDEBUG(2, "margi_cs: detach postponed, '%s' " + "still locked\n", link->dev->dev_name); + link->state |= DEV_STALE_LINK; + return; + } + + /* Break the link with Card Services */ + if (link->handle) + CardServices(DeregisterClient, link->handle); + + /* Unlink device structure, and free it */ + *linkp = link->next; + /* This points to the parent struct cvdv_cards struct */ + dev_table[nd] = NULL; + + kfree(link->priv); + +} /* margi_detach */ + +/*====================================================================== + + margi_config() is scheduled to run after a CARD_INSERTION event + is received, to configure the PCMCIA socket, and to make the + device available to the system. + +======================================================================*/ + +#define CS_CHECK(fn, args...) \ +while ((last_ret=CardServices(last_fn=(fn),args))!=0) goto cs_failed + +#define CFG_CHECK(fn, args...) \ +if (CardServices(fn, args) != 0) goto next_entry + +static void margi_config(dev_link_t * link) +{ + client_handle_t handle = link->handle; + margi_info_t *dev = link->priv; + struct cvdv_cards *card = &(dev->card); + tuple_t tuple; + cisparse_t parse; + int last_fn, last_ret, i; + u_char buf[64]; + config_info_t conf; + win_req_t req; + memreq_t map; + int minor = 0; + + MDEBUG(0, "margi_config(0x%p)\n", link); + + /* + This reads the card's CONFIG tuple to find its configuration + registers. + */ + tuple.DesiredTuple = CISTPL_CONFIG; + tuple.Attributes = 0; + tuple.TupleData = buf; + tuple.TupleDataMax = sizeof(buf); + tuple.TupleOffset = 0; + CS_CHECK(GetFirstTuple, handle, &tuple); + CS_CHECK(GetTupleData, handle, &tuple); + CS_CHECK(ParseTuple, handle, &tuple, &parse); + link->conf.ConfigBase = parse.config.base; + link->conf.Present = parse.config.rmask[0]; + + /* Configure card */ + link->state |= DEV_CONFIG; + + /* Look up the current Vcc */ + CS_CHECK(GetConfigurationInfo, handle, &conf); + link->conf.Vcc = conf.Vcc; + + /* + In this loop, we scan the CIS for configuration table entries, + each of which describes a valid card configuration, including + voltage, IO window, memory window, and interrupt settings. + + We make no assumptions about the card to be configured: we use + just the information available in the CIS. In an ideal world, + this would work for any PCMCIA card, but it requires a complete + and accurate CIS. In practice, a driver usually "knows" most of + these things without consulting the CIS, and most client drivers + will only use the CIS to fill in implementation-defined details. + */ + tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; + CS_CHECK(GetFirstTuple, handle, &tuple); + while (1) { + cistpl_cftable_entry_t dflt = { 0 }; + cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); + CFG_CHECK(GetTupleData, handle, &tuple); + CFG_CHECK(ParseTuple, handle, &tuple, &parse); + + if (cfg->flags & CISTPL_CFTABLE_DEFAULT) + dflt = *cfg; + if (cfg->index == 0) + goto next_entry; + link->conf.ConfigIndex = cfg->index; + + /* Does this card need audio output? */ + if (cfg->flags & CISTPL_CFTABLE_AUDIO) { + link->conf.Attributes |= CONF_ENABLE_SPKR; + link->conf.Status = CCSR_AUDIO_ENA; + } + + /* Use power settings for Vcc and Vpp if present */ + /* Note that the CIS values need to be rescaled */ + if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { + if (conf.Vcc != + cfg->vcc.param[CISTPL_POWER_VNOM] / + 10000) goto next_entry; + } else if (dflt.vcc.present & (1 << CISTPL_POWER_VNOM)) { + if (conf.Vcc != + dflt.vcc.param[CISTPL_POWER_VNOM] / + 10000) goto next_entry; + } + + if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) + link->conf.Vpp1 = link->conf.Vpp2 = + cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; + else if (dflt.vpp1.present & (1 << CISTPL_POWER_VNOM)) + link->conf.Vpp1 = link->conf.Vpp2 = + dflt.vpp1.param[CISTPL_POWER_VNOM] / 10000; + + /* + Allocate an interrupt line. Note that this does not assign a + handler to the interrupt, unless the 'Handler' member of the + irq structure is initialized. + */ +#ifndef NOINT + link->irq.Attributes = + IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; + link->irq.Handler = &L64014Intr; + link->irq.Instance = link; + link->conf.Attributes |= CONF_ENABLE_IRQ; +#ifdef USE_BH + init_bh(MARGI_BH, do_margi_bh); +#endif + if (link->conf.Attributes & CONF_ENABLE_IRQ) + CS_CHECK(RequestIRQ, link->handle, &link->irq); +#endif + + /* IO window settings */ + link->io.NumPorts1 = link->io.NumPorts2 = 0; + if ((cfg->io.nwin > 0) || (dflt.io.nwin > 0)) { + cistpl_io_t *io = + (cfg->io.nwin) ? &cfg->io : &dflt.io; + link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; + if (!(io->flags & CISTPL_IO_8BIT)) + link->io.Attributes1 = + IO_DATA_PATH_WIDTH_16; + if (!(io->flags & CISTPL_IO_16BIT)) + link->io.Attributes1 = + IO_DATA_PATH_WIDTH_8; + link->io.IOAddrLines = + io->flags & CISTPL_IO_LINES_MASK; + link->io.BasePort1 = io->win[0].base; + link->io.NumPorts1 = io->win[0].len; + if (io->nwin > 1) { + link->io.Attributes2 = + link->io.Attributes1; + link->io.BasePort2 = io->win[1].base; + link->io.NumPorts2 = io->win[1].len; + } + } + + /* This reserves IO space but doesn't actually enable it */ + CFG_CHECK(RequestIO, link->handle, &link->io); + + /* + Now set up a common memory window, if needed. There is room + in the dev_link_t structure for one memory window handle, + but if the base addresses need to be saved, or if multiple + windows are needed, the info should go in the private data + structure for this device. + + Note that the memory window base is a physical address, and + needs to be mapped to virtual space with ioremap() before it + is used. + */ + if ((cfg->mem.nwin > 0) || (dflt.mem.nwin > 0)) { + cistpl_mem_t *mem = + (cfg->mem.nwin) ? &cfg->mem : &dflt.mem; + req.Attributes = + WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM; + req.Attributes |= WIN_ENABLE; + req.Base = mem->win[0].host_addr; + req.Size = mem->win[0].len; + req.AccessSpeed = 0; + link->win = (window_handle_t) link->handle; + CFG_CHECK(RequestWindow, &link->win, &req); + map.Page = 0; + map.CardOffset = mem->win[0].card_addr; + CFG_CHECK(MapMemPage, link->win, &map); + } + /* If we got this far, we're cool! */ + break; + + next_entry: + CS_CHECK(GetNextTuple, handle, &tuple); + } + + /* + This actually configures the PCMCIA socket -- setting up + the I/O windows and the interrupt mapping, and putting the + card and host interface into "Memory and IO" mode. + */ + CS_CHECK(RequestConfiguration, link->handle, &link->conf); + + /* + We can release the IO port allocations here, if some other + driver for the card is going to loaded, and will expect the + ports to be available. + */ + if (free_ports) { + if (link->io.BasePort1) + release_region(link->io.BasePort1, + link->io.NumPorts1); + if (link->io.BasePort2) + release_region(link->io.BasePort2, + link->io.NumPorts2); + } + + /* + At this point, the dev_node_t structure(s) need to be + initialized and arranged in a linked list at link->dev. + */ + + first_card = card; + minor=0; + card->next = NULL; + card_init(card, minor); + if ((i = register_chrdev(CVDV_MAJOR, CVDV_PROCNAME, &cvdv_fileops)) + >= 0) { + major_device_number = ((i) ? i : CVDV_MAJOR); + printk(KERN_INFO LOGNAME + ": Char-device with major number %d installed\n", + major_device_number); + } else { + printk(KERN_ERR LOGNAME + ": ERROR: Failed to install Char-device %d, error %d\n", + CVDV_MAJOR, i); + } + + + sprintf(dev->node.dev_name, "margi"); + dev->node.major = major_device_number; + dev->node.minor = minor; + link->dev = &dev->node; +#ifdef DVB + dvb_register(card); +#endif + /* Finally, report what we've done */ + printk(KERN_INFO "%s: index 0x%02x: Vcc %d.%d", + dev->node.dev_name, link->conf.ConfigIndex, + link->conf.Vcc / 10, link->conf.Vcc % 10); + if (link->conf.Vpp1) + printk(", Vpp %d.%d", link->conf.Vpp1 / 10, + link->conf.Vpp1 % 10); + if (link->conf.Attributes & CONF_ENABLE_IRQ) + printk(", irq %d", link->irq.AssignedIRQ); + if (link->io.NumPorts1) + printk(", io 0x%04x-0x%04x", link->io.BasePort1, + link->io.BasePort1 + link->io.NumPorts1 - 1); + if (link->io.NumPorts2) + printk(" & 0x%04x-0x%04x", link->io.BasePort2, + link->io.BasePort2 + link->io.NumPorts2 - 1); + if (link->win) + printk(", mem 0x%06lx-0x%06lx", req.Base, + req.Base + req.Size - 1); + printk("\n"); + + link->state &= ~DEV_CONFIG_PENDING; + if (0xdd == read_indexed_register(card, IIO_ID)) { + printk("L64014 Version %d in mode %d detected\n", + (read_indexed_register(card, IIO_MODE) & 248) >> 3, + read_indexed_register(card, IIO_MODE) & 7); + write_indexed_register(card, IIO_GPIO_CONTROL, 0x07); + + L64014Init(card); + + // default: color bars + VideoSetBackground(card, 1, 0, 0, 0); // black + SetVideoSystem(card); + minorlist[minor] = card; // fast access for the char driver + + + /*enable L64014 IRQ */ + write_indexed_register(card, IIO_IRQ_CONTROL, + IRQ_POL | IRQ_EN | VSYNC_EN); +// write_indexed_register(card, IIO_IRQ_CONTROL, 0x24); + + OSDOpen(card, 50, 50, 150, 150, 2, 1); + OSDTest(card); + } + return; + + cs_failed: + cs_error(link->handle, last_fn, last_ret); + margi_release((u_long) link); + +} /* margi_config */ + +/*====================================================================== + + After a card is removed, margi_release() will unregister the + device, and release the PCMCIA configuration. If the device is + still open, this will be postponed until it is closed. + +======================================================================*/ + +static void margi_release(u_long arg) +{ + dev_link_t *link = (dev_link_t *) arg; + margi_info_t *dev = link->priv; + struct cvdv_cards *card = &(dev->card); + + MDEBUG(0, "margi_release(0x%p)\n", link); + /* + If the device is currently in use, we won't release until it + is actually closed, because until then, we can't be sure that + no one will try to access the device or its data structures. + */ + if (link->open) { + MDEBUG(1, "margi_cs: release postponed, '%s' still open\n", + link->dev->dev_name); + link->state |= DEV_STALE_CONFIG; + return; + } + + /* Unlink the device chain */ + link->dev = NULL; + + /* + In a normal driver, additional code may be needed to release + other kernel data structures associated with this device. + */ + + MDEBUG(1,": Unloading device driver\n"); + if (major_device_number) + unregister_chrdev(major_device_number, CVDV_PROCNAME); + CardDeInit(card); + +#ifndef NOINT +#ifdef USE_BH + remove_bh(MARGI_BH); +#endif + mdelay(100); +#endif + CloseCard(card); +#ifdef DVB + dvb_unregister(card); +#endif + /* Don't bother checking to see if these succeed or not */ + if (link->win) + CardServices(ReleaseWindow, link->win); + CardServices(ReleaseConfiguration, link->handle); + if (link->io.NumPorts1) + CardServices(ReleaseIO, link->handle, &link->io); +#ifndef NOINT + if (link->irq.AssignedIRQ) + CardServices(ReleaseIRQ, link->handle, &link->irq); +#endif + link->state &= ~DEV_CONFIG; + + if (link->state & DEV_STALE_LINK) + margi_detach(link); + +} /* margi_release */ + +/*====================================================================== + + The card status event handler. Mostly, this schedules other + stuff to run after an event is received. + + When a CARD_REMOVAL event is received, we immediately set a + private flag to block future accesses to this device. All the + functions that actually access the device should check this flag + to make sure the card is still present. + +======================================================================*/ + +static int margi_event(event_t event, int priority, + event_callback_args_t * args) +{ + dev_link_t *link = args->client_data; + margi_info_t *dev = link->priv; + + MDEBUG(1, "margi_event(0x%06x)\n", event); + + switch (event) { + case CS_EVENT_CARD_REMOVAL: + link->state &= ~DEV_PRESENT; + if (link->state & DEV_CONFIG) { + ((margi_info_t *) link->priv)->stop = 1; + link->release.expires = jiffies + HZ / 20; + add_timer(&link->release); + } + break; + case CS_EVENT_CARD_INSERTION: + link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; + dev->card.bus = args->bus; + margi_config(link); + break; + case CS_EVENT_PM_SUSPEND: + link->state |= DEV_SUSPEND; + /* Fall through... */ + case CS_EVENT_RESET_PHYSICAL: + /* Mark the device as stopped, to block IO until later */ + dev->stop = 1; + if (link->state & DEV_CONFIG) + CardServices(ReleaseConfiguration, link->handle); + break; + case CS_EVENT_PM_RESUME: + link->state &= ~DEV_SUSPEND; + /* Fall through... */ + case CS_EVENT_CARD_RESET: + if (link->state & DEV_CONFIG) + CardServices(RequestConfiguration, link->handle, + &link->conf); + dev->stop = 0; + /* + In a normal driver, additional code may go here to restore + the device state and restart IO. + */ + break; + } + return 0; +} /* margi_event */ + +/*====================================================================*/ + +static int __init init_margi_cs(void) +{ + servinfo_t serv; + MDEBUG(0, "%s\n", version); + CardServices(GetCardServicesInfo, &serv); + if (serv.Revision != CS_RELEASE_CODE) { + printk(KERN_NOTICE "margi_cs: Card Services release " + "does not match!\n"); + return -1; + } + register_pccard_driver(&dev_info, &margi_attach, &margi_detach); + return 0; +} + +static void __exit exit_margi_cs(void) +{ + MDEBUG(0, "margi_cs: unloading\n"); + unregister_pccard_driver(&dev_info); + while (dev_list != NULL) { + if (dev_list->state & DEV_CONFIG) + margi_release((u_long) dev_list); + margi_detach(dev_list); + } +} + +module_init(init_margi_cs); +module_exit(exit_margi_cs); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/margi.conf linux.20pre5-ac2/drivers/media/video/margi/margi.conf --- linux.20pre5/drivers/media/video/margi/margi.conf 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/margi.conf 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,9 @@ +device "margi_cs" + class "margi" module "margi_cs" + +# Margi +card "MARGI-Billionton" +manfid 0x01d8, 0x1000 +bind "margi_cs" + + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/margi_cs.4 linux.20pre5-ac2/drivers/media/video/margi/margi_cs.4 --- linux.20pre5/drivers/media/video/margi/margi_cs.4 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/margi_cs.4 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,34 @@ +.\" Copyright (c) 1997,1998,1999 Koji OKAMURA +.\" +.TH ISCC_CS 4 "1997/09/28" "" +.SH NAME +iscc_cs \- IBM Smart Capture Card device driver +.SH SYNOPSIS +.B insmod iscc_cs.o +.RB [ pc_debug=n ] +.RB [ mem_speed=n ] +.SH DESCRIPTION +.B Iscc_cs +is the low-level Card Services driver for the IBM Smart Capture Card +PCMCIA Video Capture adapter. When this driver is attached to a card, it +allocates the next available Video Capture Card device +.RB ( iscc0 .. iscc# ). +This +device name will be reported in the kernel log file, and passed on to +.BR cardmgr (8). +.SH PARAMETERS +.TP +.B pc_debug=n +Selects the PCMCIA debugging level. This parameter is only available +if the module is compiled with debugging enabled. A non-zero value +enables debugging. +.TP +.B mem_speed=n +Sets the access speed of the shared memory window, in nanoseconds. +The default is 0 (i.e., no extra wait states). Values of up to 1000 +are legal. +.SH AUTHOR +Koji OKAMURA \- Kyushu University + +.SH "SEE ALSO" +cardmgr(8), pcmcia(5). diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/margi_cs.mk linux.20pre5-ac2/drivers/media/video/margi/margi_cs.mk --- linux.20pre5/drivers/media/video/margi/margi_cs.mk 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/margi_cs.mk 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,113 @@ +# +# Makefile for margi_cs +# Marcus Metzler +# + +include ../config.mk + +CC = $(KCC) $(AFLAGS) $(KFLAGS) + +CFLAGS += -g -O2 -Wall -Wstrict-prototypes -pipe -Wall -D__DVB_PACK__ -DUSE_OSD -DNOINT -DDVB -DUSE_ZV + +CPPFLAGS += $(PCDEBUG) -D__KERNEL__ -DMODULE -DMODVERSIONS -I../include \ + -I$(LINUX)/include -I$(LINUX) -Iinclude + +CC_MODULE = $(CC) -c $(CFLAGS) $(CPPFLAGS) + +ETC = $(PREFIX)/etc/pcmcia +MANDIR = $(PREFIX)/usr/man +MX_OBJS = dmxdev.o dvb_demux.o dvbdev.o + +all: margi_cs.o $(MX_OBJS) + +install-modules: $(MODULES) $(MX_OBJS) + mkdir -p $(PREFIX)/$(MODDIR)/pcmcia + cp $(MODULES) $(PREFIX)/$(MODDIR)/pcmcia + su -c "mkdir -p $(MODDIR)/misc; cp -v $(MX_OBJS) $(MX_OBJS) $(MODDIR)/misc" + +install-clients: + for f in $(CLIENTS) ; do \ + [ -r $$f.conf ] && cp $$f.conf $(ETC)/$$f.conf ; \ + cmp -s $$f $(ETC)/$$f && continue ; \ + [ -r $(ETC)/$$f ] && mv $(ETC)/$$f $(ETC)/$$f.O ; \ + cp $$f $(ETC)/$$f ; \ + OPTS=$(ETC)/$$f.opts ; \ + test -r $$OPTS || cp $$f.opts $$OPTS ; \ + done + cp cvdvext.h cvdvtypes.h /usr/include/linux + mkdir -p /usr/include/ost/ + cp include/ost/*.h /usr/include/ost + rm -rf /dev/ost + makedev.napi + depmod -a + +install-man4: $(MAN4) + mkdir -p $(MANDIR)/man4 + cp $(MAN4) $(MANDIR)/man4 + + +MMODULES = margi.o cvdv.o cardbase.o i2c.o dram.o osd.o audio.o video.o streams.o decoder.o spu.o crc.o ringbuffy.o dvb_formats.o + +margi_cs.o: $(MMODULES) + $(LD) -r -o margi_cs.o $(MMODULES) + chmod -x margi_cs.o + + +margi.o: margi.h cardbase.h l64014.h l64021.h i2c.h decoder.h dram.h\ + video.h cvdv.h margi.c + $(CC_MODULE) margi.c + +cvdv.o: cvdv.c cvdv.h cardbase.h cvdvtypes.h l64021.h l64014.h dram.h\ + osd.h audio.h video.h streams.h decoder.h spu.h \ + crc.h + $(CC_MODULE) cvdv.c + +cardbase.o: cardbase.c cardbase.h cvdvtypes.h + $(CC_MODULE) cardbase.c + +i2c.o: i2c.c i2c.h cardbase.h cvdvtypes.h l64014.h + $(CC_MODULE) i2c.c + +dram.o: dram.c dram.h cardbase.h cvdvtypes.h l64021.h l64014.h + $(CC_MODULE) dram.c + +osd.o: osd.c osd.h cardbase.h cvdvtypes.h dram.h l64021.h l64014.h + $(CC_MODULE) osd.c + +audio.o: audio.c audio.h cardbase.h cvdvtypes.h l64021.h l64014.h + $(CC_MODULE) audio.c + +video.o: video.c video.h cardbase.h cvdvtypes.h dram.h l64021.h l64014.h + $(CC_MODULE) video.c + +streams.o: streams.c streams.h cardbase.h cvdvtypes.h dram.h l64021.h l64014.h \ +video.h dram.h audio.h + $(CC_MODULE) streams.c + +decoder.o: decoder.c decoder.h cardbase.h cvdvtypes.h dram.h l64021.h l64014.h \ +video.h dram.h audio.h streams.h i2c.h osd.h dram.h + $(CC_MODULE) decoder.c + +spu.o: spu.c spu.h cardbase.h cvdvtypes.h l64021.h l64014.h + $(CC_MODULE) spu.c + +crc.o: crc.c crc.h + $(CC_MODULE) crc.c + +ringbuffy.o: ringbuffy.h ringbuffy.c + $(CC_MODULE) ringbuffy.c + +dvb_formats.o: dvb_formats.h dvb_formats.c + $(CC_MODULE) dvb_formats.c + +dmxdev.o: dmxdev.h dvb_demux.h + $(CC_MODULE) -include $(LINUX)/include/linux/modversions.h dmxdev.c + +dvb_demux.o: dvb_demux.h dmxdev.h dvbdev.h + $(CC_MODULE) -include $(LINUX)/include/linux/modversions.h dvb_demux.c + +dvbdev.o: dvbdev.h + $(CC_MODULE) -include $(LINUX)/include/linux/modversions.h -DEXPORT_SYMTAB -c dvbdev.c + +clean: + rm -f core core.* *.o .*.o *.s *.a *~ .depend .depfiles/*.d diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/margi_cs.mk.MAIN linux.20pre5-ac2/drivers/media/video/margi/margi_cs.mk.MAIN --- linux.20pre5/drivers/media/video/margi/margi_cs.mk.MAIN 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/margi_cs.mk.MAIN 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,43 @@ +# +# Makefile for margi_cs +# Marcus Metzler +# + +VER = 0.5.0 + +FILES = margi_cs.mk margi2/margi_cs.mk \ + margi2/margi margi2/margi.opts margi2/margi.conf margi2/margi_cs.4\ + margi2/audio.c margi2/audio.h margi2/cardbase.c margi2/cardbase.h\ + margi2/crc.c margi2/crc.h margi2/cvdv.c\ + margi2/cvdv.h margi2/cvdvtypes.h margi2/decoder.c margi2/decoder.h\ + margi2/dram.c margi2/dram.h margi2/i2c.c margi2/i2c.h margi2/l64014.h\ + margi2/l64021.h margi2/margi.c margi2/margi.h margi2/video.c \ + margi2/video.h \ + margi2/osd.c margi2/osd.h margi2/spu.c margi2/spu.h margi2/streams.c\ + margi2/streams.h margi2/ringbuffy.c margi2/ringbuffy.h \ + margi2/README margi2/COPYING margi2/AUTHORS margi2/CHANGES\ + margi2/cvdvext.h\ + margi2/testsuite/Makefile margi2/testsuite/cvdvutil.c \ + margi2/testsuite/cvdvutil.h margi2/testsuite/osdtest.c \ + margi2/testsuite/osdwrap.c margi2/testsuite/osdwrap.h \ + margi2/testsuite/showpic.c margi2/testsuite/showpicmovie.c\ + margi2/testsuite/showstill.c margi2/testsuite/testpattern.c\ + margi2/testsuite/showstill.c margi2/testsuite/playfile.c\ + margi2/include/ost/audio.h margi2/include/ost/video.h \ + margi2/include/ost/ca.h margi2/include/ost/demux.h\ + margi2/include/ost/dmx.h margi2/include/ost/frontend.h\ + margi2/dvb_demux.h margi2/dvb_demux.c margi2/dvbdev.h margi2/dvbdev.c\ + margi2/include/ost/sec.h margi2/dmxdev.h margi2/dmxdev.c \ + margi2/include/ost/osd.h margi2/dvb_formats.h margi2/dvb_formats.c + +all: + $(MAKE) -C margi2 -f margi_cs.mk + +install: + $(MAKE) -C margi2 install-modules MODULES="margi_cs.o" -f margi_cs.mk + $(MAKE) -C margi2 install-clients CLIENTS=margi -f margi_cs.mk + $(MAKE) -C margi2 install-man4 MAN4=margi_cs.4 -f margi_cs.mk + +dist: + tar czvf margi_cs-$(VER).tar.gz $(FILES) + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/margi.h linux.20pre5-ac2/drivers/media/video/margi/margi.h --- linux.20pre5/drivers/media/video/margi/margi.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/margi.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,62 @@ +/* + margi.h + + Copyright (C) Marcus Metzler for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + +#ifndef margi_cs_h +#define margi_cs_h + +#include "cardbase.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define PBUFFER 100 + +u_char read_indexed_register(struct cvdv_cards *card, int addr); +void write_indexed_register(struct cvdv_cards *card, int addr, + u_char data); +void WriteByte(struct cvdv_cards *card, int addr, u_char data); +u_char ReadByte(struct cvdv_cards *card, int addr); +void MaskByte(struct cvdv_cards *card, int addr, u_char mask, u_char bits); +int MargiFreeBuffers(struct cvdv_cards *card); +int MargiSetBuffers(struct cvdv_cards *card, uint32_t size, int isB); +int MargiFlush (struct cvdv_cards *card); +int MargiPushA(struct cvdv_cards *card, int count, const char *data); +int MargiPushB(struct cvdv_cards *card, int count, const char *data); +int DecoderStartChannel(struct cvdv_cards *card); +int DecoderStopChannel(struct cvdv_cards *card); +void DACSetFrequency(struct cvdv_cards *card, int khz, int multiple); +stream_type get_stream_type(struct cvdv_cards *card); +audio_type get_audio_type(struct cvdv_cards *card); + +#ifdef NOINT +void Timerfunction(unsigned long data); +#endif + + +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/margi.opts linux.20pre5-ac2/drivers/media/video/margi/margi.opts --- linux.20pre5/drivers/media/video/margi/margi.opts 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/margi.opts 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,4 @@ +# +# Option for margi +# + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/osd.c linux.20pre5-ac2/drivers/media/video/margi/osd.c --- linux.20pre5/drivers/media/video/margi/osd.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/osd.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,947 @@ +/* + osd.c + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + + //////////////////////////////////////////////////////////////// + // // + // Functions to Draw on the On Screen Display of the L64021 // + // CLUT-Mode with 2, 4, or 8 bit per pixel, up to 720*576 // + // // +//////////////////////////////////////////////////////////////// +// OSD Pixel Aspect Ratio: +// CCIR601 525 Lines (NTSC,PAL-M): 11/10 (100*100 appears as 100*110) +// CCIR601 625 Lines (PAL): 11/12 (100*100 appears as 100*91.6) +// +// OSD functions for external use: +// int OSDOpen(struct cvdv_cards *card); +// int OSDClose(struct cvdv_cards *card); +// int OSDQuery(struct cvdv_cards *card, int *x0, int *y0, int *x1, int *y1, int *aspx, int *aspy); +// int OSDStartPicture(struct cvdv_cards *card, int left, int top, int width, int height, int bit, int mix); +// void OSDShow(struct cvdv_cards *card); +// void OSDHide(struct cvdv_cards *card); +// void OSDClear(struct cvdv_cards *card); +// void OSDFill(struct cvdv_cards *card, int col); +// int OSDSetColor(struct cvdv_cards *card, int num, int R, int G, int B, int mix, int trans); +// int OSDSetPixel(struct cvdv_cards *card, int x, int y, int col); +// int OSDGetPixel(struct cvdv_cards *card, int x, int y); +// int OSDSetRow(struct cvdv_cards *card, int x0, int y, int x1, u8 *data); +// int OSDFillRow(struct cvdv_cards *card, int x0, int y, int x1, int col); +// void OSDLine(struct cvdv_cards *card, int x0, int y0, int x1, int y1, int col); +// +// Return codes: (unless otherwise specified) +// 0: OK +// -1: Range error +// -2: OSD not open +// + +#define __NO_VERSION__ + +#include "osd.h" +#include "dram.h" +#include "l64021.h" + + // Builds a 4-word picture header in buf +// returns number of words in pixel field on success, -1 on error +int OSDHeader(u16 * buf, // 4 words + int *bit, // bit per pixel: 2, 4, or 8 + int *startrow, // position of our block, + int *stoprow, // row: 0..313 + int *startcol, // col: 0..864 + int *stopcol, // + int *mix, // opacity for mixed pixel, 0..15 (0%..94% resp.) + int nopal) +{ // 1: use previous palette + int count; + if (buf != NULL) { + if (*bit == 8) + *bit = 1; + else if (*bit == 2) + *bit = 0; + else + *bit = 2; + if (*startrow < 0) + *startrow = 0; + if (*startrow > 312) + *startrow = 312; + if (*stoprow <= *startrow) + *stoprow = *startrow + 1; + if (*stoprow > 313) + *stoprow = 313; + if (*startcol < 0) + *startcol = 0; + if (*startcol > 863) + *startcol = 863; + if (*stopcol <= *startcol) + *stopcol = *startcol + 2; + if (*stopcol > 864) + *stopcol = 864; + if ((*stopcol - *startcol + 1) & 1) + (*stopcol)--; + if (*mix < 0) + *mix = 0; + if (*mix > 15) + *mix = 15; + buf[0] = ((*bit << 14) & 0x8000) | (*startrow & 0x01FF); + buf[1] = + ((*mix << 12) & 0xF000) | ((*bit << 11) & 0x0800) | + ((nopal) ? 0x0400 : 0x0000) | (*stoprow & 0x01FF); + buf[2] = *startcol & 0x03FF; + buf[3] = *stopcol & 0x03FF; + count = + (*stoprow - *startrow + 1) * (*stopcol - *startcol + + 1); + if (*bit == 1) { + count = + ((count >> 3) + ((count & 0x07) ? 1 : 0)) << 2; + *bit = 8; + } else if (*bit == 0) { + count = + ((count >> 5) + ((count & 0x1F) ? 1 : 0)) << 2; + *bit = 2; + } else if (*bit == 2) { + count = + ((count >> 4) + ((count & 0x0F) ? 1 : 0)) << 2; + *bit = 4; + } + return count; // word count of pixel data + } else + return -1; +} + +// enables OSD mode +int OSDShow(struct cvdv_cards *card) +{ + if (card->OSD.open) { + DecoderMaskByte(card, 0x109, 0x03, 0x01); + DecoderDelByte(card, 0x112, 0x10); // no filter + return 0; + } else + return -2; +} + +// disables OSD mode +int OSDHide(struct cvdv_cards *card) +{ + if (card->OSD.open) { + DecoderMaskByte(card, 0x109, 0x03, 0x00); + return 0; + } else + return -2; +} + +// creates an empty picture in the memory of the card +// ONLY ONE PICTURE PER CARD! +// maximum sizes: NTSC: 720*525 PAL: 720*576 +// maximum positions: NTSC: 858*525 PAL: 864*625 +// returns 0 on success, -1 on DRAM allocation error +int OSDStartPicture(struct cvdv_cards *card, int left, int top, int width, + int height, int bit, int mix) +{ + u16 TermHeader[] = { 0x01FF, 0x05FF, 0x0000, 0x0000 }; + u16 header[4]; + int size, pixelsize, palsize, frametop, startrow, stoprow, + startcol, stopcol; + + if (card->OSD.open) + return -2; + if (top & 1) { + card->OSD.evenfirst = 0; + card->OSD.evenheight = height / 2; + card->OSD.oddheight = height - card->OSD.evenheight; + } else { + card->OSD.evenfirst = 1; + card->OSD.oddheight = height / 2; + card->OSD.evenheight = height - card->OSD.oddheight; + } + + // Setting the picture for the lines in the even field + frametop = top / 2; + startrow = frametop; + stoprow = frametop + card->OSD.evenheight - 1; + startcol = left; + stopcol = left + width - 1; + pixelsize = + OSDHeader(header, &bit, &startrow, &stoprow, &startcol, + &stopcol, &mix, 0); + card->OSD.evenheight = stoprow - startrow + 1; + card->OSD.bpp = bit; + if (bit == 8) + palsize = 256; + else if (bit == 2) + palsize = 4; + else + palsize = 16; + size = 8 + palsize + pixelsize; + card->OSD.evenmem = DRAMAlloc(card, size, 32); + if (card->OSD.evenmem == BLANK) + return -1; + card->OSD.evendata = card->OSD.evenmem; + card->OSD.evenpalette = card->OSD.evendata + 4; + card->OSD.evenbitmap = card->OSD.evenpalette + palsize; + card->OSD.eventerm = card->OSD.evenbitmap + pixelsize; + DecoderWriteWord(card, 0x110, (u16) (card->OSD.evendata >> 5)); + DRAMWriteWord(card, card->OSD.evendata, 4, header, 0); + DRAMFillByte(card, card->OSD.evenpalette, + (palsize + pixelsize) * 2, 0x00); + DRAMWriteWord(card, card->OSD.eventerm, 4, TermHeader, 0); + + // Setting the picture for the lines in the odd frame + frametop += card->OSD.evenfirst; + startrow = frametop; + stoprow = frametop + card->OSD.oddheight - 1; + pixelsize = + OSDHeader(header, &bit, &startrow, &stoprow, &startcol, + &stopcol, &mix, 0); + card->OSD.oddheight = stoprow - startrow + 1; + size = 8 + palsize + pixelsize; + card->OSD.oddmem = DRAMAlloc(card, size, 32); + if (card->OSD.oddmem == BLANK) + return -1; + card->OSD.odddata = card->OSD.oddmem; + card->OSD.oddpalette = card->OSD.odddata + 4; + card->OSD.oddbitmap = card->OSD.oddpalette + palsize; + card->OSD.oddterm = card->OSD.oddbitmap + pixelsize; + DecoderWriteWord(card, 0x10E, (u16) (card->OSD.odddata >> 5)); + DRAMWriteWord(card, card->OSD.odddata, 4, header, 0); + DRAMFillByte(card, card->OSD.oddpalette, (palsize + pixelsize) * 2, + 0x00); + DRAMWriteWord(card, card->OSD.oddterm, 4, TermHeader, 0); + + // Update of the picture dimensions + card->OSD.width = stopcol - startcol + 1; + card->OSD.height = card->OSD.evenheight + card->OSD.oddheight; + card->OSD.open = 1; + + MDEBUG(1,": OSD Open %dX%d, %d bit, mem 0x%08X/0x%08X\n", + card->OSD.width, card->OSD.height, card->OSD.bpp, + card->OSD.evendata, card->OSD.odddata); + return 0; +} + +// Disables OSD and releases the buffers +// returns 0 on success, 1 on "not open" +int OSDClose(struct cvdv_cards *card) +{ + if (card->OSD.open) { + OSDHide(card); + DRAMFree(card, card->OSD.evenmem); + DRAMFree(card, card->OSD.oddmem); + card->OSD.open = 0; + return 0; + } else + return -2; +} + +// Opens OSD with this size and bit depth +// returns 0 on success, 1 on DRAM allocation error, 2 on "already open" +int OSDOpen(struct cvdv_cards *card, int x0, int y0, int x1, int y1, + int bit, int mix) +{ + int ret; + if (card->OSD.open) + OSDClose(card); + if (bit < 0) + bit = 8; + else if (bit < 2) + bit = 2; + else if (bit < 4) + bit = 4; + else + bit = 8; + if (x0 < 0) + x0 = 0; + if (x1 < 0) + x1 = 720 - 1; + if (x1 < x0) + x1 = x0; + if (y0 < 0) + y0 = 0; + if (y1 < 0) + y1 = 576 - 1; + if (y1 < y0) + y1 = y0; + if ((x1 + 1) > 720) + x1 = 720 - 1; + if (x0 > x1) + x0 = x1; + if (CCIR601Lines(card->videomode) == 625) { // PAL + if ((y1 + 1) > 576) + y1 = 576 - 1; + if (y0 > y1) + y0 = y1; + if (! + (ret = + OSDStartPicture(card, 134 + x0, 48 + y0, x1 - x0 + 1, + y1 - y0 + 1, bit, mix))) + card->OSD.aspectratio = 12; // pixel aspect ratio 12/11 + } else { // NTSC + if ((y1 + 1) > 484) + y1 = 484 - 1; + if (y0 > y1) + y0 = y1; + if (! + (ret = + OSDStartPicture(card, 126 + x0, 44 + y0, x1 - x0 + 1, + y1 - y0 + 1, bit, mix))) + card->OSD.aspectratio = 10; // pixel aspect ratio 10/11 + } + return ret; +} + +// fills parameters with the picture dimensions and the pixel aspect ratio (aspy=11) +int OSDQuery(struct cvdv_cards *card, int *x0, int *y0, int *x1, int *y1, + int *aspx) +{ + if (!card->OSD.open) + return -2; + *x0 = 0; + *x1 = card->OSD.width - 1; + *y0 = 0; + *y1 = card->OSD.height - 1; + *aspx = card->OSD.aspectratio; + return 0; +} + +// Sets all pixel to color 0 +int OSDClear(struct cvdv_cards *card) +{ + if (!card->OSD.open) + return -2; + DRAMFillByte(card, card->OSD.oddbitmap, + (int) (card->OSD.oddterm - card->OSD.oddbitmap) * 2, + 0x00); + DRAMFillByte(card, card->OSD.evenbitmap, + (int) (card->OSD.eventerm - card->OSD.evenbitmap) * 2, + 0x00); + return 0; +} + +// Sets all pixel to color +int OSDFill(struct cvdv_cards *card, int col) +{ + u8 color; + if (!card->OSD.open) + return -2; + if (card->OSD.bpp == 8) { + color = col & 0xFF; + } else if (card->OSD.bpp == 4) { + color = (col & 0xF); + color |= (color << 4); + } else if (card->OSD.bpp == 2) { + color = (col & 0x03); + for (col = 1; col <= 3; col++) + color |= (color << 2); + } else + color = 0x00; + DRAMFillByte(card, card->OSD.oddbitmap, + (int) (card->OSD.oddterm - card->OSD.oddbitmap) * 2, + color); + DRAMFillByte(card, card->OSD.evenbitmap, + (int) (card->OSD.eventerm - card->OSD.evenbitmap) * 2, + color); + return 0; +} + +// converts RGB(8 bit) to YCrCb(OSD format) +// mix: 0=opacity 100% 1=opacity at mix value +// trans: 0=mix bit applies 1=opacity 0% +// returns word in OSD palette format +u16 OSDColor(u8 R, u8 G, u8 B, int mix, int trans) +{ + u16 Y, Cr, Cb; + Y = R * 77 + G * 150 + B * 29; // Luma=0.299R+0.587G+0.114B 0..65535 + Cb = 2048 + B * 8 - (Y >> 5); // Cr 0..4095 + Cr = 2048 + R * 10 - (Y >> 5); // Cb 0..4095 + return ((trans) ? 0 : // transparent pixel + (Y & 0xFC00) | // Luma 0..63 + ((mix) ? 0x0100 : 0x0000) | // Opacity applies + ((Cb >> 4) & 0x00F0) | // Cb 0..15 + ((Cr >> 8) & 0x000F) // Cr 0..15 + ); +} + +// set palette entry to , and apply +// R,G,B: 0..255 +// RGB=1: R=Red, G=Green, B=Blue RGB=0: R=Y G=Cb B=Cr +// mix=0, trans=0: pixel opacity 100% (only OSD pixel shows) +// mix=1, trans=0: pixel opacity as specified in header +// trans=1: pixel opacity 0% (only video pixel shows) +// returns 0 on success, 1 on error +int OSDSetColor(struct cvdv_cards *card, int num, int R, int G, int B, + int YUV, int mix, int trans) +{ + u16 burst[4]; // minimal memory unit + u32 addr; + u16 color; + if (!card->OSD.open) + return -2; + if (R < 0) + R = 0; + if (R > 255) + R = 255; + if (G < 0) + G = 0; + if (G > 255) + G = 255; + if (B < 0) + B = 0; + if (B > 255) + B = 255; + if ((num >= 0) && (num < (1 << card->OSD.bpp))) { + if (num==0) MDEBUG(4,"OSD SetColor num=%d, R=%d, G=%d, B=%d, YUV=%d, mix=%d, trans=%d\n", + num,R,G,B,YUV,mix,trans); + color = ((YUV) + ? ((trans) ? 0 : ((R << 8) & 0xFC00) | + ((mix) ? 0x0100 : 0x0000) | (G & 0x00F0) | + ((B >> 4) & 0x000F)) : OSDColor(R, G, B, mix, + trans)); + + addr = card->OSD.oddpalette + num; + DRAMReadWord(card, addr & ~3, 4, burst, 0); + burst[addr & 3] = color; + DRAMWriteWord(card, addr & ~3, 4, burst, 0); + + addr = card->OSD.evenpalette + num; + DRAMReadWord(card, addr & ~3, 4, burst, 0); + burst[addr & 3] = color; + DRAMWriteWord(card, addr & ~3, 4, burst, 0); + + return 0; + } else + return -1; +} + +// Set a number of entries in the palette +// sets the entries "firstcolor" through "lastcolor" from the array "data" +// data has 4 byte for each color: +// R,G,B, and a transparency value: 0->tranparent, 1..254->mix, 255->no mix +int OSDSetPalette(struct cvdv_cards *card, int firstcolor, int lastcolor, + u8 * data) +{ + u16 burst[4]; // minimal memory unit + u32 addr; + u16 color; + int num, i = 0; + if (!card->OSD.open) + return -2; + for (num = firstcolor; num <= lastcolor; num++) + if ((num >= 0) && (num < (1 << card->OSD.bpp))) { + color = + OSDColor(data[i], data[i + 1], data[i + 2], + ((data[i + 3] < 255) ? 1 : 0), + ((data[i + 3] == 0) ? 1 : 0)); + i += 4; + + addr = card->OSD.oddpalette + num; + DRAMReadWord(card, addr & ~3, 4, burst, 0); + burst[addr & 3] = color; + DRAMWriteWord(card, addr & ~3, 4, burst, 0); + + addr = card->OSD.evenpalette + num; + DRAMReadWord(card, addr & ~3, 4, burst, 0); + burst[addr & 3] = color; + DRAMWriteWord(card, addr & ~3, 4, burst, 0); + } + return 0; +} + +// Sets transparency of mixed pixel (0..15) +int OSDSetTrans(struct cvdv_cards *card, int trans) +{ + u16 burst[4]; // minimal memory unit + if (!card->OSD.open) + return -2; + trans &= 0x000F; + DRAMReadWord(card, card->OSD.evendata, 4, burst, 0); + burst[1] = (burst[1] & 0x0FFF) | (trans << 12); + DRAMWriteWord(card, card->OSD.evendata, 4, burst, 0); + + DRAMReadWord(card, card->OSD.odddata, 4, burst, 0); + burst[1] = (burst[1] & 0x0FFF) | (trans << 12); + DRAMWriteWord(card, card->OSD.odddata, 4, burst, 0); + return 0; +} + +// sets pixel , to color number +// returns 0 on success, 1 on error +int OSDSetPixel(struct cvdv_cards *card, int x, int y, int col) +{ + u16 burst[4]; // minimal memory unit od DRAM + u32 addr; + int offset, ppw, pos, shift, height, posmask; + u16 mask; + + if (!card->OSD.open) + return -2; + if ((y & 1) == card->OSD.evenfirst) { // even or odd frame? + addr = card->OSD.oddbitmap; + height = card->OSD.oddheight; + } else { + addr = card->OSD.evenbitmap; + height = card->OSD.evenheight; + } + y >>= 1; + if ((x >= 0) && (x < card->OSD.width) && (y >= 0) && (y < height)) { // clipping + ppw = + ((card->OSD.bpp == 4) ? 2 : ((card->OSD.bpp == 8) ? 1 : 3)); // OK, 4-(ln(bpp)/ln(2)) would have worked, too... + pos = x + y * card->OSD.width; // pixel number in bitfield + addr += (pos >> ppw); // 21 bit address of word with our pixel + offset = addr & 3; // offset in burst + addr &= ~3; // 21 bit burst address + posmask = (1 << ppw) - 1; // mask for position inside word + shift = ((posmask - (pos & posmask)) << (4 - ppw)); // pixel shift inside word + mask = (1 << (1 << (4 - ppw))) - 1; // pixel mask + DRAMReadWord(card, addr, 4, burst, 0); // get the burst with our pixel... + burst[offset] = + (burst[offset] & ~(mask << shift)) | ((col & mask) << + shift); + DRAMWriteWord(card, addr, 4, burst, 0); // ...and write it back + return 0; + } else + return -1; +} + +// returns color number of pixel ,, or -1 +int OSDGetPixel(struct cvdv_cards *card, int x, int y) +{ + u16 burst[4]; // minimal memory unit + u32 addr; + int offset, ppw, pos, shift, height, posmask; + u16 mask; + + if (!card->OSD.open) + return -2; + if ((y & 1) == card->OSD.evenfirst) { // even or odd frame? + addr = card->OSD.oddbitmap; + height = card->OSD.oddheight; + } else { + addr = card->OSD.evenbitmap; + height = card->OSD.evenheight; + } + y >>= 1; + if ((x >= 0) && (x < card->OSD.width) && (y >= 0) && (y < height)) { // clipping + ppw = + ((card->OSD.bpp == 4) ? 2 : ((card->OSD.bpp == 8) ? 1 : 3)); // OK, 4-(ln(bpp)/ln(2)) would have worked, too... + pos = x + y * card->OSD.width; // pixel number in bitfield + addr += (pos >> ppw); // 21 bit address of word with our pixel + offset = addr & 3; // offset in burst + addr &= ~3; // 21 bit burst address + posmask = (1 << ppw) - 1; // mask for position inside word + shift = ((posmask - (pos & posmask)) << (4 - ppw)); // pixel shift inside word + mask = (1 << (1 << (4 - ppw))) - 1; // pixel mask + DRAMReadWord(card, addr, 4, burst, 0); // get the burst with our pixel... + return (burst[offset] >> shift) & mask; // ...and return it's value + } else + return -1; +} + +// fills pixels x0,y through x1,y with the content of data[] +// returns 0 on success, -1 on clipping all pixel +int OSDSetRow(struct cvdv_cards *card, int x0, int y, int x1, u8 * data) +{ + u16 burst[4]; // minimal memory unit + u32 addr, addr1, bitmap; + int offset, offset1, ppw, pos, pos1, shift, shift0, shift1, + shiftstep, height, bpp, x, i, endburst, endword; + u16 mask, posmask; + + if (!card->OSD.open) + return -2; + if ((y & 1) == card->OSD.evenfirst) { + bitmap = card->OSD.oddbitmap; + height = card->OSD.oddheight; + } else { + bitmap = card->OSD.evenbitmap; + height = card->OSD.evenheight; + } + y >>= 1; + if ((y >= 0) && (y < height)) { + i = 0; + if (x0 > x1) { + x = x1; + x1 = x0; + x0 = x; + } + if ((x0 >= card->OSD.width) || (x1 < 0)) + return -1; + if (x0 < 0) { + i -= x0; + x0 = 0; + } + if (x1 >= card->OSD.width) + x1 = card->OSD.width - 1; + bpp = card->OSD.bpp; // bits per pixel + ppw = ((bpp == 4) ? 2 : ((bpp == 8) ? 1 : 3)); // positional parameter + mask = (1 << bpp) - 1; // mask for one pixel + posmask = (1 << ppw) - 1; // mask for position inside word + + pos = x0 + (y * card->OSD.width); // pixel number of first pixel + pos1 = pos + x1 - x0; // pixel number of last pixel + shift0 = ((posmask - (pos & posmask)) << (4 - ppw)); + shift1 = ((posmask - (pos1 & posmask)) << (4 - ppw)); + shiftstep = 1 << (4 - ppw); + + addr = bitmap + (pos >> ppw); // DRAM address of word with first pixel + addr1 = bitmap + (pos1 >> ppw); // " " " " " last " + offset = (int) (addr & 3); // word position inside burst + offset1 = (int) (addr1 & 3); // number of last word in the last burst + addr &= ~3; // burst address + addr1 &= ~3; // burst address of last pixel + + endburst = (addr1 != addr); // end in other burst + endword = (offset1 != offset); // end in other word + + // read old content of first burst if the row start after the beginning or + // end before the end of the first burst + if (offset || (pos & posmask) || + (!endburst + && ((offset1 != 3) + || ((pos1 & posmask) != posmask)))) { + DRAMReadWord(card, addr, 4, burst, 0); + } + // End beyond or at the end of this word? + if (endburst || endword || ((pos1 & posmask) == posmask)) { + // Fill first word + for (shift = shift0; shift >= 0; shift -= shiftstep) { // bit position inside word + burst[offset] = + (burst[offset] & ~(mask << shift)) | + ((data[i++] & mask) << shift); + } + if (endburst || endword) { // Any more words to fill? + shift0 = posmask << (4 - ppw); // from here on, we start at the beginning of each word + offset++; // fill the rest of the burst + if (endburst) { // end not in this burst? + while (offset <= 3) { // fill remaining words + burst[offset] = 0x0000; // clear first + for (shift = shift0; + shift >= 0; + shift -= shiftstep) { + burst[offset] |= + ((data + [i++] & mask) + << shift); + } + offset++; + } + DRAMWriteWord(card, addr, 4, burst, 0); // write first burst + addr += 4; // go on to the next burst + while (addr < addr1) { // all bursts between start and end burst + for (offset = 0; + offset <= 3; offset++) { // 4 words per burst + burst[offset] = 0x0000; // clear first + for (shift = + shift0; + shift >= 0; + shift -= + shiftstep) { + burst + [offset] + |= + ((data + [i++] + & + mask) + << + shift); + } + } + DRAMWriteWord(card, addr, + 4, burst, 0); // write full burst + addr += 4; // next burst + } + offset = 0; + if ((offset1 < 3) || shift1) { // does the row ends before the end of the burst? + DRAMReadWord(card, addr, 4, + burst, 0); // then we have to read the old content + } + } + while (offset < offset1) { // end not in this word + burst[offset] = 0x0000; // clear first + for (shift = shift0; shift >= 0; + shift -= shiftstep) { + burst[offset] |= + ((data[i++] & mask) << + shift); + } + offset++; + } + for (shift = shift0; shift >= shift1; + shift -= shiftstep) { // last word + burst[offset] = + (burst[offset] & + ~(mask << shift)) | + ((data[i++] & mask) << shift); + } + } + } else { // row starts and ends in one word + for (shift = shift0; shift >= shift1; shift -= shiftstep) { // bit position inside word + burst[offset] = + (burst[offset] & ~(mask << shift)) | + ((data[i++] & mask) << shift); + } + } + DRAMWriteWord(card, addr, 4, burst, 0); // write only/last burst + return 0; + } else + return -1; +} + +// fills pixels x0,y0 through x1,y1 with the content of data[] +// inc contains the width of one line in the data block, +// inc<=0 uses blockwidth as linewidth +// returns 0 on success, -1 on clipping all pixel +int OSDSetBlock(struct cvdv_cards *card, int x0, int y0, int x1, int y1, + int inc, u8 * data) +{ + int i, w = x1 - x0 + 1, ret = 0; + if (inc > 0) + w = inc; + for (i = y0; i <= y1; i++) { + ret |= OSDSetRow(card, x0, i, x1, data); + data += w; + } + return ret; +} + +// fills pixels x0,y through x1,y with the color +// returns 0 on success, -1 on clipping all pixel +int OSDFillRow(struct cvdv_cards *card, int x0, int y, int x1, int col) +{ + u16 burst[4]; // minimal memory unit + u32 addr, addr1, bitmap; + int offset, offset1, ppw, pos, pos1, shift, shift0, shift1, + shiftstep, height, bpp, x, i, endburst, endword; + u16 mask, posmask; + + if (!card->OSD.open) + return -2; + if ((y & 1) == card->OSD.evenfirst) { + bitmap = card->OSD.oddbitmap; + height = card->OSD.oddheight; + } else { + bitmap = card->OSD.evenbitmap; + height = card->OSD.evenheight; + } + y >>= 1; + if ((y >= 0) && (y < height)) { + i = 0; + if (x0 > x1) { + x = x1; + x1 = x0; + x0 = x; + } + if ((x0 >= card->OSD.width) || (x1 < 0)) + return -1; + if (x0 < 0) { + i -= x0; + x0 = 0; + } + if (x1 >= card->OSD.width) + x1 = card->OSD.width - 1; + bpp = card->OSD.bpp; // bits per pixel + ppw = ((bpp == 4) ? 2 : ((bpp == 8) ? 1 : 3)); // positional parameter + mask = (1 << bpp) - 1; // mask for one pixel + posmask = (1 << ppw) - 1; // mask for position inside word + + pos = x0 + (y * card->OSD.width); // pixel number of first pixel + pos1 = pos + x1 - x0; // pixel number of last pixel + shift0 = ((posmask - (pos & posmask)) << (4 - ppw)); + shift1 = ((posmask - (pos1 & posmask)) << (4 - ppw)); + shiftstep = 1 << (4 - ppw); + + addr = bitmap + (pos >> ppw); // DRAM address of word with first pixel + addr1 = bitmap + (pos1 >> ppw); // " " " " " last " + offset = (int) (addr & 3); // word position inside burst + offset1 = (int) (addr1 & 3); // number of last word in the last burst + addr &= ~3; // burst address + addr1 &= ~3; // burst address of last pixel + + endburst = (addr1 != addr); // end in other burst + endword = (offset1 != offset); // end in other word + + // read old content of first burst if the row start after the beginning or + // end before the end of the first burst + if (offset || (pos & posmask) || + (!endburst + && ((offset1 != 3) + || ((pos1 & posmask) != posmask)))) { + DRAMReadWord(card, addr, 4, burst, 0); + } + if (endburst || endword || ((pos1 & posmask) == posmask)) { // end beyond or at the end of this word? + for (shift = shift0; shift >= 0; shift -= shiftstep) { // bit position inside word + burst[offset] = + (burst[offset] & ~(mask << shift)) | + ((col & mask) << shift); + } + if (endburst || endword) { + shift0 = posmask << (4 - ppw); // from here on, we start at the beginning of each word + offset++; // fill the rest of the burst + if (endburst) { // end not in this burst? + while (offset <= 3) { // fill remaining words + burst[offset] = 0x0000; // clear first + for (shift = shift0; + shift >= 0; + shift -= shiftstep) { + burst[offset] |= + ((col & mask) + << shift); + } + offset++; + } + DRAMWriteWord(card, addr, 4, burst, 0); // write first burst + addr += 4; // next burst + while (addr < addr1) { // write all the bursts between start and end burst + for (offset = 0; + offset <= 3; offset++) { + burst[offset] = + 0x0000; + for (shift = + shift0; + shift >= 0; + shift -= + shiftstep) { + burst + [offset] + |= + ((col + & + mask) + << + shift); + } + } + DRAMWriteWord(card, addr, + 4, burst, 0); + addr += 4; + } + offset = 0; + if ((offset1 < 3) || shift1) { // does the row ends before the end of the burst? + DRAMReadWord(card, addr, 4, + burst, 0); // then we have to read the old content + } + } + while (offset < offset1) { // end not in this word + burst[offset] = 0x0000; + for (shift = shift0; shift >= 0; + shift -= shiftstep) { + burst[offset] |= + ((col & mask) << + shift); + } + offset++; + } + for (shift = shift0; shift >= shift1; + shift -= shiftstep) { + burst[offset] = + (burst[offset] & + ~(mask << shift)) | ((col & + mask) << + shift); + } + } + } else { // row starts and ends in one word + for (shift = shift0; shift >= shift1; shift -= shiftstep) { // bit position inside word + burst[offset] = + (burst[offset] & ~(mask << shift)) | + ((col & mask) << shift); + } + } + DRAMWriteWord(card, addr, 4, burst, 0); + return 0; + } else + return -1; +} + +// fills pixels x0,y0 through x1,y1 with the color +// returns 0 on success, -1 on clipping all pixel +int OSDFillBlock(struct cvdv_cards *card, int x0, int y0, int x1, int y1, + int col) +{ + int i, ret = 0; + for (i = y0; i <= y1; i++) + ret |= OSDFillRow(card, x0, i, x1, col); + return ret; +} + +// draw a line from x0,y0 to x1,y1 with the color +int OSDLine(struct cvdv_cards *card, int x0, int y0, int x1, int y1, + int col) +{ + int ct, ix, iy, ax, ay, dx, dy, off; +#define sgn(a) ((a)?(((a)>0)?1:-1):0) + if (!card->OSD.open) + return -2; + dx = x1 - x0; + dy = y1 - y0; + if (dx == 0) { + if (dy < 0) + for (iy = y1; iy <= y0; iy++) + OSDSetPixel(card, x0, iy, col); + else + for (iy = y0; iy <= y1; iy++) + OSDSetPixel(card, x0, iy, col); + } else if (dy == 0) { + OSDFillRow(card, x0, y0, x1, col); + } else { + ay = 0; + ax = 0; + ix = sgn(dx); + dx = abs(dx); + iy = sgn(dy); + dy = abs(dy); + if (dx < dy) { + off = dx; + dx = dy; + dy = off; + ay = ix; + ax = iy; + ix = 0; + iy = 0; + } + off = dx >> 1; + ct = 1; + OSDSetPixel(card, x0, y0, col); + x1 = x0; + y1 = y0; + while (dx >= ct) { + x0 += ix; + y0 += ax; + ct++; + off += dy; + if (off > dx) { + off -= dx; + x0 += ay; + y0 += iy; + } + if (ax) { + OSDSetPixel(card, x0, y0, col); + } else { + if (y0 != y1) { + OSDFillRow(card, x1, y1, x0 - ay, + col); + x1 = x0; + y1 = y0; + } + } + } + if (!ax) + OSDFillRow(card, x1, y0, x0, col); + } + return 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/osd.h linux.20pre5-ac2/drivers/media/video/margi/osd.h --- linux.20pre5/drivers/media/video/margi/osd.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/osd.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,148 @@ +/* + osd.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef CVDV_OSD_H +#define CVDV_OSD_H + + //////////////////////////////////////////////////////////////// + // // + // Functions to Draw on the On Screen Display of the L64021 // + // CLUT-Mode with 2, 4, or 8 bit per pixel, up to 720*576 // + // // +//////////////////////////////////////////////////////////////// +// OSD Pixel Aspect Ratio: +// CCIR601 525 Lines (NTSC,PAL-M): 11/10 (100*100 appears as 100*110) +// CCIR601 625 Lines (PAL): 11/12 (100*100 appears as 100*91.6) +// +// OSD functions for external use: +// int OSDOpen(struct cvdv_cards *card); +// int OSDClose(struct cvdv_cards *card); +// int OSDQuery(struct cvdv_cards *card, int *x0, int *y0, int *x1, int *y1, int *aspx, int *aspy); +// int OSDStartPicture(struct cvdv_cards *card, int left, int top, int width, int height, int bit, int mix); +// void OSDShow(struct cvdv_cards *card); +// void OSDHide(struct cvdv_cards *card); +// void OSDClear(struct cvdv_cards *card); +// void OSDFill(struct cvdv_cards *card, int col); +// int OSDSetColor(struct cvdv_cards *card, int num, int R, int G, int B, int mix, int trans); +// int OSDSetPixel(struct cvdv_cards *card, int x, int y, int col); +// int OSDGetPixel(struct cvdv_cards *card, int x, int y); +// int OSDSetRow(struct cvdv_cards *card, int x0, int y, int x1, u8 *data); +// int OSDFillRow(struct cvdv_cards *card, int x0, int y, int x1, int col); +// void OSDLine(struct cvdv_cards *card, int x0, int y0, int x1, int y1, int col); +// +// Return codes: (unless otherwise specified) +// 0: OK +// -1: Range error +// -2: OSD not open +// + +#include "cardbase.h" + +// enables OSD mode +int OSDShow(struct cvdv_cards *card); + +// disables OSD mode +int OSDHide(struct cvdv_cards *card); + +// creates an empty picture in the memory of the card +// ONLY ONE PICTURE PER CARD! ( might be changed in the future, if i find time...) +// maximum sizes: NTSC: 720*525 PAL: 720*576 +// maximum positions: NTSC: 858*525 PAL: 864*625 +// returns 0 on success, -1 on DRAM allocation error +int OSDStartPicture(struct cvdv_cards *card, int left, int top, int width, + int height, int bit, int mix); + +// Disables OSD and releases the buffers +// returns 0 on success, 1 on "not open" +int OSDClose(struct cvdv_cards *card); + +// Opens OSD with this size and bit depth +// returns 0 on success, 1 on DRAM allocation error, 2 on "already open" +int OSDOpen(struct cvdv_cards *card, int x0, int y0, int x1, int y1, + int bit, int mix); + +// fills parameters with the picture dimensions and the pixel aspect ratio (aspy=11) +int OSDQuery(struct cvdv_cards *card, int *x0, int *y0, int *x1, int *y1, + int *aspx); + +// Sets all pixel to color 0 +int OSDClear(struct cvdv_cards *card); + +// Sets all pixel to color +int OSDFill(struct cvdv_cards *card, int col); + +// converts RGB(8 bit) to YCrCb(OSD format) +// mix: 0=opacity 100% 1=opacity at mix value +// trans: 0=mix bit applies 1=opacity 0% +// returns word in OSD palette format +u16 OSDColor(u8 R, u8 G, u8 B, int mix, int trans); + +// set palette entry to , and apply +// R,G,B: 0..255 +// RGB=1: R=Red, G=Green, B=Blue RGB=0: R=Y G=Cb B=Cr +// mix=0, trans=0: pixel opacity 100% (only OSD pixel shows) +// mix=1, trans=0: pixel opacity as specified in header +// trans=1: pixel opacity 0% (only video pixel shows) +// returns 0 on success, 1 on error +int OSDSetColor(struct cvdv_cards *card, int num, int R, int G, int B, + int YUV, int mix, int trans); + +// Set a number of entries in the palette +// sets the entries "firstcolor" through "lastcolor" from the array "data" +// data has 4 byte for each color: +// R,G,B, and a transparency value: 0->tranparent, 1..254->mix, 255->no mix +int OSDSetPalette(struct cvdv_cards *card, int firstcolor, int lastcolor, + u8 * data); + +// Sets transparency of mixed pixel (0..15) +int OSDSetTrans(struct cvdv_cards *card, int trans); + +// sets pixel , to color number +// returns 0 on success, 1 on error +int OSDSetPixel(struct cvdv_cards *card, int x, int y, int col); + +// returns color number of pixel ,, or -1 +int OSDGetPixel(struct cvdv_cards *card, int x, int y); + +// fills pixels x0,y through x1,y with the content of data[] +// returns 0 on success, -1 on clipping all pixel +int OSDSetRow(struct cvdv_cards *card, int x0, int y, int x1, u8 * data); + +// fills pixels x0,y0 through x1,y1 with the content of data[] +// inc contains the width of one line in the data block, +// inc<=0 uses blockwidth as linewidth +// returns 0 on success, -1 on clipping all pixel +int OSDSetBlock(struct cvdv_cards *card, int x0, int y0, int x1, int y1, + int inc, u8 * data); + +// fills pixels x0,y through x1,y with the color +// returns 0 on success, -1 on clipping all pixel +int OSDFillRow(struct cvdv_cards *card, int x0, int y, int x1, int col); + +// fills pixels x0,y0 through x1,y1 with the color +// returns 0 on success, -1 on clipping all pixel +int OSDFillBlock(struct cvdv_cards *card, int x0, int y0, int x1, int y1, + int col); + +// draw a line from x0,y0 to x1,y1 with the color +int OSDLine(struct cvdv_cards *card, int x0, int y0, int x1, int y1, + int col); + +#endif /* CVDV_OSD_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/ost/audio.h linux.20pre5-ac2/drivers/media/video/margi/ost/audio.h --- linux.20pre5/drivers/media/video/margi/ost/audio.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/ost/audio.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,120 @@ +/* + * audio.h + * + * Copyright (C) 2000 Ralph Metzler + * & Marcus Metzler + for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Lesser Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _OST_AUDIO_H_ +#define _OST_AUDIO_H_ + +#ifdef __KERNEL__ +#include +#else +#include +#endif + +#define boolean int +#define true 1 +#define false 0 + +typedef enum { + AUDIO_SOURCE_DEMUX, /* Select the demux as the main source */ + AUDIO_SOURCE_MEMORY /* Select internal memory as the main source */ +} audioStreamSource_t; + +typedef enum { + AUDIO_STOPPED, /* Device is stopped */ + AUDIO_PLAYING, /* Device is currently playing */ + AUDIO_PAUSED /* Device is paused */ +} audioPlayState_t; + +typedef enum { + AUDIO_STEREO, + AUDIO_MONO_LEFT, + AUDIO_MONO_RIGHT, +} audioChannelSelect_t; + +typedef struct audioStatus { + boolean AVSyncState; /* sync audio and video? */ + boolean muteState; /* audio is muted */ + audioPlayState_t playState; /* current playback state */ + audioStreamSource_t streamSource; /* current stream source */ + audioChannelSelect_t channelSelect; /* currently selected channel */ + boolean bypassMode; /* pass on audio data to separate + decoder hardware */ +} audioStatus_t; + +typedef struct audioMixer { + unsigned int volume_left; + unsigned int volume_right; + // what else do we need? bass, pass-through, ... +} audioMixer_t; + +typedef +struct audioKaraoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */ + int vocal1; /* into left and right t at 70% each */ + int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets */ + int melody; /* mixed into the left channel and */ + /* Vocal2 into the right channel at 100% each. */ + /* if Melody is non-zero, the melody channel gets mixed */ /* into left and right */ +} audioKaraoke_t; + +typedef uint16_t audioAttributes_t; +/* bits: descr. */ +/* 15-13 audio coding mode (0=ac3, 2=mpeg1, 3=mpeg2ext, 4=LPCM, 6=DTS, */ +/* 12 multichannel extension */ +/* 11-10 audio type (0=not spec, 1=language included) */ +/* 9- 8 audio application mode (0=not spec, 1=karaoke, 2=surround) */ +/* 7- 6 Quantization / DRC (mpeg audio: 1=DRC exists)(lpcm: 0=16bit, */ +/* 5- 4 Sample frequency fs (0=48kHz, 1=96kHz) */ +/* 2- 0 number of audio channels (n+1 channels) */ + + +/* for GET_CAPABILITIES and SET_FORMAT, the latter should only set one bit */ +#define AUDIO_CAP_DTS 1 +#define AUDIO_CAP_LPCM 2 +#define AUDIO_CAP_MP1 4 +#define AUDIO_CAP_MP2 8 +#define AUDIO_CAP_MP3 16 +#define AUDIO_CAP_AAC 32 +#define AUDIO_CAP_OGG 64 +#define AUDIO_CAP_SDDS 128 +#define AUDIO_CAP_AC3 256 + +#define AUDIO_STOP _IO('o', 1) +#define AUDIO_PLAY _IO('o', 2) +#define AUDIO_PAUSE _IO('o', 3) +#define AUDIO_CONTINUE _IO('o', 4) +#define AUDIO_SELECT_SOURCE _IOW('o', 5, audioStreamSource_t) +#define AUDIO_SET_MUTE _IOW('o', 6, boolean) +#define AUDIO_SET_AV_SYNC _IOW('o', 7, boolean) +#define AUDIO_SET_BYPASS_MODE _IOW('o', 8, boolean) +#define AUDIO_CHANNEL_SELECT _IOW('o', 9, audioChannelSelect_t) +#define AUDIO_GET_STATUS _IOR('o', 10, audioStatus_t *) + +#define AUDIO_GET_CAPABILITIES _IOR('o', 11, unsigned int *) +#define AUDIO_CLEAR_BUFFER _IO('o', 12) +#define AUDIO_SET_ID _IOW('o', 13, int) +#define AUDIO_SET_MIXER _IOW('o', 14, audioMixer_t *) +#define AUDIO_SET_STREAMTYPE _IOW('o', 15, unsigned int) +#define AUDIO_SET_EXT_ID _IOW('o', 16, int) +#define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audioAttributes_t) +#define AUDIO_SET_KARAOKE _IOW('o', 18, audioKaraoke_t *) +#endif /* _OST_AUDIO_H_ */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/ost/ca.h linux.20pre5-ac2/drivers/media/video/margi/ost/ca.h --- linux.20pre5/drivers/media/video/margi/ost/ca.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/ost/ca.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,85 @@ +/* + * ca.h + * + * Copyright (C) 2000 Ralph Metzler + * & Marcus Metzler + for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Lesser Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _OST_CA_H_ +#define _OST_CA_H_ + +/* slot interface types and info */ + +typedef struct ca_slot_info_s { + int num; /* slot number */ + + int type; /* CA interface this slot supports */ +#define CA_CI 1 /* CI high level interface */ +#define CA_CI_LINK 2 /* CI link layer level interface */ +#define CA_CI_PHYS 4 /* CI physical layer level interface */ +#define CA_SC 128 /* simple smart card interface */ + + unsigned int flags; +#define CA_CI_MODULE_PRESENT 1 /* module (or card) inserted */ +#define CA_CI_MODULE_READY 2 +} ca_slot_info_t; + + +/* descrambler types and info */ + +typedef struct ca_descr_info_s { + unsigned int num; /* number of available descramblers (keys) */ + unsigned int type; /* type of supported scrambling system */ +#define CA_ECD 1 +#define CA_NDS 2 +#define CA_DSS 4 +} ca_descr_info_t; + +typedef struct ca_cap_s { + unsigned int slot_num; /* total number of CA card and module slots */ + unsigned int slot_type; /* OR of all supported types */ + unsigned int descr_num; /* total number of descrambler slots (keys) */ + unsigned int descr_type; /* OR of all supported types */ +} ca_cap_t; + +/* a message to/from a CI-CAM */ +typedef struct ca_msg_s { + unsigned int index; + unsigned int type; + unsigned int length; + unsigned char msg[256]; +} ca_msg_t; + +typedef struct ca_descr_s { + unsigned int index; + unsigned int parity; + unsigned char cw[8]; +} ca_descr_t; + +#define CA_RESET _IOW('o', 128, int) +#define CA_GET_CAP _IOR('o', 129, ca_cap_t *) +#define CA_GET_SLOT_INFO _IOR('o', 130, ca_slot_info_t *) +#define CA_GET_DESCR_INFO _IOR('o', 131, ca_descr_info_t *) +#define CA_GET_MSG _IOR('o', 132, ca_msg_t *) +#define CA_SEND_MSG _IOW('o', 133, ca_msg_t *) +#define CA_SET_DESCR _IOW('o', 134, ca_descr_t *) +#define CA_SELECT_SLOT _IOW('o', 135, int) + +#endif + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/ost/demux.h linux.20pre5-ac2/drivers/media/video/margi/ost/demux.h --- linux.20pre5/drivers/media/video/margi/ost/demux.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/ost/demux.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,346 @@ +/* * demux.h * * Copyright (c) 2000 Nokia Research Center + * Tampere, FINLAND + * + * Project: + * Universal Broadcast Access + * + * Contains: + * Type definitions of a Linux kernel-level API for filtering MPEG-2 TS + * packets and MPEG-2 sections. Support for PES packet filtering will be + * added later. + * + * History: + * 12.01.2000/JPL File created - Initial version. + * 18.02.2000/JPL Minor corrections. + * 21.02.2000/JPL DMX_NAME_SIZE and dmx_in_use() removed, typos fixed, + * some names changed. + * 23.02.2000/JPL Added a parameter indicating the callback source in + * the callback functions. + * 10.03.2000/JPL Added the macros DMX_DIR_ENTRY() and DMX_FE_ENTRY(). + * 15.03.2000/JPL Added the capabilities field to dmx_demux_t. + * 22.03.2000/JPL Corrected the callback parameter in the + * allocate_x_feed() functions. + * 03.04.2000/JPL Added support for optional resource conflict resolution + * and scarce resource handling. + * 05.04.2000/JPL Changed the dmx_resolve_conflict() to use resource + * type as a parameter. + * 12.04.2000/JPL Added a second buffer parameter for dmx_x_callback() + * functions to better handle buffer wrapping. + * 26.04.2000/JPL Added functions for section-level descrambling. + * 03.09.2000/JPL Removed support for conflict resolution and scarce + * resource handling. Otherwise only minor changes to + * data structures and function prototypes. + * + * + * Author: + * Juha-Pekka Luoma (JPL) + * Nokia Research Center + * + * Notes: + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ +/* $Id: demux.h,v 1.14 2002/02/03 11:38:56 mocm Exp $ */ + +#ifndef __DEMUX_H +#define __DEMUX_H + +#ifndef __KERNEL__ +#define __KERNEL__ +#endif + +#include /* __u8, __u16, ... */ +#include /* list_entry(), struct list_head */ +#include /* struct timespec */ +#include /* Function return values */ + +/*--------------------------------------------------------------------------*/ +/* Common definitions */ +/*--------------------------------------------------------------------------*/ + +/* + * DMX_MAX_FILTER_SIZE: Maximum length (in bytes) of a section/PES filter. + */ + +#ifndef DMX_MAX_FILTER_SIZE +#define DMX_MAX_FILTER_SIZE 18 +#endif +/* + * dmx_success_t: Success codes for the Demux Callback API. + */ + +typedef enum { + DMX_OK = 0, /* Received Ok */ + DMX_LENGTH_ERROR, /* Incorrect length */ + DMX_OVERRUN_ERROR, /* Receiver ring buffer overrun */ + DMX_CRC_ERROR, /* Incorrect CRC */ + DMX_FRAME_ERROR, /* Frame alignment error */ + DMX_FIFO_ERROR, /* Receiver FIFO overrun */ + DMX_MISSED_ERROR /* Receiver missed packet */ +} dmx_success_t; + +/*--------------------------------------------------------------------------*/ +/* TS packet reception */ +/*--------------------------------------------------------------------------*/ + +/* TS filter type for set_type() */ + +#define TS_PACKET 1 /* send TS packets (188 bytes) to callback (default) */ +#define TS_PAYLOAD_ONLY 2 /* in case TS_PACKET is set, only send the TS + payload (<=184 bytes per packet) to callback */ +#define TS_DECODER 4 /* send stream to built-in decoder (if present) */ + +/* PES type for filters which write to built-in decoder */ +/* these should be kept identical to the types in dmx.h */ + +typedef enum +{ + DMX_TS_PES_AUDIO, /* also send packets to audio decoder (if it exists) */ + DMX_TS_PES_VIDEO, /* ... */ + DMX_TS_PES_TELETEXT, + DMX_TS_PES_SUBTITLE, + DMX_TS_PES_PCR, + DMX_TS_PES_OTHER, +} dmx_ts_pes_t; + + +struct dmx_ts_feed_s { + int is_filtering; /* Set to non-zero when filtering in progress */ + struct dmx_demux_s* parent; /* Back-pointer */ + void* priv; /* Pointer to private data of the API client */ + int (*set) (struct dmx_ts_feed_s* feed, + __u16 pid, + size_t callback_length, + size_t circular_buffer_size, + int descramble, + struct timespec timeout); + int (*start_filtering) (struct dmx_ts_feed_s* feed); + int (*stop_filtering) (struct dmx_ts_feed_s* feed); + int (*set_type) (struct dmx_ts_feed_s* feed, + int type, + dmx_ts_pes_t pes_type); +}; + +typedef struct dmx_ts_feed_s dmx_ts_feed_t; + +/*--------------------------------------------------------------------------*/ +/* PES packet reception (not supported yet) */ +/*--------------------------------------------------------------------------*/ + +typedef struct dmx_pes_filter_s { + struct dmx_pes_s* parent; /* Back-pointer */ + void* priv; /* Pointer to private data of the API client */ +} dmx_pes_filter_t; + +typedef struct dmx_pes_feed_s { + int is_filtering; /* Set to non-zero when filtering in progress */ + struct dmx_demux_s* parent; /* Back-pointer */ + void* priv; /* Pointer to private data of the API client */ + int (*set) (struct dmx_pes_feed_s* feed, + __u16 pid, + size_t circular_buffer_size, + int descramble, + struct timespec timeout); + int (*start_filtering) (struct dmx_pes_feed_s* feed); + int (*stop_filtering) (struct dmx_pes_feed_s* feed); + int (*allocate_filter) (struct dmx_pes_feed_s* feed, + dmx_pes_filter_t** filter); + int (*release_filter) (struct dmx_pes_feed_s* feed, + dmx_pes_filter_t* filter); +} dmx_pes_feed_t; + +/*--------------------------------------------------------------------------*/ +/* Section reception */ +/*--------------------------------------------------------------------------*/ + +typedef struct { + __u8 filter_value [DMX_MAX_FILTER_SIZE]; + __u8 filter_mask [DMX_MAX_FILTER_SIZE]; + struct dmx_section_feed_s* parent; /* Back-pointer */ + void* priv; /* Pointer to private data of the API client */ +} dmx_section_filter_t; + +struct dmx_section_feed_s { + int is_filtering; /* Set to non-zero when filtering in progress */ + struct dmx_demux_s* parent; /* Back-pointer */ + void* priv; /* Pointer to private data of the API client */ + int (*set) (struct dmx_section_feed_s* feed, + __u16 pid, + size_t circular_buffer_size, + int descramble, + int check_crc); + int (*allocate_filter) (struct dmx_section_feed_s* feed, + dmx_section_filter_t** filter); + int (*release_filter) (struct dmx_section_feed_s* feed, + dmx_section_filter_t* filter); + int (*start_filtering) (struct dmx_section_feed_s* feed); + int (*stop_filtering) (struct dmx_section_feed_s* feed); +}; +typedef struct dmx_section_feed_s dmx_section_feed_t; + +/*--------------------------------------------------------------------------*/ +/* Callback functions */ +/*--------------------------------------------------------------------------*/ + +typedef int (*dmx_ts_cb) ( __u8 * buffer1, + size_t buffer1_length, + __u8 * buffer2, + size_t buffer2_length, + dmx_ts_feed_t* source, + dmx_success_t success); + +typedef int (*dmx_section_cb) ( __u8 * buffer1, + size_t buffer1_len, + __u8 * buffer2, + size_t buffer2_len, + dmx_section_filter_t * source, + dmx_success_t success); + +typedef int (*dmx_pes_cb) ( __u8 * buffer1, + size_t buffer1_len, + __u8 * buffer2, + size_t buffer2_len, + dmx_pes_filter_t* source, + dmx_success_t success); + +/*--------------------------------------------------------------------------*/ +/* DVB Front-End */ +/*--------------------------------------------------------------------------*/ + +typedef enum { + DMX_OTHER_FE = 0, + DMX_SATELLITE_FE, + DMX_CABLE_FE, + DMX_TERRESTRIAL_FE, + DMX_LVDS_FE, + DMX_ASI_FE, /* DVB-ASI interface */ + DMX_MEMORY_FE +} dmx_frontend_source_t; + +typedef struct { + /* The following char* fields point to NULL terminated strings */ + char* id; /* Unique front-end identifier */ + char* vendor; /* Name of the front-end vendor */ + char* model; /* Name of the front-end model */ + struct list_head connectivity_list; /* List of front-ends that can + be connected to a particular + demux */ + void* priv; /* Pointer to private data of the API client */ + dmx_frontend_source_t source; +} dmx_frontend_t; + +/*--------------------------------------------------------------------------*/ +/* MPEG-2 TS Demux */ +/*--------------------------------------------------------------------------*/ + +/* + * Flags OR'ed in the capabilites field of struct dmx_demux_s. + */ + +#define DMX_TS_FILTERING 1 +#define DMX_PES_FILTERING 2 +#define DMX_SECTION_FILTERING 4 +#define DMX_MEMORY_BASED_FILTERING 8 /* write() available */ +#define DMX_CRC_CHECKING 16 +#define DMX_TS_DESCRAMBLING 32 +#define DMX_SECTION_PAYLOAD_DESCRAMBLING 64 +#define DMX_MAC_ADDRESS_DESCRAMBLING 128 + +/* + * Demux resource type identifier. +*/ + +/* + * DMX_FE_ENTRY(): Casts elements in the list of registered + * front-ends from the generic type struct list_head + * to the type * dmx_frontend_t + *. +*/ + +#define DMX_FE_ENTRY(list) list_entry(list, dmx_frontend_t, connectivity_list) + +struct dmx_demux_s { + /* The following char* fields point to NULL terminated strings */ + char* id; /* Unique demux identifier */ + char* vendor; /* Name of the demux vendor */ + char* model; /* Name of the demux model */ + __u32 capabilities; /* Bitfield of capability flags */ + dmx_frontend_t* frontend; /* Front-end connected to the demux */ + struct list_head reg_list; /* List of registered demuxes */ + void* priv; /* Pointer to private data of the API client */ + int users; /* Number of users */ + int (*open) (struct dmx_demux_s* demux); + int (*close) (struct dmx_demux_s* demux); + int (*write) (struct dmx_demux_s* demux, const char* buf, size_t count); + int (*allocate_ts_feed) (struct dmx_demux_s* demux, + dmx_ts_feed_t** feed, + dmx_ts_cb callback); + int (*release_ts_feed) (struct dmx_demux_s* demux, + dmx_ts_feed_t* feed); + int (*allocate_pes_feed) (struct dmx_demux_s* demux, + dmx_pes_feed_t** feed, + dmx_pes_cb callback); + int (*release_pes_feed) (struct dmx_demux_s* demux, + dmx_pes_feed_t* feed); + int (*allocate_section_feed) (struct dmx_demux_s* demux, + dmx_section_feed_t** feed, + dmx_section_cb callback); + int (*release_section_feed) (struct dmx_demux_s* demux, + dmx_section_feed_t* feed); + int (*descramble_mac_address) (struct dmx_demux_s* demux, + __u8* buffer1, + size_t buffer1_length, + __u8* buffer2, + size_t buffer2_length, + __u16 pid); + int (*descramble_section_payload) (struct dmx_demux_s* demux, + __u8* buffer1, + size_t buffer1_length, + __u8* buffer2, size_t buffer2_length, + __u16 pid); + int (*add_frontend) (struct dmx_demux_s* demux, + dmx_frontend_t* frontend); + int (*remove_frontend) (struct dmx_demux_s* demux, + dmx_frontend_t* frontend); + struct list_head* (*get_frontends) (struct dmx_demux_s* demux); + int (*connect_frontend) (struct dmx_demux_s* demux, + dmx_frontend_t* frontend); + int (*disconnect_frontend) (struct dmx_demux_s* demux); + + + /* added because js cannot keep track of these himself */ + int (*get_pes_pids) (struct dmx_demux_s* demux, __u16 *pids); +}; +typedef struct dmx_demux_s dmx_demux_t; + +/*--------------------------------------------------------------------------*/ +/* Demux directory */ +/*--------------------------------------------------------------------------*/ + +/* + * DMX_DIR_ENTRY(): Casts elements in the list of registered + * demuxes from the generic type struct list_head* to the type dmx_demux_t + *. + */ + +#define DMX_DIR_ENTRY(list) list_entry(list, dmx_demux_t, reg_list) + +int dmx_register_demux (dmx_demux_t* demux); +int dmx_unregister_demux (dmx_demux_t* demux); +struct list_head* dmx_get_demuxes (void); + +#endif /* #ifndef __DEMUX_H */ + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/ost/dmx.h linux.20pre5-ac2/drivers/media/video/margi/ost/dmx.h --- linux.20pre5/drivers/media/video/margi/ost/dmx.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/ost/dmx.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,147 @@ +/* + * dmx.h + * + * Copyright (C) 2000 Marcus Metzler + * & Ralph Metzler + for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _OST_DMX_H_ +#define _OST_DMX_H_ + +#ifdef __KERNEL__ +#include +#else +#include +#endif + +#ifndef EBUFFEROVERFLOW +#define EBUFFEROVERFLOW 769 +#endif + +typedef uint16_t dvb_pid_t; + +#define DMX_FILTER_SIZE 16 + +typedef enum +{ + DMX_OUT_DECODER, /* Streaming directly to decoder. */ + DMX_OUT_TAP, /* Output going to a memory buffer */ + /* (to be retrieved via the read command).*/ + DMX_OUT_TS_TAP /* Output multiplexed into a new TS */ + /* (to be retrieved by reading from the */ + /* logical DVR device). */ +} dmxOutput_t; + + +typedef enum +{ + DMX_IN_FRONTEND, /* Input from a front-end device. */ + DMX_IN_DVR /* Input from the logical DVR device. */ +} dmxInput_t; + + +typedef enum +{ + DMX_PES_AUDIO, + DMX_PES_VIDEO, + DMX_PES_TELETEXT, + DMX_PES_SUBTITLE, + DMX_PES_PCR, + DMX_PES_OTHER +} dmxPesType_t; + + +typedef enum +{ + DMX_SCRAMBLING_EV, + DMX_FRONTEND_EV +} dmxEvent_t; + + +typedef enum +{ + DMX_SCRAMBLING_OFF, + DMX_SCRAMBLING_ON +} dmxScramblingStatus_t; + + +typedef struct dmxFilter +{ + uint8_t filter[DMX_FILTER_SIZE]; + uint8_t mask[DMX_FILTER_SIZE]; +} dmxFilter_t; + + +struct dmxFrontEnd +{ + +}; + + +struct dmxSctFilterParams +{ + dvb_pid_t pid; + dmxFilter_t filter; + uint32_t timeout; + uint32_t flags; +#define DMX_CHECK_CRC 1 +#define DMX_ONESHOT 2 +#define DMX_IMMEDIATE_START 4 +#define DMX_KERNEL_CLIENT 0x8000 +}; + + +struct dmxPesFilterParams +{ + dvb_pid_t pid; + dmxInput_t input; + dmxOutput_t output; + dmxPesType_t pesType; + uint32_t flags; +}; + + +struct dmxEvent +{ + dmxEvent_t event; + time_t timeStamp; + union + { + dmxScramblingStatus_t scrambling; + } u; +}; + + +typedef struct dmxCaps_s +{ + uint32_t caps; /* */ + int num_decoders; +} dmxCaps_t; + + +#define DMX_START _IOW('o',41,int) +#define DMX_STOP _IOW('o',42,int) +#define DMX_SET_FILTER _IOW('o',43,struct dmxSctFilterParams *) +#define DMX_SET_PES_FILTER _IOW('o',44,struct dmxPesFilterParams *) +#define DMX_SET_BUFFER_SIZE _IOW('o',45,unsigned long) +#define DMX_GET_EVENT _IOR('o',46,struct dmxEvent *) +#define DMX_GET_PES_PIDS _IOR('o',47,dvb_pid_t *) +#define DMX_GET_CAPS _IOR('o',48,dmxCaps_t *) + +#endif /*_OST_DMX_H_*/ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/ost/frontend.h linux.20pre5-ac2/drivers/media/video/margi/ost/frontend.h --- linux.20pre5/drivers/media/video/margi/ost/frontend.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/ost/frontend.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,208 @@ +/* + * frontend.h + * + * Copyright (C) 2000 Marcus Metzler + * & Ralph Metzler + * for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _FRONTEND_H_ +#define _FRONTEND_H_ + +#include + + +#define ENOSIGNAL 768 +#ifndef EBUFFEROVERFLOW +#define EBUFFEROVERFLOW 769 +#endif + + +typedef __u32 FrontendStatus; + +/* bit definitions for FrontendStatus */ +#define FE_HAS_POWER 1 +#define FE_HAS_SIGNAL 2 +#define FE_SPECTRUM_INV 4 +#define FE_HAS_LOCK 8 +#define FE_HAS_CARRIER 16 +#define FE_HAS_VITERBI 32 +#define FE_HAS_SYNC 64 +#define FE_TUNER_HAS_LOCK 128 + + +/* possible values for spectral inversion */ +typedef enum { + INVERSION_OFF, + INVERSION_ON, + INVERSION_AUTO +} SpectralInversion; + +/* possible values for FEC_inner/FEC_outer */ +typedef enum { + FEC_AUTO, + FEC_1_2, + FEC_2_3, + FEC_3_4, + FEC_5_6, + FEC_7_8, + FEC_NONE +} CodeRate; + + +typedef enum { + QPSK, + QAM_16, + QAM_32, + QAM_64, + QAM_128, + QAM_256 +} Modulation; + + +typedef enum { + TRANSMISSION_MODE_2K, + TRANSMISSION_MODE_8K +} TransmitMode; + +typedef enum { + BANDWIDTH_8_MHZ, + BANDWIDTH_7_MHZ, + BANDWIDTH_6_MHZ +} BandWidth; + + +typedef enum { + GUARD_INTERVAL_1_32, + GUARD_INTERVAL_1_16, + GUARD_INTERVAL_1_8, + GUARD_INTERVAL_1_4 +} GuardInterval; + + +typedef enum { + HIERARCHY_NONE, + HIERARCHY_1, + HIERARCHY_2, + HIERARCHY_4 +} Hierarchy; + + +typedef struct { + __u32 SymbolRate; /* symbol rate in Symbols per second */ + CodeRate FEC_inner; /* forward error correction (see above) */ +} QPSKParameters; + + +typedef struct { + __u32 SymbolRate; /* symbol rate in Symbols per second */ + CodeRate FEC_inner; /* forward error correction (see above) */ + Modulation QAM; /* modulation type (see above) */ +} QAMParameters; + + +typedef struct { + BandWidth bandWidth; + CodeRate HP_CodeRate; /* high priority stream code rate */ + CodeRate LP_CodeRate; /* low priority stream code rate */ + Modulation Constellation; /* modulation type (see above) */ + TransmitMode TransmissionMode; + GuardInterval guardInterval; + Hierarchy HierarchyInformation; +} OFDMParameters; + + +typedef enum { + FE_QPSK, + FE_QAM, + FE_OFDM +} FrontendType; + + +typedef struct { + __u32 Frequency; /* (absolute) frequency in Hz for QAM/OFDM */ + /* intermediate frequency in kHz for QPSK */ + SpectralInversion Inversion; /* spectral inversion */ + union { + QPSKParameters qpsk; + QAMParameters qam; + OFDMParameters ofdm; + } u; +} FrontendParameters; + + +typedef enum { + FE_UNEXPECTED_EV, /* unexpected event (e.g. loss of lock) */ + FE_COMPLETION_EV, /* completion event, tuning succeeded */ + FE_FAILURE_EV /* failure event, we couldn't tune */ +} EventType; + + +typedef struct { + EventType type; /* type of event, FE_UNEXPECTED_EV, ... */ + + long timestamp; /* time in seconds since 1970-01-01 */ + + union { + struct { + FrontendStatus previousStatus; /* status before event */ + FrontendStatus currentStatus; /* status during event */ + } unexpectedEvent; + FrontendParameters completionEvent; /* parameters for which the + tuning succeeded */ + FrontendStatus failureEvent; /* status at failure (e.g. no lock) */ + } u; +} FrontendEvent; + +typedef struct { + FrontendType type; + __u32 minFrequency; + __u32 maxFrequency; + __u32 maxSymbolRate; + __u32 minSymbolRate; + __u32 hwType; + __u32 hwVersion; +} FrontendInfo; + + +typedef enum { + FE_POWER_ON, + FE_POWER_STANDBY, + FE_POWER_SUSPEND, + FE_POWER_OFF +} FrontendPowerState; + + +#define FE_SELFTEST _IO('o', 61) +#define FE_SET_POWER_STATE _IOW('o', 62, FrontendPowerState) +#define FE_GET_POWER_STATE _IOR('o', 63, FrontendPowerState*) +#define FE_READ_STATUS _IOR('o', 64, FrontendStatus*) +#define FE_READ_BER _IOW('o', 65, __u32*) +#define FE_READ_SIGNAL_STRENGTH _IOR('o', 66, __s32*) +#define FE_READ_SNR _IOR('o', 67, __s32*) +#define FE_READ_UNCORRECTED_BLOCKS _IOW('o', 68, __u32*) +#define FE_GET_NEXT_FREQUENCY _IOW('o', 69, __u32*) +#define FE_GET_NEXT_SYMBOL_RATE _IOW('o', 70, __u32*) + +#define FE_SET_FRONTEND _IOW('o', 71, FrontendParameters*) +#define FE_GET_FRONTEND _IOR('o', 72, FrontendParameters*) +#define FE_GET_INFO _IOR('o', 73, FrontendInfo*) +#define FE_GET_EVENT _IOR('o', 74, FrontendEvent*) + +#endif /*_FRONTEND_H_*/ + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/ost/net.h linux.20pre5-ac2/drivers/media/video/margi/ost/net.h --- linux.20pre5/drivers/media/video/margi/ost/net.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/ost/net.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,40 @@ +/* + * net.h + * + * Copyright (C) 2000 Marcus Metzler + * & Ralph Metzler + for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _OST_NET_H_ +#define _OST_NET_H_ + +#ifdef __KERNEL__ +#include +#else +#include +#endif + +struct dvb_net_if { + uint16_t pid; + uint16_t if_num; +}; + +#define NET_ADD_IF _IOWR('o', 52, struct dvb_net_if *) +#define NET_REMOVE_IF _IOW('o', 53, uint16_t) +#endif /*_OST_VIDEO_H_*/ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/ost/osd.h linux.20pre5-ac2/drivers/media/video/margi/ost/osd.h --- linux.20pre5/drivers/media/video/margi/ost/osd.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/ost/osd.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,111 @@ +/* + * osd.h + * + * Copyright (C) 2001 Ralph Metzler + * & Marcus Metzler + for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Lesser Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _OST_OSD_H_ +#define _OST_OSD_H_ + +typedef enum { + // All functions return -2 on "not open" + OSD_Close=1, // () + // Disables OSD and releases the buffers + // returns 0 on success + OSD_Open, // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0)) + // Opens OSD with this size and bit depth + // returns 0 on success, -1 on DRAM allocation error, -2 on "already open" + OSD_Show, // () + // enables OSD mode + // returns 0 on success + OSD_Hide, // () + // disables OSD mode + // returns 0 on success + OSD_Clear, // () + // Sets all pixel to color 0 + // returns 0 on success + OSD_Fill, // (color) + // Sets all pixel to color + // returns 0 on success + OSD_SetColor, // (color,R{x0},G{y0},B{x1},opacity{y1}) + // set palette entry to , and apply + // R,G,B: 0..255 + // R=Red, G=Green, B=Blue + // opacity=0: pixel opacity 0% (only video pixel shows) + // opacity=1..254: pixel opacity as specified in header + // opacity=255: pixel opacity 100% (only OSD pixel shows) + // returns 0 on success, -1 on error + OSD_SetPalette, // (firstcolor{color},lastcolor{x0},data) + // Set a number of entries in the palette + // sets the entries "firstcolor" through "lastcolor" from the array "data" + // data has 4 byte for each color: + // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel + OSD_SetTrans, // (transparency{color}) + // Sets transparency of mixed pixel (0..15) + // returns 0 on success + OSD_SetPixel, // (x0,y0,color) + // sets pixel , to color number + // returns 0 on success, -1 on error + OSD_GetPixel, // (x0,y0) + // returns color number of pixel ,, or -1 + OSD_SetRow, // (x0,y0,x1,data) + // fills pixels x0,y through x1,y with the content of data[] + // returns 0 on success, -1 on clipping all pixel (no pixel drawn) + OSD_SetBlock, // (x0,y0,x1,y1,increment{color},data) + // fills pixels x0,y0 through x1,y1 with the content of data[] + // inc contains the width of one line in the data block, + // inc<=0 uses blockwidth as linewidth + // returns 0 on success, -1 on clipping all pixel + OSD_FillRow, // (x0,y0,x1,color) + // fills pixels x0,y through x1,y with the color + // returns 0 on success, -1 on clipping all pixel + OSD_FillBlock, // (x0,y0,x1,y1,color) + // fills pixels x0,y0 through x1,y1 with the color + // returns 0 on success, -1 on clipping all pixel + OSD_Line, // (x0,y0,x1,y1,color) + // draw a line from x0,y0 to x1,y1 with the color + // returns 0 on success + OSD_Query, // (x0,y0,x1,y1,xasp{color}}), yasp=11 + // fills parameters with the picture dimensions and the pixel aspect ratio + // returns 0 on success + OSD_Test, // () + // draws a test picture. for debugging purposes only + // returns 0 on success +// TODO: remove "test" in final version + OSD_Text, // (x0,y0,size,color,text) + OSD_SetWindow, // (x0) set window with number 0 + * & Marcus Metzler + for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _OST_SEC_H_ +#define _OST_SEC_H_ + +#define SEC_MAX_DISEQC_PARAMS 3 + +struct secDiseqcCmd { + uint8_t addr; + uint8_t cmd; + uint8_t numParams; + uint8_t params[SEC_MAX_DISEQC_PARAMS]; +}; + +typedef uint32_t secVoltage; + +enum { + SEC_VOLTAGE_OFF, + SEC_VOLTAGE_LT, + SEC_VOLTAGE_13, + SEC_VOLTAGE_13_5, + SEC_VOLTAGE_18, + SEC_VOLTAGE_18_5 +}; + +#define SEC_VOLTAGE_HORIZONTAL SEC_VOLTAGE_18 +#define SEC_VOLTAGE_VERTICAL SEC_VOLTAGE_13 + +typedef uint32_t secToneMode; + +typedef enum { + SEC_TONE_ON, + SEC_TONE_OFF +} secToneMode_t; + + +typedef uint32_t secMiniCmd; + +typedef enum { + SEC_MINI_NONE, + SEC_MINI_A, + SEC_MINI_B +} secMiniCmd_t; + +struct secStatus { + int32_t busMode; + secVoltage selVolt; + secToneMode contTone; +}; + +enum { + SEC_BUS_IDLE, + SEC_BUS_BUSY, + SEC_BUS_OFF, + SEC_BUS_OVERLOAD +}; + +struct secCommand { + int32_t type; + union { + struct secDiseqcCmd diseqc; + uint8_t vsec; + uint32_t pause; + } u; +}; + +struct secCmdSequence { + secVoltage voltage; + secMiniCmd miniCommand; + secToneMode continuousTone; + + uint32_t numCommands; + struct secCommand* commands; +}; + +enum { + SEC_CMDTYPE_DISEQC, + SEC_CMDTYPE_VSEC, + SEC_CMDTYPE_PAUSE +}; + + +#define SEC_GET_STATUS _IOR('o',91,struct secStatus *) +#define SEC_RESET_OVERLOAD _IOW('o',92,void) +#define SEC_SEND_SEQUENCE _IOW('o',93,struct secCmdSequence *) +#define SEC_SET_TONE _IOW('o',94,secToneMode) +#define SEC_SET_VOLTAGE _IOW('o',95,secVoltage) + +typedef enum { + SEC_DISEQC_SENT, + SEC_VSEC_SENT, + SEC_PAUSE_COMPLETE, + SEC_CALLBACK_ERROR +} secCallback_t; + + +#endif /*_OST_SEC_H_*/ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/ost/video.h linux.20pre5-ac2/drivers/media/video/margi/ost/video.h --- linux.20pre5/drivers/media/video/margi/ost/video.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/ost/video.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,186 @@ +/* + * video.h + * + * Copyright (C) 2000 Marcus Metzler + * & Ralph Metzler + for convergence integrated media GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + */ + +#ifndef _OST_VIDEO_H_ +#define _OST_VIDEO_H_ + +#ifdef __KERNEL__ +#include +#else +#include +#endif + +#define boolean int +#define true 1 +#define false 0 + +typedef enum { + VIDEO_FORMAT_4_3, /* Select 4:3 format */ + VIDEO_FORMAT_16_9 /* Select 16:9 format. */ +} videoFormat_t; + +typedef enum { + VIDEO_SYSTEM_PAL, + VIDEO_SYSTEM_NTSC, + VIDEO_SYSTEM_PALN, + VIDEO_SYSTEM_PALNc, + VIDEO_SYSTEM_PALM, + VIDEO_SYSTEM_NTSC60, + VIDEO_SYSTEM_PAL60, + VIDEO_SYSTEM_PALM60 +} videoSystem_t; + +typedef enum { + VIDEO_PAN_SCAN, /* use pan and scan format */ + VIDEO_LETTER_BOX, /* use letterbox format */ + VIDEO_CENTER_CUT_OUT /* use center cut out format */ +} videoDisplayFormat_t; + +typedef enum { + VIDEO_SOURCE_DEMUX, /* Select the demux as the main source */ + VIDEO_SOURCE_MEMORY /* If this source is selected, the stream + comes from the user through the write + system call */ +} videoStreamSource_t; + +typedef enum { + VIDEO_STOPPED, /* Video is stopped */ + VIDEO_PLAYING, /* Video is currently playing */ + VIDEO_FREEZED /* Video is freezed */ +} videoPlayState_t; + +struct videoEvent { + int32_t type; + time_t timestamp; + union { + videoFormat_t videoFormat; + } u; +}; + +struct videoStatus { + boolean videoBlank; /* blank video on freeze? */ + videoPlayState_t playState; /* current state of playback */ + videoStreamSource_t streamSource; /* current source (demux/memory) */ + videoFormat_t videoFormat; /* current aspect ratio of stream */ + videoDisplayFormat_t displayFormat; /* selected cropping mode */ +}; + +/* pointer to and size of a single iframe in memory */ +struct videoDisplayStillPicture { + char *iFrame; + int32_t size; +}; + + +typedef +struct videoHighlight { + boolean active; /* 1=show highlight, 0=hide highlight */ + uint8_t contrast1; /* 7- 4 Pattern pixel contrast */ + /* 3- 0 Background pixel contrast */ + uint8_t contrast2; /* 7- 4 Emphasis pixel-2 contrast */ + /* 3- 0 Emphasis pixel-1 contrast */ + uint8_t color1; /* 7- 4 Pattern pixel color */ + /* 3- 0 Background pixel color */ + uint8_t color2; /* 7- 4 Emphasis pixel-2 color */ + /* 3- 0 Emphasis pixel-1 color */ + uint32_t ypos; /* 23-22 auto action mode */ + /* 21-12 start y */ + /* 9- 0 end y */ + uint32_t xpos; /* 23-22 button color number */ + /* 21-12 start x */ + /* 9- 0 end x */ +} videoHighlight_t; + + +typedef +struct videoSPU { + boolean active; + int streamID; +} videoSPU_t; + +typedef +struct videoSPUPalette{ /* SPU Palette information */ + int length; + uint8_t *palette; +} videoSPUPalette_t; + +typedef +struct videoNaviPack{ + int length; /* 0 ... 1024 */ + uint8_t data[1024]; +} videoNaviPack_t; + + +typedef uint16_t videoAttributes_t; +/* bits: descr. */ +/* 15-14 Video compression mode (0=MPEG-1, 1=MPEG-2) */ +/* 13-12 TV system (0=525/60, 1=625/50) */ +/* 11-10 Aspect ratio (0=4:3, 3=16:9) */ +/* 9- 8 permitted display mode on 4:3 monitor (0=both, 1=only pan-sca */ +/* 7 line 21-1 data present in GOP (1=yes, 0=no) */ +/* 6 line 21-2 data present in GOP (1=yes, 0=no) */ +/* 5- 3 source resolution (0=720x480/576, 1=704x480/576, 2=352x480/57 */ +/* 2 source letterboxed (1=yes, 0=no) */ +/* 0 film/camera mode (0=camera, 1=film (625/50 only)) */ + + +/* bit definitions for capabilities: */ +/* can the hardware decode MPEG1 and/or MPEG2? */ +#define VIDEO_CAP_MPEG1 1 +#define VIDEO_CAP_MPEG2 2 +/* can you send a system and/or program stream to video device? + (you still have to open the video and the audio device but only + send the stream to the video device) */ +#define VIDEO_CAP_SYS 4 +#define VIDEO_CAP_PROG 8 +/* can the driver also handle SPU, NAVI and CSS encoded data? + (CSS API is not present yet) */ +#define VIDEO_CAP_SPU 16 +#define VIDEO_CAP_NAVI 32 +#define VIDEO_CAP_CSS 64 + + +#define VIDEO_STOP _IOW('o', 21, boolean) +#define VIDEO_PLAY _IO('o', 22) +#define VIDEO_FREEZE _IO('o', 23) +#define VIDEO_CONTINUE _IO('o', 24) +#define VIDEO_SELECT_SOURCE _IOW('o', 25, videoStreamSource_t) +#define VIDEO_SET_BLANK _IOW('o', 26, boolean) +#define VIDEO_GET_STATUS _IOR('o', 27, struct videoStatus *) +#define VIDEO_GET_EVENT _IOR('o', 28, struct videoEvent *) +#define VIDEO_SET_DISPLAY_FORMAT _IOW('o', 29, videoDisplayFormat_t) +#define VIDEO_STILLPICTURE _IOW('o', 30, struct videoDisplayStillPicture *) +#define VIDEO_FAST_FORWARD _IOW('o', 31, int) +#define VIDEO_SLOWMOTION _IOW('o', 32, int) +#define VIDEO_GET_CAPABILITIES _IOR('o', 33, unsigned int *) +#define VIDEO_CLEAR_BUFFER _IO('o', 34) +#define VIDEO_SET_ID _IOW('o', 35, unsigned char) +#define VIDEO_SET_STREAMTYPE _IOW('o', 36, int) +#define VIDEO_SET_FORMAT _IOW('o', 37, videoFormat_t) +#define VIDEO_SET_SYSTEM _IOW('o', 38, videoSystem_t) +#define VIDEO_SET_HIGHLIGHT _IOW('o', 39, videoHighlight_t *) +#define VIDEO_SET_SPU _IOW('o', 50, videoSPU_t *) +#define VIDEO_SET_SPU_PALETTE _IOW('o', 51, videoSPUPalette_t *) +#define VIDEO_GET_NAVI _IOR('o', 52, videoNaviPack_t *) +#define VIDEO_SET_ATTRIBUTES _IOW('o', 53, videoAttributes_t) +#endif /*_OST_VIDEO_H_*/ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/README linux.20pre5-ac2/drivers/media/video/margi/README --- linux.20pre5/drivers/media/video/margi/README 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/README 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,97 @@ +This is the driver for the Margi/Billionton MPEG decoder PC-Card. +It is still in a beta state and may cause problems with your system. + +INSTALLING +---------- +0) From now on you will need a 2.4.x kernel to make everything work + +1) Install David Hinds` PCMCIA Card Services package. The current + version is at http://pcmcia.sourceforge.org/. + This driver is known to work under versions 3.1.25 and later. Earlier + version may work too. + + % tar zxvf pcmcia-cs-3.1.25.tar.gz + +2) Enter the pcmcia directory and unpack the margi driver. + + % cd pcmcia-cs-3.1.25 + % tar zxvf margi_cs-0.5.tar.gz + +3) In the pcmcia main directory: + + % make config + % make all + # make install + + +The files for the margi are in margi2. (The name has historical reasons.) + +ATTENTION You now need video4linux support in the kernel. +You can now use /dev/video for playback. + + +Using the driver +---------------- +The driver registers a character device with major number 162. You can +cat an MPEG2 program stream into that device. +If the device doesn`t exist (usually it`s /dev/raw) just + % mknod -m 0666 /dev/margi char 200 0 +Than you + % cat nicempg2.vob > /dev/margi +or + % cat nicempg.mpg > /dev/margi + +At the moment we do not recognize the audio format of the MPEG1/2, so +MPEG audio is hard-coded as default. You can change that in cvdv.c in the +Prepare() routine, or by using the ioctl Decoder_Set_Audiotype, e.g.: + +#include "cvdvext.h" + +main() +{ + struct decodercmd decmd; + + decmd.param1=audio_AC3; + decmd.cmd=Decoder_Set_Audiotype; + DecoderCommand(device,decmd); +... + +} + +In the directory testsuite are some example programs for using the driver. +I hope they are more or less self explanatory. Just use the --help option. + + +If you want the latest drivers apart from the release versions, use +the public CVS at linuxtv.org : http://linuxtv.org/cgi-bin/cvsweb.cgi/ + + +ZV-support +---------- + +You will faind patches for ZV support in the zv-diffs directory. The +ones with the version number for pcmcia-cs ar for the respective +versions of this package. The rest is for graphics chips or sound +chips, like the patches for the Neomagic graphics chip and YMF sound +chip submitted by Shigehiro Nomura. + +There now three module parameters that are all set to 1 (=on) but can +be set to off in /etc/pcmcia/config.opts +They are : "svhs" for switching the svhs output DAC on or off (0 or 1). + "composite" for switching the composite output DAC on or off. + "use_zv" for enabling zv output if you compiled with the + -DUSE_ZV setting in margi_cs.mk. + +E.g. +module "margi_cs" opts "use_zv=0" +turns off zv output. +or +module "margi_cs" opts "composite=0 svhs=0" +turns off the external outputs. + +WHO DO I BLAME/FLAME? +=== == = ============ + +Send comments, patches, free pizza to . + + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/README.CVS linux.20pre5-ac2/drivers/media/video/margi/README.CVS --- linux.20pre5/drivers/media/video/margi/README.CVS 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/README.CVS 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,13 @@ +1) unpack pcmcia_cs distribution + % tar zxvf pcmcia-cs-3.1.14.tar.gz + +2) cd pcmcia-cs-3.1.14 + % cvs co margi2 + +3) cp margi2/margi_cs.mk.MAIN margi_cs.mk + +4) For ZV support in pcmcia-cs use zv.diff. Remember, this is just the + first step to get to watching the output on your notebook's screen. + If you have pcmcia-cs versio >= 3.1.25 you need to use zv.diff.3.1.25. + The patches currently only work for the Rigoch 5c478 controller. + Anybody with information about ZV regarding graphic chips, please tell me. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/ringbuffy.c linux.20pre5-ac2/drivers/media/video/margi/ringbuffy.c --- linux.20pre5/drivers/media/video/margi/ringbuffy.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/ringbuffy.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,212 @@ +/* + ringbuffy.c + + Copyright (C) Marcus Metzler for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#define __NO_VERSION__ + +#include "margi.h" +#include "ringbuffy.h" + +#ifndef outsl_ns +#define outsl_ns outsl +#endif + +int ring_init (ringbuffy *rbuf, long size) +{ + rbuf->size = 0; + rbuf->read_pos = 0; + rbuf->write_pos = 0; + + if (size > 0){ + if( !(rbuf->buffy = (char *) vmalloc(sizeof(char)*size)) ){ + MDEBUG(0, + "Not enough memory for ringbuffy\n"); + return -1; + } + } else { + MDEBUG(0, "Wrong size for ringbuffy\n"); + return -1; + } + + rbuf->size = size; + return 0; +} + + +void ring_destroy(ringbuffy *rbuf) +{ + if (rbuf->size){ + vfree(rbuf->buffy); + rbuf->buffy = NULL; + } + rbuf->size = 0; + rbuf->read_pos = 0; + rbuf->write_pos = 0; +} + + +int ring_write(ringbuffy *rbuf, const char *data, int count) +{ + + long diff, free, pos, rest; + + + if (count <=0 || !rbuf->buffy) return 0; + pos = rbuf->write_pos; + rest = rbuf->size - pos; + diff = rbuf->read_pos - pos; + free = (diff > 0) ? diff-4 : rbuf->size+diff-4; + + if ( free <= 0 ) return 0; + if ( free < count ) count = free; + + if (count >= rest){ + if(copy_from_user (rbuf->buffy+pos, data, rest)) + return -EFAULT; + if (count - rest) + if(copy_from_user(rbuf->buffy, data+rest, + count - rest)) + return -EFAULT; + rbuf->write_pos = count - rest; + } else { + copy_from_user (rbuf->buffy+pos, data, count); + rbuf->write_pos += count; + } + + return count; +} + + +int ring_writek(ringbuffy *rbuf, const char *data, int count) +{ + + long diff, free, pos, rest; + + + if (count <=0 || !rbuf->buffy) return 0; + pos = rbuf->write_pos; + rest = rbuf->size - pos; + diff = rbuf->read_pos - pos; + free = (diff > 0) ? diff-4 : rbuf->size+diff-4; + + if ( free <= 0 ) return 0; + if ( free < count ) count = free; + + if (count >= rest){ + if(memcpy(rbuf->buffy+pos, data, rest)) + return -EFAULT; + if (count - rest) + if(memcpy(rbuf->buffy, data+rest, + count - rest)) + return -EFAULT; + rbuf->write_pos = count - rest; + } else { + memcpy(rbuf->buffy+pos, data, count); + rbuf->write_pos += count; + } + + return count; +} + + + + +int ring_read(ringbuffy *rbuf, char *data, int count) +{ + + long diff, free, pos, rest; + + + if (count <=0 || !rbuf->buffy) return 0; + pos = rbuf->read_pos; + rest = rbuf->size - pos; + diff = rbuf->write_pos - pos; + free = (diff >= 0) ? diff : rbuf->size+diff; + + if ( free <= 0 ) return 0; + if ( free < count ) count = free; + + if ( count >= rest ){ + memcpy(data,rbuf->buffy+pos,rest); + if ( count - rest) + memcpy(data+rest,rbuf->buffy,count-rest); + rbuf->read_pos = count - rest; + } else { + memcpy(data,rbuf->buffy+pos,count); + rbuf->read_pos += count; + } + + return count; +} + +int ring_read_direct(ringbuffy *rbuf, int addr, int count) +{ + + long diff, free, pos, rest; + + + if (count <=0 || !rbuf->buffy) return 0; + pos = rbuf->read_pos; + rest = rbuf->size - pos; + diff = rbuf->write_pos - pos; + free = (diff >= 0) ? diff : rbuf->size+diff; + + if ( free <= 0 ) return 0; + if ( free < count ) count = free; + + if ( count >= rest ){ + outsl_ns(addr,rbuf->buffy+pos,rest/4); + if ( count - rest) + outsl_ns(addr,rbuf->buffy,(count-rest)/4); + rbuf->read_pos = count - rest; + } else { + outsl_ns(addr,rbuf->buffy+pos,count/4); + rbuf->read_pos += count; + } + + return count; +} + + +long ring_read_rest(ringbuffy *rbuf){ + long diff, free, pos; + + if (!rbuf->buffy) return 0; + pos = rbuf->read_pos; + diff = rbuf->write_pos - pos; + free = (diff >= 0) ? diff : rbuf->size+diff; + + return free; +} + +long ring_write_rest(ringbuffy *rbuf){ + long diff, free, pos; + + if (!rbuf->buffy) return 0; + pos = rbuf->write_pos; + diff = rbuf->read_pos - pos; + free = (diff > 0) ? diff-4 : rbuf->size+diff-4; + + return free; +} + +void ring_flush(ringbuffy *rbuf){ + rbuf->read_pos = 0; + rbuf->write_pos = 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/ringbuffy.h linux.20pre5-ac2/drivers/media/video/margi/ringbuffy.h --- linux.20pre5/drivers/media/video/margi/ringbuffy.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/ringbuffy.h 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,43 @@ +/* + cvdv.h + + Copyright (C) Marcus Metzler for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef RINGBUFFY_H +#define RINGBUFFY_H + + +#define FULL_BUFFER -1000 +typedef struct ringbuffy{ + long read_pos; + long write_pos; + long size; + char *buffy; +} ringbuffy; + +int ring_init (ringbuffy *rbuf, long size); +void ring_destroy(ringbuffy *rbuf); +int ring_write(ringbuffy *rbuf, const char *data, int count); +int ring_writek(ringbuffy *rbuf, const char *data, int count); +int ring_read(ringbuffy *rbuf, char *data, int count); +long ring_read_rest(ringbuffy *rbuf); +long ring_write_rest(ringbuffy *rbuf); +void ring_flush(ringbuffy *rbuf); +int ring_read_direct(ringbuffy *rbuf, int addr, int count); + +#endif /* RINGBUFFY_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/spu.c linux.20pre5-ac2/drivers/media/video/margi/spu.c --- linux.20pre5/drivers/media/video/margi/spu.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/spu.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,103 @@ +/* + spu.c + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#define __NO_VERSION__ + +#include "spu.h" +#include "l64021.h" + +int DecoderHighlight(struct cvdv_cards *card, int active, u8 * coli, + u8 * btn_posi) +{ + int i; + if ((coli == NULL) || (btn_posi == NULL)) + return 1; + MDEBUG(0,": -- DecoderHighlight: col 0x%02X%02X, contr 0x%02X%02X, act %d, %d,%d - %d,%d\n", + coli[0], coli[1], coli[2], coli[3], active, + (((int) btn_posi[0] & 0x3F) << 4) | (btn_posi[1] >> 4), + (((int) btn_posi[3] & 0x3F) << 4) | (btn_posi[4] >> 4), + (((int) btn_posi[1] & 0x03) << 8) | btn_posi[2], + (((int) btn_posi[4] & 0x03) << 8) | btn_posi[5]); + //for (i=0; i<4; i++) DecoderWriteByte(card,0x1C0+i,coli[i]); +// DecoderWriteByte(card,0x1C0,coli[1]); +// DecoderWriteByte(card,0x1C1,coli[0]); +// DecoderWriteByte(card,0x1C2,coli[3]); +// DecoderWriteByte(card,0x1C3,coli[2]); + //for (i=0; i<6; i++) DecoderWriteByte(card,0x1C4+i,btn_posi[i]); +// for (i=0; i<6; i++) DecoderWriteByte(card,0x1C4+i,btn_posi[5-i]); + //if (active) DecoderSetByte(card,0x1BF,0x01); + //else DecoderDelByte(card,0x1BF,0x01); + + //for (i=0; i<4; i++) card->highlight[i]=coli[3-i]; + card->highlight[0] = coli[1]; + card->highlight[1] = coli[0]; + card->highlight[2] = coli[3]; + card->highlight[3] = coli[2]; + for (i = 0; i < 6; i++) + card->highlight[4 + i] = btn_posi[5 - i]; + card->highlight_valid = 1; + if (active) + DecoderWriteByte(card, 0x1BF, 0x01); + else + DecoderWriteByte(card, 0x1BF, 0x00); +//DecoderSetByte(card,0x135,0x02); // Enable SPU Mix +//DecoderWriteByte(card,0x1A0,0x01); // decode start, display on + return 0; +} + +int DecoderSPUPalette(struct cvdv_cards *card, int length, u8 * palette) +{ + int i; + MDEBUG(1,": -- DecoderSPUPalette: setting up %d bytes of SPU palette(Y,Cr,Cb):", length); + for (i = 0; i < (length / 3); i++) + MDEBUG(1," %d=(%d,%d,%d)", i, palette[i * 3],palette[i * 3 + 1], + palette[i * 3 + 2]); + MDEBUG(1,"\n"); + DecoderDelByte(card, 0x1A0, 0x01); // SPU decode stop + DecoderSetByte(card, 0x1A0, 0x10); + for (i = 0; i < length; i++) + DecoderWriteByte(card, 0x1BE, palette[i]); + DecoderSetByte(card, 0x1A0, 0x01); // SPU decode start + return 0; +} + +int DecoderSPUStream(struct cvdv_cards *card, int stream, int active) +{ + MDEBUG(1,": -- DecoderSPUStream: stream %d, active %d\n", stream, + active); + if (stream < 32) { + card->reg092 |= (0x20 | (stream & 0x1F)); // stream ID and select + DecoderWriteByte(card, 0x092, card->reg092); + DecoderMaskByte(card, 0x112, 0x20, 0x20); // chroma filter enable + DecoderMaskByte(card, 0x1A1, 0x0F, 0x00); // SPU timeout + DecoderWriteByte(card, 0x1BF, 0x00); // HighLight off + DecoderSetByte(card, 0x135, 0x02); // Enable SPU Mix + if (active) + DecoderWriteByte(card, 0x1A0, 0x01); // decode start, display on + else + DecoderWriteByte(card, 0x1A0, 0x05); // decode start, display off + } else { + DecoderWriteByte(card, 0x1A0, 0x04); // decode stop, display off + card->reg092 &= (~0x20); // stream select off + DecoderWriteByte(card, 0x092, card->reg092); + DecoderDelByte(card, 0x135, 0x02); // Disable SPU Mix + } + return 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/spu.h linux.20pre5-ac2/drivers/media/video/margi/spu.h --- linux.20pre5/drivers/media/video/margi/spu.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/spu.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,33 @@ +/* + spu.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef CVDV_SPU_H +#define CVDV_SPU_H + +#include "cardbase.h" + +int DecoderHighlight(struct cvdv_cards *card, int active, u8 * coli, + u8 * btn_posi); + +int DecoderSPUPalette(struct cvdv_cards *card, int length, u8 * palette); + +int DecoderSPUStream(struct cvdv_cards *card, int stream, int active); + +#endif /* CVDV_SPU_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/streams.c linux.20pre5-ac2/drivers/media/video/margi/streams.c --- linux.20pre5/drivers/media/video/margi/streams.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/streams.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,444 @@ +/* + streams.c + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#define __NO_VERSION__ + +#include "streams.h" +#include "dram.h" +#include "l64021.h" +#include "video.h" +#include "audio.h" + +// Frees allocated channel buffers +int DecoderKillChannelBuffers(struct cvdv_cards *card) +{ + MDEBUG(1, ": -- DecoderKillChannelBuffers\n"); + DecoderStopDecode(card); + DRAMFree(card, card->VideoES); + card->VideoES = BLANK; + DRAMFree(card, card->AudioES); + card->AudioES = BLANK; + DRAMFree(card, card->VideoPES); + card->VideoPES = BLANK; + DRAMFree(card, card->DataDump); + card->DataDump = BLANK; + DRAMFree(card, card->AudioPES); + card->AudioPES = BLANK; + DRAMFree(card, card->NaviBank); + card->NaviBank = BLANK; + card->ChannelBuffersAllocated = 0; +// DecoderWriteWord( + return 0; +} + +// Allocates channel buffers +// All sizes in bytes, preferably multiple of 256 (will be rounded up otherwise) +int DecoderSetChannelBuffers(struct cvdv_cards *card, int VideoES, // Video ES Channel Buffer size, e.g. 229376 byte for NTSC + int AudioES, // Audio ES Channel Buffer size, 4096 byte + int VideoPES, // Video PES Header / SPU Channel Buffer size, 512 byte + int DataDump, // Data Dump Channel Buffer size, e.g. 80896 byte + int AudioPES, // Audio PES Header / System Channel Buffer size, 512 byte + int NaviBank) +{ // Navi Bank Channel Buffer size, 2048 byte +#define BUFFERSET(buf, id, adr,align) if (buf>0) {\ + if (buf&((1<buf=addr;\ + addr>>=align;\ + DecoderWriteByte(card,adr,addr&0xFF);\ + DecoderWriteByte(card,adr+1,(addr>>8)&(0x003F));\ + addr+=(buf>>align);\ + DecoderWriteByte(card,adr+2,(addr-1)&0xFF);\ + DecoderWriteByte(card,adr+3,((addr-1)>>8)&0x003F);\ +} + u32 addr; + MDEBUG(1, ": -- DecoderSetChannelBuffers\n"); + //DecoderStopDecode(card); + DecoderStopChannel(card); + VideoES >>= 1; // change to word sizes + AudioES >>= 1; + VideoPES >>= 1; + DataDump >>= 1; + AudioPES >>= 1; + NaviBank >>= 1; + if (card->ChannelBuffersAllocated) + DecoderKillChannelBuffers(card); + BUFFERSET(VideoES, "VideoES", 0x048, 7); + BUFFERSET(AudioES, "AudioES", 0x04C, 7); + BUFFERSET(VideoPES, "VideoPES", 0x050, 7); + BUFFERSET(DataDump, "DataDump", 0x054, 7); + BUFFERSET(AudioPES, "AudioPES", 0x058, 7); + BUFFERSET(NaviBank, "NaviBank", 0x05C, 7); + + card->VideoESSize = VideoES; + card->AudioESSize = AudioES; + card->VideoPESSize = VideoPES; + card->DataDumpSize = DataDump; + card->AudioPESSize = AudioPES; + card->NaviBankSize = NaviBank; + + DecoderWriteByte(card, 0x044, 0x7F); + DecoderWriteByte(card, 0x044, 0x01); + if (NaviBank) { + card->reg07B |= 0x10; // navi pack counter enable + DecoderWriteByte(card, 0x07B, card->reg07B); + //DecoderSetByte(card,0x07B,0x10); // navi pack counter enable + card->NaviPackAddress = + (DecoderReadWord(card, 0x05C) & 0x3FFF) << 7; + MDEBUG(4, ": navi bank init'ed: 0x%08X\n",card->NaviPackAddress); + } else { + card->reg07B &= ~0x10; // navi pack counter disable + DecoderWriteByte(card, 0x07B, card->reg07B); + //DecoderDelByte(card,0x07B,0x10); // navi pack counter disable + card->NaviPackAddress = 0; + } + card->ChannelBuffersAllocated = 1; +#undef BUFFERSET + return 0; +} + +//int DecoderReadFifo + +int DecoderUnPrepare(struct cvdv_cards *card) +{ + MDEBUG(0, ": -- DecoderUnPrepare\n"); + //DecoderStopDecode(card); + DecoderStopChannel(card); + DecoderKillChannelBuffers(card); + return 0; +} + +void DecoderPrepare(struct cvdv_cards *card) +{ + //VideoSetBackground(card,0,0,0,0); // Video on black + VideoSetBackground(card, 1, 0, 0, 0); // black + //VideoSetBackground(card,2,83,90,249); // Red + //VideoSetBackground(card,2,155,53,53); // Green + //VideoSetBackground(card,2,35,212,114); // Blue + //VideoSetBackground(card,2,4,128,128); // Black + //VideoSetBackground(card,3,155,53,53); // Video on Green + + //DecoderWriteByte(card,0x044,0x00); // Reset channel buffers on error +// DecoderWriteByte(card,0x044,0x01); // don't Reset channel buffers on error + + DecoderWriteByte(card, 0x040, 0x01); // Reset Aux FIFO + DecoderWriteByte(card, 0x041, 0x01); // Reset Data FIFO + //DecoderWriteByte(card,0x044,0x7E); // Reset channel buffers, Reset channel buffers on error + DecoderWriteByte(card, 0x044, 0x7F); // Reset channel buffers, don't Reset channel buffers on error +// udelay(100); +// DecoderWriteByte(card,0x040,0x00); // Reset Aux FIFO +// DecoderWriteByte(card,0x041,0x00); // Reset Data FIFO +// DecoderDelByte(card,0x044,0x7E); // Reset channel buffers +} + +// Selects audio type MPEG and sets stream ID's +// AID: -1=all MPEG, Audio Stream ID: 0..31 +// AExt: -1=unused, Audio Stream Extension ID: 0..31, only used if AType=5 +void DecoderSelectAudioID(struct cvdv_cards *card) +{ + int AID = card->setup.audioID; + int AExt = card->setup.audioIDext; + MDEBUG(1, ": -- SelectAudio %d %d\n", AID, AExt); + DecoderWriteByte(card, 0x07C, AExt & 0x1F); // Audio Stream Extension ID + card->reg08F = (card->reg08F & ~0x1F) | (AID & 0x1F); + DecoderWriteByte(card, 0x08F, card->reg08F); + //DecoderMaskByte(card,0x08F,0x1F,AID&0x1F); // Set Stream ID +} + +// AHeader: 0=No Headers, 1=first PTS/DTS header, 2=all headers, 3=All with PTS/DTS +// AType: 0=disable audio, 1=MPEG ID (MPEG 1), 2=Lin.PCM ID, 3=AC3 ID, 4=all MPEG (use only, if just one MPEG audio stream), 5=MPEG multichannel ID (MPEG 2) +// AID: -1=all MPEG, Audio Stream ID: 0..31 +// AExt: -1=unused, Audio Stream Extension ID: 0..31, only used if AType=5 +// IEC956: 0:MPEG/AC3 data on digital out 1:IEC956 data on digital S/PDIF out +void DecoderPrepareAudio(struct cvdv_cards *card) +{ + int AHeader = 2; + int AType = 3; + int AID = card->setup.audioID; + int AExt = card->setup.audioIDext; + int IEC956 = card->setup.SPDIFmode; + MDEBUG(1, ": -- PrepAudio %d %d %d %d %d\n", + AHeader, card->setup.audioselect, AID, AExt, IEC956); + switch (card->setup.audioselect) { + case audio_disable: + case audio_none: + case audio_SDDS: + AType = 0; + break; + case audio_MPEG: // MPEG Audio + AType = 1; + break; + case audio_MPEG_EXT: // MPEG Audio with extension stream + AType = 5; + break; + case audio_LPCM: // Linear Pulse Code Modulation LPCM + AType = 2; + break; + case audio_AC3: // AC-3 + AType = 3; + break; + case audio_DTS: // DTS + AType = 8; + break; + } + if (AType <= 0) { + card->reg08F = 0x00; // disable audio and discard all packets + DecoderWriteByte(card, 0x08F, card->reg08F); + //DecoderWriteByte(card,0x08F,0x00); // disable audio and discard all packets + //DecoderMaskByte(card,0x093,0xC3,0xC0); // write no headers + card->reg093 = (card->reg093 & ~0x03); // write no headers + DecoderWriteByte(card, 0x093, card->reg093); + } else { + AudioOpen(card); + DecoderMaskByte(card, 0x165, 0x1F, 0x00); // reset the register + if (AType == 8) { // DTS + card->reg090 |= 0x01; // DTS in Transport Private 1 Stream stored in AudioES channel buffer + DecoderWriteByte(card, 0x090, card->reg090); + //DecoderSetByte(card,0x090,0x01); // DTS in Transport Private 1 Stream stored in AudioES channel buffer + AudioSetMode(card, 0); + DecoderSetByte(card, 0x165, 0x01); + AudioStartFormat(card); + } else if (AType == 3) { // AC3 + card->reg090 |= 0x01; // AC3 in Transport Private 1 Stream stored in AudioES channel buffer + DecoderWriteByte(card, 0x090, card->reg090); + //DecoderSetByte(card,0x090,0x01); // AC3 in Transport Private 1 Stream stored in AudioES channel buffer + AudioSetMode(card, ((IEC956) ? 1 : 3)); + } else if (AType == 2) { // PCM + card->reg090 |= 0x01; // PCM in Transport Private 1 Stream stored in AudioES channel buffer + DecoderWriteByte(card, 0x090, card->reg090); + //DecoderSetByte(card,0x090,0x01); // PCM in Transport Private 1 Stream stored in AudioES channel buffer + AudioSetMode(card, 4); + } else { // MPEG + card->reg090 &= ~0x01; // MPEG Audio stored in AudioES channel buffer + DecoderWriteByte(card, 0x090, card->reg090); + //DecoderDelByte(card,0x090,0x01); // MPEG Audio stored in AudioES channel buffer + if (AID < 0) + AType = 4; + if (AExt >= 0) + AType = 5; + else + AExt = -1; + AudioSetMode(card, ((IEC956) ? 0 : 2)); + } + card->setup.audioID = AID; + card->setup.audioIDext = AExt; + DecoderSelectAudioID(card); + card->reg08F = (card->reg08F & ~0xE0) | ((AType & 0x07) << 5); // Set Stream Type + DecoderWriteByte(card, 0x08F, card->reg08F); + //DecoderMaskByte(card,0x08F,0xE0,(AType&0x07)<<5); // Set Stream Type + AudioSetVolume(card, 0xFF); // Set PCM scale to full volume + //DecoderMaskByte(card,0x093,0xC3,(AHeader&0x03)|0xC0); // write header select + card->reg093 = (card->reg093 & ~0x03) | (AHeader & 0x03); // write header select + DecoderWriteByte(card, 0x093, card->reg093); + // Mute the card and put it in play mode, then wait for the parameters to be parsed and un-mute if successful + //AudioMute(card,1); + if (AType > 0) { + AudioStartDecode(card); + //AudioSetPlayMode(card,MAUDIO_PLAY); + AudioSetPlayMode(card, MAUDIO_PAUSE); + } + //card->startingA=1; + } + card->lastaattr = 0; +} + +// VHeader: -1=disable Video, 0=No Headers, 1=first PTS/DTS header, 2=all headers, 3=All with PTS/DTS +// VID: -1=all MPEG, 0..15=Video Stream ID +void DecoderPrepareVideo(struct cvdv_cards *card) +{ + int VHeader = 3; + int VID = card->setup.videoID; + if (VHeader < 0) { + card->reg091 = 0x00; + DecoderWriteByte(card, 0x091, card->reg091); + //DecoderWriteByte(card,0x091,0x00); + } else { + if (VID < 0) { + card->reg091 = ((VHeader & 0x03) << 6) | (2 << 4); + DecoderWriteByte(card, 0x091, card->reg091); + //DecoderWriteByte(card,0x091,((VHeader&0x03)<<6)|(2<<4)); + } else { + card->reg091 = + ((VHeader & 0x03) << 6) | (1 << 4) | (VID & + 0x0F); + DecoderWriteByte(card, 0x091, card->reg091); + //DecoderWriteByte(card,0x091,((VHeader&0x03)<<6)|(1<<4)|(VID&0x0F)); + } + } +} + +// Prepare Decoder for Elementary Streams, Disable Preparser +int DecoderPrepareES(struct cvdv_cards *card) +{ + int i; + MDEBUG(1, ": -- PrepareES\n"); + //DecoderStopDecode(card); + +// DecoderWriteByte(card,0x05,0x00); + + DecoderMaskByte(card, 0x007, 0xCE, 0xC2 | (3 << 2)); // Stream Select: A/V Elementary Stream + MDEBUG(3, ": Int - A VideoES w/r addr: %08X %08X\n", + (DecoderReadByte(card,0x060)|(DecoderReadByte(card,0x061)<<8)| + (DecoderReadByte(card,0x062)<<16))<<2, + (DecoderReadByte(card,0x06C)|(DecoderReadByte(card,0x06D)<<8)| + (DecoderReadByte(card,0x06E)<<16))<<2); + // set the decoding buffers + card->reg093 = (card->reg093 & ~0xFC); // write no header + DecoderWriteByte(card, 0x093, card->reg093); + if ((i = DecoderSetChannelBuffers(card, 256000, 4096, 0, 0, 0, 0))) { + MDEBUG(0, ": SetDecoderBuffers failed for buffer at 0x%03X\n", i); + DecoderKillChannelBuffers(card); + return 1; + } + MDEBUG(3, ": Int - B VideoES w/r addr: %08X %08X\n", + (DecoderReadByte(card,0x060)|(DecoderReadByte(card,0x061)<<8)| + (DecoderReadByte(card,0x062)<<16))<<2, + (DecoderReadByte(card,0x06C)|(DecoderReadByte(card,0x06D)<<8)| + (DecoderReadByte(card,0x06E)<<16))<<2); + + MDEBUG(3, ": Int - C VideoES w/r addr: %08X %08X\n", + (DecoderReadByte(card,0x060)|(DecoderReadByte(card,0x061)<<8)| + (DecoderReadByte(card,0x062)<<16))<<2, + (DecoderReadByte(card,0x06C)|(DecoderReadByte(card,0x06D)<<8)| + (DecoderReadByte(card,0x06E)<<16))<<2); + +// DecoderStartChannel(card); +// DecoderStartDecode(card); + + MDEBUG(3, ": Int - D VideoES w/r addr: %08X %08X\n", + (DecoderReadByte(card,0x060)|(DecoderReadByte(card,0x061)<<8)| + (DecoderReadByte(card,0x062)<<16))<<2, + (DecoderReadByte(card,0x06C)|(DecoderReadByte(card,0x06D)<<8)| + (DecoderReadByte(card,0x06E)<<16))<<2); + + DecoderPrepare(card); + + return 0; +} + +// Prepare Decoder for Packetised Elementary Streams, set parameters of Preparser +int DecoderPreparePES(struct cvdv_cards *card) +{ + + // SPUID: -1=No SPU, 0..31=Display SPU of this ID + // DataDump: 0=disable DataDump, 1=process DataDump Substreams + // PackHeader: 0=write no headers, 1=write one header, 2=write all headers + // SysHeader: 0=write no headers, 1=write one header, 2=write all headers + // DSIHeader: 0=write no headers, 3=write PCI and DSI headers and packets + int i; + int SPUID = -1; + int DataDump = 0; + int PackHeader = 0; + int SysHeader = 0; + int DSIHeader = 0; + + MDEBUG(1, ": -- PreparePES\n"); + DecoderMaskByte(card, 0x007, 0xCE, 0xC2 | (0 << 2)); // Stream Select: A/V PES Packets + + if (SPUID < 0) + card->reg092 = 0; // Do we use SPU? + else + card->reg092 = 0x20 | (SPUID & 0x1F); + if (DataDump) + card->reg092 |= 0x40; // Do we use DataDump? + DecoderWriteByte(card, 0x092, card->reg092); + //DecoderMaskByte(card,0x093,0xFC,((DSIHeader&0x03)<<6)|((PackHeader&0x03)<<4)|((SysHeader&0x03)<<2)); + card->reg093 = + (card->reg093 & ~0xFC) | (((DSIHeader & 0x03) << 6) | + ((PackHeader & 0x03) << 4) | + ((SysHeader & 0x03) << 2)); + DecoderWriteByte(card, 0x093, card->reg093); + // set the decoding buffers + if ( + (i = + DecoderSetChannelBuffers(card, 256000, 4096, 512, 0, 512, + 0))) { + MDEBUG(0,": SetDecoderBuffers failed for buffer at 0x%03X\n", i); + DecoderKillChannelBuffers(card); + return 1; + } + + DecoderPrepare(card); + + return 0; +} + + +// Prepare Decoder for MPEG 1 Systems Streams or MPEG 2 Program Streams +// SPUID: -1:ignore, 0...15 SPU Substream ID +// DataDump: 0:disable data dump stream, 1:enable data dump stream +// PackHeader: 0:write no headers, 1:write one header, 2:write all headers, 3:always discard +// SysHeader: 0:always discard, 1:write one header, 2:write all headers, 3:always discard +// DSIHeader: 0:write no DSI or PCI headers, 3:write DSI and PCI headers + packets +// DVD: 0: normal MPEG-2 data, 1: DVD stream with navi pack data +int DecoderPreparePS(struct cvdv_cards *card, + int SPUID, int DataDump, + int PackHeader, int SysHeader, int DSIHeader, int DVD) +{ + int i=0; + MDEBUG(1, ": -- PreparePS %s\n", ((DVD) ? "DVD" : "")); + //DecoderStopDecode(card); + DecoderMaskByte(card, 0x007, 0xCE, 0xC2 | (1 << 2)); // Stream Select: MPEG1 System / MPEG2 Program Stream + + if (SPUID < 0) + card->reg092 = 0; // Do we use SPU? + else + card->reg092 = 0x20 | (SPUID & 0x1F); + if (DataDump) + card->reg092 |= 0x40; // Do we use DataDump? + DecoderWriteByte(card, 0x092, card->reg092); + //DecoderMaskByte(card,0x093,0xFC,((DSIHeader&0x03)<<6)|((PackHeader&0x03)<<4)|((SysHeader&0x03)<<2)); + card->reg093 = + (card->reg093 & ~0xFC) | (((DSIHeader & 0x03) << 6) | + ((PackHeader & 0x03) << 4) | + ((SysHeader & 0x03) << 2)); + DecoderWriteByte(card, 0x093, card->reg093); + // set the decoding buffers + if (DVD) { // do we need SPU-, navi- and datadump-buffers? + + // if(card->videomode == NTSC) + i = DecoderSetChannelBuffers(card, 340000, 32768, 32768, 0, + 512,4096) ; + //else + // i = DecoderSetChannelBuffers(card, 291878, 16384, 512, 0, + // 512,0) ; + + if (i) { + MDEBUG(0,": SetDecoderBuffers failed for buffer at 0x%03X\n", i); + DecoderKillChannelBuffers(card); + return 1; + } + + } else { // normal PS + if ( + (i = + DecoderSetChannelBuffers(card, 340000, 32768, 512, + 0, 512, 0))) { + MDEBUG(0,": SetDecoderBuffers failed for buffer at 0x%03X\n", i); + DecoderKillChannelBuffers(card); + return 1; + } + } + + DecoderPrepare(card); + + return 0; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/streams.h linux.20pre5-ac2/drivers/media/video/margi/streams.h --- linux.20pre5/drivers/media/video/margi/streams.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/streams.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,79 @@ +/* + streams.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef CVDV_STREAMS_H +#define CVDV_STREAMS_H + +#include "cardbase.h" + +// Frees allocated channel buffers +int DecoderKillChannelBuffers(struct cvdv_cards *card); + +// Allocates channel buffers +// All sizes in bytes, preferably multiple of 256 (will be rounded up otherwise) +int DecoderSetChannelBuffers(struct cvdv_cards *card, int VideoES, // Video ES Channel Buffer size, e.g. 229376 byte for NTSC + int AudioES, // Audio ES Channel Buffer size, 4096 byte + int VideoPES, // Video PES Header / SPU Channel Buffer size, 512 byte + int DataDump, // Data Dump Channel Buffer size, e.g. 80896 byte + int AudioPES, // Audio PES Header / System Channel Buffer size, 512 byte + int NaviBank); // Navi Bank Channel Buffer size, 2048 byte + +//int DecoderReadFifo + +int DecoderUnPrepare(struct cvdv_cards *card); + +void DecoderPrepare(struct cvdv_cards *card); + +// Selects audio type MPEG and sets stream ID's +// AID: -1=all MPEG, Audio Stream ID: 0..31 +// AExt: -1=unused, Audio Stream Extension ID: 0..31, only used if AType=5 +void DecoderSelectAudioID(struct cvdv_cards *card); + +// AHeader: 0=No Headers, 1=first PTS/DTS header, 2=all headers, 3=All with PTS/DTS +// AType: 0=disable audio, 1=MPEG ID (MPEG 1), 2=Lin.PCM ID, 3=AC3 ID, 4=all MPEG (use only, if just one MPEG audio stream), 5=MPEG multichannel ID (MPEG 2) +// AID: -1=all MPEG, Audio Stream ID: 0..31 +// AExt: -1=unused, Audio Stream Extension ID: 0..31, only used if AType=5 +// IEC956: 0:MPEG/AC3 data on digital out 1:IEC956 data on digital S/PDIF out +void DecoderPrepareAudio(struct cvdv_cards *card); + +// VHeader: -1=disable Video, 0=No Headers, 1=first PTS/DTS header, 2=all headers, 3=All with PTS/DTS +// VID: -1=all MPEG, 0..15=Video Stream ID +void DecoderPrepareVideo(struct cvdv_cards *card); + +// Prepare Decoder for Elementary Streams, Disable Preparser +int DecoderPrepareES(struct cvdv_cards *card); + +// Prepare Decoder for Packetised Elementary Streams, set parameters of Preparser +int DecoderPreparePES(struct cvdv_cards *card); + + +// Prepare Decoder for MPEG 1 Systems Streams or MPEG 2 Program Streams +// SPUID: -1:ignore, 0...15 SPU Substream ID +// DataDump: 0:disable data dump stream, 1:enable data dump stream +// PackHeader: 0:write no headers, 1:write one header, 2:write all headers, 3:always discard +// SysHeaader: 0:always discard, 1:write one header, 2:write all headers, 3:always discard +// DSIHeader: 0:write no DSI or PCI headers, 3:write DSI and PCI headers + packets +// DVD: 0: normal MPEG-2 data, 1: DVD stream with navi pack data +int DecoderPreparePS(struct cvdv_cards *card, + int SPUID, int DataDump, + int PackHeader, int SysHeader, int DSIHeader, + int DVD); + +#endif /* CVDV_STREAMS_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/video.c linux.20pre5-ac2/drivers/media/video/margi/video.c --- linux.20pre5/drivers/media/video/margi/video.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/video.c 2002-08-06 15:42:12.000000000 +0100 @@ -0,0 +1,525 @@ +/* + video.c + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +// +// Video Decoder +// +#define __NO_VERSION__ + +#include "video.h" +#include "l64021.h" +#include "dram.h" + +// Set the background of the OSD and SPU and it's color +// mode=0: Video on Black +// mode=1: Black +// mode=2: Selected Color +// mode=3: Video on Selected Color +void VideoSetBackground(struct cvdv_cards *card, int mode, u8 Y, u8 Cb, + u8 Cr) +{ + DecoderWriteByte(card, 0x10A, Y); + DecoderWriteByte(card, 0x10B, Cb); + DecoderWriteByte(card, 0x10C, Cr); + DecoderMaskByte(card, 0x109, 0xC0, mode << 6); +} + + +int DecoderStartDecode(struct cvdv_cards *card) +{ + DecoderSetByte(card, 0x0F6, 0x01); +#ifdef DVB + if (card->audiostate.AVSyncState) +#endif + card->videosync = 1; + return 0; +} + +int DecoderStopDecode(struct cvdv_cards *card) +{ + DecoderDelByte(card, 0x0F6, 0x01); + card->videosync = 0; + return 0; +} + +// Sets Display Override (Still Image Display) to Frame Buffer at specified addresses, +// addresses are 16 bit, in 64 byte resolution +// mode: 0=off, 1=Frame, 2=Field +// width: width of the still picture in 8 pixel units +int DecoderStillImageDisplay(struct cvdv_cards *card, int mode, int width, + u16 LumaAddr, u16 ChromaAddr) +{ + DecoderStopDecode(card); + DecoderWriteWord(card, 0x11D, LumaAddr); + DecoderWriteWord(card, 0x11F, ChromaAddr); + DecoderWriteByte(card, 0x11B, width & 0x7F); + DecoderMaskByte(card, 0x109, 0x30, (mode & 3) << 4); // Display Override Mode + return 0; +} + +// Frees allocated frame buffers +int DecoderKillFrameBuffers(struct cvdv_cards *card) +{ + MDEBUG(1, ": -- DecoderKillFrameBuffers\n"); + DecoderStopDecode(card); + DRAMFree(card, card->FrameStoreLuma1); + card->FrameStoreLuma1 = BLANK; + DRAMFree(card, card->FrameStoreChroma1); + card->FrameStoreChroma1 = BLANK; + DRAMFree(card, card->FrameStoreLuma2); + card->FrameStoreLuma2 = BLANK; + DRAMFree(card, card->FrameStoreChroma2); + card->FrameStoreChroma2 = BLANK; + DRAMFree(card, card->FrameStoreLumaB); + card->FrameStoreLumaB = BLANK; + DRAMFree(card, card->FrameStoreChromaB); + card->FrameStoreChromaB = BLANK; + card->FrameBuffersAllocated = 0; +// DecoderWriteWord( + return 0; +} + +int DecoderSetFrameBuffers(struct cvdv_cards *card, int lines, // number of lines of the decoded MPEG + int TwoFrames, // 1 if no B-Frames are present in the video stream, thus allowing only 2 framestores + int RMM) // 1 if RMM +{ +#define SEGMENTS 44 // 40..54 for PAL, 44 recommended +#define BUFFERSET(buf,adr,align) if (buf>0) {\ + if (buf&((1<buf=addr;\ + addr>>=align;\ + DecoderWriteByte(card,adr,addr&0xFF);\ + DecoderWriteByte(card,adr+1,(addr>>8)&(0x00FF));\ +} + u32 addr; + int pixel, byteperline; // visible pixel per video line, same for PAL and NTSC + int FrameStoreLuma1, FrameStoreChroma1, + FrameStoreLuma2, FrameStoreChroma2, + FrameStoreLumaB, FrameStoreChromaB; + MDEBUG(1, ": -- DecoderSetFrameBuffers\n"); + DecoderStopDecode(card); + //DecoderStopChannel(card); + //lines=((CCIR601Lines(card->videomode)==625)?576:480); + byteperline = (DecoderReadByte(card, 0x116) & 0x7F) * 8; // main 64-bit reads per line + pixel = byteperline * lines; + FrameStoreLuma1 = FrameStoreLuma2 = FrameStoreLumaB = pixel >> 1; // 8 bit luma per pixel in words + FrameStoreChroma1 = FrameStoreChroma2 = FrameStoreChromaB = + pixel >> 2; // 8+8 bit chroma every 2nd pixel every 2nd line + if (card->FrameBuffersAllocated) + DecoderKillFrameBuffers(card); + BUFFERSET(FrameStoreLuma1, 0x0E0, 5); // Anchor Frame Store 1 + BUFFERSET(FrameStoreChroma1, 0x0E2, 5); + BUFFERSET(FrameStoreLuma2, 0x0E4, 5); // Anchor Frame Store 2 + BUFFERSET(FrameStoreChroma2, 0x0E6, 5); + if (TwoFrames) { + DecoderDelByte(card, 0x0F8, 0x01); + } else { +// if (CCIR601Lines(card->videomode)==525) { // Normal Mode, NTSC + if (!RMM) { // Normal Mode, NTSC + BUFFERSET(FrameStoreLumaB, 0x0E8, 5); // B Frame Store + BUFFERSET(FrameStoreChromaB, 0x0EA, 5); + DecoderDelByte(card, 0x0F8, 0x01); + } else { // Reduced Memory Mode, PAL + // 44 segments with 8 lines each (8 bit luma + 4 bit chroma) + // only display modes 4-8, 10, and 11 are allowed + FrameStoreLumaB = + (8 * byteperline * SEGMENTS) >> 1; + FrameStoreChromaB = + (4 * byteperline * SEGMENTS) >> 1; + BUFFERSET(FrameStoreLumaB, 0x0E8, 5); // B Frame Store + BUFFERSET(FrameStoreChromaB, 0x0EA, 5); + DecoderWriteByte(card, 0x121, SEGMENTS << 1); // Number of segments + DecoderSetByte(card, 0x0F8, 0x01); + } + } + card->FrameBuffersAllocated = 1; +#undef SEGMENTS +#undef BUFFERSET + return 0; +} + +// returns size of the Video ES Buffer in bytes or 0=error +u32 DecoderGetVideoESSize(struct cvdv_cards * card) +{ + if (!card->ChannelBuffersAllocated) + return 0; // buffer not initialised + return (u32) ((DecoderReadWord(card, 0x04A) & 0x3FFF) - + (DecoderReadWord(card, 0x048) & 0x3FFF)) * 256; // bytes +} + +// returns level of fullness in bytes +u32 DecoderGetVideoESLevel(struct cvdv_cards * card) +{ + u32 items; + items = DecoderReadByte(card, 0x086); + items |= ((DecoderReadWord(card, 0x087) & 0x07FF) << 8); + items *= 8; // 64 bit per item + return items; +} + +// pics=0 --> items=bytes +// pics=1 --> items=pictures +void DecoderSetVideoPanic(struct cvdv_cards *card, int pics, int items) +{ + if (pics < 0) { + DecoderMaskByte(card, 0x045, 0x18, 0x00 << 3); // disable panic mode + } else { + if (pics) { + DecoderWriteMWord(card, 0x086, items & 0x0003FFFF); + DecoderMaskByte(card, 0x045, 0x18, 0x02 << 3); // set panic mode to "number of pictures" in VideoES + } else { + DecoderWriteMWord(card, 0x086, + (items / 8) & 0x0003FFFF); + DecoderMaskByte(card, 0x045, 0x18, 0x01 << 3); // set panic mode to "number of 8-byte-frames" in VideoES + } + } +} + +int DecoderClose(struct cvdv_cards *card) +{ + if (card->DecoderOpen) { + MDEBUG(1, ": -- DecoderClose\n"); + DecoderStopDecode(card); + DecoderKillFrameBuffers(card); + card->DecoderOpen = 0; + card->lastvattr = 0; + return 0; + } else + return 1; +} + +// returns 0 on success, 1 on "picture size too big", 2 on "out of DRAM memory" +int DecoderOpen(struct cvdv_cards *card, int x, int y, // size of the decoded MPEG picture + int aspect, // pixel or picture aspect ratio of the MPEG picture: 1=square pixel 2=3:4 3=9:16 4=1:2.21 + int Field, // 0:Frame (interlaced, MPEG-2) , 1:Field (non-interlaced, MPEG-1) structure + int Letterbox, // 0:PanScan (4:3), 1:letterbox (16:9, 8:3) picture ratio + int RMM) // 1:use ReducedMemoryMode +{ + int mode, // Display Mode + i, factor, // zoom factor + top, bottom, left, right, width, height, newwidth, newheight, // screen size + vaspx, vaspy, // output video pixel aspect ratio + paspx, paspy, // input picture pixel aspect ratio + SIF; // 0:Full (480/576 lines, MPEG-2), 1:SIF (half, 240/288 lines, MPEG-1) resolution + + MDEBUG(1, ": -- DecoderOpen x:%d y:%d asp:%d field:%d lt:%d rmm:%d\n", + x, y, aspect, Field, Letterbox, RMM); + if ((x <= 0) || (y <= 0)) + return 4; // picture too small +//if (card->DecoderOpen) return 3; + DecoderStopDecode(card); + DecoderClose(card); // closes only, if already open + vaspy = 11; + vaspx = ((CCIR601Lines(card->videomode) == 525) ? 10 : 12); // screen pixel aspect ratio + // note: this aspect ratio applies to 704 pixel width, but the card's default is 720, wich is not 3:4 picture aspect ratio anymore!? + i = ((x == 720) ? 704 : x); // 720 wide is overscan of 704 wide + switch (aspect) { // MPEG data pixel aspect ratio + case 1: + paspx = 1; + paspy = 1; + break; + default: + case 2: + paspx = 4 * y; + paspy = 3 * i; + break; + case 3: + paspx = 16 * y; + paspy = 9 * i; + break; + case 4: + paspx = 221 * y; + paspy = 100 * i; + break; + } + top = + DecoderReadByte(card, + 0x129) | ((DecoderReadByte(card, 0x12B) & 0x07) + << 8); // current Start- and End Column + bottom = + DecoderReadByte(card, + 0x12A) | ((DecoderReadByte(card, 0x12B) & 0x70) + << 4); + height = (bottom - top + 1) * 2; // screen (frame) height + left = + DecoderReadByte(card, + 0x12C) | ((DecoderReadByte(card, 0x12E) & 0x07) + << 8); // current Start- and End Row + right = + DecoderReadByte(card, + 0x12D) | ((DecoderReadByte(card, 0x12E) & 0x70) + << 4); + width = (right - left + 1) / 2; // screen width, 2 clocks = 1 pixel + + if (RMM) + DecoderSetByte(card, 0x0F8, 0x01); + else + DecoderDelByte(card, 0x0F8, 0x01); + + DecoderWriteByte(card, 0x0EF, 0x08); + + //if (x>width) { // Is the picture too wide for the screen? + // DecoderSetByte(card,0x112,0x40); // Horiz. 2:1 Filter enable + // x/=2; + //} else { + DecoderDelByte(card, 0x112, 0x40); // Horiz. 2:1 Filter disable + //} + + + + + if (1 /*Letterbox */ ) { // Fit to width, reduce height + newwidth = (x * vaspy * paspx / (paspy * vaspx)); // width in right aspect ratio + if (newwidth <= 360) { // less then about half the screen size? + SIF = 1; + newwidth *= 2; + } else { + SIF = 0; + } + if ((newwidth == 704) || (newwidth == 720)) + width = newwidth; // standard sizes? + newheight = + (y * vaspx * paspy / (paspx * vaspy)) * width / x; + factor = newheight * 100 / y; + printk(KERN_INFO LOGNAME + ": Decoder Open: Display size %d x %d, Picture size %d x %d, Demanded size: %d x %d, factor %d\n", + width, height, x, y, newwidth, newheight, factor); + // 16:9 Letterbox + if ((aspect == 3) + || ((aspect == 0) + && (((factor >= 65) && (factor <= 80)) + || ((factor >= 140) && (factor <= 160))))) { + if (SIF) { // height * 1.5, SIF Letterbox + if (RMM) + return 1; // not supported! + height = (y * 3) / 2 - 2; + mode = 3; + } else { // height * 0.75, 16:9 Letterbox + height = (y * 3) / 4 - 2; + mode = 8; + } + // 2.21:1 Letterbox + } else if ((aspect == 4) + || ((aspect == 0) + && (((factor >= 45) && (factor <= 60)) + || (SIF && ((factor >= 90) + && (factor <= 110)))))) { + if (SIF) { // height * 1 + height = y; + mode = 5; + } else { // height / 2 + height = y / 2; + mode = 11; + } + // 3:4 aspect ratio + } else { + if (SIF) { + height = y * 2; + mode = ((Field && ~RMM) ? 9 : 10); + } else if (newwidth > 720) { // picture too wide, scale down to 3/4 + height = (y * 3) / 4; + mode = 8; + } else { + height = y; + mode = ((Field) ? 7 : 5); +// mode=((Field)?5:7); + } + } + width = (x * vaspy * paspx / (paspy * vaspx)) * height / y; + if (x < width) { // does the picture needs a horizontal blow-up? + DecoderWriteByte(card, 0x115, + ((x * 256 + width - 1) / width) & 0xFF); // Horiz.Filter scale, x/width*256, rounded up + DecoderSetByte(card, 0x114, 0x02); // Horiz.Filter enable + } else if (x == width) { + DecoderWriteByte(card, 0x115, 0); // 1:1 scale + DecoderDelByte(card, 0x114, 0x02); // Horiz.Filter disable + } else if (x <= 720) { + width = x; + DecoderWriteByte(card, 0x115, 0); // 1:1 scale + DecoderDelByte(card, 0x114, 0x02); // Horiz.Filter disable + } else { // picture is more than twice the screen width. sigh. + return 1; + } + } else { // Pan-Scan, fit height to maximum + DecoderSetByte(card, 0x117, 0x40); // pan-scan from bitstream +//TODO + newwidth = (x * vaspy * paspx / (paspy * vaspx)); // width in right aspect ratio + newheight = y; + if (newheight <= 288) { // less then about half the screen size? + SIF = 1; + newheight *= 2; + } else { + SIF = 0; + } + if ((newwidth == 704) || (newwidth == 720)) + width = newwidth; // standard sizes? + //newheight=(y*vaspx*paspy/(paspx*vaspy))*width/x; + factor = newheight * 100 / y; + printk(KERN_INFO LOGNAME + ": Decoder Open: Display size %d x %d, Picture size %d x %d, Demanded size: %d x %d, factor %d\n", + width, height, x, y, newwidth, newheight, factor); + if (aspect == 3) { // 16:9 Letterbox + if (SIF) { // height * 1.5, SIF Letterbox + if (RMM) + return 1; // not supported! + height = (y * 3) / 2; + mode = 3; + } else { // height * 0.75, 16:9 Letterbox + height = (y * 3) / 4; + mode = 8; + } + } else if (aspect == 4) { // 2.21:1 Letterbox + if (SIF) { // height * 1 + height = y; + mode = 5; + } else { // height / 2 + height = y / 2; + mode = 11; + } + } else if (aspect == 2) { // 3:4 aspect ratio + if (SIF) { + height = y * 2; + mode = ((Field && ~RMM) ? 9 : 10); + } else if (newwidth > 720) { // picture too wide, scale down to 3/4 + height = (y * 3) / 4; + mode = 8; + } else { + height = y; + mode = ((Field) ? 7 : 5); +// mode=((Field)?5:7); + } + } + width = (x * vaspy * paspx / (paspy * vaspx)) * height / y; + if (x < width) { // does the picture needs a horizontal blow-up? + DecoderWriteByte(card, 0x115, + ((x * 256 + width - 1) / width) & 0xFF); // Horiz.Filter scale, x/width*256, rounded up + DecoderSetByte(card, 0x114, 0x02); // Horiz.Filter enable + } else if (x == width) { + DecoderWriteByte(card, 0x115, 0); // 1:1 scale + DecoderDelByte(card, 0x114, 0x02); // Horiz.Filter disable + } else if (x <= 720) { + width = x; + DecoderWriteByte(card, 0x115, 0); // 1:1 scale + DecoderDelByte(card, 0x114, 0x02); // Horiz.Filter disable + } else { // picture is more than twice the screen width. sigh. + return 1; + } + } + printk(KERN_INFO LOGNAME + ": Decoder Open: Display size %d x %d, Picture size %d x %d Mode: %d\n", + width, height, x, y, mode); + + // calculate new picture start- and end rows and columns + height /= 2; // convert back to field height + top += ((bottom - top + 1 - height) / 2); + if (top < 0) + top = 0; + bottom = top + height - 1; + width *= 2; // convert back to clocks + left += ((right - left + 1 - width) / 2); + if (left < 0) + left = 0; + right = left + width - 1; + DecoderWriteByte(card, 0x12C, left & 0xFF); // Start- and End Column + DecoderWriteByte(card, 0x12D, right & 0xFF); + DecoderWriteByte(card, 0x12E, + ((right >> 4) & 0x70) | ((left >> 8) & 0x07)); + DecoderWriteByte(card, 0x129, top & 0xFF); // Start- and End Row + DecoderWriteByte(card, 0x12A, bottom & 0xFF); + DecoderWriteByte(card, 0x12b, + ((bottom >> 4) & 0x70) | ((top >> 8) & 0x07)); + + DecoderWriteByte(card, 0x116, ((x + 7) / 8) & 0x7F); // Main Reads per Line + + // set the new mode + DecoderMaskByte(card, 0x114, 0x78, (mode & 0x0F) << 3); + + MDEBUG(3,": Decoder Open: top/bottom/width / left/right/height / main reads %d/%d/%d / %d/%d/%d / %d\n",top,bottom,width,left,right,height,((x+7)/8)&0x7F); + + // set the frame store buffers + if ((i = DecoderSetFrameBuffers(card, y, 0, RMM))) { + MDEBUG(0,": SetFrameBuffers failed for buffer at 0x%03X\n",i); + DecoderKillFrameBuffers(card); + return 2; + } + + card->lastvattr = 0; + card->DecoderOpen = 1; + return 0; +} + +// displays a still image, whose pixel data is in luma and chroma +int DecoderShowStill(struct cvdv_cards *card, int width, int height, + u8 * luma, u8 * chroma) +{ + u16 addr; + DecoderOpen(card, width, height, + (((width == 320) || (width == 640) || (width == 384) + || (width == 768)) ? 1 : 2), + ((height < 313) ? 1 : 0), 1, 0); + addr = + ((DecoderReadWord(card, 0x11D) == DecoderReadWord(card, 0x0E0)) + ? 0x0E4 : 0x0E0); // choose invisible frame + DRAMWriteByte(card, DecoderReadWord(card, addr) << 5, + width * height, luma, 1); + DRAMWriteByte(card, DecoderReadWord(card, addr + 2) << 5, + width * height / 2, chroma, 1); + DecoderStillImageDisplay(card, ((height < 313) ? 2 : 1), + DecoderReadByte(card, 0x116) & 0x7F, + DecoderReadWord(card, addr), + DecoderReadWord(card, addr + 2)); + VideoSetBackground(card, 0, 0, 0, 0); // video on black + return 0; +} + +// TODO: untested, probably won't work (have to use "main reads per line" instead of width on SIF) +int DecoderGetStill(struct cvdv_cards *card, int *width, int *height, + u8 * luma, u8 * chroma) +{ + int framebuffer; + if (card->DecoderOpen) { + //*width=((DecoderReadByte(card,0x12D)|((DecoderReadByte(card,0x12E)&0x70)<<4))-(DecoderReadByte(card,0x12C)|((DecoderReadByte(card,0x12E)&0x07)<<8))+1)/2; // screen width, 2 clocks = 1 pixel + *width = DecoderReadByte(card, 0x116) * 8; + *height = + ((DecoderReadByte + (card, + 0x12A) | ((DecoderReadByte(card, 0x12B) & 0x70) << + 4)) - + (DecoderReadByte(card, 0x129) | + ((DecoderReadByte(card, 0x12B) & 0x07) << 8)) + 1) * 2; // screen (frame) height + if ((luma != NULL) && (chroma != NULL)) { + framebuffer = + (((DecoderReadByte(card, 0x0EE) & 0x0C) == 1) ? + 0x0E4 : 0x0E0); + DRAMReadByte(card, + DecoderReadWord(card, + framebuffer) << 5, + (*width) * (*height), luma, 1); + DRAMReadByte(card, + DecoderReadWord(card, + framebuffer + 2) << 5, + (*width) * (*height) / 2, chroma, 1); + } + return 0; + } else + return 1; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/media/video/margi/video.h linux.20pre5-ac2/drivers/media/video/margi/video.h --- linux.20pre5/drivers/media/video/margi/video.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/media/video/margi/video.h 2002-09-02 14:57:05.000000000 +0100 @@ -0,0 +1,85 @@ +/* + video.h + + Copyright (C) Christian Wolff for convergence integrated media. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#ifndef CVDV_VIDEO_H +#define CVDV_VIDEO_H + + // + // Video Decoder +// + +#include "cardbase.h" + +// Set the background of the OSD and SPU and it's color +// mode=0: Video on Black +// mode=1: Black +// mode=2: Selected Color +// mode=3: Video on Selected Color +void VideoSetBackground(struct cvdv_cards *card, int mode, u8 Y, u8 Cb, + u8 Cr); + + +int DecoderStartDecode(struct cvdv_cards *card); + +int DecoderStopDecode(struct cvdv_cards *card); + +// Sets Display Override (Still Image Display) to Frame Buffer at specified addresses, +// addresses are 16 bit, in 64 byte resolution +// mode: 0=off, 1=Frame, 2=Field +// width: width of the still picture in 8 pixel units +int DecoderStillImageDisplay(struct cvdv_cards *card, int mode, int width, + u16 LumaAddr, u16 ChromaAddr); + +// Frees allocated frame buffers +int DecoderKillFrameBuffers(struct cvdv_cards *card); + +int DecoderSetFrameBuffers(struct cvdv_cards *card, int lines, // number of lines of the decoded MPEG + int TwoFrames, // 1 if no B-Frames are present in the video stream, thus allowing only 2 framestores + int RMM); // 1 if RMM + +// returns size of the Video ES Buffer in bytes or 0=error +u32 DecoderGetVideoESSize(struct cvdv_cards *card); + +// returns level of fullness in bytes +u32 DecoderGetVideoESLevel(struct cvdv_cards *card); + +// pics=0 --> items=bytes +// pics=1 --> items=pictures +void DecoderSetVideoPanic(struct cvdv_cards *card, int pics, int items); + +int DecoderClose(struct cvdv_cards *card); + +// returns 0 on success, 1 on "picture size too big", 2 on "out of DRAM memory" +int DecoderOpen(struct cvdv_cards *card, int x, int y, // size of the decoded MPEG picture + int aspect, // pixel or picture aspect ratio of the MPEG picture: 1=square pixel 2=3:4 3=9:16 4=1:2.21 + int Field, // 0:Frame (interlaced, MPEG-2) , 1:Field (non-interlaced, MPEG-1) structure + int Letterbox, // 0:PanScan (4:3), 1:letterbox (16:9, 8:3) picture ratio // TODO, ignored for now + int RMM // 1:use ReducedMemoryMode + ); + +// displays a still image, whose pixel data is in luma and chroma +int DecoderShowStill(struct cvdv_cards *card, int width, int height, + u8 * luma, u8 * chroma); + +// TODO: untested, probably won't work (have to use "main reads per line" instead of width on SIF) +int DecoderGetStill(struct cvdv_cards *card, int *width, int *height, + u8 * luma, u8 * chroma); + +#endif /* CVDV_VIDEO_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/3c59x.c linux.20pre5-ac2/drivers/net/3c59x.c --- linux.20pre5/drivers/net/3c59x.c 2002-08-29 18:39:36.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/3c59x.c 2002-08-06 15:42:06.000000000 +0100 @@ -166,6 +166,11 @@ - Rename wait_for_completion() to issue_and_wait() to avoid completion.h clash. + LK1.1.18ac 01Jul02 akpm + - Fix for undocumented transceiver power-up bit on some 3c566B's + (Donald Becker, Rahul Karnik) + + - See http://www.uow.edu.au/~andrewm/linux/#3c59x-2.3 for more details. - Also see Documentation/networking/vortex.txt */ @@ -181,8 +186,8 @@ #define DRV_NAME "3c59x" -#define DRV_VERSION "LK1.1.16" -#define DRV_RELDATE "19 July 2001" +#define DRV_VERSION "LK1.1.18-ac" +#define DRV_RELDATE "1 July 2002" @@ -400,7 +405,7 @@ EEPROM_8BIT=0x10, /* AKPM: Uses 0x230 as the base bitmaps for EEPROM reads */ HAS_PWR_CTRL=0x20, HAS_MII=0x40, HAS_NWAY=0x80, HAS_CB_FNS=0x100, INVERT_MII_PWR=0x200, INVERT_LED_PWR=0x400, MAX_COLLISION_RESET=0x800, - EEPROM_OFFSET=0x1000, HAS_HWCKSM=0x2000 }; + EEPROM_OFFSET=0x1000, HAS_HWCKSM=0x2000, WNO_XCVR_PWR=0x4000 }; enum vortex_chips { CH_3C590 = 0, @@ -508,7 +513,7 @@ HAS_HWCKSM, 128, }, {"3c556B Laptop Hurricane", PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_NWAY|EEPROM_OFFSET|HAS_CB_FNS|INVERT_MII_PWR| - HAS_HWCKSM, 128, }, + WNO_XCVR_PWR|HAS_HWCKSM, 128, }, {"3c575 [Megahertz] 10/100 LAN CardBus", PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_8BIT, 128, }, @@ -1198,6 +1203,10 @@ if (vp->drv_flags & INVERT_MII_PWR) n |= 0x4000; outw(n, ioaddr + Wn2_ResetOptions); + if (vp->drv_flags & WNO_XCVR_PWR) { + EL3WINDOW(0); + outw(0x0800, ioaddr); + } } /* Extract our information from the EEPROM data. */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/e100/e100_phy.c linux.20pre5-ac2/drivers/net/e100/e100_phy.c --- linux.20pre5/drivers/net/e100/e100_phy.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/e100/e100_phy.c 2002-08-29 22:29:08.000000000 +0100 @@ -622,7 +622,7 @@ * Returns: void * */ -static void +void e100_force_speed_duplex(struct e100_private *bdp) { u16 control; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/gmac.c linux.20pre5-ac2/drivers/net/gmac.c --- linux.20pre5/drivers/net/gmac.c 2002-08-29 18:39:36.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/gmac.c 2002-08-25 16:24:59.000000000 +0100 @@ -246,6 +246,7 @@ #endif full_duplex = ((aux_stat & MII_BCM5201_AUXCTLSTATUS_DUPLEX) != 0); link_100 = ((aux_stat & MII_BCM5201_AUXCTLSTATUS_SPEED) != 0); + netif_carrier_on(gm->dev); break; case PHY_B5400: case PHY_B5401: @@ -260,6 +261,7 @@ full_duplex = phy_BCM5400_link_table[link][0]; link_100 = phy_BCM5400_link_table[link][1]; gigabit = phy_BCM5400_link_table[link][2]; + netif_carrier_on(gm->dev); break; case PHY_LXT971: aux_stat = mii_read(gm, gm->phy_addr, MII_LXT971_STATUS2); @@ -269,6 +271,7 @@ #endif full_duplex = ((aux_stat & MII_LXT971_STATUS2_FULLDUPLEX) != 0); link_100 = ((aux_stat & MII_LXT971_STATUS2_SPEED) != 0); + netif_carrier_on(gm->dev); break; default: full_duplex = (lpar_ability & MII_ANLPA_FDAM) != 0; @@ -296,6 +299,7 @@ #ifdef DEBUG_PHY printk(KERN_INFO "%s: Link down !\n", gm->dev->name); #endif + netif_carrier_off(gm->dev); } } } @@ -1101,7 +1105,10 @@ /* Initialize the multicast tables & promisc mode if any */ gmac_set_multicast(dev); - + + /* Initialize the carrier status */ + netif_carrier_off(dev); + /* * Check out PHY status and start auto-poll * diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/irda/irport.c linux.20pre5-ac2/drivers/net/irda/irport.c --- linux.20pre5/drivers/net/irda/irport.c 2002-08-29 18:39:36.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/irda/irport.c 2002-08-06 15:42:06.000000000 +0100 @@ -126,7 +126,7 @@ { int i; - IRDA_DEBUG( 4, __FUNCTION__ "()\n"); + IRDA_DEBUG( 4, "%s()\n", __FUNCTION__); for (i=0; i < 4; i++) { if (dev_self[i]) @@ -143,15 +143,15 @@ void *ret; int err; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); /* * Allocate new instance of the driver */ self = kmalloc(sizeof(struct irport_cb), GFP_KERNEL); if (!self) { - ERROR(__FUNCTION__ "(), can't allocate memory for " - "control block!\n"); + ERROR("%s(), can't allocate memory for " + "control block!\n", __FUNCTION__); return NULL; } memset(self, 0, sizeof(struct irport_cb)); @@ -171,8 +171,8 @@ /* Lock the port that we need */ ret = request_region(self->io.sir_base, self->io.sir_ext, driver_name); if (!ret) { - IRDA_DEBUG(0, __FUNCTION__ "(), can't get iobase of 0x%03x\n", - self->io.sir_base); + IRDA_DEBUG(0, "%s(), can't get iobase of 0x%03x\n", + __FUNCTION__, self->io.sir_base); return NULL; } @@ -215,7 +215,7 @@ self->mode = IRDA_IRLAP; if (!(dev = dev_alloc("irda%d", &err))) { - ERROR(__FUNCTION__ "(), dev_alloc() failed!\n"); + ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__); return NULL; } self->netdev = dev; @@ -243,7 +243,7 @@ err = register_netdevice(dev); rtnl_unlock(); if (err) { - ERROR(__FUNCTION__ "(), register_netdev() failed!\n"); + ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); return NULL; } MESSAGE("IrDA: Registered device %s\n", dev->name); @@ -268,8 +268,8 @@ } /* Release the IO-port that this driver is using */ - IRDA_DEBUG(0 , __FUNCTION__ "(), Releasing Region %03x\n", - self->io.sir_base); + IRDA_DEBUG(0 , "%s(), Releasing Region %03x\n", + __FUNCTION__, self->io.sir_base); release_region(self->io.sir_base, self->io.sir_ext); if (self->tx_buff.head) @@ -332,7 +332,7 @@ */ int irport_probe(int iobase) { - IRDA_DEBUG(4, __FUNCTION__ "(), iobase=%#x\n", iobase); + IRDA_DEBUG(4, "%s(), iobase=%#x\n", __FUNCTION__, iobase); return 0; } @@ -352,7 +352,8 @@ int lcr; /* Line control reg */ int divisor; - IRDA_DEBUG(0, __FUNCTION__ "(), Setting speed to: %d\n", speed); + IRDA_DEBUG(0, "%s(), Setting speed to: %d\n", + __FUNCTION__, speed); ASSERT(self != NULL, return;); @@ -407,7 +408,7 @@ __u32 speed = (__u32) task->param; int ret = 0; - IRDA_DEBUG(2, __FUNCTION__ "(), <%ld>\n", jiffies); + IRDA_DEBUG(2, "%s(), <%ld>\n", __FUNCTION__, jiffies); self = (struct irport_cb *) task->instance; @@ -449,8 +450,7 @@ irda_task_next_state(task, IRDA_TASK_CHILD_DONE); break; case IRDA_TASK_CHILD_WAIT: - WARNING(__FUNCTION__ - "(), changing speed of dongle timed out!\n"); + WARNING("%s(), changing speed of dongle timed out!\n", __FUNCTION__); ret = -1; break; case IRDA_TASK_CHILD_DONE: @@ -460,7 +460,7 @@ irda_task_next_state(task, IRDA_TASK_DONE); break; default: - ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); + ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state); irda_task_next_state(task, IRDA_TASK_DONE); ret = -1; break; @@ -483,7 +483,7 @@ ASSERT(self != NULL, return;); - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); iobase = self->io.sir_base; @@ -501,7 +501,7 @@ * if we need to change the speed of the hardware */ if (self->new_speed) { - IRDA_DEBUG(5, __FUNCTION__ "(), Changing speed!\n"); + IRDA_DEBUG(5, "%s(), Changing speed!\n", __FUNCTION__); irda_task_execute(self, __irport_change_speed, irport_change_speed_complete, NULL, (void *) self->new_speed); @@ -541,7 +541,7 @@ /* Tx FIFO should be empty! */ if (!(inb(iobase+UART_LSR) & UART_LSR_THRE)) { - IRDA_DEBUG(0, __FUNCTION__ "(), failed, fifo not empty!\n"); + IRDA_DEBUG(0, "%s(), failed, fifo not empty!\n", __FUNCTION__); return 0; } @@ -566,7 +566,7 @@ { struct irport_cb *self; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); self = (struct irport_cb *) task->instance; @@ -617,7 +617,7 @@ int iobase; s32 speed; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); ASSERT(dev != NULL, return 0;); @@ -688,7 +688,7 @@ /* Make sure we don't stay here to long */ if (boguscount++ > 32) { - IRDA_DEBUG(2,__FUNCTION__ "(), breaking!\n"); + IRDA_DEBUG(2, "%s(), breaking!\n", __FUNCTION__); break; } } while (inb(iobase+UART_LSR) & UART_LSR_DR); @@ -708,7 +708,7 @@ int iir, lsr; if (!dev) { - WARNING(__FUNCTION__ "() irq %d for unknown device.\n", irq); + WARNING("%s() irq %d for unknown device.\n", __FUNCTION__, irq); return; } self = (struct irport_cb *) dev->priv; @@ -722,13 +722,12 @@ /* Clear interrupt */ lsr = inb(iobase+UART_LSR); - IRDA_DEBUG(4, __FUNCTION__ - "(), iir=%02x, lsr=%02x, iobase=%#x\n", - iir, lsr, iobase); + IRDA_DEBUG(4, "%s(), iir=%02x, lsr=%02x, iobase=%#x\n", + __FUNCTION__, iir, lsr, iobase); switch (iir) { case UART_IIR_RLSI: - IRDA_DEBUG(2, __FUNCTION__ "(), RLSI\n"); + IRDA_DEBUG(2, "%s(), RLSI\n", __FUNCTION__); break; case UART_IIR_RDI: /* Receive interrupt */ @@ -740,7 +739,7 @@ irport_write_wakeup(self); break; default: - IRDA_DEBUG(0, __FUNCTION__ "(), unhandled IIR=%#x\n", iir); + IRDA_DEBUG(0, "%s(), unhandled IIR=%#x\n", __FUNCTION__, iir); break; } @@ -775,7 +774,7 @@ int iobase; char hwname[16]; - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); ASSERT(dev != NULL, return -1;); self = (struct irport_cb *) dev->priv; @@ -784,8 +783,8 @@ if (request_irq(self->io.irq, self->interrupt, 0, dev->name, (void *) dev)) { - IRDA_DEBUG(0, __FUNCTION__ "(), unable to allocate irq=%d\n", - self->io.irq); + IRDA_DEBUG(0, "%s(), unable to allocate irq=%d\n", + __FUNCTION__, self->io.irq); return -EAGAIN; } @@ -822,7 +821,7 @@ struct irport_cb *self; int iobase; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(dev != NULL, return -1;); self = (struct irport_cb *) dev->priv; @@ -863,7 +862,7 @@ /* Wait until Tx FIFO is empty */ while (!(inb(iobase+UART_LSR) & UART_LSR_THRE)) { - IRDA_DEBUG(2, __FUNCTION__ "(), waiting!\n"); + IRDA_DEBUG(2, "%s(), waiting!\n", __FUNCTION__); current->state = TASK_INTERRUPTIBLE; schedule_timeout(MSECS_TO_JIFFIES(60)); } @@ -918,7 +917,7 @@ /* Tx FIFO should be empty! */ if (!(inb(iobase+UART_LSR) & UART_LSR_THRE)) { - IRDA_DEBUG( 0, __FUNCTION__ "(), failed, fifo not empty!\n"); + IRDA_DEBUG( 0, "%s(), failed, fifo not empty!\n", __FUNCTION__); return -1; } @@ -952,7 +951,7 @@ ASSERT(self != NULL, return -1;); - IRDA_DEBUG(2, __FUNCTION__ "(), %s, (cmd=0x%X)\n", dev->name, cmd); + IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd); /* Disable interrupts & save flags */ save_flags(flags); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/irda/irtty.c linux.20pre5-ac2/drivers/net/irda/irtty.c --- linux.20pre5/drivers/net/irda/irtty.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/irda/irtty.c 2002-08-13 14:30:24.000000000 +0100 @@ -121,9 +121,8 @@ /* Unregister tty line-discipline */ if ((ret = tty_register_ldisc(N_IRDA, NULL))) { - ERROR(__FUNCTION__ - "(), can't unregister line discipline (err = %d)\n", - ret); + ERROR("%s(), can't unregister line discipline (err = %d)\n", + __FUNCTION__, ret); } /* @@ -230,7 +229,7 @@ self->rx_buff.data = self->rx_buff.head; if (!(dev = dev_alloc("irda%d", &err))) { - ERROR(__FUNCTION__ "(), dev_alloc() failed!\n"); + ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__); return -ENOMEM; } @@ -249,7 +248,7 @@ err = register_netdevice(dev); rtnl_unlock(); if (err) { - ERROR(__FUNCTION__ "(), register_netdev() failed!\n"); + ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); return -1; } @@ -352,7 +351,7 @@ cflag &= ~CBAUD; - IRDA_DEBUG(2, __FUNCTION__ "(), Setting speed to %d\n", speed); + IRDA_DEBUG(2, "%s(), Setting speed to %d\n", __FUNCTION__, speed); switch (speed) { case 1200: @@ -400,14 +399,14 @@ __u32 speed = (__u32) task->param; int ret = 0; - IRDA_DEBUG(2, __FUNCTION__ "(), <%ld>\n", jiffies); + IRDA_DEBUG(2, "%s(), <%ld>\n", __FUNCTION__, jiffies); self = (struct irtty_cb *) task->instance; ASSERT(self != NULL, return -1;); /* Check if busy */ if (self->task && self->task != task) { - IRDA_DEBUG(0, __FUNCTION__ "(), busy!\n"); + IRDA_DEBUG(0, "%s(), busy!\n", __FUNCTION__); return MSECS_TO_JIFFIES(10); } else self->task = task; @@ -455,8 +454,7 @@ irda_task_next_state(task, IRDA_TASK_CHILD_DONE); break; case IRDA_TASK_CHILD_WAIT: - WARNING(__FUNCTION__ - "(), changing speed of dongle timed out!\n"); + WARNING("%s(), changing speed of dongle timed out!\n", __FUNCTION__); ret = -1; break; case IRDA_TASK_CHILD_DONE: @@ -467,7 +465,7 @@ self->task = NULL; break; default: - ERROR(__FUNCTION__ "(), unknown state %d\n", task->state); + ERROR("%s(), unknown state %d\n", __FUNCTION__, task->state); irda_task_next_state(task, IRDA_TASK_DONE); self->task = NULL; ret = -1; @@ -559,7 +557,7 @@ struct irtty_cb *self = (struct irtty_cb *) tty->disc_data; if (!self || !self->netdev) { - IRDA_DEBUG(0, __FUNCTION__ "(), not ready yet!\n"); + IRDA_DEBUG(0, "%s(), not ready yet!\n", __FUNCTION__); return; } @@ -605,7 +603,7 @@ { struct irtty_cb *self; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); self = (struct irtty_cb *) task->instance; @@ -684,7 +682,7 @@ */ static int irtty_receive_room(struct tty_struct *tty) { - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); return 65536; /* We can handle an infinite amount of data. :-) */ } @@ -719,14 +717,14 @@ * Now serial buffer is almost free & we can start * transmission of another packet */ - IRDA_DEBUG(5, __FUNCTION__ "(), finished with frame!\n"); + IRDA_DEBUG(5, "%s(), finished with frame!\n", __FUNCTION__); self->stats.tx_packets++; tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); if (self->new_speed) { - IRDA_DEBUG(5, __FUNCTION__ "(), Changing speed!\n"); + IRDA_DEBUG(5, "%s(), Changing speed!\n", __FUNCTION__); irda_task_execute(self, irtty_change_speed, irtty_change_speed_complete, NULL, (void *) self->new_speed); @@ -760,14 +758,11 @@ struct irtty_cb *self; struct tty_struct *tty; mm_segment_t fs; - int arg = 0; + int arg = TIOCM_MODEM_BITS; self = (struct irtty_cb *) dev->priv; tty = self->tty; -#ifdef TIOCM_OUT2 /* Not defined for ARM */ - arg = TIOCM_OUT2; -#endif if (rts) arg |= TIOCM_RTS; if (dtr) @@ -785,7 +780,7 @@ set_fs(get_ds()); if (tty->driver.ioctl(tty, NULL, TIOCMSET, (unsigned long) &arg)) { - IRDA_DEBUG(2, __FUNCTION__ "(), error doing ioctl!\n"); + IRDA_DEBUG(2, "%s(), error doing ioctl!\n", __FUNCTION__); } set_fs(fs); @@ -808,7 +803,7 @@ ASSERT(self != NULL, return -1;); - IRDA_DEBUG(2, __FUNCTION__ "(), mode=%s\n", infrared_mode[mode]); + IRDA_DEBUG(2, "%s(), mode=%s\n", __FUNCTION__, infrared_mode[mode]); /* save status for driver */ self->mode = mode; @@ -901,7 +896,7 @@ ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRTTY_MAGIC, return -1;); - IRDA_DEBUG(0, __FUNCTION__ "()\n"); + IRDA_DEBUG(0, "%s()\n", __FUNCTION__); /* Ready to play! */ netif_start_queue(dev); @@ -969,7 +964,7 @@ ASSERT(self != NULL, return -1;); ASSERT(self->magic == IRTTY_MAGIC, return -1;); - IRDA_DEBUG(3, __FUNCTION__ "(), %s, (cmd=0x%X)\n", dev->name, cmd); + IRDA_DEBUG(3, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd); /* Disable interrupts & save flags */ save_flags(flags); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/irda/nsc-ircc.c linux.20pre5-ac2/drivers/net/irda/nsc-ircc.c --- linux.20pre5/drivers/net/irda/nsc-ircc.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/irda/nsc-ircc.c 2002-08-13 14:30:33.000000000 +0100 @@ -165,8 +165,8 @@ /* Probe for all the NSC chipsets we know about */ for (chip=chips; chip->name ; chip++) { - IRDA_DEBUG(2, __FUNCTION__"(), Probing for %s ...\n", - chip->name); + IRDA_DEBUG(2, "%s(), Probing for %s ...\n", + __FUNCTION__, chip->name); /* Try all config registers for this chip */ for (cfg=0; cfg<3; cfg++) { @@ -183,8 +183,8 @@ /* Read index register */ reg = inb(cfg_base); if (reg == 0xff) { - IRDA_DEBUG(2, __FUNCTION__ - "() no chip at 0x%03x\n", cfg_base); + IRDA_DEBUG(2, "%s() no chip at 0x%03x\n", + __FUNCTION__, cfg_base); continue; } @@ -192,9 +192,8 @@ outb(chip->cid_index, cfg_base); id = inb(cfg_base+1); if ((id & chip->cid_mask) == chip->cid_value) { - IRDA_DEBUG(2, __FUNCTION__ - "() Found %s chip, revision=%d\n", - chip->name, id & ~chip->cid_mask); + IRDA_DEBUG(2, "%s() Found %s chip, revision=%d\n", + __FUNCTION__, chip->name, id & ~chip->cid_mask); /* * If the user supplies the base address, then * we init the chip, if not we probe the values @@ -209,8 +208,7 @@ ret = 0; i++; } else { - IRDA_DEBUG(2, __FUNCTION__ - "(), Wrong chip id=0x%02x\n", id); + IRDA_DEBUG(2, "%s(), Wrong chip id=0x%02x\n", __FUNCTION__, id); } } @@ -253,7 +251,7 @@ void *ret; int err; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); MESSAGE("%s, Found chip at base=0x%03x\n", driver_name, info->cfg_base); @@ -266,8 +264,8 @@ /* Allocate new instance of the driver */ self = kmalloc(sizeof(struct nsc_ircc_cb), GFP_KERNEL); if (self == NULL) { - ERROR(__FUNCTION__ "(), can't allocate memory for " - "control block!\n"); + ERROR("%s(), can't allocate memory for " + "control block!\n", __FUNCTION__); return -ENOMEM; } memset(self, 0, sizeof(struct nsc_ircc_cb)); @@ -288,8 +286,8 @@ /* Reserve the ioports that we need */ ret = request_region(self->io.fir_base, self->io.fir_ext, driver_name); if (!ret) { - WARNING(__FUNCTION__ "(), can't get iobase of 0x%03x\n", - self->io.fir_base); + WARNING("%s(), can't get iobase of 0x%03x\n", + __FUNCTION__, self->io.fir_base); dev_self[i] = NULL; kfree(self); return -ENODEV; @@ -339,7 +337,7 @@ self->tx_fifo.tail = self->tx_buff.head; if (!(dev = dev_alloc("irda%d", &err))) { - ERROR(__FUNCTION__ "(), dev_alloc() failed!\n"); + ERROR("%s(), dev_alloc() failed!\n", __FUNCTION__); return -ENOMEM; } @@ -358,7 +356,7 @@ err = register_netdevice(dev); rtnl_unlock(); if (err) { - ERROR(__FUNCTION__ "(), register_netdev() failed!\n"); + ERROR("%s(), register_netdev() failed!\n", __FUNCTION__); return -1; } MESSAGE("IrDA: Registered device %s\n", dev->name); @@ -395,7 +393,7 @@ { int iobase; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(self != NULL, return -1;); @@ -409,8 +407,8 @@ } /* Release the PORT that this driver is using */ - IRDA_DEBUG(4, __FUNCTION__ "(), Releasing Region %03x\n", - self->io.fir_base); + IRDA_DEBUG(4, "%s(), Releasing Region %03x\n", + __FUNCTION__, self->io.fir_base); release_region(self->io.fir_base, self->io.fir_ext); if (self->tx_buff.head) @@ -447,7 +445,7 @@ case 0x2e8: outb(0x15, cfg_base+1); break; case 0x3f8: outb(0x16, cfg_base+1); break; case 0x2f8: outb(0x17, cfg_base+1); break; - default: ERROR(__FUNCTION__ "(), invalid base_address"); + default: ERROR("%s(), invalid base_address", __FUNCTION__); } /* Control Signal Routing Register (CSRT) */ @@ -459,7 +457,7 @@ case 9: temp = 0x05; break; case 11: temp = 0x06; break; case 15: temp = 0x07; break; - default: ERROR(__FUNCTION__ "(), invalid irq"); + default: ERROR("%s(), invalid irq", __FUNCTION__); } outb(1, cfg_base); @@ -467,7 +465,7 @@ case 0: outb(0x08+temp, cfg_base+1); break; case 1: outb(0x10+temp, cfg_base+1); break; case 3: outb(0x18+temp, cfg_base+1); break; - default: ERROR(__FUNCTION__ "(), invalid dma"); + default: ERROR("%s(), invalid dma", __FUNCTION__); } outb(2, cfg_base); /* Mode Control Register (MCTL) */ @@ -506,8 +504,8 @@ break; } info->sir_base = info->fir_base; - IRDA_DEBUG(2, __FUNCTION__ "(), probing fir_base=0x%03x\n", - info->fir_base); + IRDA_DEBUG(2, "%s(), probing fir_base=0x%03x\n", + __FUNCTION__, info->fir_base); /* Read control signals routing register (CSRT) */ outb(CFG_CSRT, cfg_base); @@ -539,7 +537,7 @@ info->irq = 15; break; } - IRDA_DEBUG(2, __FUNCTION__ "(), probing irq=%d\n", info->irq); + IRDA_DEBUG(2, "%s(), probing irq=%d\n", __FUNCTION__, info->irq); /* Currently we only read Rx DMA but it will also be used for Tx */ switch ((reg >> 3) & 0x03) { @@ -556,7 +554,7 @@ info->dma = 3; break; } - IRDA_DEBUG(2, __FUNCTION__ "(), probing dma=%d\n", info->dma); + IRDA_DEBUG(2, "%s(), probing dma=%d\n", __FUNCTION__, info->dma); /* Read mode control register (MCTL) */ outb(CFG_MCTL, cfg_base); @@ -805,39 +803,39 @@ switch (dongle_id) { case 0x00: /* same as */ case 0x01: /* Differential serial interface */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s not defined by irda yet\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x02: /* same as */ case 0x03: /* Reserved */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s not defined by irda yet\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x04: /* Sharp RY5HD01 */ break; case 0x05: /* Reserved, but this is what the Thinkpad reports */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s not defined by irda yet\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x06: /* Single-ended serial interface */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s not defined by irda yet\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x07: /* Consumer-IR only */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s is not for IrDA mode\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s is not for IrDA mode\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x08: /* HP HSDL-2300, HP HSDL-3600/HSDL-3610 */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x09: /* IBM31T1100 or Temic TFDS6000/TFDS6500 */ outb(0x28, iobase+7); /* Set irsl[0-2] as output */ break; case 0x0A: /* same as */ case 0x0B: /* Reserved */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s not defined by irda yet\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x0C: /* same as */ case 0x0D: /* HP HSDL-1100/HSDL-2100 */ @@ -851,15 +849,15 @@ outb(0x28, iobase+7); /* Set irsl[0-2] as output */ break; case 0x0F: /* No dongle connected */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s\n", + __FUNCTION__, dongle_types[dongle_id]); switch_bank(iobase, BANK0); outb(0x62, iobase+MCR); break; default: - IRDA_DEBUG(0, __FUNCTION__ "(), invalid dongle_id %#x", - dongle_id); + IRDA_DEBUG(0, "%s(), invalid dongle_id %#x", + __FUNCTION__, dongle_id); } /* IRCFG1: IRSL1 and 2 are set to IrDA mode */ @@ -891,31 +889,31 @@ switch (dongle_id) { case 0x00: /* same as */ case 0x01: /* Differential serial interface */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s not defined by irda yet\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x02: /* same as */ case 0x03: /* Reserved */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s not defined by irda yet\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x04: /* Sharp RY5HD01 */ break; case 0x05: /* Reserved */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s not defined by irda yet\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x06: /* Single-ended serial interface */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s not defined by irda yet\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x07: /* Consumer-IR only */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s is not for IrDA mode\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s is not for IrDA mode\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x08: /* HP HSDL-2300, HP HSDL-3600/HSDL-3610 */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s\n", + __FUNCTION__, dongle_types[dongle_id]); outb(0x00, iobase+4); if (speed > 115200) outb(0x01, iobase+4); @@ -934,8 +932,8 @@ break; case 0x0A: /* same as */ case 0x0B: /* Reserved */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s not defined by irda yet\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s not defined by irda yet\n", + __FUNCTION__, dongle_types[dongle_id]); break; case 0x0C: /* same as */ case 0x0D: /* HP HSDL-1100/HSDL-2100 */ @@ -943,14 +941,14 @@ case 0x0E: /* Supports SIR Mode only */ break; case 0x0F: /* No dongle connected */ - IRDA_DEBUG(0, __FUNCTION__ "(), %s is not for IrDA mode\n", - dongle_types[dongle_id]); + IRDA_DEBUG(0, "%s(), %s is not for IrDA mode\n", + __FUNCTION__, dongle_types[dongle_id]); switch_bank(iobase, BANK0); outb(0x62, iobase+MCR); break; default: - IRDA_DEBUG(0, __FUNCTION__ "(), invalid data_rate\n"); + IRDA_DEBUG(0, "%s(), invalid data_rate\n", __FUNCTION__); } /* Restore bank register */ outb(bank, iobase+BSR); @@ -969,7 +967,7 @@ int iobase; __u8 bank; - IRDA_DEBUG(2, __FUNCTION__ "(), speed=%d\n", speed); + IRDA_DEBUG(2, "%s(), speed=%d\n", __FUNCTION__, speed); ASSERT(self != NULL, return;); @@ -1002,20 +1000,20 @@ outb(inb(iobase+4) | 0x04, iobase+4); mcr = MCR_MIR; - IRDA_DEBUG(0, __FUNCTION__ "(), handling baud of 576000\n"); + IRDA_DEBUG(0, "%s(), handling baud of 576000\n", __FUNCTION__); break; case 1152000: mcr = MCR_MIR; - IRDA_DEBUG(0, __FUNCTION__ "(), handling baud of 1152000\n"); + IRDA_DEBUG(0, "%s(), handling baud of 1152000\n", __FUNCTION__); break; case 4000000: mcr = MCR_FIR; - IRDA_DEBUG(0, __FUNCTION__ "(), handling baud of 4000000\n"); + IRDA_DEBUG(0, "%s(), handling baud of 4000000\n", __FUNCTION__); break; default: mcr = MCR_FIR; - IRDA_DEBUG(0, __FUNCTION__ "(), unknown baud rate of %d\n", - speed); + IRDA_DEBUG(0, "%s(), unknown baud rate of %d\n", + __FUNCTION__, speed); break; } @@ -1278,15 +1276,14 @@ int actual = 0; __u8 bank; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); /* Save current bank */ bank = inb(iobase+BSR); switch_bank(iobase, BANK0); if (!(inb_p(iobase+LSR) & LSR_TXEMP)) { - IRDA_DEBUG(4, __FUNCTION__ - "(), warning, FIFO not empty yet!\n"); + IRDA_DEBUG(4, "%s(), warning, FIFO not empty yet!\n", __FUNCTION__); /* FIFO may still be filled to the Tx interrupt threshold */ fifo_size -= 17; @@ -1298,8 +1295,8 @@ outb(buf[actual++], iobase+TXD); } - IRDA_DEBUG(4, __FUNCTION__ "(), fifo_size %d ; %d sent of %d\n", - fifo_size, actual, len); + IRDA_DEBUG(4, "%s(), fifo_size %d ; %d sent of %d\n", + __FUNCTION__, fifo_size, actual, len); /* Restore bank */ outb(bank, iobase+BSR); @@ -1320,7 +1317,7 @@ __u8 bank; int ret = TRUE; - IRDA_DEBUG(2, __FUNCTION__ "()\n"); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__); iobase = self->io.fir_base; @@ -1456,7 +1453,7 @@ len = inb(iobase+RFLFL) | ((inb(iobase+RFLFH) & 0x1f) << 8); if (st_fifo->tail >= MAX_RX_WINDOW) { - IRDA_DEBUG(0, __FUNCTION__ "(), window is full!\n"); + IRDA_DEBUG(0, "%s(), window is full!\n", __FUNCTION__); continue; } @@ -1546,8 +1543,8 @@ skb = dev_alloc_skb(len+1); if (skb == NULL) { - WARNING(__FUNCTION__ "(), memory squeeze, " - "dropping frame.\n"); + WARNING("%s(), memory squeeze, " + "dropping frame.\n", __FUNCTION__); self->stats.rx_dropped++; /* Restore bank register */ @@ -1643,7 +1640,7 @@ if (eir & EIR_TXEMP_EV) { /* Check if we need to change the speed? */ if (self->new_speed) { - IRDA_DEBUG(2, __FUNCTION__ "(), Changing speed!\n"); + IRDA_DEBUG(2, "%s(), Changing speed!\n", __FUNCTION__); nsc_ircc_change_speed(self, self->new_speed); self->new_speed = 0; @@ -1822,7 +1819,7 @@ */ static int nsc_ircc_net_init(struct net_device *dev) { - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); /* Setup to be a normal IrDA network device driver */ irda_device_setup(dev); @@ -1845,7 +1842,7 @@ char hwname[32]; __u8 bank; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(dev != NULL, return -1;); self = (struct nsc_ircc_cb *) dev->priv; @@ -1909,7 +1906,7 @@ int iobase; __u8 bank; - IRDA_DEBUG(4, __FUNCTION__ "()\n"); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__); ASSERT(dev != NULL, return -1;); @@ -1965,7 +1962,7 @@ ASSERT(self != NULL, return -1;); - IRDA_DEBUG(2, __FUNCTION__ "(), %s, (cmd=0x%X)\n", dev->name, cmd); + IRDA_DEBUG(2, "%s(), %s, (cmd=0x%X)\n", __FUNCTION__, dev->name, cmd); /* Disable interrupts & save flags */ save_flags(flags); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/pcmcia/wavelan_cs.c linux.20pre5-ac2/drivers/net/pcmcia/wavelan_cs.c --- linux.20pre5/drivers/net/pcmcia/wavelan_cs.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/pcmcia/wavelan_cs.c 2002-08-30 13:45:09.000000000 +0100 @@ -63,6 +63,7 @@ * */ +#include #include #include #include "wavelan_cs.h" /* Private header */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/pcnet32.c linux.20pre5-ac2/drivers/net/pcnet32.c --- linux.20pre5/drivers/net/pcnet32.c 2002-08-29 18:39:36.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/pcnet32.c 2002-08-06 15:42:06.000000000 +0100 @@ -1,5 +1,5 @@ -/* pcnet32.c: An AMD PCnet32 ethernet driver for linux. */ -/* +/* pcnet32.c: An AMD PCnet32 ethernet driver for linux. + * * Copyright 1996-1999 Thomas Bogendoerfer * * Derived from the lance driver written 1993,1994,1995 by Donald Becker. @@ -543,7 +543,7 @@ /* initialize variables */ fdx = mii = fset = dxsuflo = ltint = 0; chip_version = (chip_version >> 12) & 0xffff; - + switch (chip_version) { case 0x2420: chipname = "PCnet/PCI 79C970"; /* PCI */ @@ -1175,19 +1175,12 @@ if (err_status & 0x04000000) lp->stats.tx_aborted_errors++; if (err_status & 0x08000000) lp->stats.tx_carrier_errors++; if (err_status & 0x10000000) lp->stats.tx_window_errors++; -#ifndef DO_DXSUFLO if (err_status & 0x40000000) { lp->stats.tx_fifo_errors++; - /* Ackk! On FIFO errors the Tx unit is turned off! */ - /* Remove this verbosity later! */ - printk(KERN_ERR "%s: Tx FIFO error! CSR0=%4.4x\n", - dev->name, csr0); - must_restart = 1; - } -#else - if (err_status & 0x40000000) { - lp->stats.tx_fifo_errors++; - if (! lp->dxsuflo) { /* If controller doesn't recover ... */ +#ifdef DO_DXSUFLO + if (! lp->dxsuflo) +#endif + { /* If controller doesn't recover ... */ /* Ackk! On FIFO errors the Tx unit is turned off! */ /* Remove this verbosity later! */ printk(KERN_ERR "%s: Tx FIFO error! CSR0=%4.4x\n", @@ -1195,7 +1188,6 @@ must_restart = 1; } } -#endif } else { if (status & 0x1800) lp->stats.collisions++; @@ -1722,12 +1714,13 @@ } } + module_init(pcnet32_init_module); module_exit(pcnet32_cleanup_module); /* * Local variables: - * compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c pcnet32.c" + * compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/include/linux -Wall -Wstrict-prototypes -O2 -m486 -c pcnet32.c" * c-indent-level: 4 * tab-width: 8 * End: diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/ppp_generic.c linux.20pre5-ac2/drivers/net/ppp_generic.c --- linux.20pre5/drivers/net/ppp_generic.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/ppp_generic.c 2002-08-29 22:35:25.000000000 +0100 @@ -404,19 +404,19 @@ remove_wait_queue(&pf->rwait, &wait); if (skb == 0) - goto out; + goto err1; ret = -EOVERFLOW; if (skb->len > count) - goto outf; + goto err2; ret = -EFAULT; if (copy_to_user(buf, skb->data, skb->len)) - goto outf; + goto err2; ret = skb->len; - outf: + err2: kfree_skb(skb); - out: + err1: return ret; } @@ -432,12 +432,12 @@ ret = -ENOMEM; skb = alloc_skb(count + pf->hdrlen, GFP_KERNEL); if (skb == 0) - goto out; + goto err1; skb_reserve(skb, pf->hdrlen); ret = -EFAULT; if (copy_from_user(skb_put(skb, count), buf, count)) { kfree_skb(skb); - goto out; + goto err1; } skb_queue_tail(&pf->xq, skb); @@ -453,7 +453,7 @@ ret = count; - out: + err1: return ret; } @@ -806,7 +806,7 @@ npi = ethertype_to_npindex(ntohs(skb->protocol)); if (npi < 0) - goto outf; + goto err1; /* Drop, accept or reject the packet */ switch (ppp->npmode[npi]) { @@ -815,10 +815,10 @@ case NPMODE_QUEUE: /* it would be nice to have a way to tell the network system to queue this one up for later. */ - goto outf; + goto err1; case NPMODE_DROP: case NPMODE_ERROR: - goto outf; + goto err1; } /* Put the 2-byte PPP protocol number on the front, @@ -828,7 +828,7 @@ ns = alloc_skb(skb->len + dev->hard_header_len, GFP_ATOMIC); if (ns == 0) - goto outf; + goto err1; skb_reserve(ns, dev->hard_header_len); memcpy(skb_put(ns, skb->len), skb->data, skb->len); kfree_skb(skb); @@ -844,7 +844,7 @@ ppp_xmit_process(ppp); return 0; - outf: +err1: kfree_skb(skb); ++ppp->stats.tx_dropped; return 0; @@ -1945,11 +1945,11 @@ if (copy_from_user(&data, (void *) arg, sizeof(data)) || (data.length <= CCP_MAX_OPTION_LENGTH && copy_from_user(ccp_option, data.ptr, data.length))) - goto out; + goto err1; err = -EINVAL; if (data.length > CCP_MAX_OPTION_LENGTH || ccp_option[1] < 2 || ccp_option[1] > data.length) - goto out; + goto err1; cp = find_compressor(ccp_option[0]); #ifdef CONFIG_KMOD @@ -1960,7 +1960,7 @@ } #endif /* CONFIG_KMOD */ if (cp == 0) - goto out; + goto err1; /* * XXX race: the compressor module could get unloaded between * here and when we do the comp_alloc or decomp_alloc call below. @@ -1998,7 +1998,7 @@ } } - out: +err1: return err; } @@ -2144,15 +2144,15 @@ spin_lock(&compressor_list_lock); ret = -EEXIST; if (find_comp_entry(cp->compress_proto) != 0) - goto out; + goto err1; ret = -ENOMEM; ce = kmalloc(sizeof(struct compressor_entry), GFP_ATOMIC); if (ce == 0) - goto out; + goto err1; ret = 0; ce->comp = cp; list_add(&ce->list, &compressor_list); - out: + err1: spin_unlock(&compressor_list_lock); return ret; } @@ -2431,11 +2431,12 @@ down(&all_ppp_sem); ppp = ppp_find_unit(unit); if (ppp == 0) - goto out; + goto err1; + write_lock_bh(&pch->upl); ret = -EINVAL; if (pch->ppp != 0) - goto outl; + goto err2; ppp_lock(ppp); if (pch->file.hdrlen > ppp->file.hdrlen) @@ -2450,9 +2451,9 @@ ppp_unlock(ppp); ret = 0; - outl: + err2: write_unlock_bh(&pch->upl); - out: + err1: up(&all_ppp_sem); return ret; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/tulip/eeprom.c linux.20pre5-ac2/drivers/net/tulip/eeprom.c --- linux.20pre5/drivers/net/tulip/eeprom.c 2002-08-29 18:39:37.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/tulip/eeprom.c 2002-08-06 15:42:06.000000000 +0100 @@ -136,6 +136,48 @@ subsequent_board: if (ee_data[27] == 0) { /* No valid media table. */ +#ifdef __hppa__ + /* + * HSC-PCI cards don't have a standard srom, + * but we need to setup a fake mediatable + * for a correct csr12 setup and mii handling + */ + if (ee_data[0] == 0x3c && ee_data[1] == 0x10 && /* sub vendor id */ + ee_data[2] == 0x63 && ee_data[3] == 0x10) { /* sub device id */ + static unsigned char leafdata[] = + { 0x01, /* phy number */ + 0x02, /* gpr setup sequence length */ + 0x02, 0x00, /* gpr setup sequence */ + 0x02, /* phy reset sequence length */ + 0x01, 0x00, /* phy reset sequence */ + 0x00, 0x78, /* media capabilities */ + 0x00, 0xe0, /* nway advertisment */ + 0x00, 0x05, /* fdx bit map */ + 0x00, 0x06 /* ttm bit map */ + }; + struct mediatable *mtable; + + mtable = (struct mediatable *) + kmalloc(sizeof(struct mediatable) + sizeof(struct medialeaf), + GFP_KERNEL); + if (mtable == NULL) + return; /* Horrible, impossible failure. */ + + tp->mtable = mtable; + mtable->defaultmedia = 0x800; + mtable->leafcount = 1; + mtable->csr12dir = 0x3f; /* inputs on bit7 for hsc-pci, bit6 for pci-fx */ + mtable->has_nonmii = 0; + mtable->has_reset = 0; + mtable->has_mii = 1; + mtable->csr15dir = mtable->csr15val = 0; + mtable->mleaf[0].type = 1; + mtable->mleaf[0].media = 11; + mtable->mleaf[0].leafdata = &leafdata[0]; + tp->flags |= HAS_PHY_IRQ; + tp->csr12_shadow = -1; + } +#endif } else if (tp->chip_id == DC21041) { unsigned char *p = (void *)ee_data + ee_data[27 + controller_index*3]; int media = get_u16(p); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/tulip/interrupt.c linux.20pre5-ac2/drivers/net/tulip/interrupt.c --- linux.20pre5/drivers/net/tulip/interrupt.c 2002-08-29 18:39:37.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/tulip/interrupt.c 2002-08-06 15:42:06.000000000 +0100 @@ -291,6 +291,23 @@ #endif } +static inline void phy_interrupt (struct net_device *dev, struct tulip_private *tp, long ioaddr) +{ + int csr12; + + csr12 = inl(ioaddr + CSR12) & 0xff; + if (csr12 != tp->csr12_shadow) { + /* ack interrupt */ + outl(csr12 | 0x02, ioaddr + CSR12); + tp->csr12_shadow = csr12; + /* do link change stuff */ + spin_lock(&tp->lock); + tulip_check_duplex(dev); + spin_unlock(&tp->lock); + /* clear irq ack bit */ + outl(csr12 & ~0x02, ioaddr + CSR12); + } +} /* The interrupt handler does all of the Rx thread work and cleans up after the Tx thread. */ @@ -313,6 +330,10 @@ /* Let's see whether the interrupt really is for us */ csr5 = inl(ioaddr + CSR5); + + if (tp->flags & HAS_PHY_IRQ) + phy_interrupt (dev, tp, ioaddr); + if ((csr5 & (NormalIntr|AbnormalIntr)) == 0) return; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/tulip/media.c linux.20pre5-ac2/drivers/net/tulip/media.c --- linux.20pre5/drivers/net/tulip/media.c 2002-08-29 18:39:37.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/tulip/media.c 2002-08-25 16:21:42.000000000 +0100 @@ -284,6 +284,10 @@ for (i = 0; i < init_length; i++) outl(init_sequence[i], ioaddr + CSR12); } + + inl(ioaddr + CSR6); /* flush posted writes */ + udelay(500); + tmp_info = get_u16(&misc_info[1]); if (tmp_info) tp->advertising[phy_num] = tmp_info | 1; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/tulip/tulip_core.c linux.20pre5-ac2/drivers/net/tulip/tulip_core.c --- linux.20pre5/drivers/net/tulip/tulip_core.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/tulip/tulip_core.c 2002-08-26 01:05:33.000000000 +0100 @@ -471,6 +471,16 @@ } else tulip_select_media(dev, 1); + /* check for Apple 100BaseTX card and disable loops */ + + if ((dev->dev_addr[0] == 0x00) && + (dev->dev_addr[1] == 0x05) && + (dev->dev_addr[2] == 0x02) && + (tp->chip_id == DC21140)) { + outl(0x10f, ioaddr + CSR12); + outl(0x03, ioaddr + CSR12); + } + /* Start the chip's Tx to process setup frame. */ tulip_stop_rxtx(tp); barrier(); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/tulip/tulip.h linux.20pre5-ac2/drivers/net/tulip/tulip.h --- linux.20pre5/drivers/net/tulip/tulip.h 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/tulip/tulip.h 2002-09-02 14:57:05.000000000 +0100 @@ -63,6 +63,7 @@ HAS_8023X = 0x0400, COMET_MAC_ADDR = 0x0800, HAS_PCI_MWI = 0x1000, + HAS_PHY_IRQ = 0x2000, }; @@ -388,7 +389,8 @@ int susp_rx; unsigned long nir; unsigned long base_addr; - int pad0, pad1; /* Used for 8-byte alignment */ + int csr12_shadow; + int pad1; /* Used for 8-byte alignment */ }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/wan/8253x/sab8253xds.txt linux.20pre5-ac2/drivers/net/wan/8253x/sab8253xds.txt --- linux.20pre5/drivers/net/wan/8253x/sab8253xds.txt 2002-08-29 18:39:36.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/wan/8253x/sab8253xds.txt 2002-08-06 15:42:06.000000000 +0100 @@ -92,7 +92,7 @@ -*ln ^Ös /home/martillo/kernel/linux-2.4.3/include/asm-i386 +*ln –s /home/martillo/kernel/linux-2.4.3/include/asm-i386 /home/martillo/kernel/linux-2.4.3/include/asm* * * @@ -101,12 +101,12 @@ * * -*ln ^Ös /home/martillo/kernel/linux-2.4.6/include/asm-i386 +*ln –s /home/martillo/kernel/linux-2.4.6/include/asm-i386 /home/martillo/kernel/linux-2.4.6/include/asm* * * -*ln ^Ös / /frolix * +*ln –s / /frolix * @@ -173,7 +173,7 @@ From a shell window: -*xemacs ^Öe shell&* +*xemacs –e shell&* @@ -854,7 +854,7 @@ -patch ^Öp1 < /{directory-patch}//8253x.patch +patch –p1 < /{directory-patch}//8253x.patch @@ -1051,7 +1051,7 @@ - The ASLX driver is designed to be a ^Óplug-and-play^Ô driver as far as + The ASLX driver is designed to be a “plug-and-play” driver as far as possible. If it is built as a dynamically loadable module, the user (or relevant system configuration file) invokes /insmod /to load the ASLX.o file. @@ -1169,7 +1169,7 @@ -cu ^Öl /dev/ttyS{n} ^Ös 9600 +cu –l /dev/ttyS{n} –s 9600 @@ -1281,7 +1281,7 @@ -cu ^Öl /dev/sttyS{n} ^Ös 9600 +cu –l /dev/sttyS{n} –s 9600 @@ -1289,7 +1289,7 @@ -8253xcfg /dev/sttyS? ^Ön 64 152 0 4 0 140 15 +8253xcfg /dev/sttyS? –n 64 152 0 4 0 140 15 @@ -1658,7 +1658,7 @@ The 8253xcfg command provides access to images of the channel control, mode and baud rate generator registers of the serial port that is specified by the minor device number (port number = minor device number -^Ö minor_start) of the TTY device (either synchronous, asynchronous or +– minor_start) of the TTY device (either synchronous, asynchronous or callout) specified on the command line by which 8253xcfg is invoked. The next time the port is initialized (usually on the first open after every process that currently has the port open has closed it) these @@ -2691,37 +2691,37 @@ -1. SAB_BOARD structure ^Ö driver specific +1. SAB_BOARD structure – driver specific -2. SAB_CHIP structure ^Ö driver specific +2. SAB_CHIP structure – driver specific -3. SAB_PORT structure ^Ö driver specific +3. SAB_PORT structure – driver specific -4. AURA_CIM structure ^Ö driver specific (actually specific to the +4. AURA_CIM structure – driver specific (actually specific to the multichannel server) -5. RING_DESCRIPTOR ^Ö used by all the driver functionalities in the +5. RING_DESCRIPTOR – used by all the driver functionalities in the transmission of data. -6. DCONTROL2 ^Ö used by all the driver functionalities in managing +6. DCONTROL2 – used by all the driver functionalities in managing the transmission of data. -7. struct sk_buff_head ^Ö two buffer lists are associated with the +7. struct sk_buff_head – two buffer lists are associated with the SAB_PORT structure are used to track all the sk_buffs that are currently in use at each port. -8. struct tty_struct ^Ö one per port, standard structure by which +8. struct tty_struct – one per port, standard structure by which the TTY driver access low level routines for either asynchronous TTY, synchronous TTY and callout functionality. The SAB_PORT serves as the private data structure associated with each 8253x TTY, which on a given open can instantiate itself as a synchronous TTY, an asynchronous TTY or as a call out device. -9. struct net_device ^Ö one per port, standard network device +9. struct net_device – one per port, standard network device structure. The SAB_PORT serves as the private data structure associated with each 8253x network interface. -10. struct file_operations ^Ö one per port, standard character device +10. struct file_operations – one per port, standard character device structure. The SAB_PORT serves as the private data structure associated with each 8253x character interface. diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/net/wan/8253x/sab8253xfs.txt linux.20pre5-ac2/drivers/net/wan/8253x/sab8253xfs.txt --- linux.20pre5/drivers/net/wan/8253x/sab8253xfs.txt 2002-08-29 18:39:36.000000000 +0100 +++ linux.20pre5-ac2/drivers/net/wan/8253x/sab8253xfs.txt 2002-08-06 15:42:06.000000000 +0100 @@ -44,7 +44,7 @@ to the driver. The ASLX driver will automatically correct incorrectly programmed adapter card or Multichannel server serial EEPROMs. Moreover, in addition to the primary serial communications interface, -the ASLX driver provides a ^Ómaintenance^Ô interface to the serial EEPROMs +the ASLX driver provides a “maintenance” interface to the serial EEPROMs so that user intervention can correct an incorrectly programmed EEPROM. @@ -336,7 +336,7 @@ -Synchronous TTYs act just like asynchronous TTYs (e.g., getty^Òs may be +Synchronous TTYs act just like asynchronous TTYs (e.g., getty’s may be associated with them, and a user may invoke cu on them) in so far as possible (to wit, break processing is not possible on a synchronous TTY). @@ -536,7 +536,7 @@ In a sense, the synchronous character device implements an emulation of -Solaris putmsg/getmsg functionality for Aurora^Òs synchronous serial +Solaris putmsg/getmsg functionality for Aurora’s synchronous serial device. The availability of such emulation should help the portation of applications from Solaris to a Linux platform that uses Aurora hardware and software. @@ -586,7 +586,7 @@ Linux is not capable of registering an interrupt handler for each port -separately (when there are many ports ^Ö the specialty of Aurora +separately (when there are many ports – the specialty of Aurora hardware), and such an approach would have lower performance than having a single interrupt handler that polled the ports. In any case, interrupt status registers associated with the Aurora hardware often diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/pci/pci.c linux.20pre5-ac2/drivers/pci/pci.c --- linux.20pre5/drivers/pci/pci.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/pci/pci.c 2002-08-29 18:51:53.000000000 +0100 @@ -1687,7 +1687,7 @@ return error; } -static int pci_pm_suspend(u32 state) +int pci_pm_suspend(u32 state) { struct list_head *list; struct pci_bus *bus; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/pcmcia/yenta.c linux.20pre5-ac2/drivers/pcmcia/yenta.c --- linux.20pre5/drivers/pcmcia/yenta.c 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/pcmcia/yenta.c 2002-08-26 14:27:29.000000000 +0100 @@ -2,6 +2,11 @@ * Regular lowlevel cardbus driver ("yenta") * * (C) Copyright 1999, 2000 Linus Torvalds + * + * Changelog: + * Aug 2002: Manfred Spraul + * Dynamically adjust the size of the bridge resource + * */ #include #include @@ -704,6 +709,15 @@ return 0; } +/* + * Use an adaptive allocation for the memory resource, + * sometimes the size behind pci bridges is limited: + * 1/8 of the size of the io window of the parent. + * max 4 MB, min 16 kB. + */ +#define BRIDGE_SIZE_MAX 4*1024*1024 +#define BRIDGE_SIZE_MIN 16*1024 + static void yenta_allocate_res(pci_socket_t *socket, int nr, unsigned type) { struct pci_bus *bus; @@ -735,21 +749,42 @@ if (start && end > start) { res->start = start; res->end = end; - request_resource(root, res); - return; + if (request_resource(root, res) == 0) + return; + printk(KERN_INFO "yenta %s: Preassigned resource %d busy, reconfiguring...\n", + socket->dev->slot_name, nr); + res->start = res->end = 0; } - align = size = 4*1024*1024; - min = PCIBIOS_MIN_MEM; max = ~0U; if (type & IORESOURCE_IO) { align = 1024; size = 256; min = 0x4000; max = 0xffff; + } else { + unsigned long avail = root->end - root->start; + int i; + align = size = BRIDGE_SIZE_MAX; + if (size > avail/8) { + size=(avail+1)/8; + /* round size down to next power of 2 */ + i = 0; + while ((size /= 2) != 0) + i++; + size = 1 << i; + } + if (size < BRIDGE_SIZE_MIN) + size = BRIDGE_SIZE_MIN; + align = size; + min = PCIBIOS_MIN_MEM; max = ~0U; } - if (allocate_resource(root, res, size, min, max, align, NULL, NULL) < 0) + if (allocate_resource(root, res, size, min, max, align, NULL, NULL) < 0) { + printk(KERN_INFO "yenta %s: no resource of type %x available, trying to continue...\n", + socket->dev->slot_name, type); + res->start = res->end = 0; return; + } config_writel(socket, offset, res->start); config_writel(socket, offset+4, res->end); @@ -767,6 +802,20 @@ } /* + * Free the bridge mappings for the device.. + */ +static void yenta_free_resources(pci_socket_t *socket) +{ + int i; + for (i=0;i<4;i++) { + struct resource *res; + res = socket->dev->resource + PCI_BRIDGE_RESOURCES + i; + if (res->start != 0 && res->end != 0) + release_resource(res); + res->start = res->end = 0; + } +} +/* * Close it down - release our resources and go home.. */ static void yenta_close(pci_socket_t *sock) @@ -782,6 +831,7 @@ if (sock->base) iounmap(sock->base); + yenta_free_resources(sock); } #include "ti113x.h" diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/pnp/Config.in linux.20pre5-ac2/drivers/pnp/Config.in --- linux.20pre5/drivers/pnp/Config.in 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/pnp/Config.in 2002-08-06 15:42:11.000000000 +0100 @@ -8,4 +8,8 @@ dep_tristate ' ISA Plug and Play support' CONFIG_ISAPNP $CONFIG_PNP +if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + dep_bool ' PNPBIOS support (EXPERIMENTAL)' CONFIG_PNPBIOS $CONFIG_PNP +fi + endmenu diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/pnp/Makefile linux.20pre5-ac2/drivers/pnp/Makefile --- linux.20pre5/drivers/pnp/Makefile 2002-08-29 18:39:42.000000000 +0100 +++ linux.20pre5-ac2/drivers/pnp/Makefile 2002-08-06 15:42:11.000000000 +0100 @@ -10,15 +10,22 @@ O_TARGET := pnp.o -export-objs := isapnp.o -list-multi := isa-pnp.o +export-objs := isapnp.o pnpbios_core.o +multi-objs := isa-pnp.o pnpbios.o -proc-$(CONFIG_PROC_FS) = isapnp_proc.o -isa-pnp-objs := isapnp.o quirks.o $(proc-y) +isa-pnp-proc-$(CONFIG_PROC_FS) = isapnp_proc.o +pnpbios-proc-$(CONFIG_PROC_FS) = pnpbios_proc.o + +isa-pnp-objs := isapnp.o quirks.o $(isa-pnp-proc-y) +pnpbios-objs := pnpbios_core.o $(pnpbios-proc-y) obj-$(CONFIG_ISAPNP) += isa-pnp.o +obj-$(CONFIG_PNPBIOS) += pnpbios.o include $(TOPDIR)/Rules.make isa-pnp.o: $(isa-pnp-objs) $(LD) $(LD_RFLAG) -r -o $@ $(isa-pnp-objs) + +pnpbios.o: $(pnpbios-objs) + $(LD) $(LD_RFLAG) -r -o $@ $(pnpbios-objs) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/pnp/pnpbios_core.c linux.20pre5-ac2/drivers/pnp/pnpbios_core.c --- linux.20pre5/drivers/pnp/pnpbios_core.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/pnp/pnpbios_core.c 2002-08-06 15:42:11.000000000 +0100 @@ -0,0 +1,1352 @@ +/* + * PnP BIOS services + * + * Originally (C) 1998 Christian Schmidt + * Modifications (c) 1998 Tom Lees + * Minor reorganizations by David Hinds + * Modifications (c) 2001,2002 by Thomas Hood + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2, or (at your option) any + * later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * References: + * Compaq Computer Corporation, Phoenix Technologies Ltd., Intel Corporation + * Plug and Play BIOS Specification, Version 1.0A, May 5, 1994 + * Plug and Play BIOS Clarification Paper, October 6, 1994 + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +/* + * + * PnP BIOS INTERFACE + * + */ + +/* PnP BIOS signature: "$PnP" */ +#define PNP_SIGNATURE (('$' << 0) + ('P' << 8) + ('n' << 16) + ('P' << 24)) + +#pragma pack(1) +union pnp_bios_expansion_header { + struct { + u32 signature; /* "$PnP" */ + u8 version; /* in BCD */ + u8 length; /* length in bytes, currently 21h */ + u16 control; /* system capabilities */ + u8 checksum; /* all bytes must add up to 0 */ + + u32 eventflag; /* phys. address of the event flag */ + u16 rmoffset; /* real mode entry point */ + u16 rmcseg; + u16 pm16offset; /* 16 bit protected mode entry */ + u32 pm16cseg; + u32 deviceID; /* EISA encoded system ID or 0 */ + u16 rmdseg; /* real mode data segment */ + u32 pm16dseg; /* 16 bit pm data segment base */ + } fields; + char chars[0x21]; /* To calculate the checksum */ +}; +#pragma pack() + +static struct { + u16 offset; + u16 segment; +} pnp_bios_callpoint; + +static union pnp_bios_expansion_header * pnp_bios_hdr = NULL; + +/* The PnP BIOS entries in the GDT */ +#define PNP_GDT (0x0060) +#define PNP_CS32 (PNP_GDT+0x00) /* segment for calling fn */ +#define PNP_CS16 (PNP_GDT+0x08) /* code segment for BIOS */ +#define PNP_DS (PNP_GDT+0x10) /* data segment for BIOS */ +#define PNP_TS1 (PNP_GDT+0x18) /* transfer data segment */ +#define PNP_TS2 (PNP_GDT+0x20) /* another data segment */ + +/* + * These are some opcodes for a "static asmlinkage" + * As this code is *not* executed inside the linux kernel segment, but in a + * alias at offset 0, we need a far return that can not be compiled by + * default (please, prove me wrong! this is *really* ugly!) + * This is the only way to get the bios to return into the kernel code, + * because the bios code runs in 16 bit protected mode and therefore can only + * return to the caller if the call is within the first 64kB, and the linux + * kernel begins at offset 3GB... + */ + +asmlinkage void pnp_bios_callfunc(void); + +__asm__( + ".text \n" + __ALIGN_STR "\n" + SYMBOL_NAME_STR(pnp_bios_callfunc) ":\n" + " pushl %edx \n" + " pushl %ecx \n" + " pushl %ebx \n" + " pushl %eax \n" + " lcallw " SYMBOL_NAME_STR(pnp_bios_callpoint) "\n" + " addl $16, %esp \n" + " lret \n" + ".previous \n" +); + +#define Q_SET_SEL(selname, address, size) \ +set_base (gdt [(selname) >> 3], __va((u32)(address))); \ +set_limit (gdt [(selname) >> 3], size) + +#define Q2_SET_SEL(selname, address, size) \ +set_base (gdt [(selname) >> 3], (u32)(address)); \ +set_limit (gdt [(selname) >> 3], size) + +/* + * At some point we want to use this stack frame pointer to unwind + * after PnP BIOS oopses. + */ + +u32 pnp_bios_fault_esp; +u32 pnp_bios_fault_eip; +u32 pnp_bios_is_utter_crap = 0; + +static spinlock_t pnp_bios_lock; + +static inline u16 call_pnp_bios(u16 func, u16 arg1, u16 arg2, u16 arg3, + u16 arg4, u16 arg5, u16 arg6, u16 arg7, + void *ts1_base, u32 ts1_size, + void *ts2_base, u32 ts2_size) +{ + unsigned long flags; + u16 status; + + /* + * PnP BIOSes are generally not terribly re-entrant. + * Also, don't rely on them to save everything correctly. + */ + if(pnp_bios_is_utter_crap) + return PNP_FUNCTION_NOT_SUPPORTED; + + /* On some boxes IRQ's during PnP BIOS calls are deadly. */ + spin_lock_irqsave(&pnp_bios_lock, flags); + + if (ts1_size) + Q2_SET_SEL(PNP_TS1, ts1_base, ts1_size); + if (ts2_size) + Q2_SET_SEL(PNP_TS2, ts2_base, ts2_size); + + __asm__ __volatile__( + "pushl %%ebp\n\t" + "pushl %%edi\n\t" + "pushl %%esi\n\t" + "pushl %%ds\n\t" + "pushl %%es\n\t" + "pushl %%fs\n\t" + "pushl %%gs\n\t" + "pushfl\n\t" + "movl %%esp, pnp_bios_fault_esp\n\t" + "movl $1f, pnp_bios_fault_eip\n\t" + "lcall %5,%6\n\t" + "1:popfl\n\t" + "popl %%gs\n\t" + "popl %%fs\n\t" + "popl %%es\n\t" + "popl %%ds\n\t" + "popl %%esi\n\t" + "popl %%edi\n\t" + "popl %%ebp\n\t" + : "=a" (status) + : "0" ((func) | (((u32)arg1) << 16)), + "b" ((arg2) | (((u32)arg3) << 16)), + "c" ((arg4) | (((u32)arg5) << 16)), + "d" ((arg6) | (((u32)arg7) << 16)), + "i" (PNP_CS32), + "i" (0) + : "memory" + ); + spin_unlock_irqrestore(&pnp_bios_lock, flags); + + /* If we get here and this is set then the PnP BIOS faulted on us. */ + if(pnp_bios_is_utter_crap) + { + printk(KERN_ERR "PnPBIOS: Warning! Your PnP BIOS caused a fatal error. Attempting to continue.\n"); + printk(KERN_ERR "PnPBIOS: You may need to reboot with the \"pnpbios=off\" option to operate stably.\n"); + printk(KERN_ERR "PnPBIOS: Check with your vendor for an updated BIOS.\n"); + } + + return status; +} + + +/* + * + * UTILITY FUNCTIONS + * + */ + +static void pnpbios_warn_unexpected_status(const char * module, u16 status) +{ + printk(KERN_ERR "PnPBIOS: %s: Unexpected status 0x%x\n", module, status); +} + +void *pnpbios_kmalloc(size_t size, int f) +{ + void *p = kmalloc( size, f ); + if ( p == NULL ) + printk(KERN_ERR "PnPBIOS: kmalloc() failed\n"); + return p; +} + +/* + * Call this only after init time + */ +static inline int pnp_bios_present(void) +{ + return (pnp_bios_hdr != NULL); +} + +/* Forward declaration */ +static void update_devlist( u8 nodenum, struct pnp_bios_node *data ); + + +/* + * + * PnP BIOS ACCESS FUNCTIONS + * + */ + +#define PNP_GET_NUM_SYS_DEV_NODES 0x00 +#define PNP_GET_SYS_DEV_NODE 0x01 +#define PNP_SET_SYS_DEV_NODE 0x02 +#define PNP_GET_EVENT 0x03 +#define PNP_SEND_MESSAGE 0x04 +#define PNP_GET_DOCKING_STATION_INFORMATION 0x05 +#define PNP_SET_STATIC_ALLOCED_RES_INFO 0x09 +#define PNP_GET_STATIC_ALLOCED_RES_INFO 0x0a +#define PNP_GET_APM_ID_TABLE 0x0b +#define PNP_GET_PNP_ISA_CONFIG_STRUC 0x40 +#define PNP_GET_ESCD_INFO 0x41 +#define PNP_READ_ESCD 0x42 +#define PNP_WRITE_ESCD 0x43 + +/* + * Call PnP BIOS with function 0x00, "get number of system device nodes" + */ +static int __pnp_bios_dev_node_info(struct pnp_dev_node_info *data) +{ + u16 status; + if (!pnp_bios_present()) + return PNP_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_GET_NUM_SYS_DEV_NODES, 0, PNP_TS1, 2, PNP_TS1, PNP_DS, 0, 0, + data, sizeof(struct pnp_dev_node_info), 0, 0); + data->no_nodes &= 0xff; + return status; +} + +int pnp_bios_dev_node_info(struct pnp_dev_node_info *data) +{ + int status = __pnp_bios_dev_node_info( data ); + if ( status ) + pnpbios_warn_unexpected_status( "dev_node_info", status ); + return status; +} + +/* + * Note that some PnP BIOSes (e.g., on Sony Vaio laptops) die a horrible + * death if they are asked to access the "current" configuration. + * Therefore, if it's a matter of indifference, it's better to call + * get_dev_node() and set_dev_node() with boot=1 rather than with boot=0. + */ + +/* + * Call PnP BIOS with function 0x01, "get system device node" + * Input: *nodenum = desired node, + * boot = whether to get nonvolatile boot (!=0) + * or volatile current (0) config + * Output: *nodenum=next node or 0xff if no more nodes + */ +static int __pnp_bios_get_dev_node(u8 *nodenum, char boot, struct pnp_bios_node *data) +{ + u16 status; + if (!pnp_bios_present()) + return PNP_FUNCTION_NOT_SUPPORTED; + if ( !boot & pnpbios_dont_use_current_config ) + return PNP_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_GET_SYS_DEV_NODE, 0, PNP_TS1, 0, PNP_TS2, boot ? 2 : 1, PNP_DS, 0, + nodenum, sizeof(char), data, 65536); + return status; +} + +int pnp_bios_get_dev_node(u8 *nodenum, char boot, struct pnp_bios_node *data) +{ + int status; + status = __pnp_bios_get_dev_node( nodenum, boot, data ); + if ( status ) + pnpbios_warn_unexpected_status( "get_dev_node", status ); + return status; +} + + +/* + * Call PnP BIOS with function 0x02, "set system device node" + * Input: *nodenum = desired node, + * boot = whether to set nonvolatile boot (!=0) + * or volatile current (0) config + */ +static int __pnp_bios_set_dev_node(u8 nodenum, char boot, struct pnp_bios_node *data) +{ + u16 status; + if (!pnp_bios_present()) + return PNP_FUNCTION_NOT_SUPPORTED; + if ( !boot & pnpbios_dont_use_current_config ) + return PNP_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_SET_SYS_DEV_NODE, nodenum, 0, PNP_TS1, boot ? 2 : 1, PNP_DS, 0, 0, + data, 65536, 0, 0); + return status; +} + +int pnp_bios_set_dev_node(u8 nodenum, char boot, struct pnp_bios_node *data) +{ + int status; + status = __pnp_bios_set_dev_node( nodenum, boot, data ); + if ( status ) { + pnpbios_warn_unexpected_status( "set_dev_node", status ); + return status; + } + if ( !boot ) { /* Update devlist */ + u8 thisnodenum = nodenum; + status = pnp_bios_get_dev_node( &nodenum, boot, data ); + if ( status ) + return status; + update_devlist( thisnodenum, data ); + } + return status; +} + +#if needed +/* + * Call PnP BIOS with function 0x03, "get event" + */ +static int pnp_bios_get_event(u16 *event) +{ + u16 status; + if (!pnp_bios_present()) + return PNP_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_GET_EVENT, 0, PNP_TS1, PNP_DS, 0, 0 ,0 ,0, + event, sizeof(u16), 0, 0); + return status; +} +#endif + +#if needed +/* + * Call PnP BIOS with function 0x04, "send message" + */ +static int pnp_bios_send_message(u16 message) +{ + u16 status; + if (!pnp_bios_present()) + return PNP_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_SEND_MESSAGE, message, PNP_DS, 0, 0, 0, 0, 0, 0, 0, 0, 0); + return status; +} +#endif + +#ifdef CONFIG_HOTPLUG +/* + * Call PnP BIOS with function 0x05, "get docking station information" + */ +static int pnp_bios_dock_station_info(struct pnp_docking_station_info *data) +{ + u16 status; + if (!pnp_bios_present()) + return PNP_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_GET_DOCKING_STATION_INFORMATION, 0, PNP_TS1, PNP_DS, 0, 0, 0, 0, + data, sizeof(struct pnp_docking_station_info), 0, 0); + return status; +} +#endif + +#if needed +/* + * Call PnP BIOS with function 0x09, "set statically allocated resource + * information" + */ +static int pnp_bios_set_stat_res(char *info) +{ + u16 status; + if (!pnp_bios_present()) + return PNP_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_SET_STATIC_ALLOCED_RES_INFO, 0, PNP_TS1, PNP_DS, 0, 0, 0, 0, + info, *((u16 *) info), 0, 0); + return status; +} +#endif + +/* + * Call PnP BIOS with function 0x0a, "get statically allocated resource + * information" + */ +static int __pnp_bios_get_stat_res(char *info) +{ + u16 status; + if (!pnp_bios_present()) + return PNP_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_GET_STATIC_ALLOCED_RES_INFO, 0, PNP_TS1, PNP_DS, 0, 0, 0, 0, + info, 65536, 0, 0); + return status; +} + +int pnp_bios_get_stat_res(char *info) +{ + int status; + status = __pnp_bios_get_stat_res( info ); + if ( status ) + pnpbios_warn_unexpected_status( "get_stat_res", status ); + return status; +} + +#if needed +/* + * Call PnP BIOS with function 0x0b, "get APM id table" + */ +static int pnp_bios_apm_id_table(char *table, u16 *size) +{ + u16 status; + if (!pnp_bios_present()) + return PNP_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_GET_APM_ID_TABLE, 0, PNP_TS2, 0, PNP_TS1, PNP_DS, 0, 0, + table, *size, size, sizeof(u16)); + return status; +} +#endif + +/* + * Call PnP BIOS with function 0x40, "get isa pnp configuration structure" + */ +static int __pnp_bios_isapnp_config(struct pnp_isa_config_struc *data) +{ + u16 status; + if (!pnp_bios_present()) + return PNP_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_GET_PNP_ISA_CONFIG_STRUC, 0, PNP_TS1, PNP_DS, 0, 0, 0, 0, + data, sizeof(struct pnp_isa_config_struc), 0, 0); + return status; +} + +int pnp_bios_isapnp_config(struct pnp_isa_config_struc *data) +{ + int status; + status = __pnp_bios_isapnp_config( data ); + if ( status ) + pnpbios_warn_unexpected_status( "isapnp_config", status ); + return status; +} + +/* + * Call PnP BIOS with function 0x41, "get ESCD info" + */ +static int __pnp_bios_escd_info(struct escd_info_struc *data) +{ + u16 status; + if (!pnp_bios_present()) + return ESCD_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_GET_ESCD_INFO, 0, PNP_TS1, 2, PNP_TS1, 4, PNP_TS1, PNP_DS, + data, sizeof(struct escd_info_struc), 0, 0); + return status; +} + +int pnp_bios_escd_info(struct escd_info_struc *data) +{ + int status; + status = __pnp_bios_escd_info( data ); + if ( status ) + pnpbios_warn_unexpected_status( "escd_info", status ); + return status; +} + +/* + * Call PnP BIOS function 0x42, "read ESCD" + * nvram_base is determined by calling escd_info + */ +static int __pnp_bios_read_escd(char *data, u32 nvram_base) +{ + u16 status; + if (!pnp_bios_present()) + return ESCD_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_READ_ESCD, 0, PNP_TS1, PNP_TS2, PNP_DS, 0, 0, 0, + data, 65536, (void *)nvram_base, 65536); + return status; +} + +int pnp_bios_read_escd(char *data, u32 nvram_base) +{ + int status; + status = __pnp_bios_read_escd( data, nvram_base ); + if ( status ) + pnpbios_warn_unexpected_status( "read_escd", status ); + return status; +} + +#if needed +/* + * Call PnP BIOS function 0x43, "write ESCD" + */ +static int pnp_bios_write_escd(char *data, u32 nvram_base) +{ + u16 status; + if (!pnp_bios_present()) + return ESCD_FUNCTION_NOT_SUPPORTED; + status = call_pnp_bios(PNP_WRITE_ESCD, 0, PNP_TS1, PNP_TS2, PNP_DS, 0, 0, 0, + data, 65536, nvram_base, 65536); + return status; +} +#endif + + +/* + * + * DOCKING FUNCTIONS + * + */ + +#ifdef CONFIG_HOTPLUG + +static int unloading = 0; +static struct completion unload_sem; + +/* + * (Much of this belongs in a shared routine somewhere) + */ + +static int pnp_dock_event(int dock, struct pnp_docking_station_info *info) +{ + char *argv [3], **envp, *buf, *scratch; + int i = 0, value; + + if (!hotplug_path [0]) + return -ENOENT; + if (!current->fs->root) { + return -EAGAIN; + } + if (!(envp = (char **) pnpbios_kmalloc (20 * sizeof (char *), GFP_KERNEL))) { + return -ENOMEM; + } + if (!(buf = pnpbios_kmalloc (256, GFP_KERNEL))) { + kfree (envp); + return -ENOMEM; + } + + /* only one standardized param to hotplug command: type */ + argv [0] = hotplug_path; + argv [1] = "dock"; + argv [2] = 0; + + /* minimal command environment */ + envp [i++] = "HOME=/"; + envp [i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin"; + +#ifdef DEBUG + /* hint that policy agent should enter no-stdout debug mode */ + envp [i++] = "DEBUG=kernel"; +#endif + /* extensible set of named bus-specific parameters, + * supporting multiple driver selection algorithms. + */ + scratch = buf; + + /* action: add, remove */ + envp [i++] = scratch; + scratch += sprintf (scratch, "ACTION=%s", dock?"add":"remove") + 1; + + /* Report the ident for the dock */ + envp [i++] = scratch; + scratch += sprintf (scratch, "DOCK=%x/%x/%x", + info->location_id, info->serial, info->capabilities); + envp[i] = 0; + + value = call_usermodehelper (argv [0], argv, envp); + kfree (buf); + kfree (envp); + return 0; +} + +/* + * Poll the PnP docking at regular intervals + */ +static int pnp_dock_thread(void * unused) +{ + static struct pnp_docking_station_info now; + int docked = -1, d = 0; + daemonize(); + reparent_to_init(); + strcpy(current->comm, "kpnpbiosd"); + while(!unloading && !signal_pending(current)) + { + int status; + + /* + * Poll every 2 seconds + */ + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(HZ*2); + if(signal_pending(current)) + break; + + status = pnp_bios_dock_station_info(&now); + + switch(status) + { + /* + * No dock to manage + */ + case PNP_FUNCTION_NOT_SUPPORTED: + complete_and_exit(&unload_sem, 0); + case PNP_SYSTEM_NOT_DOCKED: + d = 0; + break; + case PNP_SUCCESS: + d = 1; + break; + default: + pnpbios_warn_unexpected_status( "pnp_dock_thread", status ); + continue; + } + if(d != docked) + { + if(pnp_dock_event(d, &now)==0) + { + docked = d; +#if 0 + printk(KERN_INFO "PnPBIOS: Docking station %stached\n", docked?"at":"de"); +#endif + } + } + } + complete_and_exit(&unload_sem, 0); +} + +#endif /* CONFIG_HOTPLUG */ + + +/* + * + * NODE DATA PARSING FUNCTIONS + * + */ + +static void add_irqresource(struct pci_dev *dev, int irq) +{ + int i = 0; + while (!(dev->irq_resource[i].flags & IORESOURCE_UNSET) && i < DEVICE_COUNT_IRQ) i++; + if (i < DEVICE_COUNT_IRQ) { + dev->irq_resource[i].start = (unsigned long) irq; + dev->irq_resource[i].flags = IORESOURCE_IRQ; // Also clears _UNSET flag + } +} + +static void add_dmaresource(struct pci_dev *dev, int dma) +{ + int i = 0; + while (!(dev->dma_resource[i].flags & IORESOURCE_UNSET) && i < DEVICE_COUNT_DMA) i++; + if (i < DEVICE_COUNT_DMA) { + dev->dma_resource[i].start = (unsigned long) dma; + dev->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag + } +} + +static void add_ioresource(struct pci_dev *dev, int io, int len) +{ + int i = 0; + while (!(dev->resource[i].flags & IORESOURCE_UNSET) && i < DEVICE_COUNT_RESOURCE) i++; + if (i < DEVICE_COUNT_RESOURCE) { + dev->resource[i].start = (unsigned long) io; + dev->resource[i].end = (unsigned long)(io + len - 1); + dev->resource[i].flags = IORESOURCE_IO; // Also clears _UNSET flag + } +} + +static void add_memresource(struct pci_dev *dev, int mem, int len) +{ + int i = 0; + while (!(dev->resource[i].flags & IORESOURCE_UNSET) && i < DEVICE_COUNT_RESOURCE) i++; + if (i < DEVICE_COUNT_RESOURCE) { + dev->resource[i].start = (unsigned long) mem; + dev->resource[i].end = (unsigned long)(mem + len - 1); + dev->resource[i].flags = IORESOURCE_MEM; // Also clears _UNSET flag + } +} + +static void node_resource_data_to_dev(struct pnp_bios_node *node, struct pci_dev *dev) +{ + unsigned char *p = node->data, *lastp=NULL; + int i; + + /* + * First, set resource info to default values + */ + for (i=0;iresource[i].start = 0; // "disabled" + dev->resource[i].flags = IORESOURCE_UNSET; + } + for (i=0;iirq_resource[i].start = (unsigned long)-1; // "disabled" + dev->irq_resource[i].flags = IORESOURCE_UNSET; + } + for (i=0;idma_resource[i].start = (unsigned long)-1; // "disabled" + dev->dma_resource[i].flags = IORESOURCE_UNSET; + } + + /* + * Fill in dev resource info + */ + while ( (char *)p < ((char *)node->data + node->size )) { + if(p==lastp) break; + + if( p[0] & 0x80 ) {// large item + switch (p[0] & 0x7f) { + case 0x01: // memory + { + int io = *(short *) &p[4]; + int len = *(short *) &p[10]; + add_memresource(dev, io, len); + break; + } + case 0x02: // device name + { + int len = *(short *) &p[1]; + memcpy(dev->name, p + 3, len >= 80 ? 79 : len); + break; + } + case 0x05: // 32-bit memory + { + int io = *(int *) &p[4]; + int len = *(int *) &p[16]; + add_memresource(dev, io, len); + break; + } + case 0x06: // fixed location 32-bit memory + { + int io = *(int *) &p[4]; + int len = *(int *) &p[8]; + add_memresource(dev, io, len); + break; + } + } /* switch */ + lastp = p+3; + p = p + p[1] + p[2]*256 + 3; + continue; + } + if ((p[0]>>3) == 0x0f) // end tag + break; + switch (p[0]>>3) { + case 0x04: // irq + { + int i, mask, irq = -1; + mask= p[1] + p[2]*256; + for (i=0;i<16;i++, mask=mask>>1) + if(mask & 0x01) irq=i; + add_irqresource(dev, irq); + break; + } + case 0x05: // dma + { + int i, mask, dma = -1; + mask = p[1]; + for (i=0;i<8;i++, mask = mask>>1) + if(mask & 0x01) dma=i; + add_dmaresource(dev, dma); + break; + } + case 0x08: // io + { + int io= p[2] + p[3] *256; + int len = p[7]; + add_ioresource(dev, io, len); + break; + } + case 0x09: // fixed location io + { + int io = p[1] + p[2] * 256; + int len = p[3]; + add_ioresource(dev, io, len); + break; + } + } /* switch */ + lastp=p+1; + p = p + (p[0] & 0x07) + 1; + + } /* while */ + + return; +} + + +/* + * + * DEVICE LIST MANAGEMENT FUNCTIONS + * + * + * Some of these are exported to give public access + * + * Question: Why maintain a device list when the PnP BIOS can + * list devices for us? Answer: Some PnP BIOSes can't report + * the current configuration, only the boot configuration. + * The boot configuration can be changed, so we need to keep + * a record of what the configuration was when we booted; + * presumably it continues to describe the current config. + * For those BIOSes that can change the current config, we + * keep the information in the devlist up to date. + * + * Note that it is currently assumed that the list does not + * grow or shrink in size after init time, and slot_name + * never changes. The list is protected by a spinlock. + */ + +static LIST_HEAD(pnpbios_devices); + +static spinlock_t pnpbios_devices_lock; + +static int inline insert_device(struct pci_dev *dev) +{ + + /* + * FIXME: Check for re-add of existing node; + * return -1 if node already present + */ + + /* We don't lock because we only do this at init time */ + list_add_tail(&dev->global_list, &pnpbios_devices); + + return 0; +} + +#define HEX(id,a) hex[((id)>>a) & 15] +#define CHAR(id,a) (0x40 + (((id)>>a) & 31)) +// +static void inline pnpid32_to_pnpid(u32 id, char *str) +{ + const char *hex = "0123456789abcdef"; + + id = be32_to_cpu(id); + str[0] = CHAR(id, 26); + str[1] = CHAR(id, 21); + str[2] = CHAR(id,16); + str[3] = HEX(id, 12); + str[4] = HEX(id, 8); + str[5] = HEX(id, 4); + str[6] = HEX(id, 0); + str[7] = '\0'; + + return; +} +// +#undef CHAR +#undef HEX + +/* + * Build a linked list of pci_devs in order of ascending node number + * Called only at init time. + */ +static void __init build_devlist(void) +{ + u8 nodenum; + unsigned int nodes_got = 0; + unsigned int devs = 0; + struct pnp_bios_node *node; + struct pnp_dev_node_info node_info; + struct pci_dev *dev; + + if (!pnp_bios_present()) + return; + + if (pnp_bios_dev_node_info(&node_info) != 0) + return; + + node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); + if (!node) + return; + + for(nodenum=0; nodenum<0xff; ) { + u8 thisnodenum = nodenum; + /* We build the list from the "boot" config because + * asking for the "current" config causes some + * BIOSes to crash. + */ + if (pnp_bios_get_dev_node(&nodenum, (char )1 , node)) + break; + nodes_got++; + dev = pnpbios_kmalloc(sizeof (struct pci_dev), GFP_KERNEL); + if (!dev) + break; + memset(dev,0,sizeof(struct pci_dev)); + dev->devfn = thisnodenum; + memcpy(dev->name,"PNPBIOS",8); + pnpid32_to_pnpid(node->eisa_id,dev->slot_name); + node_resource_data_to_dev(node,dev); + if(insert_device(dev)<0) + kfree(dev); + else + devs++; + if (nodenum <= thisnodenum) { + printk(KERN_ERR "PnPBIOS: build_devlist: Node number 0x%x is out of sequence following node 0x%x. Aborting.\n", (unsigned int)nodenum, (unsigned int)thisnodenum); + break; + } + } + kfree(node); + + printk(KERN_INFO "PnPBIOS: %i node%s reported by PnP BIOS; %i recorded by driver\n", + nodes_got, nodes_got != 1 ? "s" : "", devs); +} + +static struct pci_dev *find_device_by_nodenum( u8 nodenum ) +{ + struct pci_dev *dev; + + pnpbios_for_each_dev(dev) { + if(dev->devfn == nodenum) + return dev; + } + + return NULL; +} + +static void update_devlist( u8 nodenum, struct pnp_bios_node *data ) +{ + unsigned long flags; + struct pci_dev *dev; + + spin_lock_irqsave(&pnpbios_devices_lock, flags); + dev = find_device_by_nodenum( nodenum ); + if ( dev ) { + node_resource_data_to_dev(data,dev); + } + spin_unlock_irqrestore(&pnpbios_devices_lock, flags); + + return; +} + + +/* + * + * DRIVER REGISTRATION FUNCTIONS + * + * + * Exported to give public access + * + */ + +static LIST_HEAD(pnpbios_drivers); + +static const struct pnpbios_device_id * +match_device(const struct pnpbios_device_id *ids, const struct pci_dev *dev) +{ + while (*ids->id) + { + if(memcmp(ids->id, dev->slot_name, 7)==0) + return ids; + ids++; + } + return NULL; +} + +static int announce_device(struct pnpbios_driver *drv, struct pci_dev *dev) +{ + const struct pnpbios_device_id *id; + struct pci_dev tmpdev; + int ret; + + if (drv->id_table) { + id = match_device(drv->id_table, dev); + if (!id) + return 0; + } else + id = NULL; + + memcpy( &tmpdev, dev, sizeof(struct pci_dev)); + tmpdev.global_list.prev = NULL; + tmpdev.global_list.next = NULL; + + dev_probe_lock(); + /* Obviously, probe() should not call any pnpbios functions */ + ret = drv->probe(&tmpdev, id); + dev_probe_unlock(); + if (ret < 1) + return 0; + + dev->driver = (void *)drv; + + return 1; +} + +/** + * pnpbios_register_driver - register a new pci driver + * @drv: the driver structure to register + * + * Adds the driver structure to the list of registered drivers + * + * For each device in the pnpbios device list that matches one of + * the ids in drv->id_table, calls the driver's "probe" function with + * arguments (1) a pointer to a *temporary* struct pci_dev containing + * resource info for the device, and (2) a pointer to the id string + * of the device. Expects the probe function to return 1 if the + * driver claims the device (otherwise 0) in which case, marks the + * device as having this driver. + * + * Returns the number of pci devices which were claimed by the driver + * during registration. The driver remains registered even if the + * return value is zero. + */ +int pnpbios_register_driver(struct pnpbios_driver *drv) +{ + struct pci_dev *dev; + unsigned long flags; + int count = 0; + + list_add_tail(&drv->node, &pnpbios_drivers); + spin_lock_irqsave(&pnpbios_devices_lock, flags); + pnpbios_for_each_dev(dev) { + if (!pnpbios_dev_driver(dev)) + count += announce_device(drv, dev); + } + spin_unlock_irqrestore(&pnpbios_devices_lock, flags); + return count; +} + +EXPORT_SYMBOL(pnpbios_register_driver); + +/** + * pnpbios_unregister_driver - unregister a pci driver + * @drv: the driver structure to unregister + * + * Deletes the driver structure from the list of registered PnPBIOS + * drivers, gives it a chance to clean up by calling its "remove" + * function for each device it was responsible for, and marks those + * devices as driverless. + */ +void pnpbios_unregister_driver(struct pnpbios_driver *drv) +{ + unsigned long flags; + struct pci_dev *dev; + + list_del(&drv->node); + spin_lock_irqsave(&pnpbios_devices_lock, flags); + pnpbios_for_each_dev(dev) { + if (dev->driver == (void *)drv) { + if (drv->remove) + drv->remove(dev); + dev->driver = NULL; + } + } + spin_unlock_irqrestore(&pnpbios_devices_lock, flags); +} + +EXPORT_SYMBOL(pnpbios_unregister_driver); + + +/* + * + * RESOURCE RESERVATION FUNCTIONS + * + * + * Used only at init time + * + */ + +static void __init reserve_ioport_range(char *pnpid, int start, int end) +{ + struct resource *res; + char *regionid; + +#if 0 + /* + * TEMPORARY hack to work around the fact that the + * floppy driver inappropriately reserves ioports 0x3f0 and 0x3f1 + * Remove this once the floppy driver is fixed. + */ + if ( + (0x3f0 >= start && 0x3f0 <= end) + || (0x3f1 >= start && 0x3f1 <= end) + ) { + printk(KERN_INFO + "PnPBIOS: %s: ioport range 0x%x-0x%x NOT reserved\n", + pnpid, start, end + ); + return; + } +#endif + + regionid = pnpbios_kmalloc(16, GFP_KERNEL); + if ( regionid == NULL ) + return; + snprintf(regionid, 16, "PnPBIOS %s", pnpid); + res = request_region(start,end-start+1,regionid); + if ( res == NULL ) + kfree( regionid ); + else + res->flags &= ~IORESOURCE_BUSY; + /* + * Failures at this point are usually harmless. pci quirks for + * example do reserve stuff they know about too, so we may well + * have double reservations. + */ + printk(KERN_INFO + "PnPBIOS: %s: ioport range 0x%x-0x%x %s reserved\n", + pnpid, start, end, + NULL != res ? "has been" : "could not be" + ); + + return; +} + +static void __init reserve_resources_of_dev( struct pci_dev *dev ) +{ + int i; + + for (i=0;iresource[i].flags & IORESOURCE_UNSET ) + /* end of resources */ + break; + if (dev->resource[i].flags & IORESOURCE_IO) { + /* ioport */ + if ( dev->resource[i].start == 0 ) + /* disabled */ + /* Do nothing */ + continue; + if ( dev->resource[i].start < 0x100 ) + /* + * Below 0x100 is only standard PC hardware + * (pics, kbd, timer, dma, ...) + * We should not get resource conflicts there, + * and the kernel reserves these anyway + * (see arch/i386/kernel/setup.c). + * So, do nothing + */ + continue; + if ( dev->resource[i].end < dev->resource[i].start ) + /* invalid endpoint */ + /* Do nothing */ + continue; + reserve_ioport_range( + dev->slot_name, + dev->resource[i].start, + dev->resource[i].end + ); + } else if (dev->resource[i].flags & IORESOURCE_MEM) { + /* iomem */ + /* For now do nothing */ + continue; + } else { + /* Neither ioport nor iomem */ + /* Do nothing */ + continue; + } + } + + return; +} + +static void __init reserve_resources( void ) +{ + struct pci_dev *dev; + + pnpbios_for_each_dev(dev) { + if ( + 0 != strcmp(dev->slot_name,"PNP0c01") && /* memory controller */ + 0 != strcmp(dev->slot_name,"PNP0c02") /* system peripheral: other */ + ) { + continue; + } + reserve_resources_of_dev(dev); + } + + return; +} + + +/* + * + * INIT AND EXIT + * + */ + +extern int is_sony_vaio_laptop; + +static int pnpbios_disabled; /* = 0 */ +static int dont_reserve_resources; /* = 0 */ +int pnpbios_dont_use_current_config; /* = 0 */ + +#ifndef MODULE +static int __init pnpbios_setup(char *str) +{ + int invert; + + while ((str != NULL) && (*str != '\0')) { + if (strncmp(str, "off", 3) == 0) + pnpbios_disabled=1; + if (strncmp(str, "on", 2) == 0) + pnpbios_disabled=0; + invert = (strncmp(str, "no-", 3) == 0); + if (invert) + str += 3; + if (strncmp(str, "curr", 4) == 0) + pnpbios_dont_use_current_config = invert; + if (strncmp(str, "res", 3) == 0) + dont_reserve_resources = invert; + str = strchr(str, ','); + if (str != NULL) + str += strspn(str, ", \t"); + } + + return 1; +} + +__setup("pnpbios=", pnpbios_setup); +#endif + +int __init pnpbios_init(void) +{ + union pnp_bios_expansion_header *check; + u8 sum; + int i, length, r; + + spin_lock_init(&pnp_bios_lock); + spin_lock_init(&pnpbios_devices_lock); + + if(pnpbios_disabled) { + printk(KERN_INFO "PnPBIOS: Disabled\n"); + return -ENODEV; + } + + if ( is_sony_vaio_laptop ) + pnpbios_dont_use_current_config = 1; + + /* + * Search the defined area (0xf0000-0xffff0) for a valid PnP BIOS + * structure and, if one is found, sets up the selectors and + * entry points + */ + for (check = (union pnp_bios_expansion_header *) __va(0xf0000); + check < (union pnp_bios_expansion_header *) __va(0xffff0); + ((void *) (check)) += 16) { + if (check->fields.signature != PNP_SIGNATURE) + continue; + length = check->fields.length; + if (!length) + continue; + for (sum = 0, i = 0; i < length; i++) + sum += check->chars[i]; + if (sum) + continue; + if (check->fields.version < 0x10) { + printk(KERN_WARNING "PnPBIOS: PnP BIOS version %d.%d is not supported\n", + check->fields.version >> 4, + check->fields.version & 15); + continue; + } + printk(KERN_INFO "PnPBIOS: Found PnP BIOS installation structure at 0x%p\n", check); + printk(KERN_INFO "PnPBIOS: PnP BIOS version %d.%d, entry 0x%x:0x%x, dseg 0x%x\n", + check->fields.version >> 4, check->fields.version & 15, + check->fields.pm16cseg, check->fields.pm16offset, + check->fields.pm16dseg); + Q2_SET_SEL(PNP_CS32, &pnp_bios_callfunc, 64 * 1024); + Q_SET_SEL(PNP_CS16, check->fields.pm16cseg, 64 * 1024); + Q_SET_SEL(PNP_DS, check->fields.pm16dseg, 64 * 1024); + pnp_bios_callpoint.offset = check->fields.pm16offset; + pnp_bios_callpoint.segment = PNP_CS16; + pnp_bios_hdr = check; + break; + } + if (!pnp_bios_present()) + return -ENODEV; + build_devlist(); + if ( ! dont_reserve_resources ) + reserve_resources(); +#ifdef CONFIG_PROC_FS + r = pnpbios_proc_init(); + if (r) + return r; +#endif + return 0; +} + +static int pnpbios_thread_init(void) +{ +#ifdef CONFIG_HOTPLUG + init_completion(&unload_sem); + if(kernel_thread(pnp_dock_thread, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGNAL)>0) + unloading = 0; +#endif + return 0; +} + +#ifndef MODULE + +/* init/main.c calls pnpbios_init early */ + +/* Start the kernel thread later: */ +module_init(pnpbios_thread_init); + +#else + +/* + * N.B.: Building pnpbios as a module hasn't been fully implemented + */ + +MODULE_LICENSE("GPL"); + +static int pnpbios_init_all(void) +{ + int r; + r = pnpbios_init(); + if (r) + return r; + r = pnpbios_thread_init(); + if (r) + return r; + return 0; +} + +static void __exit pnpbios_exit(void) +{ +#ifdef CONFIG_HOTPLUG + unloading = 1; + wait_for_completion(&unload_sem); +#endif + pnpbios_proc_exit(); + /* We ought to free resources here */ + return; +} + +module_init(pnpbios_init_all); +module_exit(pnpbios_exit); + +#endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/pnp/pnpbios_proc.c linux.20pre5-ac2/drivers/pnp/pnpbios_proc.c --- linux.20pre5/drivers/pnp/pnpbios_proc.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/pnp/pnpbios_proc.c 2002-08-11 21:28:12.000000000 +0100 @@ -0,0 +1,278 @@ +/* + * /proc/bus/pnp interface for Plug and Play devices + * + * Written by David Hinds, dahinds@users.sourceforge.net + * Modified by Thomas Hood, jdthood@mail.com + * + * The .../devices and .../ and .../boot/ files are + * utilized by the lspnp and setpnp utilities, supplied with the + * pcmcia-cs package. + * http://pcmcia-cs.sourceforge.net + * + * The .../escd file is utilized by the lsescd utility written by + * Gunther Mayer. + * http://home.t-online.de/home/gunther.mayer/lsescd + * + * The .../legacy_device_resources file is not used yet. + * + * The other files are human-readable. + */ + +//#include +#define __NO_VERSION__ +//#include + +#include +#include +#include +#include +#include +#include + +static struct proc_dir_entry *proc_pnp = NULL; +static struct proc_dir_entry *proc_pnp_boot = NULL; +static struct pnp_dev_node_info node_info; + +static int proc_read_pnpconfig(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + struct pnp_isa_config_struc pnps; + + if (pnp_bios_isapnp_config(&pnps)) + return -EIO; + return snprintf(buf, count, + "structure_revision %d\n" + "number_of_CSNs %d\n" + "ISA_read_data_port 0x%x\n", + pnps.revision, + pnps.no_csns, + pnps.isa_rd_data_port + ); +} + +static int proc_read_escdinfo(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + struct escd_info_struc escd; + + if (pnp_bios_escd_info(&escd)) + return -EIO; + return snprintf(buf, count, + "min_ESCD_write_size %d\n" + "ESCD_size %d\n" + "NVRAM_base 0x%x\n", + escd.min_escd_write_size, + escd.escd_size, + escd.nv_storage_base + ); +} + +#define MAX_SANE_ESCD_SIZE (32*1024) +static int proc_read_escd(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + struct escd_info_struc escd; + char *tmpbuf; + int escd_size, escd_left_to_read, n; + + if (pnp_bios_escd_info(&escd)) + return -EIO; + + /* sanity check */ + if (escd.escd_size > MAX_SANE_ESCD_SIZE) { + printk(KERN_ERR "PnPBIOS: proc_read_escd: ESCD size reported by BIOS escd_info call is too great\n"); + return -EFBIG; + } + + tmpbuf = pnpbios_kmalloc(escd.escd_size, GFP_KERNEL); + if (!tmpbuf) return -ENOMEM; + + if (pnp_bios_read_escd(tmpbuf, escd.nv_storage_base)) + return -EIO; + + escd_size = (unsigned char)(tmpbuf[0]) + (unsigned char)(tmpbuf[1])*256; + + /* sanity check */ + if (escd_size > MAX_SANE_ESCD_SIZE) { + printk(KERN_ERR "PnPBIOS: proc_read_escd: ESCD size reported by BIOS read_escd call is too great\n"); + return -EFBIG; + } + + escd_left_to_read = escd_size - pos; + if (escd_left_to_read < 0) escd_left_to_read = 0; + if (escd_left_to_read == 0) *eof = 1; + n = min(count,escd_left_to_read); + memcpy(buf, tmpbuf + pos, n); + kfree(tmpbuf); + *start = buf; + return n; +} + +static int proc_read_legacyres(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + /* Assume that the following won't overflow the buffer */ + if (pnp_bios_get_stat_res(buf)) + return -EIO; + + return count; // FIXME: Return actual length +} + +static int proc_read_devices(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + struct pnp_bios_node *node; + u8 nodenum; + char *p = buf; + + if (pos >= 0xff) + return 0; + + node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); + if (!node) return -ENOMEM; + + for (nodenum=pos; nodenum<0xff; ) { + u8 thisnodenum = nodenum; + /* 26 = the number of characters per line sprintf'ed */ + if ((p - buf + 26) > count) + break; + if (pnp_bios_get_dev_node(&nodenum, 1, node)) + break; + p += sprintf(p, "%02x\t%08x\t%02x:%02x:%02x\t%04x\n", + node->handle, node->eisa_id, + node->type_code[0], node->type_code[1], + node->type_code[2], node->flags); + if (nodenum <= thisnodenum) { + printk(KERN_ERR "%s Node number 0x%x is out of sequence following node 0x%x. Aborting.\n", "PnPBIOS: proc_read_devices:", (unsigned int)nodenum, (unsigned int)thisnodenum); + *eof = 1; + break; + } + } + kfree(node); + if (nodenum == 0xff) + *eof = 1; + *start = (char *)((off_t)nodenum - pos); + return p - buf; +} + +static int proc_read_node(char *buf, char **start, off_t pos, + int count, int *eof, void *data) +{ + struct pnp_bios_node *node; + int boot = (long)data >> 8; + u8 nodenum = (long)data; + int len; + + node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); + if (!node) return -ENOMEM; + if (pnp_bios_get_dev_node(&nodenum, boot, node)) + return -EIO; + len = node->size - sizeof(struct pnp_bios_node); + memcpy(buf, node->data, len); + kfree(node); + return len; +} + +static int proc_write_node(struct file *file, const char *buf, + unsigned long count, void *data) +{ + struct pnp_bios_node *node; + int boot = (long)data >> 8; + u8 nodenum = (long)data; + + node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); + if (!node) return -ENOMEM; + if ( pnp_bios_get_dev_node(&nodenum, boot, node) ) + return -EIO; + if (count != node->size - sizeof(struct pnp_bios_node)) + return -EINVAL; + memcpy(node->data, buf, count); + if (pnp_bios_set_dev_node(node->handle, boot, node) != 0) + return -EINVAL; + kfree(node); + return count; +} + +/* + * When this is called, pnpbios functions are assumed to + * work and the pnpbios_dont_use_current_config flag + * should already have been set to the appropriate value + */ +int __init pnpbios_proc_init( void ) +{ + struct pnp_bios_node *node; + struct proc_dir_entry *ent; + char name[3]; + u8 nodenum; + + if (pnp_bios_dev_node_info(&node_info)) + return -EIO; + + proc_pnp = proc_mkdir("pnp", proc_bus); + if (!proc_pnp) + return -EIO; + proc_pnp_boot = proc_mkdir("boot", proc_pnp); + if (!proc_pnp_boot) + return -EIO; + create_proc_read_entry("devices", 0, proc_pnp, proc_read_devices, NULL); + create_proc_read_entry("configuration_info", 0, proc_pnp, proc_read_pnpconfig, NULL); + create_proc_read_entry("escd_info", S_IRUSR, proc_pnp, proc_read_escdinfo, NULL); + create_proc_read_entry("escd", S_IRUSR, proc_pnp, proc_read_escd, NULL); + create_proc_read_entry("legacy_device_resources", 0, proc_pnp, proc_read_legacyres, NULL); + + node = pnpbios_kmalloc(node_info.max_node_size, GFP_KERNEL); + if (!node) + return -ENOMEM; + + for (nodenum=0; nodenum<0xff; ) { + u8 thisnodenum = nodenum; + if (pnp_bios_get_dev_node(&nodenum, 1, node) != 0) + break; + sprintf(name, "%02x", node->handle); + if ( !pnpbios_dont_use_current_config ) { + ent = create_proc_entry(name, 0, proc_pnp); + if (ent) { + ent->read_proc = proc_read_node; + ent->write_proc = proc_write_node; + ent->data = (void *)(long)(node->handle); + } + } + ent = create_proc_entry(name, 0, proc_pnp_boot); + if (ent) { + ent->read_proc = proc_read_node; + ent->write_proc = proc_write_node; + ent->data = (void *)(long)(node->handle+0x100); + } + if (nodenum <= thisnodenum) { + printk(KERN_ERR "%s Node number 0x%x is out of sequence following node 0x%x. Aborting.\n", "PnPBIOS: proc_init:", (unsigned int)nodenum, (unsigned int)thisnodenum); + break; + } + } + kfree(node); + + return 0; +} + +void __exit pnpbios_proc_exit(void) +{ + int i; + char name[3]; + + if (!proc_pnp) return; + + for (i=0; i<0xff; i++) { + sprintf(name, "%02x", i); + if ( !pnpbios_dont_use_current_config ) + remove_proc_entry(name, proc_pnp); + remove_proc_entry(name, proc_pnp_boot); + } + remove_proc_entry("legacy_device_resources", proc_pnp); + remove_proc_entry("escd", proc_pnp); + remove_proc_entry("escd_info", proc_pnp); + remove_proc_entry("configuration_info", proc_pnp); + remove_proc_entry("devices", proc_pnp); + remove_proc_entry("boot", proc_pnp); + remove_proc_entry("pnp", proc_bus); + + return; +} diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/scsi/hosts.c linux.20pre5-ac2/drivers/scsi/hosts.c --- linux.20pre5/drivers/scsi/hosts.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/scsi/hosts.c 2002-08-13 14:34:11.000000000 +0100 @@ -81,8 +81,8 @@ struct Scsi_Host * scsi_hostlist; struct Scsi_Device_Template * scsi_devicelist; -int max_scsi_hosts; -int next_scsi_host; +int max_scsi_hosts; /* host_no for next new host */ +int next_scsi_host; /* count of registered scsi hosts */ void scsi_unregister(struct Scsi_Host * sh){ @@ -107,21 +107,8 @@ if (shn) shn->host_registered = 0; /* else {} : This should not happen, we should panic here... */ - /* If we are removing the last host registered, it is safe to reuse - * its host number (this avoids "holes" at boot time) (DB) - * It is also safe to reuse those of numbers directly below which have - * been released earlier (to avoid some holes in numbering). - */ - if(sh->host_no == max_scsi_hosts - 1) { - while(--max_scsi_hosts >= next_scsi_host) { - shpnt = scsi_hostlist; - while(shpnt && shpnt->host_no != max_scsi_hosts - 1) - shpnt = shpnt->next; - if(shpnt) - break; - } - } next_scsi_host--; + kfree((char *) sh); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/scsi/hosts.h linux.20pre5-ac2/drivers/scsi/hosts.h --- linux.20pre5/drivers/scsi/hosts.h 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/scsi/hosts.h 2002-09-02 14:57:05.000000000 +0100 @@ -291,9 +291,17 @@ */ unsigned emulated:1; + /* + * True for drivers that can do I/O from highmem + */ unsigned highmem_io:1; /* + * True for drivers which can handle variable length IO + */ + unsigned can_do_varyio:1; + + /* * Name of proc directory */ char *proc_name; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/scsi/ide-scsi.c linux.20pre5-ac2/drivers/scsi/ide-scsi.c --- linux.20pre5/drivers/scsi/ide-scsi.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/scsi/ide-scsi.c 2002-08-19 23:43:43.000000000 +0100 @@ -1,7 +1,8 @@ /* - * linux/drivers/scsi/ide-scsi.c Version 0.9 Jul 4, 1999 + * linux/drivers/scsi/ide-scsi.c Version 0.93 June 10, 2002 * * Copyright (C) 1996 - 1999 Gadi Oxman + * Copyright (C) 2001 - 2002 Andre Hedrick */ /* @@ -27,11 +28,19 @@ * detection of devices with CONFIG_SCSI_MULTI_LUN * Ver 0.8 Feb 05 99 Optical media need translation too. Reverse 0.7. * Ver 0.9 Jul 04 99 Fix a bug in SG_SET_TRANSFORM. + * Ver 0.91 Jan 06 02 Added 'ignore' parameter when ide-scsi is a module + * so that use of scsi emulation can be made independent + * of load order when other IDE drivers are modules. + * Chris Ebenezer + * Ver 0.92 Mar 21 02 Include DevFs support + * Borsenkow Andrej + * Ver 0.93 Jun 10 02 Fix "off by one" error in transforms */ -#define IDESCSI_VERSION "0.9" +#define IDESCSI_VERSION "0.93" #include +#include #include #include #include @@ -53,76 +62,71 @@ #include "ide-scsi.h" #include -#define IDESCSI_DEBUG_LOG 0 +#define IDESCSI_DEBUG_LOG 0 typedef struct idescsi_pc_s { - u8 c[12]; /* Actual packet bytes */ - int request_transfer; /* Bytes to transfer */ - int actually_transferred; /* Bytes actually transferred */ - int buffer_size; /* Size of our data buffer */ - struct request *rq; /* The corresponding request */ - byte *buffer; /* Data buffer */ - byte *current_position; /* Pointer into the above buffer */ - struct scatterlist *sg; /* Scatter gather table */ - int b_count; /* Bytes transferred from current entry */ - Scsi_Cmnd *scsi_cmd; /* SCSI command */ - void (*done)(Scsi_Cmnd *); /* Scsi completion routine */ - unsigned long flags; /* Status/Action flags */ - unsigned long timeout; /* Command timeout */ + u8 c[12]; /* Actual packet bytes */ + int request_transfer; /* Bytes to transfer */ + int actually_transferred; /* Bytes actually transferred */ + int buffer_size; /* Size of our data buffer */ + struct request *rq; /* The corresponding request */ + u8 *buffer; /* Data buffer */ + u8 *current_position; /* Pointer into the above buffer */ + struct scatterlist *sg; /* Scatter gather table */ + int b_count; /* Bytes transferred from current entry */ + Scsi_Cmnd *scsi_cmd; /* SCSI command */ + void (*done)(Scsi_Cmnd *); /* Scsi completion routine */ + unsigned long flags; /* Status/Action flags */ + unsigned long timeout; /* Command timeout */ } idescsi_pc_t; /* * Packet command status bits. */ -#define PC_DMA_IN_PROGRESS 0 /* 1 while DMA in progress */ -#define PC_WRITING 1 /* Data direction */ -#define PC_TRANSFORM 2 /* transform SCSI commands */ +#define PC_DMA_IN_PROGRESS 0 /* 1 while DMA in progress */ +#define PC_WRITING 1 /* Data direction */ +#define PC_TRANSFORM 2 /* transform SCSI commands */ /* * SCSI command transformation layer */ -#define IDESCSI_TRANSFORM 0 /* Enable/Disable transformation */ -#define IDESCSI_SG_TRANSFORM 1 /* /dev/sg transformation */ +#define IDESCSI_TRANSFORM 0 /* Enable/Disable transformation */ +#define IDESCSI_SG_TRANSFORM 1 /* /dev/sg transformation */ /* * Log flags */ -#define IDESCSI_LOG_CMD 0 /* Log SCSI commands */ +#define IDESCSI_LOG_CMD 0 /* Log SCSI commands */ typedef struct { ide_drive_t *drive; - idescsi_pc_t *pc; /* Current packet command */ - unsigned long flags; /* Status/Action flags */ - unsigned long transform; /* SCSI cmd translation layer */ - unsigned long log; /* log flags */ + idescsi_pc_t *pc; /* Current packet command */ + unsigned long flags; /* Status/Action flags */ + unsigned long transform; /* SCSI cmd translation layer */ + unsigned long log; /* log flags */ + devfs_handle_t de; /* pointer to IDE device */ } idescsi_scsi_t; /* * Per ATAPI device status bits. */ -#define IDESCSI_DRQ_INTERRUPT 0 /* DRQ interrupt device */ +#define IDESCSI_DRQ_INTERRUPT 0 /* DRQ interrupt device */ /* * ide-scsi requests. */ -#define IDESCSI_PC_RQ 90 - -/* - * Bits of the interrupt reason register. - */ -#define IDESCSI_IREASON_COD 0x1 /* Information transferred is command */ -#define IDESCSI_IREASON_IO 0x2 /* The device requests us to read */ +#define IDESCSI_PC_RQ 90 static void idescsi_discard_data (ide_drive_t *drive, unsigned int bcount) { while (bcount--) - IN_BYTE (IDE_DATA_REG); + (void) HWIF(drive)->INB(IDE_DATA_REG); } static void idescsi_output_zeros (ide_drive_t *drive, unsigned int bcount) { while (bcount--) - OUT_BYTE (0, IDE_DATA_REG); + HWIF(drive)->OUTB(0, IDE_DATA_REG); } /* @@ -134,13 +138,15 @@ while (bcount) { if (pc->sg - (struct scatterlist *) pc->scsi_cmd->request_buffer > pc->scsi_cmd->use_sg) { - printk (KERN_ERR "ide-scsi: scatter gather table too small, discarding data\n"); - idescsi_discard_data (drive, bcount); + printk(KERN_ERR "ide-scsi: scatter gather " + "table too small, discarding data\n"); + idescsi_discard_data(drive, bcount); return; } - count = IDE_MIN (pc->sg->length - pc->b_count, bcount); - atapi_input_bytes (drive, pc->sg->address + pc->b_count, count); - bcount -= count; pc->b_count += count; + count = IDE_MIN(pc->sg->length - pc->b_count, bcount); + HWIF(drive)->atapi_input_bytes(drive, pc->sg->address + pc->b_count, count); + bcount -= count; + pc->b_count += count; if (pc->b_count == pc->sg->length) { pc->sg++; pc->b_count = 0; @@ -154,13 +160,15 @@ while (bcount) { if (pc->sg - (struct scatterlist *) pc->scsi_cmd->request_buffer > pc->scsi_cmd->use_sg) { - printk (KERN_ERR "ide-scsi: scatter gather table too small, padding with zeros\n"); - idescsi_output_zeros (drive, bcount); + printk(KERN_ERR "ide-scsi: scatter gather table " + "too small, padding with zeros\n"); + idescsi_output_zeros(drive, bcount); return; } - count = IDE_MIN (pc->sg->length - pc->b_count, bcount); - atapi_output_bytes (drive, pc->sg->address + pc->b_count, count); - bcount -= count; pc->b_count += count; + count = IDE_MIN(pc->sg->length - pc->b_count, bcount); + HWIF(drive)->atapi_output_bytes(drive, pc->sg->address + pc->b_count, count); + bcount -= count; + pc->b_count += count; if (pc->b_count == pc->sg->length) { pc->sg++; pc->b_count = 0; @@ -181,26 +189,38 @@ return; if (drive->media == ide_cdrom || drive->media == ide_optical) { if (c[0] == READ_6 || c[0] == WRITE_6) { - c[8] = c[4]; c[5] = c[3]; c[4] = c[2]; - c[3] = c[1] & 0x1f; c[2] = 0; c[1] &= 0xe0; + c[8] = c[4]; + c[5] = c[3]; + c[4] = c[2]; + c[3] = c[1] & 0x1f; + c[2] = 0; + c[1] &= 0xe0; c[0] += (READ_10 - READ_6); } if (c[0] == MODE_SENSE || c[0] == MODE_SELECT) { + unsigned short new_len; if (!scsi_buf) return; if ((atapi_buf = kmalloc(pc->buffer_size + 4, GFP_ATOMIC)) == NULL) return; memset(atapi_buf, 0, pc->buffer_size + 4); memset (c, 0, 12); - c[0] = sc[0] | 0x40; c[1] = sc[1]; c[2] = sc[2]; - c[8] = sc[4] + 4; c[9] = sc[5]; - if (sc[4] + 4 > 255) - c[7] = sc[4] + 4 - 255; + c[0] = sc[0] | 0x40; + c[1] = sc[1]; + c[2] = sc[2]; + new_len = sc[4] + 4; + c[8] = new_len; + c[7] = new_len >> 8; + c[9] = sc[5]; if (c[0] == MODE_SELECT_10) { - atapi_buf[1] = scsi_buf[0]; /* Mode data length */ - atapi_buf[2] = scsi_buf[1]; /* Medium type */ - atapi_buf[3] = scsi_buf[2]; /* Device specific parameter */ - atapi_buf[7] = scsi_buf[3]; /* Block descriptor length */ + /* Mode data length */ + atapi_buf[1] = scsi_buf[0]; + /* Medium type */ + atapi_buf[2] = scsi_buf[1]; + /* Device specific parameter */ + atapi_buf[3] = scsi_buf[2]; + /* Block descriptor length */ + atapi_buf[7] = scsi_buf[3]; memcpy(atapi_buf + 8, scsi_buf + 4, pc->buffer_size - 4); } pc->buffer = atapi_buf; @@ -220,15 +240,21 @@ return; if (drive->media == ide_cdrom || drive->media == ide_optical) { if (pc->c[0] == MODE_SENSE_10 && sc[0] == MODE_SENSE) { - scsi_buf[0] = atapi_buf[1]; /* Mode data length */ - scsi_buf[1] = atapi_buf[2]; /* Medium type */ - scsi_buf[2] = atapi_buf[3]; /* Device specific parameter */ - scsi_buf[3] = atapi_buf[7]; /* Block descriptor length */ + /* Mode data length */ + scsi_buf[0] = atapi_buf[1]; + /* Medium type */ + scsi_buf[1] = atapi_buf[2]; + /* Device specific parameter */ + scsi_buf[2] = atapi_buf[3]; + /* Block descriptor length */ + scsi_buf[3] = atapi_buf[7]; memcpy(scsi_buf + 4, atapi_buf + 8, pc->request_transfer - 8); } if (pc->c[0] == INQUIRY) { - scsi_buf[2] |= 2; /* ansi_revision */ - scsi_buf[3] = (scsi_buf[3] & 0xf0) | 2; /* response data format */ + /* ansi_revision */ + scsi_buf[2] |= 2; + /* response data format */ + scsi_buf[3] = (scsi_buf[3] & 0xf0) | 2; } } if (atapi_buf && atapi_buf != scsi_buf) @@ -256,47 +282,83 @@ printk("]\n"); } -static void idescsi_end_request (byte uptodate, ide_hwgroup_t *hwgroup) +static int idescsi_do_end_request (ide_drive_t *drive, int uptodate) +{ + struct request *rq; + unsigned long flags; + int ret = 1; + + spin_lock_irqsave(&io_request_lock, flags); + rq = HWGROUP(drive)->rq; + + /* + * decide whether to reenable DMA -- 3 is a random magic for now, + * if we DMA timeout more than 3 times, just stay in PIO + */ + if (drive->state == DMA_PIO_RETRY && drive->retry_pio <= 3) { + drive->state = 0; + HWGROUP(drive)->hwif->ide_dma_on(drive); + } + + if (!end_that_request_first(rq, uptodate, drive->name)) { + add_blkdev_randomness(MAJOR(rq->rq_dev)); + blkdev_dequeue_request(rq); + HWGROUP(drive)->rq = NULL; + end_that_request_last(rq); + ret = 0; + } + spin_unlock_irqrestore(&io_request_lock, flags); + return ret; +} + +static int idescsi_end_request (ide_drive_t *drive, int uptodate) { - ide_drive_t *drive = hwgroup->drive; idescsi_scsi_t *scsi = drive->driver_data; - struct request *rq = hwgroup->rq; + struct request *rq = HWGROUP(drive)->rq; idescsi_pc_t *pc = (idescsi_pc_t *) rq->buffer; int log = test_bit(IDESCSI_LOG_CMD, &scsi->log); u8 *scsi_buf; unsigned long flags; if (rq->cmd != IDESCSI_PC_RQ) { - ide_end_request (uptodate, hwgroup); - return; + idescsi_do_end_request(drive, uptodate); + return 0; } - ide_end_drive_cmd (drive, 0, 0); + ide_end_drive_cmd(drive, 0, 0); if (rq->errors >= ERROR_MAX) { pc->scsi_cmd->result = DID_ERROR << 16; if (log) - printk ("ide-scsi: %s: I/O error for %lu\n", drive->name, pc->scsi_cmd->serial_number); + printk("ide-scsi: %s: I/O error for %lu\n", + drive->name, pc->scsi_cmd->serial_number); } else if (rq->errors) { pc->scsi_cmd->result = (CHECK_CONDITION << 1) | (DID_OK << 16); if (log) - printk ("ide-scsi: %s: check condition for %lu\n", drive->name, pc->scsi_cmd->serial_number); + printk("ide-scsi: %s: check condition for %lu\n", + drive->name, pc->scsi_cmd->serial_number); } else { pc->scsi_cmd->result = DID_OK << 16; - idescsi_transform_pc2 (drive, pc); + idescsi_transform_pc2(drive, pc); if (log) { - printk ("ide-scsi: %s: suc %lu", drive->name, pc->scsi_cmd->serial_number); - if (!test_bit(PC_WRITING, &pc->flags) && pc->actually_transferred && pc->actually_transferred <= 1024 && pc->buffer) { + printk("ide-scsi: %s: suc %lu", drive->name, + pc->scsi_cmd->serial_number); + if (!test_bit(PC_WRITING, &pc->flags) && + pc->actually_transferred && + pc->actually_transferred <= 1024 && + pc->buffer) { printk(", rst = "); scsi_buf = pc->scsi_cmd->request_buffer; hexdump(scsi_buf, IDE_MIN(16, pc->scsi_cmd->request_bufflen)); } else printk("\n"); } } - spin_lock_irqsave(&io_request_lock,flags); + spin_lock_irqsave(&io_request_lock, flags); pc->done(pc->scsi_cmd); - spin_unlock_irqrestore(&io_request_lock,flags); - idescsi_free_bh (rq->bh); - kfree(pc); kfree(rq); + spin_unlock_irqrestore(&io_request_lock, flags); + idescsi_free_bh(rq->bh); + kfree(pc); + kfree(rq); scsi->pc = NULL; + return 0; } static inline unsigned long get_timeout(idescsi_pc_t *pc) @@ -310,84 +372,107 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) { idescsi_scsi_t *scsi = drive->driver_data; - byte status, ireason; - int bcount; - idescsi_pc_t *pc=scsi->pc; + idescsi_pc_t *pc = scsi->pc; struct request *rq = pc->rq; + atapi_bcount_t bcount; + atapi_status_t status; + atapi_ireason_t ireason; + atapi_feature_t feature; unsigned int temp; #if IDESCSI_DEBUG_LOG - printk (KERN_INFO "ide-scsi: Reached idescsi_pc_intr interrupt handler\n"); + printk(KERN_INFO "ide-scsi: Reached idescsi_pc_intr " + "interrupt handler\n"); #endif /* IDESCSI_DEBUG_LOG */ - if (test_and_clear_bit (PC_DMA_IN_PROGRESS, &pc->flags)) { + if (test_and_clear_bit(PC_DMA_IN_PROGRESS, &pc->flags)) { #if IDESCSI_DEBUG_LOG - printk ("ide-scsi: %s: DMA complete\n", drive->name); + printk("ide-scsi: %s: DMA complete\n", drive->name); #endif /* IDESCSI_DEBUG_LOG */ - pc->actually_transferred=pc->request_transfer; - (void) (HWIF(drive)->dmaproc(ide_dma_end, drive)); + pc->actually_transferred = pc->request_transfer; + (void) (HWIF(drive)->ide_dma_end(drive)); } - status = GET_STAT(); /* Clear the interrupt */ + feature.all = 0; + /* Clear the interrupt */ + status.all = HWIF(drive)->INB(IDE_STATUS_REG); - if ((status & DRQ_STAT) == 0) { /* No more interrupts */ + if (!status.b.drq) { + /* No more interrupts */ if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) - printk (KERN_INFO "Packet command completed, %d bytes transferred\n", pc->actually_transferred); - ide__sti(); - if (status & ERR_STAT) + printk(KERN_INFO "Packet command completed, %d " + "bytes transferred\n", + pc->actually_transferred); + local_irq_enable(); + if (status.b.check) rq->errors++; - idescsi_end_request (1, HWGROUP(drive)); + idescsi_end_request(drive, 1); return ide_stopped; } - bcount = IN_BYTE (IDE_BCOUNTH_REG) << 8 | IN_BYTE (IDE_BCOUNTL_REG); - ireason = IN_BYTE (IDE_IREASON_REG); - if (ireason & IDESCSI_IREASON_COD) { - printk (KERN_ERR "ide-scsi: CoD != 0 in idescsi_pc_intr\n"); - return ide_do_reset (drive); - } - if (ireason & IDESCSI_IREASON_IO) { - temp = pc->actually_transferred + bcount; - if ( temp > pc->request_transfer) { + bcount.b.low = HWIF(drive)->INB(IDE_BCOUNTL_REG); + bcount.b.high = HWIF(drive)->INB(IDE_BCOUNTH_REG); + ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); + + if (ireason.b.cod) { + printk(KERN_ERR "ide-scsi: CoD != 0 in idescsi_pc_intr\n"); + return ide_do_reset(drive); + } + if (ireason.b.io) { + temp = pc->actually_transferred + bcount.all; + if (temp > pc->request_transfer) { if (temp > pc->buffer_size) { - printk (KERN_ERR "ide-scsi: The scsi wants to send us more data than expected - discarding data\n"); + printk(KERN_ERR "ide-scsi: The scsi wants to " + "send us more data than expected " + "- discarding data\n"); temp = pc->buffer_size - pc->actually_transferred; if (temp) { clear_bit(PC_WRITING, &pc->flags); if (pc->sg) idescsi_input_buffers(drive, pc, temp); else - atapi_input_bytes(drive, pc->current_position, temp); - printk(KERN_ERR "ide-scsi: transferred %d of %d bytes\n", temp, bcount); + HWIF(drive)->atapi_input_bytes(drive, pc->current_position, temp); + printk(KERN_ERR "ide-scsi: transferred %d of %d bytes\n", temp, bcount.all); } pc->actually_transferred += temp; pc->current_position += temp; - idescsi_discard_data (drive,bcount - temp); - ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), NULL); + idescsi_discard_data(drive, bcount.all - temp); + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, + &idescsi_pc_intr, + get_timeout(pc), + NULL); return ide_started; } #if IDESCSI_DEBUG_LOG - printk (KERN_NOTICE "ide-scsi: The scsi wants to send us more data than expected - allowing transfer\n"); + printk(KERN_NOTICE "ide-scsi: The scsi wants to send " + "us more data than expected - " + "allowing transfer\n"); #endif /* IDESCSI_DEBUG_LOG */ } } - if (ireason & IDESCSI_IREASON_IO) { + if (ireason.b.io) { clear_bit(PC_WRITING, &pc->flags); if (pc->sg) - idescsi_input_buffers (drive, pc, bcount); + idescsi_input_buffers(drive, pc, bcount.all); else - atapi_input_bytes (drive,pc->current_position,bcount); + HWIF(drive)->atapi_input_bytes(drive, pc->current_position, bcount.all); } else { set_bit(PC_WRITING, &pc->flags); if (pc->sg) - idescsi_output_buffers (drive, pc, bcount); + idescsi_output_buffers(drive, pc, bcount.all); else - atapi_output_bytes (drive,pc->current_position,bcount); + HWIF(drive)->atapi_output_bytes(drive, pc->current_position, bcount.all); } - pc->actually_transferred+=bcount; /* Update the current position */ - pc->current_position+=bcount; - - ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), NULL); /* And set the interrupt handler again */ + /* Update the current position */ + pc->actually_transferred += bcount.all; + pc->current_position += bcount.all; + + if (HWGROUP(drive)->handler != NULL) + BUG(); + /* And set the interrupt handler again */ + ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), NULL); return ide_started; } @@ -395,20 +480,29 @@ { idescsi_scsi_t *scsi = drive->driver_data; idescsi_pc_t *pc = scsi->pc; - byte ireason; + atapi_ireason_t ireason; ide_startstop_t startstop; - if (ide_wait_stat (&startstop,drive,DRQ_STAT,BUSY_STAT,WAIT_READY)) { - printk (KERN_ERR "ide-scsi: Strange, packet command initiated yet DRQ isn't asserted\n"); + if (ide_wait_stat(&startstop,drive,DRQ_STAT,BUSY_STAT,WAIT_READY)) { + printk(KERN_ERR "ide-scsi: Strange, packet command " + "initiated yet DRQ isn't asserted\n"); return startstop; } - ireason = IN_BYTE (IDE_IREASON_REG); - if ((ireason & (IDESCSI_IREASON_IO | IDESCSI_IREASON_COD)) != IDESCSI_IREASON_COD) { - printk (KERN_ERR "ide-scsi: (IO,CoD) != (0,1) while issuing a packet command\n"); - return ide_do_reset (drive); + + ireason.all = HWIF(drive)->INB(IDE_IREASON_REG); + + if (!ireason.b.cod || ireason.b.io) { + printk(KERN_ERR "ide-scsi: (IO,CoD) != (0,1) while " + "issuing a packet command\n"); + return ide_do_reset(drive); } - ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), NULL); /* Set the interrupt routine */ - atapi_output_bytes (drive, scsi->pc->c, 12); /* Send the actual packet */ + + if (HWGROUP(drive)->handler != NULL) + BUG(); + /* Set the interrupt routine */ + ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), NULL); + /* Send the actual packet */ + HWIF(drive)->atapi_output_bytes(drive, scsi->pc->c, 12); return ide_started; } @@ -418,36 +512,50 @@ static ide_startstop_t idescsi_issue_pc (ide_drive_t *drive, idescsi_pc_t *pc) { idescsi_scsi_t *scsi = drive->driver_data; - int bcount; + atapi_feature_t feature; + atapi_bcount_t bcount; struct request *rq = pc->rq; - int dma_ok = 0; - scsi->pc=pc; /* Set the current packet command */ - pc->actually_transferred=0; /* We haven't transferred any data yet */ - pc->current_position=pc->buffer; - bcount = IDE_MIN (pc->request_transfer, 63 * 1024); /* Request to transfer the entire buffer at once */ - - if (drive->using_dma && rq->bh) - dma_ok=!HWIF(drive)->dmaproc(test_bit (PC_WRITING, &pc->flags) ? ide_dma_write : ide_dma_read, drive); + /* Set the current packet command */ + scsi->pc = pc; + /* We haven't transferred any data yet */ + pc->actually_transferred = 0; + pc->current_position = pc->buffer; + /* Request to transfer the entire buffer at once */ + bcount.all = IDE_MIN(pc->request_transfer, 63 * 1024); + + if (drive->using_dma && rq->bh) { + if (test_bit(PC_WRITING, &pc->flags)) + feature.b.dma = !HWIF(drive)->ide_dma_write(drive); + else + feature.b.dma = !HWIF(drive)->ide_dma_read(drive); + } - SELECT_DRIVE(HWIF(drive), drive); + SELECT_DRIVE(drive); if (IDE_CONTROL_REG) - OUT_BYTE (drive->ctl,IDE_CONTROL_REG); - OUT_BYTE (dma_ok,IDE_FEATURE_REG); - OUT_BYTE (bcount >> 8,IDE_BCOUNTH_REG); - OUT_BYTE (bcount & 0xff,IDE_BCOUNTL_REG); - - if (dma_ok) { - set_bit (PC_DMA_IN_PROGRESS, &pc->flags); - (void) (HWIF(drive)->dmaproc(ide_dma_begin, drive)); - } - if (test_bit (IDESCSI_DRQ_INTERRUPT, &scsi->flags)) { - ide_set_handler (drive, &idescsi_transfer_pc, get_timeout(pc), NULL); - OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); /* Issue the packet command */ + HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG); + HWIF(drive)->OUTB(feature.all, IDE_FEATURE_REG); + HWIF(drive)->OUTB(bcount.b.high, IDE_BCOUNTH_REG); + HWIF(drive)->OUTB(bcount.b.low, IDE_BCOUNTL_REG); + + if (feature.b.dma) { + set_bit(PC_DMA_IN_PROGRESS, &pc->flags); + (void) (HWIF(drive)->ide_dma_begin(drive)); + } + if (test_bit(IDESCSI_DRQ_INTERRUPT, &scsi->flags)) { + if (HWGROUP(drive)->handler != NULL) + BUG(); + ide_set_handler(drive, + &idescsi_transfer_pc, + get_timeout(pc), + NULL); + /* Issue the packet command */ + HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG); return ide_started; } else { - OUT_BYTE (WIN_PACKETCMD, IDE_COMMAND_REG); - return idescsi_transfer_pc (drive); + /* Issue the packet command */ + HWIF(drive)->OUTB(WIN_PACKETCMD, IDE_COMMAND_REG); + return idescsi_transfer_pc(drive); } } @@ -457,18 +565,29 @@ static ide_startstop_t idescsi_do_request (ide_drive_t *drive, struct request *rq, unsigned long block) { #if IDESCSI_DEBUG_LOG - printk (KERN_INFO "rq_status: %d, rq_dev: %u, cmd: %d, errors: %d\n",rq->rq_status,(unsigned int) rq->rq_dev,rq->cmd,rq->errors); - printk (KERN_INFO "sector: %ld, nr_sectors: %ld, current_nr_sectors: %ld\n",rq->sector,rq->nr_sectors,rq->current_nr_sectors); + printk(KERN_INFO "rq_status: %d, rq_dev: %u, cmd: %d, errors: %d\n", + rq->rq_status, (unsigned int) rq->rq_dev, rq->cmd, rq->errors); + printk(KERN_INFO "sector: %ld, nr_sectors: %ld, " + "current_nr_sectors: %ld\n", rq->sector, + rq->nr_sectors, rq->current_nr_sectors); #endif /* IDESCSI_DEBUG_LOG */ if (rq->cmd == IDESCSI_PC_RQ) { - return idescsi_issue_pc (drive, (idescsi_pc_t *) rq->buffer); + return idescsi_issue_pc(drive, (idescsi_pc_t *) rq->buffer); } - printk (KERN_ERR "ide-scsi: %s: unsupported command in request queue (%x)\n", drive->name, rq->cmd); - idescsi_end_request (0,HWGROUP (drive)); + printk(KERN_ERR "ide-scsi: %s: unsupported command in request " + "queue (%x)\n", drive->name, rq->cmd); + idescsi_end_request(drive, 0); return ide_stopped; } +static int idescsi_do_ioctl (ide_drive_t *drive, struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) +{ + /* need to figure out how to parse scsi-atapi media type */ + + return -EINVAL; +} + static int idescsi_open (struct inode *inode, struct file *filp, ide_drive_t *drive) { MOD_INC_USE_COUNT; @@ -482,6 +601,7 @@ static ide_drive_t *idescsi_drives[MAX_HWIFS * MAX_DRIVES]; static int idescsi_initialized = 0; +static int drive_count = 0; static void idescsi_add_settings(ide_drive_t *drive) { @@ -502,34 +622,46 @@ */ static void idescsi_setup (ide_drive_t *drive, idescsi_scsi_t *scsi, int id) { + int minor = (drive->select.b.unit) << PARTN_BITS; + DRIVER(drive)->busy++; idescsi_drives[id] = drive; drive->driver_data = scsi; drive->ready_stat = 0; - memset (scsi, 0, sizeof (idescsi_scsi_t)); + memset(scsi, 0, sizeof(idescsi_scsi_t)); scsi->drive = drive; if (drive->id && (drive->id->config & 0x0060) == 0x20) - set_bit (IDESCSI_DRQ_INTERRUPT, &scsi->flags); + set_bit(IDESCSI_DRQ_INTERRUPT, &scsi->flags); set_bit(IDESCSI_TRANSFORM, &scsi->transform); clear_bit(IDESCSI_SG_TRANSFORM, &scsi->transform); #if IDESCSI_DEBUG_LOG set_bit(IDESCSI_LOG_CMD, &scsi->log); #endif /* IDESCSI_DEBUG_LOG */ idescsi_add_settings(drive); + scsi->de = devfs_register(drive->de, "generic", DEVFS_FL_DEFAULT, + HWIF(drive)->major, minor, + S_IFBLK | S_IRUSR | S_IWUSR, + ide_fops, NULL); } static int idescsi_cleanup (ide_drive_t *drive) { idescsi_scsi_t *scsi = drive->driver_data; - if (ide_unregister_subdriver (drive)) + if (ide_unregister_subdriver(drive)) { + printk("%s: %s: failed to unregister! \n", + __FUNCTION__, drive->name); return 1; + } + if (scsi->de) + devfs_unregister(scsi->de); drive->driver_data = NULL; - kfree (scsi); + kfree(scsi); return 0; } -int idescsi_reinit(ide_drive_t *drive); +int idescsi_init(void); +int idescsi_attach(ide_drive_t *drive); /* * IDE subdriver functions, registered with ide.c @@ -539,14 +671,22 @@ version: IDESCSI_VERSION, media: ide_scsi, busy: 0, +#ifdef CONFIG_IDEDMA_ONLYDISK + supports_dma: 0, +#else supports_dma: 1, +#endif supports_dsc_overlap: 0, cleanup: idescsi_cleanup, standby: NULL, + suspend: NULL, + resume: NULL, flushcache: NULL, do_request: idescsi_do_request, end_request: idescsi_end_request, - ioctl: NULL, + sense: NULL, + error: NULL, + ioctl: idescsi_do_ioctl, open: idescsi_open, release: idescsi_ide_release, media_change: NULL, @@ -555,12 +695,12 @@ capacity: NULL, special: NULL, proc: NULL, - reinit: idescsi_reinit, + init: idescsi_init, + attach: idescsi_attach, ata_prebuilder: NULL, atapi_prebuilder: NULL, }; -int idescsi_init (void); static ide_module_t idescsi_module = { IDE_DRIVER_MODULE, idescsi_init, @@ -568,51 +708,85 @@ NULL }; -int idescsi_reinit (ide_drive_t *drive) +int idescsi_attach (ide_drive_t *drive) { -#if 0 idescsi_scsi_t *scsi; - byte media[] = {TYPE_DISK, TYPE_TAPE, TYPE_PROCESSOR, TYPE_WORM, TYPE_ROM, TYPE_SCANNER, TYPE_MOD, 255}; - int i, failed, id; - - if (!idescsi_initialized) - return 0; - for (i = 0; i < MAX_HWIFS * MAX_DRIVES; i++) - idescsi_drives[i] = NULL; + u8 media[] = { TYPE_DISK, /* 0x00 */ + TYPE_TAPE, /* 0x01 */ + TYPE_PRINTER, /* 0x02 */ + TYPE_PROCESSOR, /* 0x03 */ + TYPE_WORM, /* 0x04 */ + TYPE_ROM, /* 0x05 */ + TYPE_SCANNER, /* 0x06 */ + TYPE_MOD, /* 0x07 */ + 255}; + int i = 0, ret = 0; + + if ((!idescsi_initialized) || (drive->media == ide_disk)) { + printk(KERN_ERR "ide-scsi: (%sinitialized) %s: " + "media-type (%ssupported)\n", + (idescsi_initialized) ? "" : "! ", + drive->name, + (drive->media == ide_disk) ? "! " : ""); + return (drive->media == ide_disk) ? 2 : 0; + } MOD_INC_USE_COUNT; + for (i = 0; media[i] != 255; i++) { - failed = 0; - while ((drive = ide_scan_devices (media[i], idescsi_driver.name, NULL, failed++)) != NULL) { + if (drive->media != media[i]) + continue; + else + break; + } - if ((scsi = (idescsi_scsi_t *) kmalloc (sizeof (idescsi_scsi_t), GFP_KERNEL)) == NULL) { - printk (KERN_ERR "ide-scsi: %s: Can't allocate a scsi structure\n", drive->name); - continue; - } - if (ide_register_subdriver (drive, &idescsi_driver, IDE_SUBDRIVER_VERSION)) { - printk (KERN_ERR "ide-scsi: %s: Failed to register the driver with ide.c\n", drive->name); - kfree (scsi); - continue; - } - for (id = 0; id < MAX_HWIFS * MAX_DRIVES && idescsi_drives[id]; id++); - idescsi_setup (drive, scsi, id); - failed--; - } + if ((scsi = (idescsi_scsi_t *) kmalloc(sizeof(idescsi_scsi_t), GFP_KERNEL)) == NULL) { + printk(KERN_ERR "ide-scsi: %s: Can't allocate a scsi " + "structure\n", drive->name); + ret = 1; + goto bye_game_over; } - ide_register_module(&idescsi_module); + if (ide_register_subdriver(drive, &idescsi_driver, + IDE_SUBDRIVER_VERSION)) { + printk(KERN_ERR "ide-scsi: %s: Failed to register the " + "driver with ide.c\n", drive->name); + kfree(scsi); + ret = 1; + goto bye_game_over; + } + + idescsi_setup(drive, scsi, drive_count++); + +bye_game_over: + idescsi_drives[drive_count] = NULL; + drive_count--; + MOD_DEC_USE_COUNT; -#endif - return 0; + return ret; } -/* - * idescsi_init will register the driver for each scsi. - */ +#ifdef MODULE +/* options */ +char *ignore = NULL; + +MODULE_PARM(ignore, "s"); +#endif + int idescsi_init (void) { +#ifdef CLASSIC_BUILTINS_METHOD ide_drive_t *drive; idescsi_scsi_t *scsi; - byte media[] = {TYPE_DISK, TYPE_TAPE, TYPE_PROCESSOR, TYPE_WORM, TYPE_ROM, TYPE_SCANNER, TYPE_MOD, 255}; + u8 media[] = { TYPE_DISK, /* 0x00 */ + TYPE_TAPE, /* 0x01 */ + TYPE_PRINTER, /* 0x02 */ + TYPE_PROCESSOR, /* 0x03 */ + TYPE_WORM, /* 0x04 */ + TYPE_ROM, /* 0x05 */ + TYPE_SCANNER, /* 0x06 */ + TYPE_MOD, /* 0x07 */ + 255}; + int i, failed, id; if (idescsi_initialized) @@ -623,22 +797,49 @@ MOD_INC_USE_COUNT; for (i = 0; media[i] != 255; i++) { failed = 0; - while ((drive = ide_scan_devices (media[i], idescsi_driver.name, NULL, failed++)) != NULL) { + while ((drive = ide_scan_devices(media[i], + idescsi_driver.name, NULL, failed++)) != NULL) { +#ifdef MODULE + /* skip drives we were told to ignore */ + if (ignore != NULL && strstr(ignore, drive->name)) { + printk("ide-scsi: ignoring drive %s\n", + drive->name); + continue; + } +#endif - if ((scsi = (idescsi_scsi_t *) kmalloc (sizeof (idescsi_scsi_t), GFP_KERNEL)) == NULL) { - printk (KERN_ERR "ide-scsi: %s: Can't allocate a scsi structure\n", drive->name); + if ((scsi = (idescsi_scsi_t *) kmalloc(sizeof(idescsi_scsi_t), GFP_KERNEL)) == NULL) { + printk(KERN_ERR "ide-scsi: %s: Can't allocate " + "a scsi structure\n", drive->name); continue; } - if (ide_register_subdriver (drive, &idescsi_driver, IDE_SUBDRIVER_VERSION)) { - printk (KERN_ERR "ide-scsi: %s: Failed to register the driver with ide.c\n", drive->name); - kfree (scsi); + if (ide_register_subdriver(drive, &idescsi_driver, + IDE_SUBDRIVER_VERSION)) { + printk(KERN_ERR "ide-scsi: %s: Failed to " + "register the driver with ide.c\n", + drive->name); + kfree(scsi); continue; } - for (id = 0; id < MAX_HWIFS * MAX_DRIVES && idescsi_drives[id]; id++); - idescsi_setup (drive, scsi, id); + for (id = 0; + id < MAX_HWIFS*MAX_DRIVES && idescsi_drives[id]; + id++); { + idescsi_setup(drive, scsi, id); + drive_count = id; + } failed--; } } +#else /* ! CLASSIC_BUILTINS_METHOD */ + int i; + + if (idescsi_initialized) + return 0; + idescsi_initialized = 1; + for (i = 0; i < MAX_HWIFS * MAX_DRIVES; i++) + idescsi_drives[i] = NULL; +#endif /* CLASSIC_BUILTINS_METHOD */ + MOD_INC_USE_COUNT; ide_register_module(&idescsi_module); MOD_DEC_USE_COUNT; return 0; @@ -652,9 +853,11 @@ host_template->proc_name = "ide-scsi"; host = scsi_register(host_template, 0); - if(host == NULL) + if (host == NULL) { + printk(KERN_WARNING "%s: host failure!\n", __FUNCTION__); return 0; - + } + for (id = 0; id < MAX_HWIFS * MAX_DRIVES && idescsi_drives[id]; id++) last_lun = IDE_MAX(last_lun, idescsi_drives[id]->last_lun); host->max_id = id; @@ -701,32 +904,36 @@ { struct buffer_head *bh, *bhp, *first_bh; - if ((first_bh = bhp = bh = kmalloc (sizeof(struct buffer_head), GFP_ATOMIC)) == NULL) + if ((first_bh = bhp = bh = kmalloc(sizeof(struct buffer_head), GFP_ATOMIC)) == NULL) goto abort; - memset (bh, 0, sizeof (struct buffer_head)); + memset(bh, 0, sizeof(struct buffer_head)); bh->b_reqnext = NULL; while (--count) { - if ((bh = kmalloc (sizeof(struct buffer_head), GFP_ATOMIC)) == NULL) + if ((bh = kmalloc(sizeof(struct buffer_head), GFP_ATOMIC)) == NULL) goto abort; - memset (bh, 0, sizeof (struct buffer_head)); + memset(bh, 0, sizeof(struct buffer_head)); bhp->b_reqnext = bh; bhp = bh; bh->b_reqnext = NULL; } return first_bh; abort: - idescsi_free_bh (first_bh); + idescsi_free_bh(first_bh); return NULL; } static inline int idescsi_set_direction (idescsi_pc_t *pc) { switch (pc->c[0]) { - case READ_6: case READ_10: case READ_12: - clear_bit (PC_WRITING, &pc->flags); + case READ_6: + case READ_10: + case READ_12: + clear_bit(PC_WRITING, &pc->flags); return 0; - case WRITE_6: case WRITE_10: case WRITE_12: - set_bit (PC_WRITING, &pc->flags); + case WRITE_6: + case WRITE_10: + case WRITE_12: + set_bit(PC_WRITING, &pc->flags); return 0; default: return 1; @@ -744,10 +951,12 @@ if (idescsi_set_direction(pc)) return NULL; if (segments) { - if ((first_bh = bh = idescsi_kmalloc_bh (segments)) == NULL) + if ((first_bh = bh = idescsi_kmalloc_bh(segments)) == NULL) return NULL; #if IDESCSI_DEBUG_LOG - printk ("ide-scsi: %s: building DMA table, %d segments, %dkB total\n", drive->name, segments, pc->request_transfer >> 10); + printk("ide-scsi: %s: building DMA table, %d segments, " + "%dkB total\n", drive->name, segments, + pc->request_transfer >> 10); #endif /* IDESCSI_DEBUG_LOG */ while (segments--) { if (sg->address) { @@ -766,10 +975,12 @@ /* * non-sg requests are guarenteed not to reside in highmem /jens */ - if ((first_bh = bh = idescsi_kmalloc_bh (1)) == NULL) + if ((first_bh = bh = idescsi_kmalloc_bh(1)) == NULL) return NULL; #if IDESCSI_DEBUG_LOG - printk ("ide-scsi: %s: building DMA table for a single buffer (%dkB)\n", drive->name, pc->request_transfer >> 10); + printk("ide-scsi: %s: building DMA table for a single " + "buffer (%dkB)\n", drive->name, + pc->request_transfer >> 10); #endif /* IDESCSI_DEBUG_LOG */ bh->b_data = pc->scsi_cmd->request_buffer; bh->b_size = pc->request_transfer; @@ -794,21 +1005,22 @@ idescsi_pc_t *pc = NULL; if (!drive) { - printk (KERN_ERR "ide-scsi: drive id %d not present\n", cmd->target); + printk(KERN_ERR "ide-scsi: drive id %d not present\n", + cmd->target); goto abort; } scsi = drive->driver_data; - pc = kmalloc (sizeof (idescsi_pc_t), GFP_ATOMIC); - rq = kmalloc (sizeof (struct request), GFP_ATOMIC); + pc = kmalloc(sizeof(idescsi_pc_t), GFP_ATOMIC); + rq = kmalloc(sizeof(struct request), GFP_ATOMIC); if (rq == NULL || pc == NULL) { - printk (KERN_ERR "ide-scsi: %s: out of memory\n", drive->name); + printk(KERN_ERR "ide-scsi: %s: out of memory\n", drive->name); goto abort; } - memset (pc->c, 0, 12); + memset(pc->c, 0, 12); pc->flags = 0; pc->rq = rq; - memcpy (pc->c, cmd->cmnd, cmd->cmd_len); + memcpy(pc->c, cmd->cmnd, cmd->cmd_len); if (cmd->use_sg) { pc->buffer = NULL; pc->sg = cmd->request_buffer; @@ -824,28 +1036,30 @@ if (should_transform(drive, cmd)) set_bit(PC_TRANSFORM, &pc->flags); - idescsi_transform_pc1 (drive, pc); + idescsi_transform_pc1(drive, pc); if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) { - printk ("ide-scsi: %s: que %lu, cmd = ", drive->name, cmd->serial_number); + printk("ide-scsi: %s: que %lu, cmd = ", + drive->name, cmd->serial_number); hexdump(cmd->cmnd, cmd->cmd_len); if (memcmp(pc->c, cmd->cmnd, cmd->cmd_len)) { - printk ("ide-scsi: %s: que %lu, tsl = ", drive->name, cmd->serial_number); + printk("ide-scsi: %s: que %lu, tsl = ", + drive->name, cmd->serial_number); hexdump(pc->c, 12); } } - ide_init_drive_cmd (rq); + ide_init_drive_cmd(rq); rq->buffer = (char *) pc; - rq->bh = idescsi_dma_bh (drive, pc); + rq->bh = idescsi_dma_bh(drive, pc); rq->cmd = IDESCSI_PC_RQ; spin_unlock_irq(&io_request_lock); - (void) ide_do_drive_cmd (drive, rq, ide_end); + (void) ide_do_drive_cmd(drive, rq, ide_end); spin_lock_irq(&io_request_lock); return 0; abort: - if (pc) kfree (pc); - if (rq) kfree (rq); + if (pc) kfree(pc); + if (rq) kfree(rq); cmd->result = DID_ERROR << 16; done(cmd); return 0; @@ -858,6 +1072,11 @@ int idescsi_reset (Scsi_Cmnd *cmd, unsigned int resetflags) { +#if 0 + ide_drive_t *drive = idescsi_drives[cmd->target]; + + (void) ide_do_reset(drive); +#endif return SCSI_RESET_SUCCESS; } @@ -877,24 +1096,25 @@ static int __init init_idescsi_module(void) { + drive_count = 0; idescsi_init(); idescsi_template.module = THIS_MODULE; - scsi_register_module (MODULE_SCSI_HA, &idescsi_template); + scsi_register_module(MODULE_SCSI_HA, &idescsi_template); return 0; } static void __exit exit_idescsi_module(void) { ide_drive_t *drive; - byte media[] = {TYPE_DISK, TYPE_TAPE, TYPE_PROCESSOR, TYPE_WORM, TYPE_ROM, TYPE_SCANNER, TYPE_MOD, 255}; + u8 media[] = {TYPE_DISK, TYPE_TAPE, TYPE_PROCESSOR, TYPE_WORM, TYPE_ROM, TYPE_SCANNER, TYPE_MOD, 255}; int i, failed; - scsi_unregister_module (MODULE_SCSI_HA, &idescsi_template); + scsi_unregister_module(MODULE_SCSI_HA, &idescsi_template); for (i = 0; media[i] != 255; i++) { failed = 0; - while ((drive = ide_scan_devices (media[i], idescsi_driver.name, &idescsi_driver, failed)) != NULL) - if (idescsi_cleanup (drive)) { - printk ("%s: exit_idescsi_module() called while still busy\n", drive->name); + while ((drive = ide_scan_devices(media[i], idescsi_driver.name, &idescsi_driver, failed)) != NULL) + if (idescsi_cleanup(drive)) { + printk("%s: exit_idescsi_module() called while still busy\n", drive->name); failed++; } } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/scsi/qlogicisp.h linux.20pre5-ac2/drivers/scsi/qlogicisp.h --- linux.20pre5/drivers/scsi/qlogicisp.h 2002-08-29 18:39:41.000000000 +0100 +++ linux.20pre5-ac2/drivers/scsi/qlogicisp.h 2002-08-06 15:42:07.000000000 +0100 @@ -84,7 +84,8 @@ cmd_per_lun: 1, \ present: 0, \ unchecked_isa_dma: 0, \ - use_clustering: DISABLE_CLUSTERING \ + use_clustering: DISABLE_CLUSTERING, \ + can_do_varyio: 1 \ } #endif /* _QLOGICISP_H */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/scsi/scsi.c linux.20pre5-ac2/drivers/scsi/scsi.c --- linux.20pre5/drivers/scsi/scsi.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/scsi/scsi.c 2002-08-13 14:35:10.000000000 +0100 @@ -352,8 +352,9 @@ int interruptable) { struct Scsi_Host *host; - Scsi_Cmnd *SCpnt = NULL; + Scsi_Cmnd *SCpnt; Scsi_Device *SDpnt; + struct list_head *lp; unsigned long flags; if (!device) @@ -364,7 +365,6 @@ spin_lock_irqsave(&device_request_lock, flags); while (1 == 1) { - SCpnt = NULL; if (!device->device_blocked) { if (device->single_lun) { /* @@ -404,26 +404,21 @@ * If asked to wait, we need to wait, otherwise * return NULL. */ - SCpnt = NULL; goto busy; } } /* - * Now we can check for a free command block for this device. + * Is there a free command block for this device? */ - for (SCpnt = device->device_queue; SCpnt; SCpnt = SCpnt->next) { - if (SCpnt->request.rq_status == RQ_INACTIVE) - break; - } + if (!list_empty(&device->sdev_free_q)) + goto found; } + /* - * If we couldn't find a free command block, and we have been + * Couldn't find a free command block, and we have been * asked to wait, then do so. */ - if (SCpnt) { - break; - } - busy: +busy: /* * If we have been asked to wait for a free block, then * wait here. @@ -475,12 +470,20 @@ return NULL; } } + continue; } else { spin_unlock_irqrestore(&device_request_lock, flags); return NULL; } } +found: + lp = device->sdev_free_q.next; + list_del(lp); + SCpnt = list_entry(lp, Scsi_Cmnd, sc_list); + if (SCpnt->request.rq_status != RQ_INACTIVE) + BUG(); + SCpnt->request.rq_status = RQ_SCSI_BUSY; SCpnt->request.waiting = NULL; /* And no one is waiting for this * to complete */ @@ -526,6 +529,9 @@ SDpnt = SCpnt->device; + /* command is now free - add to list */ + list_add(&SCpnt->sc_list, &SDpnt->sdev_free_q); + SCpnt->request.rq_status = RQ_INACTIVE; SCpnt->state = SCSI_STATE_UNUSED; SCpnt->owner = SCSI_OWNER_NOBODY; @@ -1448,6 +1454,7 @@ spin_lock_irqsave(&device_request_lock, flags); for (SCpnt = SDpnt->device_queue; SCpnt; SCpnt = SCnext) { SDpnt->device_queue = SCnext = SCpnt->next; + list_del(&SCpnt->sc_list); kfree((char *) SCpnt); } SDpnt->has_cmdblocks = 0; @@ -1484,6 +1491,7 @@ SDpnt->queue_depth = 1; /* live to fight another day */ } SDpnt->device_queue = NULL; + INIT_LIST_HEAD(&SDpnt->sdev_free_q); for (j = 0; j < SDpnt->queue_depth; j++) { SCpnt = (Scsi_Cmnd *) @@ -1513,6 +1521,7 @@ SDpnt->device_queue = SCpnt; SCpnt->state = SCSI_STATE_UNUSED; SCpnt->owner = SCSI_OWNER_NOBODY; + list_add(&SCpnt->sc_list, &SDpnt->sdev_free_q); } if (j < SDpnt->queue_depth) { /* low on space (D.Gilbert 990424) */ printk(KERN_WARNING "scsi_build_commandblocks: want=%d, space for=%d blocks\n", diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/scsi/scsi.h linux.20pre5-ac2/drivers/scsi/scsi.h --- linux.20pre5/drivers/scsi/scsi.h 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/scsi/scsi.h 2002-09-02 14:57:05.000000000 +0100 @@ -558,6 +558,7 @@ int (*scsi_init_io_fn) (Scsi_Cmnd *); /* Used to initialize new request */ Scsi_Cmnd *device_queue; /* queue of SCSI Command structures */ + struct list_head sdev_free_q; /* list of free cmds */ /* public: */ unsigned int id, lun, channel; @@ -775,6 +776,8 @@ * received on original command * (auto-sense) */ + struct list_head sc_list; /* Inactive cmd list linkage, guarded + * by device_request_lock. */ unsigned flags; /* diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/scsi/sd.c linux.20pre5-ac2/drivers/scsi/sd.c --- linux.20pre5/drivers/scsi/sd.c 2002-08-29 18:39:41.000000000 +0100 +++ linux.20pre5-ac2/drivers/scsi/sd.c 2002-08-06 15:42:07.000000000 +0100 @@ -95,6 +95,7 @@ static int *sd_blocksizes; static int *sd_hardsizes; /* Hardware sector size */ static int *sd_max_sectors; +static char *sd_varyio; static int check_scsidisk_media_change(kdev_t); static int fop_revalidate_scsidisk(kdev_t); @@ -1140,6 +1141,12 @@ if (!sd_max_sectors) goto cleanup_max_sectors; + sd_varyio = kmalloc((sd_template.dev_max << 4), GFP_ATOMIC); + if (!sd_varyio) + goto cleanup_varyio; + + memset(sd_varyio, 0, (sd_template.dev_max << 4)); + for (i = 0; i < sd_template.dev_max << 4; i++) { sd_blocksizes[i] = 1024; sd_hardsizes[i] = 512; @@ -1204,6 +1211,8 @@ kfree(sd_gendisks); sd_gendisks = NULL; cleanup_sd_gendisks: + kfree(sd_varyio); +cleanup_varyio: kfree(sd_max_sectors); cleanup_max_sectors: kfree(sd_hardsizes); @@ -1268,6 +1277,8 @@ return 1; } +#define SD_DISK_MAJOR(i) SD_MAJOR((i) >> 4) + static int sd_attach(Scsi_Device * SDp) { unsigned int devnum; @@ -1306,6 +1317,14 @@ printk("Attached scsi %sdisk %s at scsi%d, channel %d, id %d, lun %d\n", SDp->removable ? "removable " : "", nbuff, SDp->host->host_no, SDp->channel, SDp->id, SDp->lun); + + if (SDp->host->hostt->can_do_varyio) { + if (blkdev_varyio[SD_DISK_MAJOR(i)] == NULL) { + blkdev_varyio[SD_DISK_MAJOR(i)] = + sd_varyio + ((i / SCSI_DISKS_PER_MAJOR) << 8); + } + memset(blkdev_varyio[SD_DISK_MAJOR(i)] + (devnum << 4), 1, 16); + } return 0; } @@ -1438,6 +1457,7 @@ kfree(sd_sizes); kfree(sd_blocksizes); kfree(sd_hardsizes); + kfree(sd_varyio); for (i = 0; i < N_USED_SD_MAJORS; i++) { #if 0 /* XXX aren't we forgetting to deallocate something? */ kfree(sd_gendisks[i].de_arr); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/scsi/sd.h linux.20pre5-ac2/drivers/scsi/sd.h --- linux.20pre5/drivers/scsi/sd.h 2002-08-29 18:39:41.000000000 +0100 +++ linux.20pre5-ac2/drivers/scsi/sd.h 2002-09-02 14:57:05.000000000 +0100 @@ -24,13 +24,13 @@ #endif typedef struct scsi_disk { - unsigned capacity; /* size in blocks */ Scsi_Device *device; - unsigned char ready; /* flag ready for FLOPTICAL */ - unsigned char write_prot; /* flag write_protect for rmvable dev */ - unsigned char sector_bit_size; /* sector_size = 2 to the bit size power */ - unsigned char sector_bit_shift; /* power of 2 sectors per FS block */ + unsigned capacity; /* size in blocks */ + unsigned char sector_bit_size; /* sector_size = 2 to the bit size power */ + unsigned char sector_bit_shift; /* power of 2 sectors per FS block */ unsigned has_part_table:1; /* has partition table */ + unsigned ready:1; /* flag ready for FLOPTICAL */ + unsigned write_prot:1; /* flag write_protect for rmvable dev */ } Scsi_Disk; extern int revalidate_scsidisk(kdev_t dev, int maxusage); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/scsi/sim710_d.h linux.20pre5-ac2/drivers/scsi/sim710_d.h --- linux.20pre5/drivers/scsi/sim710_d.h 2002-08-29 18:39:41.000000000 +0100 +++ linux.20pre5-ac2/drivers/scsi/sim710_d.h 2002-08-06 15:42:07.000000000 +0100 @@ -18,15 +18,12 @@ ABSOLUTE reselected_identify = 0 ABSOLUTE msgin_buf = 0 +ABSOLUTE msg_reject = 0 +ABSOLUTE test1_src = 0 +ABSOLUTE test1_dst = 0 -ABSOLUTE int_bad_extmsg1a = 0xab930000 -ABSOLUTE int_bad_extmsg1b = 0xab930001 -ABSOLUTE int_bad_extmsg2a = 0xab930002 -ABSOLUTE int_bad_extmsg2b = 0xab930003 -ABSOLUTE int_bad_extmsg3a = 0xab930004 -ABSOLUTE int_bad_extmsg3b = 0xab930005 ABSOLUTE int_bad_msg1 = 0xab930006 ABSOLUTE int_bad_msg2 = 0xab930007 ABSOLUTE int_bad_msg3 = 0xab930008 @@ -50,7 +47,7 @@ ABSOLUTE int_disc2 = 0xab93001a ABSOLUTE int_disc3 = 0xab93001b ABSOLUTE int_not_rej = 0xab93001c - +ABSOLUTE int_test1 = 0xab93001d @@ -65,6 +62,9 @@ +ABSOLUTE did_reject = 0x01 + + @@ -74,1641 +74,1709 @@ at 0x00000000 : */ 0x60000200,0x00000000, /* - MOVE SCRATCH0 & 0 TO SCRATCH0 - -at 0x00000002 : */ 0x7c340000,0x00000000, -/* ; Enable selection timer MOVE CTEST7 & 0xef TO CTEST7 -at 0x00000004 : */ 0x7c1bef00,0x00000000, +at 0x00000002 : */ 0x7c1bef00,0x00000000, /* SELECT ATN FROM dsa_select, reselect -at 0x00000006 : */ 0x43000000,0x00000c48, +at 0x00000004 : */ 0x43000000,0x00000cd0, /* JUMP get_status, WHEN STATUS -at 0x00000008 : */ 0x830b0000,0x000000a0, +at 0x00000006 : */ 0x830b0000,0x00000098, /* ; Disable selection timer MOVE CTEST7 | 0x10 TO CTEST7 -at 0x0000000a : */ 0x7a1b1000,0x00000000, +at 0x00000008 : */ 0x7a1b1000,0x00000000, /* MOVE SCRATCH0 | had_select TO SCRATCH0 -at 0x0000000c : */ 0x7a340100,0x00000000, +at 0x0000000a : */ 0x7a340100,0x00000000, /* INT int_sel_no_ident, IF NOT MSG_OUT -at 0x0000000e : */ 0x9e020000,0xab930013, +at 0x0000000c : */ 0x9e020000,0xab930013, /* MOVE SCRATCH0 | had_msgout TO SCRATCH0 -at 0x00000010 : */ 0x7a340200,0x00000000, +at 0x0000000e : */ 0x7a340200,0x00000000, /* MOVE FROM dsa_msgout, when MSG_OUT -at 0x00000012 : */ 0x1e000000,0x00000008, +at 0x00000010 : */ 0x1e000000,0x00000008, /* ENTRY done_ident done_ident: JUMP get_status, IF STATUS -at 0x00000014 : */ 0x830a0000,0x000000a0, +at 0x00000012 : */ 0x830a0000,0x00000098, /* redo_msgin1: JUMP get_msgin1, WHEN MSG_IN -at 0x00000016 : */ 0x870b0000,0x00000920, +at 0x00000014 : */ 0x870b0000,0x00000918, /* INT int_sel_not_cmd, IF NOT CMD -at 0x00000018 : */ 0x9a020000,0xab930014, +at 0x00000016 : */ 0x9a020000,0xab930014, /* ENTRY resume_cmd resume_cmd: MOVE SCRATCH0 | had_cmdout TO SCRATCH0 -at 0x0000001a : */ 0x7a340400,0x00000000, +at 0x00000018 : */ 0x7a340400,0x00000000, /* MOVE FROM dsa_cmnd, WHEN CMD -at 0x0000001c : */ 0x1a000000,0x00000010, +at 0x0000001a : */ 0x1a000000,0x00000010, /* ENTRY resume_pmm resume_pmm: redo_msgin2: JUMP get_msgin2, WHEN MSG_IN -at 0x0000001e : */ 0x870b0000,0x00000a20, +at 0x0000001c : */ 0x870b0000,0x00000a48, /* JUMP get_status, IF STATUS -at 0x00000020 : */ 0x830a0000,0x000000a0, +at 0x0000001e : */ 0x830a0000,0x00000098, /* JUMP input_data, IF DATA_IN -at 0x00000022 : */ 0x810a0000,0x000000e0, +at 0x00000020 : */ 0x810a0000,0x000000d8, /* JUMP output_data, IF DATA_OUT -at 0x00000024 : */ 0x800a0000,0x000004f8, +at 0x00000022 : */ 0x800a0000,0x000004f0, /* INT int_cmd_bad_phase -at 0x00000026 : */ 0x98080000,0xab930009, +at 0x00000024 : */ 0x98080000,0xab930009, /* get_status: ; Disable selection timer MOVE CTEST7 | 0x10 TO CTEST7 -at 0x00000028 : */ 0x7a1b1000,0x00000000, +at 0x00000026 : */ 0x7a1b1000,0x00000000, /* MOVE FROM dsa_status, WHEN STATUS -at 0x0000002a : */ 0x1b000000,0x00000018, +at 0x00000028 : */ 0x1b000000,0x00000018, /* INT int_status_not_msgin, WHEN NOT MSG_IN -at 0x0000002c : */ 0x9f030000,0xab930015, +at 0x0000002a : */ 0x9f030000,0xab930015, /* MOVE FROM dsa_msgin, WHEN MSG_IN -at 0x0000002e : */ 0x1f000000,0x00000020, +at 0x0000002c : */ 0x1f000000,0x00000020, /* INT int_not_cmd_complete, IF NOT 0x00 -at 0x00000030 : */ 0x98040000,0xab930012, +at 0x0000002e : */ 0x98040000,0xab930012, /* CLEAR ACK -at 0x00000032 : */ 0x60000040,0x00000000, +at 0x00000030 : */ 0x60000040,0x00000000, /* ENTRY wait_disc_complete wait_disc_complete: WAIT DISCONNECT -at 0x00000034 : */ 0x48000000,0x00000000, +at 0x00000032 : */ 0x48000000,0x00000000, /* INT int_cmd_complete -at 0x00000036 : */ 0x98080000,0xab93000a, +at 0x00000034 : */ 0x98080000,0xab93000a, /* input_data: MOVE SCRATCH0 | had_datain TO SCRATCH0 -at 0x00000038 : */ 0x7a340800,0x00000000, +at 0x00000036 : */ 0x7a340800,0x00000000, /* ENTRY patch_input_data patch_input_data: JUMP 0 -at 0x0000003a : */ 0x80080000,0x00000000, +at 0x00000038 : */ 0x80080000,0x00000000, /* MOVE FROM dsa_datain+0x0000, WHEN DATA_IN -at 0x0000003c : */ 0x19000000,0x00000028, +at 0x0000003a : */ 0x19000000,0x00000028, /* MOVE FROM dsa_datain+0x0008, WHEN DATA_IN -at 0x0000003e : */ 0x19000000,0x00000030, +at 0x0000003c : */ 0x19000000,0x00000030, /* MOVE FROM dsa_datain+0x0010, WHEN DATA_IN -at 0x00000040 : */ 0x19000000,0x00000038, +at 0x0000003e : */ 0x19000000,0x00000038, /* MOVE FROM dsa_datain+0x0018, WHEN DATA_IN -at 0x00000042 : */ 0x19000000,0x00000040, +at 0x00000040 : */ 0x19000000,0x00000040, /* MOVE FROM dsa_datain+0x0020, WHEN DATA_IN -at 0x00000044 : */ 0x19000000,0x00000048, +at 0x00000042 : */ 0x19000000,0x00000048, /* MOVE FROM dsa_datain+0x0028, WHEN DATA_IN -at 0x00000046 : */ 0x19000000,0x00000050, +at 0x00000044 : */ 0x19000000,0x00000050, /* MOVE FROM dsa_datain+0x0030, WHEN DATA_IN -at 0x00000048 : */ 0x19000000,0x00000058, +at 0x00000046 : */ 0x19000000,0x00000058, /* MOVE FROM dsa_datain+0x0038, WHEN DATA_IN -at 0x0000004a : */ 0x19000000,0x00000060, +at 0x00000048 : */ 0x19000000,0x00000060, /* MOVE FROM dsa_datain+0x0040, WHEN DATA_IN -at 0x0000004c : */ 0x19000000,0x00000068, +at 0x0000004a : */ 0x19000000,0x00000068, /* MOVE FROM dsa_datain+0x0048, WHEN DATA_IN -at 0x0000004e : */ 0x19000000,0x00000070, +at 0x0000004c : */ 0x19000000,0x00000070, /* MOVE FROM dsa_datain+0x0050, WHEN DATA_IN -at 0x00000050 : */ 0x19000000,0x00000078, +at 0x0000004e : */ 0x19000000,0x00000078, /* MOVE FROM dsa_datain+0x0058, WHEN DATA_IN -at 0x00000052 : */ 0x19000000,0x00000080, +at 0x00000050 : */ 0x19000000,0x00000080, /* MOVE FROM dsa_datain+0x0060, WHEN DATA_IN -at 0x00000054 : */ 0x19000000,0x00000088, +at 0x00000052 : */ 0x19000000,0x00000088, /* MOVE FROM dsa_datain+0x0068, WHEN DATA_IN -at 0x00000056 : */ 0x19000000,0x00000090, +at 0x00000054 : */ 0x19000000,0x00000090, /* MOVE FROM dsa_datain+0x0070, WHEN DATA_IN -at 0x00000058 : */ 0x19000000,0x00000098, +at 0x00000056 : */ 0x19000000,0x00000098, /* MOVE FROM dsa_datain+0x0078, WHEN DATA_IN -at 0x0000005a : */ 0x19000000,0x000000a0, +at 0x00000058 : */ 0x19000000,0x000000a0, /* MOVE FROM dsa_datain+0x0080, WHEN DATA_IN -at 0x0000005c : */ 0x19000000,0x000000a8, +at 0x0000005a : */ 0x19000000,0x000000a8, /* MOVE FROM dsa_datain+0x0088, WHEN DATA_IN -at 0x0000005e : */ 0x19000000,0x000000b0, +at 0x0000005c : */ 0x19000000,0x000000b0, /* MOVE FROM dsa_datain+0x0090, WHEN DATA_IN -at 0x00000060 : */ 0x19000000,0x000000b8, +at 0x0000005e : */ 0x19000000,0x000000b8, /* MOVE FROM dsa_datain+0x0098, WHEN DATA_IN -at 0x00000062 : */ 0x19000000,0x000000c0, +at 0x00000060 : */ 0x19000000,0x000000c0, /* MOVE FROM dsa_datain+0x00a0, WHEN DATA_IN -at 0x00000064 : */ 0x19000000,0x000000c8, +at 0x00000062 : */ 0x19000000,0x000000c8, /* MOVE FROM dsa_datain+0x00a8, WHEN DATA_IN -at 0x00000066 : */ 0x19000000,0x000000d0, +at 0x00000064 : */ 0x19000000,0x000000d0, /* MOVE FROM dsa_datain+0x00b0, WHEN DATA_IN -at 0x00000068 : */ 0x19000000,0x000000d8, +at 0x00000066 : */ 0x19000000,0x000000d8, /* MOVE FROM dsa_datain+0x00b8, WHEN DATA_IN -at 0x0000006a : */ 0x19000000,0x000000e0, +at 0x00000068 : */ 0x19000000,0x000000e0, /* MOVE FROM dsa_datain+0x00c0, WHEN DATA_IN -at 0x0000006c : */ 0x19000000,0x000000e8, +at 0x0000006a : */ 0x19000000,0x000000e8, /* MOVE FROM dsa_datain+0x00c8, WHEN DATA_IN -at 0x0000006e : */ 0x19000000,0x000000f0, +at 0x0000006c : */ 0x19000000,0x000000f0, /* MOVE FROM dsa_datain+0x00d0, WHEN DATA_IN -at 0x00000070 : */ 0x19000000,0x000000f8, +at 0x0000006e : */ 0x19000000,0x000000f8, /* MOVE FROM dsa_datain+0x00d8, WHEN DATA_IN -at 0x00000072 : */ 0x19000000,0x00000100, +at 0x00000070 : */ 0x19000000,0x00000100, /* MOVE FROM dsa_datain+0x00e0, WHEN DATA_IN -at 0x00000074 : */ 0x19000000,0x00000108, +at 0x00000072 : */ 0x19000000,0x00000108, /* MOVE FROM dsa_datain+0x00e8, WHEN DATA_IN -at 0x00000076 : */ 0x19000000,0x00000110, +at 0x00000074 : */ 0x19000000,0x00000110, /* MOVE FROM dsa_datain+0x00f0, WHEN DATA_IN -at 0x00000078 : */ 0x19000000,0x00000118, +at 0x00000076 : */ 0x19000000,0x00000118, /* MOVE FROM dsa_datain+0x00f8, WHEN DATA_IN -at 0x0000007a : */ 0x19000000,0x00000120, +at 0x00000078 : */ 0x19000000,0x00000120, /* MOVE FROM dsa_datain+0x0100, WHEN DATA_IN -at 0x0000007c : */ 0x19000000,0x00000128, +at 0x0000007a : */ 0x19000000,0x00000128, /* MOVE FROM dsa_datain+0x0108, WHEN DATA_IN -at 0x0000007e : */ 0x19000000,0x00000130, +at 0x0000007c : */ 0x19000000,0x00000130, /* MOVE FROM dsa_datain+0x0110, WHEN DATA_IN -at 0x00000080 : */ 0x19000000,0x00000138, +at 0x0000007e : */ 0x19000000,0x00000138, /* MOVE FROM dsa_datain+0x0118, WHEN DATA_IN -at 0x00000082 : */ 0x19000000,0x00000140, +at 0x00000080 : */ 0x19000000,0x00000140, /* MOVE FROM dsa_datain+0x0120, WHEN DATA_IN -at 0x00000084 : */ 0x19000000,0x00000148, +at 0x00000082 : */ 0x19000000,0x00000148, /* MOVE FROM dsa_datain+0x0128, WHEN DATA_IN -at 0x00000086 : */ 0x19000000,0x00000150, +at 0x00000084 : */ 0x19000000,0x00000150, /* MOVE FROM dsa_datain+0x0130, WHEN DATA_IN -at 0x00000088 : */ 0x19000000,0x00000158, +at 0x00000086 : */ 0x19000000,0x00000158, /* MOVE FROM dsa_datain+0x0138, WHEN DATA_IN -at 0x0000008a : */ 0x19000000,0x00000160, +at 0x00000088 : */ 0x19000000,0x00000160, /* MOVE FROM dsa_datain+0x0140, WHEN DATA_IN -at 0x0000008c : */ 0x19000000,0x00000168, +at 0x0000008a : */ 0x19000000,0x00000168, /* MOVE FROM dsa_datain+0x0148, WHEN DATA_IN -at 0x0000008e : */ 0x19000000,0x00000170, +at 0x0000008c : */ 0x19000000,0x00000170, /* MOVE FROM dsa_datain+0x0150, WHEN DATA_IN -at 0x00000090 : */ 0x19000000,0x00000178, +at 0x0000008e : */ 0x19000000,0x00000178, /* MOVE FROM dsa_datain+0x0158, WHEN DATA_IN -at 0x00000092 : */ 0x19000000,0x00000180, +at 0x00000090 : */ 0x19000000,0x00000180, /* MOVE FROM dsa_datain+0x0160, WHEN DATA_IN -at 0x00000094 : */ 0x19000000,0x00000188, +at 0x00000092 : */ 0x19000000,0x00000188, /* MOVE FROM dsa_datain+0x0168, WHEN DATA_IN -at 0x00000096 : */ 0x19000000,0x00000190, +at 0x00000094 : */ 0x19000000,0x00000190, /* MOVE FROM dsa_datain+0x0170, WHEN DATA_IN -at 0x00000098 : */ 0x19000000,0x00000198, +at 0x00000096 : */ 0x19000000,0x00000198, /* MOVE FROM dsa_datain+0x0178, WHEN DATA_IN -at 0x0000009a : */ 0x19000000,0x000001a0, +at 0x00000098 : */ 0x19000000,0x000001a0, /* MOVE FROM dsa_datain+0x0180, WHEN DATA_IN -at 0x0000009c : */ 0x19000000,0x000001a8, +at 0x0000009a : */ 0x19000000,0x000001a8, /* MOVE FROM dsa_datain+0x0188, WHEN DATA_IN -at 0x0000009e : */ 0x19000000,0x000001b0, +at 0x0000009c : */ 0x19000000,0x000001b0, /* MOVE FROM dsa_datain+0x0190, WHEN DATA_IN -at 0x000000a0 : */ 0x19000000,0x000001b8, +at 0x0000009e : */ 0x19000000,0x000001b8, /* MOVE FROM dsa_datain+0x0198, WHEN DATA_IN -at 0x000000a2 : */ 0x19000000,0x000001c0, +at 0x000000a0 : */ 0x19000000,0x000001c0, /* MOVE FROM dsa_datain+0x01a0, WHEN DATA_IN -at 0x000000a4 : */ 0x19000000,0x000001c8, +at 0x000000a2 : */ 0x19000000,0x000001c8, /* MOVE FROM dsa_datain+0x01a8, WHEN DATA_IN -at 0x000000a6 : */ 0x19000000,0x000001d0, +at 0x000000a4 : */ 0x19000000,0x000001d0, /* MOVE FROM dsa_datain+0x01b0, WHEN DATA_IN -at 0x000000a8 : */ 0x19000000,0x000001d8, +at 0x000000a6 : */ 0x19000000,0x000001d8, /* MOVE FROM dsa_datain+0x01b8, WHEN DATA_IN -at 0x000000aa : */ 0x19000000,0x000001e0, +at 0x000000a8 : */ 0x19000000,0x000001e0, /* MOVE FROM dsa_datain+0x01c0, WHEN DATA_IN -at 0x000000ac : */ 0x19000000,0x000001e8, +at 0x000000aa : */ 0x19000000,0x000001e8, /* MOVE FROM dsa_datain+0x01c8, WHEN DATA_IN -at 0x000000ae : */ 0x19000000,0x000001f0, +at 0x000000ac : */ 0x19000000,0x000001f0, /* MOVE FROM dsa_datain+0x01d0, WHEN DATA_IN -at 0x000000b0 : */ 0x19000000,0x000001f8, +at 0x000000ae : */ 0x19000000,0x000001f8, /* MOVE FROM dsa_datain+0x01d8, WHEN DATA_IN -at 0x000000b2 : */ 0x19000000,0x00000200, +at 0x000000b0 : */ 0x19000000,0x00000200, /* MOVE FROM dsa_datain+0x01e0, WHEN DATA_IN -at 0x000000b4 : */ 0x19000000,0x00000208, +at 0x000000b2 : */ 0x19000000,0x00000208, /* MOVE FROM dsa_datain+0x01e8, WHEN DATA_IN -at 0x000000b6 : */ 0x19000000,0x00000210, +at 0x000000b4 : */ 0x19000000,0x00000210, /* MOVE FROM dsa_datain+0x01f0, WHEN DATA_IN -at 0x000000b8 : */ 0x19000000,0x00000218, +at 0x000000b6 : */ 0x19000000,0x00000218, /* MOVE FROM dsa_datain+0x01f8, WHEN DATA_IN -at 0x000000ba : */ 0x19000000,0x00000220, +at 0x000000b8 : */ 0x19000000,0x00000220, /* MOVE FROM dsa_datain+0x0200, WHEN DATA_IN -at 0x000000bc : */ 0x19000000,0x00000228, +at 0x000000ba : */ 0x19000000,0x00000228, /* MOVE FROM dsa_datain+0x0208, WHEN DATA_IN -at 0x000000be : */ 0x19000000,0x00000230, +at 0x000000bc : */ 0x19000000,0x00000230, /* MOVE FROM dsa_datain+0x0210, WHEN DATA_IN -at 0x000000c0 : */ 0x19000000,0x00000238, +at 0x000000be : */ 0x19000000,0x00000238, /* MOVE FROM dsa_datain+0x0218, WHEN DATA_IN -at 0x000000c2 : */ 0x19000000,0x00000240, +at 0x000000c0 : */ 0x19000000,0x00000240, /* MOVE FROM dsa_datain+0x0220, WHEN DATA_IN -at 0x000000c4 : */ 0x19000000,0x00000248, +at 0x000000c2 : */ 0x19000000,0x00000248, /* MOVE FROM dsa_datain+0x0228, WHEN DATA_IN -at 0x000000c6 : */ 0x19000000,0x00000250, +at 0x000000c4 : */ 0x19000000,0x00000250, /* MOVE FROM dsa_datain+0x0230, WHEN DATA_IN -at 0x000000c8 : */ 0x19000000,0x00000258, +at 0x000000c6 : */ 0x19000000,0x00000258, /* MOVE FROM dsa_datain+0x0238, WHEN DATA_IN -at 0x000000ca : */ 0x19000000,0x00000260, +at 0x000000c8 : */ 0x19000000,0x00000260, /* MOVE FROM dsa_datain+0x0240, WHEN DATA_IN -at 0x000000cc : */ 0x19000000,0x00000268, +at 0x000000ca : */ 0x19000000,0x00000268, /* MOVE FROM dsa_datain+0x0248, WHEN DATA_IN -at 0x000000ce : */ 0x19000000,0x00000270, +at 0x000000cc : */ 0x19000000,0x00000270, /* MOVE FROM dsa_datain+0x0250, WHEN DATA_IN -at 0x000000d0 : */ 0x19000000,0x00000278, +at 0x000000ce : */ 0x19000000,0x00000278, /* MOVE FROM dsa_datain+0x0258, WHEN DATA_IN -at 0x000000d2 : */ 0x19000000,0x00000280, +at 0x000000d0 : */ 0x19000000,0x00000280, /* MOVE FROM dsa_datain+0x0260, WHEN DATA_IN -at 0x000000d4 : */ 0x19000000,0x00000288, +at 0x000000d2 : */ 0x19000000,0x00000288, /* MOVE FROM dsa_datain+0x0268, WHEN DATA_IN -at 0x000000d6 : */ 0x19000000,0x00000290, +at 0x000000d4 : */ 0x19000000,0x00000290, /* MOVE FROM dsa_datain+0x0270, WHEN DATA_IN -at 0x000000d8 : */ 0x19000000,0x00000298, +at 0x000000d6 : */ 0x19000000,0x00000298, /* MOVE FROM dsa_datain+0x0278, WHEN DATA_IN -at 0x000000da : */ 0x19000000,0x000002a0, +at 0x000000d8 : */ 0x19000000,0x000002a0, /* MOVE FROM dsa_datain+0x0280, WHEN DATA_IN -at 0x000000dc : */ 0x19000000,0x000002a8, +at 0x000000da : */ 0x19000000,0x000002a8, /* MOVE FROM dsa_datain+0x0288, WHEN DATA_IN -at 0x000000de : */ 0x19000000,0x000002b0, +at 0x000000dc : */ 0x19000000,0x000002b0, /* MOVE FROM dsa_datain+0x0290, WHEN DATA_IN -at 0x000000e0 : */ 0x19000000,0x000002b8, +at 0x000000de : */ 0x19000000,0x000002b8, /* MOVE FROM dsa_datain+0x0298, WHEN DATA_IN -at 0x000000e2 : */ 0x19000000,0x000002c0, +at 0x000000e0 : */ 0x19000000,0x000002c0, /* MOVE FROM dsa_datain+0x02a0, WHEN DATA_IN -at 0x000000e4 : */ 0x19000000,0x000002c8, +at 0x000000e2 : */ 0x19000000,0x000002c8, /* MOVE FROM dsa_datain+0x02a8, WHEN DATA_IN -at 0x000000e6 : */ 0x19000000,0x000002d0, +at 0x000000e4 : */ 0x19000000,0x000002d0, /* MOVE FROM dsa_datain+0x02b0, WHEN DATA_IN -at 0x000000e8 : */ 0x19000000,0x000002d8, +at 0x000000e6 : */ 0x19000000,0x000002d8, /* MOVE FROM dsa_datain+0x02b8, WHEN DATA_IN -at 0x000000ea : */ 0x19000000,0x000002e0, +at 0x000000e8 : */ 0x19000000,0x000002e0, /* MOVE FROM dsa_datain+0x02c0, WHEN DATA_IN -at 0x000000ec : */ 0x19000000,0x000002e8, +at 0x000000ea : */ 0x19000000,0x000002e8, /* MOVE FROM dsa_datain+0x02c8, WHEN DATA_IN -at 0x000000ee : */ 0x19000000,0x000002f0, +at 0x000000ec : */ 0x19000000,0x000002f0, /* MOVE FROM dsa_datain+0x02d0, WHEN DATA_IN -at 0x000000f0 : */ 0x19000000,0x000002f8, +at 0x000000ee : */ 0x19000000,0x000002f8, /* MOVE FROM dsa_datain+0x02d8, WHEN DATA_IN -at 0x000000f2 : */ 0x19000000,0x00000300, +at 0x000000f0 : */ 0x19000000,0x00000300, /* MOVE FROM dsa_datain+0x02e0, WHEN DATA_IN -at 0x000000f4 : */ 0x19000000,0x00000308, +at 0x000000f2 : */ 0x19000000,0x00000308, /* MOVE FROM dsa_datain+0x02e8, WHEN DATA_IN -at 0x000000f6 : */ 0x19000000,0x00000310, +at 0x000000f4 : */ 0x19000000,0x00000310, /* MOVE FROM dsa_datain+0x02f0, WHEN DATA_IN -at 0x000000f8 : */ 0x19000000,0x00000318, +at 0x000000f6 : */ 0x19000000,0x00000318, /* MOVE FROM dsa_datain+0x02f8, WHEN DATA_IN -at 0x000000fa : */ 0x19000000,0x00000320, +at 0x000000f8 : */ 0x19000000,0x00000320, /* MOVE FROM dsa_datain+0x0300, WHEN DATA_IN -at 0x000000fc : */ 0x19000000,0x00000328, +at 0x000000fa : */ 0x19000000,0x00000328, /* MOVE FROM dsa_datain+0x0308, WHEN DATA_IN -at 0x000000fe : */ 0x19000000,0x00000330, +at 0x000000fc : */ 0x19000000,0x00000330, /* MOVE FROM dsa_datain+0x0310, WHEN DATA_IN -at 0x00000100 : */ 0x19000000,0x00000338, +at 0x000000fe : */ 0x19000000,0x00000338, /* MOVE FROM dsa_datain+0x0318, WHEN DATA_IN -at 0x00000102 : */ 0x19000000,0x00000340, +at 0x00000100 : */ 0x19000000,0x00000340, /* MOVE FROM dsa_datain+0x0320, WHEN DATA_IN -at 0x00000104 : */ 0x19000000,0x00000348, +at 0x00000102 : */ 0x19000000,0x00000348, /* MOVE FROM dsa_datain+0x0328, WHEN DATA_IN -at 0x00000106 : */ 0x19000000,0x00000350, +at 0x00000104 : */ 0x19000000,0x00000350, /* MOVE FROM dsa_datain+0x0330, WHEN DATA_IN -at 0x00000108 : */ 0x19000000,0x00000358, +at 0x00000106 : */ 0x19000000,0x00000358, /* MOVE FROM dsa_datain+0x0338, WHEN DATA_IN -at 0x0000010a : */ 0x19000000,0x00000360, +at 0x00000108 : */ 0x19000000,0x00000360, /* MOVE FROM dsa_datain+0x0340, WHEN DATA_IN -at 0x0000010c : */ 0x19000000,0x00000368, +at 0x0000010a : */ 0x19000000,0x00000368, /* MOVE FROM dsa_datain+0x0348, WHEN DATA_IN -at 0x0000010e : */ 0x19000000,0x00000370, +at 0x0000010c : */ 0x19000000,0x00000370, /* MOVE FROM dsa_datain+0x0350, WHEN DATA_IN -at 0x00000110 : */ 0x19000000,0x00000378, +at 0x0000010e : */ 0x19000000,0x00000378, /* MOVE FROM dsa_datain+0x0358, WHEN DATA_IN -at 0x00000112 : */ 0x19000000,0x00000380, +at 0x00000110 : */ 0x19000000,0x00000380, /* MOVE FROM dsa_datain+0x0360, WHEN DATA_IN -at 0x00000114 : */ 0x19000000,0x00000388, +at 0x00000112 : */ 0x19000000,0x00000388, /* MOVE FROM dsa_datain+0x0368, WHEN DATA_IN -at 0x00000116 : */ 0x19000000,0x00000390, +at 0x00000114 : */ 0x19000000,0x00000390, /* MOVE FROM dsa_datain+0x0370, WHEN DATA_IN -at 0x00000118 : */ 0x19000000,0x00000398, +at 0x00000116 : */ 0x19000000,0x00000398, /* MOVE FROM dsa_datain+0x0378, WHEN DATA_IN -at 0x0000011a : */ 0x19000000,0x000003a0, +at 0x00000118 : */ 0x19000000,0x000003a0, /* MOVE FROM dsa_datain+0x0380, WHEN DATA_IN -at 0x0000011c : */ 0x19000000,0x000003a8, +at 0x0000011a : */ 0x19000000,0x000003a8, /* MOVE FROM dsa_datain+0x0388, WHEN DATA_IN -at 0x0000011e : */ 0x19000000,0x000003b0, +at 0x0000011c : */ 0x19000000,0x000003b0, /* MOVE FROM dsa_datain+0x0390, WHEN DATA_IN -at 0x00000120 : */ 0x19000000,0x000003b8, +at 0x0000011e : */ 0x19000000,0x000003b8, /* MOVE FROM dsa_datain+0x0398, WHEN DATA_IN -at 0x00000122 : */ 0x19000000,0x000003c0, +at 0x00000120 : */ 0x19000000,0x000003c0, /* MOVE FROM dsa_datain+0x03a0, WHEN DATA_IN -at 0x00000124 : */ 0x19000000,0x000003c8, +at 0x00000122 : */ 0x19000000,0x000003c8, /* MOVE FROM dsa_datain+0x03a8, WHEN DATA_IN -at 0x00000126 : */ 0x19000000,0x000003d0, +at 0x00000124 : */ 0x19000000,0x000003d0, /* MOVE FROM dsa_datain+0x03b0, WHEN DATA_IN -at 0x00000128 : */ 0x19000000,0x000003d8, +at 0x00000126 : */ 0x19000000,0x000003d8, /* MOVE FROM dsa_datain+0x03b8, WHEN DATA_IN -at 0x0000012a : */ 0x19000000,0x000003e0, +at 0x00000128 : */ 0x19000000,0x000003e0, /* MOVE FROM dsa_datain+0x03c0, WHEN DATA_IN -at 0x0000012c : */ 0x19000000,0x000003e8, +at 0x0000012a : */ 0x19000000,0x000003e8, /* MOVE FROM dsa_datain+0x03c8, WHEN DATA_IN -at 0x0000012e : */ 0x19000000,0x000003f0, +at 0x0000012c : */ 0x19000000,0x000003f0, /* MOVE FROM dsa_datain+0x03d0, WHEN DATA_IN -at 0x00000130 : */ 0x19000000,0x000003f8, +at 0x0000012e : */ 0x19000000,0x000003f8, /* MOVE FROM dsa_datain+0x03d8, WHEN DATA_IN -at 0x00000132 : */ 0x19000000,0x00000400, +at 0x00000130 : */ 0x19000000,0x00000400, /* MOVE FROM dsa_datain+0x03e0, WHEN DATA_IN -at 0x00000134 : */ 0x19000000,0x00000408, +at 0x00000132 : */ 0x19000000,0x00000408, /* MOVE FROM dsa_datain+0x03e8, WHEN DATA_IN -at 0x00000136 : */ 0x19000000,0x00000410, +at 0x00000134 : */ 0x19000000,0x00000410, /* MOVE FROM dsa_datain+0x03f0, WHEN DATA_IN -at 0x00000138 : */ 0x19000000,0x00000418, +at 0x00000136 : */ 0x19000000,0x00000418, /* MOVE FROM dsa_datain+0x03f8, WHEN DATA_IN -at 0x0000013a : */ 0x19000000,0x00000420, +at 0x00000138 : */ 0x19000000,0x00000420, /* JUMP end_data_trans -at 0x0000013c : */ 0x80080000,0x00000908, +at 0x0000013a : */ 0x80080000,0x00000900, /* output_data: MOVE SCRATCH0 | had_dataout TO SCRATCH0 -at 0x0000013e : */ 0x7a341000,0x00000000, +at 0x0000013c : */ 0x7a341000,0x00000000, /* ENTRY patch_output_data patch_output_data: JUMP 0 -at 0x00000140 : */ 0x80080000,0x00000000, +at 0x0000013e : */ 0x80080000,0x00000000, /* MOVE FROM dsa_dataout+0x0000, WHEN DATA_OUT -at 0x00000142 : */ 0x18000000,0x00000428, +at 0x00000140 : */ 0x18000000,0x00000428, /* MOVE FROM dsa_dataout+0x0008, WHEN DATA_OUT -at 0x00000144 : */ 0x18000000,0x00000430, +at 0x00000142 : */ 0x18000000,0x00000430, /* MOVE FROM dsa_dataout+0x0010, WHEN DATA_OUT -at 0x00000146 : */ 0x18000000,0x00000438, +at 0x00000144 : */ 0x18000000,0x00000438, /* MOVE FROM dsa_dataout+0x0018, WHEN DATA_OUT -at 0x00000148 : */ 0x18000000,0x00000440, +at 0x00000146 : */ 0x18000000,0x00000440, /* MOVE FROM dsa_dataout+0x0020, WHEN DATA_OUT -at 0x0000014a : */ 0x18000000,0x00000448, +at 0x00000148 : */ 0x18000000,0x00000448, /* MOVE FROM dsa_dataout+0x0028, WHEN DATA_OUT -at 0x0000014c : */ 0x18000000,0x00000450, +at 0x0000014a : */ 0x18000000,0x00000450, /* MOVE FROM dsa_dataout+0x0030, WHEN DATA_OUT -at 0x0000014e : */ 0x18000000,0x00000458, +at 0x0000014c : */ 0x18000000,0x00000458, /* MOVE FROM dsa_dataout+0x0038, WHEN DATA_OUT -at 0x00000150 : */ 0x18000000,0x00000460, +at 0x0000014e : */ 0x18000000,0x00000460, /* MOVE FROM dsa_dataout+0x0040, WHEN DATA_OUT -at 0x00000152 : */ 0x18000000,0x00000468, +at 0x00000150 : */ 0x18000000,0x00000468, /* MOVE FROM dsa_dataout+0x0048, WHEN DATA_OUT -at 0x00000154 : */ 0x18000000,0x00000470, +at 0x00000152 : */ 0x18000000,0x00000470, /* MOVE FROM dsa_dataout+0x0050, WHEN DATA_OUT -at 0x00000156 : */ 0x18000000,0x00000478, +at 0x00000154 : */ 0x18000000,0x00000478, /* MOVE FROM dsa_dataout+0x0058, WHEN DATA_OUT -at 0x00000158 : */ 0x18000000,0x00000480, +at 0x00000156 : */ 0x18000000,0x00000480, /* MOVE FROM dsa_dataout+0x0060, WHEN DATA_OUT -at 0x0000015a : */ 0x18000000,0x00000488, +at 0x00000158 : */ 0x18000000,0x00000488, /* MOVE FROM dsa_dataout+0x0068, WHEN DATA_OUT -at 0x0000015c : */ 0x18000000,0x00000490, +at 0x0000015a : */ 0x18000000,0x00000490, /* MOVE FROM dsa_dataout+0x0070, WHEN DATA_OUT -at 0x0000015e : */ 0x18000000,0x00000498, +at 0x0000015c : */ 0x18000000,0x00000498, /* MOVE FROM dsa_dataout+0x0078, WHEN DATA_OUT -at 0x00000160 : */ 0x18000000,0x000004a0, +at 0x0000015e : */ 0x18000000,0x000004a0, /* MOVE FROM dsa_dataout+0x0080, WHEN DATA_OUT -at 0x00000162 : */ 0x18000000,0x000004a8, +at 0x00000160 : */ 0x18000000,0x000004a8, /* MOVE FROM dsa_dataout+0x0088, WHEN DATA_OUT -at 0x00000164 : */ 0x18000000,0x000004b0, +at 0x00000162 : */ 0x18000000,0x000004b0, /* MOVE FROM dsa_dataout+0x0090, WHEN DATA_OUT -at 0x00000166 : */ 0x18000000,0x000004b8, +at 0x00000164 : */ 0x18000000,0x000004b8, /* MOVE FROM dsa_dataout+0x0098, WHEN DATA_OUT -at 0x00000168 : */ 0x18000000,0x000004c0, +at 0x00000166 : */ 0x18000000,0x000004c0, /* MOVE FROM dsa_dataout+0x00a0, WHEN DATA_OUT -at 0x0000016a : */ 0x18000000,0x000004c8, +at 0x00000168 : */ 0x18000000,0x000004c8, /* MOVE FROM dsa_dataout+0x00a8, WHEN DATA_OUT -at 0x0000016c : */ 0x18000000,0x000004d0, +at 0x0000016a : */ 0x18000000,0x000004d0, /* MOVE FROM dsa_dataout+0x00b0, WHEN DATA_OUT -at 0x0000016e : */ 0x18000000,0x000004d8, +at 0x0000016c : */ 0x18000000,0x000004d8, /* MOVE FROM dsa_dataout+0x00b8, WHEN DATA_OUT -at 0x00000170 : */ 0x18000000,0x000004e0, +at 0x0000016e : */ 0x18000000,0x000004e0, /* MOVE FROM dsa_dataout+0x00c0, WHEN DATA_OUT -at 0x00000172 : */ 0x18000000,0x000004e8, +at 0x00000170 : */ 0x18000000,0x000004e8, /* MOVE FROM dsa_dataout+0x00c8, WHEN DATA_OUT -at 0x00000174 : */ 0x18000000,0x000004f0, +at 0x00000172 : */ 0x18000000,0x000004f0, /* MOVE FROM dsa_dataout+0x00d0, WHEN DATA_OUT -at 0x00000176 : */ 0x18000000,0x000004f8, +at 0x00000174 : */ 0x18000000,0x000004f8, /* MOVE FROM dsa_dataout+0x00d8, WHEN DATA_OUT -at 0x00000178 : */ 0x18000000,0x00000500, +at 0x00000176 : */ 0x18000000,0x00000500, /* MOVE FROM dsa_dataout+0x00e0, WHEN DATA_OUT -at 0x0000017a : */ 0x18000000,0x00000508, +at 0x00000178 : */ 0x18000000,0x00000508, /* MOVE FROM dsa_dataout+0x00e8, WHEN DATA_OUT -at 0x0000017c : */ 0x18000000,0x00000510, +at 0x0000017a : */ 0x18000000,0x00000510, /* MOVE FROM dsa_dataout+0x00f0, WHEN DATA_OUT -at 0x0000017e : */ 0x18000000,0x00000518, +at 0x0000017c : */ 0x18000000,0x00000518, /* MOVE FROM dsa_dataout+0x00f8, WHEN DATA_OUT -at 0x00000180 : */ 0x18000000,0x00000520, +at 0x0000017e : */ 0x18000000,0x00000520, /* MOVE FROM dsa_dataout+0x0100, WHEN DATA_OUT -at 0x00000182 : */ 0x18000000,0x00000528, +at 0x00000180 : */ 0x18000000,0x00000528, /* MOVE FROM dsa_dataout+0x0108, WHEN DATA_OUT -at 0x00000184 : */ 0x18000000,0x00000530, +at 0x00000182 : */ 0x18000000,0x00000530, /* MOVE FROM dsa_dataout+0x0110, WHEN DATA_OUT -at 0x00000186 : */ 0x18000000,0x00000538, +at 0x00000184 : */ 0x18000000,0x00000538, /* MOVE FROM dsa_dataout+0x0118, WHEN DATA_OUT -at 0x00000188 : */ 0x18000000,0x00000540, +at 0x00000186 : */ 0x18000000,0x00000540, /* MOVE FROM dsa_dataout+0x0120, WHEN DATA_OUT -at 0x0000018a : */ 0x18000000,0x00000548, +at 0x00000188 : */ 0x18000000,0x00000548, /* MOVE FROM dsa_dataout+0x0128, WHEN DATA_OUT -at 0x0000018c : */ 0x18000000,0x00000550, +at 0x0000018a : */ 0x18000000,0x00000550, /* MOVE FROM dsa_dataout+0x0130, WHEN DATA_OUT -at 0x0000018e : */ 0x18000000,0x00000558, +at 0x0000018c : */ 0x18000000,0x00000558, /* MOVE FROM dsa_dataout+0x0138, WHEN DATA_OUT -at 0x00000190 : */ 0x18000000,0x00000560, +at 0x0000018e : */ 0x18000000,0x00000560, /* MOVE FROM dsa_dataout+0x0140, WHEN DATA_OUT -at 0x00000192 : */ 0x18000000,0x00000568, +at 0x00000190 : */ 0x18000000,0x00000568, /* MOVE FROM dsa_dataout+0x0148, WHEN DATA_OUT -at 0x00000194 : */ 0x18000000,0x00000570, +at 0x00000192 : */ 0x18000000,0x00000570, /* MOVE FROM dsa_dataout+0x0150, WHEN DATA_OUT -at 0x00000196 : */ 0x18000000,0x00000578, +at 0x00000194 : */ 0x18000000,0x00000578, /* MOVE FROM dsa_dataout+0x0158, WHEN DATA_OUT -at 0x00000198 : */ 0x18000000,0x00000580, +at 0x00000196 : */ 0x18000000,0x00000580, /* MOVE FROM dsa_dataout+0x0160, WHEN DATA_OUT -at 0x0000019a : */ 0x18000000,0x00000588, +at 0x00000198 : */ 0x18000000,0x00000588, /* MOVE FROM dsa_dataout+0x0168, WHEN DATA_OUT -at 0x0000019c : */ 0x18000000,0x00000590, +at 0x0000019a : */ 0x18000000,0x00000590, /* MOVE FROM dsa_dataout+0x0170, WHEN DATA_OUT -at 0x0000019e : */ 0x18000000,0x00000598, +at 0x0000019c : */ 0x18000000,0x00000598, /* MOVE FROM dsa_dataout+0x0178, WHEN DATA_OUT -at 0x000001a0 : */ 0x18000000,0x000005a0, +at 0x0000019e : */ 0x18000000,0x000005a0, /* MOVE FROM dsa_dataout+0x0180, WHEN DATA_OUT -at 0x000001a2 : */ 0x18000000,0x000005a8, +at 0x000001a0 : */ 0x18000000,0x000005a8, /* MOVE FROM dsa_dataout+0x0188, WHEN DATA_OUT -at 0x000001a4 : */ 0x18000000,0x000005b0, +at 0x000001a2 : */ 0x18000000,0x000005b0, /* MOVE FROM dsa_dataout+0x0190, WHEN DATA_OUT -at 0x000001a6 : */ 0x18000000,0x000005b8, +at 0x000001a4 : */ 0x18000000,0x000005b8, /* MOVE FROM dsa_dataout+0x0198, WHEN DATA_OUT -at 0x000001a8 : */ 0x18000000,0x000005c0, +at 0x000001a6 : */ 0x18000000,0x000005c0, /* MOVE FROM dsa_dataout+0x01a0, WHEN DATA_OUT -at 0x000001aa : */ 0x18000000,0x000005c8, +at 0x000001a8 : */ 0x18000000,0x000005c8, /* MOVE FROM dsa_dataout+0x01a8, WHEN DATA_OUT -at 0x000001ac : */ 0x18000000,0x000005d0, +at 0x000001aa : */ 0x18000000,0x000005d0, /* MOVE FROM dsa_dataout+0x01b0, WHEN DATA_OUT -at 0x000001ae : */ 0x18000000,0x000005d8, +at 0x000001ac : */ 0x18000000,0x000005d8, /* MOVE FROM dsa_dataout+0x01b8, WHEN DATA_OUT -at 0x000001b0 : */ 0x18000000,0x000005e0, +at 0x000001ae : */ 0x18000000,0x000005e0, /* MOVE FROM dsa_dataout+0x01c0, WHEN DATA_OUT -at 0x000001b2 : */ 0x18000000,0x000005e8, +at 0x000001b0 : */ 0x18000000,0x000005e8, /* MOVE FROM dsa_dataout+0x01c8, WHEN DATA_OUT -at 0x000001b4 : */ 0x18000000,0x000005f0, +at 0x000001b2 : */ 0x18000000,0x000005f0, /* MOVE FROM dsa_dataout+0x01d0, WHEN DATA_OUT -at 0x000001b6 : */ 0x18000000,0x000005f8, +at 0x000001b4 : */ 0x18000000,0x000005f8, /* MOVE FROM dsa_dataout+0x01d8, WHEN DATA_OUT -at 0x000001b8 : */ 0x18000000,0x00000600, +at 0x000001b6 : */ 0x18000000,0x00000600, /* MOVE FROM dsa_dataout+0x01e0, WHEN DATA_OUT -at 0x000001ba : */ 0x18000000,0x00000608, +at 0x000001b8 : */ 0x18000000,0x00000608, /* MOVE FROM dsa_dataout+0x01e8, WHEN DATA_OUT -at 0x000001bc : */ 0x18000000,0x00000610, +at 0x000001ba : */ 0x18000000,0x00000610, /* MOVE FROM dsa_dataout+0x01f0, WHEN DATA_OUT -at 0x000001be : */ 0x18000000,0x00000618, +at 0x000001bc : */ 0x18000000,0x00000618, /* MOVE FROM dsa_dataout+0x01f8, WHEN DATA_OUT -at 0x000001c0 : */ 0x18000000,0x00000620, +at 0x000001be : */ 0x18000000,0x00000620, /* MOVE FROM dsa_dataout+0x0200, WHEN DATA_OUT -at 0x000001c2 : */ 0x18000000,0x00000628, +at 0x000001c0 : */ 0x18000000,0x00000628, /* MOVE FROM dsa_dataout+0x0208, WHEN DATA_OUT -at 0x000001c4 : */ 0x18000000,0x00000630, +at 0x000001c2 : */ 0x18000000,0x00000630, /* MOVE FROM dsa_dataout+0x0210, WHEN DATA_OUT -at 0x000001c6 : */ 0x18000000,0x00000638, +at 0x000001c4 : */ 0x18000000,0x00000638, /* MOVE FROM dsa_dataout+0x0218, WHEN DATA_OUT -at 0x000001c8 : */ 0x18000000,0x00000640, +at 0x000001c6 : */ 0x18000000,0x00000640, /* MOVE FROM dsa_dataout+0x0220, WHEN DATA_OUT -at 0x000001ca : */ 0x18000000,0x00000648, +at 0x000001c8 : */ 0x18000000,0x00000648, /* MOVE FROM dsa_dataout+0x0228, WHEN DATA_OUT -at 0x000001cc : */ 0x18000000,0x00000650, +at 0x000001ca : */ 0x18000000,0x00000650, /* MOVE FROM dsa_dataout+0x0230, WHEN DATA_OUT -at 0x000001ce : */ 0x18000000,0x00000658, +at 0x000001cc : */ 0x18000000,0x00000658, /* MOVE FROM dsa_dataout+0x0238, WHEN DATA_OUT -at 0x000001d0 : */ 0x18000000,0x00000660, +at 0x000001ce : */ 0x18000000,0x00000660, /* MOVE FROM dsa_dataout+0x0240, WHEN DATA_OUT -at 0x000001d2 : */ 0x18000000,0x00000668, +at 0x000001d0 : */ 0x18000000,0x00000668, /* MOVE FROM dsa_dataout+0x0248, WHEN DATA_OUT -at 0x000001d4 : */ 0x18000000,0x00000670, +at 0x000001d2 : */ 0x18000000,0x00000670, /* MOVE FROM dsa_dataout+0x0250, WHEN DATA_OUT -at 0x000001d6 : */ 0x18000000,0x00000678, +at 0x000001d4 : */ 0x18000000,0x00000678, /* MOVE FROM dsa_dataout+0x0258, WHEN DATA_OUT -at 0x000001d8 : */ 0x18000000,0x00000680, +at 0x000001d6 : */ 0x18000000,0x00000680, /* MOVE FROM dsa_dataout+0x0260, WHEN DATA_OUT -at 0x000001da : */ 0x18000000,0x00000688, +at 0x000001d8 : */ 0x18000000,0x00000688, /* MOVE FROM dsa_dataout+0x0268, WHEN DATA_OUT -at 0x000001dc : */ 0x18000000,0x00000690, +at 0x000001da : */ 0x18000000,0x00000690, /* MOVE FROM dsa_dataout+0x0270, WHEN DATA_OUT -at 0x000001de : */ 0x18000000,0x00000698, +at 0x000001dc : */ 0x18000000,0x00000698, /* MOVE FROM dsa_dataout+0x0278, WHEN DATA_OUT -at 0x000001e0 : */ 0x18000000,0x000006a0, +at 0x000001de : */ 0x18000000,0x000006a0, /* MOVE FROM dsa_dataout+0x0280, WHEN DATA_OUT -at 0x000001e2 : */ 0x18000000,0x000006a8, +at 0x000001e0 : */ 0x18000000,0x000006a8, /* MOVE FROM dsa_dataout+0x0288, WHEN DATA_OUT -at 0x000001e4 : */ 0x18000000,0x000006b0, +at 0x000001e2 : */ 0x18000000,0x000006b0, /* MOVE FROM dsa_dataout+0x0290, WHEN DATA_OUT -at 0x000001e6 : */ 0x18000000,0x000006b8, +at 0x000001e4 : */ 0x18000000,0x000006b8, /* MOVE FROM dsa_dataout+0x0298, WHEN DATA_OUT -at 0x000001e8 : */ 0x18000000,0x000006c0, +at 0x000001e6 : */ 0x18000000,0x000006c0, /* MOVE FROM dsa_dataout+0x02a0, WHEN DATA_OUT -at 0x000001ea : */ 0x18000000,0x000006c8, +at 0x000001e8 : */ 0x18000000,0x000006c8, /* MOVE FROM dsa_dataout+0x02a8, WHEN DATA_OUT -at 0x000001ec : */ 0x18000000,0x000006d0, +at 0x000001ea : */ 0x18000000,0x000006d0, /* MOVE FROM dsa_dataout+0x02b0, WHEN DATA_OUT -at 0x000001ee : */ 0x18000000,0x000006d8, +at 0x000001ec : */ 0x18000000,0x000006d8, /* MOVE FROM dsa_dataout+0x02b8, WHEN DATA_OUT -at 0x000001f0 : */ 0x18000000,0x000006e0, +at 0x000001ee : */ 0x18000000,0x000006e0, /* MOVE FROM dsa_dataout+0x02c0, WHEN DATA_OUT -at 0x000001f2 : */ 0x18000000,0x000006e8, +at 0x000001f0 : */ 0x18000000,0x000006e8, /* MOVE FROM dsa_dataout+0x02c8, WHEN DATA_OUT -at 0x000001f4 : */ 0x18000000,0x000006f0, +at 0x000001f2 : */ 0x18000000,0x000006f0, /* MOVE FROM dsa_dataout+0x02d0, WHEN DATA_OUT -at 0x000001f6 : */ 0x18000000,0x000006f8, +at 0x000001f4 : */ 0x18000000,0x000006f8, /* MOVE FROM dsa_dataout+0x02d8, WHEN DATA_OUT -at 0x000001f8 : */ 0x18000000,0x00000700, +at 0x000001f6 : */ 0x18000000,0x00000700, /* MOVE FROM dsa_dataout+0x02e0, WHEN DATA_OUT -at 0x000001fa : */ 0x18000000,0x00000708, +at 0x000001f8 : */ 0x18000000,0x00000708, /* MOVE FROM dsa_dataout+0x02e8, WHEN DATA_OUT -at 0x000001fc : */ 0x18000000,0x00000710, +at 0x000001fa : */ 0x18000000,0x00000710, /* MOVE FROM dsa_dataout+0x02f0, WHEN DATA_OUT -at 0x000001fe : */ 0x18000000,0x00000718, +at 0x000001fc : */ 0x18000000,0x00000718, /* MOVE FROM dsa_dataout+0x02f8, WHEN DATA_OUT -at 0x00000200 : */ 0x18000000,0x00000720, +at 0x000001fe : */ 0x18000000,0x00000720, /* MOVE FROM dsa_dataout+0x0300, WHEN DATA_OUT -at 0x00000202 : */ 0x18000000,0x00000728, +at 0x00000200 : */ 0x18000000,0x00000728, /* MOVE FROM dsa_dataout+0x0308, WHEN DATA_OUT -at 0x00000204 : */ 0x18000000,0x00000730, +at 0x00000202 : */ 0x18000000,0x00000730, /* MOVE FROM dsa_dataout+0x0310, WHEN DATA_OUT -at 0x00000206 : */ 0x18000000,0x00000738, +at 0x00000204 : */ 0x18000000,0x00000738, /* MOVE FROM dsa_dataout+0x0318, WHEN DATA_OUT -at 0x00000208 : */ 0x18000000,0x00000740, +at 0x00000206 : */ 0x18000000,0x00000740, /* MOVE FROM dsa_dataout+0x0320, WHEN DATA_OUT -at 0x0000020a : */ 0x18000000,0x00000748, +at 0x00000208 : */ 0x18000000,0x00000748, /* MOVE FROM dsa_dataout+0x0328, WHEN DATA_OUT -at 0x0000020c : */ 0x18000000,0x00000750, +at 0x0000020a : */ 0x18000000,0x00000750, /* MOVE FROM dsa_dataout+0x0330, WHEN DATA_OUT -at 0x0000020e : */ 0x18000000,0x00000758, +at 0x0000020c : */ 0x18000000,0x00000758, /* MOVE FROM dsa_dataout+0x0338, WHEN DATA_OUT -at 0x00000210 : */ 0x18000000,0x00000760, +at 0x0000020e : */ 0x18000000,0x00000760, /* MOVE FROM dsa_dataout+0x0340, WHEN DATA_OUT -at 0x00000212 : */ 0x18000000,0x00000768, +at 0x00000210 : */ 0x18000000,0x00000768, /* MOVE FROM dsa_dataout+0x0348, WHEN DATA_OUT -at 0x00000214 : */ 0x18000000,0x00000770, +at 0x00000212 : */ 0x18000000,0x00000770, /* MOVE FROM dsa_dataout+0x0350, WHEN DATA_OUT -at 0x00000216 : */ 0x18000000,0x00000778, +at 0x00000214 : */ 0x18000000,0x00000778, /* MOVE FROM dsa_dataout+0x0358, WHEN DATA_OUT -at 0x00000218 : */ 0x18000000,0x00000780, +at 0x00000216 : */ 0x18000000,0x00000780, /* MOVE FROM dsa_dataout+0x0360, WHEN DATA_OUT -at 0x0000021a : */ 0x18000000,0x00000788, +at 0x00000218 : */ 0x18000000,0x00000788, /* MOVE FROM dsa_dataout+0x0368, WHEN DATA_OUT -at 0x0000021c : */ 0x18000000,0x00000790, +at 0x0000021a : */ 0x18000000,0x00000790, /* MOVE FROM dsa_dataout+0x0370, WHEN DATA_OUT -at 0x0000021e : */ 0x18000000,0x00000798, +at 0x0000021c : */ 0x18000000,0x00000798, /* MOVE FROM dsa_dataout+0x0378, WHEN DATA_OUT -at 0x00000220 : */ 0x18000000,0x000007a0, +at 0x0000021e : */ 0x18000000,0x000007a0, /* MOVE FROM dsa_dataout+0x0380, WHEN DATA_OUT -at 0x00000222 : */ 0x18000000,0x000007a8, +at 0x00000220 : */ 0x18000000,0x000007a8, /* MOVE FROM dsa_dataout+0x0388, WHEN DATA_OUT -at 0x00000224 : */ 0x18000000,0x000007b0, +at 0x00000222 : */ 0x18000000,0x000007b0, /* MOVE FROM dsa_dataout+0x0390, WHEN DATA_OUT -at 0x00000226 : */ 0x18000000,0x000007b8, +at 0x00000224 : */ 0x18000000,0x000007b8, /* MOVE FROM dsa_dataout+0x0398, WHEN DATA_OUT -at 0x00000228 : */ 0x18000000,0x000007c0, +at 0x00000226 : */ 0x18000000,0x000007c0, /* MOVE FROM dsa_dataout+0x03a0, WHEN DATA_OUT -at 0x0000022a : */ 0x18000000,0x000007c8, +at 0x00000228 : */ 0x18000000,0x000007c8, /* MOVE FROM dsa_dataout+0x03a8, WHEN DATA_OUT -at 0x0000022c : */ 0x18000000,0x000007d0, +at 0x0000022a : */ 0x18000000,0x000007d0, /* MOVE FROM dsa_dataout+0x03b0, WHEN DATA_OUT -at 0x0000022e : */ 0x18000000,0x000007d8, +at 0x0000022c : */ 0x18000000,0x000007d8, /* MOVE FROM dsa_dataout+0x03b8, WHEN DATA_OUT -at 0x00000230 : */ 0x18000000,0x000007e0, +at 0x0000022e : */ 0x18000000,0x000007e0, /* MOVE FROM dsa_dataout+0x03c0, WHEN DATA_OUT -at 0x00000232 : */ 0x18000000,0x000007e8, +at 0x00000230 : */ 0x18000000,0x000007e8, /* MOVE FROM dsa_dataout+0x03c8, WHEN DATA_OUT -at 0x00000234 : */ 0x18000000,0x000007f0, +at 0x00000232 : */ 0x18000000,0x000007f0, /* MOVE FROM dsa_dataout+0x03d0, WHEN DATA_OUT -at 0x00000236 : */ 0x18000000,0x000007f8, +at 0x00000234 : */ 0x18000000,0x000007f8, /* MOVE FROM dsa_dataout+0x03d8, WHEN DATA_OUT -at 0x00000238 : */ 0x18000000,0x00000800, +at 0x00000236 : */ 0x18000000,0x00000800, /* MOVE FROM dsa_dataout+0x03e0, WHEN DATA_OUT -at 0x0000023a : */ 0x18000000,0x00000808, +at 0x00000238 : */ 0x18000000,0x00000808, /* MOVE FROM dsa_dataout+0x03e8, WHEN DATA_OUT -at 0x0000023c : */ 0x18000000,0x00000810, +at 0x0000023a : */ 0x18000000,0x00000810, /* MOVE FROM dsa_dataout+0x03f0, WHEN DATA_OUT -at 0x0000023e : */ 0x18000000,0x00000818, +at 0x0000023c : */ 0x18000000,0x00000818, /* MOVE FROM dsa_dataout+0x03f8, WHEN DATA_OUT -at 0x00000240 : */ 0x18000000,0x00000820, +at 0x0000023e : */ 0x18000000,0x00000820, /* ENTRY end_data_trans end_data_trans: redo_msgin3: JUMP get_status, WHEN STATUS -at 0x00000242 : */ 0x830b0000,0x000000a0, +at 0x00000240 : */ 0x830b0000,0x00000098, /* JUMP get_msgin3, WHEN MSG_IN -at 0x00000244 : */ 0x870b0000,0x00000b20, +at 0x00000242 : */ 0x870b0000,0x00000b78, /* INT int_data_bad_phase -at 0x00000246 : */ 0x98080000,0xab93000b, +at 0x00000244 : */ 0x98080000,0xab93000b, /* get_msgin1: MOVE SCRATCH0 | had_msgin TO SCRATCH0 -at 0x00000248 : */ 0x7a344000,0x00000000, +at 0x00000246 : */ 0x7a344000,0x00000000, /* MOVE 1, msgin_buf, WHEN MSG_IN -at 0x0000024a : */ 0x0f000001,0x00000000, +at 0x00000248 : */ 0x0f000001,0x00000000, /* JUMP ext_msg1, IF 0x01 ; Extended Message -at 0x0000024c : */ 0x800c0001,0x00000968, +at 0x0000024a : */ 0x800c0001,0x00000960, /* JUMP ignore_msg1, IF 0x02 ; Save Data Pointers -at 0x0000024e : */ 0x800c0002,0x00000958, +at 0x0000024c : */ 0x800c0002,0x00000950, /* JUMP ignore_msg1, IF 0x03 ; Save Restore Pointers -at 0x00000250 : */ 0x800c0003,0x00000958, +at 0x0000024e : */ 0x800c0003,0x00000950, /* JUMP disc1, IF 0x04 ; Disconnect -at 0x00000252 : */ 0x800c0004,0x000009c8, +at 0x00000250 : */ 0x800c0004,0x000009f0, /* INT int_bad_msg1 -at 0x00000254 : */ 0x98080000,0xab930006, +at 0x00000252 : */ 0x98080000,0xab930006, /* ignore_msg1: CLEAR ACK -at 0x00000256 : */ 0x60000040,0x00000000, +at 0x00000254 : */ 0x60000040,0x00000000, /* JUMP redo_msgin1 -at 0x00000258 : */ 0x80080000,0x00000058, +at 0x00000256 : */ 0x80080000,0x00000050, /* ext_msg1: MOVE SCRATCH0 | had_extmsg TO SCRATCH0 -at 0x0000025a : */ 0x7a348000,0x00000000, +at 0x00000258 : */ 0x7a348000,0x00000000, /* CLEAR ACK -at 0x0000025c : */ 0x60000040,0x00000000, +at 0x0000025a : */ 0x60000040,0x00000000, /* MOVE 1, msgin_buf + 1, WHEN MSG_IN -at 0x0000025e : */ 0x0f000001,0x00000001, +at 0x0000025c : */ 0x0f000001,0x00000001, /* - JUMP ext_msg1a, IF 0x03 + JUMP reject_msg1, IF NOT 0x03 ; Only handle SDTR -at 0x00000260 : */ 0x800c0003,0x00000990, +at 0x0000025e : */ 0x80040003,0x000009b0, /* - INT int_bad_extmsg1a + CLEAR ACK -at 0x00000262 : */ 0x98080000,0xab930000, +at 0x00000260 : */ 0x60000040,0x00000000, +/* + MOVE 1, msgin_buf + 2, WHEN MSG_IN + +at 0x00000262 : */ 0x0f000001,0x00000002, +/* + JUMP reject_msg1, IF NOT 0x01 ; Only handle SDTR + +at 0x00000264 : */ 0x80040001,0x000009b0, /* -ext_msg1a: CLEAR ACK -at 0x00000264 : */ 0x60000040,0x00000000, +at 0x00000266 : */ 0x60000040,0x00000000, /* - MOVE 1, msgin_buf + 2, WHEN MSG_IN + MOVE 2, msgin_buf + 3, WHEN MSG_IN -at 0x00000266 : */ 0x0f000001,0x00000002, +at 0x00000268 : */ 0x0f000002,0x00000003, /* - JUMP ext_msg1b, IF 0x01 ; Must be SDTR + INT int_msg_sdtr1 + +at 0x0000026a : */ 0x98080000,0xab93000c, +/* +reject_msg1: + MOVE SCRATCH1 | did_reject TO SCRATCH1 -at 0x00000268 : */ 0x800c0001,0x000009b0, +at 0x0000026c : */ 0x7a350100,0x00000000, /* - INT int_bad_extmsg1b + SET ATN -at 0x0000026a : */ 0x98080000,0xab930001, +at 0x0000026e : */ 0x58000008,0x00000000, /* -ext_msg1b: CLEAR ACK -at 0x0000026c : */ 0x60000040,0x00000000, +at 0x00000270 : */ 0x60000040,0x00000000, /* - MOVE 2, msgin_buf + 3, WHEN MSG_IN + JUMP reject_msg1a, WHEN NOT MSG_IN -at 0x0000026e : */ 0x0f000002,0x00000003, +at 0x00000272 : */ 0x87030000,0x000009e0, /* - INT int_msg_sdtr1 + MOVE 1, msgin_buf + 7, WHEN MSG_IN -at 0x00000270 : */ 0x98080000,0xab93000c, +at 0x00000274 : */ 0x0f000001,0x00000007, +/* + JUMP reject_msg1 + +at 0x00000276 : */ 0x80080000,0x000009b0, +/* +reject_msg1a: + MOVE 1, msg_reject, WHEN MSG_OUT + +at 0x00000278 : */ 0x0e000001,0x00000000, +/* + JUMP redo_msgin1 + +at 0x0000027a : */ 0x80080000,0x00000050, /* disc1: CLEAR ACK -at 0x00000272 : */ 0x60000040,0x00000000, +at 0x0000027c : */ 0x60000040,0x00000000, /* ENTRY wait_disc1 wait_disc1: WAIT DISCONNECT -at 0x00000274 : */ 0x48000000,0x00000000, +at 0x0000027e : */ 0x48000000,0x00000000, /* INT int_disc1 -at 0x00000276 : */ 0x98080000,0xab930019, +at 0x00000280 : */ 0x98080000,0xab930019, /* ENTRY resume_msgin1a resume_msgin1a: CLEAR ACK -at 0x00000278 : */ 0x60000040,0x00000000, +at 0x00000282 : */ 0x60000040,0x00000000, /* JUMP redo_msgin1 -at 0x0000027a : */ 0x80080000,0x00000058, +at 0x00000284 : */ 0x80080000,0x00000050, /* ENTRY resume_msgin1b resume_msgin1b: SET ATN -at 0x0000027c : */ 0x58000008,0x00000000, +at 0x00000286 : */ 0x58000008,0x00000000, /* CLEAR ACK -at 0x0000027e : */ 0x60000040,0x00000000, +at 0x00000288 : */ 0x60000040,0x00000000, /* INT int_no_msgout1, WHEN NOT MSG_OUT -at 0x00000280 : */ 0x9e030000,0xab93000f, +at 0x0000028a : */ 0x9e030000,0xab93000f, /* MOVE SCRATCH0 | had_msgout TO SCRATCH0 -at 0x00000282 : */ 0x7a340200,0x00000000, +at 0x0000028c : */ 0x7a340200,0x00000000, /* MOVE FROM dsa_msgout, when MSG_OUT -at 0x00000284 : */ 0x1e000000,0x00000008, +at 0x0000028e : */ 0x1e000000,0x00000008, /* JUMP redo_msgin1 -at 0x00000286 : */ 0x80080000,0x00000058, +at 0x00000290 : */ 0x80080000,0x00000050, /* get_msgin2: MOVE SCRATCH0 | had_msgin TO SCRATCH0 -at 0x00000288 : */ 0x7a344000,0x00000000, +at 0x00000292 : */ 0x7a344000,0x00000000, /* MOVE 1, msgin_buf, WHEN MSG_IN -at 0x0000028a : */ 0x0f000001,0x00000000, +at 0x00000294 : */ 0x0f000001,0x00000000, /* JUMP ext_msg2, IF 0x01 ; Extended Message -at 0x0000028c : */ 0x800c0001,0x00000a68, +at 0x00000296 : */ 0x800c0001,0x00000a90, /* JUMP ignore_msg2, IF 0x02 ; Save Data Pointers -at 0x0000028e : */ 0x800c0002,0x00000a58, +at 0x00000298 : */ 0x800c0002,0x00000a80, /* JUMP ignore_msg2, IF 0x03 ; Save Restore Pointers -at 0x00000290 : */ 0x800c0003,0x00000a58, +at 0x0000029a : */ 0x800c0003,0x00000a80, /* JUMP disc2, IF 0x04 ; Disconnect -at 0x00000292 : */ 0x800c0004,0x00000ac8, +at 0x0000029c : */ 0x800c0004,0x00000b20, /* INT int_bad_msg2 -at 0x00000294 : */ 0x98080000,0xab930007, +at 0x0000029e : */ 0x98080000,0xab930007, /* ignore_msg2: CLEAR ACK -at 0x00000296 : */ 0x60000040,0x00000000, +at 0x000002a0 : */ 0x60000040,0x00000000, /* JUMP redo_msgin2 -at 0x00000298 : */ 0x80080000,0x00000078, +at 0x000002a2 : */ 0x80080000,0x00000070, /* ext_msg2: MOVE SCRATCH0 | had_extmsg TO SCRATCH0 -at 0x0000029a : */ 0x7a348000,0x00000000, +at 0x000002a4 : */ 0x7a348000,0x00000000, /* CLEAR ACK -at 0x0000029c : */ 0x60000040,0x00000000, +at 0x000002a6 : */ 0x60000040,0x00000000, /* MOVE 1, msgin_buf + 1, WHEN MSG_IN -at 0x0000029e : */ 0x0f000001,0x00000001, +at 0x000002a8 : */ 0x0f000001,0x00000001, +/* + JUMP reject_msg2, IF NOT 0x03 ; Only handle SDTR + +at 0x000002aa : */ 0x80040003,0x00000ae0, +/* + CLEAR ACK + +at 0x000002ac : */ 0x60000040,0x00000000, /* - JUMP ext_msg2a, IF 0x03 + MOVE 1, msgin_buf + 2, WHEN MSG_IN -at 0x000002a0 : */ 0x800c0003,0x00000a90, +at 0x000002ae : */ 0x0f000001,0x00000002, /* - INT int_bad_extmsg2a + JUMP reject_msg2, IF NOT 0x01 ; Only handle SDTR -at 0x000002a2 : */ 0x98080000,0xab930002, +at 0x000002b0 : */ 0x80040001,0x00000ae0, /* -ext_msg2a: CLEAR ACK -at 0x000002a4 : */ 0x60000040,0x00000000, +at 0x000002b2 : */ 0x60000040,0x00000000, /* - MOVE 1, msgin_buf + 2, WHEN MSG_IN + MOVE 2, msgin_buf + 3, WHEN MSG_IN + +at 0x000002b4 : */ 0x0f000002,0x00000003, +/* + INT int_msg_sdtr2 -at 0x000002a6 : */ 0x0f000001,0x00000002, +at 0x000002b6 : */ 0x98080000,0xab93000d, /* - JUMP ext_msg2b, IF 0x01 ; Must be SDTR +reject_msg2: + MOVE SCRATCH1 | did_reject TO SCRATCH1 -at 0x000002a8 : */ 0x800c0001,0x00000ab0, +at 0x000002b8 : */ 0x7a350100,0x00000000, /* - INT int_bad_extmsg2b + SET ATN -at 0x000002aa : */ 0x98080000,0xab930003, +at 0x000002ba : */ 0x58000008,0x00000000, /* -ext_msg2b: CLEAR ACK -at 0x000002ac : */ 0x60000040,0x00000000, +at 0x000002bc : */ 0x60000040,0x00000000, /* - MOVE 2, msgin_buf + 3, WHEN MSG_IN + JUMP reject_msg2a, WHEN NOT MSG_IN -at 0x000002ae : */ 0x0f000002,0x00000003, +at 0x000002be : */ 0x87030000,0x00000b10, /* - INT int_msg_sdtr2 + MOVE 1, msgin_buf + 7, WHEN MSG_IN + +at 0x000002c0 : */ 0x0f000001,0x00000007, +/* + JUMP reject_msg2 + +at 0x000002c2 : */ 0x80080000,0x00000ae0, +/* +reject_msg2a: + MOVE 1, msg_reject, WHEN MSG_OUT + +at 0x000002c4 : */ 0x0e000001,0x00000000, +/* + JUMP redo_msgin2 -at 0x000002b0 : */ 0x98080000,0xab93000d, +at 0x000002c6 : */ 0x80080000,0x00000070, /* disc2: CLEAR ACK -at 0x000002b2 : */ 0x60000040,0x00000000, +at 0x000002c8 : */ 0x60000040,0x00000000, /* ENTRY wait_disc2 wait_disc2: WAIT DISCONNECT -at 0x000002b4 : */ 0x48000000,0x00000000, +at 0x000002ca : */ 0x48000000,0x00000000, /* INT int_disc2 -at 0x000002b6 : */ 0x98080000,0xab93001a, +at 0x000002cc : */ 0x98080000,0xab93001a, /* ENTRY resume_msgin2a resume_msgin2a: CLEAR ACK -at 0x000002b8 : */ 0x60000040,0x00000000, +at 0x000002ce : */ 0x60000040,0x00000000, /* JUMP redo_msgin2 -at 0x000002ba : */ 0x80080000,0x00000078, +at 0x000002d0 : */ 0x80080000,0x00000070, /* ENTRY resume_msgin2b resume_msgin2b: SET ATN -at 0x000002bc : */ 0x58000008,0x00000000, +at 0x000002d2 : */ 0x58000008,0x00000000, /* CLEAR ACK -at 0x000002be : */ 0x60000040,0x00000000, +at 0x000002d4 : */ 0x60000040,0x00000000, /* INT int_no_msgout2, WHEN NOT MSG_OUT -at 0x000002c0 : */ 0x9e030000,0xab930010, +at 0x000002d6 : */ 0x9e030000,0xab930010, /* MOVE SCRATCH0 | had_msgout TO SCRATCH0 -at 0x000002c2 : */ 0x7a340200,0x00000000, +at 0x000002d8 : */ 0x7a340200,0x00000000, /* MOVE FROM dsa_msgout, when MSG_OUT -at 0x000002c4 : */ 0x1e000000,0x00000008, +at 0x000002da : */ 0x1e000000,0x00000008, /* JUMP redo_msgin2 -at 0x000002c6 : */ 0x80080000,0x00000078, +at 0x000002dc : */ 0x80080000,0x00000070, /* get_msgin3: MOVE SCRATCH0 | had_msgin TO SCRATCH0 -at 0x000002c8 : */ 0x7a344000,0x00000000, +at 0x000002de : */ 0x7a344000,0x00000000, /* MOVE 1, msgin_buf, WHEN MSG_IN -at 0x000002ca : */ 0x0f000001,0x00000000, +at 0x000002e0 : */ 0x0f000001,0x00000000, /* JUMP ext_msg3, IF 0x01 ; Extended Message -at 0x000002cc : */ 0x800c0001,0x00000b68, +at 0x000002e2 : */ 0x800c0001,0x00000bc0, /* JUMP ignore_msg3, IF 0x02 ; Save Data Pointers -at 0x000002ce : */ 0x800c0002,0x00000b58, +at 0x000002e4 : */ 0x800c0002,0x00000bb0, /* JUMP ignore_msg3, IF 0x03 ; Save Restore Pointers -at 0x000002d0 : */ 0x800c0003,0x00000b58, +at 0x000002e6 : */ 0x800c0003,0x00000bb0, /* JUMP disc3, IF 0x04 ; Disconnect -at 0x000002d2 : */ 0x800c0004,0x00000bc8, +at 0x000002e8 : */ 0x800c0004,0x00000c50, /* INT int_bad_msg3 -at 0x000002d4 : */ 0x98080000,0xab930008, +at 0x000002ea : */ 0x98080000,0xab930008, /* ignore_msg3: CLEAR ACK -at 0x000002d6 : */ 0x60000040,0x00000000, +at 0x000002ec : */ 0x60000040,0x00000000, /* JUMP redo_msgin3 -at 0x000002d8 : */ 0x80080000,0x00000908, +at 0x000002ee : */ 0x80080000,0x00000900, /* ext_msg3: MOVE SCRATCH0 | had_extmsg TO SCRATCH0 -at 0x000002da : */ 0x7a348000,0x00000000, +at 0x000002f0 : */ 0x7a348000,0x00000000, /* CLEAR ACK -at 0x000002dc : */ 0x60000040,0x00000000, +at 0x000002f2 : */ 0x60000040,0x00000000, /* MOVE 1, msgin_buf + 1, WHEN MSG_IN -at 0x000002de : */ 0x0f000001,0x00000001, +at 0x000002f4 : */ 0x0f000001,0x00000001, /* - JUMP ext_msg3a, IF 0x03 + JUMP reject_msg3, IF NOT 0x03 ; Only handle SDTR -at 0x000002e0 : */ 0x800c0003,0x00000b90, +at 0x000002f6 : */ 0x80040003,0x00000c10, /* - INT int_bad_extmsg3a + CLEAR ACK -at 0x000002e2 : */ 0x98080000,0xab930004, +at 0x000002f8 : */ 0x60000040,0x00000000, +/* + MOVE 1, msgin_buf + 2, WHEN MSG_IN + +at 0x000002fa : */ 0x0f000001,0x00000002, +/* + JUMP reject_msg3, IF NOT 0x01 ; Only handle SDTR + +at 0x000002fc : */ 0x80040001,0x00000c10, /* -ext_msg3a: CLEAR ACK -at 0x000002e4 : */ 0x60000040,0x00000000, +at 0x000002fe : */ 0x60000040,0x00000000, /* - MOVE 1, msgin_buf + 2, WHEN MSG_IN + MOVE 2, msgin_buf + 3, WHEN MSG_IN + +at 0x00000300 : */ 0x0f000002,0x00000003, +/* + INT int_msg_sdtr3 -at 0x000002e6 : */ 0x0f000001,0x00000002, +at 0x00000302 : */ 0x98080000,0xab93000e, /* - JUMP ext_msg3b, IF 0x01 ; Must be SDTR +reject_msg3: + MOVE SCRATCH1 | did_reject TO SCRATCH1 -at 0x000002e8 : */ 0x800c0001,0x00000bb0, +at 0x00000304 : */ 0x7a350100,0x00000000, /* - INT int_bad_extmsg3b + SET ATN -at 0x000002ea : */ 0x98080000,0xab930005, +at 0x00000306 : */ 0x58000008,0x00000000, /* -ext_msg3b: CLEAR ACK -at 0x000002ec : */ 0x60000040,0x00000000, +at 0x00000308 : */ 0x60000040,0x00000000, /* - MOVE 2, msgin_buf + 3, WHEN MSG_IN + JUMP reject_msg3a, WHEN NOT MSG_IN -at 0x000002ee : */ 0x0f000002,0x00000003, +at 0x0000030a : */ 0x87030000,0x00000c40, /* - INT int_msg_sdtr3 + MOVE 1, msgin_buf + 7, WHEN MSG_IN + +at 0x0000030c : */ 0x0f000001,0x00000007, +/* + JUMP reject_msg3 + +at 0x0000030e : */ 0x80080000,0x00000c10, +/* +reject_msg3a: + MOVE 1, msg_reject, WHEN MSG_OUT -at 0x000002f0 : */ 0x98080000,0xab93000e, +at 0x00000310 : */ 0x0e000001,0x00000000, +/* + JUMP redo_msgin3 + +at 0x00000312 : */ 0x80080000,0x00000900, /* disc3: CLEAR ACK -at 0x000002f2 : */ 0x60000040,0x00000000, +at 0x00000314 : */ 0x60000040,0x00000000, /* ENTRY wait_disc3 wait_disc3: WAIT DISCONNECT -at 0x000002f4 : */ 0x48000000,0x00000000, +at 0x00000316 : */ 0x48000000,0x00000000, /* INT int_disc3 -at 0x000002f6 : */ 0x98080000,0xab93001b, +at 0x00000318 : */ 0x98080000,0xab93001b, /* ENTRY resume_msgin3a resume_msgin3a: CLEAR ACK -at 0x000002f8 : */ 0x60000040,0x00000000, +at 0x0000031a : */ 0x60000040,0x00000000, /* JUMP redo_msgin3 -at 0x000002fa : */ 0x80080000,0x00000908, +at 0x0000031c : */ 0x80080000,0x00000900, /* ENTRY resume_msgin3b resume_msgin3b: SET ATN -at 0x000002fc : */ 0x58000008,0x00000000, +at 0x0000031e : */ 0x58000008,0x00000000, /* CLEAR ACK -at 0x000002fe : */ 0x60000040,0x00000000, +at 0x00000320 : */ 0x60000040,0x00000000, /* INT int_no_msgout3, WHEN NOT MSG_OUT -at 0x00000300 : */ 0x9e030000,0xab930011, +at 0x00000322 : */ 0x9e030000,0xab930011, /* MOVE SCRATCH0 | had_msgout TO SCRATCH0 -at 0x00000302 : */ 0x7a340200,0x00000000, +at 0x00000324 : */ 0x7a340200,0x00000000, /* MOVE FROM dsa_msgout, when MSG_OUT -at 0x00000304 : */ 0x1e000000,0x00000008, +at 0x00000326 : */ 0x1e000000,0x00000008, /* JUMP redo_msgin3 -at 0x00000306 : */ 0x80080000,0x00000908, +at 0x00000328 : */ 0x80080000,0x00000900, /* ENTRY resume_rej_ident resume_rej_ident: CLEAR ATN -at 0x00000308 : */ 0x60000008,0x00000000, +at 0x0000032a : */ 0x60000008,0x00000000, /* MOVE 1, msgin_buf, WHEN MSG_IN -at 0x0000030a : */ 0x0f000001,0x00000000, +at 0x0000032c : */ 0x0f000001,0x00000000, /* INT int_not_rej, IF NOT 0x07 ; Reject -at 0x0000030c : */ 0x98040007,0xab93001c, +at 0x0000032e : */ 0x98040007,0xab93001c, /* CLEAR ACK -at 0x0000030e : */ 0x60000040,0x00000000, +at 0x00000330 : */ 0x60000040,0x00000000, /* JUMP done_ident -at 0x00000310 : */ 0x80080000,0x00000050, +at 0x00000332 : */ 0x80080000,0x00000048, /* ENTRY reselect @@ -1716,73 +1784,92 @@ ; Disable selection timer MOVE CTEST7 | 0x10 TO CTEST7 -at 0x00000312 : */ 0x7a1b1000,0x00000000, +at 0x00000334 : */ 0x7a1b1000,0x00000000, /* WAIT RESELECT resel_err -at 0x00000314 : */ 0x50000000,0x00000c70, +at 0x00000336 : */ 0x50000000,0x00000cf8, /* INT int_resel_not_msgin, WHEN NOT MSG_IN -at 0x00000316 : */ 0x9f030000,0xab930016, +at 0x00000338 : */ 0x9f030000,0xab930016, /* MOVE 1, reselected_identify, WHEN MSG_IN -at 0x00000318 : */ 0x0f000001,0x00000000, +at 0x0000033a : */ 0x0f000001,0x00000000, /* INT int_reselected -at 0x0000031a : */ 0x98080000,0xab930017, +at 0x0000033c : */ 0x98080000,0xab930017, /* resel_err: MOVE CTEST2 & 0x40 TO SFBR -at 0x0000031c : */ 0x74164000,0x00000000, +at 0x0000033e : */ 0x74164000,0x00000000, /* JUMP selected, IF 0x00 -at 0x0000031e : */ 0x800c0000,0x00000cb0, +at 0x00000340 : */ 0x800c0000,0x00000d38, /* MOVE SFBR & 0 TO SFBR -at 0x00000320 : */ 0x7c080000,0x00000000, +at 0x00000342 : */ 0x7c080000,0x00000000, /* ENTRY patch_new_dsa patch_new_dsa: MOVE SFBR | 0x11 TO DSA0 -at 0x00000322 : */ 0x6a101100,0x00000000, +at 0x00000344 : */ 0x6a101100,0x00000000, /* MOVE SFBR | 0x22 TO DSA1 -at 0x00000324 : */ 0x6a112200,0x00000000, +at 0x00000346 : */ 0x6a112200,0x00000000, /* MOVE SFBR | 0x33 TO DSA2 -at 0x00000326 : */ 0x6a123300,0x00000000, +at 0x00000348 : */ 0x6a123300,0x00000000, /* MOVE SFBR | 0x44 TO DSA3 -at 0x00000328 : */ 0x6a134400,0x00000000, +at 0x0000034a : */ 0x6a134400,0x00000000, /* JUMP do_select -at 0x0000032a : */ 0x80080000,0x00000000, +at 0x0000034c : */ 0x80080000,0x00000000, /* selected: INT int_selected -at 0x0000032c : */ 0x98080000,0xab930018, +at 0x0000034e : */ 0x98080000,0xab930018, +/* + +ENTRY test1 +test1: + MOVE MEMORY 4, test1_src, test1_dst + +at 0x00000350 : */ 0xc0000004,0x00000000,0x00000000, +/* + INT int_test1 + +at 0x00000353 : */ 0x98080000,0xab93001d, +}; + +#define A_did_reject 0x00000001 +static u32 A_did_reject_used[] __attribute((unused)) = { + 0x0000026c, + 0x000002b8, + 0x00000304, }; #define A_dsa_cmnd 0x00000010 static u32 A_dsa_cmnd_used[] __attribute((unused)) = { - 0x0000001d, + 0x0000001b, }; #define A_dsa_datain 0x00000028 static u32 A_dsa_datain_used[] __attribute((unused)) = { + 0x0000003b, 0x0000003d, 0x0000003f, 0x00000041, @@ -1910,11 +1997,11 @@ 0x00000135, 0x00000137, 0x00000139, - 0x0000013b, }; #define A_dsa_dataout 0x00000428 static u32 A_dsa_dataout_used[] __attribute((unused)) = { + 0x00000141, 0x00000143, 0x00000145, 0x00000147, @@ -2042,25 +2129,24 @@ 0x0000023b, 0x0000023d, 0x0000023f, - 0x00000241, }; #define A_dsa_msgin 0x00000020 static u32 A_dsa_msgin_used[] __attribute((unused)) = { - 0x0000002f, + 0x0000002d, }; #define A_dsa_msgout 0x00000008 static u32 A_dsa_msgout_used[] __attribute((unused)) = { - 0x00000013, - 0x00000285, - 0x000002c5, - 0x00000305, + 0x00000011, + 0x0000028f, + 0x000002db, + 0x00000327, }; #define A_dsa_select 0x00000000 static u32 A_dsa_select_used[] __attribute((unused)) = { - 0x00000006, + 0x00000004, }; #define A_dsa_size 0x00000828 @@ -2069,285 +2155,290 @@ #define A_dsa_status 0x00000018 static u32 A_dsa_status_used[] __attribute((unused)) = { - 0x0000002b, + 0x00000029, }; #define A_had_cmdout 0x00000004 static u32 A_had_cmdout_used[] __attribute((unused)) = { - 0x0000001a, + 0x00000018, }; #define A_had_datain 0x00000008 static u32 A_had_datain_used[] __attribute((unused)) = { - 0x00000038, + 0x00000036, }; #define A_had_dataout 0x00000010 static u32 A_had_dataout_used[] __attribute((unused)) = { - 0x0000013e, + 0x0000013c, }; #define A_had_extmsg 0x00000080 static u32 A_had_extmsg_used[] __attribute((unused)) = { - 0x0000025a, - 0x0000029a, - 0x000002da, + 0x00000258, + 0x000002a4, + 0x000002f0, }; #define A_had_msgin 0x00000040 static u32 A_had_msgin_used[] __attribute((unused)) = { - 0x00000248, - 0x00000288, - 0x000002c8, + 0x00000246, + 0x00000292, + 0x000002de, }; #define A_had_msgout 0x00000002 static u32 A_had_msgout_used[] __attribute((unused)) = { - 0x00000010, - 0x00000282, - 0x000002c2, - 0x00000302, + 0x0000000e, + 0x0000028c, + 0x000002d8, + 0x00000324, }; #define A_had_select 0x00000001 static u32 A_had_select_used[] __attribute((unused)) = { - 0x0000000c, + 0x0000000a, }; #define A_had_status 0x00000020 static u32 A_had_status_used[] __attribute((unused)) = { }; -#define A_int_bad_extmsg1a 0xab930000 -static u32 A_int_bad_extmsg1a_used[] __attribute((unused)) = { - 0x00000263, -}; - -#define A_int_bad_extmsg1b 0xab930001 -static u32 A_int_bad_extmsg1b_used[] __attribute((unused)) = { - 0x0000026b, -}; - -#define A_int_bad_extmsg2a 0xab930002 -static u32 A_int_bad_extmsg2a_used[] __attribute((unused)) = { - 0x000002a3, -}; - -#define A_int_bad_extmsg2b 0xab930003 -static u32 A_int_bad_extmsg2b_used[] __attribute((unused)) = { - 0x000002ab, -}; - -#define A_int_bad_extmsg3a 0xab930004 -static u32 A_int_bad_extmsg3a_used[] __attribute((unused)) = { - 0x000002e3, -}; - -#define A_int_bad_extmsg3b 0xab930005 -static u32 A_int_bad_extmsg3b_used[] __attribute((unused)) = { - 0x000002eb, -}; - #define A_int_bad_msg1 0xab930006 static u32 A_int_bad_msg1_used[] __attribute((unused)) = { - 0x00000255, + 0x00000253, }; #define A_int_bad_msg2 0xab930007 static u32 A_int_bad_msg2_used[] __attribute((unused)) = { - 0x00000295, + 0x0000029f, }; #define A_int_bad_msg3 0xab930008 static u32 A_int_bad_msg3_used[] __attribute((unused)) = { - 0x000002d5, + 0x000002eb, }; #define A_int_cmd_bad_phase 0xab930009 static u32 A_int_cmd_bad_phase_used[] __attribute((unused)) = { - 0x00000027, + 0x00000025, }; #define A_int_cmd_complete 0xab93000a static u32 A_int_cmd_complete_used[] __attribute((unused)) = { - 0x00000037, + 0x00000035, }; #define A_int_data_bad_phase 0xab93000b static u32 A_int_data_bad_phase_used[] __attribute((unused)) = { - 0x00000247, + 0x00000245, }; #define A_int_disc1 0xab930019 static u32 A_int_disc1_used[] __attribute((unused)) = { - 0x00000277, + 0x00000281, }; #define A_int_disc2 0xab93001a static u32 A_int_disc2_used[] __attribute((unused)) = { - 0x000002b7, + 0x000002cd, }; #define A_int_disc3 0xab93001b static u32 A_int_disc3_used[] __attribute((unused)) = { - 0x000002f7, + 0x00000319, }; #define A_int_msg_sdtr1 0xab93000c static u32 A_int_msg_sdtr1_used[] __attribute((unused)) = { - 0x00000271, + 0x0000026b, }; #define A_int_msg_sdtr2 0xab93000d static u32 A_int_msg_sdtr2_used[] __attribute((unused)) = { - 0x000002b1, + 0x000002b7, }; #define A_int_msg_sdtr3 0xab93000e static u32 A_int_msg_sdtr3_used[] __attribute((unused)) = { - 0x000002f1, + 0x00000303, }; #define A_int_no_msgout1 0xab93000f static u32 A_int_no_msgout1_used[] __attribute((unused)) = { - 0x00000281, + 0x0000028b, }; #define A_int_no_msgout2 0xab930010 static u32 A_int_no_msgout2_used[] __attribute((unused)) = { - 0x000002c1, + 0x000002d7, }; #define A_int_no_msgout3 0xab930011 static u32 A_int_no_msgout3_used[] __attribute((unused)) = { - 0x00000301, + 0x00000323, }; #define A_int_not_cmd_complete 0xab930012 static u32 A_int_not_cmd_complete_used[] __attribute((unused)) = { - 0x00000031, + 0x0000002f, }; #define A_int_not_rej 0xab93001c static u32 A_int_not_rej_used[] __attribute((unused)) = { - 0x0000030d, + 0x0000032f, }; #define A_int_resel_not_msgin 0xab930016 static u32 A_int_resel_not_msgin_used[] __attribute((unused)) = { - 0x00000317, + 0x00000339, }; #define A_int_reselected 0xab930017 static u32 A_int_reselected_used[] __attribute((unused)) = { - 0x0000031b, + 0x0000033d, }; #define A_int_sel_no_ident 0xab930013 static u32 A_int_sel_no_ident_used[] __attribute((unused)) = { - 0x0000000f, + 0x0000000d, }; #define A_int_sel_not_cmd 0xab930014 static u32 A_int_sel_not_cmd_used[] __attribute((unused)) = { - 0x00000019, + 0x00000017, }; #define A_int_selected 0xab930018 static u32 A_int_selected_used[] __attribute((unused)) = { - 0x0000032d, + 0x0000034f, }; #define A_int_status_not_msgin 0xab930015 static u32 A_int_status_not_msgin_used[] __attribute((unused)) = { - 0x0000002d, + 0x0000002b, +}; + +#define A_int_test1 0xab93001d +static u32 A_int_test1_used[] __attribute((unused)) = { + 0x00000354, +}; + +#define A_msg_reject 0x00000000 +static u32 A_msg_reject_used[] __attribute((unused)) = { + 0x00000279, + 0x000002c5, + 0x00000311, }; #define A_msgin_buf 0x00000000 static u32 A_msgin_buf_used[] __attribute((unused)) = { - 0x0000024b, - 0x0000025f, - 0x00000267, - 0x0000026f, - 0x0000028b, - 0x0000029f, - 0x000002a7, + 0x00000249, + 0x0000025d, + 0x00000263, + 0x00000269, + 0x00000275, + 0x00000295, + 0x000002a9, 0x000002af, - 0x000002cb, - 0x000002df, - 0x000002e7, - 0x000002ef, - 0x0000030b, + 0x000002b5, + 0x000002c1, + 0x000002e1, + 0x000002f5, + 0x000002fb, + 0x00000301, + 0x0000030d, + 0x0000032d, }; #define A_reselected_identify 0x00000000 static u32 A_reselected_identify_used[] __attribute((unused)) = { - 0x00000319, + 0x0000033b, +}; + +#define A_test1_dst 0x00000000 +static u32 A_test1_dst_used[] __attribute((unused)) = { + 0x00000352, +}; + +#define A_test1_src 0x00000000 +static u32 A_test1_src_used[] __attribute((unused)) = { + 0x00000351, }; #define Ent_do_select 0x00000000 -#define Ent_done_ident 0x00000050 -#define Ent_end_data_trans 0x00000908 -#define Ent_patch_input_data 0x000000e8 -#define Ent_patch_new_dsa 0x00000c88 -#define Ent_patch_output_data 0x00000500 -#define Ent_reselect 0x00000c48 -#define Ent_resume_cmd 0x00000068 -#define Ent_resume_msgin1a 0x000009e0 -#define Ent_resume_msgin1b 0x000009f0 -#define Ent_resume_msgin2a 0x00000ae0 -#define Ent_resume_msgin2b 0x00000af0 -#define Ent_resume_msgin3a 0x00000be0 -#define Ent_resume_msgin3b 0x00000bf0 -#define Ent_resume_pmm 0x00000078 -#define Ent_resume_rej_ident 0x00000c20 -#define Ent_wait_disc1 0x000009d0 -#define Ent_wait_disc2 0x00000ad0 -#define Ent_wait_disc3 0x00000bd0 -#define Ent_wait_disc_complete 0x000000d0 +#define Ent_done_ident 0x00000048 +#define Ent_end_data_trans 0x00000900 +#define Ent_patch_input_data 0x000000e0 +#define Ent_patch_new_dsa 0x00000d10 +#define Ent_patch_output_data 0x000004f8 +#define Ent_reselect 0x00000cd0 +#define Ent_resume_cmd 0x00000060 +#define Ent_resume_msgin1a 0x00000a08 +#define Ent_resume_msgin1b 0x00000a18 +#define Ent_resume_msgin2a 0x00000b38 +#define Ent_resume_msgin2b 0x00000b48 +#define Ent_resume_msgin3a 0x00000c68 +#define Ent_resume_msgin3b 0x00000c78 +#define Ent_resume_pmm 0x00000070 +#define Ent_resume_rej_ident 0x00000ca8 +#define Ent_test1 0x00000d40 +#define Ent_wait_disc1 0x000009f8 +#define Ent_wait_disc2 0x00000b28 +#define Ent_wait_disc3 0x00000c58 +#define Ent_wait_disc_complete 0x000000c8 static u32 LABELPATCHES[] __attribute((unused)) = { + 0x00000005, 0x00000007, - 0x00000009, + 0x00000013, 0x00000015, - 0x00000017, + 0x0000001d, 0x0000001f, 0x00000021, 0x00000023, - 0x00000025, - 0x0000013d, + 0x0000013b, + 0x00000241, 0x00000243, - 0x00000245, + 0x0000024b, 0x0000024d, 0x0000024f, 0x00000251, - 0x00000253, - 0x00000259, - 0x00000261, - 0x00000269, + 0x00000257, + 0x0000025f, + 0x00000265, + 0x00000273, + 0x00000277, 0x0000027b, - 0x00000287, - 0x0000028d, - 0x0000028f, + 0x00000285, 0x00000291, - 0x00000293, + 0x00000297, 0x00000299, - 0x000002a1, - 0x000002a9, - 0x000002bb, + 0x0000029b, + 0x0000029d, + 0x000002a3, + 0x000002ab, + 0x000002b1, + 0x000002bf, + 0x000002c3, 0x000002c7, - 0x000002cd, - 0x000002cf, 0x000002d1, - 0x000002d3, - 0x000002d9, - 0x000002e1, + 0x000002dd, + 0x000002e3, + 0x000002e5, + 0x000002e7, 0x000002e9, - 0x000002fb, - 0x00000307, - 0x00000311, - 0x00000315, - 0x0000031f, - 0x0000032b, + 0x000002ef, + 0x000002f7, + 0x000002fd, + 0x0000030b, + 0x0000030f, + 0x00000313, + 0x0000031d, + 0x00000329, + 0x00000333, + 0x00000337, + 0x00000341, + 0x0000034d, }; static struct { @@ -2356,6 +2447,6 @@ } EXTERNAL_PATCHES[] __attribute((unused)) = { }; -static u32 INSTRUCTIONS __attribute((unused)) = 407; -static u32 PATCHES __attribute((unused)) = 42; +static u32 INSTRUCTIONS __attribute((unused)) = 426; +static u32 PATCHES __attribute((unused)) = 51; static u32 EXTERNAL_PATCHES_LEN __attribute((unused)) = 0; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/sound/ac97_codec.c linux.20pre5-ac2/drivers/sound/ac97_codec.c --- linux.20pre5/drivers/sound/ac97_codec.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/sound/ac97_codec.c 2002-09-01 17:43:30.000000000 +0100 @@ -654,6 +654,25 @@ } /** + * codec_id - Turn id1/id2 into a PnP string + * @id1: Vendor ID1 + * @id2: Vendor ID2 + * @buf: 7 byte buffer + * + * Fills buf with a zero terminated PnP ident string for the id1/id2 + * pair. For convenience the return is the passed in buffer pointer. + */ + +static char *codec_id(u16 id1, u16 id2, char *buf) +{ + buf[0] = (id1 >> 8); + buf[1] = (id1 & 0xFF); + buf[2] = (id2 >> 8); + snprintf(buf+3, 4, "%d", id2&0xFF); + return buf; +} + +/** * ac97_probe_codec - Initialize and setup AC97-compatible codec * @codec: (in/out) Kernel info for a single AC97 codec * @@ -681,6 +700,7 @@ u16 id1, id2; u16 audio, modem; int i; + char cidbuf[8]; /* probing AC97 codec, AC97 2.0 says that bit 15 of register 0x00 (reset) should * be read zero. @@ -705,7 +725,9 @@ /* probe for Modem Codec */ codec->codec_write(codec, AC97_EXTENDED_MODEM_ID, 0L); - modem = codec->codec_read(codec, AC97_EXTENDED_MODEM_ID); + modem = codec->codec_read(codec, AC97_EXTENDED_MODEM_ID) & 1; + modem |= (audio&2); + audio &= ~2; codec->name = NULL; codec->codec_ops = &null_ops; @@ -722,9 +744,9 @@ } if (codec->name == NULL) codec->name = "Unknown"; - printk(KERN_INFO "ac97_codec: AC97 %s codec, id: 0x%04x:" - "0x%04x (%s)\n", audio ? "Audio" : (modem ? "Modem" : ""), - id1, id2, codec->name); + printk(KERN_INFO "ac97_codec: AC97 %s codec, id: %s(%s)\n", + modem ? "Modem" : (audio ? "Audio" : ""), + codec_id(id1, id2, cidbuf), codec->name); return ac97_init_mixer(codec); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/sound/Config.in linux.20pre5-ac2/drivers/sound/Config.in --- linux.20pre5/drivers/sound/Config.in 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/sound/Config.in 2002-08-29 22:39:49.000000000 +0100 @@ -43,7 +43,11 @@ dep_tristate ' ESS Technology Solo1' CONFIG_SOUND_ESSSOLO1 $CONFIG_SOUND $CONFIG_PCI dep_tristate ' ESS Maestro, Maestro2, Maestro2E driver' CONFIG_SOUND_MAESTRO $CONFIG_SOUND $CONFIG_PCI dep_tristate ' ESS Maestro3/Allegro driver (EXPERIMENTAL)' CONFIG_SOUND_MAESTRO3 $CONFIG_SOUND $CONFIG_PCI $CONFIG_EXPERIMENTAL -dep_tristate ' Intel ICH (i8xx), SiS 7012, NVidia nForce Audio or AMD 768' CONFIG_SOUND_ICH $CONFIG_PCI +dep_tristate ' ForteMedia FM801 driver (EXPERIMENTAL)' CONFIG_SOUND_FORTE $CONFIG_SOUND $CONFIG_PCI $CONFIG_EXPERIMENTAL +dep_tristate ' Intel ICH (i8xx), SiS 7012, NVidia nForce Audio or AMD 768/811x' CONFIG_SOUND_ICH $CONFIG_PCI +if [ "$CONFIG_GSC_LASI" = "y" ]; then + dep_tristate ' PA Harmony audio driver' CONFIG_SOUND_HARMONY $CONFIG_SOUND +fi if [ "$CONFIG_MIPS_ITE8172" = "y" -o "$CONFIG_MIPS_IVR" = "y" ]; then dep_tristate ' IT8172G Sound' CONFIG_SOUND_IT8172 $CONFIG_SOUND fi diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/sound/forte.c linux.20pre5-ac2/drivers/sound/forte.c --- linux.20pre5/drivers/sound/forte.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/sound/forte.c 2002-08-29 22:40:23.000000000 +0100 @@ -0,0 +1,1967 @@ +/* + * forte.c - ForteMedia FM801 OSS Driver + * + * Written by Martin K. Petersen + * Copyright (C) 2002 Hewlett-Packard Company + * + * Based upon the ALSA FM801 driver by Jaroslav Kysela and OSS drivers + * by Thomas Sailer, Alan Cox, Zach Brown, and Jeff Garzik. Thanks + * guys! + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version + * 2 as published by the 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 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA + * + */ + +/* + * TODO: + * MMIO + * Multichannelize + * Multichipify + * MPU401 + * M^Gameport + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#define DRIVER_NAME "forte" +#define DRIVER_VERSION "$Id: forte.c,v 1.51 2002/08/26 18:10:41 mkp Exp $" +#define PFX DRIVER_NAME ": " + +#undef M_DEBUG + +#ifdef M_DEBUG +#define DPRINTK(args...) printk(KERN_WARNING args) +#else +#define DPRINTK(args...) +#endif + +/* Card capabilities */ +#define FORTE_CAPS (DSP_CAP_MMAP | DSP_CAP_TRIGGER) + +/* Supported audio formats */ +#define FORTE_FMTS (AFMT_U8 | AFMT_S16_LE) + +/* Buffers */ +#define FORTE_MIN_FRAG_SIZE 256 +#define FORTE_MAX_FRAG_SIZE PAGE_SIZE +#define FORTE_DEF_FRAG_SIZE 256 +#define FORTE_MIN_FRAGMENTS 16 +#define FORTE_MAX_FRAGMENTS 256 +#define FORTE_DEF_FRAGMENTS 16 +#define FORTE_MIN_BUF 16386 + +/* PCI BARs */ +#define FORTE_PCM_VOL 0x00 /* PCM Output Volume */ +#define FORTE_FM_VOL 0x02 /* FM Output Volume */ +#define FORTE_I2S_VOL 0x04 /* I2S Volume */ +#define FORTE_REC_SRC 0x06 /* Record Source */ +#define FORTE_PLY_CTRL 0x08 /* Playback Control */ +#define FORTE_PLY_COUNT 0x0a /* Playback Count */ +#define FORTE_PLY_BUF1 0x0c /* Playback Buffer I */ +#define FORTE_PLY_BUF2 0x10 /* Playback Buffer II */ +#define FORTE_CAP_CTRL 0x14 /* Capture Control */ +#define FORTE_CAP_COUNT 0x16 /* Capture Count */ +#define FORTE_CAP_BUF1 0x18 /* Capture Buffer I */ +#define FORTE_CAP_BUF2 0x1c /* Capture Buffer II */ +#define FORTE_CODEC_CTRL 0x22 /* Codec Control */ +#define FORTE_I2S_MODE 0x24 /* I2S Mode Control */ +#define FORTE_VOLUME 0x26 /* Volume Up/Down/Mute Status */ +#define FORTE_I2C_CTRL 0x29 /* I2C Control */ +#define FORTE_AC97_CMD 0x2a /* AC'97 Command */ +#define FORTE_AC97_DATA 0x2c /* AC'97 Data */ +#define FORTE_MPU401_DATA 0x30 /* MPU401 Data */ +#define FORTE_MPU401_CMD 0x31 /* MPU401 Command */ +#define FORTE_GPIO_CTRL 0x52 /* General Purpose I/O Control */ +#define FORTE_GEN_CTRL 0x54 /* General Control */ +#define FORTE_IRQ_MASK 0x56 /* Interrupt Mask */ +#define FORTE_IRQ_STATUS 0x5a /* Interrupt Status */ +#define FORTE_OPL3_BANK0 0x68 /* OPL3 Status Read / Bank 0 Write */ +#define FORTE_OPL3_DATA0 0x69 /* OPL3 Data 0 Write */ +#define FORTE_OPL3_BANK1 0x6a /* OPL3 Bank 1 Write */ +#define FORTE_OPL3_DATA1 0x6b /* OPL3 Bank 1 Write */ +#define FORTE_POWERDOWN 0x70 /* Blocks Power Down Control */ + +#define FORTE_CAP_OFFSET FORTE_CAP_CTRL - FORTE_PLY_CTRL + +#define FORTE_AC97_ADDR_SHIFT 10 + +/* Playback and record control register bits */ +#define FORTE_BUF1_LAST (1<<1) +#define FORTE_BUF2_LAST (1<<2) +#define FORTE_START (1<<5) +#define FORTE_PAUSE (1<<6) +#define FORTE_IMMED_STOP (1<<7) +#define FORTE_RATE_SHIFT 8 +#define FORTE_RATE_MASK (15 << FORTE_RATE_SHIFT) +#define FORTE_CHANNELS_4 (1<<12) /* Playback only */ +#define FORTE_CHANNELS_6 (2<<12) /* Playback only */ +#define FORTE_CHANNELS_6MS (3<<12) /* Playback only */ +#define FORTE_CHANNELS_MASK (3<<12) +#define FORTE_16BIT (1<<14) +#define FORTE_STEREO (1<<15) + +/* IRQ status bits */ +#define FORTE_IRQ_PLAYBACK (1<<8) +#define FORTE_IRQ_CAPTURE (1<<9) +#define FORTE_IRQ_VOLUME (1<<14) +#define FORTE_IRQ_MPU (1<<15) + +/* CODEC control */ +#define FORTE_CC_CODEC_RESET (1<<5) +#define FORTE_CC_AC97_RESET (1<<6) + +/* AC97 cmd */ +#define FORTE_AC97_WRITE (0<<7) +#define FORTE_AC97_READ (1<<7) +#define FORTE_AC97_DP_INVALID (0<<8) +#define FORTE_AC97_DP_VALID (1<<8) +#define FORTE_AC97_PORT_RDY (0<<9) +#define FORTE_AC97_PORT_BSY (1<<9) + + +struct forte_channel { + const char *name; + + unsigned short ctrl; /* Ctrl BAR contents */ + unsigned long iobase; /* Ctrl BAR address */ + + wait_queue_head_t wait; + + void *buf; /* Buffer */ + dma_addr_t buf_handle; /* Buffer handle */ + + unsigned int record; + unsigned int format; + unsigned int rate; + unsigned int stereo; + + unsigned int frag_sz; /* Current fragment size */ + unsigned int frag_num; /* Current # of fragments */ + unsigned int buf_sz; /* Current buffer size */ + + unsigned int hwptr; /* Tail */ + unsigned int swptr; /* Head */ + unsigned int filled_frags; /* Fragments currently full */ + unsigned int next_buf; /* Index of next buffer */ + + unsigned int blocked; /* Blocked on I/O */ + unsigned int drain; /* Drain queued buffers */ + unsigned int active; /* Channel currently in use */ + unsigned int mapped; /* mmap */ + + unsigned int buf_pages; /* Real size of buffer */ + unsigned int nr_irqs; /* Number of interrupts */ + unsigned int bytes; /* Total bytes */ +}; + + +struct forte_chip { + struct pci_dev *pci_dev; + unsigned long iobase; + int irq; + + struct semaphore open_sem; /* Device access */ + spinlock_t lock; /* State */ + + spinlock_t ac97_lock; + struct ac97_codec *ac97; + + int multichannel; + int dsp; /* OSS handle */ + int trigger; /* mmap I/O trigger */ + + struct forte_channel play; + struct forte_channel rec; +}; + + +static struct forte_chip *forte; +static int found; + + +/* AC97 Codec -------------------------------------------------------------- */ + + +/** + * forte_ac97_wait: + * @chip: fm801 instance whose AC97 codec to wait on + * + * FIXME: + * Stop busy-waiting + */ + +static inline int +forte_ac97_wait (struct forte_chip *chip) +{ + int i = 10000; + + while ( (inw (chip->iobase + FORTE_AC97_CMD) & FORTE_AC97_PORT_BSY) + && i-- ) + cpu_relax(); + + return i == 0; +} + + +/** + * forte_ac97_read: + * @codec: AC97 codec to read from + * @reg: register to read + */ + +u16 +forte_ac97_read (struct ac97_codec *codec, u8 reg) +{ + u16 ret = 0; + struct forte_chip *chip = codec->private_data; + + spin_lock (&chip->ac97_lock); + + /* Knock, knock */ + if (forte_ac97_wait (chip)) { + printk (KERN_ERR PFX "ac97_read: Serial bus busy\n"); + goto out; + } + + /* Send read command */ + outw (reg | (1<<7), chip->iobase + FORTE_AC97_CMD); + + if (forte_ac97_wait (chip)) { + printk (KERN_ERR PFX "ac97_read: Bus busy reading reg 0x%x\n", + reg); + goto out; + } + + /* Sanity checking */ + if (inw (chip->iobase + FORTE_AC97_CMD) & FORTE_AC97_DP_INVALID) { + printk (KERN_ERR PFX "ac97_read: Invalid data port"); + goto out; + } + + /* Fetch result */ + ret = inw (chip->iobase + FORTE_AC97_DATA); + + out: + spin_unlock (&chip->ac97_lock); + return ret; +} + + +/** + * forte_ac97_write: + * @codec: AC97 codec to send command to + * @reg: register to write + * @val: value to write + */ + +void +forte_ac97_write (struct ac97_codec *codec, u8 reg, u16 val) +{ + struct forte_chip *chip = codec->private_data; + + spin_lock (&chip->ac97_lock); + + /* Knock, knock */ + if (forte_ac97_wait (chip)) { + printk (KERN_ERR PFX "ac97_write: Serial bus busy\n"); + goto out; + } + + outw (val, chip->iobase + FORTE_AC97_DATA); + outb (reg | FORTE_AC97_WRITE, chip->iobase + FORTE_AC97_CMD); + + /* Wait for completion */ + if (forte_ac97_wait (chip)) { + printk (KERN_ERR PFX "ac97_write: Bus busy after write\n"); + goto out; + } + + out: + spin_unlock (&chip->ac97_lock); +} + + +/* Mixer ------------------------------------------------------------------- */ + + +/** + * forte_mixer_open: + * @inode: + * @file: + */ + +static int +forte_mixer_open (struct inode *inode, struct file *file) +{ + struct forte_chip *chip = forte; + + MOD_INC_USE_COUNT; + + file->private_data = chip->ac97; + + return 0; +} + + +/** + * forte_mixer_release: + * @inode: + * @file: + */ + +static int +forte_mixer_release (struct inode *inode, struct file *file) +{ + /* We will welease Wodewick */ + MOD_DEC_USE_COUNT; + + return 0; +} + + +/** + * forte_mixer_ioctl: + * @inode: + * @file: + */ + +static int +forte_mixer_ioctl (struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg) +{ + struct ac97_codec *codec = (struct ac97_codec *) file->private_data; + + return codec->mixer_ioctl (codec, cmd, arg); +} + + +static struct file_operations forte_mixer_fops = { + owner: THIS_MODULE, + llseek: no_llseek, + ioctl: forte_mixer_ioctl, + open: forte_mixer_open, + release: forte_mixer_release, +}; + + +/* Channel ----------------------------------------------------------------- */ + +/** + * forte_channel_reset: + * @channel: Channel to reset + * + * Locking: Must be called with lock held. + */ + +static void +forte_channel_reset (struct forte_channel *channel) +{ + if (!channel || !channel->iobase) + return; + + DPRINTK ("%s: channel = %s\n", __FUNCTION__, channel->name); + + channel->ctrl &= ~FORTE_START; + outw (channel->ctrl, channel->iobase + FORTE_PLY_CTRL); + + /* We always play at least two fragments, hence these defaults */ + channel->hwptr = channel->frag_sz; + channel->next_buf = 1; + channel->swptr = 0; + channel->filled_frags = 0; + channel->blocked = 0; + channel->drain = 0; + channel->active = 0; + channel->bytes = 0; + channel->nr_irqs = 0; + channel->mapped = 0; +} + + +/** + * forte_channel_start: + * @channel: Channel to start (record/playback) + * + * Locking: Must be called with lock held. + */ + +static void inline +forte_channel_start (struct forte_channel *channel) +{ + if (!channel || !channel->iobase) + return; + + DPRINTK ("%s: channel = %s\n", __FUNCTION__, channel->name); + + channel->ctrl &= ~(FORTE_PAUSE | FORTE_BUF1_LAST | FORTE_BUF2_LAST); + channel->ctrl |= FORTE_START; + channel->active = 1; + outw (channel->ctrl, channel->iobase + FORTE_PLY_CTRL); +} + + +/** + * forte_channel_stop: + * @channel: Channel to stop + * + * Locking: Must be called with lock held. + */ + +static void inline +forte_channel_stop (struct forte_channel *channel) +{ + if (!channel || !channel->iobase) + return; + + DPRINTK ("%s: channel = %s\n", __FUNCTION__, channel->name); + + channel->ctrl &= ~FORTE_START; + channel->active = 0; + outw (channel->ctrl, channel->iobase + FORTE_PLY_CTRL); +} + + +/** + * forte_channel_rate: + * @channel: Channel whose rate to set. Playback and record are + * independent. + * @rate: Channel rate in Hz + * + * Locking: Must be called with lock held. + */ + +static int +forte_channel_rate (struct forte_channel *channel, unsigned int rate) +{ + int new_rate, ret; + + if (!channel || !channel->iobase) + return -EINVAL; + + if (rate == 0 || channel->rate == rate) { + ret = channel->rate; + goto out; + } + + if (rate > 48000) + rate = 48000; + + if (rate < 5500) + rate = 5500; + + switch (rate) { + case 5500: new_rate = 0; break; + case 8000: new_rate = 1; break; + case 9600: new_rate = 2; break; + case 11025: new_rate = 3; break; + case 16000: new_rate = 4; break; + case 19200: new_rate = 5; break; + case 22050: new_rate = 6; break; + case 32000: new_rate = 7; break; + case 38400: new_rate = 8; break; + case 44100: new_rate = 9; break; + case 48000: new_rate = 10; break; + + default: + DPRINTK ("Unsupported rate: %d", rate); + ret = -EINVAL; + goto out; + } + + channel->ctrl &= ~FORTE_RATE_MASK; + channel->ctrl |= new_rate << FORTE_RATE_SHIFT; + channel->rate = ret = rate; + + out: + DPRINTK ("%s: %s rate = %d\n", __FUNCTION__, channel->name, rate); + + return ret; +} + + +/** + * forte_channel_format: + * @channel: Channel whose audio format to set + * @format: OSS format ID + * + * Locking: Must be called with lock held. + */ + +static int +forte_channel_format (struct forte_channel *channel, int format) +{ + int ret; + + if (!channel || !channel->iobase) + return -EINVAL; + + DPRINTK ("%s: %s format = %d\n", __FUNCTION__, channel->name, format); + + switch (format) { + + case AFMT_QUERY: + ret = channel->format; + break; + + case AFMT_U8: + channel->ctrl &= ~FORTE_16BIT; + channel->format = format; + ret = format; + break; + + case AFMT_S16_LE: + channel->ctrl |= FORTE_16BIT; + channel->format = format; + ret = format; + break; + + default: + DPRINTK ("Unsupported audio format"); + ret = -EINVAL; + break; + } + + return ret; +} + + +/** + * forte_channel_stereo: + * @channel: Channel to toggle + * @stereo: 0 for Mono, 1 for Stereo + * + * Locking: Must be called with lock held. + */ + +static int +forte_channel_stereo (struct forte_channel *channel, unsigned int stereo) +{ + int ret; + + if (!channel || !channel->iobase) + return -EINVAL; + + DPRINTK ("%s: %s stereo = %d\n", __FUNCTION__, channel->name, stereo); + + switch (stereo) { + + case 0: + channel->ctrl &= ~(FORTE_STEREO | FORTE_CHANNELS_MASK); + channel-> stereo = stereo; + ret = stereo; + break; + + case 1: + channel->ctrl &= ~FORTE_CHANNELS_MASK; + channel->ctrl |= FORTE_STEREO; + channel-> stereo = stereo; + ret = stereo; + break; + + default: + DPRINTK ("Unsupported channel format"); + ret = -EINVAL; + break; + } + + return ret; +} + + +/** + * forte_channel_buffer: + * @channel: Channel whose buffer to set up + * + * Locking: Must be called with lock held. + * + * FIXME: Buffer scaling dependent on rate/channels/bits + */ + +static void +forte_channel_buffer (struct forte_channel *channel, int sz, int num) +{ + /* Go away, I'm busy */ + if (channel->filled_frags || channel->bytes) + return; + + channel->frag_sz = sz; + channel->frag_num = num; + + if (channel->frag_sz < FORTE_MIN_FRAG_SIZE) + channel->frag_sz = FORTE_MIN_FRAG_SIZE; + + if (channel->frag_sz > FORTE_MAX_FRAG_SIZE) + channel->frag_sz = FORTE_MAX_FRAG_SIZE; + + if (channel->frag_num < FORTE_MIN_FRAGMENTS) + channel->frag_num = FORTE_MIN_FRAGMENTS; + + if (channel->frag_num > FORTE_MAX_FRAGMENTS) + channel->frag_num = FORTE_MAX_FRAGMENTS; + + if (channel->frag_sz * channel->frag_num < FORTE_MIN_BUF) + channel->frag_num = FORTE_MIN_BUF / channel->frag_sz; + + channel->buf_sz = channel->frag_sz * channel->frag_num; + + DPRINTK ("%s: %s frag_sz = %d, frag_num = %d, buf_sz = %d\n", + __FUNCTION__, channel->name, channel->frag_sz, + channel->frag_num, channel->buf_sz); +} + + +/** + * forte_channel_prep: + * @channel: Channel whose buffer to prepare + * + * Locking: Lock held. + */ + +static void +forte_channel_prep (struct forte_channel *channel) +{ + struct page *page; + int i; + + if (channel->buf) + return; + + channel->buf_pages = channel->buf_sz >> PAGE_SHIFT; + + if (channel->buf_sz % PAGE_SIZE) + channel->buf_pages++; + + DPRINTK ("%s: %s frag_sz = %d, frag_num = %d, buf_sz = %d, pg = %d\n", + __FUNCTION__, channel->name, channel->frag_sz, + channel->frag_num, channel->buf_sz, channel->buf_pages); + + /* DMA buffer */ + channel->buf = pci_alloc_consistent (forte->pci_dev, + channel->buf_pages * PAGE_SIZE, + &channel->buf_handle); + + page = virt_to_page (channel->buf); + + for (i = 0 ; i < channel->buf_pages ; i++) + mem_map_reserve (page++); + + if (!channel->buf || !channel->buf_handle) + BUG(); + + /* Prep buffer registers */ + outw (channel->frag_sz - 1, channel->iobase + FORTE_PLY_COUNT); + outl (channel->buf_handle, channel->iobase + FORTE_PLY_BUF1); + outl (channel->buf_handle + channel->frag_sz, + channel->iobase + FORTE_PLY_BUF2); + + /* Reset hwptr */ + channel->hwptr = channel->frag_sz; + channel->next_buf = 1; + + DPRINTK ("%s: %s buffer @ %p (%p)\n", __FUNCTION__, channel->name, + channel->buf, channel->buf_handle); +} + + +/** + * forte_channel_drain: + * @chip: + * @channel: + * + * Locking: Don't hold the lock. + */ + +static inline int +forte_channel_drain (struct forte_channel *channel) +{ + DECLARE_WAITQUEUE (wait, current); + unsigned long flags; + + if (!channel->active) + return 0; + + if (channel->mapped) { + spin_lock_irqsave (&forte->lock, flags); + forte_channel_stop (channel); + spin_unlock_irqrestore (&forte->lock, flags); + return 0; + } + + channel->drain = 1; + add_wait_queue (&channel->wait, &wait); + + for (;;) { + spin_lock_irqsave (&forte->lock, flags); + + if (channel->active == 0 || channel->filled_frags < 1) + break; + + spin_unlock_irqrestore (&forte->lock, flags); + __set_current_state (TASK_INTERRUPTIBLE); + schedule(); + } + + channel->drain = 0; + spin_unlock_irqrestore (&forte->lock, flags); + set_current_state (TASK_RUNNING); + remove_wait_queue (&channel->wait, &wait); + + return 0; +} + + +/** + * forte_channel_init: + * @chip: Forte chip instance the channel hangs off + * @channel: Channel to initialize + * + * Description: + * Initializes a channel, sets defaults, and allocates + * buffers. + * + * Locking: No lock held. + */ + +static int +forte_channel_init (struct forte_chip *chip, struct forte_channel *channel) +{ + DPRINTK ("%s: chip iobase @ %p\n", __FUNCTION__, (void *)chip->iobase); + + spin_lock_irq (&chip->lock); + memset (channel, 0x0, sizeof (*channel)); + + if (channel == &chip->play) { + channel->name = "PCM_OUT"; + channel->iobase = chip->iobase; + DPRINTK ("%s: PCM-OUT iobase @ %p\n", __FUNCTION__, + (void *) channel->iobase); + } + else if (channel == &chip->rec) { + channel->name = "PCM_IN"; + channel->iobase = chip->iobase + FORTE_CAP_OFFSET; + channel->record = 1; + DPRINTK ("%s: PCM-IN iobase @ %p\n", __FUNCTION__, + (void *) channel->iobase); + } + else + BUG(); + + init_waitqueue_head (&channel->wait); + + /* Defaults: 48kHz, 16-bit, mono */ + forte_channel_reset (channel); + forte_channel_stereo (channel, 0); + forte_channel_format (channel, AFMT_S16_LE); + forte_channel_rate (channel, 48000); + forte_channel_buffer (channel, FORTE_DEF_FRAG_SIZE, + FORTE_DEF_FRAGMENTS); + + chip->trigger = 0; + spin_unlock_irq (&chip->lock); + + return 0; +} + + +/** + * forte_channel_free: + * @chip: Chip this channel hangs off + * @channel: Channel to nuke + * + * Description: + * Resets channel and frees buffers. + * + * Locking: Hold your horses. + */ + +static void +forte_channel_free (struct forte_chip *chip, struct forte_channel *channel) +{ + DPRINTK ("%s: %s\n", __FUNCTION__, channel->name); + + if (!channel->buf_handle) + return; + + pci_free_consistent (chip->pci_dev, channel->buf_pages * PAGE_SIZE, + channel->buf, channel->buf_handle); + + memset (channel, 0x0, sizeof (*channel)); +} + + +/* DSP --------------------------------------------------------------------- */ + + +/** + * forte_dsp_ioctl: + */ + +static int +forte_dsp_ioctl (struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) +{ + int ival, ret, rval, rd, wr, count; + unsigned long flags; + struct forte_chip *chip; + struct audio_buf_info abi; + struct count_info cinfo; + + chip = file->private_data; + + if (file->f_mode & FMODE_WRITE) + wr = 1; + else + wr = 0; + + if (file->f_mode & FMODE_READ) + rd = 1; + else + rd = 0; + + switch (cmd) { + + case OSS_GETVERSION: + return put_user (SOUND_VERSION, (int *) arg); + + case SNDCTL_DSP_GETCAPS: + DPRINTK ("%s: GETCAPS\n", __FUNCTION__); + + ival = FORTE_CAPS; /* DUPLEX */ + return put_user (ival, (int *) arg); + + case SNDCTL_DSP_GETFMTS: + DPRINTK ("%s: GETFMTS\n", __FUNCTION__); + + ival = FORTE_FMTS; /* U8, 16LE */ + return put_user (ival, (int *) arg); + + case SNDCTL_DSP_SETFMT: /* U8, 16LE */ + DPRINTK ("%s: SETFMT\n", __FUNCTION__); + + if (get_user (ival, (int *) arg)) + return -EFAULT; + + spin_lock_irq (&chip->lock); + + if (rd) { + forte_channel_stop (&chip->rec); + rval = forte_channel_format (&chip->rec, ival); + } + + if (wr) { + forte_channel_stop (&chip->rec); + rval = forte_channel_format (&chip->play, ival); + } + + spin_unlock_irq (&chip->lock); + + return put_user (rval, (int *) arg); + + case SNDCTL_DSP_STEREO: /* 0 - mono, 1 - stereo */ + DPRINTK ("%s: STEREO\n", __FUNCTION__); + + if (get_user (ival, (int *) arg)) + return -EFAULT; + + spin_lock_irq (&chip->lock); + + if (rd) { + forte_channel_stop (&chip->rec); + rval = forte_channel_stereo (&chip->rec, ival); + } + + if (wr) { + forte_channel_stop (&chip->rec); + rval = forte_channel_stereo (&chip->play, ival); + } + + spin_unlock_irq (&chip->lock); + + return put_user (rval, (int *) arg); + + case SNDCTL_DSP_CHANNELS: /* 1 - mono, 2 - stereo */ + DPRINTK ("%s: CHANNELS\n", __FUNCTION__); + + if (get_user (ival, (int *) arg)) + return -EFAULT; + + spin_lock_irq (&chip->lock); + + if (rd) { + forte_channel_stop (&chip->rec); + rval = forte_channel_stereo (&chip->rec, ival-1) + 1; + } + + if (wr) { + forte_channel_stop (&chip->play); + rval = forte_channel_stereo (&chip->play, ival-1) + 1; + } + + spin_unlock_irq (&chip->lock); + + return put_user (rval, (int *) arg); + + case SNDCTL_DSP_SPEED: + DPRINTK ("%s: SPEED\n", __FUNCTION__); + + if (get_user (ival, (int *) arg)) + return -EFAULT; + + spin_lock_irq (&chip->lock); + + if (rd) { + forte_channel_stop (&chip->rec); + rval = forte_channel_rate (&chip->rec, ival); + } + + if (wr) { + forte_channel_stop (&chip->play); + rval = forte_channel_rate (&chip->play, ival); + } + + spin_unlock_irq (&chip->lock); + + return put_user(rval, (int*) arg); + + case SNDCTL_DSP_GETBLKSIZE: + DPRINTK ("%s: GETBLKSIZE\n", __FUNCTION__); + + spin_lock_irq (&chip->lock); + + if (rd) + ival = chip->rec.frag_sz; + + if (wr) + ival = chip->play.frag_sz; + + spin_unlock_irq (&chip->lock); + + return put_user (ival, (int *) arg); + + case SNDCTL_DSP_RESET: + DPRINTK ("%s: RESET\n", __FUNCTION__); + + spin_lock_irq (&chip->lock); + + if (rd) + forte_channel_reset (&chip->rec); + + if (wr) + forte_channel_reset (&chip->play); + + spin_unlock_irq (&chip->lock); + + return 0; + + case SNDCTL_DSP_SYNC: + DPRINTK ("%s: SYNC\n", __FUNCTION__); + + if (wr) { + ret = forte_channel_drain (&chip->play); + spin_lock_irq (&chip->lock); + forte_channel_reset (&chip->play); + spin_unlock_irq (&chip->lock); + } + + return 0; + + case SNDCTL_DSP_POST: + DPRINTK ("%s: POST\n", __FUNCTION__); + + if (wr) { + spin_lock_irq (&chip->lock); + forte_channel_reset (&chip->play); + spin_unlock_irq (&chip->lock); + } + + return 0; + + case SNDCTL_DSP_SETFRAGMENT: + DPRINTK ("%s: SETFRAGMENT\n", __FUNCTION__); + + if (get_user (ival, (int *) arg)) + return -EFAULT; + + spin_lock_irq (&chip->lock); + + if (rd) { + forte_channel_buffer (&chip->rec, ival & 0xffff, + (ival >> 16) & 0xffff); + ival = (chip->rec.frag_num << 16) + chip->rec.frag_sz; + } + + if (wr) { + forte_channel_buffer (&chip->play, ival & 0xffff, + (ival >> 16) & 0xffff); + ival = (chip->play.frag_num << 16) +chip->play.frag_sz; + } + + spin_unlock_irq (&chip->lock); + + return put_user (ival, (int *) arg); + + case SNDCTL_DSP_GETISPACE: + DPRINTK ("%s: GETISPACE\n", __FUNCTION__); + + if (!rd) + return -EINVAL; + + spin_lock_irq (&chip->lock); + + abi.fragstotal = chip->rec.frag_num; + abi.fragsize = chip->rec.frag_sz; + + if (chip->rec.mapped) { + abi.fragments = chip->rec.frag_num - 2; + abi.bytes = abi.fragments * abi.fragsize; + } + else { + abi.fragments = chip->rec.filled_frags; + abi.bytes = abi.fragments * abi.fragsize; + } + + spin_unlock_irq (&chip->lock); + + return copy_to_user ((void *) arg, &abi, sizeof (abi)); + + case SNDCTL_DSP_GETIPTR: + DPRINTK ("%s: GETIPTR\n", __FUNCTION__); + + if (!rd) + return -EINVAL; + + spin_lock_irq (&chip->lock); + + if (chip->rec.active) + cinfo.ptr = chip->rec.hwptr; + else + cinfo.ptr = 0; + + cinfo.bytes = chip->rec.bytes; + cinfo.blocks = chip->rec.nr_irqs; + chip->rec.nr_irqs = 0; + + spin_unlock_irq (&chip->lock); + + return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)); + + case SNDCTL_DSP_GETOSPACE: + if (!wr) + return -EINVAL; + + spin_lock_irq (&chip->lock); + + abi.fragstotal = chip->play.frag_num; + abi.fragsize = chip->play.frag_sz; + + if (chip->play.mapped) { + abi.fragments = chip->play.frag_num - 2; + abi.bytes = chip->play.buf_sz; + } + else { + abi.fragments = chip->play.frag_num - + chip->play.filled_frags; + abi.bytes = abi.fragments * abi.fragsize; + } + + spin_unlock_irq (&chip->lock); + + return copy_to_user ((void *) arg, &abi, sizeof (abi)); + + case SNDCTL_DSP_GETOPTR: + if (!wr) + return -EINVAL; + + spin_lock_irq (&chip->lock); + + if (chip->play.active) + cinfo.ptr = chip->play.hwptr; + else + cinfo.ptr = 0; + + cinfo.bytes = chip->play.bytes; + cinfo.blocks = chip->play.nr_irqs; + chip->play.nr_irqs = 0; + + spin_unlock_irq (&chip->lock); + + return copy_to_user ((void *) arg, &cinfo, sizeof (cinfo)); + + case SNDCTL_DSP_GETODELAY: + if (!chip->play.active) + return 0; + + if (!wr) + return -EINVAL; + + spin_lock_irq (&chip->lock); + + if (chip->play.mapped) { + count = inw (chip->play.iobase + FORTE_PLY_COUNT) + 1; + ival = chip->play.frag_sz - count; + } + else { + ival = chip->play.filled_frags * chip->play.frag_sz; + } + + spin_unlock_irq (&chip->lock); + + return put_user (ival, (int *) arg); + + case SNDCTL_DSP_SETDUPLEX: + DPRINTK ("%s: SETDUPLEX\n", __FUNCTION__); + + return -EINVAL; + + case SNDCTL_DSP_GETTRIGGER: + DPRINTK ("%s: GETTRIGGER\n", __FUNCTION__); + + return put_user (chip->trigger, (int *) arg); + + case SNDCTL_DSP_SETTRIGGER: + + if (get_user (ival, (int *) arg)) + return -EFAULT; + + DPRINTK ("%s: SETTRIGGER %d\n", __FUNCTION__, ival); + + if (wr) { + spin_lock_irq (&chip->lock); + + if (ival & PCM_ENABLE_OUTPUT) + forte_channel_start (&chip->play); + else { + chip->trigger = 1; + forte_channel_prep (&chip->play); + forte_channel_stop (&chip->play); + } + + spin_unlock_irq (&chip->lock); + } + else if (rd) { + spin_lock_irq (&chip->lock); + + if (ival & PCM_ENABLE_INPUT) + forte_channel_start (&chip->rec); + else { + chip->trigger = 1; + forte_channel_prep (&chip->rec); + forte_channel_stop (&chip->rec); + } + + spin_unlock_irq (&chip->lock); + } + + return 0; + + default: + DPRINTK ("Unsupported ioctl: %x (%p)\n", cmd, (void *) arg); + break; + } + + return -EINVAL; +} + + +/** + * forte_dsp_open: + */ + +static int +forte_dsp_open (struct inode *inode, struct file *file) +{ + struct forte_chip *chip = forte; /* FIXME: HACK FROM HELL! */ + struct forte_channel *channel; + + if (down_interruptible (&chip->open_sem)) { + DPRINTK ("%s: returning -ERESTARTSYS\n", __FUNCTION__); + return -ERESTARTSYS; + } + + file->private_data = forte; + + DPRINTK ("%s: chip @ %p\n", __FUNCTION__, file->private_data); + + if (file->f_mode & FMODE_WRITE) + forte_channel_init (forte, &forte->play); + + if (file->f_mode & FMODE_READ) + forte_channel_init (forte, &forte->rec); + + return 0; +} + + +/** + * forte_dsp_release: + */ + +static int +forte_dsp_release (struct inode *inode, struct file *file) +{ + struct forte_chip *chip = file->private_data; + int ret = 0; + + DPRINTK ("%s: chip @ %p\n", __FUNCTION__, chip); + + if (file->f_mode & FMODE_WRITE) { + forte_channel_drain (&chip->play); + + spin_lock_irq (&chip->lock); + + forte_channel_stop (&chip->play); + forte_channel_free (chip, &chip->play); + + spin_unlock_irq (&chip->lock); + } + + if (file->f_mode & FMODE_READ) { + while (chip->rec.filled_frags > 0) + interruptible_sleep_on (&chip->rec.wait); + + forte_channel_stop (&chip->rec); + forte_channel_free (chip, &chip->rec); + } + + out: + up (&chip->open_sem); + + return ret; +} + + +/** + * forte_dsp_poll: + * + * FIXME: Racy + */ + +static unsigned int +forte_dsp_poll (struct file *file, struct poll_table_struct *wait) +{ + struct forte_chip *chip; + struct forte_channel *channel; + unsigned int mask = 0; + + chip = file->private_data; + + if (file->f_mode & FMODE_WRITE) { + channel = &chip->play; + + if (channel->active) + poll_wait (file, &channel->wait, wait); + + if (channel->filled_frags) + mask |= POLLOUT | POLLWRNORM; + } + + if (file->f_mode & FMODE_READ) { + channel = &chip->rec; + + if (channel->active) + poll_wait (file, &channel->wait, wait); + + if (channel->filled_frags > 0) + mask |= POLLIN | POLLRDNORM; + } + + return mask; +} + + +/** + * forte_dsp_mmap: + */ + +static int +forte_dsp_mmap (struct file *file, struct vm_area_struct *vma) +{ + struct forte_chip *chip; + struct forte_channel *channel; + unsigned long size; + int ret; + + chip = file->private_data; + + DPRINTK ("%s: start %lXh, size %ld, pgoff %ld\n", __FUNCTION__, + vma->vm_start, vma->vm_end - vma->vm_start, vma->vm_pgoff); + + spin_lock_irq (&chip->lock); + + if (vma->vm_flags & VM_WRITE && chip->play.active) { + ret = -EBUSY; + goto out; + } + + if (vma->vm_flags & VM_READ && chip->rec.active) { + ret = -EBUSY; + goto out; + } + + if (file->f_mode & FMODE_WRITE) + channel = &chip->play; + else if (file->f_mode & FMODE_READ) + channel = &chip->rec; + else { + ret = -EINVAL; + goto out; + } + + forte_channel_prep (channel); + channel->mapped = 1; + + if (vma->vm_pgoff != 0) { + ret = -EINVAL; + goto out; + } + + size = vma->vm_end - vma->vm_start; + + if (size > channel->buf_pages * PAGE_SIZE) { + DPRINTK ("%s: size (%ld) > buf_sz (%d) \n", __FUNCTION__, + size, channel->buf_sz); + ret = -EINVAL; + goto out; + } + + if (remap_page_range (vma->vm_start, virt_to_phys (channel->buf), + size, vma->vm_page_prot)) { + DPRINTK ("%s: remap el a no worko\n", __FUNCTION__); + ret = -EAGAIN; + goto out; + } + + ret = 0; + + out: + spin_unlock_irq (&chip->lock); + return ret; +} + + +/** + * forte_dsp_write: + */ + +static ssize_t +forte_dsp_write (struct file *file, const char *buffer, size_t bytes, + loff_t *ppos) +{ + struct forte_chip *chip; + struct forte_channel *channel; + unsigned int i = bytes, sz = 0; + unsigned long flags; + + if (ppos != &file->f_pos) + return -ESPIPE; + + if (!access_ok (VERIFY_READ, buffer, bytes)) + return -EFAULT; + + chip = (struct forte_chip *) file->private_data; + + if (!chip) + BUG(); + + channel = &chip->play; + + if (!channel) + BUG(); + + spin_lock_irqsave (&chip->lock, flags); + + /* Set up buffers with the right fragment size */ + forte_channel_prep (channel); + + while (i) { + /* All fragment buffers in use -> wait */ + if (channel->frag_num - channel->filled_frags == 0) { + DECLARE_WAITQUEUE (wait, current); + + /* For trigger mode operation, get out */ + if (chip->trigger) { + spin_unlock_irqrestore (&chip->lock, flags); + return -EAGAIN; + } + + /* Otherwise wait for buffers */ + channel->blocked = 1; + add_wait_queue (&channel->wait, &wait); + + for (;;) { + if (channel->active == 0) + break; + + if (channel->frag_num - channel->filled_frags) + break; + + spin_unlock_irqrestore (&chip->lock, flags); + + set_current_state (TASK_INTERRUPTIBLE); + schedule(); + + spin_lock_irqsave (&chip->lock, flags); + } + + set_current_state (TASK_RUNNING); + remove_wait_queue (&channel->wait, &wait); + channel->blocked = 0; + } + + if (i > channel->frag_sz) + sz = channel->frag_sz; + else + sz = i; + + spin_unlock_irqrestore (&chip->lock, flags); + + /* Clear the fragment so we don't get noise when copying + * smaller buffers + */ + memset ((void *) channel->buf + channel->swptr, 0x0, sz); + + if (copy_from_user ((void *) channel->buf + channel->swptr, + buffer, sz)) { + return -EFAULT; + } + + spin_lock_irqsave (&chip->lock, flags); + + /* Advance software pointer */ + buffer += sz; + channel->filled_frags++; + channel->swptr += channel->frag_sz; + channel->swptr %= channel->buf_sz; + i -= sz; + + /* If playback isn't active, start it */ + if (channel->active == 0 && chip->trigger == 0) + forte_channel_start (channel); + } + + spin_unlock_irqrestore (&chip->lock, flags); + + return bytes - i; +} + + +/** + * forte_dsp_read: + */ + +static ssize_t +forte_dsp_read (struct file *file, char *buffer, size_t bytes, + loff_t *ppos) +{ + struct forte_chip *chip; + struct forte_channel *channel; + unsigned int i = bytes, sz, ret; + unsigned long flags; + + if (ppos != &file->f_pos) + return -ESPIPE; + + if (!access_ok (VERIFY_WRITE, buffer, bytes)) + return -EFAULT; + + chip = (struct forte_chip *) file->private_data; + + if (!chip) + BUG(); + + channel = &chip->rec; + + if (!channel) + BUG(); + + spin_lock_irqsave (&chip->lock, flags); + + /* Set up buffers with the right fragment size */ + forte_channel_prep (channel); + + /* Start recording */ + if (!chip->trigger) + forte_channel_start (channel); + + while (i) { + /* No fragment buffers in use -> wait */ + if (channel->filled_frags == 0) { + DECLARE_WAITQUEUE (wait, current); + + /* For trigger mode operation, get out */ + if (chip->trigger) { + spin_unlock_irqrestore (&chip->lock, flags); + return -EAGAIN; + } + + channel->blocked = 1; + add_wait_queue (&channel->wait, &wait); + + for (;;) { + if (channel->active == 0) + break; + + if (channel->filled_frags) + break; + + spin_unlock_irqrestore (&chip->lock, flags); + + set_current_state (TASK_INTERRUPTIBLE); + schedule(); + + spin_lock_irqsave (&chip->lock, flags); + } + + set_current_state (TASK_RUNNING); + remove_wait_queue (&channel->wait, &wait); + channel->blocked = 0; + } + + if (i > channel->frag_sz) + sz = channel->frag_sz; + else + sz = i; + + spin_unlock_irqrestore (&chip->lock, flags); + + if (copy_to_user (buffer, (void *)channel->buf+channel->swptr, sz)) { + DPRINTK ("%s: copy_to_user failed\n", __FUNCTION__); + return -EFAULT; + } + + spin_lock_irqsave (&chip->lock, flags); + + /* Advance software pointer */ + buffer += sz; + channel->filled_frags--; + channel->swptr += channel->frag_sz; + channel->swptr %= channel->buf_sz; + i -= sz; + } + + spin_unlock_irqrestore (&chip->lock, flags); + + return bytes - i; +} + + +static struct file_operations forte_dsp_fops = { + owner: THIS_MODULE, + llseek: &no_llseek, + read: &forte_dsp_read, + write: &forte_dsp_write, + poll: &forte_dsp_poll, + ioctl: &forte_dsp_ioctl, + open: &forte_dsp_open, + release: &forte_dsp_release, + mmap: &forte_dsp_mmap, +}; + + +/* Common ------------------------------------------------------------------ */ + + +/** + * forte_interrupt: + */ + +static void +forte_interrupt (int irq, void *dev_id, struct pt_regs *regs) +{ + struct forte_chip *chip = dev_id; + struct forte_channel *channel = NULL; + u16 status, count; + + status = inw (chip->iobase + FORTE_IRQ_STATUS); + + /* If this is not for us, get outta here ASAP */ + if ((status & (FORTE_IRQ_PLAYBACK | FORTE_IRQ_CAPTURE)) == 0) + return; + + if (status & FORTE_IRQ_PLAYBACK) { + channel = &chip->play; + spin_lock (&chip->lock); + + /* Declare a fragment done */ + channel->filled_frags--; + + /* Get # of completed bytes */ + count = inw (channel->iobase + FORTE_PLY_COUNT) + 1; + channel->bytes += count; + + if (count == 0) { + DPRINTK ("%s: last, filled_frags = %d\n", __FUNCTION__, + channel->filled_frags); + channel->filled_frags = 0; + forte_channel_stop (channel); + goto pack; + } + + channel->nr_irqs++; + + /* Flip-flop between buffer I and II */ + channel->next_buf ^= 1; + + /* Advance hardware pointer by fragment size and wrap around */ + channel->hwptr += channel->frag_sz; + channel->hwptr %= channel->buf_sz; + + /* Buffer I or buffer II BAR */ + outl (channel->buf_handle + channel->hwptr, + channel->next_buf == 0 ? + channel->iobase + FORTE_PLY_BUF1 : + channel->iobase + FORTE_PLY_BUF2); + + /* If the currently playing fragment is last, schedule stop */ + if (channel->filled_frags == 1) + forte_channel_stop (channel); + pack: + /* Acknowledge interrupt */ + outw (FORTE_IRQ_PLAYBACK, chip->iobase + FORTE_IRQ_STATUS); + + spin_unlock (&chip->lock); + + if (channel->blocked || channel->drain) + wake_up_interruptible (&channel->wait); + } + + if (status & FORTE_IRQ_CAPTURE) { + channel = &chip->rec; + spin_lock (&chip->lock); + + /* One fragment filled */ + channel->filled_frags++; + + /* Get # of completed bytes */ + count = inw (channel->iobase + FORTE_PLY_COUNT) + 1; + + if (count == 0) { + DPRINTK ("%s: last, filled_frags = %d\n", __FUNCTION__, + channel->filled_frags); + channel->filled_frags = 0; + goto rack; + } + + /* Buffer I or buffer II BAR */ + outl (channel->buf_handle + channel->hwptr, + channel->next_buf == 0 ? + channel->iobase + FORTE_PLY_BUF1 : + channel->iobase + FORTE_PLY_BUF2); + + /* Flip-flop between buffer I and II */ + channel->next_buf ^= 1; + + /* Advance hardware pointer by fragment size and wrap around */ + channel->hwptr += channel->frag_sz; + channel->hwptr %= channel->buf_sz; + + /* Out of buffers */ + if (channel->filled_frags == channel->frag_num - 1) + forte_channel_stop (channel); + rack: + /* Acknowledge interrupt */ + outw (FORTE_IRQ_CAPTURE, chip->iobase + FORTE_IRQ_STATUS); + + spin_unlock (&chip->lock); + + if (channel->blocked) + wake_up_all (&channel->wait); + } + + return; +} + + +/** + * forte_chip_init: + * @chip: Chip instance to initialize + * + * Description: + * Resets chip, configures codec and registers the driver with + * the sound subsystem. + * + * Press and hold Start for 8 secs, then switch on Run + * and hold for 4 seconds. Let go of Start. Numbers + * assume a properly oiled TWG. + */ + +static int __devinit +forte_chip_init (struct forte_chip *chip) +{ + u8 revision; + u16 cmdw; + struct ac97_codec *codec; + + pci_read_config_byte (chip->pci_dev, PCI_REVISION_ID, &revision); + + if (revision >= 0xB1) { + chip->multichannel = 1; + printk (KERN_INFO PFX "Multi-channel device detected.\n"); + } + + /* Reset chip */ + outw (FORTE_CC_CODEC_RESET | FORTE_CC_AC97_RESET, + chip->iobase + FORTE_CODEC_CTRL); + udelay(100); + outw (0, chip->iobase + FORTE_CODEC_CTRL); + + /* Request read from AC97 */ + outw (FORTE_AC97_READ | (0 << FORTE_AC97_ADDR_SHIFT), + chip->iobase + FORTE_AC97_CMD); + mdelay(750); + + if ((inw (chip->iobase + FORTE_AC97_CMD) & (3<<8)) != (1<<8)) { + printk (KERN_INFO PFX "AC97 codec not responding"); + return -EIO; + } + + /* Init volume */ + outw (0x0808, chip->iobase + FORTE_PCM_VOL); + outw (0x9f1f, chip->iobase + FORTE_FM_VOL); + outw (0x8808, chip->iobase + FORTE_I2S_VOL); + + /* I2S control - I2S mode */ + outw (0x0003, chip->iobase + FORTE_I2S_MODE); + + /* Interrupt setup - unmask PLAYBACK & CAPTURE */ + cmdw = inw (chip->iobase + FORTE_IRQ_MASK); + cmdw &= ~0x0003; + outw (cmdw, chip->iobase + FORTE_IRQ_MASK); + + /* Interrupt clear */ + outw (FORTE_IRQ_PLAYBACK|FORTE_IRQ_CAPTURE, + chip->iobase + FORTE_IRQ_STATUS); + + /* Set up the AC97 codec */ + if ((codec = kmalloc (sizeof (struct ac97_codec), GFP_KERNEL)) == NULL) + return -ENOMEM; + memset (codec, 0, sizeof (struct ac97_codec)); + + codec->private_data = chip; + codec->codec_read = forte_ac97_read; + codec->codec_write = forte_ac97_write; + codec->id = 0; + + if (ac97_probe_codec (codec) == 0) { + printk (KERN_ERR PFX "codec probe failed\n"); + kfree (codec); + return -1; + } + + /* Register mixer */ + if ((codec->dev_mixer = + register_sound_mixer (&forte_mixer_fops, -1)) < 0) { + printk (KERN_ERR PFX "couldn't register mixer!\n"); + kfree (codec); + return -1; + } + + chip->ac97 = codec; + + /* Register DSP */ + if ((chip->dsp = register_sound_dsp (&forte_dsp_fops, -1) ) < 0) { + printk (KERN_ERR PFX "couldn't register dsp!\n"); + return -1; + } + + return 0; +} + + +/** + * forte_probe: + * @pci_dev: PCI struct for probed device + * @pci_id: + * + * Description: + * Allocates chip instance, I/O region, and IRQ + */ +static int __init +forte_probe (struct pci_dev *pci_dev, const struct pci_device_id *pci_id) +{ + struct forte_chip *chip; + int ret = 0; + + /* FIXME: Support more than one chip */ + if (found++) + return -EIO; + + /* Ignition */ + if (pci_enable_device (pci_dev)) + return -EIO; + + pci_set_master (pci_dev); + + /* Allocate chip instance and configure */ + forte = (struct forte_chip *) + kmalloc (sizeof (struct forte_chip), GFP_KERNEL); + chip = forte; + + if (chip == NULL) { + printk (KERN_WARNING PFX "Out of memory"); + return -ENOMEM; + } + + memset (chip, 0, sizeof (struct forte_chip)); + chip->pci_dev = pci_dev; + + init_MUTEX(&chip->open_sem); + spin_lock_init (&chip->lock); + spin_lock_init (&chip->ac97_lock); + + if (! request_region (pci_resource_start (pci_dev, 0), + pci_resource_len (pci_dev, 0), DRIVER_NAME)) { + printk (KERN_WARNING PFX "Unable to reserve I/O space"); + ret = -ENOMEM; + goto error; + } + + chip->iobase = pci_resource_start (pci_dev, 0); + chip->irq = pci_dev->irq; + + if (request_irq (chip->irq, forte_interrupt, SA_SHIRQ, DRIVER_NAME, + chip)) { + printk (KERN_WARNING PFX "Unable to reserve IRQ"); + ret = -EIO; + goto error; + } + + pci_set_drvdata (pci_dev, chip); + + printk (KERN_INFO PFX "FM801 chip found at 0x%04lX-0x%04lX IRQ %u\n", + chip->iobase, pci_resource_end (pci_dev, 0), chip->irq); + + /* Power it up */ + if ((ret = forte_chip_init (chip)) == 0) + return 0; + + error: + if (chip->irq) + free_irq (chip->irq, chip); + + if (chip->iobase) + release_region (pci_resource_start (pci_dev, 0), + pci_resource_len (pci_dev, 0)); + + kfree (chip); + + return ret; +} + + +/** + * forte_remove: + * @pci_dev: PCI device to unclaim + * + */ + +static void +forte_remove (struct pci_dev *pci_dev) +{ + struct forte_chip *chip = pci_get_drvdata (pci_dev); + + if (chip == NULL) + return; + + /* Turn volume down to avoid popping */ + outw (0x1f1f, chip->iobase + FORTE_PCM_VOL); + outw (0x1f1f, chip->iobase + FORTE_FM_VOL); + outw (0x1f1f, chip->iobase + FORTE_I2S_VOL); + + free_irq (chip->irq, chip); + release_region (chip->iobase, pci_resource_len (pci_dev, 0)); + + unregister_sound_dsp (chip->dsp); + unregister_sound_mixer (chip->ac97->dev_mixer); + + kfree (chip); + + printk (KERN_INFO PFX "driver released\n"); +} + + +static struct pci_device_id forte_pci_ids[] __devinitdata = { + { 0x1319, 0x0801, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, + { 0, } +}; + + +static struct pci_driver forte_pci_driver = { + name: DRIVER_NAME, + id_table: forte_pci_ids, + probe: forte_probe, + remove: forte_remove, + +}; + + +/** + * forte_init_module: + * + */ + +static int __init +forte_init_module (void) +{ + if (!pci_present()) + return -ENODEV; + + printk (KERN_INFO PFX DRIVER_VERSION "\n"); + + if (!pci_register_driver (&forte_pci_driver)) { + pci_unregister_driver (&forte_pci_driver); + return -ENODEV; + } + + return 0; +} + + +/** + * forte_cleanup_module: + * + */ + +static void __exit +forte_cleanup_module (void) +{ + pci_unregister_driver (&forte_pci_driver); +} + + +module_init(forte_init_module); +module_exit(forte_cleanup_module); + +MODULE_AUTHOR("Martin K. Petersen "); +MODULE_DESCRIPTION("ForteMedia FM801 OSS Driver"); +MODULE_LICENSE("GPL"); +MODULE_DEVICE_TABLE (pci, forte_pci_ids); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/sound/i810_audio.c linux.20pre5-ac2/drivers/sound/i810_audio.c --- linux.20pre5/drivers/sound/i810_audio.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/sound/i810_audio.c 2002-09-01 17:35:13.000000000 +0100 @@ -65,6 +65,17 @@ * If you need to force a specific rate set the clocking= option * * This driver is cursed. (Ben LaHaise) + * + * + * ICH 4 caveats + * + * The ICH4 has the feature, that the codec ID doesn't have to be + * congruent with the IO connection. + * + * Therefore, from driver version 0.23 on, there is a "codec ID" <-> + * "IO register base offset" mapping (card->ac97_id_map) field. + * + * Juergen "George" Sawinski (jsaw) */ #include @@ -126,6 +137,7 @@ //#define DEBUG2 //#define DEBUG_INTERRUPTS //#define DEBUG_MMAP +//#define DEBUG_MMIO #define ADC_RUNNING 1 #define DAC_RUNNING 2 @@ -168,6 +180,9 @@ * each dma engine has controlling registers. These goofy * names are from the datasheet, but make it easy to write * code while leafing through it. + * + * ICH4 has 6 dma engines, pcm in, pcm out, mic, pcm in 2, + * mic in 2, s/pdif. */ #define ENUM_ENGINE(PRE,DIG) \ @@ -192,6 +207,14 @@ CAS = 0x34 /* Codec Write Semaphore Register */ }; +ENUM_ENGINE(MC2,4); /* Mic In 2 */ +ENUM_ENGINE(PI2,5); /* PCM In 2 */ +ENUM_ENGINE(SP,6); /* S/PDIF */ + +enum { + SDM = 0x80 /* SDATA_IN Map Register */ +}; + /* interrupts for a dma engine */ #define DMA_INT_FIFO (1<<4) /* fifo under/over flow */ #define DMA_INT_COMPLETE (1<<3) /* buffer read/write complete and ioc set */ @@ -211,8 +234,7 @@ #define INT_GPI (1<<0) #define INT_MASK (INT_SEC|INT_PRI|INT_MC|INT_PO|INT_PI|INT_MO|INT_NI|INT_GPI) - -#define DRIVER_VERSION "0.21" +#define DRIVER_VERSION "0.23" /* magic numbers to protect our data structures */ #define I810_CARD_MAGIC 0x5072696E /* "Prin" */ @@ -221,7 +243,7 @@ #define NR_HW_CH 3 /* maxinum number of AC97 codecs connected, AC97 2.0 defined 4 */ -#define NR_AC97 2 +#define NR_AC97 4 /* Please note that an 8bit mono stream is not valid on this card, you must have a 16bit */ /* stream at a minimum for this card to be happy */ @@ -256,6 +278,25 @@ "AMD-8111 IOHub" }; +/* These are capabilities (and bugs) the chipsets _can_ have */ +static struct { + int16_t nr_ac97; +#define CAP_MMIO 0x0001 +#define CAP_20BIT_AUDIO_SUPPORT 0x0002 + u_int16_t flags; +} card_cap[] = { + { 1, 0x0000 }, /* ICH82801AA */ + { 1, 0x0000 }, /* ICH82901AB */ + { 1, 0x0000 }, /* INTEL440MX */ + { 1, 0x0000 }, /* INTELICH2 */ + { 2, 0x0000 }, /* INTELICH3 */ + { 3, 0x0003 }, /* INTELICH4 */ + /*@FIXME to be verified*/ { 2, 0x0000 }, /* SI7012 */ + /*@FIXME to be verified*/ { 2, 0x0000 }, /* NVIDIA_NFORCE */ + /*@FIXME to be verified*/ { 2, 0x0000 }, /* AMD768 */ + /*@FIXME to be verified*/ { 3, 0x0001 }, /* AMD8111 */ +}; + static struct pci_device_id i810_pci_tbl [] __initdata = { {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ICH82801AA}, @@ -353,7 +394,6 @@ struct i810_card { - struct i810_channel channel[3]; unsigned int magic; /* We keep i810 cards in a linked list */ @@ -366,6 +406,7 @@ /* PCI device stuff */ struct pci_dev * pci_dev; u16 pci_id; + u16 pci_id_internal; /* used to access card_cap[] */ #ifdef CONFIG_PM u16 pm_suspended; u32 pm_save_state[64/sizeof(u32)]; @@ -375,17 +416,27 @@ int dev_audio; /* structures for abstraction of hardware facilities, codecs, banks and channels*/ + u16 ac97_id_map[NR_AC97]; struct ac97_codec *ac97_codec[NR_AC97]; struct i810_state *states[NR_HW_CH]; + struct i810_channel *channel; /* 1:1 to states[] but diff. lifetime */ + dma_addr_t chandma; u16 ac97_features; u16 ac97_status; u16 channels; /* hardware resources */ - unsigned long iobase; unsigned long ac97base; + unsigned long iobase; u32 irq; + + unsigned long ac97base_mmio_phys; + unsigned long iobase_mmio_phys; + u_int8_t *ac97base_mmio; + u_int8_t *iobase_mmio; + + int use_mmio; /* Function support */ struct i810_channel *(*alloc_pcm_channel)(struct i810_card *); @@ -398,6 +449,12 @@ int initializing; }; +/* extract register offset from codec struct */ +#define IO_REG_OFF(codec) (((struct i810_card *) codec->private_data)->ac97_id_map[codec->id]) + +/* set LVI from CIV */ +#define CIV_TO_LVI(port, off) outb((inb(port+OFF_CIV)+off) & 31, port+OFF_LVI) + static struct i810_card *devs = NULL; static int i810_open_mixdev(struct inode *inode, struct file *file); @@ -405,6 +462,10 @@ unsigned int cmd, unsigned long arg); static u16 i810_ac97_get(struct ac97_codec *dev, u8 reg); static void i810_ac97_set(struct ac97_codec *dev, u8 reg, u16 data); +static u16 i810_ac97_get_mmio(struct ac97_codec *dev, u8 reg); +static void i810_ac97_set_mmio(struct ac97_codec *dev, u8 reg, u16 data); +static u16 i810_ac97_get_io(struct ac97_codec *dev, u8 reg); +static void i810_ac97_set_io(struct ac97_codec *dev, u8 reg, u16 data); static struct i810_channel *i810_alloc_pcm_channel(struct i810_card *card) { @@ -756,7 +817,8 @@ if (dmabuf->count < dmabuf->dmasize && dmabuf->ready && !dmabuf->enable && (dmabuf->trigger & PCM_ENABLE_INPUT)) { dmabuf->enable |= ADC_RUNNING; - outb((1<<4) | (1<<2) | 1, state->card->iobase + PI_CR); + // Interrupt enable, LVI enable, DMA enable + outb(0x10 | 0x04 | 0x01, state->card->iobase + PI_CR); } } @@ -805,7 +867,8 @@ if (dmabuf->count > 0 && dmabuf->ready && !dmabuf->enable && (dmabuf->trigger & PCM_ENABLE_OUTPUT)) { dmabuf->enable |= DAC_RUNNING; - outb((1<<4) | (1<<2) | 1, state->card->iobase + PO_CR); + // Interrupt enable, LVI enable, DMA enable + outb(0x10 | 0x04 | 0x01, state->card->iobase + PO_CR); } } static void start_dac(struct i810_state *state) @@ -957,7 +1020,7 @@ for(i=0;inumfrag;i++) { - sg->busaddr=virt_to_bus(dmabuf->rawbuf+dmabuf->fragsize*i); + sg->busaddr=(u32)dmabuf->dma_handle+dmabuf->fragsize*i; // the card will always be doing 16bit stereo sg->control=dmabuf->fragsamples; if(state->card->pci_id == PCI_DEVICE_ID_SI_7012) @@ -972,9 +1035,11 @@ } spin_lock_irqsave(&state->card->lock, flags); outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */ - outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR); - outb(0, state->card->iobase+c->port+OFF_CIV); - outb(0, state->card->iobase+c->port+OFF_LVI); + while( inb(state->card->iobase+c->port+OFF_CR) & 0x02 ) ; + outl((u32)state->card->chandma + + c->num*sizeof(struct i810_channel), + state->card->iobase+c->port+OFF_BDBAR); + CIV_TO_LVI(state->card->iobase+c->port, 0); spin_unlock_irqrestore(&state->card->lock, flags); @@ -1020,13 +1085,13 @@ if(rec && dmabuf->count < dmabuf->dmasize && (dmabuf->trigger & PCM_ENABLE_INPUT)) { - outb((inb(port+OFF_CIV)+1)&31, port+OFF_LVI); + CIV_TO_LVI(port, 1); __start_adc(state); while( !(inb(port + OFF_CR) & ((1<<4) | (1<<2))) ) ; } else if (!rec && dmabuf->count && (dmabuf->trigger & PCM_ENABLE_OUTPUT)) { - outb((inb(port+OFF_CIV)+1)&31, port+OFF_LVI); + CIV_TO_LVI(port, 1); __start_dac(state); while( !(inb(port + OFF_CR) & ((1<<4) | (1<<2))) ) ; } @@ -1294,7 +1359,6 @@ if (dmabuf->enable & ADC_RUNNING) __stop_adc(state); dmabuf->enable = 0; - wake_up(&dmabuf->wait); #ifdef DEBUG_INTERRUPTS printk(" STOP "); #endif @@ -1740,9 +1804,11 @@ } if (c != NULL) { outb(2, state->card->iobase+c->port+OFF_CR); /* reset DMA machine */ - outl(virt_to_bus(&c->sg[0]), state->card->iobase+c->port+OFF_BDBAR); - outb(0, state->card->iobase+c->port+OFF_CIV); - outb(0, state->card->iobase+c->port+OFF_LVI); + while ( inb(state->card->iobase+c->port+OFF_CR) & 2 ); + outl((u32)state->card->chandma + + c->num*sizeof(struct i810_channel), + state->card->iobase+c->port+OFF_BDBAR); + CIV_TO_LVI(state->card->iobase+c->port, 0); } spin_unlock_irqrestore(&state->card->lock, flags); @@ -1864,7 +1930,8 @@ } /* ICH and ICH0 only support 2 channels */ - if ( state->card->pci_id == 0x2415 || state->card->pci_id == 0x2425 ) + if ( state->card->pci_id == PCI_DEVICE_ID_INTEL_82801 + || state->card->pci_id == PCI_DEVICE_ID_INTEL_82901) return put_user(2, (int *)arg); /* Multi-channel support was added with ICH2. Bits in */ @@ -1883,12 +1950,14 @@ switch ( val ) { case 2: /* 2 channels is always supported */ - outl(state->card->iobase + GLOB_CNT, (i_glob_cnt & 0xcfffff)); + outl(i_glob_cnt & 0xffcfffff, + state->card->iobase + GLOB_CNT); /* Do we need to change mixer settings???? */ break; case 4: /* Supported on some chipsets, better check first */ if ( state->card->channels >= 4 ) { - outl(state->card->iobase + GLOB_CNT, ((i_glob_cnt & 0xcfffff) | 0x0100000)); + outl((i_glob_cnt & 0xffcfffff) | 0x100000, + state->card->iobase + GLOB_CNT); /* Do we need to change mixer settings??? */ } else { val = ret; @@ -1896,7 +1965,8 @@ break; case 6: /* Supported on some chipsets, better check first */ if ( state->card->channels >= 6 ) { - outl(state->card->iobase + GLOB_CNT, ((i_glob_cnt & 0xcfffff) | 0x0200000)); + outl((i_glob_cnt & 0xffcfffff) | 0x200000, + state->card->iobase + GLOB_CNT); /* Do we need to change mixer settings??? */ } else { val = ret; @@ -2414,6 +2484,9 @@ i810_set_spdif_output(state, AC97_EA_SPSA_3_4, spdif_locked); } else { i810_set_dac_rate(state, 8000); + /* Put the ACLink in 2 channel mode by default */ + i = inl(card->iobase + GLOB_CNT); + outl(i & 0xffcfffff, card->iobase + GLOB_CNT); } } @@ -2478,27 +2551,86 @@ /* Write AC97 codec registers */ -static u16 i810_ac97_get(struct ac97_codec *dev, u8 reg) +static u16 i810_ac97_get_mmio(struct ac97_codec *dev, u8 reg) { struct i810_card *card = dev->private_data; int count = 100; - u8 reg_set = ((dev->id)?((reg&0x7f)|0x80):(reg&0x7f)); + u16 reg_set = IO_REG_OFF(dev) | (reg&0x7f); + + while(count-- && (readb(card->iobase_mmio + CAS) & 1)) + udelay(1); + +#ifdef DEBUG_MMIO + { + u16 ans = readw(card->ac97base_mmio + reg_set); + printk(KERN_DEBUG "i810_audio: ac97_get_mmio(%d) -> 0x%04X\n", ((int) reg_set) & 0xffff, (u32) ans); + return ans; + } +#else + return readw(card->ac97base_mmio + reg_set); +#endif +} +static u16 i810_ac97_get_io(struct ac97_codec *dev, u8 reg) +{ + struct i810_card *card = dev->private_data; + int count = 100; + u16 reg_set = IO_REG_OFF(dev) | (reg&0x7f); + while(count-- && (inb(card->iobase + CAS) & 1)) udelay(1); return inw(card->ac97base + reg_set); } -static void i810_ac97_set(struct ac97_codec *dev, u8 reg, u16 data) +static void i810_ac97_set_mmio(struct ac97_codec *dev, u8 reg, u16 data) { struct i810_card *card = dev->private_data; int count = 100; - u8 reg_set = ((dev->id)?((reg&0x7f)|0x80):(reg&0x7f)); + u16 reg_set = IO_REG_OFF(dev) | (reg&0x7f); + + while(count-- && (readb(card->iobase_mmio + CAS) & 1)) + udelay(1); + + writew(data, card->ac97base_mmio + reg_set); + +#ifdef DEBUG_MMIO + printk(KERN_DEBUG "i810_audio: ac97_set_mmio(0x%04X, %d)\n", (u32) data, ((int) reg_set) & 0xffff); +#endif +} +static void i810_ac97_set_io(struct ac97_codec *dev, u8 reg, u16 data) +{ + struct i810_card *card = dev->private_data; + int count = 100; + u16 reg_set = IO_REG_OFF(dev) | (reg&0x7f); + while(count-- && (inb(card->iobase + CAS) & 1)) udelay(1); - outw(data, card->ac97base + reg_set); + + outw(data, card->ac97base + reg_set); +} + +static u16 i810_ac97_get(struct ac97_codec *dev, u8 reg) +{ + struct i810_card *card = dev->private_data; + if (card->use_mmio) { + return i810_ac97_get_mmio(dev, reg); + } + else { + return i810_ac97_get_io(dev, reg); + } +} + +static void i810_ac97_set(struct ac97_codec *dev, u8 reg, u16 data) +{ + struct i810_card *card = dev->private_data; + if (card->use_mmio) { + i810_ac97_set_mmio(dev, reg, data); + } + else { + i810_ac97_set_io(dev, reg, data); + } } @@ -2523,7 +2655,7 @@ set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(HZ/20); } - for (i = 0; i < NR_AC97 && card && !card->initializing; i++) + for (i = 0; i < NR_AC97 && card && !card->initializing; i++) if (card->ac97_codec[i] != NULL && card->ac97_codec[i]->dev_mixer == minor) { file->private_data = card->ac97_codec[i]; @@ -2551,10 +2683,18 @@ /* AC97 codec initialisation. These small functions exist so we don't duplicate code between module init and apm resume */ -static inline int i810_ac97_exists(struct i810_card *card,int ac97_number) +static inline int i810_ac97_exists(struct i810_card *card, int ac97_number) { u32 reg = inl(card->iobase + GLOB_STA); - return (reg & (0x100 << ac97_number)); + switch (ac97_number) { + case 0: + return reg & (1<<8); + case 1: + return reg & (1<<9); + case 2: + return reg & (1<<28); + } + return 0; } static inline int i810_ac97_enable_variable_rate(struct ac97_codec *codec) @@ -2577,10 +2717,9 @@ /* power it all up */ i810_ac97_set(codec, AC97_POWER_CONTROL, i810_ac97_get(codec, AC97_POWER_CONTROL) & ~0x7f00); + /* wait for analog ready */ - for (i=10; - i && ((i810_ac97_get(codec, AC97_POWER_CONTROL) & 0xf) != 0xf); - i--) + for (i=10; i && ((i810_ac97_get(codec, AC97_POWER_CONTROL) & 0xf) != 0xf); i--) { set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(HZ/20); @@ -2588,11 +2727,18 @@ return i; } -/* if I knew what this did, I'd give it a better name */ -static int i810_ac97_random_init_stuff(struct i810_card *card) +/** + * i810_ac97_power_up_bus - bring up AC97 link + * @card : ICH audio device to power up + * + * Bring up the ACLink AC97 codec bus + */ + +static int i810_ac97_power_up_bus(struct i810_card *card) { u32 reg = inl(card->iobase + GLOB_CNT); int i; + int primary_codec_id = 0; if((reg&2)==0) /* Cold required */ reg|=2; @@ -2600,8 +2746,13 @@ reg|=4; /* Warm */ reg&=~8; /* ACLink on */ - outl(reg , card->iobase + GLOB_CNT); + /* At this point we deassert AC_RESET # */ + outl(reg , card->iobase + GLOB_CNT); + + /* We must now allow time for the Codec initialisation. + 600mS is the specified time */ + for(i=0;i<10;i++) { if((inl(card->iobase+GLOB_CNT)&4)==0) @@ -2618,7 +2769,31 @@ set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(HZ/2); - reg = inl(card->iobase + GLOB_STA); + + /* + * See if the primary codec comes ready. This must happen + * before we start doing DMA stuff + */ + /* see i810_ac97_init for the next 7 lines (jsaw) */ + inw(card->ac97base); + if ((card->pci_id == PCI_DEVICE_ID_INTEL_ICH4) + && (card->use_mmio)) { + primary_codec_id = (int) readl(card->iobase_mmio + SDM) & 0x3; + printk(KERN_INFO "i810_audio: Primary codec has ID %d\n", + primary_codec_id); + } + + if(! i810_ac97_exists(card, primary_codec_id)) + { + printk(KERN_INFO "i810_audio: Codec not ready.. wait.. "); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(HZ); /* actually 600mS by the spec */ + + if(i810_ac97_exists(card, primary_codec_id)) + printk("OK\n"); + else + printk("no response.\n"); + } inw(card->ac97base); return 1; } @@ -2626,12 +2801,14 @@ static int __init i810_ac97_init(struct i810_card *card) { int num_ac97 = 0; + int ac97_id; int total_channels = 0; + int nr_ac97_max = card_cap[card->pci_id_internal].nr_ac97; struct ac97_codec *codec; u16 eid; u32 reg; - if(!i810_ac97_random_init_stuff(card)) return 0; + if(!i810_ac97_power_up_bus(card)) return 0; /* Number of channels supported */ /* What about the codec? Just because the ICH supports */ @@ -2647,26 +2824,47 @@ card->channels = 6; else if ( reg & 0x0100000 ) card->channels = 4; - printk("i810_audio: Audio Controller supports %d channels.\n", card->channels); + printk(KERN_INFO "i810_audio: Audio Controller supports %d channels.\n", card->channels); + printk(KERN_INFO "i810_audio: Defaulting to base 2 channel mode.\n"); + reg = inl(card->iobase + GLOB_CNT); + outl(reg & 0xffcfffff, card->iobase + GLOB_CNT); - inw(card->ac97base); + for (num_ac97 = 0; num_ac97 < NR_AC97; num_ac97++) + card->ac97_codec[num_ac97] = NULL; - for (num_ac97 = 0; num_ac97 < NR_AC97; num_ac97++) { + /*@FIXME I don't know, if I'm playing to safe here... (jsaw) */ + if ((nr_ac97_max > 2) && !card->use_mmio) nr_ac97_max = 2; - /* Assume codec isn't available until we go through the - * gauntlet below */ - card->ac97_codec[num_ac97] = NULL; + for (num_ac97 = 0; num_ac97 < nr_ac97_max; num_ac97++) { + /* codec reset */ + printk(KERN_INFO "i810_audio: Resetting connection %d\n", num_ac97); + if (card->use_mmio) readw(card->ac97base_mmio + 0x80*num_ac97); + else inw(card->ac97base + 0x80*num_ac97); + + /* If we have the SDATA_IN Map Register, as on ICH4, we + do not loop thru all possible codec IDs but thru all + possible IO channels. Bit 0:1 of SDM then holds the + last codec ID spoken to. + */ + if ((card->pci_id == PCI_DEVICE_ID_INTEL_ICH4) + && (card->use_mmio)) { + ac97_id = (int) readl(card->iobase_mmio + SDM) & 0x3; + printk(KERN_INFO "i810_audio: Connection %d with codec id %d\n", + num_ac97, ac97_id); + } + else { + ac97_id = num_ac97; + } /* The ICH programmer's reference says you should */ /* check the ready status before probing. So we chk */ /* What do we do if it's not ready? Wait and try */ /* again, or abort? */ - if (!i810_ac97_exists(card,num_ac97)) { + if (!i810_ac97_exists(card, ac97_id)) { if(num_ac97 == 0) printk(KERN_ERR "i810_audio: Primary codec not ready.\n"); - break; /* I think this works, if not ready stop */ } - + if ((codec = kmalloc(sizeof(struct ac97_codec), GFP_KERNEL)) == NULL) return -ENOMEM; memset(codec, 0, sizeof(struct ac97_codec)); @@ -2674,13 +2872,20 @@ /* initialize some basic codec information, other fields will be filled in ac97_probe_codec */ codec->private_data = card; - codec->id = num_ac97; + codec->id = ac97_id; + card->ac97_id_map[ac97_id] = num_ac97 * 0x80; - codec->codec_read = i810_ac97_get; - codec->codec_write = i810_ac97_set; + if (card->use_mmio) { + codec->codec_read = i810_ac97_get_mmio; + codec->codec_write = i810_ac97_set_mmio; + } + else { + codec->codec_read = i810_ac97_get_io; + codec->codec_write = i810_ac97_set_io; + } if(!i810_ac97_probe_and_powerup(card,codec)) { - printk("i810_audio: timed out waiting for codec %d analog ready.\n", num_ac97); + printk(KERN_ERR "i810_audio: timed out waiting for codec %d analog ready.\n", ac97_id); kfree(codec); break; /* it didn't work */ } @@ -2689,7 +2894,7 @@ /* Don't attempt to get eid until powerup is complete */ eid = i810_ac97_get(codec, AC97_EXTENDED_ID); - + if(eid==0xFFFFFF) { printk(KERN_WARNING "i810_audio: no codec attached ?\n"); @@ -2697,16 +2902,27 @@ break; } + /* Check for an AC97 1.0 soft modem (ID1) */ + + if(codec->codec_read(codec, AC97_RESET) & 2) + { + printk(KERN_WARNING "i810_audio: codec %d is an AC97 1.0 softmodem - skipping.\n", ac97_id); + kfree(codec); + continue; + } + + /* Check for an AC97 2.x soft modem */ + codec->codec_write(codec, AC97_EXTENDED_MODEM_ID, 0L); - if(codec->codec_read(codec, AC97_EXTENDED_MODEM_ID)) + if(codec->codec_read(codec, AC97_EXTENDED_MODEM_ID) & 1) { - printk(KERN_WARNING "i810_audio: codec %d is a softmodem - skipping.\n", num_ac97); + printk(KERN_WARNING "i810_audio: codec %d is an AC97 2.x softmodem - skipping.\n", ac97_id); kfree(codec); continue; } card->ac97_features = eid; - + /* Now check the codec for useful features to make up for the dumbness of the 810 hardware engine */ @@ -2720,6 +2936,11 @@ } } + /* Turn on the amplifier */ + + codec->codec_write(codec, AC97_POWER_CONTROL, + codec->codec_read(codec, AC97_POWER_CONTROL) & ~0x8000); + /* Determine how many channels the codec(s) support */ /* - The primary codec always supports 2 */ /* - If the codec supports AMAP, surround DACs will */ @@ -2745,7 +2966,7 @@ total_channels += 2; if (eid & 0x0140) /* LFE and Center channels */ total_channels += 2; - printk("i810_audio: AC'97 codec %d supports AMAP, total channels = %d\n", num_ac97, total_channels); + printk("i810_audio: AC'97 codec %d supports AMAP, total channels = %d\n", ac97_id, total_channels); } else if (eid & 0x0400) { /* this only works on 2.2 compliant codecs */ eid &= 0xffcf; if((eid & 0xc000) != 0) { @@ -2767,14 +2988,14 @@ } i810_ac97_set(codec, AC97_EXTENDED_ID, eid); eid = i810_ac97_get(codec, AC97_EXTENDED_ID); - printk("i810_audio: AC'97 codec %d, new EID value = 0x%04x\n", num_ac97, eid); + printk("i810_audio: AC'97 codec %d, new EID value = 0x%04x\n", ac97_id, eid); if (eid & 0x0080) /* L/R Surround channels */ total_channels += 2; if (eid & 0x0140) /* LFE and Center channels */ total_channels += 2; - printk("i810_audio: AC'97 codec %d, DAC map configured, total channels = %d\n", num_ac97, total_channels); + printk("i810_audio: AC'97 codec %d, DAC map configured, total channels = %d\n", ac97_id, total_channels); } else { - printk("i810_audio: AC'97 codec %d Unable to map surround DAC's (or DAC's not present), total channels = %d\n", num_ac97, total_channels); + printk("i810_audio: AC'97 codec %d Unable to map surround DAC's (or DAC's not present), total channels = %d\n", ac97_id, total_channels); } if ((codec->dev_mixer = register_sound_mixer(&i810_mixer_fops, -1)) < 0) { @@ -2823,6 +3044,8 @@ init_MUTEX(&state->open_sem); dmabuf->fmt = I810_FMT_STEREO | I810_FMT_16BIT; dmabuf->trigger = PCM_ENABLE_OUTPUT; + i810_set_spdif_output(state, -1, 0); + i810_set_dac_channels(state, 2); i810_set_dac_rate(state, 48000); if(prog_dmabuf(state, 0) != 0) { goto config_out_nodmabuf; @@ -2831,7 +3054,8 @@ goto config_out; } dmabuf->count = dmabuf->dmasize; - outb(31,card->iobase+dmabuf->write_channel->port+OFF_LVI); + stop_dac(state); + CIV_TO_LVI(card->iobase+dmabuf->write_channel->port, -1); save_flags(flags); cli(); start_dac(state); @@ -2839,10 +3063,9 @@ mdelay(50); new_offset = i810_get_dma_addr(state, 0); stop_dac(state); - outb(2,card->iobase+dmabuf->write_channel->port+OFF_CR); restore_flags(flags); i = new_offset - offset; -#ifdef DEBUG +#ifdef DEBUG_INTERRUPTS printk("i810_audio: %d bytes in 50 milliseconds\n", i); #endif if(i == 0) @@ -2884,10 +3107,25 @@ memset(card, 0, sizeof(*card)); card->initializing = 1; - card->iobase = pci_resource_start (pci_dev, 1); - card->ac97base = pci_resource_start (pci_dev, 0); card->pci_dev = pci_dev; card->pci_id = pci_id->device; + card->ac97base = pci_resource_start (pci_dev, 0); + card->iobase = pci_resource_start (pci_dev, 1); + + /* if chipset could have mmio capability, check it */ + if (card_cap[pci_id->driver_data].flags & CAP_MMIO) { + card->ac97base_mmio_phys = pci_resource_start (pci_dev, 2); + card->iobase_mmio_phys = pci_resource_start (pci_dev, 3); + + if ((card->ac97base_mmio_phys) && (card->iobase_mmio_phys)) { + card->use_mmio = 1; + } + else { + card->ac97base_mmio_phys = 0; + card->iobase_mmio_phys = 0; + } + } + card->irq = pci_dev->irq; card->next = devs; card->magic = I810_CARD_MAGIC; @@ -2899,23 +3137,37 @@ pci_set_master(pci_dev); - printk(KERN_INFO "i810: %s found at IO 0x%04lx and 0x%04lx, IRQ %d\n", - card_names[pci_id->driver_data], card->iobase, card->ac97base, + printk(KERN_INFO "i810: %s found at IO 0x%04lx and 0x%04lx, " + "MEM 0x%04lx and 0x%04lx, IRQ %d\n", + card_names[pci_id->driver_data], + card->iobase, card->ac97base, + card->ac97base_mmio_phys, card->iobase_mmio_phys, card->irq); card->alloc_pcm_channel = i810_alloc_pcm_channel; card->alloc_rec_pcm_channel = i810_alloc_rec_pcm_channel; card->alloc_rec_mic_channel = i810_alloc_rec_mic_channel; card->free_pcm_channel = i810_free_pcm_channel; - card->channel[0].offset = 0; - card->channel[0].port = 0x00; - card->channel[0].num=0; - card->channel[1].offset = 0; - card->channel[1].port = 0x10; - card->channel[1].num=1; - card->channel[2].offset = 0; - card->channel[2].port = 0x20; - card->channel[2].num=2; + + if ((card->channel = pci_alloc_consistent(pci_dev, + sizeof(struct i810_channel)*NR_HW_CH, &card->chandma)) == NULL) { + printk(KERN_ERR "i810: cannot allocate channel DMA memory\n"); + goto out_mem; + } + + { /* We may dispose of this altogether some time soon, so... */ + struct i810_channel *cp = card->channel; + + cp[0].offset = 0; + cp[0].port = 0x00; + cp[0].num = 0; + cp[1].offset = 0; + cp[1].port = 0x10; + cp[1].num = 1; + cp[2].offset = 0; + cp[2].port = 0x20; + cp[2].num = 2; + } /* claim our iospace and irq */ request_region(card->iobase, 64, card_names[pci_id->driver_data]); @@ -2924,19 +3176,42 @@ if (request_irq(card->irq, &i810_interrupt, SA_SHIRQ, card_names[pci_id->driver_data], card)) { printk(KERN_ERR "i810_audio: unable to allocate irq %d\n", card->irq); - release_region(card->iobase, 64); - release_region(card->ac97base, 256); - kfree(card); - return -ENODEV; + goto out_pio; + } + + if (card->use_mmio) { + if (request_mem_region(card->ac97base_mmio_phys, 512, "ich_audio MMBAR")) { + if ((card->ac97base_mmio = ioremap(card->ac97base_mmio_phys, 512))) { /*@FIXME can ioremap fail? don't know (jsaw) */ + if (request_mem_region(card->iobase_mmio_phys, 256, "ich_audio MBBAR")) { + if ((card->iobase_mmio = ioremap(card->iobase_mmio_phys, 256))) { + printk(KERN_INFO "i810: %s mmio at 0x%04lx and 0x%04lx\n", + card_names[pci_id->driver_data], + (unsigned long) card->ac97base_mmio, + (unsigned long) card->iobase_mmio); + } + else { + iounmap(card->ac97base_mmio); + release_mem_region(card->ac97base_mmio_phys, 512); + release_mem_region(card->iobase_mmio_phys, 512); + card->use_mmio = 0; + } + } + else { + iounmap(card->ac97base_mmio); + release_mem_region(card->ac97base_mmio_phys, 512); + card->use_mmio = 0; + } + } + } + else { + card->use_mmio = 0; + } } /* initialize AC97 codec and register /dev/mixer */ if (i810_ac97_init(card) <= 0) { - release_region(card->iobase, 64); - release_region(card->ac97base, 256); free_irq(card->irq, card); - kfree(card); - return -ENODEV; + goto out_iospace; } pci_set_drvdata(pci_dev, card); @@ -2949,19 +3224,34 @@ if ((card->dev_audio = register_sound_dsp(&i810_audio_fops, -1)) < 0) { int i; printk(KERN_ERR "i810_audio: couldn't register DSP device!\n"); - release_region(card->iobase, 64); - release_region(card->ac97base, 256); free_irq(card->irq, card); for (i = 0; i < NR_AC97; i++) if (card->ac97_codec[i] != NULL) { unregister_sound_mixer(card->ac97_codec[i]->dev_mixer); kfree (card->ac97_codec[i]); } - kfree(card); - return -ENODEV; + goto out_iospace; } + card->initializing = 0; return 0; + +out_iospace: + if (card->use_mmio) { + iounmap(card->ac97base_mmio); + iounmap(card->iobase_mmio); + release_mem_region(card->ac97base_mmio_phys, 512); + release_mem_region(card->iobase_mmio_phys, 256); + } +out_pio: + release_region(card->iobase, 64); + release_region(card->ac97base, 256); +out_chan: + pci_free_consistent(pci_dev, sizeof(struct i810_channel)*NR_HW_CH, + card->channel, card->chandma); +out_mem: + kfree(card); + return -ENODEV; } static void __devexit i810_remove(struct pci_dev *pci_dev) @@ -2972,6 +3262,12 @@ free_irq(card->irq, devs); release_region(card->iobase, 64); release_region(card->ac97base, 256); + if (card->use_mmio) { + iounmap(card->ac97base_mmio); + iounmap(card->iobase_mmio); + release_mem_region(card->ac97base_mmio_phys, 512); + release_mem_region(card->iobase_mmio_phys, 256); + } /* unregister audio devices */ for (i = 0; i < NR_AC97; i++) @@ -3054,7 +3350,7 @@ hardware has to be more or less completely reinitialized from scratch after an apm suspend. Works For Me. -dan */ - i810_ac97_random_init_stuff(card); + i810_ac97_power_up_bus(card); for (num_ac97 = 0; num_ac97 < NR_AC97; num_ac97++) { struct ac97_codec *codec = card->ac97_codec[num_ac97]; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/sound/Makefile linux.20pre5-ac2/drivers/sound/Makefile --- linux.20pre5/drivers/sound/Makefile 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/sound/Makefile 2002-08-23 01:07:36.000000000 +0100 @@ -71,6 +71,7 @@ obj-$(CONFIG_SOUND_FUSION) += cs46xx.o ac97_codec.o obj-$(CONFIG_SOUND_MAESTRO) += maestro.o obj-$(CONFIG_SOUND_MAESTRO3) += maestro3.o ac97_codec.o +obj-$(CONFIG_SOUND_FORTE) += forte.o ac97_codec.o obj-$(CONFIG_SOUND_TRIDENT) += trident.o ac97_codec.o obj-$(CONFIG_SOUND_HARMONY) += harmony.o obj-$(CONFIG_SOUND_EMU10K1) += ac97_codec.o diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/tc/tc.c linux.20pre5-ac2/drivers/tc/tc.c --- linux.20pre5/drivers/tc/tc.c 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/tc/tc.c 2002-09-01 13:23:26.000000000 +0100 @@ -40,7 +40,7 @@ * Interface to the world. Read comment in include/asm-mips/tc.h. */ -int search_tc_card(char *name) +int search_tc_card(const char *name) { int slot; slot_info *sip; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/bluetooth.c linux.20pre5-ac2/drivers/usb/bluetooth.c --- linux.20pre5/drivers/usb/bluetooth.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/bluetooth.c 2002-09-01 13:32:48.000000000 +0100 @@ -4,8 +4,12 @@ * Copyright (c) 2000, 2001 Greg Kroah-Hartman * Copyright (c) 2000 Mark Douglas Corner * - * USB Bluetooth driver, based on the Bluetooth Spec version 1.0B + * USB Bluetooth TTY driver, based on the Bluetooth Spec version 1.0B * + * (2001/11/30) Version 0.13 gkh + * - added locking patch from Masoodur Rahman + * - removed active variable, as open_count will do. + * * (2001/07/09) Version 0.12 gkh * - removed in_interrupt() call, as it doesn't make sense to do * that anymore. @@ -100,17 +104,14 @@ #include -#include -#include #include -#include #include #include -#include #include #include #include #include +#include #define DEBUG #include @@ -118,7 +119,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v0.12" +#define DRIVER_VERSION "v0.13" #define DRIVER_AUTHOR "Greg Kroah-Hartman, Mark Douglas Corner" #define DRIVER_DESC "USB Bluetooth tty driver" @@ -170,8 +171,8 @@ struct tty_struct * tty; /* the coresponding tty for this port */ unsigned char minor; /* the starting minor number for this device */ - char active; /* someone has this device open */ int throttle; /* throttled by tty layer */ + int open_count; __u8 control_out_bInterfaceNum; struct urb * control_urb_pool[NUM_CONTROL_URBS]; @@ -200,6 +201,7 @@ unsigned char int_buffer[EVENT_BUFFER_SIZE]; unsigned int bulk_packet_pos; unsigned char bulk_buffer[ACL_BUFFER_SIZE]; /* 64k preallocated, fix? */ + struct semaphore lock; }; @@ -232,10 +234,10 @@ MODULE_DEVICE_TABLE (usb, usb_bluetooth_ids); static struct usb_driver usb_bluetooth_driver = { - name: "bluetooth", - probe: usb_bluetooth_probe, - disconnect: usb_bluetooth_disconnect, - id_table: usb_bluetooth_ids, + .name = "bluetty", + .probe = usb_bluetooth_probe, + .disconnect = usb_bluetooth_disconnect, + .id_table = usb_bluetooth_ids, }; static int bluetooth_refcount; @@ -320,7 +322,7 @@ } memcpy (urb->transfer_buffer, buf, len); - dr->bRequestType = BLUETOOTH_CONTROL_REQUEST_TYPE; + dr->bRequestType= BLUETOOTH_CONTROL_REQUEST_TYPE; dr->bRequest = request; dr->wValue = cpu_to_le16((u16) value); dr->wIndex = cpu_to_le16((u16) bluetooth->control_out_bInterfaceNum); @@ -361,43 +363,46 @@ return -ENODEV; } - if (bluetooth->active) { - dbg ("%s - device already open", __FUNCTION__); - return -EINVAL; - } - - /* set up our structure making the tty driver remember our object, and us it */ - tty->driver_data = bluetooth; - bluetooth->tty = tty; - - /* force low_latency on so that our tty_push actually forces the data through, - * otherwise it is scheduled, and with high data rates (like with OHCI) data - * can get lost. */ - bluetooth->tty->low_latency = 1; + down (&bluetooth->lock); + + ++bluetooth->open_count; + if (bluetooth->open_count == 1) { + /* set up our structure making the tty driver remember our object, and us it */ + tty->driver_data = bluetooth; + bluetooth->tty = tty; + + /* force low_latency on so that our tty_push actually forces the data through, + * otherwise it is scheduled, and with high data rates (like with OHCI) data + * can get lost. */ + bluetooth->tty->low_latency = 1; - bluetooth->active = 1; - - /* Reset the packet position counters */ - bluetooth->int_packet_pos = 0; - bluetooth->bulk_packet_pos = 0; + /* Reset the packet position counters */ + bluetooth->int_packet_pos = 0; + bluetooth->bulk_packet_pos = 0; #ifndef BTBUGGYHARDWARE - /* Start reading from the device */ - FILL_BULK_URB(bluetooth->read_urb, bluetooth->dev, - usb_rcvbulkpipe(bluetooth->dev, bluetooth->bulk_in_endpointAddress), - bluetooth->bulk_in_buffer, bluetooth->bulk_in_buffer_size, - bluetooth_read_bulk_callback, bluetooth); - result = usb_submit_urb(bluetooth->read_urb); - if (result) - dbg("%s - usb_submit_urb(read bulk) failed with status %d", __FUNCTION__, result); + /* Start reading from the device */ + FILL_BULK_URB (bluetooth->read_urb, bluetooth->dev, + usb_rcvbulkpipe(bluetooth->dev, bluetooth->bulk_in_endpointAddress), + bluetooth->bulk_in_buffer, + bluetooth->bulk_in_buffer_size, + bluetooth_read_bulk_callback, bluetooth); + result = usb_submit_urb(bluetooth->read_urb); + if (result) + dbg("%s - usb_submit_urb(read bulk) failed with status %d", __FUNCTION__, result); #endif - FILL_INT_URB(bluetooth->interrupt_in_urb, bluetooth->dev, - usb_rcvintpipe(bluetooth->dev, bluetooth->interrupt_in_endpointAddress), - bluetooth->interrupt_in_buffer, bluetooth->interrupt_in_buffer_size, - bluetooth_int_callback, bluetooth, bluetooth->interrupt_in_interval); - result = usb_submit_urb(bluetooth->interrupt_in_urb); - if (result) - dbg("%s - usb_submit_urb(interrupt in) failed with status %d", __FUNCTION__, result); + FILL_INT_URB (bluetooth->interrupt_in_urb, bluetooth->dev, + usb_rcvintpipe(bluetooth->dev, bluetooth->interrupt_in_endpointAddress), + bluetooth->interrupt_in_buffer, + bluetooth->interrupt_in_buffer_size, + bluetooth_int_callback, bluetooth, + bluetooth->interrupt_in_interval); + result = usb_submit_urb(bluetooth->interrupt_in_urb); + if (result) + dbg("%s - usb_submit_urb(interrupt in) failed with status %d", __FUNCTION__, result); + } + + up(&bluetooth->lock); return 0; } @@ -414,18 +419,24 @@ dbg("%s", __FUNCTION__); - if (!bluetooth->active) { + if (!bluetooth->open_count) { dbg ("%s - device not opened", __FUNCTION__); return; } - /* shutdown any bulk reads and writes that might be going on */ - for (i = 0; i < NUM_BULK_URBS; ++i) - usb_unlink_urb (bluetooth->write_urb_pool[i]); - usb_unlink_urb (bluetooth->read_urb); - usb_unlink_urb (bluetooth->interrupt_in_urb); - - bluetooth->active = 0; + down (&bluetooth->lock); + + --bluetooth->open_count; + if (bluetooth->open_count <= 0) { + bluetooth->open_count = 0; + + /* shutdown any bulk reads and writes that might be going on */ + for (i = 0; i < NUM_BULK_URBS; ++i) + usb_unlink_urb (bluetooth->write_urb_pool[i]); + usb_unlink_urb (bluetooth->read_urb); + usb_unlink_urb (bluetooth->interrupt_in_urb); + } + up(&bluetooth->lock); } @@ -447,7 +458,7 @@ dbg("%s - %d byte(s)", __FUNCTION__, count); - if (!bluetooth->active) { + if (!bluetooth->open_count) { dbg ("%s - device not opened", __FUNCTION__); return -EINVAL; } @@ -476,7 +487,10 @@ retval = -ENOMEM; goto exit; } - copy_from_user (temp_buffer, buf, count); + if (copy_from_user (temp_buffer, buf, count)) { + retval = -EFAULT; + goto exit; + } current_buffer = temp_buffer; } else { current_buffer = buf; @@ -572,7 +586,7 @@ dbg("%s", __FUNCTION__); - if (!bluetooth->active) { + if (!bluetooth->open_count) { dbg ("%s - device not open", __FUNCTION__); return -EINVAL; } @@ -598,7 +612,7 @@ return -ENODEV; } - if (!bluetooth->active) { + if (!bluetooth->open_count) { dbg ("%s - device not open", __FUNCTION__); return -EINVAL; } @@ -624,7 +638,7 @@ dbg("%s", __FUNCTION__); - if (!bluetooth->active) { + if (!bluetooth->open_count) { dbg ("%s - device not open", __FUNCTION__); return; } @@ -645,7 +659,7 @@ dbg("%s", __FUNCTION__); - if (!bluetooth->active) { + if (!bluetooth->open_count) { dbg ("%s - device not open", __FUNCTION__); return; } @@ -664,7 +678,7 @@ dbg("%s - cmd 0x%.4x", __FUNCTION__, cmd); - if (!bluetooth->active) { + if (!bluetooth->open_count) { dbg ("%s - device not open", __FUNCTION__); return -ENODEV; } @@ -684,7 +698,7 @@ dbg("%s", __FUNCTION__); - if (!bluetooth->active) { + if (!bluetooth->open_count) { dbg ("%s - device not open", __FUNCTION__); return; } @@ -706,7 +720,7 @@ dbg("%s", __FUNCTION__); - if (!bluetooth->active) { + if (!bluetooth->open_count) { dbg ("%s - device not open", __FUNCTION__); return; } @@ -731,7 +745,7 @@ dbg("%s", __FUNCTION__); - if (!bluetooth->active) { + if (!bluetooth->open_count) { dbg ("%s - device not open", __FUNCTION__); return; } @@ -961,7 +975,7 @@ } exit: - if (!bluetooth || !bluetooth->active) + if (!bluetooth || !bluetooth->open_count) return; FILL_BULK_URB(bluetooth->read_urb, bluetooth->dev, @@ -1102,6 +1116,7 @@ bluetooth->minor = minor; bluetooth->tqueue.routine = bluetooth_softint; bluetooth->tqueue.data = bluetooth; + init_MUTEX(&bluetooth->lock); /* record the interface number for the control out */ bluetooth->control_out_bInterfaceNum = control_out_endpoint; @@ -1216,10 +1231,10 @@ int i; if (bluetooth) { - if ((bluetooth->active) && (bluetooth->tty)) + if ((bluetooth->open_count) && (bluetooth->tty)) tty_hangup(bluetooth->tty); - bluetooth->active = 0; + bluetooth->open_count = 0; if (bluetooth->read_urb) { usb_unlink_urb (bluetooth->read_urb); @@ -1270,30 +1285,30 @@ static struct tty_driver bluetooth_tty_driver = { - magic: TTY_DRIVER_MAGIC, - driver_name: "usb-bluetooth", - name: "usb/ttub/%d", - major: BLUETOOTH_TTY_MAJOR, - minor_start: 0, - num: BLUETOOTH_TTY_MINORS, - type: TTY_DRIVER_TYPE_SERIAL, - subtype: SERIAL_TYPE_NORMAL, - flags: TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS, - - refcount: &bluetooth_refcount, - table: bluetooth_tty, - termios: bluetooth_termios, - termios_locked: bluetooth_termios_locked, - - open: bluetooth_open, - close: bluetooth_close, - write: bluetooth_write, - write_room: bluetooth_write_room, - ioctl: bluetooth_ioctl, - set_termios: bluetooth_set_termios, - throttle: bluetooth_throttle, - unthrottle: bluetooth_unthrottle, - chars_in_buffer: bluetooth_chars_in_buffer, + .magic = TTY_DRIVER_MAGIC, + .driver_name = "usb-bluetooth", + .name = "usb/ttub/%d", + .major = BLUETOOTH_TTY_MAJOR, + .minor_start = 0, + .num = BLUETOOTH_TTY_MINORS, + .type = TTY_DRIVER_TYPE_SERIAL, + .subtype = SERIAL_TYPE_NORMAL, + .flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS, + + .refcount = &bluetooth_refcount, + .table = bluetooth_tty, + .termios = bluetooth_termios, + .termios_locked = bluetooth_termios_locked, + + .open = bluetooth_open, + .close = bluetooth_close, + .write = bluetooth_write, + .write_room = bluetooth_write_room, + .ioctl = bluetooth_ioctl, + .set_termios = bluetooth_set_termios, + .throttle = bluetooth_throttle, + .unthrottle = bluetooth_unthrottle, + .chars_in_buffer = bluetooth_chars_in_buffer, }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/brlvger.c linux.20pre5-ac2/drivers/usb/brlvger.c --- linux.20pre5/drivers/usb/brlvger.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/brlvger.c 2002-08-25 15:58:19.000000000 +0100 @@ -209,7 +209,7 @@ ({ printk(KERN_ERR "Voyager: " args); \ printk("\n"); }) #define dbgprint(fmt, args...) \ - ({ printk(KERN_DEBUG "Voyager: %s: " fmt, __FUNCTION__, ##args); \ + ({ printk(KERN_DEBUG "Voyager: %s: " fmt, __FUNCTION__ , ##args); \ printk("\n"); }) #define dbg(args...) \ ({ if(debug >= 1) dbgprint(args); }) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/Config.in linux.20pre5-ac2/drivers/usb/Config.in --- linux.20pre5/drivers/usb/Config.in 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/Config.in 2002-09-01 13:31:59.000000000 +0100 @@ -106,5 +106,6 @@ dep_tristate ' USB Auerswald ISDN support (EXPERIMENTAL)' CONFIG_USB_AUERSWALD $CONFIG_USB $CONFIG_EXPERIMENTAL dep_tristate ' Texas Instruments Graph Link USB (aka SilverLink) cable support' CONFIG_USB_TIGL $CONFIG_USB dep_tristate ' Tieman Voyager USB Braille display support (EXPERIMENTAL)' CONFIG_USB_BRLVGER $CONFIG_USB $CONFIG_EXPERIMENTAL + dep_tristate ' USB LCD device support' CONFIG_USB_LCD $CONFIG_USB fi endmenu diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/hid-core.c linux.20pre5-ac2/drivers/usb/hid-core.c --- linux.20pre5/drivers/usb/hid-core.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/hid-core.c 2002-09-01 13:41:08.000000000 +0100 @@ -1065,8 +1065,8 @@ list = report_enum->report_list.next; while (list != &report_enum->report_list) { report = (struct hid_report *) list; - usb_set_idle(hid->dev, hid->ifnum, 0, report->id); hid_read_report(hid, report); + usb_set_idle(hid->dev, hid->ifnum, 0, report->id); list = list->next; } } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/kaweth.c linux.20pre5-ac2/drivers/usb/kaweth.c --- linux.20pre5/drivers/usb/kaweth.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/kaweth.c 2002-09-01 13:45:23.000000000 +0100 @@ -5,17 +5,18 @@ * (c) 2000 Interlan Communications * (c) 2000 Stephane Alnet * (C) 2001 Brad Hards + * (C) 2002 Oliver Neukum * * Original author: The Zapman - * Inspired by, and much credit goes to Michael Rothwell + * Inspired by, and much credit goes to Michael Rothwell * for the test equipment, help, and patience * Based off of (and with thanks to) Petko Manolov's pegaus.c driver. - * Also many thanks to Joel Silverman and Ed Surprenant at Kawasaki + * Also many thanks to Joel Silverman and Ed Surprenant at Kawasaki * for providing the firmware and driver resources. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2, or + * published by the Free Software Foundation; either version 2, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -25,7 +26,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ****************************************************************/ @@ -36,8 +37,8 @@ * Fix bugs from previous two steps * Snoop other OSs for any tricks we're not doing * SMP locking - * Reduce arbitrary timeouts - * Smart multicast support + * Reduce arbitrary timeouts + * Smart multicast support * Temporary MAC change support * Tunable SOFs parameter - ioctl()? * Ethernet stats collection @@ -57,6 +58,7 @@ #include #include #include +#include #define DEBUG @@ -75,6 +77,7 @@ #define KAWETH_MTU 1514 #define KAWETH_BUF_SIZE 1664 #define KAWETH_TX_TIMEOUT (5 * HZ) +#define KAWETH_SCRATCH_SIZE 32 #define KAWETH_FIRMWARE_BUF_SIZE 4096 #define KAWETH_CONTROL_TIMEOUT (30 * HZ) @@ -100,8 +103,14 @@ #define KAWETH_SOFS_TO_WAIT 0x05 +#define INTBUFFERSIZE 4 -MODULE_AUTHOR("Michael Zappe , Stephane Alnet and Brad Hards "); +#define STATE_OFFSET 0 +#define STATE_MASK 0x40 +#define STATE_SHIFT 5 + + +MODULE_AUTHOR("Michael Zappe , Stephane Alnet , Brad Hards and Oliver Neukum "); MODULE_DESCRIPTION("KL5USB101 USB Ethernet driver"); MODULE_LICENSE("GPL"); @@ -112,28 +121,28 @@ ); static void kaweth_disconnect(struct usb_device *dev, void *ptr); int kaweth_internal_control_msg(struct usb_device *usb_dev, unsigned int pipe, - struct usb_ctrlrequest *cmd, void *data, int len, - int timeout); + struct usb_ctrlrequest *cmd, void *data, + int len, int timeout); /**************************************************************** * usb_device_id ****************************************************************/ static struct usb_device_id usb_klsi_table[] = { - { USB_DEVICE(0x03e8, 0x0008) }, /* AOX Endpoints USB Ethernet */ + { USB_DEVICE(0x03e8, 0x0008) }, /* AOX Endpoints USB Ethernet */ { USB_DEVICE(0x04bb, 0x0901) }, /* I-O DATA USB-ET/T */ - { USB_DEVICE(0x0506, 0x03e8) }, /* 3Com 3C19250 */ - { USB_DEVICE(0x0557, 0x2002) }, /* ATEN USB Ethernet */ - { USB_DEVICE(0x0557, 0x4000) }, /* D-Link DSB-650C */ + { USB_DEVICE(0x0506, 0x03e8) }, /* 3Com 3C19250 */ + { USB_DEVICE(0x0557, 0x2002) }, /* ATEN USB Ethernet */ + { USB_DEVICE(0x0557, 0x4000) }, /* D-Link DSB-650C */ { USB_DEVICE(0x0565, 0x0002) }, /* Peracom Enet */ { USB_DEVICE(0x0565, 0x0003) }, /* Optus@Home UEP1045A */ - { USB_DEVICE(0x0565, 0x0005) }, /* Peracom Enet2 */ + { USB_DEVICE(0x0565, 0x0005) }, /* Peracom Enet2 */ { USB_DEVICE(0x05e9, 0x0008) }, /* KLSI KL5KUSB101B */ { USB_DEVICE(0x05e9, 0x0009) }, /* KLSI KL5KUSB101B (Board change) */ - { USB_DEVICE(0x066b, 0x2202) }, /* Linksys USB10T */ - { USB_DEVICE(0x06e1, 0x0008) }, /* ADS USB-10BT */ - { USB_DEVICE(0x06e1, 0x0009) }, /* ADS USB-10BT */ - { USB_DEVICE(0x0707, 0x0100) }, /* SMC 2202USB */ - { USB_DEVICE(0x07aa, 0x0001) }, /* Correga K.K. */ + { USB_DEVICE(0x066b, 0x2202) }, /* Linksys USB10T */ + { USB_DEVICE(0x06e1, 0x0008) }, /* ADS USB-10BT */ + { USB_DEVICE(0x06e1, 0x0009) }, /* ADS USB-10BT */ + { USB_DEVICE(0x0707, 0x0100) }, /* SMC 2202USB */ + { USB_DEVICE(0x07aa, 0x0001) }, /* Correga K.K. */ { USB_DEVICE(0x07b8, 0x4000) }, /* D-Link DU-E10 */ { USB_DEVICE(0x0846, 0x1001) }, /* NetGear EA-101 */ { USB_DEVICE(0x0846, 0x1002) }, /* NetGear EA-101 */ @@ -145,10 +154,10 @@ { USB_DEVICE(0x10bd, 0x1427) }, /* ASANTE USB To Ethernet Adapter */ { USB_DEVICE(0x1342, 0x0204) }, /* Mobility USB-Ethernet Adapter */ { USB_DEVICE(0x13d2, 0x0400) }, /* Shark Pocket Adapter */ - { USB_DEVICE(0x1485, 0x0001) }, /* Silicom USB-Ethernet Adapter */ - { USB_DEVICE(0x1645, 0x0005) }, /* Entrega E45 */ - { USB_DEVICE(0x1645, 0x0008) }, /* Entrega USB Ethernet Adapter */ - { USB_DEVICE(0x1645, 0x8005) }, /* PortGear Ethernet Adapter */ + { USB_DEVICE(0x1485, 0x0001) }, /* Silicom U2E */ + { USB_DEVICE(0x1645, 0x0005) }, /* Entrega E45 */ + { USB_DEVICE(0x1645, 0x0008) }, /* Entrega USB Ethernet Adapter */ + { USB_DEVICE(0x1645, 0x8005) }, /* PortGear Ethernet Adapter */ { USB_DEVICE(0x2001, 0x4000) }, /* D-link DSB-650C */ {} /* Null terminator */ }; @@ -159,10 +168,10 @@ * kaweth_driver ****************************************************************/ static struct usb_driver kaweth_driver = { - name: "kaweth", - probe: kaweth_probe, - disconnect: kaweth_disconnect, - id_table: usb_klsi_table, + .name = "kaweth", + .probe = kaweth_probe, + .disconnect = kaweth_disconnect, + .id_table = usb_klsi_table, }; typedef __u8 eth_addr_t[6]; @@ -201,17 +210,25 @@ spinlock_t device_lock; __u32 status; + int end; + int removed; + int suspend_lowmem; + int linkstate; struct usb_device *dev; struct net_device *net; - wait_queue_head_t control_wait; + wait_queue_head_t term_wait; struct urb *rx_urb; struct urb *tx_urb; + struct urb *irq_urb; - __u8 firmware_buf[KAWETH_FIRMWARE_BUF_SIZE]; - __u8 tx_buf[KAWETH_BUF_SIZE]; + struct sk_buff *tx_skb; + + __u8 *firmware_buf; + __u8 scratch[KAWETH_SCRATCH_SIZE]; __u8 rx_buf[KAWETH_BUF_SIZE]; + __u8 intbuffer[INTBUFFERSIZE]; __u16 packet_filter_bitmap; struct kaweth_ethernet_configuration configuration; @@ -224,13 +241,13 @@ * kaweth_control ****************************************************************/ static int kaweth_control(struct kaweth_device *kaweth, - unsigned int pipe, - __u8 request, - __u8 requesttype, - __u16 value, + unsigned int pipe, + __u8 request, + __u8 requesttype, + __u16 value, __u16 index, - void *data, - __u16 size, + void *data, + __u16 size, int timeout) { struct usb_ctrlrequest *dr; @@ -244,13 +261,12 @@ dr = kmalloc(sizeof(struct usb_ctrlrequest), GFP_ATOMIC); - if(!dr) - { + if (!dr) { kaweth_dbg("kmalloc() failed"); return -ENOMEM; } - - dr->bRequestType = requesttype; + + dr->bRequestType= requesttype; dr->bRequest = request; dr->wValue = cpu_to_le16p(&value); dr->wIndex = cpu_to_le16p(&index); @@ -301,7 +317,7 @@ USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE, urb_size, 0, - (void *)&kaweth->firmware_buf, + (void *)&kaweth->scratch, 0, KAWETH_CONTROL_TIMEOUT); @@ -323,7 +339,7 @@ USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE, sofs_wait, 0, - (void *)&kaweth->firmware_buf, + (void *)&kaweth->scratch, 0, KAWETH_CONTROL_TIMEOUT); @@ -346,7 +362,7 @@ USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE, receive_filter, 0, - (void *)&kaweth->firmware_buf, + (void *)&kaweth->scratch, 0, KAWETH_CONTROL_TIMEOUT); @@ -356,19 +372,19 @@ /**************************************************************** * kaweth_download_firmware ****************************************************************/ -static int kaweth_download_firmware(struct kaweth_device *kaweth, - __u8 *data, +static int kaweth_download_firmware(struct kaweth_device *kaweth, + __u8 *data, __u16 data_len, __u8 interrupt, __u8 type) -{ +{ if(data_len > KAWETH_FIRMWARE_BUF_SIZE) { kaweth_err("Firmware too big: %d", data_len); return -ENOSPC; } - + memcpy(kaweth->firmware_buf, data, data_len); - + kaweth->firmware_buf[2] = (data_len & 0xFF) - 7; kaweth->firmware_buf[3] = data_len >> 8; kaweth->firmware_buf[4] = type; @@ -377,8 +393,8 @@ kaweth_dbg("High: %i, Low:%i", kaweth->firmware_buf[3], kaweth->firmware_buf[2]); - kaweth_dbg("Downloading firmware at %p to kaweth device at %p", - data, + kaweth_dbg("Downloading firmware at %p to kaweth device at %p", + data, kaweth); kaweth_dbg("Firmware length: %d", data_len); @@ -388,7 +404,7 @@ USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE, 0, 0, - (void *)&kaweth->firmware_buf, + (void *)kaweth->firmware_buf, data_len, KAWETH_CONTROL_TIMEOUT); } @@ -407,7 +423,7 @@ kaweth->firmware_buf[5] = interrupt; kaweth->firmware_buf[6] = 0x00; kaweth->firmware_buf[7] = 0x00; - + kaweth_dbg("Triggering firmware"); return kaweth_control(kaweth, @@ -416,7 +432,7 @@ USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE, 0, 0, - (void *)&kaweth->firmware_buf, + (void *)kaweth->firmware_buf, 8, KAWETH_CONTROL_TIMEOUT); } @@ -431,12 +447,12 @@ kaweth_dbg("kaweth_reset(%p)", kaweth); result = kaweth_control(kaweth, usb_sndctrlpipe(kaweth->dev, 0), - USB_REQ_SET_CONFIGURATION, - 0, + USB_REQ_SET_CONFIGURATION, + 0, kaweth->dev->config[0].bConfigurationValue, - 0, - NULL, - 0, + 0, + NULL, + 0, KAWETH_CONTROL_TIMEOUT); udelay(10000); @@ -447,16 +463,39 @@ } static void kaweth_usb_receive(struct urb *); +static void kaweth_resubmit_rx_urb(struct kaweth_device *); + +/**************************************************************** + int_callback +*****************************************************************/ +static void int_callback(struct urb *u) +{ + struct kaweth_device *kaweth = u->context; + int act_state; + + /* we abuse the interrupt urb for rebsubmitting under low memory saving a timer */ + if (kaweth->suspend_lowmem) + kaweth_resubmit_rx_urb(kaweth); + + /* we check the link state to report changes */ + if (kaweth->linkstate != (act_state = ( kaweth->intbuffer[STATE_OFFSET] | STATE_MASK) >> STATE_SHIFT)) { + if (!act_state) + netif_carrier_on(kaweth->net); + else + netif_carrier_off(kaweth->net); + + kaweth->linkstate = act_state; + } + +} /**************************************************************** * kaweth_resubmit_rx_urb ****************************************************************/ -static inline void kaweth_resubmit_rx_urb(struct kaweth_device *kaweth) +static void kaweth_resubmit_rx_urb(struct kaweth_device *kaweth) { int result; - memset(kaweth->rx_urb, 0, sizeof(*kaweth->rx_urb)); - FILL_BULK_URB(kaweth->rx_urb, kaweth->dev, usb_rcvbulkpipe(kaweth->dev, 1), @@ -466,7 +505,11 @@ kaweth); if((result = usb_submit_urb(kaweth->rx_urb))) { + if (result == -ENOMEM) + kaweth->suspend_lowmem = 1; kaweth_err("resubmitting rx_urb %d failed", result); + } else { + kaweth->suspend_lowmem = 0; } } @@ -479,23 +522,30 @@ { struct kaweth_device *kaweth = urb->context; struct net_device *net = kaweth->net; - + int count = urb->actual_length; int count2 = urb->transfer_buffer_length; - + __u16 pkt_len = le16_to_cpup((u16 *)kaweth->rx_buf); struct sk_buff *skb; - if(kaweth->status & KAWETH_STATUS_CLOSING) { + if(urb->status == -ECONNRESET || urb->status == -ECONNABORTED) + /* we are killed - set a flag and wake the disconnect handler */ + { + kaweth->end = 1; + wake_up(&kaweth->term_wait); return; } - - if(urb->status && urb->status != -EREMOTEIO && count != 1) { + + if (kaweth->status & KAWETH_STATUS_CLOSING) + return; + + if(urb->status && urb->status != -EREMOTEIO && count != 1) { kaweth_err("%s RX status: %d count: %d packet_len: %d", - net->name, + net->name, urb->status, - count, + count, (int)pkt_len); kaweth_resubmit_rx_urb(kaweth); return; @@ -509,7 +559,7 @@ kaweth_resubmit_rx_urb(kaweth); return; } - + if(!(skb = dev_alloc_skb(pkt_len+2))) { kaweth_resubmit_rx_urb(kaweth); return; @@ -518,13 +568,13 @@ skb->dev = net; eth_copy_and_sum(skb, kaweth->rx_buf + 2, pkt_len, 0); - + skb_put(skb, pkt_len); skb->protocol = eth_type_trans(skb, net); - + netif_rx(skb); - + kaweth->stats.rx_packets++; kaweth->stats.rx_bytes += pkt_len; } @@ -543,11 +593,23 @@ kaweth_dbg("Opening network device."); + MOD_INC_USE_COUNT; + kaweth_resubmit_rx_urb(kaweth); - netif_start_queue(net); + FILL_INT_URB( + kaweth->irq_urb, + kaweth->dev, + usb_rcvintpipe(kaweth->dev, 3), + kaweth->intbuffer, + INTBUFFERSIZE, + int_callback, + kaweth, + HZ/4); - MOD_INC_USE_COUNT; + usb_submit_urb(kaweth->irq_urb); + + netif_start_queue(net); kaweth_async_set_rx_mode(kaweth); return 0; @@ -564,6 +626,7 @@ kaweth->status |= KAWETH_STATUS_CLOSING; + usb_unlink_urb(kaweth->irq_urb); usb_unlink_urb(kaweth->rx_urb); kaweth->status &= ~KAWETH_STATUS_CLOSING; @@ -613,11 +676,13 @@ static void kaweth_usb_transmit_complete(struct urb *urb) { struct kaweth_device *kaweth = urb->context; + struct sk_buff *skb = kaweth->tx_skb; - if (urb->status) + if (urb->status != 0) kaweth_dbg("%s: TX status %d.", kaweth->net->name, urb->status); netif_wake_queue(kaweth->net); + dev_kfree_skb(skb); } /**************************************************************** @@ -626,45 +691,66 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net) { struct kaweth_device *kaweth = net->priv; - int count = skb->len; - + char *private_header; + int res; spin_lock(&kaweth->device_lock); + if (kaweth->removed) { + /* our device is undergoing disconnection - we bail out */ + spin_unlock(&kaweth->device_lock); + dev_kfree_skb(skb); + return 0; + } + kaweth_async_set_rx_mode(kaweth); netif_stop_queue(net); - *((__u16 *)kaweth->tx_buf) = cpu_to_le16(skb->len); - - memcpy(kaweth->tx_buf + 2, skb->data, skb->len); + /* We now decide whether we can put our special header into the sk_buff */ + if (skb_cloned(skb) || skb_headroom(skb) < 2) { + /* no such luck - we make our own */ + struct sk_buff *copied_skb; + copied_skb = skb_copy_expand(skb, 2, 0, GFP_ATOMIC); + dev_kfree_skb_any(skb); + skb = copied_skb; + if (!copied_skb) { + kaweth->stats.tx_errors++; + netif_start_queue(net); + spin_unlock(&kaweth->device_lock); + return 0; + } + } - memset(kaweth->tx_urb, 0, sizeof(*kaweth->tx_urb)); + private_header = __skb_push(skb, 2); + *private_header = cpu_to_le16(skb->len); + kaweth->tx_skb = skb; FILL_BULK_URB(kaweth->tx_urb, kaweth->dev, usb_sndbulkpipe(kaweth->dev, 2), - kaweth->tx_buf, - count + 2, + private_header, + skb->len, kaweth_usb_transmit_complete, kaweth); + kaweth->end = 0; + kaweth->tx_urb->transfer_flags |= USB_ASYNC_UNLINK; if((res = usb_submit_urb(kaweth->tx_urb))) { kaweth_warn("kaweth failed tx_urb %d", res); kaweth->stats.tx_errors++; - + netif_start_queue(net); - } - else + dev_kfree_skb(skb); + } + else { kaweth->stats.tx_packets++; kaweth->stats.tx_bytes += skb->len; net->trans_start = jiffies; } - dev_kfree_skb(skb); - spin_unlock(&kaweth->device_lock); return 0; @@ -676,7 +762,7 @@ static void kaweth_set_rx_mode(struct net_device *net) { struct kaweth_device *kaweth = net->priv; - + __u16 packet_filter_bitmap = KAWETH_PACKET_FILTER_DIRECTED | KAWETH_PACKET_FILTER_BROADCAST | KAWETH_PACKET_FILTER_MULTICAST; @@ -687,7 +773,7 @@ if (net->flags & IFF_PROMISC) { packet_filter_bitmap |= KAWETH_PACKET_FILTER_PROMISCUOUS; - } + } else if ((net->mc_count) || (net->flags & IFF_ALLMULTI)) { packet_filter_bitmap |= KAWETH_PACKET_FILTER_ALL_MULTICAST; } @@ -702,7 +788,7 @@ static void kaweth_async_set_rx_mode(struct kaweth_device *kaweth) { __u16 packet_filter_bitmap = kaweth->packet_filter_bitmap; - kaweth->packet_filter_bitmap = 0; + kaweth->packet_filter_bitmap = 0; if(packet_filter_bitmap == 0) return; { @@ -713,7 +799,7 @@ USB_TYPE_VENDOR | USB_DIR_OUT | USB_RECIP_DEVICE, packet_filter_bitmap, 0, - (void *)&kaweth->firmware_buf, + (void *)&kaweth->scratch, 0, KAWETH_CONTROL_TIMEOUT); @@ -745,7 +831,6 @@ kaweth->stats.tx_errors++; net->trans_start = jiffies; - kaweth->tx_urb->transfer_flags |= USB_ASYNC_UNLINK; usb_unlink_urb(kaweth->tx_urb); } @@ -763,14 +848,14 @@ int result = 0; kaweth_dbg("Kawasaki Device Probe (Device number:%d): 0x%4.4x:0x%4.4x:0x%4.4x", - dev->devnum, - (int)dev->descriptor.idVendor, + dev->devnum, + (int)dev->descriptor.idVendor, (int)dev->descriptor.idProduct, (int)dev->descriptor.bcdDevice); kaweth_dbg("Device at %p", dev); - kaweth_dbg("Descriptor length: %x type: %x", + kaweth_dbg("Descriptor length: %x type: %x", (int)dev->descriptor.bLength, (int)dev->descriptor.bDescriptorType); @@ -782,10 +867,9 @@ memset(kaweth, 0, sizeof(struct kaweth_device)); kaweth->dev = dev; - kaweth->status = 0; - kaweth->net = NULL; - kaweth->device_lock = SPIN_LOCK_UNLOCKED; - + spin_lock_init(&kaweth->device_lock); + init_waitqueue_head(&kaweth->term_wait); + kaweth_dbg("Resetting."); kaweth_reset(kaweth); @@ -800,22 +884,25 @@ } else { /* Download the firmware */ kaweth_info("Downloading firmware..."); - if ((result = kaweth_download_firmware(kaweth, - kaweth_new_code, - len_kaweth_new_code, - 100, + kaweth->firmware_buf = (__u8 *)__get_free_page(GFP_KERNEL); + if ((result = kaweth_download_firmware(kaweth, + kaweth_new_code, + len_kaweth_new_code, + 100, 2)) < 0) { kaweth_err("Error downloading firmware (%d)", result); + free_page((unsigned long)kaweth->firmware_buf); kfree(kaweth); return NULL; } - if ((result = kaweth_download_firmware(kaweth, - kaweth_new_code_fix, - len_kaweth_new_code_fix, - 100, + if ((result = kaweth_download_firmware(kaweth, + kaweth_new_code_fix, + len_kaweth_new_code_fix, + 100, 3)) < 0) { kaweth_err("Error downloading firmware fix (%d)", result); + free_page((unsigned long)kaweth->firmware_buf); kfree(kaweth); return NULL; } @@ -826,6 +913,7 @@ 126, 2)) < 0) { kaweth_err("Error downloading trigger code (%d)", result); + free_page((unsigned long)kaweth->firmware_buf); kfree(kaweth); return NULL; } @@ -836,6 +924,7 @@ 126, 3)) < 0) { kaweth_err("Error downloading trigger code fix (%d)", result); + free_page((unsigned long)kaweth->firmware_buf); kfree(kaweth); return NULL; } @@ -843,12 +932,14 @@ if ((result = kaweth_trigger_firmware(kaweth, 126)) < 0) { kaweth_err("Error triggering firmware (%d)", result); + free_page((unsigned long)kaweth->firmware_buf); kfree(kaweth); return NULL; } /* Device will now disappear for a moment... */ kaweth_info("Firmware loaded. I'll be back..."); + free_page((unsigned long)kaweth->firmware_buf); kfree(kaweth); return NULL; } @@ -873,7 +964,7 @@ (int)kaweth->configuration.hw_addr[5]); if(!memcmp(&kaweth->configuration.hw_addr, - &bcast_addr, + &bcast_addr, sizeof(bcast_addr))) { kaweth_err("Firmware not functioning properly, no net device created"); kfree(kaweth); @@ -884,13 +975,13 @@ kaweth_dbg("Error setting URB size"); return kaweth; } - + if(kaweth_set_sofs_wait(kaweth, KAWETH_SOFS_TO_WAIT) < 0) { kaweth_err("Error setting SOFS wait"); return kaweth; } - result = kaweth_set_receive_filter(kaweth, + result = kaweth_set_receive_filter(kaweth, KAWETH_PACKET_FILTER_DIRECTED | KAWETH_PACKET_FILTER_BROADCAST | KAWETH_PACKET_FILTER_MULTICAST); @@ -899,11 +990,18 @@ kaweth_err("Error setting receive filter"); return kaweth; } - + kaweth_dbg("Initializing net device."); kaweth->tx_urb = usb_alloc_urb(0); + if (!kaweth->tx_urb) + goto err_no_urb; kaweth->rx_urb = usb_alloc_urb(0); + if (!kaweth->rx_urb) + goto err_only_tx; + kaweth->irq_urb = usb_alloc_urb(0); + if (!kaweth->irq_urb) + goto err_tx_and_rx; kaweth->net = init_etherdev(0, 0); if (!kaweth->net) { @@ -912,17 +1010,17 @@ } memcpy(kaweth->net->broadcast, &bcast_addr, sizeof(bcast_addr)); - memcpy(kaweth->net->dev_addr, + memcpy(kaweth->net->dev_addr, &kaweth->configuration.hw_addr, sizeof(kaweth->configuration.hw_addr)); - + kaweth->net->priv = kaweth; kaweth->net->open = kaweth_open; kaweth->net->stop = kaweth_close; kaweth->net->watchdog_timeo = KAWETH_TX_TIMEOUT; kaweth->net->tx_timeout = kaweth_tx_timeout; - + kaweth->net->do_ioctl = kaweth_ioctl; kaweth->net->hard_start_xmit = kaweth_start_xmit; kaweth->net->set_multicast_list = kaweth_set_rx_mode; @@ -932,10 +1030,18 @@ memset(&kaweth->stats, 0, sizeof(kaweth->stats)); kaweth_info("kaweth interface created at %s", kaweth->net->name); - + kaweth_dbg("Kaweth probe returning."); return kaweth; + +err_tx_and_rx: + usb_free_urb(kaweth->rx_urb); +err_only_tx: + usb_free_urb(kaweth->tx_urb); +err_no_urb: + kfree(kaweth); + return NULL; } /**************************************************************** @@ -952,8 +1058,18 @@ return; } + kaweth->removed = 1; + usb_unlink_urb(kaweth->irq_urb); usb_unlink_urb(kaweth->rx_urb); - usb_unlink_urb(kaweth->tx_urb); + + /* we need to wait for the urb to be cancelled, if it is active */ + spin_lock(&kaweth->device_lock); + if (usb_unlink_urb(kaweth->tx_urb) == -EINPROGRESS) { + spin_unlock(&kaweth->device_lock); + wait_event(kaweth->term_wait, kaweth->end); + } else { + spin_unlock(&kaweth->device_lock); + } if(kaweth->net) { if(kaweth->net->flags & IFF_UP) { @@ -972,12 +1088,19 @@ } +// FIXME this completion stuff is a modified clone of +// an OLD version of some stuff in usb.c ... +struct kw_api_data { + wait_queue_head_t wqh; + int done; +}; + /*-------------------------------------------------------------------* * completion handler for compatibility wrappers (sync control/bulk) * *-------------------------------------------------------------------*/ static void usb_api_blocking_completion(struct urb *urb) { - struct usb_api_data *awd = (struct usb_api_data *)urb->context; + struct kw_api_data *awd = (struct kw_api_data *)urb->context; awd->done=1; wake_up(&awd->wqh); @@ -991,12 +1114,12 @@ static int usb_start_wait_urb(struct urb *urb, int timeout, int* actual_length) { DECLARE_WAITQUEUE(wait, current); - struct usb_api_data awd; + struct kw_api_data awd; int status; init_waitqueue_head(&awd.wqh); awd.done = 0; - + set_current_state(TASK_INTERRUPTIBLE); add_wait_queue(&awd.wqh, &wait); urb->context = &awd; @@ -1036,7 +1159,8 @@ /*-------------------------------------------------------------------*/ // returns status (negative) or length (positive) int kaweth_internal_control_msg(struct usb_device *usb_dev, unsigned int pipe, - struct usb_ctrlrequest *cmd, void *data, int len, int timeout) + struct usb_ctrlrequest *cmd, void *data, int len, + int timeout) { struct urb *urb; int retv; @@ -1086,3 +1210,4 @@ + diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/Makefile linux.20pre5-ac2/drivers/usb/Makefile --- linux.20pre5/drivers/usb/Makefile 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/Makefile 2002-09-01 13:31:59.000000000 +0100 @@ -95,6 +95,7 @@ obj-$(CONFIG_USB_USBNET) += usbnet.o obj-$(CONFIG_USB_AUERSWALD) += auerswald.o obj-$(CONFIG_USB_BRLVGER) += brlvger.o +obj-$(CONFIG_USB_LCD) += usblcd.o # Object files in subdirectories mod-subdirs := serial hcd diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/pegasus.h linux.20pre5-ac2/drivers/usb/pegasus.h --- linux.20pre5/drivers/usb/pegasus.h 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/pegasus.h 2002-09-01 13:31:17.000000000 +0100 @@ -2,18 +2,9 @@ * Copyright (c) 1999-2002 Petko Manolov - Petkan (petkan@users.sourceforge.net) * * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * it under the terms of the GNU General Public License version 2 as published + * by the 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 or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ @@ -196,6 +187,8 @@ DEFAULT_GPIO_RESET | PEGASUS_II ) PEGASUS_DEV( "Corega FEter USB-TX", VENDOR_COREGA, 0x0004, DEFAULT_GPIO_RESET ) +PEGASUS_DEV( "Corega FEter", VENDOR_COREGA, 0x000d, + DEFAULT_GPIO_RESET | PEGASUS_II ) PEGASUS_DEV( "D-Link DSB-650TX", VENDOR_DLINK, 0x4001, LINKSYS_GPIO_RESET ) PEGASUS_DEV( "D-Link DSB-650TX", VENDOR_DLINK, 0x4002, @@ -210,7 +203,7 @@ DEFAULT_GPIO_RESET | HAS_HOME_PNA ) PEGASUS_DEV( "D-Link DSB-650", VENDOR_DLINK, 0xabc1, DEFAULT_GPIO_RESET ) -PEGASUS_DEV( "ELCON EPLC10Mi USB to Powerline Adapter", VENDOR_ELCON, 0x0002, +PEGASUS_DEV( "GOLDPFEIL USB Adapter", VENDOR_ELCON, 0x0002, DEFAULT_GPIO_RESET | PEGASUS_II | HAS_HOME_PNA ) PEGASUS_DEV( "Elsa Micolink USB2Ethernet", VENDOR_ELSA, 0x3000, DEFAULT_GPIO_RESET ) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/printer.c linux.20pre5-ac2/drivers/usb/printer.c --- linux.20pre5/drivers/usb/printer.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/printer.c 2002-08-29 18:53:55.000000000 +0100 @@ -257,7 +257,7 @@ * Get and print printer errors. */ -static char *usblp_messages[] = { "ok", "out of paper", "off-line", "on fire" }; +static char *usblp_messages[] = { "ok", "out of paper", "off-line", "unknown error" }; static int usblp_check_status(struct usblp *usblp, int err) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/belkin_sa.c linux.20pre5-ac2/drivers/usb/serial/belkin_sa.c --- linux.20pre5/drivers/usb/serial/belkin_sa.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/belkin_sa.c 2002-09-01 13:36:41.000000000 +0100 @@ -1,8 +1,8 @@ /* * Belkin USB Serial Adapter Driver * - * Copyright (C) 2000 - * William Greathouse (wgreathouse@smva.com) + * Copyright (C) 2000 William Greathouse (wgreathouse@smva.com) + * Copyright (C) 2000-2001 Greg Kroah-Hartman (greg@kroah.com) * * This program is largely derived from work by the linux-usb group * and associated source files. Please see the usb/serial files for @@ -24,6 +24,9 @@ * -- Add support for flush commands * -- Add everything that is missing :) * + * 27-Nov-2001 gkh + * compressed all the differnent device entries into 1. + * * 30-May-2001 gkh * switched from using spinlock to a semaphore, which fixes lots of problems. * @@ -62,18 +65,15 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -88,7 +88,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v1.1" +#define DRIVER_VERSION "v1.2" #define DRIVER_AUTHOR "William Greathouse " #define DRIVER_DESC "USB Belkin Serial converter driver" @@ -103,7 +103,7 @@ static void belkin_sa_break_ctl (struct usb_serial_port *port, int break_state ); -static __devinitdata struct usb_device_id id_table_combined [] = { +static struct usb_device_id id_table_combined [] = { { USB_DEVICE(BELKIN_SA_VID, BELKIN_SA_PID) }, { USB_DEVICE(BELKIN_OLD_VID, BELKIN_OLD_PID) }, { USB_DEVICE(PERACOM_VID, PERACOM_PID) }, @@ -112,137 +112,25 @@ { } /* Terminating entry */ }; -static struct usb_device_id belkin_dockstation_table [] = { - { USB_DEVICE(BELKIN_DOCKSTATION_VID, BELKIN_DOCKSTATION_PID) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id belkin_sa_table [] = { - { USB_DEVICE(BELKIN_SA_VID, BELKIN_SA_PID) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id belkin_old_table [] = { - { USB_DEVICE(BELKIN_OLD_VID, BELKIN_OLD_PID) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id peracom_table [] = { - { USB_DEVICE(PERACOM_VID, PERACOM_PID) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id gocom232_table [] = { - { USB_DEVICE(GOHUBS_VID, GOHUBS_PID) }, - { } /* Terminating entry */ -}; - MODULE_DEVICE_TABLE (usb, id_table_combined); -/* All of the device info needed for the Belkin dockstation serial converter */ -static struct usb_serial_device_type belkin_dockstation_device = { - name: "Belkin F5U120-PC USB Serial Adapter", - id_table: belkin_dockstation_table, /* the Belkin F5U103 device */ - needs_interrupt_in: MUST_HAVE, /* this device must have an interrupt in endpoint */ - needs_bulk_in: MUST_HAVE, /* this device must have a bulk in endpoint */ - needs_bulk_out: MUST_HAVE, /* this device must have a bulk out endpoint */ - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: belkin_sa_open, - close: belkin_sa_close, - read_int_callback: belkin_sa_read_int_callback, /* How we get the status info */ - ioctl: belkin_sa_ioctl, - set_termios: belkin_sa_set_termios, - break_ctl: belkin_sa_break_ctl, - startup: belkin_sa_startup, - shutdown: belkin_sa_shutdown, -}; - -/* All of the device info needed for the Belkin serial converter */ -static struct usb_serial_device_type belkin_sa_device = { - name: "Belkin F5U103 USB Serial Adapter", - id_table: belkin_sa_table, /* the Belkin F5U103 device */ - needs_interrupt_in: MUST_HAVE, /* this device must have an interrupt in endpoint */ - needs_bulk_in: MUST_HAVE, /* this device must have a bulk in endpoint */ - needs_bulk_out: MUST_HAVE, /* this device must have a bulk out endpoint */ - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: belkin_sa_open, - close: belkin_sa_close, - read_int_callback: belkin_sa_read_int_callback, /* How we get the status info */ - ioctl: belkin_sa_ioctl, - set_termios: belkin_sa_set_termios, - break_ctl: belkin_sa_break_ctl, - startup: belkin_sa_startup, - shutdown: belkin_sa_shutdown, -}; - - -/* This driver also supports the "old" school Belkin single port adaptor */ -static struct usb_serial_device_type belkin_old_device = { - name: "Belkin USB Serial Adapter", - id_table: belkin_old_table, /* the old Belkin device */ - needs_interrupt_in: MUST_HAVE, /* this device must have an interrupt in endpoint */ - needs_bulk_in: MUST_HAVE, /* this device must have a bulk in endpoint */ - needs_bulk_out: MUST_HAVE, /* this device must have a bulk out endpoint */ - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: belkin_sa_open, - close: belkin_sa_close, - read_int_callback: belkin_sa_read_int_callback, /* How we get the status info */ - ioctl: belkin_sa_ioctl, - set_termios: belkin_sa_set_termios, - break_ctl: belkin_sa_break_ctl, - startup: belkin_sa_startup, - shutdown: belkin_sa_shutdown, -}; - -/* this driver also works for the Peracom single port adapter */ -static struct usb_serial_device_type peracom_device = { - name: "Peracom single port USB Serial Adapter", - id_table: peracom_table, /* the Peracom device */ - needs_interrupt_in: MUST_HAVE, /* this device must have an interrupt in endpoint */ - needs_bulk_in: MUST_HAVE, /* this device must have a bulk in endpoint */ - needs_bulk_out: MUST_HAVE, /* this device must have a bulk out endpoint */ - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: belkin_sa_open, - close: belkin_sa_close, - read_int_callback: belkin_sa_read_int_callback, /* How we get the status info */ - ioctl: belkin_sa_ioctl, - set_termios: belkin_sa_set_termios, - break_ctl: belkin_sa_break_ctl, - startup: belkin_sa_startup, - shutdown: belkin_sa_shutdown, -}; - -/* the GoHubs Go-COM232 device is the same as the Peracom single port adapter */ -static struct usb_serial_device_type gocom232_device = { - name: "GO-COM232 USB Serial Converter", - id_table: gocom232_table, /* the GO-COM232 device */ - needs_interrupt_in: MUST_HAVE, /* this device must have an interrupt in endpoint */ - needs_bulk_in: MUST_HAVE, /* this device must have a bulk in endpoint */ - needs_bulk_out: MUST_HAVE, /* this device must have a bulk out endpoint */ - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: belkin_sa_open, - close: belkin_sa_close, - read_int_callback: belkin_sa_read_int_callback, /* How we get the status info */ - ioctl: belkin_sa_ioctl, - set_termios: belkin_sa_set_termios, - break_ctl: belkin_sa_break_ctl, - startup: belkin_sa_startup, - shutdown: belkin_sa_shutdown, +/* All of the device info needed for the serial converters */ +static struct usb_serial_device_type belkin_device = { + .owner = THIS_MODULE, + .name = "Belkin / Peracom / GoHubs USB Serial Adapter", + .id_table = id_table_combined, + .num_interrupt_in = 1, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 1, + .open = belkin_sa_open, + .close = belkin_sa_close, + .read_int_callback = belkin_sa_read_int_callback, /* How we get the status info */ + .ioctl = belkin_sa_ioctl, + .set_termios = belkin_sa_set_termios, + .break_ctl = belkin_sa_break_ctl, + .startup = belkin_sa_startup, + .shutdown = belkin_sa_shutdown, }; @@ -300,9 +188,6 @@ /* stop reads and writes on all ports */ for (i=0; i < serial->num_ports; ++i) { - while (serial->port[i].open_count > 0) { - belkin_sa_close (&serial->port[i], NULL); - } /* My special items, the standard routines free my urbs */ if (serial->port[i].private) kfree(serial->port[i].private); @@ -316,34 +201,23 @@ dbg("%s port %d", __FUNCTION__, port->number); - down (&port->sem); - - ++port->open_count; - MOD_INC_USE_COUNT; - - if (!port->active) { - port->active = 1; - - /*Start reading from the device*/ - /* TODO: Look at possibility of submitting mulitple URBs to device to - * enhance buffering. Win trace shows 16 initial read URBs. - */ - port->read_urb->dev = port->serial->dev; - retval = usb_submit_urb(port->read_urb); - if (retval) { - err("usb_submit_urb(read bulk) failed"); - goto exit; - } - - port->interrupt_in_urb->dev = port->serial->dev; - retval = usb_submit_urb(port->interrupt_in_urb); - if (retval) - err(" usb_submit_urb(read int) failed"); + /*Start reading from the device*/ + /* TODO: Look at possibility of submitting mulitple URBs to device to + * enhance buffering. Win trace shows 16 initial read URBs. + */ + port->read_urb->dev = port->serial->dev; + retval = usb_submit_urb(port->read_urb); + if (retval) { + err("usb_submit_urb(read bulk) failed"); + goto exit; } - -exit: - up (&port->sem); + port->interrupt_in_urb->dev = port->serial->dev; + retval = usb_submit_urb(port->interrupt_in_urb); + if (retval) + err(" usb_submit_urb(read int) failed"); + +exit: return retval; } /* belkin_sa_open */ @@ -361,22 +235,12 @@ dbg("%s port %d", __FUNCTION__, port->number); - down (&port->sem); - - --port->open_count; - - if (port->open_count <= 0) { - if (serial->dev) { - /* shutdown our bulk reads and writes */ - usb_unlink_urb (port->write_urb); - usb_unlink_urb (port->read_urb); - usb_unlink_urb (port->interrupt_in_urb); - } - port->active = 0; + if (serial->dev) { + /* shutdown our bulk reads and writes */ + usb_unlink_urb (port->write_urb); + usb_unlink_urb (port->read_urb); + usb_unlink_urb (port->interrupt_in_urb); } - - up (&port->sem); - MOD_DEC_USE_COUNT; } /* belkin_sa_close */ @@ -457,12 +321,31 @@ { struct usb_serial *serial = port->serial; struct belkin_sa_private *priv = (struct belkin_sa_private *)port->private; - unsigned int iflag = port->tty->termios->c_iflag; - unsigned int cflag = port->tty->termios->c_cflag; - unsigned int old_iflag = old_termios->c_iflag; - unsigned int old_cflag = old_termios->c_cflag; + unsigned int iflag; + unsigned int cflag; + unsigned int old_iflag = 0; + unsigned int old_cflag = 0; __u16 urb_value = 0; /* Will hold the new flags */ + if ((!port->tty) || (!port->tty->termios)) { + dbg ("%s - no tty or termios structure", __FUNCTION__); + return; + } + + iflag = port->tty->termios->c_iflag; + cflag = port->tty->termios->c_cflag; + + /* check that they really want us to change something */ + if (old_termios) { + if ((cflag == old_termios->c_cflag) && + (RELEVANT_IFLAG(port->tty->termios->c_iflag) == RELEVANT_IFLAG(old_termios->c_iflag))) { + dbg("%s - nothing to change...", __FUNCTION__); + return; + } + old_iflag = old_termios->c_iflag; + old_cflag = old_termios->c_cflag; + } + /* Set the baud rate */ if( (cflag&CBAUD) != (old_cflag&CBAUD) ) { /* reassert DTR and (maybe) RTS on transition from B0 */ @@ -642,11 +525,7 @@ static int __init belkin_sa_init (void) { - usb_serial_register (&belkin_dockstation_device); - usb_serial_register (&belkin_sa_device); - usb_serial_register (&belkin_old_device); - usb_serial_register (&peracom_device); - usb_serial_register (&gocom232_device); + usb_serial_register (&belkin_device); info(DRIVER_DESC " " DRIVER_VERSION); return 0; } @@ -654,11 +533,7 @@ static void __exit belkin_sa_exit (void) { - usb_serial_deregister (&belkin_dockstation_device); - usb_serial_deregister (&belkin_sa_device); - usb_serial_deregister (&belkin_old_device); - usb_serial_deregister (&peracom_device); - usb_serial_deregister (&gocom232_device); + usb_serial_deregister (&belkin_device); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/Config.in linux.20pre5-ac2/drivers/usb/serial/Config.in --- linux.20pre5/drivers/usb/serial/Config.in 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/Config.in 2002-09-01 13:39:31.000000000 +0100 @@ -28,6 +28,8 @@ bool ' USB Keyspan USA-19 Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19 bool ' USB Keyspan USA-18X Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA18X bool ' USB Keyspan USA-19W Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19W + bool ' USB Keyspan USA-19QW Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19QW + bool ' USB Keyspan USA-19QI Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19QI bool ' USB Keyspan USA-49W Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA49W fi dep_tristate ' USB MCT Single Port Serial Driver' CONFIG_USB_SERIAL_MCT_U232 $CONFIG_USB_SERIAL diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/cyberjack.c linux.20pre5-ac2/drivers/usb/serial/cyberjack.c --- linux.20pre5/drivers/usb/serial/cyberjack.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/cyberjack.c 2002-09-01 13:36:26.000000000 +0100 @@ -25,18 +25,15 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -77,23 +74,21 @@ MODULE_DEVICE_TABLE (usb, id_table); static struct usb_serial_device_type cyberjack_device = { - name: "Reiner SCT Cyberjack USB card reader", - id_table: id_table, - needs_interrupt_in: MUST_HAVE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - startup: cyberjack_startup, - shutdown: cyberjack_shutdown, - open: cyberjack_open, - close: cyberjack_close, - write: cyberjack_write, - read_int_callback: cyberjack_read_int_callback, - read_bulk_callback: cyberjack_read_bulk_callback, - write_bulk_callback: cyberjack_write_bulk_callback, + .owner = THIS_MODULE, + .name = "Reiner SCT Cyberjack USB card reader", + .id_table = id_table, + .num_interrupt_in = 1, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 1, + .startup = cyberjack_startup, + .shutdown = cyberjack_shutdown, + .open = cyberjack_open, + .close = cyberjack_close, + .write = cyberjack_write, + .read_int_callback = cyberjack_read_int_callback, + .read_bulk_callback = cyberjack_read_bulk_callback, + .write_bulk_callback = cyberjack_write_bulk_callback, }; struct cyberjack_private { @@ -132,11 +127,7 @@ dbg("%s", __FUNCTION__); - /* stop reads and writes on all ports */ for (i=0; i < serial->num_ports; ++i) { - while (serial->port[i].open_count > 0) { - cyberjack_close (&serial->port[i], NULL); - } /* My special items, the standard routines free my urbs */ if (serial->port[i].private) kfree(serial->port[i].private); @@ -151,40 +142,29 @@ if (port_paranoia_check (port, __FUNCTION__)) return -ENODEV; - MOD_INC_USE_COUNT; - dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); - - ++port->open_count; - - if (!port->active) { - port->active = 1; - /* force low_latency on so that our tty_push actually forces - * the data through, otherwise it is scheduled, and with high - * data rates (like with OHCI) data can get lost. - */ - port->tty->low_latency = 1; - - priv = (struct cyberjack_private *)port->private; - priv->rdtodo = 0; - priv->wrfilled = 0; - priv->wrsent = 0; + /* force low_latency on so that our tty_push actually forces + * the data through, otherwise it is scheduled, and with high + * data rates (like with OHCI) data can get lost. + */ + port->tty->low_latency = 1; - /* shutdown any bulk reads that might be going on */ - usb_unlink_urb (port->write_urb); - usb_unlink_urb (port->read_urb); - usb_unlink_urb (port->interrupt_in_urb); - - port->interrupt_in_urb->dev = port->serial->dev; - result = usb_submit_urb(port->interrupt_in_urb); - if (result) - err(" usb_submit_urb(read int) failed"); - dbg("%s - usb_submit_urb(int urb)", __FUNCTION__); - } + priv = (struct cyberjack_private *)port->private; + priv->rdtodo = 0; + priv->wrfilled = 0; + priv->wrsent = 0; - up (&port->sem); + /* shutdown any bulk reads that might be going on */ + usb_unlink_urb (port->write_urb); + usb_unlink_urb (port->read_urb); + usb_unlink_urb (port->interrupt_in_urb); + + port->interrupt_in_urb->dev = port->serial->dev; + result = usb_submit_urb(port->interrupt_in_urb); + if (result) + err(" usb_submit_urb(read int) failed"); + dbg("%s - usb_submit_urb(int urb)", __FUNCTION__); return result; } @@ -193,24 +173,12 @@ { dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); - - --port->open_count; - - if (port->open_count <= 0) { - if (port->serial->dev) { - /* shutdown any bulk reads that might be going on */ - usb_unlink_urb (port->write_urb); - usb_unlink_urb (port->read_urb); - usb_unlink_urb (port->interrupt_in_urb); - } - - port->active = 0; - port->open_count = 0; + if (port->serial->dev) { + /* shutdown any bulk reads that might be going on */ + usb_unlink_urb (port->write_urb); + usb_unlink_urb (port->read_urb); + usb_unlink_urb (port->interrupt_in_urb); } - - up (&port->sem); - MOD_DEC_USE_COUNT; } static int cyberjack_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count) @@ -233,19 +201,15 @@ return (0); } - down (&port->sem); - if( (count+priv->wrfilled)>sizeof(priv->wrbuf) ) { /* To much data for buffer. Reset buffer. */ priv->wrfilled=0; - up (&port->sem); return (0); } /* Copy data */ if (from_user) { if (copy_from_user(priv->wrbuf+priv->wrfilled, buf, count)) { - up (&port->sem); return -EFAULT; } } else { @@ -288,7 +252,6 @@ /* Throw away data. No better idea what to do with it. */ priv->wrfilled=0; priv->wrsent=0; - up (&port->sem); return 0; } @@ -303,7 +266,6 @@ } } - up (&port->sem); return (count); } @@ -443,8 +405,6 @@ return; } - down (&port->sem); - dbg("%s - transmitting data (frame n)", __FUNCTION__); length = ((priv->wrfilled - priv->wrsent) > port->bulk_out_size) ? @@ -470,7 +430,6 @@ /* Throw away data. No better idea what to do with it. */ priv->wrfilled=0; priv->wrsent=0; - up (&port->sem); queue_task(&port->tqueue, &tq_immediate); mark_bh(IMMEDIATE_BH); return; @@ -488,7 +447,6 @@ priv->wrsent=0; } - up (&port->sem); queue_task(&port->tqueue, &tq_immediate); mark_bh(IMMEDIATE_BH); return; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/digi_acceleport.c linux.20pre5-ac2/drivers/usb/serial/digi_acceleport.c --- linux.20pre5/drivers/usb/serial/digi_acceleport.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/digi_acceleport.c 2002-09-01 13:37:07.000000000 +0100 @@ -14,6 +14,10 @@ * Peter Berger (pberger@brimson.com) * Al Borchers (borchers@steinerpoint.com) * +* (12/03/2001) gkh +* switched to using port->open_count instead of private version. +* Removed port->active +* * (04/08/2001) gb * Identify version on module load. * @@ -231,19 +235,16 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include #include +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -411,14 +412,14 @@ /* Structures */ -typedef struct digi_serial { +struct digi_serial { spinlock_t ds_serial_lock; struct usb_serial_port *ds_oob_port; /* out-of-band port */ int ds_oob_port_num; /* index of out-of-band port */ int ds_device_started; -} digi_serial_t; +}; -typedef struct digi_port { +struct digi_port { spinlock_t dp_port_lock; int dp_port_num; int dp_out_buf_len; @@ -429,7 +430,6 @@ int dp_write_urb_in_use; unsigned int dp_modem_signals; wait_queue_head_t dp_modem_change_wait; - int dp_open_count; /* inc on open, dec on close */ int dp_transmit_idle; wait_queue_head_t dp_transmit_idle_wait; int dp_throttled; @@ -438,7 +438,7 @@ int dp_in_close; /* close in progress */ wait_queue_head_t dp_close_wait; /* wait queue for close */ struct tq_struct dp_wakeup_task; -} digi_port_t; +}; /* Local Function Declarations */ @@ -498,55 +498,51 @@ /* device info needed for the Digi serial converter */ static struct usb_serial_device_type digi_acceleport_2_device = { - name: "Digi USB", - id_table: id_table_2, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, - num_interrupt_in: 0, - num_bulk_in: 4, - num_bulk_out: 4, - num_ports: 3, - open: digi_open, - close: digi_close, - write: digi_write, - write_room: digi_write_room, - write_bulk_callback: digi_write_bulk_callback, - read_bulk_callback: digi_read_bulk_callback, - chars_in_buffer: digi_chars_in_buffer, - throttle: digi_rx_throttle, - unthrottle: digi_rx_unthrottle, - ioctl: digi_ioctl, - set_termios: digi_set_termios, - break_ctl: digi_break_ctl, - startup: digi_startup, - shutdown: digi_shutdown, + .owner = THIS_MODULE, + .name = "Digi USB", + .id_table = id_table_2, + .num_interrupt_in = 0, + .num_bulk_in = 4, + .num_bulk_out = 4, + .num_ports = 3, + .open = digi_open, + .close = digi_close, + .write = digi_write, + .write_room = digi_write_room, + .write_bulk_callback = digi_write_bulk_callback, + .read_bulk_callback = digi_read_bulk_callback, + .chars_in_buffer = digi_chars_in_buffer, + .throttle = digi_rx_throttle, + .unthrottle = digi_rx_unthrottle, + .ioctl = digi_ioctl, + .set_termios = digi_set_termios, + .break_ctl = digi_break_ctl, + .startup = digi_startup, + .shutdown = digi_shutdown, }; static struct usb_serial_device_type digi_acceleport_4_device = { - name: "Digi USB", - id_table: id_table_4, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, - num_interrupt_in: 0, - num_bulk_in: 5, - num_bulk_out: 5, - num_ports: 4, - open: digi_open, - close: digi_close, - write: digi_write, - write_room: digi_write_room, - write_bulk_callback: digi_write_bulk_callback, - read_bulk_callback: digi_read_bulk_callback, - chars_in_buffer: digi_chars_in_buffer, - throttle: digi_rx_throttle, - unthrottle: digi_rx_unthrottle, - ioctl: digi_ioctl, - set_termios: digi_set_termios, - break_ctl: digi_break_ctl, - startup: digi_startup, - shutdown: digi_shutdown, + .owner = THIS_MODULE, + .name = "Digi USB", + .id_table = id_table_4, + .num_interrupt_in = 0, + .num_bulk_in = 5, + .num_bulk_out = 5, + .num_ports = 4, + .open = digi_open, + .close = digi_close, + .write = digi_write, + .write_room = digi_write_room, + .write_bulk_callback = digi_write_bulk_callback, + .read_bulk_callback = digi_read_bulk_callback, + .chars_in_buffer = digi_chars_in_buffer, + .throttle = digi_rx_throttle, + .unthrottle = digi_rx_unthrottle, + .ioctl = digi_ioctl, + .set_termios = digi_set_termios, + .break_ctl = digi_break_ctl, + .startup = digi_startup, + .shutdown = digi_shutdown, }; @@ -600,13 +596,12 @@ { unsigned long flags; - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); spin_lock_irqsave( &priv->dp_port_lock, flags ); digi_wakeup_write( port ); spin_unlock_irqrestore( &priv->dp_port_lock, flags ); - MOD_DEC_USE_COUNT; } static void digi_wakeup_write( struct usb_serial_port *port ) @@ -647,8 +642,8 @@ int ret = 0; int len; - struct usb_serial_port *oob_port = (struct usb_serial_port *)((digi_serial_t *)port->serial->private)->ds_oob_port; - digi_port_t *oob_priv = (digi_port_t *)oob_port->private; + struct usb_serial_port *oob_port = (struct usb_serial_port *)((struct digi_serial *)port->serial->private)->ds_oob_port; + struct digi_port *oob_priv = (struct digi_port *)oob_port->private; unsigned long flags = 0; @@ -716,7 +711,7 @@ int ret = 0; int len; - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); unsigned char *data = port->write_urb->transfer_buffer; unsigned long flags = 0; @@ -802,9 +797,9 @@ { int ret; - digi_port_t *port_priv = (digi_port_t *)port->private; - struct usb_serial_port *oob_port = (struct usb_serial_port *)((digi_serial_t *)port->serial->private)->ds_oob_port; - digi_port_t *oob_priv = (digi_port_t *)oob_port->private; + struct digi_port *port_priv = (struct digi_port *)port->private; + struct usb_serial_port *oob_port = (struct usb_serial_port *)((struct digi_serial *)port->serial->private)->ds_oob_port; + struct digi_port *oob_priv = (struct digi_port *)oob_port->private; unsigned char *data = oob_port->write_urb->transfer_buffer; unsigned long flags = 0; @@ -881,7 +876,7 @@ int ret; unsigned char buf[2]; - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); unsigned long flags = 0; @@ -921,7 +916,7 @@ { unsigned long flags; - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); dbg( "digi_rx_throttle: TOP: port=%d", priv->dp_port_num ); @@ -942,7 +937,7 @@ int ret = 0; int len; unsigned long flags; - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); struct tty_struct *tty = port->tty; @@ -986,7 +981,7 @@ struct termios *old_termios ) { - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); unsigned int iflag = port->tty->termios->c_iflag; unsigned int cflag = port->tty->termios->c_cflag; unsigned int old_iflag = old_termios->c_iflag; @@ -1210,7 +1205,7 @@ unsigned int cmd, unsigned long arg ) { - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); unsigned int val; unsigned long flags = 0; @@ -1262,7 +1257,7 @@ { int ret,data_len,new_len; - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); unsigned char *data = port->write_urb->transfer_buffer; unsigned char user_buf[64]; /* 64 bytes is max USB bulk packet */ unsigned long flags = 0; @@ -1349,14 +1344,14 @@ struct usb_serial_port *port = (struct usb_serial_port *)urb->context; struct usb_serial *serial; - digi_port_t *priv; + struct digi_port *priv; int ret = 0; dbg( "digi_write_bulk_callback: TOP, urb->status=%d", urb->status ); /* port and serial sanity check */ - if( port == NULL || (priv=(digi_port_t *)(port->private)) == NULL ) { + if( port == NULL || (priv=(struct digi_port *)(port->private)) == NULL ) { err("%s: port or port->private is NULL, status=%d", __FUNCTION__, urb->status ); return; @@ -1369,7 +1364,7 @@ /* handle oob callback */ if( priv->dp_port_num - == ((digi_serial_t *)(serial->private))->ds_oob_port_num ) { + == ((struct digi_serial *)(serial->private))->ds_oob_port_num ) { dbg( "digi_write_bulk_callback: oob callback" ); spin_lock( &priv->dp_port_lock ); priv->dp_write_urb_in_use = 0; @@ -1386,7 +1381,7 @@ /* try to send any buffered data on this port, if it is open */ spin_lock( &priv->dp_port_lock ); priv->dp_write_urb_in_use = 0; - if( priv->dp_open_count && port->write_urb->status != -EINPROGRESS + if( port->open_count && port->write_urb->status != -EINPROGRESS && priv->dp_out_buf_len > 0 ) { *((unsigned char *)(port->write_urb->transfer_buffer)) @@ -1413,9 +1408,7 @@ /* also queue up a wakeup at scheduler time, in case we */ /* lost the race in write_chan(). */ - MOD_INC_USE_COUNT; - if (schedule_task(&priv->dp_wakeup_task) == 0) - MOD_DEC_USE_COUNT; + schedule_task(&priv->dp_wakeup_task); spin_unlock( &priv->dp_port_lock ); @@ -1431,7 +1424,7 @@ { int room; - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); unsigned long flags = 0; @@ -1454,7 +1447,7 @@ static int digi_chars_in_buffer( struct usb_serial_port *port ) { - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); if( port->write_urb->status == -EINPROGRESS @@ -1475,12 +1468,12 @@ int ret; unsigned char buf[32]; - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); struct termios not_termios; unsigned long flags = 0; -dbg( "digi_open: TOP: port=%d, active=%d, open_count=%d", priv->dp_port_num, port->active, priv->dp_open_count ); +dbg( "digi_open: TOP: port=%d, open_count=%d", priv->dp_port_num, port->open_count ); /* be sure the device is started up */ if( digi_startup_device( port->serial ) != 0 ) @@ -1494,32 +1487,17 @@ return( -EAGAIN ); } - /* inc module use count before sleeping to wait for closes */ - ++priv->dp_open_count; - MOD_INC_USE_COUNT; - /* wait for a close in progress to finish */ while( priv->dp_in_close ) { cond_wait_interruptible_timeout_irqrestore( &priv->dp_close_wait, DIGI_RETRY_TIMEOUT, &priv->dp_port_lock, flags ); if( signal_pending(current) ) { - --priv->dp_open_count; - MOD_DEC_USE_COUNT; return( -EINTR ); } spin_lock_irqsave( &priv->dp_port_lock, flags ); } - /* if port is already open, just return */ - /* be sure exactly one open proceeds */ - if( port->active ) { - spin_unlock_irqrestore( &priv->dp_port_lock, flags ); - return( 0 ); - } - - /* first open, mark port as active */ - port->active = 1; spin_unlock_irqrestore( &priv->dp_port_lock, flags ); /* read modem signals automatically whenever they change */ @@ -1556,24 +1534,15 @@ int ret; unsigned char buf[32]; struct tty_struct *tty = port->tty; - digi_port_t *priv = (digi_port_t *)port->private; + struct digi_port *priv = (struct digi_port *)port->private; unsigned long flags = 0; -dbg( "digi_close: TOP: port=%d, active=%d, open_count=%d", priv->dp_port_num, port->active, priv->dp_open_count ); +dbg( "digi_close: TOP: port=%d, open_count=%d", priv->dp_port_num, port->open_count ); /* do cleanup only after final close on this port */ spin_lock_irqsave( &priv->dp_port_lock, flags ); - if( priv->dp_open_count > 1 ) { - --priv->dp_open_count; - MOD_DEC_USE_COUNT; - spin_unlock_irqrestore( &priv->dp_port_lock, flags ); - return; - } else if( priv->dp_open_count <= 0 ) { - spin_unlock_irqrestore( &priv->dp_port_lock, flags ); - return; - } priv->dp_in_close = 1; spin_unlock_irqrestore( &priv->dp_port_lock, flags ); @@ -1644,11 +1613,8 @@ tty->closing = 0; spin_lock_irqsave( &priv->dp_port_lock, flags ); - port->active = 0; priv->dp_write_urb_in_use = 0; priv->dp_in_close = 0; - --priv->dp_open_count; - MOD_DEC_USE_COUNT; wake_up_interruptible( &priv->dp_close_wait ); spin_unlock_irqrestore( &priv->dp_port_lock, flags ); @@ -1667,7 +1633,7 @@ { int i,ret = 0; - digi_serial_t *serial_priv = (digi_serial_t *)serial->private; + struct digi_serial *serial_priv = (struct digi_serial *)serial->private; struct usb_serial_port *port; @@ -1705,8 +1671,8 @@ { int i; - digi_port_t *priv; - digi_serial_t *serial_priv; + struct digi_port *priv; + struct digi_serial *serial_priv; dbg( "digi_startup: TOP" ); @@ -1715,13 +1681,11 @@ /* number of regular ports + 1 for the out-of-band port */ for( i=0; itype->num_ports+1; i++ ) { - serial->port[i].active = 0; - /* allocate port private structure */ priv = serial->port[i].private = - (digi_port_t *)kmalloc( sizeof(digi_port_t), + (struct digi_port *)kmalloc( sizeof(struct digi_port), GFP_KERNEL ); - if( priv == (digi_port_t *)0 ) { + if( priv == (struct digi_port *)0 ) { while( --i >= 0 ) kfree( serial->port[i].private ); return( 1 ); /* error */ @@ -1735,7 +1699,6 @@ priv->dp_write_urb_in_use = 0; priv->dp_modem_signals = 0; init_waitqueue_head( &priv->dp_modem_change_wait ); - priv->dp_open_count = 0; priv->dp_transmit_idle = 0; init_waitqueue_head( &priv->dp_transmit_idle_wait ); priv->dp_throttled = 0; @@ -1755,9 +1718,9 @@ /* allocate serial private structure */ serial_priv = serial->private = - (digi_serial_t *)kmalloc( sizeof(digi_serial_t), + (struct digi_serial *)kmalloc( sizeof(struct digi_serial), GFP_KERNEL ); - if( serial_priv == (digi_serial_t *)0 ) { + if( serial_priv == (struct digi_serial *)0 ) { for( i=0; itype->num_ports+1; i++ ) kfree( serial->port[i].private ); return( 1 ); /* error */ @@ -1778,8 +1741,6 @@ { int i; - digi_port_t *priv; - unsigned long flags; dbg( "digi_shutdown: TOP, in_interrupt()=%d", in_interrupt() ); @@ -1790,17 +1751,6 @@ usb_unlink_urb( serial->port[i].write_urb ); } - /* dec module use count */ - for( i=0; itype->num_ports; i++ ) { - priv = serial->port[i].private; - spin_lock_irqsave( &priv->dp_port_lock, flags ); - while( priv->dp_open_count > 0 ) { - MOD_DEC_USE_COUNT; - --priv->dp_open_count; - } - spin_unlock_irqrestore( &priv->dp_port_lock, flags ); - } - /* free the private data structures for all ports */ /* number of regular ports + 1 for the out-of-band port */ for( i=0; itype->num_ports+1; i++ ) @@ -1814,14 +1764,14 @@ { struct usb_serial_port *port = (struct usb_serial_port *)urb->context; - digi_port_t *priv; + struct digi_port *priv; int ret; dbg( "digi_read_bulk_callback: TOP" ); /* port sanity check, do not resubmit if port is not valid */ - if( port == NULL || (priv=(digi_port_t *)(port->private)) == NULL ) { + if( port == NULL || (priv=(struct digi_port *)(port->private)) == NULL ) { err("%s: port or port->private is NULL, status=%d", __FUNCTION__, urb->status ); return; @@ -1841,7 +1791,7 @@ /* handle oob or inb callback, do not resubmit if error */ if( priv->dp_port_num - == ((digi_serial_t *)(port->serial->private))->ds_oob_port_num ) { + == ((struct digi_serial *)(port->serial->private))->ds_oob_port_num ) { if( digi_read_oob_callback( urb ) != 0 ) return; } else { @@ -1874,7 +1824,7 @@ struct usb_serial_port *port = (struct usb_serial_port *)urb->context; struct tty_struct *tty = port->tty; - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); int opcode = ((unsigned char *)urb->transfer_buffer)[0]; int len = ((unsigned char *)urb->transfer_buffer)[1]; int status = ((unsigned char *)urb->transfer_buffer)[2]; @@ -1888,7 +1838,7 @@ /* do not process callbacks on closed ports */ /* but do continue the read chain */ - if( priv->dp_open_count == 0 ) + if( port->open_count == 0 ) return( 0 ); /* short/multiple packet check */ @@ -1986,7 +1936,7 @@ struct usb_serial_port *port = (struct usb_serial_port *)urb->context; struct usb_serial *serial = port->serial; - digi_port_t *priv = (digi_port_t *)(port->private); + struct digi_port *priv = (struct digi_port *)(port->private); int opcode, line, status, val; int i; @@ -2022,7 +1972,7 @@ if( val & DIGI_READ_INPUT_SIGNALS_CTS ) { priv->dp_modem_signals |= TIOCM_CTS; /* port must be open to use tty struct */ - if( priv->dp_open_count + if( port->open_count && port->tty->termios->c_cflag & CRTSCTS ) { port->tty->hw_stopped = 0; digi_wakeup_write( port ); @@ -2030,7 +1980,7 @@ } else { priv->dp_modem_signals &= ~TIOCM_CTS; /* port must be open to use tty struct */ - if( priv->dp_open_count + if( port->open_count && port->tty->termios->c_cflag & CRTSCTS ) { port->tty->hw_stopped = 1; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/empeg.c linux.20pre5-ac2/drivers/usb/serial/empeg.c --- linux.20pre5/drivers/usb/serial/empeg.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/empeg.c 2002-09-01 13:37:35.000000000 +0100 @@ -53,18 +53,15 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -114,28 +111,26 @@ MODULE_DEVICE_TABLE (usb, id_table); static struct usb_serial_device_type empeg_device = { - name: "Empeg", - id_table: id_table, - needs_interrupt_in: MUST_HAVE_NOT, /* must not have an interrupt in endpoint */ - needs_bulk_in: MUST_HAVE, /* must have a bulk in endpoint */ - needs_bulk_out: MUST_HAVE, /* must have a bulk out endpoint */ - num_interrupt_in: 0, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: empeg_open, - close: empeg_close, - throttle: empeg_throttle, - unthrottle: empeg_unthrottle, - startup: empeg_startup, - shutdown: empeg_shutdown, - ioctl: empeg_ioctl, - set_termios: empeg_set_termios, - write: empeg_write, - write_room: empeg_write_room, - chars_in_buffer: empeg_chars_in_buffer, - write_bulk_callback: empeg_write_bulk_callback, - read_bulk_callback: empeg_read_bulk_callback, + .owner = THIS_MODULE, + .name = "Empeg", + .id_table = id_table, + .num_interrupt_in = 0, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 1, + .open = empeg_open, + .close = empeg_close, + .throttle = empeg_throttle, + .unthrottle = empeg_unthrottle, + .startup = empeg_startup, + .shutdown = empeg_shutdown, + .ioctl = empeg_ioctl, + .set_termios = empeg_set_termios, + .write = empeg_write, + .write_room = empeg_write_room, + .chars_in_buffer = empeg_chars_in_buffer, + .write_bulk_callback = empeg_write_bulk_callback, + .read_bulk_callback = empeg_read_bulk_callback, }; #define NUM_URBS 16 @@ -159,41 +154,29 @@ dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); + /* Force default termio settings */ + empeg_set_termios (port, NULL) ; - ++port->open_count; - MOD_INC_USE_COUNT; + bytes_in = 0; + bytes_out = 0; - if (!port->active) { - - /* Force default termio settings */ - empeg_set_termios (port, NULL) ; - - port->active = 1; - bytes_in = 0; - bytes_out = 0; - - /* Start reading from the device */ - FILL_BULK_URB( - port->read_urb, - serial->dev, - usb_rcvbulkpipe(serial->dev, - port->bulk_in_endpointAddress), - port->read_urb->transfer_buffer, - port->read_urb->transfer_buffer_length, - empeg_read_bulk_callback, - port); - - port->read_urb->transfer_flags |= USB_QUEUE_BULK; - - result = usb_submit_urb(port->read_urb); + /* Start reading from the device */ + FILL_BULK_URB( + port->read_urb, + serial->dev, + usb_rcvbulkpipe(serial->dev, + port->bulk_in_endpointAddress), + port->read_urb->transfer_buffer, + port->read_urb->transfer_buffer_length, + empeg_read_bulk_callback, + port); - if (result) - err("%s - failed submitting read urb, error %d", __FUNCTION__, result); + port->read_urb->transfer_flags |= USB_QUEUE_BULK; - } + result = usb_submit_urb(port->read_urb); - up (&port->sem); + if (result) + err("%s - failed submitting read urb, error %d", __FUNCTION__, result); return result; } @@ -212,25 +195,12 @@ if (!serial) return; - down (&port->sem); - - --port->open_count; - - if (port->open_count <= 0) { - if (serial->dev) { - /* shutdown our bulk read */ - usb_unlink_urb (port->read_urb); - } - port->active = 0; - port->open_count = 0; + if (serial->dev) { + /* shutdown our bulk read */ + usb_unlink_urb (port->read_urb); } - - up (&port->sem); - /* Uncomment the following line if you want to see some statistics in your syslog */ /* info ("Bytes In = %d Bytes Out = %d", bytes_in, bytes_out); */ - - MOD_DEC_USE_COUNT; } @@ -271,7 +241,7 @@ } if (urb->transfer_buffer == NULL) { - urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_KERNEL); + urb->transfer_buffer = kmalloc (URB_TRANSFER_BUFFER_SIZE, GFP_ATOMIC); if (urb->transfer_buffer == NULL) { err("%s no more kernel memory...", __FUNCTION__); goto exit; @@ -469,15 +439,7 @@ static void empeg_throttle (struct usb_serial_port *port) { dbg("%s - port %d", __FUNCTION__, port->number); - - down (&port->sem); - usb_unlink_urb (port->read_urb); - - up (&port->sem); - - return; - } @@ -487,8 +449,6 @@ dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); - port->read_urb->dev = port->serial->dev; result = usb_submit_urb(port->read_urb); @@ -496,10 +456,7 @@ if (result) err("%s - failed submitting read urb, error %d", __FUNCTION__, result); - up (&port->sem); - return; - } @@ -519,17 +476,7 @@ static void empeg_shutdown (struct usb_serial *serial) { - int i; - dbg ("%s", __FUNCTION__); - - /* stop reads and writes on all ports */ - for (i=0; i < serial->num_ports; ++i) { - while (serial->port[i].open_count > 0) { - empeg_close (&serial->port[i], NULL); - } - } - } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/ftdi_sio.c linux.20pre5-ac2/drivers/usb/serial/ftdi_sio.c --- linux.20pre5/drivers/usb/serial/ftdi_sio.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/ftdi_sio.c 2002-09-01 13:37:50.000000000 +0100 @@ -108,18 +108,15 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include +#include #include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -208,49 +205,45 @@ static void ftdi_break_ctl (struct usb_serial_port *port, int break_state ); static struct usb_serial_device_type ftdi_SIO_device = { - name: "FTDI SIO", - id_table: id_table_sio, - needs_interrupt_in: MUST_HAVE_NOT, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, - num_interrupt_in: 0, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: ftdi_open, - close: ftdi_close, - write: ftdi_write, - write_room: ftdi_write_room, - read_bulk_callback: ftdi_read_bulk_callback, - write_bulk_callback: ftdi_write_bulk_callback, - ioctl: ftdi_ioctl, - set_termios: ftdi_set_termios, - break_ctl: ftdi_break_ctl, - startup: ftdi_SIO_startup, - shutdown: ftdi_shutdown, + .owner = THIS_MODULE, + .name = "FTDI SIO", + .id_table = id_table_sio, + .num_interrupt_in = 0, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 1, + .open = ftdi_open, + .close = ftdi_close, + .write = ftdi_write, + .write_room = ftdi_write_room, + .read_bulk_callback = ftdi_read_bulk_callback, + .write_bulk_callback = ftdi_write_bulk_callback, + .ioctl = ftdi_ioctl, + .set_termios = ftdi_set_termios, + .break_ctl = ftdi_break_ctl, + .startup = ftdi_SIO_startup, + .shutdown = ftdi_shutdown, }; static struct usb_serial_device_type ftdi_8U232AM_device = { - name: "FTDI 8U232AM", - id_table: id_table_8U232AM, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, - num_interrupt_in: 0, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: ftdi_open, - close: ftdi_close, - write: ftdi_write, - write_room: ftdi_write_room, - read_bulk_callback: ftdi_read_bulk_callback, - write_bulk_callback: ftdi_write_bulk_callback, - ioctl: ftdi_ioctl, - set_termios: ftdi_set_termios, - break_ctl: ftdi_break_ctl, - startup: ftdi_8U232AM_startup, - shutdown: ftdi_shutdown, + .owner = THIS_MODULE, + .name = "FTDI 8U232AM", + .id_table = id_table_8U232AM, + .num_interrupt_in = 0, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 1, + .open = ftdi_open, + .close = ftdi_close, + .write = ftdi_write, + .write_room = ftdi_write_room, + .read_bulk_callback = ftdi_read_bulk_callback, + .write_bulk_callback = ftdi_write_bulk_callback, + .ioctl = ftdi_ioctl, + .set_termios = ftdi_set_termios, + .break_ctl = ftdi_break_ctl, + .startup = ftdi_8U232AM_startup, + .shutdown = ftdi_shutdown, }; #define WDR_TIMEOUT (HZ * 5 ) /* default urb timeout */ @@ -347,7 +340,7 @@ /* 1. Get the baud rate from the tty settings, this observes alt_speed hack */ baud = tty_get_baud_rate(port->tty); - dbg(__FUNCTION__ " tty_get_baud_rate reports speed %d", baud); + dbg("%s - tty_get_baud_rate reports speed %d", __FUNCTION__, baud); /* 2. Observe async-compatible custom_divisor hack, update baudrate if needed */ @@ -355,7 +348,7 @@ ((priv->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST) && (priv->custom_divisor)) { baud = priv->baud_base / priv->custom_divisor; - dbg(__FUNCTION__ " custom divisor %d sets baud rate to %d", priv->custom_divisor, baud); + dbg("%s - custom divisor %d sets baud rate to %d", __FUNCTION__, priv->custom_divisor, baud); } /* 3. Convert baudrate to device-specific divisor */ @@ -376,13 +369,13 @@ case 115200: urb_value = ftdi_sio_b115200; break; } /* baud */ if (urb_value == 0) - dbg(__FUNCTION__ " Baudrate (%d) requested is not supported", baud); + dbg("%s - Baudrate (%d) requested is not supported", __FUNCTION__, baud); break; case FT8U232AM: /* 8U232AM chip */ if (baud <= 3000000) { urb_value = FTDI_SIO_BAUD_TO_DIVISOR(baud); } else { - dbg(__FUNCTION__ " Baud rate too high!"); + dbg("%s - Baud rate too high!", __FUNCTION__); } break; } /* priv->chip_type */ @@ -390,7 +383,7 @@ if (urb_value == 0) { urb_value = ftdi_sio_b9600; } else { - dbg(__FUNCTION__ " Baud rate set to %d (divisor %d) on chip %s", baud, urb_value, (priv->chip_type == SIO) ? "SIO" : "FT8U232AM" ); + dbg("%s - Baud rate set to %d (divisor %d) on chip %s", __FUNCTION__, baud, urb_value, (priv->chip_type == SIO) ? "SIO" : "FT8U232AM" ); } return(urb_value); @@ -546,51 +539,42 @@ dbg("%s", __FUNCTION__); - down (&port->sem); - - MOD_INC_USE_COUNT; - ++port->open_count; - - if (!port->active){ - port->active = 1; - port->tty->low_latency = (priv->flags & ASYNC_LOW_LATENCY) ? 1 : 0; + port->tty->low_latency = (priv->flags & ASYNC_LOW_LATENCY) ? 1 : 0; - /* No error checking for this (will get errors later anyway) */ - /* See ftdi_sio.h for description of what is reset */ - usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), - FTDI_SIO_RESET_REQUEST, FTDI_SIO_RESET_REQUEST_TYPE, - FTDI_SIO_RESET_SIO, - 0, buf, 0, WDR_TIMEOUT); - - /* Termios defaults are set by usb_serial_init. We don't change - port->tty->termios - this would loose speed settings, etc. - This is same behaviour as serial.c/rs_open() - Kuba */ - - /* ftdi_set_termios will send usb control messages */ - ftdi_set_termios(port, &tmp_termios); - - /* FIXME: Flow control might be enabled, so it should be checked - - we have no control of defaults! */ - /* Turn on RTS and DTR since we are not flow controlling by default */ - if (set_dtr(serial->dev, usb_sndctrlpipe(serial->dev, 0),HIGH) < 0) { - err("%s Error from DTR HIGH urb", __FUNCTION__); - } - if (set_rts(serial->dev, usb_sndctrlpipe(serial->dev, 0),HIGH) < 0){ - err("%s Error from RTS HIGH urb", __FUNCTION__); - } - - /* Start reading from the device */ - FILL_BULK_URB(port->read_urb, serial->dev, - usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), - port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, - ftdi_read_bulk_callback, port); - result = usb_submit_urb(port->read_urb); - if (result) - err("%s - failed submitting read urb, error %d", __FUNCTION__, result); + /* No error checking for this (will get errors later anyway) */ + /* See ftdi_sio.h for description of what is reset */ + usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), + FTDI_SIO_RESET_REQUEST, FTDI_SIO_RESET_REQUEST_TYPE, + FTDI_SIO_RESET_SIO, + 0, buf, 0, WDR_TIMEOUT); + + /* Termios defaults are set by usb_serial_init. We don't change + port->tty->termios - this would loose speed settings, etc. + This is same behaviour as serial.c/rs_open() - Kuba */ + + /* ftdi_set_termios will send usb control messages */ + ftdi_set_termios(port, &tmp_termios); + + /* FIXME: Flow control might be enabled, so it should be checked - + we have no control of defaults! */ + /* Turn on RTS and DTR since we are not flow controlling by default */ + if (set_dtr(serial->dev, usb_sndctrlpipe(serial->dev, 0),HIGH) < 0) { + err("%s Error from DTR HIGH urb", __FUNCTION__); } + if (set_rts(serial->dev, usb_sndctrlpipe(serial->dev, 0),HIGH) < 0){ + err("%s Error from RTS HIGH urb", __FUNCTION__); + } + + /* Start reading from the device */ + FILL_BULK_URB(port->read_urb, serial->dev, + usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), + port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, + ftdi_read_bulk_callback, port); + result = usb_submit_urb(port->read_urb); + if (result) + err("%s - failed submitting read urb, error %d", __FUNCTION__, result); - up (&port->sem); return result; } /* ftdi_open */ @@ -603,48 +587,32 @@ dbg("%s", __FUNCTION__); - down (&port->sem); - --port->open_count; - - if (port->open_count <= 0) { - if (serial->dev) { - if (c_cflag & HUPCL){ - /* Disable flow control */ - if (usb_control_msg(serial->dev, - usb_sndctrlpipe(serial->dev, 0), - FTDI_SIO_SET_FLOW_CTRL_REQUEST, - FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, - 0, 0, buf, 0, WDR_TIMEOUT) < 0) { - err("error from flowcontrol urb"); - } - - /* drop DTR */ - if (set_dtr(serial->dev, usb_sndctrlpipe(serial->dev, 0), LOW) < 0){ - err("Error from DTR LOW urb"); - } - /* drop RTS */ - if (set_rts(serial->dev, usb_sndctrlpipe(serial->dev, 0),LOW) < 0) { - err("Error from RTS LOW urb"); - } - } /* Note change no line is hupcl is off */ - - /* shutdown our bulk reads and writes */ - /* ***CHECK*** behaviour when there is nothing queued */ - usb_unlink_urb (port->write_urb); - usb_unlink_urb (port->read_urb); - } - port->active = 0; - port->open_count = 0; - } else { - /* Send a HUP if necessary */ - if (!(port->tty->termios->c_cflag & CLOCAL)){ - tty_hangup(port->tty); - } + if (serial->dev) { + if (c_cflag & HUPCL){ + /* Disable flow control */ + if (usb_control_msg(serial->dev, + usb_sndctrlpipe(serial->dev, 0), + FTDI_SIO_SET_FLOW_CTRL_REQUEST, + FTDI_SIO_SET_FLOW_CTRL_REQUEST_TYPE, + 0, 0, buf, 0, WDR_TIMEOUT) < 0) { + err("error from flowcontrol urb"); + } + + /* drop DTR */ + if (set_dtr(serial->dev, usb_sndctrlpipe(serial->dev, 0), LOW) < 0){ + err("Error from DTR LOW urb"); + } + /* drop RTS */ + if (set_rts(serial->dev, usb_sndctrlpipe(serial->dev, 0),LOW) < 0) { + err("Error from RTS LOW urb"); + } + } /* Note change no line is hupcl is off */ + + /* shutdown our bulk reads and writes */ + /* ***CHECK*** behaviour when there is nothing queued */ + usb_unlink_urb (port->write_urb); + usb_unlink_urb (port->read_urb); } - - up (&port->sem); - MOD_DEC_USE_COUNT; - } /* ftdi_close */ @@ -678,20 +646,17 @@ return (0); } - down(&port->sem); - count += data_offset; count = (count > port->bulk_out_size) ? port->bulk_out_size : count; /* Copy in the data to send */ if (from_user) { - if (copy_from_user((char *)port->write_urb->transfer_buffer + data_offset, + if (copy_from_user(port->write_urb->transfer_buffer + data_offset, buf, count - data_offset )){ - up (&port->sem); return -EFAULT; } } else { - memcpy((char *)port->write_urb->transfer_buffer + data_offset, + memcpy(port->write_urb->transfer_buffer + data_offset, buf, count - data_offset ); } @@ -713,14 +678,11 @@ result = usb_submit_urb(port->write_urb); if (result) { err("%s - failed submitting write urb, error %d", __FUNCTION__, result); - up (&port->sem); return 0; } - up (&port->sem); dbg("%s write returning: %d", __FUNCTION__, count - data_offset); return (count - data_offset); - } /* ftdi_write */ @@ -729,7 +691,7 @@ struct usb_serial_port *port = (struct usb_serial_port *)urb->context; struct usb_serial *serial; - dbg(__FUNCTION__); + dbg("%s", __FUNCTION__); if (port_paranoia_check (port, "ftdi_write_bulk_callback")) { return; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/io_edgeport.c linux.20pre5-ac2/drivers/usb/serial/io_edgeport.c --- linux.20pre5/drivers/usb/serial/io_edgeport.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/io_edgeport.c 2002-09-01 13:38:10.000000000 +0100 @@ -242,13 +242,9 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include @@ -256,7 +252,7 @@ #include #include #include -#include +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -274,7 +270,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v2.2" +#define DRIVER_VERSION "v2.3" #define DRIVER_AUTHOR "Greg Kroah-Hartman and David Iacovelli" #define DRIVER_DESC "Edgeport USB Serial Driver" @@ -372,8 +368,8 @@ struct edgeport_serial { char name[MAX_NAME_LEN+1]; /* string name of this device */ - EDGE_MANUF_DESCRIPTOR manuf_descriptor; /* the manufacturer descriptor */ - EDGE_BOOT_DESCRIPTOR boot_descriptor; /* the boot firmware descriptor */ + struct edge_manuf_descriptor manuf_descriptor; /* the manufacturer descriptor */ + struct edge_boot_descriptor boot_descriptor; /* the boot firmware descriptor */ struct edgeport_product_info product_info; /* Product Info */ __u8 interrupt_in_endpoint; /* the interrupt endpoint handle */ @@ -400,17 +396,17 @@ }; /* baud rate information */ -typedef struct _DIVISOR_TABLE_ENTRY { +struct divisor_table_entry { __u32 BaudRate; __u16 Divisor; -} DIVISOR_TABLE_ENTRY, *PDIVISOR_TABLE_ENTRY; +}; // // Define table of divisors for Rev A EdgePort/4 hardware // These assume a 3.6864MHz crystal, the standard /16, and // MCR.7 = 0. // -static DIVISOR_TABLE_ENTRY DivisorTable[] = { +static struct divisor_table_entry divisor_table[] = { { 75, 3072}, { 110, 2095}, /* 2094.545455 => 230450 => .0217 % over */ { 134, 1713}, /* 1713.011152 => 230398.5 => .00065% under */ @@ -510,7 +506,7 @@ __u16 BootBuildNumber; __u8 *BootImage; __u32 BootSize; - PEDGE_FIRMWARE_IMAGE_RECORD record; + struct edge_firmware_image_record *record; unsigned char *firmware; int response; @@ -566,13 +562,13 @@ firmware = BootImage; for (;;) { - record = (PEDGE_FIRMWARE_IMAGE_RECORD)firmware; + record = (struct edge_firmware_image_record *)firmware; response = rom_write (edge_serial->serial, record->ExtAddr, record->Addr, record->Len, &record->Data[0]); if (response < 0) { err("sram_write failed (%x, %x, %d)", record->ExtAddr, record->Addr, record->Len); break; } - firmware += sizeof (EDGE_FIRMWARE_IMAGE_RECORD) + record->Len; + firmware += sizeof (struct edge_firmware_image_record) + record->Len; if (firmware >= &BootImage[BootSize]) { break; } @@ -811,7 +807,8 @@ dbg("%s - txcredits for port%d = %d", __FUNCTION__, portNumber, edge_port->txCredits); /* tell the tty driver that something has changed */ - wake_up_interruptible(&edge_port->port->tty->write_wait); + if (edge_port->port->tty) + wake_up_interruptible(&edge_port->port->tty->write_wait); // Since we have more credit, check if more data can be sent send_more_port_data(edge_serial, edge_port); @@ -898,13 +895,15 @@ tty = edge_port->port->tty; - /* let the tty driver wakeup if it has a special write_wakeup function */ - if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup) { - (tty->ldisc.write_wakeup)(tty); - } + if (tty) { + /* let the tty driver wakeup if it has a special write_wakeup function */ + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup) { + (tty->ldisc.write_wakeup)(tty); + } - /* tell the tty driver that something has changed */ - wake_up_interruptible(&tty->write_wait); + /* tell the tty driver that something has changed */ + wake_up_interruptible(&tty->write_wait); + } // Release the Write URB edge_port->write_in_progress = FALSE; @@ -953,7 +952,8 @@ tty = edge_port->port->tty; /* tell the tty driver that something has changed */ - wake_up_interruptible(&tty->write_wait); + if (tty) + wake_up_interruptible(&tty->write_wait); /* we have completed the command */ edge_port->commandPending = FALSE; @@ -987,133 +987,118 @@ if (edge_port == NULL) return -ENODEV; - ++port->open_count; - MOD_INC_USE_COUNT; - - if (!port->active) { - port->active = 1; - - /* force low_latency on so that our tty_push actually forces the data through, - otherwise it is scheduled, and with high data rates (like with OHCI) data - can get lost. */ + /* force low_latency on so that our tty_push actually forces the data through, + otherwise it is scheduled, and with high data rates (like with OHCI) data + can get lost. */ + if (port->tty) port->tty->low_latency = 1; + + /* see if we've set up our endpoint info yet (can't set it up in edge_startup + as the structures were not set up at that time.) */ + serial = port->serial; + edge_serial = (struct edgeport_serial *)serial->private; + if (edge_serial == NULL) { + return -ENODEV; + } + if (edge_serial->interrupt_in_buffer == NULL) { + struct usb_serial_port *port0 = &serial->port[0]; + + /* not set up yet, so do it now */ + edge_serial->interrupt_in_buffer = port0->interrupt_in_buffer; + edge_serial->interrupt_in_endpoint = port0->interrupt_in_endpointAddress; + edge_serial->interrupt_read_urb = port0->interrupt_in_urb; + edge_serial->bulk_in_buffer = port0->bulk_in_buffer; + edge_serial->bulk_in_endpoint = port0->bulk_in_endpointAddress; + edge_serial->read_urb = port0->read_urb; + edge_serial->bulk_out_endpoint = port0->bulk_out_endpointAddress; - /* see if we've set up our endpoint info yet (can't set it up in edge_startup - as the structures were not set up at that time.) */ - serial = port->serial; - edge_serial = (struct edgeport_serial *)serial->private; - if (edge_serial == NULL) { - port->active = 0; - port->open_count = 0; - MOD_DEC_USE_COUNT; - return -ENODEV; - } - if (edge_serial->interrupt_in_buffer == NULL) { - struct usb_serial_port *port0 = &serial->port[0]; - - /* not set up yet, so do it now */ - edge_serial->interrupt_in_buffer = port0->interrupt_in_buffer; - edge_serial->interrupt_in_endpoint = port0->interrupt_in_endpointAddress; - edge_serial->interrupt_read_urb = port0->interrupt_in_urb; - edge_serial->bulk_in_buffer = port0->bulk_in_buffer; - edge_serial->bulk_in_endpoint = port0->bulk_in_endpointAddress; - edge_serial->read_urb = port0->read_urb; - edge_serial->bulk_out_endpoint = port0->bulk_out_endpointAddress; + /* set up our interrupt urb */ + FILL_INT_URB(edge_serial->interrupt_read_urb, + serial->dev, + usb_rcvintpipe(serial->dev, + port0->interrupt_in_endpointAddress), + port0->interrupt_in_buffer, + edge_serial->interrupt_read_urb->transfer_buffer_length, + edge_interrupt_callback, edge_serial, + edge_serial->interrupt_read_urb->interval); - /* set up our interrupt urb */ - FILL_INT_URB(edge_serial->interrupt_read_urb, - serial->dev, - usb_rcvintpipe(serial->dev, - port0->interrupt_in_endpointAddress), - port0->interrupt_in_buffer, - edge_serial->interrupt_read_urb->transfer_buffer_length, - edge_interrupt_callback, edge_serial, - edge_serial->interrupt_read_urb->interval); - - /* set up our bulk in urb */ - FILL_BULK_URB(edge_serial->read_urb, serial->dev, - usb_rcvbulkpipe(serial->dev, port0->bulk_in_endpointAddress), - port0->bulk_in_buffer, - edge_serial->read_urb->transfer_buffer_length, - edge_bulk_in_callback, edge_serial); - - /* start interrupt read for this edgeport - * this interrupt will continue as long as the edgeport is connected */ - response = usb_submit_urb (edge_serial->interrupt_read_urb); - if (response) { - err("%s - Error %d submitting control urb", __FUNCTION__, response); - } + /* set up our bulk in urb */ + FILL_BULK_URB(edge_serial->read_urb, serial->dev, + usb_rcvbulkpipe(serial->dev, port0->bulk_in_endpointAddress), + port0->bulk_in_buffer, + edge_serial->read_urb->transfer_buffer_length, + edge_bulk_in_callback, edge_serial); + + /* start interrupt read for this edgeport + * this interrupt will continue as long as the edgeport is connected */ + response = usb_submit_urb (edge_serial->interrupt_read_urb); + if (response) { + err("%s - Error %d submitting control urb", __FUNCTION__, response); } - - /* initialize our wait queues */ - init_waitqueue_head(&edge_port->wait_open); - init_waitqueue_head(&edge_port->wait_chase); - init_waitqueue_head(&edge_port->delta_msr_wait); - init_waitqueue_head(&edge_port->wait_command); - - /* initialize our icount structure */ - memset (&(edge_port->icount), 0x00, sizeof(edge_port->icount)); - - /* initialize our port settings */ - edge_port->txCredits = 0; /* Can't send any data yet */ - edge_port->shadowMCR = MCR_MASTER_IE; /* Must always set this bit to enable ints! */ - edge_port->chaseResponsePending = FALSE; + } + + /* initialize our wait queues */ + init_waitqueue_head(&edge_port->wait_open); + init_waitqueue_head(&edge_port->wait_chase); + init_waitqueue_head(&edge_port->delta_msr_wait); + init_waitqueue_head(&edge_port->wait_command); + + /* initialize our icount structure */ + memset (&(edge_port->icount), 0x00, sizeof(edge_port->icount)); + + /* initialize our port settings */ + edge_port->txCredits = 0; /* Can't send any data yet */ + edge_port->shadowMCR = MCR_MASTER_IE; /* Must always set this bit to enable ints! */ + edge_port->chaseResponsePending = FALSE; + + /* send a open port command */ + edge_port->openPending = TRUE; + edge_port->open = FALSE; + response = send_iosp_ext_cmd (edge_port, IOSP_CMD_OPEN_PORT, 0); - /* send a open port command */ - edge_port->openPending = TRUE; - edge_port->open = FALSE; - response = send_iosp_ext_cmd (edge_port, IOSP_CMD_OPEN_PORT, 0); + if (response < 0) { + err("%s - error sending open port command", __FUNCTION__); + edge_port->openPending = FALSE; + return -ENODEV; + } - if (response < 0) { - err("%s - error sending open port command", __FUNCTION__); - edge_port->openPending = FALSE; - port->active = 0; - port->open_count = 0; - MOD_DEC_USE_COUNT; - return -ENODEV; - } - - /* now wait for the port to be completly opened */ - timeout = OPEN_TIMEOUT; - while (timeout && edge_port->openPending == TRUE) { - timeout = interruptible_sleep_on_timeout (&edge_port->wait_open, timeout); - } - - if (edge_port->open == FALSE) { - /* open timed out */ - dbg("%s - open timedout", __FUNCTION__); - edge_port->openPending = FALSE; - port->active = 0; - port->open_count = 0; - MOD_DEC_USE_COUNT; - return -ENODEV; - } - - /* create the txfifo */ - edge_port->txfifo.head = 0; - edge_port->txfifo.tail = 0; - edge_port->txfifo.count = 0; - edge_port->txfifo.size = edge_port->maxTxCredits; - edge_port->txfifo.fifo = kmalloc (edge_port->maxTxCredits, GFP_KERNEL); - - if (!edge_port->txfifo.fifo) { - dbg("%s - no memory", __FUNCTION__); - edge_close (port, filp); - return -ENOMEM; - } + /* now wait for the port to be completly opened */ + timeout = OPEN_TIMEOUT; + while (timeout && edge_port->openPending == TRUE) { + timeout = interruptible_sleep_on_timeout (&edge_port->wait_open, timeout); + } - /* Allocate a URB for the write */ - edge_port->write_urb = usb_alloc_urb (0); + if (edge_port->open == FALSE) { + /* open timed out */ + dbg("%s - open timedout", __FUNCTION__); + edge_port->openPending = FALSE; + return -ENODEV; + } - if (!edge_port->write_urb) { - dbg("%s - no memory", __FUNCTION__); - edge_close (port, filp); - return -ENOMEM; - } + /* create the txfifo */ + edge_port->txfifo.head = 0; + edge_port->txfifo.tail = 0; + edge_port->txfifo.count = 0; + edge_port->txfifo.size = edge_port->maxTxCredits; + edge_port->txfifo.fifo = kmalloc (edge_port->maxTxCredits, GFP_KERNEL); + + if (!edge_port->txfifo.fifo) { + dbg("%s - no memory", __FUNCTION__); + edge_close (port, filp); + return -ENOMEM; + } + + /* Allocate a URB for the write */ + edge_port->write_urb = usb_alloc_urb (0); - dbg("%s(%d) - Initialize TX fifo to %d bytes", __FUNCTION__, port->number, edge_port->maxTxCredits); + if (!edge_port->write_urb) { + dbg("%s - no memory", __FUNCTION__); + edge_close (port, filp); + return -ENOMEM; } + dbg("%s(%d) - Initialize TX fifo to %d bytes", __FUNCTION__, port->number, edge_port->maxTxCredits); + dbg("%s exited", __FUNCTION__); return 0; @@ -1243,56 +1228,49 @@ if ((edge_serial == NULL) || (edge_port == NULL)) return; - --port->open_count; + if (serial->dev) { + // block until tx is empty + block_until_tx_empty(edge_port); + + edge_port->closePending = TRUE; + + /* flush and chase */ + edge_port->chaseResponsePending = TRUE; + + dbg("%s - Sending IOSP_CMD_CHASE_PORT", __FUNCTION__); + status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CHASE_PORT, 0); + if (status == 0) { + // block until chase finished + block_until_chase_response(edge_port); + } else { + edge_port->chaseResponsePending = FALSE; + } - if (port->open_count <= 0) { - if (serial->dev) { - // block until tx is empty - block_until_tx_empty(edge_port); - - edge_port->closePending = TRUE; - - /* flush and chase */ - edge_port->chaseResponsePending = TRUE; - - dbg("%s - Sending IOSP_CMD_CHASE_PORT", __FUNCTION__); - status = send_iosp_ext_cmd (edge_port, IOSP_CMD_CHASE_PORT, 0); - if (status == 0) { - // block until chase finished - block_until_chase_response(edge_port); - } else { - edge_port->chaseResponsePending = FALSE; - } + /* close the port */ + dbg("%s - Sending IOSP_CMD_CLOSE_PORT", __FUNCTION__); + send_iosp_ext_cmd (edge_port, IOSP_CMD_CLOSE_PORT, 0); - /* close the port */ - dbg("%s - Sending IOSP_CMD_CLOSE_PORT", __FUNCTION__); - send_iosp_ext_cmd (edge_port, IOSP_CMD_CLOSE_PORT, 0); - - //port->close = TRUE; - edge_port->closePending = FALSE; - edge_port->open = FALSE; - edge_port->openPending = FALSE; + //port->close = TRUE; + edge_port->closePending = FALSE; + edge_port->open = FALSE; + edge_port->openPending = FALSE; - if (edge_port->write_urb) { - usb_unlink_urb (edge_port->write_urb); - } - } - if (edge_port->write_urb) { - /* if this urb had a transfer buffer already (old transfer) free it */ - if (edge_port->write_urb->transfer_buffer != NULL) { - kfree(edge_port->write_urb->transfer_buffer); - } - usb_free_urb (edge_port->write_urb); + usb_unlink_urb (edge_port->write_urb); } - if (edge_port->txfifo.fifo) { - kfree(edge_port->txfifo.fifo); + } + + if (edge_port->write_urb) { + /* if this urb had a transfer buffer already (old transfer) free it */ + if (edge_port->write_urb->transfer_buffer != NULL) { + kfree(edge_port->write_urb->transfer_buffer); } - port->active = 0; - port->open_count = 0; + usb_free_urb (edge_port->write_urb); + } + if (edge_port->txfifo.fifo) { + kfree(edge_port->txfifo.fifo); } - MOD_DEC_USE_COUNT; dbg("%s exited", __FUNCTION__); } @@ -1446,7 +1424,7 @@ /* build the data header for the buffer and port that we are about to send out */ count = fifo->count; - buffer = kmalloc (count+2, GFP_KERNEL); + buffer = kmalloc (count+2, GFP_ATOMIC); if (buffer == NULL) { err("%s - no more kernel memory...", __FUNCTION__); edge_port->write_in_progress = FALSE; @@ -1591,6 +1569,10 @@ } tty = port->tty; + if (!tty) { + dbg ("%s - no tty available", __FUNCTION__); + return; + } /* if we are implementing XON/XOFF, send the stop character */ if (I_IXOFF(tty)) { @@ -1636,6 +1618,10 @@ } tty = port->tty; + if (!tty) { + dbg ("%s - no tty available", __FUNCTION__); + return; + } /* if we are implementing XON/XOFF, send the start character */ if (I_IXOFF(tty)) { @@ -1667,15 +1653,14 @@ { struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); struct tty_struct *tty = port->tty; - unsigned int cflag = tty->termios->c_cflag; + unsigned int cflag; - dbg("%s - clfag %08x %08x iflag %08x %08x", __FUNCTION__, - tty->termios->c_cflag, - old_termios->c_cflag, - RELEVANT_IFLAG(tty->termios->c_iflag), - RELEVANT_IFLAG(old_termios->c_iflag) - ); + if (!port->tty || !port->tty->termios) { + dbg ("%s - no tty or termios", __FUNCTION__); + return; + } + cflag = tty->termios->c_cflag; /* check that they really want us to change something */ if (old_termios) { if ((cflag == old_termios->c_cflag) && @@ -1685,6 +1670,15 @@ } } + dbg("%s - clfag %08x iflag %08x", __FUNCTION__, + tty->termios->c_cflag, + RELEVANT_IFLAG(tty->termios->c_iflag)); + if (old_termios) { + dbg("%s - old clfag %08x old iflag %08x", __FUNCTION__, + old_termios->c_cflag, + RELEVANT_IFLAG(old_termios->c_iflag)); + } + dbg("%s - port %d", __FUNCTION__, port->number); if (edge_port == NULL) @@ -1732,6 +1726,9 @@ unsigned int result = 0; struct tty_struct *tty = edge_port->port->tty; + if (!tty) + return -ENOIOCTLCMD; + result = tty->read_cnt; dbg("%s(%d) = %d", __FUNCTION__, edge_port->port->number, result); @@ -2159,7 +2156,8 @@ handle_new_msr (edge_port, byte2); /* send the current line settings to the port so we are in sync with any further termios calls */ - change_port_settings (edge_port, edge_port->port->tty->termios); + if (edge_port->port->tty) + change_port_settings (edge_port, edge_port->port->tty->termios); /* we have completed the open */ edge_port->openPending = FALSE; @@ -2270,7 +2268,7 @@ } /* Place LSR data byte into Rx buffer */ - if (lsrData) { + if (lsrData && edge_port->port->tty) { tty_insert_flip_char(edge_port->port->tty, data, 0); tty_flip_buffer_push(edge_port->port->tty); } @@ -2442,7 +2440,7 @@ dbg("%s - %d, %d", __FUNCTION__, command, param); - buffer = kmalloc (10, GFP_KERNEL); + buffer = kmalloc (10, GFP_ATOMIC); if (!buffer) { err("%s - kmalloc(%d) failed.\n", __FUNCTION__, 10); return -ENOMEM; @@ -2543,7 +2541,7 @@ } // Alloc memory for the string of commands. - cmdBuffer = kmalloc (0x100, GFP_KERNEL); + cmdBuffer = kmalloc (0x100, GFP_ATOMIC); if (!cmdBuffer) { err("%s - kmalloc(%d) failed.\n", __FUNCTION__, 0x100); return -ENOMEM; @@ -2585,9 +2583,9 @@ dbg("%s - %d", __FUNCTION__, baudrate); - for (i = 0; i < NUM_ENTRIES(DivisorTable); i++) { - if ( DivisorTable[i].BaudRate == baudrate ) { - *divisor = DivisorTable[i].Divisor; + for (i = 0; i < NUM_ENTRIES(divisor_table); i++) { + if ( divisor_table[i].BaudRate == baudrate ) { + *divisor = divisor_table[i].Divisor; return 0; } } @@ -2629,7 +2627,7 @@ dbg("%s - write to %s register 0x%02x", (regNum == MCR) ? "MCR" : "LCR", __FUNCTION__, regValue); // Alloc memory for the string of commands. - cmdBuffer = kmalloc (0x10, GFP_KERNEL); + cmdBuffer = kmalloc (0x10, GFP_ATOMIC); if (cmdBuffer == NULL ) { return -ENOMEM; } @@ -2881,7 +2879,7 @@ ****************************************************************************/ static void load_application_firmware (struct edgeport_serial *edge_serial) { - PEDGE_FIRMWARE_IMAGE_RECORD record; + struct edge_firmware_image_record *record; unsigned char *firmware; unsigned char *FirmwareImage; int ImageSize; @@ -2919,13 +2917,13 @@ for (;;) { - record = (PEDGE_FIRMWARE_IMAGE_RECORD)firmware; + record = (struct edge_firmware_image_record *)firmware; response = sram_write (edge_serial->serial, record->ExtAddr, record->Addr, record->Len, &record->Data[0]); if (response < 0) { err("sram_write failed (%x, %x, %d)", record->ExtAddr, record->Addr, record->Len); break; } - firmware += sizeof (EDGE_FIRMWARE_IMAGE_RECORD) + record->Len; + firmware += sizeof (struct edge_firmware_image_record) + record->Len; if (firmware >= &FirmwareImage[ImageSize]) { break; } @@ -3039,9 +3037,6 @@ /* stop reads and writes on all ports */ for (i=0; i < serial->num_ports; ++i) { - while (serial->port[i].open_count > 0) { - edge_close (&serial->port[i], NULL); - } kfree (serial->port[i].private); serial->port[i].private = NULL; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/io_edgeport.h linux.20pre5-ac2/drivers/usb/serial/io_edgeport.h --- linux.20pre5/drivers/usb/serial/io_edgeport.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/io_edgeport.h 2002-09-01 13:38:10.000000000 +0100 @@ -136,7 +136,6 @@ __u16 Strings[1]; /* Start of string block */ }; -typedef struct string_block STRING_BLOCK, *PSTRING_BLOCK; #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/io_fw_boot2.h linux.20pre5-ac2/drivers/usb/serial/io_fw_boot2.h --- linux.20pre5/drivers/usb/serial/io_fw_boot2.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/io_fw_boot2.h 2002-09-01 13:38:10.000000000 +0100 @@ -12,20 +12,18 @@ //Image structure definition #if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD) #define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD - typedef struct _EDGE_FIRMWARE_IMAGE_RECORD - { + struct edge_firmware_image_record { unsigned short ExtAddr; unsigned short Addr; unsigned short Len; unsigned char Data[0]; - } EDGE_FIRMWARE_IMAGE_RECORD, *PEDGE_FIRMWARE_IMAGE_RECORD; + }; - typedef struct _EDGE_FIRMWARE_VERSION_INFO - { + struct edge_firmware_version_info { unsigned char MajorVersion; unsigned char MinorVersion; unsigned short BuildNumber; - } EDGE_FIRMWARE_VERSION_INFO, *PEDGE_FIRMWARE_VERSION_INFO; + }; #endif @@ -539,7 +537,7 @@ }; -static EDGE_FIRMWARE_VERSION_INFO IMAGE_VERSION_NAME = { +static struct edge_firmware_version_info IMAGE_VERSION_NAME = { 2, 0, 3 }; // Major, Minor, Build #undef IMAGE_VERSION_NAME diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/io_fw_boot.h linux.20pre5-ac2/drivers/usb/serial/io_fw_boot.h --- linux.20pre5/drivers/usb/serial/io_fw_boot.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/io_fw_boot.h 2002-09-01 13:38:10.000000000 +0100 @@ -12,20 +12,18 @@ //Image structure definition #if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD) #define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD - typedef struct _EDGE_FIRMWARE_IMAGE_RECORD - { + struct edge_firmware_image_record { unsigned short ExtAddr; unsigned short Addr; unsigned short Len; unsigned char Data[0]; - } EDGE_FIRMWARE_IMAGE_RECORD, *PEDGE_FIRMWARE_IMAGE_RECORD; + }; - typedef struct _EDGE_FIRMWARE_VERSION_INFO - { + struct edge_firmware_version_info { unsigned char MajorVersion; unsigned char MinorVersion; unsigned short BuildNumber; - } EDGE_FIRMWARE_VERSION_INFO, *PEDGE_FIRMWARE_VERSION_INFO; + }; #endif @@ -549,7 +547,7 @@ 0x7e, 0x74, 0x00, 0x01, 0x02, 0x08, 0xd6, }; -static EDGE_FIRMWARE_VERSION_INFO IMAGE_VERSION_NAME = { +static struct edge_firmware_version_info IMAGE_VERSION_NAME = { 1, 12, 2 }; // Major, Minor, Build #undef IMAGE_VERSION_NAME diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/io_fw_down2.h linux.20pre5-ac2/drivers/usb/serial/io_fw_down2.h --- linux.20pre5/drivers/usb/serial/io_fw_down2.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/io_fw_down2.h 2002-09-01 13:38:10.000000000 +0100 @@ -12,20 +12,18 @@ //Image structure definition #if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD) #define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD - typedef struct _EDGE_FIRMWARE_IMAGE_RECORD - { + struct edge_firmware_image_record { unsigned short ExtAddr; unsigned short Addr; unsigned short Len; unsigned char Data[0]; - } EDGE_FIRMWARE_IMAGE_RECORD, *PEDGE_FIRMWARE_IMAGE_RECORD; + }; - typedef struct _EDGE_FIRMWARE_VERSION_INFO - { - unsigned char MajorVersion; + struct edge_firmware_version_info { + unsigned char MajorVersion; unsigned char MinorVersion; unsigned short BuildNumber; - } EDGE_FIRMWARE_VERSION_INFO, *PEDGE_FIRMWARE_VERSION_INFO; + }; #endif @@ -1126,7 +1124,7 @@ 0x02, 0x03, 0x4e, 0xa0, 0x08, 0x22, 0x80, 0xfe, }; -static EDGE_FIRMWARE_VERSION_INFO IMAGE_VERSION_NAME = { +static struct edge_firmware_version_info IMAGE_VERSION_NAME = { 2, 0, 3 }; // Major, Minor, Build #undef IMAGE_VERSION_NAME diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/io_fw_down3.h linux.20pre5-ac2/drivers/usb/serial/io_fw_down3.h --- linux.20pre5/drivers/usb/serial/io_fw_down3.h 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/io_fw_down3.h 2002-09-01 13:38:10.000000000 +0100 @@ -7,14 +7,14 @@ static int IMAGE_SIZE = 12166; -typedef struct _EDGE_FIRMWARE_VERSION_INFO +struct EDGE_FIRMWARE_VERSION_INFO { unsigned char MajorVersion; unsigned char MinorVersion; unsigned short BuildNumber; -} EDGE_FIRMWARE_VERSION_INFO, *PEDGE_FIRMWARE_VERSION_INFO; +}; -static EDGE_FIRMWARE_VERSION_INFO IMAGE_VERSION_NAME = +static struct EDGE_FIRMWARE_VERSION_INFO IMAGE_VERSION_NAME = { 4, 1, 0 // Major, Minor, Build diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/io_fw_down.h linux.20pre5-ac2/drivers/usb/serial/io_fw_down.h --- linux.20pre5/drivers/usb/serial/io_fw_down.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/io_fw_down.h 2002-09-01 13:38:10.000000000 +0100 @@ -12,20 +12,18 @@ //Image structure definition #if !defined(DEFINED_EDGE_FIRMWARE_IMAGE_RECORD) #define DEFINED_EDGE_FIRMWARE_IMAGE_RECORD - typedef struct _EDGE_FIRMWARE_IMAGE_RECORD - { + struct edge_firmware_image_record { unsigned short ExtAddr; unsigned short Addr; unsigned short Len; unsigned char Data[0]; - } EDGE_FIRMWARE_IMAGE_RECORD, *PEDGE_FIRMWARE_IMAGE_RECORD; + }; - typedef struct _EDGE_FIRMWARE_VERSION_INFO - { + struct edge_firmware_version_info { unsigned char MajorVersion; unsigned char MinorVersion; unsigned short BuildNumber; - } EDGE_FIRMWARE_VERSION_INFO, *PEDGE_FIRMWARE_VERSION_INFO; + }; #endif @@ -1114,7 +1112,7 @@ 0x08, 0xa5, 0xb8, 0x02, 0x03, 0x4e, 0xa0, 0x08, 0x22, 0x80, 0xfe, }; -static EDGE_FIRMWARE_VERSION_INFO IMAGE_VERSION_NAME = { +static struct edge_firmware_version_info IMAGE_VERSION_NAME = { 1, 12, 3 }; // Major, Minor, Build #undef IMAGE_VERSION_NAME diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/io_ionsp.h linux.20pre5-ac2/drivers/usb/serial/io_ionsp.h --- linux.20pre5/drivers/usb/serial/io_ionsp.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/io_ionsp.h 2002-09-01 13:38:10.000000000 +0100 @@ -88,12 +88,12 @@ // Interrupt pipe // -typedef struct _INT_STATUS_PKT { +struct int_status_pkt { __u16 RxBytesAvail; // Additional bytes available to // be read from Bulk IN pipe __u16 TxCredits[ MAX_RS232_PORTS ]; // Additional space available in // given port's TxBuffer -} INT_STATUS_PKT, *PINT_STATUS_PKT; +}; #define GET_INT_STATUS_SIZE(NumPorts) (sizeof(__u16) + (sizeof(__u16) * (NumPorts))) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/io_tables.h linux.20pre5-ac2/drivers/usb/serial/io_tables.h --- linux.20pre5/drivers/usb/serial/io_tables.h 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/io_tables.h 2002-09-01 13:38:10.000000000 +0100 @@ -98,11 +98,9 @@ MODULE_DEVICE_TABLE (usb, id_table_combined); static struct usb_serial_device_type edgeport_1port_device = { + owner: THIS_MODULE, name: "Edgeport 1 port adapter", id_table: edgeport_1port_id_table, - needs_interrupt_in: MUST_HAVE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, num_interrupt_in: 1, num_bulk_in: 1, num_bulk_out: 1, @@ -122,11 +120,9 @@ }; static struct usb_serial_device_type edgeport_2port_device = { + owner: THIS_MODULE, name: "Edgeport 2 port adapter", id_table: edgeport_2port_id_table, - needs_interrupt_in: MUST_HAVE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, num_interrupt_in: 1, num_bulk_in: 1, num_bulk_out: 1, @@ -146,11 +142,9 @@ }; static struct usb_serial_device_type edgeport_4port_device = { + owner: THIS_MODULE, name: "Edgeport 4 port adapter", id_table: edgeport_4port_id_table, - needs_interrupt_in: MUST_HAVE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, num_interrupt_in: 1, num_bulk_in: 1, num_bulk_out: 1, @@ -170,11 +164,9 @@ }; static struct usb_serial_device_type edgeport_8port_device = { + owner: THIS_MODULE, name: "Edgeport 8 port adapter", id_table: edgeport_8port_id_table, - needs_interrupt_in: MUST_HAVE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, num_interrupt_in: 1, num_bulk_in: 1, num_bulk_out: 1, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/io_ti.c linux.20pre5-ac2/drivers/usb/serial/io_ti.c --- linux.20pre5/drivers/usb/serial/io_ti.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/io_ti.c 2002-09-01 13:38:03.000000000 +0100 @@ -161,7 +161,7 @@ MODULE_DEVICE_TABLE (usb, id_table_combined); -static EDGE_FIRMWARE_VERSION_INFO OperationalCodeImageVersion; +static struct EDGE_FIRMWARE_VERSION_INFO OperationalCodeImageVersion; static int TIStayInBootMode = 0; static int ignore_cpu_rev = 0; @@ -494,13 +494,10 @@ if ((oedb->XByteCount & 0x80 ) != 0 ) bytes_left += 64; -// if ((oedb->YByteCount & 0x80 ) != 0 ) -// bytes_left += 64; - if ((lsr & UMP_UART_LSR_TX_MASK ) == 0 ) bytes_left += 1; -// We return Not Active if we get any kind of error + /* We return Not Active if we get any kind of error */ exit_is_tx_active: dbg ("%s - return %d", __FUNCTION__, bytes_left ); return bytes_left; @@ -523,10 +520,6 @@ write_size, port->baud_rate, loops); while (1) { -// // Is it Stopped? -// if ( !DevExt->Started ) -// return; - // Save Last count last_count = port->tx.count; @@ -534,7 +527,6 @@ last_count, loops); /* Is the Edgeport Buffer empty? */ -// if ((port->tx.count == 0) && (port->CurrentWriteIrp == NULL)) { if (port->tx.count == 0) break; @@ -565,10 +557,6 @@ write_size, port->baud_rate, loops); while (1) { -// // Is it Stopped? -// if ( !DevExt->Started ) -// return; - /* This function takes 4 ms; */ if (!TIIsTxActive (port)) { /* Delay a few char times */ @@ -970,9 +958,6 @@ struct usb_interface_descriptor *interface; int download_cur_ver; int download_new_ver; -// PUSB_CONFIGURATION_DESCRIPTOR ConfigDesc; -// PUSB_INTERFACE_DESCRIPTOR pDesc; -// PVOID MemHandle; /* This routine is entered by both the BOOT mode and the Download mode * We can determine which code is running by the reading the config @@ -1640,7 +1625,7 @@ } if (urb->status) { - dbg(__FUNCTION__" - nonzero control read status received: %d", urb->status); + dbg("%s - nonzero control read status received: %d", __FUNCTION__, urb->status); return; } @@ -1815,7 +1800,7 @@ struct usb_device *dev; struct urb *urb; int port_number; - int status = 0; + int status; u16 open_settings; u8 transaction_timeout; @@ -1827,155 +1812,140 @@ if (edge_port == NULL) return -ENODEV; - down (&port->sem); - - ++port->open_count; - MOD_INC_USE_COUNT; - - if (!port->active) { - port->active = 1; - - /* force low_latency on so that our tty_push actually forces the data through, - otherwise it is scheduled, and with high data rates (like with OHCI) data - can get lost. */ - if (port->tty) - port->tty->low_latency = 1; + /* force low_latency on so that our tty_push actually forces the data through, + otherwise it is scheduled, and with high data rates (like with OHCI) data + can get lost. */ + if (port->tty) + port->tty->low_latency = 1; + + port_number = port->number - port->serial->minor; + switch (port_number) { + case 0: + edge_port->uart_base = UMPMEM_BASE_UART1; + edge_port->dma_address = UMPD_OEDB1_ADDRESS; + break; + case 1: + edge_port->uart_base = UMPMEM_BASE_UART2; + edge_port->dma_address = UMPD_OEDB2_ADDRESS; + break; + default: + err ("Unknown port number!!!"); + return -ENODEV; + } - port_number = port->number - port->serial->minor; - switch (port_number) { - case 0: - edge_port->uart_base = UMPMEM_BASE_UART1; - edge_port->dma_address = UMPD_OEDB1_ADDRESS; - break; - case 1: - edge_port->uart_base = UMPMEM_BASE_UART2; - edge_port->dma_address = UMPD_OEDB2_ADDRESS; - break; - default: - err ("Unknown port number!!!"); - status = -ENODEV; - goto exit; - } + dbg ("%s - port_number = %d, uart_base = %04x, dma_address = %04x", + __FUNCTION__, port_number, edge_port->uart_base, edge_port->dma_address); - dbg ("%s - port_number = %d, uart_base = %04x, dma_address = %04x", - __FUNCTION__, port_number, edge_port->uart_base, edge_port->dma_address); + dev = port->serial->dev; - dev = port->serial->dev; + memset (&(edge_port->icount), 0x00, sizeof(edge_port->icount)); + init_waitqueue_head (&edge_port->delta_msr_wait); - memset (&(edge_port->icount), 0x00, sizeof(edge_port->icount)); - init_waitqueue_head (&edge_port->delta_msr_wait); + /* turn off loopback */ + status = TIClearLoopBack (edge_port); + if (status) + return status; + + /* set up the port settings */ + edge_set_termios (port, NULL); - /* turn off loopback */ - status = TIClearLoopBack (edge_port); - if (status) - goto exit; - - /* set up the port settings */ - edge_set_termios (port, NULL); + /* open up the port */ - /* open up the port */ + /* milliseconds to timeout for DMA transfer */ + transaction_timeout = 2; - /* milliseconds to timeout for DMA transfer */ - transaction_timeout = 2; + edge_port->ump_read_timeout = max (20, ((transaction_timeout * 3) / 2) ); - edge_port->ump_read_timeout = max (20, ((transaction_timeout * 3) / 2) ); - - // milliseconds to timeout for DMA transfer - open_settings = (u8)(UMP_DMA_MODE_CONTINOUS | - UMP_PIPE_TRANS_TIMEOUT_ENA | - (transaction_timeout << 2)); - - dbg ("%s - Sending UMPC_OPEN_PORT", __FUNCTION__); - - /* Tell TI to open and start the port */ - status = TIWriteCommandSync (dev, - UMPC_OPEN_PORT, - (u8)(UMPM_UART1_PORT + port_number), - open_settings, - NULL, - 0); - if (status) - goto exit; + // milliseconds to timeout for DMA transfer + open_settings = (u8)(UMP_DMA_MODE_CONTINOUS | + UMP_PIPE_TRANS_TIMEOUT_ENA | + (transaction_timeout << 2)); - /* Start the DMA? */ - status = TIWriteCommandSync (dev, - UMPC_START_PORT, - (u8)(UMPM_UART1_PORT + port_number), - 0, - NULL, - 0); - if (status) - goto exit; + dbg ("%s - Sending UMPC_OPEN_PORT", __FUNCTION__); - /* Clear TX and RX buffers in UMP */ - status = TIPurgeDataSync (port, UMP_PORT_DIR_OUT | UMP_PORT_DIR_IN); - if (status) - goto exit; + /* Tell TI to open and start the port */ + status = TIWriteCommandSync (dev, + UMPC_OPEN_PORT, + (u8)(UMPM_UART1_PORT + port_number), + open_settings, + NULL, + 0); + if (status) + return status; - /* Read Initial MSR */ - status = TIReadVendorRequestSync (dev, - UMPC_READ_MSR, // Request - 0, // wValue - (__u16)(UMPM_UART1_PORT + port_number), // wIndex (Address) - &edge_port->shadow_msr, // TransferBuffer - 1); // TransferBufferLength - if (status) - goto exit; + /* Start the DMA? */ + status = TIWriteCommandSync (dev, + UMPC_START_PORT, + (u8)(UMPM_UART1_PORT + port_number), + 0, + NULL, + 0); + if (status) + return status; - dbg ("ShadowMSR 0x%X", edge_port->shadow_msr); - - edge_serial = edge_port->edge_serial; - if (edge_serial->num_ports_open == 0) { - dbg ("%s - setting up bulk in urb", __FUNCTION__); - /* we are the first port to be opened, let's post the interrupt urb */ - urb = edge_serial->serial->port[0].interrupt_in_urb; - if (!urb) { - err ("%s - no interrupt urb present, exiting", __FUNCTION__); - status = -EINVAL; - goto exit; - } - urb->complete = edge_interrupt_callback; - urb->context = edge_serial; - urb->dev = dev; - status = usb_submit_urb (urb); - if (status) { - err ("%s - usb_submit_urb failed with value %d", __FUNCTION__, status); - goto exit; - } - } + /* Clear TX and RX buffers in UMP */ + status = TIPurgeDataSync (port, UMP_PORT_DIR_OUT | UMP_PORT_DIR_IN); + if (status) + return status; - /* reset the data toggle on the bulk endpoints */ - usb_clear_halt (dev, port->write_urb->pipe); - usb_clear_halt (dev, port->read_urb->pipe); + /* Read Initial MSR */ + status = TIReadVendorRequestSync (dev, + UMPC_READ_MSR, // Request + 0, // wValue + (__u16)(UMPM_UART1_PORT + port_number), // wIndex (Address) + &edge_port->shadow_msr, // TransferBuffer + 1); // TransferBufferLength + if (status) + return status; - /* start up our bulk read urb */ - urb = port->read_urb; + dbg ("ShadowMSR 0x%X", edge_port->shadow_msr); + + edge_serial = edge_port->edge_serial; + if (edge_serial->num_ports_open == 0) { + dbg ("%s - setting up bulk in urb", __FUNCTION__); + /* we are the first port to be opened, let's post the interrupt urb */ + urb = edge_serial->serial->port[0].interrupt_in_urb; if (!urb) { - err ("%s - no read urb present, exiting", __FUNCTION__); - status = -EINVAL; - goto exit; + err ("%s - no interrupt urb present, exiting", __FUNCTION__); + return -EINVAL; } - urb->complete = edge_bulk_in_callback; - urb->context = edge_port; + urb->complete = edge_interrupt_callback; + urb->context = edge_serial; urb->dev = dev; status = usb_submit_urb (urb); if (status) { - err ("%s - read bulk usb_submit_urb failed with value %d", __FUNCTION__, status); - goto exit; + err ("%s - usb_submit_urb failed with value %d", __FUNCTION__, status); + return status; } + } - ++edge_serial->num_ports_open; + /* + * reset the data toggle on the bulk endpoints to work around bug in + * host controllers where things get out of sync some times + */ + usb_clear_halt (dev, port->write_urb->pipe); + usb_clear_halt (dev, port->read_urb->pipe); + /* start up our bulk read urb */ + urb = port->read_urb; + if (!urb) { + err ("%s - no read urb present, exiting", __FUNCTION__); + return -EINVAL; + } + urb->complete = edge_bulk_in_callback; + urb->context = edge_port; + urb->dev = dev; + status = usb_submit_urb (urb); + if (status) { + err ("%s - read bulk usb_submit_urb failed with value %d", __FUNCTION__, status); + return status; } -exit: - up (&port->sem); - dbg("%s - exited, status = %d", __FUNCTION__, status); + ++edge_serial->num_ports_open; - if (status) - MOD_DEC_USE_COUNT; + dbg("%s - exited", __FUNCTION__); - return status; + return 0; } static void edge_close (struct usb_serial_port *port, struct file * filp) @@ -1989,7 +1959,7 @@ if (port_paranoia_check (port, __FUNCTION__)) return; - dbg(__FUNCTION__ " - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); serial = get_usb_serial (port, __FUNCTION__); if (!serial) @@ -1999,46 +1969,37 @@ edge_port = (struct edgeport_port *)port->private; if ((edge_serial == NULL) || (edge_port == NULL)) return; - - down (&port->sem); - --port->open_count; - if (port->open_count <= 0) { - if (serial->dev) { - /* The bulkreadcompletion routine will check - * this flag and dump add read data */ - edge_port->close_pending = 1; - - /* chase the port close */ - TIChasePort (edge_port); - - usb_unlink_urb (port->read_urb); - - /* assuming we can still talk to the device, - * send a close port command to it */ - dbg("%s - send umpc_close_port", __FUNCTION__); - port_number = port->number - port->serial->minor; - status = TIWriteCommandSync (port->serial->dev, - UMPC_CLOSE_PORT, - (__u8)(UMPM_UART1_PORT + port_number), - 0, - NULL, - 0); - --edge_port->edge_serial->num_ports_open; - if (edge_port->edge_serial->num_ports_open <= 0) { - /* last port is now closed, let's shut down our interrupt urb */ - usb_unlink_urb (serial->port[0].interrupt_in_urb); - edge_port->edge_serial->num_ports_open = 0; - } + + if (serial->dev) { + /* The bulkreadcompletion routine will check + * this flag and dump add read data */ + edge_port->close_pending = 1; + + /* chase the port close */ + TIChasePort (edge_port); + + usb_unlink_urb (port->read_urb); + + /* assuming we can still talk to the device, + * send a close port command to it */ + dbg("%s - send umpc_close_port", __FUNCTION__); + port_number = port->number - port->serial->minor; + status = TIWriteCommandSync (port->serial->dev, + UMPC_CLOSE_PORT, + (__u8)(UMPM_UART1_PORT + port_number), + 0, + NULL, + 0); + --edge_port->edge_serial->num_ports_open; + if (edge_port->edge_serial->num_ports_open <= 0) { + /* last port is now closed, let's shut down our interrupt urb */ + usb_unlink_urb (serial->port[0].interrupt_in_urb); + edge_port->edge_serial->num_ports_open = 0; } - edge_port->close_pending = 0; - port->active = 0; - port->open_count = 0; + edge_port->close_pending = 0; } - up (&port->sem); - - dbg(__FUNCTION__" exited"); - MOD_DEC_USE_COUNT; + dbg("%s - exited", __FUNCTION__); } static int edge_write (struct usb_serial_port *port, int from_user, const unsigned char *data, int count) @@ -2086,7 +2047,7 @@ /* send the data out the bulk port */ result = usb_submit_urb(port->write_urb); if (result) - err(__FUNCTION__ " - failed submitting write urb, error %d", result); + err("%s - failed submitting write urb, error %d", __FUNCTION__, result); else result = count; @@ -2101,19 +2062,19 @@ struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); int room = 0; - dbg(__FUNCTION__); + dbg("%s", __FUNCTION__); if (edge_port == NULL) return -ENODEV; if (edge_port->close_pending == 1) return -ENODEV; - dbg(__FUNCTION__" - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); if (port->write_urb->status != -EINPROGRESS) room = port->bulk_out_size; - dbg(__FUNCTION__ " - returns %d", room); + dbg("%s - returns %d", __FUNCTION__, room); return room; } @@ -2122,7 +2083,7 @@ struct edgeport_port *edge_port = (struct edgeport_port *)(port->private); int chars = 0; - dbg(__FUNCTION__); + dbg("%s", __FUNCTION__); if (edge_port == NULL) return -ENODEV; @@ -2177,7 +2138,7 @@ struct tty_struct *tty; int status; - dbg(__FUNCTION__" - port %d", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); if (edge_port == NULL) return; @@ -2268,32 +2229,32 @@ if (cflag & PARODD) { config->wFlags |= UMP_MASK_UART_FLAGS_PARITY; config->bParity = UMP_UART_ODDPARITY; - dbg(__FUNCTION__" - parity = odd"); + dbg("%s - parity = odd", __FUNCTION__); } else { config->wFlags |= UMP_MASK_UART_FLAGS_PARITY; config->bParity = UMP_UART_EVENPARITY; - dbg(__FUNCTION__" - parity = even"); + dbg("%s - parity = even", __FUNCTION__); } } else { config->bParity = UMP_UART_NOPARITY; - dbg(__FUNCTION__" - parity = none"); + dbg("%s - parity = none", __FUNCTION__); } if (cflag & CSTOPB) { config->bStopBits = UMP_UART_STOPBIT2; - dbg(__FUNCTION__" - stop bits = 2"); + dbg("%s - stop bits = 2", __FUNCTION__); } else { config->bStopBits = UMP_UART_STOPBIT1; - dbg(__FUNCTION__" - stop bits = 1"); + dbg("%s - stop bits = 1", __FUNCTION__); } /* figure out the flow control settings */ if (cflag & CRTSCTS) { config->wFlags |= UMP_MASK_UART_FLAGS_OUT_X_CTS_FLOW; config->wFlags |= UMP_MASK_UART_FLAGS_RTS_FLOW; - dbg(__FUNCTION__" - RTS/CTS is enabled"); + dbg("%s - RTS/CTS is enabled", __FUNCTION__); } else { - dbg(__FUNCTION__" - RTS/CTS is disabled"); + dbg("%s - RTS/CTS is disabled", __FUNCTION__); } /* if we are implementing XON/XOFF, set the start and stop character in the device */ @@ -2461,7 +2422,7 @@ | ((msr & MSR_DSR) ? TIOCM_DSR: 0); /* 0x100 */ - dbg(__FUNCTION__" -- %x", result); + dbg("%s -- %x", __FUNCTION__, result); if (copy_to_user(value, &result, sizeof(int))) return -EFAULT; @@ -2502,42 +2463,42 @@ struct async_icount cnow; struct async_icount cprev; - dbg(__FUNCTION__" - port %d, cmd = 0x%x", port->number, cmd); + dbg("%s - port %d, cmd = 0x%x", __FUNCTION__, port->number, cmd); switch (cmd) { case TIOCINQ: - dbg(__FUNCTION__" (%d) TIOCINQ", port->number); + dbg("%s - (%d) TIOCINQ", __FUNCTION__, port->number); // return get_number_bytes_avail(edge_port, (unsigned int *) arg); break; case TIOCSERGETLSR: - dbg(__FUNCTION__" (%d) TIOCSERGETLSR", port->number); + dbg("%s - (%d) TIOCSERGETLSR", __FUNCTION__, port->number); // return get_lsr_info(edge_port, (unsigned int *) arg); break; case TIOCMBIS: case TIOCMBIC: case TIOCMSET: - dbg(__FUNCTION__" (%d) TIOCMSET/TIOCMBIC/TIOCMSET", port->number); + dbg("%s - (%d) TIOCMSET/TIOCMBIC/TIOCMSET", __FUNCTION__, port->number); return set_modem_info(edge_port, cmd, (unsigned int *) arg); break; case TIOCMGET: - dbg(__FUNCTION__" (%d) TIOCMGET", port->number); + dbg("%s - (%d) TIOCMGET", __FUNCTION__, port->number); return get_modem_info(edge_port, (unsigned int *) arg); break; case TIOCGSERIAL: - dbg(__FUNCTION__" (%d) TIOCGSERIAL", port->number); + dbg("%s - (%d) TIOCGSERIAL", __FUNCTION__, port->number); return get_serial_info(edge_port, (struct serial_struct *) arg); break; case TIOCSSERIAL: - dbg(__FUNCTION__" (%d) TIOCSSERIAL", port->number); + dbg("%s - (%d) TIOCSSERIAL", __FUNCTION__, port->number); break; case TIOCMIWAIT: - dbg(__FUNCTION__" (%d) TIOCMIWAIT", port->number); + dbg("%s - (%d) TIOCMIWAIT", __FUNCTION__, port->number); cprev = edge_port->icount; while (1) { interruptible_sleep_on(&edge_port->delta_msr_wait); @@ -2604,7 +2565,7 @@ /* create our private serial structure */ edge_serial = kmalloc (sizeof(struct edgeport_serial), GFP_KERNEL); if (edge_serial == NULL) { - err(__FUNCTION__" - Out of memory"); + err("%s - Out of memory", __FUNCTION__); return -ENOMEM; } memset (edge_serial, 0, sizeof(struct edgeport_serial)); @@ -2621,7 +2582,7 @@ for (i = 0; i < serial->num_ports; ++i) { edge_port = kmalloc (sizeof(struct edgeport_port), GFP_KERNEL); if (edge_port == NULL) { - err(__FUNCTION__" - Out of memory"); + err("%s - Out of memory", __FUNCTION__); return -ENOMEM; } memset (edge_port, 0, sizeof(struct edgeport_port)); @@ -2637,7 +2598,7 @@ { int i; - dbg (__FUNCTION__); + dbg ("%s", __FUNCTION__); for (i=0; i < serial->num_ports; ++i) { kfree (serial->port[i].private); @@ -2649,11 +2610,9 @@ static struct usb_serial_device_type edgeport_1port_device = { + owner: THIS_MODULE, name: "Edgeport TI 1 port adapter", id_table: edgeport_1port_id_table, - needs_interrupt_in: MUST_HAVE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, num_interrupt_in: 1, num_bulk_in: 1, num_bulk_out: 1, @@ -2673,11 +2632,9 @@ }; static struct usb_serial_device_type edgeport_2port_device = { + owner: THIS_MODULE, name: "Edgeport TI 2 port adapter", id_table: edgeport_2port_id_table, - needs_interrupt_in: MUST_HAVE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, num_interrupt_in: 1, num_bulk_in: 2, num_bulk_out: 2, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/io_ti.h linux.20pre5-ac2/drivers/usb/serial/io_ti.h --- linux.20pre5/drivers/usb/serial/io_ti.h 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/io_ti.h 2002-09-01 13:38:03.000000000 +0100 @@ -165,11 +165,11 @@ * TYPE DEFINITIONS * Structures for USB interrupts */ -typedef struct /* Interrupt packet structure */ +struct ump_interrupt /* Interrupt packet structure */ { __u8 bICode; /* Interrupt code (interrupt num) */ __u8 bIInfo; /* Interrupt information */ -} tUmpInterrupt, *ptUmpInterrupt __attribute__((packed)); +} __attribute__((packed)); #define TIUMP_GET_PORT_FROM_CODE(c) (((c) >> 4) - 3) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/io_usbvend.h linux.20pre5-ac2/drivers/usb/serial/io_usbvend.h --- linux.20pre5/drivers/usb/serial/io_usbvend.h 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/io_usbvend.h 2002-09-01 13:38:10.000000000 +0100 @@ -107,6 +107,7 @@ #define ION_DEVICE_ID_BB_EDGEPORT_16_DUAL_CPU 0x012 // Half of an Edgeport/16 (the kind with 2 EP/8s) #define ION_DEVICE_ID_BB_EDGEPORT_8I 0x014 // Edgeport/8 RS422 (single-CPU) + /* Edgeport TI based devices */ #define ION_DEVICE_ID_TI_EDGEPORT_4 0x0201 /* Edgeport/4 RS232 */ #define ION_DEVICE_ID_TI_EDGEPORT_2 0x0205 /* Edgeport/2 RS232 */ @@ -207,11 +208,11 @@ // Version 2 format of DeviceParams. This format is longer (3C0h) // and starts lower in memory, at the uppermost 1K in ROM. #define EDGE_MANUF_DESC_ADDR 0x00FF7C00 -#define EDGE_MANUF_DESC_LEN sizeof(EDGE_MANUF_DESCRIPTOR) +#define EDGE_MANUF_DESC_LEN sizeof(struct edge_manuf_descriptor) // Boot params descriptor #define EDGE_BOOT_DESC_ADDR 0x00FF7FC0 -#define EDGE_BOOT_DESC_LEN sizeof(EDGE_BOOT_DESCRIPTOR) +#define EDGE_BOOT_DESC_LEN sizeof(struct edge_boot_descriptor) // Define the max block size that may be read or written // in a read/write RAM/ROM command. @@ -252,7 +253,7 @@ #define MAX_SERIALNUMBER_LEN 12 #define MAX_ASSEMBLYNUMBER_LEN 14 -typedef struct _EDGE_MANUF_DESCRIPTOR { +struct edge_manuf_descriptor { __u16 RootDescTable[0x10]; // C00 Root of descriptor tables (just a placeholder) __u8 DescriptorArea[0x2E0]; // C20 Descriptors go here, up to 2E0h (just a placeholder) @@ -297,7 +298,7 @@ __u8 IonConfig; // FBF Config byte for ION manufacturing use // FBF end of structure, total len = 3C0h -} EDGE_MANUF_DESCRIPTOR, *PEDGE_MANUF_DESCRIPTOR; +}; #define MANUF_DESC_VER_1 1 // Original definition of MANUF_DESC @@ -342,10 +343,10 @@ -#define MANUF_SERNUM_LENGTH sizeof(((PEDGE_MANUF_DESCRIPTOR)0)->SerialNumber) -#define MANUF_ASSYNUM_LENGTH sizeof(((PEDGE_MANUF_DESCRIPTOR)0)->AssemblyNumber) -#define MANUF_OEMASSYNUM_LENGTH sizeof(((PEDGE_MANUF_DESCRIPTOR)0)->OemAssyNumber) -#define MANUF_MANUFDATE_LENGTH sizeof(((PEDGE_MANUF_DESCRIPTOR)0)->ManufDate) +#define MANUF_SERNUM_LENGTH sizeof(((struct edge_manuf_descriptor *)0)->SerialNumber) +#define MANUF_ASSYNUM_LENGTH sizeof(((struct edge_manuf_descriptor *)0)->AssemblyNumber) +#define MANUF_OEMASSYNUM_LENGTH sizeof(((struct edge_manuf_descriptor *)0)->OemAssyNumber) +#define MANUF_MANUFDATE_LENGTH sizeof(((struct edge_manuf_descriptor *)0)->ManufDate) #define MANUF_ION_CONFIG_MASTER 0x80 // 1=Master mode, 0=Normal #define MANUF_ION_CONFIG_DIAG 0x40 // 1=Run h/w diags, 0=norm @@ -360,7 +361,7 @@ // - FF:xFFF. Note that the 930-mandated UCONFIG bytes are // included in this structure. // -typedef struct _EDGE_BOOT_DESCRIPTOR { +struct edge_boot_descriptor { __u8 Length; // C0 Desc length, per USB (= 40h) __u8 DescType; // C1 Desc type, per USB (= DEVICE type) __u8 DescVer; // C2 Desc version/format @@ -384,8 +385,7 @@ __u8 UConfig1; // F9 930-defined CPU configuration byte 1 __u8 Reserved3[6]; // FA -- unused, set to 0 -- // FF end of structure, total len = 80 - -} EDGE_BOOT_DESCRIPTOR, *PEDGE_BOOT_DESCRIPTOR; +}; #define BOOT_DESC_VER_1 1 // Original definition of BOOT_PARAMS @@ -442,7 +442,7 @@ __u8 CheckSum; }__attribute__((packed)); -typedef struct +struct ti_basic_descriptor { __u8 Power; // Self powered // bit 7: 1 - power switching supported @@ -457,7 +457,7 @@ __u16 DevPid; // PID Edgeport __u8 HubTime; // Time for power on to power good __u8 HubCurrent; // HUB Current = 100ma -} TI_BASIC_DESCRIPTOR, *PTI_BASIC_DESCRIPTOR __attribute__((packed)); +} __attribute__((packed)); #define TI_GET_CPU_REVISION(x) (__u8)((((x)>>4)&0x0f)) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/ipaq.c linux.20pre5-ac2/drivers/usb/serial/ipaq.c --- linux.20pre5/drivers/usb/serial/ipaq.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/ipaq.c 2002-09-01 13:38:34.000000000 +0100 @@ -38,18 +38,15 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -99,24 +96,22 @@ /* All of the device info needed for the Compaq iPAQ */ struct usb_serial_device_type ipaq_device = { - name: "Compaq iPAQ", - id_table: ipaq_id_table, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: ipaq_open, - close: ipaq_close, - startup: ipaq_startup, - shutdown: ipaq_shutdown, - write: ipaq_write, - write_room: ipaq_write_room, - chars_in_buffer: ipaq_chars_in_buffer, - read_bulk_callback: ipaq_read_bulk_callback, - write_bulk_callback: ipaq_write_bulk_callback, + .owner = THIS_MODULE, + .name = "Compaq iPAQ", + .id_table = ipaq_id_table, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 1, + .open = ipaq_open, + .close = ipaq_close, + .startup = ipaq_startup, + .shutdown = ipaq_shutdown, + .write = ipaq_write, + .write_room = ipaq_write_room, + .chars_in_buffer = ipaq_chars_in_buffer, + .read_bulk_callback = ipaq_read_bulk_callback, + .write_bulk_callback = ipaq_write_bulk_callback, }; static spinlock_t write_list_lock; @@ -137,121 +132,101 @@ dbg("%s - port %d", __FUNCTION__, port->number); - down(&port->sem); - - ++port->open_count; - MOD_INC_USE_COUNT; - - if (!port->active) { - port->active = 1; - bytes_in = 0; - bytes_out = 0; - priv = (struct ipaq_private *)kmalloc(sizeof(struct ipaq_private), GFP_KERNEL); - if (priv == NULL) { - err("%s - Out of memory", __FUNCTION__); - result = -ENOMEM; - goto error; - } - port->private = (void *)priv; - priv->active = 0; - priv->queue_len = 0; - INIT_LIST_HEAD(&priv->queue); - INIT_LIST_HEAD(&priv->freelist); - - for (i = 0; i < URBDATA_QUEUE_MAX / PACKET_SIZE; i++) { - pkt = kmalloc(sizeof(struct ipaq_packet), GFP_KERNEL); - if (pkt == NULL) { - goto enomem; - } - pkt->data = kmalloc(PACKET_SIZE, GFP_KERNEL); - if (pkt->data == NULL) { - kfree(pkt); - goto enomem; - } - pkt->len = 0; - pkt->written = 0; - INIT_LIST_HEAD(&pkt->list); - list_add(&pkt->list, &priv->freelist); - priv->free_len += PACKET_SIZE; - } - - /* - * Force low latency on. This will immediately push data to the line - * discipline instead of queueing. - */ - - port->tty->low_latency = 1; - port->tty->raw = 1; - port->tty->real_raw = 1; - - /* - * Lose the small buffers usbserial provides. Make larger ones. - */ - - kfree(port->bulk_in_buffer); - kfree(port->bulk_out_buffer); - port->bulk_in_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL); - if (port->bulk_in_buffer == NULL) { + bytes_in = 0; + bytes_out = 0; + priv = (struct ipaq_private *)kmalloc(sizeof(struct ipaq_private), GFP_KERNEL); + if (priv == NULL) { + err("%s - Out of memory", __FUNCTION__); + return -ENOMEM; + } + port->private = (void *)priv; + priv->active = 0; + priv->queue_len = 0; + INIT_LIST_HEAD(&priv->queue); + INIT_LIST_HEAD(&priv->freelist); + + for (i = 0; i < URBDATA_QUEUE_MAX / PACKET_SIZE; i++) { + pkt = kmalloc(sizeof(struct ipaq_packet), GFP_KERNEL); + if (pkt == NULL) { goto enomem; } - port->bulk_out_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL); - if (port->bulk_out_buffer == NULL) { - kfree(port->bulk_in_buffer); + pkt->data = kmalloc(PACKET_SIZE, GFP_KERNEL); + if (pkt->data == NULL) { + kfree(pkt); goto enomem; } - port->read_urb->transfer_buffer = port->bulk_in_buffer; - port->write_urb->transfer_buffer = port->bulk_out_buffer; - port->read_urb->transfer_buffer_length = URBDATA_SIZE; - port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE; - - /* Start reading from the device */ - FILL_BULK_URB(port->read_urb, serial->dev, - usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), - port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, - ipaq_read_bulk_callback, port); - result = usb_submit_urb(port->read_urb); - if (result) { - err("%s - failed submitting read urb, error %d", __FUNCTION__, result); - goto cleanup; - } - - /* - * Send out control message observed in win98 sniffs. Not sure what - * it does, but from empirical observations, it seems that the device - * will start the chat sequence once one of these messages gets - * through. Since this has a reasonably high failure rate, we retry - * several times. - */ - - while (retries--) { - result = usb_control_msg(serial->dev, - usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21, - 0x1, 0, NULL, 0, HZ / 10 + 1); - if (result == 0) { - break; - } - } - if (result < 0) { - err("%s - failed doing control urb, error %d", __FUNCTION__, result); - goto cleanup; + pkt->len = 0; + pkt->written = 0; + INIT_LIST_HEAD(&pkt->list); + list_add(&pkt->list, &priv->freelist); + priv->free_len += PACKET_SIZE; + } + + /* + * Force low latency on. This will immediately push data to the line + * discipline instead of queueing. + */ + + port->tty->low_latency = 1; + port->tty->raw = 1; + port->tty->real_raw = 1; + + /* + * Lose the small buffers usbserial provides. Make larger ones. + */ + + kfree(port->bulk_in_buffer); + kfree(port->bulk_out_buffer); + port->bulk_in_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL); + if (port->bulk_in_buffer == NULL) { + goto enomem; + } + port->bulk_out_buffer = kmalloc(URBDATA_SIZE, GFP_KERNEL); + if (port->bulk_out_buffer == NULL) { + kfree(port->bulk_in_buffer); + goto enomem; + } + port->read_urb->transfer_buffer = port->bulk_in_buffer; + port->write_urb->transfer_buffer = port->bulk_out_buffer; + port->read_urb->transfer_buffer_length = URBDATA_SIZE; + port->bulk_out_size = port->write_urb->transfer_buffer_length = URBDATA_SIZE; + + /* Start reading from the device */ + FILL_BULK_URB(port->read_urb, serial->dev, + usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), + port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, + ipaq_read_bulk_callback, port); + result = usb_submit_urb(port->read_urb); + if (result) { + err("%s - failed submitting read urb, error %d", __FUNCTION__, result); + goto error; + } + + /* + * Send out control message observed in win98 sniffs. Not sure what + * it does, but from empirical observations, it seems that the device + * will start the chat sequence once one of these messages gets + * through. Since this has a reasonably high failure rate, we retry + * several times. + */ + + while (retries--) { + result = usb_control_msg(serial->dev, + usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21, + 0x1, 0, NULL, 0, HZ / 10 + 1); + if (result == 0) { + return 0; } } + err("%s - failed doing control urb, error %d", __FUNCTION__, result); + goto error; - up(&port->sem); - return 0; - enomem: - err("%s - Out of memory", __FUNCTION__); result = -ENOMEM; -cleanup: + err("%s - Out of memory", __FUNCTION__); +error: ipaq_destroy_lists(port); kfree(priv); -error: - port->private = NULL; - port->open_count = 0; - port->active = 0; - up(&port->sem); - MOD_DEC_USE_COUNT; return result; } @@ -270,32 +245,19 @@ serial = get_usb_serial(port, __FUNCTION__); if (!serial) return; - - down (&port->sem); - - --port->open_count; - if (port->open_count <= 0) { + /* + * shut down bulk read and write + */ - /* - * shut down bulk read and write - */ - - usb_unlink_urb(port->write_urb); - usb_unlink_urb(port->read_urb); - ipaq_destroy_lists(port); - kfree(priv); - port->private = NULL; - port->active = 0; - port->open_count = 0; - - } - up (&port->sem); + usb_unlink_urb(port->write_urb); + usb_unlink_urb(port->read_urb); + ipaq_destroy_lists(port); + kfree(priv); + port->private = NULL; /* Uncomment the following line if you want to see some statistics in your syslog */ /* info ("Bytes In = %d Bytes Out = %d", bytes_in, bytes_out); */ - - MOD_DEC_USE_COUNT; } static void ipaq_read_bulk_callback(struct urb *urb) @@ -399,7 +361,8 @@ } if (from_user) { - copy_from_user(pkt->data, buf, count); + if (copy_from_user(pkt->data, buf, count)) + return -EFAULT; } else { memcpy(pkt->data, buf, count); } @@ -548,16 +511,7 @@ static void ipaq_shutdown(struct usb_serial *serial) { - int i; - dbg("%s", __FUNCTION__); - - /* stop reads and writes on all ports */ - for (i=0; i < serial->num_ports; ++i) { - while (serial->port[i].open_count > 0) { - ipaq_close(&serial->port[i], NULL); - } - } } static int __init ipaq_init(void) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/ir-usb.c linux.20pre5-ac2/drivers/usb/serial/ir-usb.c --- linux.20pre5/drivers/usb/serial/ir-usb.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/ir-usb.c 2002-09-01 13:38:46.000000000 +0100 @@ -1,8 +1,8 @@ /* * USB IR Dongle driver * - * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com) - * Copyright (C) 2002 Gary Brubaker (xavyer@ix.netcom.com) + * Copyright (C) 2001-2002 Greg Kroah-Hartman (greg@kroah.com) + * Copyright (C) 2002 Gary Brubaker (xavyer@ix.netcom.com) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,6 +21,11 @@ * * See Documentation/usb/usb-serial.txt for more information on using this driver * + * 2002_Mar_07 greg kh + * moved some needed structures and #define values from the + * net/irda/irda-usb.h file into our file, as we don't want to depend on + * that codebase compiling correctly :) + * * 2002_Jan_14 gb * Added module parameter to force specific number of XBOFs. * Added ir_xbof_change(). @@ -43,20 +48,16 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include +#include #include -#include #ifdef CONFIG_USB_SERIAL_DEBUG static int debug = 1; @@ -73,6 +74,33 @@ #define DRIVER_AUTHOR "Greg Kroah-Hartman " #define DRIVER_DESC "USB IR Dongle driver" +/* USB IrDA class spec information */ +#define USB_CLASS_IRDA 0x02 +#define USB_DT_IRDA 0x21 +#define IU_REQ_GET_CLASS_DESC 0x06 +#define SPEED_2400 0x01 +#define SPEED_9600 0x02 +#define SPEED_19200 0x03 +#define SPEED_38400 0x04 +#define SPEED_57600 0x05 +#define SPEED_115200 0x06 +#define SPEED_576000 0x07 +#define SPEED_1152000 0x08 +#define SPEED_4000000 0x09 + +struct irda_class_desc { + u8 bLength; + u8 bDescriptorType; + u16 bcdSpecRevision; + u8 bmDataSize; + u8 bmWindowSize; + u8 bmMinTurnaroundTime; + u16 wBaudRate; + u8 bmAdditionalBOFs; + u8 bIrdaRateSniff; + u8 bMaxUnicastList; +} __attribute__ ((packed)); + /* if overridden by the user, then use their value for the size of the read and * write urbs */ static int buffer_size = 0; @@ -103,22 +131,20 @@ struct usb_serial_device_type ir_device = { - name: "IR Dongle", - id_table: id_table, - needs_interrupt_in: MUST_HAVE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - set_termios: ir_set_termios, - startup: ir_startup, - open: ir_open, - close: ir_close, - write: ir_write, - write_bulk_callback: ir_write_bulk_callback, - read_bulk_callback: ir_read_bulk_callback, + .owner = THIS_MODULE, + .name = "IR Dongle", + .id_table = id_table, + .num_interrupt_in = 1, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 1, + .set_termios = ir_set_termios, + .startup = ir_startup, + .open = ir_open, + .close = ir_close, + .write = ir_write, + .write_bulk_callback = ir_write_bulk_callback, + .read_bulk_callback = ir_read_bulk_callback, }; static inline void irda_usb_dump_class_desc(struct irda_class_desc *desc) @@ -160,7 +186,7 @@ ret = usb_control_msg(dev, usb_rcvctrlpipe(dev,0), IU_REQ_GET_CLASS_DESC, USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE, - 0, ifnum, desc, sizeof(*desc), MSECS_TO_JIFFIES(500)); + 0, ifnum, desc, sizeof(*desc), HZ); dbg("%s - ret=%d", __FUNCTION__, ret); if (ret < sizeof(*desc)) { @@ -254,53 +280,42 @@ dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); - - ++port->open_count; - MOD_INC_USE_COUNT; - - if (!port->active) { - port->active = 1; - - if (buffer_size) { - /* override the default buffer sizes */ - buffer = kmalloc (buffer_size, GFP_KERNEL); - if (!buffer) { - err ("%s - out of memory.", __FUNCTION__); - return -ENOMEM; - } - kfree (port->read_urb->transfer_buffer); - port->read_urb->transfer_buffer = buffer; - port->read_urb->transfer_buffer_length = buffer_size; - - buffer = kmalloc (buffer_size, GFP_KERNEL); - if (!buffer) { - err ("%s - out of memory.", __FUNCTION__); - return -ENOMEM; - } - kfree (port->write_urb->transfer_buffer); - port->write_urb->transfer_buffer = buffer; - port->write_urb->transfer_buffer_length = buffer_size; - port->bulk_out_size = buffer_size; + if (buffer_size) { + /* override the default buffer sizes */ + buffer = kmalloc (buffer_size, GFP_KERNEL); + if (!buffer) { + err ("%s - out of memory.", __FUNCTION__); + return -ENOMEM; } - - /* Start reading from the device */ - usb_fill_bulk_urb ( - port->read_urb, - serial->dev, - usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), - port->read_urb->transfer_buffer, - port->read_urb->transfer_buffer_length, - ir_read_bulk_callback, - port); - port->read_urb->transfer_flags = USB_QUEUE_BULK; - result = usb_submit_urb(port->read_urb); - if (result) - err("%s - failed submitting read urb, error %d", __FUNCTION__, result); + kfree (port->read_urb->transfer_buffer); + port->read_urb->transfer_buffer = buffer; + port->read_urb->transfer_buffer_length = buffer_size; + + buffer = kmalloc (buffer_size, GFP_KERNEL); + if (!buffer) { + err ("%s - out of memory.", __FUNCTION__); + return -ENOMEM; + } + kfree (port->write_urb->transfer_buffer); + port->write_urb->transfer_buffer = buffer; + port->write_urb->transfer_buffer_length = buffer_size; + port->bulk_out_size = buffer_size; } - - up (&port->sem); - + + /* Start reading from the device */ + usb_fill_bulk_urb ( + port->read_urb, + serial->dev, + usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), + port->read_urb->transfer_buffer, + port->read_urb->transfer_buffer_length, + ir_read_bulk_callback, + port); + port->read_urb->transfer_flags = USB_QUEUE_BULK; + result = usb_submit_urb(port->read_urb); + if (result) + err("%s - failed submitting read urb, error %d", __FUNCTION__, result); + return result; } @@ -317,21 +332,10 @@ if (!serial) return; - down (&port->sem); - - --port->open_count; - - if (port->open_count <= 0) { - if (serial->dev) { - /* shutdown our bulk read */ - usb_unlink_urb (port->read_urb); - } - port->active = 0; - port->open_count = 0; - + if (serial->dev) { + /* shutdown our bulk read */ + usb_unlink_urb (port->read_urb); } - up (&port->sem); - MOD_DEC_USE_COUNT; } static int ir_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count) @@ -442,7 +446,7 @@ return; } - if (!port->active) { + if (!port->open_count) { dbg("%s - port closed.", __FUNCTION__); return; } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan.c linux.20pre5-ac2/drivers/usb/serial/keyspan.c --- linux.20pre5/drivers/usb/serial/keyspan.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan.c 2002-09-01 13:39:31.000000000 +0100 @@ -1,8 +1,8 @@ /* Keyspan USB to Serial Converter driver - (C) Copyright (C) 2000-2001 - Hugh Blemings + (C) Copyright (C) 2000-2001 Hugh Blemings + (C) Copyright (C) 2002 Greg Kroah-Hartman This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -28,6 +28,17 @@ Change History + Wed Apr 25 12:00:00 PST 2002 (Keyspan) + Started with Hugh Blemings' code dated Jan 17, 2002. All adapters + now supported (including QI and QW). Modified port open, port + close, and send setup() logic to fix various data and endpoint + synchronization bugs and device LED status bugs. Changed keyspan_ + write_room() to accurately return transmit buffer availability. + Changed forwardingLength from 1 to 16 for all adapters. + + Fri Oct 12 16:45:00 EST 2001 + Preliminary USA-19QI and USA-28 support (both test OK for me, YMMV) + Mon Oct 8 14:29:00 EST 2001 hugh Fixed bug that prevented mulitport devices operating correctly if they weren't the first unit attached. @@ -65,19 +76,15 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include -#include +#include #ifdef CONFIG_USB_SERIAL_DEBUG static int debug = 1; @@ -95,7 +102,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v1.1.1" +#define DRIVER_VERSION "v1.1.3" #define DRIVER_AUTHOR "Hugh Blemings number); + dbg("%s - port %d", __FUNCTION__, port->number); } static void keyspan_rx_unthrottle (struct usb_serial_port *port) { - dbg("keyspan_rx_unthrottle port %d\n", port->number); + dbg("%s - port %d", __FUNCTION__, port->number); } @@ -241,7 +215,7 @@ { struct keyspan_port_private *p_priv; - dbg("keyspan_break_ctl\n"); + dbg("%s", __FUNCTION__); p_priv = (struct keyspan_port_private *)port->private; @@ -257,16 +231,17 @@ static void keyspan_set_termios (struct usb_serial_port *port, struct termios *old_termios) { - int baud_rate; + int baud_rate, device_port; struct keyspan_port_private *p_priv; - const keyspan_device_details *d_details; + const struct keyspan_device_details *d_details; unsigned int cflag; - dbg("%s.\n", __FUNCTION__); + dbg("%s", __FUNCTION__); p_priv = (struct keyspan_port_private *)(port->private); d_details = p_priv->device_details; cflag = port->tty->termios->c_cflag; + device_port = port->number - port->serial->minor; /* Baud rate calculation takes baud rate as an integer so other rates can be generated if desired. */ @@ -274,7 +249,7 @@ /* If no match or invalid, don't change */ if (baud_rate >= 0 && d_details->calculate_baud_rate(baud_rate, d_details->baudclk, - NULL, NULL, NULL) == KEYSPAN_BAUD_RATE_OK) { + NULL, NULL, NULL, device_port) == KEYSPAN_BAUD_RATE_OK) { /* FIXME - more to do here to ensure rate changes cleanly */ p_priv->baud = baud_rate; } @@ -337,7 +312,7 @@ const unsigned char *buf, int count) { struct keyspan_port_private *p_priv; - const keyspan_device_details *d_details; + const struct keyspan_device_details *d_details; int flip; int left, todo; struct urb *this_urb; @@ -346,10 +321,8 @@ p_priv = (struct keyspan_port_private *)(port->private); d_details = p_priv->device_details; -#if 0 - dbg("%s for port %d (%d chars [%x]), flip=%d\n", __FUNCTION__, - port->number, count, buf[0], p_priv->out_flip); -#endif + dbg("%s - for port %d (%d chars [%x]), flip=%d", + __FUNCTION__, port->number, count, buf[0], p_priv->out_flip); for (left = count; left > 0; left -= todo) { todo = left; @@ -361,11 +334,11 @@ /* Check we have a valid urb/endpoint before we use it... */ if ((this_urb = p_priv->out_urbs[flip]) == 0) { /* no bulk out, so return 0 bytes written */ - dbg("%s no output urb :(\n", __FUNCTION__); + dbg("%s - no output urb :(", __FUNCTION__); return count; } - dbg("%s endpoint %d\n", __FUNCTION__, usb_pipeendpoint(this_urb->pipe)); + dbg("%s - endpoint %d flip %d", __FUNCTION__, usb_pipeendpoint(this_urb->pipe), flip); if (this_urb->status == -EINPROGRESS) { if (this_urb->transfer_flags & USB_ASYNC_UNLINK) @@ -395,7 +368,7 @@ this_urb->transfer_flags &= ~USB_ASYNC_UNLINK; this_urb->dev = port->serial->dev; if ((err = usb_submit_urb(this_urb)) != 0) { - dbg("usb_submit_urb(write bulk) failed (%d)\n", err); + dbg("usb_submit_urb(write bulk) failed (%d)", err); } p_priv->tx_start_time[flip] = jiffies; @@ -415,26 +388,28 @@ struct tty_struct *tty; unsigned char *data = urb->transfer_buffer; - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); endpoint = usb_pipeendpoint(urb->pipe); if (urb->status) { - dbg("%s nonzero status: %x on endpoint %d.\n", __FUNCTION__, - urb->status, endpoint); + dbg("%s - nonzero status: %x on endpoint %d.", + __FUNCTION__, urb->status, endpoint); return; } port = (struct usb_serial_port *) urb->context; tty = port->tty; if (urb->actual_length) { - if (data[0] == 0) { + /* 0x80 bit is error flag */ + if ((data[0] & 0x80) == 0) { /* no error on any byte */ for (i = 1; i < urb->actual_length ; ++i) { tty_insert_flip_char(tty, data[i], 0); } } else { /* some bytes had errors, every byte has status */ + dbg("%s - RX error!!!!", __FUNCTION__); for (i = 0; i + 1 < urb->actual_length; i += 2) { int stat = data[i], flag = 0; if (stat & RXERROR_OVERRUN) @@ -452,9 +427,10 @@ /* Resubmit urb so we continue receiving */ urb->dev = port->serial->dev; - if ((err = usb_submit_urb(urb)) != 0) { - dbg("%s resubmit read urb failed. (%d)\n", __FUNCTION__, err); - } + if (port->open_count) + if ((err = usb_submit_urb(urb)) != 0) { + dbg("%s - resubmit read urb failed. (%d)", __FUNCTION__, err); + } return; } @@ -466,9 +442,9 @@ port = (struct usb_serial_port *) urb->context; p_priv = (struct keyspan_port_private *)(port->private); - dbg("%s urb %d\n", __FUNCTION__, urb == p_priv->out_urbs[1]); + dbg ("%s - urb %d", __FUNCTION__, urb == p_priv->out_urbs[1]); - if (port->active) { + if (port->open_count) { queue_task(&port->tqueue, &tq_immediate); mark_bh(IMMEDIATE_BH); } @@ -476,7 +452,7 @@ static void usa26_inack_callback(struct urb *urb) { - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); } @@ -489,15 +465,15 @@ p_priv = (struct keyspan_port_private *)(port->private); if (p_priv->resend_cont) { - dbg("%s sending setup\n", __FUNCTION__); - keyspan_usa26_send_setup(port->serial, port, 0); + dbg ("%s - sending setup", __FUNCTION__); + keyspan_usa26_send_setup(port->serial, port, p_priv->resend_cont - 1); } } static void usa26_instat_callback(struct urb *urb) { unsigned char *data = urb->transfer_buffer; - keyspan_usa26_portStatusMessage *msg; + struct keyspan_usa26_portStatusMessage *msg; struct usb_serial *serial; struct usb_serial_port *port; struct keyspan_port_private *p_priv; @@ -506,19 +482,19 @@ serial = (struct usb_serial *) urb->context; if (urb->status) { - dbg("%s nonzero status: %x\n", __FUNCTION__, urb->status); + dbg("%s - nonzero status: %x", __FUNCTION__, urb->status); return; } if (urb->actual_length != 9) { - dbg("%s %d byte report??\n", __FUNCTION__, urb->actual_length); + dbg("%s - %d byte report??", __FUNCTION__, urb->actual_length); goto exit; } - msg = (keyspan_usa26_portStatusMessage *)data; + msg = (struct keyspan_usa26_portStatusMessage *)data; #if 0 - dbg("%s port status: port %d cts %d dcd %d dsr %d ri %d toff %d txoff %d rxen %d cr %d\n", __FUNCTION__, - msg->port, msg->hskia_cts, msg->gpia_dcd, msg->dsr, msg->ri, msg->_txOff, + dbg("%s - port status: port %d cts %d dcd %d dsr %d ri %d toff %d txoff %d rxen %d cr %d", + __FUNCTION__, msg->port, msg->hskia_cts, msg->gpia_dcd, msg->dsr, msg->ri, msg->_txOff, msg->_txXoff, msg->rxEnabled, msg->controlResponse); #endif @@ -527,7 +503,7 @@ /* Check port number from message and retrieve private data */ if (msg->port >= serial->num_ports) { - dbg ("Unexpected port number %d\n", msg->port); + dbg ("%s - Unexpected port number %d", __FUNCTION__, msg->port); goto exit; } port = &serial->port[msg->port]; @@ -548,17 +524,17 @@ /* wake_up_interruptible(&p_priv->open_wait); */ } -exit: /* Resubmit urb so we continue receiving */ urb->dev = serial->dev; if ((err = usb_submit_urb(urb)) != 0) { - dbg("%s resubmit read urb failed. (%d)\n", __FUNCTION__, err); + dbg("%s - resubmit read urb failed. (%d)", __FUNCTION__, err); } +exit: } static void usa26_glocont_callback(struct urb *urb) { - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); } @@ -571,7 +547,7 @@ unsigned char *data; struct keyspan_port_private *p_priv; - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); port = (struct usb_serial_port *) urb->context; p_priv = (struct keyspan_port_private *)(port->private); @@ -582,9 +558,8 @@ do { if (urb->status) { - dbg("%s nonzero status: %x on endpoint %d.\n", - __FUNCTION__ , urb->status, - usb_pipeendpoint(urb->pipe)); + dbg("%s - nonzero status: %x on endpoint %d.", + __FUNCTION__, urb->status, usb_pipeendpoint(urb->pipe)); return; } @@ -602,10 +577,10 @@ /* Resubmit urb so we continue receiving */ urb->dev = port->serial->dev; - if ((err = usb_submit_urb(urb)) != 0) { - dbg("%s resubmit read urb failed. (%d)\n", __FUNCTION__, -err); - } + if (port->open_count) + if ((err = usb_submit_urb(urb)) != 0) { + dbg("%s - resubmit read urb failed. (%d)", __FUNCTION__, err); + } p_priv->in_flip ^= 1; urb = p_priv->in_urbs[p_priv->in_flip]; @@ -614,7 +589,7 @@ static void usa28_inack_callback(struct urb *urb) { - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); } static void usa28_outcont_callback(struct urb *urb) @@ -626,8 +601,8 @@ p_priv = (struct keyspan_port_private *)(port->private); if (p_priv->resend_cont) { - dbg("%s sending setup\n", __FUNCTION__); - keyspan_usa28_send_setup(port->serial, port, 0); + dbg ("%s - sending setup", __FUNCTION__); + keyspan_usa28_send_setup(port->serial, port, p_priv->resend_cont - 1); } } @@ -635,7 +610,7 @@ { int err; unsigned char *data = urb->transfer_buffer; - keyspan_usa28_portStatusMessage *msg; + struct keyspan_usa28_portStatusMessage *msg; struct usb_serial *serial; struct usb_serial_port *port; struct keyspan_port_private *p_priv; @@ -644,26 +619,26 @@ serial = (struct usb_serial *) urb->context; if (urb->status) { - dbg("%s nonzero status: %x\n", __FUNCTION__, urb->status); + dbg("%s - nonzero status: %x", __FUNCTION__, urb->status); return; } if (urb->actual_length != sizeof(struct keyspan_usa28_portStatusMessage)) { - dbg("%s bad length %d\n", __FUNCTION__, urb->actual_length); + dbg("%s - bad length %d", __FUNCTION__, urb->actual_length); goto exit; } - /*dbg("%s %x %x %x %x %x %x %x %x %x %x %x %x\n", __FUNCTION__, + /*dbg("%s %x %x %x %x %x %x %x %x %x %x %x %x", __FUNCTION__ data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9], data[10], data[11]);*/ /* Now do something useful with the data */ - msg = (keyspan_usa28_portStatusMessage *)data; + msg = (struct keyspan_usa28_portStatusMessage *)data; /* Check port number from message and retrieve private data */ if (msg->port >= serial->num_ports) { - dbg ("Unexpected port number %d\n", msg->port); + dbg ("%s - Unexpected port number %d", __FUNCTION__, msg->port); goto exit; } port = &serial->port[msg->port]; @@ -684,17 +659,17 @@ /* wake_up_interruptible(&p_priv->open_wait); */ } -exit: /* Resubmit urb so we continue receiving */ urb->dev = serial->dev; if ((err = usb_submit_urb(urb)) != 0) { - dbg("%s resubmit read urb failed. (%d)\n", __FUNCTION__, err); + dbg("%s - resubmit read urb failed. (%d)", __FUNCTION__, err); } +exit: } static void usa28_glocont_callback(struct urb *urb) { - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); } @@ -705,7 +680,7 @@ struct keyspan_port_private *p_priv; int i; - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); serial = (struct usb_serial *) urb->context; for (i = 0; i < serial->num_ports; ++i) { @@ -713,8 +688,8 @@ p_priv = (struct keyspan_port_private *)(port->private); if (p_priv->resend_cont) { - dbg("%s sending setup\n", __FUNCTION__); - keyspan_usa49_send_setup(serial, port, 0); + dbg ("%s - sending setup", __FUNCTION__); + keyspan_usa49_send_setup(serial, port, p_priv->resend_cont - 1); break; } } @@ -726,36 +701,36 @@ { int err; unsigned char *data = urb->transfer_buffer; - keyspan_usa49_portStatusMessage *msg; + struct keyspan_usa49_portStatusMessage *msg; struct usb_serial *serial; struct usb_serial_port *port; struct keyspan_port_private *p_priv; int old_dcd_state; - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); serial = (struct usb_serial *) urb->context; if (urb->status) { - dbg("%s nonzero status: %x\n", __FUNCTION__, urb->status); + dbg("%s - nonzero status: %x", __FUNCTION__, urb->status); return; } if (urb->actual_length != sizeof(struct keyspan_usa49_portStatusMessage)) { - dbg("%s bad length %d\n", __FUNCTION__, urb->actual_length); + dbg("%s - bad length %d", __FUNCTION__, urb->actual_length); goto exit; } - /*dbg("%s %x %x %x %x %x %x %x %x %x %x %x\n", __FUNCTION__, + /*dbg(" %x %x %x %x %x %x %x %x %x %x %x", __FUNCTION__, data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], data[9], data[10]);*/ /* Now do something useful with the data */ - msg = (keyspan_usa49_portStatusMessage *)data; + msg = (struct keyspan_usa49_portStatusMessage *)data; /* Check port number from message and retrieve private data */ if (msg->portNumber >= serial->num_ports) { - dbg ("Unexpected port number %d\n", msg->portNumber); + dbg ("%s - Unexpected port number %d", __FUNCTION__, msg->portNumber); goto exit; } port = &serial->port[msg->portNumber]; @@ -776,18 +751,18 @@ /* wake_up_interruptible(&p_priv->open_wait); */ } -exit: /* Resubmit urb so we continue receiving */ urb->dev = serial->dev; if ((err = usb_submit_urb(urb)) != 0) { - dbg("%s resubmit read urb failed. (%d)\n", __FUNCTION__, err); + dbg("%s - resubmit read urb failed. (%d)", __FUNCTION__, err); } +exit: } static void usa49_inack_callback(struct urb *urb) { - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); } static void usa49_indat_callback(struct urb *urb) @@ -798,20 +773,21 @@ struct tty_struct *tty; unsigned char *data = urb->transfer_buffer; - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); endpoint = usb_pipeendpoint(urb->pipe); if (urb->status) { - dbg("%s nonzero status: %x on endpoint %d.\n", __FUNCTION__, - urb->status, endpoint); + dbg("%s - nonzero status: %x on endpoint %d.", __FUNCTION__, + urb->status, endpoint); return; } port = (struct usb_serial_port *) urb->context; tty = port->tty; if (urb->actual_length) { - if (data[0] == 0) { + /* 0x80 bit is error flag */ + if ((data[0] & 0x80) == 0) { /* no error on any byte */ for (i = 1; i < urb->actual_length ; ++i) { tty_insert_flip_char(tty, data[i], 0); @@ -835,24 +811,43 @@ /* Resubmit urb so we continue receiving */ urb->dev = port->serial->dev; - if ((err = usb_submit_urb(urb)) != 0) { - dbg("%s resubmit read urb failed. (%d)\n", __FUNCTION__, err); - } + if (port->open_count) + if ((err = usb_submit_urb(urb)) != 0) { + dbg("%s - resubmit read urb failed. (%d)", __FUNCTION__, err); + } } /* not used, usa-49 doesn't have per-port control endpoints */ static void usa49_outcont_callback(struct urb *urb) { - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); } static int keyspan_write_room (struct usb_serial_port *port) { - dbg("keyspan_write_room called\n"); - return (32); + struct keyspan_port_private *p_priv; + const struct keyspan_device_details *d_details; + int flip; + struct urb *this_urb; + dbg("%s", __FUNCTION__); + p_priv = (struct keyspan_port_private *)(port->private); + d_details = p_priv->device_details; + + flip = p_priv->out_flip; + + /* Check both endpoints to see if any are available. */ + if ((this_urb = p_priv->out_urbs[flip]) != 0) { + if (this_urb->status != -EINPROGRESS) + return (63); + flip = (flip + 1) & d_details->outdat_endp_flip; + if ((this_urb = p_priv->out_urbs[flip]) != 0) + if (this_urb->status != -EINPROGRESS) + return (63); + } + return (0); } @@ -867,26 +862,15 @@ struct keyspan_port_private *p_priv; struct keyspan_serial_private *s_priv; struct usb_serial *serial = port->serial; - const keyspan_device_details *d_details; - int i, already_active, err; + const struct keyspan_device_details *d_details; + int i, err; struct urb *urb; s_priv = (struct keyspan_serial_private *)(serial->private); p_priv = (struct keyspan_port_private *)(port->private); d_details = s_priv->device_details; - dbg("keyspan_open called for port%d.\n", port->number); - - MOD_INC_USE_COUNT; - - down (&port->sem); - ++port->open_count; - already_active = port->active; - port->active = 1; - up (&port->sem); - - if (already_active) - return 0; + dbg("%s - port%d.", __FUNCTION__, port->number); p_priv = (struct keyspan_port_private *)(port->private); @@ -894,16 +878,31 @@ p_priv->rts_state = 1; p_priv->dtr_state = 1; - /* Start reading from endpoints */ + p_priv->out_flip = 0; + p_priv->in_flip = 0; + + /* Reset low level data toggle and start reading from endpoints */ for (i = 0; i < 2; i++) { if ((urb = p_priv->in_urbs[i]) == NULL) continue; urb->dev = serial->dev; + usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe), 0); + if ((err = usb_submit_urb(urb)) != 0) { - dbg("%s submit urb %d failed (%d)\n", __FUNCTION__, i, err); + dbg("%s - submit urb %d failed (%d)", __FUNCTION__, i, err); } } + /* Reset low level data toggle on out endpoints */ + for (i = 0; i < 2; i++) { + if ((urb = p_priv->out_urbs[i]) == NULL) + continue; + urb->dev = serial->dev; + /* usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), usb_pipeout(urb->pipe), 0); */ + } + + keyspan_send_setup(port, 1); + //mdelay(100); keyspan_set_termios(port, NULL); return (0); @@ -928,44 +927,37 @@ if (!serial) return; - dbg("keyspan_close called\n"); + dbg("%s", __FUNCTION__); s_priv = (struct keyspan_serial_private *)(serial->private); p_priv = (struct keyspan_port_private *)(port->private); p_priv->rts_state = 0; p_priv->dtr_state = 0; - if (serial->dev) - keyspan_send_setup(port, 1); + if (serial->dev) { + keyspan_send_setup(port, 2); + /* pilot-xfer seems to work best with this delay */ + mdelay(100); + keyspan_set_termios(port, NULL); + } /*while (p_priv->outcont_urb->status == -EINPROGRESS) { - dbg("close - urb in progress\n"); + dbg("%s - urb in progress", __FUNCTION__); }*/ p_priv->out_flip = 0; p_priv->in_flip = 0; - down (&port->sem); - - if (--port->open_count <= 0) { - if (port->active) { - if (serial->dev) { - /* Stop reading/writing urbs */ - stop_urb(p_priv->inack_urb); - stop_urb(p_priv->outcont_urb); - for (i = 0; i < 2; i++) { - stop_urb(p_priv->in_urbs[i]); - stop_urb(p_priv->out_urbs[i]); - } - } + if (serial->dev) { + /* Stop reading/writing urbs */ + stop_urb(p_priv->inack_urb); + /* stop_urb(p_priv->outcont_urb); */ + for (i = 0; i < 2; i++) { + stop_urb(p_priv->in_urbs[i]); + stop_urb(p_priv->out_urbs[i]); } - port->active = 0; - port->open_count = 0; - port->tty = 0; } - up (&port->sem); - - MOD_DEC_USE_COUNT; + port->tty = 0; } @@ -976,12 +968,12 @@ const struct ezusb_hex_record *record; char *fw_name; - dbg("Keyspan startup version %04x product %04x\n", + dbg("Keyspan startup version %04x product %04x", serial->dev->descriptor.bcdDevice, serial->dev->descriptor.idProduct); if ((serial->dev->descriptor.bcdDevice & 0x8000) != 0x8000) { - dbg("Firmware already loaded. Quitting.\n"); + dbg("Firmware already loaded. Quitting."); return(1); } @@ -1012,6 +1004,16 @@ fw_name = "USA19"; break; + case keyspan_usa19qi_pre_product_id: + record = &keyspan_usa19qi_firmware[0]; + fw_name = "USA19QI"; + break; + + case keyspan_usa19qw_pre_product_id: + record = &keyspan_usa19qw_firmware[0]; + fw_name = "USA19QI"; + break; + case keyspan_usa18x_pre_product_id: record = &keyspan_usa18x_firmware[0]; fw_name = "USA18X"; @@ -1038,7 +1040,7 @@ return(1); } - dbg("Uploading Keyspan %s firmware.\n", fw_name); + dbg("Uploading Keyspan %s firmware.", fw_name); /* download the firmware image */ response = ezusb_set_reset(serial, 1); @@ -1065,19 +1067,19 @@ } /* Helper functions used by keyspan_setup_urbs */ -static struct urb *keyspan_setup_urb(struct usb_serial *serial, int endpoint, - int dir, void *ctx, char *buf, int len, - void (*callback)(struct urb *)) +static struct urb *keyspan_setup_urb (struct usb_serial *serial, int endpoint, + int dir, void *ctx, char *buf, int len, + void (*callback)(struct urb *)) { struct urb *urb; if (endpoint == -1) return NULL; /* endpoint not needed */ - dbg("%s alloc for endpoint %d.\n", __FUNCTION__, endpoint); + dbg ("%s - alloc for endpoint %d.", __FUNCTION__, endpoint); urb = usb_alloc_urb(0); /* No ISO */ if (urb == NULL) { - dbg("%s alloc for endpoint %d failed.\n", __FUNCTION__, endpoint); + dbg ("%s - alloc for endpoint %d failed.", __FUNCTION__, endpoint); return NULL; } @@ -1099,28 +1101,28 @@ } keyspan_callbacks[] = { { /* msg_usa26 callbacks */ - instat_callback: usa26_instat_callback, - glocont_callback: usa26_glocont_callback, - indat_callback: usa26_indat_callback, - outdat_callback: usa2x_outdat_callback, - inack_callback: usa26_inack_callback, - outcont_callback: usa26_outcont_callback, + .instat_callback = usa26_instat_callback, + .glocont_callback = usa26_glocont_callback, + .indat_callback = usa26_indat_callback, + .outdat_callback = usa2x_outdat_callback, + .inack_callback = usa26_inack_callback, + .outcont_callback = usa26_outcont_callback, }, { /* msg_usa28 callbacks */ - instat_callback: usa28_instat_callback, - glocont_callback: usa28_glocont_callback, - indat_callback: usa28_indat_callback, - outdat_callback: usa2x_outdat_callback, - inack_callback: usa28_inack_callback, - outcont_callback: usa28_outcont_callback, + .instat_callback = usa28_instat_callback, + .glocont_callback = usa28_glocont_callback, + .indat_callback = usa28_indat_callback, + .outdat_callback = usa2x_outdat_callback, + .inack_callback = usa28_inack_callback, + .outcont_callback = usa28_outcont_callback, }, { /* msg_usa49 callbacks */ - instat_callback: usa49_instat_callback, - glocont_callback: usa49_glocont_callback, - indat_callback: usa49_indat_callback, - outdat_callback: usa2x_outdat_callback, - inack_callback: usa49_inack_callback, - outcont_callback: usa49_outcont_callback, + .instat_callback = usa49_instat_callback, + .glocont_callback = usa49_glocont_callback, + .indat_callback = usa49_indat_callback, + .outdat_callback = usa2x_outdat_callback, + .inack_callback = usa49_inack_callback, + .outcont_callback = usa49_outcont_callback, } }; @@ -1130,13 +1132,13 @@ { int i, j; struct keyspan_serial_private *s_priv; - const keyspan_device_details *d_details; + const struct keyspan_device_details *d_details; struct usb_serial_port *port; struct keyspan_port_private *p_priv; struct callbacks *cback; int endp; - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); s_priv = (struct keyspan_serial_private *)(serial->private); d_details = s_priv->device_details; @@ -1198,13 +1200,14 @@ } /* usa19 function doesn't require prescaler */ -static int keyspan_usa19_calc_baud(u32 baud_rate, u32 baudclk, - u8 *rate_hi, u8 *rate_low, u8 *prescaler) +static int keyspan_usa19_calc_baud(u32 baud_rate, u32 baudclk, u8 *rate_hi, + u8 *rate_low, u8 *prescaler, int portnum) { u32 b16, /* baud rate times 16 (actual rate used internally) */ div, /* divisor */ cnt; /* inverse of divisor (programmed into 8051) */ + dbg ("%s - %d.", __FUNCTION__, baud_rate); /* prevent divide by zero... */ if( (b16 = (baud_rate * 16L)) == 0) { @@ -1237,14 +1240,14 @@ *rate_hi = (u8) ((cnt >> 8) & 0xff); } if (rate_low && rate_hi) { - dbg("%s %d %02x %02x.", __FUNCTION__, baud_rate, *rate_hi, *rate_low); + dbg ("%s - %d %02x %02x.", __FUNCTION__, baud_rate, *rate_hi, *rate_low); } return (KEYSPAN_BAUD_RATE_OK); } -static int keyspan_usa19w_calc_baud(u32 baud_rate, u32 baudclk, - u8 *rate_hi, u8 *rate_low, u8 *prescaler) +static int keyspan_usa19w_calc_baud(u32 baud_rate, u32 baudclk, u8 *rate_hi, + u8 *rate_low, u8 *prescaler, int portnum) { u32 b16, /* baud rate times 16 (actual rate used internally) */ clk, /* clock with 13/8 prescaler */ @@ -1255,7 +1258,7 @@ u8 best_prescaler; int i; - dbg("%s %d.\n", __FUNCTION__, baud_rate); + dbg ("%s - %d.", __FUNCTION__, baud_rate); /* prevent divide by zero */ if( (b16 = baud_rate * 16L) == 0) { @@ -1271,8 +1274,7 @@ /* 0 is an invalid prescaler, used as a flag */ best_prescaler = 0; - for(i = 8; i <= 0xff; ++i) - { + for(i = 8; i <= 0xff; ++i) { clk = (baudclk * 8) / (u32) i; if( (div = clk / b16) == 0) { @@ -1282,8 +1284,7 @@ res = clk / div; diff= (res > b16) ? (res-b16) : (b16-res); - if(diff < smallest_diff) - { + if(diff < smallest_diff) { best_prescaler = i; smallest_diff = diff; } @@ -1305,11 +1306,62 @@ } if (prescaler) { *prescaler = best_prescaler; - /* dbg("%s %d %d", __FUNCTION__, *prescaler, div); */ + /* dbg("%s - %d %d", __FUNCTION__, *prescaler, div); */ } return (KEYSPAN_BAUD_RATE_OK); } + /* USA-28 supports different maximum baud rates on each port */ +static int keyspan_usa28_calc_baud(u32 baud_rate, u32 baudclk, u8 *rate_hi, + u8 *rate_low, u8 *prescaler, int portnum) +{ + u32 b16, /* baud rate times 16 (actual rate used internally) */ + div, /* divisor */ + cnt; /* inverse of divisor (programmed into 8051) */ + + dbg ("%s - %d.", __FUNCTION__, baud_rate); + + /* prevent divide by zero */ + if ((b16 = baud_rate * 16L) == 0) + return (KEYSPAN_INVALID_BAUD_RATE); + + /* calculate the divisor and the counter (its inverse) */ + if ((div = (KEYSPAN_USA28_BAUDCLK / b16)) == 0) { + return (KEYSPAN_INVALID_BAUD_RATE); + } + else { + cnt = 0 - div; + } + + /* check for out of range, based on portnum, + and return result */ + if(portnum == 0) { + if(div > 0xffff) + return (KEYSPAN_INVALID_BAUD_RATE); + } + else { + if(portnum == 1) { + if(div > 0xff) { + return (KEYSPAN_INVALID_BAUD_RATE); + } + } + else { + return (KEYSPAN_INVALID_BAUD_RATE); + } + } + + /* return the counter values if not NULL + (port 1 will ignore retHi) */ + if (rate_low) { + *rate_low = (u8) (cnt & 0xff); + } + if (rate_hi) { + *rate_hi = (u8) ((cnt >> 8) & 0xff); + } + dbg ("%s - %d OK.", __FUNCTION__, baud_rate); + return (KEYSPAN_BAUD_RATE_OK); +} + static int keyspan_usa26_send_setup(struct usb_serial *serial, struct usb_serial_port *port, int reset_port) @@ -1317,31 +1369,35 @@ struct keyspan_usa26_portControlMessage msg; struct keyspan_serial_private *s_priv; struct keyspan_port_private *p_priv; - const keyspan_device_details *d_details; + const struct keyspan_device_details *d_details; int outcont_urb; struct urb *this_urb; - int err; + int device_port, err; - dbg ("%s reset=%d\n", __FUNCTION__, reset_port); + dbg ("%s reset=%d", __FUNCTION__, reset_port); s_priv = (struct keyspan_serial_private *)(serial->private); p_priv = (struct keyspan_port_private *)(port->private); d_details = s_priv->device_details; + device_port = port->number - port->serial->minor; outcont_urb = d_details->outcont_endpoints[port->number]; this_urb = p_priv->outcont_urb; - dbg("%s endpoint %d\n", __FUNCTION__, usb_pipeendpoint(this_urb->pipe)); + dbg("%s - endpoint %d", __FUNCTION__, usb_pipeendpoint(this_urb->pipe)); /* Make sure we have an urb then send the message */ if (this_urb == NULL) { - dbg("%s oops no urb.\n", __FUNCTION__); + dbg("%s - oops no urb.", __FUNCTION__); return -1; } - p_priv->resend_cont = 1; + /* Save reset port val for resend. + Don't overwrite resend for close condition. */ + if (p_priv->resend_cont != 3) + p_priv->resend_cont = reset_port + 1; if (this_urb->status == -EINPROGRESS) { - /* dbg("%s already writing", __FUNCTION__); */ + /* dbg ("%s - already writing", __FUNCTION__); */ return(-1); } @@ -1353,8 +1409,8 @@ msg.setClocking = 0xff; if (d_details->calculate_baud_rate (p_priv->baud, d_details->baudclk, &msg.baudHi, - &msg.baudLo, &msg.prescaler) == KEYSPAN_INVALID_BAUD_RATE ) { - dbg("%s Invalid baud rate %d requested, using 9600.\n", __FUNCTION__, + &msg.baudLo, &msg.prescaler, device_port) == KEYSPAN_INVALID_BAUD_RATE ) { + dbg("%s - Invalid baud rate %d requested, using 9600.", __FUNCTION__, p_priv->baud); msg.baudLo = 0; msg.baudHi = 125; /* Values for 9600 baud */ @@ -1388,12 +1444,26 @@ msg.ctsFlowControl = (p_priv->flow_control == flow_cts); msg.xonFlowControl = 0; msg.setFlowControl = 0xff; - - msg.forwardingLength = 1; + msg.forwardingLength = 16; msg.xonChar = 17; msg.xoffChar = 19; - if (reset_port) { + /* Opening port */ + if (reset_port == 1) { + msg._txOn = 1; + msg._txOff = 0; + msg.txFlush = 0; + msg.txBreak = 0; + msg.rxOn = 1; + msg.rxOff = 0; + msg.rxFlush = 1; + msg.rxForward = 0; + msg.returnStatus = 0; + msg.resetDataToggle = 0xff; + } + + /* Closing port */ + else if (reset_port == 2) { msg._txOn = 0; msg._txOff = 1; msg.txFlush = 0; @@ -1403,14 +1473,16 @@ msg.rxFlush = 1; msg.rxForward = 0; msg.returnStatus = 0; - msg.resetDataToggle = 0xff; + msg.resetDataToggle = 0; } + + /* Sending intermediate configs */ else { msg._txOn = (! p_priv->break_on); msg._txOff = 0; msg.txFlush = 0; msg.txBreak = (p_priv->break_on); - msg.rxOn = 1; + msg.rxOn = 0; msg.rxOff = 0; msg.rxFlush = 0; msg.rxForward = 0; @@ -1433,11 +1505,11 @@ this_urb->dev = serial->dev; if ((err = usb_submit_urb(this_urb)) != 0) { - dbg("%s usb_submit_urb(setup) failed (%d)\n", __FUNCTION__, err); + dbg("%s - usb_submit_urb(setup) failed (%d)", __FUNCTION__, err); } #if 0 else { - dbg("%s usb_submit_urb(%d) OK %d bytes (end %d)", __FUNCTION__, + dbg("%s - usb_submit_urb(%d) OK %d bytes (end %d)", __FUNCTION__ outcont_urb, this_urb->transfer_buffer_length, usb_pipeendpoint(this_urb->pipe)); } @@ -1453,32 +1525,38 @@ struct keyspan_usa28_portControlMessage msg; struct keyspan_serial_private *s_priv; struct keyspan_port_private *p_priv; - const keyspan_device_details *d_details; + const struct keyspan_device_details *d_details; struct urb *this_urb; - int err; + int device_port, err; + + dbg ("%s", __FUNCTION__); s_priv = (struct keyspan_serial_private *)(serial->private); p_priv = (struct keyspan_port_private *)(port->private); d_details = s_priv->device_details; + device_port = port->number - port->serial->minor; /* only do something if we have a bulk out endpoint */ if ((this_urb = p_priv->outcont_urb) == NULL) { - dbg("%s oops no urb.\n", __FUNCTION__); + dbg("%s - oops no urb.", __FUNCTION__); return -1; } - p_priv->resend_cont = 1; + /* Save reset port val for resend. + Don't overwrite resend for close condition. */ + if (p_priv->resend_cont != 3) + p_priv->resend_cont = reset_port + 1; if (this_urb->status == -EINPROGRESS) { - dbg("%s already writing\n", __FUNCTION__); + dbg ("%s already writing", __FUNCTION__); return(-1); } memset(&msg, 0, sizeof (struct keyspan_usa28_portControlMessage)); msg.setBaudRate = 1; - if (keyspan_usa19_calc_baud(p_priv->baud, d_details->baudclk, - &msg.baudHi, &msg.baudLo, NULL) == KEYSPAN_INVALID_BAUD_RATE ) { - dbg("%s Invalid baud rate requested %d.", __FUNCTION__, p_priv->baud); + if (d_details->calculate_baud_rate(p_priv->baud, d_details->baudclk, + &msg.baudHi, &msg.baudLo, NULL, device_port) == KEYSPAN_INVALID_BAUD_RATE ) { + dbg("%s - Invalid baud rate requested %d.", __FUNCTION__, p_priv->baud); msg.baudLo = 0xff; msg.baudHi = 0xb2; /* Values for 9600 baud */ } @@ -1493,23 +1571,56 @@ msg.rts = p_priv->rts_state; msg.dtr = p_priv->dtr_state; - msg.forwardingLength = 1; + msg.forwardingLength = 16; msg.forwardMs = 10; msg.breakThreshold = 45; msg.xonChar = 17; msg.xoffChar = 19; - msg._txOn = 1; - msg._txOff = 0; - msg.txFlush = 0; - msg.txForceXoff = 0; - msg.txBreak = 0; - msg.rxOn = 1; - msg.rxOff = 0; - msg.rxFlush = 0; - msg.rxForward = 0; /*msg.returnStatus = 1; msg.resetDataToggle = 0xff;*/ + /* Opening port */ + if (reset_port == 1) { + msg._txOn = 1; + msg._txOff = 0; + msg.txFlush = 0; + msg.txForceXoff = 0; + msg.txBreak = 0; + msg.rxOn = 1; + msg.rxOff = 0; + msg.rxFlush = 1; + msg.rxForward = 0; + msg.returnStatus = 0; + msg.resetDataToggle = 0xff; + } + /* Closing port */ + else if (reset_port == 2) { + msg._txOn = 0; + msg._txOff = 1; + msg.txFlush = 0; + msg.txForceXoff = 0; + msg.txBreak = 0; + msg.rxOn = 0; + msg.rxOff = 1; + msg.rxFlush = 1; + msg.rxForward = 0; + msg.returnStatus = 0; + msg.resetDataToggle = 0; + } + /* Sending intermediate configs */ + else { + msg._txOn = (! p_priv->break_on); + msg._txOff = 0; + msg.txFlush = 0; + msg.txForceXoff = 0; + msg.txBreak = (p_priv->break_on); + msg.rxOn = 0; + msg.rxOff = 0; + msg.rxFlush = 0; + msg.rxForward = 0; + msg.returnStatus = 0; + msg.resetDataToggle = 0x0; + } p_priv->resend_cont = 0; memcpy (this_urb->transfer_buffer, &msg, sizeof(msg)); @@ -1519,11 +1630,11 @@ this_urb->dev = serial->dev; if ((err = usb_submit_urb(this_urb)) != 0) { - dbg("%s usb_submit_urb(setup) failed\n", __FUNCTION__); + dbg("%s - usb_submit_urb(setup) failed", __FUNCTION__); } #if 0 else { - dbg("%s usb_submit_urb(setup) OK %d bytes", __FUNCTION__, + dbg("%s - usb_submit_urb(setup) OK %d bytes", __FUNCTION__, this_urb->transfer_buffer_length); } #endif @@ -1538,13 +1649,12 @@ struct keyspan_usa49_portControlMessage msg; struct keyspan_serial_private *s_priv; struct keyspan_port_private *p_priv; - const keyspan_device_details *d_details; + const struct keyspan_device_details *d_details; int glocont_urb; struct urb *this_urb; - int err; - int device_port; + int err, device_port; - dbg ("%s\n", __FUNCTION__); + dbg ("%s", __FUNCTION__); s_priv = (struct keyspan_serial_private *)(serial->private); p_priv = (struct keyspan_port_private *)(port->private); @@ -1556,17 +1666,20 @@ /* Work out which port within the device is being setup */ device_port = port->number - port->serial->minor; - dbg("%s endpoint %d port %d (%d)\n", __FUNCTION__, usb_pipeendpoint(this_urb->pipe), port->number, device_port); + dbg("%s - endpoint %d port %d (%d)",__FUNCTION__, usb_pipeendpoint(this_urb->pipe), port->number, device_port); /* Make sure we have an urb then send the message */ if (this_urb == NULL) { - dbg("%s oops no urb for port %d.\n", __FUNCTION__, port->number); + dbg("%s - oops no urb for port %d.", __FUNCTION__, port->number); return -1; } - p_priv->resend_cont = 1; + /* Save reset port val for resend. + Don't overwrite resend for close condition. */ + if (p_priv->resend_cont != 3) + p_priv->resend_cont = reset_port + 1; if (this_urb->status == -EINPROGRESS) { - /* dbg("%s already writing", __FUNCTION__); */ + /* dbg ("%s - already writing", __FUNCTION__); */ return(-1); } @@ -1581,8 +1694,8 @@ msg.setClocking = 0xff; if (d_details->calculate_baud_rate (p_priv->baud, d_details->baudclk, &msg.baudHi, - &msg.baudLo, &msg.prescaler) == KEYSPAN_INVALID_BAUD_RATE ) { - dbg("%s Invalid baud rate %d requested, using 9600.\n", __FUNCTION__, + &msg.baudLo, &msg.prescaler, device_port) == KEYSPAN_INVALID_BAUD_RATE ) { + dbg("%s - Invalid baud rate %d requested, using 9600.", __FUNCTION__, p_priv->baud); msg.baudLo = 0; msg.baudHi = 125; /* Values for 9600 baud */ @@ -1617,20 +1730,55 @@ msg.xonFlowControl = 0; msg.setFlowControl = 0xff; - msg.forwardingLength = 1; + msg.forwardingLength = 16; msg.xonChar = 17; msg.xoffChar = 19; - - msg._txOn = 1; - msg._txOff = 0; - msg.txFlush = 0; - msg.txBreak = 0; - msg.rxOn = 1; - msg.rxOff = 0; - msg.rxFlush = 0; - msg.rxForward = 0; - msg.enablePort = 0xff; - msg.disablePort = 0; + + /* Opening port */ + if (reset_port == 1) { + msg._txOn = 1; + msg._txOff = 0; + msg.txFlush = 0; + msg.txBreak = 0; + msg.rxOn = 1; + msg.rxOff = 0; + msg.rxFlush = 1; + msg.rxForward = 0; + msg.returnStatus = 0; + msg.resetDataToggle = 0xff; + msg.enablePort = 1; + msg.disablePort = 0; + } + /* Closing port */ + else if (reset_port == 2) { + msg._txOn = 0; + msg._txOff = 1; + msg.txFlush = 0; + msg.txBreak = 0; + msg.rxOn = 0; + msg.rxOff = 1; + msg.rxFlush = 1; + msg.rxForward = 0; + msg.returnStatus = 0; + msg.resetDataToggle = 0; + msg.enablePort = 0; + msg.disablePort = 1; + } + /* Sending intermediate configs */ + else { + msg._txOn = (! p_priv->break_on); + msg._txOff = 0; + msg.txFlush = 0; + msg.txBreak = (p_priv->break_on); + msg.rxOn = 0; + msg.rxOff = 0; + msg.rxFlush = 0; + msg.rxForward = 0; + msg.returnStatus = 0; + msg.resetDataToggle = 0x0; + msg.enablePort = 0; + msg.disablePort = 0; + } /* Do handshaking outputs */ msg.setRts = 0xff; @@ -1647,11 +1795,11 @@ this_urb->dev = serial->dev; if ((err = usb_submit_urb(this_urb)) != 0) { - dbg("%s usb_submit_urb(setup) failed (%d)\n", __FUNCTION__, err); + dbg("%s - usb_submit_urb(setup) failed (%d)", __FUNCTION__, err); } #if 0 else { - dbg("%s usb_submit_urb(%d) OK %d bytes (end %d)", __FUNCTION__, + dbg("%s - usb_submit_urb(%d) OK %d bytes (end %d)", __FUNCTION__, outcont_urb, this_urb->transfer_buffer_length, usb_pipeendpoint(this_urb->pipe)); } @@ -1663,8 +1811,10 @@ static void keyspan_send_setup(struct usb_serial_port *port, int reset_port) { struct usb_serial *serial = port->serial; - struct keyspan_serial_private *s_priv; - const keyspan_device_details *d_details; + struct keyspan_serial_private *s_priv; + const struct keyspan_device_details *d_details; + + dbg ("%s", __FUNCTION__); s_priv = (struct keyspan_serial_private *)(serial->private); d_details = s_priv->device_details; @@ -1690,16 +1840,15 @@ struct usb_serial_port *port; struct keyspan_serial_private *s_priv; struct keyspan_port_private *p_priv; - const keyspan_device_details *d_details; + const struct keyspan_device_details *d_details; - dbg("keyspan_startup called.\n"); + dbg("%s", __FUNCTION__); for (i = 0; (d_details = keyspan_devices[i]) != NULL; ++i) if (d_details->product_id == serial->dev->descriptor.idProduct) break; if (d_details == NULL) { - printk(KERN_ERR "%s: unknown product id %x\n", __FUNCTION__, - serial->dev->descriptor.idProduct); + err("%s - unknown product id %x", __FUNCTION__, serial->dev->descriptor.idProduct); return 1; } @@ -1707,7 +1856,7 @@ serial->private = kmalloc(sizeof(struct keyspan_serial_private), GFP_KERNEL); if (!serial->private) { - dbg("%s kmalloc for keyspan_serial_private failed.\n", __FUNCTION__); + dbg("%s - kmalloc for keyspan_serial_private failed.", __FUNCTION__); return (1); } memset(serial->private, 0, sizeof(struct keyspan_serial_private)); @@ -1721,7 +1870,7 @@ port->private = kmalloc(sizeof(struct keyspan_port_private), GFP_KERNEL); if (!port->private) { - dbg("%s kmalloc for keyspan_port_private (%d) failed!.\n", __FUNCTION__, i); + dbg("%s - kmalloc for keyspan_port_private (%d) failed!.", __FUNCTION__, i); return (1); } memset(port->private, 0, sizeof(struct keyspan_port_private)); @@ -1733,7 +1882,7 @@ s_priv->instat_urb->dev = serial->dev; if ((err = usb_submit_urb(s_priv->instat_urb)) != 0) { - dbg("%s submit instat urb failed %d\n", __FUNCTION__, err); + dbg("%s - submit instat urb failed %d", __FUNCTION__, err); } return (0); @@ -1746,7 +1895,7 @@ struct keyspan_serial_private *s_priv; struct keyspan_port_private *p_priv; - dbg("keyspan_shutdown called\n"); + dbg("%s", __FUNCTION__); s_priv = (struct keyspan_serial_private *)(serial->private); @@ -1791,10 +1940,6 @@ /* Now free per port private data */ for (i = 0; i < serial->num_ports; i++) { port = &serial->port[i]; - while (port->open_count > 0) { - --port->open_count; - MOD_DEC_USE_COUNT; - } kfree(port->private); } } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan.h linux.20pre5-ac2/drivers/usb/serial/keyspan.h --- linux.20pre5/drivers/usb/serial/keyspan.h 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan.h 2002-09-02 14:22:35.000000000 +0100 @@ -2,7 +2,7 @@ Keyspan USB to Serial Converter driver (C) Copyright (C) 2000-2001 - Hugh Blemings + Hugh Blemings This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -33,9 +33,8 @@ #ifndef __LINUX_USB_SERIAL_KEYSPAN_H #define __LINUX_USB_SERIAL_KEYSPAN_H -#include - /* Function prototypes for Keyspan serial converter */ +/* Function prototypes for Keyspan serial converter */ static int keyspan_open (struct usb_serial_port *port, struct file *filp); static void keyspan_close (struct usb_serial_port *port, @@ -54,12 +53,7 @@ static void keyspan_send_setup (struct usb_serial_port *port, int reset_port); -#if 0 -static void keyspan_write_bulk_callback (struct urb *urb); -#endif -//static void keyspan_usa26_read_int_callback (struct urb *urb); -//static void keyspan_usa28_read_int_callback (struct urb *urb); static int keyspan_chars_in_buffer (struct usb_serial_port *port); static int keyspan_ioctl (struct usb_serial_port *port, struct file *file, @@ -72,12 +66,16 @@ static int keyspan_fake_startup (struct usb_serial *serial); static int keyspan_usa19_calc_baud (u32 baud_rate, u32 baudclk, - u8 *rate_hi, u8 *rate_low, u8 *prescaler); + u8 *rate_hi, u8 *rate_low, + u8 *prescaler, int portnum); static int keyspan_usa19w_calc_baud (u32 baud_rate, u32 baudclk, - u8 *rate_hi, u8 *rate_low, u8 *prescaler); + u8 *rate_hi, u8 *rate_low, + u8 *prescaler, int portnum); -//static void keyspan_usa19_setup_urbs (struct usb_serial *serial); +static int keyspan_usa28_calc_baud (u32 baud_rate, u32 baudclk, + u8 *rate_hi, u8 *rate_low, + u8 *prescaler, int portnum); static int keyspan_usa28_send_setup (struct usb_serial *serial, struct usb_serial_port *port, @@ -89,91 +87,102 @@ struct usb_serial_port *port, int reset_port); - /* Functions from usbserial.c for ezusb firmware handling */ -extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit); -extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest); - /* Struct used for firmware - increased size of data section - to allow Keyspan's 'C' firmware struct to be used unmodified */ +/* Struct used for firmware - increased size of data section + to allow Keyspan's 'C' firmware struct to be used unmodified */ struct ezusb_hex_record { __u16 address; __u8 data_size; __u8 data[64]; }; - /* Conditionally include firmware images, if they aren't - included create a null pointer instead. Current - firmware images aren't optimised to remove duplicate - addresses in the image itself. */ + +/* Conditionally include firmware images, if they aren't + included create a null pointer instead. Current + firmware images aren't optimised to remove duplicate + addresses in the image itself. */ #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA28 - #include "keyspan_usa28_fw.h" + #include "keyspan_usa28_fw.h" #else static const struct ezusb_hex_record *keyspan_usa28_firmware = NULL; #endif #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA28X - #include "keyspan_usa28x_fw.h" + #include "keyspan_usa28x_fw.h" #else static const struct ezusb_hex_record *keyspan_usa28x_firmware = NULL; #endif #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA28XA - #include "keyspan_usa28xa_fw.h" + #include "keyspan_usa28xa_fw.h" #else static const struct ezusb_hex_record *keyspan_usa28xa_firmware = NULL; #endif #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA28XB - #include "keyspan_usa28xb_fw.h" + #include "keyspan_usa28xb_fw.h" #else static const struct ezusb_hex_record *keyspan_usa28xb_firmware = NULL; #endif #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19 - #include "keyspan_usa19_fw.h" + #include "keyspan_usa19_fw.h" #else static const struct ezusb_hex_record *keyspan_usa19_firmware = NULL; #endif +#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19QI + #include "keyspan_usa19qi_fw.h" +#else + static const struct ezusb_hex_record *keyspan_usa19qi_firmware = NULL; +#endif + +#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19QW + #include "keyspan_usa19qw_fw.h" +#else + static const struct ezusb_hex_record *keyspan_usa19qw_firmware = NULL; +#endif + #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA18X - #include "keyspan_usa18x_fw.h" + #include "keyspan_usa18x_fw.h" #else static const struct ezusb_hex_record *keyspan_usa18x_firmware = NULL; #endif #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19W - #include "keyspan_usa19w_fw.h" + #include "keyspan_usa19w_fw.h" #else static const struct ezusb_hex_record *keyspan_usa19w_firmware = NULL; #endif #ifdef CONFIG_USB_SERIAL_KEYSPAN_USA49W - #include "keyspan_usa49w_fw.h" + #include "keyspan_usa49w_fw.h" #else static const struct ezusb_hex_record *keyspan_usa49w_firmware = NULL; #endif - - /* Values used for baud rate calculation - device specific */ + +/* Values used for baud rate calculation - device specific */ #define KEYSPAN_INVALID_BAUD_RATE (-1) #define KEYSPAN_BAUD_RATE_OK (0) #define KEYSPAN_USA18X_BAUDCLK (12000000L) /* a guess */ #define KEYSPAN_USA19_BAUDCLK (12000000L) #define KEYSPAN_USA19W_BAUDCLK (24000000L) +#define KEYSPAN_USA28_BAUDCLK (1843200L) #define KEYSPAN_USA28X_BAUDCLK (12000000L) #define KEYSPAN_USA49W_BAUDCLK (48000000L) - /* Some constants used to characterise each device. - There is a four port device due later in the year, - we allow for it now in the following */ +/* Some constants used to characterise each device. */ #define KEYSPAN_MAX_NUM_PORTS (4) #define KEYSPAN_MAX_FLIPS (2) - - /* Device info for the Keyspan serial converter, used - by the overall usb-serial probe function */ + +/* Device info for the Keyspan serial converter, used + by the overall usb-serial probe function */ #define KEYSPAN_VENDOR_ID (0x06cd) - /* Product IDs for the eight products supported, pre-renumeration */ +/* Product IDs for the products supported, pre-renumeration */ #define keyspan_usa18x_pre_product_id 0x0105 #define keyspan_usa19_pre_product_id 0x0103 +#define keyspan_usa19qi_pre_product_id 0x010b +#define keyspan_usa19qw_pre_product_id 0x0118 #define keyspan_usa19w_pre_product_id 0x0106 #define keyspan_usa28_pre_product_id 0x0101 #define keyspan_usa28x_pre_product_id 0x0102 @@ -181,11 +190,13 @@ #define keyspan_usa28xb_pre_product_id 0x0113 #define keyspan_usa49w_pre_product_id 0x0109 - /* Product IDs post-renumeration. Note that the 28x and 28xb - have the same id's post-renumeration but behave identically - so it's not an issue. */ +/* Product IDs post-renumeration. Note that the 28x and 28xb + have the same id's post-renumeration but behave identically + so it's not an issue. */ #define keyspan_usa18x_product_id 0x0112 #define keyspan_usa19_product_id 0x0107 +#define keyspan_usa19qi_product_id 0x010c +#define keyspan_usa19qw_product_id 0x0119 #define keyspan_usa19w_product_id 0x0108 #define keyspan_usa28_product_id 0x010f #define keyspan_usa28x_product_id 0x0110 @@ -194,10 +205,10 @@ #define keyspan_usa49w_product_id 0x010a -typedef struct { +struct keyspan_device_details { /* product ID value */ int product_id; - + enum {msg_usa26, msg_usa28, msg_usa49} msg_format; /* Number of physical ports */ @@ -219,137 +230,190 @@ /* Input acknowledge endpoints */ int inack_endpoints[KEYSPAN_MAX_NUM_PORTS]; - /* Output control endpoints */ + /* Output control endpoints */ int outcont_endpoints[KEYSPAN_MAX_NUM_PORTS]; /* Endpoint used for input status */ int instat_endpoint; /* Endpoint used for global control functions */ - int glocont_endpoint; - + int glocont_endpoint; + int (*calculate_baud_rate) (u32 baud_rate, u32 baudclk, - u8 *rate_hi, u8 *rate_low, u8 *prescaler); + u8 *rate_hi, u8 *rate_low, u8 *prescaler, int portnum); u32 baudclk; +}; + +/* Now for each device type we setup the device detail + structure with the appropriate information (provided + in Keyspan's documentation) */ + +static const struct keyspan_device_details usa18x_device_details = { + product_id: keyspan_usa18x_product_id, + msg_format: msg_usa26, + num_ports: 1, + indat_endp_flip: 0, + outdat_endp_flip: 1, + indat_endpoints: {0x81}, + outdat_endpoints: {0x01}, + inack_endpoints: {0x85}, + outcont_endpoints: {0x05}, + instat_endpoint: 0x87, + glocont_endpoint: 0x07, + calculate_baud_rate: keyspan_usa19w_calc_baud, + baudclk: KEYSPAN_USA18X_BAUDCLK, +}; + +static const struct keyspan_device_details usa19_device_details = { + product_id: keyspan_usa19_product_id, + msg_format: msg_usa28, + num_ports: 1, + indat_endp_flip: 1, + outdat_endp_flip: 1, + indat_endpoints: {0x81}, + outdat_endpoints: {0x01}, + inack_endpoints: {0x83}, + outcont_endpoints: {0x03}, + instat_endpoint: 0x84, + glocont_endpoint: -1, + calculate_baud_rate: keyspan_usa19_calc_baud, + baudclk: KEYSPAN_USA19_BAUDCLK, +}; + +static const struct keyspan_device_details usa19qi_device_details = { + product_id: keyspan_usa19qi_product_id, + msg_format: msg_usa28, + num_ports: 1, + indat_endp_flip: 1, + outdat_endp_flip: 1, + indat_endpoints: {0x81}, + outdat_endpoints: {0x01}, + inack_endpoints: {0x83}, + outcont_endpoints: {0x03}, + instat_endpoint: 0x84, + glocont_endpoint: -1, + calculate_baud_rate: keyspan_usa28_calc_baud, + baudclk: KEYSPAN_USA19_BAUDCLK, +}; + +static const struct keyspan_device_details usa19qw_device_details = { + product_id: keyspan_usa19qw_product_id, + msg_format: msg_usa26, + num_ports: 1, + indat_endp_flip: 0, + outdat_endp_flip: 1, + indat_endpoints: {0x81}, + outdat_endpoints: {0x01}, + inack_endpoints: {0x85}, + outcont_endpoints: {0x05}, + instat_endpoint: 0x87, + glocont_endpoint: 0x07, + calculate_baud_rate: keyspan_usa19w_calc_baud, + baudclk: KEYSPAN_USA19W_BAUDCLK, +}; + +static const struct keyspan_device_details usa19w_device_details = { + product_id: keyspan_usa19w_product_id, + msg_format: msg_usa26, + num_ports: 1, + indat_endp_flip: 0, + outdat_endp_flip: 1, + indat_endpoints: {0x81}, + outdat_endpoints: {0x01}, + inack_endpoints: {0x85}, + outcont_endpoints: {0x05}, + instat_endpoint: 0x87, + glocont_endpoint: 0x07, + calculate_baud_rate: keyspan_usa19w_calc_baud, + baudclk: KEYSPAN_USA19W_BAUDCLK, +}; + +static const struct keyspan_device_details usa28_device_details = { + product_id: keyspan_usa28_product_id, + msg_format: msg_usa28, + num_ports: 2, + indat_endp_flip: 1, + outdat_endp_flip: 1, + indat_endpoints: {0x81, 0x83}, + outdat_endpoints: {0x01, 0x03}, + inack_endpoints: {0x85, 0x86}, + outcont_endpoints: {0x05, 0x06}, + instat_endpoint: 0x87, + glocont_endpoint: 0x07, + calculate_baud_rate: keyspan_usa28_calc_baud, + baudclk: KEYSPAN_USA28_BAUDCLK, +}; -} keyspan_device_details; +static const struct keyspan_device_details usa28x_device_details = { + product_id: keyspan_usa28x_product_id, + msg_format: msg_usa26, + num_ports: 2, + indat_endp_flip: 0, + outdat_endp_flip: 1, + indat_endpoints: {0x81, 0x83}, + outdat_endpoints: {0x01, 0x03}, + inack_endpoints: {0x85, 0x86}, + outcont_endpoints: {0x05, 0x06}, + instat_endpoint: 0x87, + glocont_endpoint: 0x07, + calculate_baud_rate: keyspan_usa19w_calc_baud, + baudclk: KEYSPAN_USA28X_BAUDCLK, +}; - /* Now for each device type we setup the device detail - structure with the appropriate information (provided - in Keyspan's documentation) */ - -static const keyspan_device_details usa18x_device_details = { - keyspan_usa18x_product_id, /* product ID */ - msg_usa26, /* msg type*/ - 1, /* num ports */ - 0, /* indat endpoint flip */ - 1, /* outdat endpoint flip */ - {0x81}, /* per port indat */ - {0x01}, /* per port outdat */ - {0x85}, /* per port inack */ - {0x05}, /* per port outcont */ - 0x87, /* instat endpoint */ - 0x07, /* glocont endpoint */ - keyspan_usa19w_calc_baud, /* calc baud rate */ - KEYSPAN_USA18X_BAUDCLK /* base baud clock */ -}; - -static const keyspan_device_details usa19_device_details = { - keyspan_usa19_product_id, /* product ID */ - msg_usa28, /* msg type*/ - 1, /* num ports */ - 1, /* indat endpoint flip */ - 1, /* outdat endpoint flip */ - {0x81}, /* per port indat */ - {0x01}, /* per port outdat */ - {0x83}, /* per port inack */ - {0x03}, /* per port outcont */ - 0x84, /* instat endpoint */ - -1, /* glocont endpoint */ - keyspan_usa19_calc_baud, /* calc baud rate */ - KEYSPAN_USA19_BAUDCLK /* base baud clock */ -}; - -static const keyspan_device_details usa19w_device_details = { - keyspan_usa19w_product_id, /* product ID */ - msg_usa26, /* msg type*/ - 1, /* num ports */ - 0, /* indat endpoint flip */ - 1, /* outdat endpoint flip */ - {0x81}, /* per port indat */ - {0x01}, /* per port outdat */ - {0x85}, /* per port inack */ - {0x05}, /* per port outcont */ - 0x87, /* instat endpoint */ - 0x07, /* glocont endpoint */ - keyspan_usa19w_calc_baud, /* calc baud rate */ - KEYSPAN_USA19W_BAUDCLK /* base baud clock */ -}; - -static const keyspan_device_details usa28x_device_details = { - keyspan_usa28x_product_id, /* product ID */ - msg_usa26, /* msg type*/ - 2, /* num ports */ - 0, /* indat endpoint flip */ - 1, /* outdat endpoint flip */ - {0x81, 0x83}, /* per port indat */ - {0x01, 0x03}, /* per port outdat */ - {0x85, 0x86}, /* per port inack */ - {0x05, 0x06}, /* per port outcont */ - 0x87, /* instat endpoint */ - 0x07, /* glocont endpoint */ - keyspan_usa19w_calc_baud, /* calc baud rate */ - KEYSPAN_USA28X_BAUDCLK -}; - -static const keyspan_device_details usa28xa_device_details = { - keyspan_usa28xa_product_id, /* product ID */ - msg_usa26, /* msg type*/ - 2, /* num ports */ - 0, /* indat endpoint flip */ - 1, /* outdat endpoint flip */ - {0x81, 0x83}, /* per port indat */ - {0x01, 0x03}, /* per port outdat */ - {0x85, 0x86}, /* per port inack */ - {0x05, 0x06}, /* per port outcont */ - 0x87, /* instat endpoint */ - 0x07, /* glocont endpoint */ - keyspan_usa19w_calc_baud, /* calc baud rate */ - KEYSPAN_USA28X_BAUDCLK -}; - - /* We don't need a separate entry for the usa28xb as it appears as a 28x anyway */ - -static const keyspan_device_details usa49w_device_details = { - keyspan_usa49w_product_id, /* product ID */ - msg_usa49, /* msg type*/ - 4, /* num ports */ - 0, /* indat endpoint flip */ - 0, /* outdat endpoint flip */ - { 0x81, 0x82, 0x83, 0x84}, /* per port indat */ - { 0x01, 0x02, 0x03, 0x04}, /* per port outdat */ - {-1, -1, -1, -1}, /* per port inack */ - {-1, -1, -1, -1}, /* per port outcont */ - 0x87, /* instat endpoint */ - 0x07, /* glocont endpoint */ - keyspan_usa19w_calc_baud, /* calc baud rate */ - KEYSPAN_USA49W_BAUDCLK +static const struct keyspan_device_details usa28xa_device_details = { + product_id: keyspan_usa28xa_product_id, + msg_format: msg_usa26, + num_ports: 2, + indat_endp_flip: 0, + outdat_endp_flip: 1, + indat_endpoints: {0x81, 0x83}, + outdat_endpoints: {0x01, 0x03}, + inack_endpoints: {0x85, 0x86}, + outcont_endpoints: {0x05, 0x06}, + instat_endpoint: 0x87, + glocont_endpoint: 0x07, + calculate_baud_rate: keyspan_usa19w_calc_baud, + baudclk: KEYSPAN_USA28X_BAUDCLK, +}; + +/* We don't need a separate entry for the usa28xb as it appears as a 28x anyway */ + +static const struct keyspan_device_details usa49w_device_details = { + product_id: keyspan_usa49w_product_id, + msg_format: msg_usa49, + num_ports: 4, + indat_endp_flip: 0, + outdat_endp_flip: 0, + indat_endpoints: {0x81, 0x82, 0x83, 0x84}, + outdat_endpoints: {0x01, 0x02, 0x03, 0x04}, + inack_endpoints: {-1, -1, -1, -1}, + outcont_endpoints: {-1, -1, -1, -1}, + instat_endpoint: 0x87, + glocont_endpoint: 0x07, + calculate_baud_rate: keyspan_usa19w_calc_baud, + baudclk: KEYSPAN_USA49W_BAUDCLK, }; -static const keyspan_device_details *keyspan_devices[] = { +static const struct keyspan_device_details *keyspan_devices[] = { &usa18x_device_details, &usa19_device_details, + &usa19qi_device_details, + &usa19qw_device_details, &usa19w_device_details, + &usa28_device_details, &usa28x_device_details, &usa28xa_device_details, + /* 28xb not required as it renumerates as a 28x */ &usa49w_device_details, - NULL + NULL, }; static __devinitdata struct usb_device_id keyspan_ids_combined[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_pre_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_pre_product_id) }, + { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_pre_product_id) }, + { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_pre_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_pre_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_pre_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_pre_product_id) }, @@ -358,6 +422,8 @@ { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) }, + { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) }, + { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) }, @@ -368,224 +434,58 @@ MODULE_DEVICE_TABLE(usb, keyspan_ids_combined); -/* Eventually, we will not need separate id tables for each USB - ID pattern. But, for now, it looks like we need slightly different - behavior for each match. */ - -static struct usb_device_id keyspan_usa18x_pre_ids[] = { +/* usb_device_id table for the pre-firmware download keyspan devices */ +static struct usb_device_id keyspan_pre_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_pre_product_id) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id keyspan_usa19_pre_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_pre_product_id) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id keyspan_usa19w_pre_ids[] = { + { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_pre_product_id) }, + { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_pre_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_pre_product_id) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id keyspan_usa28_pre_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_pre_product_id) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id keyspan_usa28x_pre_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_pre_product_id) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id keyspan_usa28xa_pre_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_pre_product_id) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id keyspan_usa28xb_pre_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_pre_product_id) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id keyspan_usa49w_pre_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_pre_product_id) }, { } /* Terminating entry */ }; -static struct usb_device_id keyspan_usa18x_ids[] = { +static struct usb_device_id keyspan_1port_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa18x_product_id) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id keyspan_usa19_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19_product_id) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id keyspan_usa19w_ids[] = { + { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qi_product_id) }, + { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19qw_product_id) }, { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa19w_product_id) }, { } /* Terminating entry */ }; -static struct usb_device_id keyspan_usa28_ids[] = { +static struct usb_device_id keyspan_2port_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28_product_id) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id keyspan_usa28x_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id keyspan_usa28xa_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) }, { } /* Terminating entry */ }; -static struct usb_device_id keyspan_usa49w_ids[] = { +static struct usb_device_id keyspan_4port_ids[] = { { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id) }, { } /* Terminating entry */ }; - /* Structs for the devices, pre and post renumeration. */ -static struct usb_serial_device_type keyspan_usa18x_pre_device = { - name: "Keyspan USA18X - (without firmware)", - id_table: keyspan_usa18x_pre_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 1, - startup: keyspan_fake_startup -}; - -static struct usb_serial_device_type keyspan_usa19_pre_device = { - name: "Keyspan USA19 - (without firmware)", - id_table: keyspan_usa19_pre_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 1, - startup: keyspan_fake_startup -}; - - -static struct usb_serial_device_type keyspan_usa19w_pre_device = { - name: "Keyspan USA19W - (without firmware)", - id_table: keyspan_usa19w_pre_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 1, - startup: keyspan_fake_startup -}; - - -static struct usb_serial_device_type keyspan_usa28_pre_device = { - name: "Keyspan USA28 - (without firmware)", - id_table: keyspan_usa28_pre_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 2, - startup: keyspan_fake_startup -}; - -static struct usb_serial_device_type keyspan_usa28x_pre_device = { - name: "Keyspan USA28X - (without firmware)", - id_table: keyspan_usa28x_pre_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 2, - startup: keyspan_fake_startup -}; - -static struct usb_serial_device_type keyspan_usa28xa_pre_device = { - name: "Keyspan USA28XA - (without firmware)", - id_table: keyspan_usa28xa_pre_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, +/* Structs for the devices, pre and post renumeration. */ +static struct usb_serial_device_type keyspan_pre_device = { + owner: THIS_MODULE, + name: "Keyspan - (without firmware)", + id_table: keyspan_pre_ids, num_interrupt_in: NUM_DONT_CARE, num_bulk_in: NUM_DONT_CARE, num_bulk_out: NUM_DONT_CARE, - num_ports: 2, - startup: keyspan_fake_startup -}; - -static struct usb_serial_device_type keyspan_usa28xb_pre_device = { - name: "Keyspan USA28XB - (without firmware)", - id_table: keyspan_usa28xb_pre_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 2, - startup: keyspan_fake_startup -}; - -static struct usb_serial_device_type keyspan_usa49w_pre_device = { - name: "Keyspan USA49W - (without firmware)", - id_table: keyspan_usa49w_pre_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 4, - startup: keyspan_fake_startup -}; - -static struct usb_serial_device_type keyspan_usa18x_device = { - name: "Keyspan USA18X", - id_table: keyspan_usa18x_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: 3, - num_bulk_out: 4, num_ports: 1, - open: keyspan_open, - close: keyspan_close, - write: keyspan_write, - write_room: keyspan_write_room, - //write_bulk_callback: Not used - we define our own herbs - //read_int_callback: keyspan_usa26_read_int_callback, - chars_in_buffer: keyspan_chars_in_buffer, - throttle: keyspan_rx_throttle, - unthrottle: keyspan_rx_unthrottle, - ioctl: keyspan_ioctl, - set_termios: keyspan_set_termios, - break_ctl: keyspan_break_ctl, - startup: keyspan_startup, - shutdown: keyspan_shutdown, + startup: keyspan_fake_startup, }; -static struct usb_serial_device_type keyspan_usa19_device = { - name: "Keyspan USA19", - id_table: keyspan_usa19_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, +static struct usb_serial_device_type keyspan_1port_device = { + owner: THIS_MODULE, + name: "Keyspan 1 port adapter", + id_table: keyspan_1port_ids, num_interrupt_in: NUM_DONT_CARE, num_bulk_in: 3, num_bulk_out: 4, @@ -594,8 +494,6 @@ close: keyspan_close, write: keyspan_write, write_room: keyspan_write_room, -// write_bulk_callback: keyspan_write_bulk_callback, -// read_int_callback: keyspan_usa28_read_int_callback, chars_in_buffer: keyspan_chars_in_buffer, throttle: keyspan_rx_throttle, unthrottle: keyspan_rx_unthrottle, @@ -606,85 +504,10 @@ shutdown: keyspan_shutdown, }; - -static struct usb_serial_device_type keyspan_usa19w_device = { - name: "Keyspan USA19W", - id_table: keyspan_usa19w_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: 3, - num_bulk_out: 4, - num_ports: 1, - open: keyspan_open, - close: keyspan_close, - write: keyspan_write, - write_room: keyspan_write_room, - //write_bulk_callback: Not used - we define our own herbs - //read_int_callback: keyspan_usa26_read_int_callback, - chars_in_buffer: keyspan_chars_in_buffer, - throttle: keyspan_rx_throttle, - unthrottle: keyspan_rx_unthrottle, - ioctl: keyspan_ioctl, - set_termios: keyspan_set_termios, - break_ctl: keyspan_break_ctl, - startup: keyspan_startup, - shutdown: keyspan_shutdown, -}; - - -static struct usb_serial_device_type keyspan_usa28_device = { - name: "Keyspan USA28", - id_table: keyspan_usa28_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 2, - open: keyspan_open, - close: keyspan_close, - throttle: keyspan_rx_throttle, - unthrottle: keyspan_rx_unthrottle, - set_termios: keyspan_set_termios, -}; - - -static struct usb_serial_device_type keyspan_usa28x_device = { - name: "Keyspan USA28X/XB", - id_table: keyspan_usa28x_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 2, - open: keyspan_open, - close: keyspan_close, - write: keyspan_write, - write_room: keyspan_write_room, -// write_bulk_callback: keyspan_write_bulk_callback, -// read_int_callback: keyspan_usa26_read_int_callback, - chars_in_buffer: keyspan_chars_in_buffer, - throttle: keyspan_rx_throttle, - unthrottle: keyspan_rx_unthrottle, - ioctl: keyspan_ioctl, - set_termios: keyspan_set_termios, - break_ctl: keyspan_break_ctl, - startup: keyspan_startup, - shutdown: keyspan_shutdown, - -}; - -static struct usb_serial_device_type keyspan_usa28xa_device = { - name: "Keyspan USA28XA", - id_table: keyspan_usa28xa_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, +static struct usb_serial_device_type keyspan_2port_device = { + owner: THIS_MODULE, + name: "Keyspan 2 port adapter", + id_table: keyspan_2port_ids, num_interrupt_in: NUM_DONT_CARE, num_bulk_in: NUM_DONT_CARE, num_bulk_out: NUM_DONT_CARE, @@ -693,8 +516,6 @@ close: keyspan_close, write: keyspan_write, write_room: keyspan_write_room, -// write_bulk_callback: keyspan_write_bulk_callback, -// read_int_callback: keyspan_usa26_read_int_callback, chars_in_buffer: keyspan_chars_in_buffer, throttle: keyspan_rx_throttle, unthrottle: keyspan_rx_unthrottle, @@ -703,15 +524,12 @@ break_ctl: keyspan_break_ctl, startup: keyspan_startup, shutdown: keyspan_shutdown, - }; -static struct usb_serial_device_type keyspan_usa49w_device = { - name: "Keyspan USA49W", - id_table: keyspan_usa49w_ids, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, +static struct usb_serial_device_type keyspan_4port_device = { + owner: THIS_MODULE, + name: "Keyspan 4 port adapter", + id_table: keyspan_4port_ids, num_interrupt_in: NUM_DONT_CARE, num_bulk_in: 5, num_bulk_out: 5, @@ -720,8 +538,6 @@ close: keyspan_close, write: keyspan_write, write_room: keyspan_write_room, - //write_bulk_callback: Not used - we define our own herbs - //read_int_callback: keyspan_usa26_read_int_callback, chars_in_buffer: keyspan_chars_in_buffer, throttle: keyspan_rx_throttle, unthrottle: keyspan_rx_unthrottle, @@ -732,5 +548,4 @@ shutdown: keyspan_shutdown, }; - #endif diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_pda.c linux.20pre5-ac2/drivers/usb/serial/keyspan_pda.c --- linux.20pre5/drivers/usb/serial/keyspan_pda.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_pda.c 2002-09-01 13:39:15.000000000 +0100 @@ -68,19 +68,16 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include #include +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -172,10 +169,6 @@ #ifdef XIRCOM static struct usb_device_id id_table_fake_xircom [] = { { USB_DEVICE(XIRCOM_VENDOR_ID, XIRCOM_FAKE_ID) }, - { } -}; - -static struct usb_device_id id_table_fake_entregra [] = { { USB_DEVICE(ENTREGRA_VENDOR_ID, ENTREGRA_FAKE_ID) }, { } }; @@ -197,26 +190,28 @@ /* wake up other tty processes */ wake_up_interruptible( &tty->write_wait ); /* For 2.2.16 backport -- wake_up_interruptible( &tty->poll_wait ); */ - MOD_DEC_USE_COUNT; } static void keyspan_pda_request_unthrottle( struct usb_serial *serial ) { + int result; dbg(" request_unthrottle"); /* ask the device to tell us when the tx buffer becomes sufficiently empty */ - usb_control_msg(serial->dev, - usb_sndctrlpipe(serial->dev, 0), - 7, /* request_unthrottle */ - USB_TYPE_VENDOR | USB_RECIP_INTERFACE - | USB_DIR_OUT, - 16, /* value: threshold */ - 0, /* index */ - NULL, - 0, - 2*HZ); - MOD_DEC_USE_COUNT; + result = usb_control_msg(serial->dev, + usb_sndctrlpipe(serial->dev, 0), + 7, /* request_unthrottle */ + USB_TYPE_VENDOR | USB_RECIP_INTERFACE + | USB_DIR_OUT, + 16, /* value: threshold */ + 0, /* index */ + NULL, + 0, + 2*HZ); + if (result < 0) + dbg("%s - error %d from usb_control_msg", + __FUNCTION__, result); } @@ -265,9 +260,7 @@ tty = serial->port[0].tty; priv->tx_throttled = 0; /* queue up a wakeup at scheduler time */ - MOD_INC_USE_COUNT; - if (schedule_task(&priv->wakeup_task) == 0) - MOD_DEC_USE_COUNT; + schedule_task(&priv->wakeup_task); break; default: break; @@ -345,14 +338,19 @@ { struct usb_serial *serial = port->serial; int value; + int result; + if (break_state == -1) value = 1; /* start break */ else value = 0; /* clear break */ - usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), - 4, /* set break */ - USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT, - value, 0, NULL, 0, 2*HZ); + result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), + 4, /* set break */ + USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT, + value, 0, NULL, 0, 2*HZ); + if (result < 0) + dbg("%s - error %d from usb_control_msg", + __FUNCTION__, result); /* there is something funky about this.. the TCSBRK that 'cu' performs ought to translate into a break_ctl(-1),break_ctl(0) pair HZ/4 seconds apart, but it feels like the break sent isn't as long as it @@ -606,9 +604,7 @@ if (request_unthrottle) { priv->tx_throttled = 1; /* block writers */ - MOD_INC_USE_COUNT; - if (schedule_task(&priv->unthrottle_task) == 0) - MOD_DEC_USE_COUNT; + schedule_task(&priv->unthrottle_task); } rc = count; @@ -635,9 +631,7 @@ } /* queue up a wakeup at scheduler time */ - MOD_INC_USE_COUNT; - if (schedule_task(&priv->wakeup_task) == 0) - MOD_DEC_USE_COUNT; + schedule_task(&priv->wakeup_task); } @@ -674,62 +668,45 @@ int rc = 0; struct keyspan_pda_private *priv; - down (&port->sem); - - MOD_INC_USE_COUNT; - ++port->open_count; - - if (!port->active) { - port->active = 1; - - /* find out how much room is in the Tx ring */ - rc = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), - 6, /* write_room */ - USB_TYPE_VENDOR | USB_RECIP_INTERFACE - | USB_DIR_IN, - 0, /* value */ - 0, /* index */ - &room, - 1, - 2*HZ); - if (rc < 0) { - dbg("%s - roomquery failed", __FUNCTION__); - goto error; - } - if (rc == 0) { - dbg("%s - roomquery returned 0 bytes", __FUNCTION__); - rc = -EIO; - goto error; - } - priv = (struct keyspan_pda_private *)(port->private); - priv->tx_room = room; - priv->tx_throttled = room ? 0 : 1; - - /* the normal serial device seems to always turn on DTR and RTS here, - so do the same */ - if (port->tty->termios->c_cflag & CBAUD) - keyspan_pda_set_modem_info(serial, (1<<7) | (1<<2) ); - else - keyspan_pda_set_modem_info(serial, 0); + /* find out how much room is in the Tx ring */ + rc = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0), + 6, /* write_room */ + USB_TYPE_VENDOR | USB_RECIP_INTERFACE + | USB_DIR_IN, + 0, /* value */ + 0, /* index */ + &room, + 1, + 2*HZ); + if (rc < 0) { + dbg("%s - roomquery failed", __FUNCTION__); + goto error; + } + if (rc == 0) { + dbg("%s - roomquery returned 0 bytes", __FUNCTION__); + rc = -EIO; + goto error; + } + priv = (struct keyspan_pda_private *)(port->private); + priv->tx_room = room; + priv->tx_throttled = room ? 0 : 1; - /*Start reading from the device*/ - port->interrupt_in_urb->dev = serial->dev; - rc = usb_submit_urb(port->interrupt_in_urb); - if (rc) { - dbg("%s - usb_submit_urb(read int) failed", __FUNCTION__); - goto error; - } + /* the normal serial device seems to always turn on DTR and RTS here, + so do the same */ + if (port->tty->termios->c_cflag & CBAUD) + keyspan_pda_set_modem_info(serial, (1<<7) | (1<<2) ); + else + keyspan_pda_set_modem_info(serial, 0); + /*Start reading from the device*/ + port->interrupt_in_urb->dev = serial->dev; + rc = usb_submit_urb(port->interrupt_in_urb); + if (rc) { + dbg("%s - usb_submit_urb(read int) failed", __FUNCTION__); + goto error; } - - up (&port->sem); - return rc; error: - --port->open_count; - port->active = 0; - MOD_DEC_USE_COUNT; - up (&port->sem); return rc; } @@ -738,26 +715,15 @@ { struct usb_serial *serial = port->serial; - down (&port->sem); - - --port->open_count; + if (serial->dev) { + /* the normal serial device seems to always shut off DTR and RTS now */ + if (port->tty->termios->c_cflag & HUPCL) + keyspan_pda_set_modem_info(serial, 0); - if (port->open_count <= 0) { - if (serial->dev) { - /* the normal serial device seems to always shut off DTR and RTS now */ - if (port->tty->termios->c_cflag & HUPCL) - keyspan_pda_set_modem_info(serial, 0); - - /* shutdown our bulk reads and writes */ - usb_unlink_urb (port->write_urb); - usb_unlink_urb (port->interrupt_in_urb); - } - port->active = 0; - port->open_count = 0; + /* shutdown our bulk reads and writes */ + usb_unlink_urb (port->write_urb); + usb_unlink_urb (port->interrupt_in_urb); } - - up (&port->sem); - MOD_DEC_USE_COUNT; } @@ -833,79 +799,57 @@ { dbg("%s", __FUNCTION__); - while (serial->port[0].open_count > 0) { - keyspan_pda_close (&serial->port[0], NULL); - } kfree(serial->port[0].private); } #ifdef KEYSPAN static struct usb_serial_device_type keyspan_pda_fake_device = { - name: "Keyspan PDA - (prerenumeration)", - id_table: id_table_fake, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 1, - startup: keyspan_pda_fake_startup, + .owner = THIS_MODULE, + .name = "Keyspan PDA - (prerenumeration)", + .id_table = id_table_fake, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = NUM_DONT_CARE, + .num_bulk_out = NUM_DONT_CARE, + .num_ports = 1, + .startup = keyspan_pda_fake_startup, }; #endif #ifdef XIRCOM static struct usb_serial_device_type xircom_pgs_fake_device = { - name: "Xircom PGS - (prerenumeration)", - id_table: id_table_fake_xircom, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 1, - startup: keyspan_pda_fake_startup, -}; - -static struct usb_serial_device_type entregra_pgs_fake_device = { - name: "Entregra PGS - (prerenumeration)", - id_table: id_table_fake_entregra, - needs_interrupt_in: DONT_CARE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: DONT_CARE, - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 1, - startup: keyspan_pda_fake_startup, + .owner = THIS_MODULE, + .name = "Xircom / Entregra PGS - (prerenumeration)", + .id_table = id_table_fake_xircom, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = NUM_DONT_CARE, + .num_bulk_out = NUM_DONT_CARE, + .num_ports = 1, + .startup = keyspan_pda_fake_startup, }; #endif static struct usb_serial_device_type keyspan_pda_device = { - name: "Keyspan PDA", - id_table: id_table_std, - needs_interrupt_in: MUST_HAVE, - needs_bulk_in: DONT_CARE, - needs_bulk_out: MUST_HAVE, - num_interrupt_in: 1, - num_bulk_in: 0, - num_bulk_out: 1, - num_ports: 1, - open: keyspan_pda_open, - close: keyspan_pda_close, - write: keyspan_pda_write, - write_room: keyspan_pda_write_room, - write_bulk_callback: keyspan_pda_write_bulk_callback, - read_int_callback: keyspan_pda_rx_interrupt, - chars_in_buffer: keyspan_pda_chars_in_buffer, - throttle: keyspan_pda_rx_throttle, - unthrottle: keyspan_pda_rx_unthrottle, - ioctl: keyspan_pda_ioctl, - set_termios: keyspan_pda_set_termios, - break_ctl: keyspan_pda_break_ctl, - startup: keyspan_pda_startup, - shutdown: keyspan_pda_shutdown, + .owner = THIS_MODULE, + .name = "Keyspan PDA", + .id_table = id_table_std, + .num_interrupt_in = 1, + .num_bulk_in = 0, + .num_bulk_out = 1, + .num_ports = 1, + .open = keyspan_pda_open, + .close = keyspan_pda_close, + .write = keyspan_pda_write, + .write_room = keyspan_pda_write_room, + .write_bulk_callback = keyspan_pda_write_bulk_callback, + .read_int_callback = keyspan_pda_rx_interrupt, + .chars_in_buffer = keyspan_pda_chars_in_buffer, + .throttle = keyspan_pda_rx_throttle, + .unthrottle = keyspan_pda_rx_unthrottle, + .ioctl = keyspan_pda_ioctl, + .set_termios = keyspan_pda_set_termios, + .break_ctl = keyspan_pda_break_ctl, + .startup = keyspan_pda_startup, + .shutdown = keyspan_pda_shutdown, }; @@ -917,7 +861,6 @@ #endif #ifdef XIRCOM usb_serial_register (&xircom_pgs_fake_device); - usb_serial_register (&entregra_pgs_fake_device); #endif info(DRIVER_DESC " " DRIVER_VERSION); return 0; @@ -931,7 +874,6 @@ usb_serial_deregister (&keyspan_pda_fake_device); #endif #ifdef XIRCOM - usb_serial_deregister (&entregra_pgs_fake_device); usb_serial_deregister (&xircom_pgs_fake_device); #endif } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa18x_fw.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa18x_fw.h --- linux.20pre5/drivers/usb/serial/keyspan_usa18x_fw.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa18x_fw.h 2002-09-01 13:39:31.000000000 +0100 @@ -1,341 +1,345 @@ /* keyspan_usa18x_fw.h - - Generated from Keyspan firmware image usa16code.h Sat Oct 6 12:16:35 EST 2001 - This firmware is for the Keyspan USA-18X Serial Adaptor - "The firmware contained herein as keyspan_usa18x_fw.h is - Copyright (C) 1999-2001 Keyspan, A division of InnoSys Incorporated - ("Keyspan"), as an unpublished work. This notice does not imply - unrestricted or public access to this firmware which is a trade secret of - Keyspan, and which may not be reproduced, used, sold or transferred to any - third party without Keyspan's prior written consent. All Rights Reserved. + The firmware contained herein as keyspan_usa18x_fw.h is - This firmware may not be modified and may only be used with the Keyspan - USA-18X Serial Adapter. Distribution and/or Modification of the - keyspan.c driver which includes this firmware, in whole or in part, - requires the inclusion of this statement." + Copyright (C) 1999-2001 + Keyspan, A division of InnoSys Incorporated ("Keyspan") + + as an unpublished work. This notice does not imply unrestricted or + public access to the source code from which this firmware image is + derived. Except as noted below this firmware image may not be + reproduced, used, sold or transferred to any third party without + Keyspan's prior written consent. All Rights Reserved. + Permission is hereby granted for the distribution of this firmware + image as part of a Linux or other Open Source operating system kernel + in text or binary form as required. + + This firmware may not be modified and may only be used with + Keyspan hardware. Distribution and/or Modification of the + keyspan.c driver which includes this firmware, in whole or in + part, requires the inclusion of this statement." */ static const struct ezusb_hex_record keyspan_usa18x_firmware[] = { - {0x0033, 3, { 0x02, 0x13, 0xab}}, + {0x0033, 3, { 0x02, 0x12, 0xf7}}, {0x0003, 16, { 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0}}, {0x0013, 16, { 0x90, 0x7f, 0x94, 0xf0, 0x90, 0x7f, 0x9d, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x97, 0xf0, 0x90}}, {0x0023, 15, { 0x7f, 0x95, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x07, 0xf0, 0xe4, 0x90, 0x7f, 0x98, 0xf0, 0x22}}, - {0x0046, 16, { 0x30, 0x09, 0x18, 0x12, 0x13, 0x33, 0xef, 0xc3, 0x95, 0x3c, 0x40, 0x03, 0x02, 0x00, 0xd8, 0x90}}, + {0x0046, 16, { 0x30, 0x09, 0x18, 0x12, 0x13, 0x1b, 0xef, 0xc3, 0x95, 0x3c, 0x40, 0x03, 0x02, 0x00, 0xd8, 0x90}}, {0x0056, 16, { 0x7f, 0xbf, 0x74, 0x01, 0xf0, 0xc2, 0x09, 0xc2, 0x00, 0x80, 0x77, 0x30, 0x03, 0x3b, 0x90, 0x7f}}, - {0x0066, 16, { 0xc6, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x13, 0x33, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7e}}, + {0x0066, 16, { 0xc6, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x13, 0x1b, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7e}}, {0x0076, 16, { 0x40, 0xe0, 0x13, 0x92, 0x09, 0x90, 0x7f, 0xc7, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60}}, - {0x0086, 16, { 0x0f, 0xf5, 0x08, 0x7e, 0x7e, 0x7f, 0x41, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x41, 0x12, 0x0c, 0xca}}, + {0x0086, 16, { 0x0f, 0xf5, 0x08, 0x7e, 0x7e, 0x7f, 0x41, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x41, 0x12, 0x0c, 0xba}}, {0x0096, 16, { 0xc2, 0x03, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0x80, 0x39, 0x90, 0x7f, 0xc8, 0xe0, 0x20, 0xe1, 0x32}}, - {0x00a6, 16, { 0x12, 0x13, 0x33, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x09}}, + {0x00a6, 16, { 0x12, 0x13, 0x1b, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x09}}, {0x00b6, 16, { 0x90, 0x7f, 0xc9, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7d}}, - {0x00c6, 16, { 0x7f, 0xc1, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0xc1, 0x12, 0x0c, 0xca, 0xd2, 0x03, 0xe4, 0x90, 0x7f}}, - {0x00d6, 16, { 0xc9, 0xf0, 0x90, 0x7f, 0xb6, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x01, 0x66, 0x53, 0x36, 0x80, 0x12}}, - {0x00e6, 16, { 0x13, 0x3f, 0xef, 0x42, 0x36, 0x12, 0x11, 0xed, 0x8f, 0x19, 0xef, 0xc3, 0x95, 0x3a, 0x50, 0x0f}}, - {0x00f6, 16, { 0x12, 0x13, 0x1b, 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x36, 0x20, 0xe7, 0x03, 0x30, 0x0b, 0x61, 0xc2}}, + {0x00c6, 16, { 0x7f, 0xc1, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0xc1, 0x12, 0x0c, 0xba, 0xd2, 0x03, 0xe4, 0x90, 0x7f}}, + {0x00d6, 16, { 0xc9, 0xf0, 0x90, 0x7f, 0xb6, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x01, 0x60, 0x12, 0x11, 0xd6, 0x8f}}, + {0x00e6, 16, { 0x19, 0x12, 0x13, 0x27, 0x8f, 0x36, 0xe5, 0x19, 0xc3, 0x95, 0x3a, 0x50, 0x0f, 0x12, 0x12, 0xeb}}, + {0x00f6, 16, { 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x36, 0x20, 0xe7, 0x03, 0x30, 0x0b, 0x5e, 0xc2, 0x0b, 0xe5, 0x19}}, {0x0036, 12, { 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22}}, {0x0043, 3, { 0x02, 0x13, 0x00}}, - {0x0000, 3, { 0x02, 0x0e, 0x10}}, - {0x0106, 64, { 0x0b, 0xe5, 0x19, 0x70, 0x04, 0xf5, 0x36, 0x80, 0x57, 0x12, 0x13, 0x3f, 0xef, 0x42, 0x36, 0xe5, 0x36, - 0x30, 0xe7, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, - 0x7e, 0x7e, 0x7f, 0x80, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x80, 0xaf, 0x36, 0x12, 0x0f, 0x5b, 0xe5, - 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xb7, 0xf0, 0x80, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40}}, - {0x0146, 64, { 0x03, 0x75, 0x19, 0x3f, 0x85, 0x19, 0x08, 0xe4, 0x90, 0x7e, 0x80, 0xf0, 0x7e, 0x7e, 0x7f, 0x81, 0x75, - 0x0c, 0x7e, 0x75, 0x0d, 0x81, 0x12, 0x0c, 0xef, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xb7, 0xf0, 0x90, - 0x7f, 0xce, 0xe0, 0x30, 0xe1, 0x06, 0x20, 0x05, 0x03, 0x02, 0x03, 0xc5, 0xc2, 0x05, 0xe4, 0xf5, - 0x18, 0x74, 0x40, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xff, 0xe5}}, - {0x0186, 64, { 0x18, 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, 0x79, 0x00, 0x24, 0x00, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, - 0x12, 0x0e, 0xe2, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x00, 0xe0, 0x60, 0x68, - 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x24, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x11, 0xc8, 0x7f, 0x03, 0x7d, - 0xcd, 0x12, 0x11, 0xc8, 0x43, 0x46, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0}}, - {0x01c6, 64, { 0x00, 0xe5, 0x46, 0xf0, 0xe4, 0x90, 0x7e, 0x13, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x01, 0xe0, 0xff, 0x12, - 0x10, 0x4c, 0x90, 0x7e, 0x02, 0xe0, 0xff, 0x12, 0x10, 0x72, 0x7f, 0x01, 0x90, 0x7e, 0x11, 0xe0, - 0xfd, 0x12, 0x11, 0xc8, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xc8, 0x43, 0x46, 0x80, 0x90, 0x7f, - 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12}}, - {0x0206, 64, { 0xf0, 0xe5, 0x40, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x03, 0xe0, 0x70, 0x06, 0x90, 0x7e, - 0x13, 0xe0, 0x70, 0x08, 0xe4, 0x90, 0x7e, 0x13, 0xf0, 0x75, 0x25, 0xff, 0x90, 0x7e, 0x05, 0xe0, - 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, 0xf5, 0x44, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, - 0x00, 0xe5, 0x44, 0xf0, 0x90, 0x7e, 0x07, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43}}, - {0x0246, 64, { 0x42, 0x80, 0x80, 0x03, 0x53, 0x42, 0x7f, 0x53, 0x42, 0xfc, 0x90, 0x7e, 0x09, 0xe0, 0x60, 0x11, 0x43, - 0x42, 0x02, 0xa3, 0xe0, 0xff, 0x12, 0x10, 0xbe, 0x90, 0x7e, 0x0b, 0xe0, 0xff, 0x12, 0x10, 0xe4, - 0xaf, 0x42, 0x12, 0x10, 0x98, 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x08, 0x53, 0x42, 0x7f, 0xaf, 0x42, - 0x12, 0x10, 0x98, 0x90, 0x7e, 0x0c, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46}}, - {0x0286, 64, { 0x02, 0x80, 0x03, 0x53, 0x46, 0xfd, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, - 0xf0, 0x90, 0x7e, 0x0e, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x01, 0x80, 0x03, - 0x53, 0x46, 0xfe, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, - 0x7e, 0x12, 0xe0, 0xf5, 0x3a, 0xa3, 0xe0, 0x13, 0x92, 0x0d, 0xa3, 0xe0, 0xf5, 0x3c, 0xa3}}, - {0x02c6, 64, { 0xe0, 0x60, 0x05, 0x43, 0x46, 0x10, 0x80, 0x03, 0x53, 0x46, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, - 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x16, 0xe0, 0x60, 0x32, 0x53, 0x44, 0xbf, 0x90, - 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, - 0x74, 0x11, 0xf0, 0x12, 0x13, 0x0f, 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3e}}, - {0x0306, 64, { 0xfd, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xc8, 0xe4, 0xf5, 0x2a, 0xf5, 0x29, 0xd2, 0x07, 0x90, 0x7e, - 0x17, 0xe0, 0x60, 0x0f, 0x43, 0x3e, 0x02, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xc8, 0x75, 0x29, - 0x01, 0xd2, 0x07, 0x90, 0x7e, 0x18, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, - 0x40, 0x44, 0x04, 0x90, 0xc0, 0x00, 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x19, 0xe0, 0x60, 0x11}}, - {0x0346, 64, { 0x43, 0x44, 0x40, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, - 0x90, 0x7e, 0x1a, 0xe0, 0x60, 0x0f, 0x53, 0x3e, 0xfe, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xc8, - 0x75, 0x2b, 0x01, 0xd2, 0x07, 0x90, 0x7e, 0x1b, 0xe0, 0x60, 0x0f, 0x43, 0x3e, 0x01, 0xe4, 0xff, - 0xad, 0x3e, 0x12, 0x11, 0xc8, 0xe4, 0xf5, 0x2b, 0xd2, 0x07, 0x90, 0x7e, 0x1c, 0xe0, 0x60}}, - {0x0386, 64, { 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, - 0x1d, 0xe0, 0x60, 0x02, 0xd2, 0x0b, 0x90, 0x7e, 0x1e, 0xe0, 0x60, 0x08, 0x75, 0x2c, 0x01, 0xe4, - 0xf5, 0x38, 0xd2, 0x07, 0x90, 0x7e, 0x1f, 0xe0, 0x60, 0x0f, 0x90, 0x7f, 0xd7, 0x74, 0x11, 0xf0, - 0x74, 0x31, 0xf0, 0x74, 0x15, 0xf0, 0x74, 0x35, 0xf0, 0xe4, 0x90, 0x7f, 0xcf, 0xf0, 0x30}}, - {0x03c6, 64, { 0x1a, 0x52, 0xe5, 0x38, 0x60, 0x02, 0x15, 0x38, 0x20, 0x13, 0x49, 0xe5, 0x13, 0xd3, 0x94, 0x00, 0x40, - 0x04, 0x15, 0x13, 0x80, 0x3e, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xd2, 0x13, 0x12, 0x13, 0x0f, - 0xef, 0x54, 0x01, 0xf5, 0x19, 0x65, 0x2a, 0x60, 0x05, 0x85, 0x19, 0x2a, 0xd2, 0x07, 0x12, 0x13, - 0x4b, 0xef, 0x54, 0x80, 0xf5, 0x19, 0x65, 0x26, 0x60, 0x05, 0x85, 0x19, 0x26, 0xd2, 0x07}}, - {0x0406, 64, { 0x30, 0x0d, 0x11, 0x12, 0x13, 0x4b, 0xef, 0x54, 0x10, 0xf5, 0x19, 0x65, 0x25, 0x60, 0x05, 0x85, 0x19, - 0x25, 0xd2, 0x07, 0x20, 0x1b, 0x03, 0x02, 0x07, 0xf4, 0x30, 0x0a, 0x18, 0x12, 0x13, 0x87, 0xef, - 0xc3, 0x95, 0x3d, 0x40, 0x03, 0x02, 0x04, 0xb2, 0x90, 0x7f, 0xc1, 0x74, 0x01, 0xf0, 0xc2, 0x0a, - 0xc2, 0x00, 0x80, 0x77, 0x30, 0x04, 0x3b, 0x90, 0x7f, 0xca, 0xe0, 0x20, 0xe1, 0x6d, 0x12}}, - {0x0446, 64, { 0x13, 0x87, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7d, 0x40, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, - 0xcb, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7d, 0x7f, 0x41, - 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x41, 0x12, 0x0d, 0x14, 0xc2, 0x04, 0xe4, 0x90, 0x7f, 0xcb, 0xf0, - 0x80, 0x39, 0x90, 0x7f, 0xcc, 0xe0, 0x20, 0xe1, 0x32, 0x12, 0x13, 0x87, 0xef, 0xc3, 0x94}}, - {0x0486, 64, { 0x40, 0x50, 0x29, 0x90, 0x7c, 0xc0, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, 0xcd, 0xe0, 0x14, 0xf5, 0x19, - 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7c, 0x7f, 0xc1, 0x75, 0x0c, 0x7c, 0x75, 0x0d, - 0xc1, 0x12, 0x0d, 0x14, 0xd2, 0x04, 0xe4, 0x90, 0x7f, 0xcd, 0xf0, 0x90, 0x7f, 0xba, 0xe0, 0x30, - 0xe1, 0x03, 0x02, 0x05, 0x40, 0x53, 0x37, 0x80, 0x12, 0x13, 0x93, 0xef, 0x42, 0x37, 0x12}}, - {0x04c6, 64, { 0x12, 0x37, 0x8f, 0x19, 0xef, 0xc3, 0x95, 0x3b, 0x50, 0x0f, 0x12, 0x13, 0x6f, 0xef, 0x30, 0xe0, 0x08, - 0xe5, 0x37, 0x20, 0xe7, 0x03, 0x30, 0x0c, 0x61, 0xc2, 0x0c, 0xe5, 0x19, 0x70, 0x04, 0xf5, 0x37, - 0x80, 0x57, 0x12, 0x13, 0x93, 0xef, 0x42, 0x37, 0xe5, 0x37, 0x30, 0xe7, 0x26, 0xe5, 0x19, 0xd3, - 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, 0x7e, 0x7d, 0x7f, 0x80, 0x75}}, - {0x0506, 64, { 0x0c, 0x7d, 0x75, 0x0d, 0x80, 0xaf, 0x37, 0x12, 0x0f, 0x94, 0xe5, 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xbb, - 0xf0, 0x80, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, 0x19, 0x3f, 0x85, 0x19, 0x08, - 0xe4, 0x90, 0x7d, 0x80, 0xf0, 0x7e, 0x7d, 0x7f, 0x81, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x81, 0x12, - 0x0d, 0x39, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xbb, 0xf0, 0x90, 0x7f, 0xd0, 0xe0, 0x30, 0xe1}}, - {0x0546, 64, { 0x06, 0x20, 0x06, 0x03, 0x02, 0x07, 0x9f, 0xc2, 0x06, 0xe4, 0xf5, 0x18, 0x74, 0xc0, 0x25, 0x18, 0xf5, - 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, - 0x79, 0x20, 0x24, 0x20, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, 0x12, 0x0e, 0xe2, 0x05, 0x18, 0xe5, - 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x20, 0xe0, 0x60, 0x68, 0x90, 0x7e, 0x23, 0xe0, 0x60}}, - {0x0586, 64, { 0x24, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x12, 0x12, 0x7f, 0x03, 0x7d, 0xcd, 0x12, 0x12, 0x12, 0x43, 0x47, - 0x80, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0xe4, 0x90, 0x7e, - 0x33, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x21, 0xe0, 0xff, 0x12, 0x11, 0x30, 0x90, 0x7e, 0x22, 0xe0, - 0xff, 0x12, 0x11, 0x56, 0x7f, 0x01, 0x90, 0x7e, 0x31, 0xe0, 0xfd, 0x12, 0x12, 0x12, 0x7f}}, - {0x05c6, 64, { 0x03, 0x7d, 0x07, 0x12, 0x12, 0x12, 0x43, 0x47, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, - 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0xe5, 0x41, 0x44, 0x06, 0x90, 0xc0, - 0x00, 0xf0, 0x90, 0x7e, 0x23, 0xe0, 0x70, 0x06, 0x90, 0x7e, 0x33, 0xe0, 0x70, 0x08, 0xe4, 0x90, - 0x7e, 0x33, 0xf0, 0x75, 0x2e, 0xff, 0x90, 0x7e, 0x25, 0xe0, 0x60, 0x12, 0xa3, 0xe0, 0x54}}, - {0x0606, 64, { 0x3f, 0xf5, 0x45, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x45, 0xf0, 0x90, 0x7e, - 0x27, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x43, 0x80, 0x80, 0x03, 0x53, 0x43, 0x7f, - 0x53, 0x43, 0xfc, 0x90, 0x7e, 0x29, 0xe0, 0x60, 0x11, 0x43, 0x43, 0x02, 0xa3, 0xe0, 0xff, 0x12, - 0x11, 0x7c, 0x90, 0x7e, 0x2b, 0xe0, 0xff, 0x12, 0x11, 0xa2, 0xaf, 0x43, 0x12, 0x11, 0x0a}}, - {0x0646, 64, { 0x90, 0x7e, 0x23, 0xe0, 0x60, 0x08, 0x53, 0x43, 0x7f, 0xaf, 0x43, 0x12, 0x11, 0x0a, 0x90, 0x7e, 0x2c, - 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x02, 0x80, 0x03, 0x53, 0x47, 0xfd, 0x90, - 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7e, 0x2e, 0xe0, 0x60, - 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x01, 0x80, 0x03, 0x53, 0x47, 0xfe, 0x90, 0x7f}}, - {0x0686, 64, { 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7e, 0x32, 0xe0, 0xf5, 0x3b, 0xa3, - 0xe0, 0x13, 0x92, 0x0e, 0xa3, 0xe0, 0xf5, 0x3d, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x10, 0x80, - 0x03, 0x53, 0x47, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, - 0x90, 0x7e, 0x36, 0xe0, 0x60, 0x32, 0x53, 0x45, 0xbf, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0}}, - {0x06c6, 64, { 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x12, 0x13, 0x63, - 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3f, 0xfd, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, - 0x12, 0xe4, 0xf5, 0x33, 0xf5, 0x32, 0xd2, 0x08, 0x90, 0x7e, 0x37, 0xe0, 0x60, 0x0f, 0x43, 0x3f, - 0x02, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x12, 0x75, 0x32, 0x01, 0xd2, 0x08, 0x90, 0x7e}}, - {0x0706, 64, { 0x38, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0xe5, 0x41, 0x44, 0x04, 0x90, 0xc0, 0x00, - 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x39, 0xe0, 0x60, 0x11, 0x43, 0x45, 0x40, 0x90, 0x7f, 0x98, 0x74, - 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x3a, 0xe0, 0x60, 0x0f, - 0x53, 0x3f, 0xfe, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x12, 0x75, 0x34, 0x01, 0xd2, 0x08}}, - {0x0746, 64, { 0x90, 0x7e, 0x3b, 0xe0, 0x60, 0x0f, 0x43, 0x3f, 0x01, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x12, 0xe4, - 0xf5, 0x34, 0xd2, 0x08, 0x90, 0x7e, 0x3c, 0xe0, 0x60, 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, - 0xe5, 0x41, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x3d, 0xe0, 0x60, 0x02, 0xd2, 0x0c, - 0x90, 0x7e, 0x3e, 0xe0, 0x60, 0x08, 0x75, 0x35, 0x01, 0xe4, 0xf5, 0x39, 0xd2, 0x08, 0x90}}, - {0x0786, 64, { 0x7e, 0x3f, 0xe0, 0x60, 0x0f, 0x90, 0x7f, 0xd7, 0x74, 0x13, 0xf0, 0x74, 0x33, 0xf0, 0x74, 0x16, 0xf0, - 0x74, 0x36, 0xf0, 0xe4, 0x90, 0x7f, 0xd1, 0xf0, 0x30, 0x1a, 0x52, 0xe5, 0x39, 0x60, 0x02, 0x15, - 0x39, 0x30, 0x13, 0x49, 0xe5, 0x13, 0xd3, 0x94, 0x00, 0x40, 0x04, 0x15, 0x13, 0x80, 0x3e, 0x75, - 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xc2, 0x13, 0x12, 0x13, 0x63, 0xef, 0x54, 0x01, 0xf5, 0x19}}, - {0x07c6, 64, { 0x65, 0x33, 0x60, 0x05, 0x85, 0x19, 0x33, 0xd2, 0x08, 0x12, 0x13, 0x9f, 0xef, 0x54, 0x80, 0xf5, 0x19, - 0x65, 0x2f, 0x60, 0x05, 0x85, 0x19, 0x2f, 0xd2, 0x08, 0x30, 0x0e, 0x11, 0x12, 0x13, 0x9f, 0xef, - 0x54, 0x10, 0xf5, 0x19, 0x65, 0x2e, 0x60, 0x05, 0x85, 0x19, 0x2e, 0xd2, 0x08, 0x30, 0x1a, 0x2a, - 0x90, 0x7f, 0xd2, 0xe0, 0x20, 0xe1, 0x23, 0x90, 0x7b, 0x40, 0xe0, 0x60, 0x09, 0xe0, 0xf5}}, - {0x0806, 64, { 0x15, 0x90, 0x7b, 0x42, 0xe0, 0xf5, 0x16, 0x90, 0x7b, 0x41, 0xe0, 0x60, 0x09, 0x90, 0x7f, 0xd7, 0x74, - 0x17, 0xf0, 0x74, 0x37, 0xf0, 0xe4, 0x90, 0x7f, 0xd3, 0xf0, 0x90, 0x7f, 0xc2, 0xe0, 0x30, 0xe1, - 0x03, 0x02, 0x09, 0x28, 0xe5, 0x0a, 0x70, 0x40, 0x30, 0x07, 0x39, 0xe5, 0x38, 0x70, 0x35, 0xc2, - 0x07, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00}}, - {0x0846, 64, { 0xfa, 0x12, 0x0e, 0x9c, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, - 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x38, - 0x10, 0xe4, 0xf5, 0x2c, 0x75, 0x0a, 0x01, 0x22, 0xe5, 0x0a, 0x64, 0x01, 0x70, 0x40, 0x30, 0x08, - 0x39, 0xe5, 0x39, 0x70, 0x35, 0xc2, 0x08, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x2d}}, - {0x0886, 64, { 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x9c, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, - 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, 0x90, 0x7f, - 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x39, 0x10, 0xe4, 0xf5, 0x35, 0x75, 0x0a, 0x02, 0x22, 0xe5, 0x0a, - 0x64, 0x02, 0x70, 0x36, 0x30, 0x14, 0x2f, 0xc2, 0x14, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00}}, - {0x08c6, 64, { 0x74, 0x0e, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x9c, 0xff, 0x74, 0x80, 0x25, 0x18, - 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x05, 0xdb, - 0x90, 0x7f, 0xc3, 0x74, 0x05, 0xf0, 0x75, 0x0a, 0x03, 0x22, 0xe5, 0x15, 0x60, 0x30, 0x15, 0x15, - 0xe4, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x14, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00}}, - {0x0906, 64, { 0xfa, 0x12, 0x0e, 0x9c, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, - 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x03, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, 0xf5, - 0x0a, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x0e, 0xf4, 0x0a, 0x10, 0x00, 0x0a, 0x84, 0x01, 0x0a, - 0xf0, 0x03, 0x09, 0x4c, 0x06, 0x0a, 0x03, 0x08, 0x09, 0xfd, 0x09, 0x09, 0xe5, 0x0a, 0x09}}, - {0x0946, 64, { 0xf4, 0x0b, 0x00, 0x00, 0x0b, 0x3f, 0x90, 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x19, 0x14, 0x60, 0x61, - 0x24, 0x02, 0x60, 0x03, 0x02, 0x09, 0xdb, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x00, 0x90, - 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x04, 0x7f, 0x02, 0x80, 0x02, - 0x7f, 0x03, 0x75, 0x82, 0x82, 0x75, 0x83, 0x19, 0xef, 0xf0, 0x75, 0x82, 0x7b, 0x75, 0x83}}, - {0x0986, 64, { 0x19, 0xf0, 0x75, 0x82, 0x74, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x66, 0x75, 0x83, 0x19, 0xf0, 0x75, - 0x82, 0x58, 0x75, 0x83, 0x19, 0xf0, 0x90, 0x7f, 0xea, 0xe0, 0x04, 0x75, 0x82, 0x17, 0x75, 0x83, - 0x19, 0xf0, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x12, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, - 0x46, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x0f, 0x1a, 0xea, 0x49, 0x60, 0x0d, 0xea, 0x90}}, - {0x09c6, 64, { 0x7f, 0xd4, 0xf0, 0xe9, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, - 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, - 0x00, 0xe5, 0x09, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xea, - 0xe0, 0xf5, 0x09, 0x02, 0x0b, 0x46, 0x12, 0x0b, 0x4e, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0x00}}, - {0x0a06, 64, { 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xb5, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60, - 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, 0xa2, 0x10, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, - 0xa2, 0x16, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, - 0x02, 0xf0, 0x02, 0x0b, 0x46, 0xe4, 0x90, 0x7f, 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5}}, - {0x0a46, 64, { 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, - 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, - 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, - 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f}}, - {0x0a86, 64, { 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24, 0x02, 0x60, 0x03, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xea, 0xe0, - 0xb4, 0x01, 0x05, 0xc2, 0x10, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, - 0x0b, 0x46, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x38, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, - 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4}}, - {0x0ac6, 64, { 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f, 0xec, 0xe0, 0x54, 0x80, 0xff, 0x13, 0x13, 0x13, 0x54, - 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f, 0xd7, 0xf0, 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x5f, - 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x56, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, - 0x18, 0x24, 0x02, 0x70, 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x04, 0xd2, 0x10, 0x80}}, - {0x0b06, 64, { 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, - 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, - 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, - 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0}}, - {0x0b46, 64, { 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, - 0x30, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0, 0x90, 0x7f, 0x95, 0x74, 0xc0, 0xf0, 0x90, 0x7f, 0x9e, - 0x74, 0x3f, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x18, 0xf0, 0xe4, 0xf5, 0x8e, 0x90, 0x7f, 0xdf, 0x74, - 0xff, 0xf0, 0x90, 0x7f, 0xde, 0xf0, 0xe4, 0xf5, 0x24, 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74}}, - {0x0b86, 64, { 0x24, 0x25, 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa, 0xe4, 0x12, 0x0e, 0xe2, 0x05, 0x18, 0xe5, 0x18, 0xb4, - 0x09, 0xea, 0x75, 0x3a, 0x01, 0xe4, 0xf5, 0x38, 0xf5, 0x13, 0xf5, 0x36, 0xc2, 0x07, 0xc2, 0x0b, - 0xc2, 0x05, 0xc2, 0x00, 0xc2, 0x09, 0xc2, 0x13, 0xd2, 0x03, 0xd2, 0x01, 0x90, 0x7f, 0x98, 0x74, - 0x13, 0xf0, 0x75, 0x44, 0x03, 0x90, 0xc0, 0x00, 0x74, 0x03, 0xf0, 0x7f, 0x0c, 0xe4, 0xfd}}, - {0x0bc6, 64, { 0x12, 0x11, 0xc8, 0x7f, 0x10, 0x8f, 0x42, 0x12, 0x10, 0x98, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x7f, - 0x01, 0x8f, 0x40, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, - 0x75, 0x46, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, 0x11, 0xc8, 0xe4, - 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3e, 0x12, 0x11, 0xc8, 0x90, 0x7f, 0x98, 0x74, 0x11}}, - {0x0c06, 64, { 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x11, 0xc8, 0x7f, 0x01, 0x12, 0x12, - 0x81, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xc8, 0x20, 0x1b, 0x03, 0x02, 0x0c, 0xc7, 0x75, 0x2d, - 0x01, 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74, 0x2d, 0x25, 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa, 0xe4, - 0x12, 0x0e, 0xe2, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xea, 0x75, 0x3b, 0x01, 0xe4, 0xf5}}, - {0x0c46, 64, { 0x39, 0xf5, 0x13, 0xf5, 0x37, 0xc2, 0x08, 0xc2, 0x0c, 0xc2, 0x06, 0xc2, 0x00, 0xc2, 0x0a, 0xc2, 0x13, - 0xd2, 0x04, 0xd2, 0x02, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x75, 0x45, 0x03, 0x90, 0xc0, 0x00, - 0x74, 0x03, 0xf0, 0x7f, 0x0c, 0xe4, 0xfd, 0x12, 0x12, 0x12, 0x7f, 0x10, 0x8f, 0x43, 0x12, 0x11, - 0x0a, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x7f, 0x01, 0x8f, 0x41, 0xef, 0x44, 0x06, 0x90}}, - {0x0c86, 64, { 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x75, 0x47, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, - 0xf0, 0x0f, 0xe4, 0xfd, 0x12, 0x12, 0x12, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3f, 0x12, - 0x12, 0x12, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, - 0x7f, 0x12, 0x12, 0x12, 0x7f, 0x01, 0x12, 0x12, 0xa2, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x12}}, - {0x0cc6, 64, { 0x12, 0xd2, 0x12, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, - 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, + {0x0000, 3, { 0x02, 0x0e, 0x00}}, + {0x0106, 64, { 0x60, 0x58, 0xb4, 0x80, 0x03, 0x43, 0x36, 0x02, 0xe5, 0x36, 0x30, 0xe7, 0x26, 0xe5, 0x19, 0xd3, 0x94, + 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, 0x7e, 0x7e, 0x7f, 0x80, 0x75, 0x0c, 0x7e, + 0x75, 0x0d, 0x80, 0xaf, 0x36, 0x12, 0x0f, 0x4b, 0xe5, 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xb7, 0xf0, + 0x80, 0x27, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, 0x19, 0x3f, 0x85, 0x19, 0x08}}, + {0x0146, 64, { 0x90, 0x7e, 0x80, 0xe5, 0x36, 0xf0, 0x7e, 0x7e, 0x7f, 0x81, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x81, 0x12, + 0x0c, 0xdf, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xb7, 0xf0, 0x90, 0x7f, 0xce, 0xe0, 0x30, 0xe1, 0x06, + 0x20, 0x05, 0x03, 0x02, 0x03, 0xc1, 0xc2, 0x05, 0xe4, 0xf5, 0x18, 0x74, 0x40, 0x25, 0x18, 0xf5, + 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, 0x7c, 0x00, 0x7b, 0x01, 0x7a}}, + {0x0186, 64, { 0x7e, 0x79, 0x00, 0x24, 0x00, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, 0x12, 0x0e, 0xd2, 0x05, 0x18, 0xe5, + 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x00, 0xe0, 0x60, 0x68, 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x24, + 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x11, 0xb1, 0x7f, 0x03, 0x7d, 0xcd, 0x12, 0x11, 0xb1, 0x43, 0x46, + 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0xe4, 0x90}}, + {0x01c6, 64, { 0x7e, 0x13, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x01, 0xe0, 0xff, 0x12, 0x10, 0x35, 0x90, 0x7e, 0x02, 0xe0, + 0xff, 0x12, 0x10, 0x5b, 0x7f, 0x01, 0x90, 0x7e, 0x11, 0xe0, 0xfd, 0x12, 0x11, 0xb1, 0x7f, 0x03, + 0x7d, 0x07, 0x12, 0x11, 0xb1, 0x43, 0x46, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, + 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, 0x06, 0x90}}, + {0x0206, 64, { 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x03, 0xe0, 0x70, 0x06, 0x90, 0x7e, 0x13, 0xe0, 0x70, 0x08, 0xe4, 0x90, + 0x7e, 0x13, 0xf0, 0x75, 0x25, 0xff, 0x90, 0x7e, 0x05, 0xe0, 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, + 0xf5, 0x44, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x44, 0xf0, 0x90, 0x7e, + 0x07, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x42, 0x80, 0x80, 0x03, 0x53, 0x42}}, + {0x0246, 64, { 0x7f, 0x53, 0x42, 0xfc, 0x90, 0x7e, 0x09, 0xe0, 0x60, 0x11, 0x43, 0x42, 0x02, 0xa3, 0xe0, 0xff, 0x12, + 0x10, 0xa7, 0x90, 0x7e, 0x0b, 0xe0, 0xff, 0x12, 0x10, 0xcd, 0xaf, 0x42, 0x12, 0x10, 0x81, 0x90, + 0x7e, 0x03, 0xe0, 0x60, 0x08, 0x53, 0x42, 0x7f, 0xaf, 0x42, 0x12, 0x10, 0x81, 0x90, 0x7e, 0x0c, + 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x02, 0x80, 0x03, 0x53, 0x46, 0xfd}}, + {0x0286, 64, { 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x0e, 0xe0, 0x60, + 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x01, 0x80, 0x03, 0x53, 0x46, 0xfe, 0x90, 0x7f, 0x98, + 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x12, 0xe0, 0xf5, 0x3a, 0xa3, + 0xe0, 0x13, 0x92, 0x0d, 0xa3, 0xe0, 0xf5, 0x3c, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x10}}, + {0x02c6, 64, { 0x80, 0x03, 0x53, 0x46, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, + 0x90, 0x7e, 0x16, 0xe0, 0x60, 0x32, 0x53, 0x44, 0xbf, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, + 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x12, 0x12, 0xdf, + 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3e, 0xfd, 0xe4, 0xff, 0xad, 0x3e, 0x12}}, + {0x0306, 64, { 0x11, 0xb1, 0xe4, 0xf5, 0x2a, 0xf5, 0x29, 0xd2, 0x07, 0x90, 0x7e, 0x17, 0xe0, 0x60, 0x0f, 0x43, 0x3e, + 0x02, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xb1, 0x75, 0x29, 0x01, 0xd2, 0x07, 0x90, 0x7e, 0x18, + 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, 0x04, 0x90, 0xc0, 0x00, + 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x19, 0xe0, 0x60, 0x11, 0x43, 0x44, 0x40, 0x90, 0x7f, 0x98}}, + {0x0346, 64, { 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x1a, 0xe0, 0x60, 0x0f, + 0x53, 0x3e, 0xfe, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xb1, 0x75, 0x2b, 0x01, 0xd2, 0x07, 0x90, + 0x7e, 0x1b, 0xe0, 0x60, 0x0f, 0x43, 0x3e, 0x01, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xb1, 0xe4, + 0xf5, 0x2b, 0xd2, 0x07, 0x90, 0x7e, 0x1c, 0xe0, 0x60, 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x12}}, + {0x0386, 64, { 0xf0, 0xe5, 0x40, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x1d, 0xe0, 0x60, 0x02, 0xd2, 0x0b, + 0x90, 0x7e, 0x1e, 0xe0, 0x60, 0x08, 0x75, 0x2c, 0x01, 0xe4, 0xf5, 0x38, 0xd2, 0x07, 0x90, 0x7e, + 0x1f, 0xe0, 0x60, 0x11, 0x90, 0x7f, 0xd7, 0x74, 0x11, 0xf0, 0x74, 0x31, 0xf0, 0x74, 0x15, 0xf0, + 0x74, 0x35, 0xf0, 0xd2, 0x03, 0xe4, 0x90, 0x7f, 0xcf, 0xf0, 0x30, 0x1a, 0x52, 0xe5, 0x38}}, + {0x03c6, 64, { 0x60, 0x02, 0x15, 0x38, 0x20, 0x13, 0x49, 0xe5, 0x13, 0xd3, 0x94, 0x00, 0x40, 0x04, 0x15, 0x13, 0x80, + 0x3e, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xd2, 0x13, 0x12, 0x12, 0xdf, 0xef, 0x54, 0x01, 0xf5, + 0x19, 0x65, 0x2a, 0x60, 0x05, 0x85, 0x19, 0x2a, 0xd2, 0x07, 0x12, 0x13, 0x33, 0xef, 0x54, 0x80, + 0xf5, 0x19, 0x65, 0x26, 0x60, 0x05, 0x85, 0x19, 0x26, 0xd2, 0x07, 0x30, 0x0d, 0x11, 0x12}}, + {0x0406, 64, { 0x13, 0x33, 0xef, 0x54, 0x10, 0xf5, 0x19, 0x65, 0x25, 0x60, 0x05, 0x85, 0x19, 0x25, 0xd2, 0x07, 0x20, + 0x1b, 0x03, 0x02, 0x07, 0xec, 0x30, 0x0a, 0x18, 0x12, 0x13, 0x6f, 0xef, 0xc3, 0x95, 0x3d, 0x40, + 0x03, 0x02, 0x04, 0xae, 0x90, 0x7f, 0xc1, 0x74, 0x01, 0xf0, 0xc2, 0x0a, 0xc2, 0x00, 0x80, 0x77, + 0x30, 0x04, 0x3b, 0x90, 0x7f, 0xca, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x13, 0x6f, 0xef, 0xc3}}, + {0x0446, 64, { 0x94, 0x40, 0x50, 0x64, 0x90, 0x7d, 0x40, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, 0xcb, 0xe0, 0x14, 0xf5, + 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7d, 0x7f, 0x41, 0x75, 0x0c, 0x7d, 0x75, + 0x0d, 0x41, 0x12, 0x0d, 0x04, 0xc2, 0x04, 0xe4, 0x90, 0x7f, 0xcb, 0xf0, 0x80, 0x39, 0x90, 0x7f, + 0xcc, 0xe0, 0x20, 0xe1, 0x32, 0x12, 0x13, 0x6f, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90}}, + {0x0486, 64, { 0x7c, 0xc0, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, 0xcd, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, + 0x0f, 0xf5, 0x08, 0x7e, 0x7c, 0x7f, 0xc1, 0x75, 0x0c, 0x7c, 0x75, 0x0d, 0xc1, 0x12, 0x0d, 0x04, + 0xd2, 0x04, 0xe4, 0x90, 0x7f, 0xcd, 0xf0, 0x90, 0x7f, 0xba, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x05, + 0x36, 0x12, 0x12, 0x20, 0x8f, 0x19, 0x12, 0x13, 0x7b, 0x8f, 0x37, 0xe5, 0x19, 0xc3, 0x95}}, + {0x04c6, 64, { 0x3b, 0x50, 0x0f, 0x12, 0x13, 0x57, 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x37, 0x20, 0xe7, 0x03, 0x30, 0x0c, + 0x5e, 0xc2, 0x0c, 0xe5, 0x19, 0x60, 0x58, 0xb4, 0x80, 0x03, 0x43, 0x37, 0x02, 0xe5, 0x37, 0x30, + 0xe7, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, 0x7e, + 0x7d, 0x7f, 0x80, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x80, 0xaf, 0x37, 0x12, 0x0f, 0x84, 0xe5}}, + {0x0506, 64, { 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xbb, 0xf0, 0x80, 0x27, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, + 0x19, 0x3f, 0x85, 0x19, 0x08, 0x90, 0x7d, 0x80, 0xe5, 0x37, 0xf0, 0x7e, 0x7d, 0x7f, 0x81, 0x75, + 0x0c, 0x7d, 0x75, 0x0d, 0x81, 0x12, 0x0d, 0x29, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xbb, 0xf0, 0x90, + 0x7f, 0xd0, 0xe0, 0x30, 0xe1, 0x06, 0x20, 0x06, 0x03, 0x02, 0x07, 0x97, 0xc2, 0x06, 0xe4}}, + {0x0546, 64, { 0xf5, 0x18, 0x74, 0xc0, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, + 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, 0x79, 0x20, 0x24, 0x20, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, + 0x12, 0x0e, 0xd2, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x20, 0xe0, 0x60, 0x68, + 0x90, 0x7e, 0x23, 0xe0, 0x60, 0x24, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x11, 0xfb, 0x7f, 0x03}}, + {0x0586, 64, { 0x7d, 0xcd, 0x12, 0x11, 0xfb, 0x43, 0x47, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, + 0xe5, 0x47, 0xf0, 0xe4, 0x90, 0x7e, 0x33, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x21, 0xe0, 0xff, 0x12, + 0x11, 0x19, 0x90, 0x7e, 0x22, 0xe0, 0xff, 0x12, 0x11, 0x3f, 0x7f, 0x01, 0x90, 0x7e, 0x31, 0xe0, + 0xfd, 0x12, 0x11, 0xfb, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xfb, 0x43, 0x47, 0x80, 0x90}}, + {0x05c6, 64, { 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, + 0xe5, 0x41, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x23, 0xe0, 0x70, 0x06, 0x90, 0x7e, + 0x33, 0xe0, 0x70, 0x08, 0xe4, 0x90, 0x7e, 0x33, 0xf0, 0x75, 0x2e, 0xff, 0x90, 0x7e, 0x25, 0xe0, + 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, 0xf5, 0x45, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90}}, + {0x0606, 64, { 0xc0, 0x00, 0xe5, 0x45, 0xf0, 0x90, 0x7e, 0x27, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x43, + 0x80, 0x80, 0x03, 0x53, 0x43, 0x7f, 0x53, 0x43, 0xfc, 0x90, 0x7e, 0x29, 0xe0, 0x60, 0x11, 0x43, + 0x43, 0x02, 0xa3, 0xe0, 0xff, 0x12, 0x11, 0x65, 0x90, 0x7e, 0x2b, 0xe0, 0xff, 0x12, 0x11, 0x8b, + 0xaf, 0x43, 0x12, 0x10, 0xf3, 0x90, 0x7e, 0x23, 0xe0, 0x60, 0x08, 0x53, 0x43, 0x7f, 0xaf}}, + {0x0646, 64, { 0x43, 0x12, 0x10, 0xf3, 0x90, 0x7e, 0x2c, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x02, + 0x80, 0x03, 0x53, 0x47, 0xfd, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, + 0xf0, 0x90, 0x7e, 0x2e, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x01, 0x80, 0x03, + 0x53, 0x47, 0xfe, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0}}, + {0x0686, 64, { 0x90, 0x7e, 0x32, 0xe0, 0xf5, 0x3b, 0xa3, 0xe0, 0x13, 0x92, 0x0e, 0xa3, 0xe0, 0xf5, 0x3d, 0xa3, 0xe0, + 0x60, 0x05, 0x43, 0x47, 0x10, 0x80, 0x03, 0x53, 0x47, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, + 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7e, 0x36, 0xe0, 0x60, 0x32, 0x53, 0x45, 0xbf, 0x90, + 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f}}, + {0x06c6, 64, { 0x98, 0x74, 0x09, 0xf0, 0x12, 0x13, 0x4b, 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3f, 0xfd, + 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x11, 0xfb, 0xe4, 0xf5, 0x33, 0xf5, 0x32, 0xd2, 0x08, 0x90, 0x7e, + 0x37, 0xe0, 0x60, 0x0f, 0x43, 0x3f, 0x02, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x11, 0xfb, 0x75, 0x32, + 0x01, 0xd2, 0x08, 0x90, 0x7e, 0x38, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0}}, + {0x0706, 64, { 0xe5, 0x41, 0x44, 0x04, 0x90, 0xc0, 0x00, 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x39, 0xe0, 0x60, 0x11, 0x43, + 0x45, 0x40, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, + 0x90, 0x7e, 0x3a, 0xe0, 0x60, 0x0f, 0x53, 0x3f, 0xfe, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x11, 0xfb, + 0x75, 0x34, 0x01, 0xd2, 0x08, 0x90, 0x7e, 0x3b, 0xe0, 0x60, 0x0f, 0x43, 0x3f, 0x01, 0xe4}}, + {0x0746, 64, { 0xff, 0xad, 0x3f, 0x12, 0x11, 0xfb, 0xe4, 0xf5, 0x34, 0xd2, 0x08, 0x90, 0x7e, 0x3c, 0xe0, 0x60, 0x0e, + 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0xe5, 0x41, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, + 0x3d, 0xe0, 0x60, 0x02, 0xd2, 0x0c, 0x90, 0x7e, 0x3e, 0xe0, 0x60, 0x08, 0x75, 0x35, 0x01, 0xe4, + 0xf5, 0x39, 0xd2, 0x08, 0x90, 0x7e, 0x3f, 0xe0, 0x60, 0x11, 0x90, 0x7f, 0xd7, 0x74, 0x13}}, + {0x0786, 64, { 0xf0, 0x74, 0x33, 0xf0, 0x74, 0x16, 0xf0, 0x74, 0x36, 0xf0, 0xd2, 0x04, 0xe4, 0x90, 0x7f, 0xd1, 0xf0, + 0x30, 0x1a, 0x52, 0xe5, 0x39, 0x60, 0x02, 0x15, 0x39, 0x30, 0x13, 0x49, 0xe5, 0x13, 0xd3, 0x94, + 0x00, 0x40, 0x04, 0x15, 0x13, 0x80, 0x3e, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xc2, 0x13, 0x12, + 0x13, 0x4b, 0xef, 0x54, 0x01, 0xf5, 0x19, 0x65, 0x33, 0x60, 0x05, 0x85, 0x19, 0x33, 0xd2}}, + {0x07c6, 64, { 0x08, 0x12, 0x13, 0x87, 0xef, 0x54, 0x80, 0xf5, 0x19, 0x65, 0x2f, 0x60, 0x05, 0x85, 0x19, 0x2f, 0xd2, + 0x08, 0x30, 0x0e, 0x11, 0x12, 0x13, 0x87, 0xef, 0x54, 0x10, 0xf5, 0x19, 0x65, 0x2e, 0x60, 0x05, + 0x85, 0x19, 0x2e, 0xd2, 0x08, 0x30, 0x1a, 0x2a, 0x90, 0x7f, 0xd2, 0xe0, 0x20, 0xe1, 0x23, 0x90, + 0x7b, 0x40, 0xe0, 0x60, 0x09, 0xe0, 0xf5, 0x15, 0x90, 0x7b, 0x42, 0xe0, 0xf5, 0x16, 0x90}}, + {0x0806, 64, { 0x7b, 0x41, 0xe0, 0x60, 0x09, 0x90, 0x7f, 0xd7, 0x74, 0x17, 0xf0, 0x74, 0x37, 0xf0, 0xe4, 0x90, 0x7f, + 0xd3, 0xf0, 0x90, 0x7f, 0xc2, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x09, 0x20, 0xe5, 0x0a, 0x70, 0x40, + 0x30, 0x07, 0x39, 0xe5, 0x38, 0x70, 0x35, 0xc2, 0x07, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, + 0x24, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x8c, 0xff, 0x74, 0x80, 0x25}}, + {0x0846, 64, { 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, + 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x38, 0x10, 0xe4, 0xf5, 0x2c, 0x75, 0x0a, 0x01, 0x22, + 0xe5, 0x0a, 0x64, 0x01, 0x70, 0x40, 0x30, 0x08, 0x39, 0xe5, 0x39, 0x70, 0x35, 0xc2, 0x08, 0xf5, + 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x2d, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12}}, + {0x0886, 64, { 0x0e, 0x8c, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, + 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x39, 0x10, 0xe4, + 0xf5, 0x35, 0x75, 0x0a, 0x02, 0x22, 0xe5, 0x0a, 0x64, 0x02, 0x70, 0x36, 0x30, 0x14, 0x2f, 0xc2, + 0x14, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x0e, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00}}, + {0x08c6, 64, { 0xfa, 0x12, 0x0e, 0x8c, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, + 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x05, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x05, 0xf0, 0x75, 0x0a, + 0x03, 0x22, 0xe5, 0x15, 0x60, 0x30, 0x15, 0x15, 0xe4, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, + 0x14, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x8c, 0xff, 0x74, 0x80, 0x25}}, + {0x0906, 64, { 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x03, 0xdb, + 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, 0xf5, 0x0a, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x0e, + 0xe4, 0x0a, 0x08, 0x00, 0x0a, 0x7c, 0x01, 0x0a, 0xe8, 0x03, 0x09, 0x44, 0x06, 0x09, 0xfb, 0x08, + 0x09, 0xf5, 0x09, 0x09, 0xdd, 0x0a, 0x09, 0xec, 0x0b, 0x00, 0x00, 0x0b, 0x37, 0x90, 0x7f}}, + {0x0946, 64, { 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x19, 0x14, 0x60, 0x61, 0x24, 0x02, 0x60, 0x03, 0x02, 0x09, 0xd3, 0x74, + 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x00, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, + 0xea, 0xe0, 0x70, 0x04, 0x7f, 0x02, 0x80, 0x02, 0x7f, 0x03, 0x75, 0x82, 0x82, 0x75, 0x83, 0x19, + 0xef, 0xf0, 0x75, 0x82, 0x7b, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x74, 0x75, 0x83, 0x19}}, + {0x0986, 64, { 0xf0, 0x75, 0x82, 0x66, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x58, 0x75, 0x83, 0x19, 0xf0, 0x90, 0x7f, + 0xea, 0xe0, 0x04, 0x75, 0x82, 0x17, 0x75, 0x83, 0x19, 0xf0, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, + 0x74, 0x12, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x0f, + 0x0a, 0xea, 0x49, 0x60, 0x0d, 0xea, 0x90, 0x7f, 0xd4, 0xf0, 0xe9, 0x90, 0x7f, 0xd5, 0xf0}}, + {0x09c6, 64, { 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xb4, 0xe0, + 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0x00, 0xe5, 0x09, 0xf0, 0x90, 0x7f, 0xb5, 0x74, + 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x09, 0x02, 0x0b, 0x3e, 0x12, 0x0b, + 0x46, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0x00, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xb5, 0xf0, 0x02}}, + {0x0a06, 64, { 0x0b, 0x3e, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60, 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, + 0xa2, 0x10, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, 0xa2, 0x16, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, + 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x3e, 0xe4, 0x90, 0x7f, + 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f}}, + {0x0a46, 64, { 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, + 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, + 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xb4, 0xe0, 0x44, + 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24, 0x02}}, + {0x0a86, 64, { 0x60, 0x03, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x05, 0xc2, 0x10, 0x02, 0x0b, 0x3e, + 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x38, + 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, + 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f}}, + {0x0ac6, 64, { 0xec, 0xe0, 0x54, 0x80, 0xff, 0x13, 0x13, 0x13, 0x54, 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f, + 0xd7, 0xf0, 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x5f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, + 0x56, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x18, 0x24, 0x02, 0x70, 0x4a, 0x90, 0x7f, 0xea, + 0xe0, 0xb4, 0x01, 0x04, 0xd2, 0x10, 0x80, 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0}}, + {0x0b06, 64, { 0x80, 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, + 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, + 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, + 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0, 0x22}}, + {0x0b46, 64, { 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0, 0x90, + 0x7f, 0x95, 0x74, 0xc0, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x3f, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x18, + 0xf0, 0xe4, 0xf5, 0x8e, 0x90, 0x7f, 0xdf, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xde, 0xf0, 0xe4, 0xf5, + 0x24, 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa}}, + {0x0b86, 64, { 0xe4, 0x12, 0x0e, 0xd2, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xea, 0x75, 0x3a, 0x01, 0xe4, 0xf5, 0x38, + 0xf5, 0x13, 0xf5, 0x36, 0xc2, 0x07, 0xc2, 0x0b, 0xc2, 0x05, 0xc2, 0x00, 0xc2, 0x09, 0xc2, 0x13, + 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x75, 0x44, 0x03, 0x90, 0xc0, 0x00, 0x74, 0x03, 0xf0, 0x7f, + 0x0c, 0xe4, 0xfd, 0x12, 0x11, 0xb1, 0x7f, 0x10, 0x8f, 0x42, 0x12, 0x10, 0x81, 0x90, 0x7f}}, + {0x0bc6, 64, { 0x98, 0x74, 0x12, 0xf0, 0x7f, 0x01, 0x8f, 0x40, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x14, 0xf0, 0x75, 0x46, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0x0f, 0xe4, 0xfd, + 0x12, 0x11, 0xb1, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3e, 0x12, 0x11, 0xb1, 0x90, 0x7f, + 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x11}}, + {0x0c06, 64, { 0xb1, 0x7f, 0x01, 0x12, 0x12, 0x6a, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xb1, 0x20, 0x1b, 0x03, 0x02, + 0x0c, 0xb7, 0x75, 0x2d, 0x01, 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74, 0x2d, 0x25, 0x18, 0xf9, 0xe4, + 0x34, 0x00, 0xfa, 0xe4, 0x12, 0x0e, 0xd2, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xea, 0x75, 0x3b, + 0x01, 0xe4, 0xf5, 0x39, 0xf5, 0x13, 0xf5, 0x37, 0xc2, 0x08, 0xc2, 0x0c, 0xc2, 0x06, 0xc2}}, + {0x0c46, 64, { 0x00, 0xc2, 0x0a, 0xc2, 0x13, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x75, 0x45, 0x03, 0x90, 0xc0, 0x00, + 0x74, 0x03, 0xf0, 0x7f, 0x0c, 0xe4, 0xfd, 0x12, 0x11, 0xfb, 0x7f, 0x10, 0x8f, 0x43, 0x12, 0x10, + 0xf3, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x7f, 0x01, 0x8f, 0x41, 0xef, 0x44, 0x06, 0x90, 0xc0, + 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x75, 0x47, 0x80, 0x90, 0xc0, 0x00, 0x74}}, + {0x0c86, 64, { 0x80, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, 0x11, 0xfb, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3f, 0x12, + 0x11, 0xfb, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, + 0x7f, 0x12, 0x11, 0xfb, 0x7f, 0x01, 0x12, 0x12, 0x8b, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xfb, + 0xd2, 0x12, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82}}, + {0x0cc6, 64, { 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x08, - 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00}}, - {0x0d06, 64, { 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, - 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, + 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, + 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x90, 0x7f}}, + {0x0d06, 64, { 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, - 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5}}, - {0x0d46, 64, { 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, - 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, + 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, + 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05}}, + {0x0d46, 64, { 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, - 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd2, 0x19, 0x90, 0x7f, 0x92, 0xe0, 0x44}}, - {0x0d86, 64, { 0x02, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0xff, 0xd3, 0x92, 0x10, 0xe4, 0x33, 0xfe, 0xef, 0x4e, 0xf0, 0xd2, - 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, + 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd2, 0x19, 0x90, 0x7f, 0x92, 0xe0, 0x44, 0x02, + 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0xff, 0xd3, 0x92, 0x10, 0xe4, 0x33, 0xfe, 0xef, 0x4e, 0xf0}}, + {0x0d86, 64, { 0xd2, 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91, 0xef, 0x90, - 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x0d, 0xf0, 0xd2, 0xaf}}, - {0x0dc6, 64, { 0xd2, 0x1a, 0x12, 0x12, 0x5c, 0xc2, 0x11, 0xe4, 0xf5, 0x0b, 0xf5, 0x13, 0xc2, 0x17, 0xc2, 0x12, 0x90, - 0x7f, 0xa1, 0x04, 0xf0, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x17, 0x60, 0x10, 0x30, 0x12, 0x05, 0xd2, + 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x0d, 0xf0, 0xd2, 0xaf, 0xd2, + 0x1a, 0x12, 0x12, 0x45, 0xc2, 0x11, 0xe4, 0xf5, 0x0b, 0xf5, 0x13, 0xc2, 0x17, 0xc2, 0x12}}, + {0x0dc6, 64, { 0x90, 0x7f, 0xa1, 0x04, 0xf0, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x17, 0x60, 0x10, 0x30, 0x12, 0x05, 0xd2, 0x1a, 0x12, 0x00, 0x46, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, 0x17, 0x80, 0x08, 0x30, 0x12, 0x05, 0xc2, - 0x1a, 0x12, 0x00, 0x46, 0x30, 0x11, 0x07, 0xc2, 0x11, 0x12, 0x09, 0x29, 0x80, 0xd6, 0x30}}, - {0x0e06, 64, { 0x18, 0xd3, 0xc2, 0x18, 0x12, 0x12, 0xf6, 0x80, 0xcc, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, - 0x81, 0x47, 0x02, 0x0e, 0x57, 0x02, 0x0d, 0x7f, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, + 0x1a, 0x12, 0x00, 0x46, 0x30, 0x11, 0x07, 0xc2, 0x11, 0x12, 0x09, 0x21, 0x80, 0xd6, 0x30, 0x18, + 0xd3, 0xc2, 0x18, 0x12, 0x13, 0x93, 0x80, 0xcc, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd}}, + {0x0e06, 64, { 0x75, 0x81, 0x47, 0x02, 0x0e, 0x47, 0x02, 0x0d, 0x6f, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8, 0x54, 0x07, - 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4}}, - {0x0e46, 64, { 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - 0x90, 0x12, 0xc3, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, + 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, + 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40}}, + {0x0e46, 64, { 0x80, 0x90, 0x12, 0xac, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0, 0x60, 0xa8, - 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5}}, - {0x0e86, 64, { 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, - 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, + 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, + 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca}}, + {0x0e86, 64, { 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, - 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06}}, - {0x0ec6, 64, { 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5, 0x82, - 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, + 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06, 0xe9, + 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5}}, + {0x0ec6, 64, { 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xf0, 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22, 0xd0, 0x83, 0xd0, - 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8}}, - {0x0f06, 64, { 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, - 0xa3, 0x80, 0xdf, 0x8f, 0x18, 0xe4, 0xf5, 0x19, 0x75, 0x1a, 0xff, 0x75, 0x1b, 0x19, 0x75, 0x1c, - 0x86, 0xab, 0x1a, 0xaa, 0x1b, 0xa9, 0x1c, 0x90, 0x00, 0x01, 0x12, 0x0e, 0xb5, 0xb4, 0x03, 0x1d, - 0xaf, 0x19, 0x05, 0x19, 0xef, 0xb5, 0x18, 0x01, 0x22, 0x12, 0x0e, 0x9c, 0x7e, 0x00, 0x29}}, - {0x0f46, 64, { 0xff, 0xee, 0x3a, 0xa9, 0x07, 0x75, 0x1a, 0xff, 0xf5, 0x1b, 0x89, 0x1c, 0x80, 0xd4, 0x7b, 0x00, 0x7a, - 0x00, 0x79, 0x00, 0x22, 0x8f, 0x1a, 0x05, 0x0d, 0xe5, 0x0d, 0xae, 0x0c, 0x70, 0x02, 0x05, 0x0c, + 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, + 0x01, 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3}}, + {0x0f06, 64, { 0xa3, 0xa3, 0x80, 0xdf, 0x8f, 0x18, 0xe4, 0xf5, 0x19, 0x75, 0x1a, 0xff, 0x75, 0x1b, 0x19, 0x75, 0x1c, + 0x86, 0xab, 0x1a, 0xaa, 0x1b, 0xa9, 0x1c, 0x90, 0x00, 0x01, 0x12, 0x0e, 0xa5, 0xb4, 0x03, 0x1d, + 0xaf, 0x19, 0x05, 0x19, 0xef, 0xb5, 0x18, 0x01, 0x22, 0x12, 0x0e, 0x8c, 0x7e, 0x00, 0x29, 0xff, + 0xee, 0x3a, 0xa9, 0x07, 0x75, 0x1a, 0xff, 0xf5, 0x1b, 0x89, 0x1c, 0x80, 0xd4, 0x7b, 0x00}}, + {0x0f46, 64, { 0x7a, 0x00, 0x79, 0x00, 0x22, 0x8f, 0x1a, 0x05, 0x0d, 0xe5, 0x0d, 0xae, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x1a, 0xf0, 0x12, 0x00, 0x36, 0x05, 0x0d, 0xe5, 0x0d, 0xac, - 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5}}, - {0x0f86, 64, { 0x08, 0x60, 0x0a, 0x12, 0x13, 0x3f, 0x8f, 0x1a, 0xef, 0x42, 0x36, 0x80, 0xca, 0x22, 0x8f, 0x1a, 0x05, - 0x0d, 0xe5, 0x0d, 0xae, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x1a, - 0xf0, 0x12, 0x13, 0x57, 0x05, 0x0d, 0xe5, 0x0d, 0xac, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, - 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5, 0x08, 0x60, 0x0a, 0x12, 0x13, 0x93, 0x8f}}, - {0x0fc6, 64, { 0x1a, 0xef, 0x42, 0x37, 0x80, 0xca, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, - 0xc0, 0x86, 0x75, 0x86, 0x00, 0x30, 0x15, 0x04, 0xc2, 0x15, 0x80, 0x02, 0xd2, 0x18, 0x53, 0x91, - 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, - 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0}}, - {0x1006, 64, { 0x86, 0x75, 0x86, 0x00, 0x90, 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, - 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, - 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x11, 0x53, - 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0}}, - {0x1046, 64, { 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, - 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, - 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, - 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0}}, - {0x1086, 64, { 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, - 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, - 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, - 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0}}, - {0x10c6, 64, { 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, - 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, - 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, - 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90}}, - {0x1106, 64, { 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, - 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, - 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, - 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xef}}, - {0x1146, 64, { 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, - 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x09, - 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, - 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74}}, - {0x1186, 64, { 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, - 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, - 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, 0x00, - 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00}}, - {0x11c6, 64, { 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, - 0x7f, 0x98, 0x74, 0x17, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, - 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, 0x13, 0x27, 0x8f, 0x1a, 0x12, 0x13, 0x27, 0x8f, 0x1b, - 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12, 0x13, 0x27, 0x8f, 0x1a, 0xe5, 0x1a, 0x65, 0x1b}}, - {0x1206, 64, { 0x60, 0x07, 0x12, 0x13, 0x27, 0x8f, 0x1b, 0x80, 0xe8, 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, - 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0f, 0xf0, 0x90, - 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, - 0x12, 0x13, 0x7b, 0x8f, 0x1a, 0x12, 0x13, 0x7b, 0x8f, 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60}}, - {0x1246, 64, { 0x12, 0x12, 0x13, 0x7b, 0x8f, 0x1a, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x07, 0x12, 0x13, 0x7b, 0x8f, 0x1b, - 0x80, 0xe8, 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, - 0x30, 0x1a, 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x12, 0xdf, 0x90, 0x7f, - 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0xe0, 0x44, 0x04, 0xf0, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5}}, - {0x1286, 64, { 0x3e, 0x54, 0x7f, 0xfd, 0x12, 0x11, 0xc8, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xee, - 0xf0, 0xe4, 0xe5, 0x3e, 0x44, 0x80, 0xfd, 0x12, 0x11, 0xc8, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, - 0x3f, 0x54, 0x7f, 0xfd, 0x12, 0x12, 0x12, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, - 0xee, 0xf0, 0xe4, 0xe5, 0x3f, 0x44, 0x80, 0xfd, 0x12, 0x12, 0x12, 0x22, 0x05, 0x0e, 0x02}}, - {0x12c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x03, 0x14, 0x03, 0x00, 0x00, 0xc1, 0x11, 0xc1, 0x18, 0xc1, 0x95, 0xc1, 0x10, - 0xc1, 0x16, 0x01, 0x0a, 0x00, 0xc1, 0x1b, 0x00, 0x8e, 0x18, 0x8f, 0x19, 0xe5, 0x19, 0x15, 0x19, - 0xae, 0x18, 0x70, 0x02, 0x15, 0x18, 0x4e, 0x60, 0x05, 0x12, 0x0d, 0x5e, 0x80, 0xee, 0x22, 0x12, - 0x00, 0x03, 0x12, 0x0d, 0x6f, 0x12, 0x0b, 0x4e, 0x22, 0x02, 0x10, 0x25, 0x00, 0x02, 0x13}}, - {0x1306, 64, { 0x04, 0x00, 0x02, 0x0f, 0xfb, 0x00, 0x02, 0x0f, 0xcd, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, + 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5, 0x08, + 0x60, 0x0a, 0x12, 0x13, 0x27, 0x8f, 0x1a, 0xef, 0x42, 0x36, 0x80, 0xca, 0x22, 0x8f, 0x1a}}, + {0x0f86, 64, { 0x05, 0x0d, 0xe5, 0x0d, 0xae, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x1a, + 0xf0, 0x12, 0x13, 0x3f, 0x05, 0x0d, 0xe5, 0x0d, 0xac, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, + 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5, 0x08, 0x60, 0x0a, 0x12, 0x13, 0x7b, 0x8f, 0x1a, + 0xef, 0x42, 0x37, 0x80, 0xca, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0}}, + {0x0fc6, 64, { 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90, 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, + 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, + 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, + 0x11, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0}}, + {0x1006, 64, { 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, + 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x18, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, + 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, + 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x10}}, + {0x1046, 64, { 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, + 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, + 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, + 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13}}, + {0x1086, 64, { 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xef, + 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, + 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44}}, + {0x10c6, 64, { 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, + 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, + 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x90}}, + {0x1106, 64, { 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, + 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, + 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90}}, + {0x1146, 64, { 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, + 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, + 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, + 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f}}, + {0x1186, 64, { 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, + 0x90, 0x7f, 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, + 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, + 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x17, 0xf0, 0x90}}, + {0x11c6, 64, { 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, + 0x13, 0x0f, 0x8f, 0x1a, 0x12, 0x13, 0x0f, 0x8f, 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12, + 0x13, 0x0f, 0x8f, 0x1a, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x07, 0x12, 0x13, 0x0f, 0x8f, 0x1b, 0x80, + 0xe8, 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90}}, + {0x1206, 64, { 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0f, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, + 0x74, 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, 0x13, 0x63, 0x8f, 0x1a, 0x12, 0x13, + 0x63, 0x8f, 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12, 0x13, 0x63, 0x8f, 0x1a, 0xe5, 0x1a, + 0x65, 0x1b, 0x60, 0x07, 0x12, 0x13, 0x63, 0x8f, 0x1b, 0x80, 0xe8, 0xaf, 0x1a, 0x22, 0x90}}, + {0x1246, 64, { 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x1a, 0x04, 0xe0, 0x44, 0x02, 0xf0, + 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x12, 0xc8, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0xe0, 0x44, + 0x04, 0xf0, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x3e, 0x54, 0x7f, 0xfd, 0x12, 0x11, 0xb1, 0x90, + 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x3e, 0x44, 0x80}}, + {0x1286, 64, { 0xfd, 0x12, 0x11, 0xb1, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x3f, 0x54, 0x7f, 0xfd, 0x12, 0x11, 0xfb, + 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x3f, 0x44, 0x80, + 0xfd, 0x12, 0x11, 0xfb, 0x22, 0x05, 0x0e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x14, 0x03, 0x00, + 0x00, 0xc1, 0x11, 0xc1, 0x18, 0xc1, 0x95, 0xc1, 0x10, 0xc1, 0x16, 0x01, 0x0a, 0x00, 0xc1}}, + {0x12c6, 64, { 0x1b, 0x00, 0x8e, 0x18, 0x8f, 0x19, 0xe5, 0x19, 0x15, 0x19, 0xae, 0x18, 0x70, 0x02, 0x15, 0x18, 0x4e, + 0x60, 0x05, 0x12, 0x0d, 0x4e, 0x80, 0xee, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, - 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, - 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90}}, - {0x1346, 64, { 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, - 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, - 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x90, 0xc0, - 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff}}, - {0x1386, 64, { 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, - 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, - 0x00, 0xe0, 0xff, 0x22, 0x53, 0xd8, 0xef, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x53, 0xd8, 0xef, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0f, 0xe7, 0x00, 0x02, 0x13}}, + {0x1306, 64, { 0x04, 0x00, 0x02, 0x0f, 0xbd, 0x00, 0x02, 0x10, 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, + 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0x90}}, + {0x1346, 64, { 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, + 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff}}, + {0x1386, 64, { 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x12, 0x00, 0x03, 0x12, + 0x0d, 0x5f, 0x12, 0x0b, 0x46, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, {0x13c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -420,13 +424,13 @@ {0x18c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x00, 0x01, 0xff, 0x00}}, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x10, 0x01, 0xff, 0x00}}, {0x1906, 64, { 0x00, 0x40, 0xcd, 0x06, 0x12, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x02, 0x09, 0x02, 0x74, 0x00, 0x01, 0x01, 0x00, 0xa0, 0x32, 0x09, 0x04, 0x00, 0x00, 0x0e, 0xff, 0x00, 0x00, 0x00, 0x07, 0x05, 0x01, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x02, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x03, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x04, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x05, 0x02, 0x40, 0x00}}, {0x1946, 64, { 0x00, 0x07, 0x05, 0x06, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x07, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, - 0x81, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x83, 0x02, + 0x81, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x83, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x84, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x85, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x86, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x87, 0x02, 0x40, 0x00, 0x01}}, {0x1986, 64, { 0x04, 0x03, 0x09, 0x04, 0x48, 0x03, 0x4b, 0x00, 0x65, 0x00, 0x79, 0x00, 0x73, 0x00, 0x70, 0x00, 0x61, @@ -439,5 +443,5 @@ 0x00, 0x20, 0x00, 0x41, 0x00, 0x64, 0x00, 0x61, 0x00, 0x70, 0x00, 0x74, 0x00, 0x65, 0x00}}, {0x1a06, 20, { 0x72, 0x00, 0x10, 0x03, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x00, 0x00}}, - { 0xffff, 0, {0x00} } + {0xffff, 0, {0x00} } }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa19_fw.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa19_fw.h --- linux.20pre5/drivers/usb/serial/keyspan_usa19_fw.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa19_fw.h 2002-09-01 13:39:31.000000000 +0100 @@ -1,28 +1,33 @@ /* keyspan_usa19_fw.h - - Generated from Keyspan firmware image usa19code.h Sat Oct 6 12:14:44 EST 2001 - This firmware is for the Keyspan USA-19 Serial Adaptor + + The firmware contained herein as keyspan_usa19_fw.h is - "The firmware contained herein as keyspan_usa19_fw.h is - Copyright (C) 1999-2001 Keyspan, A division of InnoSys Incorporated - ("Keyspan"), as an unpublished work. This notice does not imply - unrestricted or public access to this firmware which is a trade secret of - Keyspan, and which may not be reproduced, used, sold or transferred to any - third party without Keyspan's prior written consent. All Rights Reserved. + Copyright (C) 1999-2001 + Keyspan, A division of InnoSys Incorporated ("Keyspan") + + as an unpublished work. This notice does not imply unrestricted or + public access to the source code from which this firmware image is + derived. Except as noted below this firmware image may not be + reproduced, used, sold or transferred to any third party without + Keyspan's prior written consent. All Rights Reserved. - This firmware may not be modified and may only be used with the Keyspan - USA-19 Serial Adapter. Distribution and/or Modification of the - keyspan.c driver which includes this firmware, in whole or in part, - requires the inclusion of this statement." + Permission is hereby granted for the distribution of this firmware + image as part of a Linux or other Open Source operating system kernel + in text or binary form as required. + This firmware may not be modified and may only be used with + Keyspan hardware. Distribution and/or Modification of the + keyspan.c driver which includes this firmware, in whole or in + part, requires the inclusion of this statement." */ + static const struct ezusb_hex_record keyspan_usa19_firmware[] = { - {0x0026, 10, { 0x12, 0x0d, 0xbb, 0x12, 0x0e, 0xee, 0x12, 0x0d, 0x67, 0x22}}, + {0x0026, 10, { 0x12, 0x0d, 0xbf, 0x12, 0x0f, 0x47, 0x12, 0x0d, 0x6b, 0x22}}, {0x0033, 3, { 0x02, 0x00, 0x1a}}, {0x001a, 4, { 0x53, 0xd8, 0xef, 0x32}}, {0x0003, 16, { 0x8e, 0x13, 0x8f, 0x14, 0xe5, 0x14, 0x15, 0x14, 0xae, 0x13, 0x70, 0x02, 0x15, 0x13, 0x4e, 0x60}}, - {0x0013, 7, { 0x05, 0x12, 0x0e, 0xdd, 0x80, 0xee, 0x22}}, + {0x0013, 7, { 0x05, 0x12, 0x0f, 0x36, 0x80, 0xee, 0x22}}, {0x0023, 3, { 0x02, 0x00, 0x46}}, {0x0046, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0, 0xd0, 0x75, 0xd0, 0x08}}, {0x0056, 16, { 0x30, 0x99, 0x0e, 0x30, 0x08, 0x07, 0xa2, 0x0b, 0x92, 0x9b, 0x85, 0x35, 0x99, 0xc2, 0x99, 0xd2}}, @@ -37,7 +42,7 @@ {0x00e6, 16, { 0xf5, 0x50, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x0a, 0x20, 0x09, 0x2d, 0x20, 0x06, 0x2a, 0x90}}, {0x00f6, 16, { 0x7f, 0x9b, 0xe0, 0x30, 0xe3, 0x03, 0x20, 0x0e, 0x20, 0x30, 0x0d, 0x11, 0x90, 0x7d, 0xc1, 0xe0}}, {0x0043, 3, { 0x02, 0x0f, 0x00}}, - {0x0000, 3, { 0x02, 0x0c, 0x5d}}, + {0x0000, 3, { 0x02, 0x0c, 0x61}}, {0x0106, 64, { 0x13, 0x92, 0x0b, 0xa3, 0xe0, 0xf5, 0x35, 0x75, 0x37, 0x03, 0x02, 0x04, 0x2f, 0x75, 0x37, 0x02, 0x90, 0x7d, 0xc1, 0xe0, 0xf5, 0x35, 0x02, 0x04, 0x2f, 0x75, 0x37, 0x01, 0xc2, 0x08, 0x02, 0x04, 0x2f, 0xe5, 0x37, 0xc3, 0x95, 0x50, 0x50, 0x03, 0x02, 0x01, 0xcf, 0x90, 0x7f, 0xc6, 0xe0, 0x30, 0xe1, @@ -110,9 +115,9 @@ 0x15, 0x36, 0x05, 0x2b, 0x43, 0x33, 0x01, 0x80, 0x0b, 0x90, 0x7f, 0xb9, 0xe5, 0x36, 0xf0, 0x75, 0x36, 0x00, 0xd2, 0x01, 0xd2, 0x12, 0x30, 0x12, 0x05, 0xc2, 0x12, 0x02, 0x00, 0x56, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0xca, 0xe0, 0x30, 0xe1}}, - {0x0586, 64, { 0x03, 0x02, 0x06, 0xa7, 0xe4, 0xf5, 0x13, 0x74, 0x40, 0x25, 0x13, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, + {0x0586, 64, { 0x03, 0x02, 0x06, 0xab, 0xe4, 0xf5, 0x13, 0x74, 0x40, 0x25, 0x13, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x13, 0x7c, 0x00, 0x7b, 0x00, 0x24, 0x38, 0xf9, 0xec, 0x34, 0x00, 0xfa, - 0xef, 0x12, 0x0d, 0x2f, 0x05, 0x13, 0xe5, 0x13, 0xb4, 0x18, 0xdb, 0xe5, 0x38, 0x60, 0x0c, 0x75, + 0xef, 0x12, 0x0d, 0x33, 0x05, 0x13, 0xe5, 0x13, 0xb4, 0x18, 0xdb, 0xe5, 0x38, 0x60, 0x0c, 0x75, 0xc9, 0x20, 0x75, 0xc8, 0x34, 0x85, 0x39, 0xca, 0x85, 0x3a, 0xcb, 0xe5, 0x3b, 0x13, 0x92}}, {0x05c6, 64, { 0x0d, 0x92, 0x9f, 0xe5, 0x3c, 0x13, 0x92, 0x0e, 0xe5, 0x3d, 0x13, 0x92, 0x11, 0xe5, 0x3e, 0x60, 0x09, 0x90, 0x7f, 0x98, 0xe0, 0x54, 0xfb, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0x98, 0xe0, 0x44, 0x04, 0xf0, @@ -125,149 +130,149 @@ {0x0646, 64, { 0x90, 0x7f, 0x98, 0xe0, 0x54, 0xfd, 0xf0, 0xe5, 0x4a, 0x60, 0x0a, 0xd2, 0x9c, 0xc2, 0x98, 0x75, 0x2c, 0x01, 0x75, 0x31, 0x1e, 0xe5, 0x4b, 0x60, 0x07, 0xc2, 0x9c, 0xe4, 0xf5, 0x36, 0xf5, 0x2c, 0xe5, 0x4c, 0x60, 0x03, 0xe4, 0xf5, 0x36, 0xe5, 0x4d, 0x60, 0x02, 0xd2, 0x04, 0xe5, 0x4e, 0x60, 0x0a, - 0xe5, 0x4a, 0x70, 0x02, 0xf5, 0x31, 0xe5, 0x4e, 0x42, 0x33, 0xe5, 0x4f, 0x60, 0x1b, 0x90}}, + 0xe5, 0x4a, 0x70, 0x02, 0xf5, 0x31, 0xe5, 0x4e, 0x42, 0x33, 0xe5, 0x4f, 0x60, 0x1f, 0x90}}, {0x0686, 64, { 0x7f, 0xd7, 0x74, 0x11, 0xf0, 0x74, 0x31, 0xf0, 0x74, 0x12, 0xf0, 0x74, 0x32, 0xf0, 0x74, 0x13, 0xf0, - 0x74, 0x33, 0xf0, 0x74, 0x14, 0xf0, 0x74, 0x34, 0xf0, 0xd2, 0x05, 0xe4, 0x90, 0x7f, 0xcb, 0xf0, - 0xa2, 0x09, 0xe4, 0x33, 0xff, 0x65, 0x29, 0x60, 0x05, 0x8f, 0x29, 0x43, 0x33, 0x01, 0xa2, 0x06, - 0xe4, 0x33, 0xff, 0x65, 0x2a, 0x60, 0x05, 0x8f, 0x2a, 0x43, 0x33, 0x01, 0x90, 0x7f, 0x9b}}, - {0x06c6, 64, { 0xe0, 0x54, 0x08, 0xb5, 0x25, 0x0a, 0xe0, 0x54, 0x08, 0x64, 0x08, 0xf5, 0x25, 0x43, 0x33, 0x01, 0x90, - 0x7f, 0x9b, 0xe0, 0x54, 0x10, 0xb5, 0x26, 0x0a, 0xe0, 0x54, 0x10, 0x64, 0x10, 0xf5, 0x26, 0x43, - 0x33, 0x01, 0x90, 0x7f, 0x9b, 0xe0, 0x54, 0x40, 0xb5, 0x27, 0x0a, 0xe0, 0x54, 0x40, 0x64, 0x40, - 0xf5, 0x27, 0x43, 0x33, 0x01, 0x90, 0x7f, 0x9b, 0xe0, 0x54, 0x20, 0xb5, 0x28, 0x0a, 0xe0}}, - {0x0706, 64, { 0x54, 0x20, 0x64, 0x20, 0xf5, 0x28, 0x43, 0x33, 0x01, 0x30, 0x04, 0x35, 0xc2, 0xaf, 0x30, 0x01, 0x18, - 0x90, 0x7f, 0xb8, 0xe0, 0x20, 0xe1, 0x27, 0xe5, 0x36, 0x60, 0x09, 0x90, 0x7f, 0xb7, 0xf0, 0xe4, - 0xf5, 0x36, 0xc2, 0x01, 0xc2, 0x04, 0x80, 0x16, 0x90, 0x7f, 0xb6, 0xe0, 0x20, 0xe1, 0x0f, 0xe5, - 0x36, 0x60, 0x09, 0x90, 0x7f, 0xb9, 0xf0, 0xe4, 0xf5, 0x36, 0xd2, 0x01, 0xc2, 0x04, 0xd2}}, - {0x0746, 64, { 0xaf, 0x20, 0x03, 0x37, 0x30, 0x02, 0x1b, 0x90, 0x7f, 0xc6, 0xe0, 0x20, 0xe1, 0x2d, 0x90, 0x7e, 0x40, - 0xe0, 0x13, 0x92, 0x0a, 0x75, 0x37, 0x01, 0x90, 0x7f, 0xc7, 0xe0, 0xf5, 0x50, 0xd2, 0x03, 0x80, - 0x19, 0x90, 0x7f, 0xc8, 0xe0, 0x20, 0xe1, 0x12, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x0a, 0x75, - 0x37, 0x01, 0x90, 0x7f, 0xc9, 0xe0, 0xf5, 0x50, 0xd2, 0x03, 0x20, 0x10, 0x33, 0x20, 0x00}}, - {0x0786, 64, { 0x06, 0xe5, 0x37, 0x65, 0x50, 0x70, 0x2a, 0x30, 0x03, 0x1a, 0x30, 0x02, 0x09, 0xe4, 0x90, 0x7f, 0xc7, - 0xf0, 0xc2, 0x02, 0x80, 0x07, 0xe4, 0x90, 0x7f, 0xc9, 0xf0, 0xd2, 0x02, 0xc2, 0x03, 0xe4, 0xf5, - 0x50, 0xf5, 0x37, 0x30, 0x0a, 0x0a, 0xc2, 0x0a, 0xc2, 0x00, 0x90, 0x7f, 0xbb, 0x74, 0x01, 0xf0, - 0x30, 0x10, 0x03, 0x02, 0x08, 0xc1, 0x20, 0x03, 0x03, 0x02, 0x08, 0xc1, 0x30, 0x0e, 0x0a}}, - {0x07c6, 64, { 0x90, 0x7f, 0x9b, 0xe0, 0x30, 0xe3, 0x03, 0x02, 0x08, 0xc1, 0x30, 0x06, 0x03, 0x02, 0x08, 0xc1, 0x30, - 0x09, 0x03, 0x02, 0x08, 0xc1, 0x30, 0x02, 0x62, 0x30, 0x0d, 0x12, 0xaf, 0x37, 0x05, 0x37, 0x74, - 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x19, 0xaf, 0x37, 0x05, - 0x37, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0xf5, 0x14, 0xe5}}, - {0x0806, 64, { 0x37, 0xc3, 0x95, 0x50, 0x50, 0x2a, 0x30, 0x0d, 0x12, 0xaf, 0x37, 0x05, 0x37, 0x74, 0x40, 0x2f, 0xf5, - 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x0b, 0xaf, 0x37, 0x05, 0x37, 0x74, 0x40, - 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0xf5, 0x35, 0xd2, 0x08, 0x80, 0x6b, 0xc2, - 0x08, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0xc2, 0x02, 0x80, 0x60, 0x30, 0x0d, 0x12, 0xaf, 0x37}}, - {0x0846, 64, { 0x05, 0x37, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x19, 0xaf, - 0x37, 0x05, 0x37, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, 0x14, - 0xe5, 0x37, 0xc3, 0x95, 0x50, 0x50, 0x2a, 0x30, 0x0d, 0x12, 0xaf, 0x37, 0x05, 0x37, 0x74, 0xc0, - 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x0b, 0xaf, 0x37, 0x05}}, - {0x0886, 64, { 0x37, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, 0x35, 0xd2, 0x08, 0x80, - 0x09, 0xc2, 0x08, 0xe4, 0x90, 0x7f, 0xc9, 0xf0, 0xd2, 0x02, 0x30, 0x0d, 0x04, 0xa2, 0x19, 0x92, - 0x9b, 0xd2, 0x10, 0xc2, 0xaf, 0x85, 0x14, 0x99, 0x20, 0x08, 0x0d, 0x30, 0x0a, 0x0a, 0xc2, 0x0a, - 0xc2, 0x00, 0x90, 0x7f, 0xbb, 0x74, 0x01, 0xf0, 0xd2, 0xaf, 0x90, 0x7f, 0xbc, 0xe0, 0x20}}, - {0x08c6, 64, { 0xe1, 0x51, 0xe5, 0x33, 0x60, 0x4d, 0xe5, 0x31, 0x70, 0x49, 0xe5, 0x33, 0x30, 0xe1, 0x08, 0xe4, 0xf5, - 0x2f, 0x75, 0x33, 0x01, 0x80, 0x0b, 0xa2, 0x05, 0xe4, 0x33, 0xf5, 0x2f, 0xc2, 0x05, 0xe4, 0xf5, - 0x33, 0xe4, 0xf5, 0x13, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x13, 0xf9, 0xee, 0x34, 0x00, - 0xfa, 0x12, 0x0c, 0xe9, 0xff, 0x74, 0x00, 0x25, 0x13, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5}}, - {0x0906, 64, { 0x83, 0xef, 0xf0, 0x05, 0x13, 0xe5, 0x13, 0xb4, 0x0c, 0xdb, 0x90, 0x7f, 0xbd, 0x74, 0x0c, 0xf0, 0x75, - 0x31, 0x10, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x0d, 0x41, 0x09, 0xff, 0x00, 0x0a, 0x73, 0x01, - 0x0a, 0xdf, 0x03, 0x09, 0x3d, 0x06, 0x09, 0xf0, 0x08, 0x09, 0xe4, 0x09, 0x09, 0xcc, 0x0a, 0x09, - 0xdb, 0x0b, 0x00, 0x00, 0x0b, 0x2e, 0x90, 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x16, 0x14}}, - {0x0946, 64, { 0x60, 0x57, 0x24, 0x02, 0x70, 0x76, 0x74, 0x0f, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x64, 0x90, 0x7f, 0xd5, - 0xf0, 0x02, 0x0b, 0x35, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x04, 0x7f, 0x02, 0x80, 0x02, 0x7f, 0x03, - 0x75, 0x82, 0xb5, 0x75, 0x83, 0x0f, 0xef, 0xf0, 0x75, 0x82, 0xae, 0x75, 0x83, 0x0f, 0xf0, 0x75, - 0x82, 0xa7, 0x75, 0x83, 0x0f, 0xf0, 0x75, 0x82, 0xa0, 0x75, 0x83, 0x0f, 0xf0, 0x90, 0x7f}}, - {0x0986, 64, { 0xea, 0xe0, 0x04, 0x75, 0x82, 0x7b, 0x75, 0x83, 0x0f, 0xf0, 0x74, 0x0f, 0x90, 0x7f, 0xd4, 0xf0, 0x74, - 0x76, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x35, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x0e, 0x44, - 0xea, 0x49, 0x60, 0x0d, 0xea, 0x90, 0x7f, 0xd4, 0xf0, 0xe9, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, - 0x35, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x35, 0x90, 0x7f, 0xb4, 0xe0}}, - {0x09c6, 64, { 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x35, 0x90, 0x7f, 0x00, 0xe5, 0x19, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, - 0xf0, 0x02, 0x0b, 0x35, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x19, 0x02, 0x0b, 0x35, 0x90, 0x7f, 0xea, - 0xe0, 0xf5, 0x18, 0x12, 0x0d, 0x67, 0x02, 0x0b, 0x35, 0x90, 0x7f, 0x00, 0xe5, 0x18, 0xf0, 0x90, - 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x0b, 0x35, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60}}, - {0x0a06, 64, { 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, 0xa2, 0x13, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, 0xa2, - 0x17, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, - 0xf0, 0x02, 0x0b, 0x35, 0xe4, 0x90, 0x7f, 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, - 0xf0, 0x02, 0x0b, 0x35, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f}}, - {0x0a46, 64, { 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe0, - 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, - 0x0b, 0x35, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x35, 0x90, 0x7f, 0xe8, 0xe0, - 0x24, 0xfe, 0x60, 0x1d, 0x24, 0x02, 0x60, 0x03, 0x02, 0x0b, 0x35, 0x90, 0x7f, 0xea, 0xe0}}, - {0x0a86, 64, { 0xb4, 0x01, 0x05, 0xc2, 0x13, 0x02, 0x0b, 0x35, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, - 0x35, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x38, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, - 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, - 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f, 0xec, 0xe0, 0x54, 0x80, 0xff, 0x13, 0x13, 0x13, 0x54}}, - {0x0ac6, 64, { 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f, 0xd7, 0xf0, 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x5f, 0x90, - 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x56, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x18, - 0x24, 0x02, 0x70, 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x04, 0xd2, 0x13, 0x80, 0x3f, 0x90, - 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90}}, - {0x0b06, 64, { 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, - 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, 0x7f, - 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, - 0xb4, 0xe0, 0x44, 0x02, 0xf0, 0x22, 0x20, 0x15, 0x03, 0x02, 0x0b, 0xcf, 0xe5, 0x31, 0x60}}, - {0x0b46, 64, { 0x02, 0x15, 0x31, 0xe5, 0x36, 0x60, 0x4f, 0x65, 0x34, 0x70, 0x45, 0xe5, 0x32, 0xf4, 0x60, 0x02, 0x05, - 0x32, 0xe5, 0x32, 0xc3, 0x95, 0x41, 0x40, 0x3d, 0xc2, 0xaf, 0x30, 0x01, 0x18, 0x90, 0x7f, 0xb8, - 0xe0, 0x20, 0xe1, 0x27, 0x90, 0x7f, 0xb7, 0xe5, 0x36, 0xf0, 0xc2, 0x01, 0xe4, 0xf5, 0x36, 0xf5, - 0x32, 0xf5, 0x34, 0x80, 0x16, 0x90, 0x7f, 0xb6, 0xe0, 0x20, 0xe1, 0x0f, 0x90, 0x7f, 0xb9}}, - {0x0b86, 64, { 0xe5, 0x36, 0xf0, 0xd2, 0x01, 0xe4, 0xf5, 0x36, 0xf5, 0x32, 0xf5, 0x34, 0xd2, 0xaf, 0x80, 0x06, 0x85, - 0x36, 0x34, 0xe4, 0xf5, 0x32, 0xe5, 0x2c, 0x60, 0x2f, 0x20, 0x0c, 0x07, 0x90, 0x7f, 0x9b, 0xe0, - 0x30, 0xe0, 0x0f, 0xe5, 0x2d, 0x60, 0x06, 0xe4, 0xf5, 0x2d, 0x43, 0x33, 0x01, 0xe4, 0xf5, 0x30, - 0x80, 0x14, 0xe5, 0x30, 0xd3, 0x95, 0x42, 0x50, 0x0d, 0xe5, 0x30, 0xb5, 0x42, 0x06, 0x75}}, - {0x0bc6, 64, { 0x2d, 0x01, 0x43, 0x33, 0x01, 0x05, 0x30, 0xc2, 0x0c, 0x22, 0x75, 0x12, 0x01, 0xc2, 0x14, 0xc2, 0x18, - 0xc2, 0x13, 0xc2, 0x17, 0xc2, 0x15, 0xc2, 0x12, 0xd2, 0x16, 0xe4, 0xf5, 0x18, 0x90, 0x7f, 0x92, - 0xe0, 0x54, 0xfd, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0xff, 0xd3, 0x92, 0x13, 0xe4, 0x33, 0xfe, 0xef, - 0x4e, 0xf0, 0xd2, 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74, 0x01, 0xf0, 0x90, 0x7f}}, - {0x0c06, 64, { 0xdf, 0xf0, 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, - 0x91, 0xef, 0x90, 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x0d, 0xf0, - 0xd2, 0xaf, 0xd2, 0xbc, 0xd2, 0x19, 0x12, 0x0f, 0x36, 0xc2, 0x14, 0x30, 0x15, 0x03, 0x12, 0x05, - 0x80, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x11, 0x60, 0x08, 0xe0, 0xf5, 0x11, 0x12, 0x0b, 0x3d}}, - {0x0c46, 64, { 0x80, 0xea, 0x30, 0x14, 0x07, 0xc2, 0x14, 0x12, 0x09, 0x1a, 0x80, 0xe0, 0x30, 0x18, 0xdd, 0xc2, 0x18, - 0x12, 0x00, 0x26, 0x80, 0xd6, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x50, 0x02, - 0x0c, 0xa4, 0x02, 0x0b, 0xd0, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, 0x80, - 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8, 0x54, 0x07, 0x24, 0x0c}}, - {0x0c86, 64, { 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, 0x80, 0x01, 0x46, - 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x0e, 0x00, - 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, - 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0, 0x60, 0xa8, 0x40, 0xb8}}, - {0x0cc6, 64, { 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, - 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde, 0xe7, - 0x80, 0xbe, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, - 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x0c, 0xe5}}, - {0x0d06, 64, { 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06, 0xe9, 0x25, 0x82, 0xf8, - 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5, 0x82, 0x29, 0xf5, 0x82, - 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xf0, - 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22, 0xd0, 0x83, 0xd0, 0x82, 0xf8}}, - {0x0d46, 64, { 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, - 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, 0xa3, 0x80, 0xdf, - 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0x90, 0x7f, 0x96, 0x74, 0x10, - 0xf0, 0x90, 0x7f, 0x94, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0x9d, 0x04, 0xf0, 0x90, 0x7f, 0x97}}, - {0x0d86, 64, { 0x74, 0x20, 0xf0, 0x90, 0x7f, 0x95, 0x74, 0x03, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x84, 0xf0, 0xe4, 0x90, - 0x7f, 0x98, 0xf0, 0x90, 0x7f, 0xc7, 0xf0, 0x90, 0x7f, 0xc9, 0xf0, 0x90, 0x7f, 0xcb, 0xf0, 0x75, - 0x98, 0x40, 0x43, 0xa8, 0x10, 0x90, 0x7f, 0xde, 0x74, 0x1f, 0xf0, 0x90, 0x7f, 0xdf, 0x74, 0x0f, - 0xf0, 0xd2, 0x15, 0x22, 0xe4, 0x90, 0x7f, 0x95, 0xf0, 0x90, 0x7f, 0x94, 0xf0, 0x90, 0x7f}}, - {0x0dc6, 64, { 0x93, 0xf0, 0x90, 0x7f, 0x9d, 0xe0, 0x44, 0x02, 0xf0, 0x90, 0x7f, 0x97, 0xe0, 0x44, 0x02, 0xf0, 0x90, - 0x7f, 0x9d, 0xe0, 0x54, 0xfd, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x20, 0xf0, 0xe4, 0x90, 0x7f, 0x96, - 0xf0, 0x90, 0x7f, 0x9d, 0xe0, 0x44, 0xfd, 0xf0, 0xe4, 0x90, 0x7f, 0x97, 0xf0, 0x90, 0x7f, 0x9e, - 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x98, 0xf0, 0x22, 0x0c, 0x24, 0x00, 0x00, 0x00, 0x00}}, - {0x0e06, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x01, 0x33, 0x01, 0x01, 0x32, 0x00, - 0x01, 0x37, 0x00, 0x01, 0x50, 0x00, 0x01, 0x36, 0x00, 0x01, 0x34, 0x00, 0xc1, 0x05, 0xc1, 0x0c, - 0xc1, 0x03, 0xc1, 0x0f, 0xc1, 0x04, 0xc1, 0x0e, 0xc1, 0x11, 0xc1, 0x0a, 0xc1, 0x10, 0xc1, 0x08, - 0xc1, 0x09, 0xc1, 0x06, 0xc1, 0x00, 0xc1, 0x0d, 0xc1, 0x81, 0xc1, 0x82, 0x00, 0x8f, 0x13}}, - {0x0e46, 64, { 0xe4, 0xf5, 0x14, 0x75, 0x15, 0xff, 0x75, 0x16, 0x0f, 0x75, 0x17, 0xb9, 0xab, 0x15, 0xaa, 0x16, 0xa9, - 0x17, 0x90, 0x00, 0x01, 0x12, 0x0d, 0x02, 0xb4, 0x03, 0x1d, 0xaf, 0x14, 0x05, 0x14, 0xef, 0xb5, - 0x13, 0x01, 0x22, 0x12, 0x0c, 0xe9, 0x7e, 0x00, 0x29, 0xff, 0xee, 0x3a, 0xa9, 0x07, 0x75, 0x15, - 0xff, 0xf5, 0x16, 0x89, 0x17, 0x80, 0xd4, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x00, 0x22, 0xc0}}, - {0x0e86, 64, { 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x30, 0x16, 0x04, - 0xc2, 0x16, 0x80, 0x02, 0xd2, 0x18, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, + 0x74, 0x33, 0xf0, 0x74, 0x14, 0xf0, 0x74, 0x34, 0xf0, 0xd2, 0x02, 0xd2, 0x01, 0xd2, 0x05, 0xe4, + 0x90, 0x7f, 0xcb, 0xf0, 0xa2, 0x09, 0xe4, 0x33, 0xff, 0x65, 0x29, 0x60, 0x05, 0x8f, 0x29, 0x43, + 0x33, 0x01, 0xa2, 0x06, 0xe4, 0x33, 0xff, 0x65, 0x2a, 0x60, 0x05, 0x8f, 0x2a, 0x43, 0x33}}, + {0x06c6, 64, { 0x01, 0x90, 0x7f, 0x9b, 0xe0, 0x54, 0x08, 0xb5, 0x25, 0x0a, 0xe0, 0x54, 0x08, 0x64, 0x08, 0xf5, 0x25, + 0x43, 0x33, 0x01, 0x90, 0x7f, 0x9b, 0xe0, 0x54, 0x10, 0xb5, 0x26, 0x0a, 0xe0, 0x54, 0x10, 0x64, + 0x10, 0xf5, 0x26, 0x43, 0x33, 0x01, 0x90, 0x7f, 0x9b, 0xe0, 0x54, 0x40, 0xb5, 0x27, 0x0a, 0xe0, + 0x54, 0x40, 0x64, 0x40, 0xf5, 0x27, 0x43, 0x33, 0x01, 0x90, 0x7f, 0x9b, 0xe0, 0x54, 0x20}}, + {0x0706, 64, { 0xb5, 0x28, 0x0a, 0xe0, 0x54, 0x20, 0x64, 0x20, 0xf5, 0x28, 0x43, 0x33, 0x01, 0x30, 0x04, 0x35, 0xc2, + 0xaf, 0x30, 0x01, 0x18, 0x90, 0x7f, 0xb8, 0xe0, 0x20, 0xe1, 0x27, 0xe5, 0x36, 0x60, 0x09, 0x90, + 0x7f, 0xb7, 0xf0, 0xe4, 0xf5, 0x36, 0xc2, 0x01, 0xc2, 0x04, 0x80, 0x16, 0x90, 0x7f, 0xb6, 0xe0, + 0x20, 0xe1, 0x0f, 0xe5, 0x36, 0x60, 0x09, 0x90, 0x7f, 0xb9, 0xf0, 0xe4, 0xf5, 0x36, 0xd2}}, + {0x0746, 64, { 0x01, 0xc2, 0x04, 0xd2, 0xaf, 0x20, 0x03, 0x37, 0x30, 0x02, 0x1b, 0x90, 0x7f, 0xc6, 0xe0, 0x20, 0xe1, + 0x2d, 0x90, 0x7e, 0x40, 0xe0, 0x13, 0x92, 0x0a, 0x75, 0x37, 0x01, 0x90, 0x7f, 0xc7, 0xe0, 0xf5, + 0x50, 0xd2, 0x03, 0x80, 0x19, 0x90, 0x7f, 0xc8, 0xe0, 0x20, 0xe1, 0x12, 0x90, 0x7d, 0xc0, 0xe0, + 0x13, 0x92, 0x0a, 0x75, 0x37, 0x01, 0x90, 0x7f, 0xc9, 0xe0, 0xf5, 0x50, 0xd2, 0x03, 0x20}}, + {0x0786, 64, { 0x10, 0x33, 0x20, 0x00, 0x06, 0xe5, 0x37, 0x65, 0x50, 0x70, 0x2a, 0x30, 0x03, 0x1a, 0x30, 0x02, 0x09, + 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0xc2, 0x02, 0x80, 0x07, 0xe4, 0x90, 0x7f, 0xc9, 0xf0, 0xd2, 0x02, + 0xc2, 0x03, 0xe4, 0xf5, 0x50, 0xf5, 0x37, 0x30, 0x0a, 0x0a, 0xc2, 0x0a, 0xc2, 0x00, 0x90, 0x7f, + 0xbb, 0x74, 0x01, 0xf0, 0x30, 0x10, 0x03, 0x02, 0x08, 0xc5, 0x20, 0x03, 0x03, 0x02, 0x08}}, + {0x07c6, 64, { 0xc5, 0x30, 0x0e, 0x0a, 0x90, 0x7f, 0x9b, 0xe0, 0x30, 0xe3, 0x03, 0x02, 0x08, 0xc5, 0x30, 0x06, 0x03, + 0x02, 0x08, 0xc5, 0x30, 0x09, 0x03, 0x02, 0x08, 0xc5, 0x30, 0x02, 0x62, 0x30, 0x0d, 0x12, 0xaf, + 0x37, 0x05, 0x37, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0x13, 0x92, + 0x19, 0xaf, 0x37, 0x05, 0x37, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83}}, + {0x0806, 64, { 0xe0, 0xf5, 0x14, 0xe5, 0x37, 0xc3, 0x95, 0x50, 0x50, 0x2a, 0x30, 0x0d, 0x12, 0xaf, 0x37, 0x05, 0x37, + 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x0b, 0xaf, 0x37, + 0x05, 0x37, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0xf5, 0x35, 0xd2, + 0x08, 0x80, 0x6b, 0xc2, 0x08, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0xc2, 0x02, 0x80, 0x60, 0x30}}, + {0x0846, 64, { 0x0d, 0x12, 0xaf, 0x37, 0x05, 0x37, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, + 0x13, 0x92, 0x19, 0xaf, 0x37, 0x05, 0x37, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, + 0x83, 0xe0, 0xf5, 0x14, 0xe5, 0x37, 0xc3, 0x95, 0x50, 0x50, 0x2a, 0x30, 0x0d, 0x12, 0xaf, 0x37, + 0x05, 0x37, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92}}, + {0x0886, 64, { 0x0b, 0xaf, 0x37, 0x05, 0x37, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, + 0x35, 0xd2, 0x08, 0x80, 0x09, 0xc2, 0x08, 0xe4, 0x90, 0x7f, 0xc9, 0xf0, 0xd2, 0x02, 0x30, 0x0d, + 0x04, 0xa2, 0x19, 0x92, 0x9b, 0xd2, 0x10, 0xc2, 0xaf, 0x85, 0x14, 0x99, 0x20, 0x08, 0x0d, 0x30, + 0x0a, 0x0a, 0xc2, 0x0a, 0xc2, 0x00, 0x90, 0x7f, 0xbb, 0x74, 0x01, 0xf0, 0xd2, 0xaf, 0x90}}, + {0x08c6, 64, { 0x7f, 0xbc, 0xe0, 0x20, 0xe1, 0x51, 0xe5, 0x33, 0x60, 0x4d, 0xe5, 0x31, 0x70, 0x49, 0xe5, 0x33, 0x30, + 0xe1, 0x08, 0xe4, 0xf5, 0x2f, 0x75, 0x33, 0x01, 0x80, 0x0b, 0xa2, 0x05, 0xe4, 0x33, 0xf5, 0x2f, + 0xc2, 0x05, 0xe4, 0xf5, 0x33, 0xe4, 0xf5, 0x13, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x13, + 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0c, 0xed, 0xff, 0x74, 0x00, 0x25, 0x13, 0xf5, 0x82}}, + {0x0906, 64, { 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x13, 0xe5, 0x13, 0xb4, 0x0c, 0xdb, 0x90, 0x7f, 0xbd, + 0x74, 0x0c, 0xf0, 0x75, 0x31, 0x10, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x0d, 0x45, 0x0a, 0x03, + 0x00, 0x0a, 0x77, 0x01, 0x0a, 0xe3, 0x03, 0x09, 0x41, 0x06, 0x09, 0xf4, 0x08, 0x09, 0xe8, 0x09, + 0x09, 0xd0, 0x0a, 0x09, 0xdf, 0x0b, 0x00, 0x00, 0x0b, 0x32, 0x90, 0x7f, 0xeb, 0xe0, 0x24}}, + {0x0946, 64, { 0xfe, 0x60, 0x16, 0x14, 0x60, 0x57, 0x24, 0x02, 0x70, 0x76, 0x74, 0x0f, 0x90, 0x7f, 0xd4, 0xf0, 0x74, + 0x64, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x39, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x04, 0x7f, 0x02, + 0x80, 0x02, 0x7f, 0x03, 0x75, 0x82, 0xb5, 0x75, 0x83, 0x0f, 0xef, 0xf0, 0x75, 0x82, 0xae, 0x75, + 0x83, 0x0f, 0xf0, 0x75, 0x82, 0xa7, 0x75, 0x83, 0x0f, 0xf0, 0x75, 0x82, 0xa0, 0x75, 0x83}}, + {0x0986, 64, { 0x0f, 0xf0, 0x90, 0x7f, 0xea, 0xe0, 0x04, 0x75, 0x82, 0x7b, 0x75, 0x83, 0x0f, 0xf0, 0x74, 0x0f, 0x90, + 0x7f, 0xd4, 0xf0, 0x74, 0x76, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x39, 0x90, 0x7f, 0xea, 0xe0, + 0xff, 0x12, 0x0e, 0x48, 0xea, 0x49, 0x60, 0x0d, 0xea, 0x90, 0x7f, 0xd4, 0xf0, 0xe9, 0x90, 0x7f, + 0xd5, 0xf0, 0x02, 0x0b, 0x39, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x39}}, + {0x09c6, 64, { 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x39, 0x90, 0x7f, 0x00, 0xe5, 0x19, 0xf0, 0x90, + 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x0b, 0x39, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x19, 0x02, 0x0b, + 0x39, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x18, 0x12, 0x0d, 0x6b, 0x02, 0x0b, 0x39, 0x90, 0x7f, 0x00, + 0xe5, 0x18, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x0b, 0x39, 0x90, 0x7f, 0xe8}}, + {0x0a06, 64, { 0xe0, 0x24, 0x7f, 0x60, 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, 0xa2, 0x13, 0xe4, 0x33, 0xff, + 0x25, 0xe0, 0xff, 0xa2, 0x17, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, + 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x39, 0xe4, 0x90, 0x7f, 0x00, 0xf0, 0xa3, 0xf0, 0x90, + 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x39, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80}}, + {0x0a46, 64, { 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, + 0x7f, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, + 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x39, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x39, + 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24, 0x02, 0x60, 0x03, 0x02, 0x0b, 0x39}}, + {0x0a86, 64, { 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x05, 0xc2, 0x13, 0x02, 0x0b, 0x39, 0x90, 0x7f, 0xb4, 0xe0, 0x44, + 0x01, 0xf0, 0x02, 0x0b, 0x39, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x38, 0x90, 0x7f, 0xec, 0xe0, 0xf4, + 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, + 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f, 0xec, 0xe0, 0x54, 0x80, 0xff}}, + {0x0ac6, 64, { 0x13, 0x13, 0x13, 0x54, 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f, 0xd7, 0xf0, 0xe0, 0x44, 0x20, + 0xf0, 0x80, 0x5f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x56, 0x90, 0x7f, 0xe8, 0xe0, + 0x24, 0xfe, 0x60, 0x18, 0x24, 0x02, 0x70, 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x04, 0xd2, + 0x13, 0x80, 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x36, 0x90, 0x7f, 0xea}}, + {0x0b06, 64, { 0xe0, 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, + 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, + 0x80, 0x10, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0xb4, 0xe0, 0x44, + 0x01, 0xf0, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0, 0x22, 0x20, 0x15, 0x03, 0x02, 0x0b}}, + {0x0b46, 64, { 0xd3, 0xe5, 0x31, 0x60, 0x02, 0x15, 0x31, 0xe5, 0x36, 0x60, 0x4f, 0x65, 0x34, 0x70, 0x45, 0xe5, 0x32, + 0xf4, 0x60, 0x02, 0x05, 0x32, 0xe5, 0x32, 0xc3, 0x95, 0x41, 0x40, 0x3d, 0xc2, 0xaf, 0x30, 0x01, + 0x18, 0x90, 0x7f, 0xb8, 0xe0, 0x20, 0xe1, 0x27, 0x90, 0x7f, 0xb7, 0xe5, 0x36, 0xf0, 0xc2, 0x01, + 0xe4, 0xf5, 0x36, 0xf5, 0x32, 0xf5, 0x34, 0x80, 0x16, 0x90, 0x7f, 0xb6, 0xe0, 0x20, 0xe1}}, + {0x0b86, 64, { 0x0f, 0x90, 0x7f, 0xb9, 0xe5, 0x36, 0xf0, 0xd2, 0x01, 0xe4, 0xf5, 0x36, 0xf5, 0x32, 0xf5, 0x34, 0xd2, + 0xaf, 0x80, 0x06, 0x85, 0x36, 0x34, 0xe4, 0xf5, 0x32, 0xe5, 0x2c, 0x60, 0x2f, 0x20, 0x0c, 0x07, + 0x90, 0x7f, 0x9b, 0xe0, 0x30, 0xe0, 0x0f, 0xe5, 0x2d, 0x60, 0x06, 0xe4, 0xf5, 0x2d, 0x43, 0x33, + 0x01, 0xe4, 0xf5, 0x30, 0x80, 0x14, 0xe5, 0x30, 0xd3, 0x95, 0x42, 0x50, 0x0d, 0xe5, 0x30}}, + {0x0bc6, 64, { 0xb5, 0x42, 0x06, 0x75, 0x2d, 0x01, 0x43, 0x33, 0x01, 0x05, 0x30, 0xc2, 0x0c, 0x22, 0x75, 0x12, 0x01, + 0xc2, 0x14, 0xc2, 0x18, 0xc2, 0x13, 0xc2, 0x17, 0xc2, 0x15, 0xc2, 0x12, 0xd2, 0x16, 0xe4, 0xf5, + 0x18, 0x90, 0x7f, 0x92, 0xe0, 0x54, 0xfd, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0xff, 0xd3, 0x92, 0x13, + 0xe4, 0x33, 0xfe, 0xef, 0x4e, 0xf0, 0xd2, 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74}}, + {0x0c06, 64, { 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, + 0x7f, 0xaa, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, + 0xe0, 0x44, 0x0d, 0xf0, 0xd2, 0xaf, 0xd2, 0xbc, 0xd2, 0x19, 0x12, 0x0e, 0xda, 0xc2, 0x14, 0x30, + 0x15, 0x03, 0x12, 0x05, 0x80, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x11, 0x60, 0x08, 0xe0, 0xf5}}, + {0x0c46, 64, { 0x11, 0x12, 0x0b, 0x41, 0x80, 0xea, 0x30, 0x14, 0x07, 0xc2, 0x14, 0x12, 0x09, 0x1e, 0x80, 0xe0, 0x30, + 0x18, 0xdd, 0xc2, 0x18, 0x12, 0x00, 0x26, 0x80, 0xd6, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, + 0x75, 0x81, 0x50, 0x02, 0x0c, 0xa8, 0x02, 0x0b, 0xd4, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, + 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8}}, + {0x0c86, 64, { 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4, + 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, + 0x80, 0x90, 0x0e, 0x04, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, + 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0}}, + {0x0cc6, 64, { 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, + 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, + 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, + 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22}}, + {0x0d06, 64, { 0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06, + 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5, + 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, 0x89, + 0x82, 0x8a, 0x83, 0xf0, 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22, 0xd0}}, + {0x0d46, 64, { 0x83, 0xd0, 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8, + 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, + 0xa3, 0xa3, 0x80, 0xdf, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0x90, + 0x7f, 0x96, 0x74, 0x10, 0xf0, 0x90, 0x7f, 0x94, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0x9d, 0x04}}, + {0x0d86, 64, { 0xf0, 0x90, 0x7f, 0x97, 0x74, 0x20, 0xf0, 0x90, 0x7f, 0x95, 0x74, 0x03, 0xf0, 0x90, 0x7f, 0x9e, 0x74, + 0x84, 0xf0, 0xe4, 0x90, 0x7f, 0x98, 0xf0, 0x90, 0x7f, 0xc7, 0xf0, 0x90, 0x7f, 0xc9, 0xf0, 0x90, + 0x7f, 0xcb, 0xf0, 0x75, 0x98, 0x40, 0x43, 0xa8, 0x10, 0x90, 0x7f, 0xde, 0x74, 0x1f, 0xf0, 0x90, + 0x7f, 0xdf, 0x74, 0x0f, 0xf0, 0xd2, 0x15, 0x22, 0xe4, 0x90, 0x7f, 0x95, 0xf0, 0x90, 0x7f}}, + {0x0dc6, 64, { 0x94, 0xf0, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9d, 0xe0, 0x44, 0x02, 0xf0, 0x90, 0x7f, 0x97, 0xe0, + 0x44, 0x02, 0xf0, 0x90, 0x7f, 0x9d, 0xe0, 0x54, 0xfd, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x20, 0xf0, + 0xe4, 0x90, 0x7f, 0x96, 0xf0, 0x90, 0x7f, 0x9d, 0xe0, 0x44, 0xfd, 0xf0, 0xe4, 0x90, 0x7f, 0x97, + 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x98, 0xf0, 0x22, 0x0c, 0x24}}, + {0x0e06, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x30, 0x00, 0x01, 0x33, + 0x01, 0x01, 0x32, 0x00, 0x01, 0x37, 0x00, 0x01, 0x50, 0x00, 0x01, 0x36, 0x00, 0x01, 0x34, 0x00, + 0xc1, 0x05, 0xc1, 0x0c, 0xc1, 0x03, 0xc1, 0x0f, 0xc1, 0x04, 0xc1, 0x0e, 0xc1, 0x11, 0xc1, 0x0a, + 0xc1, 0x10, 0xc1, 0x08, 0xc1, 0x09, 0xc1, 0x06, 0xc1, 0x00, 0xc1, 0x0d, 0xc1, 0x81, 0xc1}}, + {0x0e46, 64, { 0x82, 0x00, 0x8f, 0x13, 0xe4, 0xf5, 0x14, 0x75, 0x15, 0xff, 0x75, 0x16, 0x0f, 0x75, 0x17, 0xb9, 0xab, + 0x15, 0xaa, 0x16, 0xa9, 0x17, 0x90, 0x00, 0x01, 0x12, 0x0d, 0x06, 0xb4, 0x03, 0x1d, 0xaf, 0x14, + 0x05, 0x14, 0xef, 0xb5, 0x13, 0x01, 0x22, 0x12, 0x0c, 0xed, 0x7e, 0x00, 0x29, 0xff, 0xee, 0x3a, + 0xa9, 0x07, 0x75, 0x15, 0xff, 0xf5, 0x16, 0x89, 0x17, 0x80, 0xd4, 0x7b, 0x00, 0x7a, 0x00}}, + {0x0e86, 64, { 0x79, 0x00, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, + 0x00, 0x90, 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, - 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90, 0x7f, 0xc4, 0xe4}}, - {0x0ec6, 64, { 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, - 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, - 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, 0x87, - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x02, 0x0f, 0x0f, 0x00, 0x02, 0x0f}}, - {0x0f06, 64, { 0x04, 0x00, 0x02, 0x0e, 0xb3, 0x00, 0x02, 0x0e, 0x85, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, - 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x14, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, - 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, - 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x19, 0x04, 0xe0, 0x44}}, - {0x0f46, 64, { 0x02, 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x00, 0x03, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0xe0, - 0x44, 0x04, 0xf0, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x00, + 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x14, 0x53, 0x91}}, + {0x0ec6, 64, { 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, + 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x19, + 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x00, 0x03, 0x90, 0x7f, 0xd6, 0xe0, + 0x54, 0xf7, 0xf0, 0xe0, 0x44, 0x04, 0xf0, 0x22, 0x00, 0x02, 0x0e, 0xb3, 0x00, 0x02, 0x0f}}, + {0x0f06, 64, { 0x04, 0x00, 0x02, 0x0e, 0x89, 0x00, 0x02, 0x0f, 0x0f, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, + 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x18, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, + 0x08, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x74, + 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9}}, + {0x0f46, 64, { 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x10, 0x01, 0xff, 0x00, 0x00, 0x40, 0xcd, 0x06, 0x07, 0x01, 0x01, 0x00, 0x01, 0x02, 0x00, 0x02, 0x09, 0x02, 0x43, 0x00, 0x01, 0x01, 0x00, 0x80, 0x32, 0x09, 0x04, 0x00, 0x00, 0x07, 0xff, 0x00}}, {0x0f86, 64, { 0x00, 0x00, 0x07, 0x05, 0x01, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x02, 0x02, 0x40, 0x00, 0x00, 0x07, @@ -276,5 +281,5 @@ 0x00, 0x01, 0x04, 0x03, 0x09, 0x04, 0x10, 0x03, 0x4b, 0x00, 0x65, 0x00, 0x79, 0x00, 0x73}}, {0x0fc6, 23, { 0x00, 0x70, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x0e, 0x03, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x00, 0x00}}, -{ 0xffff, 0, {0x00} } + {0xffff, 0, {0x00} } }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa19qi_fw.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa19qi_fw.h --- linux.20pre5/drivers/usb/serial/keyspan_usa19qi_fw.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa19qi_fw.h 2002-09-01 13:39:31.000000000 +0100 @@ -0,0 +1,284 @@ +/* keyspan_usa19qi_fw.h + + The firmware contained herein as keyspn_usa19qi_fw.h is + + Copyright (C) 1999-2001 + Keyspan, A division of InnoSys Incorporated ("Keyspan") + + as an unpublished work. This notice does not imply unrestricted or + public access to the source code from which this firmware image is + derived. Except as noted below this firmware image may not be + reproduced, used, sold or transferred to any third party without + Keyspan's prior written consent. All Rights Reserved. + + Permission is hereby granted for the distribution of this firmware + image as part of a Linux or other Open Source operating system kernel + in text or binary form as required. + + This firmware may not be modified and may only be used with + Keyspan hardware. Distribution and/or Modification of the + keyspan.c driver which includes this firmware, in whole or in + part, requires the inclusion of this statement." + +*/ + +static const struct ezusb_hex_record keyspan_usa19qi_firmware[] = { + {0x0033, 3, { 0x02, 0x00, 0x1a}}, + {0x001a, 4, { 0x53, 0xd8, 0xef, 0x32}}, + {0x0003, 16, { 0x8e, 0x11, 0x8f, 0x12, 0xe5, 0x12, 0x15, 0x12, 0xae, 0x11, 0x70, 0x02, 0x15, 0x11, 0x4e, 0x60}}, + {0x0013, 7, { 0x05, 0x12, 0x0f, 0x84, 0x80, 0xee, 0x22}}, + {0x0023, 3, { 0x02, 0x00, 0x46}}, + {0x0046, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0, 0xd0, 0x75, 0xd0, 0x08}}, + {0x0056, 16, { 0x30, 0x99, 0x0e, 0x30, 0x0b, 0x07, 0xa2, 0x0e, 0x92, 0x9b, 0x85, 0x36, 0x99, 0xc2, 0x99, 0xd2}}, + {0x0066, 16, { 0x12, 0x20, 0x12, 0x03, 0x02, 0x04, 0x1e, 0xc2, 0x12, 0x20, 0x03, 0x03, 0x02, 0x02, 0x4e, 0x20}}, + {0x0076, 16, { 0x0b, 0x03, 0x02, 0x01, 0x26, 0xe5, 0x3a, 0xc3, 0x95, 0x53, 0x50, 0x3c, 0x20, 0x0c, 0x34, 0x20}}, + {0x0086, 16, { 0x09, 0x31, 0x90, 0x7f, 0x9b, 0xe0, 0x55, 0x38, 0x70, 0x29, 0x30, 0x10, 0x12, 0xaf, 0x3a, 0x05}}, + {0x0096, 16, { 0x3a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x0e, 0xaf}}, + {0x00a6, 16, { 0x3a, 0x05, 0x3a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0xf5, 0x36}}, + {0x00b6, 16, { 0x02, 0x04, 0x1c, 0xc2, 0x0b, 0x02, 0x04, 0x1c, 0x90, 0x7f, 0xc7, 0xe4, 0xf0, 0xc2, 0x03, 0x30}}, + {0x00c6, 16, { 0x0d, 0x0c, 0xc2, 0x0d, 0x90, 0x7f, 0xbb, 0x04, 0xf0, 0xc2, 0x0b, 0x02, 0x04, 0x1c, 0x90, 0x7f}}, + {0x00d6, 16, { 0xc8, 0xe0, 0x30, 0xe1, 0x05, 0xc2, 0x0b, 0x02, 0x04, 0x1c, 0x90, 0x7f, 0xc9, 0xe0, 0xf5, 0x53}}, + {0x00e6, 16, { 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x0d, 0x75, 0x16, 0xff, 0x20, 0x0c, 0x2b, 0x20, 0x09, 0x28}}, + {0x00f6, 16, { 0x90, 0x7f, 0x9b, 0xe0, 0x55, 0x38, 0x70, 0x20, 0x30, 0x10, 0x11, 0x90, 0x7d, 0xc1, 0xe0, 0x13}}, + {0x0043, 3, { 0x02, 0x0e, 0x00}}, + {0x0000, 3, { 0x02, 0x00, 0x26}}, + {0x0026, 12, { 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x54, 0x02, 0x0b, 0x28}}, + {0x0106, 64, { 0x92, 0x0e, 0xa3, 0xe0, 0xf5, 0x36, 0x75, 0x3a, 0x03, 0x02, 0x04, 0x1c, 0x75, 0x3a, 0x02, 0x90, 0x7d, + 0xc1, 0xe0, 0xf5, 0x36, 0x02, 0x04, 0x1c, 0x75, 0x3a, 0x01, 0xc2, 0x0b, 0x02, 0x04, 0x1c, 0xe5, + 0x3a, 0xc3, 0x95, 0x53, 0x50, 0x03, 0x02, 0x01, 0xc9, 0x90, 0x7f, 0xc6, 0xe0, 0x30, 0xe1, 0x07, + 0xc2, 0x14, 0xc2, 0x05, 0x02, 0x04, 0x1c, 0x90, 0x7f, 0xc7, 0xe0, 0xf5, 0x53, 0x90, 0x7e}}, + {0x0146, 64, { 0x40, 0xe0, 0x13, 0x92, 0x0d, 0x75, 0x16, 0xff, 0x20, 0x0c, 0x70, 0x20, 0x09, 0x6d, 0x90, 0x7f, 0x9b, + 0xe0, 0x55, 0x38, 0x70, 0x65, 0x30, 0x10, 0x10, 0x90, 0x7e, 0x41, 0xe0, 0x13, 0x92, 0x9b, 0xa3, + 0xe0, 0xf5, 0x99, 0x75, 0x3a, 0x03, 0x80, 0x09, 0x90, 0x7e, 0x41, 0xe0, 0xf5, 0x99, 0x75, 0x3a, + 0x02, 0xe5, 0x3a, 0xc3, 0x95, 0x53, 0x40, 0x17, 0x90, 0x7f, 0xc7, 0xe4, 0xf0, 0xc2, 0x03}}, + {0x0186, 64, { 0x20, 0x0d, 0x03, 0x02, 0x04, 0x1c, 0xc2, 0x0d, 0x90, 0x7f, 0xbb, 0x04, 0xf0, 0x02, 0x04, 0x1c, 0x30, + 0x10, 0x12, 0xaf, 0x3a, 0x05, 0x3a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, + 0xe0, 0x13, 0x92, 0x0e, 0xaf, 0x3a, 0x05, 0x3a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, + 0xf5, 0x83, 0xe0, 0xf5, 0x36, 0xd2, 0x0b, 0x02, 0x04, 0x1c, 0x75, 0x3a, 0x01, 0xc2, 0x14}}, + {0x01c6, 64, { 0x02, 0x04, 0x1c, 0x30, 0x0c, 0x03, 0x02, 0x02, 0x49, 0x20, 0x09, 0x77, 0x90, 0x7f, 0x9b, 0xe0, 0x55, + 0x38, 0x70, 0x6f, 0x30, 0x10, 0x12, 0xaf, 0x3a, 0x05, 0x3a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, + 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x9b, 0xaf, 0x3a, 0x05, 0x3a, 0x74, 0x40, 0x2f, 0xf5, + 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0xf5, 0x99, 0xe5, 0x3a, 0xc3, 0x95, 0x53, 0x40}}, + {0x0206, 64, { 0x17, 0x90, 0x7f, 0xc7, 0xe4, 0xf0, 0xc2, 0x03, 0x20, 0x0d, 0x03, 0x02, 0x04, 0x1c, 0xc2, 0x0d, 0x90, + 0x7f, 0xbb, 0x04, 0xf0, 0x02, 0x04, 0x1c, 0x30, 0x10, 0x12, 0xaf, 0x3a, 0x05, 0x3a, 0x74, 0x40, + 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x0e, 0xaf, 0x3a, 0x05, 0x3a, + 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0xf5, 0x36, 0xd2, 0x0b}}, + {0x0246, 64, { 0x02, 0x04, 0x1c, 0xc2, 0x14, 0x02, 0x04, 0x1c, 0x20, 0x0b, 0x03, 0x02, 0x02, 0xff, 0xe5, 0x3a, 0xc3, + 0x95, 0x53, 0x50, 0x3c, 0x20, 0x0c, 0x34, 0x20, 0x09, 0x31, 0x90, 0x7f, 0x9b, 0xe0, 0x55, 0x38, + 0x70, 0x29, 0x30, 0x10, 0x12, 0xaf, 0x3a, 0x05, 0x3a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, + 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x0e, 0xaf, 0x3a, 0x05, 0x3a, 0x74, 0xc0, 0x2f, 0xf5}}, + {0x0286, 64, { 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, 0x36, 0x02, 0x04, 0x1c, 0xc2, 0x0b, 0x02, 0x04, 0x1c, + 0x90, 0x7f, 0xc9, 0xe4, 0xf0, 0xd2, 0x03, 0x30, 0x0d, 0x0c, 0xc2, 0x0d, 0x90, 0x7f, 0xbb, 0x04, + 0xf0, 0xc2, 0x0b, 0x02, 0x04, 0x1c, 0x90, 0x7f, 0xc6, 0xe0, 0x30, 0xe1, 0x05, 0xc2, 0x0b, 0x02, + 0x04, 0x1c, 0x90, 0x7f, 0xc7, 0xe0, 0xf5, 0x53, 0x90, 0x7e, 0x40, 0xe0, 0x13, 0x92, 0x0d}}, + {0x02c6, 64, { 0x75, 0x16, 0xff, 0x20, 0x0c, 0x2b, 0x20, 0x09, 0x28, 0x90, 0x7f, 0x9b, 0xe0, 0x55, 0x38, 0x70, 0x20, + 0x30, 0x10, 0x11, 0x90, 0x7e, 0x41, 0xe0, 0x13, 0x92, 0x0e, 0xa3, 0xe0, 0xf5, 0x36, 0x75, 0x3a, + 0x03, 0x02, 0x04, 0x1c, 0x75, 0x3a, 0x02, 0x90, 0x7e, 0x41, 0xe0, 0xf5, 0x36, 0x02, 0x04, 0x1c, + 0x75, 0x3a, 0x01, 0xc2, 0x0b, 0x02, 0x04, 0x1c, 0xe5, 0x3a, 0xc3, 0x95, 0x53, 0x50, 0x03}}, + {0x0306, 64, { 0x02, 0x03, 0xa2, 0x90, 0x7f, 0xc8, 0xe0, 0x30, 0xe1, 0x07, 0xc2, 0x14, 0xc2, 0x05, 0x02, 0x04, 0x1c, + 0x90, 0x7f, 0xc9, 0xe0, 0xf5, 0x53, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x0d, 0x75, 0x16, 0xff, + 0x20, 0x0c, 0x70, 0x20, 0x09, 0x6d, 0x90, 0x7f, 0x9b, 0xe0, 0x55, 0x38, 0x70, 0x65, 0x30, 0x10, + 0x10, 0x90, 0x7d, 0xc1, 0xe0, 0x13, 0x92, 0x9b, 0xa3, 0xe0, 0xf5, 0x99, 0x75, 0x3a, 0x03}}, + {0x0346, 64, { 0x80, 0x09, 0x90, 0x7d, 0xc1, 0xe0, 0xf5, 0x99, 0x75, 0x3a, 0x02, 0xe5, 0x3a, 0xc3, 0x95, 0x53, 0x40, + 0x17, 0x90, 0x7f, 0xc9, 0xe4, 0xf0, 0xd2, 0x03, 0x20, 0x0d, 0x03, 0x02, 0x04, 0x1c, 0xc2, 0x0d, + 0x90, 0x7f, 0xbb, 0x04, 0xf0, 0x02, 0x04, 0x1c, 0x30, 0x10, 0x12, 0xaf, 0x3a, 0x05, 0x3a, 0x74, + 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x0e, 0xaf, 0x3a}}, + {0x0386, 64, { 0x05, 0x3a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, 0x36, 0xd2, 0x0b, + 0x02, 0x04, 0x1c, 0x75, 0x3a, 0x01, 0xc2, 0x14, 0x02, 0x04, 0x1c, 0x20, 0x0c, 0x75, 0x20, 0x09, + 0x72, 0x90, 0x7f, 0x9b, 0xe0, 0x55, 0x38, 0x70, 0x6a, 0x30, 0x10, 0x12, 0xaf, 0x3a, 0x05, 0x3a, + 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x9b, 0xaf}}, + {0x03c6, 64, { 0x3a, 0x05, 0x3a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, 0x99, 0xe5, + 0x3a, 0xc3, 0x95, 0x53, 0x40, 0x13, 0x90, 0x7f, 0xc9, 0xe4, 0xf0, 0xd2, 0x03, 0x30, 0x0d, 0x35, + 0xc2, 0x0d, 0x90, 0x7f, 0xbb, 0x04, 0xf0, 0x80, 0x2c, 0x30, 0x10, 0x12, 0xaf, 0x3a, 0x05, 0x3a, + 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x0e, 0xaf}}, + {0x0406, 64, { 0x3a, 0x05, 0x3a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, 0x36, 0xd2, + 0x0b, 0x80, 0x02, 0xc2, 0x14, 0xd2, 0x01, 0x20, 0x98, 0x03, 0x02, 0x05, 0x5a, 0xc2, 0x98, 0x20, + 0x02, 0x03, 0x02, 0x04, 0xc7, 0x20, 0x16, 0x27, 0xaf, 0x39, 0x05, 0x39, 0x74, 0x80, 0x2f, 0xf5, + 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe5, 0x99, 0xf0, 0x30, 0x10, 0x4d, 0xaf, 0x39, 0x05}}, + {0x0446, 64, { 0x39, 0x74, 0x80, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe5, 0x98, 0xf0, 0x80, 0x3a, 0x85, + 0x99, 0x10, 0xe5, 0x10, 0xb5, 0x47, 0x04, 0xd2, 0x09, 0x80, 0x2e, 0xe5, 0x10, 0xb5, 0x46, 0x04, + 0xc2, 0x09, 0x80, 0x25, 0xaf, 0x39, 0x05, 0x39, 0x74, 0x80, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, + 0xf5, 0x83, 0xe5, 0x10, 0xf0, 0x30, 0x10, 0x11, 0xaf, 0x39, 0x05, 0x39, 0x74, 0x80, 0x2f}}, + {0x0486, 64, { 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe5, 0x98, 0xf0, 0xd2, 0x0f, 0xe5, 0x39, 0xc3, 0x95, 0x43, + 0x50, 0x03, 0x02, 0x05, 0x58, 0x90, 0x7f, 0xb8, 0xe0, 0x30, 0xe1, 0x16, 0xe5, 0x39, 0xc3, 0x94, + 0x40, 0x50, 0x03, 0x02, 0x05, 0x58, 0x15, 0x39, 0x15, 0x39, 0x05, 0x2b, 0x43, 0x34, 0x01, 0x02, + 0x05, 0x58, 0x90, 0x7f, 0xb7, 0xe5, 0x39, 0xf0, 0x75, 0x39, 0x00, 0xc2, 0x02, 0x02, 0x05}}, + {0x04c6, 64, { 0x58, 0x20, 0x16, 0x27, 0xaf, 0x39, 0x05, 0x39, 0x74, 0x00, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, + 0x83, 0xe5, 0x99, 0xf0, 0x30, 0x10, 0x4d, 0xaf, 0x39, 0x05, 0x39, 0x74, 0x00, 0x2f, 0xf5, 0x82, + 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe5, 0x98, 0xf0, 0x80, 0x3a, 0x85, 0x99, 0x10, 0xe5, 0x10, 0xb5, + 0x47, 0x04, 0xd2, 0x09, 0x80, 0x2e, 0xe5, 0x10, 0xb5, 0x46, 0x04, 0xc2, 0x09, 0x80, 0x25}}, + {0x0506, 64, { 0xaf, 0x39, 0x05, 0x39, 0x74, 0x00, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe5, 0x10, 0xf0, + 0x30, 0x10, 0x11, 0xaf, 0x39, 0x05, 0x39, 0x74, 0x00, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, + 0x83, 0xe5, 0x98, 0xf0, 0xd2, 0x0f, 0xe5, 0x39, 0xc3, 0x95, 0x43, 0x40, 0x24, 0x90, 0x7f, 0xb6, + 0xe0, 0x30, 0xe1, 0x12, 0xe5, 0x39, 0xc3, 0x94, 0x40, 0x40, 0x16, 0x15, 0x39, 0x15, 0x39}}, + {0x0546, 64, { 0x05, 0x2b, 0x43, 0x34, 0x01, 0x80, 0x0b, 0x90, 0x7f, 0xb9, 0xe5, 0x39, 0xf0, 0x75, 0x39, 0x00, 0xd2, + 0x02, 0xd2, 0x01, 0x30, 0x01, 0x05, 0xc2, 0x01, 0x02, 0x00, 0x56, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, + 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0xbc, 0xe0, 0x20, 0xe1, 0x51, 0xe5, 0x34, 0x60, + 0x4d, 0xe5, 0x31, 0x70, 0x49, 0xe5, 0x34, 0x30, 0xe1, 0x08, 0xe4, 0xf5, 0x2f, 0x75, 0x34}}, + {0x0586, 64, { 0x01, 0x80, 0x0b, 0xa2, 0x08, 0xe4, 0x33, 0xf5, 0x2f, 0xc2, 0x08, 0xe4, 0xf5, 0x34, 0xe4, 0xf5, 0x11, + 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x11, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0d, 0x06, + 0xff, 0x74, 0x00, 0x25, 0x11, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x11, + 0xe5, 0x11, 0xb4, 0x0c, 0xdb, 0x90, 0x7f, 0xbd, 0x74, 0x0c, 0xf0, 0x75, 0x31, 0x10, 0x90}}, + {0x05c6, 64, { 0x7f, 0xca, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x06, 0xf3, 0xe4, 0xf5, 0x11, 0x74, 0x40, 0x25, 0x11, 0xf5, + 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x11, 0x7c, 0x00, 0x7b, 0x00, 0x24, 0x3b, + 0xf9, 0xec, 0x34, 0x00, 0xfa, 0xef, 0x12, 0x0d, 0x1f, 0x05, 0x11, 0xe5, 0x11, 0xb4, 0x18, 0xdb, + 0xe5, 0x3b, 0x60, 0x11, 0x75, 0xc9, 0x20, 0x75, 0xc8, 0x36, 0x85, 0x3c, 0xca, 0x85, 0x3d}}, + {0x0606, 64, { 0xcb, 0xe4, 0x90, 0x7f, 0x9f, 0xf0, 0xe5, 0x3e, 0x13, 0x92, 0x10, 0x92, 0x9f, 0x85, 0x3f, 0x38, 0xe5, + 0x40, 0x13, 0x92, 0x16, 0xe5, 0x41, 0x60, 0x09, 0x90, 0x7f, 0x98, 0xe0, 0x54, 0xfb, 0xf0, 0x80, + 0x07, 0x90, 0x7f, 0x98, 0xe0, 0x44, 0x04, 0xf0, 0xe5, 0x42, 0x60, 0x09, 0x90, 0x7f, 0x98, 0xe0, + 0x54, 0x7f, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0x98, 0xe0, 0x44, 0x80, 0xf0, 0xe5, 0x48, 0x60}}, + {0x0646, 64, { 0x0b, 0xc2, 0x0c, 0xc2, 0x09, 0x90, 0x7f, 0x95, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x49, 0x60, 0x0c, 0xd2, + 0x09, 0x43, 0x34, 0x01, 0x90, 0x7f, 0x95, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x4a, 0x60, 0x0d, 0xc2, + 0xaf, 0xc2, 0x0b, 0xd2, 0x00, 0xe4, 0xf5, 0x53, 0xf5, 0x3a, 0xd2, 0xaf, 0xe5, 0x4b, 0x60, 0x05, + 0x30, 0x16, 0x02, 0xd2, 0x09, 0xe5, 0x4c, 0x60, 0x15, 0x90, 0x7f, 0x95, 0xe0, 0x54, 0xfd}}, + {0x0686, 64, { 0xf0, 0x90, 0x7f, 0x9e, 0xe0, 0x44, 0x02, 0xf0, 0x90, 0x7f, 0x98, 0xe0, 0x54, 0xfd, 0xf0, 0xe5, 0x4d, + 0x60, 0x0a, 0xd2, 0x9c, 0xc2, 0x98, 0x75, 0x2c, 0x01, 0x75, 0x31, 0x1e, 0xe5, 0x4e, 0x60, 0x07, + 0xc2, 0x9c, 0xe4, 0xf5, 0x39, 0xf5, 0x2c, 0xe5, 0x4f, 0x60, 0x03, 0xe4, 0xf5, 0x39, 0xe5, 0x50, + 0x60, 0x02, 0xd2, 0x07, 0xe5, 0x51, 0x60, 0x0a, 0xe5, 0x4d, 0x70, 0x02, 0xf5, 0x31, 0xe5}}, + {0x06c6, 64, { 0x51, 0x42, 0x34, 0xe5, 0x52, 0x60, 0x1f, 0x90, 0x7f, 0xd7, 0x74, 0x11, 0xf0, 0x74, 0x31, 0xf0, 0x74, + 0x12, 0xf0, 0x74, 0x32, 0xf0, 0x74, 0x13, 0xf0, 0x74, 0x33, 0xf0, 0x74, 0x14, 0xf0, 0x74, 0x34, + 0xf0, 0xd2, 0x03, 0xd2, 0x02, 0xd2, 0x08, 0xe4, 0x90, 0x7f, 0xcb, 0xf0, 0xa2, 0x0c, 0xe4, 0x33, + 0xff, 0x65, 0x29, 0x60, 0x05, 0x8f, 0x29, 0x43, 0x34, 0x01, 0xa2, 0x09, 0xe4, 0x33, 0xff}}, + {0x0706, 64, { 0x65, 0x2a, 0x60, 0x05, 0x8f, 0x2a, 0x43, 0x34, 0x01, 0x90, 0x7f, 0x9b, 0xe0, 0xff, 0x54, 0x08, 0x64, + 0x08, 0xfe, 0x65, 0x25, 0x60, 0x05, 0x8e, 0x25, 0x43, 0x34, 0x01, 0xef, 0x54, 0x10, 0x64, 0x10, + 0xfe, 0x65, 0x26, 0x60, 0x05, 0x8e, 0x26, 0x43, 0x34, 0x01, 0xef, 0x54, 0x40, 0x64, 0x40, 0xfe, + 0x65, 0x27, 0x60, 0x05, 0x8e, 0x27, 0x43, 0x34, 0x01, 0xef, 0x54, 0x20, 0x64, 0x20, 0xfe}}, + {0x0746, 64, { 0x65, 0x28, 0x60, 0x05, 0x8e, 0x28, 0x43, 0x34, 0x01, 0x90, 0x7f, 0x9a, 0xe0, 0x54, 0x40, 0x64, 0x40, + 0xfe, 0x65, 0x2e, 0x60, 0x05, 0x8e, 0x2e, 0x43, 0x34, 0x01, 0x30, 0x07, 0x35, 0xc2, 0xaf, 0x30, + 0x02, 0x18, 0x90, 0x7f, 0xb8, 0xe0, 0x20, 0xe1, 0x27, 0xe5, 0x39, 0x60, 0x09, 0x90, 0x7f, 0xb7, + 0xf0, 0xe4, 0xf5, 0x39, 0xc2, 0x02, 0xc2, 0x07, 0x80, 0x16, 0x90, 0x7f, 0xb6, 0xe0, 0x20}}, + {0x0786, 64, { 0xe1, 0x0f, 0xe5, 0x39, 0x60, 0x09, 0x90, 0x7f, 0xb9, 0xf0, 0xe4, 0xf5, 0x39, 0xd2, 0x02, 0xc2, 0x07, + 0xd2, 0xaf, 0x20, 0x05, 0x3d, 0x30, 0x03, 0x1e, 0x90, 0x7f, 0xc6, 0xe0, 0x20, 0xe1, 0x33, 0x90, + 0x7e, 0x40, 0xe0, 0x13, 0x92, 0x0d, 0x75, 0x3a, 0x01, 0x90, 0x7f, 0xc7, 0xe0, 0xf5, 0x53, 0xd2, + 0x05, 0x75, 0x16, 0xff, 0x80, 0x1c, 0x90, 0x7f, 0xc8, 0xe0, 0x20, 0xe1, 0x15, 0x90, 0x7d}}, + {0x07c6, 64, { 0xc0, 0xe0, 0x13, 0x92, 0x0d, 0x75, 0x3a, 0x01, 0x90, 0x7f, 0xc9, 0xe0, 0xf5, 0x53, 0xd2, 0x05, 0x75, + 0x16, 0xff, 0x20, 0x14, 0x33, 0x20, 0x00, 0x06, 0xe5, 0x3a, 0x65, 0x53, 0x70, 0x2a, 0x30, 0x05, + 0x1a, 0x30, 0x03, 0x09, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0xc2, 0x03, 0x80, 0x07, 0xe4, 0x90, 0x7f, + 0xc9, 0xf0, 0xd2, 0x03, 0xc2, 0x05, 0xe4, 0xf5, 0x53, 0xf5, 0x3a, 0x30, 0x0d, 0x0a, 0xc2}}, + {0x0806, 64, { 0x0d, 0xc2, 0x00, 0x90, 0x7f, 0xbb, 0x74, 0x01, 0xf0, 0x30, 0x14, 0x03, 0x02, 0x09, 0x14, 0x20, 0x05, + 0x03, 0x02, 0x09, 0x14, 0x30, 0x0c, 0x03, 0x02, 0x09, 0x14, 0x30, 0x09, 0x03, 0x02, 0x09, 0x14, + 0x90, 0x7f, 0x9b, 0xe0, 0x55, 0x38, 0x60, 0x03, 0x02, 0x09, 0x14, 0x30, 0x03, 0x61, 0x30, 0x10, + 0x12, 0xaf, 0x3a, 0x05, 0x3a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83}}, + {0x0846, 64, { 0xe0, 0x13, 0x92, 0x1b, 0xaf, 0x3a, 0x05, 0x3a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, + 0x83, 0xe0, 0xfe, 0xe5, 0x3a, 0xc3, 0x95, 0x53, 0x50, 0x2a, 0x30, 0x10, 0x12, 0xaf, 0x3a, 0x05, + 0x3a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x0e, 0xaf, + 0x3a, 0x05, 0x3a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0xf5}}, + {0x0886, 64, { 0x36, 0xd2, 0x0b, 0x80, 0x6a, 0xc2, 0x0b, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0xc2, 0x03, 0x80, 0x5f, 0x30, + 0x10, 0x12, 0xaf, 0x3a, 0x05, 0x3a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, + 0xe0, 0x13, 0x92, 0x1b, 0xaf, 0x3a, 0x05, 0x3a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, + 0xf5, 0x83, 0xe0, 0xfe, 0xe5, 0x3a, 0xc3, 0x95, 0x53, 0x50, 0x2a, 0x30, 0x10, 0x12, 0xaf}}, + {0x08c6, 64, { 0x3a, 0x05, 0x3a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x0e, + 0xaf, 0x3a, 0x05, 0x3a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, + 0x36, 0xd2, 0x0b, 0x80, 0x09, 0xc2, 0x0b, 0xe4, 0x90, 0x7f, 0xc9, 0xf0, 0xd2, 0x03, 0x30, 0x10, + 0x04, 0xa2, 0x1b, 0x92, 0x9b, 0xd2, 0x14, 0xc2, 0xaf, 0x8e, 0x99, 0x20, 0x0b, 0x0d, 0x30}}, + {0x0906, 64, { 0x0d, 0x0a, 0xc2, 0x0d, 0xc2, 0x00, 0x90, 0x7f, 0xbb, 0x74, 0x01, 0xf0, 0xd2, 0xaf, 0x22, 0x90, 0x7f, + 0xe9, 0xe0, 0x12, 0x0d, 0x31, 0x0a, 0x11, 0x00, 0x0a, 0x7e, 0x01, 0x0a, 0xdb, 0x03, 0x09, 0x38, + 0x06, 0x0a, 0x02, 0x08, 0x09, 0xf6, 0x09, 0x09, 0xde, 0x0a, 0x09, 0xed, 0x0b, 0x00, 0x00, 0x0b, + 0x19, 0x90, 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x19, 0x14, 0x60, 0x5a, 0x24, 0x02, 0x60}}, + {0x0946, 64, { 0x03, 0x02, 0x0b, 0x19, 0x74, 0x0d, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x87, 0x90, 0x7f, 0xd5, 0xf0, 0x02, + 0x0b, 0x20, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x04, 0x7f, 0x02, 0x80, 0x02, 0x7f, 0x03, 0x75, 0x82, + 0xd8, 0x75, 0x83, 0x0d, 0xef, 0xf0, 0x75, 0x82, 0xd1, 0x75, 0x83, 0x0d, 0xf0, 0x75, 0x82, 0xca, + 0x75, 0x83, 0x0d, 0xf0, 0x75, 0x82, 0xc3, 0x75, 0x83, 0x0d, 0xf0, 0x90, 0x7f, 0xea, 0xe0}}, + {0x0986, 64, { 0x04, 0x75, 0x82, 0x9e, 0x75, 0x83, 0x0d, 0xf0, 0x74, 0x0d, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x99, 0x90, + 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x20, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x0b, 0x75, 0x11, 0xff, 0x75, + 0x12, 0x0d, 0x75, 0x13, 0xdc, 0x80, 0x1b, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x0b, 0x75, 0x11, + 0xff, 0x75, 0x12, 0x0d, 0x75, 0x13, 0xe0, 0x80, 0x09, 0x75, 0x11, 0xff, 0x75, 0x12, 0x0d}}, + {0x09c6, 64, { 0x75, 0x13, 0xf0, 0xaa, 0x12, 0xa9, 0x13, 0xae, 0x02, 0xee, 0x90, 0x7f, 0xd4, 0xf0, 0xaf, 0x01, 0xef, + 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x20, 0x90, 0x7f, 0x00, 0xe5, 0x15, 0xf0, 0x90, 0x7f, 0xb5, + 0x74, 0x01, 0xf0, 0x02, 0x0b, 0x20, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x15, 0x02, 0x0b, 0x20, 0x12, + 0x0c, 0xb1, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x14, 0x02, 0x0b, 0x20, 0x90, 0x7f, 0x00, 0xe5}}, + {0x0a06, 64, { 0x14, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x0b, 0x20, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, + 0x60, 0x27, 0x14, 0x60, 0x34, 0x24, 0x02, 0x60, 0x03, 0x02, 0x0b, 0x19, 0xa2, 0x17, 0xe4, 0x33, + 0xff, 0x25, 0xe0, 0xff, 0xa2, 0x19, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, + 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x20, 0xe4, 0x90, 0x7f, 0x00, 0xf0, 0xa3}}, + {0x0a46, 64, { 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, + 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, + 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, + 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x20, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x17}}, + {0x0a86, 64, { 0x24, 0x02, 0x60, 0x03, 0x02, 0x0b, 0x20, 0x90, 0x7f, 0xea, 0xe0, 0x64, 0x01, 0x60, 0x03, 0x02, 0x0b, + 0x19, 0xc2, 0x17, 0x02, 0x0b, 0x20, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x76, 0x90, 0x7f, 0xec, 0xe0, + 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, + 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f, 0xec, 0xe0, 0x54, 0x80}}, + {0x0ac6, 64, { 0xff, 0x13, 0x13, 0x13, 0x54, 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f, 0xd7, 0xf0, 0xe0, 0x44, + 0x20, 0xf0, 0x80, 0x45, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x10, 0x24, 0x02, 0x70, 0x39, + 0x90, 0x7f, 0xea, 0xe0, 0x64, 0x01, 0x70, 0x2a, 0xd2, 0x17, 0x80, 0x2d, 0x90, 0x7f, 0xea, 0xe0, + 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0}}, + {0x0b06, 64, { 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, + 0x80, 0x07, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0, + 0x22, 0xc2, 0x10, 0xe4, 0xf5, 0x14, 0xf5, 0x34, 0xc2, 0x09, 0xc2, 0x0c, 0xc2, 0x0b, 0xc2, 0x14, + 0xc2, 0x0d, 0xc2, 0x16, 0xc2, 0x11, 0xc2, 0x07, 0xc2, 0x12, 0xc2, 0x0f, 0xc2, 0x08, 0xf5}}, + {0x0b46, 64, { 0x35, 0xf5, 0x39, 0xf5, 0x53, 0xf5, 0x3a, 0xf5, 0x33, 0xf5, 0x30, 0xf5, 0x2f, 0xf5, 0x2e, 0xf5, 0x2d, + 0xf5, 0x2c, 0xf5, 0x2b, 0xf5, 0x2a, 0xf5, 0x29, 0xf5, 0x28, 0xf5, 0x27, 0xf5, 0x26, 0xf5, 0x25, + 0xf5, 0x24, 0xc2, 0x05, 0xc2, 0x18, 0xc2, 0x1a, 0xc2, 0x17, 0xc2, 0x19, 0xc2, 0x15, 0xc2, 0x04, + 0xd2, 0x13, 0xc2, 0x06, 0xc2, 0x01, 0x90, 0x7f, 0x92, 0xe0, 0x54, 0xfd, 0xf0, 0xd2, 0xe8}}, + {0x0b86, 64, { 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xab, 0x74, + 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaf, + 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x0f, 0xf0, 0x90, 0x7f, 0xac, 0x74, 0x0e, + 0xf0, 0xd2, 0xaf, 0xd2, 0xbc, 0xd2, 0x1b, 0x12, 0x0f, 0x5f, 0xc2, 0x18, 0x30, 0x04, 0x03}}, + {0x0bc6, 64, { 0x12, 0x05, 0x6d, 0x30, 0x04, 0x2a, 0x30, 0x06, 0x27, 0xc2, 0x06, 0xe5, 0x16, 0x60, 0x16, 0x15, 0x16, + 0x90, 0x7f, 0xd8, 0xe0, 0x30, 0xe6, 0x04, 0x7f, 0x00, 0x80, 0x02, 0x7f, 0x20, 0x90, 0x7f, 0x96, + 0xef, 0xf0, 0x80, 0x06, 0x90, 0x7f, 0x96, 0x74, 0x20, 0xf0, 0x12, 0x0c, 0x0b, 0x80, 0xcd, 0x30, + 0x18, 0x07, 0xc2, 0x18, 0x12, 0x09, 0x15, 0x80, 0xc3, 0x30, 0x1a, 0xc0, 0xc2, 0x1a, 0x12}}, + {0x0c06, 64, { 0x0f, 0xbb, 0x80, 0xb9, 0x22, 0xe5, 0x31, 0x60, 0x02, 0x15, 0x31, 0xe5, 0x39, 0x60, 0x55, 0x65, 0x35, + 0x70, 0x4b, 0xe5, 0x33, 0xf4, 0x60, 0x02, 0x05, 0x33, 0xe5, 0x33, 0xc3, 0x95, 0x44, 0x40, 0x43, + 0xc2, 0xaf, 0x30, 0x02, 0x1b, 0x90, 0x7f, 0xb8, 0xe0, 0x20, 0xe1, 0x2d, 0x90, 0x7f, 0xb7, 0xe5, + 0x39, 0xf0, 0xc2, 0x02, 0xe4, 0xf5, 0x39, 0xf5, 0x33, 0xf5, 0x35, 0x75, 0x16, 0xff, 0x80}}, + {0x0c46, 64, { 0x19, 0x90, 0x7f, 0xb6, 0xe0, 0x20, 0xe1, 0x12, 0x90, 0x7f, 0xb9, 0xe5, 0x39, 0xf0, 0xd2, 0x02, 0xe4, + 0xf5, 0x39, 0xf5, 0x33, 0xf5, 0x35, 0x75, 0x16, 0xff, 0xd2, 0xaf, 0x80, 0x06, 0x85, 0x39, 0x35, + 0xe4, 0xf5, 0x33, 0xe5, 0x2c, 0x60, 0x30, 0x20, 0x0f, 0x07, 0x90, 0x7f, 0x9b, 0xe0, 0x30, 0xe0, + 0x0f, 0xe5, 0x2d, 0x60, 0x06, 0xe4, 0xf5, 0x2d, 0x43, 0x34, 0x01, 0xe4, 0xf5, 0x30, 0x80}}, + {0x0c86, 64, { 0x14, 0xe5, 0x30, 0xd3, 0x95, 0x45, 0x50, 0x0d, 0xe5, 0x30, 0xb5, 0x45, 0x06, 0x75, 0x2d, 0x01, 0x43, + 0x34, 0x01, 0x05, 0x30, 0xc2, 0x0f, 0x22, 0x90, 0x7f, 0xd9, 0xe0, 0x30, 0xe2, 0x04, 0x7f, 0x00, + 0x80, 0x02, 0x7f, 0x20, 0x90, 0x7f, 0x96, 0xef, 0xf0, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, + 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0x90, 0x7f, 0x96, 0x74, 0x20, 0xf0, 0x90, 0x7f, 0x94, 0x74}}, + {0x0cc6, 64, { 0x01, 0xf0, 0x90, 0x7f, 0x9d, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x97, 0x74, 0x86, 0xf0, 0x90, 0x7f, 0x95, + 0x74, 0x03, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x84, 0xf0, 0x90, 0x7f, 0x98, 0xf0, 0xe4, 0x90, 0x7f, + 0xc7, 0xf0, 0x90, 0x7f, 0xc9, 0xf0, 0x90, 0x7f, 0xcb, 0xf0, 0x75, 0x98, 0x40, 0x43, 0xa8, 0x10, + 0x90, 0x7f, 0xde, 0x74, 0x1f, 0xf0, 0x90, 0x7f, 0xdf, 0x74, 0x0f, 0xf0, 0xd2, 0x04, 0x22}}, + {0x0d06, 64, { 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02, 0xe3, + 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xf0, + 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22, 0xd0, 0x83, 0xd0, 0x82, 0xf8, 0xe4, + 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01, 0x93}}, + {0x0d46, 64, { 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, 0xa3, 0x80, 0xdf, + 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90, + 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, + 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x0d86, 64, { 0x00, 0x12, 0x01, 0x10, 0x01, 0xff, 0x00, 0x00, 0x40, 0xcd, 0x06, 0x0c, 0x01, 0x01, 0x00, 0x01, 0x02, + 0x00, 0x02, 0x09, 0x02, 0x43, 0x00, 0x01, 0x01, 0x00, 0x80, 0x32, 0x09, 0x04, 0x00, 0x00, 0x07, + 0xff, 0x00, 0x00, 0x00, 0x07, 0x05, 0x01, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x02, 0x02, 0x40, + 0x00, 0x00, 0x07, 0x05, 0x03, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x81, 0x02, 0x40, 0x00}}, + {0x0dc6, 64, { 0x01, 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x83, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, + 0x84, 0x02, 0x40, 0x00, 0x01, 0x04, 0x03, 0x09, 0x04, 0x10, 0x03, 0x4b, 0x00, 0x65, 0x00, 0x79, + 0x00, 0x73, 0x00, 0x70, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x0e, 0x03, 0x53, 0x00, 0x65, 0x00, 0x72, + 0x00, 0x69, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x02, 0x0e, 0xa2, 0x00, 0x02, 0x0e}}, + {0x0e06, 64, { 0x7b, 0x00, 0x02, 0x0d, 0x57, 0x00, 0x02, 0x0e, 0xc9, 0x00, 0x02, 0x0e, 0x10, 0x00, 0x02, 0x0e, 0x14, + 0x00, 0x02, 0x0e, 0x18, 0x00, 0x02, 0x0e, 0x1c, 0x00, 0x02, 0x0e, 0xf0, 0x00, 0x02, 0x0e, 0x24, + 0x00, 0x02, 0x0f, 0x15, 0x00, 0x02, 0x0e, 0x2c, 0x00, 0x02, 0x0f, 0x3a, 0xe4, 0x90, 0x7f, 0x95, + 0xf0, 0x90, 0x7f, 0x94, 0xf0, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9d, 0xe0, 0x44, 0x02}}, + {0x0e46, 64, { 0xf0, 0x90, 0x7f, 0x97, 0xe0, 0x44, 0x02, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x10, 0xf0, 0xe4, 0x90, 0x7f, + 0x96, 0xf0, 0x90, 0x7f, 0x9d, 0x74, 0xfe, 0xf0, 0x30, 0x17, 0x04, 0x7f, 0x80, 0x80, 0x02, 0x7f, + 0x00, 0x90, 0x7f, 0x97, 0xef, 0xf0, 0xe4, 0x90, 0x7f, 0x95, 0xf0, 0x90, 0x7f, 0x9e, 0xf0, 0x90, + 0x7f, 0x98, 0xf0, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0}}, + {0x0e86, 64, { 0x86, 0x75, 0x86, 0x00, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x02, 0xf0, 0xd2, 0x06, 0xd0, 0x86, + 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, + 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x18, 0x53, 0x91, 0xef, 0x90, + 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83}}, + {0x0ec6, 64, { 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, + 0x00, 0xd2, 0x1a, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, 0x86, 0xd0, 0x84, + 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, + 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xa9, 0x74}}, + {0x0f06, 64, { 0x02, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, + 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x53, 0x91, 0xef, + 0x90, 0x7f, 0xa9, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, + 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86}}, + {0x0f46, 64, { 0x75, 0x86, 0x00, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xa9, 0x74, 0x08, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, + 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, + 0x44, 0x08, 0xf0, 0x30, 0x1b, 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x00, + 0x03, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0xe0, 0x44, 0x04, 0xf0, 0x22, 0x74, 0x00}}, + {0x0f86, 64, { 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f, + 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x90, 0x7f, + 0xd6, 0xe0, 0x44, 0x01, 0xf0, 0x7f, 0x0d, 0x7e, 0x00, 0x12, 0x00, 0x03, 0x90, 0x7f, 0xd6, 0xe0, + 0x54, 0xfe, 0xf0, 0x22, 0x12, 0x0e, 0x33, 0x12, 0x0f, 0x95, 0x90, 0x7f, 0xd6, 0xe0, 0x30}}, + {0x0fc6, 9, { 0xe7, 0x03, 0x12, 0x0f, 0xa5, 0x12, 0x0c, 0xb1, 0x22}}, + {0xffff, 0, {0x00}} +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa19qw_fw.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa19qw_fw.h --- linux.20pre5/drivers/usb/serial/keyspan_usa19qw_fw.h 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa19qw_fw.h 2002-09-01 13:39:31.000000000 +0100 @@ -0,0 +1,448 @@ +/* keyspan_usa19qw_fw.h + + The firmware contained herein as keyspan_usa19wq_fw.h is + + Copyright (C) 1999-2001 + Keyspan, A division of InnoSys Incorporated ("Keyspan") + + as an unpublished work. This notice does not imply unrestricted or + public access to the source code from which this firmware image is + derived. Except as noted below this firmware image may not be + reproduced, used, sold or transferred to any third party without + Keyspan's prior written consent. All Rights Reserved. + + Permission is hereby granted for the distribution of this firmware + image as part of a Linux or other Open Source operating system kernel + in text or binary form as required. + + This firmware may not be modified and may only be used with + Keyspan hardware. Distribution and/or Modification of the + keyspan.c driver which includes this firmware, in whole or in + part, requires the inclusion of this statement." + +*/ + +static const struct ezusb_hex_record keyspan_usa19qw_firmware[] = { + {0x0033, 3, { 0x02, 0x00, 0x2d}}, + {0x002d, 4, { 0x53, 0xd8, 0xef, 0x32}}, + {0x0046, 16, { 0x30, 0x10, 0x19, 0x12, 0x0e, 0x0f, 0xef, 0xc3, 0x95, 0x14, 0x40, 0x03, 0x02, 0x00, 0xdf, 0x90}}, + {0x0056, 16, { 0x7f, 0xbf, 0x74, 0x01, 0xf0, 0xc2, 0x10, 0xc2, 0x0b, 0x02, 0x00, 0xdf, 0x30, 0x0d, 0x3e, 0x90}}, + {0x0066, 16, { 0x7f, 0xc6, 0xe0, 0x20, 0xe1, 0x73, 0x12, 0x0e, 0x0f, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x6a, 0x90}}, + {0x0076, 16, { 0x7e, 0x40, 0xe0, 0x13, 0x92, 0x10, 0x90, 0x7f, 0xc7, 0xe0, 0x14, 0xf5, 0x36, 0x20, 0x0b, 0x11}}, + {0x0086, 16, { 0x60, 0x0f, 0xf5, 0x24, 0x7e, 0x7e, 0x7f, 0x41, 0x75, 0x29, 0x7e, 0x75, 0x2a, 0x41, 0x12, 0x09}}, + {0x0096, 16, { 0x10, 0xc2, 0x0d, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0x75, 0x26, 0xff, 0x80, 0x3c, 0x90, 0x7f, 0xc8}}, + {0x00a6, 16, { 0xe0, 0x20, 0xe1, 0x35, 0x12, 0x0e, 0x0f, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x2c, 0x90, 0x7d, 0xc0}}, + {0x00b6, 16, { 0xe0, 0x13, 0x92, 0x10, 0x90, 0x7f, 0xc9, 0xe0, 0x14, 0xf5, 0x36, 0x20, 0x0b, 0x11, 0x60, 0x0f}}, + {0x00c6, 16, { 0xf5, 0x24, 0x7e, 0x7d, 0x7f, 0xc1, 0x75, 0x29, 0x7d, 0x75, 0x2a, 0xc1, 0x12, 0x09, 0x10, 0xd2}}, + {0x00d6, 16, { 0x0d, 0xe4, 0x90, 0x7f, 0xc9, 0xf0, 0x75, 0x26, 0xff, 0x90, 0x7f, 0xb6, 0xe0, 0x30, 0xe1, 0x03}}, + {0x00e6, 16, { 0x02, 0x01, 0x68, 0x12, 0x0c, 0xff, 0x8f, 0x36, 0x12, 0x0e, 0x1b, 0x8f, 0x11, 0xe5, 0x36, 0xc3}}, + {0x00f6, 16, { 0x95, 0x13, 0x50, 0x0f, 0x12, 0x0d, 0xde, 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x11, 0x20, 0xe7, 0x03}}, + {0x0036, 12, { 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22}}, + {0x0043, 3, { 0x02, 0x0e, 0x00}}, + {0x0003, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90}}, + {0x0013, 16, { 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0}}, + {0x0023, 10, { 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32}}, + {0x0000, 3, { 0x02, 0x09, 0xc5}}, + {0x0106, 64, { 0x30, 0x13, 0x5f, 0xc2, 0x13, 0xe5, 0x36, 0x60, 0x59, 0xb4, 0x80, 0x03, 0x43, 0x11, 0x02, 0xe5, 0x11, + 0x30, 0xe7, 0x24, 0xe5, 0x36, 0xd3, 0x94, 0x20, 0x40, 0x03, 0x75, 0x36, 0x20, 0x85, 0x36, 0x24, + 0x7e, 0x7e, 0x7f, 0x80, 0x75, 0x29, 0x7e, 0x75, 0x2a, 0x80, 0x12, 0x0b, 0x9a, 0xe5, 0x36, 0x25, + 0xe0, 0x90, 0x7f, 0xb7, 0xf0, 0x80, 0x2a, 0xe5, 0x36, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75}}, + {0x0146, 64, { 0x36, 0x3f, 0x85, 0x36, 0x24, 0x90, 0x7e, 0x80, 0xe5, 0x11, 0xf0, 0x7e, 0x7e, 0x7f, 0x81, 0x75, 0x29, + 0x7e, 0x75, 0x2a, 0x81, 0x12, 0x09, 0x35, 0xe5, 0x36, 0x04, 0x90, 0x7f, 0xb7, 0xf0, 0x75, 0x26, + 0xff, 0x90, 0x7f, 0xce, 0xe0, 0x30, 0xe1, 0x06, 0x20, 0x0e, 0x03, 0x02, 0x03, 0xc4, 0xe4, 0xf5, + 0x35, 0x74, 0x40, 0x25, 0x35, 0xf5, 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xff, 0xe5}}, + {0x0186, 64, { 0x35, 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, 0x79, 0x00, 0x24, 0x00, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, + 0x12, 0x0a, 0x97, 0x05, 0x35, 0xe5, 0x35, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x00, 0xe0, 0x60, 0x6e, + 0x7f, 0x01, 0x90, 0x7e, 0x11, 0xe0, 0xfd, 0x12, 0x0c, 0xda, 0x90, 0x7e, 0x01, 0xe0, 0xff, 0x12, + 0x0c, 0x1c, 0x90, 0x7e, 0x02, 0xe0, 0xff, 0x12, 0x0c, 0x42, 0xd2, 0x11, 0xd2, 0x12, 0x75}}, + {0x01c6, 64, { 0x36, 0x04, 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x05, 0xc2, 0x12, 0x43, 0x36, 0xc0, 0x90, 0x7e, 0x04, 0xe0, + 0xb4, 0x01, 0x07, 0xc2, 0x12, 0x43, 0x36, 0x0b, 0x80, 0x10, 0x90, 0x7e, 0x04, 0xe0, 0x60, 0x07, + 0xc2, 0x11, 0x43, 0x36, 0x09, 0x80, 0x03, 0x43, 0x36, 0x02, 0x7f, 0x03, 0xad, 0x36, 0x12, 0x0c, + 0xda, 0x43, 0x1a, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x1a}}, + {0x0206, 64, { 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x17, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, + 0x05, 0xe0, 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, 0xf5, 0x19, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, + 0x90, 0xc0, 0x00, 0xe5, 0x19, 0xf0, 0x90, 0x7e, 0x07, 0xe0, 0x60, 0x42, 0x90, 0x7e, 0x13, 0xe0, + 0x60, 0x05, 0x43, 0x16, 0x04, 0x80, 0x03, 0x53, 0x16, 0xfb, 0xe4, 0xff, 0xad, 0x16, 0x12}}, + {0x0246, 64, { 0x0c, 0xda, 0x90, 0x7e, 0x08, 0xe0, 0x60, 0x05, 0x43, 0x18, 0x80, 0x80, 0x03, 0x53, 0x18, 0x7f, 0x53, + 0x18, 0xfc, 0x90, 0x7e, 0x09, 0xe0, 0x60, 0x11, 0x43, 0x18, 0x02, 0xa3, 0xe0, 0xff, 0x12, 0x0c, + 0x8e, 0x90, 0x7e, 0x0b, 0xe0, 0xff, 0x12, 0x0c, 0xb4, 0xaf, 0x18, 0x12, 0x0c, 0x68, 0x90, 0x7e, + 0x0e, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x1a, 0x01, 0x80, 0x03, 0x53, 0x1a}}, + {0x0286, 64, { 0xfe, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x1a, 0xf0, 0x90, 0x7e, 0x0c, 0xe0, + 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x1a, 0x02, 0x80, 0x03, 0x53, 0x1a, 0xfd, 0x90, 0x7f, + 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x1a, 0xf0, 0x90, 0x7e, 0x12, 0xe0, 0xf5, 0x13, + 0xa3, 0xe0, 0x13, 0x92, 0x14, 0xa3, 0xe0, 0xf5, 0x14, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x1a}}, + {0x02c6, 64, { 0x10, 0x80, 0x03, 0x53, 0x1a, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x1a, + 0xf0, 0x90, 0x7e, 0x16, 0xe0, 0x60, 0x32, 0x53, 0x19, 0xbf, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, + 0xe5, 0x19, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x12, 0x0d, + 0xd2, 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x16, 0xfd, 0xe4, 0xff, 0xad, 0x16}}, + {0x0306, 64, { 0x12, 0x0c, 0xda, 0xe4, 0xf5, 0x0e, 0xf5, 0x0d, 0xd2, 0x0f, 0x90, 0x7e, 0x17, 0xe0, 0x60, 0x0f, 0x43, + 0x16, 0x02, 0xe4, 0xff, 0xad, 0x16, 0x12, 0x0c, 0xda, 0x75, 0x0d, 0x01, 0xd2, 0x0f, 0x90, 0x7e, + 0x18, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x17, 0x44, 0x04, 0x90, 0xc0, + 0x00, 0xf0, 0xd2, 0x0b, 0x90, 0x7e, 0x19, 0xe0, 0x60, 0x11, 0x43, 0x19, 0x40, 0x90, 0x7f}}, + {0x0346, 64, { 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x19, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x1a, 0xe0, 0x60, + 0x0f, 0x53, 0x16, 0xfe, 0xe4, 0xff, 0xad, 0x16, 0x12, 0x0c, 0xda, 0x75, 0x0f, 0x01, 0xd2, 0x0f, + 0x90, 0x7e, 0x1b, 0xe0, 0x60, 0x0f, 0x43, 0x16, 0x01, 0xe4, 0xff, 0xad, 0x16, 0x12, 0x0c, 0xda, + 0xe4, 0xf5, 0x0f, 0xd2, 0x0f, 0x90, 0x7e, 0x1c, 0xe0, 0x60, 0x0e, 0x90, 0x7f, 0x98, 0x74}}, + {0x0386, 64, { 0x12, 0xf0, 0xe5, 0x17, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x1d, 0xe0, 0x60, 0x02, 0xd2, + 0x13, 0x90, 0x7e, 0x1e, 0xe0, 0x60, 0x08, 0x75, 0x10, 0x01, 0xe4, 0xf5, 0x12, 0xd2, 0x0f, 0x90, + 0x7e, 0x1f, 0xe0, 0x60, 0x11, 0x90, 0x7f, 0xd7, 0x74, 0x11, 0xf0, 0x74, 0x31, 0xf0, 0x74, 0x15, + 0xf0, 0x74, 0x35, 0xf0, 0xd2, 0x0d, 0xc2, 0x0e, 0xe4, 0x90, 0x7f, 0xcf, 0xf0, 0x30, 0x16}}, + {0x03c6, 64, { 0x71, 0xe5, 0x12, 0x60, 0x02, 0x15, 0x12, 0xe5, 0x30, 0xd3, 0x94, 0x00, 0x40, 0x04, 0x15, 0x30, 0x80, + 0x60, 0x75, 0x30, 0x0a, 0x12, 0x0d, 0xd2, 0xef, 0x54, 0x01, 0xf5, 0x36, 0x65, 0x0e, 0x60, 0x07, + 0x85, 0x36, 0x0e, 0xd2, 0x0f, 0x80, 0x11, 0x12, 0x0e, 0x27, 0xef, 0x54, 0x10, 0xf5, 0x36, 0x65, + 0x09, 0x60, 0x05, 0x85, 0x36, 0x09, 0xd2, 0x0f, 0x12, 0x0e, 0x27, 0xef, 0x54, 0x80, 0xf5}}, + {0x0406, 64, { 0x36, 0x65, 0x0a, 0x60, 0x05, 0x85, 0x36, 0x0a, 0xd2, 0x0f, 0x12, 0x0e, 0x27, 0xef, 0x54, 0x20, 0xf5, + 0x36, 0x65, 0x0b, 0x60, 0x08, 0x85, 0x36, 0x0b, 0x30, 0x11, 0x02, 0xd2, 0x0f, 0x12, 0x0e, 0x27, + 0xef, 0x54, 0x40, 0xf5, 0x36, 0x65, 0x0c, 0x60, 0x08, 0x85, 0x36, 0x0c, 0x30, 0x12, 0x02, 0xd2, + 0x0f, 0x30, 0x16, 0x2a, 0x90, 0x7f, 0xd2, 0xe0, 0x20, 0xe1, 0x23, 0x90, 0x7b, 0x40, 0xe0}}, + {0x0446, 64, { 0x60, 0x09, 0xe0, 0xf5, 0x32, 0x90, 0x7b, 0x42, 0xe0, 0xf5, 0x33, 0x90, 0x7b, 0x41, 0xe0, 0x60, 0x09, + 0x90, 0x7f, 0xd7, 0x74, 0x17, 0xf0, 0x74, 0x37, 0xf0, 0xe4, 0x90, 0x7f, 0xd3, 0xf0, 0x90, 0x7f, + 0xc2, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x05, 0x29, 0xe5, 0x27, 0x70, 0x40, 0x30, 0x0f, 0x39, 0xe5, + 0x12, 0x70, 0x35, 0xc2, 0x0f, 0xf5, 0x35, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x08, 0x25, 0x35}}, + {0x0486, 64, { 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0a, 0x51, 0xff, 0x74, 0x80, 0x25, 0x35, 0xf5, 0x82, 0xe4, 0x34, + 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x35, 0xe5, 0x35, 0xb4, 0x09, 0xdb, 0x90, 0x7f, 0xc3, 0x74, + 0x09, 0xf0, 0x75, 0x12, 0x10, 0xe4, 0xf5, 0x10, 0x75, 0x27, 0x02, 0x22, 0xe5, 0x27, 0x64, 0x02, + 0x70, 0x36, 0x30, 0x05, 0x2f, 0xc2, 0x05, 0xf5, 0x35, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x2b}}, + {0x04c6, 64, { 0x25, 0x35, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0a, 0x51, 0xff, 0x74, 0x80, 0x25, 0x35, 0xf5, 0x82, + 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x35, 0xe5, 0x35, 0xb4, 0x05, 0xdb, 0x90, 0x7f, + 0xc3, 0x74, 0x05, 0xf0, 0x75, 0x27, 0x03, 0x22, 0xe5, 0x32, 0x60, 0x33, 0x75, 0x31, 0x03, 0x15, + 0x32, 0xe4, 0xf5, 0x35, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x31, 0x25, 0x35, 0xf9, 0xee, 0x34}}, + {0x0506, 64, { 0x00, 0xfa, 0x12, 0x0a, 0x51, 0xff, 0x74, 0x80, 0x25, 0x35, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, + 0xef, 0xf0, 0x05, 0x35, 0xe5, 0x35, 0xb4, 0x03, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, + 0xf5, 0x27, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x0a, 0xa9, 0x06, 0x08, 0x00, 0x06, 0x7c, 0x01, + 0x06, 0xe9, 0x03, 0x05, 0x4d, 0x06, 0x05, 0xf9, 0x08, 0x05, 0xed, 0x09, 0x05, 0xd5, 0x0a}}, + {0x0546, 64, { 0x05, 0xe4, 0x0b, 0x00, 0x00, 0x07, 0x39, 0x90, 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x16, 0x14, 0x60, + 0x50, 0x24, 0x02, 0x70, 0x6f, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x00, 0x90, 0x7f, 0xd5, + 0xf0, 0x02, 0x07, 0x40, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x04, 0x7f, 0x02, 0x80, 0x02, 0x7f, 0x03, + 0x75, 0x82, 0x82, 0x75, 0x83, 0x19, 0xef, 0xf0, 0x75, 0x82, 0x74, 0x75, 0x83, 0x19, 0xf0}}, + {0x0586, 64, { 0x75, 0x82, 0x58, 0x75, 0x83, 0x19, 0xf0, 0x90, 0x7f, 0xea, 0xe0, 0x04, 0x75, 0x82, 0x17, 0x75, 0x83, + 0x19, 0xf0, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x12, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x07, + 0x40, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x0b, 0x1c, 0xea, 0x49, 0x60, 0x0d, 0xea, 0x90, 0x7f, + 0xd4, 0xf0, 0xe9, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x07, 0x40, 0x90, 0x7f, 0xb4, 0xe0, 0x44}}, + {0x05c6, 64, { 0x01, 0xf0, 0x02, 0x07, 0x40, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x07, 0x40, 0x90, 0x7f, + 0x00, 0xe5, 0x25, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x07, 0x40, 0x90, 0x7f, 0xea, + 0xe0, 0xf5, 0x25, 0x02, 0x07, 0x40, 0x12, 0x07, 0x48, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x23, 0x02, + 0x07, 0x40, 0x90, 0x7f, 0x00, 0xe5, 0x23, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02}}, + {0x0606, 64, { 0x07, 0x40, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60, 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, + 0xa2, 0x01, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, 0xa2, 0x07, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, + 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x07, 0x40, 0xe4, 0x90, 0x7f, + 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x07, 0x40, 0x90, 0x7f}}, + {0x0646, 64, { 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, + 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, + 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x07, 0x40, 0x90, 0x7f, 0xb4, 0xe0, 0x44, + 0x01, 0xf0, 0x02, 0x07, 0x40, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1e, 0x24, 0x02}}, + {0x0686, 64, { 0x60, 0x03, 0x02, 0x07, 0x40, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x06, 0x12, 0x0d, 0xf9, 0x02, 0x07, + 0x40, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x07, 0x40, 0x90, 0x7f, 0xea, 0xe0, 0x70, + 0x38, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, + 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90}}, + {0x06c6, 64, { 0x7f, 0xec, 0xe0, 0x54, 0x80, 0xff, 0x13, 0x13, 0x13, 0x54, 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, + 0x7f, 0xd7, 0xf0, 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x60, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, + 0x80, 0x57, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x19, 0x24, 0x02, 0x70, 0x4b, 0x90, 0x7f, + 0xea, 0xe0, 0xb4, 0x01, 0x05, 0x12, 0x0d, 0xf6, 0x80, 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44}}, + {0x0706, 64, { 0x01, 0xf0, 0x80, 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, + 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, + 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, + 0x80, 0x07, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02}}, + {0x0746, 64, { 0xf0, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0x90, 0x7f, 0x96, 0x74, + 0x20, 0xf0, 0x90, 0x7f, 0x95, 0x74, 0xc0, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x3f, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x10, 0xf0, 0xe4, 0xf5, 0x8e, 0x90, 0x7f, 0xdf, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xde, + 0xf0, 0xe4, 0xf5, 0x08, 0x7f, 0x01, 0x7b, 0x00, 0x74, 0x08, 0x2f, 0xf9, 0xe4, 0x34, 0x00}}, + {0x0786, 64, { 0xfa, 0xe4, 0x12, 0x0a, 0x97, 0x0f, 0xbf, 0x09, 0xee, 0x75, 0x13, 0x01, 0xe4, 0xf5, 0x12, 0xf5, 0x30, + 0xf5, 0x11, 0xc2, 0x0f, 0xc2, 0x13, 0xc2, 0x0e, 0xc2, 0x0b, 0xc2, 0x10, 0xc2, 0x04, 0x90, 0x7f, + 0x98, 0x74, 0x13, 0xf0, 0x75, 0x19, 0x03, 0x90, 0xc0, 0x00, 0x74, 0x03, 0xf0, 0x7f, 0x0c, 0xe4, + 0xfd, 0x12, 0x0c, 0xda, 0x7f, 0x10, 0x8f, 0x18, 0x12, 0x0c, 0x68, 0x90, 0x7f, 0x98, 0x74}}, + {0x07c6, 64, { 0x12, 0xf0, 0x7f, 0x01, 0x8f, 0x17, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, + 0x0c, 0xda, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x16, 0x12, 0x0c, 0xda, 0x90, 0x7f, 0x98, + 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x0c, 0xda, 0x7f, + 0x01, 0x12, 0x0d, 0x6a, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x0c, 0xda, 0xe4, 0xff, 0xe5, 0x16}}, + {0x0806, 64, { 0x54, 0x7f, 0xfd, 0x12, 0x0c, 0xda, 0x12, 0x0e, 0x0f, 0x8f, 0x15, 0xe4, 0xff, 0xe5, 0x16, 0x44, 0x80, + 0xfd, 0x12, 0x0c, 0xda, 0xe5, 0x15, 0x30, 0xe7, 0x04, 0xc2, 0x08, 0x80, 0x02, 0xd2, 0x08, 0x90, + 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x75, 0x1a, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0xd2, 0x03, + 0x22, 0xd2, 0x15, 0x90, 0x7f, 0x92, 0xe0, 0x44, 0x02, 0xf0, 0x12, 0x0d, 0xf9, 0xd2, 0xe8}}, + {0x0846, 64, { 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xab, 0x74, + 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaf, + 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0x74, 0x0d, 0xf0, 0xd2, 0xaf, 0xd2, 0x16, 0x12, 0x0d, + 0x24, 0xc2, 0x02, 0xe4, 0xf5, 0x28, 0xf5, 0x30, 0xc2, 0x09, 0xf5, 0x23, 0xc2, 0x03, 0x90}}, + {0x0886, 64, { 0x7f, 0xa1, 0x04, 0xf0, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x34, 0x60, 0x48, 0x30, 0x03, 0x05, 0xd2, 0x16, + 0x12, 0x00, 0x46, 0xe5, 0x0f, 0x60, 0x22, 0xe5, 0x26, 0x60, 0x16, 0x15, 0x26, 0x90, 0x7f, 0xd8, + 0xe0, 0x30, 0xe6, 0x04, 0x7f, 0x20, 0x80, 0x02, 0x7f, 0x30, 0x90, 0x7f, 0x96, 0xef, 0xf0, 0x80, + 0x1a, 0x90, 0x7f, 0x96, 0x74, 0x30, 0xf0, 0x80, 0x12, 0x90, 0x7f, 0xd9, 0xe0, 0x30, 0xe2}}, + {0x08c6, 64, { 0x04, 0x7f, 0x30, 0x80, 0x02, 0x7f, 0x20, 0x90, 0x7f, 0x96, 0xef, 0xf0, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, + 0x34, 0x80, 0x20, 0x30, 0x03, 0x07, 0xc2, 0x16, 0x12, 0x00, 0x46, 0x80, 0x16, 0xe5, 0x0f, 0x70, + 0x12, 0x90, 0x7f, 0xd9, 0xe0, 0x30, 0xe2, 0x04, 0x7f, 0x30, 0x80, 0x02, 0x7f, 0x20, 0x90, 0x7f, + 0x96, 0xef, 0xf0, 0x30, 0x02, 0x07, 0xc2, 0x02, 0x12, 0x05, 0x2a, 0x80, 0x86, 0x30, 0x0a}}, + {0x0906, 64, { 0x83, 0xc2, 0x0a, 0x12, 0x0b, 0x5d, 0x02, 0x08, 0x8a, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, + 0x24, 0xe5, 0x2a, 0xf5, 0x82, 0xe5, 0x29, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, + 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, 0xaf, 0x22, 0x90, 0x7f, + 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x24, 0xe5, 0x2a, 0xf5, 0x82, 0xe5, 0x29, 0xf5, 0x83, 0xc2}}, + {0x0946, 64, { 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, + 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x24, 0xe5, 0x2a, 0xf5, 0x82, 0xe5, + 0x29, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, + 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf}}, + {0x0986, 64, { 0x24, 0xe5, 0x2a, 0xf5, 0x82, 0xe5, 0x29, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, + 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x74, 0x00, 0xf5, + 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f, + 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x78}}, + {0x09c6, 64, { 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x39, 0x02, 0x0a, 0x0c, 0x02, 0x08, 0x38, 0xe4, 0x93, 0xa3, + 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, + 0x93, 0xa3, 0xf8, 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, + 0x83, 0x40, 0x04, 0xf4, 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02}}, + {0x0a06, 64, { 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x0d, 0x8b, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, + 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, + 0xc0, 0x25, 0xe0, 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, + 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82}}, + {0x0a46, 64, { 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, + 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, + 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, + 0xe0, 0x22, 0x50, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25}}, + {0x0a86, 64, { 0x82, 0xf8, 0xe2, 0x22, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, + 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xf0, 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, + 0xf3, 0x22, 0xd0, 0x83, 0xd0, 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, + 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02}}, + {0x0ac6, 64, { 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, 0xa3, 0x80, 0xdf, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, + 0x74, 0x20, 0xf0, 0x30, 0x01, 0x03, 0xff, 0x80, 0x02, 0x7f, 0x00, 0x90, 0x7f, 0x96, 0xef, 0xf0, + 0xe4, 0x90, 0x7f, 0x94, 0xf0, 0x90, 0x7f, 0x9d, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x97, 0xf0, + 0x30, 0x08, 0x11, 0x90, 0x7f, 0x95, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0xff, 0xf0, 0x90, 0x7f}}, + {0x0b06, 64, { 0x98, 0x74, 0x20, 0xf0, 0x22, 0xe4, 0x90, 0x7f, 0x95, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0xdf, 0xf0, 0xe4, + 0x90, 0x7f, 0x98, 0xf0, 0x22, 0x8f, 0x35, 0xe4, 0xf5, 0x36, 0x75, 0x37, 0xff, 0x75, 0x38, 0x19, + 0x75, 0x39, 0x86, 0xab, 0x37, 0xaa, 0x38, 0xa9, 0x39, 0x90, 0x00, 0x01, 0x12, 0x0a, 0x6a, 0xb4, + 0x03, 0x1d, 0xaf, 0x36, 0x05, 0x36, 0xef, 0xb5, 0x35, 0x01, 0x22, 0x12, 0x0a, 0x51, 0x7e}}, + {0x0b46, 64, { 0x00, 0x29, 0xff, 0xee, 0x3a, 0xa9, 0x07, 0x75, 0x37, 0xff, 0xf5, 0x38, 0x89, 0x39, 0x80, 0xd4, 0x7b, + 0x00, 0x7a, 0x00, 0x79, 0x00, 0x22, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, 0x35, 0x12, 0x0a, 0xcf, 0x20, + 0x08, 0x07, 0x90, 0x7f, 0x92, 0xe0, 0x54, 0xfd, 0xf0, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, + 0x12, 0x09, 0xb5, 0x90, 0x7f, 0xd6, 0xe0, 0x30, 0xe7, 0x0e, 0x30, 0x01, 0x05, 0x12, 0x0d}}, + {0x0b86, 64, { 0xbc, 0x80, 0x06, 0x12, 0x0d, 0x49, 0xef, 0x60, 0xe1, 0x90, 0x7f, 0x92, 0xe0, 0x44, 0x02, 0xf0, 0x12, + 0x07, 0x48, 0x22, 0x05, 0x2a, 0xe5, 0x2a, 0xae, 0x29, 0x70, 0x02, 0x05, 0x29, 0x14, 0xf5, 0x82, + 0x8e, 0x83, 0xe5, 0x11, 0xf0, 0x12, 0x00, 0x36, 0x05, 0x2a, 0xe5, 0x2a, 0xac, 0x29, 0x70, 0x02, + 0x05, 0x29, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x24, 0xe5, 0x24, 0x60, 0x07}}, + {0x0bc6, 64, { 0x12, 0x0e, 0x1b, 0x8f, 0x11, 0x80, 0xcd, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, + 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x02, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, + 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, + 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x0a}}, + {0x0c06, 64, { 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, + 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, + 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, + 0x13, 0xf0, 0xe5, 0x19, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74}}, + {0x0c46, 64, { 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, + 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x19, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, + 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, + 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5}}, + {0x0c86, 64, { 0x19, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, + 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x19, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, + 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0}}, + {0x0cc6, 64, { 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x19, 0x54, 0x7f, 0x90, 0xc0, + 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x19, 0x54, 0x7f, 0x90, 0xc0, 0x00, + 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x17, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, + 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, 0x0d, 0xea, 0x8f, 0x37, 0x12, 0x0d}}, + {0x0d06, 64, { 0xea, 0x8f, 0x38, 0xe5, 0x37, 0x65, 0x38, 0x60, 0x12, 0x12, 0x0d, 0xea, 0x8f, 0x37, 0xe5, 0x37, 0x65, + 0x38, 0x60, 0x07, 0x12, 0x0d, 0xea, 0x8f, 0x38, 0x80, 0xe8, 0xaf, 0x37, 0x22, 0x90, 0x7f, 0xd6, + 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x16, 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, + 0xf4, 0x7e, 0x01, 0x12, 0x0d, 0xa5, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0xe0, 0x44}}, + {0x0d46, 64, { 0x04, 0xf0, 0x22, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, 0x36, 0x12, 0x07, 0x48, 0x12, 0x0e, 0x27, 0xef, 0x30, + 0xe6, 0x0b, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x36, 0x60, 0xf1, 0x7f, 0x01, 0x22, 0x12, 0x0a, 0xcf, + 0x7f, 0x00, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x16, 0x54, 0x7f, 0xfd, 0x12, 0x0c, 0xda, 0x90, + 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x16, 0x44, 0x80}}, + {0x0d86, 64, { 0xfd, 0x12, 0x0c, 0xda, 0x22, 0x05, 0x2b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x31, 0x03, 0x00, 0x00, + 0xc1, 0x86, 0xc1, 0x02, 0xc1, 0x0a, 0xc1, 0x01, 0xc1, 0x07, 0x01, 0x27, 0x00, 0x00, 0x8e, 0x36, + 0x8f, 0x37, 0xe5, 0x37, 0x15, 0x37, 0xae, 0x36, 0x70, 0x02, 0x15, 0x36, 0x4e, 0x60, 0x05, 0x12, + 0x09, 0xa4, 0x80, 0xee, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x01, 0xf0, 0x7f, 0x0d, 0x7e}}, + {0x0dc6, 64, { 0x00, 0x12, 0x0d, 0xa5, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x11, + 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, + 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0xd2, + 0x01, 0x22, 0xc2, 0x01, 0x22, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0b, 0xce, 0x00, 0x02, 0x0e}}, + {0x0e06, 64, { 0x04, 0x00, 0x02, 0x00, 0x03, 0x00, 0x02, 0x0b, 0xf5, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, + 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x0e46, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x0e86, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x0ec6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x0f06, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x0f46, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x0f86, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x0fc6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1006, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1046, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1086, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x10c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1106, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1146, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1186, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x11c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1206, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1246, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1286, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x12c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1306, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1346, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1386, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x13c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1406, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1446, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1486, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x14c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1506, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1546, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1586, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x15c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1606, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1646, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1686, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x16c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1706, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1746, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1786, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x17c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1806, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1846, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1886, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x18c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x10, 0x01, 0xff, 0x00}}, + {0x1906, 64, { 0x00, 0x40, 0xcd, 0x06, 0x19, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x02, 0x09, 0x02, 0x74, 0x00, 0x01, + 0x01, 0x00, 0xa0, 0x32, 0x09, 0x04, 0x00, 0x00, 0x0e, 0xff, 0x00, 0x00, 0x00, 0x07, 0x05, 0x01, + 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x02, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x03, 0x02, 0x40, + 0x00, 0x00, 0x07, 0x05, 0x04, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x05, 0x02, 0x40, 0x00}}, + {0x1946, 64, { 0x00, 0x07, 0x05, 0x06, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x07, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, + 0x81, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x83, 0x02, + 0x40, 0x00, 0x01, 0x07, 0x05, 0x84, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x85, 0x02, 0x40, 0x00, + 0x01, 0x07, 0x05, 0x86, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x87, 0x02, 0x40, 0x00, 0x01}}, + {0x1986, 64, { 0x04, 0x03, 0x09, 0x04, 0x48, 0x03, 0x4b, 0x00, 0x65, 0x00, 0x79, 0x00, 0x73, 0x00, 0x70, 0x00, 0x61, + 0x00, 0x6e, 0x00, 0x2c, 0x00, 0x20, 0x00, 0x61, 0x00, 0x20, 0x00, 0x64, 0x00, 0x69, 0x00, 0x76, + 0x00, 0x69, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x6f, 0x00, 0x66, + 0x00, 0x20, 0x00, 0x49, 0x00, 0x6e, 0x00, 0x6e, 0x00, 0x6f, 0x00, 0x53, 0x00, 0x79, 0x00}}, + {0x19c6, 64, { 0x73, 0x00, 0x20, 0x00, 0x49, 0x00, 0x6e, 0x00, 0x63, 0x00, 0x2e, 0x00, 0x36, 0x03, 0x4b, 0x00, 0x65, + 0x00, 0x79, 0x00, 0x73, 0x00, 0x70, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x55, 0x00, 0x53, + 0x00, 0x42, 0x00, 0x20, 0x00, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6c, + 0x00, 0x20, 0x00, 0x41, 0x00, 0x64, 0x00, 0x61, 0x00, 0x70, 0x00, 0x74, 0x00, 0x65, 0x00}}, + {0x1a06, 4, { 0x72, 0x00, 0x00, 0x00}}, + {0xffff, 0, {0x00}} +}; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa19w_fw.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa19w_fw.h --- linux.20pre5/drivers/usb/serial/keyspan_usa19w_fw.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa19w_fw.h 2002-09-01 13:39:31.000000000 +0100 @@ -1,108 +1,112 @@ /* keyspan_usa19w_fw.h - - Generated from Keyspan firmware image usa17code.h Sat Oct 6 12:13:03 EST 2001 - This firmware is for the Keyspan USA-19W Serial Adaptor - "The firmware contained herein as keyspan_usa19w_fw.h is - Copyright (C) 1999-2001 Keyspan, A division of InnoSys Incorporated - ("Keyspan"), as an unpublished work. This notice does not imply - unrestricted or public access to this firmware which is a trade secret of - Keyspan, and which may not be reproduced, used, sold or transferred to any - third party without Keyspan's prior written consent. All Rights Reserved. + The firmware contained herein as keyspan_usa19w_fw.h is - This firmware may not be modified and may only be used with the Keyspan - USA-19W Serial Adapter. Distribution and/or Modification of the - keyspan.c driver which includes this firmware, in whole or in part, - requires the inclusion of this statement." + Copyright (C) 1999-2001 + Keyspan, A division of InnoSys Incorporated ("Keyspan") + + as an unpublished work. This notice does not imply unrestricted or + public access to the source code from which this firmware image is + derived. Except as noted below this firmware image may not be + reproduced, used, sold or transferred to any third party without + Keyspan's prior written consent. All Rights Reserved. + Permission is hereby granted for the distribution of this firmware + image as part of a Linux or other Open Source operating system kernel + in text or binary form as required. + + This firmware may not be modified and may only be used with + Keyspan hardware. Distribution and/or Modification of the + keyspan.c driver which includes this firmware, in whole or in + part, requires the inclusion of this statement." */ static const struct ezusb_hex_record keyspan_usa19w_firmware[] = { - {0x0033, 3, { 0x02, 0x0d, 0x6c}}, + {0x0033, 3, { 0x02, 0x0d, 0x5c}}, {0x0003, 16, { 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0}}, {0x0013, 16, { 0x90, 0x7f, 0x94, 0xf0, 0x90, 0x7f, 0x9d, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x97, 0xf0, 0x90}}, {0x0023, 15, { 0x7f, 0x95, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x17, 0xf0, 0xe4, 0x90, 0x7f, 0x98, 0xf0, 0x22}}, - {0x0046, 16, { 0x30, 0x0f, 0x18, 0x12, 0x0d, 0x48, 0xef, 0xc3, 0x95, 0x14, 0x40, 0x03, 0x02, 0x00, 0xd8, 0x90}}, + {0x0046, 16, { 0x30, 0x0f, 0x18, 0x12, 0x0d, 0x38, 0xef, 0xc3, 0x95, 0x14, 0x40, 0x03, 0x02, 0x00, 0xd8, 0x90}}, {0x0056, 16, { 0x7f, 0xbf, 0x74, 0x01, 0xf0, 0xc2, 0x0f, 0xc2, 0x0a, 0x80, 0x77, 0x30, 0x0c, 0x3b, 0x90, 0x7f}}, - {0x0066, 16, { 0xc6, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x0d, 0x48, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7e}}, + {0x0066, 16, { 0xc6, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x0d, 0x38, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7e}}, {0x0076, 16, { 0x40, 0xe0, 0x13, 0x92, 0x0f, 0x90, 0x7f, 0xc7, 0xe0, 0x14, 0xf5, 0x1c, 0x20, 0x0a, 0x11, 0x60}}, - {0x0086, 16, { 0x0f, 0xf5, 0x23, 0x7e, 0x7e, 0x7f, 0x41, 0x75, 0x27, 0x7e, 0x75, 0x28, 0x41, 0x12, 0x08, 0x05}}, + {0x0086, 16, { 0x0f, 0xf5, 0x23, 0x7e, 0x7e, 0x7f, 0x41, 0x75, 0x27, 0x7e, 0x75, 0x28, 0x41, 0x12, 0x08, 0x01}}, {0x0096, 16, { 0xc2, 0x0c, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0x80, 0x39, 0x90, 0x7f, 0xc8, 0xe0, 0x20, 0xe1, 0x32}}, - {0x00a6, 16, { 0x12, 0x0d, 0x48, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x0f}}, + {0x00a6, 16, { 0x12, 0x0d, 0x38, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x0f}}, {0x00b6, 16, { 0x90, 0x7f, 0xc9, 0xe0, 0x14, 0xf5, 0x1c, 0x20, 0x0a, 0x11, 0x60, 0x0f, 0xf5, 0x23, 0x7e, 0x7d}}, - {0x00c6, 16, { 0x7f, 0xc1, 0x75, 0x27, 0x7d, 0x75, 0x28, 0xc1, 0x12, 0x08, 0x05, 0xd2, 0x0c, 0xe4, 0x90, 0x7f}}, - {0x00d6, 16, { 0xc9, 0xf0, 0x90, 0x7f, 0xb6, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x01, 0x60, 0x53, 0x11, 0x80, 0x12}}, - {0x00e6, 16, { 0x0d, 0x54, 0xef, 0x42, 0x11, 0x12, 0x0c, 0x51, 0x8f, 0x1c, 0xef, 0xc3, 0x95, 0x13, 0x50, 0x0f}}, - {0x00f6, 16, { 0x12, 0x0d, 0x30, 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x11, 0x20, 0xe7, 0x03, 0x30, 0x12, 0x5b, 0xc2}}, + {0x00c6, 16, { 0x7f, 0xc1, 0x75, 0x27, 0x7d, 0x75, 0x28, 0xc1, 0x12, 0x08, 0x01, 0xd2, 0x0c, 0xe4, 0x90, 0x7f}}, + {0x00d6, 16, { 0xc9, 0xf0, 0x90, 0x7f, 0xb6, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x01, 0x5e, 0x12, 0x0c, 0x41, 0x8f}}, + {0x00e6, 16, { 0x1c, 0x12, 0x0d, 0x44, 0x8f, 0x11, 0xe5, 0x1c, 0xc3, 0x95, 0x13, 0x50, 0x0f, 0x12, 0x0d, 0x20}}, + {0x00f6, 16, { 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x11, 0x20, 0xe7, 0x03, 0x30, 0x12, 0x5c, 0xc2, 0x12, 0xe5, 0x1c}}, {0x0036, 12, { 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22}}, {0x0043, 3, { 0x02, 0x0e, 0x00}}, - {0x0000, 3, { 0x02, 0x08, 0xba}}, - {0x0106, 64, { 0x12, 0xe5, 0x1c, 0x70, 0x04, 0xf5, 0x11, 0x80, 0x51, 0xe5, 0x11, 0x30, 0xe7, 0x26, 0xe5, 0x1c, 0xd3, - 0x94, 0x20, 0x40, 0x03, 0x75, 0x1c, 0x20, 0x85, 0x1c, 0x23, 0x7e, 0x7e, 0x7f, 0x80, 0x75, 0x27, - 0x7e, 0x75, 0x28, 0x80, 0xaf, 0x11, 0x12, 0x0a, 0x8a, 0xe5, 0x1c, 0x25, 0xe0, 0x90, 0x7f, 0xb7, - 0xf0, 0x80, 0x26, 0xe5, 0x1c, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, 0x1c, 0x3f, 0x85, 0x1c}}, - {0x0146, 64, { 0x23, 0xe4, 0x90, 0x7e, 0x80, 0xf0, 0x7e, 0x7e, 0x7f, 0x81, 0x75, 0x27, 0x7e, 0x75, 0x28, 0x81, 0x12, - 0x08, 0x2a, 0xe5, 0x1c, 0x04, 0x90, 0x7f, 0xb7, 0xf0, 0x90, 0x7f, 0xce, 0xe0, 0x30, 0xe1, 0x06, - 0x20, 0x0d, 0x03, 0x02, 0x03, 0xba, 0xe4, 0xf5, 0x1b, 0x74, 0x40, 0x25, 0x1b, 0xf5, 0x82, 0xe4, - 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x1b, 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, 0x79}}, - {0x0186, 64, { 0x00, 0x24, 0x00, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, 0x12, 0x0a, 0x11, 0x05, 0x1b, 0xe5, 0x1b, 0xb4, - 0x20, 0xd7, 0x90, 0x7e, 0x00, 0xe0, 0x60, 0x6e, 0x7f, 0x01, 0x90, 0x7e, 0x11, 0xe0, 0xfd, 0x12, - 0x0c, 0x2c, 0x90, 0x7e, 0x01, 0xe0, 0xff, 0x12, 0x0b, 0x6e, 0x90, 0x7e, 0x02, 0xe0, 0xff, 0x12, - 0x0b, 0x94, 0xd2, 0x10, 0xd2, 0x11, 0x75, 0x1c, 0x04, 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x05}}, - {0x01c6, 64, { 0xc2, 0x11, 0x43, 0x1c, 0xc0, 0x90, 0x7e, 0x04, 0xe0, 0xb4, 0x01, 0x07, 0xc2, 0x11, 0x43, 0x1c, 0x0b, - 0x80, 0x10, 0x90, 0x7e, 0x04, 0xe0, 0x60, 0x07, 0xc2, 0x10, 0x43, 0x1c, 0x09, 0x80, 0x03, 0x43, - 0x1c, 0x02, 0x7f, 0x03, 0xad, 0x1c, 0x12, 0x0c, 0x2c, 0x43, 0x19, 0x80, 0x90, 0x7f, 0x98, 0x74, - 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x19, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5}}, - {0x0206, 64, { 0x16, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x05, 0xe0, 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, - 0xf5, 0x18, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x18, 0xf0, 0x90, 0x7e, - 0x07, 0xe0, 0x60, 0x42, 0x90, 0x7e, 0x13, 0xe0, 0x60, 0x05, 0x43, 0x15, 0x04, 0x80, 0x03, 0x53, - 0x15, 0xfb, 0xe4, 0xff, 0xad, 0x15, 0x12, 0x0c, 0x2c, 0x90, 0x7e, 0x08, 0xe0, 0x60, 0x05}}, - {0x0246, 64, { 0x43, 0x17, 0x80, 0x80, 0x03, 0x53, 0x17, 0x7f, 0x53, 0x17, 0xfc, 0x90, 0x7e, 0x09, 0xe0, 0x60, 0x11, - 0x43, 0x17, 0x02, 0xa3, 0xe0, 0xff, 0x12, 0x0b, 0xe0, 0x90, 0x7e, 0x0b, 0xe0, 0xff, 0x12, 0x0c, - 0x06, 0xaf, 0x17, 0x12, 0x0b, 0xba, 0x90, 0x7e, 0x0e, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, - 0x43, 0x19, 0x01, 0x80, 0x03, 0x53, 0x19, 0xfe, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90}}, - {0x0286, 64, { 0xc0, 0x00, 0xe5, 0x19, 0xf0, 0x90, 0x7e, 0x0c, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x19, - 0x02, 0x80, 0x03, 0x53, 0x19, 0xfd, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, - 0x19, 0xf0, 0x90, 0x7e, 0x12, 0xe0, 0xf5, 0x13, 0xa3, 0xe0, 0x13, 0x92, 0x13, 0xa3, 0xe0, 0xf5, - 0x14, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x19, 0x10, 0x80, 0x03, 0x53, 0x19, 0xef, 0x90, 0x7f}}, - {0x02c6, 64, { 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x19, 0xf0, 0x90, 0x7e, 0x16, 0xe0, 0x60, 0x32, 0x53, - 0x18, 0xbf, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x18, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, - 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x12, 0x0d, 0x24, 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, - 0x53, 0x15, 0xfd, 0xe4, 0xff, 0xad, 0x15, 0x12, 0x0c, 0x2c, 0xe4, 0xf5, 0x0e, 0xf5, 0x0d}}, - {0x0306, 64, { 0xd2, 0x0e, 0x90, 0x7e, 0x17, 0xe0, 0x60, 0x0f, 0x43, 0x15, 0x02, 0xe4, 0xff, 0xad, 0x15, 0x12, 0x0c, - 0x2c, 0x75, 0x0d, 0x01, 0xd2, 0x0e, 0x90, 0x7e, 0x18, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, - 0x12, 0xf0, 0xe5, 0x16, 0x44, 0x04, 0x90, 0xc0, 0x00, 0xf0, 0xd2, 0x0a, 0x90, 0x7e, 0x19, 0xe0, - 0x60, 0x11, 0x43, 0x18, 0x40, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x18, 0x54, 0x7f}}, - {0x0346, 64, { 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x1a, 0xe0, 0x60, 0x0f, 0x53, 0x15, 0xfe, 0xe4, 0xff, 0xad, 0x15, - 0x12, 0x0c, 0x2c, 0x75, 0x0f, 0x01, 0xd2, 0x0e, 0x90, 0x7e, 0x1b, 0xe0, 0x60, 0x0f, 0x43, 0x15, - 0x01, 0xe4, 0xff, 0xad, 0x15, 0x12, 0x0c, 0x2c, 0xe4, 0xf5, 0x0f, 0xd2, 0x0e, 0x90, 0x7e, 0x1c, - 0xe0, 0x60, 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x16, 0x44, 0x02, 0x90, 0xc0}}, - {0x0386, 64, { 0x00, 0xf0, 0x90, 0x7e, 0x1d, 0xe0, 0x60, 0x02, 0xd2, 0x12, 0x90, 0x7e, 0x1e, 0xe0, 0x60, 0x08, 0x75, - 0x10, 0x01, 0xe4, 0xf5, 0x12, 0xd2, 0x0e, 0x90, 0x7e, 0x1f, 0xe0, 0x60, 0x0f, 0x90, 0x7f, 0xd7, - 0x74, 0x11, 0xf0, 0x74, 0x31, 0xf0, 0x74, 0x15, 0xf0, 0x74, 0x35, 0xf0, 0xc2, 0x0d, 0xe4, 0x90, + {0x0000, 3, { 0x02, 0x08, 0xb6}}, + {0x0106, 64, { 0x60, 0x56, 0xb4, 0x80, 0x03, 0x43, 0x11, 0x02, 0xe5, 0x11, 0x30, 0xe7, 0x24, 0xe5, 0x1c, 0xd3, 0x94, + 0x20, 0x40, 0x03, 0x75, 0x1c, 0x20, 0x85, 0x1c, 0x23, 0x7e, 0x7e, 0x7f, 0x80, 0x75, 0x27, 0x7e, + 0x75, 0x28, 0x80, 0x12, 0x0a, 0x86, 0xe5, 0x1c, 0x25, 0x1c, 0x90, 0x7f, 0xb7, 0xf0, 0x80, 0x27, + 0xe5, 0x1c, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, 0x1c, 0x3f, 0x85, 0x1c, 0x23, 0x90, 0x7e}}, + {0x0146, 64, { 0x80, 0xe5, 0x11, 0xf0, 0x7e, 0x7e, 0x7f, 0x81, 0x75, 0x27, 0x7e, 0x75, 0x28, 0x81, 0x12, 0x08, 0x26, + 0xe5, 0x1c, 0x04, 0x90, 0x7f, 0xb7, 0xf0, 0x90, 0x7f, 0xce, 0xe0, 0x30, 0xe1, 0x06, 0x20, 0x0d, + 0x03, 0x02, 0x03, 0xba, 0xe4, 0xf5, 0x1b, 0x74, 0x40, 0x25, 0x1b, 0xf5, 0x82, 0xe4, 0x34, 0x7c, + 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x1b, 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, 0x79, 0x00, 0x24}}, + {0x0186, 64, { 0x00, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, 0x12, 0x0a, 0x0d, 0x05, 0x1b, 0xe5, 0x1b, 0xb4, 0x20, 0xd7, + 0x90, 0x7e, 0x00, 0xe0, 0x60, 0x6e, 0x7f, 0x01, 0x90, 0x7e, 0x11, 0xe0, 0xfd, 0x12, 0x0c, 0x1c, + 0x90, 0x7e, 0x01, 0xe0, 0xff, 0x12, 0x0b, 0x5e, 0x90, 0x7e, 0x02, 0xe0, 0xff, 0x12, 0x0b, 0x84, + 0xd2, 0x10, 0xd2, 0x11, 0x75, 0x1c, 0x04, 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x05, 0xc2, 0x11}}, + {0x01c6, 64, { 0x43, 0x1c, 0xc0, 0x90, 0x7e, 0x04, 0xe0, 0xb4, 0x01, 0x07, 0xc2, 0x11, 0x43, 0x1c, 0x0b, 0x80, 0x10, + 0x90, 0x7e, 0x04, 0xe0, 0x60, 0x07, 0xc2, 0x10, 0x43, 0x1c, 0x09, 0x80, 0x03, 0x43, 0x1c, 0x02, + 0x7f, 0x03, 0xad, 0x1c, 0x12, 0x0c, 0x1c, 0x43, 0x19, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, + 0x90, 0xc0, 0x00, 0xe5, 0x19, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x16, 0x44}}, + {0x0206, 64, { 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x05, 0xe0, 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, 0xf5, 0x18, + 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x18, 0xf0, 0x90, 0x7e, 0x07, 0xe0, + 0x60, 0x42, 0x90, 0x7e, 0x13, 0xe0, 0x60, 0x05, 0x43, 0x15, 0x04, 0x80, 0x03, 0x53, 0x15, 0xfb, + 0xe4, 0xff, 0xad, 0x15, 0x12, 0x0c, 0x1c, 0x90, 0x7e, 0x08, 0xe0, 0x60, 0x05, 0x43, 0x17}}, + {0x0246, 64, { 0x80, 0x80, 0x03, 0x53, 0x17, 0x7f, 0x53, 0x17, 0xfc, 0x90, 0x7e, 0x09, 0xe0, 0x60, 0x11, 0x43, 0x17, + 0x02, 0xa3, 0xe0, 0xff, 0x12, 0x0b, 0xd0, 0x90, 0x7e, 0x0b, 0xe0, 0xff, 0x12, 0x0b, 0xf6, 0xaf, + 0x17, 0x12, 0x0b, 0xaa, 0x90, 0x7e, 0x0e, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x19, + 0x01, 0x80, 0x03, 0x53, 0x19, 0xfe, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00}}, + {0x0286, 64, { 0xe5, 0x19, 0xf0, 0x90, 0x7e, 0x0c, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x19, 0x02, 0x80, + 0x03, 0x53, 0x19, 0xfd, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x19, 0xf0, + 0x90, 0x7e, 0x12, 0xe0, 0xf5, 0x13, 0xa3, 0xe0, 0x13, 0x92, 0x13, 0xa3, 0xe0, 0xf5, 0x14, 0xa3, + 0xe0, 0x60, 0x05, 0x43, 0x19, 0x10, 0x80, 0x03, 0x53, 0x19, 0xef, 0x90, 0x7f, 0x98, 0x74}}, + {0x02c6, 64, { 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x19, 0xf0, 0x90, 0x7e, 0x16, 0xe0, 0x60, 0x32, 0x53, 0x18, 0xbf, + 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x18, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x11, 0xf0, 0x12, 0x0d, 0x14, 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x15, + 0xfd, 0xe4, 0xff, 0xad, 0x15, 0x12, 0x0c, 0x1c, 0xe4, 0xf5, 0x0e, 0xf5, 0x0d, 0xd2, 0x0e}}, + {0x0306, 64, { 0x90, 0x7e, 0x17, 0xe0, 0x60, 0x0f, 0x43, 0x15, 0x02, 0xe4, 0xff, 0xad, 0x15, 0x12, 0x0c, 0x1c, 0x75, + 0x0d, 0x01, 0xd2, 0x0e, 0x90, 0x7e, 0x18, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, + 0xe5, 0x16, 0x44, 0x04, 0x90, 0xc0, 0x00, 0xf0, 0xd2, 0x0a, 0x90, 0x7e, 0x19, 0xe0, 0x60, 0x11, + 0x43, 0x18, 0x40, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x18, 0x54, 0x7f, 0x90, 0xc0}}, + {0x0346, 64, { 0x00, 0xf0, 0x90, 0x7e, 0x1a, 0xe0, 0x60, 0x0f, 0x53, 0x15, 0xfe, 0xe4, 0xff, 0xad, 0x15, 0x12, 0x0c, + 0x1c, 0x75, 0x0f, 0x01, 0xd2, 0x0e, 0x90, 0x7e, 0x1b, 0xe0, 0x60, 0x0f, 0x43, 0x15, 0x01, 0xe4, + 0xff, 0xad, 0x15, 0x12, 0x0c, 0x1c, 0xe4, 0xf5, 0x0f, 0xd2, 0x0e, 0x90, 0x7e, 0x1c, 0xe0, 0x60, + 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x16, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0}}, + {0x0386, 64, { 0x90, 0x7e, 0x1d, 0xe0, 0x60, 0x02, 0xd2, 0x12, 0x90, 0x7e, 0x1e, 0xe0, 0x60, 0x08, 0x75, 0x10, 0x01, + 0xe4, 0xf5, 0x12, 0xd2, 0x0e, 0x90, 0x7e, 0x1f, 0xe0, 0x60, 0x11, 0x90, 0x7f, 0xd7, 0x74, 0x11, + 0xf0, 0x74, 0x31, 0xf0, 0x74, 0x15, 0xf0, 0x74, 0x35, 0xf0, 0xd2, 0x0c, 0xc2, 0x0d, 0xe4, 0x90, 0x7f, 0xcf, 0xf0, 0x30, 0x15, 0x71, 0xe5, 0x12, 0x60, 0x02, 0x15, 0x12, 0xe5, 0x2e, 0xd3}}, - {0x03c6, 64, { 0x94, 0x00, 0x40, 0x04, 0x15, 0x2e, 0x80, 0x60, 0x75, 0x2e, 0x0a, 0x12, 0x0d, 0x24, 0xef, 0x54, 0x01, - 0xf5, 0x1c, 0x65, 0x0e, 0x60, 0x07, 0x85, 0x1c, 0x0e, 0xd2, 0x0e, 0x80, 0x11, 0x12, 0x0d, 0x60, + {0x03c6, 64, { 0x94, 0x00, 0x40, 0x04, 0x15, 0x2e, 0x80, 0x60, 0x75, 0x2e, 0x0a, 0x12, 0x0d, 0x14, 0xef, 0x54, 0x01, + 0xf5, 0x1c, 0x65, 0x0e, 0x60, 0x07, 0x85, 0x1c, 0x0e, 0xd2, 0x0e, 0x80, 0x11, 0x12, 0x0d, 0x50, 0xef, 0x54, 0x10, 0xf5, 0x1c, 0x65, 0x09, 0x60, 0x05, 0x85, 0x1c, 0x09, 0xd2, 0x0e, 0x12, 0x0d, - 0x60, 0xef, 0x54, 0x80, 0xf5, 0x1c, 0x65, 0x0a, 0x60, 0x05, 0x85, 0x1c, 0x0a, 0xd2, 0x0e}}, - {0x0406, 64, { 0x12, 0x0d, 0x60, 0xef, 0x54, 0x20, 0xf5, 0x1c, 0x65, 0x0b, 0x60, 0x08, 0x85, 0x1c, 0x0b, 0x30, 0x10, - 0x02, 0xd2, 0x0e, 0x12, 0x0d, 0x60, 0xef, 0x54, 0x40, 0xf5, 0x1c, 0x65, 0x0c, 0x60, 0x08, 0x85, + 0x50, 0xef, 0x54, 0x80, 0xf5, 0x1c, 0x65, 0x0a, 0x60, 0x05, 0x85, 0x1c, 0x0a, 0xd2, 0x0e}}, + {0x0406, 64, { 0x12, 0x0d, 0x50, 0xef, 0x54, 0x20, 0xf5, 0x1c, 0x65, 0x0b, 0x60, 0x08, 0x85, 0x1c, 0x0b, 0x30, 0x10, + 0x02, 0xd2, 0x0e, 0x12, 0x0d, 0x50, 0xef, 0x54, 0x40, 0xf5, 0x1c, 0x65, 0x0c, 0x60, 0x08, 0x85, 0x1c, 0x0c, 0x30, 0x11, 0x02, 0xd2, 0x0e, 0x30, 0x15, 0x2a, 0x90, 0x7f, 0xd2, 0xe0, 0x20, 0xe1, 0x23, 0x90, 0x7b, 0x40, 0xe0, 0x60, 0x09, 0xe0, 0xf5, 0x30, 0x90, 0x7b, 0x42, 0xe0, 0xf5}}, {0x0446, 64, { 0x31, 0x90, 0x7b, 0x41, 0xe0, 0x60, 0x09, 0x90, 0x7f, 0xd7, 0x74, 0x17, 0xf0, 0x74, 0x37, 0xf0, 0xe4, 0x90, 0x7f, 0xd3, 0xf0, 0x90, 0x7f, 0xc2, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x05, 0x1f, 0xe5, 0x25, 0x70, 0x40, 0x30, 0x0e, 0x39, 0xe5, 0x12, 0x70, 0x35, 0xc2, 0x0e, 0xf5, 0x1b, 0x7e, 0x00, 0x7b, - 0x00, 0x74, 0x08, 0x25, 0x1b, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x09, 0xcb, 0xff, 0x74}}, + 0x00, 0x74, 0x08, 0x25, 0x1b, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x09, 0xc7, 0xff, 0x74}}, {0x0486, 64, { 0x80, 0x25, 0x1b, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x1b, 0xe5, 0x1b, 0xb4, 0x09, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x12, 0x10, 0xe4, 0xf5, 0x10, 0x75, 0x25, 0x02, 0x22, 0xe5, 0x25, 0x64, 0x02, 0x70, 0x36, 0x30, 0x05, 0x2f, 0xc2, 0x05, 0xf5, 0x1b, 0x7e, - 0x00, 0x7b, 0x00, 0x74, 0x29, 0x25, 0x1b, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x09, 0xcb}}, + 0x00, 0x7b, 0x00, 0x74, 0x29, 0x25, 0x1b, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x09, 0xc7}}, {0x04c6, 64, { 0xff, 0x74, 0x80, 0x25, 0x1b, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x1b, 0xe5, 0x1b, 0xb4, 0x05, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x05, 0xf0, 0x75, 0x25, 0x03, 0x22, 0xe5, 0x30, 0x60, 0x33, 0x75, 0x2f, 0x03, 0x15, 0x30, 0xe4, 0xf5, 0x1b, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x2f, - 0x25, 0x1b, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x09, 0xcb, 0xff, 0x74, 0x80, 0x25, 0x1b}}, + 0x25, 0x1b, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x09, 0xc7, 0xff, 0x74, 0x80, 0x25, 0x1b}}, {0x0506, 64, { 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x1b, 0xe5, 0x1b, 0xb4, 0x03, 0xdb, 0x90, - 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, 0xf5, 0x25, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x0a, 0x23, + 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, 0xf5, 0x25, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x0a, 0x1f, 0x05, 0xf6, 0x00, 0x06, 0x6a, 0x01, 0x06, 0xd7, 0x03, 0x05, 0x43, 0x06, 0x05, 0xe9, 0x08, 0x05, 0xe3, 0x09, 0x05, 0xcb, 0x0a, 0x05, 0xda, 0x0b, 0x00, 0x00, 0x07, 0x27, 0x90, 0x7f, 0xeb}}, {0x0546, 64, { 0xe0, 0x24, 0xfe, 0x60, 0x16, 0x14, 0x60, 0x50, 0x24, 0x02, 0x70, 0x6f, 0x74, 0x19, 0x90, 0x7f, 0xd4, @@ -110,7 +114,7 @@ 0x7f, 0x02, 0x80, 0x02, 0x7f, 0x03, 0x75, 0x82, 0x82, 0x75, 0x83, 0x19, 0xef, 0xf0, 0x75, 0x82, 0x74, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x58, 0x75, 0x83, 0x19, 0xf0, 0x90, 0x7f, 0xea}}, {0x0586, 64, { 0xe0, 0x04, 0x75, 0x82, 0x17, 0x75, 0x83, 0x19, 0xf0, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x12, - 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x07, 0x2e, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x0a, 0x49, 0xea, + 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x07, 0x2e, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x0a, 0x45, 0xea, 0x49, 0x60, 0x0d, 0xea, 0x90, 0x7f, 0xd4, 0xf0, 0xe9, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x07, 0x2e, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x07, 0x2e, 0x90, 0x7f, 0xb4, 0xe0, 0x44}}, {0x05c6, 64, { 0x01, 0xf0, 0x02, 0x07, 0x2e, 0x90, 0x7f, 0x00, 0xe5, 0x24, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, @@ -124,14 +128,14 @@ {0x0646, 64, { 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x07, 0x2e, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x07, 0x2e, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1e, 0x24, 0x02, 0x60, 0x03, 0x02, - 0x07, 0x2e, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x06, 0x12, 0x0d, 0x73, 0x02, 0x07, 0x2e}}, + 0x07, 0x2e, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x06, 0x12, 0x0d, 0x63, 0x02, 0x07, 0x2e}}, {0x0686, 64, { 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x07, 0x2e, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x38, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f, 0xec, 0xe0, 0x54, 0x80, 0xff, 0x13, 0x13, 0x13, 0x54, 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f}}, {0x06c6, 64, { 0xd7, 0xf0, 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x60, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x57, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x19, 0x24, 0x02, 0x70, 0x4b, 0x90, 0x7f, 0xea, 0xe0, - 0xb4, 0x01, 0x05, 0x12, 0x0d, 0x70, 0x80, 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, + 0xb4, 0x01, 0x05, 0x12, 0x0d, 0x60, 0x80, 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff}}, {0x0706, 64, { 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, @@ -140,102 +144,102 @@ {0x0746, 64, { 0x90, 0x7f, 0x95, 0x74, 0xc0, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x3f, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x18, 0xf0, 0xe4, 0xf5, 0x8e, 0x90, 0x7f, 0xdf, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xde, 0xf0, 0xe4, 0xf5, 0x08, 0x7f, 0x01, 0x7b, 0x00, 0x74, 0x08, 0x2f, 0xf9, 0xe4, 0x34, 0x00, 0xfa, 0xe4, 0x12, 0x0a, - 0x11, 0x0f, 0xbf, 0x09, 0xee, 0x75, 0x13, 0x01, 0xe4, 0xf5, 0x12, 0xf5, 0x2e, 0xf5, 0x11}}, - {0x0786, 64, { 0xc2, 0x0e, 0xc2, 0x12, 0xc2, 0x0d, 0xc2, 0x0a, 0xc2, 0x0f, 0xc2, 0x04, 0xd2, 0x0c, 0xd2, 0x0b, 0x90, - 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x75, 0x18, 0x03, 0x90, 0xc0, 0x00, 0x74, 0x03, 0xf0, 0x7f, 0x0c, - 0xe4, 0xfd, 0x12, 0x0c, 0x2c, 0x7f, 0x10, 0x8f, 0x17, 0x12, 0x0b, 0xba, 0x90, 0x7f, 0x98, 0x74, - 0x12, 0xf0, 0x7f, 0x01, 0x8f, 0x16, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f}}, - {0x07c6, 64, { 0x98, 0x74, 0x14, 0xf0, 0x75, 0x19, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, - 0x0c, 0x2c, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x15, 0x12, 0x0c, 0x2c, 0x90, 0x7f, 0x98, - 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x0c, 0x2c, 0x7f, - 0x01, 0x12, 0x0c, 0xbc, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x0c, 0x2c, 0xd2, 0x03, 0x22, 0x90}}, - {0x0806, 64, { 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x23, 0xe5, 0x28, 0xf5, 0x82, 0xe5, 0x27, 0xf5, 0x83, 0xc2, 0xaf, - 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, - 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x23, 0xe5, 0x28, 0xf5, 0x82, 0xe5, - 0x27, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3}}, - {0x0846, 64, { 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x23, - 0xe5, 0x28, 0xf5, 0x82, 0xe5, 0x27, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, - 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, - 0x74, 0x08, 0xf0, 0xaf, 0x23, 0xe5, 0x28, 0xf5, 0x82, 0xe5, 0x27, 0xf5, 0x83, 0xc2, 0xaf}}, - {0x0886, 64, { 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, - 0xaf, 0x22, 0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, - 0x70, 0xf9, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, 0x87, 0x01, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x31, 0x02, 0x09, 0x01}}, - {0x08c6, 64, { 0x02, 0x09, 0x46, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2, 0x08, - 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8, 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, - 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, - 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x0c, 0xdd, 0xe4, 0x7e}}, - {0x0906, 64, { 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, - 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0, 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, - 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, - 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe}}, - {0x0946, 64, { 0xd2, 0x14, 0x90, 0x7f, 0x92, 0xe0, 0x44, 0x02, 0xf0, 0x12, 0x0d, 0x73, 0xd2, 0xe8, 0x43, 0xd8, 0x20, - 0x90, 0x7f, 0xde, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, - 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaf, 0xe0, 0x44, - 0x01, 0xf0, 0x90, 0x7f, 0xae, 0x74, 0x0d, 0xf0, 0xd2, 0xaf, 0xd2, 0x15, 0x12, 0x0c, 0x76}}, - {0x0986, 64, { 0xc2, 0x02, 0xe4, 0xf5, 0x26, 0xf5, 0x2e, 0xc2, 0x08, 0xc2, 0x03, 0x90, 0x7f, 0xa1, 0x04, 0xf0, 0x90, - 0x7f, 0xd8, 0xe0, 0x65, 0x1a, 0x60, 0x10, 0x30, 0x03, 0x05, 0xd2, 0x15, 0x12, 0x00, 0x46, 0x90, - 0x7f, 0xd8, 0xe0, 0xf5, 0x1a, 0x80, 0x08, 0x30, 0x03, 0x05, 0xc2, 0x15, 0x12, 0x00, 0x46, 0x30, - 0x02, 0x07, 0xc2, 0x02, 0x12, 0x05, 0x20, 0x80, 0xd6, 0x30, 0x09, 0xd3, 0xc2, 0x09, 0x12}}, - {0x09c6, 64, { 0x0a, 0xf1, 0x80, 0xcc, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, - 0x22, 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x0c, - 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06, 0xe9, 0x25, - 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5, 0x82}}, - {0x0a06, 64, { 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, - 0x83, 0xf0, 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22, 0xd0, 0x83, 0xd0, 0x82, - 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01, - 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3}}, - {0x0a46, 64, { 0xa3, 0x80, 0xdf, 0x8f, 0x1b, 0xe4, 0xf5, 0x1c, 0x75, 0x1d, 0xff, 0x75, 0x1e, 0x19, 0x75, 0x1f, 0x86, - 0xab, 0x1d, 0xaa, 0x1e, 0xa9, 0x1f, 0x90, 0x00, 0x01, 0x12, 0x09, 0xe4, 0xb4, 0x03, 0x1d, 0xaf, - 0x1c, 0x05, 0x1c, 0xef, 0xb5, 0x1b, 0x01, 0x22, 0x12, 0x09, 0xcb, 0x7e, 0x00, 0x29, 0xff, 0xee, - 0x3a, 0xa9, 0x07, 0x75, 0x1d, 0xff, 0xf5, 0x1e, 0x89, 0x1f, 0x80, 0xd4, 0x7b, 0x00, 0x7a}}, - {0x0a86, 64, { 0x00, 0x79, 0x00, 0x22, 0x8f, 0x1d, 0x05, 0x28, 0xe5, 0x28, 0xae, 0x27, 0x70, 0x02, 0x05, 0x27, 0x14, - 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x1d, 0xf0, 0x12, 0x00, 0x36, 0x05, 0x28, 0xe5, 0x28, 0xac, 0x27, - 0x70, 0x02, 0x05, 0x27, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x23, 0xe5, 0x23, 0x60, - 0x0a, 0x12, 0x0d, 0x54, 0x8f, 0x1d, 0xef, 0x42, 0x11, 0x80, 0xca, 0x22, 0xc0, 0xe0, 0xc0}}, - {0x0ac6, 64, { 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x30, 0x06, 0x04, 0xc2, 0x06, - 0x80, 0x02, 0xd2, 0x09, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, 0x86, 0xd0, - 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, 0x1b, - 0x12, 0x00, 0x03, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x12, 0x08, 0xaa, 0x90, 0x7f}}, - {0x0b06, 64, { 0xd6, 0xe0, 0x30, 0xe7, 0x0e, 0x30, 0x01, 0x05, 0x12, 0x0d, 0x0e, 0x80, 0x06, 0x12, 0x0c, 0x9b, 0xef, - 0x60, 0xe1, 0x12, 0x07, 0x36, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, - 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90, 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, - 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0}}, - {0x0b46, 64, { 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, - 0x02, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, + 0x0d, 0x0f, 0xbf, 0x09, 0xee, 0x75, 0x13, 0x01, 0xe4, 0xf5, 0x12, 0xf5, 0x2e, 0xf5, 0x11}}, + {0x0786, 64, { 0xc2, 0x0e, 0xc2, 0x12, 0xc2, 0x0d, 0xc2, 0x0a, 0xc2, 0x0f, 0xc2, 0x04, 0x90, 0x7f, 0x98, 0x74, 0x13, + 0xf0, 0x75, 0x18, 0x03, 0x90, 0xc0, 0x00, 0x74, 0x03, 0xf0, 0x7f, 0x0c, 0xe4, 0xfd, 0x12, 0x0c, + 0x1c, 0x7f, 0x10, 0x8f, 0x17, 0x12, 0x0b, 0xaa, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x7f, 0x01, + 0x8f, 0x16, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, 0x0c, 0x1c}}, + {0x07c6, 64, { 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x15, 0x12, 0x0c, 0x1c, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, + 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x0c, 0x1c, 0x7f, 0x01, 0x12, 0x0c, + 0xac, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x0c, 0x1c, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x75, 0x19, + 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0xd2, 0x03, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10}}, + {0x0806, 64, { 0xf0, 0xaf, 0x23, 0xe5, 0x28, 0xf5, 0x82, 0xe5, 0x27, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, + 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, 0xaf, 0x22, 0x90, + 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x23, 0xe5, 0x28, 0xf5, 0x82, 0xe5, 0x27, 0xf5, 0x83, 0xc2, + 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7}}, + {0x0846, 64, { 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x23, 0xe5, 0x28, 0xf5, 0x82, + 0xe5, 0x27, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, + 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, + 0x23, 0xe5, 0x28, 0xf5, 0x82, 0xe5, 0x27, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0}}, + {0x0886, 64, { 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x74, 0x00, + 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, + 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x78, + 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x31, 0x02, 0x08, 0xfd, 0x02, 0x09, 0x42, 0xe4}}, + {0x08c6, 64, { 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, + 0xe4, 0x93, 0xa3, 0xf8, 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, + 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, + 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x0c, 0xcd, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc}}, + {0x0906, 64, { 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, + 0x54, 0xc0, 0x25, 0xe0, 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, + 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, + 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0xd2, 0x14, 0x90, 0x7f}}, + {0x0946, 64, { 0x92, 0xe0, 0x44, 0x02, 0xf0, 0x12, 0x0d, 0x63, 0xd2, 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74, + 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, + 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, + 0xae, 0x74, 0x0d, 0xf0, 0xd2, 0xaf, 0xd2, 0x15, 0x12, 0x0c, 0x66, 0xc2, 0x02, 0xe4, 0xf5}}, + {0x0986, 64, { 0x26, 0xf5, 0x2e, 0xc2, 0x08, 0xc2, 0x03, 0x90, 0x7f, 0xa1, 0x04, 0xf0, 0x90, 0x7f, 0xd8, 0xe0, 0x65, + 0x1a, 0x60, 0x10, 0x30, 0x03, 0x05, 0xd2, 0x15, 0x12, 0x00, 0x46, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, + 0x1a, 0x80, 0x08, 0x30, 0x03, 0x05, 0xc2, 0x15, 0x12, 0x00, 0x46, 0x30, 0x02, 0x07, 0xc2, 0x02, + 0x12, 0x05, 0x20, 0x80, 0xd6, 0x30, 0x09, 0xd3, 0xc2, 0x09, 0x12, 0x0a, 0xba, 0x80, 0xcc}}, + {0x09c6, 64, { 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02, + 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, + 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, + 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5}}, + {0x0a06, 64, { 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xf0, 0x22, 0x50, + 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22, 0xd0, 0x83, 0xd0, 0x82, 0xf8, 0xe4, 0x93, 0x70, + 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, + 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, 0xa3, 0x80, 0xdf, 0x8f}}, + {0x0a46, 64, { 0x1b, 0xe4, 0xf5, 0x1c, 0x75, 0x1d, 0xff, 0x75, 0x1e, 0x19, 0x75, 0x1f, 0x86, 0xab, 0x1d, 0xaa, 0x1e, + 0xa9, 0x1f, 0x90, 0x00, 0x01, 0x12, 0x09, 0xe0, 0xb4, 0x03, 0x1d, 0xaf, 0x1c, 0x05, 0x1c, 0xef, + 0xb5, 0x1b, 0x01, 0x22, 0x12, 0x09, 0xc7, 0x7e, 0x00, 0x29, 0xff, 0xee, 0x3a, 0xa9, 0x07, 0x75, + 0x1d, 0xff, 0xf5, 0x1e, 0x89, 0x1f, 0x80, 0xd4, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x00, 0x22}}, + {0x0a86, 64, { 0x05, 0x28, 0xe5, 0x28, 0xae, 0x27, 0x70, 0x02, 0x05, 0x27, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x11, + 0xf0, 0x12, 0x00, 0x36, 0x05, 0x28, 0xe5, 0x28, 0xac, 0x27, 0x70, 0x02, 0x05, 0x27, 0x14, 0xf5, + 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x23, 0xe5, 0x23, 0x60, 0x07, 0x12, 0x0d, 0x44, 0x8f, 0x11, + 0x80, 0xcd, 0x22, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, 0x1b, 0x12, 0x00, 0x03, 0x90, 0x7f, 0xd6}}, + {0x0ac6, 64, { 0xe0, 0x44, 0x80, 0xf0, 0x12, 0x08, 0xa6, 0x90, 0x7f, 0xd6, 0xe0, 0x30, 0xe7, 0x0e, 0x30, 0x01, 0x05, + 0x12, 0x0c, 0xfe, 0x80, 0x06, 0x12, 0x0c, 0x8b, 0xef, 0x60, 0xe1, 0x12, 0x07, 0x36, 0x22, 0xc0, + 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90, 0x7f, + 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0}}, + {0x0b06, 64, { 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, + 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x02, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, + 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, + 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00}}, + {0x0b46, 64, { 0xd2, 0x09, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, - 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90}}, - {0x0b86, 64, { 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x18, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, - 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, + 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x18, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f}}, + {0x0b86, 64, { 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x18, 0x54, 0x7f, 0x90, 0xc0, - 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0}}, - {0x0bc6, 64, { 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, - 0xe5, 0x18, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, + 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, + 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13}}, + {0x0bc6, 64, { 0xf0, 0xe5, 0x18, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, - 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x18, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22}}, - {0x0c06, 64, { 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x16, - 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x18, 0x54, 0x7f, + 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x18, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, + 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74}}, + {0x0c06, 64, { 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x18, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x18, 0x54, 0x7f, 0x90, - 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x17, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90}}, - {0x0c46, 64, { 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, 0x0d, 0x3c, 0x8f, 0x1d, 0x12, - 0x0d, 0x3c, 0x8f, 0x1e, 0xe5, 0x1d, 0x65, 0x1e, 0x60, 0x12, 0x12, 0x0d, 0x3c, 0x8f, 0x1d, 0xe5, - 0x1d, 0x65, 0x1e, 0x60, 0x07, 0x12, 0x0d, 0x3c, 0x8f, 0x1e, 0x80, 0xe8, 0xaf, 0x1d, 0x22, 0x90, - 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x15, 0x04, 0xe0, 0x44}}, - {0x0c86, 64, { 0x02, 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x0c, 0xf7, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0xe0, - 0x44, 0x04, 0xf0, 0x22, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, 0x1c, 0x12, 0x07, 0x36, 0x12, 0x0d, 0x60, + 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x17, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, 0x0d, 0x2c, 0x8f, 0x1d}}, + {0x0c46, 64, { 0x12, 0x0d, 0x2c, 0x8f, 0x1e, 0xe5, 0x1d, 0x65, 0x1e, 0x60, 0x12, 0x12, 0x0d, 0x2c, 0x8f, 0x1d, 0xe5, + 0x1d, 0x65, 0x1e, 0x60, 0x07, 0x12, 0x0d, 0x2c, 0x8f, 0x1e, 0x80, 0xe8, 0xaf, 0x1d, 0x22, 0x90, + 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x15, 0x04, 0xe0, 0x44, 0x02, + 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x0c, 0xe7, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0}}, + {0x0c86, 64, { 0xe0, 0x44, 0x04, 0xf0, 0x22, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, 0x1c, 0x12, 0x07, 0x36, 0x12, 0x0d, 0x50, 0xef, 0x30, 0xe6, 0x0b, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x1c, 0x60, 0xf1, 0x7f, 0x01, 0x22, 0x12, - 0x00, 0x03, 0x7f, 0x00, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x15, 0x54, 0x7f, 0xfd, 0x12}}, - {0x0cc6, 64, { 0x0c, 0x2c, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x15, 0x44, - 0x80, 0xfd, 0x12, 0x0c, 0x2c, 0x22, 0x05, 0x29, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x2f, 0x03, + 0x00, 0x03, 0x7f, 0x00, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x15, 0x54, 0x7f, 0xfd, 0x12, 0x0c, + 0x1c, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x15}}, + {0x0cc6, 64, { 0x44, 0x80, 0xfd, 0x12, 0x0c, 0x1c, 0x22, 0x05, 0x29, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x2f, 0x03, 0x00, 0x00, 0xc1, 0x86, 0xc1, 0x02, 0xc1, 0x09, 0xc1, 0x01, 0xc1, 0x07, 0x01, 0x25, 0x00, 0x00, - 0x8e, 0x1c, 0x8f, 0x1d, 0xe5, 0x1d, 0x15, 0x1d, 0xae, 0x1c, 0x70, 0x02, 0x15, 0x1c, 0x4e}}, - {0x0d06, 64, { 0x60, 0x05, 0x12, 0x08, 0x99, 0x80, 0xee, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x01, 0xf0, 0x7f, 0x0d, - 0x7e, 0x00, 0x12, 0x0c, 0xf7, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x7f, 0x98, + 0x8e, 0x1c, 0x8f, 0x1d, 0xe5, 0x1d, 0x15, 0x1d, 0xae, 0x1c, 0x70, 0x02, 0x15, 0x1c, 0x4e, 0x60, + 0x05, 0x12, 0x08, 0x95, 0x80, 0xee, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x01, 0xf0, 0x7f}}, + {0x0d06, 64, { 0x0d, 0x7e, 0x00, 0x12, 0x0c, 0xe7, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, - 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe0}}, - {0x0d46, 64, { 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, - 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, + 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, + 0x22, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f}}, + {0x0d46, 64, { 0x98, 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x53, 0xd8, 0xef, 0x32, 0xd2, 0x01, 0x22, 0xc2, 0x01, 0x22, 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}}, {0x0d86, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -244,8 +248,8 @@ {0x0dc6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0b, 0x47, 0x00, 0x02, 0x0e}}, - {0x0e06, 64, { 0x04, 0x00, 0x02, 0x0b, 0x1d, 0x00, 0x02, 0x0a, 0xc3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0b, 0x10, 0x00, 0x02, 0x0e}}, + {0x0e06, 64, { 0x04, 0x00, 0x02, 0x0a, 0xe6, 0x00, 0x02, 0x0b, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, @@ -420,15 +424,15 @@ {0x18c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x00, 0x01, 0xff, 0x00}}, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x10, 0x01, 0xff, 0x00}}, {0x1906, 64, { 0x00, 0x40, 0xcd, 0x06, 0x08, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x02, 0x09, 0x02, 0x74, 0x00, 0x01, 0x01, 0x00, 0xa0, 0x32, 0x09, 0x04, 0x00, 0x00, 0x0e, 0xff, 0x00, 0x00, 0x00, 0x07, 0x05, 0x01, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x02, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x03, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x04, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x05, 0x02, 0x40, 0x00}}, {0x1946, 64, { 0x00, 0x07, 0x05, 0x06, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x07, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, - 0x81, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x83, 0x02, - 0x40, 0x00, 0x00, 0x07, 0x05, 0x84, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x85, 0x02, 0x40, 0x00, - 0x01, 0x07, 0x05, 0x86, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x87, 0x02, 0x40, 0x00, 0x01}}, + 0x81, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x83, 0x02, + 0x40, 0x00, 0x01, 0x07, 0x05, 0x84, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x85, 0x02, 0x40, 0x00, + 0x01, 0x07, 0x05, 0x86, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x87, 0x02, 0x40, 0x00, 0x01}}, {0x1986, 64, { 0x04, 0x03, 0x09, 0x04, 0x48, 0x03, 0x4b, 0x00, 0x65, 0x00, 0x79, 0x00, 0x73, 0x00, 0x70, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x2c, 0x00, 0x20, 0x00, 0x61, 0x00, 0x20, 0x00, 0x64, 0x00, 0x69, 0x00, 0x76, 0x00, 0x69, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x6f, 0x00, 0x66, @@ -438,5 +442,5 @@ 0x00, 0x42, 0x00, 0x20, 0x00, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x41, 0x00, 0x64, 0x00, 0x61, 0x00, 0x70, 0x00, 0x74, 0x00, 0x65, 0x00}}, {0x1a06, 4, { 0x72, 0x00, 0x00, 0x00}}, -{ 0xffff, 0, {0x00} } + {0xffff, 0, {0x00} } }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa26msg.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa26msg.h --- linux.20pre5/drivers/usb/serial/keyspan_usa26msg.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa26msg.h 2002-09-01 13:39:31.000000000 +0100 @@ -44,7 +44,7 @@ Buffer formats for RX/TX data messages are not defined by a structure, but are described here: - USB OUT (host -> USA26, transmit) messages contain a + USB OUT (host -> USAxx, transmit) messages contain a REQUEST_ACK indicator (set to 0xff to request an ACK at the completion of transmit; 0x00 otherwise), followed by data: @@ -52,25 +52,48 @@ with a total data length of 63. - USB IN (USA26 -> host, receive) messages contain either a zero - flag (indicating no error in any data bytes): + USB IN (USAxx -> host, receive) messages begin with a status + byte in which the 0x80 bit is either: - 00 DAT DAT DAT ... + (a) 0x80 bit clear + indicates that the bytes following it are all data + bytes: - for a total of 63 data bytes, or a non-zero status flag (indicating - that all data bytes will be preceded by status flag): + STAT DATA DATA DATA DATA DATA ... - STAT DAT STAT DAT STAT DAT ... + for a total of up to 63 DATA bytes, - for a total of 32 data bytes. The valid bits in the STAT bytes are: + or: + + (b) 0x80 bit set + indiates that the bytes following alternate data and + status bytes: + + STAT DATA STAT DATA STAT DATA STAT DATA ... + + for a total of up to 32 DATA bytes. + + The valid bits in the STAT bytes are: OVERRUN 0x02 PARITY 0x04 FRAMING 0x08 BREAK 0x10 - Note: a "no status" RX data message (first byte zero) can serve as - a "break off" indicator. + Notes: + + (1) The OVERRUN bit can appear in either (a) or (b) format + messages, but the but the PARITY/FRAMING/BREAK bits + only appear in (b) format messages. + (2) For the host to determine the exact point at which the + overrun occurred (to identify the point in the data + stream at which the data was lost), it needs to count + 128 characters, starting at the first character of the + message in which OVERRUN was reported; the lost character(s) + would have been received between the 128th and 129th + characters. + (3) An RX data message in which the first byte has 0x80 clear + serves as a "break off" indicator. revision history: @@ -80,6 +103,7 @@ 1999apr14 add resetDataToggle to control message 2000jan04 merge with usa17msg.h 2000jun01 add extended BSD-style copyright text + 2001jul05 change message format to improve OVERRUN case Note on shared names: @@ -93,7 +117,7 @@ #define __USA26MSG__ -typedef struct keyspan_usa26_portControlMessage +struct keyspan_usa26_portControlMessage { /* there are three types of "commands" sent in the control message: @@ -164,7 +188,7 @@ returnStatus, // BOTH: return current status (even if it hasn't changed) resetDataToggle;// BOTH: reset data toggle state to DATA0 -} keyspan_usa26_portControlMessage; +}; // defines for bits in lcr #define USA_DATABITS_5 0x00 @@ -182,7 +206,7 @@ // all things called "StatusMessage" are sent on the status endpoint -typedef struct keyspan_usa26_portStatusMessage // one for each port +struct keyspan_usa26_portStatusMessage // one for each port { u8 port, // BOTH: 0=first, 1=second, other=see below hskia_cts, // USA26: reports HSKIA pin @@ -195,7 +219,7 @@ _txXoff, // port is in XOFF state (either host or RX XOFF) rxEnabled, // as configured by rxOn/rxOff 1=on, 0=off controlResponse;// 1=a control message has been processed -} keyspan_usa26_portStatusMessage; +}; // bits in RX data message when STAT byte is included #define RXERROR_OVERRUN 0x02 @@ -203,28 +227,28 @@ #define RXERROR_FRAMING 0x08 #define RXERROR_BREAK 0x10 -typedef struct keyspan_usa26_globalControlMessage +struct keyspan_usa26_globalControlMessage { u8 sendGlobalStatus, // 2=request for two status responses resetStatusToggle, // 1=reset global status toggle resetStatusCount; // a cycling value -} keyspan_usa26_globalControlMessage; +}; -typedef struct keyspan_usa26_globalStatusMessage +struct keyspan_usa26_globalStatusMessage { u8 port, // 3 sendGlobalStatus, // from request, decremented resetStatusCount; // as in request -} keyspan_usa26_globalStatusMessage; +}; -typedef struct keyspan_usa26_globalDebugMessage +struct keyspan_usa26_globalDebugMessage { u8 port, // 2 a, b, c, d; -} keyspan_usa26_globalDebugMessage; +}; // ie: the maximum length of an EZUSB endpoint buffer #define MAX_DATA_LEN 64 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa28_fw.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa28_fw.h --- linux.20pre5/drivers/usb/serial/keyspan_usa28_fw.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa28_fw.h 2002-09-01 13:39:31.000000000 +0100 @@ -1,28 +1,33 @@ /* keyspan_usa28_fw.h - - Generated from Keyspan firmware image usa28code.h Sat Oct 6 12:11:26 EST 2001 - This firmware is for the Keyspan USA-28 Serial Adaptor - "The firmware contained herein as keyspan_usa28_fw.h is - Copyright (C) 1999-2001 Keyspan, A division of InnoSys Incorporated - ("Keyspan"), as an unpublished work. This notice does not imply - unrestricted or public access to this firmware which is a trade secret of - Keyspan, and which may not be reproduced, used, sold or transferred to any - third party without Keyspan's prior written consent. All Rights Reserved. + The firmware contained herein as keyspan_usa28_fw.h is - This firmware may not be modified and may only be used with the Keyspan - USA-28 Serial Adapter. Distribution and/or Modification of the - keyspan.c driver which includes this firmware, in whole or in part, - requires the inclusion of this statement." + Copyright (C) 1999-2001 + Keyspan, A division of InnoSys Incorporated ("Keyspan") + + as an unpublished work. This notice does not imply unrestricted or + public access to the source code from which this firmware image is + derived. Except as noted below this firmware image may not be + reproduced, used, sold or transferred to any third party without + Keyspan's prior written consent. All Rights Reserved. + + Permission is hereby granted for the distribution of this firmware + image as part of a Linux or other Open Source operating system kernel + in text or binary form as required. + + This firmware may not be modified and may only be used with + Keyspan hardware. Distribution and/or Modification of the + keyspan.c driver which includes this firmware, in whole or in + part, requires the inclusion of this statement." */ static const struct ezusb_hex_record keyspan_usa28_firmware[] = { - {0x0026, 10, { 0x12, 0x18, 0x09, 0x12, 0x18, 0xbc, 0x12, 0x14, 0xbb, 0x22}}, + {0x0026, 10, { 0x12, 0x17, 0xdb, 0x12, 0x18, 0xb5, 0x12, 0x14, 0xc3, 0x22}}, {0x0033, 3, { 0x02, 0x00, 0x1d}}, {0x001d, 4, { 0x53, 0xd8, 0xef, 0x32}}, {0x0006, 16, { 0x8e, 0x12, 0x8f, 0x13, 0xe5, 0x13, 0x15, 0x13, 0xae, 0x12, 0x70, 0x02, 0x15, 0x12, 0x4e, 0x60}}, - {0x0016, 7, { 0x05, 0x12, 0x18, 0xab, 0x80, 0xee, 0x22}}, + {0x0016, 7, { 0x05, 0x12, 0x18, 0xa4, 0x80, 0xee, 0x22}}, {0x0003, 3, { 0x02, 0x00, 0x46}}, {0x0046, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0, 0xd0, 0x75, 0xd0, 0x08}}, {0x0056, 16, { 0x30, 0x99, 0x0e, 0x30, 0x11, 0x07, 0xa2, 0x17, 0x92, 0x9b, 0x85, 0x46, 0x99, 0xc2, 0x99, 0xd2}}, @@ -192,7 +197,7 @@ 0x40, 0x15, 0x15, 0x49, 0x15, 0x49, 0x05, 0x39, 0xd2, 0x0e, 0x80, 0x0b, 0x90, 0x7f, 0xbd, 0xe5, 0x49, 0xf0, 0x75, 0x49, 0x00, 0xd2, 0x02, 0xd2, 0x25, 0x30, 0x25, 0x05, 0xc2, 0x25, 0x02, 0x00, 0x56, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0xce}}, - {0x0a86, 64, { 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x0b, 0xa1, 0xe4, 0xf5, 0x12, 0x74, 0x40, 0x25, 0x12, 0xf5, 0x82, 0xe4, + {0x0a86, 64, { 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x0b, 0xa5, 0xe4, 0xf5, 0x12, 0x74, 0x40, 0x25, 0x12, 0xf5, 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x12, 0x7c, 0x00, 0x7b, 0x00, 0x24, 0x4c, 0xf9, 0xec, 0x34, 0x00, 0xfa, 0xef, 0x12, 0x15, 0xcd, 0x05, 0x12, 0xe5, 0x12, 0xb4, 0x18, 0xdb, 0xe5, 0x4c, 0x60, 0x0c, 0x75, 0xc9, 0x20, 0x75, 0xc8, 0x36, 0x85, 0x4d, 0xca, 0x85, 0x4e, 0xcb, 0xe5}}, @@ -207,166 +212,166 @@ {0x0b46, 64, { 0x02, 0xf0, 0x90, 0x7f, 0x98, 0xe0, 0x54, 0xfd, 0xf0, 0xe5, 0x5e, 0x60, 0x0a, 0xd2, 0x9c, 0xc2, 0x98, 0x75, 0x2e, 0x01, 0x75, 0x40, 0x28, 0xe5, 0x5f, 0x60, 0x07, 0xc2, 0x9c, 0xe4, 0xf5, 0x48, 0xf5, 0x2e, 0xe5, 0x60, 0x60, 0x03, 0xe4, 0xf5, 0x48, 0xe5, 0x61, 0x60, 0x02, 0xd2, 0x07, 0xe5, 0x62, - 0x60, 0x08, 0xe5, 0x5e, 0x70, 0x02, 0xf5, 0x40, 0xd2, 0x0c, 0xe5, 0x63, 0x60, 0x15, 0x90}}, + 0x60, 0x08, 0xe5, 0x5e, 0x70, 0x02, 0xf5, 0x40, 0xd2, 0x0c, 0xe5, 0x63, 0x60, 0x19, 0x90}}, {0x0b86, 64, { 0x7f, 0xd7, 0x74, 0x11, 0xf0, 0x74, 0x31, 0xf0, 0x74, 0x12, 0xf0, 0x74, 0x32, 0xf0, 0x74, 0x15, 0xf0, - 0x74, 0x35, 0xf0, 0xd2, 0x09, 0xe4, 0x90, 0x7f, 0xcf, 0xf0, 0xa2, 0x13, 0xe4, 0x33, 0xff, 0x65, - 0x2b, 0x60, 0x04, 0x8f, 0x2b, 0xd2, 0x0c, 0xa2, 0x0b, 0xe4, 0x33, 0xff, 0x65, 0x2c, 0x60, 0x04, - 0x8f, 0x2c, 0xd2, 0x0c, 0x90, 0x7f, 0x9b, 0xe0, 0x54, 0x08, 0x65, 0x27, 0x60, 0x07, 0xe0}}, - {0x0bc6, 64, { 0x54, 0x08, 0xf5, 0x27, 0xd2, 0x0c, 0x90, 0x7f, 0x9b, 0xe0, 0x54, 0x40, 0xb5, 0x29, 0x09, 0xe0, 0x54, - 0x40, 0x64, 0x40, 0xf5, 0x29, 0xd2, 0x0c, 0x30, 0x07, 0x35, 0xc2, 0xaf, 0x30, 0x01, 0x18, 0x90, - 0x7f, 0xb8, 0xe0, 0x20, 0xe1, 0x27, 0xe5, 0x48, 0x60, 0x09, 0x90, 0x7f, 0xb7, 0xf0, 0xe4, 0xf5, - 0x48, 0xc2, 0x01, 0xc2, 0x07, 0x80, 0x16, 0x90, 0x7f, 0xb6, 0xe0, 0x20, 0xe1, 0x0f, 0xe5}}, - {0x0c06, 64, { 0x48, 0x60, 0x09, 0x90, 0x7f, 0xb9, 0xf0, 0xe4, 0xf5, 0x48, 0xd2, 0x01, 0xc2, 0x07, 0xd2, 0xaf, 0x20, - 0x05, 0x37, 0x30, 0x03, 0x1b, 0x90, 0x7f, 0xc6, 0xe0, 0x20, 0xe1, 0x2d, 0x90, 0x7e, 0x40, 0xe0, - 0x13, 0x92, 0x15, 0x75, 0x4a, 0x01, 0x90, 0x7f, 0xc7, 0xe0, 0xf5, 0x7c, 0xd2, 0x05, 0x80, 0x19, - 0x90, 0x7f, 0xc8, 0xe0, 0x20, 0xe1, 0x12, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x15, 0x75}}, - {0x0c46, 64, { 0x4a, 0x01, 0x90, 0x7f, 0xc9, 0xe0, 0xf5, 0x7c, 0xd2, 0x05, 0x20, 0x21, 0x33, 0x20, 0x00, 0x06, 0xe5, - 0x4a, 0x65, 0x7c, 0x70, 0x2a, 0x30, 0x05, 0x1a, 0x30, 0x03, 0x09, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, - 0xc2, 0x03, 0x80, 0x07, 0xe4, 0x90, 0x7f, 0xc9, 0xf0, 0xd2, 0x03, 0xc2, 0x05, 0xe4, 0xf5, 0x7c, - 0xf5, 0x4a, 0x30, 0x15, 0x0a, 0xc2, 0x15, 0xc2, 0x00, 0x90, 0x7f, 0xbf, 0x74, 0x01, 0xf0}}, - {0x0c86, 64, { 0x30, 0x21, 0x03, 0x02, 0x0d, 0x90, 0x20, 0x05, 0x03, 0x02, 0x0d, 0x90, 0x30, 0x1c, 0x0a, 0x90, 0x7f, - 0x9b, 0xe0, 0x20, 0xe3, 0x03, 0x02, 0x0d, 0x90, 0x30, 0x0b, 0x03, 0x02, 0x0d, 0x90, 0x30, 0x13, - 0x03, 0x02, 0x0d, 0x90, 0x30, 0x03, 0x62, 0x30, 0x1b, 0x12, 0xaf, 0x4a, 0x05, 0x4a, 0x74, 0x40, - 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x2d, 0xaf, 0x4a, 0x05}}, - {0x0cc6, 64, { 0x4a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0xf5, 0x13, 0xe5, 0x4a, 0xc3, - 0x95, 0x7c, 0x50, 0x2a, 0x30, 0x1b, 0x12, 0xaf, 0x4a, 0x05, 0x4a, 0x74, 0x40, 0x2f, 0xf5, 0x82, - 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x17, 0xaf, 0x4a, 0x05, 0x4a, 0x74, 0x40, 0x2f, - 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0xf5, 0x46, 0xd2, 0x11, 0x80, 0x6b, 0xc2}}, - {0x0d06, 64, { 0x11, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0xc2, 0x03, 0x80, 0x60, 0x30, 0x1b, 0x12, 0xaf, 0x4a, 0x05, 0x4a, - 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x2d, 0xaf, 0x4a, - 0x05, 0x4a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, 0x13, 0xe5, - 0x4a, 0xc3, 0x95, 0x7c, 0x50, 0x2a, 0x30, 0x1b, 0x12, 0xaf, 0x4a, 0x05, 0x4a, 0x74, 0xc0}}, - {0x0d46, 64, { 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x17, 0xaf, 0x4a, 0x05, 0x4a, 0x74, - 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, 0x46, 0xd2, 0x11, 0x80, 0x09, - 0xc2, 0x11, 0xe4, 0x90, 0x7f, 0xc9, 0xf0, 0xd2, 0x03, 0x30, 0x1b, 0x04, 0xa2, 0x2d, 0x92, 0x9b, - 0xd2, 0x21, 0xc2, 0xaf, 0x85, 0x13, 0x99, 0x20, 0x11, 0x0d, 0x30, 0x15, 0x0a, 0xc2, 0x15}}, - {0x0d86, 64, { 0xc2, 0x00, 0x90, 0x7f, 0xbf, 0x74, 0x01, 0xf0, 0xd2, 0xaf, 0x90, 0x7f, 0xd0, 0xe0, 0x30, 0xe1, 0x03, - 0x02, 0x0e, 0xad, 0xe4, 0xf5, 0x12, 0x74, 0xc0, 0x25, 0x12, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, - 0x83, 0xe0, 0xff, 0xe5, 0x12, 0x7c, 0x00, 0x7b, 0x00, 0x24, 0x64, 0xf9, 0xec, 0x34, 0x00, 0xfa, - 0xef, 0x12, 0x15, 0xcd, 0x05, 0x12, 0xe5, 0x12, 0xb4, 0x18, 0xdb, 0xe5, 0x64, 0x60, 0x0b}}, - {0x0dc6, 64, { 0x75, 0x89, 0x60, 0x75, 0x88, 0x40, 0xd2, 0xdf, 0x85, 0x65, 0x8d, 0xe5, 0x67, 0x13, 0x92, 0x1d, 0x92, - 0xc7, 0xe5, 0x68, 0x13, 0x92, 0x1e, 0xe5, 0x69, 0x13, 0x92, 0x24, 0xe5, 0x6a, 0x60, 0x09, 0x90, - 0x7f, 0x97, 0xe0, 0x54, 0xef, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0x97, 0xe0, 0x44, 0x10, 0xf0, 0xe5, - 0x6b, 0x60, 0x09, 0x90, 0x7f, 0x97, 0xe0, 0x54, 0x7f, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0x97}}, - {0x0e06, 64, { 0xe0, 0x44, 0x80, 0xf0, 0xe5, 0x71, 0x60, 0x0b, 0xc2, 0x14, 0xc2, 0x0d, 0x90, 0x7f, 0x94, 0xe0, 0x44, - 0x08, 0xf0, 0xe5, 0x72, 0x60, 0x0b, 0xd2, 0x0d, 0xd2, 0x0e, 0x90, 0x7f, 0x94, 0xe0, 0x44, 0x08, - 0xf0, 0xe5, 0x73, 0x60, 0x0d, 0xc2, 0xaf, 0xc2, 0x12, 0xd2, 0x00, 0xe4, 0xf5, 0x7d, 0xf5, 0x4b, - 0xd2, 0xaf, 0xe5, 0x74, 0x60, 0x05, 0x30, 0x24, 0x02, 0xd2, 0x0d, 0xe5, 0x75, 0x60, 0x15}}, - {0x0e46, 64, { 0x90, 0x7f, 0x94, 0xe0, 0x54, 0xf7, 0xf0, 0x90, 0x7f, 0x9d, 0xe0, 0x44, 0x08, 0xf0, 0x90, 0x7f, 0x97, - 0xe0, 0x54, 0xf7, 0xf0, 0xe5, 0x76, 0x60, 0x0a, 0xd2, 0xc4, 0xc2, 0xc0, 0x75, 0x3a, 0x01, 0x75, - 0x41, 0x28, 0xe5, 0x77, 0x60, 0x07, 0xc2, 0xc4, 0xe4, 0xf5, 0x49, 0xf5, 0x3a, 0xe5, 0x78, 0x60, - 0x03, 0xe4, 0xf5, 0x49, 0xe5, 0x79, 0x60, 0x02, 0xd2, 0x08, 0xe5, 0x7a, 0x60, 0x08, 0xe5}}, - {0x0e86, 64, { 0x76, 0x70, 0x02, 0xf5, 0x41, 0xd2, 0x0e, 0xe5, 0x7b, 0x60, 0x15, 0x90, 0x7f, 0xd7, 0x74, 0x13, 0xf0, - 0x74, 0x33, 0xf0, 0x74, 0x14, 0xf0, 0x74, 0x34, 0xf0, 0x74, 0x16, 0xf0, 0x74, 0x36, 0xf0, 0xd2, - 0x0a, 0xe4, 0x90, 0x7f, 0xd1, 0xf0, 0xa2, 0x14, 0xe4, 0x33, 0xff, 0x65, 0x37, 0x60, 0x04, 0x8f, - 0x37, 0xd2, 0x0e, 0xa2, 0x0d, 0xe4, 0x33, 0xff, 0x65, 0x38, 0x60, 0x04, 0x8f, 0x38, 0xd2}}, - {0x0ec6, 64, { 0x0e, 0x90, 0x7f, 0x9a, 0xe0, 0x54, 0x20, 0x65, 0x33, 0x60, 0x07, 0xe0, 0x54, 0x20, 0xf5, 0x33, 0xd2, - 0x0e, 0x90, 0x7f, 0x9a, 0xe0, 0x54, 0x40, 0xb5, 0x35, 0x09, 0xe0, 0x54, 0x40, 0x64, 0x40, 0xf5, - 0x35, 0xd2, 0x0e, 0x30, 0x08, 0x35, 0xc2, 0xaf, 0x30, 0x02, 0x18, 0x90, 0x7f, 0xbc, 0xe0, 0x20, - 0xe1, 0x27, 0xe5, 0x49, 0x60, 0x09, 0x90, 0x7f, 0xbb, 0xf0, 0xe4, 0xf5, 0x49, 0xc2, 0x02}}, - {0x0f06, 64, { 0xc2, 0x08, 0x80, 0x16, 0x90, 0x7f, 0xba, 0xe0, 0x20, 0xe1, 0x0f, 0xe5, 0x49, 0x60, 0x09, 0x90, 0x7f, - 0xbd, 0xf0, 0xe4, 0xf5, 0x49, 0xd2, 0x02, 0xc2, 0x08, 0xd2, 0xaf, 0x20, 0x06, 0x37, 0x30, 0x04, - 0x1b, 0x90, 0x7f, 0xca, 0xe0, 0x20, 0xe1, 0x2d, 0x90, 0x7d, 0x40, 0xe0, 0x13, 0x92, 0x16, 0x75, - 0x4b, 0x01, 0x90, 0x7f, 0xcb, 0xe0, 0xf5, 0x7d, 0xd2, 0x06, 0x80, 0x19, 0x90, 0x7f, 0xcc}}, - {0x0f46, 64, { 0xe0, 0x20, 0xe1, 0x12, 0x90, 0x7c, 0xc0, 0xe0, 0x13, 0x92, 0x16, 0x75, 0x4b, 0x01, 0x90, 0x7f, 0xcd, - 0xe0, 0xf5, 0x7d, 0xd2, 0x06, 0x20, 0x22, 0x33, 0x20, 0x00, 0x06, 0xe5, 0x4b, 0x65, 0x7d, 0x70, - 0x2a, 0x30, 0x06, 0x1a, 0x30, 0x04, 0x09, 0xe4, 0x90, 0x7f, 0xcb, 0xf0, 0xc2, 0x04, 0x80, 0x07, - 0xe4, 0x90, 0x7f, 0xcd, 0xf0, 0xd2, 0x04, 0xc2, 0x06, 0xe4, 0xf5, 0x7d, 0xf5, 0x4b, 0x30}}, - {0x0f86, 64, { 0x16, 0x0a, 0xc2, 0x16, 0xc2, 0x00, 0x90, 0x7f, 0xc1, 0x74, 0x01, 0xf0, 0x30, 0x22, 0x03, 0x02, 0x10, - 0x9c, 0x20, 0x06, 0x03, 0x02, 0x10, 0x9c, 0x30, 0x1e, 0x0a, 0x90, 0x7f, 0x9a, 0xe0, 0x20, 0xe5, - 0x03, 0x02, 0x10, 0x9c, 0x30, 0x0d, 0x03, 0x02, 0x10, 0x9c, 0x30, 0x14, 0x03, 0x02, 0x10, 0x9c, - 0x30, 0x04, 0x62, 0x30, 0x1d, 0x12, 0xaf, 0x4b, 0x05, 0x4b, 0x74, 0x40, 0x2f, 0xf5, 0x82}}, - {0x0fc6, 64, { 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x2d, 0xaf, 0x4b, 0x05, 0x4b, 0x74, 0x40, 0x2f, 0xf5, - 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, 0x13, 0xe5, 0x4b, 0xc3, 0x95, 0x7d, 0x50, 0x2a, - 0x30, 0x1d, 0x12, 0xaf, 0x4b, 0x05, 0x4b, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, - 0x83, 0xe0, 0x13, 0x92, 0x18, 0xaf, 0x4b, 0x05, 0x4b, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4}}, - {0x1006, 64, { 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, 0x47, 0xd2, 0x12, 0x80, 0x6b, 0xc2, 0x12, 0xe4, 0x90, 0x7f, 0xcb, - 0xf0, 0xc2, 0x04, 0x80, 0x60, 0x30, 0x1d, 0x12, 0xaf, 0x4b, 0x05, 0x4b, 0x74, 0xc0, 0x2f, 0xf5, - 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x2d, 0xaf, 0x4b, 0x05, 0x4b, 0x74, 0xc0, - 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xf5, 0x13, 0xe5, 0x4b, 0xc3, 0x95}}, - {0x1046, 64, { 0x7d, 0x50, 0x2a, 0x30, 0x1d, 0x12, 0xaf, 0x4b, 0x05, 0x4b, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, - 0x7c, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x18, 0xaf, 0x4b, 0x05, 0x4b, 0x74, 0xc0, 0x2f, 0xf5, 0x82, - 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xf5, 0x47, 0xd2, 0x12, 0x80, 0x09, 0xc2, 0x12, 0xe4, 0x90, - 0x7f, 0xcd, 0xf0, 0xd2, 0x04, 0x30, 0x1d, 0x04, 0xa2, 0x2d, 0x92, 0xc3, 0xd2, 0x22, 0xc2}}, - {0x1086, 64, { 0xaf, 0x85, 0x13, 0xc1, 0x20, 0x12, 0x0d, 0x30, 0x16, 0x0a, 0xc2, 0x16, 0xc2, 0x00, 0x90, 0x7f, 0xc1, - 0x74, 0x01, 0xf0, 0xd2, 0xaf, 0x90, 0x7f, 0xc2, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x11, 0x72, 0xe5, - 0x1a, 0x70, 0x46, 0x30, 0x0c, 0x3f, 0xe5, 0x40, 0x70, 0x3b, 0xa2, 0x09, 0x33, 0xf5, 0x31, 0xc2, - 0x09, 0xc2, 0x0c, 0xe4, 0xf5, 0x12, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x26, 0x25, 0x12, 0xf9}}, - {0x10c6, 64, { 0xee, 0x34, 0x00, 0xfa, 0x12, 0x15, 0x87, 0xff, 0x74, 0x80, 0x25, 0x12, 0xf5, 0x82, 0xe4, 0x34, 0x7b, - 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x12, 0xe5, 0x12, 0xb4, 0x0c, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x0c, - 0xf0, 0x75, 0x40, 0x10, 0x22, 0x75, 0x1a, 0x01, 0x22, 0xe5, 0x1a, 0x64, 0x01, 0x70, 0x45, 0x30, - 0x0e, 0x3e, 0xe5, 0x41, 0x70, 0x3a, 0xa2, 0x0a, 0x33, 0xf5, 0x3d, 0xc2, 0x0a, 0xc2, 0x0e}}, - {0x1106, 64, { 0xe4, 0xf5, 0x12, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x32, 0x25, 0x12, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, - 0x15, 0x87, 0xff, 0x74, 0x80, 0x25, 0x12, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, - 0x05, 0x12, 0xe5, 0x12, 0xb4, 0x0c, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x0c, 0xf0, 0x75, 0x41, 0x10, - 0x75, 0x1a, 0x02, 0x22, 0xe5, 0x1c, 0x60, 0x30, 0x15, 0x1c, 0xe4, 0xf5, 0x12, 0x7e, 0x00}}, - {0x1146, 64, { 0x7b, 0x00, 0x74, 0x1b, 0x25, 0x12, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x15, 0x87, 0xff, 0x74, 0x80, - 0x25, 0x12, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x12, 0xe5, 0x12, 0xb4, - 0x03, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, 0xf5, 0x1a, 0x22, 0x90, 0x7f, 0xe9, 0xe0, - 0x12, 0x16, 0x17, 0x12, 0x38, 0x00, 0x12, 0xac, 0x01, 0x13, 0x18, 0x03, 0x11, 0x96, 0x06}}, - {0x1186, 64, { 0x12, 0x2b, 0x08, 0x12, 0x25, 0x09, 0x12, 0x18, 0x0a, 0x13, 0x6e, 0x0b, 0x00, 0x00, 0x13, 0x67, 0x90, - 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x16, 0x14, 0x60, 0x40, 0x24, 0x02, 0x70, 0x69, 0x74, 0x19, - 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x00, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x13, 0x6e, 0x90, 0x7f, 0xea, - 0xe0, 0xff, 0x12, 0x17, 0x4b, 0x8b, 0x12, 0x8a, 0x13, 0x89, 0x14, 0xea, 0x49, 0x60, 0x11}}, - {0x11c6, 64, { 0xae, 0x02, 0xee, 0x90, 0x7f, 0xd4, 0xf0, 0xaf, 0x01, 0xef, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x13, 0x6e, - 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x13, 0x6e, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, - 0x17, 0x9a, 0x8b, 0x12, 0x8a, 0x13, 0x89, 0x14, 0xea, 0x49, 0x60, 0x11, 0xae, 0x02, 0xee, 0x90, - 0x7f, 0xd4, 0xf0, 0xaf, 0x01, 0xef, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x13, 0x6e, 0x90, 0x7f}}, - {0x1206, 64, { 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x13, 0x6e, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x13, - 0x6e, 0x90, 0x7f, 0x00, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xb5, 0xf0, 0x02, 0x13, 0x6e, 0x12, 0x14, - 0xbb, 0x02, 0x13, 0x6e, 0x90, 0x7f, 0x00, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xb5, 0xf0, 0x02, 0x13, - 0x6e, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60, 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70}}, - {0x1246, 64, { 0x5b, 0xa2, 0x26, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, 0xa2, 0x2b, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, - 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x13, 0x6e, 0xe4, 0x90, 0x7f, - 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x13, 0x6e, 0x90, 0x7f, 0xec, - 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0}}, - {0x1286, 64, { 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, - 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x13, 0x6e, 0x90, 0x7f, 0xb4, 0xe0, 0x44, - 0x01, 0xf0, 0x02, 0x13, 0x6e, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24, 0x02, 0x60, - 0x03, 0x02, 0x13, 0x6e, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x05, 0xc2, 0x26, 0x02, 0x13}}, - {0x12c6, 64, { 0x6e, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x13, 0x6e, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x38, - 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, - 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f, 0xec, - 0xe0, 0x54, 0x80, 0xff, 0x13, 0x13, 0x13, 0x54, 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90}}, - {0x1306, 64, { 0x7f, 0xd7, 0xf0, 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x5f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, - 0x56, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x18, 0x24, 0x02, 0x70, 0x4a, 0x90, 0x7f, 0xea, - 0xe0, 0xb4, 0x01, 0x04, 0xd2, 0x26, 0x80, 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, - 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff}}, - {0x1346, 64, { 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, - 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, - 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0, 0x22, 0x20, - 0x28, 0x03, 0x02, 0x14, 0xba, 0xe5, 0x40, 0x60, 0x02, 0x15, 0x40, 0xe5, 0x48, 0x60, 0x4f}}, - {0x1386, 64, { 0x65, 0x44, 0x70, 0x45, 0xe5, 0x42, 0xf4, 0x60, 0x02, 0x05, 0x42, 0xe5, 0x42, 0xc3, 0x95, 0x55, 0x40, - 0x3d, 0xc2, 0xaf, 0x30, 0x01, 0x18, 0x90, 0x7f, 0xb8, 0xe0, 0x20, 0xe1, 0x27, 0x90, 0x7f, 0xb7, - 0xe5, 0x48, 0xf0, 0xc2, 0x01, 0xe4, 0xf5, 0x48, 0xf5, 0x42, 0xf5, 0x44, 0x80, 0x16, 0x90, 0x7f, - 0xb6, 0xe0, 0x20, 0xe1, 0x0f, 0x90, 0x7f, 0xb9, 0xe5, 0x48, 0xf0, 0xd2, 0x01, 0xe4, 0xf5}}, - {0x13c6, 64, { 0x48, 0xf5, 0x42, 0xf5, 0x44, 0xd2, 0xaf, 0x80, 0x06, 0x85, 0x48, 0x44, 0xe4, 0xf5, 0x42, 0xe5, 0x2e, - 0x60, 0x2d, 0x20, 0x19, 0x07, 0x90, 0x7f, 0x9b, 0xe0, 0x30, 0xe0, 0x0e, 0xe5, 0x2f, 0x60, 0x05, - 0xe4, 0xf5, 0x2f, 0xd2, 0x0c, 0xe4, 0xf5, 0x3e, 0x80, 0x13, 0xe5, 0x3e, 0xd3, 0x95, 0x56, 0x50, - 0x0c, 0xe5, 0x3e, 0xb5, 0x56, 0x05, 0x75, 0x2f, 0x01, 0xd2, 0x0c, 0x05, 0x3e, 0xc2, 0x19}}, - {0x1406, 64, { 0xe5, 0x41, 0x60, 0x02, 0x15, 0x41, 0xe5, 0x49, 0x60, 0x4f, 0x65, 0x45, 0x70, 0x45, 0xe5, 0x43, 0xf4, - 0x60, 0x02, 0x05, 0x43, 0xe5, 0x43, 0xc3, 0x95, 0x6d, 0x40, 0x3d, 0xc2, 0xaf, 0x30, 0x02, 0x18, - 0x90, 0x7f, 0xbc, 0xe0, 0x20, 0xe1, 0x27, 0x90, 0x7f, 0xbb, 0xe5, 0x49, 0xf0, 0xc2, 0x02, 0xe4, - 0xf5, 0x49, 0xf5, 0x43, 0xf5, 0x45, 0x80, 0x16, 0x90, 0x7f, 0xba, 0xe0, 0x20, 0xe1, 0x0f}}, - {0x1446, 64, { 0x90, 0x7f, 0xbd, 0xe5, 0x49, 0xf0, 0xd2, 0x02, 0xe4, 0xf5, 0x49, 0xf5, 0x43, 0xf5, 0x45, 0xd2, 0xaf, - 0x80, 0x06, 0x85, 0x49, 0x45, 0xe4, 0xf5, 0x43, 0xe5, 0x3a, 0x60, 0x2d, 0x20, 0x1a, 0x07, 0x90, - 0x7f, 0x9a, 0xe0, 0x30, 0xe2, 0x0e, 0xe5, 0x3b, 0x60, 0x05, 0xe4, 0xf5, 0x3b, 0xd2, 0x0e, 0xe4, - 0xf5, 0x3f, 0x80, 0x13, 0xe5, 0x3f, 0xd3, 0x95, 0x6e, 0x50, 0x0c, 0xe5, 0x3f, 0xb5, 0x6e}}, - {0x1486, 64, { 0x05, 0x75, 0x3b, 0x01, 0xd2, 0x0e, 0x05, 0x3f, 0xc2, 0x1a, 0x90, 0x7f, 0xd2, 0xe0, 0x20, 0xe1, 0x23, - 0x90, 0x7b, 0x40, 0xe0, 0x60, 0x09, 0xe0, 0xf5, 0x1c, 0x90, 0x7b, 0x42, 0xe0, 0xf5, 0x1d, 0x90, - 0x7b, 0x41, 0xe0, 0x60, 0x09, 0x90, 0x7f, 0xd7, 0x74, 0x17, 0xf0, 0x74, 0x37, 0xf0, 0xe4, 0x90, - 0x7f, 0xd3, 0xf0, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0}}, - {0x14c6, 64, { 0x90, 0x7f, 0x96, 0xe0, 0x44, 0x10, 0xf0, 0x90, 0x7f, 0x94, 0x74, 0x0d, 0xf0, 0x90, 0x7f, 0x9d, 0x74, - 0x9a, 0xf0, 0x90, 0x7f, 0x97, 0xe0, 0x54, 0xfd, 0xf0, 0x90, 0x7f, 0x95, 0x74, 0x23, 0xf0, 0x90, - 0x7f, 0x9e, 0x74, 0x84, 0xf0, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0x90, 0x7f, 0xc9, 0xf0, 0x90, 0x7f, - 0xcf, 0xf0, 0x75, 0x98, 0x40, 0x43, 0xa8, 0x10, 0xc2, 0x1b, 0xc2, 0x05, 0xc2, 0x21, 0xc2}}, - {0x1506, 64, { 0x0b, 0xc2, 0x13, 0xf5, 0x7c, 0xf5, 0x4a, 0xc2, 0x11, 0xc2, 0x15, 0xf5, 0x42, 0xc2, 0x19, 0xf5, 0x44, - 0xf5, 0x48, 0xc2, 0x23, 0xc2, 0x1c, 0xf5, 0x2d, 0xf5, 0x2f, 0xc2, 0x07, 0xc2, 0x00, 0xc2, 0x1f, - 0xf5, 0x3e, 0xc2, 0x09, 0xd2, 0x01, 0xd2, 0x03, 0xd2, 0x0c, 0xf5, 0x26, 0x90, 0x7f, 0xcb, 0xf0, - 0x90, 0x7f, 0xcd, 0xf0, 0x90, 0x7f, 0xd1, 0xf0, 0x75, 0xc0, 0x40, 0x43, 0xa8, 0x40, 0xc2}}, - {0x1546, 64, { 0x1d, 0xc2, 0x06, 0xc2, 0x22, 0xc2, 0x0d, 0xc2, 0x14, 0xf5, 0x7d, 0xf5, 0x4b, 0xc2, 0x12, 0xc2, 0x16, - 0xf5, 0x43, 0xc2, 0x1a, 0xf5, 0x45, 0xf5, 0x49, 0xc2, 0x24, 0xc2, 0x1e, 0xf5, 0x39, 0xf5, 0x3b, - 0xc2, 0x08, 0xc2, 0x00, 0xc2, 0x20, 0xf5, 0x3f, 0xc2, 0x0a, 0xd2, 0x02, 0xd2, 0x04, 0xd2, 0x0e, + 0x74, 0x35, 0xf0, 0xd2, 0x03, 0xd2, 0x01, 0xd2, 0x09, 0xe4, 0x90, 0x7f, 0xcf, 0xf0, 0xa2, 0x13, + 0xe4, 0x33, 0xff, 0x65, 0x2b, 0x60, 0x04, 0x8f, 0x2b, 0xd2, 0x0c, 0xa2, 0x0b, 0xe4, 0x33, 0xff, + 0x65, 0x2c, 0x60, 0x04, 0x8f, 0x2c, 0xd2, 0x0c, 0x90, 0x7f, 0x9b, 0xe0, 0x54, 0x08, 0x65}}, + {0x0bc6, 64, { 0x27, 0x60, 0x07, 0xe0, 0x54, 0x08, 0xf5, 0x27, 0xd2, 0x0c, 0x90, 0x7f, 0x9b, 0xe0, 0x54, 0x40, 0xb5, + 0x29, 0x09, 0xe0, 0x54, 0x40, 0x64, 0x40, 0xf5, 0x29, 0xd2, 0x0c, 0x30, 0x07, 0x35, 0xc2, 0xaf, + 0x30, 0x01, 0x18, 0x90, 0x7f, 0xb8, 0xe0, 0x20, 0xe1, 0x27, 0xe5, 0x48, 0x60, 0x09, 0x90, 0x7f, + 0xb7, 0xf0, 0xe4, 0xf5, 0x48, 0xc2, 0x01, 0xc2, 0x07, 0x80, 0x16, 0x90, 0x7f, 0xb6, 0xe0}}, + {0x0c06, 64, { 0x20, 0xe1, 0x0f, 0xe5, 0x48, 0x60, 0x09, 0x90, 0x7f, 0xb9, 0xf0, 0xe4, 0xf5, 0x48, 0xd2, 0x01, 0xc2, + 0x07, 0xd2, 0xaf, 0x20, 0x05, 0x37, 0x30, 0x03, 0x1b, 0x90, 0x7f, 0xc6, 0xe0, 0x20, 0xe1, 0x2d, + 0x90, 0x7e, 0x40, 0xe0, 0x13, 0x92, 0x15, 0x75, 0x4a, 0x01, 0x90, 0x7f, 0xc7, 0xe0, 0xf5, 0x7c, + 0xd2, 0x05, 0x80, 0x19, 0x90, 0x7f, 0xc8, 0xe0, 0x20, 0xe1, 0x12, 0x90, 0x7d, 0xc0, 0xe0}}, + {0x0c46, 64, { 0x13, 0x92, 0x15, 0x75, 0x4a, 0x01, 0x90, 0x7f, 0xc9, 0xe0, 0xf5, 0x7c, 0xd2, 0x05, 0x20, 0x21, 0x33, + 0x20, 0x00, 0x06, 0xe5, 0x4a, 0x65, 0x7c, 0x70, 0x2a, 0x30, 0x05, 0x1a, 0x30, 0x03, 0x09, 0xe4, + 0x90, 0x7f, 0xc7, 0xf0, 0xc2, 0x03, 0x80, 0x07, 0xe4, 0x90, 0x7f, 0xc9, 0xf0, 0xd2, 0x03, 0xc2, + 0x05, 0xe4, 0xf5, 0x7c, 0xf5, 0x4a, 0x30, 0x15, 0x0a, 0xc2, 0x15, 0xc2, 0x00, 0x90, 0x7f}}, + {0x0c86, 64, { 0xbf, 0x74, 0x01, 0xf0, 0x30, 0x21, 0x03, 0x02, 0x0d, 0x94, 0x20, 0x05, 0x03, 0x02, 0x0d, 0x94, 0x30, + 0x1c, 0x0a, 0x90, 0x7f, 0x9b, 0xe0, 0x20, 0xe3, 0x03, 0x02, 0x0d, 0x94, 0x30, 0x0b, 0x03, 0x02, + 0x0d, 0x94, 0x30, 0x13, 0x03, 0x02, 0x0d, 0x94, 0x30, 0x03, 0x62, 0x30, 0x1b, 0x12, 0xaf, 0x4a, + 0x05, 0x4a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0x13, 0x92}}, + {0x0cc6, 64, { 0x2d, 0xaf, 0x4a, 0x05, 0x4a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0xf5, + 0x13, 0xe5, 0x4a, 0xc3, 0x95, 0x7c, 0x50, 0x2a, 0x30, 0x1b, 0x12, 0xaf, 0x4a, 0x05, 0x4a, 0x74, + 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x17, 0xaf, 0x4a, 0x05, + 0x4a, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7e, 0xf5, 0x83, 0xe0, 0xf5, 0x46, 0xd2}}, + {0x0d06, 64, { 0x11, 0x80, 0x6b, 0xc2, 0x11, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0xc2, 0x03, 0x80, 0x60, 0x30, 0x1b, 0x12, + 0xaf, 0x4a, 0x05, 0x4a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, + 0x92, 0x2d, 0xaf, 0x4a, 0x05, 0x4a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, + 0xe0, 0xf5, 0x13, 0xe5, 0x4a, 0xc3, 0x95, 0x7c, 0x50, 0x2a, 0x30, 0x1b, 0x12, 0xaf, 0x4a}}, + {0x0d46, 64, { 0x05, 0x4a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x17, 0xaf, + 0x4a, 0x05, 0x4a, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, 0x46, + 0xd2, 0x11, 0x80, 0x09, 0xc2, 0x11, 0xe4, 0x90, 0x7f, 0xc9, 0xf0, 0xd2, 0x03, 0x30, 0x1b, 0x04, + 0xa2, 0x2d, 0x92, 0x9b, 0xd2, 0x21, 0xc2, 0xaf, 0x85, 0x13, 0x99, 0x20, 0x11, 0x0d, 0x30}}, + {0x0d86, 64, { 0x15, 0x0a, 0xc2, 0x15, 0xc2, 0x00, 0x90, 0x7f, 0xbf, 0x74, 0x01, 0xf0, 0xd2, 0xaf, 0x90, 0x7f, 0xd0, + 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x0e, 0xb5, 0xe4, 0xf5, 0x12, 0x74, 0xc0, 0x25, 0x12, 0xf5, 0x82, + 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x12, 0x7c, 0x00, 0x7b, 0x00, 0x24, 0x64, 0xf9, + 0xec, 0x34, 0x00, 0xfa, 0xef, 0x12, 0x15, 0xcd, 0x05, 0x12, 0xe5, 0x12, 0xb4, 0x18, 0xdb}}, + {0x0dc6, 64, { 0xe5, 0x64, 0x60, 0x0b, 0x75, 0x89, 0x60, 0x75, 0x88, 0x40, 0xd2, 0xdf, 0x85, 0x65, 0x8d, 0xe5, 0x67, + 0x13, 0x92, 0x1d, 0x92, 0xc7, 0xe5, 0x68, 0x13, 0x92, 0x1e, 0xe5, 0x69, 0x13, 0x92, 0x24, 0xe5, + 0x6a, 0x60, 0x09, 0x90, 0x7f, 0x97, 0xe0, 0x54, 0xef, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0x97, 0xe0, + 0x44, 0x10, 0xf0, 0xe5, 0x6b, 0x60, 0x09, 0x90, 0x7f, 0x97, 0xe0, 0x54, 0x7f, 0xf0, 0x80}}, + {0x0e06, 64, { 0x07, 0x90, 0x7f, 0x97, 0xe0, 0x44, 0x80, 0xf0, 0xe5, 0x71, 0x60, 0x0b, 0xc2, 0x14, 0xc2, 0x0d, 0x90, + 0x7f, 0x94, 0xe0, 0x44, 0x08, 0xf0, 0xe5, 0x72, 0x60, 0x0b, 0xd2, 0x0d, 0xd2, 0x0e, 0x90, 0x7f, + 0x94, 0xe0, 0x44, 0x08, 0xf0, 0xe5, 0x73, 0x60, 0x0d, 0xc2, 0xaf, 0xc2, 0x12, 0xd2, 0x00, 0xe4, + 0xf5, 0x7d, 0xf5, 0x4b, 0xd2, 0xaf, 0xe5, 0x74, 0x60, 0x05, 0x30, 0x24, 0x02, 0xd2, 0x0d}}, + {0x0e46, 64, { 0xe5, 0x75, 0x60, 0x15, 0x90, 0x7f, 0x94, 0xe0, 0x54, 0xf7, 0xf0, 0x90, 0x7f, 0x9d, 0xe0, 0x44, 0x08, + 0xf0, 0x90, 0x7f, 0x97, 0xe0, 0x54, 0xf7, 0xf0, 0xe5, 0x76, 0x60, 0x0a, 0xd2, 0xc4, 0xc2, 0xc0, + 0x75, 0x3a, 0x01, 0x75, 0x41, 0x28, 0xe5, 0x77, 0x60, 0x07, 0xc2, 0xc4, 0xe4, 0xf5, 0x49, 0xf5, + 0x3a, 0xe5, 0x78, 0x60, 0x03, 0xe4, 0xf5, 0x49, 0xe5, 0x79, 0x60, 0x02, 0xd2, 0x08, 0xe5}}, + {0x0e86, 64, { 0x7a, 0x60, 0x08, 0xe5, 0x76, 0x70, 0x02, 0xf5, 0x41, 0xd2, 0x0e, 0xe5, 0x7b, 0x60, 0x19, 0x90, 0x7f, + 0xd7, 0x74, 0x13, 0xf0, 0x74, 0x33, 0xf0, 0x74, 0x14, 0xf0, 0x74, 0x34, 0xf0, 0x74, 0x16, 0xf0, + 0x74, 0x36, 0xf0, 0xd2, 0x04, 0xd2, 0x02, 0xd2, 0x0a, 0xe4, 0x90, 0x7f, 0xd1, 0xf0, 0xa2, 0x14, + 0xe4, 0x33, 0xff, 0x65, 0x37, 0x60, 0x04, 0x8f, 0x37, 0xd2, 0x0e, 0xa2, 0x0d, 0xe4, 0x33}}, + {0x0ec6, 64, { 0xff, 0x65, 0x38, 0x60, 0x04, 0x8f, 0x38, 0xd2, 0x0e, 0x90, 0x7f, 0x9a, 0xe0, 0x54, 0x20, 0x65, 0x33, + 0x60, 0x07, 0xe0, 0x54, 0x20, 0xf5, 0x33, 0xd2, 0x0e, 0x90, 0x7f, 0x9a, 0xe0, 0x54, 0x40, 0xb5, + 0x35, 0x09, 0xe0, 0x54, 0x40, 0x64, 0x40, 0xf5, 0x35, 0xd2, 0x0e, 0x30, 0x08, 0x35, 0xc2, 0xaf, + 0x30, 0x02, 0x18, 0x90, 0x7f, 0xbc, 0xe0, 0x20, 0xe1, 0x27, 0xe5, 0x49, 0x60, 0x09, 0x90}}, + {0x0f06, 64, { 0x7f, 0xbb, 0xf0, 0xe4, 0xf5, 0x49, 0xc2, 0x02, 0xc2, 0x08, 0x80, 0x16, 0x90, 0x7f, 0xba, 0xe0, 0x20, + 0xe1, 0x0f, 0xe5, 0x49, 0x60, 0x09, 0x90, 0x7f, 0xbd, 0xf0, 0xe4, 0xf5, 0x49, 0xd2, 0x02, 0xc2, + 0x08, 0xd2, 0xaf, 0x20, 0x06, 0x37, 0x30, 0x04, 0x1b, 0x90, 0x7f, 0xca, 0xe0, 0x20, 0xe1, 0x2d, + 0x90, 0x7d, 0x40, 0xe0, 0x13, 0x92, 0x16, 0x75, 0x4b, 0x01, 0x90, 0x7f, 0xcb, 0xe0, 0xf5}}, + {0x0f46, 64, { 0x7d, 0xd2, 0x06, 0x80, 0x19, 0x90, 0x7f, 0xcc, 0xe0, 0x20, 0xe1, 0x12, 0x90, 0x7c, 0xc0, 0xe0, 0x13, + 0x92, 0x16, 0x75, 0x4b, 0x01, 0x90, 0x7f, 0xcd, 0xe0, 0xf5, 0x7d, 0xd2, 0x06, 0x20, 0x22, 0x33, + 0x20, 0x00, 0x06, 0xe5, 0x4b, 0x65, 0x7d, 0x70, 0x2a, 0x30, 0x06, 0x1a, 0x30, 0x04, 0x09, 0xe4, + 0x90, 0x7f, 0xcb, 0xf0, 0xc2, 0x04, 0x80, 0x07, 0xe4, 0x90, 0x7f, 0xcd, 0xf0, 0xd2, 0x04}}, + {0x0f86, 64, { 0xc2, 0x06, 0xe4, 0xf5, 0x7d, 0xf5, 0x4b, 0x30, 0x16, 0x0a, 0xc2, 0x16, 0xc2, 0x00, 0x90, 0x7f, 0xc1, + 0x74, 0x01, 0xf0, 0x30, 0x22, 0x03, 0x02, 0x10, 0xa4, 0x20, 0x06, 0x03, 0x02, 0x10, 0xa4, 0x30, + 0x1e, 0x0a, 0x90, 0x7f, 0x9a, 0xe0, 0x20, 0xe5, 0x03, 0x02, 0x10, 0xa4, 0x30, 0x0d, 0x03, 0x02, + 0x10, 0xa4, 0x30, 0x14, 0x03, 0x02, 0x10, 0xa4, 0x30, 0x04, 0x62, 0x30, 0x1d, 0x12, 0xaf}}, + {0x0fc6, 64, { 0x4b, 0x05, 0x4b, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x2d, + 0xaf, 0x4b, 0x05, 0x4b, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, + 0x13, 0xe5, 0x4b, 0xc3, 0x95, 0x7d, 0x50, 0x2a, 0x30, 0x1d, 0x12, 0xaf, 0x4b, 0x05, 0x4b, 0x74, + 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x18, 0xaf, 0x4b}}, + {0x1006, 64, { 0x05, 0x4b, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7d, 0xf5, 0x83, 0xe0, 0xf5, 0x47, 0xd2, 0x12, + 0x80, 0x6b, 0xc2, 0x12, 0xe4, 0x90, 0x7f, 0xcb, 0xf0, 0xc2, 0x04, 0x80, 0x60, 0x30, 0x1d, 0x12, + 0xaf, 0x4b, 0x05, 0x4b, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0x13, + 0x92, 0x2d, 0xaf, 0x4b, 0x05, 0x4b, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7c, 0xf5}}, + {0x1046, 64, { 0x83, 0xe0, 0xf5, 0x13, 0xe5, 0x4b, 0xc3, 0x95, 0x7d, 0x50, 0x2a, 0x30, 0x1d, 0x12, 0xaf, 0x4b, 0x05, + 0x4b, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0x13, 0x92, 0x18, 0xaf, + 0x4b, 0x05, 0x4b, 0x74, 0xc0, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xf5, 0x47, + 0xd2, 0x12, 0x80, 0x09, 0xc2, 0x12, 0xe4, 0x90, 0x7f, 0xcd, 0xf0, 0xd2, 0x04, 0x30, 0x1d}}, + {0x1086, 64, { 0x04, 0xa2, 0x2d, 0x92, 0xc3, 0xd2, 0x22, 0xc2, 0xaf, 0x85, 0x13, 0xc1, 0x20, 0x12, 0x0d, 0x30, 0x16, + 0x0a, 0xc2, 0x16, 0xc2, 0x00, 0x90, 0x7f, 0xc1, 0x74, 0x01, 0xf0, 0xd2, 0xaf, 0x90, 0x7f, 0xc2, + 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x11, 0x7a, 0xe5, 0x1a, 0x70, 0x46, 0x30, 0x0c, 0x3f, 0xe5, 0x40, + 0x70, 0x3b, 0xa2, 0x09, 0x33, 0xf5, 0x31, 0xc2, 0x09, 0xc2, 0x0c, 0xe4, 0xf5, 0x12, 0x7e}}, + {0x10c6, 64, { 0x00, 0x7b, 0x00, 0x74, 0x26, 0x25, 0x12, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x15, 0x87, 0xff, 0x74, + 0x80, 0x25, 0x12, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x12, 0xe5, 0x12, + 0xb4, 0x0c, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x0c, 0xf0, 0x75, 0x40, 0x10, 0x22, 0x75, 0x1a, 0x01, + 0x22, 0xe5, 0x1a, 0x64, 0x01, 0x70, 0x45, 0x30, 0x0e, 0x3e, 0xe5, 0x41, 0x70, 0x3a, 0xa2}}, + {0x1106, 64, { 0x0a, 0x33, 0xf5, 0x3d, 0xc2, 0x0a, 0xc2, 0x0e, 0xe4, 0xf5, 0x12, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x32, + 0x25, 0x12, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x15, 0x87, 0xff, 0x74, 0x80, 0x25, 0x12, 0xf5, + 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x12, 0xe5, 0x12, 0xb4, 0x0c, 0xdb, 0x90, + 0x7f, 0xc3, 0x74, 0x0c, 0xf0, 0x75, 0x41, 0x10, 0x75, 0x1a, 0x02, 0x22, 0xe5, 0x1c, 0x60}}, + {0x1146, 64, { 0x30, 0x15, 0x1c, 0xe4, 0xf5, 0x12, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x1b, 0x25, 0x12, 0xf9, 0xee, 0x34, + 0x00, 0xfa, 0x12, 0x15, 0x87, 0xff, 0x74, 0x80, 0x25, 0x12, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, + 0x83, 0xef, 0xf0, 0x05, 0x12, 0xe5, 0x12, 0xb4, 0x03, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, + 0xe4, 0xf5, 0x1a, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x16, 0x17, 0x12, 0x40, 0x00, 0x12}}, + {0x1186, 64, { 0xb4, 0x01, 0x13, 0x20, 0x03, 0x11, 0x9e, 0x06, 0x12, 0x33, 0x08, 0x12, 0x2d, 0x09, 0x12, 0x20, 0x0a, + 0x13, 0x76, 0x0b, 0x00, 0x00, 0x13, 0x6f, 0x90, 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x16, 0x14, + 0x60, 0x40, 0x24, 0x02, 0x70, 0x69, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x00, 0x90, 0x7f, + 0xd5, 0xf0, 0x02, 0x13, 0x76, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x17, 0x4b, 0x8b, 0x12}}, + {0x11c6, 64, { 0x8a, 0x13, 0x89, 0x14, 0xea, 0x49, 0x60, 0x11, 0xae, 0x02, 0xee, 0x90, 0x7f, 0xd4, 0xf0, 0xaf, 0x01, + 0xef, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x13, 0x76, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, + 0x13, 0x76, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x17, 0x9a, 0x8b, 0x12, 0x8a, 0x13, 0x89, 0x14, + 0xea, 0x49, 0x60, 0x11, 0xae, 0x02, 0xee, 0x90, 0x7f, 0xd4, 0xf0, 0xaf, 0x01, 0xef, 0x90}}, + {0x1206, 64, { 0x7f, 0xd5, 0xf0, 0x02, 0x13, 0x76, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x13, 0x76, 0x90, + 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x13, 0x76, 0x90, 0x7f, 0x00, 0x74, 0x01, 0xf0, 0x90, + 0x7f, 0xb5, 0xf0, 0x02, 0x13, 0x76, 0x12, 0x14, 0xc3, 0x02, 0x13, 0x76, 0x90, 0x7f, 0x00, 0x74, + 0x01, 0xf0, 0x90, 0x7f, 0xb5, 0xf0, 0x02, 0x13, 0x76, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f}}, + {0x1246, 64, { 0x60, 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, 0xa2, 0x26, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, + 0xa2, 0x2b, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, + 0x02, 0xf0, 0x02, 0x13, 0x76, 0xe4, 0x90, 0x7f, 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, + 0x02, 0xf0, 0x02, 0x13, 0x76, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54}}, + {0x1286, 64, { 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, + 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, + 0x02, 0x13, 0x76, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x13, 0x76, 0x90, 0x7f, 0xe8, + 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24, 0x02, 0x60, 0x03, 0x02, 0x13, 0x76, 0x90, 0x7f, 0xea}}, + {0x12c6, 64, { 0xe0, 0xb4, 0x01, 0x05, 0xc2, 0x26, 0x02, 0x13, 0x76, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, + 0x13, 0x76, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x38, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, + 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, + 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f, 0xec, 0xe0, 0x54, 0x80, 0xff, 0x13, 0x13, 0x13}}, + {0x1306, 64, { 0x54, 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f, 0xd7, 0xf0, 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x5f, + 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x56, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, + 0x18, 0x24, 0x02, 0x70, 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x04, 0xd2, 0x26, 0x80, 0x3f, + 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20}}, + {0x1346, 64, { 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, + 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, + 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90, + 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0, 0x22, 0x20, 0x28, 0x03, 0x02, 0x14, 0xc2, 0xe5, 0x40}}, + {0x1386, 64, { 0x60, 0x02, 0x15, 0x40, 0xe5, 0x48, 0x60, 0x4f, 0x65, 0x44, 0x70, 0x45, 0xe5, 0x42, 0xf4, 0x60, 0x02, + 0x05, 0x42, 0xe5, 0x42, 0xc3, 0x95, 0x55, 0x40, 0x3d, 0xc2, 0xaf, 0x30, 0x01, 0x18, 0x90, 0x7f, + 0xb8, 0xe0, 0x20, 0xe1, 0x27, 0x90, 0x7f, 0xb7, 0xe5, 0x48, 0xf0, 0xc2, 0x01, 0xe4, 0xf5, 0x48, + 0xf5, 0x42, 0xf5, 0x44, 0x80, 0x16, 0x90, 0x7f, 0xb6, 0xe0, 0x20, 0xe1, 0x0f, 0x90, 0x7f}}, + {0x13c6, 64, { 0xb9, 0xe5, 0x48, 0xf0, 0xd2, 0x01, 0xe4, 0xf5, 0x48, 0xf5, 0x42, 0xf5, 0x44, 0xd2, 0xaf, 0x80, 0x06, + 0x85, 0x48, 0x44, 0xe4, 0xf5, 0x42, 0xe5, 0x2e, 0x60, 0x2d, 0x20, 0x19, 0x07, 0x90, 0x7f, 0x9b, + 0xe0, 0x30, 0xe0, 0x0e, 0xe5, 0x2f, 0x60, 0x05, 0xe4, 0xf5, 0x2f, 0xd2, 0x0c, 0xe4, 0xf5, 0x3e, + 0x80, 0x13, 0xe5, 0x3e, 0xd3, 0x95, 0x56, 0x50, 0x0c, 0xe5, 0x3e, 0xb5, 0x56, 0x05, 0x75}}, + {0x1406, 64, { 0x2f, 0x01, 0xd2, 0x0c, 0x05, 0x3e, 0xc2, 0x19, 0xe5, 0x41, 0x60, 0x02, 0x15, 0x41, 0xe5, 0x49, 0x60, + 0x4f, 0x65, 0x45, 0x70, 0x45, 0xe5, 0x43, 0xf4, 0x60, 0x02, 0x05, 0x43, 0xe5, 0x43, 0xc3, 0x95, + 0x6d, 0x40, 0x3d, 0xc2, 0xaf, 0x30, 0x02, 0x18, 0x90, 0x7f, 0xbc, 0xe0, 0x20, 0xe1, 0x27, 0x90, + 0x7f, 0xbb, 0xe5, 0x49, 0xf0, 0xc2, 0x02, 0xe4, 0xf5, 0x49, 0xf5, 0x43, 0xf5, 0x45, 0x80}}, + {0x1446, 64, { 0x16, 0x90, 0x7f, 0xba, 0xe0, 0x20, 0xe1, 0x0f, 0x90, 0x7f, 0xbd, 0xe5, 0x49, 0xf0, 0xd2, 0x02, 0xe4, + 0xf5, 0x49, 0xf5, 0x43, 0xf5, 0x45, 0xd2, 0xaf, 0x80, 0x06, 0x85, 0x49, 0x45, 0xe4, 0xf5, 0x43, + 0xe5, 0x3a, 0x60, 0x2d, 0x20, 0x1a, 0x07, 0x90, 0x7f, 0x9a, 0xe0, 0x30, 0xe2, 0x0e, 0xe5, 0x3b, + 0x60, 0x05, 0xe4, 0xf5, 0x3b, 0xd2, 0x0e, 0xe4, 0xf5, 0x3f, 0x80, 0x13, 0xe5, 0x3f, 0xd3}}, + {0x1486, 64, { 0x95, 0x6e, 0x50, 0x0c, 0xe5, 0x3f, 0xb5, 0x6e, 0x05, 0x75, 0x3b, 0x01, 0xd2, 0x0e, 0x05, 0x3f, 0xc2, + 0x1a, 0x90, 0x7f, 0xd2, 0xe0, 0x20, 0xe1, 0x23, 0x90, 0x7b, 0x40, 0xe0, 0x60, 0x09, 0xe0, 0xf5, + 0x1c, 0x90, 0x7b, 0x42, 0xe0, 0xf5, 0x1d, 0x90, 0x7b, 0x41, 0xe0, 0x60, 0x09, 0x90, 0x7f, 0xd7, + 0x74, 0x17, 0xf0, 0x74, 0x37, 0xf0, 0xe4, 0x90, 0x7f, 0xd3, 0xf0, 0x22, 0xe4, 0x90, 0x7f}}, + {0x14c6, 64, { 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0x90, 0x7f, 0x96, 0xe0, 0x44, 0x10, 0xf0, 0x90, 0x7f, + 0x94, 0x74, 0x0d, 0xf0, 0x90, 0x7f, 0x9d, 0x74, 0x9a, 0xf0, 0x90, 0x7f, 0x97, 0xe0, 0x54, 0xfd, + 0xf0, 0x90, 0x7f, 0x95, 0x74, 0x23, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x84, 0xf0, 0xe4, 0x90, 0x7f, + 0xc7, 0xf0, 0x90, 0x7f, 0xc9, 0xf0, 0x90, 0x7f, 0xcf, 0xf0, 0x75, 0x98, 0x40, 0x43, 0xa8}}, + {0x1506, 64, { 0x10, 0xc2, 0x1b, 0xc2, 0x05, 0xc2, 0x21, 0xc2, 0x0b, 0xc2, 0x13, 0xf5, 0x7c, 0xf5, 0x4a, 0xc2, 0x11, + 0xc2, 0x15, 0xf5, 0x42, 0xc2, 0x19, 0xf5, 0x44, 0xf5, 0x48, 0xc2, 0x23, 0xc2, 0x1c, 0xf5, 0x2d, + 0xf5, 0x2f, 0xc2, 0x07, 0xc2, 0x00, 0xc2, 0x1f, 0xf5, 0x3e, 0xc2, 0x09, 0xd2, 0x0c, 0xf5, 0x26, + 0x90, 0x7f, 0xcb, 0xf0, 0x90, 0x7f, 0xcd, 0xf0, 0x90, 0x7f, 0xd1, 0xf0, 0x75, 0xc0, 0x40}}, + {0x1546, 64, { 0x43, 0xa8, 0x40, 0xc2, 0x1d, 0xc2, 0x06, 0xc2, 0x22, 0xc2, 0x0d, 0xc2, 0x14, 0xf5, 0x7d, 0xf5, 0x4b, + 0xc2, 0x12, 0xc2, 0x16, 0xf5, 0x43, 0xc2, 0x1a, 0xf5, 0x45, 0xf5, 0x49, 0xc2, 0x24, 0xc2, 0x1e, + 0xf5, 0x39, 0xf5, 0x3b, 0xc2, 0x08, 0xc2, 0x00, 0xc2, 0x20, 0xf5, 0x3f, 0xc2, 0x0a, 0xd2, 0x0e, 0x75, 0x32, 0x01, 0x90, 0x7f, 0xdf, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xde, 0xf0, 0xd2, 0x28}}, {0x1586, 64, { 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, @@ -384,7 +389,7 @@ 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8, 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x18}}, - {0x1686, 64, { 0xcc, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, + {0x1686, 64, { 0xc5, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0, 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde}}, @@ -393,9 +398,9 @@ 0x7f, 0xde, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaf, 0xe0, 0x44}}, {0x1706, 64, { 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x0d, 0xf0, 0xd2, 0xaf, 0xd2, 0xbc, 0xd2, 0xbe, 0xd2, 0x2d, - 0x12, 0x18, 0x86, 0xc2, 0x27, 0xc2, 0x25, 0xc2, 0x28, 0x30, 0x28, 0x03, 0x12, 0x0a, 0x83, 0x90, - 0x7f, 0xd8, 0xe0, 0x65, 0x10, 0x60, 0x08, 0xe0, 0xf5, 0x10, 0x12, 0x13, 0x76, 0x80, 0xea, 0x30, - 0x27, 0x07, 0xc2, 0x27, 0x12, 0x11, 0x73, 0x80, 0xe0, 0x30, 0x2c, 0xdd, 0xc2, 0x2c, 0x12}}, + 0x12, 0x18, 0x7f, 0xc2, 0x27, 0xc2, 0x25, 0xc2, 0x28, 0x30, 0x28, 0x03, 0x12, 0x0a, 0x83, 0x90, + 0x7f, 0xd8, 0xe0, 0x65, 0x10, 0x60, 0x08, 0xe0, 0xf5, 0x10, 0x12, 0x13, 0x7e, 0x80, 0xea, 0x30, + 0x27, 0x07, 0xc2, 0x27, 0x12, 0x11, 0x7b, 0x80, 0xe0, 0x30, 0x2c, 0xdd, 0xc2, 0x2c, 0x12}}, {0x1746, 64, { 0x00, 0x26, 0x80, 0xd6, 0x22, 0xe4, 0xfe, 0x75, 0x17, 0xff, 0x75, 0x18, 0x19, 0x75, 0x19, 0x12, 0xab, 0x17, 0xaa, 0x18, 0xa9, 0x19, 0x90, 0x00, 0x01, 0x12, 0x15, 0xa0, 0x64, 0x02, 0x70, 0x2d, 0xad, 0x06, 0x0e, 0xed, 0xb5, 0x07, 0x01, 0x22, 0x90, 0x00, 0x02, 0x12, 0x15, 0xdf, 0x85, 0xf0, 0x15, @@ -405,33 +410,33 @@ 0x86, 0xab, 0x17, 0xaa, 0x18, 0xa9, 0x19, 0x90, 0x00, 0x01, 0x12, 0x15, 0xa0, 0xb4, 0x03, 0x1d, 0xaf, 0x16, 0x05, 0x16, 0xef, 0xb5, 0x15, 0x01, 0x22, 0x12, 0x15, 0x87, 0x7e, 0x00, 0x29}}, {0x17c6, 64, { 0xff, 0xee, 0x3a, 0xa9, 0x07, 0x75, 0x17, 0xff, 0xf5, 0x18, 0x89, 0x19, 0x80, 0xd4, 0x7b, 0x00, 0x7a, - 0x00, 0x79, 0x00, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, - 0x75, 0x86, 0x00, 0x30, 0x2a, 0x04, 0xc2, 0x2a, 0x80, 0x02, 0xd2, 0x2c, 0x53, 0x91, 0xef, 0x90, - 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83}}, - {0x1806, 64, { 0xd0, 0xe0, 0x32, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0xf0, 0x90, 0x7f, 0x94, 0xf0, 0x90, - 0x7f, 0x9d, 0x74, 0x02, 0xf0, 0x90, 0x7f, 0x97, 0xf0, 0xe4, 0x90, 0x7f, 0x95, 0xf0, 0x90, 0x7f, - 0x9e, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x98, 0xf0, 0x90, 0x7f, 0x9d, 0xf0, 0x22, 0xc0, 0xe0, - 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90, 0x7f}}, - {0x1846, 64, { 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, - 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, - 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x27, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, - 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32}}, - {0x1886, 64, { 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x2d, 0x04, 0xe0, 0x44, 0x02, - 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x00, 0x06, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0xe0, - 0x44, 0x04, 0xf0, 0x22, 0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, - 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, 0x87, 0x01}}, - {0x18c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xc1, 0xaa, 0x01, 0x1a, 0x00, 0x03, 0x1b, 0x03, 0x00, 0x00, 0xc1, - 0x27, 0xc1, 0x2c, 0xc1, 0x26, 0xc1, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x79, 0x00, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0xf0, 0x90, 0x7f, 0x94, + 0xf0, 0x90, 0x7f, 0x9d, 0x74, 0x02, 0xf0, 0x90, 0x7f, 0x97, 0xf0, 0xe4, 0x90, 0x7f, 0x95, 0xf0, + 0x90, 0x7f, 0x9e, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x98, 0xf0, 0x90, 0x7f, 0x9d, 0xf0}}, + {0x1806, 64, { 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90, + 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, + 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, + 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x27, 0x53, 0x91, 0xef, 0x90}}, + {0x1846, 64, { 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, + 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, + 0xd2, 0x2c, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, + 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0}}, + {0x1886, 64, { 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x2d, 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x00, + 0x06, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0xe0, 0x44, 0x04, 0xf0, 0x22, 0x74, 0x00, 0xf5, + 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f, + 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xc1}}, + {0x18c6, 64, { 0xaa, 0x01, 0x1a, 0x00, 0x03, 0x1b, 0x03, 0x00, 0x00, 0xc1, 0x27, 0xc1, 0x2c, 0xc1, 0x26, 0xc1, 0x2b, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x00, 0x01, 0xff, 0x00}}, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x10, 0x01, 0xff, 0x00}}, {0x1906, 64, { 0x00, 0x40, 0xcd, 0x06, 0x0f, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x01, 0x09, 0x02, 0x74, 0x00, 0x01, 0x01, 0x00, 0xa0, 0x32, 0x09, 0x04, 0x00, 0x00, 0x0e, 0xff, 0x00, 0x00, 0x00, 0x07, 0x05, 0x01, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x02, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x03, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x04, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x05, 0x02, 0x40, 0x00}}, {0x1946, 64, { 0x00, 0x07, 0x05, 0x06, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x07, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, - 0x81, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x83, 0x02, - 0x40, 0x00, 0x00, 0x07, 0x05, 0x84, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x85, 0x02, 0x40, 0x00, - 0x00, 0x07, 0x05, 0x86, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x87, 0x02, 0x40, 0x00, 0x00}}, + 0x81, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x83, 0x02, + 0x40, 0x00, 0x01, 0x07, 0x05, 0x84, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x85, 0x02, 0x40, 0x00, + 0x01, 0x07, 0x05, 0x86, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x87, 0x02, 0x40, 0x00, 0x01}}, {0x1986, 64, { 0x04, 0x03, 0x09, 0x04, 0x48, 0x03, 0x4b, 0x00, 0x65, 0x00, 0x79, 0x00, 0x73, 0x00, 0x70, 0x00, 0x61, 0x00, 0x6e, 0x00, 0x2c, 0x00, 0x20, 0x00, 0x61, 0x00, 0x20, 0x00, 0x64, 0x00, 0x69, 0x00, 0x76, 0x00, 0x69, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00, 0x6f, 0x00, 0x66, @@ -455,7 +460,7 @@ {0x1ac6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x18, 0x5f, 0x00, 0x02, 0x1b}}, - {0x1b06, 9, { 0x04, 0x00, 0x02, 0x18, 0x35, 0x00, 0x02, 0x17, 0xdb}}, -{ 0xffff, 0, {0x00} } + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x18, 0x31, 0x00, 0x02, 0x1b}}, + {0x1b06, 9, { 0x04, 0x00, 0x02, 0x18, 0x07, 0x00, 0x02, 0x18, 0x58}}, + {0xffff, 0, {0x00}} }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa28msg.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa28msg.h --- linux.20pre5/drivers/usb/serial/keyspan_usa28msg.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa28msg.h 2002-09-01 13:39:31.000000000 +0100 @@ -95,7 +95,7 @@ #define __USA28MSG__ -typedef struct keyspan_usa28_portControlMessage +struct keyspan_usa28_portControlMessage { /* there are four types of "commands" sent in the control message: @@ -146,9 +146,9 @@ returnStatus, // return current status n times (1 or 2) resetDataToggle;// reset data toggle state to DATA0 -} keyspan_usa28_portControlMessage; +}; -typedef struct keyspan_usa28_portStatusMessage +struct keyspan_usa28_portStatusMessage { u8 port, // 0=first, 1=second, 2=global (see below) cts, @@ -164,32 +164,32 @@ rxBreak, // 1=we're in break state rs232invalid, // 1=no valid signals on rs-232 inputs controlResponse;// 1=a control messages has been processed -} keyspan_usa28_portStatusMessage; +}; // bit defines in txState #define TX_OFF 0x01 // requested by host txOff command #define TX_XOFF 0x02 // either real, or simulated by host -typedef struct keyspan_usa28_globalControlMessage +struct keyspan_usa28_globalControlMessage { u8 sendGlobalStatus, // 2=request for two status responses resetStatusToggle, // 1=reset global status toggle resetStatusCount; // a cycling value -} keyspan_usa28_globalControlMessage; +}; -typedef struct keyspan_usa28_globalStatusMessage +struct keyspan_usa28_globalStatusMessage { u8 port, // 3 sendGlobalStatus, // from request, decremented resetStatusCount; // as in request -} keyspan_usa28_globalStatusMessage; +}; -typedef struct keyspan_usa28_globalDebugMessage +struct keyspan_usa28_globalDebugMessage { u8 port, // 2 n, // typically a count/status byte b; // typically a data byte -} keyspan_usa28_globalDebugMessage; +}; // ie: the maximum length of an EZUSB endpoint buffer #define MAX_DATA_LEN 64 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa28xa_fw.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa28xa_fw.h --- linux.20pre5/drivers/usb/serial/keyspan_usa28xa_fw.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa28xa_fw.h 2002-09-01 13:39:31.000000000 +0100 @@ -1,351 +1,354 @@ /* keyspan_usa28xa_fw.h - Generated from Keyspan firmware image usa44code.h Sat Oct 6 12:08:02 EST 2001 - This firmware is for the Keyspan USA-28XA Serial Adaptor + The firmware contained herein as keyspan_usa28xa.h is - "The firmware contained herein as keyspan_usa28xa_fw.h is - Copyright (C) 1999-2001 Keyspan, A division of InnoSys Incorporated - ("Keyspan"), as an unpublished work. This notice does not imply - unrestricted or public access to this firmware which is a trade secret of - Keyspan, and which may not be reproduced, used, sold or transferred to any - third party without Keyspan's prior written consent. All Rights Reserved. + Copyright (C) 1999-2001 + Keyspan, A division of InnoSys Incorporated ("Keyspan") + + as an unpublished work. This notice does not imply unrestricted or + public access to the source code from which this firmware image is + derived. Except as noted below this firmware image may not be + reproduced, used, sold or transferred to any third party without + Keyspan's prior written consent. All Rights Reserved. + + Permission is hereby granted for the distribution of this firmware + image as part of a Linux or other Open Source operating system kernel + in text or binary form as required. + + This firmware may not be modified and may only be used with + Keyspan hardware. Distribution and/or Modification of the + keyspan.c driver which includes this firmware, in whole or in + part, requires the inclusion of this statement." - Permission is hereby granted for the distribution of this firmware image - as part of a Linux or other Open Source operating system kernel in - text or binary form as required. - This firmware may not be modified and may only be used with the Keyspan - USA-28XA Serial Adapter. Distribution and/or Modification of the - keyspan.c driver which includes this firmware, in whole or in part, - requires the inclusion of this statement." */ static const struct ezusb_hex_record keyspan_usa28xa_firmware[] = { - {0x0033, 3, { 0x02, 0x13, 0xaa}}, + {0x0033, 3, { 0x02, 0x12, 0xf9}}, {0x0003, 16, { 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0}}, {0x0013, 16, { 0x90, 0x7f, 0x94, 0xf0, 0x90, 0x7f, 0x9d, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x97, 0xf0, 0x90}}, {0x0023, 15, { 0x7f, 0x95, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x07, 0xf0, 0xe4, 0x90, 0x7f, 0x98, 0xf0, 0x22}}, - {0x0046, 16, { 0x30, 0x09, 0x18, 0x12, 0x13, 0x28, 0xef, 0xc3, 0x95, 0x3c, 0x40, 0x03, 0x02, 0x00, 0xd8, 0x90}}, + {0x0046, 16, { 0x30, 0x09, 0x18, 0x12, 0x13, 0x27, 0xef, 0xc3, 0x95, 0x3c, 0x40, 0x03, 0x02, 0x00, 0xd8, 0x90}}, {0x0056, 16, { 0x7f, 0xbf, 0x74, 0x01, 0xf0, 0xc2, 0x09, 0xc2, 0x00, 0x80, 0x77, 0x30, 0x03, 0x3b, 0x90, 0x7f}}, - {0x0066, 16, { 0xc6, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x13, 0x28, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7e}}, + {0x0066, 16, { 0xc6, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x13, 0x27, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7e}}, {0x0076, 16, { 0x40, 0xe0, 0x13, 0x92, 0x09, 0x90, 0x7f, 0xc7, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60}}, - {0x0086, 16, { 0x0f, 0xf5, 0x08, 0x7e, 0x7e, 0x7f, 0x41, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x41, 0x12, 0x0c, 0xd8}}, + {0x0086, 16, { 0x0f, 0xf5, 0x08, 0x7e, 0x7e, 0x7f, 0x41, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x41, 0x12, 0x0c, 0xc8}}, {0x0096, 16, { 0xc2, 0x03, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0x80, 0x39, 0x90, 0x7f, 0xc8, 0xe0, 0x20, 0xe1, 0x32}}, - {0x00a6, 16, { 0x12, 0x13, 0x28, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x09}}, + {0x00a6, 16, { 0x12, 0x13, 0x27, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x09}}, {0x00b6, 16, { 0x90, 0x7f, 0xc9, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7d}}, - {0x00c6, 16, { 0x7f, 0xc1, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0xc1, 0x12, 0x0c, 0xd8, 0xd2, 0x03, 0xe4, 0x90, 0x7f}}, - {0x00d6, 16, { 0xc9, 0xf0, 0x90, 0x7f, 0xb6, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x01, 0x66, 0x53, 0x36, 0x80, 0x12}}, - {0x00e6, 16, { 0x13, 0x34, 0xef, 0x42, 0x36, 0x12, 0x11, 0xfb, 0x8f, 0x19, 0xef, 0xc3, 0x95, 0x3a, 0x50, 0x0f}}, - {0x00f6, 16, { 0x12, 0x13, 0x10, 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x36, 0x20, 0xe7, 0x03, 0x30, 0x0b, 0x61, 0xc2}}, + {0x00c6, 16, { 0x7f, 0xc1, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0xc1, 0x12, 0x0c, 0xc8, 0xd2, 0x03, 0xe4, 0x90, 0x7f}}, + {0x00d6, 16, { 0xc9, 0xf0, 0x90, 0x7f, 0xb6, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x01, 0x60, 0x12, 0x11, 0xe4, 0x8f}}, + {0x00e6, 16, { 0x19, 0x12, 0x13, 0x33, 0x8f, 0x36, 0xe5, 0x19, 0xc3, 0x95, 0x3a, 0x50, 0x0f, 0x12, 0x13, 0x0f}}, + {0x00f6, 16, { 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x36, 0x20, 0xe7, 0x03, 0x30, 0x0b, 0x5e, 0xc2, 0x0b, 0xe5, 0x19}}, {0x0036, 12, { 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22}}, - {0x0043, 3, { 0x02, 0x14, 0x00}}, - {0x0000, 3, { 0x02, 0x0e, 0x1e}}, - {0x0106, 64, { 0x0b, 0xe5, 0x19, 0x70, 0x04, 0xf5, 0x36, 0x80, 0x57, 0x12, 0x13, 0x34, 0xef, 0x42, 0x36, 0xe5, 0x36, - 0x30, 0xe7, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, - 0x7e, 0x7e, 0x7f, 0x80, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x80, 0xaf, 0x36, 0x12, 0x0f, 0x69, 0xe5, - 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xb7, 0xf0, 0x80, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40}}, - {0x0146, 64, { 0x03, 0x75, 0x19, 0x3f, 0x85, 0x19, 0x08, 0xe4, 0x90, 0x7e, 0x80, 0xf0, 0x7e, 0x7e, 0x7f, 0x81, 0x75, - 0x0c, 0x7e, 0x75, 0x0d, 0x81, 0x12, 0x0c, 0xfd, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xb7, 0xf0, 0x90, - 0x7f, 0xce, 0xe0, 0x30, 0xe1, 0x06, 0x20, 0x05, 0x03, 0x02, 0x03, 0xc5, 0xc2, 0x05, 0xe4, 0xf5, - 0x18, 0x74, 0x40, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xff, 0xe5}}, - {0x0186, 64, { 0x18, 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, 0x79, 0x00, 0x24, 0x00, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, - 0x12, 0x0e, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x00, 0xe0, 0x60, 0x68, - 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x24, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x11, 0xd6, 0x7f, 0x03, 0x7d, - 0xcd, 0x12, 0x11, 0xd6, 0x43, 0x46, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0}}, - {0x01c6, 64, { 0x00, 0xe5, 0x46, 0xf0, 0xe4, 0x90, 0x7e, 0x13, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x01, 0xe0, 0xff, 0x12, - 0x10, 0x5a, 0x90, 0x7e, 0x02, 0xe0, 0xff, 0x12, 0x10, 0x80, 0x7f, 0x01, 0x90, 0x7e, 0x11, 0xe0, - 0xfd, 0x12, 0x11, 0xd6, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xd6, 0x43, 0x46, 0x80, 0x90, 0x7f, - 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12}}, - {0x0206, 64, { 0xf0, 0xe5, 0x40, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x03, 0xe0, 0x70, 0x06, 0x90, 0x7e, - 0x13, 0xe0, 0x70, 0x08, 0xe4, 0x90, 0x7e, 0x13, 0xf0, 0x75, 0x25, 0xff, 0x90, 0x7e, 0x05, 0xe0, - 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, 0xf5, 0x44, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, - 0x00, 0xe5, 0x44, 0xf0, 0x90, 0x7e, 0x07, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43}}, - {0x0246, 64, { 0x42, 0x80, 0x80, 0x03, 0x53, 0x42, 0x7f, 0x53, 0x42, 0xfc, 0x90, 0x7e, 0x09, 0xe0, 0x60, 0x11, 0x43, - 0x42, 0x02, 0xa3, 0xe0, 0xff, 0x12, 0x10, 0xcc, 0x90, 0x7e, 0x0b, 0xe0, 0xff, 0x12, 0x10, 0xf2, - 0xaf, 0x42, 0x12, 0x10, 0xa6, 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x08, 0x53, 0x42, 0x7f, 0xaf, 0x42, - 0x12, 0x10, 0xa6, 0x90, 0x7e, 0x0c, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46}}, - {0x0286, 64, { 0x02, 0x80, 0x03, 0x53, 0x46, 0xfd, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, - 0xf0, 0x90, 0x7e, 0x0e, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x01, 0x80, 0x03, - 0x53, 0x46, 0xfe, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, - 0x7e, 0x12, 0xe0, 0xf5, 0x3a, 0xa3, 0xe0, 0x13, 0x92, 0x0d, 0xa3, 0xe0, 0xf5, 0x3c, 0xa3}}, - {0x02c6, 64, { 0xe0, 0x60, 0x05, 0x43, 0x46, 0x10, 0x80, 0x03, 0x53, 0x46, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, - 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x16, 0xe0, 0x60, 0x32, 0x53, 0x44, 0xbf, 0x90, - 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, - 0x74, 0x11, 0xf0, 0x12, 0x13, 0x04, 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3e}}, - {0x0306, 64, { 0xfd, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xd6, 0xe4, 0xf5, 0x2a, 0xf5, 0x29, 0xd2, 0x07, 0x90, 0x7e, - 0x17, 0xe0, 0x60, 0x0f, 0x43, 0x3e, 0x02, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xd6, 0x75, 0x29, - 0x01, 0xd2, 0x07, 0x90, 0x7e, 0x18, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, - 0x40, 0x44, 0x04, 0x90, 0xc0, 0x00, 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x19, 0xe0, 0x60, 0x11}}, - {0x0346, 64, { 0x43, 0x44, 0x40, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, - 0x90, 0x7e, 0x1a, 0xe0, 0x60, 0x0f, 0x53, 0x3e, 0xfe, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xd6, - 0x75, 0x2b, 0x01, 0xd2, 0x07, 0x90, 0x7e, 0x1b, 0xe0, 0x60, 0x0f, 0x43, 0x3e, 0x01, 0xe4, 0xff, - 0xad, 0x3e, 0x12, 0x11, 0xd6, 0xe4, 0xf5, 0x2b, 0xd2, 0x07, 0x90, 0x7e, 0x1c, 0xe0, 0x60}}, - {0x0386, 64, { 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, - 0x1d, 0xe0, 0x60, 0x02, 0xd2, 0x0b, 0x90, 0x7e, 0x1e, 0xe0, 0x60, 0x08, 0x75, 0x2c, 0x01, 0xe4, - 0xf5, 0x38, 0xd2, 0x07, 0x90, 0x7e, 0x1f, 0xe0, 0x60, 0x0f, 0x90, 0x7f, 0xd7, 0x74, 0x11, 0xf0, - 0x74, 0x31, 0xf0, 0x74, 0x15, 0xf0, 0x74, 0x35, 0xf0, 0xe4, 0x90, 0x7f, 0xcf, 0xf0, 0x30}}, - {0x03c6, 64, { 0x1a, 0x52, 0xe5, 0x38, 0x60, 0x02, 0x15, 0x38, 0x20, 0x13, 0x49, 0xe5, 0x13, 0xd3, 0x94, 0x00, 0x40, - 0x04, 0x15, 0x13, 0x80, 0x3e, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xd2, 0x13, 0x12, 0x13, 0x04, - 0xef, 0x54, 0x01, 0xf5, 0x19, 0x65, 0x2a, 0x60, 0x05, 0x85, 0x19, 0x2a, 0xd2, 0x07, 0x12, 0x13, - 0x40, 0xef, 0x54, 0x80, 0xf5, 0x19, 0x65, 0x26, 0x60, 0x05, 0x85, 0x19, 0x26, 0xd2, 0x07}}, - {0x0406, 64, { 0x30, 0x0d, 0x11, 0x12, 0x13, 0x40, 0xef, 0x54, 0x10, 0xf5, 0x19, 0x65, 0x25, 0x60, 0x05, 0x85, 0x19, - 0x25, 0xd2, 0x07, 0x20, 0x1b, 0x03, 0x02, 0x07, 0xf4, 0x30, 0x0a, 0x18, 0x12, 0x13, 0x7c, 0xef, - 0xc3, 0x95, 0x3d, 0x40, 0x03, 0x02, 0x04, 0xb2, 0x90, 0x7f, 0xc1, 0x74, 0x01, 0xf0, 0xc2, 0x0a, - 0xc2, 0x00, 0x80, 0x77, 0x30, 0x04, 0x3b, 0x90, 0x7f, 0xca, 0xe0, 0x20, 0xe1, 0x6d, 0x12}}, - {0x0446, 64, { 0x13, 0x7c, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7d, 0x40, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, - 0xcb, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7d, 0x7f, 0x41, - 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x41, 0x12, 0x0d, 0x22, 0xc2, 0x04, 0xe4, 0x90, 0x7f, 0xcb, 0xf0, - 0x80, 0x39, 0x90, 0x7f, 0xcc, 0xe0, 0x20, 0xe1, 0x32, 0x12, 0x13, 0x7c, 0xef, 0xc3, 0x94}}, - {0x0486, 64, { 0x40, 0x50, 0x29, 0x90, 0x7c, 0xc0, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, 0xcd, 0xe0, 0x14, 0xf5, 0x19, - 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7c, 0x7f, 0xc1, 0x75, 0x0c, 0x7c, 0x75, 0x0d, - 0xc1, 0x12, 0x0d, 0x22, 0xd2, 0x04, 0xe4, 0x90, 0x7f, 0xcd, 0xf0, 0x90, 0x7f, 0xba, 0xe0, 0x30, - 0xe1, 0x03, 0x02, 0x05, 0x40, 0x53, 0x37, 0x80, 0x12, 0x13, 0x88, 0xef, 0x42, 0x37, 0x12}}, - {0x04c6, 64, { 0x12, 0x45, 0x8f, 0x19, 0xef, 0xc3, 0x95, 0x3b, 0x50, 0x0f, 0x12, 0x13, 0x64, 0xef, 0x30, 0xe0, 0x08, - 0xe5, 0x37, 0x20, 0xe7, 0x03, 0x30, 0x0c, 0x61, 0xc2, 0x0c, 0xe5, 0x19, 0x70, 0x04, 0xf5, 0x37, - 0x80, 0x57, 0x12, 0x13, 0x88, 0xef, 0x42, 0x37, 0xe5, 0x37, 0x30, 0xe7, 0x26, 0xe5, 0x19, 0xd3, - 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, 0x7e, 0x7d, 0x7f, 0x80, 0x75}}, - {0x0506, 64, { 0x0c, 0x7d, 0x75, 0x0d, 0x80, 0xaf, 0x37, 0x12, 0x0f, 0xa2, 0xe5, 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xbb, - 0xf0, 0x80, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, 0x19, 0x3f, 0x85, 0x19, 0x08, - 0xe4, 0x90, 0x7d, 0x80, 0xf0, 0x7e, 0x7d, 0x7f, 0x81, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x81, 0x12, - 0x0d, 0x47, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xbb, 0xf0, 0x90, 0x7f, 0xd0, 0xe0, 0x30, 0xe1}}, - {0x0546, 64, { 0x06, 0x20, 0x06, 0x03, 0x02, 0x07, 0x9f, 0xc2, 0x06, 0xe4, 0xf5, 0x18, 0x74, 0xc0, 0x25, 0x18, 0xf5, - 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, - 0x79, 0x20, 0x24, 0x20, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, 0x12, 0x0e, 0xf0, 0x05, 0x18, 0xe5, - 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x20, 0xe0, 0x60, 0x68, 0x90, 0x7e, 0x23, 0xe0, 0x60}}, - {0x0586, 64, { 0x24, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x12, 0x20, 0x7f, 0x03, 0x7d, 0xcd, 0x12, 0x12, 0x20, 0x43, 0x47, - 0x80, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0xe4, 0x90, 0x7e, - 0x33, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x21, 0xe0, 0xff, 0x12, 0x11, 0x3e, 0x90, 0x7e, 0x22, 0xe0, - 0xff, 0x12, 0x11, 0x64, 0x7f, 0x01, 0x90, 0x7e, 0x31, 0xe0, 0xfd, 0x12, 0x12, 0x20, 0x7f}}, - {0x05c6, 64, { 0x03, 0x7d, 0x07, 0x12, 0x12, 0x20, 0x43, 0x47, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, - 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0xe5, 0x41, 0x44, 0x06, 0x90, 0xc0, - 0x00, 0xf0, 0x90, 0x7e, 0x23, 0xe0, 0x70, 0x06, 0x90, 0x7e, 0x33, 0xe0, 0x70, 0x08, 0xe4, 0x90, - 0x7e, 0x33, 0xf0, 0x75, 0x2e, 0xff, 0x90, 0x7e, 0x25, 0xe0, 0x60, 0x12, 0xa3, 0xe0, 0x54}}, - {0x0606, 64, { 0x3f, 0xf5, 0x45, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x45, 0xf0, 0x90, 0x7e, - 0x27, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x43, 0x80, 0x80, 0x03, 0x53, 0x43, 0x7f, - 0x53, 0x43, 0xfc, 0x90, 0x7e, 0x29, 0xe0, 0x60, 0x11, 0x43, 0x43, 0x02, 0xa3, 0xe0, 0xff, 0x12, - 0x11, 0x8a, 0x90, 0x7e, 0x2b, 0xe0, 0xff, 0x12, 0x11, 0xb0, 0xaf, 0x43, 0x12, 0x11, 0x18}}, - {0x0646, 64, { 0x90, 0x7e, 0x23, 0xe0, 0x60, 0x08, 0x53, 0x43, 0x7f, 0xaf, 0x43, 0x12, 0x11, 0x18, 0x90, 0x7e, 0x2c, - 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x02, 0x80, 0x03, 0x53, 0x47, 0xfd, 0x90, - 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7e, 0x2e, 0xe0, 0x60, - 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x01, 0x80, 0x03, 0x53, 0x47, 0xfe, 0x90, 0x7f}}, - {0x0686, 64, { 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7e, 0x32, 0xe0, 0xf5, 0x3b, 0xa3, - 0xe0, 0x13, 0x92, 0x0e, 0xa3, 0xe0, 0xf5, 0x3d, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x10, 0x80, - 0x03, 0x53, 0x47, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, - 0x90, 0x7e, 0x36, 0xe0, 0x60, 0x32, 0x53, 0x45, 0xbf, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0}}, - {0x06c6, 64, { 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x12, 0x13, 0x58, - 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3f, 0xfd, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, - 0x20, 0xe4, 0xf5, 0x33, 0xf5, 0x32, 0xd2, 0x08, 0x90, 0x7e, 0x37, 0xe0, 0x60, 0x0f, 0x43, 0x3f, - 0x02, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x20, 0x75, 0x32, 0x01, 0xd2, 0x08, 0x90, 0x7e}}, - {0x0706, 64, { 0x38, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0xe5, 0x41, 0x44, 0x04, 0x90, 0xc0, 0x00, - 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x39, 0xe0, 0x60, 0x11, 0x43, 0x45, 0x40, 0x90, 0x7f, 0x98, 0x74, - 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x3a, 0xe0, 0x60, 0x0f, - 0x53, 0x3f, 0xfe, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x20, 0x75, 0x34, 0x01, 0xd2, 0x08}}, - {0x0746, 64, { 0x90, 0x7e, 0x3b, 0xe0, 0x60, 0x0f, 0x43, 0x3f, 0x01, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x20, 0xe4, - 0xf5, 0x34, 0xd2, 0x08, 0x90, 0x7e, 0x3c, 0xe0, 0x60, 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, - 0xe5, 0x41, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x3d, 0xe0, 0x60, 0x02, 0xd2, 0x0c, - 0x90, 0x7e, 0x3e, 0xe0, 0x60, 0x08, 0x75, 0x35, 0x01, 0xe4, 0xf5, 0x39, 0xd2, 0x08, 0x90}}, - {0x0786, 64, { 0x7e, 0x3f, 0xe0, 0x60, 0x0f, 0x90, 0x7f, 0xd7, 0x74, 0x13, 0xf0, 0x74, 0x33, 0xf0, 0x74, 0x16, 0xf0, - 0x74, 0x36, 0xf0, 0xe4, 0x90, 0x7f, 0xd1, 0xf0, 0x30, 0x1a, 0x52, 0xe5, 0x39, 0x60, 0x02, 0x15, - 0x39, 0x30, 0x13, 0x49, 0xe5, 0x13, 0xd3, 0x94, 0x00, 0x40, 0x04, 0x15, 0x13, 0x80, 0x3e, 0x75, - 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xc2, 0x13, 0x12, 0x13, 0x58, 0xef, 0x54, 0x01, 0xf5, 0x19}}, - {0x07c6, 64, { 0x65, 0x33, 0x60, 0x05, 0x85, 0x19, 0x33, 0xd2, 0x08, 0x12, 0x13, 0x94, 0xef, 0x54, 0x80, 0xf5, 0x19, - 0x65, 0x2f, 0x60, 0x05, 0x85, 0x19, 0x2f, 0xd2, 0x08, 0x30, 0x0e, 0x11, 0x12, 0x13, 0x94, 0xef, - 0x54, 0x10, 0xf5, 0x19, 0x65, 0x2e, 0x60, 0x05, 0x85, 0x19, 0x2e, 0xd2, 0x08, 0x30, 0x1a, 0x2a, - 0x90, 0x7f, 0xd2, 0xe0, 0x20, 0xe1, 0x23, 0x90, 0x7b, 0x40, 0xe0, 0x60, 0x09, 0xe0, 0xf5}}, - {0x0806, 64, { 0x15, 0x90, 0x7b, 0x42, 0xe0, 0xf5, 0x16, 0x90, 0x7b, 0x41, 0xe0, 0x60, 0x09, 0x90, 0x7f, 0xd7, 0x74, - 0x17, 0xf0, 0x74, 0x37, 0xf0, 0xe4, 0x90, 0x7f, 0xd3, 0xf0, 0x90, 0x7f, 0xc2, 0xe0, 0x30, 0xe1, - 0x03, 0x02, 0x09, 0x28, 0xe5, 0x0a, 0x70, 0x40, 0x30, 0x07, 0x39, 0xe5, 0x38, 0x70, 0x35, 0xc2, - 0x07, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00}}, - {0x0846, 64, { 0xfa, 0x12, 0x0e, 0xaa, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, - 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x38, - 0x10, 0xe4, 0xf5, 0x2c, 0x75, 0x0a, 0x01, 0x22, 0xe5, 0x0a, 0x64, 0x01, 0x70, 0x40, 0x30, 0x08, - 0x39, 0xe5, 0x39, 0x70, 0x35, 0xc2, 0x08, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x2d}}, - {0x0886, 64, { 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0xaa, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, - 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, 0x90, 0x7f, - 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x39, 0x10, 0xe4, 0xf5, 0x35, 0x75, 0x0a, 0x02, 0x22, 0xe5, 0x0a, - 0x64, 0x02, 0x70, 0x36, 0x30, 0x14, 0x2f, 0xc2, 0x14, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00}}, - {0x08c6, 64, { 0x74, 0x0e, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0xaa, 0xff, 0x74, 0x80, 0x25, 0x18, - 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x05, 0xdb, - 0x90, 0x7f, 0xc3, 0x74, 0x05, 0xf0, 0x75, 0x0a, 0x03, 0x22, 0xe5, 0x15, 0x60, 0x30, 0x15, 0x15, - 0xe4, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x14, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00}}, - {0x0906, 64, { 0xfa, 0x12, 0x0e, 0xaa, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, - 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x03, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, 0xf5, - 0x0a, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x0f, 0x02, 0x0a, 0x10, 0x00, 0x0a, 0x84, 0x01, 0x0a, - 0xf0, 0x03, 0x09, 0x4c, 0x06, 0x0a, 0x03, 0x08, 0x09, 0xfd, 0x09, 0x09, 0xe5, 0x0a, 0x09}}, - {0x0946, 64, { 0xf4, 0x0b, 0x00, 0x00, 0x0b, 0x3f, 0x90, 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x19, 0x14, 0x60, 0x61, - 0x24, 0x02, 0x60, 0x03, 0x02, 0x09, 0xdb, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x00, 0x90, - 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x04, 0x7f, 0x02, 0x80, 0x02, - 0x7f, 0x03, 0x75, 0x82, 0x82, 0x75, 0x83, 0x19, 0xef, 0xf0, 0x75, 0x82, 0x7b, 0x75, 0x83}}, - {0x0986, 64, { 0x19, 0xf0, 0x75, 0x82, 0x74, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x66, 0x75, 0x83, 0x19, 0xf0, 0x75, - 0x82, 0x58, 0x75, 0x83, 0x19, 0xf0, 0x90, 0x7f, 0xea, 0xe0, 0x04, 0x75, 0x82, 0x17, 0x75, 0x83, - 0x19, 0xf0, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x12, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, - 0x46, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x0f, 0x28, 0xea, 0x49, 0x60, 0x0d, 0xea, 0x90}}, - {0x09c6, 64, { 0x7f, 0xd4, 0xf0, 0xe9, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, - 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, - 0x00, 0xe5, 0x09, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xea, - 0xe0, 0xf5, 0x09, 0x02, 0x0b, 0x46, 0x12, 0x0b, 0x4e, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0x00}}, - {0x0a06, 64, { 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xb5, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60, - 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, 0xa2, 0x10, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, - 0xa2, 0x16, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, - 0x02, 0xf0, 0x02, 0x0b, 0x46, 0xe4, 0x90, 0x7f, 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5}}, - {0x0a46, 64, { 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, - 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, - 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, - 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f}}, - {0x0a86, 64, { 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24, 0x02, 0x60, 0x03, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xea, 0xe0, - 0xb4, 0x01, 0x05, 0xc2, 0x10, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, - 0x0b, 0x46, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x38, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, - 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4}}, - {0x0ac6, 64, { 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f, 0xec, 0xe0, 0x54, 0x80, 0xff, 0x13, 0x13, 0x13, 0x54, - 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f, 0xd7, 0xf0, 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x5f, - 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x56, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, - 0x18, 0x24, 0x02, 0x70, 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x04, 0xd2, 0x10, 0x80}}, - {0x0b06, 64, { 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, - 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, - 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, - 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0}}, - {0x0b46, 64, { 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, - 0x30, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0, 0x90, 0x7f, 0x95, 0x74, 0xc0, 0xf0, 0x90, 0x7f, 0x9e, - 0x74, 0x3f, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x18, 0xf0, 0xe4, 0xf5, 0x8e, 0x90, 0x7f, 0xdf, 0x74, - 0xff, 0xf0, 0x90, 0x7f, 0xde, 0xf0, 0xe4, 0xf5, 0x24, 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74}}, - {0x0b86, 64, { 0x24, 0x25, 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa, 0xe4, 0x12, 0x0e, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, - 0x09, 0xea, 0x75, 0x3a, 0x01, 0xe4, 0xf5, 0x38, 0xf5, 0x13, 0xf5, 0x36, 0xc2, 0x07, 0xc2, 0x0b, - 0xc2, 0x05, 0xc2, 0x00, 0xc2, 0x09, 0xc2, 0x13, 0xd2, 0x03, 0xd2, 0x01, 0x90, 0x7f, 0x98, 0x74, - 0x13, 0xf0, 0x75, 0x44, 0x03, 0x90, 0xc0, 0x00, 0x74, 0x03, 0xf0, 0x7f, 0x0c, 0xe4, 0xfd}}, - {0x0bc6, 64, { 0x12, 0x11, 0xd6, 0x7f, 0x10, 0x8f, 0x42, 0x12, 0x10, 0xa6, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x7f, - 0x01, 0x8f, 0x40, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, - 0x75, 0x46, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, 0x11, 0xd6, 0xe4, - 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3e, 0x12, 0x11, 0xd6, 0x90, 0x7f, 0x98, 0x74, 0x11}}, - {0x0c06, 64, { 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x11, 0xd6, 0x7f, 0x01, 0x12, 0x12, - 0x8f, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xd6, 0x7f, 0x13, 0x7d, 0x01, 0x12, 0x11, 0xd6, 0x20, - 0x1b, 0x03, 0x02, 0x0c, 0xd5, 0x75, 0x2d, 0x01, 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74, 0x2d, 0x25, - 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa, 0xe4, 0x12, 0x0e, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4}}, - {0x0c46, 64, { 0x09, 0xea, 0x75, 0x3b, 0x01, 0xe4, 0xf5, 0x39, 0xf5, 0x13, 0xf5, 0x37, 0xc2, 0x08, 0xc2, 0x0c, 0xc2, - 0x06, 0xc2, 0x00, 0xc2, 0x0a, 0xc2, 0x13, 0xd2, 0x04, 0xd2, 0x02, 0x90, 0x7f, 0x98, 0x74, 0x0b, + {0x0043, 3, { 0x02, 0x13, 0x00}}, + {0x0000, 3, { 0x02, 0x0e, 0x0e}}, + {0x0106, 64, { 0x60, 0x58, 0xb4, 0x80, 0x03, 0x43, 0x36, 0x02, 0xe5, 0x36, 0x30, 0xe7, 0x26, 0xe5, 0x19, 0xd3, 0x94, + 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, 0x7e, 0x7e, 0x7f, 0x80, 0x75, 0x0c, 0x7e, + 0x75, 0x0d, 0x80, 0xaf, 0x36, 0x12, 0x0f, 0x59, 0xe5, 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xb7, 0xf0, + 0x80, 0x27, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, 0x19, 0x3f, 0x85, 0x19, 0x08}}, + {0x0146, 64, { 0x90, 0x7e, 0x80, 0xe5, 0x36, 0xf0, 0x7e, 0x7e, 0x7f, 0x81, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x81, 0x12, + 0x0c, 0xed, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xb7, 0xf0, 0x90, 0x7f, 0xce, 0xe0, 0x30, 0xe1, 0x06, + 0x20, 0x05, 0x03, 0x02, 0x03, 0xc1, 0xc2, 0x05, 0xe4, 0xf5, 0x18, 0x74, 0x40, 0x25, 0x18, 0xf5, + 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, 0x7c, 0x00, 0x7b, 0x01, 0x7a}}, + {0x0186, 64, { 0x7e, 0x79, 0x00, 0x24, 0x00, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, 0x12, 0x0e, 0xe0, 0x05, 0x18, 0xe5, + 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x00, 0xe0, 0x60, 0x68, 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x24, + 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x11, 0xbf, 0x7f, 0x03, 0x7d, 0xcd, 0x12, 0x11, 0xbf, 0x43, 0x46, + 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0xe4, 0x90}}, + {0x01c6, 64, { 0x7e, 0x13, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x01, 0xe0, 0xff, 0x12, 0x10, 0x43, 0x90, 0x7e, 0x02, 0xe0, + 0xff, 0x12, 0x10, 0x69, 0x7f, 0x01, 0x90, 0x7e, 0x11, 0xe0, 0xfd, 0x12, 0x11, 0xbf, 0x7f, 0x03, + 0x7d, 0x07, 0x12, 0x11, 0xbf, 0x43, 0x46, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, + 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, 0x06, 0x90}}, + {0x0206, 64, { 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x03, 0xe0, 0x70, 0x06, 0x90, 0x7e, 0x13, 0xe0, 0x70, 0x08, 0xe4, 0x90, + 0x7e, 0x13, 0xf0, 0x75, 0x25, 0xff, 0x90, 0x7e, 0x05, 0xe0, 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, + 0xf5, 0x44, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x44, 0xf0, 0x90, 0x7e, + 0x07, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x42, 0x80, 0x80, 0x03, 0x53, 0x42}}, + {0x0246, 64, { 0x7f, 0x53, 0x42, 0xfc, 0x90, 0x7e, 0x09, 0xe0, 0x60, 0x11, 0x43, 0x42, 0x02, 0xa3, 0xe0, 0xff, 0x12, + 0x10, 0xb5, 0x90, 0x7e, 0x0b, 0xe0, 0xff, 0x12, 0x10, 0xdb, 0xaf, 0x42, 0x12, 0x10, 0x8f, 0x90, + 0x7e, 0x03, 0xe0, 0x60, 0x08, 0x53, 0x42, 0x7f, 0xaf, 0x42, 0x12, 0x10, 0x8f, 0x90, 0x7e, 0x0c, + 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x02, 0x80, 0x03, 0x53, 0x46, 0xfd}}, + {0x0286, 64, { 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x0e, 0xe0, 0x60, + 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x01, 0x80, 0x03, 0x53, 0x46, 0xfe, 0x90, 0x7f, 0x98, + 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x12, 0xe0, 0xf5, 0x3a, 0xa3, + 0xe0, 0x13, 0x92, 0x0d, 0xa3, 0xe0, 0xf5, 0x3c, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x10}}, + {0x02c6, 64, { 0x80, 0x03, 0x53, 0x46, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, + 0x90, 0x7e, 0x16, 0xe0, 0x60, 0x32, 0x53, 0x44, 0xbf, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, + 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x12, 0x12, 0xed, + 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3e, 0xfd, 0xe4, 0xff, 0xad, 0x3e, 0x12}}, + {0x0306, 64, { 0x11, 0xbf, 0xe4, 0xf5, 0x2a, 0xf5, 0x29, 0xd2, 0x07, 0x90, 0x7e, 0x17, 0xe0, 0x60, 0x0f, 0x43, 0x3e, + 0x02, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xbf, 0x75, 0x29, 0x01, 0xd2, 0x07, 0x90, 0x7e, 0x18, + 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, 0x04, 0x90, 0xc0, 0x00, + 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x19, 0xe0, 0x60, 0x11, 0x43, 0x44, 0x40, 0x90, 0x7f, 0x98}}, + {0x0346, 64, { 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x1a, 0xe0, 0x60, 0x0f, + 0x53, 0x3e, 0xfe, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xbf, 0x75, 0x2b, 0x01, 0xd2, 0x07, 0x90, + 0x7e, 0x1b, 0xe0, 0x60, 0x0f, 0x43, 0x3e, 0x01, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xbf, 0xe4, + 0xf5, 0x2b, 0xd2, 0x07, 0x90, 0x7e, 0x1c, 0xe0, 0x60, 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x12}}, + {0x0386, 64, { 0xf0, 0xe5, 0x40, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x1d, 0xe0, 0x60, 0x02, 0xd2, 0x0b, + 0x90, 0x7e, 0x1e, 0xe0, 0x60, 0x08, 0x75, 0x2c, 0x01, 0xe4, 0xf5, 0x38, 0xd2, 0x07, 0x90, 0x7e, + 0x1f, 0xe0, 0x60, 0x11, 0x90, 0x7f, 0xd7, 0x74, 0x11, 0xf0, 0x74, 0x31, 0xf0, 0x74, 0x15, 0xf0, + 0x74, 0x35, 0xf0, 0xd2, 0x03, 0xe4, 0x90, 0x7f, 0xcf, 0xf0, 0x30, 0x1a, 0x52, 0xe5, 0x38}}, + {0x03c6, 64, { 0x60, 0x02, 0x15, 0x38, 0x20, 0x13, 0x49, 0xe5, 0x13, 0xd3, 0x94, 0x00, 0x40, 0x04, 0x15, 0x13, 0x80, + 0x3e, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xd2, 0x13, 0x12, 0x12, 0xed, 0xef, 0x54, 0x01, 0xf5, + 0x19, 0x65, 0x2a, 0x60, 0x05, 0x85, 0x19, 0x2a, 0xd2, 0x07, 0x12, 0x13, 0x3f, 0xef, 0x54, 0x80, + 0xf5, 0x19, 0x65, 0x26, 0x60, 0x05, 0x85, 0x19, 0x26, 0xd2, 0x07, 0x30, 0x0d, 0x11, 0x12}}, + {0x0406, 64, { 0x13, 0x3f, 0xef, 0x54, 0x10, 0xf5, 0x19, 0x65, 0x25, 0x60, 0x05, 0x85, 0x19, 0x25, 0xd2, 0x07, 0x20, + 0x1b, 0x03, 0x02, 0x07, 0xec, 0x30, 0x0a, 0x18, 0x12, 0x13, 0x7b, 0xef, 0xc3, 0x95, 0x3d, 0x40, + 0x03, 0x02, 0x04, 0xae, 0x90, 0x7f, 0xc1, 0x74, 0x01, 0xf0, 0xc2, 0x0a, 0xc2, 0x00, 0x80, 0x77, + 0x30, 0x04, 0x3b, 0x90, 0x7f, 0xca, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x13, 0x7b, 0xef, 0xc3}}, + {0x0446, 64, { 0x94, 0x40, 0x50, 0x64, 0x90, 0x7d, 0x40, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, 0xcb, 0xe0, 0x14, 0xf5, + 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7d, 0x7f, 0x41, 0x75, 0x0c, 0x7d, 0x75, + 0x0d, 0x41, 0x12, 0x0d, 0x12, 0xc2, 0x04, 0xe4, 0x90, 0x7f, 0xcb, 0xf0, 0x80, 0x39, 0x90, 0x7f, + 0xcc, 0xe0, 0x20, 0xe1, 0x32, 0x12, 0x13, 0x7b, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90}}, + {0x0486, 64, { 0x7c, 0xc0, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, 0xcd, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, + 0x0f, 0xf5, 0x08, 0x7e, 0x7c, 0x7f, 0xc1, 0x75, 0x0c, 0x7c, 0x75, 0x0d, 0xc1, 0x12, 0x0d, 0x12, + 0xd2, 0x04, 0xe4, 0x90, 0x7f, 0xcd, 0xf0, 0x90, 0x7f, 0xba, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x05, + 0x36, 0x12, 0x12, 0x2e, 0x8f, 0x19, 0x12, 0x13, 0x87, 0x8f, 0x37, 0xe5, 0x19, 0xc3, 0x95}}, + {0x04c6, 64, { 0x3b, 0x50, 0x0f, 0x12, 0x13, 0x63, 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x37, 0x20, 0xe7, 0x03, 0x30, 0x0c, + 0x5e, 0xc2, 0x0c, 0xe5, 0x19, 0x60, 0x58, 0xb4, 0x80, 0x03, 0x43, 0x37, 0x02, 0xe5, 0x37, 0x30, + 0xe7, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, 0x7e, + 0x7d, 0x7f, 0x80, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x80, 0xaf, 0x37, 0x12, 0x0f, 0x92, 0xe5}}, + {0x0506, 64, { 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xbb, 0xf0, 0x80, 0x27, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, + 0x19, 0x3f, 0x85, 0x19, 0x08, 0x90, 0x7d, 0x80, 0xe5, 0x37, 0xf0, 0x7e, 0x7d, 0x7f, 0x81, 0x75, + 0x0c, 0x7d, 0x75, 0x0d, 0x81, 0x12, 0x0d, 0x37, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xbb, 0xf0, 0x90, + 0x7f, 0xd0, 0xe0, 0x30, 0xe1, 0x06, 0x20, 0x06, 0x03, 0x02, 0x07, 0x97, 0xc2, 0x06, 0xe4}}, + {0x0546, 64, { 0xf5, 0x18, 0x74, 0xc0, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, + 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, 0x79, 0x20, 0x24, 0x20, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, + 0x12, 0x0e, 0xe0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x20, 0xe0, 0x60, 0x68, + 0x90, 0x7e, 0x23, 0xe0, 0x60, 0x24, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x12, 0x09, 0x7f, 0x03}}, + {0x0586, 64, { 0x7d, 0xcd, 0x12, 0x12, 0x09, 0x43, 0x47, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, + 0xe5, 0x47, 0xf0, 0xe4, 0x90, 0x7e, 0x33, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x21, 0xe0, 0xff, 0x12, + 0x11, 0x27, 0x90, 0x7e, 0x22, 0xe0, 0xff, 0x12, 0x11, 0x4d, 0x7f, 0x01, 0x90, 0x7e, 0x31, 0xe0, + 0xfd, 0x12, 0x12, 0x09, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x12, 0x09, 0x43, 0x47, 0x80, 0x90}}, + {0x05c6, 64, { 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, + 0xe5, 0x41, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x23, 0xe0, 0x70, 0x06, 0x90, 0x7e, + 0x33, 0xe0, 0x70, 0x08, 0xe4, 0x90, 0x7e, 0x33, 0xf0, 0x75, 0x2e, 0xff, 0x90, 0x7e, 0x25, 0xe0, + 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, 0xf5, 0x45, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90}}, + {0x0606, 64, { 0xc0, 0x00, 0xe5, 0x45, 0xf0, 0x90, 0x7e, 0x27, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x43, + 0x80, 0x80, 0x03, 0x53, 0x43, 0x7f, 0x53, 0x43, 0xfc, 0x90, 0x7e, 0x29, 0xe0, 0x60, 0x11, 0x43, + 0x43, 0x02, 0xa3, 0xe0, 0xff, 0x12, 0x11, 0x73, 0x90, 0x7e, 0x2b, 0xe0, 0xff, 0x12, 0x11, 0x99, + 0xaf, 0x43, 0x12, 0x11, 0x01, 0x90, 0x7e, 0x23, 0xe0, 0x60, 0x08, 0x53, 0x43, 0x7f, 0xaf}}, + {0x0646, 64, { 0x43, 0x12, 0x11, 0x01, 0x90, 0x7e, 0x2c, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x02, + 0x80, 0x03, 0x53, 0x47, 0xfd, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, + 0xf0, 0x90, 0x7e, 0x2e, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x01, 0x80, 0x03, + 0x53, 0x47, 0xfe, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0}}, + {0x0686, 64, { 0x90, 0x7e, 0x32, 0xe0, 0xf5, 0x3b, 0xa3, 0xe0, 0x13, 0x92, 0x0e, 0xa3, 0xe0, 0xf5, 0x3d, 0xa3, 0xe0, + 0x60, 0x05, 0x43, 0x47, 0x10, 0x80, 0x03, 0x53, 0x47, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, + 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7e, 0x36, 0xe0, 0x60, 0x32, 0x53, 0x45, 0xbf, 0x90, + 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f}}, + {0x06c6, 64, { 0x98, 0x74, 0x09, 0xf0, 0x12, 0x13, 0x57, 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3f, 0xfd, + 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x09, 0xe4, 0xf5, 0x33, 0xf5, 0x32, 0xd2, 0x08, 0x90, 0x7e, + 0x37, 0xe0, 0x60, 0x0f, 0x43, 0x3f, 0x02, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x09, 0x75, 0x32, + 0x01, 0xd2, 0x08, 0x90, 0x7e, 0x38, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0}}, + {0x0706, 64, { 0xe5, 0x41, 0x44, 0x04, 0x90, 0xc0, 0x00, 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x39, 0xe0, 0x60, 0x11, 0x43, + 0x45, 0x40, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, + 0x90, 0x7e, 0x3a, 0xe0, 0x60, 0x0f, 0x53, 0x3f, 0xfe, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x09, + 0x75, 0x34, 0x01, 0xd2, 0x08, 0x90, 0x7e, 0x3b, 0xe0, 0x60, 0x0f, 0x43, 0x3f, 0x01, 0xe4}}, + {0x0746, 64, { 0xff, 0xad, 0x3f, 0x12, 0x12, 0x09, 0xe4, 0xf5, 0x34, 0xd2, 0x08, 0x90, 0x7e, 0x3c, 0xe0, 0x60, 0x0e, + 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0xe5, 0x41, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, + 0x3d, 0xe0, 0x60, 0x02, 0xd2, 0x0c, 0x90, 0x7e, 0x3e, 0xe0, 0x60, 0x08, 0x75, 0x35, 0x01, 0xe4, + 0xf5, 0x39, 0xd2, 0x08, 0x90, 0x7e, 0x3f, 0xe0, 0x60, 0x11, 0x90, 0x7f, 0xd7, 0x74, 0x13}}, + {0x0786, 64, { 0xf0, 0x74, 0x33, 0xf0, 0x74, 0x16, 0xf0, 0x74, 0x36, 0xf0, 0xd2, 0x04, 0xe4, 0x90, 0x7f, 0xd1, 0xf0, + 0x30, 0x1a, 0x52, 0xe5, 0x39, 0x60, 0x02, 0x15, 0x39, 0x30, 0x13, 0x49, 0xe5, 0x13, 0xd3, 0x94, + 0x00, 0x40, 0x04, 0x15, 0x13, 0x80, 0x3e, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xc2, 0x13, 0x12, + 0x13, 0x57, 0xef, 0x54, 0x01, 0xf5, 0x19, 0x65, 0x33, 0x60, 0x05, 0x85, 0x19, 0x33, 0xd2}}, + {0x07c6, 64, { 0x08, 0x12, 0x13, 0x93, 0xef, 0x54, 0x80, 0xf5, 0x19, 0x65, 0x2f, 0x60, 0x05, 0x85, 0x19, 0x2f, 0xd2, + 0x08, 0x30, 0x0e, 0x11, 0x12, 0x13, 0x93, 0xef, 0x54, 0x10, 0xf5, 0x19, 0x65, 0x2e, 0x60, 0x05, + 0x85, 0x19, 0x2e, 0xd2, 0x08, 0x30, 0x1a, 0x2a, 0x90, 0x7f, 0xd2, 0xe0, 0x20, 0xe1, 0x23, 0x90, + 0x7b, 0x40, 0xe0, 0x60, 0x09, 0xe0, 0xf5, 0x15, 0x90, 0x7b, 0x42, 0xe0, 0xf5, 0x16, 0x90}}, + {0x0806, 64, { 0x7b, 0x41, 0xe0, 0x60, 0x09, 0x90, 0x7f, 0xd7, 0x74, 0x17, 0xf0, 0x74, 0x37, 0xf0, 0xe4, 0x90, 0x7f, + 0xd3, 0xf0, 0x90, 0x7f, 0xc2, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x09, 0x20, 0xe5, 0x0a, 0x70, 0x40, + 0x30, 0x07, 0x39, 0xe5, 0x38, 0x70, 0x35, 0xc2, 0x07, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, + 0x24, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x9a, 0xff, 0x74, 0x80, 0x25}}, + {0x0846, 64, { 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, + 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x38, 0x10, 0xe4, 0xf5, 0x2c, 0x75, 0x0a, 0x01, 0x22, + 0xe5, 0x0a, 0x64, 0x01, 0x70, 0x40, 0x30, 0x08, 0x39, 0xe5, 0x39, 0x70, 0x35, 0xc2, 0x08, 0xf5, + 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x2d, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12}}, + {0x0886, 64, { 0x0e, 0x9a, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, + 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x39, 0x10, 0xe4, + 0xf5, 0x35, 0x75, 0x0a, 0x02, 0x22, 0xe5, 0x0a, 0x64, 0x02, 0x70, 0x36, 0x30, 0x14, 0x2f, 0xc2, + 0x14, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x0e, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00}}, + {0x08c6, 64, { 0xfa, 0x12, 0x0e, 0x9a, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, + 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x05, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x05, 0xf0, 0x75, 0x0a, + 0x03, 0x22, 0xe5, 0x15, 0x60, 0x30, 0x15, 0x15, 0xe4, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, + 0x14, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x9a, 0xff, 0x74, 0x80, 0x25}}, + {0x0906, 64, { 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x03, 0xdb, + 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, 0xf5, 0x0a, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x0e, + 0xf2, 0x0a, 0x08, 0x00, 0x0a, 0x7c, 0x01, 0x0a, 0xe8, 0x03, 0x09, 0x44, 0x06, 0x09, 0xfb, 0x08, + 0x09, 0xf5, 0x09, 0x09, 0xdd, 0x0a, 0x09, 0xec, 0x0b, 0x00, 0x00, 0x0b, 0x37, 0x90, 0x7f}}, + {0x0946, 64, { 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x19, 0x14, 0x60, 0x61, 0x24, 0x02, 0x60, 0x03, 0x02, 0x09, 0xd3, 0x74, + 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x00, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, + 0xea, 0xe0, 0x70, 0x04, 0x7f, 0x02, 0x80, 0x02, 0x7f, 0x03, 0x75, 0x82, 0x82, 0x75, 0x83, 0x19, + 0xef, 0xf0, 0x75, 0x82, 0x7b, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x74, 0x75, 0x83, 0x19}}, + {0x0986, 64, { 0xf0, 0x75, 0x82, 0x66, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x58, 0x75, 0x83, 0x19, 0xf0, 0x90, 0x7f, + 0xea, 0xe0, 0x04, 0x75, 0x82, 0x17, 0x75, 0x83, 0x19, 0xf0, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, + 0x74, 0x12, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x0f, + 0x18, 0xea, 0x49, 0x60, 0x0d, 0xea, 0x90, 0x7f, 0xd4, 0xf0, 0xe9, 0x90, 0x7f, 0xd5, 0xf0}}, + {0x09c6, 64, { 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xb4, 0xe0, + 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0x00, 0xe5, 0x09, 0xf0, 0x90, 0x7f, 0xb5, 0x74, + 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x09, 0x02, 0x0b, 0x3e, 0x12, 0x0b, + 0x46, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0x00, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xb5, 0xf0, 0x02}}, + {0x0a06, 64, { 0x0b, 0x3e, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60, 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, + 0xa2, 0x10, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, 0xa2, 0x16, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, + 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x3e, 0xe4, 0x90, 0x7f, + 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f}}, + {0x0a46, 64, { 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, + 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, + 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xb4, 0xe0, 0x44, + 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24, 0x02}}, + {0x0a86, 64, { 0x60, 0x03, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x05, 0xc2, 0x10, 0x02, 0x0b, 0x3e, + 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x38, + 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, + 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f}}, + {0x0ac6, 64, { 0xec, 0xe0, 0x54, 0x80, 0xff, 0x13, 0x13, 0x13, 0x54, 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f, + 0xd7, 0xf0, 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x5f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, + 0x56, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x18, 0x24, 0x02, 0x70, 0x4a, 0x90, 0x7f, 0xea, + 0xe0, 0xb4, 0x01, 0x04, 0xd2, 0x10, 0x80, 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0}}, + {0x0b06, 64, { 0x80, 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, + 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, + 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, + 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0, 0x22}}, + {0x0b46, 64, { 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0, 0x90, + 0x7f, 0x95, 0x74, 0xc0, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x3f, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x18, + 0xf0, 0xe4, 0xf5, 0x8e, 0x90, 0x7f, 0xdf, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xde, 0xf0, 0xe4, 0xf5, + 0x24, 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa}}, + {0x0b86, 64, { 0xe4, 0x12, 0x0e, 0xe0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xea, 0x75, 0x3a, 0x01, 0xe4, 0xf5, 0x38, + 0xf5, 0x13, 0xf5, 0x36, 0xc2, 0x07, 0xc2, 0x0b, 0xc2, 0x05, 0xc2, 0x00, 0xc2, 0x09, 0xc2, 0x13, + 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x75, 0x44, 0x03, 0x90, 0xc0, 0x00, 0x74, 0x03, 0xf0, 0x7f, + 0x0c, 0xe4, 0xfd, 0x12, 0x11, 0xbf, 0x7f, 0x10, 0x8f, 0x42, 0x12, 0x10, 0x8f, 0x90, 0x7f}}, + {0x0bc6, 64, { 0x98, 0x74, 0x12, 0xf0, 0x7f, 0x01, 0x8f, 0x40, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x14, 0xf0, 0x75, 0x46, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0x0f, 0xe4, 0xfd, + 0x12, 0x11, 0xbf, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3e, 0x12, 0x11, 0xbf, 0x90, 0x7f, + 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x11}}, + {0x0c06, 64, { 0xbf, 0x7f, 0x01, 0x12, 0x12, 0x78, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xbf, 0x7f, 0x13, 0x7d, 0x01, + 0x12, 0x11, 0xbf, 0x20, 0x1b, 0x03, 0x02, 0x0c, 0xc5, 0x75, 0x2d, 0x01, 0x75, 0x18, 0x01, 0x7b, + 0x00, 0x74, 0x2d, 0x25, 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa, 0xe4, 0x12, 0x0e, 0xe0, 0x05, 0x18, + 0xe5, 0x18, 0xb4, 0x09, 0xea, 0x75, 0x3b, 0x01, 0xe4, 0xf5, 0x39, 0xf5, 0x13, 0xf5, 0x37}}, + {0x0c46, 64, { 0xc2, 0x08, 0xc2, 0x0c, 0xc2, 0x06, 0xc2, 0x00, 0xc2, 0x0a, 0xc2, 0x13, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x75, 0x45, 0x03, 0x90, 0xc0, 0x00, 0x74, 0x03, 0xf0, 0x7f, 0x0c, 0xe4, 0xfd, 0x12, 0x12, - 0x20, 0x7f, 0x10, 0x8f, 0x43, 0x12, 0x11, 0x18, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x7f}}, - {0x0c86, 64, { 0x01, 0x8f, 0x41, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x75, - 0x47, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, 0x12, 0x20, 0xe4, 0xff, - 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3f, 0x12, 0x12, 0x20, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, - 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x12, 0x20, 0x7f, 0x01, 0x12, 0x12}}, - {0x0cc6, 64, { 0xb0, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x12, 0x20, 0x7f, 0x13, 0x7d, 0x01, 0x12, 0x12, 0x20, 0xd2, 0x12, - 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, + 0x09, 0x7f, 0x10, 0x8f, 0x43, 0x12, 0x11, 0x01, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x7f, 0x01, + 0x8f, 0x41, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0}}, + {0x0c86, 64, { 0x75, 0x47, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, 0x12, 0x09, 0xe4, 0xff, + 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3f, 0x12, 0x12, 0x09, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, + 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x12, 0x09, 0x7f, 0x01, 0x12, 0x12, 0x99, + 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x12, 0x09, 0x7f, 0x13, 0x7d, 0x01, 0x12, 0x12, 0x09, 0xd2}}, + {0x0cc6, 64, { 0x12, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, - 0x86, 0xdf, 0xf7, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x08, 0xe5}}, - {0x0d06, 64, { 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, - 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, + 0x86, 0xdf, 0xf7, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, + 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05}}, + {0x0d06, 64, { 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, - 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, 0xaf}}, - {0x0d46, 64, { 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, - 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, + 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, 0xaf, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5}}, + {0x0d46, 64, { 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, - 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, 0x87}}, - {0x0d86, 64, { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd2, 0x19, 0x90, 0x7f, 0x92, 0xe0, 0x44, 0x02, 0xf0, 0x90, - 0x7f, 0xae, 0xe0, 0xff, 0xd3, 0x92, 0x10, 0xe4, 0x33, 0xfe, 0xef, 0x4e, 0xf0, 0xd2, 0xe8, 0x43, + 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, 0x87, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd2, 0x19, 0x90, 0x7f, 0x92, 0xe0, 0x44, 0x02, 0xf0}}, + {0x0d86, 64, { 0x90, 0x7f, 0xae, 0xe0, 0xff, 0xd3, 0x92, 0x10, 0xe4, 0x33, 0xfe, 0xef, 0x4e, 0xf0, 0xd2, 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xab, 0x74, - 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f}}, - {0x0dc6, 64, { 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x0d, 0xf0, 0xd2, 0xaf, 0xd2, 0x1a, 0x12, - 0x12, 0x6a, 0xc2, 0x11, 0xe4, 0xf5, 0x0b, 0xf5, 0x13, 0xc2, 0x17, 0xc2, 0x12, 0x90, 0x7f, 0xa1, + 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaf, + 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x0d, 0xf0, 0xd2, 0xaf, 0xd2, 0x1a}}, + {0x0dc6, 64, { 0x12, 0x12, 0x53, 0xc2, 0x11, 0xe4, 0xf5, 0x0b, 0xf5, 0x13, 0xc2, 0x17, 0xc2, 0x12, 0x90, 0x7f, 0xa1, 0x04, 0xf0, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x17, 0x60, 0x10, 0x30, 0x12, 0x05, 0xd2, 0x1a, 0x12, - 0x00, 0x46, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, 0x17, 0x80, 0x08, 0x30, 0x12, 0x05, 0xc2, 0x1a}}, - {0x0e06, 64, { 0x12, 0x00, 0x46, 0x30, 0x11, 0x07, 0xc2, 0x11, 0x12, 0x09, 0x29, 0x80, 0xd6, 0x30, 0x18, 0xd3, 0xc2, - 0x18, 0x12, 0x13, 0xa0, 0x80, 0xcc, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x47, - 0x02, 0x0e, 0x65, 0x02, 0x0d, 0x8d, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, - 0x80, 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8, 0x54, 0x07, 0x24}}, - {0x0e46, 64, { 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, 0x80, 0x01, - 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x12, - 0xd1, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, - 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0, 0x60, 0xa8, 0x40}}, - {0x0e86, 64, { 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, - 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde, + 0x00, 0x46, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, 0x17, 0x80, 0x08, 0x30, 0x12, 0x05, 0xc2, 0x1a, 0x12, + 0x00, 0x46, 0x30, 0x11, 0x07, 0xc2, 0x11, 0x12, 0x09, 0x21, 0x80, 0xd6, 0x30, 0x18, 0xd3}}, + {0x0e06, 64, { 0xc2, 0x18, 0x12, 0x13, 0x9f, 0x80, 0xcc, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x47, + 0x02, 0x0e, 0x55, 0x02, 0x0d, 0x7d, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, + 0x80, 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8, 0x54, 0x07, 0x24, 0x0c, + 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, 0x80}}, + {0x0e46, 64, { 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x12, + 0xba, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, + 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0, 0x60, 0xa8, 0x40, 0xb8, + 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8}}, + {0x0e86, 64, { 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, - 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x0c}}, - {0x0ec6, 64, { 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06, 0xe9, 0x25, 0x82, - 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5, 0x82, 0x29, 0xf5, + 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x0c, 0xe5, + 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06, 0xe9, 0x25}}, + {0x0ec6, 64, { 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, - 0xf0, 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22, 0xd0, 0x83, 0xd0, 0x82}}, - {0x0f06, 64, { 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01, 0x93, - 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, 0xa3, 0x80, + 0xf0, 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22, 0xd0, 0x83, 0xd0, 0x82, 0xf8, + 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01}}, + {0x0f06, 64, { 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, 0xa3, 0x80, 0xdf, 0x8f, 0x18, 0xe4, 0xf5, 0x19, 0x75, 0x1a, 0xff, 0x75, 0x1b, 0x19, 0x75, 0x1c, 0x86, 0xab, - 0x1a, 0xaa, 0x1b, 0xa9, 0x1c, 0x90, 0x00, 0x01, 0x12, 0x0e, 0xc3, 0xb4, 0x03, 0x1d, 0xaf}}, - {0x0f46, 64, { 0x19, 0x05, 0x19, 0xef, 0xb5, 0x18, 0x01, 0x22, 0x12, 0x0e, 0xaa, 0x7e, 0x00, 0x29, 0xff, 0xee, 0x3a, - 0xa9, 0x07, 0x75, 0x1a, 0xff, 0xf5, 0x1b, 0x89, 0x1c, 0x80, 0xd4, 0x7b, 0x00, 0x7a, 0x00, 0x79, + 0x1a, 0xaa, 0x1b, 0xa9, 0x1c, 0x90, 0x00, 0x01, 0x12, 0x0e, 0xb3, 0xb4, 0x03, 0x1d, 0xaf, 0x19, + 0x05, 0x19, 0xef, 0xb5, 0x18, 0x01, 0x22, 0x12, 0x0e, 0x9a, 0x7e, 0x00, 0x29, 0xff, 0xee}}, + {0x0f46, 64, { 0x3a, 0xa9, 0x07, 0x75, 0x1a, 0xff, 0xf5, 0x1b, 0x89, 0x1c, 0x80, 0xd4, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x00, 0x22, 0x8f, 0x1a, 0x05, 0x0d, 0xe5, 0x0d, 0xae, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, - 0x82, 0x8e, 0x83, 0xe5, 0x1a, 0xf0, 0x12, 0x00, 0x36, 0x05, 0x0d, 0xe5, 0x0d, 0xac, 0x0c}}, - {0x0f86, 64, { 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5, 0x08, 0x60, 0x0a, - 0x12, 0x13, 0x34, 0x8f, 0x1a, 0xef, 0x42, 0x36, 0x80, 0xca, 0x22, 0x8f, 0x1a, 0x05, 0x0d, 0xe5, + 0x82, 0x8e, 0x83, 0xe5, 0x1a, 0xf0, 0x12, 0x00, 0x36, 0x05, 0x0d, 0xe5, 0x0d, 0xac, 0x0c, 0x70, + 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5, 0x08, 0x60}}, + {0x0f86, 64, { 0x0a, 0x12, 0x13, 0x33, 0x8f, 0x1a, 0xef, 0x42, 0x36, 0x80, 0xca, 0x22, 0x8f, 0x1a, 0x05, 0x0d, 0xe5, 0x0d, 0xae, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x1a, 0xf0, 0x12, - 0x13, 0x4c, 0x05, 0x0d, 0xe5, 0x0d, 0xac, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82}}, - {0x0fc6, 64, { 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5, 0x08, 0x60, 0x0a, 0x12, 0x13, 0x88, 0x8f, 0x1a, 0xef, 0x42, - 0x37, 0x80, 0xca, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, - 0x75, 0x86, 0x00, 0x30, 0x15, 0x04, 0xc2, 0x15, 0x80, 0x02, 0xd2, 0x18, 0x53, 0x91, 0xef, 0x90, - 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83}}, - {0x1006, 64, { 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, - 0x00, 0x90, 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, - 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, - 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x11, 0x53, 0x91}}, - {0x1046, 64, { 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, - 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, - 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, - 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0}}, - {0x1086, 64, { 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, - 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, - 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, - 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54}}, - {0x10c6, 64, { 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, - 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, - 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, - 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, 0xc0}}, - {0x1106, 64, { 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, - 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, - 0x74, 0x0a, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, - 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0}}, - {0x1146, 64, { 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, - 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, - 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, - 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90}}, - {0x1186, 64, { 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, - 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, - 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, - 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, 0x00, 0xef}}, - {0x11c6, 64, { 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, - 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, - 0x74, 0x17, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90, 0xc0, - 0x00, 0xed, 0xf0, 0x22, 0x12, 0x13, 0x1c, 0x8f, 0x1a, 0x12, 0x13, 0x1c, 0x8f, 0x1b, 0xe5}}, - {0x1206, 64, { 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12, 0x13, 0x1c, 0x8f, 0x1a, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x07, 0x12, - 0x13, 0x1c, 0x8f, 0x1b, 0x80, 0xe8, 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, - 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0f, 0xf0, 0x90, 0xc0, 0x00, - 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12}}, - {0x1246, 64, { 0x13, 0x70, 0x8f, 0x1a, 0x12, 0x13, 0x70, 0x8f, 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12, 0x13, - 0x70, 0x8f, 0x1a, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x07, 0x12, 0x13, 0x70, 0x8f, 0x1b, 0x80, 0xe8, - 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x1a, - 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x12, 0xed, 0x90, 0x7f, 0xd6}}, - {0x1286, 64, { 0xe0, 0x54, 0xf7, 0xf0, 0xe0, 0x44, 0x04, 0xf0, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x3e, 0x54, 0x7f, - 0xfd, 0x12, 0x11, 0xd6, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, - 0xe5, 0x3e, 0x44, 0x80, 0xfd, 0x12, 0x11, 0xd6, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x3f, 0x54, - 0x7f, 0xfd, 0x12, 0x12, 0x20, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xee}}, - {0x12c6, 64, { 0xf0, 0xe4, 0xe5, 0x3f, 0x44, 0x80, 0xfd, 0x12, 0x12, 0x20, 0x22, 0x05, 0x0e, 0x02, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x14, 0x03, 0x00, 0x00, 0xc1, 0x11, 0xc1, 0x18, 0xc1, 0x95, 0xc1, 0x10, 0xc1, 0x16, - 0x01, 0x0a, 0x00, 0xc1, 0x9b, 0x00, 0x8e, 0x18, 0x8f, 0x19, 0xe5, 0x19, 0x15, 0x19, 0xae, 0x18, - 0x70, 0x02, 0x15, 0x18, 0x4e, 0x60, 0x05, 0x12, 0x0d, 0x6c, 0x80, 0xee, 0x22, 0x90, 0x7f}}, - {0x1306, 64, { 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, - 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, - 0x22, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, - 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0}}, - {0x1346, 64, { 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, - 0x22, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, - 0x74, 0x0a, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, - 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe0}}, - {0x1386, 64, { 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, - 0x74, 0x0e, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x12, 0x00, 0x03, 0x12, 0x0d, 0x7d, 0x12, - 0x0b, 0x4e, 0x22, 0x53, 0xd8, 0xef, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x13, 0x4b, 0x05, 0x0d, 0xe5, 0x0d, 0xac, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8c, + 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5, 0x08, 0x60, 0x0a, 0x12, 0x13, 0x87, 0x8f, 0x1a, 0xef}}, + {0x0fc6, 64, { 0x42, 0x37, 0x80, 0xca, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, + 0x75, 0x86, 0x00, 0x90, 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, + 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, + 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x11}}, + {0x1006, 64, { 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, + 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, + 0x86, 0x75, 0x86, 0x00, 0xd2, 0x18, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, + 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0x98}}, + {0x1046, 64, { 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, + 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, + 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0}}, + {0x1086, 64, { 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, + 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, + 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, + 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x14}}, + {0x10c6, 64, { 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, + 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, + 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, + 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b}}, + {0x1106, 64, { 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x90, 0xc0, 0x00, 0xef, + 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, + 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45}}, + {0x1146, 64, { 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, + 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, + 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90}}, + {0x1186, 64, { 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, + 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, + 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5}}, + {0x11c6, 64, { 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x17, 0xf0, 0x90, 0xc0, 0x00, 0xef, + 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, 0x13, 0x1b, + 0x8f, 0x1a, 0x12, 0x13, 0x1b, 0x8f, 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12, 0x13, 0x1b, + 0x8f, 0x1a, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x07, 0x12, 0x13, 0x1b, 0x8f, 0x1b, 0x80, 0xe8}}, + {0x1206, 64, { 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, + 0x90, 0x7f, 0x98, 0x74, 0x0f, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0d, + 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, 0x13, 0x6f, 0x8f, 0x1a, 0x12, 0x13, 0x6f, 0x8f, + 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12, 0x13, 0x6f, 0x8f, 0x1a, 0xe5, 0x1a, 0x65}}, + {0x1246, 64, { 0x1b, 0x60, 0x07, 0x12, 0x13, 0x6f, 0x8f, 0x1b, 0x80, 0xe8, 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0xd6, 0xe0, + 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x1a, 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, 0xf4, + 0x7e, 0x01, 0x12, 0x12, 0xd6, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0xe0, 0x44, 0x04, 0xf0, + 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x3e, 0x54, 0x7f, 0xfd, 0x12, 0x11, 0xbf, 0x90, 0x7f}}, + {0x1286, 64, { 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x3e, 0x44, 0x80, 0xfd, 0x12, 0x11, + 0xbf, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x3f, 0x54, 0x7f, 0xfd, 0x12, 0x12, 0x09, 0x90, 0x7f, + 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x3f, 0x44, 0x80, 0xfd, 0x12, + 0x12, 0x09, 0x22, 0x05, 0x0e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x14, 0x03, 0x00, 0x00}}, + {0x12c6, 64, { 0xc1, 0x11, 0xc1, 0x18, 0xc1, 0x95, 0xc1, 0x10, 0xc1, 0x16, 0x01, 0x0a, 0x00, 0xc1, 0x9b, 0x00, 0x8e, + 0x18, 0x8f, 0x19, 0xe5, 0x19, 0x15, 0x19, 0xae, 0x18, 0x70, 0x02, 0x15, 0x18, 0x4e, 0x60, 0x05, + 0x12, 0x0d, 0x5c, 0x80, 0xee, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xe0, + 0xff, 0x22, 0x53, 0xd8, 0xef, 0x32, 0x00, 0x00, 0x00, 0x02, 0x0f, 0xf5, 0x00, 0x02, 0x13}}, + {0x1306, 64, { 0x04, 0x00, 0x02, 0x0f, 0xcb, 0x00, 0x02, 0x10, 0x1c, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, 0xc0, + 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90}}, + {0x1346, 64, { 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x0a, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, + 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff}}, + {0x1386, 64, { 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x0e, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x12, 0x00, 0x03, 0x12, 0x0d, 0x6d, 0x12, 0x0b, + 0x46, 0x22, 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}}, {0x13c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x10, 0x33, 0x00, 0x02, 0x14}}, - {0x1406, 64, { 0x04, 0x00, 0x02, 0x10, 0x09, 0x00, 0x02, 0x0f, 0xdb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1406, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, @@ -424,13 +427,13 @@ {0x18c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x00, 0x01, 0xff, 0x00}}, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x10, 0x01, 0xff, 0x00}}, {0x1906, 64, { 0x00, 0x40, 0xcd, 0x06, 0x15, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x02, 0x09, 0x02, 0x74, 0x00, 0x01, 0x01, 0x00, 0xa0, 0x32, 0x09, 0x04, 0x00, 0x00, 0x0e, 0xff, 0x00, 0x00, 0x00, 0x07, 0x05, 0x01, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x02, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x03, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x04, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x05, 0x02, 0x40, 0x00}}, {0x1946, 64, { 0x00, 0x07, 0x05, 0x06, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x07, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, - 0x81, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x83, 0x02, + 0x81, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x82, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x83, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x84, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x85, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x86, 0x02, 0x40, 0x00, 0x01, 0x07, 0x05, 0x87, 0x02, 0x40, 0x00, 0x01}}, {0x1986, 64, { 0x04, 0x03, 0x09, 0x04, 0x48, 0x03, 0x4b, 0x00, 0x65, 0x00, 0x79, 0x00, 0x73, 0x00, 0x70, 0x00, 0x61, @@ -442,5 +445,5 @@ 0x00, 0x42, 0x00, 0x20, 0x00, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x41, 0x00, 0x64, 0x00, 0x61, 0x00, 0x70, 0x00, 0x74, 0x00, 0x65, 0x00}}, {0x1a06, 4, { 0x72, 0x00, 0x00, 0x00}}, - { 0xffff, 0, {0x00} } + {0xffff, 0, {0x00}} }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa28xb_fw.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa28xb_fw.h --- linux.20pre5/drivers/usb/serial/keyspan_usa28xb_fw.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa28xb_fw.h 2002-09-01 13:39:31.000000000 +0100 @@ -1,352 +1,353 @@ /* keyspan_usa28xb_fw.h - Generated from Keyspan firmware image usacode36.h Sat Oct 6 12:07:38 EST 2001 - This firmware is for the Keyspan USA-28XA Serial Adaptor + The firmware contained herein as keyspan_usa29xb_fw.h is - "The firmware contained herein as keyspan_usa28xb_fw.h is - Copyright (C) 1999-2001 Keyspan, A division of InnoSys Incorporated - ("Keyspan"), as an unpublished work. This notice does not imply - unrestricted or public access to the source code from which this - firmware image is derived. Except as noted below this firmware image - may not be reproduced, used, sold or transferred to any third party - without Keyspan's prior written consent. All Rights Reserved. + Copyright (C) 1999-2001 + Keyspan, A division of InnoSys Incorporated ("Keyspan") + + as an unpublished work. This notice does not imply unrestricted or + public access to the source code from which this firmware image is + derived. Except as noted below this firmware image may not be + reproduced, used, sold or transferred to any third party without + Keyspan's prior written consent. All Rights Reserved. - Permission is hereby granted for the distribution of this firmware image - as part of a Linux or other Open Source operating system kernel in - text or binary form as required. + Permission is hereby granted for the distribution of this firmware + image as part of a Linux or other Open Source operating system kernel + in text or binary form as required. - This firmware may not be modified and may only be used with the Keyspan - USA-28 Serial Adapter. Distribution and/or Modification of the - keyspan.c driver which includes this firmware, in whole or in part, - requires the inclusion of this statement." + This firmware may not be modified and may only be used with + Keyspan hardware. Distribution and/or Modification of the + keyspan.c driver which includes this firmware, in whole or in + part, requires the inclusion of this statement." */ static const struct ezusb_hex_record keyspan_usa28xb_firmware[] = { - {0x0033, 3, { 0x02, 0x13, 0xb7}}, - {0x0046, 16, { 0x30, 0x09, 0x18, 0x12, 0x13, 0x35, 0xef, 0xc3, 0x95, 0x3c, 0x40, 0x03, 0x02, 0x00, 0xd8, 0x90}}, + {0x0033, 3, { 0x02, 0x00, 0x2d}}, + {0x002d, 4, { 0x53, 0xd8, 0xef, 0x32}}, + {0x0046, 16, { 0x30, 0x09, 0x18, 0x12, 0x13, 0x33, 0xef, 0xc3, 0x95, 0x3c, 0x40, 0x03, 0x02, 0x00, 0xd8, 0x90}}, {0x0056, 16, { 0x7f, 0xbf, 0x74, 0x01, 0xf0, 0xc2, 0x09, 0xc2, 0x00, 0x80, 0x77, 0x30, 0x03, 0x3b, 0x90, 0x7f}}, - {0x0066, 16, { 0xc6, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x13, 0x35, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7e}}, + {0x0066, 16, { 0xc6, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x13, 0x33, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7e}}, {0x0076, 16, { 0x40, 0xe0, 0x13, 0x92, 0x09, 0x90, 0x7f, 0xc7, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60}}, - {0x0086, 16, { 0x0f, 0xf5, 0x08, 0x7e, 0x7e, 0x7f, 0x41, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x41, 0x12, 0x0c, 0xdc}}, + {0x0086, 16, { 0x0f, 0xf5, 0x08, 0x7e, 0x7e, 0x7f, 0x41, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x41, 0x12, 0x0c, 0xcc}}, {0x0096, 16, { 0xc2, 0x03, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0x80, 0x39, 0x90, 0x7f, 0xc8, 0xe0, 0x20, 0xe1, 0x32}}, - {0x00a6, 16, { 0x12, 0x13, 0x35, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x09}}, + {0x00a6, 16, { 0x12, 0x13, 0x33, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x09}}, {0x00b6, 16, { 0x90, 0x7f, 0xc9, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7d}}, - {0x00c6, 16, { 0x7f, 0xc1, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0xc1, 0x12, 0x0c, 0xdc, 0xd2, 0x03, 0xe4, 0x90, 0x7f}}, - {0x00d6, 16, { 0xc9, 0xf0, 0x90, 0x7f, 0xb6, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x01, 0x66, 0x53, 0x36, 0x80, 0x12}}, - {0x00e6, 16, { 0x13, 0x41, 0xef, 0x42, 0x36, 0x12, 0x12, 0x08, 0x8f, 0x19, 0xef, 0xc3, 0x95, 0x3a, 0x50, 0x0f}}, - {0x00f6, 16, { 0x12, 0x13, 0x1d, 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x36, 0x20, 0xe7, 0x03, 0x30, 0x0b, 0x61, 0xc2}}, + {0x00c6, 16, { 0x7f, 0xc1, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0xc1, 0x12, 0x0c, 0xcc, 0xd2, 0x03, 0xe4, 0x90, 0x7f}}, + {0x00d6, 16, { 0xc9, 0xf0, 0x90, 0x7f, 0xb6, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x01, 0x60, 0x12, 0x11, 0xf5, 0x8f}}, + {0x00e6, 16, { 0x19, 0x12, 0x13, 0x3f, 0x8f, 0x36, 0xe5, 0x19, 0xc3, 0x95, 0x3a, 0x50, 0x0f, 0x12, 0x13, 0x1b}}, + {0x00f6, 16, { 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x36, 0x20, 0xe7, 0x03, 0x30, 0x0b, 0x5e, 0xc2, 0x0b, 0xe5, 0x19}}, {0x0036, 12, { 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22}}, - {0x0043, 3, { 0x02, 0x14, 0x00}}, - {0x0003, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x30}}, - {0x0013, 16, { 0x15, 0x04, 0xc2, 0x15, 0x80, 0x02, 0xd2, 0x18, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08}}, - {0x0023, 14, { 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32}}, - {0x0000, 3, { 0x02, 0x0e, 0x22}}, - {0x0106, 64, { 0x0b, 0xe5, 0x19, 0x70, 0x04, 0xf5, 0x36, 0x80, 0x57, 0x12, 0x13, 0x41, 0xef, 0x42, 0x36, 0xe5, 0x36, - 0x30, 0xe7, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, - 0x7e, 0x7e, 0x7f, 0x80, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x80, 0xaf, 0x36, 0x12, 0x0f, 0x6d, 0xe5, - 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xb7, 0xf0, 0x80, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40}}, - {0x0146, 64, { 0x03, 0x75, 0x19, 0x3f, 0x85, 0x19, 0x08, 0xe4, 0x90, 0x7e, 0x80, 0xf0, 0x7e, 0x7e, 0x7f, 0x81, 0x75, - 0x0c, 0x7e, 0x75, 0x0d, 0x81, 0x12, 0x0d, 0x01, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xb7, 0xf0, 0x90, - 0x7f, 0xce, 0xe0, 0x30, 0xe1, 0x06, 0x20, 0x05, 0x03, 0x02, 0x03, 0xc5, 0xe4, 0xf5, 0x18, 0x74, - 0x40, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, 0x7c}}, - {0x0186, 64, { 0x00, 0x7b, 0x01, 0x7a, 0x7e, 0x79, 0x00, 0x24, 0x00, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, 0x12, 0x0e, - 0xf4, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x00, 0xe0, 0x60, 0x68, 0x90, 0x7e, - 0x03, 0xe0, 0x60, 0x24, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x11, 0xe3, 0x7f, 0x03, 0x7d, 0xcd, 0x12, - 0x11, 0xe3, 0x43, 0x46, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5}}, - {0x01c6, 64, { 0x46, 0xf0, 0xe4, 0x90, 0x7e, 0x13, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x01, 0xe0, 0xff, 0x12, 0x10, 0x67, - 0x90, 0x7e, 0x02, 0xe0, 0xff, 0x12, 0x10, 0x8d, 0x7f, 0x01, 0x90, 0x7e, 0x11, 0xe0, 0xfd, 0x12, - 0x11, 0xe3, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xe3, 0x43, 0x46, 0x80, 0x90, 0x7f, 0x98, 0x74, - 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5}}, - {0x0206, 64, { 0x40, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x03, 0xe0, 0x70, 0x06, 0x90, 0x7e, 0x13, 0xe0, - 0x70, 0x08, 0xe4, 0x90, 0x7e, 0x13, 0xf0, 0x75, 0x25, 0xff, 0x90, 0x7e, 0x05, 0xe0, 0x60, 0x12, - 0xa3, 0xe0, 0x54, 0x3f, 0xf5, 0x44, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe5, - 0x44, 0xf0, 0x90, 0x7e, 0x07, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x42, 0x80}}, - {0x0246, 64, { 0x80, 0x03, 0x53, 0x42, 0x7f, 0x53, 0x42, 0xfc, 0x90, 0x7e, 0x09, 0xe0, 0x60, 0x11, 0x43, 0x42, 0x02, - 0xa3, 0xe0, 0xff, 0x12, 0x10, 0xd9, 0x90, 0x7e, 0x0b, 0xe0, 0xff, 0x12, 0x10, 0xff, 0xaf, 0x42, - 0x12, 0x10, 0xb3, 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x08, 0x53, 0x42, 0x7f, 0xaf, 0x42, 0x12, 0x10, - 0xb3, 0x90, 0x7e, 0x0c, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x02, 0x80}}, - {0x0286, 64, { 0x03, 0x53, 0x46, 0xfd, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, - 0x7e, 0x0e, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x01, 0x80, 0x03, 0x53, 0x46, - 0xfe, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x12, - 0xe0, 0xf5, 0x3a, 0xa3, 0xe0, 0x13, 0x92, 0x0d, 0xa3, 0xe0, 0xf5, 0x3c, 0xa3, 0xe0, 0x60}}, - {0x02c6, 64, { 0x05, 0x43, 0x46, 0x10, 0x80, 0x03, 0x53, 0x46, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, - 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x16, 0xe0, 0x60, 0x32, 0x53, 0x44, 0xbf, 0x90, 0x7f, 0x98, - 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, - 0xf0, 0x12, 0x13, 0x11, 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3e, 0xfd, 0xe4}}, - {0x0306, 64, { 0xff, 0xad, 0x3e, 0x12, 0x11, 0xe3, 0xe4, 0xf5, 0x2a, 0xf5, 0x29, 0xd2, 0x07, 0x90, 0x7e, 0x17, 0xe0, - 0x60, 0x0f, 0x43, 0x3e, 0x02, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xe3, 0x75, 0x29, 0x01, 0xd2, - 0x07, 0x90, 0x7e, 0x18, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, - 0x04, 0x90, 0xc0, 0x00, 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x19, 0xe0, 0x60, 0x11, 0x43, 0x44}}, - {0x0346, 64, { 0x40, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, - 0x1a, 0xe0, 0x60, 0x0f, 0x53, 0x3e, 0xfe, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xe3, 0x75, 0x2b, - 0x01, 0xd2, 0x07, 0x90, 0x7e, 0x1b, 0xe0, 0x60, 0x0f, 0x43, 0x3e, 0x01, 0xe4, 0xff, 0xad, 0x3e, - 0x12, 0x11, 0xe3, 0xe4, 0xf5, 0x2b, 0xd2, 0x07, 0x90, 0x7e, 0x1c, 0xe0, 0x60, 0x0e, 0x90}}, - {0x0386, 64, { 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x1d, 0xe0, - 0x60, 0x02, 0xd2, 0x0b, 0x90, 0x7e, 0x1e, 0xe0, 0x60, 0x08, 0x75, 0x2c, 0x01, 0xe4, 0xf5, 0x38, - 0xd2, 0x07, 0x90, 0x7e, 0x1f, 0xe0, 0x60, 0x0f, 0x90, 0x7f, 0xd7, 0x74, 0x11, 0xf0, 0x74, 0x31, - 0xf0, 0x74, 0x15, 0xf0, 0x74, 0x35, 0xf0, 0xc2, 0x05, 0xe4, 0x90, 0x7f, 0xcf, 0xf0, 0x30}}, - {0x03c6, 64, { 0x1a, 0x54, 0xe5, 0x38, 0x60, 0x02, 0x15, 0x38, 0x20, 0x13, 0x4b, 0xe5, 0x13, 0xd3, 0x94, 0x00, 0x40, - 0x04, 0x15, 0x13, 0x80, 0x40, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xd2, 0x13, 0x12, 0x13, 0x11, - 0xef, 0x54, 0x01, 0xf5, 0x19, 0x65, 0x2a, 0x60, 0x05, 0x85, 0x19, 0x2a, 0xd2, 0x07, 0x12, 0x13, - 0x4d, 0xef, 0x54, 0x80, 0x64, 0x80, 0xf5, 0x19, 0x65, 0x26, 0x60, 0x05, 0x85, 0x19, 0x26}}, - {0x0406, 64, { 0xd2, 0x07, 0x30, 0x0d, 0x11, 0x12, 0x13, 0x4d, 0xef, 0x54, 0x10, 0xf5, 0x19, 0x65, 0x25, 0x60, 0x05, - 0x85, 0x19, 0x25, 0xd2, 0x07, 0x20, 0x1b, 0x03, 0x02, 0x07, 0xf8, 0x30, 0x0a, 0x18, 0x12, 0x13, - 0x89, 0xef, 0xc3, 0x95, 0x3d, 0x40, 0x03, 0x02, 0x04, 0xb4, 0x90, 0x7f, 0xc1, 0x74, 0x01, 0xf0, - 0xc2, 0x0a, 0xc2, 0x00, 0x80, 0x77, 0x30, 0x04, 0x3b, 0x90, 0x7f, 0xca, 0xe0, 0x20, 0xe1}}, - {0x0446, 64, { 0x6d, 0x12, 0x13, 0x89, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7d, 0x40, 0xe0, 0x13, 0x92, 0x0a, - 0x90, 0x7f, 0xcb, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7d, - 0x7f, 0x41, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x41, 0x12, 0x0d, 0x26, 0xc2, 0x04, 0xe4, 0x90, 0x7f, - 0xcb, 0xf0, 0x80, 0x39, 0x90, 0x7f, 0xcc, 0xe0, 0x20, 0xe1, 0x32, 0x12, 0x13, 0x89, 0xef}}, - {0x0486, 64, { 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90, 0x7c, 0xc0, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, 0xcd, 0xe0, 0x14, - 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7c, 0x7f, 0xc1, 0x75, 0x0c, 0x7c, - 0x75, 0x0d, 0xc1, 0x12, 0x0d, 0x26, 0xd2, 0x04, 0xe4, 0x90, 0x7f, 0xcd, 0xf0, 0x90, 0x7f, 0xba, - 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x05, 0x42, 0x53, 0x37, 0x80, 0x12, 0x13, 0x95, 0xef, 0x42}}, - {0x04c6, 64, { 0x37, 0x12, 0x12, 0x52, 0x8f, 0x19, 0xef, 0xc3, 0x95, 0x3b, 0x50, 0x0f, 0x12, 0x13, 0x71, 0xef, 0x30, - 0xe0, 0x08, 0xe5, 0x37, 0x20, 0xe7, 0x03, 0x30, 0x0c, 0x61, 0xc2, 0x0c, 0xe5, 0x19, 0x70, 0x04, - 0xf5, 0x37, 0x80, 0x57, 0x12, 0x13, 0x95, 0xef, 0x42, 0x37, 0xe5, 0x37, 0x30, 0xe7, 0x26, 0xe5, - 0x19, 0xd3, 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, 0x7e, 0x7d, 0x7f}}, - {0x0506, 64, { 0x80, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x80, 0xaf, 0x37, 0x12, 0x0f, 0xa6, 0xe5, 0x19, 0x25, 0xe0, 0x90, - 0x7f, 0xbb, 0xf0, 0x80, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, 0x19, 0x3f, 0x85, - 0x19, 0x08, 0xe4, 0x90, 0x7d, 0x80, 0xf0, 0x7e, 0x7d, 0x7f, 0x81, 0x75, 0x0c, 0x7d, 0x75, 0x0d, - 0x81, 0x12, 0x0d, 0x4b, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xbb, 0xf0, 0x90, 0x7f, 0xd0, 0xe0}}, - {0x0546, 64, { 0x30, 0xe1, 0x06, 0x20, 0x06, 0x03, 0x02, 0x07, 0xa1, 0xe4, 0xf5, 0x18, 0x74, 0xc0, 0x25, 0x18, 0xf5, - 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, - 0x79, 0x20, 0x24, 0x20, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, 0x12, 0x0e, 0xf4, 0x05, 0x18, 0xe5, - 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x20, 0xe0, 0x60, 0x68, 0x90, 0x7e, 0x23, 0xe0, 0x60}}, - {0x0586, 64, { 0x24, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x12, 0x2d, 0x7f, 0x03, 0x7d, 0xcd, 0x12, 0x12, 0x2d, 0x43, 0x47, - 0x80, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0xe4, 0x90, 0x7e, - 0x33, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x21, 0xe0, 0xff, 0x12, 0x11, 0x4b, 0x90, 0x7e, 0x22, 0xe0, - 0xff, 0x12, 0x11, 0x71, 0x7f, 0x01, 0x90, 0x7e, 0x31, 0xe0, 0xfd, 0x12, 0x12, 0x2d, 0x7f}}, - {0x05c6, 64, { 0x03, 0x7d, 0x07, 0x12, 0x12, 0x2d, 0x43, 0x47, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, - 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0xe5, 0x41, 0x44, 0x06, 0x90, 0xc0, - 0x00, 0xf0, 0x90, 0x7e, 0x23, 0xe0, 0x70, 0x06, 0x90, 0x7e, 0x33, 0xe0, 0x70, 0x08, 0xe4, 0x90, - 0x7e, 0x33, 0xf0, 0x75, 0x2e, 0xff, 0x90, 0x7e, 0x25, 0xe0, 0x60, 0x12, 0xa3, 0xe0, 0x54}}, - {0x0606, 64, { 0x3f, 0xf5, 0x45, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x45, 0xf0, 0x90, 0x7e, - 0x27, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x43, 0x80, 0x80, 0x03, 0x53, 0x43, 0x7f, - 0x53, 0x43, 0xfc, 0x90, 0x7e, 0x29, 0xe0, 0x60, 0x11, 0x43, 0x43, 0x02, 0xa3, 0xe0, 0xff, 0x12, - 0x11, 0x97, 0x90, 0x7e, 0x2b, 0xe0, 0xff, 0x12, 0x11, 0xbd, 0xaf, 0x43, 0x12, 0x11, 0x25}}, - {0x0646, 64, { 0x90, 0x7e, 0x23, 0xe0, 0x60, 0x08, 0x53, 0x43, 0x7f, 0xaf, 0x43, 0x12, 0x11, 0x25, 0x90, 0x7e, 0x2c, - 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x02, 0x80, 0x03, 0x53, 0x47, 0xfd, 0x90, - 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7e, 0x2e, 0xe0, 0x60, - 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x01, 0x80, 0x03, 0x53, 0x47, 0xfe, 0x90, 0x7f}}, - {0x0686, 64, { 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7e, 0x32, 0xe0, 0xf5, 0x3b, 0xa3, - 0xe0, 0x13, 0x92, 0x0e, 0xa3, 0xe0, 0xf5, 0x3d, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x10, 0x80, - 0x03, 0x53, 0x47, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, - 0x90, 0x7e, 0x36, 0xe0, 0x60, 0x32, 0x53, 0x45, 0xbf, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0}}, - {0x06c6, 64, { 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x12, 0x13, 0x65, - 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3f, 0xfd, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, - 0x2d, 0xe4, 0xf5, 0x33, 0xf5, 0x32, 0xd2, 0x08, 0x90, 0x7e, 0x37, 0xe0, 0x60, 0x0f, 0x43, 0x3f, - 0x02, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x2d, 0x75, 0x32, 0x01, 0xd2, 0x08, 0x90, 0x7e}}, - {0x0706, 64, { 0x38, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0xe5, 0x41, 0x44, 0x04, 0x90, 0xc0, 0x00, - 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x39, 0xe0, 0x60, 0x11, 0x43, 0x45, 0x40, 0x90, 0x7f, 0x98, 0x74, - 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x3a, 0xe0, 0x60, 0x0f, - 0x53, 0x3f, 0xfe, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x2d, 0x75, 0x34, 0x01, 0xd2, 0x08}}, - {0x0746, 64, { 0x90, 0x7e, 0x3b, 0xe0, 0x60, 0x0f, 0x43, 0x3f, 0x01, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x2d, 0xe4, - 0xf5, 0x34, 0xd2, 0x08, 0x90, 0x7e, 0x3c, 0xe0, 0x60, 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, - 0xe5, 0x41, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x3d, 0xe0, 0x60, 0x02, 0xd2, 0x0c, - 0x90, 0x7e, 0x3e, 0xe0, 0x60, 0x08, 0x75, 0x35, 0x01, 0xe4, 0xf5, 0x39, 0xd2, 0x08, 0x90}}, - {0x0786, 64, { 0x7e, 0x3f, 0xe0, 0x60, 0x0f, 0x90, 0x7f, 0xd7, 0x74, 0x13, 0xf0, 0x74, 0x33, 0xf0, 0x74, 0x16, 0xf0, - 0x74, 0x36, 0xf0, 0xc2, 0x06, 0xe4, 0x90, 0x7f, 0xd1, 0xf0, 0x30, 0x1a, 0x54, 0xe5, 0x39, 0x60, - 0x02, 0x15, 0x39, 0x30, 0x13, 0x4b, 0xe5, 0x13, 0xd3, 0x94, 0x00, 0x40, 0x04, 0x15, 0x13, 0x80, - 0x40, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xc2, 0x13, 0x12, 0x13, 0x65, 0xef, 0x54, 0x01}}, - {0x07c6, 64, { 0xf5, 0x19, 0x65, 0x33, 0x60, 0x05, 0x85, 0x19, 0x33, 0xd2, 0x08, 0x12, 0x13, 0xa1, 0xef, 0x54, 0x80, - 0x64, 0x80, 0xf5, 0x19, 0x65, 0x2f, 0x60, 0x05, 0x85, 0x19, 0x2f, 0xd2, 0x08, 0x30, 0x0e, 0x11, - 0x12, 0x13, 0xa1, 0xef, 0x54, 0x10, 0xf5, 0x19, 0x65, 0x2e, 0x60, 0x05, 0x85, 0x19, 0x2e, 0xd2, - 0x08, 0x30, 0x1a, 0x2a, 0x90, 0x7f, 0xd2, 0xe0, 0x20, 0xe1, 0x23, 0x90, 0x7b, 0x40, 0xe0}}, - {0x0806, 64, { 0x60, 0x09, 0xe0, 0xf5, 0x15, 0x90, 0x7b, 0x42, 0xe0, 0xf5, 0x16, 0x90, 0x7b, 0x41, 0xe0, 0x60, 0x09, - 0x90, 0x7f, 0xd7, 0x74, 0x17, 0xf0, 0x74, 0x37, 0xf0, 0xe4, 0x90, 0x7f, 0xd3, 0xf0, 0x90, 0x7f, - 0xc2, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x09, 0x2c, 0xe5, 0x0a, 0x70, 0x40, 0x30, 0x07, 0x39, 0xe5, - 0x38, 0x70, 0x35, 0xc2, 0x07, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x18}}, - {0x0846, 64, { 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0xae, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, - 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, 0x90, 0x7f, 0xc3, 0x74, - 0x09, 0xf0, 0x75, 0x38, 0x10, 0xe4, 0xf5, 0x2c, 0x75, 0x0a, 0x01, 0x22, 0xe5, 0x0a, 0x64, 0x01, - 0x70, 0x40, 0x30, 0x08, 0x39, 0xe5, 0x39, 0x70, 0x35, 0xc2, 0x08, 0xf5, 0x18, 0x7e, 0x00}}, - {0x0886, 64, { 0x7b, 0x00, 0x74, 0x2d, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0xae, 0xff, 0x74, 0x80, - 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, - 0x09, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x39, 0x10, 0xe4, 0xf5, 0x35, 0x75, 0x0a, - 0x02, 0x22, 0xe5, 0x0a, 0x64, 0x02, 0x70, 0x36, 0x30, 0x14, 0x2f, 0xc2, 0x14, 0xf5, 0x18}}, - {0x08c6, 64, { 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x0e, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0xae, 0xff, - 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, - 0x18, 0xb4, 0x05, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x05, 0xf0, 0x75, 0x0a, 0x03, 0x22, 0xe5, 0x15, - 0x60, 0x30, 0x15, 0x15, 0xe4, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x14, 0x25, 0x18}}, - {0x0906, 64, { 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0xae, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, - 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x03, 0xdb, 0x90, 0x7f, 0xc3, 0x74, - 0x03, 0xf0, 0xe4, 0xf5, 0x0a, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x0f, 0x06, 0x0a, 0x14, 0x00, - 0x0a, 0x88, 0x01, 0x0a, 0xf4, 0x03, 0x09, 0x50, 0x06, 0x0a, 0x07, 0x08, 0x0a, 0x01, 0x09}}, - {0x0946, 64, { 0x09, 0xe9, 0x0a, 0x09, 0xf8, 0x0b, 0x00, 0x00, 0x0b, 0x43, 0x90, 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, - 0x19, 0x14, 0x60, 0x61, 0x24, 0x02, 0x60, 0x03, 0x02, 0x09, 0xdf, 0x74, 0x19, 0x90, 0x7f, 0xd4, - 0xf0, 0x74, 0x00, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x04, - 0x7f, 0x02, 0x80, 0x02, 0x7f, 0x03, 0x75, 0x82, 0x82, 0x75, 0x83, 0x19, 0xef, 0xf0, 0x75}}, - {0x0986, 64, { 0x82, 0x7b, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x74, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x66, 0x75, - 0x83, 0x19, 0xf0, 0x75, 0x82, 0x58, 0x75, 0x83, 0x19, 0xf0, 0x90, 0x7f, 0xea, 0xe0, 0x04, 0x75, - 0x82, 0x17, 0x75, 0x83, 0x19, 0xf0, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x12, 0x90, 0x7f, - 0xd5, 0xf0, 0x02, 0x0b, 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x0f, 0x2c, 0xea, 0x49}}, - {0x09c6, 64, { 0x60, 0x0d, 0xea, 0x90, 0x7f, 0xd4, 0xf0, 0xe9, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x4a, 0x90, 0x7f, - 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x4a, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, - 0x0b, 0x4a, 0x90, 0x7f, 0x00, 0xe5, 0x09, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x0b, - 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x09, 0x02, 0x0b, 0x4a, 0x12, 0x0b, 0x52, 0x02, 0x0b}}, - {0x0a06, 64, { 0x4a, 0x90, 0x7f, 0x00, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xb5, 0xf0, 0x02, 0x0b, 0x4a, 0x90, 0x7f, 0xe8, - 0xe0, 0x24, 0x7f, 0x60, 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, 0xa2, 0x10, 0xe4, 0x33, - 0xff, 0x25, 0xe0, 0xff, 0xa2, 0x16, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, - 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x4a, 0xe4, 0x90, 0x7f, 0x00, 0xf0, 0xa3}}, - {0x0a46, 64, { 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x4a, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, - 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, - 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, - 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x4a, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02}}, - {0x0a86, 64, { 0x0b, 0x4a, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24, 0x02, 0x60, 0x03, 0x02, 0x0b, 0x4a, - 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x05, 0xc2, 0x10, 0x02, 0x0b, 0x4a, 0x90, 0x7f, 0xb4, 0xe0, - 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x38, 0x90, 0x7f, 0xec, 0xe0, - 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24}}, - {0x0ac6, 64, { 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f, 0xec, 0xe0, 0x54, 0x80, 0xff, - 0x13, 0x13, 0x13, 0x54, 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f, 0xd7, 0xf0, 0xe0, 0x44, - 0x20, 0xf0, 0x80, 0x5f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x56, 0x90, 0x7f, 0xe8, - 0xe0, 0x24, 0xfe, 0x60, 0x18, 0x24, 0x02, 0x70, 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01}}, - {0x0b06, 64, { 0x04, 0xd2, 0x10, 0x80, 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x36, 0x90, 0x7f, 0xea, - 0xe0, 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, - 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, - 0xf0, 0x80, 0x10, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0xb4}}, - {0x0b46, 64, { 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, - 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0, 0x90, 0x7f, 0x95, 0x74, 0xc0, - 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x3f, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x18, 0xf0, 0xe4, 0xf5, 0x8e, - 0x90, 0x7f, 0xdf, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xde, 0xf0, 0xe4, 0xf5, 0x24, 0x75, 0x18}}, - {0x0b86, 64, { 0x01, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa, 0xe4, 0x12, 0x0e, 0xf4, 0x05, - 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xea, 0x75, 0x3a, 0x01, 0xe4, 0xf5, 0x38, 0xf5, 0x13, 0xf5, 0x36, - 0xc2, 0x07, 0xc2, 0x0b, 0xc2, 0x05, 0xc2, 0x00, 0xc2, 0x09, 0xc2, 0x13, 0xd2, 0x03, 0xd2, 0x01, - 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x75, 0x44, 0x03, 0x90, 0xc0, 0x00, 0x74, 0x03, 0xf0}}, - {0x0bc6, 64, { 0x7f, 0x0c, 0xe4, 0xfd, 0x12, 0x11, 0xe3, 0x7f, 0x10, 0x8f, 0x42, 0x12, 0x10, 0xb3, 0x90, 0x7f, 0x98, - 0x74, 0x12, 0xf0, 0x7f, 0x01, 0x8f, 0x40, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, - 0x98, 0x74, 0x14, 0xf0, 0x75, 0x46, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0x0f, 0xe4, 0xfd, - 0x12, 0x11, 0xe3, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3e, 0x12, 0x11, 0xe3, 0x90}}, - {0x0c06, 64, { 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x11, 0xe3, - 0x7f, 0x01, 0x12, 0x12, 0x9c, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xe3, 0x7f, 0x13, 0x7d, 0x09, - 0x12, 0x11, 0xe3, 0x20, 0x1b, 0x03, 0x02, 0x0c, 0xd9, 0x75, 0x2d, 0x01, 0x75, 0x18, 0x01, 0x7b, - 0x00, 0x74, 0x2d, 0x25, 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa, 0xe4, 0x12, 0x0e, 0xf4, 0x05}}, - {0x0c46, 64, { 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xea, 0x75, 0x3b, 0x01, 0xe4, 0xf5, 0x39, 0xf5, 0x13, 0xf5, 0x37, 0xc2, - 0x08, 0xc2, 0x0c, 0xc2, 0x06, 0xc2, 0x00, 0xc2, 0x0a, 0xc2, 0x13, 0xd2, 0x04, 0xd2, 0x02, 0x90, + {0x0043, 3, { 0x02, 0x13, 0x00}}, + {0x0003, 16, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90}}, + {0x0013, 16, { 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0}}, + {0x0023, 10, { 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32}}, + {0x0000, 3, { 0x02, 0x0e, 0x12}}, + {0x0106, 64, { 0x60, 0x58, 0xb4, 0x80, 0x03, 0x43, 0x36, 0x02, 0xe5, 0x36, 0x30, 0xe7, 0x26, 0xe5, 0x19, 0xd3, 0x94, + 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, 0x7e, 0x7e, 0x7f, 0x80, 0x75, 0x0c, 0x7e, + 0x75, 0x0d, 0x80, 0xaf, 0x36, 0x12, 0x0f, 0x5d, 0xe5, 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xb7, 0xf0, + 0x80, 0x27, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, 0x19, 0x3f, 0x85, 0x19, 0x08}}, + {0x0146, 64, { 0x90, 0x7e, 0x80, 0xe5, 0x36, 0xf0, 0x7e, 0x7e, 0x7f, 0x81, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x81, 0x12, + 0x0c, 0xf1, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xb7, 0xf0, 0x90, 0x7f, 0xce, 0xe0, 0x30, 0xe1, 0x06, + 0x20, 0x05, 0x03, 0x02, 0x03, 0xc1, 0xe4, 0xf5, 0x18, 0x74, 0x40, 0x25, 0x18, 0xf5, 0x82, 0xe4, + 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, 0x79}}, + {0x0186, 64, { 0x00, 0x24, 0x00, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, 0x12, 0x0e, 0xe4, 0x05, 0x18, 0xe5, 0x18, 0xb4, + 0x20, 0xd7, 0x90, 0x7e, 0x00, 0xe0, 0x60, 0x68, 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x24, 0x7f, 0x01, + 0xe4, 0xfd, 0x12, 0x11, 0xd0, 0x7f, 0x03, 0x7d, 0xcd, 0x12, 0x11, 0xd0, 0x43, 0x46, 0x80, 0x90, + 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0xe4, 0x90, 0x7e, 0x13}}, + {0x01c6, 64, { 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x01, 0xe0, 0xff, 0x12, 0x10, 0x54, 0x90, 0x7e, 0x02, 0xe0, 0xff, 0x12, + 0x10, 0x7a, 0x7f, 0x01, 0x90, 0x7e, 0x11, 0xe0, 0xfd, 0x12, 0x11, 0xd0, 0x7f, 0x03, 0x7d, 0x07, + 0x12, 0x11, 0xd0, 0x43, 0x46, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, + 0x46, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, 0x06, 0x90, 0xc0, 0x00}}, + {0x0206, 64, { 0xf0, 0x90, 0x7e, 0x03, 0xe0, 0x70, 0x06, 0x90, 0x7e, 0x13, 0xe0, 0x70, 0x08, 0xe4, 0x90, 0x7e, 0x13, + 0xf0, 0x75, 0x25, 0xff, 0x90, 0x7e, 0x05, 0xe0, 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, 0xf5, 0x44, + 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x44, 0xf0, 0x90, 0x7e, 0x07, 0xe0, + 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x42, 0x80, 0x80, 0x03, 0x53, 0x42, 0x7f, 0x53}}, + {0x0246, 64, { 0x42, 0xfc, 0x90, 0x7e, 0x09, 0xe0, 0x60, 0x11, 0x43, 0x42, 0x02, 0xa3, 0xe0, 0xff, 0x12, 0x10, 0xc6, + 0x90, 0x7e, 0x0b, 0xe0, 0xff, 0x12, 0x10, 0xec, 0xaf, 0x42, 0x12, 0x10, 0xa0, 0x90, 0x7e, 0x03, + 0xe0, 0x60, 0x08, 0x53, 0x42, 0x7f, 0xaf, 0x42, 0x12, 0x10, 0xa0, 0x90, 0x7e, 0x0c, 0xe0, 0x60, + 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x02, 0x80, 0x03, 0x53, 0x46, 0xfd, 0x90, 0x7f}}, + {0x0286, 64, { 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x0e, 0xe0, 0x60, 0x18, 0xa3, + 0xe0, 0x60, 0x05, 0x43, 0x46, 0x01, 0x80, 0x03, 0x53, 0x46, 0xfe, 0x90, 0x7f, 0x98, 0x74, 0x14, + 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x12, 0xe0, 0xf5, 0x3a, 0xa3, 0xe0, 0x13, + 0x92, 0x0d, 0xa3, 0xe0, 0xf5, 0x3c, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x10, 0x80, 0x03}}, + {0x02c6, 64, { 0x53, 0x46, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, + 0x16, 0xe0, 0x60, 0x32, 0x53, 0x44, 0xbf, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, + 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x12, 0x13, 0x0f, 0xef, 0x54, + 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3e, 0xfd, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xd0}}, + {0x0306, 64, { 0xe4, 0xf5, 0x2a, 0xf5, 0x29, 0xd2, 0x07, 0x90, 0x7e, 0x17, 0xe0, 0x60, 0x0f, 0x43, 0x3e, 0x02, 0xe4, + 0xff, 0xad, 0x3e, 0x12, 0x11, 0xd0, 0x75, 0x29, 0x01, 0xd2, 0x07, 0x90, 0x7e, 0x18, 0xe0, 0x60, + 0x10, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, 0x04, 0x90, 0xc0, 0x00, 0xf0, 0xd2, + 0x00, 0x90, 0x7e, 0x19, 0xe0, 0x60, 0x11, 0x43, 0x44, 0x40, 0x90, 0x7f, 0x98, 0x74, 0x13}}, + {0x0346, 64, { 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x1a, 0xe0, 0x60, 0x0f, 0x53, 0x3e, + 0xfe, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xd0, 0x75, 0x2b, 0x01, 0xd2, 0x07, 0x90, 0x7e, 0x1b, + 0xe0, 0x60, 0x0f, 0x43, 0x3e, 0x01, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xd0, 0xe4, 0xf5, 0x2b, + 0xd2, 0x07, 0x90, 0x7e, 0x1c, 0xe0, 0x60, 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5}}, + {0x0386, 64, { 0x40, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x1d, 0xe0, 0x60, 0x02, 0xd2, 0x0b, 0x90, 0x7e, + 0x1e, 0xe0, 0x60, 0x08, 0x75, 0x2c, 0x01, 0xe4, 0xf5, 0x38, 0xd2, 0x07, 0x90, 0x7e, 0x1f, 0xe0, + 0x60, 0x11, 0x90, 0x7f, 0xd7, 0x74, 0x11, 0xf0, 0x74, 0x31, 0xf0, 0x74, 0x15, 0xf0, 0x74, 0x35, + 0xf0, 0xd2, 0x03, 0xc2, 0x05, 0xe4, 0x90, 0x7f, 0xcf, 0xf0, 0x30, 0x1a, 0x54, 0xe5, 0x38}}, + {0x03c6, 64, { 0x60, 0x02, 0x15, 0x38, 0x20, 0x13, 0x4b, 0xe5, 0x13, 0xd3, 0x94, 0x00, 0x40, 0x04, 0x15, 0x13, 0x80, + 0x40, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xd2, 0x13, 0x12, 0x13, 0x0f, 0xef, 0x54, 0x01, 0xf5, + 0x19, 0x65, 0x2a, 0x60, 0x05, 0x85, 0x19, 0x2a, 0xd2, 0x07, 0x12, 0x13, 0x4b, 0xef, 0x54, 0x80, + 0x64, 0x80, 0xf5, 0x19, 0x65, 0x26, 0x60, 0x05, 0x85, 0x19, 0x26, 0xd2, 0x07, 0x30, 0x0d}}, + {0x0406, 64, { 0x11, 0x12, 0x13, 0x4b, 0xef, 0x54, 0x10, 0xf5, 0x19, 0x65, 0x25, 0x60, 0x05, 0x85, 0x19, 0x25, 0xd2, + 0x07, 0x20, 0x1b, 0x03, 0x02, 0x07, 0xf0, 0x30, 0x0a, 0x18, 0x12, 0x13, 0x87, 0xef, 0xc3, 0x95, + 0x3d, 0x40, 0x03, 0x02, 0x04, 0xb0, 0x90, 0x7f, 0xc1, 0x74, 0x01, 0xf0, 0xc2, 0x0a, 0xc2, 0x00, + 0x80, 0x77, 0x30, 0x04, 0x3b, 0x90, 0x7f, 0xca, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x13, 0x87}}, + {0x0446, 64, { 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7d, 0x40, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, 0xcb, 0xe0, + 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7d, 0x7f, 0x41, 0x75, 0x0c, + 0x7d, 0x75, 0x0d, 0x41, 0x12, 0x0d, 0x16, 0xc2, 0x04, 0xe4, 0x90, 0x7f, 0xcb, 0xf0, 0x80, 0x39, + 0x90, 0x7f, 0xcc, 0xe0, 0x20, 0xe1, 0x32, 0x12, 0x13, 0x87, 0xef, 0xc3, 0x94, 0x40, 0x50}}, + {0x0486, 64, { 0x29, 0x90, 0x7c, 0xc0, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, 0xcd, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, + 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7c, 0x7f, 0xc1, 0x75, 0x0c, 0x7c, 0x75, 0x0d, 0xc1, 0x12, + 0x0d, 0x16, 0xd2, 0x04, 0xe4, 0x90, 0x7f, 0xcd, 0xf0, 0x90, 0x7f, 0xba, 0xe0, 0x30, 0xe1, 0x03, + 0x02, 0x05, 0x38, 0x12, 0x12, 0x3f, 0x8f, 0x19, 0x12, 0x13, 0x93, 0x8f, 0x37, 0xe5, 0x19}}, + {0x04c6, 64, { 0xc3, 0x95, 0x3b, 0x50, 0x0f, 0x12, 0x13, 0x6f, 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x37, 0x20, 0xe7, 0x03, + 0x30, 0x0c, 0x5e, 0xc2, 0x0c, 0xe5, 0x19, 0x60, 0x58, 0xb4, 0x80, 0x03, 0x43, 0x37, 0x02, 0xe5, + 0x37, 0x30, 0xe7, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, + 0x08, 0x7e, 0x7d, 0x7f, 0x80, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x80, 0xaf, 0x37, 0x12, 0x0f}}, + {0x0506, 64, { 0x96, 0xe5, 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xbb, 0xf0, 0x80, 0x27, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, + 0x03, 0x75, 0x19, 0x3f, 0x85, 0x19, 0x08, 0x90, 0x7d, 0x80, 0xe5, 0x37, 0xf0, 0x7e, 0x7d, 0x7f, + 0x81, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x81, 0x12, 0x0d, 0x3b, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xbb, + 0xf0, 0x90, 0x7f, 0xd0, 0xe0, 0x30, 0xe1, 0x06, 0x20, 0x06, 0x03, 0x02, 0x07, 0x99, 0xe4}}, + {0x0546, 64, { 0xf5, 0x18, 0x74, 0xc0, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, + 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, 0x79, 0x20, 0x24, 0x20, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, + 0x12, 0x0e, 0xe4, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x20, 0xe0, 0x60, 0x68, + 0x90, 0x7e, 0x23, 0xe0, 0x60, 0x24, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x12, 0x1a, 0x7f, 0x03}}, + {0x0586, 64, { 0x7d, 0xcd, 0x12, 0x12, 0x1a, 0x43, 0x47, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, + 0xe5, 0x47, 0xf0, 0xe4, 0x90, 0x7e, 0x33, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x21, 0xe0, 0xff, 0x12, + 0x11, 0x38, 0x90, 0x7e, 0x22, 0xe0, 0xff, 0x12, 0x11, 0x5e, 0x7f, 0x01, 0x90, 0x7e, 0x31, 0xe0, + 0xfd, 0x12, 0x12, 0x1a, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x12, 0x1a, 0x43, 0x47, 0x80, 0x90}}, + {0x05c6, 64, { 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, + 0xe5, 0x41, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x23, 0xe0, 0x70, 0x06, 0x90, 0x7e, + 0x33, 0xe0, 0x70, 0x08, 0xe4, 0x90, 0x7e, 0x33, 0xf0, 0x75, 0x2e, 0xff, 0x90, 0x7e, 0x25, 0xe0, + 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, 0xf5, 0x45, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90}}, + {0x0606, 64, { 0xc0, 0x00, 0xe5, 0x45, 0xf0, 0x90, 0x7e, 0x27, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x43, + 0x80, 0x80, 0x03, 0x53, 0x43, 0x7f, 0x53, 0x43, 0xfc, 0x90, 0x7e, 0x29, 0xe0, 0x60, 0x11, 0x43, + 0x43, 0x02, 0xa3, 0xe0, 0xff, 0x12, 0x11, 0x84, 0x90, 0x7e, 0x2b, 0xe0, 0xff, 0x12, 0x11, 0xaa, + 0xaf, 0x43, 0x12, 0x11, 0x12, 0x90, 0x7e, 0x23, 0xe0, 0x60, 0x08, 0x53, 0x43, 0x7f, 0xaf}}, + {0x0646, 64, { 0x43, 0x12, 0x11, 0x12, 0x90, 0x7e, 0x2c, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x02, + 0x80, 0x03, 0x53, 0x47, 0xfd, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, + 0xf0, 0x90, 0x7e, 0x2e, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x01, 0x80, 0x03, + 0x53, 0x47, 0xfe, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0}}, + {0x0686, 64, { 0x90, 0x7e, 0x32, 0xe0, 0xf5, 0x3b, 0xa3, 0xe0, 0x13, 0x92, 0x0e, 0xa3, 0xe0, 0xf5, 0x3d, 0xa3, 0xe0, + 0x60, 0x05, 0x43, 0x47, 0x10, 0x80, 0x03, 0x53, 0x47, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, + 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7e, 0x36, 0xe0, 0x60, 0x32, 0x53, 0x45, 0xbf, 0x90, + 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f}}, + {0x06c6, 64, { 0x98, 0x74, 0x09, 0xf0, 0x12, 0x13, 0x63, 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3f, 0xfd, + 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x1a, 0xe4, 0xf5, 0x33, 0xf5, 0x32, 0xd2, 0x08, 0x90, 0x7e, + 0x37, 0xe0, 0x60, 0x0f, 0x43, 0x3f, 0x02, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x1a, 0x75, 0x32, + 0x01, 0xd2, 0x08, 0x90, 0x7e, 0x38, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0}}, + {0x0706, 64, { 0xe5, 0x41, 0x44, 0x04, 0x90, 0xc0, 0x00, 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x39, 0xe0, 0x60, 0x11, 0x43, + 0x45, 0x40, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, + 0x90, 0x7e, 0x3a, 0xe0, 0x60, 0x0f, 0x53, 0x3f, 0xfe, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x1a, + 0x75, 0x34, 0x01, 0xd2, 0x08, 0x90, 0x7e, 0x3b, 0xe0, 0x60, 0x0f, 0x43, 0x3f, 0x01, 0xe4}}, + {0x0746, 64, { 0xff, 0xad, 0x3f, 0x12, 0x12, 0x1a, 0xe4, 0xf5, 0x34, 0xd2, 0x08, 0x90, 0x7e, 0x3c, 0xe0, 0x60, 0x0e, + 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0xe5, 0x41, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, + 0x3d, 0xe0, 0x60, 0x02, 0xd2, 0x0c, 0x90, 0x7e, 0x3e, 0xe0, 0x60, 0x08, 0x75, 0x35, 0x01, 0xe4, + 0xf5, 0x39, 0xd2, 0x08, 0x90, 0x7e, 0x3f, 0xe0, 0x60, 0x11, 0x90, 0x7f, 0xd7, 0x74, 0x13}}, + {0x0786, 64, { 0xf0, 0x74, 0x33, 0xf0, 0x74, 0x16, 0xf0, 0x74, 0x36, 0xf0, 0xd2, 0x04, 0xc2, 0x06, 0xe4, 0x90, 0x7f, + 0xd1, 0xf0, 0x30, 0x1a, 0x54, 0xe5, 0x39, 0x60, 0x02, 0x15, 0x39, 0x30, 0x13, 0x4b, 0xe5, 0x13, + 0xd3, 0x94, 0x00, 0x40, 0x04, 0x15, 0x13, 0x80, 0x40, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xc2, + 0x13, 0x12, 0x13, 0x63, 0xef, 0x54, 0x01, 0xf5, 0x19, 0x65, 0x33, 0x60, 0x05, 0x85, 0x19}}, + {0x07c6, 64, { 0x33, 0xd2, 0x08, 0x12, 0x13, 0x9f, 0xef, 0x54, 0x80, 0x64, 0x80, 0xf5, 0x19, 0x65, 0x2f, 0x60, 0x05, + 0x85, 0x19, 0x2f, 0xd2, 0x08, 0x30, 0x0e, 0x11, 0x12, 0x13, 0x9f, 0xef, 0x54, 0x10, 0xf5, 0x19, + 0x65, 0x2e, 0x60, 0x05, 0x85, 0x19, 0x2e, 0xd2, 0x08, 0x30, 0x1a, 0x2a, 0x90, 0x7f, 0xd2, 0xe0, + 0x20, 0xe1, 0x23, 0x90, 0x7b, 0x40, 0xe0, 0x60, 0x09, 0xe0, 0xf5, 0x15, 0x90, 0x7b, 0x42}}, + {0x0806, 64, { 0xe0, 0xf5, 0x16, 0x90, 0x7b, 0x41, 0xe0, 0x60, 0x09, 0x90, 0x7f, 0xd7, 0x74, 0x17, 0xf0, 0x74, 0x37, + 0xf0, 0xe4, 0x90, 0x7f, 0xd3, 0xf0, 0x90, 0x7f, 0xc2, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x09, 0x24, + 0xe5, 0x0a, 0x70, 0x40, 0x30, 0x07, 0x39, 0xe5, 0x38, 0x70, 0x35, 0xc2, 0x07, 0xf5, 0x18, 0x7e, + 0x00, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x9e}}, + {0x0846, 64, { 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, + 0x18, 0xb4, 0x09, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x38, 0x10, 0xe4, 0xf5, 0x2c, + 0x75, 0x0a, 0x01, 0x22, 0xe5, 0x0a, 0x64, 0x01, 0x70, 0x40, 0x30, 0x08, 0x39, 0xe5, 0x39, 0x70, + 0x35, 0xc2, 0x08, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x2d, 0x25, 0x18, 0xf9, 0xee}}, + {0x0886, 64, { 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x9e, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, + 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, + 0x75, 0x39, 0x10, 0xe4, 0xf5, 0x35, 0x75, 0x0a, 0x02, 0x22, 0xe5, 0x0a, 0x64, 0x02, 0x70, 0x36, + 0x30, 0x14, 0x2f, 0xc2, 0x14, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x0e, 0x25, 0x18}}, + {0x08c6, 64, { 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x9e, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, + 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x05, 0xdb, 0x90, 0x7f, 0xc3, 0x74, + 0x05, 0xf0, 0x75, 0x0a, 0x03, 0x22, 0xe5, 0x15, 0x60, 0x30, 0x15, 0x15, 0xe4, 0xf5, 0x18, 0x7e, + 0x00, 0x7b, 0x00, 0x74, 0x14, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x9e}}, + {0x0906, 64, { 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, + 0x18, 0xb4, 0x03, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, 0xf5, 0x0a, 0x22, 0x90, 0x7f, + 0xe9, 0xe0, 0x12, 0x0e, 0xf6, 0x0a, 0x0c, 0x00, 0x0a, 0x80, 0x01, 0x0a, 0xec, 0x03, 0x09, 0x48, + 0x06, 0x09, 0xff, 0x08, 0x09, 0xf9, 0x09, 0x09, 0xe1, 0x0a, 0x09, 0xf0, 0x0b, 0x00, 0x00}}, + {0x0946, 64, { 0x0b, 0x3b, 0x90, 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x19, 0x14, 0x60, 0x61, 0x24, 0x02, 0x60, 0x03, + 0x02, 0x09, 0xd7, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x00, 0x90, 0x7f, 0xd5, 0xf0, 0x02, + 0x0b, 0x42, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x04, 0x7f, 0x02, 0x80, 0x02, 0x7f, 0x03, 0x75, 0x82, + 0x82, 0x75, 0x83, 0x19, 0xef, 0xf0, 0x75, 0x82, 0x7b, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82}}, + {0x0986, 64, { 0x74, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x66, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x58, 0x75, 0x83, + 0x19, 0xf0, 0x90, 0x7f, 0xea, 0xe0, 0x04, 0x75, 0x82, 0x17, 0x75, 0x83, 0x19, 0xf0, 0x74, 0x19, + 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x12, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x42, 0x90, 0x7f, 0xea, + 0xe0, 0xff, 0x12, 0x0f, 0x1c, 0xea, 0x49, 0x60, 0x0d, 0xea, 0x90, 0x7f, 0xd4, 0xf0, 0xe9}}, + {0x09c6, 64, { 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x42, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x42, + 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x42, 0x90, 0x7f, 0x00, 0xe5, 0x09, 0xf0, + 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x0b, 0x42, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x09, 0x02, + 0x0b, 0x42, 0x12, 0x0b, 0x4a, 0x02, 0x0b, 0x42, 0x90, 0x7f, 0x00, 0x74, 0x01, 0xf0, 0x90}}, + {0x0a06, 64, { 0x7f, 0xb5, 0xf0, 0x02, 0x0b, 0x42, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60, 0x24, 0x14, 0x60, 0x31, + 0x24, 0x02, 0x70, 0x5b, 0xa2, 0x10, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, 0xa2, 0x16, 0xe4, 0x33, + 0x4f, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, + 0x42, 0xe4, 0x90, 0x7f, 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02}}, + {0x0a46, 64, { 0x0b, 0x42, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, + 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0x90, + 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x42, 0x90, + 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x42, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe}}, + {0x0a86, 64, { 0x60, 0x1d, 0x24, 0x02, 0x60, 0x03, 0x02, 0x0b, 0x42, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x05, 0xc2, + 0x10, 0x02, 0x0b, 0x42, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x42, 0x90, 0x7f, + 0xea, 0xe0, 0x70, 0x38, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, + 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83}}, + {0x0ac6, 64, { 0xe4, 0xf0, 0x90, 0x7f, 0xec, 0xe0, 0x54, 0x80, 0xff, 0x13, 0x13, 0x13, 0x54, 0x1f, 0xff, 0xe0, 0x54, + 0x07, 0x2f, 0x90, 0x7f, 0xd7, 0xf0, 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x5f, 0x90, 0x7f, 0xb4, 0xe0, + 0x44, 0x01, 0xf0, 0x80, 0x56, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x18, 0x24, 0x02, 0x70, + 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x04, 0xd2, 0x10, 0x80, 0x3f, 0x90, 0x7f, 0xb4}}, + {0x0b06, 64, { 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, + 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, + 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, 0x7f, 0xb4, 0xe0, 0x44, + 0x01, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xb4, 0xe0}}, + {0x0b46, 64, { 0x44, 0x02, 0xf0, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0xe4, 0x90, + 0x7f, 0x96, 0xf0, 0x90, 0x7f, 0x95, 0x74, 0xc0, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x3f, 0xf0, 0x90, + 0x7f, 0x98, 0x74, 0x18, 0xf0, 0xe4, 0xf5, 0x8e, 0x90, 0x7f, 0xdf, 0x74, 0xff, 0xf0, 0x90, 0x7f, + 0xde, 0xf0, 0xe4, 0xf5, 0x24, 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x18, 0xf9}}, + {0x0b86, 64, { 0xe4, 0x34, 0x00, 0xfa, 0xe4, 0x12, 0x0e, 0xe4, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xea, 0x75, 0x3a, + 0x01, 0xe4, 0xf5, 0x38, 0xf5, 0x13, 0xf5, 0x36, 0xc2, 0x07, 0xc2, 0x0b, 0xc2, 0x05, 0xc2, 0x00, + 0xc2, 0x09, 0xc2, 0x13, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x75, 0x44, 0x03, 0x90, 0xc0, 0x00, + 0x74, 0x03, 0xf0, 0x7f, 0x0c, 0xe4, 0xfd, 0x12, 0x11, 0xd0, 0x7f, 0x10, 0x8f, 0x42, 0x12}}, + {0x0bc6, 64, { 0x10, 0xa0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x7f, 0x01, 0x8f, 0x40, 0xef, 0x44, 0x06, 0x90, 0xc0, + 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x75, 0x46, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, + 0xf0, 0x0f, 0xe4, 0xfd, 0x12, 0x11, 0xd0, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3e, 0x12, + 0x11, 0xd0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05}}, + {0x0c06, 64, { 0x7d, 0x7f, 0x12, 0x11, 0xd0, 0x7f, 0x01, 0x12, 0x12, 0x89, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xd0, + 0x7f, 0x13, 0x7d, 0x09, 0x12, 0x11, 0xd0, 0x20, 0x1b, 0x03, 0x02, 0x0c, 0xc9, 0x75, 0x2d, 0x01, + 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74, 0x2d, 0x25, 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa, 0xe4, 0x12, + 0x0e, 0xe4, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xea, 0x75, 0x3b, 0x01, 0xe4, 0xf5, 0x39}}, + {0x0c46, 64, { 0xf5, 0x13, 0xf5, 0x37, 0xc2, 0x08, 0xc2, 0x0c, 0xc2, 0x06, 0xc2, 0x00, 0xc2, 0x0a, 0xc2, 0x13, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x75, 0x45, 0x03, 0x90, 0xc0, 0x00, 0x74, 0x03, 0xf0, 0x7f, 0x0c, - 0xe4, 0xfd, 0x12, 0x12, 0x2d, 0x7f, 0x10, 0x8f, 0x43, 0x12, 0x11, 0x25, 0x90, 0x7f, 0x98}}, - {0x0c86, 64, { 0x74, 0x0a, 0xf0, 0x7f, 0x01, 0x8f, 0x41, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, - 0x74, 0x0c, 0xf0, 0x75, 0x47, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, - 0x12, 0x2d, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3f, 0x12, 0x12, 0x2d, 0x90, 0x7f, 0x98, - 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x12, 0x2d}}, - {0x0cc6, 64, { 0x7f, 0x01, 0x12, 0x12, 0xbd, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x12, 0x2d, 0x7f, 0x13, 0x7d, 0x09, 0x12, - 0x12, 0x2d, 0xd2, 0x12, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, + 0xe4, 0xfd, 0x12, 0x12, 0x1a, 0x7f, 0x10, 0x8f, 0x43, 0x12, 0x11, 0x12, 0x90, 0x7f, 0x98, 0x74, + 0x0a, 0xf0, 0x7f, 0x01, 0x8f, 0x41, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f}}, + {0x0c86, 64, { 0x98, 0x74, 0x0c, 0xf0, 0x75, 0x47, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, + 0x12, 0x1a, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3f, 0x12, 0x12, 0x1a, 0x90, 0x7f, 0x98, + 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x12, 0x1a, 0x7f, + 0x01, 0x12, 0x12, 0xaa, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x12, 0x1a, 0x7f, 0x13, 0x7d, 0x09}}, + {0x0cc6, 64, { 0x12, 0x12, 0x1a, 0xd2, 0x12, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, - 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10}}, - {0x0d06, 64, { 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, - 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x90, + 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, + 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90}}, + {0x0d06, 64, { 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, - 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, 0x86}}, - {0x0d46, 64, { 0xdf, 0xf7, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, - 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, + 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, + 0xf7, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5}}, + {0x0d46, 64, { 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, - 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44}}, - {0x0d86, 64, { 0x80, 0xf0, 0x43, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd2, 0x19, 0x90, 0x7f, 0x92, 0xe0, - 0x44, 0x02, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0xff, 0xd3, 0x92, 0x10, 0xe4, 0x33, 0xfe, 0xef, 0x4e, + 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, + 0xf0, 0x43, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd2, 0x19, 0x90, 0x7f, 0x92}}, + {0x0d86, 64, { 0xe0, 0x44, 0x02, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0xff, 0xd3, 0x92, 0x10, 0xe4, 0x33, 0xfe, 0xef, 0x4e, 0xf0, 0xd2, 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, - 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53}}, - {0x0dc6, 64, { 0x91, 0xef, 0x90, 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x0d, 0xf0, 0xd2, - 0xaf, 0xd2, 0x1a, 0x12, 0x12, 0x77, 0xc2, 0x11, 0xe4, 0xf5, 0x0b, 0xf5, 0x13, 0xc2, 0x17, 0xc2, + 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91, + 0xef, 0x90, 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x0d, 0xf0}}, + {0x0dc6, 64, { 0xd2, 0xaf, 0xd2, 0x1a, 0x12, 0x12, 0x64, 0xc2, 0x11, 0xe4, 0xf5, 0x0b, 0xf5, 0x13, 0xc2, 0x17, 0xc2, 0x12, 0x90, 0x7f, 0xa1, 0x04, 0xf0, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x17, 0x60, 0x10, 0x30, 0x12, - 0x05, 0xd2, 0x1a, 0x12, 0x00, 0x46, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, 0x17, 0x80, 0x08, 0x30}}, - {0x0e06, 64, { 0x12, 0x05, 0xc2, 0x1a, 0x12, 0x00, 0x46, 0x30, 0x11, 0x07, 0xc2, 0x11, 0x12, 0x09, 0x2d, 0x80, 0xd6, - 0x30, 0x18, 0xd3, 0xc2, 0x18, 0x12, 0x13, 0xad, 0x80, 0xcc, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, - 0xfd, 0x75, 0x81, 0x47, 0x02, 0x0e, 0x69, 0x02, 0x0d, 0x91, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, - 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3}}, - {0x0e46, 64, { 0xf8, 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, - 0xf4, 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, - 0x40, 0x80, 0x90, 0x12, 0xde, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, - 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25}}, - {0x0e86, 64, { 0xe0, 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, - 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, + 0x05, 0xd2, 0x1a, 0x12, 0x00, 0x46, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, 0x17, 0x80, 0x08, 0x30, 0x12, + 0x05, 0xc2, 0x1a, 0x12, 0x00, 0x46, 0x30, 0x11, 0x07, 0xc2, 0x11, 0x12, 0x09, 0x25, 0x80}}, + {0x0e06, 64, { 0xd6, 0x30, 0x18, 0xd3, 0xc2, 0x18, 0x12, 0x13, 0xab, 0x80, 0xcc, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, + 0xfd, 0x75, 0x81, 0x47, 0x02, 0x0e, 0x59, 0x02, 0x0d, 0x81, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, + 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8, + 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40}}, + {0x0e46, 64, { 0x04, 0xf4, 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, + 0x40, 0x80, 0x90, 0x12, 0xcb, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, + 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0, + 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3}}, + {0x0e86, 64, { 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, - 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93}}, - {0x0ec6, 64, { 0x22, 0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, - 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, + 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, + 0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22}}, + {0x0ec6, 64, { 0x50, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, - 0x89, 0x82, 0x8a, 0x83, 0xf0, 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22}}, - {0x0f06, 64, { 0xd0, 0x83, 0xd0, 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, - 0xf8, 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, + 0x89, 0x82, 0x8a, 0x83, 0xf0, 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22, 0xd0, + 0x83, 0xd0, 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3}}, + {0x0f06, 64, { 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, 0xa3, 0x80, 0xdf, 0x8f, 0x18, 0xe4, 0xf5, 0x19, 0x75, 0x1a, 0xff, 0x75, 0x1b, 0x19, - 0x75, 0x1c, 0x86, 0xab, 0x1a, 0xaa, 0x1b, 0xa9, 0x1c, 0x90, 0x00, 0x01, 0x12, 0x0e, 0xc7}}, - {0x0f46, 64, { 0xb4, 0x03, 0x1d, 0xaf, 0x19, 0x05, 0x19, 0xef, 0xb5, 0x18, 0x01, 0x22, 0x12, 0x0e, 0xae, 0x7e, 0x00, - 0x29, 0xff, 0xee, 0x3a, 0xa9, 0x07, 0x75, 0x1a, 0xff, 0xf5, 0x1b, 0x89, 0x1c, 0x80, 0xd4, 0x7b, + 0x75, 0x1c, 0x86, 0xab, 0x1a, 0xaa, 0x1b, 0xa9, 0x1c, 0x90, 0x00, 0x01, 0x12, 0x0e, 0xb7, 0xb4, + 0x03, 0x1d, 0xaf, 0x19, 0x05, 0x19, 0xef, 0xb5, 0x18, 0x01, 0x22, 0x12, 0x0e, 0x9e, 0x7e}}, + {0x0f46, 64, { 0x00, 0x29, 0xff, 0xee, 0x3a, 0xa9, 0x07, 0x75, 0x1a, 0xff, 0xf5, 0x1b, 0x89, 0x1c, 0x80, 0xd4, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x00, 0x22, 0x8f, 0x1a, 0x05, 0x0d, 0xe5, 0x0d, 0xae, 0x0c, 0x70, 0x02, - 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x1a, 0xf0, 0x12, 0x00, 0x36, 0x05, 0x0d}}, - {0x0f86, 64, { 0xe5, 0x0d, 0xac, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, - 0xe5, 0x08, 0x60, 0x0a, 0x12, 0x13, 0x41, 0x8f, 0x1a, 0xef, 0x42, 0x36, 0x80, 0xca, 0x22, 0x8f, + 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x1a, 0xf0, 0x12, 0x00, 0x36, 0x05, 0x0d, 0xe5, + 0x0d, 0xac, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15}}, + {0x0f86, 64, { 0x08, 0xe5, 0x08, 0x60, 0x0a, 0x12, 0x13, 0x3f, 0x8f, 0x1a, 0xef, 0x42, 0x36, 0x80, 0xca, 0x22, 0x8f, 0x1a, 0x05, 0x0d, 0xe5, 0x0d, 0xae, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8e, 0x83, - 0xe5, 0x1a, 0xf0, 0x12, 0x13, 0x59, 0x05, 0x0d, 0xe5, 0x0d, 0xac, 0x0c, 0x70, 0x02, 0x05}}, - {0x0fc6, 64, { 0x0c, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5, 0x08, 0x60, 0x0a, 0x12, 0x13, 0x95, - 0x8f, 0x1a, 0xef, 0x42, 0x37, 0x80, 0xca, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, + 0xe5, 0x1a, 0xf0, 0x12, 0x13, 0x57, 0x05, 0x0d, 0xe5, 0x0d, 0xac, 0x0c, 0x70, 0x02, 0x05, 0x0c, + 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5, 0x08, 0x60, 0x0a, 0x12, 0x13}}, + {0x0fc6, 64, { 0x93, 0x8f, 0x1a, 0xef, 0x42, 0x37, 0x80, 0xca, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0, 0x90, 0x7f, 0x95, 0xf0, 0x90, 0x7f, 0x9e, 0x74, - 0x27, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x20, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x07, 0xf0, 0xe4}}, - {0x1006, 64, { 0x90, 0x7f, 0x94, 0xf0, 0x90, 0x7f, 0x9d, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x97, 0xf0, 0x22, 0xc0, - 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90, 0x7f, - 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, 0x84, - 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82}}, - {0x1046, 64, { 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x11, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, - 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, - 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, - 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44}}, - {0x1086, 64, { 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, - 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, - 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, - 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90}}, - {0x10c6, 64, { 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, - 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, - 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, - 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90}}, - {0x1106, 64, { 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, - 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, - 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, - 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f}}, - {0x1146, 64, { 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, - 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, - 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, - 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00}}, - {0x1186, 64, { 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, - 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, - 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, - 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00}}, - {0x11c6, 64, { 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, - 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, - 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x17, 0xf0, - 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xed}}, - {0x1206, 64, { 0xf0, 0x22, 0x12, 0x13, 0x29, 0x8f, 0x1a, 0x12, 0x13, 0x29, 0x8f, 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60, - 0x12, 0x12, 0x13, 0x29, 0x8f, 0x1a, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x07, 0x12, 0x13, 0x29, 0x8f, - 0x1b, 0x80, 0xe8, 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, - 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0f, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0}}, - {0x1246, 64, { 0x90, 0x7f, 0x98, 0x74, 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, 0x13, 0x7d, 0x8f, 0x1a, - 0x12, 0x13, 0x7d, 0x8f, 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12, 0x13, 0x7d, 0x8f, 0x1a, - 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x07, 0x12, 0x13, 0x7d, 0x8f, 0x1b, 0x80, 0xe8, 0xaf, 0x1a, 0x22, - 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x1a, 0x04, 0xe0}}, - {0x1286, 64, { 0x44, 0x02, 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x12, 0xfa, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, - 0xe0, 0x44, 0x04, 0xf0, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x3e, 0x54, 0x7f, 0xfd, 0x12, 0x11, - 0xe3, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x3e, 0x44, - 0x80, 0xfd, 0x12, 0x11, 0xe3, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x3f, 0x54, 0x7f, 0xfd}}, - {0x12c6, 64, { 0x12, 0x12, 0x2d, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x3f, - 0x44, 0x80, 0xfd, 0x12, 0x12, 0x2d, 0x22, 0x05, 0x0e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x14, - 0x03, 0x00, 0x00, 0xc1, 0x11, 0xc1, 0x18, 0xc1, 0x95, 0xc1, 0x10, 0xc1, 0x16, 0x01, 0x0a, 0x00, - 0xc1, 0x9b, 0x00, 0x8e, 0x18, 0x8f, 0x19, 0xe5, 0x19, 0x15, 0x19, 0xae, 0x18, 0x70, 0x02}}, - {0x1306, 64, { 0x15, 0x18, 0x4e, 0x60, 0x05, 0x12, 0x0d, 0x70, 0x80, 0xee, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, - 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xe0, - 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, - 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x15}}, - {0x1346, 64, { 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xe0, - 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, - 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, - 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00}}, - {0x1386, 64, { 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, - 0x98, 0x74, 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0e, 0xf0, - 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x12, 0x0f, 0xdf, 0x12, 0x0d, 0x81, 0x12, 0x0b, 0x52, 0x22, - 0x53, 0xd8, 0xef, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + 0x27, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x20, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x07, 0xf0, 0xe4, 0x90, + 0x7f, 0x94, 0xf0, 0x90, 0x7f, 0x9d, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x97, 0xf0, 0x22}}, + {0x1006, 64, { 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x11, + 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, + 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, + 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x18, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08}}, + {0x1046, 64, { 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0x98, + 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, + 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, + 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0}}, + {0x1086, 64, { 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, + 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, + 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, + 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22}}, + {0x10c6, 64, { 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x14, + 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, + 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, + 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98}}, + {0x1106, 64, { 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, + 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x90, 0xc0, 0x00, + 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, + 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f}}, + {0x1146, 64, { 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, + 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, + 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f}}, + {0x1186, 64, { 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, + 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, + 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, + 0x7f, 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b}}, + {0x11c6, 64, { 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, + 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x17, 0xf0, 0x90, 0xc0, 0x00, + 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, 0x13, + 0x27, 0x8f, 0x1a, 0x12, 0x13, 0x27, 0x8f, 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12}}, + {0x1206, 64, { 0x13, 0x27, 0x8f, 0x1a, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x07, 0x12, 0x13, 0x27, 0x8f, 0x1b, 0x80, 0xe8, + 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, + 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0f, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, + 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, 0x13, 0x7b, 0x8f, 0x1a, 0x12, 0x13}}, + {0x1246, 64, { 0x7b, 0x8f, 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12, 0x13, 0x7b, 0x8f, 0x1a, 0xe5, 0x1a, 0x65, + 0x1b, 0x60, 0x07, 0x12, 0x13, 0x7b, 0x8f, 0x1b, 0x80, 0xe8, 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0xd6, + 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x1a, 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, + 0xf4, 0x7e, 0x01, 0x12, 0x12, 0xe7, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0xe0, 0x44}}, + {0x1286, 64, { 0x04, 0xf0, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x3e, 0x54, 0x7f, 0xfd, 0x12, 0x11, 0xd0, 0x90, 0x7f, + 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x3e, 0x44, 0x80, 0xfd, 0x12, + 0x11, 0xd0, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x3f, 0x54, 0x7f, 0xfd, 0x12, 0x12, 0x1a, 0x90, + 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x3f, 0x44, 0x80}}, + {0x12c6, 64, { 0xfd, 0x12, 0x12, 0x1a, 0x22, 0x05, 0x0e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x14, 0x03, 0x00, 0x00, + 0xc1, 0x11, 0xc1, 0x18, 0xc1, 0x95, 0xc1, 0x10, 0xc1, 0x16, 0x01, 0x0a, 0x00, 0xc1, 0x9b, 0x00, + 0x8e, 0x18, 0x8f, 0x19, 0xe5, 0x19, 0x15, 0x19, 0xae, 0x18, 0x70, 0x02, 0x15, 0x18, 0x4e, 0x60, + 0x05, 0x12, 0x0d, 0x60, 0x80, 0xee, 0x22, 0x00, 0x00, 0x02, 0x10, 0x06, 0x00, 0x02, 0x13}}, + {0x1306, 64, { 0x04, 0x00, 0x02, 0x00, 0x03, 0x00, 0x02, 0x10, 0x2d, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, + 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90}}, + {0x1346, 64, { 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x90, 0xc0, + 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff}}, + {0x1386, 64, { 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, + 0x00, 0xe0, 0xff, 0x22, 0x12, 0x0f, 0xcf, 0x12, 0x0d, 0x71, 0x12, 0x0b, 0x4a, 0x22, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, {0x13c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x10, 0x40, 0x00, 0x02, 0x14}}, - {0x1406, 64, { 0x04, 0x00, 0x02, 0x10, 0x16, 0x00, 0x02, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, + {0x1406, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, @@ -425,7 +426,7 @@ {0x18c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x00, 0x01, 0xff, 0x00}}, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x10, 0x01, 0xff, 0x00}}, {0x1906, 64, { 0x00, 0x40, 0xcd, 0x06, 0x10, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x02, 0x09, 0x02, 0x74, 0x00, 0x01, 0x01, 0x00, 0xa0, 0x32, 0x09, 0x04, 0x00, 0x00, 0x0e, 0xff, 0x00, 0x00, 0x00, 0x07, 0x05, 0x01, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x02, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x03, 0x02, 0x40, @@ -443,5 +444,5 @@ 0x00, 0x42, 0x00, 0x20, 0x00, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x41, 0x00, 0x64, 0x00, 0x61, 0x00, 0x70, 0x00, 0x74, 0x00, 0x65, 0x00}}, {0x1a06, 4, { 0x72, 0x00, 0x00, 0x00}}, - {0xffff, 0, {0x00} } + {0xffff, 0, {0x00}} }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa28x_fw.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa28x_fw.h --- linux.20pre5/drivers/usb/serial/keyspan_usa28x_fw.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa28x_fw.h 2002-09-01 13:39:31.000000000 +0100 @@ -1,341 +1,346 @@ /* keyspan_usa28x_fw.h - - Generated from Keyspan firmware image usa26code.h Sat Oct 6 12:08:55 EST 2001 - This firmware is for the Keyspan USA-28X Serial Adaptor - "The firmware contained herein as keyspan_usa28x_fw.h is - Copyright (C) 1999-2001 Keyspan, A division of InnoSys Incorporated - ("Keyspan"), as an unpublished work. This notice does not imply - unrestricted or public access to this firmware which is a trade secret of - Keyspan, and which may not be reproduced, used, sold or transferred to any - third party without Keyspan's prior written consent. All Rights Reserved. + The firmware contained herein as keyspan_usa28x_fw.h is - This firmware may not be modified and may only be used with the Keyspan - USA-28X Serial Adapter. Distribution and/or Modification of the - keyspan.c driver which includes this firmware, in whole or in part, - requires the inclusion of this statement." + Copyright (C) 1999-2001 + Keyspan, A division of InnoSys Incorporated ("Keyspan") + + as an unpublished work. This notice does not imply unrestricted or + public access to the source code from which this firmware image is + derived. Except as noted below this firmware image may not be + reproduced, used, sold or transferred to any third party without + Keyspan's prior written consent. All Rights Reserved. + + Permission is hereby granted for the distribution of this firmware + image as part of a Linux or other Open Source operating system kernel + in text or binary form as required. + + This firmware may not be modified and may only be used with + Keyspan hardware. Distribution and/or Modification of the + keyspan.c driver which includes this firmware, in whole or in + part, requires the inclusion of this statement." */ static const struct ezusb_hex_record keyspan_usa28x_firmware[] = { - {0x0033, 3, { 0x02, 0x13, 0xab}}, + {0x0033, 3, { 0x02, 0x12, 0xf7}}, {0x0003, 16, { 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0}}, {0x0013, 16, { 0x90, 0x7f, 0x94, 0xf0, 0x90, 0x7f, 0x9d, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x97, 0xf0, 0x90}}, {0x0023, 15, { 0x7f, 0x95, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x07, 0xf0, 0xe4, 0x90, 0x7f, 0x98, 0xf0, 0x22}}, - {0x0046, 16, { 0x30, 0x09, 0x18, 0x12, 0x13, 0x33, 0xef, 0xc3, 0x95, 0x3c, 0x40, 0x03, 0x02, 0x00, 0xd8, 0x90}}, + {0x0046, 16, { 0x30, 0x09, 0x18, 0x12, 0x13, 0x1b, 0xef, 0xc3, 0x95, 0x3c, 0x40, 0x03, 0x02, 0x00, 0xd8, 0x90}}, {0x0056, 16, { 0x7f, 0xbf, 0x74, 0x01, 0xf0, 0xc2, 0x09, 0xc2, 0x00, 0x80, 0x77, 0x30, 0x03, 0x3b, 0x90, 0x7f}}, - {0x0066, 16, { 0xc6, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x13, 0x33, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7e}}, + {0x0066, 16, { 0xc6, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x13, 0x1b, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7e}}, {0x0076, 16, { 0x40, 0xe0, 0x13, 0x92, 0x09, 0x90, 0x7f, 0xc7, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60}}, - {0x0086, 16, { 0x0f, 0xf5, 0x08, 0x7e, 0x7e, 0x7f, 0x41, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x41, 0x12, 0x0c, 0xca}}, + {0x0086, 16, { 0x0f, 0xf5, 0x08, 0x7e, 0x7e, 0x7f, 0x41, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x41, 0x12, 0x0c, 0xba}}, {0x0096, 16, { 0xc2, 0x03, 0xe4, 0x90, 0x7f, 0xc7, 0xf0, 0x80, 0x39, 0x90, 0x7f, 0xc8, 0xe0, 0x20, 0xe1, 0x32}}, - {0x00a6, 16, { 0x12, 0x13, 0x33, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x09}}, + {0x00a6, 16, { 0x12, 0x13, 0x1b, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90, 0x7d, 0xc0, 0xe0, 0x13, 0x92, 0x09}}, {0x00b6, 16, { 0x90, 0x7f, 0xc9, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7d}}, - {0x00c6, 16, { 0x7f, 0xc1, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0xc1, 0x12, 0x0c, 0xca, 0xd2, 0x03, 0xe4, 0x90, 0x7f}}, - {0x00d6, 16, { 0xc9, 0xf0, 0x90, 0x7f, 0xb6, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x01, 0x66, 0x53, 0x36, 0x80, 0x12}}, - {0x00e6, 16, { 0x13, 0x3f, 0xef, 0x42, 0x36, 0x12, 0x11, 0xed, 0x8f, 0x19, 0xef, 0xc3, 0x95, 0x3a, 0x50, 0x0f}}, - {0x00f6, 16, { 0x12, 0x13, 0x1b, 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x36, 0x20, 0xe7, 0x03, 0x30, 0x0b, 0x61, 0xc2}}, + {0x00c6, 16, { 0x7f, 0xc1, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0xc1, 0x12, 0x0c, 0xba, 0xd2, 0x03, 0xe4, 0x90, 0x7f}}, + {0x00d6, 16, { 0xc9, 0xf0, 0x90, 0x7f, 0xb6, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x01, 0x60, 0x12, 0x11, 0xd6, 0x8f}}, + {0x00e6, 16, { 0x19, 0x12, 0x13, 0x27, 0x8f, 0x36, 0xe5, 0x19, 0xc3, 0x95, 0x3a, 0x50, 0x0f, 0x12, 0x12, 0xeb}}, + {0x00f6, 16, { 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x36, 0x20, 0xe7, 0x03, 0x30, 0x0b, 0x5e, 0xc2, 0x0b, 0xe5, 0x19}}, {0x0036, 12, { 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22}}, {0x0043, 3, { 0x02, 0x13, 0x00}}, - {0x0000, 3, { 0x02, 0x0e, 0x10}}, - {0x0106, 64, { 0x0b, 0xe5, 0x19, 0x70, 0x04, 0xf5, 0x36, 0x80, 0x57, 0x12, 0x13, 0x3f, 0xef, 0x42, 0x36, 0xe5, 0x36, - 0x30, 0xe7, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, - 0x7e, 0x7e, 0x7f, 0x80, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x80, 0xaf, 0x36, 0x12, 0x0f, 0x5b, 0xe5, - 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xb7, 0xf0, 0x80, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40}}, - {0x0146, 64, { 0x03, 0x75, 0x19, 0x3f, 0x85, 0x19, 0x08, 0xe4, 0x90, 0x7e, 0x80, 0xf0, 0x7e, 0x7e, 0x7f, 0x81, 0x75, - 0x0c, 0x7e, 0x75, 0x0d, 0x81, 0x12, 0x0c, 0xef, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xb7, 0xf0, 0x90, - 0x7f, 0xce, 0xe0, 0x30, 0xe1, 0x06, 0x20, 0x05, 0x03, 0x02, 0x03, 0xc5, 0xc2, 0x05, 0xe4, 0xf5, - 0x18, 0x74, 0x40, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xff, 0xe5}}, - {0x0186, 64, { 0x18, 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, 0x79, 0x00, 0x24, 0x00, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, - 0x12, 0x0e, 0xe2, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x00, 0xe0, 0x60, 0x68, - 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x24, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x11, 0xc8, 0x7f, 0x03, 0x7d, - 0xcd, 0x12, 0x11, 0xc8, 0x43, 0x46, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0}}, - {0x01c6, 64, { 0x00, 0xe5, 0x46, 0xf0, 0xe4, 0x90, 0x7e, 0x13, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x01, 0xe0, 0xff, 0x12, - 0x10, 0x4c, 0x90, 0x7e, 0x02, 0xe0, 0xff, 0x12, 0x10, 0x72, 0x7f, 0x01, 0x90, 0x7e, 0x11, 0xe0, - 0xfd, 0x12, 0x11, 0xc8, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xc8, 0x43, 0x46, 0x80, 0x90, 0x7f, - 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12}}, - {0x0206, 64, { 0xf0, 0xe5, 0x40, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x03, 0xe0, 0x70, 0x06, 0x90, 0x7e, - 0x13, 0xe0, 0x70, 0x08, 0xe4, 0x90, 0x7e, 0x13, 0xf0, 0x75, 0x25, 0xff, 0x90, 0x7e, 0x05, 0xe0, - 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, 0xf5, 0x44, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, - 0x00, 0xe5, 0x44, 0xf0, 0x90, 0x7e, 0x07, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43}}, - {0x0246, 64, { 0x42, 0x80, 0x80, 0x03, 0x53, 0x42, 0x7f, 0x53, 0x42, 0xfc, 0x90, 0x7e, 0x09, 0xe0, 0x60, 0x11, 0x43, - 0x42, 0x02, 0xa3, 0xe0, 0xff, 0x12, 0x10, 0xbe, 0x90, 0x7e, 0x0b, 0xe0, 0xff, 0x12, 0x10, 0xe4, - 0xaf, 0x42, 0x12, 0x10, 0x98, 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x08, 0x53, 0x42, 0x7f, 0xaf, 0x42, - 0x12, 0x10, 0x98, 0x90, 0x7e, 0x0c, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46}}, - {0x0286, 64, { 0x02, 0x80, 0x03, 0x53, 0x46, 0xfd, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, - 0xf0, 0x90, 0x7e, 0x0e, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x01, 0x80, 0x03, - 0x53, 0x46, 0xfe, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, - 0x7e, 0x12, 0xe0, 0xf5, 0x3a, 0xa3, 0xe0, 0x13, 0x92, 0x0d, 0xa3, 0xe0, 0xf5, 0x3c, 0xa3}}, - {0x02c6, 64, { 0xe0, 0x60, 0x05, 0x43, 0x46, 0x10, 0x80, 0x03, 0x53, 0x46, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, - 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x16, 0xe0, 0x60, 0x32, 0x53, 0x44, 0xbf, 0x90, - 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, - 0x74, 0x11, 0xf0, 0x12, 0x13, 0x0f, 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3e}}, - {0x0306, 64, { 0xfd, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xc8, 0xe4, 0xf5, 0x2a, 0xf5, 0x29, 0xd2, 0x07, 0x90, 0x7e, - 0x17, 0xe0, 0x60, 0x0f, 0x43, 0x3e, 0x02, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xc8, 0x75, 0x29, - 0x01, 0xd2, 0x07, 0x90, 0x7e, 0x18, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, - 0x40, 0x44, 0x04, 0x90, 0xc0, 0x00, 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x19, 0xe0, 0x60, 0x11}}, - {0x0346, 64, { 0x43, 0x44, 0x40, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, - 0x90, 0x7e, 0x1a, 0xe0, 0x60, 0x0f, 0x53, 0x3e, 0xfe, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xc8, - 0x75, 0x2b, 0x01, 0xd2, 0x07, 0x90, 0x7e, 0x1b, 0xe0, 0x60, 0x0f, 0x43, 0x3e, 0x01, 0xe4, 0xff, - 0xad, 0x3e, 0x12, 0x11, 0xc8, 0xe4, 0xf5, 0x2b, 0xd2, 0x07, 0x90, 0x7e, 0x1c, 0xe0, 0x60}}, - {0x0386, 64, { 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, - 0x1d, 0xe0, 0x60, 0x02, 0xd2, 0x0b, 0x90, 0x7e, 0x1e, 0xe0, 0x60, 0x08, 0x75, 0x2c, 0x01, 0xe4, - 0xf5, 0x38, 0xd2, 0x07, 0x90, 0x7e, 0x1f, 0xe0, 0x60, 0x0f, 0x90, 0x7f, 0xd7, 0x74, 0x11, 0xf0, - 0x74, 0x31, 0xf0, 0x74, 0x15, 0xf0, 0x74, 0x35, 0xf0, 0xe4, 0x90, 0x7f, 0xcf, 0xf0, 0x30}}, - {0x03c6, 64, { 0x1a, 0x52, 0xe5, 0x38, 0x60, 0x02, 0x15, 0x38, 0x20, 0x13, 0x49, 0xe5, 0x13, 0xd3, 0x94, 0x00, 0x40, - 0x04, 0x15, 0x13, 0x80, 0x3e, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xd2, 0x13, 0x12, 0x13, 0x0f, - 0xef, 0x54, 0x01, 0xf5, 0x19, 0x65, 0x2a, 0x60, 0x05, 0x85, 0x19, 0x2a, 0xd2, 0x07, 0x12, 0x13, - 0x4b, 0xef, 0x54, 0x80, 0xf5, 0x19, 0x65, 0x26, 0x60, 0x05, 0x85, 0x19, 0x26, 0xd2, 0x07}}, - {0x0406, 64, { 0x30, 0x0d, 0x11, 0x12, 0x13, 0x4b, 0xef, 0x54, 0x10, 0xf5, 0x19, 0x65, 0x25, 0x60, 0x05, 0x85, 0x19, - 0x25, 0xd2, 0x07, 0x20, 0x1b, 0x03, 0x02, 0x07, 0xf4, 0x30, 0x0a, 0x18, 0x12, 0x13, 0x87, 0xef, - 0xc3, 0x95, 0x3d, 0x40, 0x03, 0x02, 0x04, 0xb2, 0x90, 0x7f, 0xc1, 0x74, 0x01, 0xf0, 0xc2, 0x0a, - 0xc2, 0x00, 0x80, 0x77, 0x30, 0x04, 0x3b, 0x90, 0x7f, 0xca, 0xe0, 0x20, 0xe1, 0x6d, 0x12}}, - {0x0446, 64, { 0x13, 0x87, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x64, 0x90, 0x7d, 0x40, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, - 0xcb, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7d, 0x7f, 0x41, - 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x41, 0x12, 0x0d, 0x14, 0xc2, 0x04, 0xe4, 0x90, 0x7f, 0xcb, 0xf0, - 0x80, 0x39, 0x90, 0x7f, 0xcc, 0xe0, 0x20, 0xe1, 0x32, 0x12, 0x13, 0x87, 0xef, 0xc3, 0x94}}, - {0x0486, 64, { 0x40, 0x50, 0x29, 0x90, 0x7c, 0xc0, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, 0xcd, 0xe0, 0x14, 0xf5, 0x19, - 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7c, 0x7f, 0xc1, 0x75, 0x0c, 0x7c, 0x75, 0x0d, - 0xc1, 0x12, 0x0d, 0x14, 0xd2, 0x04, 0xe4, 0x90, 0x7f, 0xcd, 0xf0, 0x90, 0x7f, 0xba, 0xe0, 0x30, - 0xe1, 0x03, 0x02, 0x05, 0x40, 0x53, 0x37, 0x80, 0x12, 0x13, 0x93, 0xef, 0x42, 0x37, 0x12}}, - {0x04c6, 64, { 0x12, 0x37, 0x8f, 0x19, 0xef, 0xc3, 0x95, 0x3b, 0x50, 0x0f, 0x12, 0x13, 0x6f, 0xef, 0x30, 0xe0, 0x08, - 0xe5, 0x37, 0x20, 0xe7, 0x03, 0x30, 0x0c, 0x61, 0xc2, 0x0c, 0xe5, 0x19, 0x70, 0x04, 0xf5, 0x37, - 0x80, 0x57, 0x12, 0x13, 0x93, 0xef, 0x42, 0x37, 0xe5, 0x37, 0x30, 0xe7, 0x26, 0xe5, 0x19, 0xd3, - 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, 0x7e, 0x7d, 0x7f, 0x80, 0x75}}, - {0x0506, 64, { 0x0c, 0x7d, 0x75, 0x0d, 0x80, 0xaf, 0x37, 0x12, 0x0f, 0x94, 0xe5, 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xbb, - 0xf0, 0x80, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, 0x19, 0x3f, 0x85, 0x19, 0x08, - 0xe4, 0x90, 0x7d, 0x80, 0xf0, 0x7e, 0x7d, 0x7f, 0x81, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x81, 0x12, - 0x0d, 0x39, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xbb, 0xf0, 0x90, 0x7f, 0xd0, 0xe0, 0x30, 0xe1}}, - {0x0546, 64, { 0x06, 0x20, 0x06, 0x03, 0x02, 0x07, 0x9f, 0xc2, 0x06, 0xe4, 0xf5, 0x18, 0x74, 0xc0, 0x25, 0x18, 0xf5, - 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, - 0x79, 0x20, 0x24, 0x20, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, 0x12, 0x0e, 0xe2, 0x05, 0x18, 0xe5, - 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x20, 0xe0, 0x60, 0x68, 0x90, 0x7e, 0x23, 0xe0, 0x60}}, - {0x0586, 64, { 0x24, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x12, 0x12, 0x7f, 0x03, 0x7d, 0xcd, 0x12, 0x12, 0x12, 0x43, 0x47, - 0x80, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0xe4, 0x90, 0x7e, - 0x33, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x21, 0xe0, 0xff, 0x12, 0x11, 0x30, 0x90, 0x7e, 0x22, 0xe0, - 0xff, 0x12, 0x11, 0x56, 0x7f, 0x01, 0x90, 0x7e, 0x31, 0xe0, 0xfd, 0x12, 0x12, 0x12, 0x7f}}, - {0x05c6, 64, { 0x03, 0x7d, 0x07, 0x12, 0x12, 0x12, 0x43, 0x47, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, - 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0xe5, 0x41, 0x44, 0x06, 0x90, 0xc0, - 0x00, 0xf0, 0x90, 0x7e, 0x23, 0xe0, 0x70, 0x06, 0x90, 0x7e, 0x33, 0xe0, 0x70, 0x08, 0xe4, 0x90, - 0x7e, 0x33, 0xf0, 0x75, 0x2e, 0xff, 0x90, 0x7e, 0x25, 0xe0, 0x60, 0x12, 0xa3, 0xe0, 0x54}}, - {0x0606, 64, { 0x3f, 0xf5, 0x45, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x45, 0xf0, 0x90, 0x7e, - 0x27, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x43, 0x80, 0x80, 0x03, 0x53, 0x43, 0x7f, - 0x53, 0x43, 0xfc, 0x90, 0x7e, 0x29, 0xe0, 0x60, 0x11, 0x43, 0x43, 0x02, 0xa3, 0xe0, 0xff, 0x12, - 0x11, 0x7c, 0x90, 0x7e, 0x2b, 0xe0, 0xff, 0x12, 0x11, 0xa2, 0xaf, 0x43, 0x12, 0x11, 0x0a}}, - {0x0646, 64, { 0x90, 0x7e, 0x23, 0xe0, 0x60, 0x08, 0x53, 0x43, 0x7f, 0xaf, 0x43, 0x12, 0x11, 0x0a, 0x90, 0x7e, 0x2c, - 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x02, 0x80, 0x03, 0x53, 0x47, 0xfd, 0x90, - 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7e, 0x2e, 0xe0, 0x60, - 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x01, 0x80, 0x03, 0x53, 0x47, 0xfe, 0x90, 0x7f}}, - {0x0686, 64, { 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7e, 0x32, 0xe0, 0xf5, 0x3b, 0xa3, - 0xe0, 0x13, 0x92, 0x0e, 0xa3, 0xe0, 0xf5, 0x3d, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x10, 0x80, - 0x03, 0x53, 0x47, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, - 0x90, 0x7e, 0x36, 0xe0, 0x60, 0x32, 0x53, 0x45, 0xbf, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0}}, - {0x06c6, 64, { 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x12, 0x13, 0x63, - 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3f, 0xfd, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, - 0x12, 0xe4, 0xf5, 0x33, 0xf5, 0x32, 0xd2, 0x08, 0x90, 0x7e, 0x37, 0xe0, 0x60, 0x0f, 0x43, 0x3f, - 0x02, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x12, 0x75, 0x32, 0x01, 0xd2, 0x08, 0x90, 0x7e}}, - {0x0706, 64, { 0x38, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0xe5, 0x41, 0x44, 0x04, 0x90, 0xc0, 0x00, - 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x39, 0xe0, 0x60, 0x11, 0x43, 0x45, 0x40, 0x90, 0x7f, 0x98, 0x74, - 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x3a, 0xe0, 0x60, 0x0f, - 0x53, 0x3f, 0xfe, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x12, 0x75, 0x34, 0x01, 0xd2, 0x08}}, - {0x0746, 64, { 0x90, 0x7e, 0x3b, 0xe0, 0x60, 0x0f, 0x43, 0x3f, 0x01, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x12, 0x12, 0xe4, - 0xf5, 0x34, 0xd2, 0x08, 0x90, 0x7e, 0x3c, 0xe0, 0x60, 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, - 0xe5, 0x41, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x3d, 0xe0, 0x60, 0x02, 0xd2, 0x0c, - 0x90, 0x7e, 0x3e, 0xe0, 0x60, 0x08, 0x75, 0x35, 0x01, 0xe4, 0xf5, 0x39, 0xd2, 0x08, 0x90}}, - {0x0786, 64, { 0x7e, 0x3f, 0xe0, 0x60, 0x0f, 0x90, 0x7f, 0xd7, 0x74, 0x13, 0xf0, 0x74, 0x33, 0xf0, 0x74, 0x16, 0xf0, - 0x74, 0x36, 0xf0, 0xe4, 0x90, 0x7f, 0xd1, 0xf0, 0x30, 0x1a, 0x52, 0xe5, 0x39, 0x60, 0x02, 0x15, - 0x39, 0x30, 0x13, 0x49, 0xe5, 0x13, 0xd3, 0x94, 0x00, 0x40, 0x04, 0x15, 0x13, 0x80, 0x3e, 0x75, - 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xc2, 0x13, 0x12, 0x13, 0x63, 0xef, 0x54, 0x01, 0xf5, 0x19}}, - {0x07c6, 64, { 0x65, 0x33, 0x60, 0x05, 0x85, 0x19, 0x33, 0xd2, 0x08, 0x12, 0x13, 0x9f, 0xef, 0x54, 0x80, 0xf5, 0x19, - 0x65, 0x2f, 0x60, 0x05, 0x85, 0x19, 0x2f, 0xd2, 0x08, 0x30, 0x0e, 0x11, 0x12, 0x13, 0x9f, 0xef, - 0x54, 0x10, 0xf5, 0x19, 0x65, 0x2e, 0x60, 0x05, 0x85, 0x19, 0x2e, 0xd2, 0x08, 0x30, 0x1a, 0x2a, - 0x90, 0x7f, 0xd2, 0xe0, 0x20, 0xe1, 0x23, 0x90, 0x7b, 0x40, 0xe0, 0x60, 0x09, 0xe0, 0xf5}}, - {0x0806, 64, { 0x15, 0x90, 0x7b, 0x42, 0xe0, 0xf5, 0x16, 0x90, 0x7b, 0x41, 0xe0, 0x60, 0x09, 0x90, 0x7f, 0xd7, 0x74, - 0x17, 0xf0, 0x74, 0x37, 0xf0, 0xe4, 0x90, 0x7f, 0xd3, 0xf0, 0x90, 0x7f, 0xc2, 0xe0, 0x30, 0xe1, - 0x03, 0x02, 0x09, 0x28, 0xe5, 0x0a, 0x70, 0x40, 0x30, 0x07, 0x39, 0xe5, 0x38, 0x70, 0x35, 0xc2, - 0x07, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00}}, - {0x0846, 64, { 0xfa, 0x12, 0x0e, 0x9c, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, - 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x38, - 0x10, 0xe4, 0xf5, 0x2c, 0x75, 0x0a, 0x01, 0x22, 0xe5, 0x0a, 0x64, 0x01, 0x70, 0x40, 0x30, 0x08, - 0x39, 0xe5, 0x39, 0x70, 0x35, 0xc2, 0x08, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x2d}}, - {0x0886, 64, { 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x9c, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, - 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, 0x90, 0x7f, - 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x39, 0x10, 0xe4, 0xf5, 0x35, 0x75, 0x0a, 0x02, 0x22, 0xe5, 0x0a, - 0x64, 0x02, 0x70, 0x36, 0x30, 0x14, 0x2f, 0xc2, 0x14, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00}}, - {0x08c6, 64, { 0x74, 0x0e, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x9c, 0xff, 0x74, 0x80, 0x25, 0x18, - 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x05, 0xdb, - 0x90, 0x7f, 0xc3, 0x74, 0x05, 0xf0, 0x75, 0x0a, 0x03, 0x22, 0xe5, 0x15, 0x60, 0x30, 0x15, 0x15, - 0xe4, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x14, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00}}, - {0x0906, 64, { 0xfa, 0x12, 0x0e, 0x9c, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, - 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x03, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, 0xf5, - 0x0a, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x0e, 0xf4, 0x0a, 0x10, 0x00, 0x0a, 0x84, 0x01, 0x0a, - 0xf0, 0x03, 0x09, 0x4c, 0x06, 0x0a, 0x03, 0x08, 0x09, 0xfd, 0x09, 0x09, 0xe5, 0x0a, 0x09}}, - {0x0946, 64, { 0xf4, 0x0b, 0x00, 0x00, 0x0b, 0x3f, 0x90, 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x19, 0x14, 0x60, 0x61, - 0x24, 0x02, 0x60, 0x03, 0x02, 0x09, 0xdb, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x00, 0x90, - 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x04, 0x7f, 0x02, 0x80, 0x02, - 0x7f, 0x03, 0x75, 0x82, 0x82, 0x75, 0x83, 0x19, 0xef, 0xf0, 0x75, 0x82, 0x7b, 0x75, 0x83}}, - {0x0986, 64, { 0x19, 0xf0, 0x75, 0x82, 0x74, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x66, 0x75, 0x83, 0x19, 0xf0, 0x75, - 0x82, 0x58, 0x75, 0x83, 0x19, 0xf0, 0x90, 0x7f, 0xea, 0xe0, 0x04, 0x75, 0x82, 0x17, 0x75, 0x83, - 0x19, 0xf0, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x12, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, - 0x46, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x0f, 0x1a, 0xea, 0x49, 0x60, 0x0d, 0xea, 0x90}}, - {0x09c6, 64, { 0x7f, 0xd4, 0xf0, 0xe9, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, - 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, - 0x00, 0xe5, 0x09, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xea, - 0xe0, 0xf5, 0x09, 0x02, 0x0b, 0x46, 0x12, 0x0b, 0x4e, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0x00}}, - {0x0a06, 64, { 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xb5, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60, - 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, 0xa2, 0x10, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, - 0xa2, 0x16, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, - 0x02, 0xf0, 0x02, 0x0b, 0x46, 0xe4, 0x90, 0x7f, 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5}}, - {0x0a46, 64, { 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, - 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, - 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, - 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x46, 0x90, 0x7f}}, - {0x0a86, 64, { 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24, 0x02, 0x60, 0x03, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xea, 0xe0, - 0xb4, 0x01, 0x05, 0xc2, 0x10, 0x02, 0x0b, 0x46, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, - 0x0b, 0x46, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x38, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, - 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4}}, - {0x0ac6, 64, { 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f, 0xec, 0xe0, 0x54, 0x80, 0xff, 0x13, 0x13, 0x13, 0x54, - 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f, 0xd7, 0xf0, 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x5f, - 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x56, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, - 0x18, 0x24, 0x02, 0x70, 0x4a, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x04, 0xd2, 0x10, 0x80}}, - {0x0b06, 64, { 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, - 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, - 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, - 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0}}, - {0x0b46, 64, { 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, - 0x30, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0, 0x90, 0x7f, 0x95, 0x74, 0xc0, 0xf0, 0x90, 0x7f, 0x9e, - 0x74, 0x3f, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x18, 0xf0, 0xe4, 0xf5, 0x8e, 0x90, 0x7f, 0xdf, 0x74, - 0xff, 0xf0, 0x90, 0x7f, 0xde, 0xf0, 0xe4, 0xf5, 0x24, 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74}}, - {0x0b86, 64, { 0x24, 0x25, 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa, 0xe4, 0x12, 0x0e, 0xe2, 0x05, 0x18, 0xe5, 0x18, 0xb4, - 0x09, 0xea, 0x75, 0x3a, 0x01, 0xe4, 0xf5, 0x38, 0xf5, 0x13, 0xf5, 0x36, 0xc2, 0x07, 0xc2, 0x0b, - 0xc2, 0x05, 0xc2, 0x00, 0xc2, 0x09, 0xc2, 0x13, 0xd2, 0x03, 0xd2, 0x01, 0x90, 0x7f, 0x98, 0x74, - 0x13, 0xf0, 0x75, 0x44, 0x03, 0x90, 0xc0, 0x00, 0x74, 0x03, 0xf0, 0x7f, 0x0c, 0xe4, 0xfd}}, - {0x0bc6, 64, { 0x12, 0x11, 0xc8, 0x7f, 0x10, 0x8f, 0x42, 0x12, 0x10, 0x98, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x7f, - 0x01, 0x8f, 0x40, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, - 0x75, 0x46, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, 0x11, 0xc8, 0xe4, - 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3e, 0x12, 0x11, 0xc8, 0x90, 0x7f, 0x98, 0x74, 0x11}}, - {0x0c06, 64, { 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x11, 0xc8, 0x7f, 0x01, 0x12, 0x12, - 0x81, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xc8, 0x20, 0x1b, 0x03, 0x02, 0x0c, 0xc7, 0x75, 0x2d, - 0x01, 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74, 0x2d, 0x25, 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa, 0xe4, - 0x12, 0x0e, 0xe2, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xea, 0x75, 0x3b, 0x01, 0xe4, 0xf5}}, - {0x0c46, 64, { 0x39, 0xf5, 0x13, 0xf5, 0x37, 0xc2, 0x08, 0xc2, 0x0c, 0xc2, 0x06, 0xc2, 0x00, 0xc2, 0x0a, 0xc2, 0x13, - 0xd2, 0x04, 0xd2, 0x02, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x75, 0x45, 0x03, 0x90, 0xc0, 0x00, - 0x74, 0x03, 0xf0, 0x7f, 0x0c, 0xe4, 0xfd, 0x12, 0x12, 0x12, 0x7f, 0x10, 0x8f, 0x43, 0x12, 0x11, - 0x0a, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x7f, 0x01, 0x8f, 0x41, 0xef, 0x44, 0x06, 0x90}}, - {0x0c86, 64, { 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x75, 0x47, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, - 0xf0, 0x0f, 0xe4, 0xfd, 0x12, 0x12, 0x12, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3f, 0x12, - 0x12, 0x12, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, - 0x7f, 0x12, 0x12, 0x12, 0x7f, 0x01, 0x12, 0x12, 0xa2, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x12}}, - {0x0cc6, 64, { 0x12, 0xd2, 0x12, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, - 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, + {0x0000, 3, { 0x02, 0x0e, 0x00}}, + {0x0106, 64, { 0x60, 0x58, 0xb4, 0x80, 0x03, 0x43, 0x36, 0x02, 0xe5, 0x36, 0x30, 0xe7, 0x26, 0xe5, 0x19, 0xd3, 0x94, + 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, 0x7e, 0x7e, 0x7f, 0x80, 0x75, 0x0c, 0x7e, + 0x75, 0x0d, 0x80, 0xaf, 0x36, 0x12, 0x0f, 0x4b, 0xe5, 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xb7, 0xf0, + 0x80, 0x27, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, 0x19, 0x3f, 0x85, 0x19, 0x08}}, + {0x0146, 64, { 0x90, 0x7e, 0x80, 0xe5, 0x36, 0xf0, 0x7e, 0x7e, 0x7f, 0x81, 0x75, 0x0c, 0x7e, 0x75, 0x0d, 0x81, 0x12, + 0x0c, 0xdf, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xb7, 0xf0, 0x90, 0x7f, 0xce, 0xe0, 0x30, 0xe1, 0x06, + 0x20, 0x05, 0x03, 0x02, 0x03, 0xc1, 0xc2, 0x05, 0xe4, 0xf5, 0x18, 0x74, 0x40, 0x25, 0x18, 0xf5, + 0x82, 0xe4, 0x34, 0x7c, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, 0x7c, 0x00, 0x7b, 0x01, 0x7a}}, + {0x0186, 64, { 0x7e, 0x79, 0x00, 0x24, 0x00, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, 0x12, 0x0e, 0xd2, 0x05, 0x18, 0xe5, + 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x00, 0xe0, 0x60, 0x68, 0x90, 0x7e, 0x03, 0xe0, 0x60, 0x24, + 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x11, 0xb1, 0x7f, 0x03, 0x7d, 0xcd, 0x12, 0x11, 0xb1, 0x43, 0x46, + 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0xe4, 0x90}}, + {0x01c6, 64, { 0x7e, 0x13, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x01, 0xe0, 0xff, 0x12, 0x10, 0x35, 0x90, 0x7e, 0x02, 0xe0, + 0xff, 0x12, 0x10, 0x5b, 0x7f, 0x01, 0x90, 0x7e, 0x11, 0xe0, 0xfd, 0x12, 0x11, 0xb1, 0x7f, 0x03, + 0x7d, 0x07, 0x12, 0x11, 0xb1, 0x43, 0x46, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, + 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, 0x06, 0x90}}, + {0x0206, 64, { 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x03, 0xe0, 0x70, 0x06, 0x90, 0x7e, 0x13, 0xe0, 0x70, 0x08, 0xe4, 0x90, + 0x7e, 0x13, 0xf0, 0x75, 0x25, 0xff, 0x90, 0x7e, 0x05, 0xe0, 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, + 0xf5, 0x44, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x44, 0xf0, 0x90, 0x7e, + 0x07, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x42, 0x80, 0x80, 0x03, 0x53, 0x42}}, + {0x0246, 64, { 0x7f, 0x53, 0x42, 0xfc, 0x90, 0x7e, 0x09, 0xe0, 0x60, 0x11, 0x43, 0x42, 0x02, 0xa3, 0xe0, 0xff, 0x12, + 0x10, 0xa7, 0x90, 0x7e, 0x0b, 0xe0, 0xff, 0x12, 0x10, 0xcd, 0xaf, 0x42, 0x12, 0x10, 0x81, 0x90, + 0x7e, 0x03, 0xe0, 0x60, 0x08, 0x53, 0x42, 0x7f, 0xaf, 0x42, 0x12, 0x10, 0x81, 0x90, 0x7e, 0x0c, + 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x02, 0x80, 0x03, 0x53, 0x46, 0xfd}}, + {0x0286, 64, { 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x0e, 0xe0, 0x60, + 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x01, 0x80, 0x03, 0x53, 0x46, 0xfe, 0x90, 0x7f, 0x98, + 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, 0x90, 0x7e, 0x12, 0xe0, 0xf5, 0x3a, 0xa3, + 0xe0, 0x13, 0x92, 0x0d, 0xa3, 0xe0, 0xf5, 0x3c, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x46, 0x10}}, + {0x02c6, 64, { 0x80, 0x03, 0x53, 0x46, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x46, 0xf0, + 0x90, 0x7e, 0x16, 0xe0, 0x60, 0x32, 0x53, 0x44, 0xbf, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, + 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x12, 0x12, 0xdf, + 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3e, 0xfd, 0xe4, 0xff, 0xad, 0x3e, 0x12}}, + {0x0306, 64, { 0x11, 0xb1, 0xe4, 0xf5, 0x2a, 0xf5, 0x29, 0xd2, 0x07, 0x90, 0x7e, 0x17, 0xe0, 0x60, 0x0f, 0x43, 0x3e, + 0x02, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xb1, 0x75, 0x29, 0x01, 0xd2, 0x07, 0x90, 0x7e, 0x18, + 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0xe5, 0x40, 0x44, 0x04, 0x90, 0xc0, 0x00, + 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x19, 0xe0, 0x60, 0x11, 0x43, 0x44, 0x40, 0x90, 0x7f, 0x98}}, + {0x0346, 64, { 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x1a, 0xe0, 0x60, 0x0f, + 0x53, 0x3e, 0xfe, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xb1, 0x75, 0x2b, 0x01, 0xd2, 0x07, 0x90, + 0x7e, 0x1b, 0xe0, 0x60, 0x0f, 0x43, 0x3e, 0x01, 0xe4, 0xff, 0xad, 0x3e, 0x12, 0x11, 0xb1, 0xe4, + 0xf5, 0x2b, 0xd2, 0x07, 0x90, 0x7e, 0x1c, 0xe0, 0x60, 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x12}}, + {0x0386, 64, { 0xf0, 0xe5, 0x40, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x1d, 0xe0, 0x60, 0x02, 0xd2, 0x0b, + 0x90, 0x7e, 0x1e, 0xe0, 0x60, 0x08, 0x75, 0x2c, 0x01, 0xe4, 0xf5, 0x38, 0xd2, 0x07, 0x90, 0x7e, + 0x1f, 0xe0, 0x60, 0x11, 0x90, 0x7f, 0xd7, 0x74, 0x11, 0xf0, 0x74, 0x31, 0xf0, 0x74, 0x15, 0xf0, + 0x74, 0x35, 0xf0, 0xd2, 0x03, 0xe4, 0x90, 0x7f, 0xcf, 0xf0, 0x30, 0x1a, 0x52, 0xe5, 0x38}}, + {0x03c6, 64, { 0x60, 0x02, 0x15, 0x38, 0x20, 0x13, 0x49, 0xe5, 0x13, 0xd3, 0x94, 0x00, 0x40, 0x04, 0x15, 0x13, 0x80, + 0x3e, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xd2, 0x13, 0x12, 0x12, 0xdf, 0xef, 0x54, 0x01, 0xf5, + 0x19, 0x65, 0x2a, 0x60, 0x05, 0x85, 0x19, 0x2a, 0xd2, 0x07, 0x12, 0x13, 0x33, 0xef, 0x54, 0x80, + 0xf5, 0x19, 0x65, 0x26, 0x60, 0x05, 0x85, 0x19, 0x26, 0xd2, 0x07, 0x30, 0x0d, 0x11, 0x12}}, + {0x0406, 64, { 0x13, 0x33, 0xef, 0x54, 0x10, 0xf5, 0x19, 0x65, 0x25, 0x60, 0x05, 0x85, 0x19, 0x25, 0xd2, 0x07, 0x20, + 0x1b, 0x03, 0x02, 0x07, 0xec, 0x30, 0x0a, 0x18, 0x12, 0x13, 0x6f, 0xef, 0xc3, 0x95, 0x3d, 0x40, + 0x03, 0x02, 0x04, 0xae, 0x90, 0x7f, 0xc1, 0x74, 0x01, 0xf0, 0xc2, 0x0a, 0xc2, 0x00, 0x80, 0x77, + 0x30, 0x04, 0x3b, 0x90, 0x7f, 0xca, 0xe0, 0x20, 0xe1, 0x6d, 0x12, 0x13, 0x6f, 0xef, 0xc3}}, + {0x0446, 64, { 0x94, 0x40, 0x50, 0x64, 0x90, 0x7d, 0x40, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, 0xcb, 0xe0, 0x14, 0xf5, + 0x19, 0x20, 0x00, 0x11, 0x60, 0x0f, 0xf5, 0x08, 0x7e, 0x7d, 0x7f, 0x41, 0x75, 0x0c, 0x7d, 0x75, + 0x0d, 0x41, 0x12, 0x0d, 0x04, 0xc2, 0x04, 0xe4, 0x90, 0x7f, 0xcb, 0xf0, 0x80, 0x39, 0x90, 0x7f, + 0xcc, 0xe0, 0x20, 0xe1, 0x32, 0x12, 0x13, 0x6f, 0xef, 0xc3, 0x94, 0x40, 0x50, 0x29, 0x90}}, + {0x0486, 64, { 0x7c, 0xc0, 0xe0, 0x13, 0x92, 0x0a, 0x90, 0x7f, 0xcd, 0xe0, 0x14, 0xf5, 0x19, 0x20, 0x00, 0x11, 0x60, + 0x0f, 0xf5, 0x08, 0x7e, 0x7c, 0x7f, 0xc1, 0x75, 0x0c, 0x7c, 0x75, 0x0d, 0xc1, 0x12, 0x0d, 0x04, + 0xd2, 0x04, 0xe4, 0x90, 0x7f, 0xcd, 0xf0, 0x90, 0x7f, 0xba, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x05, + 0x36, 0x12, 0x12, 0x20, 0x8f, 0x19, 0x12, 0x13, 0x7b, 0x8f, 0x37, 0xe5, 0x19, 0xc3, 0x95}}, + {0x04c6, 64, { 0x3b, 0x50, 0x0f, 0x12, 0x13, 0x57, 0xef, 0x30, 0xe0, 0x08, 0xe5, 0x37, 0x20, 0xe7, 0x03, 0x30, 0x0c, + 0x5e, 0xc2, 0x0c, 0xe5, 0x19, 0x60, 0x58, 0xb4, 0x80, 0x03, 0x43, 0x37, 0x02, 0xe5, 0x37, 0x30, + 0xe7, 0x26, 0xe5, 0x19, 0xd3, 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x08, 0x7e, + 0x7d, 0x7f, 0x80, 0x75, 0x0c, 0x7d, 0x75, 0x0d, 0x80, 0xaf, 0x37, 0x12, 0x0f, 0x84, 0xe5}}, + {0x0506, 64, { 0x19, 0x25, 0xe0, 0x90, 0x7f, 0xbb, 0xf0, 0x80, 0x27, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, + 0x19, 0x3f, 0x85, 0x19, 0x08, 0x90, 0x7d, 0x80, 0xe5, 0x37, 0xf0, 0x7e, 0x7d, 0x7f, 0x81, 0x75, + 0x0c, 0x7d, 0x75, 0x0d, 0x81, 0x12, 0x0d, 0x29, 0xe5, 0x19, 0x04, 0x90, 0x7f, 0xbb, 0xf0, 0x90, + 0x7f, 0xd0, 0xe0, 0x30, 0xe1, 0x06, 0x20, 0x06, 0x03, 0x02, 0x07, 0x97, 0xc2, 0x06, 0xe4}}, + {0x0546, 64, { 0xf5, 0x18, 0x74, 0xc0, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x18, + 0x7c, 0x00, 0x7b, 0x01, 0x7a, 0x7e, 0x79, 0x20, 0x24, 0x20, 0xf9, 0xec, 0x34, 0x7e, 0xfa, 0xef, + 0x12, 0x0e, 0xd2, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x20, 0xd7, 0x90, 0x7e, 0x20, 0xe0, 0x60, 0x68, + 0x90, 0x7e, 0x23, 0xe0, 0x60, 0x24, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x11, 0xfb, 0x7f, 0x03}}, + {0x0586, 64, { 0x7d, 0xcd, 0x12, 0x11, 0xfb, 0x43, 0x47, 0x80, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, + 0xe5, 0x47, 0xf0, 0xe4, 0x90, 0x7e, 0x33, 0xf0, 0x80, 0x30, 0x90, 0x7e, 0x21, 0xe0, 0xff, 0x12, + 0x11, 0x19, 0x90, 0x7e, 0x22, 0xe0, 0xff, 0x12, 0x11, 0x3f, 0x7f, 0x01, 0x90, 0x7e, 0x31, 0xe0, + 0xfd, 0x12, 0x11, 0xfb, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xfb, 0x43, 0x47, 0x80, 0x90}}, + {0x05c6, 64, { 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, + 0xe5, 0x41, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, 0x23, 0xe0, 0x70, 0x06, 0x90, 0x7e, + 0x33, 0xe0, 0x70, 0x08, 0xe4, 0x90, 0x7e, 0x33, 0xf0, 0x75, 0x2e, 0xff, 0x90, 0x7e, 0x25, 0xe0, + 0x60, 0x12, 0xa3, 0xe0, 0x54, 0x3f, 0xf5, 0x45, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90}}, + {0x0606, 64, { 0xc0, 0x00, 0xe5, 0x45, 0xf0, 0x90, 0x7e, 0x27, 0xe0, 0x60, 0x2b, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x43, + 0x80, 0x80, 0x03, 0x53, 0x43, 0x7f, 0x53, 0x43, 0xfc, 0x90, 0x7e, 0x29, 0xe0, 0x60, 0x11, 0x43, + 0x43, 0x02, 0xa3, 0xe0, 0xff, 0x12, 0x11, 0x65, 0x90, 0x7e, 0x2b, 0xe0, 0xff, 0x12, 0x11, 0x8b, + 0xaf, 0x43, 0x12, 0x10, 0xf3, 0x90, 0x7e, 0x23, 0xe0, 0x60, 0x08, 0x53, 0x43, 0x7f, 0xaf}}, + {0x0646, 64, { 0x43, 0x12, 0x10, 0xf3, 0x90, 0x7e, 0x2c, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x02, + 0x80, 0x03, 0x53, 0x47, 0xfd, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, + 0xf0, 0x90, 0x7e, 0x2e, 0xe0, 0x60, 0x18, 0xa3, 0xe0, 0x60, 0x05, 0x43, 0x47, 0x01, 0x80, 0x03, + 0x53, 0x47, 0xfe, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0}}, + {0x0686, 64, { 0x90, 0x7e, 0x32, 0xe0, 0xf5, 0x3b, 0xa3, 0xe0, 0x13, 0x92, 0x0e, 0xa3, 0xe0, 0xf5, 0x3d, 0xa3, 0xe0, + 0x60, 0x05, 0x43, 0x47, 0x10, 0x80, 0x03, 0x53, 0x47, 0xef, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, + 0x90, 0xc0, 0x00, 0xe5, 0x47, 0xf0, 0x90, 0x7e, 0x36, 0xe0, 0x60, 0x32, 0x53, 0x45, 0xbf, 0x90, + 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f}}, + {0x06c6, 64, { 0x98, 0x74, 0x09, 0xf0, 0x12, 0x13, 0x4b, 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0x53, 0x3f, 0xfd, + 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x11, 0xfb, 0xe4, 0xf5, 0x33, 0xf5, 0x32, 0xd2, 0x08, 0x90, 0x7e, + 0x37, 0xe0, 0x60, 0x0f, 0x43, 0x3f, 0x02, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x11, 0xfb, 0x75, 0x32, + 0x01, 0xd2, 0x08, 0x90, 0x7e, 0x38, 0xe0, 0x60, 0x10, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0}}, + {0x0706, 64, { 0xe5, 0x41, 0x44, 0x04, 0x90, 0xc0, 0x00, 0xf0, 0xd2, 0x00, 0x90, 0x7e, 0x39, 0xe0, 0x60, 0x11, 0x43, + 0x45, 0x40, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, + 0x90, 0x7e, 0x3a, 0xe0, 0x60, 0x0f, 0x53, 0x3f, 0xfe, 0xe4, 0xff, 0xad, 0x3f, 0x12, 0x11, 0xfb, + 0x75, 0x34, 0x01, 0xd2, 0x08, 0x90, 0x7e, 0x3b, 0xe0, 0x60, 0x0f, 0x43, 0x3f, 0x01, 0xe4}}, + {0x0746, 64, { 0xff, 0xad, 0x3f, 0x12, 0x11, 0xfb, 0xe4, 0xf5, 0x34, 0xd2, 0x08, 0x90, 0x7e, 0x3c, 0xe0, 0x60, 0x0e, + 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0xe5, 0x41, 0x44, 0x02, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7e, + 0x3d, 0xe0, 0x60, 0x02, 0xd2, 0x0c, 0x90, 0x7e, 0x3e, 0xe0, 0x60, 0x08, 0x75, 0x35, 0x01, 0xe4, + 0xf5, 0x39, 0xd2, 0x08, 0x90, 0x7e, 0x3f, 0xe0, 0x60, 0x11, 0x90, 0x7f, 0xd7, 0x74, 0x13}}, + {0x0786, 64, { 0xf0, 0x74, 0x33, 0xf0, 0x74, 0x16, 0xf0, 0x74, 0x36, 0xf0, 0xd2, 0x04, 0xe4, 0x90, 0x7f, 0xd1, 0xf0, + 0x30, 0x1a, 0x52, 0xe5, 0x39, 0x60, 0x02, 0x15, 0x39, 0x30, 0x13, 0x49, 0xe5, 0x13, 0xd3, 0x94, + 0x00, 0x40, 0x04, 0x15, 0x13, 0x80, 0x3e, 0x75, 0x13, 0x0a, 0x30, 0x1b, 0x02, 0xc2, 0x13, 0x12, + 0x13, 0x4b, 0xef, 0x54, 0x01, 0xf5, 0x19, 0x65, 0x33, 0x60, 0x05, 0x85, 0x19, 0x33, 0xd2}}, + {0x07c6, 64, { 0x08, 0x12, 0x13, 0x87, 0xef, 0x54, 0x80, 0xf5, 0x19, 0x65, 0x2f, 0x60, 0x05, 0x85, 0x19, 0x2f, 0xd2, + 0x08, 0x30, 0x0e, 0x11, 0x12, 0x13, 0x87, 0xef, 0x54, 0x10, 0xf5, 0x19, 0x65, 0x2e, 0x60, 0x05, + 0x85, 0x19, 0x2e, 0xd2, 0x08, 0x30, 0x1a, 0x2a, 0x90, 0x7f, 0xd2, 0xe0, 0x20, 0xe1, 0x23, 0x90, + 0x7b, 0x40, 0xe0, 0x60, 0x09, 0xe0, 0xf5, 0x15, 0x90, 0x7b, 0x42, 0xe0, 0xf5, 0x16, 0x90}}, + {0x0806, 64, { 0x7b, 0x41, 0xe0, 0x60, 0x09, 0x90, 0x7f, 0xd7, 0x74, 0x17, 0xf0, 0x74, 0x37, 0xf0, 0xe4, 0x90, 0x7f, + 0xd3, 0xf0, 0x90, 0x7f, 0xc2, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x09, 0x20, 0xe5, 0x0a, 0x70, 0x40, + 0x30, 0x07, 0x39, 0xe5, 0x38, 0x70, 0x35, 0xc2, 0x07, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, + 0x24, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x8c, 0xff, 0x74, 0x80, 0x25}}, + {0x0846, 64, { 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, + 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x38, 0x10, 0xe4, 0xf5, 0x2c, 0x75, 0x0a, 0x01, 0x22, + 0xe5, 0x0a, 0x64, 0x01, 0x70, 0x40, 0x30, 0x08, 0x39, 0xe5, 0x39, 0x70, 0x35, 0xc2, 0x08, 0xf5, + 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x2d, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12}}, + {0x0886, 64, { 0x0e, 0x8c, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, + 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x09, 0xf0, 0x75, 0x39, 0x10, 0xe4, + 0xf5, 0x35, 0x75, 0x0a, 0x02, 0x22, 0xe5, 0x0a, 0x64, 0x02, 0x70, 0x36, 0x30, 0x14, 0x2f, 0xc2, + 0x14, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x0e, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00}}, + {0x08c6, 64, { 0xfa, 0x12, 0x0e, 0x8c, 0xff, 0x74, 0x80, 0x25, 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, + 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x05, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x05, 0xf0, 0x75, 0x0a, + 0x03, 0x22, 0xe5, 0x15, 0x60, 0x30, 0x15, 0x15, 0xe4, 0xf5, 0x18, 0x7e, 0x00, 0x7b, 0x00, 0x74, + 0x14, 0x25, 0x18, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x0e, 0x8c, 0xff, 0x74, 0x80, 0x25}}, + {0x0906, 64, { 0x18, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x03, 0xdb, + 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, 0xf5, 0x0a, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x0e, + 0xe4, 0x0a, 0x08, 0x00, 0x0a, 0x7c, 0x01, 0x0a, 0xe8, 0x03, 0x09, 0x44, 0x06, 0x09, 0xfb, 0x08, + 0x09, 0xf5, 0x09, 0x09, 0xdd, 0x0a, 0x09, 0xec, 0x0b, 0x00, 0x00, 0x0b, 0x37, 0x90, 0x7f}}, + {0x0946, 64, { 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x19, 0x14, 0x60, 0x61, 0x24, 0x02, 0x60, 0x03, 0x02, 0x09, 0xd3, 0x74, + 0x19, 0x90, 0x7f, 0xd4, 0xf0, 0x74, 0x00, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, + 0xea, 0xe0, 0x70, 0x04, 0x7f, 0x02, 0x80, 0x02, 0x7f, 0x03, 0x75, 0x82, 0x82, 0x75, 0x83, 0x19, + 0xef, 0xf0, 0x75, 0x82, 0x7b, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x74, 0x75, 0x83, 0x19}}, + {0x0986, 64, { 0xf0, 0x75, 0x82, 0x66, 0x75, 0x83, 0x19, 0xf0, 0x75, 0x82, 0x58, 0x75, 0x83, 0x19, 0xf0, 0x90, 0x7f, + 0xea, 0xe0, 0x04, 0x75, 0x82, 0x17, 0x75, 0x83, 0x19, 0xf0, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, + 0x74, 0x12, 0x90, 0x7f, 0xd5, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x0f, + 0x0a, 0xea, 0x49, 0x60, 0x0d, 0xea, 0x90, 0x7f, 0xd4, 0xf0, 0xe9, 0x90, 0x7f, 0xd5, 0xf0}}, + {0x09c6, 64, { 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xb4, 0xe0, + 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0x00, 0xe5, 0x09, 0xf0, 0x90, 0x7f, 0xb5, 0x74, + 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x09, 0x02, 0x0b, 0x3e, 0x12, 0x0b, + 0x46, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0x00, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xb5, 0xf0, 0x02}}, + {0x0a06, 64, { 0x0b, 0x3e, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0x7f, 0x60, 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, + 0xa2, 0x10, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, 0xa2, 0x16, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, + 0xf0, 0xe4, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x3e, 0xe4, 0x90, 0x7f, + 0x00, 0xf0, 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f}}, + {0x0a46, 64, { 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, + 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0x90, 0x7f, 0x00, 0xf0, 0xe4, + 0xa3, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x02, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xb4, 0xe0, 0x44, + 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x1d, 0x24, 0x02}}, + {0x0a86, 64, { 0x60, 0x03, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xea, 0xe0, 0xb4, 0x01, 0x05, 0xc2, 0x10, 0x02, 0x0b, 0x3e, + 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x0b, 0x3e, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x38, + 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, + 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xe4, 0xf0, 0x90, 0x7f}}, + {0x0ac6, 64, { 0xec, 0xe0, 0x54, 0x80, 0xff, 0x13, 0x13, 0x13, 0x54, 0x1f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x90, 0x7f, + 0xd7, 0xf0, 0xe0, 0x44, 0x20, 0xf0, 0x80, 0x5f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, + 0x56, 0x90, 0x7f, 0xe8, 0xe0, 0x24, 0xfe, 0x60, 0x18, 0x24, 0x02, 0x70, 0x4a, 0x90, 0x7f, 0xea, + 0xe0, 0xb4, 0x01, 0x04, 0xd2, 0x10, 0x80, 0x3f, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0}}, + {0x0b06, 64, { 0x80, 0x36, 0x90, 0x7f, 0xea, 0xe0, 0x70, 0x20, 0x90, 0x7f, 0xec, 0xe0, 0xf4, 0x54, 0x80, 0xff, 0xc4, + 0x54, 0x0f, 0xff, 0xe0, 0x54, 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, + 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, + 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0, 0x22}}, + {0x0b46, 64, { 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0x30, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0, 0x90, + 0x7f, 0x95, 0x74, 0xc0, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x3f, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x18, + 0xf0, 0xe4, 0xf5, 0x8e, 0x90, 0x7f, 0xdf, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xde, 0xf0, 0xe4, 0xf5, + 0x24, 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74, 0x24, 0x25, 0x18, 0xf9, 0xe4, 0x34, 0x00, 0xfa}}, + {0x0b86, 64, { 0xe4, 0x12, 0x0e, 0xd2, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xea, 0x75, 0x3a, 0x01, 0xe4, 0xf5, 0x38, + 0xf5, 0x13, 0xf5, 0x36, 0xc2, 0x07, 0xc2, 0x0b, 0xc2, 0x05, 0xc2, 0x00, 0xc2, 0x09, 0xc2, 0x13, + 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x75, 0x44, 0x03, 0x90, 0xc0, 0x00, 0x74, 0x03, 0xf0, 0x7f, + 0x0c, 0xe4, 0xfd, 0x12, 0x11, 0xb1, 0x7f, 0x10, 0x8f, 0x42, 0x12, 0x10, 0x81, 0x90, 0x7f}}, + {0x0bc6, 64, { 0x98, 0x74, 0x12, 0xf0, 0x7f, 0x01, 0x8f, 0x40, 0xef, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x14, 0xf0, 0x75, 0x46, 0x80, 0x90, 0xc0, 0x00, 0x74, 0x80, 0xf0, 0x0f, 0xe4, 0xfd, + 0x12, 0x11, 0xb1, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3e, 0x12, 0x11, 0xb1, 0x90, 0x7f, + 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x11}}, + {0x0c06, 64, { 0xb1, 0x7f, 0x01, 0x12, 0x12, 0x6a, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xb1, 0x20, 0x1b, 0x03, 0x02, + 0x0c, 0xb7, 0x75, 0x2d, 0x01, 0x75, 0x18, 0x01, 0x7b, 0x00, 0x74, 0x2d, 0x25, 0x18, 0xf9, 0xe4, + 0x34, 0x00, 0xfa, 0xe4, 0x12, 0x0e, 0xd2, 0x05, 0x18, 0xe5, 0x18, 0xb4, 0x09, 0xea, 0x75, 0x3b, + 0x01, 0xe4, 0xf5, 0x39, 0xf5, 0x13, 0xf5, 0x37, 0xc2, 0x08, 0xc2, 0x0c, 0xc2, 0x06, 0xc2}}, + {0x0c46, 64, { 0x00, 0xc2, 0x0a, 0xc2, 0x13, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x75, 0x45, 0x03, 0x90, 0xc0, 0x00, + 0x74, 0x03, 0xf0, 0x7f, 0x0c, 0xe4, 0xfd, 0x12, 0x11, 0xfb, 0x7f, 0x10, 0x8f, 0x43, 0x12, 0x10, + 0xf3, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x7f, 0x01, 0x8f, 0x41, 0xef, 0x44, 0x06, 0x90, 0xc0, + 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x75, 0x47, 0x80, 0x90, 0xc0, 0x00, 0x74}}, + {0x0c86, 64, { 0x80, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, 0x11, 0xfb, 0xe4, 0xff, 0x7e, 0xa3, 0xad, 0x06, 0x8d, 0x3f, 0x12, + 0x11, 0xfb, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, + 0x7f, 0x12, 0x11, 0xfb, 0x7f, 0x01, 0x12, 0x12, 0x8b, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x11, 0xfb, + 0xd2, 0x12, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82}}, + {0x0cc6, 64, { 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0xaf, 0x08, - 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00}}, - {0x0d06, 64, { 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x90, 0x7f, 0x98, - 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, + 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, + 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x90, 0x7f}}, + {0x0d06, 64, { 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0x05, 0x86, 0xe0, 0xa3, 0x05, 0x86, 0xf0, 0x05, 0x86, 0xdf, 0xf7, 0xd2, - 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5}}, - {0x0d46, 64, { 0x0c, 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05, 0x86, - 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, + 0xaf, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0xaf, 0x08, 0xe5, 0x0d, 0xf5, 0x82, 0xe5, 0x0c, + 0xf5, 0x83, 0xc2, 0xaf, 0x05, 0x86, 0x90, 0xc0, 0x00, 0xe0, 0x05, 0x86, 0xf0, 0xa3, 0x05}}, + {0x0d46, 64, { 0x86, 0xdf, 0xf7, 0x05, 0x86, 0xd2, 0xaf, 0x22, 0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, - 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd2, 0x19, 0x90, 0x7f, 0x92, 0xe0, 0x44}}, - {0x0d86, 64, { 0x02, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0xff, 0xd3, 0x92, 0x10, 0xe4, 0x33, 0xfe, 0xef, 0x4e, 0xf0, 0xd2, - 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, + 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0xd2, 0x19, 0x90, 0x7f, 0x92, 0xe0, 0x44, 0x02, + 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0xff, 0xd3, 0x92, 0x10, 0xe4, 0x33, 0xfe, 0xef, 0x4e, 0xf0}}, + {0x0d86, 64, { 0xd2, 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91, 0xef, 0x90, - 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x0d, 0xf0, 0xd2, 0xaf}}, - {0x0dc6, 64, { 0xd2, 0x1a, 0x12, 0x12, 0x5c, 0xc2, 0x11, 0xe4, 0xf5, 0x0b, 0xf5, 0x13, 0xc2, 0x17, 0xc2, 0x12, 0x90, - 0x7f, 0xa1, 0x04, 0xf0, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x17, 0x60, 0x10, 0x30, 0x12, 0x05, 0xd2, + 0x7f, 0xaf, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0xe0, 0x44, 0x0d, 0xf0, 0xd2, 0xaf, 0xd2, + 0x1a, 0x12, 0x12, 0x45, 0xc2, 0x11, 0xe4, 0xf5, 0x0b, 0xf5, 0x13, 0xc2, 0x17, 0xc2, 0x12}}, + {0x0dc6, 64, { 0x90, 0x7f, 0xa1, 0x04, 0xf0, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x17, 0x60, 0x10, 0x30, 0x12, 0x05, 0xd2, 0x1a, 0x12, 0x00, 0x46, 0x90, 0x7f, 0xd8, 0xe0, 0xf5, 0x17, 0x80, 0x08, 0x30, 0x12, 0x05, 0xc2, - 0x1a, 0x12, 0x00, 0x46, 0x30, 0x11, 0x07, 0xc2, 0x11, 0x12, 0x09, 0x29, 0x80, 0xd6, 0x30}}, - {0x0e06, 64, { 0x18, 0xd3, 0xc2, 0x18, 0x12, 0x12, 0xf6, 0x80, 0xcc, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, - 0x81, 0x47, 0x02, 0x0e, 0x57, 0x02, 0x0d, 0x7f, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, + 0x1a, 0x12, 0x00, 0x46, 0x30, 0x11, 0x07, 0xc2, 0x11, 0x12, 0x09, 0x21, 0x80, 0xd6, 0x30, 0x18, + 0xd3, 0xc2, 0x18, 0x12, 0x13, 0x93, 0x80, 0xcc, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd}}, + {0x0e06, 64, { 0x75, 0x81, 0x47, 0x02, 0x0e, 0x47, 0x02, 0x0d, 0x6f, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8, 0x54, 0x07, - 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4}}, - {0x0e46, 64, { 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, - 0x90, 0x12, 0xc3, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, + 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, + 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40}}, + {0x0e46, 64, { 0x80, 0x90, 0x12, 0xac, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0, 0x60, 0xa8, - 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5}}, - {0x0e86, 64, { 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, - 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, + 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, + 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca}}, + {0x0e86, 64, { 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, - 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06}}, - {0x0ec6, 64, { 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5, 0x82, - 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, + 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06, 0xe9, + 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5}}, + {0x0ec6, 64, { 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xf0, 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22, 0xd0, 0x83, 0xd0, - 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8}}, - {0x0f06, 64, { 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, - 0xa3, 0x80, 0xdf, 0x8f, 0x18, 0xe4, 0xf5, 0x19, 0x75, 0x1a, 0xff, 0x75, 0x1b, 0x19, 0x75, 0x1c, - 0x86, 0xab, 0x1a, 0xaa, 0x1b, 0xa9, 0x1c, 0x90, 0x00, 0x01, 0x12, 0x0e, 0xb5, 0xb4, 0x03, 0x1d, - 0xaf, 0x19, 0x05, 0x19, 0xef, 0xb5, 0x18, 0x01, 0x22, 0x12, 0x0e, 0x9c, 0x7e, 0x00, 0x29}}, - {0x0f46, 64, { 0xff, 0xee, 0x3a, 0xa9, 0x07, 0x75, 0x1a, 0xff, 0xf5, 0x1b, 0x89, 0x1c, 0x80, 0xd4, 0x7b, 0x00, 0x7a, - 0x00, 0x79, 0x00, 0x22, 0x8f, 0x1a, 0x05, 0x0d, 0xe5, 0x0d, 0xae, 0x0c, 0x70, 0x02, 0x05, 0x0c, + 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, + 0x01, 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3}}, + {0x0f06, 64, { 0xa3, 0xa3, 0x80, 0xdf, 0x8f, 0x18, 0xe4, 0xf5, 0x19, 0x75, 0x1a, 0xff, 0x75, 0x1b, 0x19, 0x75, 0x1c, + 0x86, 0xab, 0x1a, 0xaa, 0x1b, 0xa9, 0x1c, 0x90, 0x00, 0x01, 0x12, 0x0e, 0xa5, 0xb4, 0x03, 0x1d, + 0xaf, 0x19, 0x05, 0x19, 0xef, 0xb5, 0x18, 0x01, 0x22, 0x12, 0x0e, 0x8c, 0x7e, 0x00, 0x29, 0xff, + 0xee, 0x3a, 0xa9, 0x07, 0x75, 0x1a, 0xff, 0xf5, 0x1b, 0x89, 0x1c, 0x80, 0xd4, 0x7b, 0x00}}, + {0x0f46, 64, { 0x7a, 0x00, 0x79, 0x00, 0x22, 0x8f, 0x1a, 0x05, 0x0d, 0xe5, 0x0d, 0xae, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x1a, 0xf0, 0x12, 0x00, 0x36, 0x05, 0x0d, 0xe5, 0x0d, 0xac, - 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5}}, - {0x0f86, 64, { 0x08, 0x60, 0x0a, 0x12, 0x13, 0x3f, 0x8f, 0x1a, 0xef, 0x42, 0x36, 0x80, 0xca, 0x22, 0x8f, 0x1a, 0x05, - 0x0d, 0xe5, 0x0d, 0xae, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x1a, - 0xf0, 0x12, 0x13, 0x57, 0x05, 0x0d, 0xe5, 0x0d, 0xac, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, - 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5, 0x08, 0x60, 0x0a, 0x12, 0x13, 0x93, 0x8f}}, - {0x0fc6, 64, { 0x1a, 0xef, 0x42, 0x37, 0x80, 0xca, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, - 0xc0, 0x86, 0x75, 0x86, 0x00, 0x30, 0x15, 0x04, 0xc2, 0x15, 0x80, 0x02, 0xd2, 0x18, 0x53, 0x91, - 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, - 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0}}, - {0x1006, 64, { 0x86, 0x75, 0x86, 0x00, 0x90, 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, - 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, - 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x11, 0x53, - 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0}}, - {0x1046, 64, { 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, - 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x10, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, - 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, - 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0}}, - {0x1086, 64, { 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, - 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, - 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, - 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0}}, - {0x10c6, 64, { 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, - 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, - 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, - 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90}}, - {0x1106, 64, { 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, - 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, - 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, - 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xef}}, - {0x1146, 64, { 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, - 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x09, - 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, - 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74}}, - {0x1186, 64, { 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, - 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, - 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, 0x00, - 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00}}, - {0x11c6, 64, { 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, - 0x7f, 0x98, 0x74, 0x17, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, - 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, 0x13, 0x27, 0x8f, 0x1a, 0x12, 0x13, 0x27, 0x8f, 0x1b, - 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12, 0x13, 0x27, 0x8f, 0x1a, 0xe5, 0x1a, 0x65, 0x1b}}, - {0x1206, 64, { 0x60, 0x07, 0x12, 0x13, 0x27, 0x8f, 0x1b, 0x80, 0xe8, 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, - 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0f, 0xf0, 0x90, - 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, - 0x12, 0x13, 0x7b, 0x8f, 0x1a, 0x12, 0x13, 0x7b, 0x8f, 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60}}, - {0x1246, 64, { 0x12, 0x12, 0x13, 0x7b, 0x8f, 0x1a, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x07, 0x12, 0x13, 0x7b, 0x8f, 0x1b, - 0x80, 0xe8, 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, - 0x30, 0x1a, 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x12, 0xdf, 0x90, 0x7f, - 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0xe0, 0x44, 0x04, 0xf0, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5}}, - {0x1286, 64, { 0x3e, 0x54, 0x7f, 0xfd, 0x12, 0x11, 0xc8, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xee, - 0xf0, 0xe4, 0xe5, 0x3e, 0x44, 0x80, 0xfd, 0x12, 0x11, 0xc8, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, - 0x3f, 0x54, 0x7f, 0xfd, 0x12, 0x12, 0x12, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, - 0xee, 0xf0, 0xe4, 0xe5, 0x3f, 0x44, 0x80, 0xfd, 0x12, 0x12, 0x12, 0x22, 0x05, 0x0e, 0x02}}, - {0x12c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x03, 0x14, 0x03, 0x00, 0x00, 0xc1, 0x11, 0xc1, 0x18, 0xc1, 0x95, 0xc1, 0x10, - 0xc1, 0x16, 0x01, 0x0a, 0x00, 0xc1, 0x9b, 0x00, 0x8e, 0x18, 0x8f, 0x19, 0xe5, 0x19, 0x15, 0x19, - 0xae, 0x18, 0x70, 0x02, 0x15, 0x18, 0x4e, 0x60, 0x05, 0x12, 0x0d, 0x5e, 0x80, 0xee, 0x22, 0x12, - 0x00, 0x03, 0x12, 0x0d, 0x6f, 0x12, 0x0b, 0x4e, 0x22, 0x02, 0x10, 0x25, 0x00, 0x02, 0x13}}, - {0x1306, 64, { 0x04, 0x00, 0x02, 0x0f, 0xfb, 0x00, 0x02, 0x0f, 0xcd, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, + 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5, 0x08, + 0x60, 0x0a, 0x12, 0x13, 0x27, 0x8f, 0x1a, 0xef, 0x42, 0x36, 0x80, 0xca, 0x22, 0x8f, 0x1a}}, + {0x0f86, 64, { 0x05, 0x0d, 0xe5, 0x0d, 0xae, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x1a, + 0xf0, 0x12, 0x13, 0x3f, 0x05, 0x0d, 0xe5, 0x0d, 0xac, 0x0c, 0x70, 0x02, 0x05, 0x0c, 0x14, 0xf5, + 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x08, 0xe5, 0x08, 0x60, 0x0a, 0x12, 0x13, 0x7b, 0x8f, 0x1a, + 0xef, 0x42, 0x37, 0x80, 0xca, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0}}, + {0x0fc6, 64, { 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90, 0x7f, 0xc4, 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, + 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, + 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, + 0x11, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0}}, + {0x1006, 64, { 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, + 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x18, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, + 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7f, + 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x10}}, + {0x1046, 64, { 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, + 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, + 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, + 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13}}, + {0x1086, 64, { 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xef, + 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, + 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0xe5, 0x44}}, + {0x10c6, 64, { 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0x74, + 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, + 0x74, 0x13, 0xf0, 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x90}}, + {0x1106, 64, { 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, + 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, + 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, + 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90}}, + {0x1146, 64, { 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, + 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, + 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, + 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f}}, + {0x1186, 64, { 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, + 0x90, 0x7f, 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0b, + 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, + 0xe5, 0x44, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x17, 0xf0, 0x90}}, + {0x11c6, 64, { 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, + 0x13, 0x0f, 0x8f, 0x1a, 0x12, 0x13, 0x0f, 0x8f, 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12, + 0x13, 0x0f, 0x8f, 0x1a, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x07, 0x12, 0x13, 0x0f, 0x8f, 0x1b, 0x80, + 0xe8, 0xaf, 0x1a, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0xe5, 0x45, 0x54, 0x7f, 0x90}}, + {0x1206, 64, { 0xc0, 0x00, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x0f, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x7f, 0x98, + 0x74, 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x12, 0x13, 0x63, 0x8f, 0x1a, 0x12, 0x13, + 0x63, 0x8f, 0x1b, 0xe5, 0x1a, 0x65, 0x1b, 0x60, 0x12, 0x12, 0x13, 0x63, 0x8f, 0x1a, 0xe5, 0x1a, + 0x65, 0x1b, 0x60, 0x07, 0x12, 0x13, 0x63, 0x8f, 0x1b, 0x80, 0xe8, 0xaf, 0x1a, 0x22, 0x90}}, + {0x1246, 64, { 0x7f, 0xd6, 0xe0, 0x54, 0xfb, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x1a, 0x04, 0xe0, 0x44, 0x02, 0xf0, + 0x7f, 0xf4, 0x7e, 0x01, 0x12, 0x12, 0xc8, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0xe0, 0x44, + 0x04, 0xf0, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x3e, 0x54, 0x7f, 0xfd, 0x12, 0x11, 0xb1, 0x90, + 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x3e, 0x44, 0x80}}, + {0x1286, 64, { 0xfd, 0x12, 0x11, 0xb1, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x3f, 0x54, 0x7f, 0xfd, 0x12, 0x11, 0xfb, + 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x3f, 0x44, 0x80, + 0xfd, 0x12, 0x11, 0xfb, 0x22, 0x05, 0x0e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x03, 0x14, 0x03, 0x00, + 0x00, 0xc1, 0x11, 0xc1, 0x18, 0xc1, 0x95, 0xc1, 0x10, 0xc1, 0x16, 0x01, 0x0a, 0x00, 0xc1}}, + {0x12c6, 64, { 0x9b, 0x00, 0x8e, 0x18, 0x8f, 0x19, 0xe5, 0x19, 0x15, 0x19, 0xae, 0x18, 0x70, 0x02, 0x15, 0x18, 0x4e, + 0x60, 0x05, 0x12, 0x0d, 0x4e, 0x80, 0xee, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x11, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x12, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, - 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, - 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90}}, - {0x1346, 64, { 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, - 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, - 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x90, 0xc0, - 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff}}, - {0x1386, 64, { 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, - 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, - 0x00, 0xe0, 0xff, 0x22, 0x53, 0xd8, 0xef, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x53, 0xd8, 0xef, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x0f, 0xe7, 0x00, 0x02, 0x13}}, + {0x1306, 64, { 0x04, 0x00, 0x02, 0x0f, 0xbd, 0x00, 0x02, 0x10, 0x0e, 0x90, 0x7f, 0x98, 0x74, 0x13, 0xf0, 0x90, 0xc0, + 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x14, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x15, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x16, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x08, 0xf0, 0x90}}, + {0x1346, 64, { 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x09, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, + 0x90, 0x7f, 0x98, 0x74, 0x0a, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, + 0x0b, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0c, 0xf0, 0x90, 0xc0, + 0x00, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0d, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff}}, + {0x1386, 64, { 0x22, 0x90, 0x7f, 0x98, 0x74, 0x0e, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x12, 0x00, 0x03, 0x12, + 0x0d, 0x5f, 0x12, 0x0b, 0x46, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, {0x13c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -420,7 +425,7 @@ {0x18c6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x00, 0x01, 0xff, 0x00}}, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x01, 0x10, 0x01, 0xff, 0x00}}, {0x1906, 64, { 0x00, 0x40, 0xcd, 0x06, 0x10, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x02, 0x09, 0x02, 0x74, 0x00, 0x01, 0x01, 0x00, 0xa0, 0x32, 0x09, 0x04, 0x00, 0x00, 0x0e, 0xff, 0x00, 0x00, 0x00, 0x07, 0x05, 0x01, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x02, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x03, 0x02, 0x40, @@ -438,5 +443,5 @@ 0x00, 0x42, 0x00, 0x20, 0x00, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x41, 0x00, 0x64, 0x00, 0x61, 0x00, 0x70, 0x00, 0x74, 0x00, 0x65, 0x00}}, {0x1a06, 4, { 0x72, 0x00, 0x00, 0x00}}, -{ 0xffff, 0, {0x00} } + {0xffff, 0, {0x00}} }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa49msg.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa49msg.h --- linux.20pre5/drivers/usb/serial/keyspan_usa49msg.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa49msg.h 2002-09-01 13:39:31.000000000 +0100 @@ -41,14 +41,10 @@ 4th revision: USA49W version - See usa26msg.h for description of message formats - - Third revision: USA28X version (aka USA26) - Buffer formats for RX/TX data messages are not defined by a structure, but are described here: - USB OUT (host -> USA26, transmit) messages contain a + USB OUT (host -> USAxx, transmit) messages contain a REQUEST_ACK indicator (set to 0xff to request an ACK at the completion of transmit; 0x00 otherwise), followed by data: @@ -56,17 +52,28 @@ with a total data length of 63. - USB IN (USA26 -> host, receive) messages contain either a zero - flag (indicating no error in any data bytes): + USB IN (USAxx -> host, receive) messages begin with a status + byte in which the 0x80 bit is either: + + (a) 0x80 bit clear + indicates that the bytes following it are all data + bytes: + + STAT DATA DATA DATA DATA DATA ... + + for a total of up to 63 DATA bytes, + + or: - 00 DAT DAT DAT ... + (b) 0x80 bit set + indiates that the bytes following alternate data and + status bytes: - for a total of 63 data bytes, or a non-zero status flag (indicating - that all data bytes will be preceded by status flag): + STAT DATA STAT DATA STAT DATA STAT DATA ... - STAT DAT STAT DAT STAT DAT ... + for a total of up to 32 DATA bytes. - for a total of 32 data bytes. The valid bits in the STAT bytes are: + The valid bits in the STAT bytes are: OVERRUN 0x02 PARITY 0x04 @@ -75,9 +82,19 @@ Notes: - 1. a "no status" RX data message (first byte zero) can serve as - a "break off" indicator. - 2. a control message specifying disablePort will be answered + (1) The OVERRUN bit can appear in either (a) or (b) format + messages, but the but the PARITY/FRAMING/BREAK bits + only appear in (b) format messages. + (2) For the host to determine the exact point at which the + overrun occurred (to identify the point in the data + stream at which the data was lost), it needs to count + 128 characters, starting at the first character of the + message in which OVERRUN was reported; the lost character(s) + would have been received between the 128th and 129th + characters. + (3) An RX data message in which the first byte has 0x80 clear + serves as a "break off" indicator. + (4) a control message specifying disablePort will be answered with a status message, but no further status will be sent until a control messages with enablePort is sent @@ -92,6 +109,7 @@ 2000mar09 change to support 4 ports 2000may03 change external clocking to match USA-49W hardware 2000jun01 add extended BSD-style copyright text + 2001jul05 change message format to improve OVERRUN case */ #ifndef __USA49MSG__ @@ -107,7 +125,7 @@ 0x80 globalControlMessage */ -typedef struct keyspan_usa49_portControlMessage +struct keyspan_usa49_portControlMessage { /* 0. 0/1/2/3 port control message follows @@ -173,7 +191,7 @@ enablePort, // start servicing port (move data, check status) disablePort; // stop servicing port (does implicit tx/rx flush/off) -} keyspan_usa49_portControlMessage; +}; // defines for bits in lcr #define USA_DATABITS_5 0x00 @@ -201,7 +219,7 @@ sends any control message (either global or port-specific). */ -typedef struct keyspan_usa49_globalControlMessage +struct keyspan_usa49_globalControlMessage { u8 portNumber, // 0x80 sendGlobalStatus, // 1/2=number of status responses requested @@ -209,7 +227,7 @@ resetStatusCount, // a cycling value remoteWakeupEnable, // 0x10=P1, 0x20=P2, 0x40=P3, 0x80=P4 disableStatusMessages; // 1=send no status until host talks -} keyspan_usa49_globalControlMessage; +}; /* Device->host messages send on the global status endpoint @@ -221,7 +239,7 @@ 0x81 globalDebugMessage */ -typedef struct keyspan_usa49_portStatusMessage // one for each port +struct keyspan_usa49_portStatusMessage // one for each port { u8 portNumber, // 0,1,2,3 cts, // reports CTS pin @@ -234,7 +252,7 @@ controlResponse,// 1=a control message has been processed txAck, // ACK (data TX complete) rs232valid; // RS-232 signal valid -} keyspan_usa49_portStatusMessage; +}; // bits in RX data message when STAT byte is included #define RXERROR_OVERRUN 0x02 @@ -242,19 +260,19 @@ #define RXERROR_FRAMING 0x08 #define RXERROR_BREAK 0x10 -typedef struct keyspan_usa49_globalStatusMessage +struct keyspan_usa49_globalStatusMessage { u8 portNumber, // 0x80=globalStatusMessage sendGlobalStatus, // from request, decremented resetStatusCount; // as in request -} keyspan_usa49_globalStatusMessage; +}; -typedef struct keyspan_usa49_globalDebugMessage +struct keyspan_usa49_globalDebugMessage { u8 portNumber, // 0x81=globalDebugMessage n, // typically a count/status byte b; // typically a data byte -} keyspan_usa49_globalDebugMessage; +}; // ie: the maximum length of an EZUSB endpoint buffer #define MAX_DATA_LEN 64 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/keyspan_usa49w_fw.h linux.20pre5-ac2/drivers/usb/serial/keyspan_usa49w_fw.h --- linux.20pre5/drivers/usb/serial/keyspan_usa49w_fw.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/keyspan_usa49w_fw.h 2002-09-01 13:39:31.000000000 +0100 @@ -1,43 +1,47 @@ /* keyspan_usa49w_fw.h - - Generated from Keyspan firmware image usa49code.h Sat Oct 6 12:06:59 EST 2001 - This firmware is for the Keyspan USA-49W Serial Adaptor - "The firmware contained herein as keyspan_usa49w_fw.h is - Copyright (C) 1999-2001 Keyspan, A division of InnoSys Incorporated - ("Keyspan"), as an unpublished work. This notice does not imply - unrestricted or public access to this firmware which is a trade secret of - Keyspan, and which may not be reproduced, used, sold or transferred to any - third party without Keyspan's prior written consent. All Rights Reserved. + The firmware contained herein as keyspan_usa49w_fw.h is - This firmware may not be modified and may only be used with the Keyspan - USA-49W Serial Adapter. Distribution and/or Modification of the - keyspan.c driver which includes this firmware, in whole or in part, - requires the inclusion of this statement." + Copyright (C) 1999-2001 + Keyspan, A division of InnoSys Incorporated ("Keyspan") + + as an unpublished work. This notice does not imply unrestricted or + public access to the source code from which this firmware image is + derived. Except as noted below this firmware image may not be + reproduced, used, sold or transferred to any third party without + Keyspan's prior written consent. All Rights Reserved. + + Permission is hereby granted for the distribution of this firmware + image as part of a Linux or other Open Source operating system kernel + in text or binary form as required. + + This firmware may not be modified and may only be used with + Keyspan hardware. Distribution and/or Modification of the + keyspan.c driver which includes this firmware, in whole or in + part, requires the inclusion of this statement." */ static const struct ezusb_hex_record keyspan_usa49w_firmware[] = { - {0x7f92, 1, { 0x01}}, - {0x0033, 3, { 0x02, 0x18, 0xfc}}, + {0x0033, 3, { 0x02, 0x18, 0xfb}}, {0x0036, 12, { 0x90, 0x78, 0x41, 0x74, 0x01, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22}}, {0x0046, 16, { 0xe4, 0xff, 0x74, 0x40, 0x2f, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xe0, 0xfe, 0xe5, 0x15}}, {0x0056, 16, { 0x24, 0x04, 0xfd, 0xe4, 0x35, 0x14, 0xfa, 0xa9, 0x05, 0x7b, 0x01, 0xef, 0x7c, 0x00, 0x29, 0xf9}}, - {0x0066, 16, { 0xec, 0x3a, 0xfa, 0xee, 0x12, 0x11, 0xf6, 0x0f, 0xbf, 0x22, 0xd7, 0xe5, 0x15, 0x24, 0x05, 0xf5}}, + {0x0066, 16, { 0xec, 0x3a, 0xfa, 0xee, 0x12, 0x11, 0xf1, 0x0f, 0xbf, 0x22, 0xd7, 0xe5, 0x15, 0x24, 0x05, 0xf5}}, {0x0076, 16, { 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x70, 0x03, 0x02, 0x01, 0x34, 0xe5, 0x15, 0x24, 0x09}}, {0x0086, 16, { 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x70, 0x0e, 0xe5, 0x15, 0x24, 0x0a, 0xf5, 0x82}}, - {0x0096, 16, { 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x18, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x16, 0x4c, 0xe5}}, + {0x0096, 16, { 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x18, 0x7f, 0x01, 0xe4, 0xfd, 0x12, 0x16, 0x47, 0xe5}}, {0x00a6, 16, { 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0xcf, 0xf0, 0x80, 0x41}}, - {0x00b6, 16, { 0xe5, 0x15, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0x12, 0x16, 0x7b}}, + {0x00b6, 16, { 0xe5, 0x15, 0x24, 0x06, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0x12, 0x16, 0x76}}, {0x00c6, 16, { 0xe5, 0x15, 0x24, 0x07, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0x12, 0x00, 0x03}}, {0x00d6, 16, { 0x7f, 0x01, 0xe5, 0x15, 0x24, 0x08, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xfd, 0x12}}, - {0x00e6, 16, { 0x16, 0x4c, 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x30}}, + {0x00e6, 16, { 0x16, 0x47, 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x30}}, {0x00f6, 16, { 0xf0, 0xe5, 0x15, 0x24, 0x39, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x80, 0xf0}}, {0x0003, 16, { 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x78, 0x41, 0x74}}, {0x0013, 16, { 0x01, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0xe5, 0x15, 0x24}}, {0x0023, 16, { 0x37, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22}}, {0x0043, 3, { 0x02, 0x1b, 0x00}}, - {0x0000, 3, { 0x02, 0x10, 0x9a}}, + {0x0000, 3, { 0x02, 0x10, 0x95}}, {0x0106, 64, { 0x90, 0x78, 0x41, 0x74, 0x04, 0xf0, 0xe5, 0x15, 0x24, 0x39, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x02, 0xf0, 0xe5, 0x15, 0x24, 0x36, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0xe5, 0x15, 0x24, @@ -49,16 +53,16 @@ {0x0186, 64, { 0x15, 0x24, 0x17, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x11, 0xe5, 0x15, 0x24, 0x32, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x04, 0xf0, 0x80, 0x0f, 0xe5, 0x15, 0x24, 0x32, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0xfb, 0xf0, 0xe4, 0xff, 0xe5, 0x15, - 0x24, 0x32, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xfd, 0x12, 0x16, 0x4c, 0xe5}}, + 0x24, 0x32, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xfd, 0x12, 0x16, 0x47, 0xe5}}, {0x01c6, 64, { 0x15, 0x24, 0x0e, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x11, 0xe5, 0x15, 0x24, 0x33, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x80, 0xf0, 0x80, 0x0f, 0xe5, 0x15, 0x24, 0x33, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0xf0, 0xe5, 0x15, 0x24, 0x33, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0xfc, 0xf0, 0xe5, 0x15, 0x24, 0x0f}}, {0x0206, 64, { 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x2f, 0xe5, 0x15, 0x24, 0x33, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x15, 0x24, 0x10, 0xf5, 0x82, 0xe4, 0x35, - 0x14, 0xf5, 0x83, 0xe0, 0xff, 0x12, 0x15, 0xec, 0xe5, 0x15, 0x24, 0x11, 0xf5, 0x82, 0xe4, 0x35, - 0x14, 0xf5, 0x83, 0xe0, 0xff, 0x12, 0x16, 0x1c, 0xe5, 0x15, 0x24, 0x33, 0xf5, 0x82, 0xe4}}, - {0x0246, 64, { 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0x12, 0x15, 0xbc, 0xe5, 0x15, 0x24, 0x14, 0xf5, 0x82, 0xe4, 0x35, + 0x14, 0xf5, 0x83, 0xe0, 0xff, 0x12, 0x15, 0xe7, 0xe5, 0x15, 0x24, 0x11, 0xf5, 0x82, 0xe4, 0x35, + 0x14, 0xf5, 0x83, 0xe0, 0xff, 0x12, 0x16, 0x17, 0xe5, 0x15, 0x24, 0x33, 0xf5, 0x82, 0xe4}}, + {0x0246, 64, { 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0x12, 0x15, 0xb7, 0xe5, 0x15, 0x24, 0x14, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x44, 0xe5, 0x15, 0x24, 0x15, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x11, 0xe5, 0x15, 0x24, 0x39, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x0f, 0xe5, 0x15, 0x24, 0x39, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5}}, @@ -84,12 +88,12 @@ 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0xe5, 0x15, 0x24, 0x37, 0xf5, 0x82, 0xe4, 0x35, 0x14}}, {0x03c6, 64, { 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x01, 0xf0, 0x12, 0x00, 0x36, 0xef, 0x54, 0xfe, 0x90, 0xc0, 0x00, 0xf0, 0xe5, 0x15, 0x24, 0x32, 0xf5, 0x82, 0xe4, 0x35, - 0x14, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0xff, 0xf0, 0xfd, 0xe4, 0xff, 0x12, 0x16, 0x4c, 0xe5, 0x15, + 0x14, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0xff, 0xf0, 0xfd, 0xe4, 0xff, 0x12, 0x16, 0x47, 0xe5, 0x15, 0x24, 0x2c, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x15, 0x24, 0x2b}}, {0x0406, 64, { 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x16, 0x42, 0x13, 0xe5, 0x15, 0x24, 0x1b, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x70, 0x0e, 0xe5, 0x15, 0x24, 0x25, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x28, 0xe5, 0x15, 0x24, 0x32, 0xf5, 0x82, 0xe4, 0x35, - 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x02, 0xff, 0xf0, 0xfd, 0xe4, 0xff, 0x12, 0x16, 0x4c, 0xe5}}, + 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x02, 0xff, 0xf0, 0xfd, 0xe4, 0xff, 0x12, 0x16, 0x47, 0xe5}}, {0x0446, 64, { 0x15, 0x24, 0x2b, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0xe5, 0x16, 0x42, 0x13, 0xe5, 0x15, 0x24, 0x1c, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0x70, 0x0e, 0xe5, 0x15, 0x24, 0x25, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x2a, 0x90, 0x78, 0x41, @@ -100,12 +104,12 @@ 0xe0, 0x44, 0x40, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0xe5, 0x15, 0x24, 0x37, 0xf5}}, {0x04c6, 64, { 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0xe5, 0x15, 0x24, 0x1e, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x28, 0xe5, 0x15, 0x24, 0x32, 0xf5, 0x82, - 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0xfe, 0xff, 0xf0, 0xfd, 0xe4, 0xff, 0x12, 0x16, 0x4c, + 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0xfe, 0xff, 0xf0, 0xfd, 0xe4, 0xff, 0x12, 0x16, 0x47, 0xe5, 0x15, 0x24, 0x2d, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0xe5}}, {0x0506, 64, { 0x16, 0x42, 0x13, 0xe5, 0x15, 0x24, 0x1f, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x70, 0x0e, 0xe5, 0x15, 0x24, 0x25, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x27, 0xe5, 0x15, 0x24, 0x32, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x01, 0xff, 0xf0, 0xfd, 0xe4, - 0xff, 0x12, 0x16, 0x4c, 0xe5, 0x15, 0x24, 0x2d, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83}}, + 0xff, 0x12, 0x16, 0x47, 0xe5, 0x15, 0x24, 0x2d, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83}}, {0x0546, 64, { 0xe4, 0xf0, 0xe5, 0x16, 0x42, 0x13, 0xe5, 0x15, 0x24, 0x20, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x70, 0x0e, 0xe5, 0x15, 0x24, 0x25, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x18, 0x90, 0x78, 0x41, 0x74, 0x02, 0xf0, 0xe5, 0x15, 0x24, 0x36, 0xf5, 0x82, 0xe4, 0x35, 0x14, @@ -115,12 +119,12 @@ 0x83, 0xe0, 0x60, 0x1f, 0xe5, 0x15, 0x24, 0x2e, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0xe5, 0x15, 0x24, 0x3a, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe4, 0xf0}}, {0x05c6, 64, { 0xe5, 0x16, 0x42, 0x13, 0xe5, 0x15, 0x24, 0x23, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, - 0x03, 0x12, 0x18, 0x91, 0xe5, 0x15, 0x24, 0x24, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, + 0x03, 0x12, 0x18, 0x85, 0xe5, 0x15, 0x24, 0x24, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x1b, 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x08, 0xf0, 0x90, 0x7f, 0x98, 0xe0, 0xff, 0xe5, 0x16, 0xf4, 0xfe, 0xef, 0x5e, 0xf0, 0xe5, 0x15}}, {0x0606, 64, { 0x24, 0x25, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x16, 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0xf7, 0xf0, 0x90, 0x7f, 0x98, 0xe0, 0x45, 0x16, - 0xf0, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x12, 0x08, 0x07, 0x83, 0x00, 0x07, 0xf7, 0x01, 0x08, + 0xf0, 0x22, 0x90, 0x7f, 0xe9, 0xe0, 0x12, 0x12, 0x03, 0x07, 0x83, 0x00, 0x07, 0xf7, 0x01, 0x08, 0x63, 0x03, 0x06, 0x4c, 0x06, 0x07, 0x74, 0x08, 0x07, 0x68, 0x09, 0x07, 0x50, 0x0a, 0x07}}, {0x0646, 64, { 0x5f, 0x0b, 0x00, 0x00, 0x08, 0xb2, 0x90, 0x7f, 0xeb, 0xe0, 0x24, 0xfe, 0x60, 0x1c, 0x14, 0x70, 0x03, 0x02, 0x06, 0xfe, 0x24, 0x02, 0x60, 0x03, 0x02, 0x07, 0x46, 0x74, 0x19, 0x90, 0x7f, 0xd4, 0xf0, @@ -133,14 +137,14 @@ {0x06c6, 64, { 0xfe, 0x90, 0x7f, 0xee, 0xe0, 0x7c, 0x00, 0x24, 0x00, 0xf5, 0x19, 0xec, 0x3e, 0xf5, 0x18, 0x75, 0x33, 0x19, 0x75, 0x34, 0x12, 0x75, 0x82, 0x14, 0x75, 0x83, 0x19, 0xe0, 0x75, 0x27, 0x00, 0xf5, 0x28, 0xd3, 0xe5, 0x28, 0x95, 0x19, 0xe5, 0x27, 0x95, 0x18, 0x40, 0x06, 0x85, 0x18, 0x27, 0x85, 0x19, - 0x28, 0x12, 0x13, 0x17, 0x02, 0x08, 0xb9, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x14, 0x30}}, + 0x28, 0x12, 0x13, 0x12, 0x02, 0x08, 0xb9, 0x90, 0x7f, 0xea, 0xe0, 0xff, 0x12, 0x14, 0x2b}}, {0x0706, 64, { 0xea, 0x49, 0x60, 0x32, 0x90, 0x7f, 0xee, 0xe0, 0x75, 0x18, 0x00, 0xf5, 0x19, 0xae, 0x02, 0xaf, 0x01, 0x8e, 0x33, 0x8f, 0x34, 0x8f, 0x82, 0x8e, 0x83, 0xe0, 0xfe, 0xa3, 0xe0, 0x8e, 0x27, 0xf5, 0x28, 0xd3, 0x95, 0x19, 0xe5, 0x27, 0x95, 0x18, 0x40, 0x06, 0x85, 0x18, 0x27, 0x85, 0x19, 0x28, 0x12, - 0x13, 0x17, 0x02, 0x08, 0xb9, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x08, 0xb9}}, + 0x13, 0x12, 0x02, 0x08, 0xb9, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x08, 0xb9}}, {0x0746, 64, { 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x02, 0x08, 0xb9, 0x90, 0x7f, 0x00, 0xe5, 0x25, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x08, 0xb9, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x25, 0x02, 0x08, - 0xb9, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x22, 0x12, 0x0a, 0xbd, 0x02, 0x08, 0xb9, 0x90, 0x7f, 0x00, + 0xb9, 0x90, 0x7f, 0xea, 0xe0, 0xf5, 0x22, 0x12, 0x0a, 0xb8, 0x02, 0x08, 0xb9, 0x90, 0x7f, 0x00, 0xe5, 0x22, 0xf0, 0x90, 0x7f, 0xb5, 0x74, 0x01, 0xf0, 0x02, 0x08, 0xb9, 0x90, 0x7f, 0xe8}}, {0x0786, 64, { 0xe0, 0x24, 0x7f, 0x60, 0x24, 0x14, 0x60, 0x31, 0x24, 0x02, 0x70, 0x5b, 0xa2, 0x00, 0xe4, 0x33, 0xff, 0x25, 0xe0, 0xff, 0xa2, 0x06, 0xe4, 0x33, 0x4f, 0x90, 0x7f, 0x00, 0xf0, 0xe4, 0xa3, 0xf0, 0x90, @@ -162,266 +166,266 @@ 0x07, 0x2f, 0x25, 0xe0, 0x24, 0xb4, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x80, 0x10, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x80, 0x07, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xb4, 0xe0, 0x44, 0x02, 0xf0, 0x22, 0xe5, 0x11, 0x54, 0x0f, 0x70}}, - {0x08c6, 64, { 0x03, 0x02, 0x09, 0xb2, 0x12, 0x16, 0xaa, 0xef, 0x20, 0xe1, 0x75, 0x12, 0x17, 0x08, 0xef, 0x14, 0xf5, - 0x19, 0x12, 0x18, 0xd8, 0xef, 0x25, 0x19, 0xff, 0xe4, 0x33, 0xfe, 0xc3, 0xef, 0x94, 0x80, 0xee, + {0x08c6, 64, { 0x03, 0x02, 0x09, 0xb2, 0x12, 0x16, 0xa5, 0xef, 0x20, 0xe1, 0x75, 0x12, 0x17, 0x03, 0xef, 0x14, 0xf5, + 0x19, 0x12, 0x18, 0xcc, 0xef, 0x25, 0x19, 0xff, 0xe4, 0x33, 0xfe, 0xc3, 0xef, 0x94, 0x80, 0xee, 0x64, 0x80, 0x94, 0x80, 0x50, 0x59, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0xe0, 0xfe, 0xa3, 0xe0, 0xff, 0xf5, 0x82, 0x8e, 0x83, 0xe0, 0x30, 0xe0, 0x11, 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82}}, {0x0906, 64, { 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x80, 0xf0, 0x80, 0x0f, 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0xf0, 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x20, 0xe2, 0x12, 0xe5, 0x19, 0x60, 0x0e, 0xf5, 0x23, 0xef, 0x24, - 0x01, 0xf5, 0x2d, 0xe4, 0x3e, 0xf5, 0x2c, 0x12, 0x14, 0xb2, 0xe4, 0xff, 0x12, 0x14, 0xe8}}, + 0x01, 0xf5, 0x2d, 0xe4, 0x3e, 0xf5, 0x2c, 0x12, 0x14, 0xad, 0xe4, 0xff, 0x12, 0x14, 0xe3}}, {0x0946, 64, { 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x30, 0xe7, 0x5d, 0x12, 0x18, - 0xd8, 0xe5, 0x15, 0x24, 0x3b, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xfe, 0xef, 0xc3, + 0xcc, 0xe5, 0x15, 0x24, 0x3b, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xfe, 0xef, 0xc3, 0x9e, 0x50, 0x48, 0xe5, 0x15, 0x24, 0x2f, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7b}}, {0x0986, 64, { 0xf0, 0xe5, 0x15, 0x24, 0x3a, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x16, 0x42, 0x13, 0x90, 0x7f, 0xc2, 0xe0, 0x30, 0xe1, 0x10, 0xe5, 0x15, 0x24, 0x26, 0xf5, 0x82, 0xe4, 0x35, - 0x14, 0xf5, 0x83, 0xe0, 0xf5, 0x24, 0x80, 0x03, 0x12, 0x12, 0xa6, 0x12, 0x16, 0xd9, 0xef, 0x30, - 0xe1, 0x03, 0x02, 0x0a, 0xbc, 0xe5, 0x15, 0x24, 0x38, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5}}, - {0x09c6, 64, { 0x83, 0xe0, 0x54, 0x80, 0xf0, 0xe5, 0x15, 0x24, 0x38, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xc0, - 0x83, 0xc0, 0x82, 0xe0, 0xfe, 0x12, 0x18, 0xe4, 0xee, 0x4f, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0x12, - 0x17, 0xde, 0x8f, 0x19, 0xe5, 0x15, 0x24, 0x35, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, - 0xfe, 0xef, 0xc3, 0x9e, 0x50, 0x28, 0x12, 0x18, 0xc0, 0xef, 0x30, 0xe0, 0x21, 0xe5, 0x15}}, - {0x0a06, 64, { 0x24, 0x38, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x20, 0xe7, 0x12, 0xe5, 0x15, 0x24, 0x31, - 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x20, 0xe1, 0x03, 0x02, 0x0a, 0xbc, 0xe5, 0x15, - 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0xfd, 0xf0, 0xe5, 0x19, 0x70, - 0x0e, 0xe5, 0x15, 0x24, 0x38, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe4, 0xf0, 0x22}}, - {0x0a46, 64, { 0xe5, 0x15, 0x24, 0x38, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0x30, 0xe7, 0x29, 0xe5, - 0x19, 0xd3, 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x23, 0x85, 0x15, 0x82, 0x85, - 0x14, 0x83, 0xa3, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0x8c, 0x2c, 0xf5, 0x2d, 0x12, 0x13, 0xe2, 0xe5, - 0x19, 0x25, 0xe0, 0xff, 0x12, 0x15, 0x1e, 0x22, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03}}, - {0x0a86, 64, { 0x75, 0x19, 0x3f, 0x85, 0x19, 0x23, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0xa3, 0xa3, 0xe0, 0xfe, 0xa3, - 0xe0, 0xf5, 0x82, 0x8e, 0x83, 0xe4, 0xf0, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0xa3, 0xa3, 0xe0, - 0xfe, 0xa3, 0xe0, 0x24, 0x01, 0xf5, 0x2d, 0xe4, 0x3e, 0xf5, 0x2c, 0x12, 0x14, 0x71, 0xe5, 0x19, - 0x04, 0xff, 0x12, 0x15, 0x1e, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74}}, - {0x0ac6, 64, { 0xf0, 0xf0, 0x90, 0x7f, 0x96, 0xf0, 0xe4, 0x90, 0x7f, 0x94, 0xf0, 0x90, 0x78, 0x4a, 0x04, 0xf0, 0xf5, - 0x8e, 0x90, 0x7f, 0x95, 0x74, 0xc0, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x3f, 0xf0, 0x90, 0x7f, 0x98, - 0x74, 0x1f, 0xf0, 0x90, 0x78, 0x43, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x78, 0x41, 0xf0, 0x90, 0x7f, - 0xdf, 0x74, 0x9f, 0xf0, 0x90, 0x7f, 0xde, 0xf0, 0x90, 0x7f, 0x92, 0xe0, 0x44, 0x02, 0xf0}}, - {0x0b06, 64, { 0x7e, 0x7b, 0x7f, 0xc0, 0x75, 0x14, 0x7b, 0x75, 0x15, 0xc0, 0x90, 0x7f, 0x96, 0x74, 0xef, 0xf0, 0x75, - 0x16, 0x01, 0x12, 0x0f, 0x17, 0x7e, 0x7b, 0x7f, 0xc0, 0x75, 0x14, 0x7b, 0x75, 0x15, 0xc0, 0x90, - 0x7f, 0x96, 0x74, 0xef, 0xf0, 0x75, 0x16, 0x01, 0xe5, 0x15, 0x24, 0x26, 0xf5, 0x82, 0xe4, 0x35, - 0x14, 0xf5, 0x83, 0xe4, 0xf0, 0x7e, 0x7e, 0x7f, 0x40, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83}}, - {0x0b46, 64, { 0x74, 0x7e, 0xf0, 0xa3, 0x74, 0x40, 0xf0, 0x7e, 0x7e, 0x7f, 0x80, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, - 0xa3, 0xa3, 0x74, 0x7e, 0xf0, 0xa3, 0x74, 0x80, 0xf0, 0x7e, 0x7c, 0x7f, 0x00, 0x75, 0x14, 0x7c, - 0x75, 0x15, 0x00, 0x90, 0x7f, 0x96, 0x74, 0xdf, 0xf0, 0x75, 0x16, 0x02, 0x12, 0x0f, 0x17, 0x7e, - 0x7c, 0x7f, 0x00, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x00, 0x90, 0x7f, 0x96, 0x74, 0xdf, 0xf0}}, - {0x0b86, 64, { 0x75, 0x16, 0x02, 0xe5, 0x15, 0x24, 0x26, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74, 0x01, 0xf0, - 0x7e, 0x7d, 0x7f, 0xc0, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0x74, 0x7d, 0xf0, 0xa3, 0x74, 0xc0, - 0xf0, 0x7e, 0x7e, 0x7f, 0x00, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0xa3, 0xa3, 0x74, 0x7e, 0xf0, - 0xa3, 0x74, 0x00, 0xf0, 0x7e, 0x7c, 0x7f, 0x40, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x40, 0x90}}, - {0x0bc6, 64, { 0x7f, 0x96, 0x74, 0xbf, 0xf0, 0x75, 0x16, 0x04, 0x12, 0x0f, 0x17, 0x7e, 0x7c, 0x7f, 0x40, 0x75, 0x14, - 0x7c, 0x75, 0x15, 0x40, 0x90, 0x7f, 0x96, 0x74, 0xbf, 0xf0, 0x75, 0x16, 0x04, 0xe5, 0x15, 0x24, - 0x26, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74, 0x02, 0xf0, 0x7e, 0x7d, 0x7f, 0x40, 0x85, - 0x15, 0x82, 0x85, 0x14, 0x83, 0x74, 0x7d, 0xf0, 0xa3, 0x74, 0x40, 0xf0, 0x7e, 0x7d, 0x7f}}, - {0x0c06, 64, { 0x80, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0xa3, 0xa3, 0x74, 0x7d, 0xf0, 0xa3, 0x74, 0x80, 0xf0, 0x7e, - 0x7c, 0x7f, 0x80, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x80, 0x90, 0x7f, 0x96, 0x74, 0x7f, 0xf0, 0x75, - 0x16, 0x08, 0x12, 0x0f, 0x17, 0x7e, 0x7c, 0x7f, 0x80, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x80, 0x90, - 0x7f, 0x96, 0x74, 0x7f, 0xf0, 0x75, 0x16, 0x08, 0xe5, 0x15, 0x24, 0x26, 0xf5, 0x82, 0xe4}}, - {0x0c46, 64, { 0x35, 0x14, 0xf5, 0x83, 0x74, 0x03, 0xf0, 0x7e, 0x7c, 0x7f, 0xc0, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, - 0x74, 0x7c, 0xf0, 0xa3, 0x74, 0xc0, 0xf0, 0x7e, 0x7d, 0x7f, 0x00, 0x85, 0x15, 0x82, 0x85, 0x14, - 0x83, 0xa3, 0xa3, 0x74, 0x7d, 0xf0, 0xa3, 0x74, 0x00, 0xf0, 0xc2, 0x0a, 0xc2, 0x09, 0xd2, 0x02, - 0x22, 0xe5, 0x10, 0x04, 0x54, 0x03, 0xf5, 0x10, 0x14, 0x60, 0x1f, 0x14, 0x60, 0x31, 0x14}}, - {0x0c86, 64, { 0x60, 0x43, 0x24, 0x03, 0x70, 0x52, 0x7e, 0x7b, 0x7f, 0xc0, 0x75, 0x14, 0x7b, 0x75, 0x15, 0xc0, 0x90, - 0x7f, 0x96, 0x74, 0xef, 0xf0, 0x75, 0x16, 0x01, 0x80, 0x3d, 0x7e, 0x7c, 0x7f, 0x00, 0x75, 0x14, - 0x7c, 0x75, 0x15, 0x00, 0x90, 0x7f, 0x96, 0x74, 0xdf, 0xf0, 0x75, 0x16, 0x02, 0x80, 0x28, 0x7e, + 0x14, 0xf5, 0x83, 0xe0, 0xf5, 0x24, 0x80, 0x03, 0x12, 0x12, 0xa1, 0x12, 0x16, 0xd4, 0xef, 0x30, + 0xe1, 0x03, 0x02, 0x0a, 0xb7, 0x12, 0x17, 0xd2, 0x8f, 0x19, 0x12, 0x18, 0xd8, 0xe5, 0x15}}, + {0x09c6, 64, { 0x24, 0x38, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xef, 0xf0, 0xe5, 0x15, 0x24, 0x35, 0xf5, 0x82, + 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x19, 0xc3, 0x9f, 0x50, 0x28, 0x12, 0x18, 0xb4, + 0xef, 0x30, 0xe0, 0x21, 0xe5, 0x15, 0x24, 0x38, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, + 0x20, 0xe7, 0x12, 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0}}, + {0x0a06, 64, { 0x20, 0xe1, 0x03, 0x02, 0x0a, 0xb7, 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, + 0xe0, 0x54, 0xfd, 0xf0, 0xe5, 0x19, 0x70, 0x03, 0x02, 0x0a, 0xb7, 0xb4, 0x80, 0x0f, 0xe5, 0x15, + 0x24, 0x38, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x02, 0xf0, 0xe5, 0x15, 0x24, + 0x38, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0x30, 0xe7, 0x29, 0xe5, 0x19}}, + {0x0a46, 64, { 0xd3, 0x94, 0x20, 0x40, 0x03, 0x75, 0x19, 0x20, 0x85, 0x19, 0x23, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, + 0xa3, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0x8c, 0x2c, 0xf5, 0x2d, 0x12, 0x13, 0xdd, 0xe5, 0x19, 0x25, + 0xe0, 0xff, 0x12, 0x15, 0x19, 0x22, 0xe5, 0x19, 0xd3, 0x94, 0x3f, 0x40, 0x03, 0x75, 0x19, 0x3f, + 0x85, 0x19, 0x23, 0xe5, 0x15, 0x24, 0x38, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0}}, + {0x0a86, 64, { 0xff, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0xa3, 0xa3, 0xe0, 0xfc, 0xa3, 0xe0, 0xf5, 0x82, 0x8c, 0x83, + 0xef, 0xf0, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0xa3, 0xa3, 0xe0, 0xfe, 0xa3, 0xe0, 0x24, 0x01, + 0xf5, 0x2d, 0xe4, 0x3e, 0xf5, 0x2c, 0x12, 0x14, 0x6c, 0xe5, 0x19, 0x04, 0xff, 0x12, 0x15, 0x19, + 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0xf0, 0xf0, 0x90, 0x7f, 0x96}}, + {0x0ac6, 64, { 0xf0, 0xe4, 0x90, 0x7f, 0x94, 0xf0, 0x90, 0x78, 0x4a, 0x04, 0xf0, 0xf5, 0x8e, 0x90, 0x7f, 0x95, 0x74, + 0xc0, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0x3f, 0xf0, 0x90, 0x7f, 0x98, 0x74, 0x1f, 0xf0, 0x90, 0x78, + 0x43, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x78, 0x41, 0xf0, 0x90, 0x7f, 0xdf, 0x74, 0x9f, 0xf0, 0x90, + 0x7f, 0xde, 0xf0, 0x90, 0x7f, 0x92, 0xe0, 0x44, 0x02, 0xf0, 0x7e, 0x7b, 0x7f, 0xc0, 0x75}}, + {0x0b06, 64, { 0x14, 0x7b, 0x75, 0x15, 0xc0, 0x90, 0x7f, 0x96, 0x74, 0xef, 0xf0, 0x75, 0x16, 0x01, 0x12, 0x0f, 0x12, + 0x7e, 0x7b, 0x7f, 0xc0, 0x75, 0x14, 0x7b, 0x75, 0x15, 0xc0, 0x90, 0x7f, 0x96, 0x74, 0xef, 0xf0, + 0x75, 0x16, 0x01, 0xe5, 0x15, 0x24, 0x26, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe4, 0xf0, + 0x7e, 0x7e, 0x7f, 0x40, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0x74, 0x7e, 0xf0, 0xa3, 0x74}}, + {0x0b46, 64, { 0x40, 0xf0, 0x7e, 0x7e, 0x7f, 0x80, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0xa3, 0xa3, 0x74, 0x7e, 0xf0, + 0xa3, 0x74, 0x80, 0xf0, 0x7e, 0x7c, 0x7f, 0x00, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x00, 0x90, 0x7f, + 0x96, 0x74, 0xdf, 0xf0, 0x75, 0x16, 0x02, 0x12, 0x0f, 0x12, 0x7e, 0x7c, 0x7f, 0x00, 0x75, 0x14, + 0x7c, 0x75, 0x15, 0x00, 0x90, 0x7f, 0x96, 0x74, 0xdf, 0xf0, 0x75, 0x16, 0x02, 0xe5, 0x15}}, + {0x0b86, 64, { 0x24, 0x26, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x7e, 0x7d, 0x7f, 0xc0, 0x85, + 0x15, 0x82, 0x85, 0x14, 0x83, 0x74, 0x7d, 0xf0, 0xa3, 0x74, 0xc0, 0xf0, 0x7e, 0x7e, 0x7f, 0x00, + 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0xa3, 0xa3, 0x74, 0x7e, 0xf0, 0xa3, 0x74, 0x00, 0xf0, 0x7e, 0x7c, 0x7f, 0x40, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x40, 0x90, 0x7f, 0x96, 0x74, 0xbf, 0xf0}}, - {0x0cc6, 64, { 0x75, 0x16, 0x04, 0x80, 0x13, 0x7e, 0x7c, 0x7f, 0x80, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x80, 0x90, 0x7f, - 0x96, 0x74, 0x7f, 0xf0, 0x75, 0x16, 0x08, 0xe5, 0x32, 0x55, 0x16, 0x70, 0x03, 0x02, 0x0e, 0x16, - 0xe5, 0x16, 0xf4, 0xff, 0x52, 0x32, 0xe5, 0x26, 0x54, 0x7f, 0xfe, 0x70, 0x0f, 0xe5, 0x2a, 0x55, - 0x16, 0x60, 0x24, 0x90, 0x7f, 0x98, 0xe0, 0x45, 0x16, 0xf0, 0x80, 0x1b, 0xbe, 0x20, 0x18}}, - {0x0d06, 64, { 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x30, 0xe3, 0x09, 0xe4, 0xf5, - 0x2a, 0x90, 0x7f, 0x98, 0xe0, 0x5f, 0xf0, 0xe5, 0x15, 0x24, 0x3a, 0xf5, 0x82, 0xe4, 0x35, 0x14, - 0xf5, 0x83, 0xe0, 0x60, 0x03, 0xe0, 0x14, 0xf0, 0xe5, 0x15, 0x24, 0x34, 0xf5, 0x82, 0xe4, 0x35, - 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x03, 0xe0, 0x14, 0xf0, 0xe0, 0x60, 0x03, 0x02, 0x0e, 0x16}}, - {0x0d46, 64, { 0x74, 0x0a, 0xf0, 0x12, 0x00, 0x36, 0xef, 0x54, 0x01, 0xff, 0xf5, 0x19, 0xe5, 0x15, 0x24, 0x2c, 0xf5, - 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x6f, 0x60, 0x07, 0xe5, 0x19, 0xf0, 0xe5, 0x16, 0x42, - 0x13, 0x12, 0x18, 0xf0, 0x8f, 0x19, 0xe5, 0x15, 0x24, 0x27, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, - 0x83, 0xe0, 0xff, 0xe5, 0x19, 0x54, 0x10, 0xfe, 0x6f, 0x60, 0x06, 0xee, 0xf0, 0xe5, 0x16}}, - {0x0d86, 64, { 0x42, 0x13, 0xe5, 0x15, 0x24, 0x28, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x19, - 0x54, 0x80, 0xfe, 0x6f, 0x60, 0x06, 0xee, 0xf0, 0xe5, 0x16, 0x42, 0x13, 0xe5, 0x15, 0x24, 0x29, - 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x19, 0x54, 0x20, 0xfe, 0x6f, 0x60, - 0x15, 0xee, 0xf0, 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0}}, - {0x0dc6, 64, { 0x30, 0xe4, 0x04, 0xe5, 0x16, 0x42, 0x13, 0xe5, 0x12, 0x55, 0x16, 0xff, 0xf5, 0x19, 0xe5, 0x15, 0x24, - 0x2a, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x6f, 0x60, 0x16, 0xe5, 0x19, 0xf0, 0xe5, - 0x15, 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x30, 0xe5, 0x04, 0xe5, 0x16, - 0x42, 0x13, 0xe5, 0x17, 0x55, 0x16, 0xff, 0xf5, 0x19, 0xe5, 0x15, 0x24, 0x30, 0xf5, 0x82}}, - {0x0e06, 64, { 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x6f, 0x60, 0x07, 0xe5, 0x19, 0xf0, 0xe5, 0x16, 0x42, 0x13, 0x22, - 0x30, 0x09, 0x03, 0x02, 0x0f, 0x16, 0xe5, 0x24, 0x14, 0x60, 0x2a, 0x14, 0x60, 0x41, 0x14, 0x60, - 0x58, 0x14, 0x60, 0x6f, 0x24, 0x04, 0x60, 0x03, 0x02, 0x0e, 0xd4, 0x7e, 0x7b, 0x7f, 0xc0, 0x75, - 0x14, 0x7b, 0x75, 0x15, 0xc0, 0x90, 0x7f, 0x96, 0x74, 0xef, 0xf0, 0x75, 0x16, 0x01, 0x12}}, - {0x0e46, 64, { 0x12, 0xa6, 0x75, 0x24, 0x01, 0x22, 0x7e, 0x7c, 0x7f, 0x00, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x00, 0x90, - 0x7f, 0x96, 0x74, 0xdf, 0xf0, 0x75, 0x16, 0x02, 0x12, 0x12, 0xa6, 0x75, 0x24, 0x02, 0x22, 0x7e, - 0x7c, 0x7f, 0x40, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x40, 0x90, 0x7f, 0x96, 0x74, 0xbf, 0xf0, 0x75, - 0x16, 0x04, 0x12, 0x12, 0xa6, 0x75, 0x24, 0x03, 0x22, 0x7e, 0x7c, 0x7f, 0x80, 0x75, 0x14}}, - {0x0e86, 64, { 0x7c, 0x75, 0x15, 0x80, 0x90, 0x7f, 0x96, 0x74, 0x7f, 0xf0, 0x75, 0x16, 0x08, 0x12, 0x12, 0xa6, 0x75, - 0x24, 0x04, 0x22, 0x30, 0x04, 0x33, 0xc2, 0x04, 0x53, 0x13, 0xdf, 0xe4, 0xf5, 0x19, 0x7e, 0x00, - 0x7b, 0x00, 0x74, 0x2e, 0x25, 0x19, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x11, 0xb0, 0xff, 0x74, - 0x80, 0x25, 0x19, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x19, 0xe5}}, - {0x0ec6, 64, { 0x19, 0xb4, 0x03, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0x75, 0x24, 0x05, 0x22, 0xe5, 0x36, 0x60, - 0x3b, 0xd5, 0x36, 0x0a, 0x53, 0x13, 0xef, 0x30, 0x0a, 0x04, 0xd2, 0x09, 0xc2, 0x0a, 0xe4, 0xf5, - 0x19, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x35, 0x25, 0x19, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x11, - 0xb0, 0xff, 0x74, 0x80, 0x25, 0x19, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0}}, - {0x0f06, 64, { 0x05, 0x19, 0xe5, 0x19, 0xb4, 0x03, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, 0xf5, 0x24, 0x22, - 0xe4, 0xf5, 0x1a, 0x7e, 0x00, 0x7b, 0x01, 0xe5, 0x15, 0x25, 0x1a, 0xf9, 0xee, 0x35, 0x14, 0xfa, - 0xe4, 0x12, 0x11, 0xf6, 0x05, 0x1a, 0xe5, 0x1a, 0xb4, 0x3c, 0xe8, 0xe5, 0x15, 0x24, 0x35, 0xf5, - 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74, 0x01, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0}}, - {0x0f46, 64, { 0xe5, 0x15, 0x24, 0x37, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74, 0x03, 0xf0, 0x90, 0xc0, 0x00, - 0xf0, 0x7f, 0x0c, 0xe4, 0xfd, 0x12, 0x16, 0x4c, 0x7f, 0x10, 0xe5, 0x15, 0x24, 0x33, 0xf5, 0x82, - 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xef, 0xf0, 0x12, 0x15, 0xbc, 0x90, 0x78, 0x41, 0x74, 0x02, 0xf0, - 0x7f, 0x01, 0xe5, 0x15, 0x24, 0x36, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xef, 0xf0}}, - {0x0f86, 64, { 0x44, 0x06, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x04, 0xf0, 0xe5, 0x15, 0x24, 0x39, 0xf5, - 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74, 0x80, 0xf0, 0x90, 0xc0, 0x00, 0xf0, 0x0f, 0xe4, 0xfd, - 0x12, 0x16, 0x4c, 0xe4, 0xff, 0x7e, 0xa3, 0xe5, 0x15, 0x24, 0x32, 0xf5, 0x82, 0xe4, 0x35, 0x14, - 0xf5, 0x83, 0xee, 0xf0, 0xfd, 0x12, 0x16, 0x4c, 0x90, 0x78, 0x41, 0x74, 0x01, 0xf0, 0x90}}, - {0x0fc6, 64, { 0xc0, 0x00, 0xe4, 0xf0, 0x7f, 0x05, 0x7d, 0x7f, 0x12, 0x16, 0x4c, 0x7f, 0x01, 0x12, 0x15, 0x54, 0x7f, - 0x03, 0x7d, 0x07, 0x12, 0x16, 0x4c, 0x22, 0x53, 0x13, 0x3f, 0x90, 0x7b, 0xf1, 0xe0, 0x30, 0xe3, - 0x16, 0x7e, 0x7b, 0x7f, 0xc0, 0x75, 0x14, 0x7b, 0x75, 0x15, 0xc0, 0x90, 0x7f, 0x96, 0x74, 0xef, - 0xf0, 0x75, 0x16, 0x01, 0x12, 0x08, 0xc1, 0x90, 0x7c, 0x31, 0xe0, 0x30, 0xe3, 0x16, 0x7e}}, - {0x1006, 64, { 0x7c, 0x7f, 0x00, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x00, 0x90, 0x7f, 0x96, 0x74, 0xdf, 0xf0, 0x75, 0x16, - 0x02, 0x12, 0x08, 0xc1, 0x90, 0x7c, 0x71, 0xe0, 0x30, 0xe3, 0x16, 0x7e, 0x7c, 0x7f, 0x40, 0x75, - 0x14, 0x7c, 0x75, 0x15, 0x40, 0x90, 0x7f, 0x96, 0x74, 0xbf, 0xf0, 0x75, 0x16, 0x04, 0x12, 0x08, - 0xc1, 0x90, 0x7c, 0xb1, 0xe0, 0x30, 0xe3, 0x16, 0x7e, 0x7c, 0x7f, 0x80, 0x75, 0x14, 0x7c}}, - {0x1046, 64, { 0x75, 0x15, 0x80, 0x90, 0x7f, 0x96, 0x74, 0x7f, 0xf0, 0x75, 0x16, 0x08, 0x12, 0x08, 0xc1, 0x05, 0x11, - 0xe5, 0x11, 0x54, 0x0f, 0xf5, 0x18, 0x70, 0x1f, 0x90, 0x78, 0x41, 0xe0, 0x54, 0xf7, 0xf0, 0x90, - 0x7f, 0x99, 0xe0, 0xf5, 0x17, 0x90, 0x78, 0x41, 0xe0, 0x44, 0x08, 0xf0, 0x90, 0x7f, 0x99, 0xe0, - 0xf4, 0xf5, 0x12, 0x12, 0x11, 0x26, 0x22, 0xe5, 0x18, 0xb4, 0x01, 0x04, 0x12, 0x0c, 0x78}}, - {0x1086, 64, { 0x22, 0x90, 0x7f, 0xc2, 0xe0, 0x20, 0xe1, 0x08, 0xe5, 0x13, 0x60, 0x04, 0x12, 0x0e, 0x17, 0x22, 0x12, - 0x0c, 0x78, 0x22, 0x78, 0x7f, 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x37, 0x02, 0x10, 0xe1, 0x02, - 0x12, 0x2e, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2, 0x08, - 0xdf, 0xf4, 0x80, 0x29, 0xe4, 0x93, 0xa3, 0xf8, 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33}}, - {0x10c6, 64, { 0xc4, 0x54, 0x0f, 0x44, 0x20, 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, - 0x80, 0x0b, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x18, 0x5c, 0xe4, 0x7e, 0x01, - 0x93, 0x60, 0xbc, 0xa3, 0xff, 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, - 0x60, 0x01, 0x0e, 0xcf, 0x54, 0xc0, 0x25, 0xe0, 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3}}, - {0x1106, 64, { 0xfa, 0xe4, 0x93, 0xa3, 0xf8, 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, - 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0x90, - 0x7f, 0xd2, 0xe0, 0x30, 0xe1, 0x03, 0x02, 0x11, 0xaf, 0xc2, 0x09, 0x90, 0x7b, 0x40, 0xe0, 0x14, - 0x60, 0x26, 0x14, 0x60, 0x3b, 0x14, 0x60, 0x50, 0x24, 0x83, 0x60, 0x64, 0x24, 0x80, 0x70}}, - {0x1146, 64, { 0x63, 0x7e, 0x7b, 0x7f, 0xc0, 0x75, 0x14, 0x7b, 0x75, 0x15, 0xc0, 0x90, 0x7f, 0x96, 0x74, 0xef, 0xf0, - 0x75, 0x16, 0x01, 0x12, 0x00, 0x46, 0x80, 0x4b, 0x7e, 0x7c, 0x7f, 0x00, 0x75, 0x14, 0x7c, 0x75, - 0x15, 0x00, 0x90, 0x7f, 0x96, 0x74, 0xdf, 0xf0, 0x75, 0x16, 0x02, 0x12, 0x00, 0x46, 0x80, 0x33, - 0x7e, 0x7c, 0x7f, 0x40, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x40, 0x90, 0x7f, 0x96, 0x74, 0xbf}}, - {0x1186, 64, { 0xf0, 0x75, 0x16, 0x04, 0x12, 0x00, 0x46, 0x80, 0x1b, 0x7e, 0x7c, 0x7f, 0x80, 0x75, 0x14, 0x7c, 0x75, - 0x15, 0x80, 0x90, 0x7f, 0x96, 0x74, 0x7f, 0xf0, 0x75, 0x16, 0x08, 0x12, 0x00, 0x46, 0x80, 0x03, - 0x12, 0x17, 0x8f, 0xe4, 0x90, 0x7f, 0xd3, 0xf0, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, - 0xe0, 0x22, 0x50, 0x02, 0xe7, 0x22, 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83}}, - {0x11c6, 64, { 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, - 0x22, 0x50, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, - 0xe2, 0x22, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, 0xbb, - 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xf0, 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01}}, - {0x1206, 64, { 0xf3, 0x22, 0xd0, 0x83, 0xd0, 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, - 0xa3, 0x93, 0xf8, 0x74, 0x01, 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, - 0x60, 0xef, 0xa3, 0xa3, 0xa3, 0x80, 0xdf, 0x90, 0x7f, 0xae, 0xe0, 0xff, 0xd3, 0x92, 0x00, 0xe4, - 0x33, 0xfe, 0xef, 0x4e, 0xf0, 0xd2, 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74, 0x01}}, - {0x1246, 64, { 0xf0, 0x90, 0x7f, 0xdf, 0xf0, 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, - 0xaa, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xaf, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0x74, 0x0d, - 0xf0, 0xd2, 0xaf, 0xd2, 0x0b, 0x12, 0x18, 0x20, 0xc2, 0x01, 0xe4, 0xf5, 0x2b, 0xf5, 0x31, 0xc2, - 0x07, 0xc2, 0x02, 0x75, 0x29, 0xf0, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x26, 0x60, 0x06, 0x75}}, - {0x1286, 64, { 0x32, 0x0f, 0xe0, 0xf5, 0x26, 0x30, 0x02, 0x03, 0x12, 0x0f, 0xde, 0x30, 0x01, 0x07, 0xc2, 0x01, 0x12, - 0x06, 0x29, 0x80, 0xe2, 0x30, 0x08, 0xdf, 0xc2, 0x08, 0x12, 0x18, 0x41, 0x80, 0xd8, 0x22, 0xe5, - 0x13, 0x55, 0x16, 0x60, 0x6a, 0xe5, 0x15, 0x24, 0x3a, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, - 0xe0, 0x70, 0x5c, 0xe5, 0x16, 0xf4, 0x52, 0x13, 0xe5, 0x15, 0x24, 0x26, 0xff, 0xe4, 0x35}}, - {0x12c6, 64, { 0x14, 0xfe, 0xe4, 0xfd, 0x0f, 0xef, 0xaa, 0x06, 0x70, 0x01, 0x0e, 0x14, 0xf5, 0x82, 0x8a, 0x83, 0xe0, - 0xfc, 0x74, 0x80, 0x2d, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xec, 0xf0, 0x0d, 0xbd, 0x0b, - 0xe2, 0x90, 0x7f, 0xc3, 0x74, 0x0b, 0xf0, 0xe5, 0x15, 0x24, 0x3a, 0xf5, 0x82, 0xe4, 0x35, 0x14, - 0xf5, 0x83, 0x74, 0x10, 0xf0, 0xe5, 0x15, 0x24, 0x2e, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5}}, - {0x1306, 64, { 0x83, 0xe4, 0xf0, 0xe5, 0x15, 0x24, 0x2f, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe4, 0xf0, 0x22, - 0xe5, 0x28, 0x45, 0x27, 0x60, 0x57, 0xae, 0x27, 0xaf, 0x28, 0xd3, 0xef, 0x94, 0x40, 0xee, 0x94, - 0x00, 0x40, 0x04, 0x7e, 0x00, 0x7f, 0x40, 0xc3, 0xe5, 0x28, 0x9f, 0xf5, 0x28, 0xe5, 0x27, 0x9e, - 0xf5, 0x27, 0xe4, 0xfd, 0xed, 0xc3, 0x9f, 0xe4, 0x9e, 0x50, 0x1f, 0x85, 0x34, 0x82, 0x85}}, - {0x1346, 64, { 0x33, 0x83, 0xe0, 0xfc, 0x74, 0x00, 0x2d, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xec, 0xf0, 0x0d, - 0x05, 0x34, 0xe5, 0x34, 0x70, 0x02, 0x05, 0x33, 0x80, 0xda, 0x90, 0x7f, 0xa9, 0x74, 0x01, 0xf0, - 0x90, 0x7f, 0xac, 0xe0, 0x44, 0x01, 0xf0, 0x90, 0x7f, 0xb5, 0xef, 0xf0, 0x22, 0x90, 0x7f, 0xac, - 0xe0, 0x54, 0xfe, 0xf0, 0xe4, 0x90, 0x7f, 0xb5, 0xf0, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0}}, - {0x1386, 64, { 0x90, 0x7f, 0x9c, 0x74, 0xf0, 0xf0, 0x90, 0x7f, 0x96, 0xf0, 0xe4, 0x90, 0x78, 0x4a, 0xf0, 0x90, 0x7f, - 0x94, 0xf0, 0x90, 0x7f, 0x9d, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x97, 0xf0, 0x30, 0x00, 0x07, - 0xe5, 0x29, 0x54, 0xf0, 0xff, 0x80, 0x02, 0x7f, 0x00, 0xef, 0x44, 0x08, 0x90, 0x78, 0x41, 0xf0, - 0xe4, 0x90, 0x7f, 0x98, 0xf0, 0x90, 0x7f, 0x95, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0xff, 0xf0}}, - {0x13c6, 64, { 0xe4, 0x90, 0x7f, 0x98, 0xf0, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0xf0, 0xf0, 0xe4, 0x90, - 0x7f, 0x96, 0xf0, 0x90, 0x7f, 0x92, 0xe0, 0x54, 0xfd, 0xf0, 0x22, 0x8f, 0x1a, 0x05, 0x2d, 0xe5, - 0x2d, 0xae, 0x2c, 0x70, 0x02, 0x05, 0x2c, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x1a, 0xf0, 0x12, - 0x1a, 0x08, 0x05, 0x2d, 0xe5, 0x2d, 0xac, 0x2c, 0x70, 0x02, 0x05, 0x2c, 0x14, 0xf5, 0x82}}, - {0x1406, 64, { 0x8c, 0x83, 0xef, 0xf0, 0x15, 0x23, 0xe5, 0x23, 0x60, 0x1f, 0xe5, 0x15, 0x24, 0x38, 0xf5, 0x82, 0xe4, - 0x35, 0x14, 0xf5, 0x83, 0xc0, 0x83, 0xc0, 0x82, 0xe0, 0xfe, 0x12, 0x18, 0xe4, 0x8f, 0x1a, 0xee, - 0x4f, 0xd0, 0x82, 0xd0, 0x83, 0xf0, 0x80, 0xb5, 0x22, 0x8f, 0x1a, 0xe4, 0xf5, 0x1b, 0x75, 0x1c, - 0xff, 0x75, 0x1d, 0x19, 0x75, 0x1e, 0x86, 0xab, 0x1c, 0xaa, 0x1d, 0xa9, 0x1e, 0x90, 0x00}}, - {0x1446, 64, { 0x01, 0x12, 0x11, 0xc9, 0xb4, 0x03, 0x1d, 0xaf, 0x1b, 0x05, 0x1b, 0xef, 0xb5, 0x1a, 0x01, 0x22, 0x12, - 0x11, 0xb0, 0x7e, 0x00, 0x29, 0xff, 0xee, 0x3a, 0xa9, 0x07, 0x75, 0x1c, 0xff, 0xf5, 0x1d, 0x89, - 0x1e, 0x80, 0xd4, 0x7b, 0x00, 0x7a, 0x00, 0x79, 0x00, 0x22, 0xe4, 0x90, 0x78, 0x41, 0xf0, 0x90, - 0x78, 0x4f, 0x74, 0xc0, 0xf0, 0xe4, 0x90, 0x78, 0x50, 0xf0, 0xe5, 0x2c, 0x90, 0x78, 0x51}}, - {0x1486, 64, { 0xf0, 0xae, 0x2c, 0xe5, 0x2d, 0x90, 0x78, 0x52, 0xf0, 0x90, 0x78, 0x54, 0xe5, 0x23, 0xf0, 0x90, 0x78, - 0x57, 0x74, 0x04, 0xf0, 0x90, 0x7f, 0xe2, 0xe0, 0x44, 0x10, 0xf0, 0xe0, 0x54, 0xf7, 0xf0, 0xe4, - 0x90, 0x78, 0x55, 0xf0, 0x90, 0x78, 0x55, 0xe0, 0x60, 0xfa, 0x22, 0xe4, 0x90, 0x78, 0x41, 0xf0, - 0xe5, 0x2c, 0x90, 0x78, 0x4f, 0xf0, 0xae, 0x2c, 0xe5, 0x2d, 0x90, 0x78, 0x50, 0xf0, 0x90}}, - {0x14c6, 64, { 0x78, 0x51, 0x74, 0xc0, 0xf0, 0xe4, 0x90, 0x78, 0x52, 0xf0, 0x90, 0x78, 0x54, 0xe5, 0x23, 0xf0, 0x90, - 0x78, 0x57, 0x74, 0x04, 0xf0, 0xe4, 0x90, 0x78, 0x55, 0xf0, 0x90, 0x78, 0x55, 0xe0, 0x60, 0xfa, - 0x22, 0xe5, 0x15, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x14, 0x60, 0x0f, - 0x14, 0x60, 0x13, 0x14, 0x60, 0x17, 0x80, 0x00, 0x90, 0x7f, 0xc7, 0xef, 0xf0, 0x80, 0x13}}, - {0x1506, 64, { 0x90, 0x7f, 0xc9, 0xef, 0xf0, 0x80, 0x0c, 0x90, 0x7f, 0xcb, 0xef, 0xf0, 0x80, 0x05, 0x90, 0x7f, 0xcd, - 0xef, 0xf0, 0xe5, 0x16, 0x42, 0x2a, 0x22, 0xe5, 0x15, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x14, - 0xf5, 0x83, 0xe0, 0x14, 0x60, 0x0f, 0x14, 0x60, 0x13, 0x14, 0x60, 0x17, 0x80, 0x00, 0x90, 0x7f, - 0xb7, 0xef, 0xf0, 0x80, 0x13, 0x90, 0x7f, 0xb9, 0xef, 0xf0, 0x80, 0x0c, 0x90, 0x7f, 0xbb}}, - {0x1546, 64, { 0xef, 0xf0, 0x80, 0x05, 0x90, 0x7f, 0xbd, 0xef, 0xf0, 0xe5, 0x16, 0x42, 0x2a, 0x22, 0xae, 0x07, 0xe4, - 0xff, 0xe5, 0x15, 0x24, 0x32, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0xfd, - 0x12, 0x16, 0x4c, 0x90, 0x78, 0x41, 0x74, 0x01, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, - 0x15, 0x24, 0x32, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x80, 0xfd, 0x12}}, - {0x1586, 64, { 0x16, 0x4c, 0x22, 0xc0, 0xe0, 0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, - 0x75, 0x86, 0x00, 0xc0, 0xd0, 0x75, 0xd0, 0x08, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xa9, 0x74, 0x01, - 0xf0, 0x12, 0x13, 0x17, 0xd0, 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, - 0xd0, 0xf0, 0xd0, 0xe0, 0x32, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0x90, 0xc0, 0x00, 0x74}}, - {0x15c6, 64, { 0xbf, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x02, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x78, 0x41, 0x74, - 0x03, 0xf0, 0xe5, 0x15, 0x24, 0x37, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, - 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, - 0xf0, 0x90, 0x78, 0x41, 0x74, 0x04, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x78, 0x41}}, - {0x1606, 64, { 0x74, 0x03, 0xf0, 0xe5, 0x15, 0x24, 0x37, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, - 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, - 0xf0, 0x90, 0x78, 0x41, 0x74, 0x06, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x78, 0x41, 0x74, - 0x03, 0xf0, 0xe5, 0x15, 0x24, 0x37, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54}}, - {0x1646, 64, { 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0xe5, 0x15, 0x24, 0x37, 0xf5, - 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x78, 0x41, - 0x74, 0x07, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x05, 0xf0, 0x90, 0xc0, - 0x00, 0xed, 0xf0, 0x22, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf}}, - {0x1686, 64, { 0xf0, 0xe4, 0x90, 0x78, 0x41, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, - 0xe5, 0x15, 0x24, 0x37, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0x90, 0xc0, - 0x00, 0xf0, 0x22, 0xe5, 0x15, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x14, - 0x60, 0x0e, 0x14, 0x60, 0x11, 0x14, 0x60, 0x14, 0x80, 0x00, 0x90, 0x7f, 0xc6, 0xe0, 0xff}}, - {0x16c6, 64, { 0x22, 0x90, 0x7f, 0xc8, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0xca, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0xcc, 0xe0, - 0xff, 0x22, 0xe5, 0x15, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x14, 0x60, - 0x0e, 0x14, 0x60, 0x11, 0x14, 0x60, 0x14, 0x80, 0x00, 0x90, 0x7f, 0xb6, 0xe0, 0xff, 0x22, 0x90, - 0x7f, 0xb8, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0xba, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0xbc, 0xe0}}, - {0x1706, 64, { 0xff, 0x22, 0xe5, 0x15, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x14, 0x60, 0x0e, - 0x14, 0x60, 0x11, 0x14, 0x60, 0x14, 0x80, 0x00, 0x90, 0x7f, 0xc7, 0xe0, 0xff, 0x22, 0x90, 0x7f, - 0xc9, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0xcb, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0xcd, 0xe0, 0xff, 0x22, - 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00}}, - {0x1746, 64, { 0x30, 0x05, 0x04, 0xc2, 0x05, 0x80, 0x02, 0xd2, 0x08, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, - 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, - 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90, 0x7f, 0xc4, - 0xe4, 0xf0, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, 0x84}}, - {0x1786, 64, { 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7b, 0x41, 0xe0, 0xf5, 0x36, 0x43, 0x13, - 0x10, 0xa3, 0xe0, 0x60, 0x09, 0x90, 0x7f, 0xd7, 0x74, 0x17, 0xf0, 0x74, 0x37, 0xf0, 0x90, 0x7b, - 0x43, 0xe0, 0xf5, 0x37, 0xa3, 0xe0, 0x54, 0xf0, 0xf5, 0x29, 0xe0, 0x60, 0x02, 0xd2, 0x0a, 0x22, - 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00}}, - {0x17c6, 64, { 0xd2, 0x01, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, - 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x12, 0x18, 0xcc, 0xae, 0x07, 0x12, 0x18, 0xcc, 0xad, - 0x07, 0xee, 0x6d, 0x60, 0x10, 0x12, 0x18, 0xcc, 0xae, 0x07, 0xee, 0x6d, 0x60, 0x07, 0x12, 0x18, - 0xcc, 0xad, 0x07, 0x80, 0xec, 0xaf, 0x06, 0x22, 0x74, 0x00, 0xf5, 0x86, 0x90, 0xfd, 0xa5}}, - {0x1806, 64, { 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x80, 0xf0, - 0x43, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x04, 0xf0, - 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x0b, 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, 0xf4, 0x7e, 0x01, 0x12, - 0x18, 0x77, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0x22, 0x12, 0x13, 0x81, 0x12, 0x18}}, - {0x1846, 64, { 0x10, 0x90, 0x7f, 0xd6, 0xe0, 0x30, 0xe7, 0x0a, 0x7f, 0x05, 0x7e, 0x00, 0x12, 0x18, 0x77, 0x12, 0x18, - 0xaa, 0x12, 0x0a, 0xbd, 0x22, 0x03, 0x35, 0x80, 0x00, 0x00, 0x03, 0x2e, 0x81, 0x00, 0x00, 0xc1, - 0x85, 0xc1, 0x81, 0xc1, 0x08, 0xc1, 0x00, 0xc1, 0x06, 0x01, 0x22, 0x00, 0x01, 0x24, 0x00, 0x00, - 0x8e, 0x18, 0x8f, 0x19, 0xe5, 0x19, 0x15, 0x19, 0xae, 0x18, 0x70, 0x02, 0x15, 0x18, 0x4e}}, - {0x1886, 64, { 0x60, 0x08, 0x12, 0x17, 0xff, 0x12, 0x17, 0xff, 0x80, 0xeb, 0x22, 0xe5, 0x15, 0x24, 0x04, 0xf5, 0x82, - 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x04, 0xff, 0x44, 0x10, 0x90, 0x7f, 0xd7, 0xf0, 0xef, 0x44, - 0x30, 0xf0, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x01, 0xf0, 0x7f, 0x0d, 0x7e, 0x00, 0x12, 0x18, - 0x77, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x78, 0x41, 0x74, 0x02, 0xf0}}, - {0x18c6, 64, { 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, - 0x22, 0x90, 0x78, 0x41, 0x74, 0x04, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x78, 0x41, - 0x74, 0x05, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x78, 0x41, 0x74, 0x06, 0xf0, 0x90, - 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x53, 0xd8, 0xef, 0x32, 0x12, 0x01, 0x00, 0x01, 0xff, 0x00}}, + {0x0bc6, 64, { 0x75, 0x16, 0x04, 0x12, 0x0f, 0x12, 0x7e, 0x7c, 0x7f, 0x40, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x40, 0x90, + 0x7f, 0x96, 0x74, 0xbf, 0xf0, 0x75, 0x16, 0x04, 0xe5, 0x15, 0x24, 0x26, 0xf5, 0x82, 0xe4, 0x35, + 0x14, 0xf5, 0x83, 0x74, 0x02, 0xf0, 0x7e, 0x7d, 0x7f, 0x40, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, + 0x74, 0x7d, 0xf0, 0xa3, 0x74, 0x40, 0xf0, 0x7e, 0x7d, 0x7f, 0x80, 0x85, 0x15, 0x82, 0x85}}, + {0x0c06, 64, { 0x14, 0x83, 0xa3, 0xa3, 0x74, 0x7d, 0xf0, 0xa3, 0x74, 0x80, 0xf0, 0x7e, 0x7c, 0x7f, 0x80, 0x75, 0x14, + 0x7c, 0x75, 0x15, 0x80, 0x90, 0x7f, 0x96, 0x74, 0x7f, 0xf0, 0x75, 0x16, 0x08, 0x12, 0x0f, 0x12, + 0x7e, 0x7c, 0x7f, 0x80, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x80, 0x90, 0x7f, 0x96, 0x74, 0x7f, 0xf0, + 0x75, 0x16, 0x08, 0xe5, 0x15, 0x24, 0x26, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74}}, + {0x0c46, 64, { 0x03, 0xf0, 0x7e, 0x7c, 0x7f, 0xc0, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0x74, 0x7c, 0xf0, 0xa3, 0x74, + 0xc0, 0xf0, 0x7e, 0x7d, 0x7f, 0x00, 0x85, 0x15, 0x82, 0x85, 0x14, 0x83, 0xa3, 0xa3, 0x74, 0x7d, + 0xf0, 0xa3, 0x74, 0x00, 0xf0, 0xc2, 0x0a, 0xc2, 0x09, 0xd2, 0x02, 0x22, 0xe5, 0x10, 0x04, 0x54, + 0x03, 0xf5, 0x10, 0x14, 0x60, 0x1f, 0x14, 0x60, 0x31, 0x14, 0x60, 0x43, 0x24, 0x03, 0x70}}, + {0x0c86, 64, { 0x52, 0x7e, 0x7b, 0x7f, 0xc0, 0x75, 0x14, 0x7b, 0x75, 0x15, 0xc0, 0x90, 0x7f, 0x96, 0x74, 0xef, 0xf0, + 0x75, 0x16, 0x01, 0x80, 0x3d, 0x7e, 0x7c, 0x7f, 0x00, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x00, 0x90, + 0x7f, 0x96, 0x74, 0xdf, 0xf0, 0x75, 0x16, 0x02, 0x80, 0x28, 0x7e, 0x7c, 0x7f, 0x40, 0x75, 0x14, + 0x7c, 0x75, 0x15, 0x40, 0x90, 0x7f, 0x96, 0x74, 0xbf, 0xf0, 0x75, 0x16, 0x04, 0x80, 0x13}}, + {0x0cc6, 64, { 0x7e, 0x7c, 0x7f, 0x80, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x80, 0x90, 0x7f, 0x96, 0x74, 0x7f, 0xf0, 0x75, + 0x16, 0x08, 0xe5, 0x32, 0x55, 0x16, 0x70, 0x03, 0x02, 0x0e, 0x11, 0xe5, 0x16, 0xf4, 0xff, 0x52, + 0x32, 0xe5, 0x26, 0x54, 0x7f, 0xfe, 0x70, 0x0f, 0xe5, 0x2a, 0x55, 0x16, 0x60, 0x24, 0x90, 0x7f, + 0x98, 0xe0, 0x45, 0x16, 0xf0, 0x80, 0x1b, 0xbe, 0x20, 0x18, 0xe5, 0x15, 0x24, 0x31, 0xf5}}, + {0x0d06, 64, { 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x30, 0xe3, 0x09, 0xe4, 0xf5, 0x2a, 0x90, 0x7f, 0x98, 0xe0, + 0x5f, 0xf0, 0xe5, 0x15, 0x24, 0x3a, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, 0x03, + 0xe0, 0x14, 0xf0, 0xe5, 0x15, 0x24, 0x34, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x60, + 0x03, 0xe0, 0x14, 0xf0, 0xe0, 0x60, 0x03, 0x02, 0x0e, 0x11, 0x74, 0x0a, 0xf0, 0x12, 0x00}}, + {0x0d46, 64, { 0x36, 0xef, 0x54, 0x01, 0xff, 0xf5, 0x19, 0xe5, 0x15, 0x24, 0x2c, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, + 0x83, 0xe0, 0x6f, 0x60, 0x07, 0xe5, 0x19, 0xf0, 0xe5, 0x16, 0x42, 0x13, 0x12, 0x18, 0xe4, 0x8f, + 0x19, 0xe5, 0x15, 0x24, 0x27, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x19, + 0x54, 0x10, 0xfe, 0x6f, 0x60, 0x06, 0xee, 0xf0, 0xe5, 0x16, 0x42, 0x13, 0xe5, 0x15, 0x24}}, + {0x0d86, 64, { 0x28, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x19, 0x54, 0x80, 0xfe, 0x6f, 0x60, + 0x06, 0xee, 0xf0, 0xe5, 0x16, 0x42, 0x13, 0xe5, 0x15, 0x24, 0x29, 0xf5, 0x82, 0xe4, 0x35, 0x14, + 0xf5, 0x83, 0xe0, 0xff, 0xe5, 0x19, 0x54, 0x20, 0xfe, 0x6f, 0x60, 0x15, 0xee, 0xf0, 0xe5, 0x15, + 0x24, 0x31, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x30, 0xe4, 0x04, 0xe5, 0x16}}, + {0x0dc6, 64, { 0x42, 0x13, 0xe5, 0x12, 0x55, 0x16, 0xff, 0xf5, 0x19, 0xe5, 0x15, 0x24, 0x2a, 0xf5, 0x82, 0xe4, 0x35, + 0x14, 0xf5, 0x83, 0xe0, 0x6f, 0x60, 0x16, 0xe5, 0x19, 0xf0, 0xe5, 0x15, 0x24, 0x31, 0xf5, 0x82, + 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x30, 0xe5, 0x04, 0xe5, 0x16, 0x42, 0x13, 0xe5, 0x17, 0x55, + 0x16, 0xff, 0xf5, 0x19, 0xe5, 0x15, 0x24, 0x30, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83}}, + {0x0e06, 64, { 0xe0, 0x6f, 0x60, 0x07, 0xe5, 0x19, 0xf0, 0xe5, 0x16, 0x42, 0x13, 0x22, 0x30, 0x09, 0x03, 0x02, 0x0f, + 0x11, 0xe5, 0x24, 0x14, 0x60, 0x2a, 0x14, 0x60, 0x41, 0x14, 0x60, 0x58, 0x14, 0x60, 0x6f, 0x24, + 0x04, 0x60, 0x03, 0x02, 0x0e, 0xcf, 0x7e, 0x7b, 0x7f, 0xc0, 0x75, 0x14, 0x7b, 0x75, 0x15, 0xc0, + 0x90, 0x7f, 0x96, 0x74, 0xef, 0xf0, 0x75, 0x16, 0x01, 0x12, 0x12, 0xa1, 0x75, 0x24, 0x01}}, + {0x0e46, 64, { 0x22, 0x7e, 0x7c, 0x7f, 0x00, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x00, 0x90, 0x7f, 0x96, 0x74, 0xdf, 0xf0, + 0x75, 0x16, 0x02, 0x12, 0x12, 0xa1, 0x75, 0x24, 0x02, 0x22, 0x7e, 0x7c, 0x7f, 0x40, 0x75, 0x14, + 0x7c, 0x75, 0x15, 0x40, 0x90, 0x7f, 0x96, 0x74, 0xbf, 0xf0, 0x75, 0x16, 0x04, 0x12, 0x12, 0xa1, + 0x75, 0x24, 0x03, 0x22, 0x7e, 0x7c, 0x7f, 0x80, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x80, 0x90}}, + {0x0e86, 64, { 0x7f, 0x96, 0x74, 0x7f, 0xf0, 0x75, 0x16, 0x08, 0x12, 0x12, 0xa1, 0x75, 0x24, 0x04, 0x22, 0x30, 0x04, + 0x33, 0xc2, 0x04, 0x53, 0x13, 0xdf, 0xe4, 0xf5, 0x19, 0x7e, 0x00, 0x7b, 0x00, 0x74, 0x2e, 0x25, + 0x19, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x11, 0xab, 0xff, 0x74, 0x80, 0x25, 0x19, 0xf5, 0x82, + 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x19, 0xe5, 0x19, 0xb4, 0x03, 0xdb, 0x90}}, + {0x0ec6, 64, { 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0x75, 0x24, 0x05, 0x22, 0xe5, 0x36, 0x60, 0x3b, 0xd5, 0x36, 0x0a, 0x53, + 0x13, 0xef, 0x30, 0x0a, 0x04, 0xd2, 0x09, 0xc2, 0x0a, 0xe4, 0xf5, 0x19, 0x7e, 0x00, 0x7b, 0x00, + 0x74, 0x35, 0x25, 0x19, 0xf9, 0xee, 0x34, 0x00, 0xfa, 0x12, 0x11, 0xab, 0xff, 0x74, 0x80, 0x25, + 0x19, 0xf5, 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xef, 0xf0, 0x05, 0x19, 0xe5, 0x19, 0xb4}}, + {0x0f06, 64, { 0x03, 0xdb, 0x90, 0x7f, 0xc3, 0x74, 0x03, 0xf0, 0xe4, 0xf5, 0x24, 0x22, 0xe4, 0xf5, 0x1a, 0x7e, 0x00, + 0x7b, 0x01, 0xe5, 0x15, 0x25, 0x1a, 0xf9, 0xee, 0x35, 0x14, 0xfa, 0xe4, 0x12, 0x11, 0xf1, 0x05, + 0x1a, 0xe5, 0x1a, 0xb4, 0x3c, 0xe8, 0xe5, 0x15, 0x24, 0x35, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, + 0x83, 0x74, 0x01, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0xe5, 0x15, 0x24, 0x37, 0xf5}}, + {0x0f46, 64, { 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74, 0x03, 0xf0, 0x90, 0xc0, 0x00, 0xf0, 0x7f, 0x0c, 0xe4, 0xfd, + 0x12, 0x16, 0x47, 0x7f, 0x10, 0xe5, 0x15, 0x24, 0x33, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, + 0xef, 0xf0, 0x12, 0x15, 0xb7, 0x90, 0x78, 0x41, 0x74, 0x02, 0xf0, 0x7f, 0x01, 0xe5, 0x15, 0x24, + 0x36, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xef, 0xf0, 0x44, 0x06, 0x90, 0xc0, 0x00}}, + {0x0f86, 64, { 0xf0, 0x90, 0x78, 0x41, 0x74, 0x04, 0xf0, 0xe5, 0x15, 0x24, 0x39, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, + 0x83, 0x74, 0x80, 0xf0, 0x90, 0xc0, 0x00, 0xf0, 0x0f, 0xe4, 0xfd, 0x12, 0x16, 0x47, 0xe4, 0xff, + 0x7e, 0xa3, 0xe5, 0x15, 0x24, 0x32, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xee, 0xf0, 0xfd, + 0x12, 0x16, 0x47, 0x90, 0x78, 0x41, 0x74, 0x01, 0xf0, 0x90, 0xc0, 0x00, 0xe4, 0xf0, 0x7f}}, + {0x0fc6, 64, { 0x05, 0x7d, 0x7f, 0x12, 0x16, 0x47, 0x7f, 0x01, 0x12, 0x15, 0x4f, 0x7f, 0x03, 0x7d, 0x07, 0x12, 0x16, + 0x47, 0x22, 0x53, 0x13, 0x3f, 0x90, 0x7b, 0xf1, 0xe0, 0x30, 0xe3, 0x16, 0x7e, 0x7b, 0x7f, 0xc0, + 0x75, 0x14, 0x7b, 0x75, 0x15, 0xc0, 0x90, 0x7f, 0x96, 0x74, 0xef, 0xf0, 0x75, 0x16, 0x01, 0x12, + 0x08, 0xc1, 0x90, 0x7c, 0x31, 0xe0, 0x30, 0xe3, 0x16, 0x7e, 0x7c, 0x7f, 0x00, 0x75, 0x14}}, + {0x1006, 64, { 0x7c, 0x75, 0x15, 0x00, 0x90, 0x7f, 0x96, 0x74, 0xdf, 0xf0, 0x75, 0x16, 0x02, 0x12, 0x08, 0xc1, 0x90, + 0x7c, 0x71, 0xe0, 0x30, 0xe3, 0x16, 0x7e, 0x7c, 0x7f, 0x40, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x40, + 0x90, 0x7f, 0x96, 0x74, 0xbf, 0xf0, 0x75, 0x16, 0x04, 0x12, 0x08, 0xc1, 0x90, 0x7c, 0xb1, 0xe0, + 0x30, 0xe3, 0x16, 0x7e, 0x7c, 0x7f, 0x80, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x80, 0x90, 0x7f}}, + {0x1046, 64, { 0x96, 0x74, 0x7f, 0xf0, 0x75, 0x16, 0x08, 0x12, 0x08, 0xc1, 0x05, 0x11, 0xe5, 0x11, 0x54, 0x0f, 0xf5, + 0x18, 0x70, 0x1f, 0x90, 0x78, 0x41, 0xe0, 0x54, 0xf7, 0xf0, 0x90, 0x7f, 0x99, 0xe0, 0xf5, 0x17, + 0x90, 0x78, 0x41, 0xe0, 0x44, 0x08, 0xf0, 0x90, 0x7f, 0x99, 0xe0, 0xf4, 0xf5, 0x12, 0x12, 0x11, + 0x21, 0x22, 0xe5, 0x18, 0xb4, 0x01, 0x04, 0x12, 0x0c, 0x73, 0x22, 0x90, 0x7f, 0xc2, 0xe0}}, + {0x1086, 64, { 0x20, 0xe1, 0x08, 0xe5, 0x13, 0x60, 0x04, 0x12, 0x0e, 0x12, 0x22, 0x12, 0x0c, 0x73, 0x22, 0x78, 0x7f, + 0xe4, 0xf6, 0xd8, 0xfd, 0x75, 0x81, 0x37, 0x02, 0x10, 0xdc, 0x02, 0x12, 0x29, 0xe4, 0x93, 0xa3, + 0xf8, 0xe4, 0x93, 0xa3, 0x40, 0x03, 0xf6, 0x80, 0x01, 0xf2, 0x08, 0xdf, 0xf4, 0x80, 0x29, 0xe4, + 0x93, 0xa3, 0xf8, 0x54, 0x07, 0x24, 0x0c, 0xc8, 0xc3, 0x33, 0xc4, 0x54, 0x0f, 0x44, 0x20}}, + {0x10c6, 64, { 0xc8, 0x83, 0x40, 0x04, 0xf4, 0x56, 0x80, 0x01, 0x46, 0xf6, 0xdf, 0xe4, 0x80, 0x0b, 0x01, 0x02, 0x04, + 0x08, 0x10, 0x20, 0x40, 0x80, 0x90, 0x18, 0x50, 0xe4, 0x7e, 0x01, 0x93, 0x60, 0xbc, 0xa3, 0xff, + 0x54, 0x3f, 0x30, 0xe5, 0x09, 0x54, 0x1f, 0xfe, 0xe4, 0x93, 0xa3, 0x60, 0x01, 0x0e, 0xcf, 0x54, + 0xc0, 0x25, 0xe0, 0x60, 0xa8, 0x40, 0xb8, 0xe4, 0x93, 0xa3, 0xfa, 0xe4, 0x93, 0xa3, 0xf8}}, + {0x1106, 64, { 0xe4, 0x93, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, 0xca, 0xc5, 0x83, 0xca, 0xf0, 0xa3, 0xc8, 0xc5, 0x82, 0xc8, + 0xca, 0xc5, 0x83, 0xca, 0xdf, 0xe9, 0xde, 0xe7, 0x80, 0xbe, 0x90, 0x7f, 0xd2, 0xe0, 0x30, 0xe1, + 0x03, 0x02, 0x11, 0xaa, 0xc2, 0x09, 0x90, 0x7b, 0x40, 0xe0, 0x14, 0x60, 0x26, 0x14, 0x60, 0x3b, + 0x14, 0x60, 0x50, 0x24, 0x83, 0x60, 0x64, 0x24, 0x80, 0x70, 0x63, 0x7e, 0x7b, 0x7f, 0xc0}}, + {0x1146, 64, { 0x75, 0x14, 0x7b, 0x75, 0x15, 0xc0, 0x90, 0x7f, 0x96, 0x74, 0xef, 0xf0, 0x75, 0x16, 0x01, 0x12, 0x00, + 0x46, 0x80, 0x4b, 0x7e, 0x7c, 0x7f, 0x00, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x00, 0x90, 0x7f, 0x96, + 0x74, 0xdf, 0xf0, 0x75, 0x16, 0x02, 0x12, 0x00, 0x46, 0x80, 0x33, 0x7e, 0x7c, 0x7f, 0x40, 0x75, + 0x14, 0x7c, 0x75, 0x15, 0x40, 0x90, 0x7f, 0x96, 0x74, 0xbf, 0xf0, 0x75, 0x16, 0x04, 0x12}}, + {0x1186, 64, { 0x00, 0x46, 0x80, 0x1b, 0x7e, 0x7c, 0x7f, 0x80, 0x75, 0x14, 0x7c, 0x75, 0x15, 0x80, 0x90, 0x7f, 0x96, + 0x74, 0x7f, 0xf0, 0x75, 0x16, 0x08, 0x12, 0x00, 0x46, 0x80, 0x03, 0x12, 0x17, 0x5c, 0xe4, 0x90, + 0x7f, 0xd3, 0xf0, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, 0x83, 0xe0, 0x22, 0x50, 0x02, 0xe7, + 0x22, 0xbb, 0xfe, 0x02, 0xe3, 0x22, 0x89, 0x82, 0x8a, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01}}, + {0x11c6, 64, { 0x0c, 0xe5, 0x82, 0x29, 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe0, 0x22, 0x50, 0x06, 0xe9, 0x25, + 0x82, 0xf8, 0xe6, 0x22, 0xbb, 0xfe, 0x06, 0xe9, 0x25, 0x82, 0xf8, 0xe2, 0x22, 0xe5, 0x82, 0x29, + 0xf5, 0x82, 0xe5, 0x83, 0x3a, 0xf5, 0x83, 0xe4, 0x93, 0x22, 0xbb, 0x01, 0x06, 0x89, 0x82, 0x8a, + 0x83, 0xf0, 0x22, 0x50, 0x02, 0xf7, 0x22, 0xbb, 0xfe, 0x01, 0xf3, 0x22, 0xd0, 0x83, 0xd0}}, + {0x1206, 64, { 0x82, 0xf8, 0xe4, 0x93, 0x70, 0x12, 0x74, 0x01, 0x93, 0x70, 0x0d, 0xa3, 0xa3, 0x93, 0xf8, 0x74, 0x01, + 0x93, 0xf5, 0x82, 0x88, 0x83, 0xe4, 0x73, 0x74, 0x02, 0x93, 0x68, 0x60, 0xef, 0xa3, 0xa3, 0xa3, + 0x80, 0xdf, 0x90, 0x7f, 0xae, 0xe0, 0xff, 0xd3, 0x92, 0x00, 0xe4, 0x33, 0xfe, 0xef, 0x4e, 0xf0, + 0xd2, 0xe8, 0x43, 0xd8, 0x20, 0x90, 0x7f, 0xde, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xdf, 0xf0}}, + {0x1246, 64, { 0x90, 0x7f, 0xab, 0x74, 0xff, 0xf0, 0x90, 0x7f, 0xa9, 0xf0, 0x90, 0x7f, 0xaa, 0xf0, 0x53, 0x91, 0xef, + 0x90, 0x7f, 0xaf, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xae, 0x74, 0x0d, 0xf0, 0xd2, 0xaf, 0xd2, 0x0b, + 0x12, 0x18, 0x14, 0xc2, 0x01, 0xe4, 0xf5, 0x2b, 0xf5, 0x31, 0xc2, 0x07, 0xc2, 0x02, 0x75, 0x29, + 0xf0, 0x90, 0x7f, 0xd8, 0xe0, 0x65, 0x26, 0x60, 0x06, 0x75, 0x32, 0x0f, 0xe0, 0xf5, 0x26}}, + {0x1286, 64, { 0x30, 0x02, 0x03, 0x12, 0x0f, 0xd9, 0x30, 0x01, 0x07, 0xc2, 0x01, 0x12, 0x06, 0x29, 0x80, 0xe2, 0x30, + 0x08, 0xdf, 0xc2, 0x08, 0x12, 0x18, 0x35, 0x80, 0xd8, 0x22, 0xe5, 0x13, 0x55, 0x16, 0x60, 0x6a, + 0xe5, 0x15, 0x24, 0x3a, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x70, 0x5c, 0xe5, 0x16, + 0xf4, 0x52, 0x13, 0xe5, 0x15, 0x24, 0x26, 0xff, 0xe4, 0x35, 0x14, 0xfe, 0xe4, 0xfd, 0x0f}}, + {0x12c6, 64, { 0xef, 0xaa, 0x06, 0x70, 0x01, 0x0e, 0x14, 0xf5, 0x82, 0x8a, 0x83, 0xe0, 0xfc, 0x74, 0x80, 0x2d, 0xf5, + 0x82, 0xe4, 0x34, 0x7b, 0xf5, 0x83, 0xec, 0xf0, 0x0d, 0xbd, 0x0b, 0xe2, 0x90, 0x7f, 0xc3, 0x74, + 0x0b, 0xf0, 0xe5, 0x15, 0x24, 0x3a, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0x74, 0x10, 0xf0, + 0xe5, 0x15, 0x24, 0x2e, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe4, 0xf0, 0xe5, 0x15}}, + {0x1306, 64, { 0x24, 0x2f, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe4, 0xf0, 0x22, 0xe5, 0x28, 0x45, 0x27, 0x60, + 0x57, 0xae, 0x27, 0xaf, 0x28, 0xd3, 0xef, 0x94, 0x40, 0xee, 0x94, 0x00, 0x40, 0x04, 0x7e, 0x00, + 0x7f, 0x40, 0xc3, 0xe5, 0x28, 0x9f, 0xf5, 0x28, 0xe5, 0x27, 0x9e, 0xf5, 0x27, 0xe4, 0xfd, 0xed, + 0xc3, 0x9f, 0xe4, 0x9e, 0x50, 0x1f, 0x85, 0x34, 0x82, 0x85, 0x33, 0x83, 0xe0, 0xfc, 0x74}}, + {0x1346, 64, { 0x00, 0x2d, 0xf5, 0x82, 0xe4, 0x34, 0x7f, 0xf5, 0x83, 0xec, 0xf0, 0x0d, 0x05, 0x34, 0xe5, 0x34, 0x70, + 0x02, 0x05, 0x33, 0x80, 0xda, 0x90, 0x7f, 0xa9, 0x74, 0x01, 0xf0, 0x90, 0x7f, 0xac, 0xe0, 0x44, + 0x01, 0xf0, 0x90, 0x7f, 0xb5, 0xef, 0xf0, 0x22, 0x90, 0x7f, 0xac, 0xe0, 0x54, 0xfe, 0xf0, 0xe4, + 0x90, 0x7f, 0xb5, 0xf0, 0x22, 0xe4, 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0xf0}}, + {0x1386, 64, { 0xf0, 0x90, 0x7f, 0x96, 0xf0, 0xe4, 0x90, 0x78, 0x4a, 0xf0, 0x90, 0x7f, 0x94, 0xf0, 0x90, 0x7f, 0x9d, + 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x97, 0xf0, 0x30, 0x00, 0x07, 0xe5, 0x29, 0x54, 0xf0, 0xff, + 0x80, 0x02, 0x7f, 0x00, 0xef, 0x44, 0x08, 0x90, 0x78, 0x41, 0xf0, 0xe4, 0x90, 0x7f, 0x98, 0xf0, + 0x90, 0x7f, 0x95, 0xf0, 0x90, 0x7f, 0x9e, 0x74, 0xff, 0xf0, 0xe4, 0x90, 0x7f, 0x98, 0xf0}}, + {0x13c6, 64, { 0x90, 0x7f, 0x93, 0xf0, 0x90, 0x7f, 0x9c, 0x74, 0xf0, 0xf0, 0xe4, 0x90, 0x7f, 0x96, 0xf0, 0x90, 0x7f, + 0x92, 0xe0, 0x54, 0xfd, 0xf0, 0x22, 0x8f, 0x1a, 0x05, 0x2d, 0xe5, 0x2d, 0xae, 0x2c, 0x70, 0x02, + 0x05, 0x2c, 0x14, 0xf5, 0x82, 0x8e, 0x83, 0xe5, 0x1a, 0xf0, 0x12, 0x18, 0xf0, 0x05, 0x2d, 0xe5, + 0x2d, 0xac, 0x2c, 0x70, 0x02, 0x05, 0x2c, 0x14, 0xf5, 0x82, 0x8c, 0x83, 0xef, 0xf0, 0x15}}, + {0x1406, 64, { 0x23, 0xe5, 0x23, 0x60, 0x1f, 0xe5, 0x15, 0x24, 0x38, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xc0, + 0x83, 0xc0, 0x82, 0xe0, 0xfe, 0x12, 0x18, 0xd8, 0x8f, 0x1a, 0xee, 0x4f, 0xd0, 0x82, 0xd0, 0x83, + 0xf0, 0x80, 0xb5, 0x22, 0x8f, 0x1a, 0xe4, 0xf5, 0x1b, 0x75, 0x1c, 0xff, 0x75, 0x1d, 0x19, 0x75, + 0x1e, 0x86, 0xab, 0x1c, 0xaa, 0x1d, 0xa9, 0x1e, 0x90, 0x00, 0x01, 0x12, 0x11, 0xc4, 0xb4}}, + {0x1446, 64, { 0x03, 0x1d, 0xaf, 0x1b, 0x05, 0x1b, 0xef, 0xb5, 0x1a, 0x01, 0x22, 0x12, 0x11, 0xab, 0x7e, 0x00, 0x29, + 0xff, 0xee, 0x3a, 0xa9, 0x07, 0x75, 0x1c, 0xff, 0xf5, 0x1d, 0x89, 0x1e, 0x80, 0xd4, 0x7b, 0x00, + 0x7a, 0x00, 0x79, 0x00, 0x22, 0xe4, 0x90, 0x78, 0x41, 0xf0, 0x90, 0x78, 0x4f, 0x74, 0xc0, 0xf0, + 0xe4, 0x90, 0x78, 0x50, 0xf0, 0xe5, 0x2c, 0x90, 0x78, 0x51, 0xf0, 0xae, 0x2c, 0xe5, 0x2d}}, + {0x1486, 64, { 0x90, 0x78, 0x52, 0xf0, 0x90, 0x78, 0x54, 0xe5, 0x23, 0xf0, 0x90, 0x78, 0x57, 0x74, 0x04, 0xf0, 0x90, + 0x7f, 0xe2, 0xe0, 0x44, 0x10, 0xf0, 0xe0, 0x54, 0xf7, 0xf0, 0xe4, 0x90, 0x78, 0x55, 0xf0, 0x90, + 0x78, 0x55, 0xe0, 0x60, 0xfa, 0x22, 0xe4, 0x90, 0x78, 0x41, 0xf0, 0xe5, 0x2c, 0x90, 0x78, 0x4f, + 0xf0, 0xae, 0x2c, 0xe5, 0x2d, 0x90, 0x78, 0x50, 0xf0, 0x90, 0x78, 0x51, 0x74, 0xc0, 0xf0}}, + {0x14c6, 64, { 0xe4, 0x90, 0x78, 0x52, 0xf0, 0x90, 0x78, 0x54, 0xe5, 0x23, 0xf0, 0x90, 0x78, 0x57, 0x74, 0x04, 0xf0, + 0xe4, 0x90, 0x78, 0x55, 0xf0, 0x90, 0x78, 0x55, 0xe0, 0x60, 0xfa, 0x22, 0xe5, 0x15, 0x24, 0x04, + 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x14, 0x60, 0x0f, 0x14, 0x60, 0x13, 0x14, 0x60, + 0x17, 0x80, 0x00, 0x90, 0x7f, 0xc7, 0xef, 0xf0, 0x80, 0x13, 0x90, 0x7f, 0xc9, 0xef, 0xf0}}, + {0x1506, 64, { 0x80, 0x0c, 0x90, 0x7f, 0xcb, 0xef, 0xf0, 0x80, 0x05, 0x90, 0x7f, 0xcd, 0xef, 0xf0, 0xe5, 0x16, 0x42, + 0x2a, 0x22, 0xe5, 0x15, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x14, 0x60, + 0x0f, 0x14, 0x60, 0x13, 0x14, 0x60, 0x17, 0x80, 0x00, 0x90, 0x7f, 0xb7, 0xef, 0xf0, 0x80, 0x13, + 0x90, 0x7f, 0xb9, 0xef, 0xf0, 0x80, 0x0c, 0x90, 0x7f, 0xbb, 0xef, 0xf0, 0x80, 0x05, 0x90}}, + {0x1546, 64, { 0x7f, 0xbd, 0xef, 0xf0, 0xe5, 0x16, 0x42, 0x2a, 0x22, 0xae, 0x07, 0xe4, 0xff, 0xe5, 0x15, 0x24, 0x32, + 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0xfd, 0x12, 0x16, 0x47, 0x90, 0x78, + 0x41, 0x74, 0x01, 0xf0, 0x90, 0xc0, 0x00, 0xee, 0xf0, 0xe4, 0xe5, 0x15, 0x24, 0x32, 0xf5, 0x82, + 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x44, 0x80, 0xfd, 0x12, 0x16, 0x47, 0x22, 0xc0, 0xe0}}, + {0x1586, 64, { 0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xc0, 0xd0, + 0x75, 0xd0, 0x08, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xa9, 0x74, 0x01, 0xf0, 0x12, 0x13, 0x12, 0xd0, + 0xd0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xf0, 0xd0, 0xe0, 0x32, + 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x78, 0x41}}, + {0x15c6, 64, { 0x74, 0x02, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0xe5, 0x15, 0x24, + 0x37, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, + 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x78, 0x41, 0x74, + 0x04, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0xe5, 0x15}}, + {0x1606, 64, { 0x24, 0x37, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, + 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0x90, 0x78, 0x41, 0x74, + 0x06, 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0xe5, 0x15, 0x24, + 0x37, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0}}, + {0x1646, 64, { 0x22, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0xe5, 0x15, 0x24, 0x37, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, + 0x83, 0xe0, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x07, 0xf0, 0x90, 0xc0, + 0x00, 0xef, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x05, 0xf0, 0x90, 0xc0, 0x00, 0xed, 0xf0, 0x22, 0x90, + 0x78, 0x41, 0x74, 0x03, 0xf0, 0x90, 0xc0, 0x00, 0x74, 0xbf, 0xf0, 0xe4, 0x90, 0x78, 0x41}}, + {0x1686, 64, { 0xf0, 0x90, 0xc0, 0x00, 0xef, 0xf0, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0, 0xe5, 0x15, 0x24, 0x37, 0xf5, + 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x54, 0x7f, 0x90, 0xc0, 0x00, 0xf0, 0x22, 0xe5, 0x15, + 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x14, 0x60, 0x0e, 0x14, 0x60, 0x11, + 0x14, 0x60, 0x14, 0x80, 0x00, 0x90, 0x7f, 0xc6, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0xc8, 0xe0}}, + {0x16c6, 64, { 0xff, 0x22, 0x90, 0x7f, 0xca, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0xcc, 0xe0, 0xff, 0x22, 0xe5, 0x15, 0x24, + 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x14, 0x60, 0x0e, 0x14, 0x60, 0x11, 0x14, + 0x60, 0x14, 0x80, 0x00, 0x90, 0x7f, 0xb6, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0xb8, 0xe0, 0xff, 0x22, + 0x90, 0x7f, 0xba, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0xbc, 0xe0, 0xff, 0x22, 0xe5, 0x15, 0x24}}, + {0x1706, 64, { 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x14, 0x60, 0x0e, 0x14, 0x60, 0x11, 0x14, 0x60, + 0x14, 0x80, 0x00, 0x90, 0x7f, 0xc7, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0xc9, 0xe0, 0xff, 0x22, 0x90, + 0x7f, 0xcb, 0xe0, 0xff, 0x22, 0x90, 0x7f, 0xcd, 0xe0, 0xff, 0x22, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, + 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0x90, 0x7f, 0xc4, 0xe4, 0xf0}}, + {0x1746, 64, { 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x04, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, + 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x90, 0x7b, 0x41, 0xe0, 0xf5, 0x36, 0x43, 0x13, 0x10, 0xa3, 0xe0, + 0x60, 0x09, 0x90, 0x7f, 0xd7, 0x74, 0x17, 0xf0, 0x74, 0x37, 0xf0, 0x90, 0x7b, 0x43, 0xe0, 0xf5, + 0x37, 0xa3, 0xe0, 0x54, 0xf0, 0xf5, 0x29, 0xe0, 0x60, 0x02, 0xd2, 0x0a, 0x22, 0xc0, 0xe0}}, + {0x1786, 64, { 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, 0x75, 0x86, 0x00, 0xd2, 0x01, 0x53, 0x91, + 0xef, 0x90, 0x7f, 0xab, 0x74, 0x01, 0xf0, 0xd0, 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, + 0x83, 0xd0, 0xe0, 0x32, 0xc0, 0xe0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0x85, 0xc0, 0x84, 0xc0, 0x86, + 0x75, 0x86, 0x00, 0xd2, 0x08, 0x53, 0x91, 0xef, 0x90, 0x7f, 0xab, 0x74, 0x08, 0xf0, 0xd0}}, + {0x17c6, 64, { 0x86, 0xd0, 0x84, 0xd0, 0x85, 0xd0, 0x82, 0xd0, 0x83, 0xd0, 0xe0, 0x32, 0x12, 0x18, 0xc0, 0xae, 0x07, + 0x12, 0x18, 0xc0, 0xad, 0x07, 0xee, 0x6d, 0x60, 0x10, 0x12, 0x18, 0xc0, 0xae, 0x07, 0xee, 0x6d, + 0x60, 0x07, 0x12, 0x18, 0xc0, 0xad, 0x07, 0x80, 0xec, 0xaf, 0x06, 0x22, 0x74, 0x00, 0xf5, 0x86, + 0x90, 0xfd, 0xa5, 0x7c, 0x05, 0xa3, 0xe5, 0x82, 0x45, 0x83, 0x70, 0xf9, 0x22, 0x90, 0x7f}}, + {0x1806, 64, { 0xd6, 0xe0, 0x44, 0x80, 0xf0, 0x43, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x90, 0x7f, 0xd6, + 0xe0, 0x44, 0x04, 0xf0, 0xe0, 0x44, 0x08, 0xf0, 0x30, 0x0b, 0x04, 0xe0, 0x44, 0x02, 0xf0, 0x7f, + 0xf4, 0x7e, 0x01, 0x12, 0x18, 0x6b, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xf7, 0xf0, 0x22, 0x12, 0x13, + 0x7c, 0x12, 0x18, 0x04, 0x90, 0x7f, 0xd6, 0xe0, 0x30, 0xe7, 0x0a, 0x7f, 0x05, 0x7e, 0x00}}, + {0x1846, 64, { 0x12, 0x18, 0x6b, 0x12, 0x18, 0x9e, 0x12, 0x0a, 0xb8, 0x22, 0x03, 0x35, 0x80, 0x00, 0x00, 0x03, 0x2e, + 0x81, 0x00, 0x00, 0xc1, 0x85, 0xc1, 0x81, 0xc1, 0x08, 0xc1, 0x00, 0xc1, 0x06, 0x01, 0x22, 0x00, + 0x01, 0x24, 0x00, 0x00, 0x8e, 0x18, 0x8f, 0x19, 0xe5, 0x19, 0x15, 0x19, 0xae, 0x18, 0x70, 0x02, + 0x15, 0x18, 0x4e, 0x60, 0x08, 0x12, 0x17, 0xf3, 0x12, 0x17, 0xf3, 0x80, 0xeb, 0x22, 0xe5}}, + {0x1886, 64, { 0x15, 0x24, 0x04, 0xf5, 0x82, 0xe4, 0x35, 0x14, 0xf5, 0x83, 0xe0, 0x04, 0xff, 0x44, 0x10, 0x90, 0x7f, + 0xd7, 0xf0, 0xef, 0x44, 0x30, 0xf0, 0x22, 0x90, 0x7f, 0xd6, 0xe0, 0x44, 0x01, 0xf0, 0x7f, 0x0d, + 0x7e, 0x00, 0x12, 0x18, 0x6b, 0x90, 0x7f, 0xd6, 0xe0, 0x54, 0xfe, 0xf0, 0x22, 0x90, 0x78, 0x41, + 0x74, 0x02, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x78, 0x41, 0x74, 0x03, 0xf0}}, + {0x18c6, 64, { 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x78, 0x41, 0x74, 0x04, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, + 0x22, 0x90, 0x78, 0x41, 0x74, 0x05, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x90, 0x78, 0x41, + 0x74, 0x06, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0xe4, 0x90, 0x78, 0x41, 0xf0, 0x90, 0xc0, + 0x00, 0xe0, 0xff, 0x22, 0x53, 0xd8, 0xef, 0x32, 0x00, 0x12, 0x01, 0x10, 0x01, 0xff, 0x00}}, {0x1906, 64, { 0x00, 0x40, 0xcd, 0x06, 0x0a, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x04, 0x09, 0x02, 0x74, 0x00, 0x01, 0x01, 0x00, 0xa0, 0x32, 0x09, 0x04, 0x00, 0x00, 0x0e, 0xff, 0x00, 0x00, 0x00, 0x07, 0x05, 0x01, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x02, 0x02, 0x40, 0x00, 0x00, 0x07, 0x05, 0x03, 0x02, 0x40, @@ -438,7 +442,7 @@ 0x00, 0x42, 0x00, 0x20, 0x00, 0x34, 0x00, 0x2d, 0x00, 0x70, 0x00, 0x6f, 0x00, 0x72, 0x00, 0x74, 0x00, 0x20, 0x00, 0x53, 0x00, 0x65, 0x00, 0x72, 0x00, 0x69, 0x00, 0x61, 0x00, 0x6c, 0x00, 0x20, 0x00, 0x41, 0x00, 0x64, 0x00, 0x61, 0x00, 0x70, 0x00, 0x74, 0x00, 0x65, 0x00, 0x72, 0x00}}, - {0x1a06, 64, { 0x00, 0x00, 0xe4, 0x90, 0x78, 0x41, 0xf0, 0x90, 0xc0, 0x00, 0xe0, 0xff, 0x22, 0x00, 0x00, 0x00, 0x00, + {0x1a06, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}}, @@ -453,8 +457,8 @@ {0x1ac6, 64, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x17, 0xb7, 0x00, 0x02, 0x1b}}, - {0x1b06, 21, { 0x04, 0x00, 0x02, 0x17, 0x65, 0x00, 0x02, 0x17, 0x37, 0x00, 0x02, 0x1b, 0x10, 0x00, 0x02, 0x1b, 0x14, - 0x00, 0x02, 0x15, 0x89}}, -{ 0xffff, 0, {0x00} } + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x17, 0x84, 0x00, 0x02, 0x1b}}, + {0x1b06, 21, { 0x04, 0x00, 0x02, 0x17, 0x32, 0x00, 0x02, 0x17, 0xab, 0x00, 0x02, 0x1b, 0x10, 0x00, 0x02, 0x1b, 0x14, + 0x00, 0x02, 0x15, 0x84}}, + {0xffff, 0, {0x00}} }; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/kl5kusb105.c linux.20pre5-ac2/drivers/usb/serial/kl5kusb105.c --- linux.20pre5/drivers/usb/serial/kl5kusb105.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/kl5kusb105.c 2002-09-01 13:39:50.000000000 +0100 @@ -47,18 +47,14 @@ #include #include -#include -#include #include -#include #include #include -/*#include */ #include #include #include #include -/*#include */ +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -111,81 +107,41 @@ */ /* - * All of the device info needed for the MCT USB-RS232 converter. + * All of the device info needed for the KLSI converters. */ -static __devinitdata struct usb_device_id id_table_combined [] = { +static struct usb_device_id id_table [] = { { USB_DEVICE(PALMCONNECT_VID, PALMCONNECT_PID) }, { USB_DEVICE(KLSI_VID, KLSI_KL5KUSB105D_PID) }, { } /* Terminating entry */ }; -static struct usb_device_id palmconnect_table [] = { - { USB_DEVICE(PALMCONNECT_VID, PALMCONNECT_PID) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id kl5kusb105d_table [] = { - { USB_DEVICE(KLSI_VID, KLSI_KL5KUSB105D_PID) }, - { } /* Terminating entry */ -}; - +MODULE_DEVICE_TABLE (usb, id_table); -MODULE_DEVICE_TABLE (usb, id_table_combined); - - -static struct usb_serial_device_type palmconnect_device = { - name: "PalmConnect USB Serial", - id_table: palmconnect_table, - needs_interrupt_in: MUST_HAVE, /* 1 interrupt-in endpoints */ - needs_bulk_in: MUST_HAVE, /* 1 bulk-in endpoint */ - needs_bulk_out: MUST_HAVE, /* 1 bulk-out endpoint */ - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: klsi_105_open, - close: klsi_105_close, - write: klsi_105_write, - write_bulk_callback: klsi_105_write_bulk_callback, - chars_in_buffer: klsi_105_chars_in_buffer, - write_room: klsi_105_write_room, - read_bulk_callback: klsi_105_read_bulk_callback, - ioctl: klsi_105_ioctl, - set_termios: klsi_105_set_termios, - /*break_ctl: klsi_105_break_ctl,*/ - startup: klsi_105_startup, - shutdown: klsi_105_shutdown, - throttle: klsi_105_throttle, - unthrottle: klsi_105_unthrottle, -}; static struct usb_serial_device_type kl5kusb105d_device = { - name: "generic KL5KUSB105D USB->Serial", - id_table: kl5kusb105d_table, - needs_interrupt_in: MUST_HAVE, /* 1 interrupt-in endpoints */ - needs_bulk_in: MUST_HAVE, /* 1 bulk-in endpoint */ - needs_bulk_out: MUST_HAVE, /* 1 bulk-out endpoint */ - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: klsi_105_open, - close: klsi_105_close, - write: klsi_105_write, - write_bulk_callback: klsi_105_write_bulk_callback, - chars_in_buffer: klsi_105_chars_in_buffer, - write_room: klsi_105_write_room, - read_bulk_callback: klsi_105_read_bulk_callback, - ioctl: klsi_105_ioctl, - set_termios: klsi_105_set_termios, - /*break_ctl: klsi_105_break_ctl,*/ - startup: klsi_105_startup, - shutdown: klsi_105_shutdown, - throttle: klsi_105_throttle, - unthrottle: klsi_105_unthrottle, + .owner = THIS_MODULE, + .name = "KL5KUSB105D / PalmConnect", + .id_table = id_table, + .num_interrupt_in = 1, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 1, + .open = klsi_105_open, + .close = klsi_105_close, + .write = klsi_105_write, + .write_bulk_callback = klsi_105_write_bulk_callback, + .chars_in_buffer = klsi_105_chars_in_buffer, + .write_room = klsi_105_write_room, + .read_bulk_callback =klsi_105_read_bulk_callback, + .ioctl = klsi_105_ioctl, + .set_termios = klsi_105_set_termios, + /*.break_ctl = klsi_105_break_ctl,*/ + .startup = klsi_105_startup, + .shutdown = klsi_105_shutdown, + .throttle = klsi_105_throttle, + .unthrottle = klsi_105_unthrottle, }; - struct klsi_105_port_settings { __u8 pktlen; /* always 5, it seems */ __u8 baudrate; @@ -359,9 +315,6 @@ struct klsi_105_private *priv = (struct klsi_105_private*) serial->port[i].private; unsigned long flags; - while (serial->port[i].open_count > 0) { - klsi_105_close (&serial->port[i], NULL); - } if (priv) { /* kill our write urb pool */ @@ -397,90 +350,79 @@ struct usb_serial *serial = port->serial; struct klsi_105_private *priv = (struct klsi_105_private *)port->private; int retval = 0; + int rc; + int i; + unsigned long line_state; dbg("%s port %d", __FUNCTION__, port->number); - down (&port->sem); + /* force low_latency on so that our tty_push actually forces + * the data through + * port->tty->low_latency = 1; */ + + /* Do a defined restart: + * Set up sane default baud rate and send the 'READ_ON' + * vendor command. + * FIXME: set modem line control (how?) + * Then read the modem line control and store values in + * priv->line_state. + */ + priv->cfg.pktlen = 5; + priv->cfg.baudrate = kl5kusb105a_sio_b9600; + priv->cfg.databits = kl5kusb105a_dtb_8; + priv->cfg.unknown1 = 0; + priv->cfg.unknown2 = 1; + klsi_105_chg_port_settings(serial, &(priv->cfg)); - ++port->open_count; - MOD_INC_USE_COUNT; - - if (!port->active) { - int rc; - int i; - unsigned long line_state; - port->active = 1; - - /* force low_latency on so that our tty_push actually forces - * the data through - * port->tty->low_latency = 1; */ - - /* Do a defined restart: - * Set up sane default baud rate and send the 'READ_ON' - * vendor command. - * FIXME: set modem line control (how?) - * Then read the modem line control and store values in - * priv->line_state. - */ - priv->cfg.pktlen = 5; - priv->cfg.baudrate = kl5kusb105a_sio_b9600; - priv->cfg.databits = kl5kusb105a_dtb_8; - priv->cfg.unknown1 = 0; - priv->cfg.unknown2 = 1; - klsi_105_chg_port_settings(serial, &(priv->cfg)); - - /* set up termios structure */ - priv->termios.c_iflag = port->tty->termios->c_iflag; - priv->termios.c_oflag = port->tty->termios->c_oflag; - priv->termios.c_cflag = port->tty->termios->c_cflag; - priv->termios.c_lflag = port->tty->termios->c_lflag; - for (i=0; itermios.c_cc[i] = port->tty->termios->c_cc[i]; - - - /* READ_ON and urb submission */ - FILL_BULK_URB(port->read_urb, serial->dev, - usb_rcvbulkpipe(serial->dev, - port->bulk_in_endpointAddress), - port->read_urb->transfer_buffer, - port->read_urb->transfer_buffer_length, - klsi_105_read_bulk_callback, - port); - port->read_urb->transfer_flags |= USB_QUEUE_BULK; + /* set up termios structure */ + priv->termios.c_iflag = port->tty->termios->c_iflag; + priv->termios.c_oflag = port->tty->termios->c_oflag; + priv->termios.c_cflag = port->tty->termios->c_cflag; + priv->termios.c_lflag = port->tty->termios->c_lflag; + for (i=0; itermios.c_cc[i] = port->tty->termios->c_cc[i]; - rc = usb_submit_urb(port->read_urb); - if (rc) { - err("%s - failed submitting read urb, error %d", __FUNCTION__, rc); - retval = rc; - goto exit; - } - rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev,0), - KL5KUSB105A_SIO_CONFIGURE, - USB_TYPE_VENDOR|USB_DIR_OUT|USB_RECIP_INTERFACE, - KL5KUSB105A_SIO_CONFIGURE_READ_ON, - 0, /* index */ - NULL, - 0, - KLSI_TIMEOUT); - if (rc < 0) { - err("Enabling read failed (error = %d)", rc); - retval = rc; - } else - dbg("%s - enabled reading", __FUNCTION__); + /* READ_ON and urb submission */ + FILL_BULK_URB(port->read_urb, serial->dev, + usb_rcvbulkpipe(serial->dev, + port->bulk_in_endpointAddress), + port->read_urb->transfer_buffer, + port->read_urb->transfer_buffer_length, + klsi_105_read_bulk_callback, + port); + port->read_urb->transfer_flags |= USB_QUEUE_BULK; - rc = klsi_105_get_line_state(serial, &line_state); - if (rc >= 0) { - priv->line_state = line_state; - dbg("%s - read line state 0x%lx", __FUNCTION__, line_state); - retval = 0; - } else - retval = rc; + rc = usb_submit_urb(port->read_urb); + if (rc) { + err("%s - failed submitting read urb, error %d", __FUNCTION__, rc); + retval = rc; + goto exit; } + rc = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev,0), + KL5KUSB105A_SIO_CONFIGURE, + USB_TYPE_VENDOR|USB_DIR_OUT|USB_RECIP_INTERFACE, + KL5KUSB105A_SIO_CONFIGURE_READ_ON, + 0, /* index */ + NULL, + 0, + KLSI_TIMEOUT); + if (rc < 0) { + err("Enabling read failed (error = %d)", rc); + retval = rc; + } else + dbg("%s - enabled reading", __FUNCTION__); + + rc = klsi_105_get_line_state(serial, &line_state); + if (rc >= 0) { + priv->line_state = line_state; + dbg("%s - read line state 0x%lx", __FUNCTION__, line_state); + retval = 0; + } else + retval = rc; + exit: - up (&port->sem); - return retval; } /* klsi_105_open */ @@ -490,6 +432,8 @@ struct usb_serial *serial; struct klsi_105_private *priv = (struct klsi_105_private *)port->private; + int rc; + dbg("%s port %d", __FUNCTION__, port->number); serial = get_usb_serial (port, __FUNCTION__); @@ -497,36 +441,26 @@ if(!serial) return; - down (&port->sem); - - --port->open_count; + /* send READ_OFF */ + rc = usb_control_msg (serial->dev, + usb_sndctrlpipe(serial->dev, 0), + KL5KUSB105A_SIO_CONFIGURE, + USB_TYPE_VENDOR | USB_DIR_OUT, + KL5KUSB105A_SIO_CONFIGURE_READ_OFF, + 0, /* index */ + NULL, 0, + KLSI_TIMEOUT); + if (rc < 0) + err("Disabling read failed (error = %d)", rc); - if (port->open_count <= 0) { - /* send READ_OFF */ - int rc = usb_control_msg(serial->dev, - usb_sndctrlpipe(serial->dev, 0), - KL5KUSB105A_SIO_CONFIGURE, - USB_TYPE_VENDOR | USB_DIR_OUT, - KL5KUSB105A_SIO_CONFIGURE_READ_OFF, - 0, /* index */ - NULL, 0, - KLSI_TIMEOUT); - if (rc < 0) - err("Disabling read failed (error = %d)", rc); - - /* shutdown our bulk reads and writes */ - usb_unlink_urb (port->write_urb); - usb_unlink_urb (port->read_urb); - /* unlink our write pool */ - /* FIXME */ - /* wgg - do I need this? I think so. */ - usb_unlink_urb (port->interrupt_in_urb); - port->active = 0; - info("kl5kusb105 port stats: %ld bytes in, %ld bytes out", priv->bytes_in, priv->bytes_out); - } - - up (&port->sem); - MOD_DEC_USE_COUNT; + /* shutdown our bulk reads and writes */ + usb_unlink_urb (port->write_urb); + usb_unlink_urb (port->read_urb); + /* unlink our write pool */ + /* FIXME */ + /* wgg - do I need this? I think so. */ + usb_unlink_urb (port->interrupt_in_urb); + info("kl5kusb105 port stats: %ld bytes in, %ld bytes out", priv->bytes_in, priv->bytes_out); } /* klsi_105_close */ @@ -536,6 +470,7 @@ */ #define KLSI_105_DATA_OFFSET 2 /* in the bulk urb data block */ + static int klsi_105_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count) { @@ -547,9 +482,6 @@ dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); /* to lock against someone else trying to - take an URB we just selected from the pool */ - while (count > 0) { /* try to find a free urb (write 0 bytes if none) */ struct urb *urb = NULL; @@ -585,7 +517,6 @@ if (from_user) { if (copy_from_user(urb->transfer_buffer + KLSI_105_DATA_OFFSET, buf, size)) { - up (&port->sem); return -EFAULT; } } else { @@ -619,7 +550,6 @@ count -= size; } exit: - up (&port->sem); priv->bytes_out+=bytes_sent; return bytes_sent; /* that's how much we wrote */ @@ -1060,41 +990,27 @@ static void klsi_105_throttle (struct usb_serial_port *port) { - dbg("%s - port %d", __FUNCTION__, port->number); - - down (&port->sem); - usb_unlink_urb (port->read_urb); - - up (&port->sem); - - return; } + static void klsi_105_unthrottle (struct usb_serial_port *port) { int result; dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); - port->read_urb->dev = port->serial->dev; result = usb_submit_urb(port->read_urb); if (result) err("%s - failed submitting read urb, error %d", __FUNCTION__, result); - - up (&port->sem); - - return; } static int __init klsi_105_init (void) { - usb_serial_register (&palmconnect_device); usb_serial_register (&kl5kusb105d_device); info(DRIVER_DESC " " DRIVER_VERSION); @@ -1104,7 +1020,6 @@ static void __exit klsi_105_exit (void) { - usb_serial_deregister (&palmconnect_device); usb_serial_deregister (&kl5kusb105d_device); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/kl5kusb105.h linux.20pre5-ac2/drivers/usb/serial/kl5kusb105.h --- linux.20pre5/drivers/usb/serial/kl5kusb105.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/kl5kusb105.h 2002-09-01 13:39:50.000000000 +0100 @@ -16,7 +16,7 @@ /* baud rates */ -typedef enum { +enum { kl5kusb105a_sio_b115200 = 0, kl5kusb105a_sio_b57600 = 1, kl5kusb105a_sio_b38400 = 2, @@ -27,7 +27,7 @@ kl5kusb105a_sio_b2400 = 9, /* unchecked */ kl5kusb105a_sio_b1200 = 0xa, /* unchecked */ kl5kusb105a_sio_b600 = 0xb /* unchecked */ -} KL5KUSB105A_SIO_baudrate_t; +}; /* data bits */ #define kl5kusb105a_dtb_7 7 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/mct_u232.c linux.20pre5-ac2/drivers/usb/serial/mct_u232.c --- linux.20pre5/drivers/usb/serial/mct_u232.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/mct_u232.c 2002-09-01 13:40:06.000000000 +0100 @@ -61,18 +61,15 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -132,7 +129,7 @@ /* * All of the device info needed for the MCT USB-RS232 converter. */ -static __devinitdata struct usb_device_id id_table_combined [] = { +static struct usb_device_id id_table_combined [] = { { USB_DEVICE(MCT_U232_VID, MCT_U232_PID) }, { USB_DEVICE(MCT_U232_VID, MCT_U232_SITECOM_PID) }, { USB_DEVICE(MCT_U232_VID, MCT_U232_DU_H3SP_PID) }, @@ -140,99 +137,31 @@ { } /* Terminating entry */ }; -static struct usb_device_id mct_u232_table [] = { - { USB_DEVICE(MCT_U232_VID, MCT_U232_PID) }, - { USB_DEVICE(MCT_U232_BELKIN_F5U109_VID, MCT_U232_BELKIN_F5U109_PID) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id mct_u232_sitecom_table [] = { - { USB_DEVICE(MCT_U232_VID, MCT_U232_SITECOM_PID) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id mct_u232_du_h3sp_table [] = { - { USB_DEVICE(MCT_U232_VID, MCT_U232_DU_H3SP_PID) }, - { } /* Terminating entry */ -}; - MODULE_DEVICE_TABLE (usb, id_table_combined); static struct usb_serial_device_type mct_u232_device = { - name: "Magic Control Technology USB-RS232", - id_table: mct_u232_table, - needs_interrupt_in: MUST_HAVE, /* 2 interrupt-in endpoints */ - needs_bulk_in: MUST_HAVE_NOT, /* no bulk-in endpoint */ - needs_bulk_out: MUST_HAVE, /* 1 bulk-out endpoint */ - num_interrupt_in: 2, - num_bulk_in: 0, - num_bulk_out: 1, - num_ports: 1, - open: mct_u232_open, - close: mct_u232_close, + .owner = THIS_MODULE, + .name = "Magic Control Technology USB-RS232", + .id_table = id_table_combined, + .num_interrupt_in = 2, + .num_bulk_in = 0, + .num_bulk_out = 1, + .num_ports = 1, + .open = mct_u232_open, + .close = mct_u232_close, #ifdef FIX_WRITE_RETURN_CODE_PROBLEM - write: mct_u232_write, - write_bulk_callback: mct_u232_write_bulk_callback, + .write = mct_u232_write, + .write_bulk_callback = mct_u232_write_bulk_callback, #endif - read_int_callback: mct_u232_read_int_callback, - ioctl: mct_u232_ioctl, - set_termios: mct_u232_set_termios, - break_ctl: mct_u232_break_ctl, - startup: mct_u232_startup, - shutdown: mct_u232_shutdown, + .read_int_callback = mct_u232_read_int_callback, + .ioctl = mct_u232_ioctl, + .set_termios = mct_u232_set_termios, + .break_ctl = mct_u232_break_ctl, + .startup = mct_u232_startup, + .shutdown = mct_u232_shutdown, }; -static struct usb_serial_device_type mct_u232_sitecom_device = { - name: "MCT/Sitecom USB-RS232", - id_table: mct_u232_sitecom_table, - needs_interrupt_in: MUST_HAVE, /* 2 interrupt-in endpoints */ - needs_bulk_in: MUST_HAVE_NOT, /* no bulk-in endpoint */ - needs_bulk_out: MUST_HAVE, /* 1 bulk-out endpoint */ - num_interrupt_in: 2, - num_bulk_in: 0, - num_bulk_out: 1, - num_ports: 1, - open: mct_u232_open, - close: mct_u232_close, -#ifdef FIX_WRITE_RETURN_CODE_PROBLEM - write: mct_u232_write, - write_bulk_callback: mct_u232_write_bulk_callback, -#endif - read_int_callback: mct_u232_read_int_callback, - ioctl: mct_u232_ioctl, - set_termios: mct_u232_set_termios, - break_ctl: mct_u232_break_ctl, - startup: mct_u232_startup, - shutdown: mct_u232_shutdown, -}; - -static struct usb_serial_device_type mct_u232_du_h3sp_device = { - name: "MCT/D-Link DU-H3SP USB BAY", - id_table: mct_u232_du_h3sp_table, - needs_interrupt_in: MUST_HAVE, /* 2 interrupt-in endpoints */ - needs_bulk_in: MUST_HAVE_NOT, /* no bulk-in endpoint */ - needs_bulk_out: MUST_HAVE, /* 1 bulk-out endpoint */ - num_interrupt_in: 2, - num_bulk_in: 0, - num_bulk_out: 1, - num_ports: 1, - open: mct_u232_open, - close: mct_u232_close, -#ifdef FIX_WRITE_RETURN_CODE_PROBLEM - write: mct_u232_write, - write_bulk_callback: mct_u232_write_bulk_callback, -#endif - read_int_callback: mct_u232_read_int_callback, - ioctl: mct_u232_ioctl, - set_termios: mct_u232_set_termios, - break_ctl: mct_u232_break_ctl, - startup: mct_u232_startup, - shutdown: mct_u232_shutdown, -}; - - - struct mct_u232_private { unsigned long control_state; /* Modem Line Setting (TIOCM) */ @@ -392,9 +321,6 @@ /* stop reads and writes on all ports */ for (i=0; i < serial->num_ports; ++i) { - while (serial->port[i].open_count > 0) { - mct_u232_close (&serial->port[i], NULL); - } /* My special items, the standard routines free my urbs */ if (serial->port[i].private) kfree(serial->port[i].private); @@ -409,68 +335,56 @@ dbg("%s port %d", __FUNCTION__, port->number); - down (&port->sem); - - ++port->open_count; - MOD_INC_USE_COUNT; - - if (!port->active) { - port->active = 1; + /* Compensate for a hardware bug: although the Sitecom U232-P25 + * device reports a maximum output packet size of 32 bytes, + * it seems to be able to accept only 16 bytes (and that's what + * SniffUSB says too...) + */ + if (serial->dev->descriptor.idProduct == MCT_U232_SITECOM_PID) + port->bulk_out_size = 16; - /* Compensate for a hardware bug: although the Sitecom U232-P25 - * device reports a maximum output packet size of 32 bytes, - * it seems to be able to accept only 16 bytes (and that's what - * SniffUSB says too...) - */ - if (serial->dev->descriptor.idProduct == MCT_U232_SITECOM_PID) - port->bulk_out_size = 16; - - /* Do a defined restart: the normal serial device seems to - * always turn on DTR and RTS here, so do the same. I'm not - * sure if this is really necessary. But it should not harm - * either. - */ - if (port->tty->termios->c_cflag & CBAUD) - priv->control_state = TIOCM_DTR | TIOCM_RTS; - else - priv->control_state = 0; - mct_u232_set_modem_ctrl(serial, priv->control_state); - - priv->last_lcr = (MCT_U232_DATA_BITS_8 | - MCT_U232_PARITY_NONE | - MCT_U232_STOP_BITS_1); - mct_u232_set_line_ctrl(serial, priv->last_lcr); + /* Do a defined restart: the normal serial device seems to + * always turn on DTR and RTS here, so do the same. I'm not + * sure if this is really necessary. But it should not harm + * either. + */ + if (port->tty->termios->c_cflag & CBAUD) + priv->control_state = TIOCM_DTR | TIOCM_RTS; + else + priv->control_state = 0; + mct_u232_set_modem_ctrl(serial, priv->control_state); + + priv->last_lcr = (MCT_U232_DATA_BITS_8 | + MCT_U232_PARITY_NONE | + MCT_U232_STOP_BITS_1); + mct_u232_set_line_ctrl(serial, priv->last_lcr); - /* Read modem status and update control state */ - mct_u232_get_modem_stat(serial, &priv->last_msr); - mct_u232_msr_to_state(&priv->control_state, priv->last_msr); - - { - /* Puh, that's dirty */ - struct usb_serial_port *rport; - rport = &serial->port[1]; - rport->tty = port->tty; - rport->private = port->private; - port->read_urb = rport->interrupt_in_urb; - } - - port->read_urb->dev = port->serial->dev; - retval = usb_submit_urb(port->read_urb); - if (retval) { - err("usb_submit_urb(read bulk) failed"); - goto exit; - } - - port->interrupt_in_urb->dev = port->serial->dev; - retval = usb_submit_urb(port->interrupt_in_urb); - if (retval) - err(" usb_submit_urb(read int) failed"); + /* Read modem status and update control state */ + mct_u232_get_modem_stat(serial, &priv->last_msr); + mct_u232_msr_to_state(&priv->control_state, priv->last_msr); - } + { + /* Puh, that's dirty */ + struct usb_serial_port *rport; + rport = &serial->port[1]; + rport->tty = port->tty; + rport->private = port->private; + port->read_urb = rport->interrupt_in_urb; + } + + port->read_urb->dev = port->serial->dev; + retval = usb_submit_urb(port->read_urb); + if (retval) { + err("usb_submit_urb(read bulk) failed"); + goto exit; + } + + port->interrupt_in_urb->dev = port->serial->dev; + retval = usb_submit_urb(port->interrupt_in_urb); + if (retval) + err(" usb_submit_urb(read int) failed"); exit: - up (&port->sem); - return 0; } /* mct_u232_open */ @@ -479,22 +393,12 @@ { dbg("%s port %d", __FUNCTION__, port->number); - down (&port->sem); - - --port->open_count; - - if (port->open_count <= 0) { - if (port->serial->dev) { - /* shutdown our urbs */ - usb_unlink_urb (port->write_urb); - usb_unlink_urb (port->read_urb); - usb_unlink_urb (port->interrupt_in_urb); - } - port->active = 0; + if (port->serial->dev) { + /* shutdown our urbs */ + usb_unlink_urb (port->write_urb); + usb_unlink_urb (port->read_urb); + usb_unlink_urb (port->interrupt_in_urb); } - - up (&port->sem); - MOD_DEC_USE_COUNT; } /* mct_u232_close */ @@ -526,16 +430,12 @@ bytes_sent = 0; while (count > 0) { - - down (&port->sem); - size = (count > port->bulk_out_size) ? port->bulk_out_size : count; usb_serial_debug_data (__FILE__, __FUNCTION__, size, buf); if (from_user) { if (copy_from_user(port->write_urb->transfer_buffer, buf, size)) { - up (&port->sem); return -EFAULT; } } @@ -557,12 +457,9 @@ result = usb_submit_urb(port->write_urb); if (result) { err("%s - failed submitting write urb, error %d", __FUNCTION__, result); - up (&port->sem); return result; } - up (&port->sem); - bytes_sent += size; if (write_blocking) interruptible_sleep_on(&port->write_wait); @@ -885,9 +782,7 @@ static int __init mct_u232_init (void) { usb_serial_register (&mct_u232_device); - usb_serial_register (&mct_u232_sitecom_device); - usb_serial_register (&mct_u232_du_h3sp_device); - info(DRIVER_VERSION ":" DRIVER_DESC); + info(DRIVER_DESC " " DRIVER_VERSION); return 0; } @@ -895,8 +790,6 @@ static void __exit mct_u232_exit (void) { usb_serial_deregister (&mct_u232_device); - usb_serial_deregister (&mct_u232_sitecom_device); - usb_serial_deregister (&mct_u232_du_h3sp_device); } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/omninet.c linux.20pre5-ac2/drivers/usb/serial/omninet.c --- linux.20pre5/drivers/usb/serial/omninet.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/omninet.c 2002-09-01 13:40:19.000000000 +0100 @@ -37,18 +37,15 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -88,22 +85,20 @@ static struct usb_serial_device_type zyxel_omninet_device = { - name: "ZyXEL - omni.net lcd plus usb", - id_table: id_table, - needs_interrupt_in: MUST_HAVE, - needs_bulk_in: MUST_HAVE, - needs_bulk_out: MUST_HAVE, - num_interrupt_in: 1, - num_bulk_in: 1, - num_bulk_out: 2, - num_ports: 1, - open: omninet_open, - close: omninet_close, - write: omninet_write, - write_room: omninet_write_room, - read_bulk_callback: omninet_read_bulk_callback, - write_bulk_callback: omninet_write_bulk_callback, - shutdown: omninet_shutdown, + .owner = THIS_MODULE, + .name = "ZyXEL - omni.net lcd plus usb", + .id_table = id_table, + .num_interrupt_in = 1, + .num_bulk_in = 1, + .num_bulk_out = 2, + .num_ports = 1, + .open = omninet_open, + .close = omninet_close, + .write = omninet_write, + .write_room = omninet_write_room, + .read_bulk_callback = omninet_read_bulk_callback, + .write_bulk_callback = omninet_write_bulk_callback, + .shutdown = omninet_shutdown, }; @@ -159,39 +154,24 @@ if (!serial) return -ENODEV; - down (&port->sem); - - MOD_INC_USE_COUNT; - ++port->open_count; - - if (!port->active) { - port->active = 1; - - od = kmalloc( sizeof(struct omninet_data), GFP_KERNEL ); - if( !od ) { - err("%s- kmalloc(%Zd) failed.", __FUNCTION__, sizeof(struct omninet_data)); - --port->open_count; - port->active = 0; - up (&port->sem); - MOD_DEC_USE_COUNT; - return -ENOMEM; - } - - port->private = od; - wport = &serial->port[1]; - wport->tty = port->tty; - - /* Start reading from the device */ - FILL_BULK_URB(port->read_urb, serial->dev, - usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), - port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, - omninet_read_bulk_callback, port); - result = usb_submit_urb(port->read_urb); - if (result) - err("%s - failed submitting read urb, error %d", __FUNCTION__, result); + od = kmalloc( sizeof(struct omninet_data), GFP_KERNEL ); + if( !od ) { + err("%s- kmalloc(%Zd) failed.", __FUNCTION__, sizeof(struct omninet_data)); + return -ENOMEM; } - up (&port->sem); + port->private = od; + wport = &serial->port[1]; + wport->tty = port->tty; + + /* Start reading from the device */ + FILL_BULK_URB(port->read_urb, serial->dev, + usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), + port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, + omninet_read_bulk_callback, port); + result = usb_submit_urb(port->read_urb); + if (result) + err("%s - failed submitting read urb, error %d", __FUNCTION__, result); return result; } @@ -211,26 +191,15 @@ if (!serial) return; - down (&port->sem); - - --port->open_count; - - if (port->open_count <= 0) { - if (serial->dev) { - wport = &serial->port[1]; - usb_unlink_urb (wport->write_urb); - usb_unlink_urb (port->read_urb); - } - - port->active = 0; - port->open_count = 0; - od = (struct omninet_data *)port->private; - if (od) - kfree(od); + if (serial->dev) { + wport = &serial->port[1]; + usb_unlink_urb (wport->write_urb); + usb_unlink_urb (port->read_urb); } - up (&port->sem); - MOD_DEC_USE_COUNT; + od = (struct omninet_data *)port->private; + if (od) + kfree(od); } @@ -395,10 +364,6 @@ static void omninet_shutdown (struct usb_serial *serial) { dbg ("%s", __FUNCTION__); - - while (serial->port[0].open_count > 0) { - omninet_close (&serial->port[0], NULL); - } } diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/pl2303.c linux.20pre5-ac2/drivers/usb/serial/pl2303.c --- linux.20pre5/drivers/usb/serial/pl2303.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/pl2303.c 2002-09-01 13:40:31.000000000 +0100 @@ -1,7 +1,7 @@ /* * Prolific PL2303 USB to serial adaptor driver * - * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com) + * Copyright (C) 2001-2002 Greg Kroah-Hartman (greg@kroah.com) * * Original driver for 2.2.x by anonymous * @@ -32,19 +32,16 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include #include +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -71,6 +68,7 @@ { USB_DEVICE(ATEN_VENDOR_ID, ATEN_PRODUCT_ID) }, { USB_DEVICE(ELCOM_VENDOR_ID, ELCOM_PRODUCT_ID) }, { USB_DEVICE(ITEGNO_VENDOR_ID, ITEGNO_PRODUCT_ID) }, + { USB_DEVICE(MA620_VENDOR_ID, MA620_PRODUCT_ID) }, { } /* Terminating entry */ }; @@ -118,26 +116,24 @@ /* All of the device info needed for the PL2303 SIO serial converter */ static struct usb_serial_device_type pl2303_device = { - name: "PL-2303", - id_table: id_table, - needs_interrupt_in: DONT_CARE, /* this device must have an interrupt in endpoint */ - needs_bulk_in: MUST_HAVE, /* this device must have a bulk in endpoint */ - needs_bulk_out: MUST_HAVE, /* this device must have a bulk out endpoint */ - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: pl2303_open, - close: pl2303_close, - write: pl2303_write, - ioctl: pl2303_ioctl, - break_ctl: pl2303_break_ctl, - set_termios: pl2303_set_termios, - read_bulk_callback: pl2303_read_bulk_callback, - read_int_callback: pl2303_read_int_callback, - write_bulk_callback: pl2303_write_bulk_callback, - startup: pl2303_startup, - shutdown: pl2303_shutdown, + .owner = THIS_MODULE, + .name = "PL-2303", + .id_table = id_table, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 1, + .open = pl2303_open, + .close = pl2303_close, + .write = pl2303_write, + .ioctl = pl2303_ioctl, + .break_ctl = pl2303_break_ctl, + .set_termios = pl2303_set_termios, + .read_bulk_callback = pl2303_read_bulk_callback, + .read_int_callback = pl2303_read_int_callback, + .write_bulk_callback = pl2303_write_bulk_callback, + .startup = pl2303_startup, + .shutdown = pl2303_shutdown, }; struct pl2303_private { @@ -178,11 +174,6 @@ dbg("%s - port %d, %d bytes", __FUNCTION__, port->number, count); - if (!port->tty) { - err("%s - no tty???", __FUNCTION__); - return 0; - } - if (port->write_urb->status == -EINPROGRESS) { dbg("%s - already writing", __FUNCTION__); return 0; @@ -228,7 +219,7 @@ return; } - if (!(((struct pl2303_private *)port->private)->termios_initialized)) { + if (!(((struct pl2303_private *) port->private)->termios_initialized)) { *(port->tty->termios) = tty_std_termios; port->tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; ((struct pl2303_private *) port->private)->termios_initialized = 1; @@ -378,62 +369,52 @@ dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); - - ++port->open_count; - MOD_INC_USE_COUNT; - - if (!port->active) { - port->active = 1; - -#define FISH(a,b,c,d) \ - result=usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev,0), \ - b, a, c, d, buf, 1, 100); \ - dbg("0x%x:0x%x:0x%x:0x%x %d - %x",a,b,c,d,result,buf[0]); - -#define SOUP(a,b,c,d) \ - result=usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev,0), \ - b, a, c, d, NULL, 0, 100); \ - dbg("0x%x:0x%x:0x%x:0x%x %d",a,b,c,d,result); - - FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0); - SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0x0404, 0); - FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0); - FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8383, 0); - FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0); - SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0x0404, 1); - FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0); - FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8383, 0); - SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0, 1); - SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 1, 0xc0); - SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 4); +#define FISH(a,b,c,d) \ + result=usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev,0), \ + b, a, c, d, buf, 1, 100); \ + dbg("0x%x:0x%x:0x%x:0x%x %d - %x",a,b,c,d,result,buf[0]); + +#define SOUP(a,b,c,d) \ + result=usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev,0), \ + b, a, c, d, NULL, 0, 100); \ + dbg("0x%x:0x%x:0x%x:0x%x %d",a,b,c,d,result); + + FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0); + SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0x0404, 0); + FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0); + FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8383, 0); + FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0); + SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0x0404, 1); + FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8484, 0); + FISH (VENDOR_READ_REQUEST_TYPE, VENDOR_READ_REQUEST, 0x8383, 0); + SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 0, 1); + SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 1, 0xc0); + SOUP (VENDOR_WRITE_REQUEST_TYPE, VENDOR_WRITE_REQUEST, 2, 4); - /* Setup termios */ + /* Setup termios */ + if (port->tty) { pl2303_set_termios (port, &tmp_termios); + } - //FIXME: need to assert RTS and DTR if CRTSCTS off - - dbg("%s - submitting read urb", __FUNCTION__); - port->read_urb->dev = serial->dev; - result = usb_submit_urb (port->read_urb); - if (result) { - err("%s - failed submitting read urb, error %d", __FUNCTION__, result); - up (&port->sem); - pl2303_close (port, NULL); - return -EPROTO; - } + //FIXME: need to assert RTS and DTR if CRTSCTS off - dbg("%s - submitting interrupt urb", __FUNCTION__); - port->interrupt_in_urb->dev = serial->dev; - result = usb_submit_urb (port->interrupt_in_urb); - if (result) { - err("%s - failed submitting interrupt urb, error %d", __FUNCTION__, result); - up (&port->sem); - pl2303_close (port, NULL); - return -EPROTO; - } + dbg("%s - submitting read urb", __FUNCTION__); + port->read_urb->dev = serial->dev; + result = usb_submit_urb (port->read_urb); + if (result) { + err("%s - failed submitting read urb, error %d", __FUNCTION__, result); + pl2303_close (port, NULL); + return -EPROTO; + } + + dbg("%s - submitting interrupt urb", __FUNCTION__); + port->interrupt_in_urb->dev = serial->dev; + result = usb_submit_urb (port->interrupt_in_urb); + if (result) { + err("%s - failed submitting interrupt urb, error %d", __FUNCTION__, result); + pl2303_close (port, NULL); + return -EPROTO; } - up (&port->sem); return 0; } @@ -453,11 +434,8 @@ dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); - - --port->open_count; - if (port->open_count <= 0) { - if (serial->dev) { + if (serial->dev) { + if (port->tty) { c_cflag = port->tty->termios->c_cflag; if (c_cflag & HUPCL) { /* drop DTR and RTS */ @@ -466,34 +444,28 @@ set_control_lines (port->serial->dev, priv->line_control); } + } - /* shutdown our urbs */ - dbg("%s - shutting down urbs", __FUNCTION__); - result = usb_unlink_urb (port->write_urb); - if (result) - dbg("%s - usb_unlink_urb (write_urb)" - " failed with reason: %d", __FUNCTION__, - result); - - result = usb_unlink_urb (port->read_urb); - if (result) - dbg("%s - usb_unlink_urb (read_urb) " - "failed with reason: %d", __FUNCTION__, - result); + /* shutdown our urbs */ + dbg("%s - shutting down urbs", __FUNCTION__); + result = usb_unlink_urb (port->write_urb); + if (result) + dbg("%s - usb_unlink_urb (write_urb)" + " failed with reason: %d", __FUNCTION__, + result); - result = usb_unlink_urb (port->interrupt_in_urb); - if (result) - dbg("%s - usb_unlink_urb (interrupt_in_urb)" - " failed with reason: %d", __FUNCTION__, - result); - } + result = usb_unlink_urb (port->read_urb); + if (result) + dbg("%s - usb_unlink_urb (read_urb) " + "failed with reason: %d", __FUNCTION__, + result); - port->active = 0; - port->open_count = 0; + result = usb_unlink_urb (port->interrupt_in_urb); + if (result) + dbg("%s - usb_unlink_urb (interrupt_in_urb)" + " failed with reason: %d", __FUNCTION__, + result); } - - up (&port->sem); - MOD_DEC_USE_COUNT; } static int set_modem_info (struct usb_serial_port *port, unsigned int cmd, unsigned int *value) @@ -600,12 +572,8 @@ dbg("%s", __FUNCTION__); - /* stop everything on all ports */ for (i = 0; i < serial->num_ports; ++i) - while (serial->port[i].open_count > 0) { - pl2303_close (&serial->port[i], NULL); - kfree (serial->port[i].private); - } + kfree (serial->port[i].private); } @@ -657,7 +625,7 @@ if (urb->status) { dbg("%s - urb->status = %d", __FUNCTION__, urb->status); - if (!port->active) { + if (!port->open_count) { dbg("%s - port is closed, exiting.", __FUNCTION__); return; } @@ -678,7 +646,7 @@ usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); tty = port->tty; - if (urb->actual_length) { + if (tty && urb->actual_length) { for (i = 0; i < urb->actual_length; ++i) { if (tty->flip.count >= TTY_FLIPBUF_SIZE) { tty_flip_buffer_push(tty); @@ -689,7 +657,7 @@ } /* Schedule the next read _if_ we are still open */ - if (port->active) { + if (port->open_count) { urb->dev = serial->dev; result = usb_submit_urb(urb); if (result) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/pl2303.h linux.20pre5-ac2/drivers/usb/serial/pl2303.h --- linux.20pre5/drivers/usb/serial/pl2303.h 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/pl2303.h 2002-09-01 13:40:31.000000000 +0100 @@ -22,3 +22,6 @@ #define ITEGNO_VENDOR_ID 0x0eba #define ITEGNO_PRODUCT_ID 0x1080 + +#define MA620_VENDOR_ID 0x0df7 +#define MA620_PRODUCT_ID 0x0620 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/usbserial.c linux.20pre5-ac2/drivers/usb/serial/usbserial.c --- linux.20pre5/drivers/usb/serial/usbserial.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/usbserial.c 2002-09-01 13:36:52.000000000 +0100 @@ -1,14 +1,13 @@ /* * USB Serial Converter driver * - * Copyright (C) 1999 - 2001 Greg Kroah-Hartman (greg@kroah.com) + * Copyright (C) 1999 - 2002 Greg Kroah-Hartman (greg@kroah.com) * Copyright (c) 2000 Peter Berger (pberger@brimson.com) * Copyright (c) 2000 Al Borchers (borchers@steinerpoint.com) * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version + * 2 as published by the Free Software Foundation. * * This driver was originally based on the ACM driver by Armin Fuerst (which was * based on a driver by Brad Keryan) @@ -337,24 +336,15 @@ /* All of the device info needed for the Generic Serial Converter */ static struct usb_serial_device_type generic_device = { - name: "Generic", - id_table: generic_device_ids, - needs_interrupt_in: DONT_CARE, /* don't have to have an interrupt in endpoint */ - needs_bulk_in: DONT_CARE, /* don't have to have a bulk in endpoint */ - needs_bulk_out: DONT_CARE, /* don't have to have a bulk out endpoint */ - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 1, - shutdown: generic_shutdown, + .owner = THIS_MODULE, + .name = "Generic", + .id_table = generic_device_ids, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = NUM_DONT_CARE, + .num_bulk_out = NUM_DONT_CARE, + .num_ports = 1, + .shutdown = generic_shutdown, }; - -#define if_generic_do(x) \ - if ((serial->vendor == vendor) && \ - (serial->product == product)) \ - x -#else -#define if_generic_do(x) #endif @@ -375,10 +365,10 @@ static void usb_serial_disconnect(struct usb_device *dev, void *ptr); static struct usb_driver usb_serial_driver = { - name: "serial", - probe: usb_serial_probe, - disconnect: usb_serial_disconnect, - id_table: NULL, /* check all devices */ + .name = "serial", + .probe = usb_serial_probe, + .disconnect = usb_serial_disconnect, + .id_table = NULL, /* check all devices */ }; /* There is no MODULE_DEVICE_TABLE for usbserial.c. Instead @@ -387,7 +377,7 @@ via modprobe, and modprobe will load usbserial because the serial drivers depend on it. */ - + static int serial_refcount; static struct tty_driver serial_tty_driver; @@ -400,7 +390,7 @@ static LIST_HEAD(usb_serial_driver_list); -static struct usb_serial *get_serial_by_minor (int minor) +static struct usb_serial *get_serial_by_minor (unsigned int minor) { return serial_table[minor]; } @@ -442,7 +432,6 @@ return NULL; } - static void return_serial (struct usb_serial *serial) { int i; @@ -459,7 +448,6 @@ return; } - #ifdef USES_EZUSB_FUNCTIONS /* EZ-USB Control and Status Register. Bit 0 controls 8051 reset */ #define CPUCS_REG 0x7F92 @@ -486,7 +474,6 @@ return result; } - int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit) { int response; @@ -500,7 +487,6 @@ #endif /* USES_EZUSB_FUNCTIONS */ - /***************************************************************************** * Driver tty interface functions *****************************************************************************/ @@ -508,7 +494,8 @@ { struct usb_serial *serial; struct usb_serial_port *port; - int portNumber; + unsigned int portNumber; + int retval = 0; dbg("%s", __FUNCTION__); @@ -518,257 +505,350 @@ /* get the serial object associated with this tty pointer */ serial = get_serial_by_minor (MINOR(tty->device)); - if (serial_paranoia_check (serial, __FUNCTION__)) { + if (serial_paranoia_check (serial, __FUNCTION__)) return -ENODEV; - } /* set up our port structure making the tty driver remember our port object, and us it */ portNumber = MINOR(tty->device) - serial->minor; port = &serial->port[portNumber]; tty->driver_data = port; + + down (&port->sem); port->tty = tty; - /* pass on to the driver specific version of this function if it is available */ - if (serial->type->open) { - return (serial->type->open(port, filp)); - } else { - return (generic_open(port, filp)); + /* lock this module before we call it */ + if (serial->type->owner) + __MOD_INC_USE_COUNT(serial->type->owner); + + ++port->open_count; + if (port->open_count == 1) { + /* only call the device specific open if this + * is the first time the port is opened */ + if (serial->type->open) + retval = serial->type->open(port, filp); + else + retval = generic_open(port, filp); + } + + if (retval) { + port->open_count = 0; + if (serial->type->owner) + __MOD_DEC_USE_COUNT(serial->type->owner); } + + up (&port->sem); + return retval; } +static void __serial_close(struct usb_serial_port *port, struct file *filp) +{ + if (!port->open_count) { + dbg ("%s - port not opened", __FUNCTION__); + return; + } + + --port->open_count; + if (port->open_count <= 0) { + /* only call the device specific close if this + * port is being closed by the last owner */ + if (port->serial->type->close) + port->serial->type->close(port, filp); + else + generic_close(port, filp); + port->open_count = 0; + } + + if (port->serial->type->owner) + __MOD_DEC_USE_COUNT(port->serial->type->owner); +} static void serial_close(struct tty_struct *tty, struct file * filp) { struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data; struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); - if (!serial) { + if (!serial) return; - } + + down (&port->sem); dbg("%s - port %d", __FUNCTION__, port->number); - - if (!port->active) { - dbg("%s - port not opened", __FUNCTION__); - return; - } - /* pass on to the driver specific version of this function if it is available */ - if (serial->type->close) { - serial->type->close(port, filp); - } else { - generic_close(port, filp); + /* if disconnect beat us to the punch here, there's nothing to do */ + if (tty->driver_data) { + __serial_close(port, filp); } -} + up (&port->sem); +} static int serial_write (struct tty_struct * tty, int from_user, const unsigned char *buf, int count) { struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data; struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); - - if (!serial) { + int retval = -EINVAL; + + if (!serial) return -ENODEV; - } - + + down (&port->sem); + dbg("%s - port %d, %d byte(s)", __FUNCTION__, port->number, count); - if (!port->active) { + if (!port->open_count) { dbg("%s - port not opened", __FUNCTION__); - return -EINVAL; + goto exit; } - + /* pass on to the driver specific version of this function if it is available */ - if (serial->type->write) { - return (serial->type->write(port, from_user, buf, count)); - } else { - return (generic_write(port, from_user, buf, count)); - } -} + if (serial->type->write) + retval = serial->type->write(port, from_user, buf, count); + else + retval = generic_write(port, from_user, buf, count); +exit: + up (&port->sem); + return retval; +} static int serial_write_room (struct tty_struct *tty) { struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data; struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); + int retval = -EINVAL; - if (!serial) { + if (!serial) return -ENODEV; - } + + down (&port->sem); dbg("%s - port %d", __FUNCTION__, port->number); - - if (!port->active) { + + if (!port->open_count) { dbg("%s - port not open", __FUNCTION__); - return -EINVAL; + goto exit; } /* pass on to the driver specific version of this function if it is available */ - if (serial->type->write_room) { - return (serial->type->write_room(port)); - } else { - return (generic_write_room(port)); - } -} + if (serial->type->write_room) + retval = serial->type->write_room(port); + else + retval = generic_write_room(port); +exit: + up (&port->sem); + return retval; +} static int serial_chars_in_buffer (struct tty_struct *tty) { struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data; struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); + int retval = -EINVAL; - if (!serial) { + if (!serial) return -ENODEV; - } - if (!port->active) { + down (&port->sem); + + dbg("%s = port %d", __FUNCTION__, port->number); + + if (!port->open_count) { dbg("%s - port not open", __FUNCTION__); - return -EINVAL; + goto exit; } /* pass on to the driver specific version of this function if it is available */ - if (serial->type->chars_in_buffer) { - return (serial->type->chars_in_buffer(port)); - } else { - return (generic_chars_in_buffer(port)); - } -} + if (serial->type->chars_in_buffer) + retval = serial->type->chars_in_buffer(port); + else + retval = generic_chars_in_buffer(port); +exit: + up (&port->sem); + return retval; +} static void serial_throttle (struct tty_struct * tty) { struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data; struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); - if (!serial) { + if (!serial) return; - } + + down (&port->sem); dbg("%s - port %d", __FUNCTION__, port->number); - if (!port->active) { - dbg("%s - port not open", __FUNCTION__); - return; + if (!port->open_count) { + dbg ("%s - port not open", __FUNCTION__); + goto exit; } /* pass on to the driver specific version of this function */ - if (serial->type->throttle) { + if (serial->type->throttle) serial->type->throttle(port); - } - return; +exit: + up (&port->sem); } - static void serial_unthrottle (struct tty_struct * tty) { struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data; struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); - if (!serial) { + if (!serial) return; - } + + down (&port->sem); dbg("%s - port %d", __FUNCTION__, port->number); - if (!port->active) { + if (!port->open_count) { dbg("%s - port not open", __FUNCTION__); - return; + goto exit; } /* pass on to the driver specific version of this function */ - if (serial->type->unthrottle) { + if (serial->type->unthrottle) serial->type->unthrottle(port); - } - return; +exit: + up (&port->sem); } - static int serial_ioctl (struct tty_struct *tty, struct file * file, unsigned int cmd, unsigned long arg) { struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data; struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); + int retval = -ENODEV; - if (!serial) { + if (!serial) return -ENODEV; - } + + down (&port->sem); dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd); - if (!port->active) { - dbg("%s - port not open", __FUNCTION__); - return -ENODEV; + if (!port->open_count) { + dbg ("%s - port not open", __FUNCTION__); + goto exit; } /* pass on to the driver specific version of this function if it is available */ - if (serial->type->ioctl) { - return (serial->type->ioctl(port, file, cmd, arg)); - } else { - return -ENOIOCTLCMD; - } -} + if (serial->type->ioctl) + retval = serial->type->ioctl(port, file, cmd, arg); + else + retval = -ENOIOCTLCMD; +exit: + up (&port->sem); + return retval; +} static void serial_set_termios (struct tty_struct *tty, struct termios * old) { struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data; struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); - if (!serial) { + if (!serial) return; - } + + down (&port->sem); dbg("%s - port %d", __FUNCTION__, port->number); - if (!port->active) { + if (!port->open_count) { dbg("%s - port not open", __FUNCTION__); - return; + goto exit; } /* pass on to the driver specific version of this function if it is available */ - if (serial->type->set_termios) { + if (serial->type->set_termios) serial->type->set_termios(port, old); - } - - return; -} +exit: + up (&port->sem); +} static void serial_break (struct tty_struct *tty, int break_state) { struct usb_serial_port *port = (struct usb_serial_port *) tty->driver_data; struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); - if (!serial) { + if (!serial) return; - } + + down (&port->sem); dbg("%s - port %d", __FUNCTION__, port->number); - if (!port->active) { + if (!port->open_count) { dbg("%s - port not open", __FUNCTION__); - return; + goto exit; } - /* pass on to the driver specific version of this function if it is - available */ - if (serial->type->break_ctl) { + /* pass on to the driver specific version of this function if it is available */ + if (serial->type->break_ctl) serial->type->break_ctl(port, break_state); - } -} +exit: + up (&port->sem); +} static void serial_shutdown (struct usb_serial *serial) { - if (serial->type->shutdown) { + dbg ("%s", __FUNCTION__); + + if (serial->type->shutdown) serial->type->shutdown(serial); - } else { + else generic_shutdown(serial); - } } +static int serial_read_proc (char *page, char **start, off_t off, int count, int *eof, void *data) +{ + struct usb_serial *serial; + int length = 0; + int i; + off_t begin = 0; +// char tmp[40]; + + dbg("%s", __FUNCTION__); + length += sprintf (page, "usbserinfo:1.0 driver:%s\n", DRIVER_VERSION); + for (i = 0; i < SERIAL_TTY_MINORS && length < PAGE_SIZE; ++i) { + serial = get_serial_by_minor(i); + if (serial == NULL) + continue; + + length += sprintf (page+length, "%d:", i); + if (serial->type->owner) + length += sprintf (page+length, " module:%s", serial->type->owner->name); + length += sprintf (page+length, " name:\"%s\"", serial->type->name); + length += sprintf (page+length, " vendor:%04x product:%04x", serial->vendor, serial->product); + length += sprintf (page+length, " num_ports:%d", serial->num_ports); + length += sprintf (page+length, " port:%d", i - serial->minor + 1); +// usb_make_path(serial->dev, tmp, sizeof(tmp)); +// length += sprintf (page+length, " path:%s", tmp); + + length += sprintf (page+length, "\n"); + if ((length + begin) > (off + count)) + goto done; + if ((length + begin) < off) { + begin += length; + length = 0; + } + } + *eof = 1; +done: + if (off >= (length + begin)) + return 0; + *start = page + (off-begin); + return ((count < begin+length-off) ? count : begin+length-off); +} /***************************************************************************** * generic devices specific driver functions @@ -781,74 +861,53 @@ if (port_paranoia_check (port, __FUNCTION__)) return -ENODEV; - /* only increment our usage count, if this device is _really_ a generic device */ - if_generic_do(MOD_INC_USE_COUNT); - dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); - - ++port->open_count; - - if (!port->active) { - port->active = 1; - - /* force low_latency on so that our tty_push actually forces the data through, - otherwise it is scheduled, and with high data rates (like with OHCI) data - can get lost. */ + /* force low_latency on so that our tty_push actually forces the data through, + otherwise it is scheduled, and with high data rates (like with OHCI) data + can get lost. */ + if (port->tty) port->tty->low_latency = 1; - - /* if we have a bulk interrupt, start reading from it */ - if (serial->num_bulk_in) { - /* Start reading from the device */ - FILL_BULK_URB(port->read_urb, serial->dev, - usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), - port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, - ((serial->type->read_bulk_callback) ? - serial->type->read_bulk_callback : - generic_read_bulk_callback), - port); - result = usb_submit_urb(port->read_urb); - if (result) - err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); - } + + /* if we have a bulk interrupt, start reading from it */ + if (serial->num_bulk_in) { + /* Start reading from the device */ + usb_fill_bulk_urb (port->read_urb, serial->dev, + usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), + port->read_urb->transfer_buffer, + port->read_urb->transfer_buffer_length, + ((serial->type->read_bulk_callback) ? + serial->type->read_bulk_callback : + generic_read_bulk_callback), + port); + result = usb_submit_urb(port->read_urb); + if (result) + err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); } - - up (&port->sem); - + return result; } - -static void generic_close (struct usb_serial_port *port, struct file * filp) +static void generic_cleanup (struct usb_serial_port *port) { struct usb_serial *serial = port->serial; dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); - - --port->open_count; - - if (port->open_count <= 0) { - if (serial->dev) { - /* shutdown any bulk reads that might be going on */ - if (serial->num_bulk_out) - usb_unlink_urb (port->write_urb); - if (serial->num_bulk_in) - usb_unlink_urb (port->read_urb); - } - - port->active = 0; - port->open_count = 0; + if (serial->dev) { + /* shutdown any bulk reads that might be going on */ + if (serial->num_bulk_out) + usb_unlink_urb (port->write_urb); + if (serial->num_bulk_in) + usb_unlink_urb (port->read_urb); } - - up (&port->sem); - - /* only decrement our usage count, if this device is _really_ a generic device */ - if_generic_do(MOD_DEC_USE_COUNT); } +static void generic_close (struct usb_serial_port *port, struct file * filp) +{ + dbg("%s - port %d", __FUNCTION__, port->number); + generic_cleanup (port); +} static int generic_write (struct usb_serial_port *port, int from_user, const unsigned char *buf, int count) { @@ -877,18 +936,18 @@ } else { memcpy (port->write_urb->transfer_buffer, buf, count); - } + } usb_serial_debug_data (__FILE__, __FUNCTION__, count, port->write_urb->transfer_buffer); /* set up our urb */ - FILL_BULK_URB(port->write_urb, serial->dev, - usb_sndbulkpipe(serial->dev, port->bulk_out_endpointAddress), - port->write_urb->transfer_buffer, count, - ((serial->type->write_bulk_callback) ? - serial->type->write_bulk_callback : - generic_write_bulk_callback), - port); + usb_fill_bulk_urb (port->write_urb, serial->dev, + usb_sndbulkpipe (serial->dev, + port->bulk_out_endpointAddress), + port->write_urb->transfer_buffer, count, + ((serial->type->write_bulk_callback) ? + serial->type->write_bulk_callback : + generic_write_bulk_callback), port); /* send the data out the bulk port */ result = usb_submit_urb(port->write_urb); @@ -899,11 +958,10 @@ return result; } - + /* no bulk out, so return 0 bytes written */ return (0); -} - +} static int generic_write_room (struct usb_serial_port *port) { @@ -916,19 +974,18 @@ if (port->write_urb->status != -EINPROGRESS) room = port->bulk_out_size; } - + dbg("%s - returns %d", __FUNCTION__, room); return (room); } - static int generic_chars_in_buffer (struct usb_serial_port *port) { struct usb_serial *serial = port->serial; int chars = 0; dbg("%s - port %d", __FUNCTION__, port->number); - + if (serial->num_bulk_out) { if (port->write_urb->status == -EINPROGRESS) chars = port->write_urb->transfer_buffer_length; @@ -938,7 +995,6 @@ return (chars); } - static void generic_read_bulk_callback (struct urb *urb) { struct usb_serial_port *port = (struct usb_serial_port *)urb->context; @@ -949,7 +1005,7 @@ int result; dbg("%s - port %d", __FUNCTION__, port->number); - + if (!serial) { dbg("%s - bad serial pointer, exiting", __FUNCTION__); return; @@ -963,7 +1019,7 @@ usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); tty = port->tty; - if (urb->actual_length) { + if (tty && urb->actual_length) { for (i = 0; i < urb->actual_length ; ++i) { /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */ if(tty->flip.count >= TTY_FLIPBUF_SIZE) { @@ -976,26 +1032,26 @@ } /* Continue trying to always read */ - FILL_BULK_URB(port->read_urb, serial->dev, - usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), - port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, - ((serial->type->read_bulk_callback) ? - serial->type->read_bulk_callback : - generic_read_bulk_callback), - port); + usb_fill_bulk_urb (port->read_urb, serial->dev, + usb_rcvbulkpipe (serial->dev, + port->bulk_in_endpointAddress), + port->read_urb->transfer_buffer, + port->read_urb->transfer_buffer_length, + ((serial->type->read_bulk_callback) ? + serial->type->read_bulk_callback : + generic_read_bulk_callback), port); result = usb_submit_urb(port->read_urb); if (result) err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); } - static void generic_write_bulk_callback (struct urb *urb) { struct usb_serial_port *port = (struct usb_serial_port *)urb->context; struct usb_serial *serial = get_usb_serial (port, __FUNCTION__); dbg("%s - port %d", __FUNCTION__, port->number); - + if (!serial) { dbg("%s - bad serial pointer, exiting", __FUNCTION__); return; @@ -1008,11 +1064,10 @@ queue_task(&port->tqueue, &tq_immediate); mark_bh(IMMEDIATE_BH); - + return; } - static void generic_shutdown (struct usb_serial *serial) { int i; @@ -1021,13 +1076,10 @@ /* stop reads and writes on all ports */ for (i=0; i < serial->num_ports; ++i) { - while (serial->port[i].open_count > 0) { - generic_close (&serial->port[i], NULL); - } + generic_cleanup (&serial->port[i]); } } - static void port_softint(void *private) { struct usb_serial_port *port = (struct usb_serial_port *)private; @@ -1036,11 +1088,13 @@ dbg("%s - port %d", __FUNCTION__, port->number); - if (!serial) { + if (!serial) return; - } - + tty = port->tty; + if (!tty) + return; + if ((tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) && tty->ldisc.write_wakeup) { dbg("%s - write wakeup call.", __FUNCTION__); (tty->ldisc.write_wakeup)(tty); @@ -1068,9 +1122,6 @@ int minor; int buffer_size; int i; - char interrupt_pipe; - char bulk_in_pipe; - char bulk_out_pipe; int num_interrupt_in = 0; int num_bulk_in = 0; int num_bulk_out = 0; @@ -1078,7 +1129,6 @@ int max_endpoints; const struct usb_device_id *id_pattern = NULL; - /* loop through our list of known serial converters, and see if this device matches. */ found = 0; @@ -1099,8 +1149,6 @@ } /* descriptor matches, let's find the endpoints needed */ - interrupt_pipe = bulk_in_pipe = bulk_out_pipe = HAS_NOT; - /* check out the endpoints */ iface_desc = &interface->altsetting[0]; for (i = 0; i < iface_desc->bNumEndpoints; ++i) { @@ -1110,7 +1158,6 @@ ((endpoint->bmAttributes & 3) == 0x02)) { /* we found a bulk in endpoint */ dbg("found bulk in"); - bulk_in_pipe = HAS; bulk_in_endpoint[num_bulk_in] = endpoint; ++num_bulk_in; } @@ -1119,7 +1166,6 @@ ((endpoint->bmAttributes & 3) == 0x02)) { /* we found a bulk out endpoint */ dbg("found bulk out"); - bulk_out_pipe = HAS; bulk_out_endpoint[num_bulk_out] = endpoint; ++num_bulk_out; } @@ -1128,12 +1174,11 @@ ((endpoint->bmAttributes & 3) == 0x03)) { /* we found a interrupt in endpoint */ dbg("found interrupt in"); - interrupt_pipe = HAS; interrupt_in_endpoint[num_interrupt_in] = endpoint; ++num_interrupt_in; } } - + #if defined(CONFIG_USB_SERIAL_PL2303) || defined(CONFIG_USB_SERIAL_PL2303_MODULE) /* BEGIN HORRIBLE HACK FOR PL2303 */ /* this is needed due to the looney way its endpoints are set up */ @@ -1151,7 +1196,6 @@ ((endpoint->bmAttributes & 3) == 0x03)) { /* we found a interrupt in endpoint */ dbg("found interrupt in for Prolific device on separate interface"); - interrupt_pipe = HAS; interrupt_in_endpoint[num_interrupt_in] = endpoint; ++num_interrupt_in; } @@ -1160,7 +1204,7 @@ } /* END HORRIBLE HACK FOR PL2303 */ #endif - + /* found all that we need */ info("%s converter detected", type->name); @@ -1180,7 +1224,7 @@ err("No more free serial devices"); return NULL; } - + serial->dev = dev; serial->type = type; serial->interface = interface; @@ -1208,13 +1252,14 @@ err("Couldn't allocate bulk_in_buffer"); goto probe_error; } - FILL_BULK_URB(port->read_urb, dev, - usb_rcvbulkpipe(dev, endpoint->bEndpointAddress), - port->bulk_in_buffer, buffer_size, - ((serial->type->read_bulk_callback) ? - serial->type->read_bulk_callback : - generic_read_bulk_callback), - port); + usb_fill_bulk_urb (port->read_urb, dev, + usb_rcvbulkpipe (dev, + endpoint->bEndpointAddress), + port->bulk_in_buffer, buffer_size, + ((serial->type->read_bulk_callback) ? + serial->type->read_bulk_callback : + generic_read_bulk_callback), + port); } for (i = 0; i < num_bulk_out; ++i) { @@ -1233,13 +1278,14 @@ err("Couldn't allocate bulk_out_buffer"); goto probe_error; } - FILL_BULK_URB(port->write_urb, dev, - usb_sndbulkpipe(dev, endpoint->bEndpointAddress), - port->bulk_out_buffer, buffer_size, - ((serial->type->write_bulk_callback) ? - serial->type->write_bulk_callback : - generic_write_bulk_callback), - port); + usb_fill_bulk_urb (port->write_urb, dev, + usb_sndbulkpipe (dev, + endpoint->bEndpointAddress), + port->bulk_out_buffer, buffer_size, + ((serial->type->write_bulk_callback) ? + serial->type->write_bulk_callback : + generic_write_bulk_callback), + port); } for (i = 0; i < num_interrupt_in; ++i) { @@ -1257,12 +1303,12 @@ err("Couldn't allocate interrupt_in_buffer"); goto probe_error; } - FILL_INT_URB(port->interrupt_in_urb, dev, - usb_rcvintpipe(dev, endpoint->bEndpointAddress), - port->interrupt_in_buffer, buffer_size, - serial->type->read_int_callback, - port, - endpoint->bInterval); + usb_fill_int_urb (port->interrupt_in_urb, dev, + usb_rcvintpipe (dev, + endpoint->bEndpointAddress), + port->interrupt_in_buffer, buffer_size, + serial->type->read_int_callback, port, + endpoint->bInterval); } /* initialize some parts of the port structures */ @@ -1296,7 +1342,7 @@ info("%s converter now attached to ttyUSB%d (or usb/tts/%d for devfs)", type->name, serial->port[i].number, serial->port[i].number); } - + return serial; /* success */ @@ -1322,7 +1368,7 @@ if (port->interrupt_in_buffer) kfree (port->interrupt_in_buffer); } - + /* return the minor range that this device had */ return_serial (serial); @@ -1331,25 +1377,32 @@ return NULL; } - static void usb_serial_disconnect(struct usb_device *dev, void *ptr) { struct usb_serial *serial = (struct usb_serial *) ptr; struct usb_serial_port *port; int i; + dbg ("%s", __FUNCTION__); if (serial) { /* fail all future close/read/write/ioctl/etc calls */ for (i = 0; i < serial->num_ports; ++i) { - if (serial->port[i].tty != NULL) - serial->port[i].tty->driver_data = NULL; + port = &serial->port[i]; + down (&port->sem); + if (port->tty != NULL) { + while (port->open_count > 0) { + __serial_close(port, NULL); + } + port->tty->driver_data = NULL; + } + up (&port->sem); } serial->dev = NULL; serial_shutdown (serial); for (i = 0; i < serial->num_ports; ++i) - serial->port[i].active = 0; + serial->port[i].open_count = 0; for (i = 0; i < serial->num_bulk_in; ++i) { port = &serial->port[i]; @@ -1393,40 +1446,41 @@ } else { info("device disconnected"); } - + } static struct tty_driver serial_tty_driver = { - magic: TTY_DRIVER_MAGIC, - driver_name: "usb-serial", + .magic = TTY_DRIVER_MAGIC, + .driver_name = "usb-serial", #ifndef CONFIG_DEVFS_FS - name: "ttyUSB", + .name = "ttyUSB", #else - name: "usb/tts/%d", + .name = "usb/tts/%d", #endif - major: SERIAL_TTY_MAJOR, - minor_start: 0, - num: SERIAL_TTY_MINORS, - type: TTY_DRIVER_TYPE_SERIAL, - subtype: SERIAL_TYPE_NORMAL, - flags: TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS, - - refcount: &serial_refcount, - table: serial_tty, - termios: serial_termios, - termios_locked: serial_termios_locked, - - open: serial_open, - close: serial_close, - write: serial_write, - write_room: serial_write_room, - ioctl: serial_ioctl, - set_termios: serial_set_termios, - throttle: serial_throttle, - unthrottle: serial_unthrottle, - break_ctl: serial_break, - chars_in_buffer: serial_chars_in_buffer, + .major = SERIAL_TTY_MAJOR, + .minor_start = 0, + .num = SERIAL_TTY_MINORS, + .type = TTY_DRIVER_TYPE_SERIAL, + .subtype = SERIAL_TYPE_NORMAL, + .flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS, + + .refcount = &serial_refcount, + .table = serial_tty, + .termios = serial_termios, + .termios_locked = serial_termios_locked, + + .open = serial_open, + .close = serial_close, + .write = serial_write, + .write_room = serial_write_room, + .ioctl = serial_ioctl, + .set_termios = serial_set_termios, + .throttle = serial_throttle, + .unthrottle = serial_unthrottle, + .break_ctl = serial_break, + .chars_in_buffer = serial_chars_in_buffer, + .read_proc = serial_read_proc, }; @@ -1521,7 +1575,7 @@ -/* If the usb-serial core is build into the core, the usb-serial drivers +/* If the usb-serial core is built into the core, the usb-serial drivers need these symbols to load properly as modules. */ EXPORT_SYMBOL(usb_serial_register); EXPORT_SYMBOL(usb_serial_deregister); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/usb-serial.h linux.20pre5-ac2/drivers/usb/serial/usb-serial.h --- linux.20pre5/drivers/usb/serial/usb-serial.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/usb-serial.h 2002-09-02 14:22:35.000000000 +0100 @@ -1,7 +1,7 @@ /* * USB Serial Converter driver * - * Copyright (C) 1999 - 2001 + * Copyright (C) 1999 - 2002 * Greg Kroah-Hartman (greg@kroah.com) * * This program is free software; you can redistribute it and/or modify @@ -11,6 +11,10 @@ * * See Documentation/usb/usb-serial.txt for more information on using this driver * + * (12/03/2001) gkh + * removed active from the port structure. + * added documentation to the usb_serial_device_type structure + * * (10/10/2001) gkh * added vendor and product to serial structure. Needed to determine device * owner when the device is disconnected. @@ -59,13 +63,41 @@ /* parity check flag */ #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) - +/** + * usb_serial_port: structure for the specific ports of a device. + * @magic: magic number for internal validity of this pointer. + * @serial: pointer back to the struct usb_serial owner of this port. + * @tty: pointer to the coresponding tty for this port. + * @number: the number of the port (the minor number). + * @interrupt_in_buffer: pointer to the interrupt in buffer for this port. + * @interrupt_in_urb: pointer to the interrupt in struct urb for this port. + * @interrupt_in_endpointAddress: endpoint address for the interrupt in pipe + * for this port. + * @bulk_in_buffer: pointer to the bulk in buffer for this port. + * @read_urb: pointer to the bulk in struct urb for this port. + * @bulk_in_endpointAddress: endpoint address for the bulk in pipe for this + * port. + * @bulk_out_buffer: pointer to the bulk out buffer for this port. + * @bulk_out_size: the size of the bulk_out_buffer, in bytes. + * @write_urb: pointer to the bulk out struct urb for this port. + * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this + * port. + * @write_wait: a wait_queue_head_t used by the port. + * @tqueue: task queue for the line discipline waking up. + * @open_count: number of times this port has been opened. + * @sem: struct semaphore used to lock this structure. + * @private: place to put any driver specific information that is needed. The + * usb-serial driver is required to manage this data, the usb-serial core + * will not touch this. + * + * This structure is used by the usb-serial core and drivers for the specific + * ports of a device. + */ struct usb_serial_port { int magic; - struct usb_serial *serial; /* pointer back to the owner of this port */ - struct tty_struct * tty; /* the coresponding tty for this port */ + struct usb_serial *serial; + struct tty_struct * tty; unsigned char number; - char active; /* someone has this device open */ unsigned char * interrupt_in_buffer; struct urb * interrupt_in_urb; @@ -81,63 +113,92 @@ __u8 bulk_out_endpointAddress; wait_queue_head_t write_wait; - - struct tq_struct tqueue; /* task queue for line discipline waking up */ - int open_count; /* number of times this port has been opened */ - struct semaphore sem; /* locks this structure */ - - void * private; /* data private to the specific port */ + struct tq_struct tqueue; + int open_count; + struct semaphore sem; + void * private; }; +/** + * usb_serial - structure used by the usb-serial core for a device + * @magic: magic number for internal validity of this pointer. + * @dev: pointer to the struct usb_device for this device + * @type: pointer to the struct usb_serial_device_type for this device + * @interface: pointer to the struct usb_interface for this device + * @minor: the starting minor number for this device + * @num_ports: the number of ports this device has + * @num_interrupt_in: number of interrupt in endpoints we have + * @num_bulk_in: number of bulk in endpoints we have + * @num_bulk_out: number of bulk out endpoints we have + * @vendor: vendor id of this device + * @product: product id of this device + * @port: array of struct usb_serial_port structures for the different ports. + * @private: place to put any driver specific information that is needed. The + * usb-serial driver is required to manage this data, the usb-serial core + * will not touch this. + */ struct usb_serial { int magic; struct usb_device * dev; - struct usb_serial_device_type * type; /* the type of usb serial device this is */ - struct usb_interface * interface; /* the interface for this device */ - struct tty_driver * tty_driver; /* the tty_driver for this device */ - unsigned char minor; /* the starting minor number for this device */ - unsigned char num_ports; /* the number of ports this device has */ - char num_interrupt_in; /* number of interrupt in endpoints we have */ - char num_bulk_in; /* number of bulk in endpoints we have */ - char num_bulk_out; /* number of bulk out endpoints we have */ - __u16 vendor; /* vendor id of this device */ - __u16 product; /* product id of this device */ + struct usb_serial_device_type * type; + struct usb_interface * interface; + unsigned char minor; + unsigned char num_ports; + char num_interrupt_in; + char num_bulk_in; + char num_bulk_out; + __u16 vendor; + __u16 product; struct usb_serial_port port[MAX_NUM_PORTS]; - - void * private; /* data private to the specific driver */ + void * private; }; -#define MUST_HAVE_NOT 0x01 -#define MUST_HAVE 0x02 -#define DONT_CARE 0x03 - -#define HAS 0x02 -#define HAS_NOT 0x01 - #define NUM_DONT_CARE (-1) -/* This structure defines the individual serial converter. */ +/** + * usb_serial_device_type - a structure that defines a usb serial device + * @owner: pointer to the module that owns this device. + * @name: pointer to a string that describes this device. This string used + * in the syslog messages when a device is inserted or removed. + * @id_table: pointer to a list of usb_device_id structures that define all + * of the devices this structure can support. + * @num_interrupt_in: the number of interrupt in endpoints this device will + * have. + * @num_bulk_in: the number of bulk in endpoints this device will have. + * @num_bulk_out: the number of bulk out endpoints this device will have. + * @num_ports: the number of different ports this device will have. + * @calc_num_ports: pointer to a function to determine how many ports this + * device has dynamically. It will be called after the probe() + * callback is called, but before attach() + * @startup: pointer to the driver's startup function. + * This will be called when the device is inserted into the system, + * but before the device has been fully initialized by the usb_serial + * subsystem. Use this function to download any firmware to the device, + * or any other early initialization that might be needed. + * Return 0 to continue on with the initialization sequence. Anything + * else will abort it. + * @shutdown: pointer to the driver's shutdown function. This will be + * called when the device is removed from the system. + * + * This structure is defines a USB Serial device. It provides all of + * the information that the USB serial core code needs. If the function + * pointers are defined, then the USB serial core code will call them when + * the corresponding tty port functions are called. If they are not + * called, the generic serial function will be used instead. + */ struct usb_serial_device_type { + struct module *owner; char *name; const struct usb_device_id *id_table; - char needs_interrupt_in; - char needs_bulk_in; - char needs_bulk_out; char num_interrupt_in; char num_bulk_in; char num_bulk_out; - char num_ports; /* number of serial ports this device has */ + char num_ports; struct list_head driver_list; - /* function call to make before accepting driver - * return 0 to continue initialization, - * < 0 aborts startup, - * > 0 does not set up anything else and is useful for devices that have - * downloaded firmware, and will reset themselves shortly. - */ int (*startup) (struct usb_serial *serial); void (*shutdown) (struct usb_serial *serial); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/visor.c linux.20pre5-ac2/drivers/usb/serial/visor.c --- linux.20pre5/drivers/usb/serial/visor.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/visor.c 2002-09-01 13:40:45.000000000 +0100 @@ -123,18 +123,15 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -149,7 +146,7 @@ /* * Version Information */ -#define DRIVER_VERSION "v1.5" +#define DRIVER_VERSION "v1.6" #define DRIVER_AUTHOR "Greg Kroah-Hartman " #define DRIVER_DESC "USB HandSpring Visor, Palm m50x, Sony Clié driver" @@ -170,18 +167,17 @@ static int clie_3_5_startup (struct usb_serial *serial); -static struct usb_device_id visor_id_table [] = { - { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_VISOR_ID) }, - { } /* Terminating entry */ -}; - -static struct usb_device_id palm_4_0_id_table [] = { +static struct usb_device_id id_table [] = { { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_M515_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_M125_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_M130_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_I705_ID) }, + { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_VISOR_ID) }, + { USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_4_0_ID) }, + { USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_S360_ID) }, + { USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_4_1_ID) }, { } /* Terminating entry */ }; @@ -190,13 +186,6 @@ { } /* Terminating entry */ }; -static struct usb_device_id clie_id_4_0_table [] = { - { USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_4_0_ID) }, - { USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_S360_ID) }, - { USB_DEVICE(SONY_VENDOR_ID, SONY_CLIE_4_1_ID) }, - { } /* Terminating entry */ -}; - static __devinitdata struct usb_device_id id_table_combined [] = { { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_VISOR_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID) }, @@ -216,109 +205,53 @@ -/* All of the device info needed for the Handspring Visor */ +/* All of the device info needed for the Handspring Visor, and Palm 4.0 devices */ static struct usb_serial_device_type handspring_device = { - name: "Handspring Visor", - id_table: visor_id_table, - needs_interrupt_in: MUST_HAVE_NOT, /* this device must not have an interrupt in endpoint */ - needs_bulk_in: MUST_HAVE, /* this device must have a bulk in endpoint */ - needs_bulk_out: MUST_HAVE, /* this device must have a bulk out endpoint */ - num_interrupt_in: 0, - num_bulk_in: 2, - num_bulk_out: 2, - num_ports: 2, - open: visor_open, - close: visor_close, - throttle: visor_throttle, - unthrottle: visor_unthrottle, - startup: visor_startup, - shutdown: visor_shutdown, - ioctl: visor_ioctl, - set_termios: visor_set_termios, - write: visor_write, - write_room: visor_write_room, - chars_in_buffer: visor_chars_in_buffer, - write_bulk_callback: visor_write_bulk_callback, - read_bulk_callback: visor_read_bulk_callback, + .owner = THIS_MODULE, + .name = "Handspring Visor / Palm 4.0 / Clié 4.x", + .id_table = id_table, + .num_interrupt_in = 0, + .num_bulk_in = 2, + .num_bulk_out = 2, + .num_ports = 2, + .open = visor_open, + .close = visor_close, + .throttle = visor_throttle, + .unthrottle = visor_unthrottle, + .startup = visor_startup, + .shutdown = visor_shutdown, + .ioctl = visor_ioctl, + .set_termios = visor_set_termios, + .write = visor_write, + .write_room = visor_write_room, + .chars_in_buffer = visor_chars_in_buffer, + .write_bulk_callback = visor_write_bulk_callback, + .read_bulk_callback = visor_read_bulk_callback, }; -/* device info for the Palm 4.0 devices */ -static struct usb_serial_device_type palm_4_0_device = { - name: "Palm 4.0", - id_table: palm_4_0_id_table, - needs_interrupt_in: MUST_HAVE_NOT, /* this device must not have an interrupt in endpoint */ - needs_bulk_in: MUST_HAVE, /* this device must have a bulk in endpoint */ - needs_bulk_out: MUST_HAVE, /* this device must have a bulk out endpoint */ - num_interrupt_in: 0, - num_bulk_in: 2, - num_bulk_out: 2, - num_ports: 2, - open: visor_open, - close: visor_close, - throttle: visor_throttle, - unthrottle: visor_unthrottle, - startup: visor_startup, - shutdown: visor_shutdown, - ioctl: visor_ioctl, - set_termios: visor_set_termios, - write: visor_write, - write_room: visor_write_room, - chars_in_buffer: visor_chars_in_buffer, - write_bulk_callback: visor_write_bulk_callback, - read_bulk_callback: visor_read_bulk_callback, -}; - - /* device info for the Sony Clie OS version 3.5 */ static struct usb_serial_device_type clie_3_5_device = { - name: "Sony Clié 3.5", - id_table: clie_id_3_5_table, - needs_interrupt_in: MUST_HAVE_NOT, /* this device must not have an interrupt in endpoint */ - needs_bulk_in: MUST_HAVE, /* this device must have a bulk in endpoint */ - needs_bulk_out: MUST_HAVE, /* this device must have a bulk out endpoint */ - num_interrupt_in: 0, - num_bulk_in: 1, - num_bulk_out: 1, - num_ports: 1, - open: visor_open, - close: visor_close, - throttle: visor_throttle, - unthrottle: visor_unthrottle, - startup: clie_3_5_startup, - ioctl: visor_ioctl, - set_termios: visor_set_termios, - write: visor_write, - write_room: visor_write_room, - chars_in_buffer: visor_chars_in_buffer, - write_bulk_callback: visor_write_bulk_callback, - read_bulk_callback: visor_read_bulk_callback, + .owner = THIS_MODULE, + .name = "Sony Clié 3.5", + .id_table = clie_id_3_5_table, + .num_interrupt_in = 0, + .num_bulk_in = 1, + .num_bulk_out = 1, + .num_ports = 1, + .open = visor_open, + .close = visor_close, + .throttle = visor_throttle, + .unthrottle = visor_unthrottle, + .startup = clie_3_5_startup, + .ioctl = visor_ioctl, + .set_termios = visor_set_termios, + .write = visor_write, + .write_room = visor_write_room, + .chars_in_buffer = visor_chars_in_buffer, + .write_bulk_callback = visor_write_bulk_callback, + .read_bulk_callback = visor_read_bulk_callback, }; -/* device info for the Sony Clie OS version 4.0 */ -static struct usb_serial_device_type clie_4_0_device = { - name: "Sony Clié 4.x", - id_table: clie_id_4_0_table, - needs_interrupt_in: MUST_HAVE_NOT, /* this device must not have an interrupt in endpoint */ - needs_bulk_in: MUST_HAVE, /* this device must have a bulk in endpoint */ - needs_bulk_out: MUST_HAVE, /* this device must have a bulk out endpoint */ - num_interrupt_in: 0, - num_bulk_in: 2, - num_bulk_out: 2, - num_ports: 2, - open: visor_open, - close: visor_close, - throttle: visor_throttle, - unthrottle: visor_unthrottle, - startup: visor_startup, - shutdown: visor_shutdown, - ioctl: visor_ioctl, - set_termios: visor_set_termios, - write: visor_write, - write_room: visor_write_room, - chars_in_buffer: visor_chars_in_buffer, - write_bulk_callback: visor_write_bulk_callback, - read_bulk_callback: visor_read_bulk_callback, -}; #define NUM_URBS 24 #define URB_TRANSFER_BUFFER_SIZE 768 @@ -342,36 +275,32 @@ dbg("%s - port %d", __FUNCTION__, port->number); if (!port->read_urb) { + /* this is needed for some brain dead Sony devices */ err ("Device lied about number of ports, please use a lower one."); return -ENODEV; } - down (&port->sem); - - ++port->open_count; - MOD_INC_USE_COUNT; - - if (!port->active) { - port->active = 1; - bytes_in = 0; - bytes_out = 0; - - /* force low_latency on so that our tty_push actually forces the data through, - otherwise it is scheduled, and with high data rates (like with OHCI) data - can get lost. */ + bytes_in = 0; + bytes_out = 0; + + /* + * Force low_latency on so that our tty_push actually forces the data + * through, otherwise it is scheduled, and with high data rates (like + * with OHCI) data can get lost. + */ + if (port->tty) port->tty->low_latency = 1; - - /* Start reading from the device */ - FILL_BULK_URB(port->read_urb, serial->dev, - usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), - port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, - visor_read_bulk_callback, port); - result = usb_submit_urb(port->read_urb); - if (result) - err("%s - failed submitting read urb, error %d", __FUNCTION__, result); - } - - up (&port->sem); + + /* Start reading from the device */ + usb_fill_bulk_urb (port->read_urb, serial->dev, + usb_rcvbulkpipe (serial->dev, + port->bulk_in_endpointAddress), + port->read_urb->transfer_buffer, + port->read_urb->transfer_buffer_length, + visor_read_bulk_callback, port); + result = usb_submit_urb(port->read_urb); + if (result) + err("%s - failed submitting read urb, error %d", __FUNCTION__, result); return result; } @@ -391,38 +320,26 @@ if (!serial) return; - down (&port->sem); - - --port->open_count; - - if (port->open_count <= 0) { - if (serial->dev) { - /* only send a shutdown message if the - * device is still here */ - transfer_buffer = kmalloc (0x12, GFP_KERNEL); - if (!transfer_buffer) { - err("%s - kmalloc(%d) failed.", __FUNCTION__, 0x12); - } else { - /* send a shutdown message to the device */ - usb_control_msg (serial->dev, - usb_rcvctrlpipe(serial->dev, 0), - VISOR_CLOSE_NOTIFICATION, 0xc2, - 0x0000, 0x0000, - transfer_buffer, 0x12, 300); - kfree (transfer_buffer); - } - /* shutdown our bulk read */ - usb_unlink_urb (port->read_urb); + if (serial->dev) { + /* only send a shutdown message if the + * device is still here */ + transfer_buffer = kmalloc (0x12, GFP_KERNEL); + if (!transfer_buffer) { + err("%s - kmalloc(%d) failed.", __FUNCTION__, 0x12); + } else { + /* send a shutdown message to the device */ + usb_control_msg (serial->dev, + usb_rcvctrlpipe(serial->dev, 0), + VISOR_CLOSE_NOTIFICATION, 0xc2, + 0x0000, 0x0000, + transfer_buffer, 0x12, 300); + kfree (transfer_buffer); } - port->active = 0; - port->open_count = 0; + /* shutdown our bulk read */ + usb_unlink_urb (port->read_urb); } - up (&port->sem); - /* Uncomment the following line if you want to see some statistics in your syslog */ /* info ("Bytes In = %d Bytes Out = %d", bytes_in, bytes_out); */ - - MOD_DEC_USE_COUNT; } @@ -560,7 +477,7 @@ queue_task(&port->tqueue, &tq_immediate); mark_bh(IMMEDIATE_BH); - + return; } @@ -592,7 +509,7 @@ usb_serial_debug_data (__FILE__, __FUNCTION__, urb->actual_length, data); tty = port->tty; - if (urb->actual_length) { + if (tty && urb->actual_length) { for (i = 0; i < urb->actual_length ; ++i) { /* if we insert more than TTY_FLIPBUF_SIZE characters, we drop them. */ if(tty->flip.count >= TTY_FLIPBUF_SIZE) { @@ -606,10 +523,12 @@ } /* Continue trying to always read */ - FILL_BULK_URB(port->read_urb, serial->dev, - usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), - port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, - visor_read_bulk_callback, port); + usb_fill_bulk_urb (port->read_urb, serial->dev, + usb_rcvbulkpipe (serial->dev, + port->bulk_in_endpointAddress), + port->read_urb->transfer_buffer, + port->read_urb->transfer_buffer_length, + visor_read_bulk_callback, port); result = usb_submit_urb(port->read_urb); if (result) err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); @@ -619,16 +538,8 @@ static void visor_throttle (struct usb_serial_port *port) { - dbg("%s - port %d", __FUNCTION__, port->number); - - down (&port->sem); - usb_unlink_urb (port->read_urb); - - up (&port->sem); - - return; } @@ -638,20 +549,13 @@ dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); - port->read_urb->dev = port->serial->dev; result = usb_submit_urb(port->read_urb); if (result) err("%s - failed submitting read urb, error %d", __FUNCTION__, result); - - up (&port->sem); - - return; } - -static int visor_startup (struct usb_serial *serial) +static int visor_startup (struct usb_serial *serial) { int response; int i; @@ -699,7 +603,8 @@ string = "unknown"; break; } - info("%s: port %d, is for %s use and is bound to ttyUSB%d", serial->type->name, connection_info->connections[i].port, string, serial->minor + i); + info("%s: port %d, is for %s use and is bound to ttyUSB%d", serial->type->name, + connection_info->connections[i].port, string, serial->minor + i); } } @@ -783,18 +688,9 @@ static void visor_shutdown (struct usb_serial *serial) { - int i; - dbg("%s", __FUNCTION__); - - /* stop reads and writes on all ports */ - for (i=0; i < serial->num_ports; ++i) { - serial->port[i].active = 0; - serial->port[i].open_count = 0; - } } - static int visor_ioctl (struct usb_serial_port *port, struct file * file, unsigned int cmd, unsigned long arg) { dbg("%s - port %d, cmd 0x%.4x", __FUNCTION__, port->number, cmd); @@ -858,7 +754,8 @@ /* determine software flow control */ if (I_IXOFF(port->tty)) - dbg("%s - XON/XOFF is enabled, XON = %2x, XOFF = %2x", __FUNCTION__, START_CHAR(port->tty), STOP_CHAR(port->tty)); + dbg("%s - XON/XOFF is enabled, XON = %2x, XOFF = %2x", + __FUNCTION__, START_CHAR(port->tty), STOP_CHAR(port->tty)); else dbg("%s - XON/XOFF is disabled", __FUNCTION__); @@ -875,9 +772,7 @@ int i; usb_serial_register (&handspring_device); - usb_serial_register (&palm_4_0_device); usb_serial_register (&clie_3_5_device); - usb_serial_register (&clie_4_0_device); /* create our write urb pool and transfer buffers */ spin_lock_init (&write_urb_pool_lock); @@ -909,9 +804,7 @@ unsigned long flags; usb_serial_deregister (&handspring_device); - usb_serial_deregister (&palm_4_0_device); usb_serial_deregister (&clie_3_5_device); - usb_serial_deregister (&clie_4_0_device); spin_lock_irqsave (&write_urb_pool_lock, flags); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/serial/whiteheat.c linux.20pre5-ac2/drivers/usb/serial/whiteheat.c --- linux.20pre5/drivers/usb/serial/whiteheat.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/serial/whiteheat.c 2002-09-01 13:40:56.000000000 +0100 @@ -61,18 +61,15 @@ #include #include -#include -#include #include -#include #include #include -#include #include #include #include #include #include +#include #include #ifdef CONFIG_USB_SERIAL_DEBUG @@ -133,36 +130,32 @@ static void whiteheat_real_shutdown (struct usb_serial *serial); static struct usb_serial_device_type whiteheat_fake_device = { - name: "Connect Tech - WhiteHEAT - (prerenumeration)", - id_table: id_table_prerenumeration, - needs_interrupt_in: DONT_CARE, /* don't have to have an interrupt in endpoint */ - needs_bulk_in: DONT_CARE, /* don't have to have a bulk in endpoint */ - needs_bulk_out: DONT_CARE, /* don't have to have a bulk out endpoint */ - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 1, - startup: whiteheat_fake_startup, + .owner = THIS_MODULE, + .name = "Connect Tech - WhiteHEAT - (prerenumeration)", + .id_table = id_table_prerenumeration, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = NUM_DONT_CARE, + .num_bulk_out = NUM_DONT_CARE, + .num_ports = 1, + .startup = whiteheat_fake_startup, }; static struct usb_serial_device_type whiteheat_device = { - name: "Connect Tech - WhiteHEAT", - id_table: id_table_std, - needs_interrupt_in: DONT_CARE, /* don't have to have an interrupt in endpoint */ - needs_bulk_in: DONT_CARE, /* don't have to have a bulk in endpoint */ - needs_bulk_out: DONT_CARE, /* don't have to have a bulk out endpoint */ - num_interrupt_in: NUM_DONT_CARE, - num_bulk_in: NUM_DONT_CARE, - num_bulk_out: NUM_DONT_CARE, - num_ports: 4, - open: whiteheat_open, - close: whiteheat_close, - throttle: whiteheat_throttle, - unthrottle: whiteheat_unthrottle, - ioctl: whiteheat_ioctl, - set_termios: whiteheat_set_termios, - startup: whiteheat_real_startup, - shutdown: whiteheat_real_shutdown, + .owner = THIS_MODULE, + .name = "Connect Tech - WhiteHEAT", + .id_table = id_table_std, + .num_interrupt_in = NUM_DONT_CARE, + .num_bulk_in = NUM_DONT_CARE, + .num_bulk_out = NUM_DONT_CARE, + .num_ports = 4, + .open = whiteheat_open, + .close = whiteheat_close, + .throttle = whiteheat_throttle, + .unthrottle = whiteheat_unthrottle, + .ioctl = whiteheat_ioctl, + .set_termios = whiteheat_set_termios, + .startup = whiteheat_real_startup, + .shutdown = whiteheat_real_shutdown, }; struct whiteheat_private { @@ -310,68 +303,49 @@ dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); - - ++port->open_count; - MOD_INC_USE_COUNT; - - if (!port->active) { - port->active = 1; - - /* set up some stuff for our command port */ - command_port = &port->serial->port[COMMAND_PORT]; - if (command_port->private == NULL) { - info = (struct whiteheat_private *)kmalloc (sizeof(struct whiteheat_private), GFP_KERNEL); - if (info == NULL) { - err("%s - out of memory", __FUNCTION__); - retval = -ENOMEM; - goto error_exit; - } - - init_waitqueue_head(&info->wait_command); - command_port->private = info; - command_port->write_urb->complete = command_port_write_callback; - command_port->read_urb->complete = command_port_read_callback; - command_port->read_urb->dev = port->serial->dev; - command_port->tty = port->tty; /* need this to "fake" our our sanity check macros */ - retval = usb_submit_urb (command_port->read_urb); - if (retval) { - err("%s - failed submitting read urb, error %d", __FUNCTION__, retval); - goto error_exit; - } + /* set up some stuff for our command port */ + command_port = &port->serial->port[COMMAND_PORT]; + if (command_port->private == NULL) { + info = (struct whiteheat_private *)kmalloc (sizeof(struct whiteheat_private), GFP_KERNEL); + if (info == NULL) { + err("%s - out of memory", __FUNCTION__); + retval = -ENOMEM; + goto exit; } - /* Start reading from the device */ - port->read_urb->dev = port->serial->dev; - retval = usb_submit_urb(port->read_urb); + init_waitqueue_head(&info->wait_command); + command_port->private = info; + command_port->write_urb->complete = command_port_write_callback; + command_port->read_urb->complete = command_port_read_callback; + command_port->read_urb->dev = port->serial->dev; + command_port->tty = port->tty; /* need this to "fake" our our sanity check macros */ + retval = usb_submit_urb (command_port->read_urb); if (retval) { err("%s - failed submitting read urb, error %d", __FUNCTION__, retval); - goto error_exit; + goto exit; } + } - /* send an open port command */ - /* firmware uses 1 based port numbering */ - open_command.port = port->number - port->serial->minor + 1; - retval = whiteheat_send_cmd (port->serial, WHITEHEAT_OPEN, (__u8 *)&open_command, sizeof(open_command)); - if (retval) - goto error_exit; - - /* Need to do device specific setup here (control lines, baud rate, etc.) */ - /* FIXME!!! */ + /* Start reading from the device */ + port->read_urb->dev = port->serial->dev; + retval = usb_submit_urb(port->read_urb); + if (retval) { + err("%s - failed submitting read urb, error %d", __FUNCTION__, retval); + goto exit; } - dbg("%s - exit", __FUNCTION__); - up (&port->sem); - - return retval; + /* send an open port command */ + /* firmware uses 1 based port numbering */ + open_command.port = port->number - port->serial->minor + 1; + retval = whiteheat_send_cmd (port->serial, WHITEHEAT_OPEN, (__u8 *)&open_command, sizeof(open_command)); + if (retval) + goto exit; -error_exit: - --port->open_count; - MOD_DEC_USE_COUNT; + /* Need to do device specific setup here (control lines, baud rate, etc.) */ + /* FIXME!!! */ - dbg("%s - error_exit", __FUNCTION__); - up (&port->sem); - +exit: + dbg("%s - exit, retval = %d", __FUNCTION__, retval); return retval; } @@ -382,25 +356,17 @@ dbg("%s - port %d", __FUNCTION__, port->number); - down (&port->sem); - --port->open_count; + /* send a close command to the port */ + /* firmware uses 1 based port numbering */ + close_command.port = port->number - port->serial->minor + 1; + whiteheat_send_cmd (port->serial, WHITEHEAT_CLOSE, (__u8 *)&close_command, sizeof(close_command)); - if (port->open_count <= 0) { - /* send a close command to the port */ - /* firmware uses 1 based port numbering */ - close_command.port = port->number - port->serial->minor + 1; - whiteheat_send_cmd (port->serial, WHITEHEAT_CLOSE, (__u8 *)&close_command, sizeof(close_command)); + /* Need to change the control lines here */ + /* FIXME */ - /* Need to change the control lines here */ - /* FIXME */ - - /* shutdown our bulk reads and writes */ - usb_unlink_urb (port->write_urb); - usb_unlink_urb (port->read_urb); - port->active = 0; - } - MOD_DEC_USE_COUNT; - up (&port->sem); + /* shutdown our bulk reads and writes */ + usb_unlink_urb (port->write_urb); + usb_unlink_urb (port->read_urb); } @@ -419,8 +385,6 @@ dbg("%s -port %d", __FUNCTION__, port->number); - down (&port->sem); - if ((!port->tty) || (!port->tty->termios)) { dbg("%s - no tty structures", __FUNCTION__); goto exit; @@ -501,7 +465,6 @@ whiteheat_send_cmd (port->serial, WHITEHEAT_SETUP_PORT, (__u8 *)&port_settings, sizeof(port_settings)); exit: - up (&port->sem); return; } @@ -541,7 +504,7 @@ - device renumerated itself and comes up as new device id with all firmware download completed. */ -static int whiteheat_fake_startup (struct usb_serial *serial) +static int whiteheat_fake_startup (struct usb_serial *serial) { int response; const struct whiteheat_hex_record *record; @@ -555,8 +518,8 @@ response = ezusb_writememory (serial, record->address, (unsigned char *)record->data, record->data_size, 0xa0); if (response < 0) { - err("%s - ezusb_writememory failed for loader (%d %04X %p %d)", __FUNCTION__, - response, record->address, record->data, record->data_size); + err("%s - ezusb_writememory failed for loader (%d %04X %p %d)", + __FUNCTION__, response, record->address, record->data, record->data_size); break; } ++record; @@ -572,8 +535,8 @@ response = ezusb_writememory (serial, record->address, (unsigned char *)record->data, record->data_size, 0xa3); if (response < 0) { - err("%s - ezusb_writememory failed for first firmware step (%d %04X %p %d)", __FUNCTION__, - response, record->address, record->data, record->data_size); + err("%s - ezusb_writememory failed for first firmware step (%d %04X %p %d)", + __FUNCTION__, response, record->address, record->data, record->data_size); break; } ++record; @@ -586,8 +549,8 @@ response = ezusb_writememory (serial, record->address, (unsigned char *)record->data, record->data_size, 0xa0); if (response < 0) { - err("%s - ezusb_writememory failed for second firmware step (%d %04X %p %d)", __FUNCTION__, - response, record->address, record->data, record->data_size); + err("%s - ezusb_writememory failed for second firmware step (%d %04X %p %d)", + __FUNCTION__, response, record->address, record->data, record->data_size); break; } ++record; @@ -662,17 +625,9 @@ static void whiteheat_real_shutdown (struct usb_serial *serial) { struct usb_serial_port *command_port; - int i; dbg("%s", __FUNCTION__); - /* stop reads and writes on all ports */ - for (i=0; i < serial->num_ports; ++i) { - while (serial->port[i].open_count > 0) { - whiteheat_close (&serial->port[i], NULL); - } - } - /* free up our private data for our command port */ command_port = &serial->port[COMMAND_PORT]; if (command_port->private != NULL) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/storage/freecom.c linux.20pre5-ac2/drivers/usb/storage/freecom.c --- linux.20pre5/drivers/usb/storage/freecom.c 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/storage/freecom.c 2002-09-01 17:53:34.000000000 +0100 @@ -34,7 +34,7 @@ #include "usb.h" #include "debug.h" #include "freecom.h" -#include "linux/hdreg.h" +#include #ifdef CONFIG_USB_STORAGE_DEBUG static void pdump (void *, int); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/storage/isd200.c linux.20pre5-ac2/drivers/usb/storage/isd200.c --- linux.20pre5/drivers/usb/storage/isd200.c 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/storage/isd200.c 2002-08-19 23:43:56.000000000 +0100 @@ -102,13 +102,6 @@ #define REG_STATUS 0x80 #define REG_COMMAND 0x80 -/* ATA error definitions not in */ -#define ATA_ERROR_MEDIA_CHANGE 0x20 - -/* ATA command definitions not in */ -#define ATA_COMMAND_GET_MEDIA_STATUS 0xDA -#define ATA_COMMAND_MEDIA_EJECT 0xED - /* ATA drive control definitions */ #define ATA_DC_DISABLE_INTERRUPTS 0x02 #define ATA_DC_RESET_CONTROLLER 0x04 @@ -353,7 +346,7 @@ struct sense_data *buf = (struct sense_data *) &srb->sense_buffer[0]; unsigned char error = info->ATARegs[IDE_ERROR_OFFSET]; - if(error & ATA_ERROR_MEDIA_CHANGE) { + if(error & MC_ERR) { buf->ErrorCode = 0x70 | SENSE_ERRCODE_VALID; buf->AdditionalSenseLength = 0xb; buf->Flags = UNIT_ATTENTION; @@ -1472,7 +1465,7 @@ ataCdb->generic.SignatureByte1 = info->ConfigData.ATAMinorCommand; ataCdb->generic.TransferBlockSize = 1; ataCdb->generic.RegisterSelect = REG_COMMAND; - ataCdb->write.CommandByte = ATA_COMMAND_GET_MEDIA_STATUS; + ataCdb->write.CommandByte = WIN_GETMEDIASTATUS; srb->request_bufflen = 0; } else { US_DEBUGP(" Media Status not supported, just report okay\n"); @@ -1493,7 +1486,7 @@ ataCdb->generic.SignatureByte1 = info->ConfigData.ATAMinorCommand; ataCdb->generic.TransferBlockSize = 1; ataCdb->generic.RegisterSelect = REG_COMMAND; - ataCdb->write.CommandByte = ATA_COMMAND_GET_MEDIA_STATUS; + ataCdb->write.CommandByte = WIN_GETMEDIASTATUS; srb->request_bufflen = 0; } else { US_DEBUGP(" Media Status not supported, just report okay\n"); @@ -1625,14 +1618,14 @@ ataCdb->generic.SignatureByte1 = info->ConfigData.ATAMinorCommand; ataCdb->generic.TransferBlockSize = 0; ataCdb->generic.RegisterSelect = REG_COMMAND; - ataCdb->write.CommandByte = ATA_COMMAND_MEDIA_EJECT; + ataCdb->write.CommandByte = WIN_MEDIAEJECT; } else if ((srb->cmnd[4] & 0x3) == 0x1) { US_DEBUGP(" Get Media Status\n"); ataCdb->generic.SignatureByte0 = info->ConfigData.ATAMajorCommand; ataCdb->generic.SignatureByte1 = info->ConfigData.ATAMinorCommand; ataCdb->generic.TransferBlockSize = 1; ataCdb->generic.RegisterSelect = REG_COMMAND; - ataCdb->write.CommandByte = ATA_COMMAND_GET_MEDIA_STATUS; + ataCdb->write.CommandByte = WIN_GETMEDIASTATUS; srb->request_bufflen = 0; } else { US_DEBUGP(" Nothing to do, just report okay\n"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/storage/scsiglue.c linux.20pre5-ac2/drivers/usb/storage/scsiglue.c --- linux.20pre5/drivers/usb/storage/scsiglue.c 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/storage/scsiglue.c 2002-09-01 13:44:03.000000000 +0100 @@ -190,7 +190,7 @@ } /* if we have an urb pending, let's wake the control thread up */ - if (us->current_urb->status == -EINPROGRESS) { + if (!us->current_done.done) { /* cancel the URB -- this will automatically wake the thread */ usb_unlink_urb(us->current_urb); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/storage/transport.c linux.20pre5-ac2/drivers/usb/storage/transport.c --- linux.20pre5/drivers/usb/storage/transport.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/storage/transport.c 2002-09-01 13:44:03.000000000 +0100 @@ -360,7 +360,6 @@ u8 request, u8 requesttype, u16 value, u16 index, void *data, u16 size) { - struct completion urb_done; int status; struct usb_ctrlrequest *dr; @@ -377,7 +376,7 @@ dr->wLength = cpu_to_le16(size); /* set up data structures for the wakeup system */ - init_completion(&urb_done); + init_completion(&us->current_done); /* lock the URB */ down(&(us->current_urb_sem)); @@ -385,7 +384,7 @@ /* fill the URB */ FILL_CONTROL_URB(us->current_urb, us->pusb_dev, pipe, (unsigned char*) dr, data, size, - usb_stor_blocking_completion, &urb_done); + usb_stor_blocking_completion, &us->current_done); us->current_urb->actual_length = 0; us->current_urb->error_count = 0; us->current_urb->transfer_flags = USB_ASYNC_UNLINK; @@ -401,7 +400,7 @@ /* wait for the completion of the URB */ up(&(us->current_urb_sem)); - wait_for_completion(&urb_done); + wait_for_completion(&us->current_done); down(&(us->current_urb_sem)); /* return the actual length of the data transferred if no error*/ @@ -421,18 +420,17 @@ int usb_stor_bulk_msg(struct us_data *us, void *data, int pipe, unsigned int len, unsigned int *act_len) { - struct completion urb_done; int status; /* set up data structures for the wakeup system */ - init_completion(&urb_done); + init_completion(&us->current_done); /* lock the URB */ down(&(us->current_urb_sem)); /* fill the URB */ FILL_BULK_URB(us->current_urb, us->pusb_dev, pipe, data, len, - usb_stor_blocking_completion, &urb_done); + usb_stor_blocking_completion, &us->current_done); us->current_urb->actual_length = 0; us->current_urb->error_count = 0; us->current_urb->transfer_flags = USB_ASYNC_UNLINK; @@ -447,7 +445,7 @@ /* wait for the completion of the URB */ up(&(us->current_urb_sem)); - wait_for_completion(&urb_done); + wait_for_completion(&us->current_done); down(&(us->current_urb_sem)); /* return the actual length of the data transferred */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/storage/unusual_devs.h linux.20pre5-ac2/drivers/usb/storage/unusual_devs.h --- linux.20pre5/drivers/usb/storage/unusual_devs.h 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/storage/unusual_devs.h 2002-09-02 14:22:35.000000000 +0100 @@ -97,6 +97,15 @@ "DVD-CAM DZ-MV100A Camcorder", US_SC_SCSI, US_PR_CB, NULL, US_FL_SINGLE_LUN), +/* Reported by Jan Willamowius + * The device needs the flags only. + */ +UNUSUAL_DEV( 0x04c8, 0x0723, 0x0000, 0x9999, + "Konica", + "KD-200Z", + US_SC_SCSI, US_PR_BULK, NULL, + US_FL_START_STOP), + UNUSUAL_DEV( 0x04cb, 0x0100, 0x0000, 0x2210, "Fujifilm", "FinePix 1400Zoom", @@ -353,6 +362,12 @@ US_SC_SCSI, US_PR_BULK, NULL, US_FL_START_STOP ), +UNUSUAL_DEV( 0x0686, 0x400b, 0x0001, 0x0001, + "Minolta", + "Dimage 7i", + US_SC_SCSI, US_PR_BULK, NULL, + US_FL_START_STOP ), + UNUSUAL_DEV( 0x0693, 0x0002, 0x0100, 0x0100, "Hagiwara", "FlashGate SmartMedia", @@ -491,6 +506,12 @@ US_SC_SCSI, US_PR_CB, NULL, US_FL_MODE_XLATE ), +UNUSUAL_DEV( 0x0a16, 0x8888, 0x0100, 0x0100, + "IBM", + "IBM USB Memory Key", + US_SC_SCSI, US_PR_BULK, NULL, + US_FL_FIX_INQUIRY ), + #ifdef CONFIG_USB_STORAGE_ISD200 UNUSUAL_DEV( 0x0bf6, 0xa001, 0x0100, 0x0110, "ATI", diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/storage/usb.h linux.20pre5-ac2/drivers/usb/storage/usb.h --- linux.20pre5/drivers/usb/storage/usb.h 2002-08-29 18:39:45.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/storage/usb.h 2002-09-02 14:57:05.000000000 +0100 @@ -166,6 +166,7 @@ /* control and bulk communications data */ struct semaphore current_urb_sem; /* to protect irq_urb */ struct urb *current_urb; /* non-int USB requests */ + struct completion current_done; /* the done flag */ /* the semaphore for sleeping the control thread */ struct semaphore sema; /* to sleep thread on */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/usblcd.c linux.20pre5-ac2/drivers/usb/usblcd.c --- linux.20pre5/drivers/usb/usblcd.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/usblcd.c 2002-09-01 13:31:59.000000000 +0100 @@ -0,0 +1,346 @@ +/***************************************************************************** + * USBLCD Kernel Driver * + * See http://www.usblcd.de for Hardware and Documentation. * + * Version 1.01 * + * (C) 2002 Adams IT Services * + * * + * This file is licensed under the GPL. See COPYING in the package. * + * Based on rio500.c by Cesar Miquel (miquel@df.uba.ar) which is based on * + * hp_scanner.c by David E. Nelson (dnelson@jump.net) * + * * + * 23.7.02 RA changed minor device number to the official assigned one * + *****************************************************************************/ +#include +#include +#include +#include +#include +#include +#include + +#define DRIVER_VERSION "USBLCD Driver Version 1.01" + +#define USBLCD_MINOR 128 + +#define IOCTL_GET_HARD_VERSION 1 +#define IOCTL_GET_DRV_VERSION 2 + +/* stall/wait timeout for USBLCD */ +#define NAK_TIMEOUT (HZ) + +#define IBUF_SIZE 0x1000 +#define OBUF_SIZE 0x10000 + +struct lcd_usb_data { + struct usb_device *lcd_dev; /* init: probe_lcd */ + unsigned int ifnum; /* Interface number of the USB device */ + int isopen; /* nz if open */ + int present; /* Device is present on the bus */ + char *obuf, *ibuf; /* transfer buffers */ + char bulk_in_ep, bulk_out_ep; /* Endpoint assignments */ + wait_queue_head_t wait_q; /* for timeouts */ +}; + +static struct lcd_usb_data lcd_instance; + +static int open_lcd(struct inode *inode, struct file *file) +{ + struct lcd_usb_data *lcd = &lcd_instance; + + if (lcd->isopen || !lcd->present) { + return -EBUSY; + } + lcd->isopen = 1; + + init_waitqueue_head(&lcd->wait_q); + + info("USBLCD opened."); + + return 0; +} + +static int close_lcd(struct inode *inode, struct file *file) +{ + struct lcd_usb_data *lcd = &lcd_instance; + + lcd->isopen = 0; + + info("USBLCD closed."); + return 0; +} + +static int +ioctl_lcd(struct inode *inode, struct file *file, unsigned int cmd, + unsigned long arg) +{ + struct lcd_usb_data *lcd = &lcd_instance; + int i; + char buf[30]; + + /* Sanity check to make sure lcd is connected, powered, etc */ + if (lcd == NULL || + lcd->present == 0 || + lcd->lcd_dev == NULL) + return -1; + + switch (cmd) { + case IOCTL_GET_HARD_VERSION: + i = (lcd->lcd_dev)->descriptor.bcdDevice; + sprintf(buf,"%1d%1d.%1d%1d",(i & 0xF000)>>12,(i & 0xF00)>>8, + (i & 0xF0)>>4,(i & 0xF)); + if (copy_to_user((void *)arg,buf,strlen(buf))!=0) + return -EFAULT; + break; + case IOCTL_GET_DRV_VERSION: + sprintf(buf,DRIVER_VERSION); + if (copy_to_user((void *)arg,buf,strlen(buf))!=0) + return -EFAULT; + break; + default: + return -ENOIOCTLCMD; + break; + } + + return 0; +} + +static ssize_t +write_lcd(struct file *file, const char *buffer, + size_t count, loff_t * ppos) +{ + struct lcd_usb_data *lcd = &lcd_instance; + + unsigned long copy_size; + unsigned long bytes_written = 0; + unsigned int partial; + + int result = 0; + int maxretry; + + /* Sanity check to make sure lcd is connected, powered, etc */ + if (lcd == NULL || + lcd->present == 0 || + lcd->lcd_dev == NULL) + return -1; + + do { + unsigned long thistime; + char *obuf = lcd->obuf; + + thistime = copy_size = + (count >= OBUF_SIZE) ? OBUF_SIZE : count; + if (copy_from_user(lcd->obuf, buffer, copy_size)) + return -EFAULT; + maxretry = 5; + while (thistime) { + if (!lcd->lcd_dev) + return -ENODEV; + if (signal_pending(current)) { + return bytes_written ? bytes_written : -EINTR; + } + + result = usb_bulk_msg(lcd->lcd_dev, + usb_sndbulkpipe(lcd->lcd_dev, 1), + obuf, thistime, &partial, 10 * HZ); + + dbg("write stats: result:%d thistime:%lu partial:%u", + result, thistime, partial); + + if (result == USB_ST_TIMEOUT) { /* NAK - so hold for a while */ + if (!maxretry--) { + return -ETIME; + } + interruptible_sleep_on_timeout(&lcd-> wait_q, NAK_TIMEOUT); + continue; + } else if (!result & partial) { + obuf += partial; + thistime -= partial; + } else + break; + }; + if (result) { + err("Write Whoops - %x", result); + return -EIO; + } + bytes_written += copy_size; + count -= copy_size; + buffer += copy_size; + } while (count > 0); + + return bytes_written ? bytes_written : -EIO; +} + +static ssize_t +read_lcd(struct file *file, char *buffer, size_t count, loff_t * ppos) +{ + struct lcd_usb_data *lcd = &lcd_instance; + ssize_t read_count; + unsigned int partial; + int this_read; + int result; + int maxretry = 10; + char *ibuf = lcd->ibuf; + + /* Sanity check to make sure lcd is connected, powered, etc */ + if (lcd == NULL || + lcd->present == 0 || + lcd->lcd_dev == NULL) + return -1; + + read_count = 0; + + while (count > 0) { + if (signal_pending(current)) { + return read_count ? read_count : -EINTR; + } + if (!lcd->lcd_dev) + return -ENODEV; + this_read = (count >= IBUF_SIZE) ? IBUF_SIZE : count; + + result = usb_bulk_msg(lcd->lcd_dev, + usb_rcvbulkpipe(lcd->lcd_dev, 0), + ibuf, this_read, &partial, + (int) (HZ * 8)); + + dbg(KERN_DEBUG "read stats: result:%d this_read:%u partial:%u", + result, this_read, partial); + + if (partial) { + count = this_read = partial; + } else if (result == USB_ST_TIMEOUT || result == 15) { /* FIXME: 15 ??? */ + if (!maxretry--) { + err("read_lcd: maxretry timeout"); + return -ETIME; + } + interruptible_sleep_on_timeout(&lcd->wait_q, + NAK_TIMEOUT); + continue; + } else if (result != USB_ST_DATAUNDERRUN) { + err("Read Whoops - result:%u partial:%u this_read:%u", + result, partial, this_read); + return -EIO; + } else { + return (0); + } + + if (this_read) { + if (copy_to_user(buffer, ibuf, this_read)) + return -EFAULT; + count -= this_read; + read_count += this_read; + buffer += this_read; + } + } + return read_count; +} + +static void *probe_lcd(struct usb_device *dev, unsigned int ifnum) +{ + struct lcd_usb_data *lcd = &lcd_instance; + int i; + + if (dev->descriptor.idProduct != 0x0001 ) { + warn(KERN_INFO "USBLCD model not supported."); + return NULL; + } + + if (lcd->present == 1) { + warn(KERN_INFO "Multiple USBLCDs are not supported!"); + return NULL; + } + + i = dev->descriptor.bcdDevice; + + info("USBLCD Version %1d%1d.%1d%1d found at address %d", + (i & 0xF000)>>12,(i & 0xF00)>>8,(i & 0xF0)>>4,(i & 0xF), + dev->devnum); + + lcd->present = 1; + lcd->lcd_dev = dev; + + if (!(lcd->obuf = (char *) kmalloc(OBUF_SIZE, GFP_KERNEL))) { + err("probe_lcd: Not enough memory for the output buffer"); + return NULL; + } + dbg("probe_lcd: obuf address:%p", lcd->obuf); + + if (!(lcd->ibuf = (char *) kmalloc(IBUF_SIZE, GFP_KERNEL))) { + err("probe_lcd: Not enough memory for the input buffer"); + kfree(lcd->obuf); + return NULL; + } + dbg("probe_lcd: ibuf address:%p", lcd->ibuf); + + return lcd; +} + +static void disconnect_lcd(struct usb_device *dev, void *ptr) +{ + struct lcd_usb_data *lcd = (struct lcd_usb_data *) ptr; + + if (lcd->isopen) { + lcd->isopen = 0; + /* better let it finish - the release will do whats needed */ + lcd->lcd_dev = NULL; + return; + } + kfree(lcd->ibuf); + kfree(lcd->obuf); + + info("USBLCD disconnected."); + + lcd->present = 0; +} + +static struct usb_device_id id_table [] = { + { .idVendor = 0x1212, .match_flags = USB_DEVICE_ID_MATCH_VENDOR, }, + {}, +}; + +MODULE_DEVICE_TABLE (usb, id_table); + +static struct +file_operations usb_lcd_fops = { + .owner = THIS_MODULE, + .read = read_lcd, + .write = write_lcd, + .ioctl = ioctl_lcd, + .open = open_lcd, + .release = close_lcd, +}; + +static struct +usb_driver lcd_driver = { + .name = "usblcd", + .probe = (void *)probe_lcd, + .disconnect = disconnect_lcd, + .id_table = id_table, + .fops = &usb_lcd_fops, + .minor = USBLCD_MINOR, +}; + +int usb_lcd_init(void) +{ + if (usb_register(&lcd_driver) < 0) + return -1; + + info("%s (C) Adams IT Services http://www.usblcd.de", DRIVER_VERSION); + info("USBLCD support registered."); + return 0; +} + + +void usb_lcd_cleanup(void) +{ + struct lcd_usb_data *lcd = &lcd_instance; + + lcd->present = 0; + usb_deregister(&lcd_driver); +} + +module_init(usb_lcd_init); +module_exit(usb_lcd_cleanup); + +MODULE_AUTHOR("Adams IT Services "); +MODULE_DESCRIPTION(DRIVER_VERSION); +MODULE_LICENSE("GPL"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/usb/usb-ohci.c linux.20pre5-ac2/drivers/usb/usb-ohci.c --- linux.20pre5/drivers/usb/usb-ohci.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/usb/usb-ohci.c 2002-09-01 13:44:18.000000000 +0100 @@ -1512,6 +1512,8 @@ urb->complete (urb); } else { urb->status = -ENOENT; + if (urb->complete) + urb->complete (urb); /* unblock sohci_unlink_urb */ if (wait_head) diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/aty/atyfb_base.c linux.20pre5-ac2/drivers/video/aty/atyfb_base.c --- linux.20pre5/drivers/video/aty/atyfb_base.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/aty/atyfb_base.c 2002-08-06 15:42:11.000000000 +0100 @@ -360,6 +360,7 @@ /* 3D RAGE Mobility */ { 0x4c4d, 0x4c4d, 0x00, 0x00, m64n_mob_p, 230, 50, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_MOBIL_BUS }, + { 0x4c52, 0x4c52, 0x00, 0x00, m64n_mob_p, 230, 40, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_MOBIL_BUS | M64F_MAGIC_POSTDIV | M64F_SDRAM_MAGIC_PLL | M64F_XL_DLL }, { 0x4c4e, 0x4c4e, 0x00, 0x00, m64n_mob_a, 230, 50, M64F_GT | M64F_INTEGRATED | M64F_RESET_3D | M64F_GTB_DSP | M64F_MOBIL_BUS }, #endif /* CONFIG_FB_ATY_CT */ }; @@ -438,7 +439,7 @@ #endif /* defined(CONFIG_PPC) */ -#if defined(CONFIG_PMAC_PBOOK) || defined(CONFIG_PMAC_BACKLIGHT) +#if defined(CONFIG_PMAC_PBOOK) || defined(CONFIG_PMAC_BACKLIGHT) || defined(CONFIG_FB_ATY_CT_VAIO_LCD) static void aty_st_lcd(int index, u32 val, const struct fb_info_aty *info) { unsigned long temp; @@ -460,7 +461,7 @@ /* read the register value */ return aty_ld_le32(LCD_DATA, info); } -#endif /* CONFIG_PMAC_PBOOK || CONFIG_PMAC_BACKLIGHT */ +#endif /* CONFIG_PMAC_PBOOK || CONFIG_PMAC_BACKLIGHT || CONFIG_FB_ATY_CT_VAIO_LCD */ /* ------------------------------------------------------------------------- */ @@ -1772,6 +1773,9 @@ #if defined(CONFIG_PPC) int sense; #endif +#if defined(CONFIG_FB_ATY_CT_VAIO_LCD) + u32 pm, hs; +#endif u8 pll_ref_div; info->aty_cmap_regs = (struct aty_cmap_regs *)(info->ati_regbase+0xc0); @@ -2089,6 +2093,35 @@ var = default_var; #endif /* !__sparc__ */ #endif /* !CONFIG_PPC */ +#if defined(CONFIG_FB_ATY_CT_VAIO_LCD) + /* Power Management */ + pm=aty_ld_lcd(POWER_MANAGEMENT, info); + pm=(pm & ~PWR_MGT_MODE_MASK) | PWR_MGT_MODE_PCI; + pm|=PWR_MGT_ON; + aty_st_lcd(POWER_MANAGEMENT, pm, info); + udelay(10); + + /* OVR_WID_LEFT_RIGHT */ + hs=aty_ld_le32(OVR_WID_LEFT_RIGHT,info); + hs= 0x00000000; + aty_st_le32(OVR_WID_LEFT_RIGHT, hs, info); + udelay(10); + + /* CONFIG_PANEL */ + hs=aty_ld_lcd(CONFIG_PANEL,info); + hs|=DONT_SHADOW_HEND ; + aty_st_lcd(CONFIG_PANEL, hs, info); + udelay(10); + +#if defined(DEBUG) + printk("LCD_INDEX CONFIG_PANEL LCD_GEN_CTRL POWER_MANAGEMENT\n" + "%08x %08x %08x %08x\n", + aty_ld_le32(LCD_INDEX, info), + aty_ld_lcd(CONFIG_PANEL, info), + aty_ld_lcd(LCD_GEN_CTRL, info), + aty_ld_lcd(POWER_MANAGEMENT, info), +#endif /* DEBUG */ +#endif /* CONFIG_FB_ATY_CT_VAIO_LCD */ #endif /* !MODULE */ if (noaccel) var.accel_flags &= ~FB_ACCELF_TEXT; @@ -2712,6 +2745,23 @@ /* * Blank the display. */ +#if defined(CONFIG_FB_ATY_CT_VAIO_LCD) +static int set_backlight_enable(int on, struct fb_info_aty *info) +{ + unsigned int reg = aty_ld_lcd(POWER_MANAGEMENT, info); + if(on) { + reg=(reg & ~SUSPEND_NOW) | PWR_BLON; + } else { + reg=(reg & ~PWR_BLON) | SUSPEND_NOW; + } + aty_st_lcd(POWER_MANAGEMENT, reg, info); + udelay(10); +#ifdef DEBUG + printk(KERN_INFO "set_backlight_enable(%i): %08x\n", on, aty_ld_lcd(POWER_MANAGEMENT, info) ); +#endif + return 0; +} +#endif /* CONFIG_FB_ATY_CT_VAIO_LCD */ static void atyfbcon_blank(int blank, struct fb_info *fb) { @@ -2723,6 +2773,9 @@ set_backlight_enable(0); #endif /* CONFIG_PMAC_BACKLIGHT */ +#if defined(CONFIG_FB_ATY_CT_VAIO_LCD) + set_backlight_enable(!blank, info); +#endif /* CONFIG_FB_ATY_CT_VAIO_LCD */ gen_cntl = aty_ld_8(CRTC_GEN_CNTL, info); if (blank > 0) switch (blank-1) { diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/aty/mach64_ct.c linux.20pre5-ac2/drivers/video/aty/mach64_ct.c --- linux.20pre5/drivers/video/aty/mach64_ct.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/aty/mach64_ct.c 2002-08-06 15:42:11.000000000 +0100 @@ -178,11 +178,14 @@ } pll->pll_gen_cntl |= mpostdiv<<4; /* mclk */ - if (M64_HAS(MAGIC_POSTDIV)) - pll->pll_ext_cntl = 0; - else +#if defined(CONFIG_FB_ATY_CT_VAIO_LCD) pll->pll_ext_cntl = mpostdiv; /* xclk == mclk */ - +#else + if ( M64_HAS(MAGIC_POSTDIV) ) + pll->pll_ext_cntl = 0; + else + pll->pll_ext_cntl = mpostdiv; /* xclk == mclk */ +#endif switch (pll->vclk_post_div_real) { case 2: vpostdiv = 1; diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/aty/mach64.h linux.20pre5-ac2/drivers/video/aty/mach64.h --- linux.20pre5/drivers/video/aty/mach64.h 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/aty/mach64.h 2002-08-06 15:42:11.000000000 +0100 @@ -1148,6 +1148,8 @@ #define APC_LUT_MN 0x39 #define APC_LUT_OP 0x3A +/* Values in CONFIG_PANEL */ +#define DONT_SHADOW_HEND 0x00004000 /* Values in LCD_MISC_CNTL */ #define BIAS_MOD_LEVEL_MASK 0x0000ff00 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/Config.in linux.20pre5-ac2/drivers/video/Config.in --- linux.20pre5/drivers/video/Config.in 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/Config.in 2002-09-02 00:08:04.000000000 +0100 @@ -124,22 +124,34 @@ if [ "$CONFIG_FB_MATROX" != "n" ]; then bool ' Millennium I/II support' CONFIG_FB_MATROX_MILLENIUM bool ' Mystique support' CONFIG_FB_MATROX_MYSTIQUE - bool ' G100/G200/G400/G450/G550 support' CONFIG_FB_MATROX_G100 + bool ' G100/G200/G400/G450/G550 support' CONFIG_FB_MATROX_G450 + if [ "$CONFIG_FB_MATROX_G450" = "n" ]; then + bool ' G100/G200/G400 support' CONFIG_FB_MATROX_G100A + fi + if [ "$CONFIG_FB_MATROX_G450" = "y" -o "$CONFIG_FB_MATROX_G100A" = "y" ]; then + define_bool CONFIG_FB_MATROX_G100 y + fi if [ "$CONFIG_I2C" != "n" ]; then dep_tristate ' Matrox I2C support' CONFIG_FB_MATROX_I2C $CONFIG_FB_MATROX $CONFIG_I2C_ALGOBIT if [ "$CONFIG_FB_MATROX_G100" = "y" ]; then dep_tristate ' G400 second head support' CONFIG_FB_MATROX_MAVEN $CONFIG_FB_MATROX_I2C fi fi - dep_tristate ' G450/G550 second head support (mandatory for G550)' CONFIG_FB_MATROX_G450 $CONFIG_FB_MATROX_G100 + dep_tristate ' Matrox /proc interface' CONFIG_FB_MATROX_PROC $CONFIG_FB_MATROX bool ' Multihead support' CONFIG_FB_MATROX_MULTIHEAD fi tristate ' ATI Mach64 display support (EXPERIMENTAL)' CONFIG_FB_ATY if [ "$CONFIG_FB_ATY" != "n" ]; then bool ' Mach64 GX support (EXPERIMENTAL)' CONFIG_FB_ATY_GX bool ' Mach64 CT/VT/GT/LT (incl. 3D RAGE) support' CONFIG_FB_ATY_CT + if [ "$CONFIG_FB_ATY_CT" = "y" ]; then + bool ' Sony Vaio C1VE 1024x480 LCD support' CONFIG_FB_ATY_CT_VAIO_LCD + fi fi tristate ' ATI Radeon display support (EXPERIMENTAL)' CONFIG_FB_RADEON + if [ "$CONFIG_FB_RADEON" = "y" ]; then + bool ' Sony Vaio C1MV 1280x600 LCD support' CONFIG_FB_RADEON_VAIO_LCD + fi tristate ' ATI Rage128 display support (EXPERIMENTAL)' CONFIG_FB_ATY128 tristate ' SIS acceleration (EXPERIMENTAL)' CONFIG_FB_SIS if [ "$CONFIG_FB_SIS" != "n" ]; then diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/g450_pll.c linux.20pre5-ac2/drivers/video/matrox/g450_pll.c --- linux.20pre5/drivers/video/matrox/g450_pll.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/g450_pll.c 2002-09-02 00:06:57.000000000 +0100 @@ -2,11 +2,11 @@ * * Hardware accelerated Matrox PCI cards - G450/G550 PLL control. * - * (c) 2001 Petr Vandrovec + * (c) 2001-2002 Petr Vandrovec * * Portions Copyright (c) 2001 Matrox Graphics Inc. * - * Version: 1.62 2001/11/29 + * Version: 1.64 2002/06/10 * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive for @@ -33,6 +33,10 @@ return (ACCESS_FBINFO(features).pll.ref_freq * n + (m >> 1)) / m; } +unsigned int g450_mnp2f(CPMINFO unsigned int mnp) { + return g450_vco2f(mnp, g450_mnp2vco(PMINFO mnp)); +} + static inline unsigned int pll_freq_delta(unsigned int f1, unsigned int f2) { if (f2 < f1) { f2 = f1 - f2; @@ -52,40 +56,42 @@ m = (mnp >> 16) & 0xFF; p = mnp & 0xFF; - if (m == 0 || m == 0xFF) { - if (m == 0) { - if (p & 0x40) { - return NO_MORE_MNP; + do { + if (m == 0 || m == 0xFF) { + if (m == 0) { + if (p & 0x40) { + return NO_MORE_MNP; + } + if (p & 3) { + p--; + } else { + p = 0x40; + } + tvco >>= 1; + if (tvco < pi->vcomin) { + return NO_MORE_MNP; + } + *fvco = tvco; } - if (p & 3) { - p--; + + p &= 0x43; + if (tvco < 550000) { +/* p |= 0x00; */ + } else if (tvco < 700000) { + p |= 0x08; + } else if (tvco < 1000000) { + p |= 0x10; + } else if (tvco < 1150000) { + p |= 0x18; } else { - p = 0x40; + p |= 0x20; } - tvco >>= 1; - if (tvco < pi->vcomin) { - return NO_MORE_MNP; - } - *fvco = tvco; - } - - p &= 0x43; - if (tvco < 550000) { -/* p |= 0x00; */ - } else if (tvco < 700000) { - p |= 0x08; - } else if (tvco < 1000000) { - p |= 0x10; - } else if (tvco < 1150000) { - p |= 0x18; + m = 9; } else { - p |= 0x20; + m--; } - m = 9; - } else { - m--; - } - n = ((tvco * (m+1) + ACCESS_FBINFO(features).pll.ref_freq) / (ACCESS_FBINFO(features).pll.ref_freq * 2)) - 2; + n = ((tvco * (m+1) + ACCESS_FBINFO(features).pll.ref_freq) / (ACCESS_FBINFO(features).pll.ref_freq * 2)) - 2; + } while (n < 0x03 || n > 0x7A); return (m << 16) | (n << 8) | p; } @@ -219,7 +225,7 @@ } } -static inline void g450_setpll_cond(WPMINFO unsigned int mnp, unsigned int pll) { +void matroxfb_g450_setpll_cond(WPMINFO unsigned int mnp, unsigned int pll) { if (g450_cmppll(PMINFO mnp, pll)) { g450_setpll(PMINFO mnp, pll); } @@ -385,10 +391,8 @@ unsigned int vco; unsigned int delta; - if ((mnp & 0xFF00) < 0x0300 || (mnp & 0xFF00) > 0x7A00) { - continue; - } vco = g450_mnp2vco(PMINFO mnp); +#if 0 if (pll == M_VIDEO_PLL) { unsigned int big, small; @@ -406,6 +410,7 @@ continue; } } +#endif delta = pll_freq_delta(fout, g450_vco2f(mnp, vco)); for (idx = mnpcount; idx > 0; idx--) { /* == is important; due to nextpll algorithm we get @@ -426,7 +431,7 @@ } /* VideoPLL and PixelPLL matched: do nothing... In all other cases we should get at least one frequency */ if (!mnpcount) { - return 1; + return -EBUSY; } { unsigned long flags; @@ -435,15 +440,15 @@ matroxfb_DAC_lock_irqsave(flags); mnp = g450_checkcache(PMINFO ci, mnparray[0]); if (mnp != NO_MORE_MNP) { - g450_setpll_cond(PMINFO mnp, pll); + matroxfb_g450_setpll_cond(PMINFO mnp, pll); } else { mnp = g450_findworkingpll(PMINFO pll, mnparray, mnpcount); g450_addcache(ci, mnparray[0], mnp); } updatehwstate_clk(&ACCESS_FBINFO(hw), mnp, pll); matroxfb_DAC_unlock_irqrestore(flags); + return mnp; } - return 0; } /* It must be greater than number of possible PLL values. @@ -465,8 +470,10 @@ } EXPORT_SYMBOL(matroxfb_g450_setclk); +EXPORT_SYMBOL(g450_mnp2f); +EXPORT_SYMBOL(matroxfb_g450_setpll_cond); -MODULE_AUTHOR("(c) 2001 Petr Vandrovec "); +MODULE_AUTHOR("(c) 2001-2002 Petr Vandrovec "); MODULE_DESCRIPTION("Matrox G450/G550 PLL driver"); MODULE_LICENSE("GPL"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/g450_pll.h linux.20pre5-ac2/drivers/video/matrox/g450_pll.h --- linux.20pre5/drivers/video/matrox/g450_pll.h 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/g450_pll.h 2002-09-02 14:57:05.000000000 +0100 @@ -4,5 +4,7 @@ #include "matroxfb_base.h" int matroxfb_g450_setclk(WPMINFO unsigned int fout, unsigned int pll); +unsigned int g450_mnp2f(CPMINFO unsigned int mnp); +void matroxfb_g450_setpll_cond(WPMINFO unsigned int mnp, unsigned int pll); #endif /* __G450_PLL_H__ */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/i2c-matroxfb.c linux.20pre5-ac2/drivers/video/matrox/i2c-matroxfb.c --- linux.20pre5/drivers/video/matrox/i2c-matroxfb.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/i2c-matroxfb.c 2002-09-02 00:06:57.000000000 +0100 @@ -2,9 +2,9 @@ * * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450. * - * (c) 1998-2001 Petr Vandrovec + * (c) 1998-2002 Petr Vandrovec * - * Version: 1.51 2001/01/19 + * Version: 1.64 2002/06/10 * * See matroxfb_base.c for contributors. * @@ -30,6 +30,12 @@ /******************************************************/ +struct matroxfb_dh_maven_info { + struct i2c_bit_adapter maven; + struct i2c_bit_adapter ddc1; + struct i2c_bit_adapter ddc2; +}; + static int matroxfb_read_gpio(struct matrox_fb_info* minfo) { unsigned long flags; int v; @@ -40,7 +46,7 @@ return v; } -static inline void matroxfb_set_gpio(struct matrox_fb_info* minfo, int mask, int val) { +static void matroxfb_set_gpio(struct matrox_fb_info* minfo, int mask, int val) { unsigned long flags; int v; @@ -53,7 +59,7 @@ } /* software I2C functions */ -static void matroxfb_i2c_set(struct matrox_fb_info* minfo, int mask, int state) { +static inline void matroxfb_i2c_set(struct matrox_fb_info* minfo, int mask, int state) { if (state) state = 0; else @@ -61,68 +67,24 @@ matroxfb_set_gpio(minfo, ~mask, state); } -static void matroxfb_maven_setsda(void* data, int state) { - matroxfb_i2c_set(data, MAT_DATA, state); -} - -static void matroxfb_maven_setscl(void* data, int state) { - matroxfb_i2c_set(data, MAT_CLK, state); -} - -static int matroxfb_maven_getsda(void* data) { - return (matroxfb_read_gpio(data) & MAT_DATA) ? 1 : 0; +static void matroxfb_gpio_setsda(void* data, int state) { + struct i2c_bit_adapter* b = data; + matroxfb_i2c_set(b->minfo, b->mask.data, state); } -static int matroxfb_maven_getscl(void* data) { - return (matroxfb_read_gpio(data) & MAT_CLK) ? 1 : 0; +static void matroxfb_gpio_setscl(void* data, int state) { + struct i2c_bit_adapter* b = data; + matroxfb_i2c_set(b->minfo, b->mask.clock, state); } -static void matroxfb_ddc1_setsda(void* data, int state) { - matroxfb_i2c_set(data, DDC1_DATA, state); +static int matroxfb_gpio_getsda(void* data) { + struct i2c_bit_adapter* b = data; + return (matroxfb_read_gpio(b->minfo) & b->mask.data) ? 1 : 0; } -static void matroxfb_ddc1_setscl(void* data, int state) { - matroxfb_i2c_set(data, DDC1_CLK, state); -} - -static int matroxfb_ddc1_getsda(void* data) { - return (matroxfb_read_gpio(data) & DDC1_DATA) ? 1 : 0; -} - -static int matroxfb_ddc1_getscl(void* data) { - return (matroxfb_read_gpio(data) & DDC1_CLK) ? 1 : 0; -} - -static void matroxfb_ddc1b_setsda(void* data, int state) { - matroxfb_i2c_set(data, DDC1B_DATA, state); -} - -static void matroxfb_ddc1b_setscl(void* data, int state) { - matroxfb_i2c_set(data, DDC1B_CLK, state); -} - -static int matroxfb_ddc1b_getsda(void* data) { - return (matroxfb_read_gpio(data) & DDC1B_DATA) ? 1 : 0; -} - -static int matroxfb_ddc1b_getscl(void* data) { - return (matroxfb_read_gpio(data) & DDC1B_CLK) ? 1 : 0; -} - -static void matroxfb_ddc2_setsda(void* data, int state) { - matroxfb_i2c_set(data, DDC2_DATA, state); -} - -static void matroxfb_ddc2_setscl(void* data, int state) { - matroxfb_i2c_set(data, DDC2_CLK, state); -} - -static int matroxfb_ddc2_getsda(void* data) { - return (matroxfb_read_gpio(data) & DDC2_DATA) ? 1 : 0; -} - -static int matroxfb_ddc2_getscl(void* data) { - return (matroxfb_read_gpio(data) & DDC2_CLK) ? 1 : 0; +static int matroxfb_gpio_getscl(void* data) { + struct i2c_bit_adapter* b = data; + return (matroxfb_read_gpio(b->minfo) & b->mask.clock) ? 1 : 0; } static void matroxfb_dh_inc_use(struct i2c_adapter* dummy) { @@ -133,97 +95,36 @@ MOD_DEC_USE_COUNT; } -static struct i2c_adapter matroxmaven_i2c_adapter_template = +static struct i2c_adapter matrox_i2c_adapter_template = { - "", - I2C_HW_B_G400, - - NULL, - NULL, - - matroxfb_dh_inc_use, - matroxfb_dh_dec_use, - NULL, - NULL, - NULL, + .id = I2C_HW_B_G400, + .inc_use = matroxfb_dh_inc_use, + .dec_use = matroxfb_dh_dec_use, }; -static struct i2c_algo_bit_data matroxmaven_i2c_algo_template = +static struct i2c_algo_bit_data matrox_i2c_algo_template = { NULL, - matroxfb_maven_setsda, - matroxfb_maven_setscl, - matroxfb_maven_getsda, - matroxfb_maven_getscl, + matroxfb_gpio_setsda, + matroxfb_gpio_setscl, + matroxfb_gpio_getsda, + matroxfb_gpio_getscl, 10, 10, 100, }; -static struct i2c_adapter matrox_ddc1_adapter_template = -{ - "", - I2C_HW_B_G400, /* DDC */ - - NULL, - NULL, - - matroxfb_dh_inc_use, - matroxfb_dh_dec_use, - NULL, - NULL, - NULL, -}; - -static struct i2c_algo_bit_data matrox_ddc1_algo_template = -{ - NULL, - matroxfb_ddc1_setsda, - matroxfb_ddc1_setscl, - matroxfb_ddc1_getsda, - matroxfb_ddc1_getscl, - 10, 10, 100, -}; - -static struct i2c_algo_bit_data matrox_ddc1b_algo_template = -{ - NULL, - matroxfb_ddc1b_setsda, - matroxfb_ddc1b_setscl, - matroxfb_ddc1b_getsda, - matroxfb_ddc1b_getscl, - 10, 10, 100, -}; - -static struct i2c_adapter matrox_ddc2_adapter_template = -{ - "", - I2C_HW_B_G400, /* DDC */ - - NULL, - NULL, - - matroxfb_dh_inc_use, /* should increment matroxfb_maven usage too, this DDC is coupled with maven_client */ - matroxfb_dh_dec_use, /* should decrement matroxfb_maven usage too */ - NULL, - NULL, - NULL, -}; - -static struct i2c_algo_bit_data matrox_ddc2_algo_template = -{ - NULL, - matroxfb_ddc2_setsda, - matroxfb_ddc2_setscl, - matroxfb_ddc2_getsda, - matroxfb_ddc2_getscl, - 10, 10, 100, -}; - -static int i2c_bus_reg(struct i2c_bit_adapter* b, struct matrox_fb_info* minfo) { +static int i2c_bus_reg(struct i2c_bit_adapter* b, struct matrox_fb_info* minfo, + unsigned int data, unsigned int clock, const char* name) { int err; - b->adapter.data = minfo; + b->minfo = minfo; + b->mask.data = data; + b->mask.clock = clock; + b->adapter = matrox_i2c_adapter_template; + sprintf(b->adapter.name, name, GET_FB_IDX(minfo->fbcon.node)); + b->adapter.data = b; b->adapter.algo_data = &b->bac; - b->bac.data = minfo; + b->bac = matrox_i2c_algo_template; + b->bac.data = b; err = i2c_bit_add_bus(&b->adapter); b->initialized = !err; return err; @@ -236,50 +137,14 @@ } } -static inline int i2c_maven_init(struct matroxfb_dh_maven_info* minfo2) { - struct i2c_bit_adapter *b = &minfo2->maven; - - b->adapter = matroxmaven_i2c_adapter_template; - b->bac = matroxmaven_i2c_algo_template; - sprintf(b->adapter.name, "MAVEN:fb%u on i2c-matroxfb", GET_FB_IDX(minfo2->primary_dev->fbcon.node)); - return i2c_bus_reg(b, minfo2->primary_dev); -} - static inline void i2c_maven_done(struct matroxfb_dh_maven_info* minfo2) { i2c_bit_bus_del(&minfo2->maven); } -static inline int i2c_ddc1_init(struct matroxfb_dh_maven_info* minfo2) { - struct i2c_bit_adapter *b = &minfo2->ddc1; - - b->adapter = matrox_ddc1_adapter_template; - b->bac = matrox_ddc1_algo_template; - sprintf(b->adapter.name, "DDC:fb%u #0 on i2c-matroxfb", GET_FB_IDX(minfo2->primary_dev->fbcon.node)); - return i2c_bus_reg(b, minfo2->primary_dev); -} - -static inline int i2c_ddc1b_init(struct matroxfb_dh_maven_info* minfo2) { - struct i2c_bit_adapter *b = &minfo2->ddc1; - - b->adapter = matrox_ddc1_adapter_template; - b->bac = matrox_ddc1b_algo_template; - sprintf(b->adapter.name, "DDC:fb%u #0 on i2c-matroxfb", GET_FB_IDX(minfo2->primary_dev->fbcon.node)); - return i2c_bus_reg(b, minfo2->primary_dev); -} - static inline void i2c_ddc1_done(struct matroxfb_dh_maven_info* minfo2) { i2c_bit_bus_del(&minfo2->ddc1); } -static inline int i2c_ddc2_init(struct matroxfb_dh_maven_info* minfo2) { - struct i2c_bit_adapter *b = &minfo2->ddc2; - - b->adapter = matrox_ddc2_adapter_template; - b->bac = matrox_ddc2_algo_template; - sprintf(b->adapter.name, "DDC:fb%u #1 on i2c-matroxfb", GET_FB_IDX(minfo2->primary_dev->fbcon.node)); - return i2c_bus_reg(b, minfo2->primary_dev); -} - static inline void i2c_ddc2_done(struct matroxfb_dh_maven_info* minfo2) { i2c_bit_bus_del(&minfo2->ddc2); } @@ -299,24 +164,26 @@ matroxfb_DAC_unlock_irqrestore(flags); memset(m2info, 0, sizeof(*m2info)); - m2info->maven.minfo = m2info; - m2info->ddc1.minfo = m2info; - m2info->ddc2.minfo = m2info; - m2info->primary_dev = minfo; - - if (ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGA2064W || - ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGA2164W || - ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGA2164W_AGP) - err = i2c_ddc1b_init(m2info); - else - err = i2c_ddc1_init(m2info); + + switch (ACCESS_FBINFO(chip)) { + case MGA_2064: + case MGA_2164: + err = i2c_bus_reg(&m2info->ddc1, minfo, DDC1B_DATA, DDC1B_CLK, "DDC:fb%u #0 on i2c-matroxfb"); + break; + default: + err = i2c_bus_reg(&m2info->ddc1, minfo, DDC1_DATA, DDC1_CLK, "DDC:fb%u #0 on i2c-matroxfb"); + break; + } if (err) goto fail_ddc1; - if (ACCESS_FBINFO(devflags.maven_capable)) { - err = i2c_ddc2_init(m2info); - if (err) + if (ACCESS_FBINFO(devflags.dualhead)) { + err = i2c_bus_reg(&m2info->ddc2, minfo, DDC2_DATA, DDC2_CLK, "DDC:fb%u #1 on i2c-matroxfb"); + if (err == -ENODEV) { + printk(KERN_INFO "i2c-matroxfb: VGA->TV plug detected, DDC unavailable.\n"); + } else if (err) printk(KERN_INFO "i2c-matroxfb: Could not register secondary output i2c bus. Continuing anyway.\n"); - err = i2c_maven_init(m2info); + /* Register maven bus even on G450/G550 */ + err = i2c_bus_reg(&m2info->maven, minfo, MAT_DATA, MAT_CLK, "MAVEN:fb%u on i2c-matroxfb"); if (err) printk(KERN_INFO "i2c-matroxfb: Could not register Maven i2c bus. Continuing anyway.\n"); } @@ -337,10 +204,10 @@ } static struct matroxfb_driver i2c_matroxfb = { - LIST_HEAD_INIT(i2c_matroxfb.node), - "i2c-matroxfb", - i2c_matroxfb_probe, - i2c_matroxfb_remove, + .node = LIST_HEAD_INIT(i2c_matroxfb.node), + .name = "i2c-matroxfb", + .probe = i2c_matroxfb_probe, + .remove = i2c_matroxfb_remove, }; static int __init i2c_matroxfb_init(void) { @@ -355,7 +222,7 @@ matroxfb_unregister_driver(&i2c_matroxfb); } -MODULE_AUTHOR("(c) 1999-2001 Petr Vandrovec "); +MODULE_AUTHOR("(c) 1999-2002 Petr Vandrovec "); MODULE_DESCRIPTION("Support module providing I2C buses present on Matrox videocards"); module_init(i2c_matroxfb_init); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/Makefile linux.20pre5-ac2/drivers/video/matrox/Makefile --- linux.20pre5/drivers/video/matrox/Makefile 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/Makefile 2002-09-02 02:28:49.000000000 +0100 @@ -7,7 +7,7 @@ # All of the (potential) objects that export symbols. # This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. -export-objs := matroxfb_base.o matroxfb_accel.o matroxfb_DAC1064.o matroxfb_Ti3026.o matroxfb_misc.o g450_pll.o +export-objs := matroxfb_base.o matroxfb_accel.o matroxfb_DAC1064.o matroxfb_Ti3026.o matroxfb_misc.o g450_pll.o matroxfb_g450.o # Each configuration option enables a list of files. @@ -15,8 +15,13 @@ obj-$(CONFIG_FB_MATROX) += matroxfb_base.o matroxfb_accel.o matroxfb_DAC1064.o matroxfb_Ti3026.o matroxfb_misc.o $(my-obj-y) obj-$(CONFIG_FB_MATROX_I2C) += i2c-matroxfb.o -obj-$(CONFIG_FB_MATROX_MAVEN) += matroxfb_maven.o matroxfb_crtc2.o -obj-$(CONFIG_FB_MATROX_G450) += matroxfb_g450.o matroxfb_crtc2.o +ifeq ($(CONFIG_FB_MATROX_MAVEN),y) + obj-$(CONFIG_FB_MATROX) += matroxfb_maven.o matroxfb_crtc2.o +endif +ifeq ($(CONFIG_FB_MATROX_G450),y) + obj-$(CONFIG_FB_MATROX) += matroxfb_g450.o matroxfb_crtc2.o +endif +obj-$(CONFIG_FB_MATROX_PROC) += matroxfb_proc.o include $(TOPDIR)/Rules.make diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_accel.c linux.20pre5-ac2/drivers/video/matrox/matroxfb_accel.c --- linux.20pre5/drivers/video/matrox/matroxfb_accel.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_accel.c 2002-09-02 00:06:57.000000000 +0100 @@ -143,6 +143,8 @@ ACCESS_FBINFO(accel.m_opmode) = mopmode; } +EXPORT_SYMBOL(matrox_cfbX_init); + static void matrox_cfbX_bmove(struct display* p, int sy, int sx, int dy, int dx, int height, int width) { int pixx = p->var.xres_virtual, start, end; CRITFLAGS @@ -943,7 +945,7 @@ CRITEND } -void matrox_text_createcursor(WPMINFO struct display* p) { +static void matrox_text_createcursor(WPMINFO struct display* p) { CRITFLAGS if (ACCESS_FBINFO(currcon_display) != p) @@ -1029,6 +1031,8 @@ var->xres_virtual = vxres * hf; } +EXPORT_SYMBOL(matrox_text_round); + static int matrox_text_setfont(struct display* p, int width, int height) { DBG("matrox_text_setfont"); @@ -1223,6 +1227,8 @@ } } +EXPORT_SYMBOL(initMatrox); + void matrox_init_putc(WPMINFO struct display* p, void (*dac_createcursor)(WPMINFO struct display* p)) { int i; @@ -1245,4 +1251,7 @@ ACCESS_FBINFO(curr.putcs) = matrox_cfbX_putcs; } } + +EXPORT_SYMBOL(matrox_init_putc); + MODULE_LICENSE("GPL"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_accel.h linux.20pre5-ac2/drivers/video/matrox/matroxfb_accel.h --- linux.20pre5/drivers/video/matrox/matroxfb_accel.h 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_accel.h 2002-09-02 14:57:05.000000000 +0100 @@ -5,7 +5,6 @@ void matrox_init_putc(WPMINFO struct display* p, void (*)(WPMINFO struct display *p)); void matrox_cfbX_init(WPMINFO struct display* p); -void matrox_text_createcursor(WPMINFO struct display* p); void matrox_text_round(CPMINFO struct fb_var_screeninfo* var, struct display* p); void initMatrox(WPMINFO struct display* p); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_base.c linux.20pre5-ac2/drivers/video/matrox/matroxfb_base.c --- linux.20pre5/drivers/video/matrox/matroxfb_base.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_base.c 2002-09-02 00:06:57.000000000 +0100 @@ -2,11 +2,11 @@ * * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200 and G400 * - * (c) 1998-2001 Petr Vandrovec + * (c) 1998-2002 Petr Vandrovec * * Portions Copyright (c) 2001 Matrox Graphics Inc. * - * Version: 1.62 2001/11/29 + * Version: 1.64 2002/06/10 * * MTRR stuff: 1998 Tom Rini * @@ -77,6 +77,15 @@ * "Uns Lider" * G100 PLNWT fixes * + * "Denis Zaitsev" + * Fixes + * + * "Mike Pieper" + * TVOut enhandcements, V4L2 control interface. + * + * "Diego Biurrun" + * DFP testing + * * (following author is not in any relation with this code, but his code * is included in this driver) * @@ -100,6 +109,7 @@ #include "matroxfb_Ti3026.h" #include "matroxfb_maven.h" #include "matroxfb_crtc2.h" +#include "matroxfb_g450.h" #include #include @@ -199,6 +209,7 @@ } matroxfb_unregister_device(MINFO); unregister_framebuffer(&ACCESS_FBINFO(fbcon)); + matroxfb_g450_shutdown(PMINFO2); del_timer_sync(&ACCESS_FBINFO(cursor.timer)); #ifdef CONFIG_MTRR if (ACCESS_FBINFO(mtrr.vram_valid)) @@ -220,7 +231,7 @@ static int matroxfb_open(struct fb_info *info, int user) { -#define minfo ((struct matrox_fb_info*)info) +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) DBG_LOOP("matroxfb_open") if (ACCESS_FBINFO(dead)) { @@ -233,7 +244,7 @@ static int matroxfb_release(struct fb_info *info, int user) { -#define minfo ((struct matrox_fb_info*)info) +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) DBG_LOOP("matroxfb_release") if (!(--ACCESS_FBINFO(usecount)) && ACCESS_FBINFO(dead)) { @@ -245,7 +256,7 @@ static int matroxfb_pan_display(struct fb_var_screeninfo *var, int con, struct fb_info* info) { -#define minfo ((struct matrox_fb_info*)info) +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) DBG("matroxfb_pan_display") @@ -271,7 +282,7 @@ static int matroxfb_updatevar(int con, struct fb_info *info) { -#define minfo ((struct matrox_fb_info*)info) +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) DBG("matroxfb_updatevar"); matrox_pan_var(PMINFO &fb_display[con].var); @@ -391,12 +402,43 @@ } static int matroxfb_decode_var(CPMINFO struct display* p, struct fb_var_screeninfo *var, int *visual, int *video_cmap_len, unsigned int* ydstorg) { + struct RGBT { + unsigned char bpp; + struct { + unsigned char offset, + length; + } red, + green, + blue, + transp; + signed char visual; + }; + static const struct RGBT table[]= { +#if defined FBCON_HAS_VGATEXT + { 0,{ 0,6},{0,6},{0,6},{ 0,0},MX_VISUAL_PSEUDOCOLOR}, +#endif +#if defined FBCON_HAS_CFB4 || defined FBCON_HAS_CFB8 + { 8,{ 0,8},{0,8},{0,8},{ 0,0},MX_VISUAL_PSEUDOCOLOR}, +#endif +#if defined FBCON_HAS_CFB16 + {15,{10,5},{5,5},{0,5},{15,1},MX_VISUAL_DIRECTCOLOR}, + {16,{11,5},{5,6},{0,5},{ 0,0},MX_VISUAL_DIRECTCOLOR}, +#endif +#if defined FBCON_HAS_CFB24 + {24,{16,8},{8,8},{0,8},{ 0,0},MX_VISUAL_DIRECTCOLOR}, +#endif +#if defined FBCON_HAS_CFB32 + {32,{16,8},{8,8},{0,8},{24,8},MX_VISUAL_DIRECTCOLOR} +#endif + }; + struct RGBT const *rgbt; + unsigned int bpp = var->bits_per_pixel; unsigned int vramlen; unsigned int memlen; DBG("matroxfb_decode_var") - switch (var->bits_per_pixel) { + switch (bpp) { #ifdef FBCON_HAS_VGATEXT case 0: if (!ACCESS_FBINFO(capable.text)) return -EINVAL; break; @@ -425,22 +467,22 @@ var->yres_virtual = var->yres; if (var->xres_virtual < var->xres) var->xres_virtual = var->xres; - if (var->bits_per_pixel) { - var->xres_virtual = matroxfb_pitch_adjust(PMINFO var->xres_virtual, var->bits_per_pixel); - memlen = var->xres_virtual * var->bits_per_pixel * var->yres_virtual / 8; + if (bpp) { + var->xres_virtual = matroxfb_pitch_adjust(PMINFO var->xres_virtual, bpp); + memlen = var->xres_virtual * bpp * var->yres_virtual / 8; if (memlen > vramlen) { - var->yres_virtual = vramlen * 8 / (var->xres_virtual * var->bits_per_pixel); - memlen = var->xres_virtual * var->bits_per_pixel * var->yres_virtual / 8; + var->yres_virtual = vramlen * 8 / (var->xres_virtual * bpp); + memlen = var->xres_virtual * bpp * var->yres_virtual / 8; } /* There is hardware bug that no line can cross 4MB boundary */ /* give up for CFB24, it is impossible to easy workaround it */ /* for other try to do something */ if (!ACCESS_FBINFO(capable.cross4MB) && (memlen > 0x400000)) { - if (var->bits_per_pixel == 24) { + if (bpp == 24) { /* sorry */ } else { unsigned int linelen; - unsigned int m1 = linelen = var->xres_virtual * var->bits_per_pixel / 8; + unsigned int m1 = linelen = var->xres_virtual * bpp / 8; unsigned int m2 = PAGE_SIZE; /* or 128 if you do not need PAGE ALIGNED address */ unsigned int max_yres; @@ -484,104 +526,43 @@ if (var->yoffset + var->yres > var->yres_virtual) var->yoffset = var->yres_virtual - var->yres; - if (var->bits_per_pixel == 0) { - var->red.offset = 0; - var->red.length = 6; - var->green.offset = 0; - var->green.length = 6; - var->blue.offset = 0; - var->blue.length = 6; - var->transp.offset = 0; - var->transp.length = 0; - *visual = MX_VISUAL_PSEUDOCOLOR; - } else if (var->bits_per_pixel == 4) { - var->red.offset = 0; - var->red.length = 8; - var->green.offset = 0; - var->green.length = 8; - var->blue.offset = 0; - var->blue.length = 8; - var->transp.offset = 0; - var->transp.length = 0; - *visual = MX_VISUAL_PSEUDOCOLOR; - } else if (var->bits_per_pixel <= 8) { - var->red.offset = 0; - var->red.length = 8; - var->green.offset = 0; - var->green.length = 8; - var->blue.offset = 0; - var->blue.length = 8; - var->transp.offset = 0; - var->transp.length = 0; - *visual = MX_VISUAL_PSEUDOCOLOR; - } else { - if (var->bits_per_pixel <= 16) { - if (var->green.length == 5) { - var->red.offset = 10; - var->red.length = 5; - var->green.offset = 5; - var->green.length = 5; - var->blue.offset = 0; - var->blue.length = 5; - var->transp.offset = 15; - var->transp.length = 1; - } else { - var->red.offset = 11; - var->red.length = 5; - var->green.offset = 5; - var->green.length = 6; - var->blue.offset = 0; - var->blue.length = 5; - var->transp.offset = 0; - var->transp.length = 0; - } - } else if (var->bits_per_pixel <= 24) { - var->red.offset = 16; - var->red.length = 8; - var->green.offset = 8; - var->green.length = 8; - var->blue.offset = 0; - var->blue.length = 8; - var->transp.offset = 0; - var->transp.length = 0; - } else { - var->red.offset = 16; - var->red.length = 8; - var->green.offset = 8; - var->green.length = 8; - var->blue.offset = 0; - var->blue.length = 8; - var->transp.offset = 24; - var->transp.length = 8; - } - dprintk("matroxfb: truecolor: " - "size=%d:%d:%d:%d, shift=%d:%d:%d:%d\n", - var->transp.length, - var->red.length, - var->green.length, - var->blue.length, - var->transp.offset, - var->red.offset, - var->green.offset, - var->blue.offset); - *visual = MX_VISUAL_DIRECTCOLOR; + if (bpp == 16 && var->green.length == 5) { + bpp--; /* an artifical value - 15 */ } + + for (rgbt = table; rgbt->bpp < bpp; rgbt++); +#define SETCLR(clr)\ + var->clr.offset = rgbt->clr.offset;\ + var->clr.length = rgbt->clr.length + SETCLR(red); + SETCLR(green); + SETCLR(blue); + SETCLR(transp); +#undef SETCLR + *visual = rgbt->visual; + + if (bpp > 8) + dprintk("matroxfb: truecolor: " + "size=%d:%d:%d:%d, shift=%d:%d:%d:%d\n", + var->transp.length, var->red.length, var->green.length, var->blue.length, + var->transp.offset, var->red.offset, var->green.offset, var->blue.offset); + *video_cmap_len = matroxfb_get_cmap_len(var); dprintk(KERN_INFO "requested %d*%d/%dbpp (%d*%d)\n", var->xres, var->yres, var->bits_per_pixel, var->xres_virtual, var->yres_virtual); return 0; } -static int matrox_setcolreg(unsigned regno, unsigned red, unsigned green, - unsigned blue, unsigned transp, - struct fb_info *fb_info) +static int matroxfb_setcolreg(unsigned regno, unsigned red, unsigned green, + unsigned blue, unsigned transp, + struct fb_info *fb_info) { struct display* p; #ifdef CONFIG_FB_MATROX_MULTIHEAD - struct matrox_fb_info* minfo = (struct matrox_fb_info*)fb_info; + struct matrox_fb_info* minfo = list_entry(fb_info, struct matrox_fb_info, fbcon); #endif - DBG("matrox_setcolreg") + DBG("matroxfb_setcolreg") /* * Set a single color register. The values supplied are @@ -656,15 +637,17 @@ return 0; } -static void do_install_cmap(WPMINFO struct display* dsp) +static inline void my_install_cmap(WPMINFO2) { - DBG("do_install_cmap") + /* Do not touch this code if you do not understand what it does! */ + /* Never try to use do_install_cmap() instead. It is crap. */ + struct fb_cmap* cmap = &ACCESS_FBINFO(currcon_display)->cmap; - if (dsp->cmap.len) - fb_set_cmap(&dsp->cmap, 1, matrox_setcolreg, &ACCESS_FBINFO(fbcon)); + if (cmap->len) + fb_set_cmap(cmap, 1, matroxfb_setcolreg, &ACCESS_FBINFO(fbcon)); else fb_set_cmap(fb_default_cmap(ACCESS_FBINFO(curr.cmap_len)), - 1, matrox_setcolreg, &ACCESS_FBINFO(fbcon)); + 1, matroxfb_setcolreg, &ACCESS_FBINFO(fbcon)); } static int matroxfb_get_fix(struct fb_fix_screeninfo *fix, int con, @@ -673,7 +656,7 @@ struct display* p; DBG("matroxfb_get_fix") -#define minfo ((struct matrox_fb_info*)info) +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) if (ACCESS_FBINFO(dead)) { return -ENXIO; @@ -684,7 +667,7 @@ else p = ACCESS_FBINFO(fbcon.disp); - memset(fix, 0, sizeof(struct fb_fix_screeninfo)); + memset(fix, 0, sizeof(*fix)); strcpy(fix->id,"MATROX"); fix->smem_start = ACCESS_FBINFO(video.base) + ACCESS_FBINFO(curr.ydstorg.bytes); @@ -706,7 +689,7 @@ static int matroxfb_get_var(struct fb_var_screeninfo *var, int con, struct fb_info *info) { -#define minfo ((struct matrox_fb_info*)info) +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) DBG("matroxfb_get_var") if(con < 0) @@ -720,7 +703,7 @@ static int matroxfb_set_var(struct fb_var_screeninfo *var, int con, struct fb_info *info) { -#define minfo ((struct matrox_fb_info*)info) +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) int err; int visual; int cmap_len; @@ -760,7 +743,7 @@ } display->var = *var; /* cmap */ - display->screen_base = vaddr_va(ACCESS_FBINFO(video.vbase)) + ydstorg; + display->screen_base = ACCESS_FBINFO(fbcon.screen_base) = vaddr_va(ACCESS_FBINFO(video.vbase)) + ydstorg; display->visual = visual; display->ypanstep = 1; display->ywrapstep = 0; @@ -816,8 +799,10 @@ { struct my_timming mt; struct matrox_hw_state* hw; + int out; matroxfb_var2my(var, &mt); + mt.crtc = MATROXFB_SRC_CRTC1; /* CRTC1 delays */ switch (var->bits_per_pixel) { case 0: mt.delay = 31 + 0; break; @@ -832,6 +817,16 @@ del_timer_sync(&ACCESS_FBINFO(cursor.timer)); ACCESS_FBINFO(cursor.state) = CM_ERASE; + down_read(&ACCESS_FBINFO(altout).lock); + for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { + if (ACCESS_FBINFO(outputs[out]).src == MATROXFB_SRC_CRTC1 && + ACCESS_FBINFO(outputs[out]).output->compute) { + ACCESS_FBINFO(outputs[out]).output->compute(ACCESS_FBINFO(outputs[out]).data, &mt); + } + } + up_read(&ACCESS_FBINFO(altout).lock); + ACCESS_FBINFO(crtc1).pixclock = mt.pixclock; + ACCESS_FBINFO(crtc1).mnp = mt.mnp; ACCESS_FBINFO(hw_switch->init(PMINFO &mt, display)); if (display->type == FB_TYPE_TEXT) { if (fontheight(display)) @@ -847,40 +842,25 @@ hw->CRTC[0x0C] = (pos & 0xFF00) >> 8; hw->CRTCEXT[0] = (hw->CRTCEXT[0] & 0xF0) | ((pos >> 16) & 0x0F) | ((pos >> 14) & 0x40); hw->CRTCEXT[8] = pos >> 21; - if (ACCESS_FBINFO(output.ph) & (MATROXFB_OUTPUT_CONN_PRIMARY | MATROXFB_OUTPUT_CONN_DFP)) { - if (ACCESS_FBINFO(primout)) - ACCESS_FBINFO(primout)->compute(MINFO, &mt); - } - if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_SECONDARY) { - down_read(&ACCESS_FBINFO(altout.lock)); - if (ACCESS_FBINFO(altout.output)) - ACCESS_FBINFO(altout.output)->compute(ACCESS_FBINFO(altout.device), &mt); - up_read(&ACCESS_FBINFO(altout.lock)); - } + ACCESS_FBINFO(hw_switch->restore(PMINFO display)); - if (ACCESS_FBINFO(output.ph) & (MATROXFB_OUTPUT_CONN_PRIMARY | MATROXFB_OUTPUT_CONN_DFP)) { - if (ACCESS_FBINFO(primout)) - ACCESS_FBINFO(primout)->program(MINFO); - } - if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_SECONDARY) { - down_read(&ACCESS_FBINFO(altout.lock)); - if (ACCESS_FBINFO(altout.output)) - ACCESS_FBINFO(altout.output)->program(ACCESS_FBINFO(altout.device)); - up_read(&ACCESS_FBINFO(altout.lock)); + down_read(&ACCESS_FBINFO(altout).lock); + for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { + if (ACCESS_FBINFO(outputs[out]).src == MATROXFB_SRC_CRTC1 && + ACCESS_FBINFO(outputs[out]).output->program) { + ACCESS_FBINFO(outputs[out]).output->program(ACCESS_FBINFO(outputs[out]).data); + } } ACCESS_FBINFO(cursor.redraw) = 1; - if (ACCESS_FBINFO(output.ph) & (MATROXFB_OUTPUT_CONN_PRIMARY | MATROXFB_OUTPUT_CONN_DFP)) { - if (ACCESS_FBINFO(primout)) - ACCESS_FBINFO(primout)->start(MINFO); - } - if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_SECONDARY) { - down_read(&ACCESS_FBINFO(altout.lock)); - if (ACCESS_FBINFO(altout.output)) - ACCESS_FBINFO(altout.output)->start(ACCESS_FBINFO(altout.device)); - up_read(&ACCESS_FBINFO(altout.lock)); + for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { + if (ACCESS_FBINFO(outputs[out]).src == MATROXFB_SRC_CRTC1 && + ACCESS_FBINFO(outputs[out]).output->start) { + ACCESS_FBINFO(outputs[out]).output->start(ACCESS_FBINFO(outputs[out]).data); + } } + up_read(&ACCESS_FBINFO(altout).lock); matrox_cfbX_init(PMINFO display); - do_install_cmap(PMINFO display); + my_install_cmap(PMINFO2); #if defined(CONFIG_FB_COMPAT_XPMAC) if (console_fb_info == &ACCESS_FBINFO(fbcon)) { int vmode, cmode; @@ -913,7 +893,7 @@ DBG("matrox_getcolreg") -#define minfo ((struct matrox_fb_info*)info) +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) /* * Read a single color register and split it into colors/transparent. * Return != 0 for invalid regno. @@ -933,7 +913,7 @@ static int matroxfb_get_cmap(struct fb_cmap *cmap, int kspc, int con, struct fb_info *info) { -#define minfo ((struct matrox_fb_info*)info) +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) struct display* dsp = (con < 0) ? ACCESS_FBINFO(fbcon.disp) : fb_display + con; @@ -959,7 +939,7 @@ { unsigned int cmap_len; struct display* dsp = (con < 0) ? info->disp : (fb_display + con); -#define minfo ((struct matrox_fb_info*)info) +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) DBG("matroxfb_set_cmap") @@ -976,7 +956,7 @@ return err; } if (con == ACCESS_FBINFO(currcon)) { /* current console? */ - return fb_set_cmap(cmap, kspc, matrox_setcolreg, info); + return fb_set_cmap(cmap, kspc, matroxfb_setcolreg, info); } else fb_copy_cmap(cmap, &dsp->cmap, kspc ? 0 : 1); return 0; @@ -1006,11 +986,16 @@ return 0; } +static struct matrox_altout panellink_output = { + .owner = THIS_MODULE, + .name = "Panellink output", +}; + static int matroxfb_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg, int con, struct fb_info *info) { -#define minfo ((struct matrox_fb_info*)info) +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) DBG("matroxfb_ioctl") if (ACCESS_FBINFO(dead)) { @@ -1033,80 +1018,74 @@ case MATROXFB_SET_OUTPUT_MODE: { struct matroxioc_output_mode mom; + struct matrox_altout *oproc; int val; if (copy_from_user(&mom, (struct matroxioc_output_mode*)arg, sizeof(mom))) return -EFAULT; - if (mom.output >= sizeof(u_int32_t)) - return -EINVAL; - switch (mom.output) { - case MATROXFB_OUTPUT_PRIMARY: - if (mom.mode != MATROXFB_OUTPUT_MODE_MONITOR) - return -EINVAL; - /* mode did not change... */ - return 0; - case MATROXFB_OUTPUT_SECONDARY: + if (mom.output >= MATROXFB_MAX_OUTPUTS) + return -ENXIO; + down_read(&ACCESS_FBINFO(altout.lock)); + oproc = ACCESS_FBINFO(outputs[mom.output]).output; + if (!oproc) { + val = -ENXIO; + } else if (!oproc->verifymode) { + if (mom.mode == MATROXFB_OUTPUT_MODE_MONITOR) { + val = 0; + } else { val = -EINVAL; - down_read(&ACCESS_FBINFO(altout.lock)); - if (ACCESS_FBINFO(altout.output) && ACCESS_FBINFO(altout.device)) - val = ACCESS_FBINFO(altout.output)->setmode(ACCESS_FBINFO(altout.device), mom.mode); - up_read(&ACCESS_FBINFO(altout.lock)); - if (val != 1) - return val; - if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_SECONDARY) - matroxfb_switch(ACCESS_FBINFO(currcon), info); - if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_SECONDARY) { + } + } else { + val = oproc->verifymode(ACCESS_FBINFO(outputs[mom.output]).data, mom.mode); + } + if (!val) { + if (ACCESS_FBINFO(outputs[mom.output]).mode != mom.mode) { + ACCESS_FBINFO(outputs[mom.output]).mode = mom.mode; + val = 1; + } + } + up_read(&ACCESS_FBINFO(altout.lock)); + if (val != 1) + return val; + switch (ACCESS_FBINFO(outputs[mom.output]).src) { + case MATROXFB_SRC_CRTC1: + matroxfb_switch(ACCESS_FBINFO(currcon), info); + break; + case MATROXFB_SRC_CRTC2: + { struct matroxfb_dh_fb_info* crtc2; down_read(&ACCESS_FBINFO(crtc2.lock)); - crtc2 = (struct matroxfb_dh_fb_info*)(ACCESS_FBINFO(crtc2.info)); + crtc2 = ACCESS_FBINFO(crtc2.info); if (crtc2) crtc2->fbcon.switch_con(crtc2->currcon, &crtc2->fbcon); up_read(&ACCESS_FBINFO(crtc2.lock)); } - return 0; - case MATROXFB_OUTPUT_DFP: - if (!(ACCESS_FBINFO(output.all) & MATROXFB_OUTPUT_CONN_DFP)) - return -ENXIO; - if (mom.mode!= MATROXFB_OUTPUT_MODE_MONITOR) - return -EINVAL; - /* mode did not change... */ - return 0; - default: - return -EINVAL; + break; } return 0; } case MATROXFB_GET_OUTPUT_MODE: { struct matroxioc_output_mode mom; + struct matrox_altout *oproc; int val; if (copy_from_user(&mom, (struct matroxioc_output_mode*)arg, sizeof(mom))) return -EFAULT; - if (mom.output >= sizeof(u_int32_t)) - return -EINVAL; - switch (mom.output) { - case MATROXFB_OUTPUT_PRIMARY: - mom.mode = MATROXFB_OUTPUT_MODE_MONITOR; - break; - case MATROXFB_OUTPUT_SECONDARY: - val = -EINVAL; - down_read(&ACCESS_FBINFO(altout.lock)); - if (ACCESS_FBINFO(altout.output) && ACCESS_FBINFO(altout.device)) - val = ACCESS_FBINFO(altout.output)->getmode(ACCESS_FBINFO(altout.device), &mom.mode); - up_read(&ACCESS_FBINFO(altout.lock)); - if (val) - return val; - break; - case MATROXFB_OUTPUT_DFP: - if (!(ACCESS_FBINFO(output.all) & MATROXFB_OUTPUT_CONN_DFP)) - return -ENXIO; - mom.mode = MATROXFB_OUTPUT_MODE_MONITOR; - break; - default: - return -EINVAL; + if (mom.output >= MATROXFB_MAX_OUTPUTS) + return -ENXIO; + down_read(&ACCESS_FBINFO(altout.lock)); + oproc = ACCESS_FBINFO(outputs[mom.output]).output; + if (!oproc) { + val = -ENXIO; + } else { + mom.mode = ACCESS_FBINFO(outputs[mom.output]).mode; + val = 0; } + up_read(&ACCESS_FBINFO(altout.lock)); + if (val) + return val; if (copy_to_user((struct matroxioc_output_mode*)arg, &mom, sizeof(mom))) return -EFAULT; return 0; @@ -1114,55 +1093,248 @@ case MATROXFB_SET_OUTPUT_CONNECTION: { u_int32_t tmp; + int i; + int changes; if (copy_from_user(&tmp, (u_int32_t*)arg, sizeof(tmp))) return -EFAULT; - if (tmp & ~ACCESS_FBINFO(output.all)) - return -EINVAL; - if (tmp & ACCESS_FBINFO(output.sh)) - return -EINVAL; - if (tmp & MATROXFB_OUTPUT_CONN_DFP) { - if (tmp & MATROXFB_OUTPUT_CONN_SECONDARY) - return -EINVAL; - if (ACCESS_FBINFO(output.sh)) - return -EINVAL; + for (i = 0; i < 32; i++) { + if (tmp & (1 << i)) { + if (i >= MATROXFB_MAX_OUTPUTS) + return -ENXIO; + if (!ACCESS_FBINFO(outputs[i]).output) + return -ENXIO; + switch (ACCESS_FBINFO(outputs[i]).src) { + case MATROXFB_SRC_NONE: + case MATROXFB_SRC_CRTC1: + break; + default: + return -EBUSY; + } + } } - if (tmp == ACCESS_FBINFO(output.ph)) + if (ACCESS_FBINFO(devflags.panellink)) { + if (tmp & MATROXFB_OUTPUT_CONN_DFP) { + if (tmp & MATROXFB_OUTPUT_CONN_SECONDARY) + return -EINVAL; + for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { + if (ACCESS_FBINFO(outputs[i]).src == MATROXFB_SRC_CRTC2) { + return -EBUSY; + } + } + } + } + changes = 0; + for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { + if (tmp & (1 << i)) { + if (ACCESS_FBINFO(outputs[i]).src != MATROXFB_SRC_CRTC1) { + changes = 1; + ACCESS_FBINFO(outputs[i]).src = MATROXFB_SRC_CRTC1; + } + } else if (ACCESS_FBINFO(outputs[i]).src == MATROXFB_SRC_CRTC1) { + changes = 1; + ACCESS_FBINFO(outputs[i]).src = MATROXFB_SRC_NONE; + } + } + if (!changes) return 0; - ACCESS_FBINFO(output.ph) = tmp; matroxfb_switch(ACCESS_FBINFO(currcon), info); return 0; } case MATROXFB_GET_OUTPUT_CONNECTION: { - if (put_user(ACCESS_FBINFO(output.ph), (u_int32_t*)arg)) + u_int32_t conn = 0; + int i; + + for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { + if (ACCESS_FBINFO(outputs[i]).src == MATROXFB_SRC_CRTC1) { + conn |= 1 << i; + } + } + if (put_user(conn, (u_int32_t*)arg)) return -EFAULT; return 0; } case MATROXFB_GET_AVAILABLE_OUTPUTS: { - u_int32_t tmp; + u_int32_t conn = 0; + int i; - tmp = ACCESS_FBINFO(output.all) & ~ACCESS_FBINFO(output.sh); - if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_DFP) - tmp &= ~MATROXFB_OUTPUT_CONN_SECONDARY; - if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_SECONDARY) - tmp &= ~MATROXFB_OUTPUT_CONN_DFP; - if (put_user(tmp, (u_int32_t*)arg)) + for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { + if (ACCESS_FBINFO(outputs[i]).output) { + switch (ACCESS_FBINFO(outputs[i]).src) { + case MATROXFB_SRC_NONE: + case MATROXFB_SRC_CRTC1: + conn |= 1 << i; + break; + } + } + } + if (ACCESS_FBINFO(devflags.panellink)) { + if (conn & MATROXFB_OUTPUT_CONN_DFP) + conn &= ~MATROXFB_OUTPUT_CONN_SECONDARY; + if (conn & MATROXFB_OUTPUT_CONN_SECONDARY) + conn &= ~MATROXFB_OUTPUT_CONN_DFP; + } + if (put_user(conn, (u_int32_t*)arg)) return -EFAULT; return 0; } case MATROXFB_GET_ALL_OUTPUTS: { - if (put_user(ACCESS_FBINFO(output.all), (u_int32_t*)arg)) + u_int32_t conn = 0; + int i; + + for (i = 0; i < MATROXFB_MAX_OUTPUTS; i++) { + if (ACCESS_FBINFO(outputs[i]).output) { + conn |= 1 << i; + } + } + if (put_user(conn, (u_int32_t*)arg)) + return -EFAULT; + return 0; + } + case 0x80585600: + { + struct { + char name[32]; + int type; + int inputs; + int outputs; + int audios; + int maxwidth; + int maxheight; + int minwidth; + int minheight; + int maxframerate; + __u32 flags; + __u32 reserved[4]; + } r; + + memset(&r, 0, sizeof(r)); + strcat(r.name, "Matrox TVO"); + r.type = 2; // output + r.inputs = 0; + r.outputs = 1; + r.audios = 0; + r.maxwidth = 1023; // max visible width + r.maxheight = 625; // max picture height: full PAL + r.minwidth = 512; // min visible width... ~480 + r.minheight = 480; // min picture height: visible portion of NTSC + r.maxframerate = 60; // max: NTSC, 60Hz interlaced + r.flags = 0; // nothing is supported... + if (copy_to_user((void*)arg, &r, sizeof(r))) return -EFAULT; return 0; + + } + case MATROXFB_TVOQUERYCTRL: + { + struct matroxfb_queryctrl qctrl; + int err; + + if (copy_from_user(&qctrl, (struct matroxfb_queryctrl*)arg, sizeof(qctrl))) + return -EFAULT; + + down_read(&ACCESS_FBINFO(altout).lock); + if (!ACCESS_FBINFO(outputs[1]).output) { + err = -ENXIO; + } else if (ACCESS_FBINFO(outputs[1]).output->getqueryctrl) { + err = ACCESS_FBINFO(outputs[1]).output->getqueryctrl(ACCESS_FBINFO(outputs[1]).data, &qctrl); + } else { + err = -EINVAL; + } + up_read(&ACCESS_FBINFO(altout).lock); + if (err >= 0 && + copy_to_user((struct matroxfb_queryctrl*)arg, &qctrl, sizeof(qctrl))) + return -EFAULT; + return err; + } + case MATROXFB_G_TVOCTRL: + { + struct matroxfb_control ctrl; + int err; + + if (copy_from_user(&ctrl, (struct matroxfb_control*)arg, sizeof(ctrl))) + return -EFAULT; + + down_read(&ACCESS_FBINFO(altout).lock); + if (!ACCESS_FBINFO(outputs[1]).output) { + err = -ENXIO; + } else if (ACCESS_FBINFO(outputs[1]).output->getctrl) { + err = ACCESS_FBINFO(outputs[1]).output->getctrl(ACCESS_FBINFO(outputs[1]).data, &ctrl); + } else { + err = -EINVAL; + } + up_read(&ACCESS_FBINFO(altout).lock); + if (err >= 0 && + copy_to_user((struct matroxfb_control*)arg, &ctrl, sizeof(ctrl))) + return -EFAULT; + return err; + } + case MATROXFB_S_TVOCTRL: + { + struct matroxfb_control ctrl; + int err; + + if (copy_from_user(&ctrl, (struct matroxfb_control*)arg, sizeof(ctrl))) + return -EFAULT; + + down_read(&ACCESS_FBINFO(altout).lock); + if (!ACCESS_FBINFO(outputs[1]).output) { + err = -ENXIO; + } else if (ACCESS_FBINFO(outputs[1]).output->setctrl) { + err = ACCESS_FBINFO(outputs[1]).output->setctrl(ACCESS_FBINFO(outputs[1]).data, &ctrl); + } else { + err = -EINVAL; + } + up_read(&ACCESS_FBINFO(altout).lock); + return err; } } - return -EINVAL; + return -ENOTTY; #undef minfo } +/* 0 unblank, 1 blank, 2 no vsync, 3 no hsync, 4 off */ + +static int matroxfb_blank(int blank, struct fb_info *info) +{ +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) + int seq; + int crtc; + CRITFLAGS + + DBG("matroxfb_blank") + + if (ACCESS_FBINFO(dead)) + return 1; + + switch (blank) { + case 1: seq = 0x20; crtc = 0x00; break; /* works ??? */ + case 2: seq = 0x20; crtc = 0x10; break; + case 3: seq = 0x20; crtc = 0x20; break; + case 4: seq = 0x20; crtc = 0x30; break; + default: seq = 0x00; crtc = 0x00; break; + } + + CRITBEGIN + + mga_outb(M_SEQ_INDEX, 1); + mga_outb(M_SEQ_DATA, (mga_inb(M_SEQ_DATA) & ~0x20) | seq); + mga_outb(M_EXTVGA_INDEX, 1); + mga_outb(M_EXTVGA_DATA, (mga_inb(M_EXTVGA_DATA) & ~0x30) | crtc); + + CRITEND + return 0; +#undef minfo +} + +static void matroxfb_blank24(int blank, struct fb_info *info) +{ + matroxfb_blank(blank, info); +} + static struct fb_ops matroxfb_ops = { owner: THIS_MODULE, fb_open: matroxfb_open, @@ -1178,7 +1350,7 @@ int matroxfb_switch(int con, struct fb_info *info) { -#define minfo ((struct matrox_fb_info*)info) +#define minfo (list_entry(info, struct matrox_fb_info, fbcon)) struct fb_cmap* cmap; struct display *p; @@ -1226,40 +1398,6 @@ #undef minfo } -/* 0 unblank, 1 blank, 2 no vsync, 3 no hsync, 4 off */ - -static void matroxfb_blank(int blank, struct fb_info *info) -{ -#define minfo ((struct matrox_fb_info*)info) - int seq; - int crtc; - CRITFLAGS - - DBG("matroxfb_blank") - - if (ACCESS_FBINFO(dead)) - return; - - switch (blank) { - case 1: seq = 0x20; crtc = 0x00; break; /* works ??? */ - case 2: seq = 0x20; crtc = 0x10; break; - case 3: seq = 0x20; crtc = 0x20; break; - case 4: seq = 0x20; crtc = 0x30; break; - default: seq = 0x00; crtc = 0x00; break; - } - - CRITBEGIN - - mga_outb(M_SEQ_INDEX, 1); - mga_outb(M_SEQ_DATA, (mga_inb(M_SEQ_DATA) & ~0x20) | seq); - mga_outb(M_EXTVGA_INDEX, 1); - mga_outb(M_EXTVGA_DATA, (mga_inb(M_EXTVGA_DATA) & ~0x30) | crtc); - - CRITEND - -#undef minfo -} - #define RSDepth(X) (((X) >> 8) & 0x0F) #define RS8bpp 0x1 #define RS15bpp 0x2 @@ -1407,10 +1545,10 @@ #define DEVF_VIDEO64BIT 0x0001 #define DEVF_SWAPS 0x0002 #define DEVF_SRCORG 0x0004 -#define DEVF_BOTHDACS 0x0008 /* put CRTC1 on both outputs by default */ +#define DEVF_DUALHEAD 0x0008 #define DEVF_CROSS4MB 0x0010 #define DEVF_TEXT4B 0x0020 -#define DEVF_DDC_8_2 0x0040 +/* #define DEVF_recycled 0x0040 */ /* #define DEVF_recycled 0x0080 */ #define DEVF_SUPPORT32MB 0x0100 #define DEVF_ANY_VXRES 0x0200 @@ -1420,14 +1558,14 @@ #define DEVF_PANELLINK_CAPABLE 0x2000 #define DEVF_G450DAC 0x4000 -#define DEVF_GCORE (DEVF_VIDEO64BIT | DEVF_SWAPS | DEVF_CROSS4MB | DEVF_DDC_8_2) -#define DEVF_G2CORE (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_MAVEN_CAPABLE | DEVF_PANELLINK_CAPABLE | DEVF_SRCORG) +#define DEVF_GCORE (DEVF_VIDEO64BIT | DEVF_SWAPS | DEVF_CROSS4MB) +#define DEVF_G2CORE (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_MAVEN_CAPABLE | DEVF_PANELLINK_CAPABLE | DEVF_SRCORG | DEVF_DUALHEAD) #define DEVF_G100 (DEVF_GCORE) /* no doc, no vxres... */ #define DEVF_G200 (DEVF_G2CORE) #define DEVF_G400 (DEVF_G2CORE | DEVF_SUPPORT32MB | DEVF_TEXT16B | DEVF_CRTC2) /* if you'll find how to drive DFP... */ -#define DEVF_G450 (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_SUPPORT32MB | DEVF_TEXT16B | DEVF_CRTC2 | DEVF_G450DAC | DEVF_SRCORG) -#define DEVF_G550 (DEVF_G450 | DEVF_BOTHDACS) +#define DEVF_G450 (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_SUPPORT32MB | DEVF_TEXT16B | DEVF_CRTC2 | DEVF_G450DAC | DEVF_SRCORG | DEVF_DUALHEAD) +#define DEVF_G550 (DEVF_G450) static struct board { unsigned short vendor, device, rev, svid, sid; @@ -1621,27 +1759,24 @@ ACCESS_FBINFO(devflags.text_type_aux) = FB_AUX_TEXT_MGA_STEP8; } #ifdef CONFIG_FB_MATROX_32MB - ACCESS_FBINFO(devflags.support32MB) = b->flags & DEVF_SUPPORT32MB; + ACCESS_FBINFO(devflags.support32MB) = (b->flags & DEVF_SUPPORT32MB) != 0; #endif ACCESS_FBINFO(devflags.precise_width) = !(b->flags & DEVF_ANY_VXRES); - ACCESS_FBINFO(devflags.crtc2) = b->flags & DEVF_CRTC2; - ACCESS_FBINFO(devflags.maven_capable) = b->flags & DEVF_MAVEN_CAPABLE; + ACCESS_FBINFO(devflags.crtc2) = (b->flags & DEVF_CRTC2) != 0; + ACCESS_FBINFO(devflags.maven_capable) = (b->flags & DEVF_MAVEN_CAPABLE) != 0; + ACCESS_FBINFO(devflags.dualhead) = (b->flags & DEVF_DUALHEAD) != 0; if (b->flags & DEVF_PANELLINK_CAPABLE) { - ACCESS_FBINFO(output.all) |= MATROXFB_OUTPUT_CONN_DFP; + ACCESS_FBINFO(outputs[2]).data = MINFO; + ACCESS_FBINFO(outputs[2]).output = &panellink_output; if (dfp) - ACCESS_FBINFO(output.ph) |= MATROXFB_OUTPUT_CONN_DFP; - } - if (b->flags & DEVF_BOTHDACS) { -#ifdef CONFIG_FB_MATROX_G450 - ACCESS_FBINFO(output.all) |= MATROXFB_OUTPUT_CONN_SECONDARY; - ACCESS_FBINFO(output.ph) |= MATROXFB_OUTPUT_CONN_SECONDARY; -#else - printk(KERN_INFO "Only digital output of G550 is now working (in analog mode). Enable G450 support in\n"); - printk(KERN_INFO "kernel configuration if you have analog monitor connected to G550 analog output.\n"); -#endif + ACCESS_FBINFO(outputs[2]).src = MATROXFB_SRC_CRTC1; + else + ACCESS_FBINFO(outputs[2]).src = MATROXFB_SRC_NONE; + ACCESS_FBINFO(outputs[2]).mode = MATROXFB_OUTPUT_MODE_MONITOR; + ACCESS_FBINFO(devflags.panellink) = 1; } ACCESS_FBINFO(devflags.dfp_type) = dfp_type; - ACCESS_FBINFO(devflags.g450dac) = b->flags & DEVF_G450DAC; + ACCESS_FBINFO(devflags.g450dac) = (b->flags & DEVF_G450DAC) != 0; ACCESS_FBINFO(devflags.textstep) = ACCESS_FBINFO(devflags.vgastep) * ACCESS_FBINFO(devflags.textmode); ACCESS_FBINFO(devflags.textvram) = 65536 / ACCESS_FBINFO(devflags.textmode); @@ -1747,6 +1882,7 @@ if (!ACCESS_FBINFO(devflags.novga)) request_region(0x3C0, 32, "matrox"); + matroxfb_g450_connect(PMINFO2); ACCESS_FBINFO(hw_switch->reset(PMINFO2)); ACCESS_FBINFO(fbcon.monspecs.hfmin) = 0; @@ -1775,7 +1911,7 @@ ACCESS_FBINFO(fbcon.disp) = d; ACCESS_FBINFO(fbcon.switch_con) = &matroxfb_switch; ACCESS_FBINFO(fbcon.updatevar) = &matroxfb_updatevar; - ACCESS_FBINFO(fbcon.blank) = &matroxfb_blank; + ACCESS_FBINFO(fbcon.blank) = &matroxfb_blank24; /* after __init time we are like module... no logo */ ACCESS_FBINFO(fbcon.flags) = hotplug ? FBINFO_FLAG_MODULE : FBINFO_FLAG_DEFAULT; ACCESS_FBINFO(video.len_usable) &= PAGE_MASK; @@ -1907,6 +2043,7 @@ } return 0; failVideoIO:; + matroxfb_g450_shutdown(PMINFO2); mga_iounmap(ACCESS_FBINFO(video.vbase)); failCtrlIO:; mga_iounmap(ACCESS_FBINFO(mmio.vbase)); @@ -2094,10 +2231,6 @@ init_rwsem(&ACCESS_FBINFO(crtc2.lock)); init_rwsem(&ACCESS_FBINFO(altout.lock)); - ACCESS_FBINFO(output.all) = MATROXFB_OUTPUT_CONN_PRIMARY; - ACCESS_FBINFO(output.ph) = MATROXFB_OUTPUT_CONN_PRIMARY; - ACCESS_FBINFO(output.sh) = 0; - err = initMatrox2(PMINFO d, b); if (!err) { #ifndef CONFIG_FB_MATROX_MULTIHEAD @@ -2511,8 +2644,8 @@ /* *************************** init module code **************************** */ -MODULE_AUTHOR("(c) 1998-2001 Petr Vandrovec "); -MODULE_DESCRIPTION("Accelerated FBDev driver for Matrox Millennium/Mystique/G100/G200/G400/G450"); +MODULE_AUTHOR("(c) 1998-2002 Petr Vandrovec "); +MODULE_DESCRIPTION("Accelerated FBDev driver for Matrox Millennium/Mystique/G100/G200/G400/G450/G550"); MODULE_LICENSE("GPL"); MODULE_PARM(mem, "i"); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_base.h linux.20pre5-ac2/drivers/video/matrox/matroxfb_base.h --- linux.20pre5/drivers/video/matrox/matroxfb_base.h 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_base.h 2002-09-02 14:57:05.000000000 +0100 @@ -291,6 +291,8 @@ struct my_timming { unsigned int pixclock; + int mnp; + unsigned int crtc; unsigned int HDisplay; unsigned int HSyncStart; unsigned int HSyncEnd; @@ -367,6 +369,10 @@ u_int16_t hcorr; }; +struct matrox_crtc2 { + u_int32_t ctl, hparam, hsync, vparam, vsync, preload, datactl; +}; + struct matrox_hw_state { u_int32_t MXoptionReg; unsigned char DACclk[6]; @@ -384,10 +390,7 @@ /* TVOut only */ struct mavenregs maven; - /* CRTC2 only */ - /* u_int32_t TBD */ - - unsigned int vidclk; + struct matrox_crtc2 crtc2; }; struct matrox_accel_data { @@ -398,16 +401,28 @@ u_int32_t m_opmode; }; +struct matroxfb_queryctrl; +struct matroxfb_control; + struct matrox_altout { + struct module *owner; + const char *name; int (*compute)(void* altout_dev, struct my_timming* input); int (*program)(void* altout_dev); int (*start)(void* altout_dev); - void (*incuse)(void* altout_dev); - void (*decuse)(void* altout_dev); - int (*setmode)(void* altout_dev, u_int32_t mode); - int (*getmode)(void* altout_dev, u_int32_t* mode); + int (*verifymode)(void* altout_dev, u_int32_t mode); + int (*getqueryctrl)(void* altout_dev, + struct matroxfb_queryctrl* ctrl); + int (*getctrl)(void* altout_dev, + struct matroxfb_control* ctrl); + int (*setctrl)(void* altout_dev, + struct matroxfb_control* ctrl); }; +#define MATROXFB_SRC_NONE 0 +#define MATROXFB_SRC_CRTC1 1 +#define MATROXFB_SRC_CRTC2 2 + enum mga_chip { MGA_2064, MGA_2164, MGA_1064, MGA_1164, MGA_G100, MGA_G200, MGA_G400, MGA_G450, MGA_G550 }; struct matrox_bios { @@ -424,9 +439,9 @@ struct matrox_switch; struct matroxfb_driver; +struct matroxfb_dh_fb_info; struct matrox_fb_info { - /* fb_info must be first */ struct fb_info fbcon; struct list_head next_fb; @@ -442,21 +457,19 @@ struct pci_dev* pcidev; struct { - u_int32_t all; - u_int32_t ph; - u_int32_t sh; - } output; - struct matrox_altout* primout; - struct { - struct fb_info* info; struct rw_semaphore lock; - } crtc2; struct { - struct matrox_altout* output; - void* device; - struct rw_semaphore lock; + int brightness, contrast, saturation, hue, gamma; + int testout, deflicker; + } tvo_params; } altout; - +#define MATROXFB_MAX_OUTPUTS 3 + struct { + unsigned int src; + struct matrox_altout* output; + void* data; + unsigned int mode; + } outputs[MATROXFB_MAX_OUTPUTS]; #define MATROXFB_MAX_FB_DRIVERS 5 struct matroxfb_driver* (drivers[MATROXFB_MAX_FB_DRIVERS]); void* (drivers_data[MATROXFB_MAX_FB_DRIVERS]); @@ -545,6 +558,8 @@ int memtype; int g450dac; int dfp_type; + int panellink; /* G400 DFP possible (not G450/G550) */ + int dualhead; unsigned int fbResource; } devflags; struct display_switch dispsw; @@ -561,6 +576,16 @@ } cursor; struct matrox_bios bios; struct { + unsigned int pixclock; + int mnp; + } crtc1; + struct { + unsigned int pixclock; + int mnp; + struct matroxfb_dh_fb_info* info; + struct rw_semaphore lock; + } crtc2; + struct { struct matrox_pll_limits pixel; struct matrox_pll_limits system; struct matrox_pll_limits video; @@ -625,7 +650,7 @@ #define PMINFO PMINFO2 , static inline struct matrox_fb_info* mxinfo(const struct display* p) { - return (struct matrox_fb_info*)p->fb_info; + return list_entry(p->fb_info, struct matrox_fb_info, fbcon); } #define PMXINFO(p) mxinfo(p), diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_crtc2.c linux.20pre5-ac2/drivers/video/matrox/matroxfb_crtc2.c --- linux.20pre5/drivers/video/matrox/matroxfb_crtc2.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_crtc2.c 2002-09-02 00:06:57.000000000 +0100 @@ -2,11 +2,11 @@ * * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450. * - * (c) 1998-2001 Petr Vandrovec + * (c) 1998-2002 Petr Vandrovec * * Portions Copyright (c) 2001 Matrox Graphics Inc. * - * Version: 1.62 2001/11/29 + * Version: 1.64 2002/06/10 * */ @@ -28,8 +28,8 @@ static int matroxfb_dh_getcolreg(unsigned regno, unsigned *red, unsigned *green, unsigned *blue, unsigned *transp, struct fb_info* info) { -#define m2info ((struct matroxfb_dh_fb_info*)info) - if (regno > 16) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) + if (regno >= 16) return 1; *red = m2info->palette[regno].red; *blue = m2info->palette[regno].blue; @@ -41,10 +41,10 @@ static int matroxfb_dh_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, unsigned transp, struct fb_info* info) { -#define m2info ((struct matroxfb_dh_fb_info*)info) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) struct display* p; - if (regno > 16) + if (regno >= 16) return 1; m2info->palette[regno].red = red; m2info->palette[regno].blue = blue; @@ -84,86 +84,129 @@ #undef m2info } -static void do_install_cmap(struct matroxfb_dh_fb_info* m2info, struct display* p) { - if (p->cmap.len) - fb_set_cmap(&p->cmap, 1, matroxfb_dh_setcolreg, &m2info->fbcon); +static inline void my_install_cmap(struct matroxfb_dh_fb_info* m2info) +{ + /* Do not touch this code if you do not understand what it does! */ + /* Never try to use do_install_cmap() instead. It is crap. */ + struct fb_cmap* cmap = &m2info->currcon_display->cmap; + + if (cmap->len) + fb_set_cmap(cmap, 1, matroxfb_dh_setcolreg, &m2info->fbcon); else fb_set_cmap(fb_default_cmap(16), 1, matroxfb_dh_setcolreg, &m2info->fbcon); } + static void matroxfb_dh_restore(struct matroxfb_dh_fb_info* m2info, struct my_timming* mt, struct display* p, int mode, unsigned int pos) { - u_int32_t tmp; + struct matrox_crtc2 c2; MINFO_FROM(m2info->primary_dev); switch (mode) { case 15: - tmp = 0x00200000; + c2.ctl = 0x00200000; break; case 16: - tmp = 0x00400000; + c2.ctl = 0x00400000; break; /* case 32: */ default: - tmp = 0x00800000; + c2.ctl = 0x00800000; break; } - - if (ACCESS_FBINFO(output.sh)) { - tmp |= 0x00000001; /* enable CRTC2 */ - - if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_SECONDARY) { - if (ACCESS_FBINFO(devflags.g450dac)) { - tmp |= 0x00000006; /* source from secondary pixel PLL */ - /* no vidrst */ - } else { - tmp |= 0x00000002; /* source from VDOCLK */ - tmp |= 0xC0000000; /* enable vvidrst & hvidrst */ - /* MGA TVO is our clock source */ + c2.ctl |= 0x00000001; /* enable CRTC2 */ + c2.datactl = 0; + if (ACCESS_FBINFO(outputs[1]).src == MATROXFB_SRC_CRTC2) { + if (ACCESS_FBINFO(devflags.g450dac)) { + c2.ctl |= 0x00000006; /* source from secondary pixel PLL */ + /* no vidrst when in monitor mode */ + if (ACCESS_FBINFO(outputs[1]).mode != MATROXFB_OUTPUT_MODE_MONITOR) { + c2.ctl |= 0xC0001000; /* Enable H/V vidrst */ } - } else if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_PRIMARY) { - tmp |= 0x00000004; /* source from pixclock */ - /* PIXPLL is our clock source */ - } - - if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_PRIMARY) - tmp |= 0x00100000; /* connect CRTC2 to DAC */ + } else { + c2.ctl |= 0x00000002; /* source from VDOCLK */ + c2.ctl |= 0xC0000000; /* enable vvidrst & hvidrst */ + /* MGA TVO is our clock source */ + } + } else if (ACCESS_FBINFO(outputs[0]).src == MATROXFB_SRC_CRTC2) { + c2.ctl |= 0x00000004; /* source from pixclock */ + /* PIXPLL is our clock source */ + } + if (ACCESS_FBINFO(outputs[0]).src == MATROXFB_SRC_CRTC2) { + c2.ctl |= 0x00100000; /* connect CRTC2 to DAC */ } if (mt->interlaced) { - tmp |= 0x02000000; /* interlaced, second field is bigger, as G450 apparently ignores it */ + c2.ctl |= 0x02000000; /* interlaced, second field is bigger, as G450 apparently ignores it */ mt->VDisplay >>= 1; mt->VSyncStart >>= 1; mt->VSyncEnd >>= 1; mt->VTotal >>= 1; } - mga_outl(0x3C10, tmp | 0x10000000); /* depth and so on... 0x10000000 is VIDRST polarity */ - mga_outl(0x3C14, ((mt->HDisplay - 8) << 16) | (mt->HTotal - 8)); - mga_outl(0x3C18, ((mt->HSyncEnd - 8) << 16) | (mt->HSyncStart - 8)); - mga_outl(0x3C1C, ((mt->VDisplay - 1) << 16) | (mt->VTotal - 1)); - mga_outl(0x3C20, ((mt->VSyncEnd - 1) << 16) | (mt->VSyncStart - 1)); - mga_outl(0x3C24, ((mt->VSyncStart) << 16) | (mt->HSyncStart)); /* preload */ + if ((mt->HTotal & 7) == 2) { + c2.datactl |= 0x00000010; + mt->HTotal &= ~7; + } + c2.ctl |= 0x10000000; /* 0x10000000 is VIDRST polarity */ + c2.hparam = ((mt->HDisplay - 8) << 16) | (mt->HTotal - 8); + c2.hsync = ((mt->HSyncEnd - 8) << 16) | (mt->HSyncStart - 8); + c2.vparam = ((mt->VDisplay - 1) << 16) | (mt->VTotal - 1); + c2.vsync = ((mt->VSyncEnd - 1) << 16) | (mt->VSyncStart - 1); + c2.preload = ((mt->VSyncStart) << 16) | (mt->HSyncStart); + mga_outl(0x3C14, c2.hparam); + mga_outl(0x3C18, c2.hsync); + mga_outl(0x3C1C, c2.vparam); + mga_outl(0x3C20, c2.vsync); + mga_outl(0x3C24, c2.preload); { u_int32_t linelen = p->var.xres_virtual * (p->var.bits_per_pixel >> 3); - if (mt->interlaced) { + if (c2.ctl & 0x02000000) { /* field #0 is smaller, so... */ mga_outl(0x3C2C, pos); /* field #1 vmemory start */ mga_outl(0x3C28, pos + linelen); /* field #0 vmemory start */ linelen <<= 1; + m2info->interlaced = 1; } else { mga_outl(0x3C28, pos); /* vmemory start */ + m2info->interlaced = 0; } mga_outl(0x3C40, linelen); } - tmp = 0x0FFF0000; /* line compare */ - if (mt->sync & FB_SYNC_HOR_HIGH_ACT) - tmp |= 0x00000100; - if (mt->sync & FB_SYNC_VERT_HIGH_ACT) - tmp |= 0x00000200; - mga_outl(0x3C44, tmp); - mga_outl(0x3C4C, 0); /* data control */ + mga_outl(0x3C4C, c2.datactl); /* data control */ + if (c2.ctl & 0x02000000) { + int i; + + mga_outl(0x3C10, c2.ctl & ~0x02000000); + for (i = 0; i < 2; i++) { + unsigned int nl; + unsigned int lastl = 0; + + while ((nl = mga_inl(0x3C48) & 0xFFF) >= lastl) { + lastl = nl; + } + } + } + mga_outl(0x3C10, c2.ctl); + ACCESS_FBINFO(hw).crtc2.ctl = c2.ctl; + { + u_int32_t tmp; + + tmp = 0x0FFF0000; /* line compare */ + if (mt->sync & FB_SYNC_HOR_HIGH_ACT) + tmp |= 0x00000100; + if (mt->sync & FB_SYNC_VERT_HIGH_ACT) + tmp |= 0x00000200; + mga_outl(0x3C44, tmp); + } +} + +static void matroxfb_dh_disable(struct matroxfb_dh_fb_info* m2info) { + MINFO_FROM(m2info->primary_dev); + + mga_outl(0x3C10, 0x00000004); /* disable CRTC2, CRTC1->DAC1, PLL as clock source */ + ACCESS_FBINFO(hw).crtc2.ctl = 0x00000004; } static void matroxfb_dh_cfbX_init(struct matroxfb_dh_fb_info* m2info, @@ -176,19 +219,18 @@ unsigned int pos; unsigned int linelen; unsigned int pixelsize; + MINFO_FROM(m2info->primary_dev); -#define minfo (m2info->primary_dev) pixelsize = var->bits_per_pixel >> 3; linelen = var->xres_virtual * pixelsize; pos = var->yoffset * linelen + var->xoffset * pixelsize; pos += m2info->video.offbase; - if (var->vmode & FB_VMODE_INTERLACED) { + if (m2info->interlaced) { mga_outl(0x3C2C, pos); mga_outl(0x3C28, pos + linelen); } else { mga_outl(0x3C28, pos); } -#undef minfo } static int matroxfb_dh_decode_var(struct matroxfb_dh_fb_info* m2info, @@ -292,7 +334,7 @@ } static int matroxfb_dh_open(struct fb_info* info, int user) { -#define m2info ((struct matroxfb_dh_fb_info*)info) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) MINFO_FROM(m2info->primary_dev); if (MINFO) { @@ -305,7 +347,7 @@ } static int matroxfb_dh_release(struct fb_info* info, int user) { -#define m2info ((struct matroxfb_dh_fb_info*)info) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) MINFO_FROM(m2info->primary_dev); if (MINFO) { @@ -316,7 +358,7 @@ static int matroxfb_dh_get_fix(struct fb_fix_screeninfo* fix, int con, struct fb_info* info) { -#define m2info ((struct matroxfb_dh_fb_info*)info) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) struct display* p; if (con >= 0) @@ -345,7 +387,7 @@ static int matroxfb_dh_get_var(struct fb_var_screeninfo* var, int con, struct fb_info* info) { -#define m2info ((struct matroxfb_dh_fb_info*)info) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) if (con < 0) *var = m2info->fbcon.disp->var; else @@ -356,7 +398,7 @@ static int matroxfb_dh_set_var(struct fb_var_screeninfo* var, int con, struct fb_info* info) { -#define m2info ((struct matroxfb_dh_fb_info*)info) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) struct display* p; int chgvar; int visual; @@ -390,7 +432,7 @@ chgvar = 0; p->var = *var; /* cmap */ - p->screen_base = vaddr_va(m2info->video.vbase); + p->screen_base = m2info->fbcon.screen_base = vaddr_va(m2info->video.vbase); p->visual = visual; p->ypanstep = 1; p->ywrapstep = 0; @@ -405,48 +447,52 @@ if (con == m2info->currcon) { struct my_timming mt; unsigned int pos; + int out; + int cnt; matroxfb_var2my(var, &mt); + mt.crtc = MATROXFB_SRC_CRTC2; /* CRTC2 delay */ mt.delay = 34; pos = (var->yoffset * var->xres_virtual + var->xoffset) * var->bits_per_pixel >> 3; pos += m2info->video.offbase; - DAC1064_global_init(PMINFO2); - if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_PRIMARY) { - if (ACCESS_FBINFO(primout)) - ACCESS_FBINFO(primout)->compute(MINFO, &mt); + cnt = 0; + down_read(&ACCESS_FBINFO(altout).lock); + for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { + if (ACCESS_FBINFO(outputs[out]).src == MATROXFB_SRC_CRTC2) { + cnt++; + if (ACCESS_FBINFO(outputs[out]).output->compute) { + ACCESS_FBINFO(outputs[out]).output->compute(ACCESS_FBINFO(outputs[out]).data, &mt); + } + } } - if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_SECONDARY) { - down_read(&ACCESS_FBINFO(altout.lock)); - if (ACCESS_FBINFO(altout.output)) - ACCESS_FBINFO(altout.output)->compute(ACCESS_FBINFO(altout.device), &mt); - up_read(&ACCESS_FBINFO(altout.lock)); + ACCESS_FBINFO(crtc2).pixclock = mt.pixclock; + ACCESS_FBINFO(crtc2).mnp = mt.mnp; + up_read(&ACCESS_FBINFO(altout).lock); + if (cnt) { + matroxfb_dh_restore(m2info, &mt, p, mode, pos); + } else { + matroxfb_dh_disable(m2info); } - matroxfb_dh_restore(m2info, &mt, p, mode, pos); + DAC1064_global_init(PMINFO2); DAC1064_global_restore(PMINFO2); - if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_PRIMARY) { - if (ACCESS_FBINFO(primout)) - ACCESS_FBINFO(primout)->program(MINFO); - } - if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_SECONDARY) { - down_read(&ACCESS_FBINFO(altout.lock)); - if (ACCESS_FBINFO(altout.output)) - ACCESS_FBINFO(altout.output)->program(ACCESS_FBINFO(altout.device)); - up_read(&ACCESS_FBINFO(altout.lock)); - } - if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_PRIMARY) { - if (ACCESS_FBINFO(primout)) - ACCESS_FBINFO(primout)->start(MINFO); + down_read(&ACCESS_FBINFO(altout).lock); + for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { + if (ACCESS_FBINFO(outputs[out]).src == MATROXFB_SRC_CRTC2 && + ACCESS_FBINFO(outputs[out]).output->program) { + ACCESS_FBINFO(outputs[out]).output->program(ACCESS_FBINFO(outputs[out]).data); + } } - if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_SECONDARY) { - down_read(&ACCESS_FBINFO(altout.lock)); - if (ACCESS_FBINFO(altout.output)) - ACCESS_FBINFO(altout.output)->start(ACCESS_FBINFO(altout.device)); - up_read(&ACCESS_FBINFO(altout.lock)); + for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { + if (ACCESS_FBINFO(outputs[out]).src == MATROXFB_SRC_CRTC2 && + ACCESS_FBINFO(outputs[out]).output->start) { + ACCESS_FBINFO(outputs[out]).output->start(ACCESS_FBINFO(outputs[out]).data); + } } + up_read(&ACCESS_FBINFO(altout).lock); matroxfb_dh_cfbX_init(m2info, p); - do_install_cmap(m2info, p); + my_install_cmap(m2info); } return 0; #undef m2info @@ -454,7 +500,7 @@ static int matroxfb_dh_get_cmap(struct fb_cmap* cmap, int kspc, int con, struct fb_info* info) { -#define m2info ((struct matroxfb_dh_fb_info*)info) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) struct display* dsp; if (con < 0) @@ -473,7 +519,7 @@ static int matroxfb_dh_set_cmap(struct fb_cmap* cmap, int kspc, int con, struct fb_info* info) { -#define m2info ((struct matroxfb_dh_fb_info*)info) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) struct display* dsp; if (con < 0) @@ -497,7 +543,7 @@ static int matroxfb_dh_pan_display(struct fb_var_screeninfo* var, int con, struct fb_info* info) { -#define m2info ((struct matroxfb_dh_fb_info*)info) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) if (var->xoffset + fb_display[con].var.xres > fb_display[con].var.xres_virtual || var->yoffset + fb_display[con].var.yres > fb_display[con].var.yres_virtual) return -EINVAL; @@ -530,7 +576,7 @@ unsigned long arg, int con, struct fb_info* info) { -#define m2info ((struct matroxfb_dh_fb_info*)info) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) MINFO_FROM(m2info->primary_dev); DBG("matroxfb_crtc2_ioctl") @@ -557,38 +603,84 @@ case MATROXFB_SET_OUTPUT_CONNECTION: { u_int32_t tmp; + int out; + int changes; if (get_user(tmp, (u_int32_t*)arg)) return -EFAULT; - if (tmp & ~ACCESS_FBINFO(output.all)) - return -EINVAL; - if (tmp & ACCESS_FBINFO(output.ph)) - return -EINVAL; - if (tmp & MATROXFB_OUTPUT_CONN_DFP) - return -EINVAL; - if ((ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_DFP) && tmp) - return -EINVAL; - if (tmp == ACCESS_FBINFO(output.sh)) + for (out = 0; out < 32; out++) { + if (tmp & (1 << out)) { + if (out >= MATROXFB_MAX_OUTPUTS) + return -ENXIO; + if (!ACCESS_FBINFO(outputs[out]).output) + return -ENXIO; + switch (ACCESS_FBINFO(outputs[out]).src) { + case MATROXFB_SRC_NONE: + case MATROXFB_SRC_CRTC2: + break; + default: + return -EBUSY; + } + } + } + if (ACCESS_FBINFO(devflags.panellink)) { + if (tmp & MATROXFB_OUTPUT_CONN_DFP) + return -EINVAL; + if ((ACCESS_FBINFO(outputs[2]).src == MATROXFB_SRC_CRTC1) && tmp) + return -EBUSY; + } + changes = 0; + for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { + if (tmp & (1 << out)) { + if (ACCESS_FBINFO(outputs[out]).src != MATROXFB_SRC_CRTC2) { + changes = 1; + ACCESS_FBINFO(outputs[out]).src = MATROXFB_SRC_CRTC2; + } + } else if (ACCESS_FBINFO(outputs[out]).src == MATROXFB_SRC_CRTC2) { + changes = 1; + ACCESS_FBINFO(outputs[out]).src = MATROXFB_SRC_NONE; + } + } + if (!changes) return 0; - ACCESS_FBINFO(output.sh) = tmp; matroxfb_dh_switch(m2info->currcon, info); return 0; } case MATROXFB_GET_OUTPUT_CONNECTION: { - if (put_user(ACCESS_FBINFO(output.sh), (u_int32_t*)arg)) + u_int32_t conn = 0; + int out; + + for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { + if (ACCESS_FBINFO(outputs[out]).src == MATROXFB_SRC_CRTC2) { + conn |= 1 << out; + } + } + if (put_user(conn, (u_int32_t*)arg)) return -EFAULT; return 0; } case MATROXFB_GET_AVAILABLE_OUTPUTS: { - u_int32_t tmp; + u_int32_t tmp = 0; + int out; - /* we do not support DFP from CRTC2 */ - tmp = ACCESS_FBINFO(output.all) & ~ACCESS_FBINFO(output.ph) & ~MATROXFB_OUTPUT_CONN_DFP; - /* CRTC1 in DFP mode disables CRTC2 at all (I know, I'm lazy) */ - if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_DFP) - tmp = 0; + for (out = 0; out < MATROXFB_MAX_OUTPUTS; out++) { + if (ACCESS_FBINFO(outputs[out]).output) { + switch (ACCESS_FBINFO(outputs[out]).src) { + case MATROXFB_SRC_NONE: + case MATROXFB_SRC_CRTC2: + tmp |= 1 << out; + break; + } + } + } + if (ACCESS_FBINFO(devflags.panellink)) { + tmp &= ~MATROXFB_OUTPUT_CONN_DFP; + if (ACCESS_FBINFO(outputs[2]).src == MATROXFB_SRC_CRTC1) { + tmp = 0; + } + } if (put_user(tmp, (u_int32_t*)arg)) return -EFAULT; return 0; @@ -598,6 +690,24 @@ #undef m2info } +static int matroxfb_dh_blank(int blank, struct fb_info* info) { +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) + switch (blank) { + case 1: + case 2: + case 3: + case 4: + default:; + } + /* do something... */ + return 0; +#undef m2info +} + +static void matroxfb_dh_blank24(int blank, struct fb_info* info) { + matroxfb_dh_blank(blank, info); +} + static struct fb_ops matroxfb_dh_ops = { owner: THIS_MODULE, fb_open: matroxfb_dh_open, @@ -612,7 +722,7 @@ }; static int matroxfb_dh_switch(int con, struct fb_info* info) { -#define m2info ((struct matroxfb_dh_fb_info*)info) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) struct fb_cmap* cmap; struct display* p; @@ -635,25 +745,12 @@ } static int matroxfb_dh_updatevar(int con, struct fb_info* info) { -#define m2info ((struct matroxfb_dh_fb_info*)info) +#define m2info (list_entry(info, struct matroxfb_dh_fb_info, fbcon)) matroxfb_dh_pan_var(m2info, &fb_display[con].var); return 0; #undef m2info } -static void matroxfb_dh_blank(int blank, struct fb_info* info) { -#define m2info ((struct matroxfb_dh_fb_info*)info) - switch (blank) { - case 1: - case 2: - case 3: - case 4: - default:; - } - /* do something... */ -#undef m2info -} - static struct fb_var_screeninfo matroxfb_dh_defined = { 640,480,640,480,/* W,H, virtual W,H */ 0,0, /* offset */ @@ -692,7 +789,7 @@ m2info->fbcon.disp = d; m2info->fbcon.switch_con = &matroxfb_dh_switch; m2info->fbcon.updatevar = &matroxfb_dh_updatevar; - m2info->fbcon.blank = &matroxfb_dh_blank; + m2info->fbcon.blank = &matroxfb_dh_blank24; m2info->fbcon.flags = FBINFO_FLAG_DEFAULT; m2info->currcon = -1; m2info->currcon_display = d; @@ -722,11 +819,10 @@ /* * If we have unused output, connect CRTC2 to it... */ - if ((ACCESS_FBINFO(output.all) & MATROXFB_OUTPUT_CONN_SECONDARY) && - !(ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_SECONDARY) && - !(ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_DFP)) { - ACCESS_FBINFO(output.sh) |= MATROXFB_OUTPUT_CONN_SECONDARY; - ACCESS_FBINFO(output.sh) &= ~MATROXFB_OUTPUT_CONN_DFP; + if (ACCESS_FBINFO(outputs[1]).output && + ACCESS_FBINFO(outputs[1]).src == MATROXFB_SRC_NONE && + ACCESS_FBINFO(outputs[2]).src == MATROXFB_SRC_NONE) { + ACCESS_FBINFO(outputs[1]).src = MATROXFB_SRC_CRTC2; } matroxfb_dh_set_var(&matroxfb_dh_defined, -2, &m2info->fbcon); @@ -739,7 +835,7 @@ } down_write(&ACCESS_FBINFO(crtc2.lock)); oldcrtc2 = ACCESS_FBINFO(crtc2.info); - ACCESS_FBINFO(crtc2.info) = &m2info->fbcon; + ACCESS_FBINFO(crtc2.info) = m2info; up_write(&ACCESS_FBINFO(crtc2.lock)); if (oldcrtc2) { printk(KERN_ERR "matroxfb_crtc2: Internal consistency check failed: crtc2 already present: %p\n", @@ -768,16 +864,16 @@ #define minfo (m2info->primary_dev) if (m2info->fbcon_registered) { int id; - struct fb_info* crtc2; + struct matroxfb_dh_fb_info* crtc2; down_write(&ACCESS_FBINFO(crtc2.lock)); crtc2 = ACCESS_FBINFO(crtc2.info); - if (crtc2 == &m2info->fbcon) + if (crtc2 == m2info) ACCESS_FBINFO(crtc2.info) = NULL; up_write(&ACCESS_FBINFO(crtc2.lock)); - if (crtc2 != &m2info->fbcon) { + if (crtc2 != m2info) { printk(KERN_ERR "matroxfb_crtc2: Internal consistency check failed: crtc2 mismatch at unload: %p != %p\n", - crtc2, &m2info->fbcon); + crtc2, m2info); printk(KERN_ERR "matroxfb_crtc2: Expect kernel crash after module unload.\n"); return; } @@ -815,6 +911,7 @@ static void matroxfb_crtc2_remove(struct matrox_fb_info* minfo, void* crtc2) { matroxfb_dh_deregisterfb(crtc2); + kfree(crtc2); } static struct matroxfb_driver crtc2 = { @@ -831,7 +928,7 @@ matroxfb_unregister_driver(&crtc2); } -MODULE_AUTHOR("(c) 1999-2001 Petr Vandrovec "); +MODULE_AUTHOR("(c) 1999-2002 Petr Vandrovec "); MODULE_DESCRIPTION("Matrox G400 CRTC2 driver"); MODULE_LICENSE("GPL"); module_init(matroxfb_crtc2_init); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_crtc2.h linux.20pre5-ac2/drivers/video/matrox/matroxfb_crtc2.h --- linux.20pre5/drivers/video/matrox/matroxfb_crtc2.h 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_crtc2.h 2002-09-02 14:57:05.000000000 +0100 @@ -29,6 +29,8 @@ int currcon; struct display* currcon_display; + + int interlaced:1; union { #ifdef FBCON_HAS_CFB16 diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_DAC1064.c linux.20pre5-ac2/drivers/video/matrox/matroxfb_DAC1064.c --- linux.20pre5/drivers/video/matrox/matroxfb_DAC1064.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_DAC1064.c 2002-09-02 00:06:57.000000000 +0100 @@ -2,11 +2,11 @@ * * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450. * - * (c) 1998-2001 Petr Vandrovec + * (c) 1998-2002 Petr Vandrovec * * Portions Copyright (c) 2001 Matrox Graphics Inc. * - * Version: 1.62 2001/11/29 + * Version: 1.64 2002/06/10 * * See matroxfb_base.c for contributors. * @@ -161,37 +161,20 @@ unsigned int p; DBG("DAC1064_calcclock") + + /* only for devices older than G450 */ fvco = PLL_calcclock(PMINFO freq, fmax, in, feed, &p); - if (ACCESS_FBINFO(devflags.g450dac)) { - if (fvco <= 300000) /* 276-324 */ - ; - else if (fvco <= 400000) /* 378-438 */ - p |= 0x08; - else if (fvco <= 550000) /* 540-567 */ - p |= 0x10; - else if (fvco <= 690000) /* 675-695 */ - p |= 0x18; - else if (fvco <= 800000) /* 776-803 */ - p |= 0x20; - else if (fvco <= 891000) /* 891-891 */ - p |= 0x28; - else if (fvco <= 940000) /* 931-945 */ - p |= 0x30; - else /* <959 */ - p |= 0x38; - } else { - p = (1 << p) - 1; - if (fvco <= 100000) - ; - else if (fvco <= 140000) - p |= 0x08; - else if (fvco <= 180000) - p |= 0x10; - else - p |= 0x18; - } + p = (1 << p) - 1; + if (fvco <= 100000) + ; + else if (fvco <= 140000) + p |= 0x08; + else if (fvco <= 180000) + p |= 0x10; + else + p |= 0x18; *post = p; } @@ -293,31 +276,164 @@ hw->MXoptionReg = mx; } +static void g450_set_plls(WPMINFO2) { + u_int32_t c2_ctl; + unsigned int pxc; + struct matrox_hw_state* hw = &ACCESS_FBINFO(hw); + int pixelmnp; + int videomnp; + + c2_ctl = hw->crtc2.ctl & ~0x4007; /* Clear PLL + enable for CRTC2 */ + c2_ctl |= 0x0001; /* Enable CRTC2 */ + hw->DACreg[POS1064_XPWRCTRL] &= ~0x02; /* Stop VIDEO PLL */ + pixelmnp = ACCESS_FBINFO(crtc1).mnp; + videomnp = ACCESS_FBINFO(crtc2).mnp; + if (videomnp < 0) { + c2_ctl &= ~0x0001; /* Disable CRTC2 */ + hw->DACreg[POS1064_XPWRCTRL] &= ~0x10; /* Powerdown CRTC2 */ + } else if (ACCESS_FBINFO(crtc2).pixclock == ACCESS_FBINFO(features).pll.ref_freq) { + c2_ctl |= 0x4002; /* Use reference directly */ + } else if (videomnp == pixelmnp) { + c2_ctl |= 0x0004; /* Use pixel PLL */ + } else { + if (0 == ((videomnp ^ pixelmnp) & 0xFFFFFF00)) { + /* PIXEL and VIDEO PLL must not use same frequency. We modify N + of PIXEL PLL in such case because of VIDEO PLL may be source + of TVO clocks, and chroma subcarrier is derived from its + pixel clocks */ + pixelmnp += 0x000100; + } + c2_ctl |= 0x0006; /* Use video PLL */ + hw->DACreg[POS1064_XPWRCTRL] |= 0x02; + + outDAC1064(PMINFO M1064_XPWRCTRL, hw->DACreg[POS1064_XPWRCTRL]); + matroxfb_g450_setpll_cond(PMINFO videomnp, M_VIDEO_PLL); + } + + hw->DACreg[POS1064_XPIXCLKCTRL] &= ~M1064_XPIXCLKCTRL_PLL_UP; + if (pixelmnp >= 0) { + hw->DACreg[POS1064_XPIXCLKCTRL] |= M1064_XPIXCLKCTRL_PLL_UP; + + outDAC1064(PMINFO M1064_XPIXCLKCTRL, hw->DACreg[POS1064_XPIXCLKCTRL]); + matroxfb_g450_setpll_cond(PMINFO pixelmnp, M_PIXEL_PLL_C); + } + if (c2_ctl != hw->crtc2.ctl) { + hw->crtc2.ctl = c2_ctl; + mga_outl(0x3C10, c2_ctl); + } + + pxc = ACCESS_FBINFO(crtc1).pixclock; + if (pxc == 0 || ACCESS_FBINFO(outputs[2]).src == MATROXFB_SRC_CRTC2) { + pxc = ACCESS_FBINFO(crtc2).pixclock; + } + if (ACCESS_FBINFO(chip) == MGA_G550) { + if (pxc < 45000) { + hw->DACreg[POS1064_XPANMODE] = 0x00; /* 0-50 */ + } else if (pxc < 55000) { + hw->DACreg[POS1064_XPANMODE] = 0x08; /* 34-62 */ + } else if (pxc < 70000) { + hw->DACreg[POS1064_XPANMODE] = 0x10; /* 42-78 */ + } else if (pxc < 85000) { + hw->DACreg[POS1064_XPANMODE] = 0x18; /* 62-92 */ + } else if (pxc < 100000) { + hw->DACreg[POS1064_XPANMODE] = 0x20; /* 74-108 */ + } else if (pxc < 115000) { + hw->DACreg[POS1064_XPANMODE] = 0x28; /* 94-122 */ + } else if (pxc < 125000) { + hw->DACreg[POS1064_XPANMODE] = 0x30; /* 108-132 */ + } else { + hw->DACreg[POS1064_XPANMODE] = 0x38; /* 120-168 */ + } + } else { + /* G450 */ + if (pxc < 45000) { + hw->DACreg[POS1064_XPANMODE] = 0x00; /* 0-54 */ + } else if (pxc < 65000) { + hw->DACreg[POS1064_XPANMODE] = 0x08; /* 38-70 */ + } else if (pxc < 85000) { + hw->DACreg[POS1064_XPANMODE] = 0x10; /* 56-96 */ + } else if (pxc < 105000) { + hw->DACreg[POS1064_XPANMODE] = 0x18; /* 80-114 */ + } else if (pxc < 135000) { + hw->DACreg[POS1064_XPANMODE] = 0x20; /* 102-144 */ + } else if (pxc < 160000) { + hw->DACreg[POS1064_XPANMODE] = 0x28; /* 132-166 */ + } else if (pxc < 175000) { + hw->DACreg[POS1064_XPANMODE] = 0x30; /* 154-182 */ + } else { + hw->DACreg[POS1064_XPANMODE] = 0x38; /* 170-204 */ + } + } +} + void DAC1064_global_init(WPMINFO2) { struct matrox_hw_state* hw = &ACCESS_FBINFO(hw); hw->DACreg[POS1064_XMISCCTRL] &= M1064_XMISCCTRL_DAC_WIDTHMASK; hw->DACreg[POS1064_XMISCCTRL] |= M1064_XMISCCTRL_LUT_EN; hw->DACreg[POS1064_XPIXCLKCTRL] = M1064_XPIXCLKCTRL_PLL_UP | M1064_XPIXCLKCTRL_EN | M1064_XPIXCLKCTRL_SRC_PLL; - hw->DACreg[POS1064_XOUTPUTCONN] = 0x01; /* output #1 enabled */ - if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_SECONDARY) { - if (ACCESS_FBINFO(devflags.g450dac)) { - hw->DACreg[POS1064_XPIXCLKCTRL] = M1064_XPIXCLKCTRL_PLL_UP | M1064_XPIXCLKCTRL_EN | M1064_XPIXCLKCTRL_SRC_PLL2; - hw->DACreg[POS1064_XOUTPUTCONN] = 0x05; /* output #1 enabled; CRTC1 connected to output #2 */ - } else { + if (ACCESS_FBINFO(devflags.g450dac)) { + hw->DACreg[POS1064_XPWRCTRL] = 0x1F; /* powerup everything */ + hw->DACreg[POS1064_XOUTPUTCONN] = 0x00; /* disable outputs */ + hw->DACreg[POS1064_XMISCCTRL] |= M1064_XMISCCTRL_DAC_EN; + switch (ACCESS_FBINFO(outputs[0]).src) { + case MATROXFB_SRC_CRTC1: + case MATROXFB_SRC_CRTC2: + hw->DACreg[POS1064_XOUTPUTCONN] |= 0x01; /* enable output; CRTC1/2 selection is in CRTC2 ctl */ + break; + case MATROXFB_SRC_NONE: + hw->DACreg[POS1064_XMISCCTRL] &= ~M1064_XMISCCTRL_DAC_EN; + break; + } + switch (ACCESS_FBINFO(outputs[1]).src) { + case MATROXFB_SRC_CRTC1: + hw->DACreg[POS1064_XOUTPUTCONN] |= 0x04; + break; + case MATROXFB_SRC_CRTC2: + if (ACCESS_FBINFO(outputs[1]).mode == MATROXFB_OUTPUT_MODE_MONITOR) { + hw->DACreg[POS1064_XOUTPUTCONN] |= 0x08; + } else { + hw->DACreg[POS1064_XOUTPUTCONN] |= 0x0C; + } + break; + case MATROXFB_SRC_NONE: + hw->DACreg[POS1064_XPWRCTRL] &= ~0x01; /* Poweroff DAC2 */ + break; + } + switch (ACCESS_FBINFO(outputs[2]).src) { + case MATROXFB_SRC_CRTC1: + hw->DACreg[POS1064_XOUTPUTCONN] |= 0x20; + break; + case MATROXFB_SRC_CRTC2: + hw->DACreg[POS1064_XOUTPUTCONN] |= 0x40; + break; + case MATROXFB_SRC_NONE: +#if 0 + /* HELP! If we boot without DFP connected to DVI, we can + poweroff TMDS. But if we boot with DFP connected, + TMDS generated clocks are used instead of ALL pixclocks + available... If someone knows which register + handles it, please reveal this secret to me... */ + hw->DACreg[POS1064_XPWRCTRL] &= ~0x04; /* Poweroff TMDS */ +#endif + break; + } + /* Now set timming related variables... */ + g450_set_plls(PMINFO2); + } else { + if (ACCESS_FBINFO(outputs[1]).src == MATROXFB_SRC_CRTC1) { hw->DACreg[POS1064_XPIXCLKCTRL] = M1064_XPIXCLKCTRL_PLL_UP | M1064_XPIXCLKCTRL_EN | M1064_XPIXCLKCTRL_SRC_EXT; hw->DACreg[POS1064_XMISCCTRL] |= GX00_XMISCCTRL_MFC_MAFC | G400_XMISCCTRL_VDO_MAFC12; - } - } else if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_SECONDARY) { - hw->DACreg[POS1064_XMISCCTRL] |= GX00_XMISCCTRL_MFC_MAFC | G400_XMISCCTRL_VDO_C2_MAFC12; - hw->DACreg[POS1064_XOUTPUTCONN] = 0x09; /* output #1 enabled; CRTC2 connected to output #2 */ - } else if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_DFP) - hw->DACreg[POS1064_XMISCCTRL] |= GX00_XMISCCTRL_MFC_PANELLINK | G400_XMISCCTRL_VDO_MAFC12; - else - hw->DACreg[POS1064_XMISCCTRL] |= GX00_XMISCCTRL_MFC_DIS; + } else if (ACCESS_FBINFO(outputs[1]).src == MATROXFB_SRC_CRTC2) { + hw->DACreg[POS1064_XMISCCTRL] |= GX00_XMISCCTRL_MFC_MAFC | G400_XMISCCTRL_VDO_C2_MAFC12; + } else if (ACCESS_FBINFO(outputs[2]).src == MATROXFB_SRC_CRTC1) + hw->DACreg[POS1064_XMISCCTRL] |= GX00_XMISCCTRL_MFC_PANELLINK | G400_XMISCCTRL_VDO_MAFC12; + else + hw->DACreg[POS1064_XMISCCTRL] |= GX00_XMISCCTRL_MFC_DIS; - if ((ACCESS_FBINFO(output.ph) | ACCESS_FBINFO(output.sh)) & MATROXFB_OUTPUT_CONN_PRIMARY) - hw->DACreg[POS1064_XMISCCTRL] |= M1064_XMISCCTRL_DAC_EN; + if (ACCESS_FBINFO(outputs[0]).src != MATROXFB_SRC_NONE) + hw->DACreg[POS1064_XMISCCTRL] |= M1064_XMISCCTRL_DAC_EN; + } } void DAC1064_global_restore(WPMINFO2) { @@ -329,8 +445,9 @@ outDAC1064(PMINFO 0x20, 0x04); outDAC1064(PMINFO 0x1F, ACCESS_FBINFO(devflags.dfp_type)); if (ACCESS_FBINFO(devflags.g450dac)) { - outDAC1064(PMINFO M1064_XSYNCCTRL, 0xCC); /* only matrox know... */ - outDAC1064(PMINFO M1064_XPWRCTRL, 0x1F); /* powerup everything */ + outDAC1064(PMINFO M1064_XSYNCCTRL, 0xCC); + outDAC1064(PMINFO M1064_XPWRCTRL, hw->DACreg[POS1064_XPWRCTRL]); + outDAC1064(PMINFO M1064_XPANMODE, hw->DACreg[POS1064_XPANMODE]); outDAC1064(PMINFO M1064_XOUTPUTCONN, hw->DACreg[POS1064_XOUTPUTCONN]); } } @@ -368,13 +485,13 @@ return 1; /* unsupported depth */ } } - - DAC1064_global_init(PMINFO2); hw->DACreg[POS1064_XVREFCTRL] = ACCESS_FBINFO(features.DAC1064.xvrefctrl); hw->DACreg[POS1064_XGENCTRL] &= ~M1064_XGENCTRL_SYNC_ON_GREEN_MASK; hw->DACreg[POS1064_XGENCTRL] |= (m->sync & FB_SYNC_ON_GREEN)?M1064_XGENCTRL_SYNC_ON_GREEN:M1064_XGENCTRL_NO_SYNC_ON_GREEN; hw->DACreg[POS1064_XCURADDL] = ACCESS_FBINFO(features.DAC1064.cursorimage) >> 10; hw->DACreg[POS1064_XCURADDH] = ACCESS_FBINFO(features.DAC1064.cursorimage) >> 18; + + DAC1064_global_init(PMINFO2); return 0; } @@ -471,13 +588,8 @@ #endif } -static int m1064_compute(void* outdev, struct my_timming* m) { -#define minfo ((struct matrox_fb_info*)outdev) -#ifdef CONFIG_FB_MATROX_G450 - if (ACCESS_FBINFO(devflags.g450dac)) { - matroxfb_g450_setclk(PMINFO m->pixclock, M_PIXEL_PLL_C); - } else -#endif +static int m1064_compute(void* out, struct my_timming* m) { +#define minfo ((struct matrox_fb_info*)out) { int i; int tmout; @@ -504,37 +616,28 @@ return 0; } -static int m1064_program(void* outdev) { - /* nothing, hardware is set in m1064_compute */ - return 0; -} - -static int m1064_start(void* outdev) { - /* nothing */ - return 0; -} - -static void m1064_incuse(void* outdev) { - /* nothing yet; MODULE_INC_USE in future... */ -} - -static void m1064_decuse(void* outdev) { - /* nothing yet; MODULE_DEC_USE in future... */ -} +static struct matrox_altout m1064 = { + .owner = THIS_MODULE, + .name = "Primary output", + .compute = m1064_compute, +}; -static int m1064_setmode(void* outdev, u_int32_t mode) { - if (mode != MATROXFB_OUTPUT_MODE_MONITOR) - return -EINVAL; +static int g450_compute(void* out, struct my_timming* m) { +#define minfo ((struct matrox_fb_info*)out) + if (m->mnp < 0) { + m->mnp = matroxfb_g450_setclk(PMINFO m->pixclock, (m->crtc == MATROXFB_SRC_CRTC1) ? M_PIXEL_PLL_C : M_VIDEO_PLL); + if (m->mnp >= 0) { + m->pixclock = g450_mnp2f(PMINFO m->mnp); + } + } +#undef minfo return 0; } -static struct matrox_altout m1064 = { - m1064_compute, - m1064_program, - m1064_start, - m1064_incuse, - m1064_decuse, - m1064_setmode +static struct matrox_altout g450out = { + .owner = THIS_MODULE, + .name = "Primary output", + .compute = g450_compute, }; #endif /* NEED_DAC1064 */ @@ -680,7 +783,10 @@ ACCESS_FBINFO(features.accel.has_cacheflush) = 1; ACCESS_FBINFO(cursor.timer.function) = matroxfb_DAC1064_flashcursor; - ACCESS_FBINFO(primout) = &m1064; + ACCESS_FBINFO(outputs[0]).output = &m1064; + ACCESS_FBINFO(outputs[0]).src = MATROXFB_SRC_CRTC1; + ACCESS_FBINFO(outputs[0]).data = MINFO; + ACCESS_FBINFO(outputs[0]).mode = MATROXFB_OUTPUT_MODE_MONITOR; if (ACCESS_FBINFO(devflags.noinit)) return 0; /* do not modify settings */ @@ -726,8 +832,13 @@ ((ACCESS_FBINFO(values).reg.opt3 & 0x300000) == 0x300000)) { matroxfb_g450_setclk(PMINFO ACCESS_FBINFO(values.pll.video), M_VIDEO_PLL); } else { - /* slow down video clocks... */ - matroxfb_g450_setclk(PMINFO 0, M_VIDEO_PLL); + unsigned long flags; + unsigned int pwr; + + matroxfb_DAC_lock_irqsave(flags); + pwr = inDAC1064(PMINFO M1064_XPWRCTRL) & ~0x02; + outDAC1064(PMINFO M1064_XPWRCTRL, pwr); + matroxfb_DAC_unlock_irqrestore(flags); } matroxfb_g450_setclk(PMINFO ACCESS_FBINFO(values.pll.system), M_SYSTEM_PLL); @@ -864,7 +975,14 @@ ACCESS_FBINFO(capable.plnwt) = ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG100 ? ACCESS_FBINFO(devflags.sgram) : 1; - ACCESS_FBINFO(primout) = &m1064; + if (ACCESS_FBINFO(devflags.g450dac)) { + ACCESS_FBINFO(outputs[0]).output = &g450out; + } else { + ACCESS_FBINFO(outputs[0]).output = &m1064; + } + ACCESS_FBINFO(outputs[0]).src = MATROXFB_SRC_CRTC1; + ACCESS_FBINFO(outputs[0]).data = MINFO; + ACCESS_FBINFO(outputs[0]).mode = MATROXFB_OUTPUT_MODE_MONITOR; if (ACCESS_FBINFO(devflags.g450dac)) { /* we must do this always, BIOS does not do it for us @@ -895,8 +1013,7 @@ hw->MXoptionReg |= 0x1080; pci_write_config_dword(ACCESS_FBINFO(pcidev), PCI_OPTION_REG, hw->MXoptionReg); - mga_outl(M_CTLWTST, 0x00000300); - /* mga_outl(M_CTLWTST, 0x03258A31); */ + mga_outl(M_CTLWTST, ACCESS_FBINFO(values).reg.mctlwtst); udelay(100); mga_outb(0x1C05, 0x00); mga_outb(0x1C05, 0x80); @@ -947,17 +1064,18 @@ pci_write_config_dword(ACCESS_FBINFO(pcidev), PCI_OPTION2_REG, reg50); if (ACCESS_FBINFO(devflags.memtype) == -1) - ACCESS_FBINFO(devflags.memtype) = 0; - hw->MXoptionReg |= (ACCESS_FBINFO(devflags.memtype) & 7) << 10; + hw->MXoptionReg |= ACCESS_FBINFO(values).reg.opt & 0x1C00; + else + hw->MXoptionReg |= (ACCESS_FBINFO(devflags.memtype) & 7) << 10; if (ACCESS_FBINFO(devflags.sgram)) hw->MXoptionReg |= 0x4000; - mga_outl(M_CTLWTST, 0x042450A1); - mga_outl(M_MEMRDBK, 0x00000108); + mga_outl(M_CTLWTST, ACCESS_FBINFO(values).reg.mctlwtst); + mga_outl(M_MEMRDBK, ACCESS_FBINFO(values).reg.memrdbk); udelay(200); mga_outl(M_MACCESS, 0x00000000); mga_outl(M_MACCESS, 0x00008000); udelay(100); - mga_outl(M_MEMRDBK, 0x00000108); + mga_outl(M_MEMRDBK, ACCESS_FBINFO(values).reg.memrdbk); hw->MXoptionReg |= 0x00040020; } pci_write_config_dword(ACCESS_FBINFO(pcidev), PCI_OPTION_REG, hw->MXoptionReg); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_DAC1064.h linux.20pre5-ac2/drivers/video/matrox/matroxfb_DAC1064.h --- linux.20pre5/drivers/video/matrox/matroxfb_DAC1064.h 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_DAC1064.h 2002-09-02 14:57:05.000000000 +0100 @@ -146,6 +146,8 @@ #define M1064_XPWRCTRL 0xA0 +#define M1064_XPANMODE 0xA2 + enum POS1064 { POS1064_XCURADDL=0, POS1064_XCURADDH, POS1064_XCURCTRL, POS1064_XCURCOL0RED, POS1064_XCURCOL0GREEN, POS1064_XCURCOL0BLUE, @@ -156,7 +158,7 @@ POS1064_XGENIOCTRL, POS1064_XGENIODATA, POS1064_XZOOMCTRL, POS1064_XSENSETEST, POS1064_XCRCBITSEL, POS1064_XCOLKEYMASKL, POS1064_XCOLKEYMASKH, POS1064_XCOLKEYL, POS1064_XCOLKEYH, - POS1064_XOUTPUTCONN }; + POS1064_XOUTPUTCONN, POS1064_XPANMODE, POS1064_XPWRCTRL }; #endif /* __MATROXFB_DAC1064_H__ */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_g450.c linux.20pre5-ac2/drivers/video/matrox/matroxfb_g450.c --- linux.20pre5/drivers/video/matrox/matroxfb_g450.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_g450.c 2002-09-02 00:06:57.000000000 +0100 @@ -2,145 +2,634 @@ * * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450. * - * (c) 1998-2001 Petr Vandrovec + * (c) 1998-2002 Petr Vandrovec * * Portions Copyright (c) 2001 Matrox Graphics Inc. * - * Version: 1.62 2001/11/29 + * Version: 1.64 2002/06/02 * * See matroxfb_base.c for contributors. * */ -#include "matroxfb_g450.h" +#include "matroxfb_base.h" #include "matroxfb_misc.h" #include "matroxfb_DAC1064.h" #include "g450_pll.h" #include #include +#include -static int matroxfb_g450_compute(void* md, struct my_timming* mt) { -#define m2info ((struct matroxfb_g450_info*)md) -#define minfo (m2info->primary_dev) - ACCESS_FBINFO(hw).vidclk = mt->pixclock; -#undef minfo -#undef m2info - return 0; +/* Definition of the various controls */ +struct mctl { + struct matroxfb_queryctrl desc; + size_t control; +}; + +#define BLMIN 0xF3 +#define WLMAX 0x3FF + +static const struct mctl g450_controls[] = +{ { { MATROXFB_CID_BRIGHTNESS, + "brightness", + 0, WLMAX-BLMIN, 1, 370-BLMIN, + MATROXFB_CTRL_TYPE_INTEGER, 0, 0, + "picture" + }, offsetof(struct matrox_fb_info, altout.tvo_params.brightness) }, + { { MATROXFB_CID_CONTRAST, + "contrast", + 0, 1023, 1, 127, + MATROXFB_CTRL_TYPE_INTEGER, 0, 0, + "picture" + }, offsetof(struct matrox_fb_info, altout.tvo_params.contrast) }, + { { MATROXFB_CID_SATURATION, + "saturation", + 0, 255, 1, 165, + MATROXFB_CTRL_TYPE_INTEGER, 0, 0, + "picture" + }, offsetof(struct matrox_fb_info, altout.tvo_params.saturation) }, + { { MATROXFB_CID_HUE, + "hue", + 0, 255, 1, 0, + MATROXFB_CTRL_TYPE_INTEGER, 0, 0, + "picture" + }, offsetof(struct matrox_fb_info, altout.tvo_params.hue) }, + { { MATROXFB_CID_TESTOUT, + "test output", + 0, 1, 1, 0, + MATROXFB_CTRL_TYPE_BOOLEAN, 0, 0, + "picture" + }, offsetof(struct matrox_fb_info, altout.tvo_params.testout) }, +}; + +#define G450CTRLS (sizeof(g450_controls)/sizeof(g450_controls[0])) + +/* Return: positive number: id found + -EINVAL: id not found, return failure + -ENOENT: id not found, create fake disabled control */ +static int get_ctrl_id(__u32 v4l2_id) { + int i; + + for (i = 0; i < G450CTRLS; i++) { + if (v4l2_id < g450_controls[i].desc.id) { + if (g450_controls[i].desc.id == 0x08000000) { + return -EINVAL; + } + return -ENOENT; + } + if (v4l2_id == g450_controls[i].desc.id) { + return i; + } + } + return -EINVAL; } -static int matroxfb_g450_program(void* md) { -#define m2info ((struct matroxfb_g450_info*)md) -#define minfo (m2info->primary_dev) - matroxfb_g450_setclk(PMINFO ACCESS_FBINFO(hw).vidclk, M_VIDEO_PLL); -#undef minfo -#undef m2info - return 0; +static inline int* get_ctrl_ptr(WPMINFO unsigned int idx) { + return (int*)((char*)MINFO + g450_controls[idx].control); } -static int matroxfb_g450_start(void* md) { - return 0; +static void tvo_fill_defaults(WPMINFO2) { + unsigned int i; + + for (i = 0; i < G450CTRLS; i++) { + *get_ctrl_ptr(PMINFO i) = g450_controls[i].desc.default_value; + } } -static void matroxfb_g450_incuse(void* md) { - MOD_INC_USE_COUNT; +static int cve2_get_reg(WPMINFO int reg) { + unsigned long flags; + int val; + + matroxfb_DAC_lock_irqsave(flags); + matroxfb_DAC_out(PMINFO 0x87, reg); + val = matroxfb_DAC_in(PMINFO 0x88); + matroxfb_DAC_unlock_irqrestore(flags); + return val; } -static void matroxfb_g450_decuse(void* md) { - MOD_DEC_USE_COUNT; +static void cve2_set_reg(WPMINFO int reg, int val) { + unsigned long flags; + + matroxfb_DAC_lock_irqsave(flags); + matroxfb_DAC_out(PMINFO 0x87, reg); + matroxfb_DAC_out(PMINFO 0x88, val); + matroxfb_DAC_unlock_irqrestore(flags); +} + +static void cve2_set_reg10(WPMINFO int reg, int val) { + unsigned long flags; + + matroxfb_DAC_lock_irqsave(flags); + matroxfb_DAC_out(PMINFO 0x87, reg); + matroxfb_DAC_out(PMINFO 0x88, val >> 2); + matroxfb_DAC_out(PMINFO 0x87, reg + 1); + matroxfb_DAC_out(PMINFO 0x88, val & 3); + matroxfb_DAC_unlock_irqrestore(flags); +} + +static void g450_compute_bwlevel(CPMINFO int *bl, int *wl) { + const int b = ACCESS_FBINFO(altout.tvo_params.brightness) + BLMIN; + const int c = ACCESS_FBINFO(altout.tvo_params.contrast); + + *bl = max(b - c, BLMIN); + *wl = min(b + c, WLMAX); } -static int matroxfb_g450_set_mode(void* md, u_int32_t arg) { - if (arg == MATROXFB_OUTPUT_MODE_MONITOR) { - return 1; +static int g450_query_ctrl(void* md, struct matroxfb_queryctrl *p) { + int i; + + i = get_ctrl_id(p->id); + if (i >= 0) { + *p = g450_controls[i].desc; + return 0; + } + if (i == -ENOENT) { + static const struct matroxfb_queryctrl disctrl = + { 0, "", 0, 0, 0, 0, 0, 1, 1, "Disabled" }; + + i = p->id; + *p = disctrl; + p->id = i; + sprintf(p->name, "Ctrl #%08X", i); + return 0; } return -EINVAL; } -static int matroxfb_g450_get_mode(void* md, u_int32_t* arg) { - *arg = MATROXFB_OUTPUT_MODE_MONITOR; +static int g450_set_ctrl(void* md, struct matroxfb_control *p) { + int i; + MINFO_FROM(md); + + i = get_ctrl_id(p->id); + if (i < 0) return -EINVAL; + + /* + * Check if changed. + */ + if (p->value == *get_ctrl_ptr(PMINFO i)) return 0; + + /* + * Check limits. + */ + if (p->value > g450_controls[i].desc.maximum) return -EINVAL; + if (p->value < g450_controls[i].desc.minimum) return -EINVAL; + + /* + * Store new value. + */ + *get_ctrl_ptr(PMINFO i) = p->value; + + switch (p->id) { + case MATROXFB_CID_BRIGHTNESS: + case MATROXFB_CID_CONTRAST: + { + int blacklevel, whitelevel; + g450_compute_bwlevel(PMINFO &blacklevel, &whitelevel); + cve2_set_reg10(PMINFO 0x0e, blacklevel); + cve2_set_reg10(PMINFO 0x1e, whitelevel); + } + break; + case MATROXFB_CID_SATURATION: + cve2_set_reg(PMINFO 0x20, p->value); + cve2_set_reg(PMINFO 0x22, p->value); + break; + case MATROXFB_CID_HUE: + cve2_set_reg(PMINFO 0x25, p->value); + break; + case MATROXFB_CID_TESTOUT: + { + unsigned char val = cve2_get_reg (PMINFO 0x05); + if (p->value) val |= 0x02; + else val &= ~0x02; + cve2_set_reg(PMINFO 0x05, val); + } + break; + } + + + return 0; +} + +static int g450_get_ctrl(void* md, struct matroxfb_control *p) { + int i; + MINFO_FROM(md); + + i = get_ctrl_id(p->id); + if (i < 0) return -EINVAL; + p->value = *get_ctrl_ptr(PMINFO i); return 0; } -static struct matrox_altout matroxfb_g450_altout = { - matroxfb_g450_compute, - matroxfb_g450_program, - matroxfb_g450_start, - matroxfb_g450_incuse, - matroxfb_g450_decuse, - matroxfb_g450_set_mode, - matroxfb_g450_get_mode +struct output_desc { + unsigned int h_vis; + unsigned int h_f_porch; + unsigned int h_sync; + unsigned int h_b_porch; + unsigned long long int chromasc; + unsigned int burst; + unsigned int v_total; }; -static int matroxfb_g450_connect(struct matroxfb_g450_info* m2info) { - MINFO_FROM(m2info->primary_dev); +static void computeRegs(WPMINFO struct mavenregs* r, struct my_timming* mt, const struct output_desc* outd) { + u_int32_t chromasc; + u_int32_t hlen; + u_int32_t hsl; + u_int32_t hbp; + u_int32_t hfp; + u_int32_t hvis; + unsigned int pixclock; + unsigned long long piic; + int mnp; + int over; + + r->regs[0x80] = 0x03; /* | 0x40 for SCART */ - down_write(&ACCESS_FBINFO(altout.lock)); - ACCESS_FBINFO(altout.device) = m2info; - ACCESS_FBINFO(altout.output) = &matroxfb_g450_altout; - up_write(&ACCESS_FBINFO(altout.lock)); - ACCESS_FBINFO(output.all) |= MATROXFB_OUTPUT_CONN_SECONDARY; - matroxfb_switch(ACCESS_FBINFO(currcon), (struct fb_info*)MINFO); - return 0; + hvis = ((mt->HDisplay << 1) + 3) & ~3; + + if (hvis >= 2048) { + hvis = 2044; + } + + piic = 1000000000ULL * hvis; + do_div(piic, outd->h_vis); + + dprintk(KERN_DEBUG "Want %u kHz pixclock\n", (unsigned int)piic); + + mnp = matroxfb_g450_setclk(PMINFO piic, M_VIDEO_PLL); + + mt->mnp = mnp; + mt->pixclock = g450_mnp2f(PMINFO mnp); + + dprintk(KERN_DEBUG "MNP=%08X\n", mnp); + + pixclock = 1000000000U / mt->pixclock; + + dprintk(KERN_DEBUG "Got %u ps pixclock\n", pixclock); + + piic = outd->chromasc; + do_div(piic, mt->pixclock); + chromasc = piic; + + dprintk(KERN_DEBUG "Chroma is %08X\n", chromasc); + + r->regs[0] = piic >> 24; + r->regs[1] = piic >> 16; + r->regs[2] = piic >> 8; + r->regs[3] = piic >> 0; + hbp = (((outd->h_b_porch + pixclock) / pixclock)) & ~1; + hfp = (((outd->h_f_porch + pixclock) / pixclock)) & ~1; + hsl = (((outd->h_sync + pixclock) / pixclock)) & ~1; + hlen = hvis + hfp + hsl + hbp; + over = hlen & 0x0F; + + dprintk(KERN_DEBUG "WL: vis=%u, hf=%u, hs=%u, hb=%u, total=%u\n", hvis, hfp, hsl, hbp, hlen); + + if (over) { + hfp -= over; + hlen -= over; + if (over <= 2) { + } else if (over < 10) { + hfp += 4; + hlen += 4; + } else { + hfp += 16; + hlen += 16; + } + } + + /* maybe cve2 has requirement 800 < hlen < 1184 */ + r->regs[0x08] = hsl; + r->regs[0x09] = (outd->burst + pixclock - 1) / pixclock; /* burst length */ + r->regs[0x0A] = hbp; + r->regs[0x2C] = hfp; + r->regs[0x31] = hvis / 8; + r->regs[0x32] = hvis & 7; + + dprintk(KERN_DEBUG "PG: vis=%04X, hf=%02X, hs=%02X, hb=%02X, total=%04X\n", hvis, hfp, hsl, hbp, hlen); + + r->regs[0x84] = 1; /* x sync point */ + r->regs[0x85] = 0; + hvis = hvis >> 1; + hlen = hlen >> 1; + + dprintk(KERN_DEBUG "hlen=%u hvis=%u\n", hlen, hvis); + + mt->interlaced = 1; + + mt->HDisplay = hvis & ~7; + mt->HSyncStart = mt->HDisplay + 8; + mt->HSyncEnd = (hlen & ~7) - 8; + mt->HTotal = hlen; + + { + int upper; + unsigned int vtotal; + unsigned int vsyncend; + unsigned int vdisplay; + + vtotal = mt->VTotal; + vsyncend = mt->VSyncEnd; + vdisplay = mt->VDisplay; + if (vtotal < outd->v_total) { + unsigned int yovr = outd->v_total - vtotal; + + vsyncend += yovr >> 1; + } else if (vtotal > outd->v_total) { + vdisplay = outd->v_total - 4; + vsyncend = outd->v_total; + } + upper = (outd->v_total - vsyncend) >> 1; /* in field lines */ + r->regs[0x17] = outd->v_total / 4; + r->regs[0x18] = outd->v_total & 3; + r->regs[0x33] = upper - 1; /* upper blanking */ + r->regs[0x82] = upper; /* y sync point */ + r->regs[0x83] = upper >> 8; + + mt->VDisplay = vdisplay; + mt->VSyncStart = outd->v_total - 2; + mt->VSyncEnd = outd->v_total; + mt->VTotal = outd->v_total; + } +} + +static void cve2_init_TVdata(int norm, struct mavenregs* data, const struct output_desc** outd) { + static const struct output_desc paloutd = { + .h_vis = 52148148, // ps + .h_f_porch = 1407407, // ps + .h_sync = 4666667, // ps + .h_b_porch = 5777778, // ps + .chromasc = 19042247534182ULL, // 4433618.750 Hz + .burst = 2518518, // ps + .v_total = 625, + }; + static const struct output_desc ntscoutd = { + .h_vis = 52888889, // ps + .h_f_porch = 1333333, // ps + .h_sync = 4666667, // ps + .h_b_porch = 4666667, // ps + .chromasc = 15374030659475ULL, // 3579545.454 Hz + .burst = 2418418, // ps + .v_total = 525, // lines + }; + + static const struct mavenregs palregs = { { + 0x2A, 0x09, 0x8A, 0xCB, /* 00: chroma subcarrier */ + 0x00, + 0x00, /* test */ + 0xF9, /* modified by code (F9 written...) */ + 0x00, /* ? not written */ + 0x7E, /* 08 */ + 0x44, /* 09 */ + 0x9C, /* 0A */ + 0x2E, /* 0B */ + 0x21, /* 0C */ + 0x00, /* ? not written */ +// 0x3F, 0x03, /* 0E-0F */ + 0x3C, 0x03, + 0x3C, 0x03, /* 10-11 */ + 0x1A, /* 12 */ + 0x2A, /* 13 */ + 0x1C, 0x3D, 0x14, /* 14-16 */ + 0x9C, 0x01, /* 17-18 */ + 0x00, /* 19 */ + 0xFE, /* 1A */ + 0x7E, /* 1B */ + 0x60, /* 1C */ + 0x05, /* 1D */ +// 0x89, 0x03, /* 1E-1F */ + 0xAD, 0x03, +// 0x72, /* 20 */ + 0xA5, + 0x07, /* 21 */ +// 0x72, /* 22 */ + 0xA5, + 0x00, /* 23 */ + 0x00, /* 24 */ + 0x00, /* 25 */ + 0x08, /* 26 */ + 0x04, /* 27 */ + 0x00, /* 28 */ + 0x1A, /* 29 */ + 0x55, 0x01, /* 2A-2B */ + 0x26, /* 2C */ + 0x07, 0x7E, /* 2D-2E */ + 0x02, 0x54, /* 2F-30 */ + 0xB0, 0x00, /* 31-32 */ + 0x14, /* 33 */ + 0x49, /* 34 */ + 0x00, /* 35 written multiple times */ + 0x00, /* 36 not written */ + 0xA3, /* 37 */ + 0xC8, /* 38 */ + 0x22, /* 39 */ + 0x02, /* 3A */ + 0x22, /* 3B */ + 0x3F, 0x03, /* 3C-3D */ + 0x00, /* 3E written multiple times */ + 0x00, /* 3F not written */ + } }; + static struct mavenregs ntscregs = { { + 0x21, 0xF0, 0x7C, 0x1F, /* 00: chroma subcarrier */ + 0x00, + 0x00, /* test */ + 0xF9, /* modified by code (F9 written...) */ + 0x00, /* ? not written */ + 0x7E, /* 08 */ + 0x43, /* 09 */ + 0x7E, /* 0A */ + 0x3D, /* 0B */ + 0x00, /* 0C */ + 0x00, /* ? not written */ + 0x41, 0x00, /* 0E-0F */ + 0x3C, 0x00, /* 10-11 */ + 0x17, /* 12 */ + 0x21, /* 13 */ + 0x1B, 0x1B, 0x24, /* 14-16 */ + 0x83, 0x01, /* 17-18 */ + 0x00, /* 19 */ + 0x0F, /* 1A */ + 0x0F, /* 1B */ + 0x60, /* 1C */ + 0x05, /* 1D */ + //0x89, 0x02, /* 1E-1F */ + 0xC0, 0x02, /* 1E-1F */ + //0x5F, /* 20 */ + 0x9C, /* 20 */ + 0x04, /* 21 */ + //0x5F, /* 22 */ + 0x9C, /* 22 */ + 0x01, /* 23 */ + 0x02, /* 24 */ + 0x00, /* 25 */ + 0x0A, /* 26 */ + 0x05, /* 27 */ + 0x00, /* 28 */ + 0x10, /* 29 */ + 0xFF, 0x03, /* 2A-2B */ + 0x24, /* 2C */ + 0x0F, 0x78, /* 2D-2E */ + 0x00, 0x00, /* 2F-30 */ + 0xB2, 0x04, /* 31-32 */ + 0x14, /* 33 */ + 0x02, /* 34 */ + 0x00, /* 35 written multiple times */ + 0x00, /* 36 not written */ + 0xA3, /* 37 */ + 0xC8, /* 38 */ + 0x15, /* 39 */ + 0x05, /* 3A */ + 0x3B, /* 3B */ + 0x3C, 0x00, /* 3C-3D */ + 0x00, /* 3E written multiple times */ + 0x00, /* never written */ + } }; + + if (norm == MATROXFB_OUTPUT_MODE_PAL) { + *data = palregs; + *outd = &paloutd; + } else { + *data = ntscregs; + *outd = &ntscoutd; + } + return; } -static void matroxfb_g450_shutdown(struct matroxfb_g450_info* m2info) { - MINFO_FROM(m2info->primary_dev); +#define LR(x) cve2_set_reg(PMINFO (x), m->regs[(x)]) +static void cve2_init_TV(WPMINFO const struct mavenregs* m) { + int i; + + LR(0x80); + LR(0x82); LR(0x83); + LR(0x84); LR(0x85); - if (MINFO) { - ACCESS_FBINFO(output.all) &= ~MATROXFB_OUTPUT_CONN_SECONDARY; - ACCESS_FBINFO(output.ph) &= ~MATROXFB_OUTPUT_CONN_SECONDARY; - ACCESS_FBINFO(output.sh) &= ~MATROXFB_OUTPUT_CONN_SECONDARY; - down_write(&ACCESS_FBINFO(altout.lock)); - ACCESS_FBINFO(altout.device) = NULL; - ACCESS_FBINFO(altout.output) = NULL; - up_write(&ACCESS_FBINFO(altout.lock)); - m2info->primary_dev = NULL; + cve2_set_reg(PMINFO 0x3E, 0x01); + + for (i = 0; i < 0x3E; i++) { + LR(i); } + cve2_set_reg(PMINFO 0x3E, 0x00); } -/* we do not have __setup() yet */ -static void* matroxfb_g450_probe(struct matrox_fb_info* minfo) { - struct matroxfb_g450_info* m2info; +static int matroxfb_g450_compute(void* md, struct my_timming* mt) { + MINFO_FROM(md); - /* hardware is not G450... */ - if (!ACCESS_FBINFO(devflags.g450dac)) - return NULL; - m2info = (struct matroxfb_g450_info*)kmalloc(sizeof(*m2info), GFP_KERNEL); - if (!m2info) { - printk(KERN_ERR "matroxfb_g450: Not enough memory for G450 DAC control structs\n"); - return NULL; + dprintk(KERN_DEBUG "Computing, mode=%u\n", ACCESS_FBINFO(outputs[1]).mode); + + if (mt->crtc == MATROXFB_SRC_CRTC2 && + ACCESS_FBINFO(outputs[1]).mode != MATROXFB_OUTPUT_MODE_MONITOR) { + const struct output_desc* outd; + + cve2_init_TVdata(ACCESS_FBINFO(outputs[1]).mode, &ACCESS_FBINFO(hw).maven, &outd); + { + int blacklevel, whitelevel; + g450_compute_bwlevel(PMINFO &blacklevel, &whitelevel); + ACCESS_FBINFO(hw).maven.regs[0x0E] = blacklevel >> 2; + ACCESS_FBINFO(hw).maven.regs[0x0F] = blacklevel & 3; + ACCESS_FBINFO(hw).maven.regs[0x1E] = whitelevel >> 2; + ACCESS_FBINFO(hw).maven.regs[0x1F] = whitelevel & 3; + + ACCESS_FBINFO(hw).maven.regs[0x20] = + ACCESS_FBINFO(hw).maven.regs[0x22] = ACCESS_FBINFO(altout.tvo_params.saturation); + + ACCESS_FBINFO(hw).maven.regs[0x25] = ACCESS_FBINFO(altout.tvo_params.hue); + + if (ACCESS_FBINFO(altout.tvo_params.testout)) { + ACCESS_FBINFO(hw).maven.regs[0x05] |= 0x02; + } + } + computeRegs(PMINFO &ACCESS_FBINFO(hw).maven, mt, outd); + } else if (mt->mnp < 0) { + /* We must program clocks before CRTC2, otherwise interlaced mode + startup may fail */ + mt->mnp = matroxfb_g450_setclk(PMINFO mt->pixclock, (mt->crtc == MATROXFB_SRC_CRTC1) ? M_PIXEL_PLL_C : M_VIDEO_PLL); + mt->pixclock = g450_mnp2f(PMINFO mt->mnp); } - memset(m2info, 0, sizeof(*m2info)); - m2info->primary_dev = MINFO; - if (matroxfb_g450_connect(m2info)) { - kfree(m2info); - printk(KERN_ERR "matroxfb_g450: G450 DAC failed to initialize\n"); - return NULL; + dprintk(KERN_DEBUG "Pixclock = %u\n", mt->pixclock); + return 0; +} + +static int matroxfb_g450_program(void* md) { + MINFO_FROM(md); + + if (ACCESS_FBINFO(outputs[1]).mode != MATROXFB_OUTPUT_MODE_MONITOR) { + cve2_init_TV(PMINFO &ACCESS_FBINFO(hw).maven); } - return m2info; + return 0; } -static void matroxfb_g450_remove(struct matrox_fb_info* minfo, void* g450) { - matroxfb_g450_shutdown(g450); - kfree(g450); +static int matroxfb_g450_verify_mode(void* md, u_int32_t arg) { + MINFO_FROM(md); + + switch (arg) { + case MATROXFB_OUTPUT_MODE_PAL: + case MATROXFB_OUTPUT_MODE_NTSC: + case MATROXFB_OUTPUT_MODE_MONITOR: + return 0; + } + return -EINVAL; } -static struct matroxfb_driver g450 = { - name: "Matrox G450 output #2", - probe: matroxfb_g450_probe, - remove: matroxfb_g450_remove }; +static int g450_dvi_compute(void* md, struct my_timming* mt) { + MINFO_FROM(md); -static int matroxfb_g450_init(void) { - matroxfb_register_driver(&g450); + if (mt->mnp < 0) { + mt->mnp = matroxfb_g450_setclk(PMINFO mt->pixclock, (mt->crtc == MATROXFB_SRC_CRTC1) ? M_PIXEL_PLL_C : M_VIDEO_PLL); + mt->pixclock = g450_mnp2f(PMINFO mt->mnp); + } return 0; } -static void matroxfb_g450_exit(void) { - matroxfb_unregister_driver(&g450); +static struct matrox_altout matroxfb_g450_altout = { + .owner = THIS_MODULE, + .name = "Secondary output", + .compute = matroxfb_g450_compute, + .program = matroxfb_g450_program, + .verifymode = matroxfb_g450_verify_mode, + .getqueryctrl = g450_query_ctrl, + .getctrl = g450_get_ctrl, + .setctrl = g450_set_ctrl, +}; + +static struct matrox_altout matroxfb_g450_dvi = { + .owner = THIS_MODULE, + .name = "DVI output", + .compute = g450_dvi_compute, +}; + +void matroxfb_g450_connect(WPMINFO2) { + if (ACCESS_FBINFO(devflags.g450dac)) { + down_write(&ACCESS_FBINFO(altout.lock)); + tvo_fill_defaults(PMINFO2); + ACCESS_FBINFO(outputs[1]).src = MATROXFB_SRC_CRTC1; + ACCESS_FBINFO(outputs[1]).data = MINFO; + ACCESS_FBINFO(outputs[1]).output = &matroxfb_g450_altout; + ACCESS_FBINFO(outputs[1]).mode = MATROXFB_OUTPUT_MODE_MONITOR; + ACCESS_FBINFO(outputs[2]).src = MATROXFB_SRC_CRTC1; + ACCESS_FBINFO(outputs[2]).data = MINFO; + ACCESS_FBINFO(outputs[2]).output = &matroxfb_g450_dvi; + ACCESS_FBINFO(outputs[2]).mode = MATROXFB_OUTPUT_MODE_MONITOR; + up_write(&ACCESS_FBINFO(altout.lock)); + } } -MODULE_AUTHOR("(c) 2000-2001 Petr Vandrovec "); -MODULE_DESCRIPTION("Matrox G450 secondary output driver"); +void matroxfb_g450_shutdown(WPMINFO2) { + if (ACCESS_FBINFO(devflags.g450dac)) { + down_write(&ACCESS_FBINFO(altout.lock)); + ACCESS_FBINFO(outputs[1]).src = MATROXFB_SRC_NONE; + ACCESS_FBINFO(outputs[1]).output = NULL; + ACCESS_FBINFO(outputs[1]).data = NULL; + ACCESS_FBINFO(outputs[1]).mode = MATROXFB_OUTPUT_MODE_MONITOR; + ACCESS_FBINFO(outputs[2]).src = MATROXFB_SRC_NONE; + ACCESS_FBINFO(outputs[2]).output = NULL; + ACCESS_FBINFO(outputs[2]).data = NULL; + ACCESS_FBINFO(outputs[2]).mode = MATROXFB_OUTPUT_MODE_MONITOR; + up_write(&ACCESS_FBINFO(altout.lock)); + } +} + +EXPORT_SYMBOL(matroxfb_g450_connect); +EXPORT_SYMBOL(matroxfb_g450_shutdown); + +MODULE_AUTHOR("(c) 2000-2002 Petr Vandrovec "); +MODULE_DESCRIPTION("Matrox G450/G550 output driver"); MODULE_LICENSE("GPL"); -module_init(matroxfb_g450_init); -module_exit(matroxfb_g450_exit); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_g450.h linux.20pre5-ac2/drivers/video/matrox/matroxfb_g450.h --- linux.20pre5/drivers/video/matrox/matroxfb_g450.h 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_g450.h 2002-09-02 14:57:05.000000000 +0100 @@ -1,12 +1,14 @@ #ifndef __MATROXFB_G450_H__ #define __MATROXFB_G450_H__ -#include #include "matroxfb_base.h" -struct matroxfb_g450_info { - struct matrox_fb_info* primary_dev; - unsigned int timmings; -}; +#ifdef CONFIG_FB_MATROX_G450 +void matroxfb_g450_connect(WPMINFO2); +void matroxfb_g450_shutdown(WPMINFO2); +#else +static inline void matroxfb_g450_connect(WPMINFO2) { }; +static inline void matroxfb_g450_shutdown(WPMINFO2) { }; +#endif -#endif /* __MATROXFB_MAVEN_H__ */ +#endif /* __MATROXFB_G450_H__ */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_maven.c linux.20pre5-ac2/drivers/video/matrox/matroxfb_maven.c --- linux.20pre5/drivers/video/matrox/matroxfb_maven.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_maven.c 2002-09-02 00:06:57.000000000 +0100 @@ -2,11 +2,11 @@ * * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450. * - * (c) 1998-2001 Petr Vandrovec + * (c) 1998-2002 Petr Vandrovec * * Portions Copyright (c) 2001 Matrox Graphics Inc. * - * Version: 1.62 2001/11/29 + * Version: 1.64 2002/06/10 * * See matroxfb_base.c for contributors. * @@ -30,13 +30,125 @@ #define MGATVO_B 1 #define MGATVO_C 2 +static const struct maven_gamma { + unsigned char reg83; + unsigned char reg84; + unsigned char reg85; + unsigned char reg86; + unsigned char reg87; + unsigned char reg88; + unsigned char reg89; + unsigned char reg8a; + unsigned char reg8b; +} maven_gamma[] = { + { 131, 57, 223, 15, 117, 212, 251, 91, 156}, + { 133, 61, 128, 63, 180, 147, 195, 100, 180}, + { 131, 19, 63, 31, 50, 66, 171, 64, 176}, + { 0, 0, 0, 31, 16, 16, 16, 100, 200}, + { 8, 23, 47, 73, 147, 244, 220, 80, 195}, + { 22, 43, 64, 80, 147, 115, 58, 85, 168}, + { 34, 60, 80, 214, 147, 212, 188, 85, 167}, + { 45, 77, 96, 216, 147, 99, 91, 85, 159}, + { 56, 76, 112, 107, 147, 212, 148, 64, 144}, + { 65, 91, 128, 137, 147, 196, 17, 69, 148}, + { 72, 104, 136, 138, 147, 180, 245, 73, 147}, + { 87, 116, 143, 126, 16, 83, 229, 77, 144}, + { 95, 119, 152, 254, 244, 83, 221, 77, 151}, + { 100, 129, 159, 156, 244, 148, 197, 77, 160}, + { 105, 141, 167, 247, 244, 132, 181, 84, 166}, + { 105, 147, 168, 247, 244, 245, 181, 90, 170}, + { 120, 153, 175, 248, 212, 229, 165, 90, 180}, + { 119, 156, 176, 248, 244, 229, 84, 74, 160}, + { 119, 158, 183, 248, 244, 229, 149, 78, 165} +}; + +/* Definition of the various controls */ +struct mctl { + struct matroxfb_queryctrl desc; + size_t control; +}; + +#define BLMIN 0x0FF +#define WLMAX 0x3FF + +static const struct mctl maven_controls[] = +{ { { MATROXFB_CID_BRIGHTNESS, + "brightness", + 0, WLMAX - BLMIN, 1, 379 - BLMIN, + MATROXFB_CTRL_TYPE_INTEGER, 0, 0, + "picture" + }, offsetof(struct matrox_fb_info, altout.tvo_params.brightness) }, + { { MATROXFB_CID_CONTRAST, + "contrast", + 0, 1023, 1, 127, + MATROXFB_CTRL_TYPE_INTEGER, 0, 0, + "picture" + }, offsetof(struct matrox_fb_info, altout.tvo_params.contrast) }, + { { MATROXFB_CID_SATURATION, + "saturation", + 0, 255, 1, 155, + MATROXFB_CTRL_TYPE_INTEGER, 0, 0, + "picture" + }, offsetof(struct matrox_fb_info, altout.tvo_params.saturation) }, + { { MATROXFB_CID_HUE, + "hue", + 0, 255, 1, 0, + MATROXFB_CTRL_TYPE_INTEGER, 0, 0, + "picture" + }, offsetof(struct matrox_fb_info, altout.tvo_params.hue) }, + { { MATROXFB_CID_GAMMA, + "gamma", + 0, sizeof(maven_gamma)/sizeof(maven_gamma[0])-1, 1, 3, + MATROXFB_CTRL_TYPE_INTEGER, 0, 0, + "picture" + }, offsetof(struct matrox_fb_info, altout.tvo_params.gamma) }, + { { MATROXFB_CID_TESTOUT, + "test output", + 0, 1, 1, 0, + MATROXFB_CTRL_TYPE_BOOLEAN, 0, 0, + "picture" + }, offsetof(struct matrox_fb_info, altout.tvo_params.testout) }, + { { MATROXFB_CID_DEFLICKER, + "deflicker mode", + 0, 2, 1, 0, + MATROXFB_CTRL_TYPE_INTEGER, 0, 0, + "picture" + }, offsetof(struct matrox_fb_info, altout.tvo_params.deflicker) }, + +}; + +#define MAVCTRLS (sizeof(maven_controls)/sizeof(maven_controls[0])) + +/* Return: positive number: id found + -EINVAL: id not found, return failure + -ENOENT: id not found, create fake disabled control */ +static int get_ctrl_id(__u32 v4l2_id) { + int i; + + for (i = 0; i < MAVCTRLS; i++) { + if (v4l2_id < maven_controls[i].desc.id) { + if (maven_controls[i].desc.id == 0x08000000) { + return -EINVAL; + } + return -ENOENT; + } + if (v4l2_id == maven_controls[i].desc.id) { + return i; + } + } + return -EINVAL; +} + struct maven_data { struct matrox_fb_info* primary_head; struct i2c_client* client; - int mode; int version; }; +static int* get_ctrl_ptr(struct maven_data* md, int idx) { + return (int*)((char*)(md->primary_head) + maven_controls[idx].control); +} + static int maven_get_reg(struct i2c_client* c, char reg) { char dst; struct i2c_msg msgs[] = {{ c->addr, I2C_M_REV_DIR_ADDR, sizeof(reg), ® }, @@ -127,8 +239,8 @@ fwant = htotal * vtotal; fmax = pll->vco_freq_max / ctl->den; - printk(KERN_DEBUG "want: %u, xtal: %u, h: %u, v: %u, fmax: %u\n", - fwant, fxtal, htotal, vtotal, fmax); +/* printk(KERN_DEBUG "want: %u, xtal: %u, h: %u, v: %u, fmax: %u\n", + fwant, fxtal, htotal, vtotal, fmax); */ for (p = 1; p <= pll->post_shift_max; p++) { if (fwant * 2 > fmax) break; @@ -163,9 +275,9 @@ ln = ln - scrlen; if (ln > htotal) continue; - printk(KERN_DEBUG "Match: %u / %u / %u / %u\n", n, m, p, ln); + dprintk(KERN_DEBUG "Match: %u / %u / %u / %u\n", n, m, p, ln); if (ln > besth2) { - printk(KERN_DEBUG "Better...\n"); + dprintk(KERN_DEBUG "Better...\n"); *h2 = besth2 = ln; *post = p; *in = m; @@ -221,6 +333,38 @@ return; } +static unsigned char maven_compute_deflicker (const struct maven_data* md) { + unsigned char df; + + df = (md->version == MGATVO_B?0x40:0x00); + switch (md->primary_head->altout.tvo_params.deflicker) { + case 0: +/* df |= 0x00; */ + break; + case 1: + df |= 0xB1; + break; + case 2: + df |= 0xA2; + break; + } + return df; +} + +static void maven_compute_bwlevel (const struct maven_data* md, + int *bl, int *wl) { + const int b = md->primary_head->altout.tvo_params.brightness + BLMIN; + const int c = md->primary_head->altout.tvo_params.contrast; + + *bl = max(b - c, BLMIN); + *wl = min(b + c, WLMAX); +} + +static const struct maven_gamma* maven_compute_gamma (const struct maven_data* md) { + return maven_gamma + md->primary_head->altout.tvo_params.gamma; +} + + static void maven_init_TVdata(const struct maven_data* md, struct mavenregs* data) { static struct mavenregs palregs = { { 0x2A, 0x09, 0x8A, 0xCB, /* 00: chroma subcarrier */ @@ -326,26 +470,50 @@ 0x00, /* 3E written multiple times */ 0x00, /* never written */ }, MODE_NTSC, 525, 60 }; + MINFO_FROM(md->primary_head); - if (md->mode & MODE_PAL) + if (ACCESS_FBINFO(outputs[1].mode) == MODE_PAL) *data = palregs; - else - *data = ntscregs; - - data->regs[0x93] = 0xA2; - - /* gamma correction registers */ - data->regs[0x83] = 0x00; - data->regs[0x84] = 0x00; - data->regs[0x85] = 0x00; - data->regs[0x86] = 0x1F; - data->regs[0x87] = 0x10; - data->regs[0x88] = 0x10; - data->regs[0x89] = 0x10; - data->regs[0x8A] = 0x64; /* 100 */ - data->regs[0x8B] = 0xC8; /* 200 */ - - return; + else + *data = ntscregs; + + /* Set deflicker */ + data->regs[0x93] = maven_compute_deflicker(md); + + /* set gamma */ + { + const struct maven_gamma* g; + g = maven_compute_gamma(md); + data->regs[0x83] = g->reg83; + data->regs[0x84] = g->reg84; + data->regs[0x85] = g->reg85; + data->regs[0x86] = g->reg86; + data->regs[0x87] = g->reg87; + data->regs[0x88] = g->reg88; + data->regs[0x89] = g->reg89; + data->regs[0x8A] = g->reg8a; + data->regs[0x8B] = g->reg8b; + } + + /* Set contrast / brightness */ + { + int bl, wl; + maven_compute_bwlevel (md, &bl, &wl); + data->regs[0x0e] = bl >> 2; + data->regs[0x0f] = bl & 3; + data->regs[0x1e] = wl >> 2; + data->regs[0x1f] = wl & 3; + } + + /* Set saturation */ + { + data->regs[0x20] = + data->regs[0x22] = ACCESS_FBINFO(altout.tvo_params.saturation); + } + + /* Set HUE */ + data->regs[0x25] = ACCESS_FBINFO(altout.tvo_params.hue); + return; } #define LR(x) maven_set_reg(c, (x), m->regs[(x)]) @@ -386,7 +554,7 @@ LRP(0x17); LR(0x0B); LR(0x0C); - if (m->mode & MODE_PAL) { + if (m->mode == MODE_PAL) { maven_set_reg(c, 0x35, 0x10); /* ... */ } else { maven_set_reg(c, 0x35, 0x0F); /* ... */ @@ -424,7 +592,7 @@ LR(0x27); LR(0x21); LRP(0x2A); - if (m->mode & MODE_PAL) + if (m->mode == MODE_PAL) maven_set_reg(c, 0x35, 0x1D); /* ... */ else maven_set_reg(c, 0x35, 0x1C); @@ -473,7 +641,7 @@ LR(0xC2); maven_get_reg(c, 0x8D); - maven_set_reg(c, 0x8D, 0x00); + maven_set_reg(c, 0x8D, 0x04); LR(0x20); /* saturation #1 */ LR(0x22); /* saturation #2 */ @@ -498,7 +666,7 @@ LR(0x8B); val = maven_get_reg(c, 0x8D); - val &= 0x10; /* 0x10 or anything ored with it */ + val &= 0x14; /* 0x10 or anything ored with it */ maven_set_reg(c, 0x8D, val); LR(0x33); @@ -524,7 +692,7 @@ LR(0x27); LR(0x21); LRP(0x2A); - if (m->mode & MODE_PAL) + if (m->mode == MODE_PAL) maven_set_reg(c, 0x35, 0x1D); else maven_set_reg(c, 0x35, 0x1C); @@ -562,7 +730,7 @@ unsigned int a, b, c, h2; unsigned int h = ht + 2 + x; - if (!matroxfb_mavenclock((m->mode & MODE_PAL) ? &maven_PAL : &maven_NTSC, h, vt, &a, &b, &c, &h2)) { + if (!matroxfb_mavenclock((m->mode == MODE_PAL) ? &maven_PAL : &maven_NTSC, h, vt, &a, &b, &c, &h2)) { unsigned int diff = h - h2; if (diff < err) { @@ -584,8 +752,8 @@ unsigned int tmpi; unsigned int a, bv, c; - m->mode = md->mode; - if (MODE_TV(md->mode)) { + m->mode = md->primary_head->outputs[1].mode; + if (MODE_TV(m->mode)) { unsigned int lmargin; unsigned int umargin; unsigned int vslen; @@ -804,7 +972,7 @@ m->regs[0xB0] = 0x03; /* output: monitor */ m->regs[0xB1] = 0xA0; /* ??? */ m->regs[0x8C] = 0x20; /* must be set... */ - m->regs[0x8D] = 0x00; /* defaults to 0x10: test signal */ + m->regs[0x8D] = 0x04; /* defaults to 0x10: test signal */ m->regs[0xB9] = 0x1A; /* defaults to 0x2C: too bright */ m->regs[0xBF] = 0x22; /* makes picture stable */ @@ -849,25 +1017,122 @@ return 0; } -static inline int maven_resync(struct maven_data* md) { +static inline int maven_start(struct maven_data* md) { struct i2c_client* c = md->client; maven_set_reg(c, 0x95, 0x20); /* start whole thing */ return 0; } -static int maven_set_output_mode(struct maven_data* md, u_int32_t arg) { - switch (arg) { - case MATROXFB_OUTPUT_MODE_PAL: - case MATROXFB_OUTPUT_MODE_NTSC: - case MATROXFB_OUTPUT_MODE_MONITOR: - md->mode = arg; - return 1; +static int maven_get_queryctrl (struct maven_data* md, + struct matroxfb_queryctrl *p) { + int i; + + i = get_ctrl_id(p->id); + if (i >= 0) { + *p = maven_controls[i].desc; + return 0; + } + if (i == -ENOENT) { + static const struct matroxfb_queryctrl disctrl = + { 0, "", 0, 0, 0, 0, 0, 1, 1, "Disabled" }; + + i = p->id; + *p = disctrl; + p->id = i; + sprintf(p->name, "Ctrl #%08X", i); + return 0; } return -EINVAL; } -static int maven_get_output_mode(struct maven_data* md, u_int32_t *arg) { - *arg = md->mode; +static int maven_set_control (struct maven_data* md, + struct matroxfb_control *p) { + int i; + + i = get_ctrl_id(p->id); + if (i < 0) return -EINVAL; + + /* + * Check if changed. + */ + if (p->value == *get_ctrl_ptr(md, i)) return 0; + + /* + * Check limits. + */ + if (p->value > maven_controls[i].desc.maximum) return -EINVAL; + if (p->value < maven_controls[i].desc.minimum) return -EINVAL; + + /* + * Store new value. + */ + *get_ctrl_ptr(md, i) = p->value; + + switch (p->id) { + case MATROXFB_CID_BRIGHTNESS: + case MATROXFB_CID_CONTRAST: + { + int blacklevel, whitelevel; + maven_compute_bwlevel(md, &blacklevel, &whitelevel); + blacklevel = (blacklevel >> 2) | ((blacklevel & 3) << 8); + whitelevel = (whitelevel >> 2) | ((whitelevel & 3) << 8); + maven_set_reg_pair(md->client, 0x0e, blacklevel); + maven_set_reg_pair(md->client, 0x1e, whitelevel); + } + break; + case MATROXFB_CID_SATURATION: + { + maven_set_reg(md->client, 0x20, p->value); + maven_set_reg(md->client, 0x22, p->value); + } + break; + case MATROXFB_CID_HUE: + { + maven_set_reg(md->client, 0x25, p->value); + } + break; + case MATROXFB_CID_GAMMA: + { + const struct maven_gamma* g; + g = maven_compute_gamma(md); + maven_set_reg(md->client, 0x83, g->reg83); + maven_set_reg(md->client, 0x84, g->reg84); + maven_set_reg(md->client, 0x85, g->reg85); + maven_set_reg(md->client, 0x86, g->reg86); + maven_set_reg(md->client, 0x87, g->reg87); + maven_set_reg(md->client, 0x88, g->reg88); + maven_set_reg(md->client, 0x89, g->reg89); + maven_set_reg(md->client, 0x8a, g->reg8a); + maven_set_reg(md->client, 0x8b, g->reg8b); + } + break; + case MATROXFB_CID_TESTOUT: + { + unsigned char val + = maven_get_reg (md->client,0x8d); + if (p->value) val |= 0x10; + else val &= ~0x10; + maven_set_reg (md->client, 0x8d, val); + } + break; + case MATROXFB_CID_DEFLICKER: + { + maven_set_reg(md->client, 0x93, maven_compute_deflicker(md)); + } + break; + } + + + return 0; +} + +static int maven_get_control (struct maven_data* md, + struct matroxfb_control *p) { + int i; + + i = get_ctrl_id(p->id); + if (i < 0) return -EINVAL; + p->value = *get_ctrl_ptr(md, i); return 0; } @@ -890,56 +1155,73 @@ } static int maven_out_start(void* md) { - return maven_resync(md); + return maven_start(md); } -static void maven_out_incuse(void* md) { - if (md) - i2c_inc_use_client(((struct maven_data*)md)->client); +static int maven_out_verify_mode(void* md, u_int32_t arg) { + switch (arg) { + case MATROXFB_OUTPUT_MODE_PAL: + case MATROXFB_OUTPUT_MODE_NTSC: + case MATROXFB_OUTPUT_MODE_MONITOR: + return 0; + } + return -EINVAL; } -static void maven_out_decuse(void* md) { - if (md) - i2c_dec_use_client(((struct maven_data*)md)->client); +static int maven_out_get_queryctrl(void* md, struct matroxfb_queryctrl* p) { + return maven_get_queryctrl(md, p); } -static int maven_out_set_mode(void* md, u_int32_t arg) { - return maven_set_output_mode(md, arg); +static int maven_out_get_ctrl(void* md, struct matroxfb_control* p) { + return maven_get_control(md, p); } -static int maven_out_get_mode(void* md, u_int32_t* arg) { - return maven_get_output_mode(md, arg); +static int maven_out_set_ctrl(void* md, struct matroxfb_control* p) { + return maven_set_control(md, p); } static struct matrox_altout maven_altout = { - maven_out_compute, - maven_out_program, - maven_out_start, - maven_out_incuse, - maven_out_decuse, - maven_out_set_mode, - maven_out_get_mode + .owner = THIS_MODULE, + .name = "Secondary output", + .compute = maven_out_compute, + .program = maven_out_program, + .start = maven_out_start, + .verifymode = maven_out_verify_mode, + .getqueryctrl = maven_out_get_queryctrl, + .getctrl = maven_out_get_ctrl, + .setctrl = maven_out_set_ctrl, }; static int maven_init_client(struct i2c_client* clnt) { struct i2c_adapter* a = clnt->adapter; struct maven_data* md = clnt->data; - struct matroxfb_dh_maven_info* m2info __attribute__((unused)) = ((struct i2c_bit_adapter*)a)->minfo; - MINFO_FROM(m2info->primary_dev); + MINFO_FROM(list_entry(a, struct i2c_bit_adapter, adapter)->minfo); - md->mode = MODE_MONITOR; md->primary_head = MINFO; md->client = clnt; down_write(&ACCESS_FBINFO(altout.lock)); - ACCESS_FBINFO(altout.device) = md; - ACCESS_FBINFO(altout.output) = &maven_altout; + ACCESS_FBINFO(outputs[1]).output = &maven_altout; + ACCESS_FBINFO(outputs[1]).src = MATROXFB_SRC_NONE; + ACCESS_FBINFO(outputs[1]).data = md; + ACCESS_FBINFO(outputs[1]).mode = MATROXFB_OUTPUT_MODE_MONITOR; up_write(&ACCESS_FBINFO(altout.lock)); - ACCESS_FBINFO(output.all) |= MATROXFB_OUTPUT_CONN_SECONDARY; if (maven_get_reg(clnt, 0xB2) < 0x14) { md->version = MGATVO_B; + /* Tweak some things for this old chip */ } else { md->version = MGATVO_C; } + /* + * Set all parameters to its initial values. + */ + { + unsigned int i; + + for (i = 0; i < MAVCTRLS; ++i) { + *get_ctrl_ptr(md, i) = maven_controls[i].desc.default_value; + } + } + return 0; } @@ -947,13 +1229,14 @@ struct maven_data* md = clnt->data; if (md->primary_head) { - md->primary_head->output.all &= ~MATROXFB_OUTPUT_CONN_SECONDARY; - md->primary_head->output.ph &= ~MATROXFB_OUTPUT_CONN_SECONDARY; - md->primary_head->output.sh &= ~MATROXFB_OUTPUT_CONN_SECONDARY; - down_write(&md->primary_head->altout.lock); - md->primary_head->altout.device = NULL; - md->primary_head->altout.output = NULL; - up_write(&md->primary_head->altout.lock); + MINFO_FROM(md->primary_head); + + down_write(&ACCESS_FBINFO(altout.lock)); + ACCESS_FBINFO(outputs[1]).src = MATROXFB_SRC_NONE; + ACCESS_FBINFO(outputs[1]).output = NULL; + ACCESS_FBINFO(outputs[1]).data = NULL; + ACCESS_FBINFO(outputs[1]).mode = MATROXFB_OUTPUT_MODE_MONITOR; + up_write(&ACCESS_FBINFO(altout.lock)); md->primary_head = NULL; } return 0; @@ -1066,7 +1349,7 @@ i2c_del_driver(&maven_driver); } -MODULE_AUTHOR("(c) 1999-2001 Petr Vandrovec "); +MODULE_AUTHOR("(c) 1999-2002 Petr Vandrovec "); MODULE_DESCRIPTION("Matrox G200/G400 Matrox MGA-TVO driver"); MODULE_LICENSE("GPL"); module_init(matroxfb_maven_init); diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_maven.h linux.20pre5-ac2/drivers/video/matrox/matroxfb_maven.h --- linux.20pre5/drivers/video/matrox/matroxfb_maven.h 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_maven.h 2002-09-02 14:57:05.000000000 +0100 @@ -6,21 +6,15 @@ #include #include "matroxfb_base.h" -struct matroxfb_dh_maven_info; - struct i2c_bit_adapter { struct i2c_adapter adapter; int initialized; struct i2c_algo_bit_data bac; - struct matroxfb_dh_maven_info *minfo; -}; - -struct matroxfb_dh_maven_info { - struct matrox_fb_info* primary_dev; - - struct i2c_bit_adapter maven; - struct i2c_bit_adapter ddc1; - struct i2c_bit_adapter ddc2; + struct matrox_fb_info* minfo; + struct { + unsigned int data; + unsigned int clock; + } mask; }; #endif /* __MATROXFB_MAVEN_H__ */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_misc.c linux.20pre5-ac2/drivers/video/matrox/matroxfb_misc.c --- linux.20pre5/drivers/video/matrox/matroxfb_misc.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_misc.c 2002-09-02 00:06:57.000000000 +0100 @@ -146,6 +146,7 @@ if (!pixclock) pixclock = 10000; /* 10ns = 100MHz */ mt->pixclock = 1000000000 / pixclock; if (mt->pixclock < 1) mt->pixclock = 1; + mt->mnp = -1; mt->dblscan = var->vmode & FB_VMODE_DOUBLE; mt->interlaced = var->vmode & FB_VMODE_INTERLACED; mt->HDisplay = var->xres; @@ -360,7 +361,8 @@ ((hd & 0x100) >> 7) | /* blanking */ ((hs & 0x100) >> 6) | /* sync start */ (hbe & 0x040); /* end hor. blanking */ - if (ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_SECONDARY) + /* FIXME: Enable vidrst only on G400, and only if TV-out is used */ + if (ACCESS_FBINFO(outputs[1]).src == MATROXFB_SRC_CRTC1) hw->CRTCEXT[1] |= 0x88; /* enable horizontal and vertical vidrst */ hw->CRTCEXT[2] = ((vt & 0xC00) >> 10) | ((vd & 0x400) >> 8) | /* disp end */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_proc.c linux.20pre5-ac2/drivers/video/matrox/matroxfb_proc.c --- linux.20pre5/drivers/video/matrox/matroxfb_proc.c 1970-01-01 01:00:00.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_proc.c 2002-09-02 00:06:57.000000000 +0100 @@ -0,0 +1,151 @@ +/* + * + * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450. + * + * (c) 1998-2002 Petr Vandrovec + * + * Version: 1.64 2002/06/10 + * + */ + +#include "matroxfb_base.h" +#include + +static struct proc_dir_entry* mga_pde; + +struct procinfo { + struct matrox_fb_info* info; + struct proc_dir_entry* pde; +}; + +static inline void remove_pde(struct proc_dir_entry* pde) { + if (pde) { + remove_proc_entry(pde->name, pde->parent); + } +} + +#ifndef CONFIG_PROC_FS +static int bios_read_proc(char* buffer, char** start, off_t offset, + int size, int *eof, void *data) { + return 0; +} + +static int pins_read_proc(char* buffer, char** start, off_t offset, + int size, int *eof, void *data) { + return 0; +} +#else +/* This macro frees the machine specific function from bounds checking and + * this like that... */ +#define PRINT_PROC(fmt,args...) \ + do { \ + len += sprintf(buffer+len, fmt, ##args ); \ + if (begin + len > offset + size) \ + break; \ + if (begin + len < offset) { \ + begin += len; \ + len = 0; \ + } \ + } while(0) + +static int bios_read_proc(char* buffer, char** start, off_t offset, + int size, int *eof, void *data) { + int len = 0; + off_t begin = 0; + struct matrox_bios* bd = data; + + do { + *eof = 0; + if (bd->bios_valid) { + PRINT_PROC("BIOS: %u.%u.%u\n", bd->version.vMaj, bd->version.vMin, bd->version.vRev); + PRINT_PROC("Output: 0x%02X\n", bd->output.state); + PRINT_PROC("TVOut: %s\n", bd->output.tvout?"yes":"no"); + PRINT_PROC("PINS: %s\n", bd->pins_len ? "found" : "not found"); + PRINT_PROC("Info: %p\n", bd); + } else { + PRINT_PROC("BIOS: Invalid\n"); + } + *eof = 1; + } while (0); + if (offset >= begin + len) + return 0; + *start = buffer + (offset - begin); + return size < begin + len - offset ? size : begin + len - offset; +} + +static int pins_read_proc(char* buffer, char** start, off_t offset, + int size, int *eof, void *data) { + struct matrox_bios* bd = data; + + if (offset >= bd->pins_len) { + *eof = 1; + return 0; + } + if (offset + size >= bd->pins_len) { + size = bd->pins_len - offset; + *eof = 1; + } + memcpy(buffer, bd->pins + offset, size); + *start = buffer; + return size; +} +#endif /* CONFIG_PROC_FS */ + +static void* matroxfb_proc_probe(struct matrox_fb_info* minfo) { + struct procinfo* binfo; + char b[10]; + + binfo = (struct procinfo*)kmalloc(sizeof(*binfo), GFP_KERNEL); + if (!binfo) { + printk(KERN_ERR "matroxfb_proc: Not enough memory for /proc control structs\n"); + return NULL; + } + binfo->info = minfo; + sprintf(b, "fb%u", GET_FB_IDX(minfo->fbcon.node)); + binfo->pde = proc_mkdir(b, mga_pde); + if (binfo->pde) { + create_proc_read_entry("bios", 0, binfo->pde, bios_read_proc, &minfo->bios); + if (minfo->bios.pins_len) { + struct proc_dir_entry* p = create_proc_read_entry("pins", 0, binfo->pde, pins_read_proc, &minfo->bios); + if (p) { + p->size = minfo->bios.pins_len; + } + } + } + return binfo; +} + +static void matroxfb_proc_remove(struct matrox_fb_info* minfo, void* binfoI) { + struct procinfo* binfo = binfoI; + + if (binfo->pde) { + remove_proc_entry("pins", binfo->pde); + remove_proc_entry("bios", binfo->pde); + remove_pde(binfo->pde); + } + kfree(binfo); +} + +static struct matroxfb_driver procfn = { + .name = "Matrox /proc driver", + .probe = matroxfb_proc_probe, + .remove = matroxfb_proc_remove +}; + +static int matroxfb_proc_init(void) { + mga_pde = proc_mkdir("driver/mga", NULL); + matroxfb_register_driver(&procfn); + return 0; +} + +static void matroxfb_proc_exit(void) { + matroxfb_unregister_driver(&procfn); + remove_pde(mga_pde); +} + +MODULE_AUTHOR("(c) 2001-2002 Petr Vandrovec "); +MODULE_DESCRIPTION("Matrox /proc driver"); +MODULE_LICENSE("GPL"); +module_init(matroxfb_proc_init); +module_exit(matroxfb_proc_exit); +/* we do not have __setup() */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/matrox/matroxfb_Ti3026.c linux.20pre5-ac2/drivers/video/matrox/matroxfb_Ti3026.c --- linux.20pre5/drivers/video/matrox/matroxfb_Ti3026.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/matrox/matroxfb_Ti3026.c 2002-09-02 00:06:57.000000000 +0100 @@ -2,11 +2,11 @@ * * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200 and G400 * - * (c) 1998,1999,2000 Petr Vandrovec + * (c) 1998-2002 Petr Vandrovec * * Portions Copyright (c) 2001 Matrox Graphics Inc. * - * Version: 1.62 2000/11/29 + * Version: 1.64 2002/06/10 * * MTRR stuff: 1998 Tom Rini * @@ -84,6 +84,7 @@ #include "matroxfb_Ti3026.h" #include "matroxfb_misc.h" #include "matroxfb_accel.h" +#include #ifdef CONFIG_FB_MATROX_MILLENIUM #define outTi3026 matroxfb_DAC_out @@ -811,6 +812,11 @@ ti3026_ramdac_init(PMINFO2); } +static struct matrox_altout ti3026_output = { + .owner = THIS_MODULE, + .name = "Primary output", +}; + static int Ti3026_preinit(WPMINFO2) { static const int vxres_mill2[] = { 512, 640, 768, 800, 832, 960, 1024, 1152, 1280, 1600, 1664, 1920, @@ -829,6 +835,11 @@ ACCESS_FBINFO(capable.vxres) = isMilleniumII(MINFO)?vxres_mill2:vxres_mill1; ACCESS_FBINFO(cursor.timer.function) = matroxfb_ti3026_flashcursor; + ACCESS_FBINFO(outputs[0]).data = MINFO; + ACCESS_FBINFO(outputs[0]).output = &ti3026_output; + ACCESS_FBINFO(outputs[0]).src = MATROXFB_SRC_CRTC1; + ACCESS_FBINFO(outputs[0]).mode = MATROXFB_OUTPUT_MODE_MONITOR; + if (ACCESS_FBINFO(devflags.noinit)) return 0; /* preserve VGA I/O, BIOS and PPC */ diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/modedb.c linux.20pre5-ac2/drivers/video/modedb.c --- linux.20pre5/drivers/video/modedb.c 2002-08-29 18:39:44.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/modedb.c 2002-08-06 15:42:11.000000000 +0100 @@ -42,6 +42,20 @@ #define DEFAULT_MODEDB_INDEX 0 static struct fb_videomode modedb[] __initdata = { +#if defined(CONFIG_FB_ATY_CT_VAIO_LCD) + { + /* 1024x480 @ 65 Hz */ + NULL, 65, 1024, 480, 25203, 24, 24, 1, 17, 144, 4, + 0, FB_VMODE_NONINTERLACED + }, +#endif /* CONFIG_FB_ATY_CT_VAIO_LCD */ +#if defined(CONFIG_FB_RADEON_VAIO_LCD) + { + /* 1280x600 @ 72 Hz, 45.288 kHz hsync */ + NULL, 72, 1280, 600, 13940, 24, 24, 23, 1, 256, 5, + FB_SYNC_VERT_HIGH_ACT, FB_VMODE_NONINTERLACED + }, +#endif /* CONFIG_FB_RADEON_VAIO_LCD */ { /* 640x400 @ 70 Hz, 31.5 kHz hsync */ NULL, 70, 640, 400, 39721, 40, 24, 39, 9, 96, 2, diff -u --exclude-from /usr/src/exclude --new-file --recursive linux.20pre5/drivers/video/radeonfb.c linux.20pre5-ac2/drivers/video/radeonfb.c --- linux.20pre5/drivers/video/radeonfb.c 2002-08-29 18:39:55.000000000 +0100 +++ linux.20pre5-ac2/drivers/video/radeonfb.c 2002-08-25 16:26:26.000000000 +0100 @@ -22,6 +22,13 @@ * * Special thanks to ATI DevRel team for their hardware donations. * + * 2002-04-02 Added MTRR support. Fixed 8bpp acceleration. Added + * acceleration for 16/32bpp. Applied fix from XFree86 + * for hard crash on accelerator reset. Fixed up the + * colour stuff. Peter Horton + * 2002-04-10 Make ypan work. More colour fixes, all modes >8bpp + * now DIRECTCOLOR. Match up CRTC and accelerator + * pitch. */ @@ -73,18 +80,24 @@ #include