diff --git a/[refs] b/[refs] index c4852df97d18..45782aee78bf 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f8aea20018aefa51bf818914c9c1ef9006353dbb +refs/heads/master: f81db8200d1aaf45069399e7525c442ac3013826 diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index 16202c8ac68f..277451a52695 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -378,9 +378,8 @@ T: git://git.kernel.org/pub/scm/linux/kernel/git/joro/linux-2.6-iommu.git S: Supported AMD MICROCODE UPDATE SUPPORT -P: Andreas Herrmann -M: andeas.herrmann3@amd.com -L: amd64-microcode@amd64.org +P: Peter Oruba +M: peter.oruba@amd.com S: Supported AMS (Apple Motion Sensor) DRIVER diff --git a/trunk/arch/m68k/amiga/config.c b/trunk/arch/m68k/amiga/config.c index ab9862c3a136..0a3f9e8ebde0 100644 --- a/trunk/arch/m68k/amiga/config.c +++ b/trunk/arch/m68k/amiga/config.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -94,7 +93,7 @@ static char amiga_model_name[13] = "Amiga "; static void amiga_sched_init(irq_handler_t handler); static void amiga_get_model(char *model); -static void amiga_get_hardware_list(struct seq_file *m); +static int amiga_get_hardware_list(char *buffer); /* amiga specific timer functions */ static unsigned long amiga_gettimeoffset(void); static int a3000_hwclk(int, struct rtc_time *); @@ -912,11 +911,13 @@ static void amiga_get_model(char *model) } -static void amiga_get_hardware_list(struct seq_file *m) +static int amiga_get_hardware_list(char *buffer) { + int len = 0; + if (AMIGAHW_PRESENT(CHIP_RAM)) - seq_printf(m, "Chip RAM:\t%ldK\n", amiga_chip_size>>10); - seq_printf(m, "PS Freq:\t%dHz\nEClock Freq:\t%ldHz\n", + len += sprintf(buffer+len, "Chip RAM:\t%ldK\n", amiga_chip_size>>10); + len += sprintf(buffer+len, "PS Freq:\t%dHz\nEClock Freq:\t%ldHz\n", amiga_psfreq, amiga_eclock); if (AMIGAHW_PRESENT(AMI_VIDEO)) { char *type; @@ -934,14 +935,14 @@ static void amiga_get_hardware_list(struct seq_file *m) type = "Old or Unknown"; break; } - seq_printf(m, "Graphics:\t%s\n", type); + len += sprintf(buffer+len, "Graphics:\t%s\n", type); } #define AMIGAHW_ANNOUNCE(name, str) \ if (AMIGAHW_PRESENT(name)) \ - seq_printf (m, "\t%s\n", str) + len += sprintf (buffer+len, "\t%s\n", str) - seq_printf (m, "Detected hardware:\n"); + len += sprintf (buffer + len, "Detected hardware:\n"); AMIGAHW_ANNOUNCE(AMI_VIDEO, "Amiga Video"); AMIGAHW_ANNOUNCE(AMI_BLITTER, "Blitter"); @@ -974,13 +975,15 @@ static void amiga_get_hardware_list(struct seq_file *m) AMIGAHW_ANNOUNCE(PCMCIA, "PCMCIA Slot"); #ifdef CONFIG_ZORRO if (AMIGAHW_PRESENT(ZORRO)) - seq_printf(m, "\tZorro II%s AutoConfig: %d Expansion " + len += sprintf(buffer+len, "\tZorro II%s AutoConfig: %d Expansion " "Device%s\n", AMIGAHW_PRESENT(ZORRO3) ? "I" : "", zorro_num_autocon, zorro_num_autocon == 1 ? "" : "s"); #endif /* CONFIG_ZORRO */ #undef AMIGAHW_ANNOUNCE + + return len; } /* diff --git a/trunk/arch/m68k/atari/config.c b/trunk/arch/m68k/atari/config.c index 49c28cdbea5c..af031855f796 100644 --- a/trunk/arch/m68k/atari/config.c +++ b/trunk/arch/m68k/atari/config.c @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -64,7 +63,7 @@ int atari_rtc_year_offset; /* local function prototypes */ static void atari_reset(void); static void atari_get_model(char *model); -static void atari_get_hardware_list(struct seq_file *m); +static int atari_get_hardware_list(char *buffer); /* atari specific irq functions */ extern void atari_init_IRQ (void); @@ -612,21 +611,21 @@ static void atari_get_model(char *model) } -static void atari_get_hardware_list(struct seq_file *m) +static int atari_get_hardware_list(char *buffer) { - int i; + int len = 0, i; for (i = 0; i < m68k_num_memory; i++) - seq_printf(m, "\t%3ld MB at 0x%08lx (%s)\n", + len += sprintf(buffer+len, "\t%3ld MB at 0x%08lx (%s)\n", m68k_memory[i].size >> 20, m68k_memory[i].addr, (m68k_memory[i].addr & 0xff000000 ? "alternate RAM" : "ST-RAM")); #define ATARIHW_ANNOUNCE(name, str) \ if (ATARIHW_PRESENT(name)) \ - seq_printf(m, "\t%s\n", str) + len += sprintf(buffer + len, "\t%s\n", str) - seq_printf(m, "Detected hardware:\n"); + len += sprintf(buffer + len, "Detected hardware:\n"); ATARIHW_ANNOUNCE(STND_SHIFTER, "ST Shifter"); ATARIHW_ANNOUNCE(EXTD_SHIFTER, "STe Shifter"); ATARIHW_ANNOUNCE(TT_SHIFTER, "TT Shifter"); @@ -655,4 +654,6 @@ static void atari_get_hardware_list(struct seq_file *m) ATARIHW_ANNOUNCE(BLITTER, "Blitter"); ATARIHW_ANNOUNCE(VME, "VME Bus"); ATARIHW_ANNOUNCE(DSP56K, "DSP56001 processor"); + + return len; } diff --git a/trunk/arch/m68k/atari/stram.c b/trunk/arch/m68k/atari/stram.c index 6ec3b7f33779..04c69ffbea71 100644 --- a/trunk/arch/m68k/atari/stram.c +++ b/trunk/arch/m68k/atari/stram.c @@ -42,7 +42,6 @@ /* abbrev for the && above... */ #define DO_PROC #include -#include #endif /* @@ -324,16 +323,19 @@ static int remove_region( BLOCK *block ) #ifdef DO_PROC -#define PRINT_PROC(fmt,args...) seq_printf( m, fmt, ##args ) +#define PRINT_PROC(fmt,args...) len += sprintf( buf+len, fmt, ##args ) -static int stram_proc_show(struct seq_file *m, void *v) +int get_stram_list( char *buf ) { + int len = 0; BLOCK *p; PRINT_PROC("Total ST-RAM: %8u kB\n", (stram_end - stram_start) >> 10); PRINT_PROC( "Allocated regions:\n" ); for( p = alloc_list; p; p = p->next ) { + if (len + 50 >= PAGE_SIZE) + break; PRINT_PROC("0x%08lx-0x%08lx: %s (", virt_to_phys(p->start), virt_to_phys(p->start+p->size-1), @@ -344,27 +346,9 @@ static int stram_proc_show(struct seq_file *m, void *v) PRINT_PROC( "??)\n" ); } - return 0; -} - -static int stram_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, stram_proc_show, NULL); + return( len ); } -static const struct file_operations stram_proc_fops = { - .open = stram_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int __init proc_stram_init(void) -{ - proc_create("stram", 0, NULL, &stram_proc_fops); - return 0; -} -module_init(proc_stram_init); #endif diff --git a/trunk/arch/m68k/bvme6000/config.c b/trunk/arch/m68k/bvme6000/config.c index c072595928c0..65c9204ab9ac 100644 --- a/trunk/arch/m68k/bvme6000/config.c +++ b/trunk/arch/m68k/bvme6000/config.c @@ -38,6 +38,7 @@ #include static void bvme6000_get_model(char *model); +static int bvme6000_get_hardware_list(char *buffer); extern void bvme6000_sched_init(irq_handler_t handler); extern unsigned long bvme6000_gettimeoffset (void); extern int bvme6000_hwclk (int, struct rtc_time *); @@ -81,6 +82,15 @@ static void bvme6000_get_model(char *model) sprintf(model, "BVME%d000", m68k_cputype == CPU_68060 ? 6 : 4); } + +/* No hardware options on BVME6000? */ + +static int bvme6000_get_hardware_list(char *buffer) +{ + *buffer = '\0'; + return 0; +} + /* * This function is called during kernel startup to initialize * the bvme6000 IRQ handling routines. @@ -117,6 +127,7 @@ void __init config_bvme6000(void) mach_set_clock_mmss = bvme6000_set_clock_mmss; mach_reset = bvme6000_reset; mach_get_model = bvme6000_get_model; + mach_get_hardware_list = bvme6000_get_hardware_list; printk ("Board is %sconfigured as a System Controller\n", *config_reg_ptr & BVME_CONFIG_SW1 ? "" : "not "); diff --git a/trunk/arch/m68k/kernel/setup.c b/trunk/arch/m68k/kernel/setup.c index 4d97bd2bd573..ea1e44da19b9 100644 --- a/trunk/arch/m68k/kernel/setup.c +++ b/trunk/arch/m68k/kernel/setup.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include @@ -81,7 +80,7 @@ void (*mach_sched_init) (irq_handler_t handler) __initdata = NULL; /* machine dependent irq functions */ void (*mach_init_IRQ) (void) __initdata = NULL; void (*mach_get_model) (char *model); -void (*mach_get_hardware_list) (struct seq_file *m); +int (*mach_get_hardware_list) (char *buffer); /* machine dependent timer functions */ unsigned long (*mach_gettimeoffset) (void); int (*mach_hwclk) (int, struct rtc_time*); @@ -468,9 +467,9 @@ const struct seq_operations cpuinfo_op = { .show = show_cpuinfo, }; -#ifdef CONFIG_PROC_HARDWARE -static int hardware_proc_show(struct seq_file *m, void *v) +int get_hardware_list(char *buffer) { + int len = 0; char model[80]; unsigned long mem; int i; @@ -480,37 +479,17 @@ static int hardware_proc_show(struct seq_file *m, void *v) else strcpy(model, "Unknown m68k"); - seq_printf(m, "Model:\t\t%s\n", model); + len += sprintf(buffer + len, "Model:\t\t%s\n", model); for (mem = 0, i = 0; i < m68k_num_memory; i++) mem += m68k_memory[i].size; - seq_printf(m, "System Memory:\t%ldK\n", mem >> 10); + len += sprintf(buffer + len, "System Memory:\t%ldK\n", mem >> 10); if (mach_get_hardware_list) - mach_get_hardware_list(m); + len += mach_get_hardware_list(buffer + len); - return 0; -} - -static int hardware_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, hardware_proc_show, NULL); + return len; } -static const struct file_operations hardware_proc_fops = { - .open = hardware_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int __init proc_hardware_init(void) -{ - proc_create("hardware", 0, NULL, &hardware_proc_fops); - return 0; -} -module_init(proc_hardware_init); -#endif - void check_bugs(void) { #ifndef CONFIG_M68KFPU_EMU diff --git a/trunk/arch/m68k/mvme147/config.c b/trunk/arch/m68k/mvme147/config.c index 43cdf476ffab..92fe50714112 100644 --- a/trunk/arch/m68k/mvme147/config.c +++ b/trunk/arch/m68k/mvme147/config.c @@ -37,6 +37,7 @@ static void mvme147_get_model(char *model); +static int mvme147_get_hardware_list(char *buffer); extern void mvme147_sched_init(irq_handler_t handler); extern unsigned long mvme147_gettimeoffset (void); extern int mvme147_hwclk (int, struct rtc_time *); @@ -75,6 +76,14 @@ static void mvme147_get_model(char *model) sprintf(model, "Motorola MVME147"); } + +static int mvme147_get_hardware_list(char *buffer) +{ + *buffer = '\0'; + + return 0; +} + /* * This function is called during kernel startup to initialize * the mvme147 IRQ handling routines. @@ -95,6 +104,7 @@ void __init config_mvme147(void) mach_set_clock_mmss = mvme147_set_clock_mmss; mach_reset = mvme147_reset; mach_get_model = mvme147_get_model; + mach_get_hardware_list = mvme147_get_hardware_list; /* Board type is only set by newer versions of vmelilo/tftplilo */ if (!vme_brdtype) diff --git a/trunk/arch/m68k/mvme16x/config.c b/trunk/arch/m68k/mvme16x/config.c index 1521826fc3c7..24cbc3030454 100644 --- a/trunk/arch/m68k/mvme16x/config.c +++ b/trunk/arch/m68k/mvme16x/config.c @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include @@ -43,6 +42,7 @@ extern t_bdid mvme_bdid; static MK48T08ptr_t volatile rtc = (MK48T08ptr_t)MVME_RTC_BASE; static void mvme16x_get_model(char *model); +static int mvme16x_get_hardware_list(char *buffer); extern void mvme16x_sched_init(irq_handler_t handler); extern unsigned long mvme16x_gettimeoffset (void); extern int mvme16x_hwclk (int, struct rtc_time *); @@ -93,21 +93,26 @@ static void mvme16x_get_model(char *model) } -static void mvme16x_get_hardware_list(struct seq_file *m) +static int mvme16x_get_hardware_list(char *buffer) { p_bdid p = &mvme_bdid; + int len = 0; if (p->brdno == 0x0162 || p->brdno == 0x0172) { unsigned char rev = *(unsigned char *)MVME162_VERSION_REG; - seq_printf (m, "VMEchip2 %spresent\n", + len += sprintf (buffer+len, "VMEchip2 %spresent\n", rev & MVME16x_CONFIG_NO_VMECHIP2 ? "NOT " : ""); - seq_printf (m, "SCSI interface %spresent\n", + len += sprintf (buffer+len, "SCSI interface %spresent\n", rev & MVME16x_CONFIG_NO_SCSICHIP ? "NOT " : ""); - seq_printf (m, "Ethernet i/f %spresent\n", + len += sprintf (buffer+len, "Ethernet i/f %spresent\n", rev & MVME16x_CONFIG_NO_ETHERNET ? "NOT " : ""); } + else + *buffer = '\0'; + + return (len); } /* diff --git a/trunk/arch/m68k/q40/config.c b/trunk/arch/m68k/q40/config.c index 7110546e3c00..9c7eefa3f98a 100644 --- a/trunk/arch/m68k/q40/config.c +++ b/trunk/arch/m68k/q40/config.c @@ -39,6 +39,7 @@ extern irqreturn_t q40_process_int(int level, struct pt_regs *regs); extern void q40_init_IRQ(void); static void q40_get_model(char *model); +static int q40_get_hardware_list(char *buffer); extern void q40_sched_init(irq_handler_t handler); static unsigned long q40_gettimeoffset(void); @@ -152,6 +153,14 @@ static void q40_get_model(char *model) sprintf(model, "Q40"); } +/* No hardware options on Q40? */ + +static int q40_get_hardware_list(char *buffer) +{ + *buffer = '\0'; + return 0; +} + static unsigned int serports[] = { 0x3f8,0x2f8,0x3e8,0x2e8,0 @@ -182,6 +191,7 @@ void __init config_q40(void) mach_reset = q40_reset; mach_get_model = q40_get_model; + mach_get_hardware_list = q40_get_hardware_list; #if defined(CONFIG_INPUT_M68K_BEEP) || defined(CONFIG_INPUT_M68K_BEEP_MODULE) mach_beep = q40_mksound; diff --git a/trunk/arch/m68k/sun3/config.c b/trunk/arch/m68k/sun3/config.c index 8dfaa201342e..732087d0735c 100644 --- a/trunk/arch/m68k/sun3/config.c +++ b/trunk/arch/m68k/sun3/config.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include @@ -47,9 +46,16 @@ extern volatile unsigned char* sun3_intreg; extern unsigned long availmem; unsigned long num_pages; -static void sun3_get_hardware_list(struct seq_file *m) +static int sun3_get_hardware_list(char *buffer) { - seq_printf(m, "PROM Revision:\t%s\n", romvec->pv_monid); + + int len = 0; + + len += sprintf(buffer + len, "PROM Revision:\t%s\n", + romvec->pv_monid); + + return len; + } void __init sun3_init(void) diff --git a/trunk/arch/m68k/sun3x/config.c b/trunk/arch/m68k/sun3x/config.c index 2b1ca2db070f..987891783a47 100644 --- a/trunk/arch/m68k/sun3x/config.c +++ b/trunk/arch/m68k/sun3x/config.c @@ -8,7 +8,6 @@ #include #include -#include #include #include @@ -32,9 +31,16 @@ void sun3_leds(unsigned int i) } -static void sun3x_get_hardware_list(struct seq_file *m) +static int sun3x_get_hardware_list(char *buffer) { - seq_printf(m, "PROM Revision:\t%s\n", romvec->pv_monid); + + int len = 0; + + len += sprintf(buffer + len, "PROM Revision:\t%s\n", + romvec->pv_monid); + + return len; + } /* diff --git a/trunk/arch/x86/boot/video-bios.c b/trunk/arch/x86/boot/video-bios.c index 3fa979c9c363..49f26aaaebc8 100644 --- a/trunk/arch/x86/boot/video-bios.c +++ b/trunk/arch/x86/boot/video-bios.c @@ -17,7 +17,7 @@ #include "boot.h" #include "video.h" -static __videocard video_bios; +__videocard video_bios; /* Set a conventional BIOS mode */ static int set_bios_mode(u8 mode); @@ -119,7 +119,7 @@ static int bios_probe(void) return nmodes; } -static __videocard video_bios = +__videocard video_bios = { .card_name = "BIOS", .probe = bios_probe, diff --git a/trunk/arch/x86/boot/video-vesa.c b/trunk/arch/x86/boot/video-vesa.c index 75115849af33..99b3079dc6ab 100644 --- a/trunk/arch/x86/boot/video-vesa.c +++ b/trunk/arch/x86/boot/video-vesa.c @@ -20,7 +20,7 @@ static struct vesa_general_info vginfo; static struct vesa_mode_info vminfo; -static __videocard video_vesa; +__videocard video_vesa; #ifndef _WAKEUP static void vesa_store_mode_params_graphics(void); @@ -293,7 +293,7 @@ void vesa_store_edid(void) #endif /* not _WAKEUP */ -static __videocard video_vesa = +__videocard video_vesa = { .card_name = "VESA", .probe = vesa_probe, diff --git a/trunk/arch/x86/include/asm/pgtable.h b/trunk/arch/x86/include/asm/pgtable.h index c012f3b11671..fb7d1e9985b5 100644 --- a/trunk/arch/x86/include/asm/pgtable.h +++ b/trunk/arch/x86/include/asm/pgtable.h @@ -348,8 +348,7 @@ static inline void native_pagetable_setup_start(pgd_t *base) {} static inline void native_pagetable_setup_done(pgd_t *base) {} #endif -struct seq_file; -extern void arch_report_meminfo(struct seq_file *m); +extern int arch_report_meminfo(char *page); #ifdef CONFIG_PARAVIRT #include diff --git a/trunk/arch/x86/include/asm/syscall.h b/trunk/arch/x86/include/asm/syscall.h index d82f39bb7905..1d88f6957d39 100644 --- a/trunk/arch/x86/include/asm/syscall.h +++ b/trunk/arch/x86/include/asm/syscall.h @@ -93,26 +93,26 @@ static inline void syscall_get_arguments(struct task_struct *task, { # ifdef CONFIG_IA32_EMULATION if (task_thread_info(task)->status & TS_COMPAT) - switch (i) { - case 0: + switch (i + n) { + case 6: if (!n--) break; - *args++ = regs->bx; - case 1: + *args++ = regs->bp; + case 5: if (!n--) break; - *args++ = regs->cx; - case 2: + *args++ = regs->di; + case 4: if (!n--) break; - *args++ = regs->dx; + *args++ = regs->si; case 3: if (!n--) break; - *args++ = regs->si; - case 4: + *args++ = regs->dx; + case 2: if (!n--) break; - *args++ = regs->di; - case 5: + *args++ = regs->cx; + case 1: if (!n--) break; - *args++ = regs->bp; - case 6: + *args++ = regs->bx; + case 0: if (!n--) break; default: BUG(); @@ -120,26 +120,26 @@ static inline void syscall_get_arguments(struct task_struct *task, } else # endif - switch (i) { - case 0: + switch (i + n) { + case 6: if (!n--) break; - *args++ = regs->di; - case 1: + *args++ = regs->r9; + case 5: if (!n--) break; - *args++ = regs->si; - case 2: + *args++ = regs->r8; + case 4: if (!n--) break; - *args++ = regs->dx; + *args++ = regs->r10; case 3: if (!n--) break; - *args++ = regs->r10; - case 4: + *args++ = regs->dx; + case 2: if (!n--) break; - *args++ = regs->r8; - case 5: + *args++ = regs->si; + case 1: if (!n--) break; - *args++ = regs->r9; - case 6: + *args++ = regs->di; + case 0: if (!n--) break; default: BUG(); @@ -154,57 +154,55 @@ static inline void syscall_set_arguments(struct task_struct *task, { # ifdef CONFIG_IA32_EMULATION if (task_thread_info(task)->status & TS_COMPAT) - switch (i) { - case 0: + switch (i + n) { + case 6: if (!n--) break; - regs->bx = *args++; - case 1: + regs->bp = *args++; + case 5: if (!n--) break; - regs->cx = *args++; - case 2: + regs->di = *args++; + case 4: if (!n--) break; - regs->dx = *args++; + regs->si = *args++; case 3: if (!n--) break; - regs->si = *args++; - case 4: + regs->dx = *args++; + case 2: if (!n--) break; - regs->di = *args++; - case 5: + regs->cx = *args++; + case 1: if (!n--) break; - regs->bp = *args++; - case 6: + regs->bx = *args++; + case 0: if (!n--) break; default: BUG(); - break; } else # endif - switch (i) { - case 0: + switch (i + n) { + case 6: if (!n--) break; - regs->di = *args++; - case 1: + regs->r9 = *args++; + case 5: if (!n--) break; - regs->si = *args++; - case 2: + regs->r8 = *args++; + case 4: if (!n--) break; - regs->dx = *args++; + regs->r10 = *args++; case 3: if (!n--) break; - regs->r10 = *args++; - case 4: + regs->dx = *args++; + case 2: if (!n--) break; - regs->r8 = *args++; - case 5: + regs->si = *args++; + case 1: if (!n--) break; - regs->r9 = *args++; - case 6: + regs->di = *args++; + case 0: if (!n--) break; default: BUG(); - break; } } diff --git a/trunk/arch/x86/kernel/acpi/boot.c b/trunk/arch/x86/kernel/acpi/boot.c index 8c1f76abae9e..53b01a1ae10c 100644 --- a/trunk/arch/x86/kernel/acpi/boot.c +++ b/trunk/arch/x86/kernel/acpi/boot.c @@ -1137,7 +1137,7 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity) return gsi; } if (test_bit(ioapic_pin, mp_ioapic_routing[ioapic].pin_programmed)) { - pr_debug("Pin %d-%d already programmed\n", + pr_debug(KERN_DEBUG "Pin %d-%d already programmed\n", mp_ioapic_routing[ioapic].apic_id, ioapic_pin); #ifdef CONFIG_X86_32 return (gsi < IRQ_COMPRESSION_START ? gsi : gsi_to_irq[gsi]); @@ -1599,11 +1599,6 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), }, }, - {} -}; - -/* second table for DMI checks that should run after early-quirks */ -static struct dmi_system_id __initdata acpi_dmi_table_late[] = { /* * HP laptops which use a DSDT reporting as HP/SB400/10000, * which includes some code which overrides all temperature @@ -1732,9 +1727,6 @@ int __init early_acpi_boot_init(void) int __init acpi_boot_init(void) { - /* those are executed after early-quirks are executed */ - dmi_check_system(acpi_dmi_table_late); - /* * If acpi_disabled, bail out * One exception: acpi=ht continues far enough to enumerate LAPICs diff --git a/trunk/arch/x86/kernel/cpu/proc.c b/trunk/arch/x86/kernel/cpu/proc.c index 01b1244ef1c0..a26c480b9491 100644 --- a/trunk/arch/x86/kernel/cpu/proc.c +++ b/trunk/arch/x86/kernel/cpu/proc.c @@ -160,16 +160,14 @@ static void *c_start(struct seq_file *m, loff_t *pos) { if (*pos == 0) /* just in case, cpu 0 is not the first */ *pos = first_cpu(cpu_online_map); - else - *pos = next_cpu_nr(*pos - 1, cpu_online_map); - if ((*pos) < nr_cpu_ids) + if ((*pos) < nr_cpu_ids && cpu_online(*pos)) return &cpu_data(*pos); return NULL; } static void *c_next(struct seq_file *m, void *v, loff_t *pos) { - (*pos)++; + *pos = next_cpu(*pos, cpu_online_map); return c_start(m, pos); } diff --git a/trunk/arch/x86/kernel/dumpstack_32.c b/trunk/arch/x86/kernel/dumpstack_32.c index b3614752197b..1a78180f08d3 100644 --- a/trunk/arch/x86/kernel/dumpstack_32.c +++ b/trunk/arch/x86/kernel/dumpstack_32.c @@ -405,6 +405,7 @@ die_nmi(char *str, struct pt_regs *regs, int do_panic) panic("Non maskable interrupt"); console_silent(); spin_unlock(&nmi_print_lock); + bust_spinlocks(0); /* * If we are in kernel we are probably nested up pretty bad @@ -415,7 +416,6 @@ die_nmi(char *str, struct pt_regs *regs, int do_panic) crash_kexec(regs); } - bust_spinlocks(0); do_exit(SIGSEGV); } diff --git a/trunk/arch/x86/kernel/entry_32.S b/trunk/arch/x86/kernel/entry_32.S index dd65143941a8..c356423a6026 100644 --- a/trunk/arch/x86/kernel/entry_32.S +++ b/trunk/arch/x86/kernel/entry_32.S @@ -1024,7 +1024,7 @@ ENTRY(machine_check) RING0_INT_FRAME pushl $0 CFI_ADJUST_CFA_OFFSET 4 - pushl machine_check_vector + pushl $do_machine_check CFI_ADJUST_CFA_OFFSET 4 jmp error_code CFI_ENDPROC diff --git a/trunk/arch/x86/kernel/genapic_flat_64.c b/trunk/arch/x86/kernel/genapic_flat_64.c index c0262791bda4..2ec2de8d8c46 100644 --- a/trunk/arch/x86/kernel/genapic_flat_64.c +++ b/trunk/arch/x86/kernel/genapic_flat_64.c @@ -25,7 +25,7 @@ #include #endif -static int flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) +static int __init flat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) { return 1; } @@ -170,7 +170,7 @@ struct genapic apic_flat = { * We cannot use logical delivery in this case because the mask * overflows, so use physical mode. */ -static int physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) +static int __init physflat_acpi_madt_oem_check(char *oem_id, char *oem_table_id) { #ifdef CONFIG_ACPI /* diff --git a/trunk/arch/x86/kernel/genx2apic_cluster.c b/trunk/arch/x86/kernel/genx2apic_cluster.c index f6a2c8eb48a6..e4bf2cc0d743 100644 --- a/trunk/arch/x86/kernel/genx2apic_cluster.c +++ b/trunk/arch/x86/kernel/genx2apic_cluster.c @@ -12,7 +12,7 @@ DEFINE_PER_CPU(u32, x86_cpu_to_logical_apicid); -static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) +static int __init x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) { if (cpu_has_x2apic) return 1; diff --git a/trunk/arch/x86/kernel/genx2apic_phys.c b/trunk/arch/x86/kernel/genx2apic_phys.c index d042211768b7..8f1343df2627 100644 --- a/trunk/arch/x86/kernel/genx2apic_phys.c +++ b/trunk/arch/x86/kernel/genx2apic_phys.c @@ -19,7 +19,7 @@ static int set_x2apic_phys_mode(char *arg) } early_param("x2apic_phys", set_x2apic_phys_mode); -static int x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) +static int __init x2apic_acpi_madt_oem_check(char *oem_id, char *oem_table_id) { if (cpu_has_x2apic && x2apic_phys) return 1; diff --git a/trunk/arch/x86/kernel/genx2apic_uv_x.c b/trunk/arch/x86/kernel/genx2apic_uv_x.c index 680a06557c5e..bfd532843df6 100644 --- a/trunk/arch/x86/kernel/genx2apic_uv_x.c +++ b/trunk/arch/x86/kernel/genx2apic_uv_x.c @@ -30,7 +30,7 @@ DEFINE_PER_CPU(int, x2apic_extra_bits); static enum uv_system_type uv_system_type; -static int uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) +static int __init uv_acpi_madt_oem_check(char *oem_id, char *oem_table_id) { if (!strcmp(oem_id, "SGI")) { if (!strcmp(oem_table_id, "UVL")) diff --git a/trunk/arch/x86/kernel/setup_percpu.c b/trunk/arch/x86/kernel/setup_percpu.c index ae0c0d3bb770..410c88f0bfeb 100644 --- a/trunk/arch/x86/kernel/setup_percpu.c +++ b/trunk/arch/x86/kernel/setup_percpu.c @@ -218,7 +218,7 @@ static void __init setup_node_to_cpumask_map(void) /* allocate the map */ map = alloc_bootmem_low(nr_node_ids * sizeof(cpumask_t)); - pr_debug("Node to cpumask map at %p for %d nodes\n", + pr_debug(KERN_DEBUG "Node to cpumask map at %p for %d nodes\n", map, nr_node_ids); /* node_to_cpumask() will now work */ diff --git a/trunk/arch/x86/kernel/smpboot.c b/trunk/arch/x86/kernel/smpboot.c index 7b1093397319..7ece815ea637 100644 --- a/trunk/arch/x86/kernel/smpboot.c +++ b/trunk/arch/x86/kernel/smpboot.c @@ -893,11 +893,9 @@ static int __cpuinit do_boot_cpu(int apicid, int cpu) smpboot_setup_warm_reset_vector(start_ip); /* * Be paranoid about clearing APIC errors. - */ - if (APIC_INTEGRATED(apic_version[boot_cpu_physical_apicid])) { - apic_write(APIC_ESR, 0); - apic_read(APIC_ESR); - } + */ + apic_write(APIC_ESR, 0); + apic_read(APIC_ESR); } /* diff --git a/trunk/arch/x86/kernel/tlb_uv.c b/trunk/arch/x86/kernel/tlb_uv.c index 04431f34fd16..8b8c0d6640fa 100644 --- a/trunk/arch/x86/kernel/tlb_uv.c +++ b/trunk/arch/x86/kernel/tlb_uv.c @@ -6,7 +6,7 @@ * This code is released under the GNU General Public License version 2 or * later. */ -#include +#include #include #include diff --git a/trunk/arch/x86/kernel/traps.c b/trunk/arch/x86/kernel/traps.c index 04d242ab0161..e062974cce34 100644 --- a/trunk/arch/x86/kernel/traps.c +++ b/trunk/arch/x86/kernel/traps.c @@ -931,6 +931,14 @@ do_device_not_available(struct pt_regs *regs, long error) } #ifdef CONFIG_X86_32 +#ifdef CONFIG_X86_MCE +dotraplinkage void __kprobes do_machine_check(struct pt_regs *regs, long error) +{ + conditional_sti(regs); + machine_check_vector(regs, error); +} +#endif + dotraplinkage void do_iret_error(struct pt_regs *regs, long error_code) { siginfo_t info; diff --git a/trunk/arch/x86/kernel/xsave.c b/trunk/arch/x86/kernel/xsave.c index b13acb75e822..9abac8a9d823 100644 --- a/trunk/arch/x86/kernel/xsave.c +++ b/trunk/arch/x86/kernel/xsave.c @@ -248,7 +248,7 @@ int restore_i387_xstate(void __user *buf) * This will be saved when ever the FP and extended state context is * saved on the user stack during the signal handler delivery to the user. */ -static void prepare_fx_sw_frame(void) +void prepare_fx_sw_frame(void) { int size_extended = (xstate_size - sizeof(struct i387_fxsave_struct)) + FP_XSTATE_MAGIC2_SIZE; diff --git a/trunk/arch/x86/mm/memtest.c b/trunk/arch/x86/mm/memtest.c index 9cab18b0b857..672e17f8262a 100644 --- a/trunk/arch/x86/mm/memtest.c +++ b/trunk/arch/x86/mm/memtest.c @@ -61,9 +61,9 @@ static void __init memtest(unsigned long start_phys, unsigned long size, last_bad += incr; } else { if (start_bad) { - printk(KERN_CONT "\n %016lx bad mem addr %010lx - %010lx reserved", + printk(KERN_CONT "\n %010lx bad mem addr %010lx - %010lx reserved", val, start_bad, last_bad + incr); - reserve_early(start_bad, last_bad + incr, "BAD RAM"); + reserve_early(start_bad, last_bad - start_bad, "BAD RAM"); } start_bad = last_bad = start_phys_aligned; } @@ -72,8 +72,9 @@ static void __init memtest(unsigned long start_phys, unsigned long size, if (start_bad) { printk(KERN_CONT "\n %016lx bad mem addr %010lx - %010lx reserved", val, start_bad, last_bad + incr); - reserve_early(start_bad, last_bad + incr, "BAD RAM"); + reserve_early(start_bad, last_bad - start_bad, "BAD RAM"); } + } /* default is disabled */ diff --git a/trunk/arch/x86/mm/pageattr.c b/trunk/arch/x86/mm/pageattr.c index f1dc1b75d166..407d8784f669 100644 --- a/trunk/arch/x86/mm/pageattr.c +++ b/trunk/arch/x86/mm/pageattr.c @@ -65,22 +65,23 @@ static void split_page_count(int level) direct_pages_count[level - 1] += PTRS_PER_PTE; } -void arch_report_meminfo(struct seq_file *m) +int arch_report_meminfo(char *page) { - seq_printf(m, "DirectMap4k: %8lu kB\n", + int n = sprintf(page, "DirectMap4k: %8lu kB\n", direct_pages_count[PG_LEVEL_4K] << 2); #if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) - seq_printf(m, "DirectMap2M: %8lu kB\n", + n += sprintf(page + n, "DirectMap2M: %8lu kB\n", direct_pages_count[PG_LEVEL_2M] << 11); #else - seq_printf(m, "DirectMap4M: %8lu kB\n", + n += sprintf(page + n, "DirectMap4M: %8lu kB\n", direct_pages_count[PG_LEVEL_2M] << 12); #endif #ifdef CONFIG_X86_64 if (direct_gbpages) - seq_printf(m, "DirectMap1G: %8lu kB\n", + n += sprintf(page + n, "DirectMap1G: %8lu kB\n", direct_pages_count[PG_LEVEL_1G] << 20); #endif + return n; } #else static inline void split_page_count(int level) { } diff --git a/trunk/block/genhd.c b/trunk/block/genhd.c index 4e5e7493f676..646e1d2507c7 100644 --- a/trunk/block/genhd.c +++ b/trunk/block/genhd.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -728,24 +727,12 @@ static int show_partition(struct seq_file *seqf, void *v) return 0; } -static const struct seq_operations partitions_op = { +const struct seq_operations partitions_op = { .start = show_partition_start, .next = disk_seqf_next, .stop = disk_seqf_stop, .show = show_partition }; - -static int partitions_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &partitions_op); -} - -static const struct file_operations proc_partitions_operations = { - .open = partitions_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; #endif @@ -1005,32 +992,12 @@ static int diskstats_show(struct seq_file *seqf, void *v) return 0; } -static const struct seq_operations diskstats_op = { +const struct seq_operations diskstats_op = { .start = disk_seqf_start, .next = disk_seqf_next, .stop = disk_seqf_stop, .show = diskstats_show }; - -static int diskstats_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &diskstats_op); -} - -static const struct file_operations proc_diskstats_operations = { - .open = diskstats_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - -static int __init proc_genhd_init(void) -{ - proc_create("diskstats", 0, NULL, &proc_diskstats_operations); - proc_create("partitions", 0, NULL, &proc_partitions_operations); - return 0; -} -module_init(proc_genhd_init); #endif /* CONFIG_PROC_FS */ static void media_change_notify_thread(struct work_struct *work) diff --git a/trunk/drivers/message/fusion/mptscsih.c b/trunk/drivers/message/fusion/mptscsih.c index d62fd4f6b52e..9f9354fd3516 100644 --- a/trunk/drivers/message/fusion/mptscsih.c +++ b/trunk/drivers/message/fusion/mptscsih.c @@ -1760,9 +1760,10 @@ mptscsih_get_tm_timeout(MPT_ADAPTER *ioc) case FC: return 40; case SAS: + return 10; case SPI: default: - return 10; + return 2; } } diff --git a/trunk/drivers/scsi/3w-9xxx.c b/trunk/drivers/scsi/3w-9xxx.c index 5311317c2e4c..b92c19bb6876 100644 --- a/trunk/drivers/scsi/3w-9xxx.c +++ b/trunk/drivers/scsi/3w-9xxx.c @@ -1924,9 +1924,12 @@ static void twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int re (cmd->sc_data_direction == DMA_FROM_DEVICE || cmd->sc_data_direction == DMA_BIDIRECTIONAL)) { if (scsi_sg_count(cmd) == 1) { + unsigned long flags; void *buf = tw_dev->generic_buffer_virt[request_id]; + local_irq_save(flags); scsi_sg_copy_from_buffer(cmd, buf, TW_SECTOR_SIZE); + local_irq_restore(flags); } } } /* End twa_scsiop_execute_scsi_complete() */ diff --git a/trunk/drivers/scsi/3w-xxxx.c b/trunk/drivers/scsi/3w-xxxx.c index c03f1d2c9e2e..a0537f09aa21 100644 --- a/trunk/drivers/scsi/3w-xxxx.c +++ b/trunk/drivers/scsi/3w-xxxx.c @@ -1466,7 +1466,12 @@ static int tw_scsiop_inquiry(TW_Device_Extension *tw_dev, int request_id) static void tw_transfer_internal(TW_Device_Extension *tw_dev, int request_id, void *data, unsigned int len) { - scsi_sg_copy_from_buffer(tw_dev->srb[request_id], data, len); + struct scsi_cmnd *cmd = tw_dev->srb[request_id]; + unsigned long flags; + + local_irq_save(flags); + scsi_sg_copy_from_buffer(cmd, data, len); + local_irq_restore(flags); } /* This function is called by the isr to complete an inquiry command */ diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx.reg b/trunk/drivers/scsi/aic7xxx/aic79xx.reg index 0666c22ab55b..cca16fc5b4ad 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx.reg +++ b/trunk/drivers/scsi/aic7xxx/aic79xx.reg @@ -79,17 +79,6 @@ VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#77 $" mvi SEQINTCODE, code; \ } -/* - * Registers marked "dont_generate_debug_code" are not (yet) referenced - * from the driver code, and this keyword inhibit generation - * of debug code for them. - * - * REG_PRETTY_PRINT config will complain if dont_generate_debug_code - * is added to the register which is referenced in the driver. - * Unreferenced register with no dont_generate_debug_code will result - * in dead code. No warning is issued. - */ - /* * Mode Pointer * Controls which of the 5, 512byte, address spaces should be used @@ -102,7 +91,6 @@ register MODE_PTR { field DST_MODE 0x70 field SRC_MODE 0x07 mode_pointer - dont_generate_debug_code } const SRC_MODE_SHIFT 0 @@ -202,7 +190,6 @@ register SEQINTCODE { SAW_HWERR, BAD_SCB_STATUS } - dont_generate_debug_code } /* @@ -220,7 +207,6 @@ register CLRINT { field CLRSEQINT 0x04 field CLRCMDINT 0x02 field CLRSPLTINT 0x01 - dont_generate_debug_code } /* @@ -236,7 +222,6 @@ register ERROR { field SQPARERR 0x08 field ILLOPCODE 0x04 field DSCTMOUT 0x02 - dont_generate_debug_code } /* @@ -270,7 +255,6 @@ register HCNTRL { field INTEN 0x02 field CHIPRST 0x01 field CHIPRSTACK 0x01 - dont_generate_debug_code } /* @@ -281,7 +265,6 @@ register HNSCB_QOFF { access_mode RW size 2 count 2 - dont_generate_debug_code } /* @@ -291,7 +274,6 @@ register HESCB_QOFF { address 0x008 access_mode RW count 2 - dont_generate_debug_code } /* @@ -329,7 +311,6 @@ register CLRSEQINTSTAT { field CLRSEQ_SCSIINT 0x04 field CLRSEQ_PCIINT 0x02 field CLRSEQ_SPLTINT 0x01 - dont_generate_debug_code } /* @@ -339,7 +320,6 @@ register SWTIMER { address 0x00E access_mode RW size 2 - dont_generate_debug_code } /* @@ -350,7 +330,6 @@ register SNSCB_QOFF { access_mode RW size 2 modes M_CCHAN - dont_generate_debug_code } /* @@ -361,7 +340,6 @@ register SESCB_QOFF { count 2 access_mode RW modes M_CCHAN - dont_generate_debug_code } /* @@ -372,7 +350,6 @@ register SDSCB_QOFF { access_mode RW modes M_CCHAN size 2 - dont_generate_debug_code } /* @@ -401,7 +378,6 @@ register QOFF_CTLSTA { SCB_QSIZE_8192, SCB_QSIZE_16384 } - dont_generate_debug_code } /* @@ -455,7 +431,6 @@ register DSCOMMAND0 { field EXTREQLCK 0x10 /* External Request Lock */ field DISABLE_TWATE 0x02 /* Rev B or greater */ field CIOPARCKEN 0x01 /* Internal bus parity error enable */ - dont_generate_debug_code } /* @@ -484,7 +459,6 @@ register SG_CACHE_PRE { field SG_ADDR_MASK 0xf8 field ODD_SEG 0x04 field LAST_SEG 0x02 - dont_generate_debug_code } register SG_CACHE_SHADOW { @@ -517,7 +491,6 @@ register HADDR { access_mode RW size 8 modes M_DFF0, M_DFF1 - dont_generate_debug_code } /* @@ -549,7 +522,6 @@ register HCNT { access_mode RW size 3 modes M_DFF0, M_DFF1 - dont_generate_debug_code } /* @@ -579,7 +551,6 @@ register SGHADDR { access_mode RW size 8 modes M_DFF0, M_DFF1 - dont_generate_debug_code } /* @@ -590,7 +561,6 @@ register SCBHADDR { access_mode RW size 8 modes M_CCHAN - dont_generate_debug_code } /* @@ -600,7 +570,6 @@ register SGHCNT { address 0x084 access_mode RW modes M_DFF0, M_DFF1 - dont_generate_debug_code } /* @@ -610,7 +579,6 @@ register SCBHCNT { address 0x084 access_mode RW modes M_CCHAN - dont_generate_debug_code } /* @@ -641,7 +609,6 @@ register DFF_THRSH { RD_DFTHRSH_90, RD_DFTHRSH_MAX } - dont_generate_debug_code } /* @@ -850,7 +817,6 @@ register PCIXCTL { field SRSPDPEEN 0x04 field TSCSERREN 0x02 field CMPABCDIS 0x01 - dont_generate_debug_code } /* @@ -897,7 +863,6 @@ register DCHSPLTSTAT0 { field RXOVRUN 0x04 field RXSCEMSG 0x02 field RXSPLTRSP 0x01 - dont_generate_debug_code } /* @@ -943,7 +908,6 @@ register DCHSPLTSTAT1 { modes M_DFF0, M_DFF1 count 2 field RXDATABUCKET 0x01 - dont_generate_debug_code } /* @@ -1105,7 +1069,6 @@ register SGSPLTSTAT0 { field RXOVRUN 0x04 field RXSCEMSG 0x02 field RXSPLTRSP 0x01 - dont_generate_debug_code } /* @@ -1117,7 +1080,6 @@ register SGSPLTSTAT1 { modes M_DFF0, M_DFF1 count 2 field RXDATABUCKET 0x01 - dont_generate_debug_code } /* @@ -1129,7 +1091,6 @@ register SFUNCT { modes M_CFG field TEST_GROUP 0xF0 field TEST_NUM 0x0F - dont_generate_debug_code } /* @@ -1148,7 +1109,6 @@ register DF0PCISTAT { field RDPERR 0x04 field TWATERR 0x02 field DPR 0x01 - dont_generate_debug_code } /* @@ -1244,7 +1204,6 @@ register TARGPCISTAT { field SSE 0x40 field STA 0x08 field TWATERR 0x02 - dont_generate_debug_code } /* @@ -1257,7 +1216,6 @@ register LQIN { size 20 count 2 modes M_DFF0, M_DFF1, M_SCSI - dont_generate_debug_code } /* @@ -1289,7 +1247,6 @@ register LUNPTR { access_mode RW modes M_CFG count 2 - dont_generate_debug_code } /* @@ -1321,7 +1278,6 @@ register CMDLENPTR { access_mode RW modes M_CFG count 1 - dont_generate_debug_code } /* @@ -1334,7 +1290,6 @@ register ATTRPTR { access_mode RW modes M_CFG count 1 - dont_generate_debug_code } /* @@ -1347,7 +1302,6 @@ register FLAGPTR { access_mode RW modes M_CFG count 1 - dont_generate_debug_code } /* @@ -1359,7 +1313,6 @@ register CMDPTR { access_mode RW modes M_CFG count 1 - dont_generate_debug_code } /* @@ -1371,7 +1324,6 @@ register QNEXTPTR { access_mode RW modes M_CFG count 1 - dont_generate_debug_code } /* @@ -1395,7 +1347,6 @@ register ABRTBYTEPTR { access_mode RW modes M_CFG count 1 - dont_generate_debug_code } /* @@ -1407,7 +1358,6 @@ register ABRTBITPTR { access_mode RW modes M_CFG count 1 - dont_generate_debug_code } /* @@ -1448,7 +1398,6 @@ register LUNLEN { count 2 mask ILUNLEN 0x0F mask TLUNLEN 0xF0 - dont_generate_debug_code } const LUNLEN_SINGLE_LEVEL_LUN 0xF @@ -1461,7 +1410,6 @@ register CDBLIMIT { access_mode RW modes M_CFG count 1 - dont_generate_debug_code } /* @@ -1474,7 +1422,6 @@ register MAXCMD { access_mode RW modes M_CFG count 9 - dont_generate_debug_code } /* @@ -1485,7 +1432,6 @@ register MAXCMDCNT { address 0x033 access_mode RW modes M_CFG - dont_generate_debug_code } /* @@ -1544,7 +1490,6 @@ register LQCTL1 { field PCI2PCI 0x04 field SINGLECMD 0x02 field ABORTPENDING 0x01 - dont_generate_debug_code } /* @@ -1563,7 +1508,6 @@ register LQCTL2 { field LQOCONTINUE 0x04 field LQOTOIDLE 0x02 field LQOPAUSE 0x01 - dont_generate_debug_code } /* @@ -1634,7 +1578,6 @@ register SXFRCTL0 { field DFPEXP 0x40 field BIOSCANCELEN 0x10 field SPIOEN 0x08 - dont_generate_debug_code } /* @@ -1651,7 +1594,6 @@ register SXFRCTL1 { field ENSTIMER 0x04 field ACTNEGEN 0x02 field STPWEN 0x01 - dont_generate_debug_code } /* @@ -1754,7 +1696,6 @@ register SCSISIGO { P_STATUS CDO|IOO, P_MESGIN CDO|IOO|MSGO } - dont_generate_debug_code } /* @@ -1797,7 +1738,6 @@ register MULTARGID { modes M_CFG size 2 count 2 - dont_generate_debug_code } /* @@ -1834,7 +1774,6 @@ register SCSIDAT { access_mode RW modes M_DFF0, M_DFF1, M_SCSI size 2 - dont_generate_debug_code } /* @@ -1857,7 +1796,6 @@ register TARGIDIN { count 2 field CLKOUT 0x80 field TARGID 0x0F - dont_generate_debug_code } /* @@ -1887,7 +1825,6 @@ register SBLKCTL { field ENAB40 0x08 /* LVD transceiver active */ field ENAB20 0x04 /* SE/HVD transceiver active */ field SELWIDE 0x02 - dont_generate_debug_code } /* @@ -1905,7 +1842,6 @@ register OPTIONMODE { field ENDGFORMCHK 0x04 field AUTO_MSGOUT_DE 0x02 mask OPTIONMODE_DEFAULTS AUTO_MSGOUT_DE - dont_generate_debug_code } /* @@ -1940,7 +1876,6 @@ register CLRSINT0 { field CLROVERRUN 0x04 field CLRSPIORDY 0x02 field CLRARBDO 0x01 - dont_generate_debug_code } /* @@ -1994,7 +1929,6 @@ register CLRSINT1 { field CLRSCSIPERR 0x04 field CLRSTRB2FAST 0x02 field CLRREQINIT 0x01 - dont_generate_debug_code } /* @@ -2028,7 +1962,6 @@ register CLRSINT2 { field CLRWIDE_RES 0x04 /* Modes 0 and 1 only */ field CLRSDONE 0x02 /* Modes 0 and 1 only */ field CLRDMADONE 0x01 /* Modes 0 and 1 only */ - dont_generate_debug_code } /* @@ -2069,7 +2002,6 @@ register LQISTATE { access_mode RO modes M_CFG count 6 - dont_generate_debug_code } /* @@ -2090,7 +2022,6 @@ register LQOSTATE { access_mode RO modes M_CFG count 2 - dont_generate_debug_code } /* @@ -2123,7 +2054,6 @@ register CLRLQIINT0 { field CLRLQIBADLQT 0x04 field CLRLQIATNLQ 0x02 field CLRLQIATNCMD 0x01 - dont_generate_debug_code } /* @@ -2140,7 +2070,6 @@ register LQIMODE0 { field ENLQIBADLQT 0x04 field ENLQIATNLQ 0x02 field ENLQIATNCMD 0x01 - dont_generate_debug_code } /* @@ -2177,7 +2106,6 @@ register CLRLQIINT1 { field CLRLQIBADLQI 0x04 field CLRLQIOVERI_LQ 0x02 field CLRLQIOVERI_NLQ 0x01 - dont_generate_debug_code } /* @@ -2196,7 +2124,6 @@ register LQIMODE1 { field ENLQIBADLQI 0x04 field ENLQIOVERI_LQ 0x02 /* LQIOVERI1 */ field ENLQIOVERI_NLQ 0x01 /* LQIOVERI2 */ - dont_generate_debug_code } /* @@ -2238,7 +2165,6 @@ register CLRSINT3 { count 3 field CLRNTRAMPERR 0x02 field CLROSRAMPERR 0x01 - dont_generate_debug_code } /* @@ -2251,7 +2177,6 @@ register SIMODE3 { count 4 field ENNTRAMPERR 0x02 field ENOSRAMPERR 0x01 - dont_generate_debug_code } /* @@ -2282,7 +2207,6 @@ register CLRLQOINT0 { field CLRLQOATNLQ 0x04 field CLRLQOATNPKT 0x02 field CLRLQOTCRC 0x01 - dont_generate_debug_code } /* @@ -2298,7 +2222,6 @@ register LQOMODE0 { field ENLQOATNLQ 0x04 field ENLQOATNPKT 0x02 field ENLQOTCRC 0x01 - dont_generate_debug_code } /* @@ -2328,7 +2251,6 @@ register CLRLQOINT1 { field CLRLQOBADQAS 0x04 field CLRLQOBUSFREE 0x02 field CLRLQOPHACHGINPKT 0x01 - dont_generate_debug_code } /* @@ -2344,7 +2266,6 @@ register LQOMODE1 { field ENLQOBADQAS 0x04 field ENLQOBUSFREE 0x02 field ENLQOPHACHGINPKT 0x01 - dont_generate_debug_code } /* @@ -2368,7 +2289,6 @@ register OS_SPACE_CNT { access_mode RO modes M_CFG count 2 - dont_generate_debug_code } /* @@ -2398,7 +2318,6 @@ register GSFIFO { access_mode RO size 2 modes M_DFF0, M_DFF1, M_SCSI - dont_generate_debug_code } /* @@ -2422,7 +2341,6 @@ register NEXTSCB { access_mode RW size 2 modes M_SCSI - dont_generate_debug_code } /* @@ -2439,7 +2357,6 @@ register LQOSCSCTL { field LQOBUSETDLY 0x40 field LQONOHOLDLACK 0x02 field LQONOCHKOVER 0x01 - dont_generate_debug_code } /* @@ -2472,7 +2389,6 @@ register CLRSEQINTSRC { field CLRCFG4TSTAT 0x04 field CLRCFG4ICMD 0x02 field CLRCFG4TCMD 0x01 - dont_generate_debug_code } /* @@ -2499,7 +2415,6 @@ register CURRSCB { access_mode RW size 2 modes M_SCSI - dont_generate_debug_code } /* @@ -2557,7 +2472,6 @@ register LASTSCB { access_mode RW size 2 modes M_SCSI - dont_generate_debug_code } /* @@ -2580,7 +2494,6 @@ register SHADDR { access_mode RO size 8 modes M_DFF0, M_DFF1 - dont_generate_debug_code } /* @@ -2600,7 +2513,6 @@ register NEGOADDR { address 0x060 access_mode RW modes M_SCSI - dont_generate_debug_code } /* @@ -2611,7 +2523,6 @@ register NEGPERIOD { access_mode RW modes M_SCSI count 1 - dont_generate_debug_code } /* @@ -2632,7 +2543,6 @@ register NEGOFFSET { access_mode RW modes M_SCSI count 1 - dont_generate_debug_code } /* @@ -2647,7 +2557,6 @@ register NEGPPROPTS { field PPROPT_QAS 0x04 field PPROPT_DT 0x02 field PPROPT_IUT 0x01 - dont_generate_debug_code } /* @@ -2664,7 +2573,6 @@ register NEGCONOPTS { field ENAUTOATNI 0x04 field ENAUTOATNO 0x02 field WIDEXFER 0x01 - dont_generate_debug_code } /* @@ -2675,7 +2583,6 @@ register ANNEXCOL { access_mode RW modes M_SCSI count 7 - dont_generate_debug_code } /* @@ -2695,7 +2602,6 @@ register SCSCHKN { field DFFACTCLR 0x04 field SHVALIDSTDIS 0x02 field LSTSGCLRDIS 0x01 - dont_generate_debug_code } const AHD_ANNEXCOL_PER_DEV0 4 @@ -2729,7 +2635,6 @@ register ANNEXDAT { access_mode RW modes M_SCSI count 3 - dont_generate_debug_code } /* @@ -2740,7 +2645,6 @@ register IOWNID { address 0x067 access_mode RW modes M_SCSI - dont_generate_debug_code } /* @@ -2767,7 +2671,6 @@ register TOWNID { access_mode RW modes M_SCSI count 2 - dont_generate_debug_code } /* @@ -2799,7 +2702,6 @@ register SHCNT { access_mode RW size 3 modes M_DFF0, M_DFF1 - dont_generate_debug_code } /* @@ -2887,7 +2789,6 @@ register SCBPTR { access_mode RW size 2 modes M_DFF0, M_DFF1, M_CCHAN, M_SCSI - dont_generate_debug_code } /* @@ -2915,7 +2816,6 @@ register SCBAUTOPTR { field AUSCBPTR_EN 0x80 field SCBPTR_ADDR 0x38 field SCBPTR_OFF 0x07 - dont_generate_debug_code } /* @@ -2925,7 +2825,6 @@ register CCSGADDR { address 0x0AC access_mode RW modes M_DFF0, M_DFF1 - dont_generate_debug_code } /* @@ -2935,7 +2834,6 @@ register CCSCBADDR { address 0x0AC access_mode RW modes M_CCHAN - dont_generate_debug_code } /* @@ -3001,7 +2899,6 @@ register CCSGRAM { address 0x0B0 access_mode RW modes M_DFF0, M_DFF1 - dont_generate_debug_code } /* @@ -3011,7 +2908,6 @@ register CCSCBRAM { address 0x0B0 access_mode RW modes M_CCHAN - dont_generate_debug_code } /* @@ -3062,7 +2958,6 @@ register BRDDAT { access_mode RW modes M_SCSI count 2 - dont_generate_debug_code } /* @@ -3079,7 +2974,6 @@ register BRDCTL { field BRDEN 0x04 field BRDRW 0x02 field BRDSTB 0x01 - dont_generate_debug_code } /* @@ -3090,7 +2984,6 @@ register SEEADR { access_mode RW modes M_SCSI count 4 - dont_generate_debug_code } /* @@ -3102,7 +2995,6 @@ register SEEDAT { size 2 modes M_SCSI count 4 - dont_generate_debug_code } /* @@ -3119,7 +3011,6 @@ register SEESTAT { field SEEARBACK 0x04 field SEEBUSY 0x02 field SEESTART 0x01 - dont_generate_debug_code } /* @@ -3145,7 +3036,6 @@ register SEECTL { mask SEEOP_EWDS 0x40 field SEERST 0x02 field SEESTART 0x01 - dont_generate_debug_code } const SEEOP_ERAL_ADDR 0x80 @@ -3160,7 +3050,6 @@ register SCBCNT { address 0x0BF access_mode RW modes M_SCSI - dont_generate_debug_code } /* @@ -3172,7 +3061,6 @@ register DFWADDR { access_mode RW size 2 modes M_DFF0, M_DFF1 - dont_generate_debug_code } /* @@ -3199,7 +3087,6 @@ register DSPDATACTL { field DESQDIS 0x10 field RCVROFFSTDIS 0x04 field XMITOFFSTDIS 0x02 - dont_generate_debug_code } /* @@ -3245,7 +3132,6 @@ register DFDAT { address 0x0C4 access_mode RW modes M_DFF0, M_DFF1 - dont_generate_debug_code } /* @@ -3258,7 +3144,6 @@ register DSPSELECT { count 1 field AUTOINCEN 0x80 field DSPSEL 0x1F - dont_generate_debug_code } const NUMDSPS 0x14 @@ -3273,7 +3158,6 @@ register WRTBIASCTL { count 3 field AUTOXBCDIS 0x80 field XMITMANVAL 0x3F - dont_generate_debug_code } /* @@ -3432,7 +3316,6 @@ register FLAGS { count 23 field ZERO 0x02 field CARRY 0x01 - dont_generate_debug_code } /* @@ -3461,7 +3344,6 @@ register SEQRAM { address 0x0DA access_mode RW count 2 - dont_generate_debug_code } /* @@ -3473,7 +3355,6 @@ register PRGMCNT { access_mode RW size 2 count 5 - dont_generate_debug_code } /* @@ -3483,7 +3364,6 @@ register ACCUM { address 0x0E0 access_mode RW accumulator - dont_generate_debug_code } /* @@ -3500,7 +3380,6 @@ register SINDEX { access_mode RW size 2 sindex - dont_generate_debug_code } /* @@ -3511,7 +3390,6 @@ register DINDEX { address 0x0E4 access_mode RW size 2 - dont_generate_debug_code } /* @@ -3537,7 +3415,6 @@ register ALLONES { address 0x0E8 access_mode RO allones - dont_generate_debug_code } /* @@ -3548,7 +3425,6 @@ register ALLZEROS { address 0x0EA access_mode RO allzeros - dont_generate_debug_code } /* @@ -3559,7 +3435,6 @@ register NONE { address 0x0EA access_mode WO none - dont_generate_debug_code } /* @@ -3570,7 +3445,6 @@ register NONE { register SINDIR { address 0x0EC access_mode RO - dont_generate_debug_code } /* @@ -3581,7 +3455,6 @@ register SINDIR { register DINDIR { address 0x0ED access_mode WO - dont_generate_debug_code } /* @@ -3606,7 +3479,6 @@ register FUNCTION1 { register STACK { address 0x0F2 access_mode RW - dont_generate_debug_code } /* @@ -3619,7 +3491,6 @@ register INTVEC1_ADDR { size 2 modes M_CFG count 1 - dont_generate_debug_code } /* @@ -3632,7 +3503,6 @@ register CURADDR { size 2 modes M_SCSI count 2 - dont_generate_debug_code } /* @@ -3645,7 +3515,6 @@ register INTVEC2_ADDR { size 2 modes M_CFG count 1 - dont_generate_debug_code } /* @@ -3674,14 +3543,12 @@ scratch_ram { modes 0, 1, 2, 3 REG0 { size 2 - dont_generate_debug_code } REG1 { size 2 } REG_ISR { size 2 - dont_generate_debug_code } SG_STATE { size 1 @@ -3705,11 +3572,9 @@ scratch_ram { modes 0, 1, 2, 3 LONGJMP_ADDR { size 2 - dont_generate_debug_code } ACCUM_SAVE { size 1 - dont_generate_debug_code } } @@ -3726,22 +3591,18 @@ scratch_ram { */ WAITING_SCB_TAILS { size 32 - dont_generate_debug_code } WAITING_TID_HEAD { size 2 - dont_generate_debug_code } WAITING_TID_TAIL { size 2 - dont_generate_debug_code } /* * SCBID of the next SCB in the new SCB queue. */ NEXT_QUEUED_SCB_ADDR { size 4 - dont_generate_debug_code } /* * head of list of SCBs that have @@ -3750,7 +3611,6 @@ scratch_ram { */ COMPLETE_SCB_HEAD { size 2 - dont_generate_debug_code } /* * The list of completed SCBs in @@ -3758,7 +3618,6 @@ scratch_ram { */ COMPLETE_SCB_DMAINPROG_HEAD { size 2 - dont_generate_debug_code } /* * head of list of SCBs that have @@ -3767,7 +3626,6 @@ scratch_ram { */ COMPLETE_DMA_SCB_HEAD { size 2 - dont_generate_debug_code } /* * tail of list of SCBs that have @@ -3776,7 +3634,6 @@ scratch_ram { */ COMPLETE_DMA_SCB_TAIL { size 2 - dont_generate_debug_code } /* * head of list of SCBs that have @@ -3786,7 +3643,6 @@ scratch_ram { */ COMPLETE_ON_QFREEZE_HEAD { size 2 - dont_generate_debug_code } /* * Counting semaphore to prevent new select-outs @@ -3811,7 +3667,6 @@ scratch_ram { */ MSG_OUT { size 1 - dont_generate_debug_code } /* Parameters for DMA Logic */ DMAPARAMS { @@ -3827,7 +3682,6 @@ scratch_ram { field DIRECTION 0x04 /* Set indicates PCI->SCSI */ field FIFOFLUSH 0x02 field FIFORESET 0x01 - dont_generate_debug_code } SEQ_FLAGS { size 1 @@ -3849,11 +3703,9 @@ scratch_ram { */ SAVED_SCSIID { size 1 - dont_generate_debug_code } SAVED_LUN { size 1 - dont_generate_debug_code } /* * The last bus phase as seen by the sequencer. @@ -3881,7 +3733,6 @@ scratch_ram { */ QOUTFIFO_ENTRY_VALID_TAG { size 1 - dont_generate_debug_code } /* * Kernel and sequencer offsets into the queue of @@ -3891,12 +3742,10 @@ scratch_ram { KERNEL_TQINPOS { size 1 count 1 - dont_generate_debug_code } TQINPOS { size 1 count 8 - dont_generate_debug_code } /* * Base address of our shared data with the kernel driver in host @@ -3905,7 +3754,6 @@ scratch_ram { */ SHARED_DATA_ADDR { size 4 - dont_generate_debug_code } /* * Pointer to location in host memory for next @@ -3913,7 +3761,6 @@ scratch_ram { */ QOUTFIFO_NEXT_ADDR { size 4 - dont_generate_debug_code } ARG_1 { size 1 @@ -3926,13 +3773,11 @@ scratch_ram { mask CONT_MSG_LOOP_READ 0x03 mask CONT_MSG_LOOP_TARG 0x02 alias RETURN_1 - dont_generate_debug_code } ARG_2 { size 1 count 1 alias RETURN_2 - dont_generate_debug_code } /* @@ -3940,7 +3785,6 @@ scratch_ram { */ LAST_MSG { size 1 - dont_generate_debug_code } /* @@ -3957,7 +3801,6 @@ scratch_ram { field MANUALP 0x0C field ENAUTOATNP 0x02 field ALTSTIM 0x01 - dont_generate_debug_code } /* @@ -3966,7 +3809,6 @@ scratch_ram { INITIATOR_TAG { size 1 count 1 - dont_generate_debug_code } SEQ_FLAGS2 { @@ -3978,7 +3820,6 @@ scratch_ram { ALLOCFIFO_SCBPTR { size 2 - dont_generate_debug_code } /* @@ -3988,7 +3829,6 @@ scratch_ram { */ INT_COALESCING_TIMER { size 2 - dont_generate_debug_code } /* @@ -3998,7 +3838,6 @@ scratch_ram { */ INT_COALESCING_MAXCMDS { size 1 - dont_generate_debug_code } /* @@ -4007,7 +3846,6 @@ scratch_ram { */ INT_COALESCING_MINCMDS { size 1 - dont_generate_debug_code } /* @@ -4015,7 +3853,6 @@ scratch_ram { */ CMDS_PENDING { size 2 - dont_generate_debug_code } /* @@ -4023,7 +3860,6 @@ scratch_ram { */ INT_COALESCING_CMDCOUNT { size 1 - dont_generate_debug_code } /* @@ -4032,7 +3868,6 @@ scratch_ram { */ LOCAL_HS_MAILBOX { size 1 - dont_generate_debug_code } /* * Target-mode CDB type to CDB length table used @@ -4041,7 +3876,6 @@ scratch_ram { CMDSIZE_TABLE { size 8 count 8 - dont_generate_debug_code } /* * When an SCB with the MK_MESSAGE flag is @@ -4074,31 +3908,25 @@ scb { size 4 alias SCB_CDB_STORE alias SCB_HOST_CDB_PTR - dont_generate_debug_code } SCB_RESIDUAL_SGPTR { size 4 field SG_ADDR_MASK 0xf8 /* In the last byte */ field SG_OVERRUN_RESID 0x02 /* In the first byte */ field SG_LIST_NULL 0x01 /* In the first byte */ - dont_generate_debug_code } SCB_SCSI_STATUS { size 1 alias SCB_HOST_CDB_LEN - dont_generate_debug_code } SCB_TARGET_PHASES { size 1 - dont_generate_debug_code } SCB_TARGET_DATA_DIR { size 1 - dont_generate_debug_code } SCB_TARGET_ITAG { size 1 - dont_generate_debug_code } SCB_SENSE_BUSADDR { /* @@ -4108,12 +3936,10 @@ scb { */ size 4 alias SCB_NEXT_COMPLETE - dont_generate_debug_code } SCB_TAG { alias SCB_FIFO_USE_COUNT size 2 - dont_generate_debug_code } SCB_CONTROL { size 1 @@ -4133,7 +3959,6 @@ scb { SCB_LUN { size 1 field LID 0xff - dont_generate_debug_code } SCB_TASK_ATTRIBUTE { size 1 @@ -4142,20 +3967,16 @@ scb { * ignore wide residue message handling. */ field SCB_XFERLEN_ODD 0x01 - dont_generate_debug_code } SCB_CDB_LEN { size 1 field SCB_CDB_LEN_PTR 0x80 /* CDB in host memory */ - dont_generate_debug_code } SCB_TASK_MANAGEMENT { size 1 - dont_generate_debug_code } SCB_DATAPTR { size 8 - dont_generate_debug_code } SCB_DATACNT { /* @@ -4165,27 +3986,22 @@ scb { size 4 field SG_LAST_SEG 0x80 /* In the fourth byte */ field SG_HIGH_ADDR_BITS 0x7F /* In the fourth byte */ - dont_generate_debug_code } SCB_SGPTR { size 4 field SG_STATUS_VALID 0x04 /* In the first byte */ field SG_FULL_RESID 0x02 /* In the first byte */ field SG_LIST_NULL 0x01 /* In the first byte */ - dont_generate_debug_code } SCB_BUSADDR { size 4 - dont_generate_debug_code } SCB_NEXT { alias SCB_NEXT_SCB_BUSADDR size 2 - dont_generate_debug_code } SCB_NEXT2 { size 2 - dont_generate_debug_code } SCB_SPARE { size 8 @@ -4193,7 +4009,6 @@ scb { } SCB_DISCONNECTED_LISTS { size 8 - dont_generate_debug_code } } diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_core.c b/trunk/drivers/scsi/aic7xxx/aic79xx_core.c index bdad54ec088c..55508b0fcec4 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_core.c +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_core.c @@ -2472,6 +2472,8 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) if ((ahd->bugs & AHD_CLRLQO_AUTOCLR_BUG) != 0) ahd_outb(ahd, CLRLQOINT1, 0); } else if ((status & SELTO) != 0) { + u_int scbid; + /* Stop the selection */ ahd_outb(ahd, SCSISEQ0, 0); @@ -2581,6 +2583,9 @@ ahd_handle_scsiint(struct ahd_softc *ahd, u_int intstat) case BUSFREE_DFF0: case BUSFREE_DFF1: { + u_int scbid; + struct scb *scb; + mode = busfreetime == BUSFREE_DFF0 ? AHD_MODE_DFF0 : AHD_MODE_DFF1; ahd_set_modes(ahd, mode, mode); @@ -3684,7 +3689,7 @@ ahd_free_tstate(struct ahd_softc *ahd, u_int scsi_id, char channel, int force) * by the capabilities of the bus connectivity of and sync settings for * the target. */ -static void +void ahd_devlimited_syncrate(struct ahd_softc *ahd, struct ahd_initiator_tinfo *tinfo, u_int *period, u_int *ppr_options, role_t role) @@ -4131,7 +4136,7 @@ ahd_update_neg_table(struct ahd_softc *ahd, struct ahd_devinfo *devinfo, /* * Harpoon2A assumed that there would be a - * fallback rate between 160MHz and 80MHz, + * fallback rate between 160MHz and 80Mhz, * so 7 is used as the period factor rather * than 8 for 160MHz. */ @@ -8703,7 +8708,7 @@ ahd_reset_current_bus(struct ahd_softc *ahd) int ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset) { - struct ahd_devinfo caminfo; + struct ahd_devinfo devinfo; u_int initiator; u_int target; u_int max_scsiid; @@ -8724,7 +8729,7 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset) ahd->pending_device = NULL; - ahd_compile_devinfo(&caminfo, + ahd_compile_devinfo(&devinfo, CAM_TARGET_WILDCARD, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD, @@ -8863,7 +8868,7 @@ ahd_reset_channel(struct ahd_softc *ahd, char channel, int initiate_reset) } /* Notify the XPT that a bus reset occurred */ - ahd_send_async(ahd, caminfo.channel, CAM_TARGET_WILDCARD, + ahd_send_async(ahd, devinfo.channel, CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD, AC_BUS_RESET); ahd_restart(ahd); diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_pci.c b/trunk/drivers/scsi/aic7xxx/aic79xx_pci.c index a734d77e880e..c25b6adffbf9 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_pci.c +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_pci.c @@ -223,10 +223,10 @@ static const char *pci_bus_modes[] = "PCI bus mode unknown", "PCI bus mode unknown", "PCI bus mode unknown", - "PCI-X 101-133MHz", - "PCI-X 67-100MHz", - "PCI-X 50-66MHz", - "PCI 33 or 66MHz" + "PCI-X 101-133Mhz", + "PCI-X 67-100Mhz", + "PCI-X 50-66Mhz", + "PCI 33 or 66Mhz" }; #define TESTMODE 0x00000800ul @@ -337,6 +337,8 @@ ahd_pci_config(struct ahd_softc *ahd, const struct ahd_pci_identity *entry) * 64bit bus (PCI64BIT set in devconfig). */ if ((ahd->flags & (AHD_39BIT_ADDRESSING|AHD_64BIT_ADDRESSING)) != 0) { + uint32_t devconfig; + if (bootverbose) printf("%s: Enabling 39Bit Addressing\n", ahd_name(ahd)); @@ -481,6 +483,8 @@ ahd_pci_test_register_access(struct ahd_softc *ahd) goto fail; if ((ahd_inb(ahd, INTSTAT) & PCIINT) != 0) { + u_int targpcistat; + ahd_set_modes(ahd, AHD_MODE_CFG, AHD_MODE_CFG); targpcistat = ahd_inb(ahd, TARGPCISTAT); if ((targpcistat & STA) != 0) diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped b/trunk/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped index cdcead071ef6..c21ceab8e913 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_reg.h_shipped @@ -33,6 +33,13 @@ ahd_reg_print_t ahd_seqintcode_print; ahd_print_register(NULL, 0, "SEQINTCODE", 0x02, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_clrint_print; +#else +#define ahd_clrint_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "CLRINT", 0x03, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_error_print; #else @@ -40,6 +47,20 @@ ahd_reg_print_t ahd_error_print; ahd_print_register(NULL, 0, "ERROR", 0x04, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_hcntrl_print; +#else +#define ahd_hcntrl_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "HCNTRL", 0x05, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_hnscb_qoff_print; +#else +#define ahd_hnscb_qoff_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "HNSCB_QOFF", 0x06, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_hescb_qoff_print; #else @@ -75,6 +96,13 @@ ahd_reg_print_t ahd_swtimer_print; ahd_print_register(NULL, 0, "SWTIMER", 0x0e, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_snscb_qoff_print; +#else +#define ahd_snscb_qoff_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SNSCB_QOFF", 0x10, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_sescb_qoff_print; #else @@ -82,6 +110,20 @@ ahd_reg_print_t ahd_sescb_qoff_print; ahd_print_register(NULL, 0, "SESCB_QOFF", 0x12, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_sdscb_qoff_print; +#else +#define ahd_sdscb_qoff_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SDSCB_QOFF", 0x14, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_qoff_ctlsta_print; +#else +#define ahd_qoff_ctlsta_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "QOFF_CTLSTA", 0x16, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_intctl_print; #else @@ -96,6 +138,13 @@ ahd_reg_print_t ahd_dfcntrl_print; ahd_print_register(NULL, 0, "DFCNTRL", 0x19, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_dscommand0_print; +#else +#define ahd_dscommand0_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "DSCOMMAND0", 0x19, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_dfstatus_print; #else @@ -110,6 +159,13 @@ ahd_reg_print_t ahd_sg_cache_shadow_print; ahd_print_register(NULL, 0, "SG_CACHE_SHADOW", 0x1b, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_sg_cache_pre_print; +#else +#define ahd_sg_cache_pre_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SG_CACHE_PRE", 0x1b, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_lqin_print; #else @@ -236,6 +292,13 @@ ahd_reg_print_t ahd_sxfrctl0_print; ahd_print_register(NULL, 0, "SXFRCTL0", 0x3c, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_sxfrctl1_print; +#else +#define ahd_sxfrctl1_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SXFRCTL1", 0x3d, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_dffstat_print; #else @@ -250,6 +313,13 @@ ahd_reg_print_t ahd_multargid_print; ahd_print_register(NULL, 0, "MULTARGID", 0x40, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_scsisigo_print; +#else +#define ahd_scsisigo_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SCSISIGO", 0x40, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_scsisigi_print; #else @@ -292,6 +362,13 @@ ahd_reg_print_t ahd_selid_print; ahd_print_register(NULL, 0, "SELID", 0x49, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_optionmode_print; +#else +#define ahd_optionmode_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "OPTIONMODE", 0x4a, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_sblkctl_print; #else @@ -313,6 +390,13 @@ ahd_reg_print_t ahd_simode0_print; ahd_print_register(NULL, 0, "SIMODE0", 0x4b, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_clrsint0_print; +#else +#define ahd_clrsint0_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "CLRSINT0", 0x4b, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_sstat1_print; #else @@ -320,6 +404,13 @@ ahd_reg_print_t ahd_sstat1_print; ahd_print_register(NULL, 0, "SSTAT1", 0x4c, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_clrsint1_print; +#else +#define ahd_clrsint1_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "CLRSINT1", 0x4c, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_sstat2_print; #else @@ -370,17 +461,17 @@ ahd_reg_print_t ahd_lqistat0_print; #endif #if AIC_DEBUG_REGISTERS -ahd_reg_print_t ahd_clrlqiint0_print; +ahd_reg_print_t ahd_lqimode0_print; #else -#define ahd_clrlqiint0_print(regvalue, cur_col, wrap) \ - ahd_print_register(NULL, 0, "CLRLQIINT0", 0x50, regvalue, cur_col, wrap) +#define ahd_lqimode0_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "LQIMODE0", 0x50, regvalue, cur_col, wrap) #endif #if AIC_DEBUG_REGISTERS -ahd_reg_print_t ahd_lqimode0_print; +ahd_reg_print_t ahd_clrlqiint0_print; #else -#define ahd_lqimode0_print(regvalue, cur_col, wrap) \ - ahd_print_register(NULL, 0, "LQIMODE0", 0x50, regvalue, cur_col, wrap) +#define ahd_clrlqiint0_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "CLRLQIINT0", 0x50, regvalue, cur_col, wrap) #endif #if AIC_DEBUG_REGISTERS @@ -538,17 +629,17 @@ ahd_reg_print_t ahd_seqintsrc_print; #endif #if AIC_DEBUG_REGISTERS -ahd_reg_print_t ahd_currscb_print; +ahd_reg_print_t ahd_seqimode_print; #else -#define ahd_currscb_print(regvalue, cur_col, wrap) \ - ahd_print_register(NULL, 0, "CURRSCB", 0x5c, regvalue, cur_col, wrap) +#define ahd_seqimode_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SEQIMODE", 0x5c, regvalue, cur_col, wrap) #endif #if AIC_DEBUG_REGISTERS -ahd_reg_print_t ahd_seqimode_print; +ahd_reg_print_t ahd_currscb_print; #else -#define ahd_seqimode_print(regvalue, cur_col, wrap) \ - ahd_print_register(NULL, 0, "SEQIMODE", 0x5c, regvalue, cur_col, wrap) +#define ahd_currscb_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "CURRSCB", 0x5c, regvalue, cur_col, wrap) #endif #if AIC_DEBUG_REGISTERS @@ -565,6 +656,13 @@ ahd_reg_print_t ahd_lastscb_print; ahd_print_register(NULL, 0, "LASTSCB", 0x5e, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_shaddr_print; +#else +#define ahd_shaddr_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SHADDR", 0x60, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_negoaddr_print; #else @@ -650,10 +748,17 @@ ahd_reg_print_t ahd_seloid_print; #endif #if AIC_DEBUG_REGISTERS -ahd_reg_print_t ahd_scbhaddr_print; +ahd_reg_print_t ahd_haddr_print; #else -#define ahd_scbhaddr_print(regvalue, cur_col, wrap) \ - ahd_print_register(NULL, 0, "SCBHADDR", 0x7c, regvalue, cur_col, wrap) +#define ahd_haddr_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "HADDR", 0x70, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_hcnt_print; +#else +#define ahd_hcnt_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "HCNT", 0x78, regvalue, cur_col, wrap) #endif #if AIC_DEBUG_REGISTERS @@ -664,10 +769,10 @@ ahd_reg_print_t ahd_sghaddr_print; #endif #if AIC_DEBUG_REGISTERS -ahd_reg_print_t ahd_scbhcnt_print; +ahd_reg_print_t ahd_scbhaddr_print; #else -#define ahd_scbhcnt_print(regvalue, cur_col, wrap) \ - ahd_print_register(NULL, 0, "SCBHCNT", 0x84, regvalue, cur_col, wrap) +#define ahd_scbhaddr_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SCBHADDR", 0x7c, regvalue, cur_col, wrap) #endif #if AIC_DEBUG_REGISTERS @@ -677,6 +782,20 @@ ahd_reg_print_t ahd_sghcnt_print; ahd_print_register(NULL, 0, "SGHCNT", 0x84, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_scbhcnt_print; +#else +#define ahd_scbhcnt_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SCBHCNT", 0x84, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_dff_thrsh_print; +#else +#define ahd_dff_thrsh_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "DFF_THRSH", 0x88, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_pcixctl_print; #else @@ -747,6 +866,13 @@ ahd_reg_print_t ahd_targpcistat_print; ahd_print_register(NULL, 0, "TARGPCISTAT", 0xa7, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_scbptr_print; +#else +#define ahd_scbptr_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SCBPTR", 0xa8, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_scbautoptr_print; #else @@ -754,6 +880,13 @@ ahd_reg_print_t ahd_scbautoptr_print; ahd_print_register(NULL, 0, "SCBAUTOPTR", 0xab, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_ccsgaddr_print; +#else +#define ahd_ccsgaddr_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "CCSGADDR", 0xac, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_ccscbaddr_print; #else @@ -775,6 +908,13 @@ ahd_reg_print_t ahd_ccsgctl_print; ahd_print_register(NULL, 0, "CCSGCTL", 0xad, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_ccsgram_print; +#else +#define ahd_ccsgram_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "CCSGRAM", 0xb0, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_ccscbram_print; #else @@ -789,6 +929,13 @@ ahd_reg_print_t ahd_brddat_print; ahd_print_register(NULL, 0, "BRDDAT", 0xb8, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_brdctl_print; +#else +#define ahd_brdctl_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "BRDCTL", 0xb9, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_seeadr_print; #else @@ -824,6 +971,13 @@ ahd_reg_print_t ahd_dspdatactl_print; ahd_print_register(NULL, 0, "DSPDATACTL", 0xc1, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_dfdat_print; +#else +#define ahd_dfdat_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "DFDAT", 0xc4, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_dspselect_print; #else @@ -845,6 +999,13 @@ ahd_reg_print_t ahd_seqctl0_print; ahd_print_register(NULL, 0, "SEQCTL0", 0xd6, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_flags_print; +#else +#define ahd_flags_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "FLAGS", 0xd8, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_seqintctl_print; #else @@ -852,6 +1013,13 @@ ahd_reg_print_t ahd_seqintctl_print; ahd_print_register(NULL, 0, "SEQINTCTL", 0xd9, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_seqram_print; +#else +#define ahd_seqram_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SEQRAM", 0xda, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_prgmcnt_print; #else @@ -859,6 +1027,41 @@ ahd_reg_print_t ahd_prgmcnt_print; ahd_print_register(NULL, 0, "PRGMCNT", 0xde, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_accum_print; +#else +#define ahd_accum_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "ACCUM", 0xe0, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_sindex_print; +#else +#define ahd_sindex_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SINDEX", 0xe2, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_dindex_print; +#else +#define ahd_dindex_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "DINDEX", 0xe4, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_allones_print; +#else +#define ahd_allones_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "ALLONES", 0xe8, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_allzeros_print; +#else +#define ahd_allzeros_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "ALLZEROS", 0xea, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_none_print; #else @@ -866,6 +1069,27 @@ ahd_reg_print_t ahd_none_print; ahd_print_register(NULL, 0, "NONE", 0xea, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_sindir_print; +#else +#define ahd_sindir_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SINDIR", 0xec, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_dindir_print; +#else +#define ahd_dindir_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "DINDIR", 0xed, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_stack_print; +#else +#define ahd_stack_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "STACK", 0xf2, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_intvec1_addr_print; #else @@ -902,17 +1126,17 @@ ahd_reg_print_t ahd_accum_save_print; #endif #if AIC_DEBUG_REGISTERS -ahd_reg_print_t ahd_waiting_scb_tails_print; +ahd_reg_print_t ahd_sram_base_print; #else -#define ahd_waiting_scb_tails_print(regvalue, cur_col, wrap) \ - ahd_print_register(NULL, 0, "WAITING_SCB_TAILS", 0x100, regvalue, cur_col, wrap) +#define ahd_sram_base_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SRAM_BASE", 0x100, regvalue, cur_col, wrap) #endif #if AIC_DEBUG_REGISTERS -ahd_reg_print_t ahd_sram_base_print; +ahd_reg_print_t ahd_waiting_scb_tails_print; #else -#define ahd_sram_base_print(regvalue, cur_col, wrap) \ - ahd_print_register(NULL, 0, "SRAM_BASE", 0x100, regvalue, cur_col, wrap) +#define ahd_waiting_scb_tails_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "WAITING_SCB_TAILS", 0x100, regvalue, cur_col, wrap) #endif #if AIC_DEBUG_REGISTERS @@ -999,6 +1223,13 @@ ahd_reg_print_t ahd_msg_out_print; ahd_print_register(NULL, 0, "MSG_OUT", 0x137, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_dmaparams_print; +#else +#define ahd_dmaparams_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "DMAPARAMS", 0x138, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_seq_flags_print; #else @@ -1006,6 +1237,20 @@ ahd_reg_print_t ahd_seq_flags_print; ahd_print_register(NULL, 0, "SEQ_FLAGS", 0x139, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_saved_scsiid_print; +#else +#define ahd_saved_scsiid_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SAVED_SCSIID", 0x13a, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_saved_lun_print; +#else +#define ahd_saved_lun_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SAVED_LUN", 0x13b, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_lastphase_print; #else @@ -1027,6 +1272,20 @@ ahd_reg_print_t ahd_kernel_tqinpos_print; ahd_print_register(NULL, 0, "KERNEL_TQINPOS", 0x13e, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_tqinpos_print; +#else +#define ahd_tqinpos_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "TQINPOS", 0x13f, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_shared_data_addr_print; +#else +#define ahd_shared_data_addr_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SHARED_DATA_ADDR", 0x140, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_qoutfifo_next_addr_print; #else @@ -1034,6 +1293,20 @@ ahd_reg_print_t ahd_qoutfifo_next_addr_print; ahd_print_register(NULL, 0, "QOUTFIFO_NEXT_ADDR", 0x144, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_arg_1_print; +#else +#define ahd_arg_1_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "ARG_1", 0x148, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_arg_2_print; +#else +#define ahd_arg_2_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "ARG_2", 0x149, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_last_msg_print; #else @@ -1132,6 +1405,13 @@ ahd_reg_print_t ahd_mk_message_scsiid_print; ahd_print_register(NULL, 0, "MK_MESSAGE_SCSIID", 0x162, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_scb_residual_datacnt_print; +#else +#define ahd_scb_residual_datacnt_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SCB_RESIDUAL_DATACNT", 0x180, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_scb_base_print; #else @@ -1140,10 +1420,17 @@ ahd_reg_print_t ahd_scb_base_print; #endif #if AIC_DEBUG_REGISTERS -ahd_reg_print_t ahd_scb_residual_datacnt_print; +ahd_reg_print_t ahd_scb_residual_sgptr_print; #else -#define ahd_scb_residual_datacnt_print(regvalue, cur_col, wrap) \ - ahd_print_register(NULL, 0, "SCB_RESIDUAL_DATACNT", 0x180, regvalue, cur_col, wrap) +#define ahd_scb_residual_sgptr_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SCB_RESIDUAL_SGPTR", 0x184, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_scb_scsi_status_print; +#else +#define ahd_scb_scsi_status_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SCB_SCSI_STATUS", 0x188, regvalue, cur_col, wrap) #endif #if AIC_DEBUG_REGISTERS @@ -1188,6 +1475,13 @@ ahd_reg_print_t ahd_scb_task_attribute_print; ahd_print_register(NULL, 0, "SCB_TASK_ATTRIBUTE", 0x195, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_scb_cdb_len_print; +#else +#define ahd_scb_cdb_len_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SCB_CDB_LEN", 0x196, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_scb_task_management_print; #else @@ -1223,6 +1517,13 @@ ahd_reg_print_t ahd_scb_busaddr_print; ahd_print_register(NULL, 0, "SCB_BUSADDR", 0x1a8, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahd_reg_print_t ahd_scb_next_print; +#else +#define ahd_scb_next_print(regvalue, cur_col, wrap) \ + ahd_print_register(NULL, 0, "SCB_NEXT", 0x1ac, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahd_reg_print_t ahd_scb_next2_print; #else @@ -1416,10 +1717,10 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define SG_CACHE_PRE 0x1b -#define LQIN 0x20 - #define TYPEPTR 0x20 +#define LQIN 0x20 + #define TAGPTR 0x21 #define LUNPTR 0x22 @@ -1479,14 +1780,6 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define SINGLECMD 0x02 #define ABORTPENDING 0x01 -#define SCSBIST0 0x39 -#define GSBISTERR 0x40 -#define GSBISTDONE 0x20 -#define GSBISTRUN 0x10 -#define OSBISTERR 0x04 -#define OSBISTDONE 0x02 -#define OSBISTRUN 0x01 - #define LQCTL2 0x39 #define LQIRETRY 0x80 #define LQICONTINUE 0x40 @@ -1497,10 +1790,13 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define LQOTOIDLE 0x02 #define LQOPAUSE 0x01 -#define SCSBIST1 0x3a -#define NTBISTERR 0x04 -#define NTBISTDONE 0x02 -#define NTBISTRUN 0x01 +#define SCSBIST0 0x39 +#define GSBISTERR 0x40 +#define GSBISTDONE 0x20 +#define GSBISTRUN 0x10 +#define OSBISTERR 0x04 +#define OSBISTDONE 0x02 +#define OSBISTRUN 0x01 #define SCSISEQ0 0x3a #define TEMODEO 0x80 @@ -1509,8 +1805,15 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define FORCEBUSFREE 0x10 #define SCSIRSTO 0x01 +#define SCSBIST1 0x3a +#define NTBISTERR 0x04 +#define NTBISTDONE 0x02 +#define NTBISTRUN 0x01 + #define SCSISEQ1 0x3b +#define BUSINITID 0x3c + #define SXFRCTL0 0x3c #define DFON 0x80 #define DFPEXP 0x40 @@ -1519,8 +1822,6 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define DLCOUNT 0x3c -#define BUSINITID 0x3c - #define SXFRCTL1 0x3d #define BITBUCKET 0x80 #define ENSACHK 0x40 @@ -1545,6 +1846,8 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define CURRFIFO_1 0x01 #define CURRFIFO_0 0x00 +#define MULTARGID 0x40 + #define SCSISIGO 0x40 #define CDO 0x80 #define IOO 0x40 @@ -1555,8 +1858,6 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define REQO 0x02 #define ACKO 0x01 -#define MULTARGID 0x40 - #define SCSISIGI 0x41 #define ATNI 0x10 #define SELI 0x08 @@ -1603,15 +1904,6 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define ENAB20 0x04 #define SELWIDE 0x02 -#define CLRSINT0 0x4b -#define CLRSELDO 0x40 -#define CLRSELDI 0x20 -#define CLRSELINGO 0x10 -#define CLRIOERR 0x08 -#define CLROVERRUN 0x04 -#define CLRSPIORDY 0x02 -#define CLRARBDO 0x01 - #define SSTAT0 0x4b #define TARGET 0x80 #define SELDO 0x40 @@ -1631,14 +1923,14 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define ENSPIORDY 0x02 #define ENARBDO 0x01 -#define CLRSINT1 0x4c -#define CLRSELTIMEO 0x80 -#define CLRATNO 0x40 -#define CLRSCSIRSTI 0x20 -#define CLRBUSFREE 0x08 -#define CLRSCSIPERR 0x04 -#define CLRSTRB2FAST 0x02 -#define CLRREQINIT 0x01 +#define CLRSINT0 0x4b +#define CLRSELDO 0x40 +#define CLRSELDI 0x20 +#define CLRSELINGO 0x10 +#define CLRIOERR 0x08 +#define CLROVERRUN 0x04 +#define CLRSPIORDY 0x02 +#define CLRARBDO 0x01 #define SSTAT1 0x4c #define SELTO 0x80 @@ -1650,6 +1942,15 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define STRB2FAST 0x02 #define REQINIT 0x01 +#define CLRSINT1 0x4c +#define CLRSELTIMEO 0x80 +#define CLRATNO 0x40 +#define CLRSCSIRSTI 0x20 +#define CLRBUSFREE 0x08 +#define CLRSCSIPERR 0x04 +#define CLRSTRB2FAST 0x02 +#define CLRREQINIT 0x01 + #define SSTAT2 0x4d #define BUSFREETIME 0xc0 #define NONPACKREQ 0x20 @@ -1697,14 +1998,6 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define LQIATNLQ 0x02 #define LQIATNCMD 0x01 -#define CLRLQIINT0 0x50 -#define CLRLQIATNQAS 0x20 -#define CLRLQICRCT1 0x10 -#define CLRLQICRCT2 0x08 -#define CLRLQIBADLQT 0x04 -#define CLRLQIATNLQ 0x02 -#define CLRLQIATNCMD 0x01 - #define LQIMODE0 0x50 #define ENLQIATNQASK 0x20 #define ENLQICRCT1 0x10 @@ -1713,6 +2006,14 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define ENLQIATNLQ 0x02 #define ENLQIATNCMD 0x01 +#define CLRLQIINT0 0x50 +#define CLRLQIATNQAS 0x20 +#define CLRLQICRCT1 0x10 +#define CLRLQICRCT2 0x08 +#define CLRLQIBADLQT 0x04 +#define CLRLQIATNLQ 0x02 +#define CLRLQIATNCMD 0x01 + #define LQIMODE1 0x51 #define ENLQIPHASE_LQ 0x80 #define ENLQIPHASE_NLQ 0x40 @@ -1859,8 +2160,6 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define CFG4ICMD 0x02 #define CFG4TCMD 0x01 -#define CURRSCB 0x5c - #define SEQIMODE 0x5c #define ENCTXTDONE 0x40 #define ENSAVEPTRS 0x20 @@ -1870,6 +2169,8 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define ENCFG4ICMD 0x02 #define ENCFG4TCMD 0x01 +#define CURRSCB 0x5c + #define MDFFSTAT 0x5d #define SHCNTNEGATIVE 0x40 #define SHCNTMINUS1 0x20 @@ -1884,29 +2185,29 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define DFFTAG 0x5e -#define LASTSCB 0x5e - #define SCSITEST 0x5e #define CNTRTEST 0x08 #define SEL_TXPLL_DEBUG 0x04 +#define LASTSCB 0x5e + #define IOPDNCTL 0x5f #define DISABLE_OE 0x80 #define PDN_IDIST 0x04 #define PDN_DIFFSENSE 0x01 +#define DGRPCRCI 0x60 + #define SHADDR 0x60 #define NEGOADDR 0x60 -#define DGRPCRCI 0x60 - #define NEGPERIOD 0x61 -#define PACKCRCI 0x62 - #define NEGOFFSET 0x62 +#define PACKCRCI 0x62 + #define NEGPPROPTS 0x63 #define PPROPT_PACE 0x08 #define PPROPT_QAS 0x04 @@ -1952,6 +2253,8 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define SELOID 0x6b +#define FAIRNESS 0x6c + #define PLL400CTL0 0x6c #define PLL_VCOSEL 0x80 #define PLL_PWDN 0x40 @@ -1961,8 +2264,6 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define PLL_DLPF 0x02 #define PLL_ENFBM 0x01 -#define FAIRNESS 0x6c - #define PLL400CTL1 0x6d #define PLL_CNTEN 0x80 #define PLL_CNTCLR 0x40 @@ -1974,25 +2275,25 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define HADDR 0x70 +#define HODMAADR 0x70 + #define PLLDELAY 0x70 #define SPLIT_DROP_REQ 0x80 -#define HODMAADR 0x70 +#define HCNT 0x78 #define HODMACNT 0x78 -#define HCNT 0x78 - #define HODMAEN 0x7a -#define SCBHADDR 0x7c - #define SGHADDR 0x7c -#define SCBHCNT 0x84 +#define SCBHADDR 0x7c #define SGHCNT 0x84 +#define SCBHCNT 0x84 + #define DFF_THRSH 0x88 #define WR_DFTHRSH 0x70 #define RD_DFTHRSH 0x07 @@ -2025,6 +2326,10 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define CMCRXMSG0 0x90 +#define OVLYRXMSG0 0x90 + +#define DCHRXMSG0 0x90 + #define ROENABLE 0x90 #define MSIROEN 0x20 #define OVLYROEN 0x10 @@ -2033,11 +2338,11 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define DCH1ROEN 0x02 #define DCH0ROEN 0x01 -#define OVLYRXMSG0 0x90 +#define OVLYRXMSG1 0x91 -#define DCHRXMSG0 0x90 +#define CMCRXMSG1 0x91 -#define OVLYRXMSG1 0x91 +#define DCHRXMSG1 0x91 #define NSENABLE 0x91 #define MSINSEN 0x20 @@ -2047,10 +2352,6 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define DCH1NSEN 0x02 #define DCH0NSEN 0x01 -#define CMCRXMSG1 0x91 - -#define DCHRXMSG1 0x91 - #define DCHRXMSG2 0x92 #define CMCRXMSG2 0x92 @@ -2074,24 +2375,24 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define TSCSERREN 0x02 #define CMPABCDIS 0x01 +#define CMCSEQBCNT 0x94 + #define OVLYSEQBCNT 0x94 #define DCHSEQBCNT 0x94 -#define CMCSEQBCNT 0x94 - -#define CMCSPLTSTAT0 0x96 - #define DCHSPLTSTAT0 0x96 #define OVLYSPLTSTAT0 0x96 -#define CMCSPLTSTAT1 0x97 +#define CMCSPLTSTAT0 0x96 #define OVLYSPLTSTAT1 0x97 #define DCHSPLTSTAT1 0x97 +#define CMCSPLTSTAT1 0x97 + #define SGRXMSG0 0x98 #define CDNUM 0xf8 #define CFNUM 0x07 @@ -2119,18 +2420,15 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define TAG_NUM 0x1f #define RLXORD 0x10 -#define SGSEQBCNT 0x9c - #define SLVSPLTOUTATTR0 0x9c #define LOWER_BCNT 0xff +#define SGSEQBCNT 0x9c + #define SLVSPLTOUTATTR1 0x9d #define CMPLT_DNUM 0xf8 #define CMPLT_FNUM 0x07 -#define SLVSPLTOUTATTR2 0x9e -#define CMPLT_BNUM 0xff - #define SGSPLTSTAT0 0x9e #define STAETERM 0x80 #define SCBCERR 0x40 @@ -2141,6 +2439,9 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define RXSCEMSG 0x02 #define RXSPLTRSP 0x01 +#define SLVSPLTOUTATTR2 0x9e +#define CMPLT_BNUM 0xff + #define SGSPLTSTAT1 0x9f #define RXDATABUCKET 0x01 @@ -2196,10 +2497,10 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define CCSGADDR 0xac -#define CCSCBADR_BK 0xac - #define CCSCBADDR 0xac +#define CCSCBADR_BK 0xac + #define CMC_RAMBIST 0xad #define SG_ELEMENT_SIZE 0x80 #define SCBRAMBIST_FAIL 0x40 @@ -2253,9 +2554,9 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define SEEDAT 0xbc #define SEECTL 0xbe +#define SEEOP_EWDS 0x40 #define SEEOP_WALL 0x40 #define SEEOP_EWEN 0x40 -#define SEEOP_EWDS 0x40 #define SEEOPCODE 0x70 #define SEERST 0x02 #define SEESTART 0x01 @@ -2272,25 +2573,25 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define SCBCNT 0xbf -#define DFWADDR 0xc0 - #define DSPFLTRCTL 0xc0 #define FLTRDISABLE 0x20 #define EDGESENSE 0x10 #define DSPFCNTSEL 0x0f +#define DFWADDR 0xc0 + #define DSPDATACTL 0xc1 #define BYPASSENAB 0x80 #define DESQDIS 0x10 #define RCVROFFSTDIS 0x04 #define XMITOFFSTDIS 0x02 -#define DFRADDR 0xc2 - #define DSPREQCTL 0xc2 #define MANREQCTL 0xc0 #define MANREQDLY 0x3f +#define DFRADDR 0xc2 + #define DSPACKCTL 0xc3 #define MANACKCTL 0xc0 #define MANACKDLY 0x3f @@ -2311,14 +2612,14 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define WRTBIASCALC 0xc7 -#define RCVRBIASCALC 0xc8 - #define DFPTRS 0xc8 -#define SKEWCALC 0xc9 +#define RCVRBIASCALC 0xc8 #define DFBKPTR 0xc9 +#define SKEWCALC 0xc9 + #define DFDBCTL 0xcb #define DFF_CIO_WR_RDY 0x20 #define DFF_CIO_RD_RDY 0x10 @@ -2403,12 +2704,12 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define ACCUM_SAVE 0xfa -#define WAITING_SCB_TAILS 0x100 - #define AHD_PCI_CONFIG_BASE 0x100 #define SRAM_BASE 0x100 +#define WAITING_SCB_TAILS 0x100 + #define WAITING_TID_HEAD 0x120 #define WAITING_TID_TAIL 0x122 @@ -2437,8 +2738,8 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define PRELOADEN 0x80 #define WIDEODD 0x40 #define SCSIEN 0x20 -#define SDMAEN 0x10 #define SDMAENACK 0x10 +#define SDMAEN 0x10 #define HDMAEN 0x08 #define HDMAENACK 0x08 #define DIRECTION 0x04 @@ -2536,12 +2837,12 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define MK_MESSAGE_SCSIID 0x162 -#define SCB_BASE 0x180 - #define SCB_RESIDUAL_DATACNT 0x180 #define SCB_CDB_STORE 0x180 #define SCB_HOST_CDB_PTR 0x180 +#define SCB_BASE 0x180 + #define SCB_RESIDUAL_SGPTR 0x184 #define SG_ADDR_MASK 0xf8 #define SG_OVERRUN_RESID 0x02 @@ -2609,6 +2910,17 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define SCB_DISCONNECTED_LISTS 0x1b8 +#define CMD_GROUP_CODE_SHIFT 0x05 +#define STIMESEL_MIN 0x18 +#define STIMESEL_SHIFT 0x03 +#define INVALID_ADDR 0x80 +#define AHD_PRECOMP_MASK 0x07 +#define TARGET_DATA_IN 0x01 +#define CCSCBADDR_MAX 0x80 +#define NUMDSPS 0x14 +#define SEEOP_EWEN_ADDR 0xc0 +#define AHD_ANNEXCOL_PER_DEV0 0x04 +#define DST_MODE_SHIFT 0x04 #define AHD_TIMER_MAX_US 0x18ffe7 #define AHD_TIMER_MAX_TICKS 0xffff #define AHD_SENSE_BUFSIZE 0x100 @@ -2643,43 +2955,32 @@ ahd_reg_print_t ahd_scb_disconnected_lists_print; #define LUNLEN_SINGLE_LEVEL_LUN 0x0f #define NVRAM_SCB_OFFSET 0x2c #define STATUS_PKT_SENSE 0xff -#define CMD_GROUP_CODE_SHIFT 0x05 #define MAX_OFFSET_PACED_BUG 0x7f #define STIMESEL_BUG_ADJ 0x08 -#define STIMESEL_MIN 0x18 -#define STIMESEL_SHIFT 0x03 #define CCSGRAM_MAXSEGS 0x10 -#define INVALID_ADDR 0x80 #define SEEOP_ERAL_ADDR 0x80 #define AHD_SLEWRATE_DEF_REVB 0x08 #define AHD_PRECOMP_CUTBACK_17 0x04 -#define AHD_PRECOMP_MASK 0x07 #define SRC_MODE_SHIFT 0x00 #define PKT_OVERRUN_BUFSIZE 0x200 #define SCB_TRANSFER_SIZE_1BYTE_LUN 0x30 -#define TARGET_DATA_IN 0x01 #define HOST_MSG 0xff #define MAX_OFFSET 0xfe #define BUS_16_BIT 0x01 -#define CCSCBADDR_MAX 0x80 -#define NUMDSPS 0x14 -#define SEEOP_EWEN_ADDR 0xc0 -#define AHD_ANNEXCOL_PER_DEV0 0x04 -#define DST_MODE_SHIFT 0x04 /* Downloaded Constant Definitions */ +#define SG_SIZEOF 0x04 +#define SG_PREFETCH_ALIGN_MASK 0x02 +#define SG_PREFETCH_CNT_LIMIT 0x01 #define CACHELINE_MASK 0x07 #define SCB_TRANSFER_SIZE 0x06 #define PKT_OVERRUN_BUFOFFSET 0x05 -#define SG_SIZEOF 0x04 #define SG_PREFETCH_ADDR_MASK 0x03 -#define SG_PREFETCH_ALIGN_MASK 0x02 -#define SG_PREFETCH_CNT_LIMIT 0x01 #define SG_PREFETCH_CNT 0x00 #define DOWNLOAD_CONST_COUNT 0x08 /* Exported Labels */ -#define LABEL_seq_isr 0x28f #define LABEL_timer_isr 0x28b +#define LABEL_seq_isr 0x28f diff --git a/trunk/drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped b/trunk/drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped index f5ea715d6ac3..c4c8a96bf5a3 100644 --- a/trunk/drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped +++ b/trunk/drivers/scsi/aic7xxx/aic79xx_reg_print.c_shipped @@ -8,6 +8,18 @@ #include "aic79xx_osm.h" +static const ahd_reg_parse_entry_t MODE_PTR_parse_table[] = { + { "SRC_MODE", 0x07, 0x07 }, + { "DST_MODE", 0x70, 0x70 } +}; + +int +ahd_mode_ptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(MODE_PTR_parse_table, 2, "MODE_PTR", + 0x00, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t INTSTAT_parse_table[] = { { "SPLTINT", 0x01, 0x01 }, { "CMDCMPLT", 0x02, 0x02 }, @@ -27,6 +39,110 @@ ahd_intstat_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x01, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t SEQINTCODE_parse_table[] = { + { "NO_SEQINT", 0x00, 0xff }, + { "BAD_PHASE", 0x01, 0xff }, + { "SEND_REJECT", 0x02, 0xff }, + { "PROTO_VIOLATION", 0x03, 0xff }, + { "NO_MATCH", 0x04, 0xff }, + { "IGN_WIDE_RES", 0x05, 0xff }, + { "PDATA_REINIT", 0x06, 0xff }, + { "HOST_MSG_LOOP", 0x07, 0xff }, + { "BAD_STATUS", 0x08, 0xff }, + { "DATA_OVERRUN", 0x09, 0xff }, + { "MKMSG_FAILED", 0x0a, 0xff }, + { "MISSED_BUSFREE", 0x0b, 0xff }, + { "DUMP_CARD_STATE", 0x0c, 0xff }, + { "ILLEGAL_PHASE", 0x0d, 0xff }, + { "INVALID_SEQINT", 0x0e, 0xff }, + { "CFG4ISTAT_INTR", 0x0f, 0xff }, + { "STATUS_OVERRUN", 0x10, 0xff }, + { "CFG4OVERRUN", 0x11, 0xff }, + { "ENTERING_NONPACK", 0x12, 0xff }, + { "TASKMGMT_FUNC_COMPLETE",0x13, 0xff }, + { "TASKMGMT_CMD_CMPLT_OKAY",0x14, 0xff }, + { "TRACEPOINT0", 0x15, 0xff }, + { "TRACEPOINT1", 0x16, 0xff }, + { "TRACEPOINT2", 0x17, 0xff }, + { "TRACEPOINT3", 0x18, 0xff }, + { "SAW_HWERR", 0x19, 0xff }, + { "BAD_SCB_STATUS", 0x1a, 0xff } +}; + +int +ahd_seqintcode_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SEQINTCODE_parse_table, 27, "SEQINTCODE", + 0x02, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t CLRINT_parse_table[] = { + { "CLRSPLTINT", 0x01, 0x01 }, + { "CLRCMDINT", 0x02, 0x02 }, + { "CLRSEQINT", 0x04, 0x04 }, + { "CLRSCSIINT", 0x08, 0x08 }, + { "CLRPCIINT", 0x10, 0x10 }, + { "CLRSWTMINT", 0x20, 0x20 }, + { "CLRBRKADRINT", 0x40, 0x40 }, + { "CLRHWERRINT", 0x80, 0x80 } +}; + +int +ahd_clrint_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CLRINT_parse_table, 8, "CLRINT", + 0x03, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t ERROR_parse_table[] = { + { "DSCTMOUT", 0x02, 0x02 }, + { "ILLOPCODE", 0x04, 0x04 }, + { "SQPARERR", 0x08, 0x08 }, + { "DPARERR", 0x10, 0x10 }, + { "MPARERR", 0x20, 0x20 }, + { "CIOACCESFAIL", 0x40, 0x40 }, + { "CIOPARERR", 0x80, 0x80 } +}; + +int +ahd_error_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(ERROR_parse_table, 7, "ERROR", + 0x04, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t HCNTRL_parse_table[] = { + { "CHIPRST", 0x01, 0x01 }, + { "CHIPRSTACK", 0x01, 0x01 }, + { "INTEN", 0x02, 0x02 }, + { "PAUSE", 0x04, 0x04 }, + { "SWTIMER_START_B", 0x08, 0x08 }, + { "SWINT", 0x10, 0x10 }, + { "POWRDN", 0x40, 0x40 }, + { "SEQ_RESET", 0x80, 0x80 } +}; + +int +ahd_hcntrl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(HCNTRL_parse_table, 8, "HCNTRL", + 0x05, regvalue, cur_col, wrap)); +} + +int +ahd_hnscb_qoff_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "HNSCB_QOFF", + 0x06, regvalue, cur_col, wrap)); +} + +int +ahd_hescb_qoff_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "HESCB_QOFF", + 0x08, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t HS_MAILBOX_parse_table[] = { { "ENINT_COALESCE", 0x40, 0x40 }, { "HOST_TQINPOS", 0x80, 0x80 } @@ -54,6 +170,77 @@ ahd_seqintstat_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x0c, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t CLRSEQINTSTAT_parse_table[] = { + { "CLRSEQ_SPLTINT", 0x01, 0x01 }, + { "CLRSEQ_PCIINT", 0x02, 0x02 }, + { "CLRSEQ_SCSIINT", 0x04, 0x04 }, + { "CLRSEQ_SEQINT", 0x08, 0x08 }, + { "CLRSEQ_SWTMRTO", 0x10, 0x10 } +}; + +int +ahd_clrseqintstat_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CLRSEQINTSTAT_parse_table, 5, "CLRSEQINTSTAT", + 0x0c, regvalue, cur_col, wrap)); +} + +int +ahd_swtimer_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SWTIMER", + 0x0e, regvalue, cur_col, wrap)); +} + +int +ahd_snscb_qoff_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SNSCB_QOFF", + 0x10, regvalue, cur_col, wrap)); +} + +int +ahd_sescb_qoff_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SESCB_QOFF", + 0x12, regvalue, cur_col, wrap)); +} + +int +ahd_sdscb_qoff_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SDSCB_QOFF", + 0x14, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t QOFF_CTLSTA_parse_table[] = { + { "SCB_QSIZE_4", 0x00, 0x0f }, + { "SCB_QSIZE_8", 0x01, 0x0f }, + { "SCB_QSIZE_16", 0x02, 0x0f }, + { "SCB_QSIZE_32", 0x03, 0x0f }, + { "SCB_QSIZE_64", 0x04, 0x0f }, + { "SCB_QSIZE_128", 0x05, 0x0f }, + { "SCB_QSIZE_256", 0x06, 0x0f }, + { "SCB_QSIZE_512", 0x07, 0x0f }, + { "SCB_QSIZE_1024", 0x08, 0x0f }, + { "SCB_QSIZE_2048", 0x09, 0x0f }, + { "SCB_QSIZE_4096", 0x0a, 0x0f }, + { "SCB_QSIZE_8192", 0x0b, 0x0f }, + { "SCB_QSIZE_16384", 0x0c, 0x0f }, + { "SCB_QSIZE", 0x0f, 0x0f }, + { "HS_MAILBOX_ACT", 0x10, 0x10 }, + { "SDSCB_ROLLOVR", 0x20, 0x20 }, + { "NEW_SCB_AVAIL", 0x40, 0x40 }, + { "EMPTY_SCB_AVAIL", 0x80, 0x80 } +}; + +int +ahd_qoff_ctlsta_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(QOFF_CTLSTA_parse_table, 18, "QOFF_CTLSTA", + 0x16, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t INTCTL_parse_table[] = { { "SPLTINTEN", 0x01, 0x01 }, { "SEQINTEN", 0x02, 0x02 }, @@ -93,6 +280,22 @@ ahd_dfcntrl_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x19, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t DSCOMMAND0_parse_table[] = { + { "CIOPARCKEN", 0x01, 0x01 }, + { "DISABLE_TWATE", 0x02, 0x02 }, + { "EXTREQLCK", 0x10, 0x10 }, + { "MPARCKEN", 0x20, 0x20 }, + { "DPARCKEN", 0x40, 0x40 }, + { "CACHETHEN", 0x80, 0x80 } +}; + +int +ahd_dscommand0_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(DSCOMMAND0_parse_table, 6, "DSCOMMAND0", + 0x19, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t DFSTATUS_parse_table[] = { { "FIFOEMP", 0x01, 0x01 }, { "FIFOFULL", 0x02, 0x02 }, @@ -124,6 +327,146 @@ ahd_sg_cache_shadow_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x1b, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t SG_CACHE_PRE_parse_table[] = { + { "LAST_SEG", 0x02, 0x02 }, + { "ODD_SEG", 0x04, 0x04 }, + { "SG_ADDR_MASK", 0xf8, 0xf8 } +}; + +int +ahd_sg_cache_pre_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SG_CACHE_PRE_parse_table, 3, "SG_CACHE_PRE", + 0x1b, regvalue, cur_col, wrap)); +} + +int +ahd_lqin_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "LQIN", + 0x20, regvalue, cur_col, wrap)); +} + +int +ahd_lunptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "LUNPTR", + 0x22, regvalue, cur_col, wrap)); +} + +int +ahd_cmdlenptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "CMDLENPTR", + 0x25, regvalue, cur_col, wrap)); +} + +int +ahd_attrptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "ATTRPTR", + 0x26, regvalue, cur_col, wrap)); +} + +int +ahd_flagptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "FLAGPTR", + 0x27, regvalue, cur_col, wrap)); +} + +int +ahd_cmdptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "CMDPTR", + 0x28, regvalue, cur_col, wrap)); +} + +int +ahd_qnextptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "QNEXTPTR", + 0x29, regvalue, cur_col, wrap)); +} + +int +ahd_abrtbyteptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "ABRTBYTEPTR", + 0x2b, regvalue, cur_col, wrap)); +} + +int +ahd_abrtbitptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "ABRTBITPTR", + 0x2c, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t LUNLEN_parse_table[] = { + { "ILUNLEN", 0x0f, 0x0f }, + { "TLUNLEN", 0xf0, 0xf0 } +}; + +int +ahd_lunlen_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(LUNLEN_parse_table, 2, "LUNLEN", + 0x30, regvalue, cur_col, wrap)); +} + +int +ahd_cdblimit_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "CDBLIMIT", + 0x31, regvalue, cur_col, wrap)); +} + +int +ahd_maxcmd_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "MAXCMD", + 0x32, regvalue, cur_col, wrap)); +} + +int +ahd_maxcmdcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "MAXCMDCNT", + 0x33, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t LQCTL1_parse_table[] = { + { "ABORTPENDING", 0x01, 0x01 }, + { "SINGLECMD", 0x02, 0x02 }, + { "PCI2PCI", 0x04, 0x04 } +}; + +int +ahd_lqctl1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(LQCTL1_parse_table, 3, "LQCTL1", + 0x38, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t LQCTL2_parse_table[] = { + { "LQOPAUSE", 0x01, 0x01 }, + { "LQOTOIDLE", 0x02, 0x02 }, + { "LQOCONTINUE", 0x04, 0x04 }, + { "LQORETRY", 0x08, 0x08 }, + { "LQIPAUSE", 0x10, 0x10 }, + { "LQITOIDLE", 0x20, 0x20 }, + { "LQICONTINUE", 0x40, 0x40 }, + { "LQIRETRY", 0x80, 0x80 } +}; + +int +ahd_lqctl2_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(LQCTL2_parse_table, 8, "LQCTL2", + 0x39, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t SCSISEQ0_parse_table[] = { { "SCSIRSTO", 0x01, 0x01 }, { "FORCEBUSFREE", 0x10, 0x10 }, @@ -155,6 +498,37 @@ ahd_scsiseq1_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x3b, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t SXFRCTL0_parse_table[] = { + { "SPIOEN", 0x08, 0x08 }, + { "BIOSCANCELEN", 0x10, 0x10 }, + { "DFPEXP", 0x40, 0x40 }, + { "DFON", 0x80, 0x80 } +}; + +int +ahd_sxfrctl0_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SXFRCTL0_parse_table, 4, "SXFRCTL0", + 0x3c, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SXFRCTL1_parse_table[] = { + { "STPWEN", 0x01, 0x01 }, + { "ACTNEGEN", 0x02, 0x02 }, + { "ENSTIMER", 0x04, 0x04 }, + { "STIMESEL", 0x18, 0x18 }, + { "ENSPCHK", 0x20, 0x20 }, + { "ENSACHK", 0x40, 0x40 }, + { "BITBUCKET", 0x80, 0x80 } +}; + +int +ahd_sxfrctl1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SXFRCTL1_parse_table, 7, "SXFRCTL1", + 0x3d, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t DFFSTAT_parse_table[] = { { "CURRFIFO_0", 0x00, 0x03 }, { "CURRFIFO_1", 0x01, 0x03 }, @@ -171,6 +545,40 @@ ahd_dffstat_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x3f, regvalue, cur_col, wrap)); } +int +ahd_multargid_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "MULTARGID", + 0x40, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SCSISIGO_parse_table[] = { + { "P_DATAOUT", 0x00, 0xe0 }, + { "P_DATAOUT_DT", 0x20, 0xe0 }, + { "P_DATAIN", 0x40, 0xe0 }, + { "P_DATAIN_DT", 0x60, 0xe0 }, + { "P_COMMAND", 0x80, 0xe0 }, + { "P_MESGOUT", 0xa0, 0xe0 }, + { "P_STATUS", 0xc0, 0xe0 }, + { "P_MESGIN", 0xe0, 0xe0 }, + { "ACKO", 0x01, 0x01 }, + { "REQO", 0x02, 0x02 }, + { "BSYO", 0x04, 0x04 }, + { "SELO", 0x08, 0x08 }, + { "ATNO", 0x10, 0x10 }, + { "MSGO", 0x20, 0x20 }, + { "IOO", 0x40, 0x40 }, + { "CDO", 0x80, 0x80 }, + { "PHASE_MASK", 0xe0, 0xe0 } +}; + +int +ahd_scsisigo_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SCSISIGO_parse_table, 17, "SCSISIGO", + 0x40, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t SCSISIGI_parse_table[] = { { "P_DATAOUT", 0x00, 0xe0 }, { "P_DATAOUT_DT", 0x20, 0xe0 }, @@ -215,6 +623,13 @@ ahd_scsiphase_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x42, regvalue, cur_col, wrap)); } +int +ahd_scsidat_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCSIDAT", + 0x44, regvalue, cur_col, wrap)); +} + int ahd_scsibus_print(u_int regvalue, u_int *cur_col, u_int wrap) { @@ -222,6 +637,18 @@ ahd_scsibus_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x46, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t TARGIDIN_parse_table[] = { + { "TARGID", 0x0f, 0x0f }, + { "CLKOUT", 0x80, 0x80 } +}; + +int +ahd_targidin_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(TARGIDIN_parse_table, 2, "TARGIDIN", + 0x48, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t SELID_parse_table[] = { { "ONEBIT", 0x08, 0x08 }, { "SELID_MASK", 0xf0, 0xf0 } @@ -234,6 +661,38 @@ ahd_selid_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x49, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t OPTIONMODE_parse_table[] = { + { "AUTO_MSGOUT_DE", 0x02, 0x02 }, + { "ENDGFORMCHK", 0x04, 0x04 }, + { "BUSFREEREV", 0x10, 0x10 }, + { "BIASCANCTL", 0x20, 0x20 }, + { "AUTOACKEN", 0x40, 0x40 }, + { "BIOSCANCTL", 0x80, 0x80 }, + { "OPTIONMODE_DEFAULTS",0x02, 0x02 } +}; + +int +ahd_optionmode_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(OPTIONMODE_parse_table, 7, "OPTIONMODE", + 0x4a, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SBLKCTL_parse_table[] = { + { "SELWIDE", 0x02, 0x02 }, + { "ENAB20", 0x04, 0x04 }, + { "ENAB40", 0x08, 0x08 }, + { "DIAGLEDON", 0x40, 0x40 }, + { "DIAGLEDEN", 0x80, 0x80 } +}; + +int +ahd_sblkctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SBLKCTL_parse_table, 5, "SBLKCTL", + 0x4a, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t SSTAT0_parse_table[] = { { "ARBDO", 0x01, 0x01 }, { "SPIORDY", 0x02, 0x02 }, @@ -269,6 +728,23 @@ ahd_simode0_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x4b, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t CLRSINT0_parse_table[] = { + { "CLRARBDO", 0x01, 0x01 }, + { "CLRSPIORDY", 0x02, 0x02 }, + { "CLROVERRUN", 0x04, 0x04 }, + { "CLRIOERR", 0x08, 0x08 }, + { "CLRSELINGO", 0x10, 0x10 }, + { "CLRSELDI", 0x20, 0x20 }, + { "CLRSELDO", 0x40, 0x40 } +}; + +int +ahd_clrsint0_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CLRSINT0_parse_table, 7, "CLRSINT0", + 0x4b, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t SSTAT1_parse_table[] = { { "REQINIT", 0x01, 0x01 }, { "STRB2FAST", 0x02, 0x02 }, @@ -287,6 +763,23 @@ ahd_sstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x4c, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t CLRSINT1_parse_table[] = { + { "CLRREQINIT", 0x01, 0x01 }, + { "CLRSTRB2FAST", 0x02, 0x02 }, + { "CLRSCSIPERR", 0x04, 0x04 }, + { "CLRBUSFREE", 0x08, 0x08 }, + { "CLRSCSIRSTI", 0x20, 0x20 }, + { "CLRATNO", 0x40, 0x40 }, + { "CLRSELTIMEO", 0x80, 0x80 } +}; + +int +ahd_clrsint1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CLRSINT1_parse_table, 7, "CLRSINT1", + 0x4c, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t SSTAT2_parse_table[] = { { "BUSFREE_LQO", 0x40, 0xc0 }, { "BUSFREE_DFF0", 0x80, 0xc0 }, @@ -307,6 +800,20 @@ ahd_sstat2_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x4d, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t CLRSINT2_parse_table[] = { + { "CLRDMADONE", 0x01, 0x01 }, + { "CLRSDONE", 0x02, 0x02 }, + { "CLRWIDE_RES", 0x04, 0x04 }, + { "CLRNONPACKREQ", 0x20, 0x20 } +}; + +int +ahd_clrsint2_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CLRSINT2_parse_table, 4, "CLRSINT2", + 0x4d, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t PERRDIAG_parse_table[] = { { "DTERR", 0x01, 0x01 }, { "DGFORMERR", 0x02, 0x02 }, @@ -325,6 +832,13 @@ ahd_perrdiag_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x4e, regvalue, cur_col, wrap)); } +int +ahd_lqistate_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "LQISTATE", + 0x4e, regvalue, cur_col, wrap)); +} + int ahd_soffcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) { @@ -332,6 +846,13 @@ ahd_soffcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x4f, regvalue, cur_col, wrap)); } +int +ahd_lqostate_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "LQOSTATE", + 0x4f, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t LQISTAT0_parse_table[] = { { "LQIATNCMD", 0x01, 0x01 }, { "LQIATNLQ", 0x02, 0x02 }, @@ -348,6 +869,56 @@ ahd_lqistat0_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x50, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t LQIMODE0_parse_table[] = { + { "ENLQIATNCMD", 0x01, 0x01 }, + { "ENLQIATNLQ", 0x02, 0x02 }, + { "ENLQIBADLQT", 0x04, 0x04 }, + { "ENLQICRCT2", 0x08, 0x08 }, + { "ENLQICRCT1", 0x10, 0x10 }, + { "ENLQIATNQASK", 0x20, 0x20 } +}; + +int +ahd_lqimode0_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(LQIMODE0_parse_table, 6, "LQIMODE0", + 0x50, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t CLRLQIINT0_parse_table[] = { + { "CLRLQIATNCMD", 0x01, 0x01 }, + { "CLRLQIATNLQ", 0x02, 0x02 }, + { "CLRLQIBADLQT", 0x04, 0x04 }, + { "CLRLQICRCT2", 0x08, 0x08 }, + { "CLRLQICRCT1", 0x10, 0x10 }, + { "CLRLQIATNQAS", 0x20, 0x20 } +}; + +int +ahd_clrlqiint0_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CLRLQIINT0_parse_table, 6, "CLRLQIINT0", + 0x50, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t LQIMODE1_parse_table[] = { + { "ENLQIOVERI_NLQ", 0x01, 0x01 }, + { "ENLQIOVERI_LQ", 0x02, 0x02 }, + { "ENLQIBADLQI", 0x04, 0x04 }, + { "ENLQICRCI_NLQ", 0x08, 0x08 }, + { "ENLQICRCI_LQ", 0x10, 0x10 }, + { "ENLIQABORT", 0x20, 0x20 }, + { "ENLQIPHASE_NLQ", 0x40, 0x40 }, + { "ENLQIPHASE_LQ", 0x80, 0x80 } +}; + +int +ahd_lqimode1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(LQIMODE1_parse_table, 8, "LQIMODE1", + 0x51, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t LQISTAT1_parse_table[] = { { "LQIOVERI_NLQ", 0x01, 0x01 }, { "LQIOVERI_LQ", 0x02, 0x02 }, @@ -366,7 +937,25 @@ ahd_lqistat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x51, regvalue, cur_col, wrap)); } -static const ahd_reg_parse_entry_t LQISTAT2_parse_table[] = { +static const ahd_reg_parse_entry_t CLRLQIINT1_parse_table[] = { + { "CLRLQIOVERI_NLQ", 0x01, 0x01 }, + { "CLRLQIOVERI_LQ", 0x02, 0x02 }, + { "CLRLQIBADLQI", 0x04, 0x04 }, + { "CLRLQICRCI_NLQ", 0x08, 0x08 }, + { "CLRLQICRCI_LQ", 0x10, 0x10 }, + { "CLRLIQABORT", 0x20, 0x20 }, + { "CLRLQIPHASE_NLQ", 0x40, 0x40 }, + { "CLRLQIPHASE_LQ", 0x80, 0x80 } +}; + +int +ahd_clrlqiint1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CLRLQIINT1_parse_table, 8, "CLRLQIINT1", + 0x51, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t LQISTAT2_parse_table[] = { { "LQIGSAVAIL", 0x01, 0x01 }, { "LQISTOPCMD", 0x02, 0x02 }, { "LQISTOPLQ", 0x04, 0x04 }, @@ -396,6 +985,30 @@ ahd_sstat3_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x53, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t SIMODE3_parse_table[] = { + { "ENOSRAMPERR", 0x01, 0x01 }, + { "ENNTRAMPERR", 0x02, 0x02 } +}; + +int +ahd_simode3_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SIMODE3_parse_table, 2, "SIMODE3", + 0x53, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t CLRSINT3_parse_table[] = { + { "CLROSRAMPERR", 0x01, 0x01 }, + { "CLRNTRAMPERR", 0x02, 0x02 } +}; + +int +ahd_clrsint3_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CLRSINT3_parse_table, 2, "CLRSINT3", + 0x53, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t LQOSTAT0_parse_table[] = { { "LQOTCRC", 0x01, 0x01 }, { "LQOATNPKT", 0x02, 0x02 }, @@ -411,6 +1024,51 @@ ahd_lqostat0_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x54, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t CLRLQOINT0_parse_table[] = { + { "CLRLQOTCRC", 0x01, 0x01 }, + { "CLRLQOATNPKT", 0x02, 0x02 }, + { "CLRLQOATNLQ", 0x04, 0x04 }, + { "CLRLQOSTOPT2", 0x08, 0x08 }, + { "CLRLQOTARGSCBPERR", 0x10, 0x10 } +}; + +int +ahd_clrlqoint0_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CLRLQOINT0_parse_table, 5, "CLRLQOINT0", + 0x54, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t LQOMODE0_parse_table[] = { + { "ENLQOTCRC", 0x01, 0x01 }, + { "ENLQOATNPKT", 0x02, 0x02 }, + { "ENLQOATNLQ", 0x04, 0x04 }, + { "ENLQOSTOPT2", 0x08, 0x08 }, + { "ENLQOTARGSCBPERR", 0x10, 0x10 } +}; + +int +ahd_lqomode0_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(LQOMODE0_parse_table, 5, "LQOMODE0", + 0x54, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t LQOMODE1_parse_table[] = { + { "ENLQOPHACHGINPKT", 0x01, 0x01 }, + { "ENLQOBUSFREE", 0x02, 0x02 }, + { "ENLQOBADQAS", 0x04, 0x04 }, + { "ENLQOSTOPI2", 0x08, 0x08 }, + { "ENLQOINITSCBPERR", 0x10, 0x10 } +}; + +int +ahd_lqomode1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(LQOMODE1_parse_table, 5, "LQOMODE1", + 0x55, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t LQOSTAT1_parse_table[] = { { "LQOPHACHGINPKT", 0x01, 0x01 }, { "LQOBUSFREE", 0x02, 0x02 }, @@ -426,6 +1084,21 @@ ahd_lqostat1_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x55, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t CLRLQOINT1_parse_table[] = { + { "CLRLQOPHACHGINPKT", 0x01, 0x01 }, + { "CLRLQOBUSFREE", 0x02, 0x02 }, + { "CLRLQOBADQAS", 0x04, 0x04 }, + { "CLRLQOSTOPI2", 0x08, 0x08 }, + { "CLRLQOINITSCBPERR", 0x10, 0x10 } +}; + +int +ahd_clrlqoint1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CLRLQOINT1_parse_table, 5, "CLRLQOINT1", + 0x55, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t LQOSTAT2_parse_table[] = { { "LQOSTOP0", 0x01, 0x01 }, { "LQOPHACHGOUTPKT", 0x02, 0x02 }, @@ -440,6 +1113,13 @@ ahd_lqostat2_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x56, regvalue, cur_col, wrap)); } +int +ahd_os_space_cnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "OS_SPACE_CNT", + 0x56, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t SIMODE1_parse_table[] = { { "ENREQINIT", 0x01, 0x01 }, { "ENSTRB2FAST", 0x02, 0x02 }, @@ -458,6 +1138,13 @@ ahd_simode1_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x57, regvalue, cur_col, wrap)); } +int +ahd_gsfifo_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "GSFIFO", + 0x58, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t DFFSXFRCTL_parse_table[] = { { "RSTCHN", 0x01, 0x01 }, { "CLRCHN", 0x02, 0x02 }, @@ -472,6 +1159,44 @@ ahd_dffsxfrctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x5a, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t LQOSCSCTL_parse_table[] = { + { "LQONOCHKOVER", 0x01, 0x01 }, + { "LQONOHOLDLACK", 0x02, 0x02 }, + { "LQOBUSETDLY", 0x40, 0x40 }, + { "LQOH2A_VERSION", 0x80, 0x80 } +}; + +int +ahd_lqoscsctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(LQOSCSCTL_parse_table, 4, "LQOSCSCTL", + 0x5a, regvalue, cur_col, wrap)); +} + +int +ahd_nextscb_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "NEXTSCB", + 0x5a, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t CLRSEQINTSRC_parse_table[] = { + { "CLRCFG4TCMD", 0x01, 0x01 }, + { "CLRCFG4ICMD", 0x02, 0x02 }, + { "CLRCFG4TSTAT", 0x04, 0x04 }, + { "CLRCFG4ISTAT", 0x08, 0x08 }, + { "CLRCFG4DATA", 0x10, 0x10 }, + { "CLRSAVEPTRS", 0x20, 0x20 }, + { "CLRCTXTDONE", 0x40, 0x40 } +}; + +int +ahd_clrseqintsrc_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CLRSEQINTSRC_parse_table, 7, "CLRSEQINTSRC", + 0x5b, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t SEQINTSRC_parse_table[] = { { "CFG4TCMD", 0x01, 0x01 }, { "CFG4ICMD", 0x02, 0x02 }, @@ -506,6 +1231,13 @@ ahd_seqimode_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x5c, regvalue, cur_col, wrap)); } +int +ahd_currscb_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "CURRSCB", + 0x5c, regvalue, cur_col, wrap)); +} + static const ahd_reg_parse_entry_t MDFFSTAT_parse_table[] = { { "FIFOFREE", 0x01, 0x01 }, { "DATAINFIFO", 0x02, 0x02 }, @@ -524,222 +1256,1213 @@ ahd_mdffstat_print(u_int regvalue, u_int *cur_col, u_int wrap) } int -ahd_seloid_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_lastscb_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(NULL, 0, "SELOID", - 0x6b, regvalue, cur_col, wrap)); + return (ahd_print_register(NULL, 0, "LASTSCB", + 0x5e, regvalue, cur_col, wrap)); } -static const ahd_reg_parse_entry_t SG_STATE_parse_table[] = { - { "SEGS_AVAIL", 0x01, 0x01 }, - { "LOADING_NEEDED", 0x02, 0x02 }, - { "FETCH_INPROG", 0x04, 0x04 } -}; +int +ahd_shaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SHADDR", + 0x60, regvalue, cur_col, wrap)); +} int -ahd_sg_state_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_negoaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(SG_STATE_parse_table, 3, "SG_STATE", - 0xa6, regvalue, cur_col, wrap)); + return (ahd_print_register(NULL, 0, "NEGOADDR", + 0x60, regvalue, cur_col, wrap)); } -static const ahd_reg_parse_entry_t CCSCBCTL_parse_table[] = { - { "CCSCBRESET", 0x01, 0x01 }, - { "CCSCBDIR", 0x04, 0x04 }, - { "CCSCBEN", 0x08, 0x08 }, - { "CCARREN", 0x10, 0x10 }, - { "ARRDONE", 0x40, 0x40 }, - { "CCSCBDONE", 0x80, 0x80 } -}; +int +ahd_negperiod_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "NEGPERIOD", + 0x61, regvalue, cur_col, wrap)); +} int -ahd_ccscbctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_negoffset_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(CCSCBCTL_parse_table, 6, "CCSCBCTL", - 0xad, regvalue, cur_col, wrap)); + return (ahd_print_register(NULL, 0, "NEGOFFSET", + 0x62, regvalue, cur_col, wrap)); } -static const ahd_reg_parse_entry_t CCSGCTL_parse_table[] = { - { "CCSGRESET", 0x01, 0x01 }, - { "SG_FETCH_REQ", 0x02, 0x02 }, - { "CCSGENACK", 0x08, 0x08 }, - { "SG_CACHE_AVAIL", 0x10, 0x10 }, - { "CCSGDONE", 0x80, 0x80 }, - { "CCSGEN", 0x0c, 0x0c } +static const ahd_reg_parse_entry_t NEGPPROPTS_parse_table[] = { + { "PPROPT_IUT", 0x01, 0x01 }, + { "PPROPT_DT", 0x02, 0x02 }, + { "PPROPT_QAS", 0x04, 0x04 }, + { "PPROPT_PACE", 0x08, 0x08 } }; int -ahd_ccsgctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_negppropts_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(CCSGCTL_parse_table, 6, "CCSGCTL", - 0xad, regvalue, cur_col, wrap)); + return (ahd_print_register(NEGPPROPTS_parse_table, 4, "NEGPPROPTS", + 0x63, regvalue, cur_col, wrap)); } -static const ahd_reg_parse_entry_t SEQCTL0_parse_table[] = { - { "LOADRAM", 0x01, 0x01 }, - { "SEQRESET", 0x02, 0x02 }, - { "STEP", 0x04, 0x04 }, - { "BRKADRINTEN", 0x08, 0x08 }, - { "FASTMODE", 0x10, 0x10 }, - { "FAILDIS", 0x20, 0x20 }, - { "PAUSEDIS", 0x40, 0x40 }, - { "PERRORDIS", 0x80, 0x80 } +static const ahd_reg_parse_entry_t NEGCONOPTS_parse_table[] = { + { "WIDEXFER", 0x01, 0x01 }, + { "ENAUTOATNO", 0x02, 0x02 }, + { "ENAUTOATNI", 0x04, 0x04 }, + { "ENSLOWCRC", 0x08, 0x08 }, + { "RTI_OVRDTRN", 0x10, 0x10 }, + { "RTI_WRTDIS", 0x20, 0x20 }, + { "ENSNAPSHOT", 0x40, 0x40 } }; int -ahd_seqctl0_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_negconopts_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(SEQCTL0_parse_table, 8, "SEQCTL0", - 0xd6, regvalue, cur_col, wrap)); + return (ahd_print_register(NEGCONOPTS_parse_table, 7, "NEGCONOPTS", + 0x64, regvalue, cur_col, wrap)); } -static const ahd_reg_parse_entry_t SEQINTCTL_parse_table[] = { - { "IRET", 0x01, 0x01 }, - { "INTMASK1", 0x02, 0x02 }, - { "INTMASK2", 0x04, 0x04 }, - { "SCS_SEQ_INT1M0", 0x08, 0x08 }, - { "SCS_SEQ_INT1M1", 0x10, 0x10 }, - { "INT1_CONTEXT", 0x20, 0x20 }, - { "INTVEC1DSL", 0x80, 0x80 } +int +ahd_annexcol_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "ANNEXCOL", + 0x65, regvalue, cur_col, wrap)); +} + +int +ahd_annexdat_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "ANNEXDAT", + 0x66, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SCSCHKN_parse_table[] = { + { "LSTSGCLRDIS", 0x01, 0x01 }, + { "SHVALIDSTDIS", 0x02, 0x02 }, + { "DFFACTCLR", 0x04, 0x04 }, + { "SDONEMSKDIS", 0x08, 0x08 }, + { "WIDERESEN", 0x10, 0x10 }, + { "CURRFIFODEF", 0x20, 0x20 }, + { "STSELSKIDDIS", 0x40, 0x40 }, + { "BIDICHKDIS", 0x80, 0x80 } }; int -ahd_seqintctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_scschkn_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(SEQINTCTL_parse_table, 7, "SEQINTCTL", - 0xd9, regvalue, cur_col, wrap)); + return (ahd_print_register(SCSCHKN_parse_table, 8, "SCSCHKN", + 0x66, regvalue, cur_col, wrap)); } int -ahd_sram_base_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_iownid_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(NULL, 0, "SRAM_BASE", - 0x100, regvalue, cur_col, wrap)); + return (ahd_print_register(NULL, 0, "IOWNID", + 0x67, regvalue, cur_col, wrap)); } int -ahd_qfreeze_count_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_shcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(NULL, 0, "QFREEZE_COUNT", - 0x132, regvalue, cur_col, wrap)); + return (ahd_print_register(NULL, 0, "SHCNT", + 0x68, regvalue, cur_col, wrap)); } int -ahd_kernel_qfreeze_count_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_townid_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(NULL, 0, "KERNEL_QFREEZE_COUNT", - 0x134, regvalue, cur_col, wrap)); + return (ahd_print_register(NULL, 0, "TOWNID", + 0x69, regvalue, cur_col, wrap)); } int -ahd_saved_mode_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_seloid_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(NULL, 0, "SAVED_MODE", - 0x136, regvalue, cur_col, wrap)); + return (ahd_print_register(NULL, 0, "SELOID", + 0x6b, regvalue, cur_col, wrap)); } -static const ahd_reg_parse_entry_t SEQ_FLAGS_parse_table[] = { - { "NO_DISCONNECT", 0x01, 0x01 }, - { "SPHASE_PENDING", 0x02, 0x02 }, - { "DPHASE_PENDING", 0x04, 0x04 }, - { "CMDPHASE_PENDING", 0x08, 0x08 }, - { "TARG_CMD_PENDING", 0x10, 0x10 }, - { "DPHASE", 0x20, 0x20 }, - { "NO_CDB_SENT", 0x40, 0x40 }, - { "TARGET_CMD_IS_TAGGED",0x40, 0x40 }, - { "NOT_IDENTIFIED", 0x80, 0x80 } -}; +int +ahd_haddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "HADDR", + 0x70, regvalue, cur_col, wrap)); +} int -ahd_seq_flags_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_hcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(SEQ_FLAGS_parse_table, 9, "SEQ_FLAGS", - 0x139, regvalue, cur_col, wrap)); + return (ahd_print_register(NULL, 0, "HCNT", + 0x78, regvalue, cur_col, wrap)); } -static const ahd_reg_parse_entry_t LASTPHASE_parse_table[] = { - { "P_DATAOUT", 0x00, 0xe0 }, - { "P_DATAOUT_DT", 0x20, 0xe0 }, - { "P_DATAIN", 0x40, 0xe0 }, - { "P_DATAIN_DT", 0x60, 0xe0 }, - { "P_COMMAND", 0x80, 0xe0 }, - { "P_MESGOUT", 0xa0, 0xe0 }, - { "P_STATUS", 0xc0, 0xe0 }, - { "P_MESGIN", 0xe0, 0xe0 }, - { "P_BUSFREE", 0x01, 0x01 }, - { "MSGI", 0x20, 0x20 }, - { "IOI", 0x40, 0x40 }, - { "CDI", 0x80, 0x80 }, - { "PHASE_MASK", 0xe0, 0xe0 } +int +ahd_sghaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SGHADDR", + 0x7c, regvalue, cur_col, wrap)); +} + +int +ahd_scbhaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCBHADDR", + 0x7c, regvalue, cur_col, wrap)); +} + +int +ahd_sghcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SGHCNT", + 0x84, regvalue, cur_col, wrap)); +} + +int +ahd_scbhcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCBHCNT", + 0x84, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t DFF_THRSH_parse_table[] = { + { "WR_DFTHRSH_MIN", 0x00, 0x70 }, + { "RD_DFTHRSH_MIN", 0x00, 0x07 }, + { "RD_DFTHRSH_25", 0x01, 0x07 }, + { "RD_DFTHRSH_50", 0x02, 0x07 }, + { "RD_DFTHRSH_63", 0x03, 0x07 }, + { "RD_DFTHRSH_75", 0x04, 0x07 }, + { "RD_DFTHRSH_85", 0x05, 0x07 }, + { "RD_DFTHRSH_90", 0x06, 0x07 }, + { "RD_DFTHRSH_MAX", 0x07, 0x07 }, + { "WR_DFTHRSH_25", 0x10, 0x70 }, + { "WR_DFTHRSH_50", 0x20, 0x70 }, + { "WR_DFTHRSH_63", 0x30, 0x70 }, + { "WR_DFTHRSH_75", 0x40, 0x70 }, + { "WR_DFTHRSH_85", 0x50, 0x70 }, + { "WR_DFTHRSH_90", 0x60, 0x70 }, + { "WR_DFTHRSH_MAX", 0x70, 0x70 }, + { "RD_DFTHRSH", 0x07, 0x07 }, + { "WR_DFTHRSH", 0x70, 0x70 } }; int -ahd_lastphase_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_dff_thrsh_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(LASTPHASE_parse_table, 13, "LASTPHASE", - 0x13c, regvalue, cur_col, wrap)); + return (ahd_print_register(DFF_THRSH_parse_table, 18, "DFF_THRSH", + 0x88, regvalue, cur_col, wrap)); } -static const ahd_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = { - { "PENDING_MK_MESSAGE", 0x01, 0x01 }, - { "TARGET_MSG_PENDING", 0x02, 0x02 }, - { "SELECTOUT_QFROZEN", 0x04, 0x04 } +static const ahd_reg_parse_entry_t PCIXCTL_parse_table[] = { + { "CMPABCDIS", 0x01, 0x01 }, + { "TSCSERREN", 0x02, 0x02 }, + { "SRSPDPEEN", 0x04, 0x04 }, + { "SPLTSTADIS", 0x08, 0x08 }, + { "SPLTSMADIS", 0x10, 0x10 }, + { "UNEXPSCIEN", 0x20, 0x20 }, + { "SERRPULSE", 0x80, 0x80 } }; int -ahd_seq_flags2_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_pcixctl_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(SEQ_FLAGS2_parse_table, 3, "SEQ_FLAGS2", - 0x14d, regvalue, cur_col, wrap)); + return (ahd_print_register(PCIXCTL_parse_table, 7, "PCIXCTL", + 0x93, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t DCHSPLTSTAT0_parse_table[] = { + { "RXSPLTRSP", 0x01, 0x01 }, + { "RXSCEMSG", 0x02, 0x02 }, + { "RXOVRUN", 0x04, 0x04 }, + { "CNTNOTCMPLT", 0x08, 0x08 }, + { "SCDATBUCKET", 0x10, 0x10 }, + { "SCADERR", 0x20, 0x20 }, + { "SCBCERR", 0x40, 0x40 }, + { "STAETERM", 0x80, 0x80 } +}; + int -ahd_mk_message_scb_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_dchspltstat0_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(NULL, 0, "MK_MESSAGE_SCB", - 0x160, regvalue, cur_col, wrap)); + return (ahd_print_register(DCHSPLTSTAT0_parse_table, 8, "DCHSPLTSTAT0", + 0x96, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t DCHSPLTSTAT1_parse_table[] = { + { "RXDATABUCKET", 0x01, 0x01 } +}; + int -ahd_mk_message_scsiid_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_dchspltstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(NULL, 0, "MK_MESSAGE_SCSIID", - 0x162, regvalue, cur_col, wrap)); + return (ahd_print_register(DCHSPLTSTAT1_parse_table, 1, "DCHSPLTSTAT1", + 0x97, regvalue, cur_col, wrap)); } +static const ahd_reg_parse_entry_t SGSPLTSTAT0_parse_table[] = { + { "RXSPLTRSP", 0x01, 0x01 }, + { "RXSCEMSG", 0x02, 0x02 }, + { "RXOVRUN", 0x04, 0x04 }, + { "CNTNOTCMPLT", 0x08, 0x08 }, + { "SCDATBUCKET", 0x10, 0x10 }, + { "SCADERR", 0x20, 0x20 }, + { "SCBCERR", 0x40, 0x40 }, + { "STAETERM", 0x80, 0x80 } +}; + int -ahd_scb_base_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_sgspltstat0_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(NULL, 0, "SCB_BASE", - 0x180, regvalue, cur_col, wrap)); + return (ahd_print_register(SGSPLTSTAT0_parse_table, 8, "SGSPLTSTAT0", + 0x9e, regvalue, cur_col, wrap)); } -static const ahd_reg_parse_entry_t SCB_CONTROL_parse_table[] = { - { "SCB_TAG_TYPE", 0x03, 0x03 }, - { "DISCONNECTED", 0x04, 0x04 }, - { "STATUS_RCVD", 0x08, 0x08 }, - { "MK_MESSAGE", 0x10, 0x10 }, - { "TAG_ENB", 0x20, 0x20 }, - { "DISCENB", 0x40, 0x40 }, - { "TARGET_SCB", 0x80, 0x80 } +static const ahd_reg_parse_entry_t SGSPLTSTAT1_parse_table[] = { + { "RXDATABUCKET", 0x01, 0x01 } }; int -ahd_scb_control_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_sgspltstat1_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(SCB_CONTROL_parse_table, 7, "SCB_CONTROL", - 0x192, regvalue, cur_col, wrap)); + return (ahd_print_register(SGSPLTSTAT1_parse_table, 1, "SGSPLTSTAT1", + 0x9f, regvalue, cur_col, wrap)); } -static const ahd_reg_parse_entry_t SCB_SCSIID_parse_table[] = { - { "OID", 0x0f, 0x0f }, - { "TID", 0xf0, 0xf0 } +static const ahd_reg_parse_entry_t DF0PCISTAT_parse_table[] = { + { "DPR", 0x01, 0x01 }, + { "TWATERR", 0x02, 0x02 }, + { "RDPERR", 0x04, 0x04 }, + { "SCAAPERR", 0x08, 0x08 }, + { "RTA", 0x10, 0x10 }, + { "RMA", 0x20, 0x20 }, + { "SSE", 0x40, 0x40 }, + { "DPE", 0x80, 0x80 } }; int -ahd_scb_scsiid_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahd_df0pcistat_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahd_print_register(SCB_SCSIID_parse_table, 2, "SCB_SCSIID", - 0x193, regvalue, cur_col, wrap)); + return (ahd_print_register(DF0PCISTAT_parse_table, 8, "DF0PCISTAT", + 0xa0, regvalue, cur_col, wrap)); +} + +int +ahd_reg0_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "REG0", + 0xa0, regvalue, cur_col, wrap)); +} + +int +ahd_reg_isr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "REG_ISR", + 0xa4, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SG_STATE_parse_table[] = { + { "SEGS_AVAIL", 0x01, 0x01 }, + { "LOADING_NEEDED", 0x02, 0x02 }, + { "FETCH_INPROG", 0x04, 0x04 } +}; + +int +ahd_sg_state_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SG_STATE_parse_table, 3, "SG_STATE", + 0xa6, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t TARGPCISTAT_parse_table[] = { + { "TWATERR", 0x02, 0x02 }, + { "STA", 0x08, 0x08 }, + { "SSE", 0x40, 0x40 }, + { "DPE", 0x80, 0x80 } +}; + +int +ahd_targpcistat_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(TARGPCISTAT_parse_table, 4, "TARGPCISTAT", + 0xa7, regvalue, cur_col, wrap)); +} + +int +ahd_scbptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCBPTR", + 0xa8, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SCBAUTOPTR_parse_table[] = { + { "SCBPTR_OFF", 0x07, 0x07 }, + { "SCBPTR_ADDR", 0x38, 0x38 }, + { "AUSCBPTR_EN", 0x80, 0x80 } +}; + +int +ahd_scbautoptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SCBAUTOPTR_parse_table, 3, "SCBAUTOPTR", + 0xab, regvalue, cur_col, wrap)); +} + +int +ahd_ccsgaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "CCSGADDR", + 0xac, regvalue, cur_col, wrap)); +} + +int +ahd_ccscbaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "CCSCBADDR", + 0xac, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t CCSCBCTL_parse_table[] = { + { "CCSCBRESET", 0x01, 0x01 }, + { "CCSCBDIR", 0x04, 0x04 }, + { "CCSCBEN", 0x08, 0x08 }, + { "CCARREN", 0x10, 0x10 }, + { "ARRDONE", 0x40, 0x40 }, + { "CCSCBDONE", 0x80, 0x80 } +}; + +int +ahd_ccscbctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CCSCBCTL_parse_table, 6, "CCSCBCTL", + 0xad, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t CCSGCTL_parse_table[] = { + { "CCSGRESET", 0x01, 0x01 }, + { "SG_FETCH_REQ", 0x02, 0x02 }, + { "CCSGENACK", 0x08, 0x08 }, + { "SG_CACHE_AVAIL", 0x10, 0x10 }, + { "CCSGDONE", 0x80, 0x80 }, + { "CCSGEN", 0x0c, 0x0c } +}; + +int +ahd_ccsgctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(CCSGCTL_parse_table, 6, "CCSGCTL", + 0xad, regvalue, cur_col, wrap)); +} + +int +ahd_ccsgram_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "CCSGRAM", + 0xb0, regvalue, cur_col, wrap)); +} + +int +ahd_ccscbram_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "CCSCBRAM", + 0xb0, regvalue, cur_col, wrap)); +} + +int +ahd_brddat_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "BRDDAT", + 0xb8, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t BRDCTL_parse_table[] = { + { "BRDSTB", 0x01, 0x01 }, + { "BRDRW", 0x02, 0x02 }, + { "BRDEN", 0x04, 0x04 }, + { "BRDADDR", 0x38, 0x38 }, + { "FLXARBREQ", 0x40, 0x40 }, + { "FLXARBACK", 0x80, 0x80 } +}; + +int +ahd_brdctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(BRDCTL_parse_table, 6, "BRDCTL", + 0xb9, regvalue, cur_col, wrap)); +} + +int +ahd_seeadr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SEEADR", + 0xba, regvalue, cur_col, wrap)); +} + +int +ahd_seedat_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SEEDAT", + 0xbc, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SEECTL_parse_table[] = { + { "SEEOP_ERAL", 0x40, 0x70 }, + { "SEEOP_WRITE", 0x50, 0x70 }, + { "SEEOP_READ", 0x60, 0x70 }, + { "SEEOP_ERASE", 0x70, 0x70 }, + { "SEESTART", 0x01, 0x01 }, + { "SEERST", 0x02, 0x02 }, + { "SEEOPCODE", 0x70, 0x70 }, + { "SEEOP_EWEN", 0x40, 0x40 }, + { "SEEOP_WALL", 0x40, 0x40 }, + { "SEEOP_EWDS", 0x40, 0x40 } +}; + +int +ahd_seectl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SEECTL_parse_table, 10, "SEECTL", + 0xbe, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SEESTAT_parse_table[] = { + { "SEESTART", 0x01, 0x01 }, + { "SEEBUSY", 0x02, 0x02 }, + { "SEEARBACK", 0x04, 0x04 }, + { "LDALTID_L", 0x08, 0x08 }, + { "SEEOPCODE", 0x70, 0x70 }, + { "INIT_DONE", 0x80, 0x80 } +}; + +int +ahd_seestat_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SEESTAT_parse_table, 6, "SEESTAT", + 0xbe, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t DSPDATACTL_parse_table[] = { + { "XMITOFFSTDIS", 0x02, 0x02 }, + { "RCVROFFSTDIS", 0x04, 0x04 }, + { "DESQDIS", 0x10, 0x10 }, + { "BYPASSENAB", 0x80, 0x80 } +}; + +int +ahd_dspdatactl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(DSPDATACTL_parse_table, 4, "DSPDATACTL", + 0xc1, regvalue, cur_col, wrap)); +} + +int +ahd_dfdat_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "DFDAT", + 0xc4, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t DSPSELECT_parse_table[] = { + { "DSPSEL", 0x1f, 0x1f }, + { "AUTOINCEN", 0x80, 0x80 } +}; + +int +ahd_dspselect_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(DSPSELECT_parse_table, 2, "DSPSELECT", + 0xc4, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t WRTBIASCTL_parse_table[] = { + { "XMITMANVAL", 0x3f, 0x3f }, + { "AUTOXBCDIS", 0x80, 0x80 } +}; + +int +ahd_wrtbiasctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(WRTBIASCTL_parse_table, 2, "WRTBIASCTL", + 0xc5, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SEQCTL0_parse_table[] = { + { "LOADRAM", 0x01, 0x01 }, + { "SEQRESET", 0x02, 0x02 }, + { "STEP", 0x04, 0x04 }, + { "BRKADRINTEN", 0x08, 0x08 }, + { "FASTMODE", 0x10, 0x10 }, + { "FAILDIS", 0x20, 0x20 }, + { "PAUSEDIS", 0x40, 0x40 }, + { "PERRORDIS", 0x80, 0x80 } +}; + +int +ahd_seqctl0_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SEQCTL0_parse_table, 8, "SEQCTL0", + 0xd6, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t FLAGS_parse_table[] = { + { "CARRY", 0x01, 0x01 }, + { "ZERO", 0x02, 0x02 } +}; + +int +ahd_flags_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(FLAGS_parse_table, 2, "FLAGS", + 0xd8, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SEQINTCTL_parse_table[] = { + { "IRET", 0x01, 0x01 }, + { "INTMASK1", 0x02, 0x02 }, + { "INTMASK2", 0x04, 0x04 }, + { "SCS_SEQ_INT1M0", 0x08, 0x08 }, + { "SCS_SEQ_INT1M1", 0x10, 0x10 }, + { "INT1_CONTEXT", 0x20, 0x20 }, + { "INTVEC1DSL", 0x80, 0x80 } +}; + +int +ahd_seqintctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SEQINTCTL_parse_table, 7, "SEQINTCTL", + 0xd9, regvalue, cur_col, wrap)); +} + +int +ahd_seqram_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SEQRAM", + 0xda, regvalue, cur_col, wrap)); +} + +int +ahd_prgmcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "PRGMCNT", + 0xde, regvalue, cur_col, wrap)); +} + +int +ahd_accum_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "ACCUM", + 0xe0, regvalue, cur_col, wrap)); +} + +int +ahd_sindex_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SINDEX", + 0xe2, regvalue, cur_col, wrap)); +} + +int +ahd_dindex_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "DINDEX", + 0xe4, regvalue, cur_col, wrap)); +} + +int +ahd_allones_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "ALLONES", + 0xe8, regvalue, cur_col, wrap)); +} + +int +ahd_allzeros_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "ALLZEROS", + 0xea, regvalue, cur_col, wrap)); +} + +int +ahd_none_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "NONE", + 0xea, regvalue, cur_col, wrap)); +} + +int +ahd_sindir_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SINDIR", + 0xec, regvalue, cur_col, wrap)); +} + +int +ahd_dindir_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "DINDIR", + 0xed, regvalue, cur_col, wrap)); +} + +int +ahd_stack_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "STACK", + 0xf2, regvalue, cur_col, wrap)); +} + +int +ahd_intvec1_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "INTVEC1_ADDR", + 0xf4, regvalue, cur_col, wrap)); +} + +int +ahd_curaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "CURADDR", + 0xf4, regvalue, cur_col, wrap)); +} + +int +ahd_intvec2_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "INTVEC2_ADDR", + 0xf6, regvalue, cur_col, wrap)); +} + +int +ahd_longjmp_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "LONGJMP_ADDR", + 0xf8, regvalue, cur_col, wrap)); +} + +int +ahd_accum_save_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "ACCUM_SAVE", + 0xfa, regvalue, cur_col, wrap)); +} + +int +ahd_sram_base_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SRAM_BASE", + 0x100, regvalue, cur_col, wrap)); +} + +int +ahd_waiting_scb_tails_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "WAITING_SCB_TAILS", + 0x100, regvalue, cur_col, wrap)); +} + +int +ahd_waiting_tid_head_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "WAITING_TID_HEAD", + 0x120, regvalue, cur_col, wrap)); +} + +int +ahd_waiting_tid_tail_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "WAITING_TID_TAIL", + 0x122, regvalue, cur_col, wrap)); +} + +int +ahd_next_queued_scb_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "NEXT_QUEUED_SCB_ADDR", + 0x124, regvalue, cur_col, wrap)); +} + +int +ahd_complete_scb_head_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "COMPLETE_SCB_HEAD", + 0x128, regvalue, cur_col, wrap)); +} + +int +ahd_complete_scb_dmainprog_head_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "COMPLETE_SCB_DMAINPROG_HEAD", + 0x12a, regvalue, cur_col, wrap)); +} + +int +ahd_complete_dma_scb_head_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "COMPLETE_DMA_SCB_HEAD", + 0x12c, regvalue, cur_col, wrap)); +} + +int +ahd_complete_dma_scb_tail_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "COMPLETE_DMA_SCB_TAIL", + 0x12e, regvalue, cur_col, wrap)); +} + +int +ahd_complete_on_qfreeze_head_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "COMPLETE_ON_QFREEZE_HEAD", + 0x130, regvalue, cur_col, wrap)); +} + +int +ahd_qfreeze_count_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "QFREEZE_COUNT", + 0x132, regvalue, cur_col, wrap)); +} + +int +ahd_kernel_qfreeze_count_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "KERNEL_QFREEZE_COUNT", + 0x134, regvalue, cur_col, wrap)); +} + +int +ahd_saved_mode_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SAVED_MODE", + 0x136, regvalue, cur_col, wrap)); +} + +int +ahd_msg_out_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "MSG_OUT", + 0x137, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t DMAPARAMS_parse_table[] = { + { "FIFORESET", 0x01, 0x01 }, + { "FIFOFLUSH", 0x02, 0x02 }, + { "DIRECTION", 0x04, 0x04 }, + { "HDMAEN", 0x08, 0x08 }, + { "HDMAENACK", 0x08, 0x08 }, + { "SDMAEN", 0x10, 0x10 }, + { "SDMAENACK", 0x10, 0x10 }, + { "SCSIEN", 0x20, 0x20 }, + { "WIDEODD", 0x40, 0x40 }, + { "PRELOADEN", 0x80, 0x80 } +}; + +int +ahd_dmaparams_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(DMAPARAMS_parse_table, 10, "DMAPARAMS", + 0x138, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SEQ_FLAGS_parse_table[] = { + { "NO_DISCONNECT", 0x01, 0x01 }, + { "SPHASE_PENDING", 0x02, 0x02 }, + { "DPHASE_PENDING", 0x04, 0x04 }, + { "CMDPHASE_PENDING", 0x08, 0x08 }, + { "TARG_CMD_PENDING", 0x10, 0x10 }, + { "DPHASE", 0x20, 0x20 }, + { "NO_CDB_SENT", 0x40, 0x40 }, + { "TARGET_CMD_IS_TAGGED",0x40, 0x40 }, + { "NOT_IDENTIFIED", 0x80, 0x80 } +}; + +int +ahd_seq_flags_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SEQ_FLAGS_parse_table, 9, "SEQ_FLAGS", + 0x139, regvalue, cur_col, wrap)); +} + +int +ahd_saved_scsiid_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SAVED_SCSIID", + 0x13a, regvalue, cur_col, wrap)); +} + +int +ahd_saved_lun_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SAVED_LUN", + 0x13b, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t LASTPHASE_parse_table[] = { + { "P_DATAOUT", 0x00, 0xe0 }, + { "P_DATAOUT_DT", 0x20, 0xe0 }, + { "P_DATAIN", 0x40, 0xe0 }, + { "P_DATAIN_DT", 0x60, 0xe0 }, + { "P_COMMAND", 0x80, 0xe0 }, + { "P_MESGOUT", 0xa0, 0xe0 }, + { "P_STATUS", 0xc0, 0xe0 }, + { "P_MESGIN", 0xe0, 0xe0 }, + { "P_BUSFREE", 0x01, 0x01 }, + { "MSGI", 0x20, 0x20 }, + { "IOI", 0x40, 0x40 }, + { "CDI", 0x80, 0x80 }, + { "PHASE_MASK", 0xe0, 0xe0 } +}; + +int +ahd_lastphase_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(LASTPHASE_parse_table, 13, "LASTPHASE", + 0x13c, regvalue, cur_col, wrap)); +} + +int +ahd_qoutfifo_entry_valid_tag_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "QOUTFIFO_ENTRY_VALID_TAG", + 0x13d, regvalue, cur_col, wrap)); +} + +int +ahd_kernel_tqinpos_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "KERNEL_TQINPOS", + 0x13e, regvalue, cur_col, wrap)); +} + +int +ahd_tqinpos_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "TQINPOS", + 0x13f, regvalue, cur_col, wrap)); +} + +int +ahd_shared_data_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SHARED_DATA_ADDR", + 0x140, regvalue, cur_col, wrap)); +} + +int +ahd_qoutfifo_next_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "QOUTFIFO_NEXT_ADDR", + 0x144, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t ARG_1_parse_table[] = { + { "CONT_MSG_LOOP_TARG", 0x02, 0x02 }, + { "CONT_MSG_LOOP_READ", 0x03, 0x03 }, + { "CONT_MSG_LOOP_WRITE",0x04, 0x04 }, + { "EXIT_MSG_LOOP", 0x08, 0x08 }, + { "MSGOUT_PHASEMIS", 0x10, 0x10 }, + { "SEND_REJ", 0x20, 0x20 }, + { "SEND_SENSE", 0x40, 0x40 }, + { "SEND_MSG", 0x80, 0x80 } +}; + +int +ahd_arg_1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(ARG_1_parse_table, 8, "ARG_1", + 0x148, regvalue, cur_col, wrap)); +} + +int +ahd_arg_2_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "ARG_2", + 0x149, regvalue, cur_col, wrap)); +} + +int +ahd_last_msg_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "LAST_MSG", + 0x14a, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SCSISEQ_TEMPLATE_parse_table[] = { + { "ALTSTIM", 0x01, 0x01 }, + { "ENAUTOATNP", 0x02, 0x02 }, + { "MANUALP", 0x0c, 0x0c }, + { "ENRSELI", 0x10, 0x10 }, + { "ENSELI", 0x20, 0x20 }, + { "MANUALCTL", 0x40, 0x40 } +}; + +int +ahd_scsiseq_template_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SCSISEQ_TEMPLATE_parse_table, 6, "SCSISEQ_TEMPLATE", + 0x14b, regvalue, cur_col, wrap)); +} + +int +ahd_initiator_tag_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "INITIATOR_TAG", + 0x14c, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = { + { "PENDING_MK_MESSAGE", 0x01, 0x01 }, + { "TARGET_MSG_PENDING", 0x02, 0x02 }, + { "SELECTOUT_QFROZEN", 0x04, 0x04 } +}; + +int +ahd_seq_flags2_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SEQ_FLAGS2_parse_table, 3, "SEQ_FLAGS2", + 0x14d, regvalue, cur_col, wrap)); +} + +int +ahd_allocfifo_scbptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "ALLOCFIFO_SCBPTR", + 0x14e, regvalue, cur_col, wrap)); +} + +int +ahd_int_coalescing_timer_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "INT_COALESCING_TIMER", + 0x150, regvalue, cur_col, wrap)); +} + +int +ahd_int_coalescing_maxcmds_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "INT_COALESCING_MAXCMDS", + 0x152, regvalue, cur_col, wrap)); +} + +int +ahd_int_coalescing_mincmds_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "INT_COALESCING_MINCMDS", + 0x153, regvalue, cur_col, wrap)); +} + +int +ahd_cmds_pending_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "CMDS_PENDING", + 0x154, regvalue, cur_col, wrap)); +} + +int +ahd_int_coalescing_cmdcount_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "INT_COALESCING_CMDCOUNT", + 0x156, regvalue, cur_col, wrap)); +} + +int +ahd_local_hs_mailbox_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "LOCAL_HS_MAILBOX", + 0x157, regvalue, cur_col, wrap)); +} + +int +ahd_cmdsize_table_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "CMDSIZE_TABLE", + 0x158, regvalue, cur_col, wrap)); +} + +int +ahd_mk_message_scb_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "MK_MESSAGE_SCB", + 0x160, regvalue, cur_col, wrap)); +} + +int +ahd_mk_message_scsiid_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "MK_MESSAGE_SCSIID", + 0x162, regvalue, cur_col, wrap)); +} + +int +ahd_scb_residual_datacnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCB_RESIDUAL_DATACNT", + 0x180, regvalue, cur_col, wrap)); +} + +int +ahd_scb_base_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCB_BASE", + 0x180, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SCB_RESIDUAL_SGPTR_parse_table[] = { + { "SG_LIST_NULL", 0x01, 0x01 }, + { "SG_OVERRUN_RESID", 0x02, 0x02 }, + { "SG_ADDR_MASK", 0xf8, 0xf8 } +}; + +int +ahd_scb_residual_sgptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SCB_RESIDUAL_SGPTR_parse_table, 3, "SCB_RESIDUAL_SGPTR", + 0x184, regvalue, cur_col, wrap)); +} + +int +ahd_scb_scsi_status_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCB_SCSI_STATUS", + 0x188, regvalue, cur_col, wrap)); +} + +int +ahd_scb_sense_busaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCB_SENSE_BUSADDR", + 0x18c, regvalue, cur_col, wrap)); +} + +int +ahd_scb_tag_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCB_TAG", + 0x190, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SCB_CONTROL_parse_table[] = { + { "SCB_TAG_TYPE", 0x03, 0x03 }, + { "DISCONNECTED", 0x04, 0x04 }, + { "STATUS_RCVD", 0x08, 0x08 }, + { "MK_MESSAGE", 0x10, 0x10 }, + { "TAG_ENB", 0x20, 0x20 }, + { "DISCENB", 0x40, 0x40 }, + { "TARGET_SCB", 0x80, 0x80 } +}; + +int +ahd_scb_control_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SCB_CONTROL_parse_table, 7, "SCB_CONTROL", + 0x192, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SCB_SCSIID_parse_table[] = { + { "OID", 0x0f, 0x0f }, + { "TID", 0xf0, 0xf0 } +}; + +int +ahd_scb_scsiid_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SCB_SCSIID_parse_table, 2, "SCB_SCSIID", + 0x193, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SCB_LUN_parse_table[] = { + { "LID", 0xff, 0xff } +}; + +int +ahd_scb_lun_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SCB_LUN_parse_table, 1, "SCB_LUN", + 0x194, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SCB_TASK_ATTRIBUTE_parse_table[] = { + { "SCB_XFERLEN_ODD", 0x01, 0x01 } +}; + +int +ahd_scb_task_attribute_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SCB_TASK_ATTRIBUTE_parse_table, 1, "SCB_TASK_ATTRIBUTE", + 0x195, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SCB_CDB_LEN_parse_table[] = { + { "SCB_CDB_LEN_PTR", 0x80, 0x80 } +}; + +int +ahd_scb_cdb_len_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SCB_CDB_LEN_parse_table, 1, "SCB_CDB_LEN", + 0x196, regvalue, cur_col, wrap)); +} + +int +ahd_scb_task_management_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCB_TASK_MANAGEMENT", + 0x197, regvalue, cur_col, wrap)); +} + +int +ahd_scb_dataptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCB_DATAPTR", + 0x198, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SCB_DATACNT_parse_table[] = { + { "SG_HIGH_ADDR_BITS", 0x7f, 0x7f }, + { "SG_LAST_SEG", 0x80, 0x80 } +}; + +int +ahd_scb_datacnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SCB_DATACNT_parse_table, 2, "SCB_DATACNT", + 0x1a0, regvalue, cur_col, wrap)); +} + +static const ahd_reg_parse_entry_t SCB_SGPTR_parse_table[] = { + { "SG_LIST_NULL", 0x01, 0x01 }, + { "SG_FULL_RESID", 0x02, 0x02 }, + { "SG_STATUS_VALID", 0x04, 0x04 } +}; + +int +ahd_scb_sgptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(SCB_SGPTR_parse_table, 3, "SCB_SGPTR", + 0x1a4, regvalue, cur_col, wrap)); +} + +int +ahd_scb_busaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCB_BUSADDR", + 0x1a8, regvalue, cur_col, wrap)); +} + +int +ahd_scb_next_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCB_NEXT", + 0x1ac, regvalue, cur_col, wrap)); +} + +int +ahd_scb_next2_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCB_NEXT2", + 0x1ae, regvalue, cur_col, wrap)); +} + +int +ahd_scb_disconnected_lists_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahd_print_register(NULL, 0, "SCB_DISCONNECTED_LISTS", + 0x1b8, regvalue, cur_col, wrap)); } diff --git a/trunk/drivers/scsi/aic7xxx/aic7xxx.reg b/trunk/drivers/scsi/aic7xxx/aic7xxx.reg index 9a96e55da39a..0d2f763c3427 100644 --- a/trunk/drivers/scsi/aic7xxx/aic7xxx.reg +++ b/trunk/drivers/scsi/aic7xxx/aic7xxx.reg @@ -50,17 +50,6 @@ VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#40 $" * Adaptec's Technical Documents Department 1-800-934-2766 */ -/* - * Registers marked "dont_generate_debug_code" are not (yet) referenced - * from the driver code, and this keyword inhibit generation - * of debug code for them. - * - * REG_PRETTY_PRINT config will complain if dont_generate_debug_code - * is added to the register which is referenced in the driver. - * Unreferenced register with no dont_generate_debug_code will result - * in dead code. No warning is issued. - */ - /* * SCSI Sequence Control (p. 3-11). * Each bit, when set starts a specific SCSI sequence on the bus @@ -108,7 +97,6 @@ register SXFRCTL1 { field ENSTIMER 0x04 field ACTNEGEN 0x02 field STPWEN 0x01 /* Powered Termination */ - dont_generate_debug_code } /* @@ -167,7 +155,6 @@ register SCSISIGO { mask P_MESGOUT CDI|MSGI mask P_STATUS CDI|IOI mask P_MESGIN CDI|IOI|MSGI - dont_generate_debug_code } /* @@ -207,7 +194,6 @@ register SCSIID { */ alias SCSIOFFSET mask SOFS_ULTRA2 0x7f /* Sync offset U2 chips */ - dont_generate_debug_code } /* @@ -219,7 +205,6 @@ register SCSIID { register SCSIDATL { address 0x006 access_mode RW - dont_generate_debug_code } register SCSIDATH { @@ -238,7 +223,6 @@ register STCNT { address 0x008 size 3 access_mode RW - dont_generate_debug_code } /* ALT_MODE registers (Ultra2 and Ultra160 chips) */ @@ -264,7 +248,6 @@ register OPTIONMODE { field AUTO_MSGOUT_DE 0x02 field DIS_MSGIN_DUALEDGE 0x01 mask OPTIONMODE_DEFAULTS AUTO_MSGOUT_DE|DIS_MSGIN_DUALEDGE - dont_generate_debug_code } /* ALT_MODE register on Ultra160 chips */ @@ -273,7 +256,6 @@ register TARGCRCCNT { size 2 access_mode RW count 2 - dont_generate_debug_code } /* @@ -289,7 +271,6 @@ register CLRSINT0 { field CLRSWRAP 0x08 field CLRIOERR 0x08 /* Ultra2 Only */ field CLRSPIORDY 0x02 - dont_generate_debug_code } /* @@ -325,7 +306,6 @@ register CLRSINT1 { field CLRSCSIPERR 0x04 field CLRPHASECHG 0x02 field CLRREQINIT 0x01 - dont_generate_debug_code } /* @@ -380,7 +360,6 @@ register SCSIID_ULTRA2 { access_mode RW mask TID 0xf0 /* Target ID mask */ mask OID 0x0f /* Our ID mask */ - dont_generate_debug_code } /* @@ -446,7 +425,6 @@ register SHADDR { address 0x014 size 4 access_mode RO - dont_generate_debug_code } /* @@ -463,7 +441,6 @@ register SELTIMER { field STAGE2 0x02 field STAGE1 0x01 alias TARGIDIN - dont_generate_debug_code } /* @@ -476,7 +453,6 @@ register SELID { access_mode RW mask SELID_MASK 0xf0 field ONEBIT 0x08 - dont_generate_debug_code } register SCAMCTL { @@ -497,7 +473,6 @@ register TARGID { size 2 access_mode RW count 14 - dont_generate_debug_code } /* @@ -520,7 +495,6 @@ register SPIOCAP { field EEPROM 0x04 /* Writable external BIOS ROM */ field ROM 0x02 /* Logic for accessing external ROM */ field SSPIOCPS 0x01 /* Termination and cable detection */ - dont_generate_debug_code } register BRDCTL { @@ -540,7 +514,6 @@ register BRDCTL { field BRDDAT2 0x04 field BRDRW_ULTRA2 0x02 field BRDSTB_ULTRA2 0x01 - dont_generate_debug_code } /* @@ -578,7 +551,6 @@ register SEECTL { field SEECK 0x04 field SEEDO 0x02 field SEEDI 0x01 - dont_generate_debug_code } /* * SCSI Block Control (p. 3-32) @@ -629,7 +601,6 @@ register SEQRAM { address 0x061 access_mode RW count 2 - dont_generate_debug_code } /* @@ -639,7 +610,6 @@ register SEQRAM { register SEQADDR0 { address 0x062 access_mode RW - dont_generate_debug_code } register SEQADDR1 { @@ -647,7 +617,6 @@ register SEQADDR1 { access_mode RW count 8 mask SEQADDR1_MASK 0x01 - dont_generate_debug_code } /* @@ -658,41 +627,35 @@ register ACCUM { address 0x064 access_mode RW accumulator - dont_generate_debug_code } register SINDEX { address 0x065 access_mode RW sindex - dont_generate_debug_code } register DINDEX { address 0x066 access_mode RW - dont_generate_debug_code } register ALLONES { address 0x069 access_mode RO allones - dont_generate_debug_code } register ALLZEROS { address 0x06a access_mode RO allzeros - dont_generate_debug_code } register NONE { address 0x06a access_mode WO none - dont_generate_debug_code } register FLAGS { @@ -701,19 +664,16 @@ register FLAGS { count 18 field ZERO 0x02 field CARRY 0x01 - dont_generate_debug_code } register SINDIR { address 0x06c access_mode RO - dont_generate_debug_code } register DINDIR { address 0x06d access_mode WO - dont_generate_debug_code } register FUNCTION1 { @@ -725,7 +685,6 @@ register STACK { address 0x06f access_mode RO count 5 - dont_generate_debug_code } const STACK_SIZE 4 @@ -757,7 +716,6 @@ register DSCOMMAND0 { field RAMPS 0x04 /* External SCB RAM Present */ field USCBSIZE32 0x02 /* Use 32byte SCB Page Size */ field CIOPARCKEN 0x01 /* Internal bus parity error enable */ - dont_generate_debug_code } register DSCOMMAND1 { @@ -766,7 +724,6 @@ register DSCOMMAND1 { mask DSLATT 0xfc /* PCI latency timer (non-ultra2) */ field HADDLDSEL1 0x02 /* Host Address Load Select Bits */ field HADDLDSEL0 0x01 - dont_generate_debug_code } /* @@ -778,7 +735,6 @@ register BUSTIME { count 2 mask BOFF 0xf0 mask BON 0x0f - dont_generate_debug_code } /* @@ -793,7 +749,6 @@ register BUSSPD { mask STBON 0x07 mask DFTHRSH_100 0xc0 mask DFTHRSH_75 0x80 - dont_generate_debug_code } /* aic7850/55/60/70/80/95 only */ @@ -801,7 +756,6 @@ register DSPCISTATUS { address 0x086 count 4 mask DFTHRSH_100 0xc0 - dont_generate_debug_code } /* aic7890/91/96/97 only */ @@ -810,7 +764,6 @@ register HS_MAILBOX { mask HOST_MAILBOX 0xF0 mask SEQ_MAILBOX 0x0F mask HOST_TQINPOS 0x80 /* Boundary at either 0 or 128 */ - dont_generate_debug_code } const HOST_MAILBOX_SHIFT 4 @@ -831,7 +784,6 @@ register HCNTRL { field INTEN 0x02 field CHIPRST 0x01 field CHIPRSTACK 0x01 - dont_generate_debug_code } /* @@ -843,14 +795,12 @@ register HADDR { address 0x088 size 4 access_mode RW - dont_generate_debug_code } register HCNT { address 0x08c size 3 access_mode RW - dont_generate_debug_code } /* @@ -860,7 +810,6 @@ register HCNT { register SCBPTR { address 0x090 access_mode RW - dont_generate_debug_code } /* @@ -929,7 +878,6 @@ register INTSTAT { mask SEQINT_MASK 0xf0|SEQINT /* SEQINT Status Codes */ mask INT_PEND (BRKADRINT|SEQINT|SCSIINT|CMDCMPLT) - dont_generate_debug_code } /* @@ -963,7 +911,6 @@ register CLRINT { field CLRSCSIINT 0x04 field CLRCMDINT 0x02 field CLRSEQINT 0x01 - dont_generate_debug_code } register DFCNTRL { @@ -997,7 +944,6 @@ register DFSTATUS { register DFWADDR { address 0x95 access_mode RW - dont_generate_debug_code } register DFRADDR { @@ -1008,7 +954,6 @@ register DFRADDR { register DFDAT { address 0x099 access_mode RW - dont_generate_debug_code } /* @@ -1022,7 +967,6 @@ register SCBCNT { count 1 field SCBAUTO 0x80 mask SCBCNT_MASK 0x1f - dont_generate_debug_code } /* @@ -1033,7 +977,6 @@ register QINFIFO { address 0x09b access_mode RW count 12 - dont_generate_debug_code } /* @@ -1053,7 +996,6 @@ register QOUTFIFO { address 0x09d access_mode WO count 7 - dont_generate_debug_code } register CRCCONTROL1 { @@ -1066,7 +1008,6 @@ register CRCCONTROL1 { field CRCREQCHKEN 0x10 field TARGCRCENDEN 0x08 field TARGCRCCNTEN 0x04 - dont_generate_debug_code } @@ -1099,7 +1040,6 @@ register SFUNCT { access_mode RW count 4 field ALT_MODE 0x80 - dont_generate_debug_code } /* @@ -1113,31 +1053,24 @@ scb { size 4 alias SCB_RESIDUAL_DATACNT alias SCB_CDB_STORE - dont_generate_debug_code } SCB_RESIDUAL_SGPTR { size 4 - dont_generate_debug_code } SCB_SCSI_STATUS { size 1 - dont_generate_debug_code } SCB_TARGET_PHASES { size 1 - dont_generate_debug_code } SCB_TARGET_DATA_DIR { size 1 - dont_generate_debug_code } SCB_TARGET_ITAG { size 1 - dont_generate_debug_code } SCB_DATAPTR { size 4 - dont_generate_debug_code } SCB_DATACNT { /* @@ -1147,14 +1080,12 @@ scb { size 4 field SG_LAST_SEG 0x80 /* In the fourth byte */ mask SG_HIGH_ADDR_BITS 0x7F /* In the fourth byte */ - dont_generate_debug_code } SCB_SGPTR { size 4 field SG_RESID_VALID 0x04 /* In the first byte */ field SG_FULL_RESID 0x02 /* In the first byte */ field SG_LIST_NULL 0x01 /* In the first byte */ - dont_generate_debug_code } SCB_CONTROL { size 1 @@ -1184,27 +1115,22 @@ scb { } SCB_CDB_LEN { size 1 - dont_generate_debug_code } SCB_SCSIRATE { size 1 - dont_generate_debug_code } SCB_SCSIOFFSET { size 1 count 1 - dont_generate_debug_code } SCB_NEXT { size 1 - dont_generate_debug_code } SCB_64_SPARE { size 16 } SCB_64_BTT { size 16 - dont_generate_debug_code } } @@ -1223,7 +1149,6 @@ register SEECTL_2840 { field CS_2840 0x04 field CK_2840 0x02 field DO_2840 0x01 - dont_generate_debug_code } register STATUS_2840 { @@ -1234,7 +1159,6 @@ register STATUS_2840 { mask BIOS_SEL 0x60 mask ADSEL 0x1e field DI_2840 0x01 - dont_generate_debug_code } /* --------------------- AIC-7870-only definitions -------------------- */ @@ -1242,22 +1166,18 @@ register STATUS_2840 { register CCHADDR { address 0x0E0 size 8 - dont_generate_debug_code } register CCHCNT { address 0x0E8 - dont_generate_debug_code } register CCSGRAM { address 0x0E9 - dont_generate_debug_code } register CCSGADDR { address 0x0EA - dont_generate_debug_code } register CCSGCTL { @@ -1266,13 +1186,11 @@ register CCSGCTL { field CCSGEN 0x08 field SG_FETCH_NEEDED 0x02 /* Bit used for software state */ field CCSGRESET 0x01 - dont_generate_debug_code } register CCSCBCNT { address 0xEF count 1 - dont_generate_debug_code } register CCSCBCTL { @@ -1283,17 +1201,14 @@ register CCSCBCTL { field CCSCBEN 0x08 field CCSCBDIR 0x04 field CCSCBRESET 0x01 - dont_generate_debug_code } register CCSCBADDR { address 0x0ED - dont_generate_debug_code } register CCSCBRAM { address 0xEC - dont_generate_debug_code } /* @@ -1303,28 +1218,23 @@ register SCBBADDR { address 0x0F0 access_mode RW count 3 - dont_generate_debug_code } register CCSCBPTR { address 0x0F1 - dont_generate_debug_code } register HNSCB_QOFF { address 0x0F4 count 4 - dont_generate_debug_code } register SNSCB_QOFF { address 0x0F6 - dont_generate_debug_code } register SDSCB_QOFF { address 0x0F8 - dont_generate_debug_code } register QOFF_CTLSTA { @@ -1334,7 +1244,6 @@ register QOFF_CTLSTA { field SDSCB_ROLLOVER 0x10 mask SCB_QSIZE 0x07 mask SCB_QSIZE_256 0x06 - dont_generate_debug_code } register DFF_THRSH { @@ -1358,7 +1267,6 @@ register DFF_THRSH { mask WR_DFTHRSH_90 0x60 mask WR_DFTHRSH_MAX 0x70 count 4 - dont_generate_debug_code } register SG_CACHE_PRE { @@ -1367,7 +1275,6 @@ register SG_CACHE_PRE { mask SG_ADDR_MASK 0xf8 field LAST_SEG 0x02 field LAST_SEG_DONE 0x01 - dont_generate_debug_code } register SG_CACHE_SHADOW { @@ -1376,7 +1283,6 @@ register SG_CACHE_SHADOW { mask SG_ADDR_MASK 0xf8 field LAST_SEG 0x02 field LAST_SEG_DONE 0x01 - dont_generate_debug_code } /* ---------------------- Scratch RAM Offsets ------------------------- */ /* These offsets are either to values that are initialized by the board's @@ -1403,7 +1309,6 @@ scratch_ram { BUSY_TARGETS { alias TARG_SCSIRATE size 16 - dont_generate_debug_code } /* * Bit vector of targets that have ULTRA enabled as set by @@ -1416,7 +1321,6 @@ scratch_ram { alias CMDSIZE_TABLE size 2 count 2 - dont_generate_debug_code } /* * Bit vector of targets that have disconnection disabled as set by @@ -1427,7 +1331,6 @@ scratch_ram { DISC_DSB { size 2 count 6 - dont_generate_debug_code } CMDSIZE_TABLE_TAIL { size 4 @@ -1438,14 +1341,12 @@ scratch_ram { */ MWI_RESIDUAL { size 1 - dont_generate_debug_code } /* * SCBID of the next SCB to be started by the controller. */ NEXT_QUEUED_SCB { size 1 - dont_generate_debug_code } /* * Single byte buffer used to designate the type or message @@ -1453,7 +1354,6 @@ scratch_ram { */ MSG_OUT { size 1 - dont_generate_debug_code } /* Parameters for DMA Logic */ DMAPARAMS { @@ -1469,7 +1369,6 @@ scratch_ram { field DIRECTION 0x04 /* Set indicates PCI->SCSI */ field FIFOFLUSH 0x02 field FIFORESET 0x01 - dont_generate_debug_code } SEQ_FLAGS { size 1 @@ -1491,11 +1390,9 @@ scratch_ram { */ SAVED_SCSIID { size 1 - dont_generate_debug_code } SAVED_LUN { size 1 - dont_generate_debug_code } /* * The last bus phase as seen by the sequencer. @@ -1520,7 +1417,6 @@ scratch_ram { */ WAITING_SCBH { size 1 - dont_generate_debug_code } /* * head of list of SCBs that are @@ -1529,7 +1425,6 @@ scratch_ram { */ DISCONNECTED_SCBH { size 1 - dont_generate_debug_code } /* * head of list of SCBs that are @@ -1537,7 +1432,6 @@ scratch_ram { */ FREE_SCBH { size 1 - dont_generate_debug_code } /* * head of list of SCBs that have @@ -1552,7 +1446,6 @@ scratch_ram { */ HSCB_ADDR { size 4 - dont_generate_debug_code } /* * Base address of our shared data with the kernel driver in host @@ -1561,19 +1454,15 @@ scratch_ram { */ SHARED_DATA_ADDR { size 4 - dont_generate_debug_code } KERNEL_QINPOS { size 1 - dont_generate_debug_code } QINPOS { size 1 - dont_generate_debug_code } QOUTPOS { size 1 - dont_generate_debug_code } /* * Kernel and sequencer offsets into the queue of @@ -1582,11 +1471,9 @@ scratch_ram { */ KERNEL_TQINPOS { size 1 - dont_generate_debug_code } TQINPOS { size 1 - dont_generate_debug_code } ARG_1 { size 1 @@ -1599,12 +1486,10 @@ scratch_ram { mask CONT_MSG_LOOP 0x04 mask CONT_TARG_SESSION 0x02 alias RETURN_1 - dont_generate_debug_code } ARG_2 { size 1 alias RETURN_2 - dont_generate_debug_code } /* @@ -1613,7 +1498,6 @@ scratch_ram { LAST_MSG { size 1 alias TARG_IMMEDIATE_SCB - dont_generate_debug_code } /* @@ -1629,7 +1513,6 @@ scratch_ram { field ENAUTOATNO 0x08 field ENAUTOATNI 0x04 field ENAUTOATNP 0x02 - dont_generate_debug_code } } @@ -1650,14 +1533,12 @@ scratch_ram { field HA_274_EXTENDED_TRANS 0x01 alias INITIATOR_TAG count 1 - dont_generate_debug_code } SEQ_FLAGS2 { size 1 field SCB_DMA 0x01 field TARGET_MSG_PENDING 0x02 - dont_generate_debug_code } } @@ -1681,7 +1562,6 @@ scratch_ram { field ENSPCHK 0x20 mask HSCSIID 0x07 /* our SCSI ID */ mask HWSCSIID 0x0f /* our SCSI ID if Wide Bus */ - dont_generate_debug_code } INTDEF { address 0x05c @@ -1689,13 +1569,11 @@ scratch_ram { count 1 field EDGE_TRIG 0x80 mask VECTOR 0x0f - dont_generate_debug_code } HOSTCONF { address 0x05d size 1 count 1 - dont_generate_debug_code } HA_274_BIOSCTRL { address 0x05f @@ -1704,7 +1582,6 @@ scratch_ram { mask BIOSMODE 0x30 mask BIOSDISABLED 0x30 field CHANNEL_B_PRIMARY 0x08 - dont_generate_debug_code } } @@ -1718,7 +1595,6 @@ scratch_ram { TARG_OFFSET { size 16 count 1 - dont_generate_debug_code } } diff --git a/trunk/drivers/scsi/aic7xxx/aic7xxx_core.c b/trunk/drivers/scsi/aic7xxx/aic7xxx_core.c index e6f2bb7365e6..0ae2b4605d09 100644 --- a/trunk/drivers/scsi/aic7xxx/aic7xxx_core.c +++ b/trunk/drivers/scsi/aic7xxx/aic7xxx_core.c @@ -814,7 +814,6 @@ ahc_intr(struct ahc_softc *ahc) static void ahc_restart(struct ahc_softc *ahc) { - uint8_t sblkctl; ahc_pause(ahc); @@ -869,12 +868,6 @@ ahc_restart(struct ahc_softc *ahc) ahc_outb(ahc, SEQADDR0, 0); ahc_outb(ahc, SEQADDR1, 0); - /* - * Take the LED out of diagnostic mode on PM resume, too - */ - sblkctl = ahc_inb(ahc, SBLKCTL); - ahc_outb(ahc, SBLKCTL, (sblkctl & ~(DIAGLEDEN|DIAGLEDON))); - ahc_unpause(ahc); } diff --git a/trunk/drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped b/trunk/drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped index e821082a4f47..2ce1febca207 100644 --- a/trunk/drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped +++ b/trunk/drivers/scsi/aic7xxx/aic7xxx_reg.h_shipped @@ -26,6 +26,20 @@ ahc_reg_print_t ahc_sxfrctl0_print; ahc_print_register(NULL, 0, "SXFRCTL0", 0x01, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_sxfrctl1_print; +#else +#define ahc_sxfrctl1_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SXFRCTL1", 0x02, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scsisigo_print; +#else +#define ahc_scsisigo_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCSISIGO", 0x03, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_scsisigi_print; #else @@ -40,6 +54,55 @@ ahc_reg_print_t ahc_scsirate_print; ahc_print_register(NULL, 0, "SCSIRATE", 0x04, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scsiid_print; +#else +#define ahc_scsiid_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCSIID", 0x05, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scsidatl_print; +#else +#define ahc_scsidatl_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCSIDATL", 0x06, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scsidath_print; +#else +#define ahc_scsidath_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCSIDATH", 0x07, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_stcnt_print; +#else +#define ahc_stcnt_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "STCNT", 0x08, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_optionmode_print; +#else +#define ahc_optionmode_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "OPTIONMODE", 0x08, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_targcrccnt_print; +#else +#define ahc_targcrccnt_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "TARGCRCCNT", 0x0a, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_clrsint0_print; +#else +#define ahc_clrsint0_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CLRSINT0", 0x0b, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_sstat0_print; #else @@ -47,6 +110,13 @@ ahc_reg_print_t ahc_sstat0_print; ahc_print_register(NULL, 0, "SSTAT0", 0x0b, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_clrsint1_print; +#else +#define ahc_clrsint1_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CLRSINT1", 0x0c, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_sstat1_print; #else @@ -68,6 +138,13 @@ ahc_reg_print_t ahc_sstat3_print; ahc_print_register(NULL, 0, "SSTAT3", 0x0e, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scsiid_ultra2_print; +#else +#define ahc_scsiid_ultra2_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCSIID_ULTRA2", 0x0f, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_simode0_print; #else @@ -89,6 +166,76 @@ ahc_reg_print_t ahc_scsibusl_print; ahc_print_register(NULL, 0, "SCSIBUSL", 0x12, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scsibush_print; +#else +#define ahc_scsibush_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCSIBUSH", 0x13, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_sxfrctl2_print; +#else +#define ahc_sxfrctl2_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SXFRCTL2", 0x13, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_shaddr_print; +#else +#define ahc_shaddr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SHADDR", 0x14, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_seltimer_print; +#else +#define ahc_seltimer_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SELTIMER", 0x18, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_selid_print; +#else +#define ahc_selid_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SELID", 0x19, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scamctl_print; +#else +#define ahc_scamctl_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCAMCTL", 0x1a, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_targid_print; +#else +#define ahc_targid_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "TARGID", 0x1b, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_spiocap_print; +#else +#define ahc_spiocap_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SPIOCAP", 0x1b, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_brdctl_print; +#else +#define ahc_brdctl_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "BRDCTL", 0x1d, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_seectl_print; +#else +#define ahc_seectl_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SEECTL", 0x1e, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_sblkctl_print; #else @@ -96,6 +243,62 @@ ahc_reg_print_t ahc_sblkctl_print; ahc_print_register(NULL, 0, "SBLKCTL", 0x1f, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_busy_targets_print; +#else +#define ahc_busy_targets_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "BUSY_TARGETS", 0x20, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_ultra_enb_print; +#else +#define ahc_ultra_enb_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "ULTRA_ENB", 0x30, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_disc_dsb_print; +#else +#define ahc_disc_dsb_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "DISC_DSB", 0x32, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_cmdsize_table_tail_print; +#else +#define ahc_cmdsize_table_tail_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CMDSIZE_TABLE_TAIL", 0x34, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_mwi_residual_print; +#else +#define ahc_mwi_residual_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "MWI_RESIDUAL", 0x38, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_next_queued_scb_print; +#else +#define ahc_next_queued_scb_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "NEXT_QUEUED_SCB", 0x39, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_msg_out_print; +#else +#define ahc_msg_out_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "MSG_OUT", 0x3a, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_dmaparams_print; +#else +#define ahc_dmaparams_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "DMAPARAMS", 0x3b, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_seq_flags_print; #else @@ -103,6 +306,20 @@ ahc_reg_print_t ahc_seq_flags_print; ahc_print_register(NULL, 0, "SEQ_FLAGS", 0x3c, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_saved_scsiid_print; +#else +#define ahc_saved_scsiid_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SAVED_SCSIID", 0x3d, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_saved_lun_print; +#else +#define ahc_saved_lun_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SAVED_LUN", 0x3e, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_lastphase_print; #else @@ -110,6 +327,153 @@ ahc_reg_print_t ahc_lastphase_print; ahc_print_register(NULL, 0, "LASTPHASE", 0x3f, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_waiting_scbh_print; +#else +#define ahc_waiting_scbh_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "WAITING_SCBH", 0x40, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_disconnected_scbh_print; +#else +#define ahc_disconnected_scbh_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "DISCONNECTED_SCBH", 0x41, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_free_scbh_print; +#else +#define ahc_free_scbh_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "FREE_SCBH", 0x42, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_complete_scbh_print; +#else +#define ahc_complete_scbh_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "COMPLETE_SCBH", 0x43, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_hscb_addr_print; +#else +#define ahc_hscb_addr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "HSCB_ADDR", 0x44, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_shared_data_addr_print; +#else +#define ahc_shared_data_addr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SHARED_DATA_ADDR", 0x48, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_kernel_qinpos_print; +#else +#define ahc_kernel_qinpos_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "KERNEL_QINPOS", 0x4c, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_qinpos_print; +#else +#define ahc_qinpos_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "QINPOS", 0x4d, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_qoutpos_print; +#else +#define ahc_qoutpos_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "QOUTPOS", 0x4e, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_kernel_tqinpos_print; +#else +#define ahc_kernel_tqinpos_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "KERNEL_TQINPOS", 0x4f, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_tqinpos_print; +#else +#define ahc_tqinpos_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "TQINPOS", 0x50, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_arg_1_print; +#else +#define ahc_arg_1_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "ARG_1", 0x51, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_arg_2_print; +#else +#define ahc_arg_2_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "ARG_2", 0x52, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_last_msg_print; +#else +#define ahc_last_msg_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "LAST_MSG", 0x53, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scsiseq_template_print; +#else +#define ahc_scsiseq_template_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCSISEQ_TEMPLATE", 0x54, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_ha_274_biosglobal_print; +#else +#define ahc_ha_274_biosglobal_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "HA_274_BIOSGLOBAL", 0x56, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_seq_flags2_print; +#else +#define ahc_seq_flags2_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SEQ_FLAGS2", 0x57, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scsiconf_print; +#else +#define ahc_scsiconf_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCSICONF", 0x5a, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_intdef_print; +#else +#define ahc_intdef_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "INTDEF", 0x5c, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_hostconf_print; +#else +#define ahc_hostconf_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "HOSTCONF", 0x5d, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_ha_274_biosctrl_print; +#else +#define ahc_ha_274_biosctrl_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "HA_274_BIOSCTRL", 0x5f, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_seqctl_print; #else @@ -117,6 +481,111 @@ ahc_reg_print_t ahc_seqctl_print; ahc_print_register(NULL, 0, "SEQCTL", 0x60, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_seqram_print; +#else +#define ahc_seqram_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SEQRAM", 0x61, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_seqaddr0_print; +#else +#define ahc_seqaddr0_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SEQADDR0", 0x62, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_seqaddr1_print; +#else +#define ahc_seqaddr1_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SEQADDR1", 0x63, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_accum_print; +#else +#define ahc_accum_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "ACCUM", 0x64, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_sindex_print; +#else +#define ahc_sindex_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SINDEX", 0x65, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_dindex_print; +#else +#define ahc_dindex_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "DINDEX", 0x66, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_allones_print; +#else +#define ahc_allones_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "ALLONES", 0x69, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_allzeros_print; +#else +#define ahc_allzeros_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "ALLZEROS", 0x6a, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_none_print; +#else +#define ahc_none_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "NONE", 0x6a, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_flags_print; +#else +#define ahc_flags_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "FLAGS", 0x6b, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_sindir_print; +#else +#define ahc_sindir_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SINDIR", 0x6c, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_dindir_print; +#else +#define ahc_dindir_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "DINDIR", 0x6d, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_function1_print; +#else +#define ahc_function1_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "FUNCTION1", 0x6e, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_stack_print; +#else +#define ahc_stack_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "STACK", 0x6f, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_targ_offset_print; +#else +#define ahc_targ_offset_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "TARG_OFFSET", 0x70, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_sram_base_print; #else @@ -124,6 +593,97 @@ ahc_reg_print_t ahc_sram_base_print; ahc_print_register(NULL, 0, "SRAM_BASE", 0x70, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_bctl_print; +#else +#define ahc_bctl_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "BCTL", 0x84, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_dscommand0_print; +#else +#define ahc_dscommand0_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "DSCOMMAND0", 0x84, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_bustime_print; +#else +#define ahc_bustime_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "BUSTIME", 0x85, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_dscommand1_print; +#else +#define ahc_dscommand1_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "DSCOMMAND1", 0x85, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_busspd_print; +#else +#define ahc_busspd_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "BUSSPD", 0x86, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_hs_mailbox_print; +#else +#define ahc_hs_mailbox_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "HS_MAILBOX", 0x86, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_dspcistatus_print; +#else +#define ahc_dspcistatus_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "DSPCISTATUS", 0x86, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_hcntrl_print; +#else +#define ahc_hcntrl_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "HCNTRL", 0x87, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_haddr_print; +#else +#define ahc_haddr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "HADDR", 0x88, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_hcnt_print; +#else +#define ahc_hcnt_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "HCNT", 0x8c, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scbptr_print; +#else +#define ahc_scbptr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCBPTR", 0x90, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_intstat_print; +#else +#define ahc_intstat_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "INTSTAT", 0x91, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_clrint_print; +#else +#define ahc_clrint_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CLRINT", 0x92, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_error_print; #else @@ -145,6 +705,69 @@ ahc_reg_print_t ahc_dfstatus_print; ahc_print_register(NULL, 0, "DFSTATUS", 0x94, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_dfwaddr_print; +#else +#define ahc_dfwaddr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "DFWADDR", 0x95, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_dfraddr_print; +#else +#define ahc_dfraddr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "DFRADDR", 0x97, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_dfdat_print; +#else +#define ahc_dfdat_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "DFDAT", 0x99, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scbcnt_print; +#else +#define ahc_scbcnt_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCBCNT", 0x9a, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_qinfifo_print; +#else +#define ahc_qinfifo_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "QINFIFO", 0x9b, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_qincnt_print; +#else +#define ahc_qincnt_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "QINCNT", 0x9c, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_qoutfifo_print; +#else +#define ahc_qoutfifo_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "QOUTFIFO", 0x9d, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_crccontrol1_print; +#else +#define ahc_crccontrol1_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CRCCONTROL1", 0x9d, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_qoutcnt_print; +#else +#define ahc_qoutcnt_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "QOUTCNT", 0x9e, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_scsiphase_print; #else @@ -152,6 +775,13 @@ ahc_reg_print_t ahc_scsiphase_print; ahc_print_register(NULL, 0, "SCSIPHASE", 0x9e, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_sfunct_print; +#else +#define ahc_sfunct_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SFUNCT", 0x9f, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_scb_base_print; #else @@ -159,6 +789,69 @@ ahc_reg_print_t ahc_scb_base_print; ahc_print_register(NULL, 0, "SCB_BASE", 0xa0, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_cdb_ptr_print; +#else +#define ahc_scb_cdb_ptr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_CDB_PTR", 0xa0, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_residual_sgptr_print; +#else +#define ahc_scb_residual_sgptr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_RESIDUAL_SGPTR", 0xa4, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_scsi_status_print; +#else +#define ahc_scb_scsi_status_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_SCSI_STATUS", 0xa8, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_target_phases_print; +#else +#define ahc_scb_target_phases_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_TARGET_PHASES", 0xa9, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_target_data_dir_print; +#else +#define ahc_scb_target_data_dir_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_TARGET_DATA_DIR", 0xaa, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_target_itag_print; +#else +#define ahc_scb_target_itag_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_TARGET_ITAG", 0xab, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_dataptr_print; +#else +#define ahc_scb_dataptr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_DATAPTR", 0xac, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_datacnt_print; +#else +#define ahc_scb_datacnt_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_DATACNT", 0xb0, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_sgptr_print; +#else +#define ahc_scb_sgptr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_SGPTR", 0xb4, regvalue, cur_col, wrap) +#endif + #if AIC_DEBUG_REGISTERS ahc_reg_print_t ahc_scb_control_print; #else @@ -187,6 +880,188 @@ ahc_reg_print_t ahc_scb_tag_print; ahc_print_register(NULL, 0, "SCB_TAG", 0xbb, regvalue, cur_col, wrap) #endif +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_cdb_len_print; +#else +#define ahc_scb_cdb_len_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_CDB_LEN", 0xbc, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_scsirate_print; +#else +#define ahc_scb_scsirate_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_SCSIRATE", 0xbd, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_scsioffset_print; +#else +#define ahc_scb_scsioffset_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_SCSIOFFSET", 0xbe, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_next_print; +#else +#define ahc_scb_next_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_NEXT", 0xbf, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_64_spare_print; +#else +#define ahc_scb_64_spare_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_64_SPARE", 0xc0, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_seectl_2840_print; +#else +#define ahc_seectl_2840_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SEECTL_2840", 0xc0, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_status_2840_print; +#else +#define ahc_status_2840_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "STATUS_2840", 0xc1, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scb_64_btt_print; +#else +#define ahc_scb_64_btt_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCB_64_BTT", 0xd0, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_cchaddr_print; +#else +#define ahc_cchaddr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CCHADDR", 0xe0, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_cchcnt_print; +#else +#define ahc_cchcnt_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CCHCNT", 0xe8, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_ccsgram_print; +#else +#define ahc_ccsgram_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CCSGRAM", 0xe9, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_ccsgaddr_print; +#else +#define ahc_ccsgaddr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CCSGADDR", 0xea, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_ccsgctl_print; +#else +#define ahc_ccsgctl_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CCSGCTL", 0xeb, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_ccscbram_print; +#else +#define ahc_ccscbram_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CCSCBRAM", 0xec, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_ccscbaddr_print; +#else +#define ahc_ccscbaddr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CCSCBADDR", 0xed, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_ccscbctl_print; +#else +#define ahc_ccscbctl_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CCSCBCTL", 0xee, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_ccscbcnt_print; +#else +#define ahc_ccscbcnt_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CCSCBCNT", 0xef, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_scbbaddr_print; +#else +#define ahc_scbbaddr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SCBBADDR", 0xf0, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_ccscbptr_print; +#else +#define ahc_ccscbptr_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "CCSCBPTR", 0xf1, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_hnscb_qoff_print; +#else +#define ahc_hnscb_qoff_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "HNSCB_QOFF", 0xf4, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_snscb_qoff_print; +#else +#define ahc_snscb_qoff_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SNSCB_QOFF", 0xf6, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_sdscb_qoff_print; +#else +#define ahc_sdscb_qoff_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SDSCB_QOFF", 0xf8, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_qoff_ctlsta_print; +#else +#define ahc_qoff_ctlsta_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "QOFF_CTLSTA", 0xfa, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_dff_thrsh_print; +#else +#define ahc_dff_thrsh_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "DFF_THRSH", 0xfb, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_sg_cache_shadow_print; +#else +#define ahc_sg_cache_shadow_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SG_CACHE_SHADOW", 0xfc, regvalue, cur_col, wrap) +#endif + +#if AIC_DEBUG_REGISTERS +ahc_reg_print_t ahc_sg_cache_pre_print; +#else +#define ahc_sg_cache_pre_print(regvalue, cur_col, wrap) \ + ahc_print_register(NULL, 0, "SG_CACHE_PRE", 0xfc, regvalue, cur_col, wrap) +#endif + #define SCSISEQ 0x00 #define TEMODE 0x80 diff --git a/trunk/drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped b/trunk/drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped index 9f9b88047d0c..309a562b009e 100644 --- a/trunk/drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped +++ b/trunk/drivers/scsi/aic7xxx/aic7xxx_reg_print.c_shipped @@ -43,6 +43,48 @@ ahc_sxfrctl0_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x01, regvalue, cur_col, wrap)); } +static const ahc_reg_parse_entry_t SXFRCTL1_parse_table[] = { + { "STPWEN", 0x01, 0x01 }, + { "ACTNEGEN", 0x02, 0x02 }, + { "ENSTIMER", 0x04, 0x04 }, + { "ENSPCHK", 0x20, 0x20 }, + { "SWRAPEN", 0x40, 0x40 }, + { "BITBUCKET", 0x80, 0x80 }, + { "STIMESEL", 0x18, 0x18 } +}; + +int +ahc_sxfrctl1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SXFRCTL1_parse_table, 7, "SXFRCTL1", + 0x02, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SCSISIGO_parse_table[] = { + { "ACKO", 0x01, 0x01 }, + { "REQO", 0x02, 0x02 }, + { "BSYO", 0x04, 0x04 }, + { "SELO", 0x08, 0x08 }, + { "ATNO", 0x10, 0x10 }, + { "MSGO", 0x20, 0x20 }, + { "IOO", 0x40, 0x40 }, + { "CDO", 0x80, 0x80 }, + { "P_DATAOUT", 0x00, 0x00 }, + { "P_DATAIN", 0x40, 0x40 }, + { "P_COMMAND", 0x80, 0x80 }, + { "P_MESGOUT", 0xa0, 0xa0 }, + { "P_STATUS", 0xc0, 0xc0 }, + { "PHASE_MASK", 0xe0, 0xe0 }, + { "P_MESGIN", 0xe0, 0xe0 } +}; + +int +ahc_scsisigo_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SCSISIGO_parse_table, 15, "SCSISIGO", + 0x03, regvalue, cur_col, wrap)); +} + static const ahc_reg_parse_entry_t SCSISIGI_parse_table[] = { { "ACKI", 0x01, 0x01 }, { "REQI", 0x02, 0x02 }, @@ -86,6 +128,77 @@ ahc_scsirate_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x04, regvalue, cur_col, wrap)); } +static const ahc_reg_parse_entry_t SCSIID_parse_table[] = { + { "TWIN_CHNLB", 0x80, 0x80 }, + { "OID", 0x0f, 0x0f }, + { "TWIN_TID", 0x70, 0x70 }, + { "SOFS_ULTRA2", 0x7f, 0x7f }, + { "TID", 0xf0, 0xf0 } +}; + +int +ahc_scsiid_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SCSIID_parse_table, 5, "SCSIID", + 0x05, regvalue, cur_col, wrap)); +} + +int +ahc_scsidatl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCSIDATL", + 0x06, regvalue, cur_col, wrap)); +} + +int +ahc_stcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "STCNT", + 0x08, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t OPTIONMODE_parse_table[] = { + { "DIS_MSGIN_DUALEDGE", 0x01, 0x01 }, + { "AUTO_MSGOUT_DE", 0x02, 0x02 }, + { "SCSIDATL_IMGEN", 0x04, 0x04 }, + { "EXPPHASEDIS", 0x08, 0x08 }, + { "BUSFREEREV", 0x10, 0x10 }, + { "ATNMGMNTEN", 0x20, 0x20 }, + { "AUTOACKEN", 0x40, 0x40 }, + { "AUTORATEEN", 0x80, 0x80 }, + { "OPTIONMODE_DEFAULTS",0x03, 0x03 } +}; + +int +ahc_optionmode_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(OPTIONMODE_parse_table, 9, "OPTIONMODE", + 0x08, regvalue, cur_col, wrap)); +} + +int +ahc_targcrccnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "TARGCRCCNT", + 0x0a, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t CLRSINT0_parse_table[] = { + { "CLRSPIORDY", 0x02, 0x02 }, + { "CLRSWRAP", 0x08, 0x08 }, + { "CLRIOERR", 0x08, 0x08 }, + { "CLRSELINGO", 0x10, 0x10 }, + { "CLRSELDI", 0x20, 0x20 }, + { "CLRSELDO", 0x40, 0x40 } +}; + +int +ahc_clrsint0_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(CLRSINT0_parse_table, 6, "CLRSINT0", + 0x0b, regvalue, cur_col, wrap)); +} + static const ahc_reg_parse_entry_t SSTAT0_parse_table[] = { { "DMADONE", 0x01, 0x01 }, { "SPIORDY", 0x02, 0x02 }, @@ -105,6 +218,23 @@ ahc_sstat0_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x0b, regvalue, cur_col, wrap)); } +static const ahc_reg_parse_entry_t CLRSINT1_parse_table[] = { + { "CLRREQINIT", 0x01, 0x01 }, + { "CLRPHASECHG", 0x02, 0x02 }, + { "CLRSCSIPERR", 0x04, 0x04 }, + { "CLRBUSFREE", 0x08, 0x08 }, + { "CLRSCSIRSTI", 0x20, 0x20 }, + { "CLRATNO", 0x40, 0x40 }, + { "CLRSELTIMEO", 0x80, 0x80 } +}; + +int +ahc_clrsint1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(CLRSINT1_parse_table, 7, "CLRSINT1", + 0x0c, regvalue, cur_col, wrap)); +} + static const ahc_reg_parse_entry_t SSTAT1_parse_table[] = { { "REQINIT", 0x01, 0x01 }, { "PHASECHG", 0x02, 0x02 }, @@ -154,6 +284,18 @@ ahc_sstat3_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x0e, regvalue, cur_col, wrap)); } +static const ahc_reg_parse_entry_t SCSIID_ULTRA2_parse_table[] = { + { "OID", 0x0f, 0x0f }, + { "TID", 0xf0, 0xf0 } +}; + +int +ahc_scsiid_ultra2_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SCSIID_ULTRA2_parse_table, 2, "SCSIID_ULTRA2", + 0x0f, regvalue, cur_col, wrap)); +} + static const ahc_reg_parse_entry_t SIMODE0_parse_table[] = { { "ENDMADONE", 0x01, 0x01 }, { "ENSPIORDY", 0x02, 0x02 }, @@ -197,6 +339,107 @@ ahc_scsibusl_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x12, regvalue, cur_col, wrap)); } +int +ahc_shaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SHADDR", + 0x14, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SELTIMER_parse_table[] = { + { "STAGE1", 0x01, 0x01 }, + { "STAGE2", 0x02, 0x02 }, + { "STAGE3", 0x04, 0x04 }, + { "STAGE4", 0x08, 0x08 }, + { "STAGE5", 0x10, 0x10 }, + { "STAGE6", 0x20, 0x20 } +}; + +int +ahc_seltimer_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SELTIMER_parse_table, 6, "SELTIMER", + 0x18, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SELID_parse_table[] = { + { "ONEBIT", 0x08, 0x08 }, + { "SELID_MASK", 0xf0, 0xf0 } +}; + +int +ahc_selid_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SELID_parse_table, 2, "SELID", + 0x19, regvalue, cur_col, wrap)); +} + +int +ahc_targid_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "TARGID", + 0x1b, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SPIOCAP_parse_table[] = { + { "SSPIOCPS", 0x01, 0x01 }, + { "ROM", 0x02, 0x02 }, + { "EEPROM", 0x04, 0x04 }, + { "SEEPROM", 0x08, 0x08 }, + { "EXT_BRDCTL", 0x10, 0x10 }, + { "SOFTCMDEN", 0x20, 0x20 }, + { "SOFT0", 0x40, 0x40 }, + { "SOFT1", 0x80, 0x80 } +}; + +int +ahc_spiocap_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SPIOCAP_parse_table, 8, "SPIOCAP", + 0x1b, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t BRDCTL_parse_table[] = { + { "BRDCTL0", 0x01, 0x01 }, + { "BRDSTB_ULTRA2", 0x01, 0x01 }, + { "BRDCTL1", 0x02, 0x02 }, + { "BRDRW_ULTRA2", 0x02, 0x02 }, + { "BRDRW", 0x04, 0x04 }, + { "BRDDAT2", 0x04, 0x04 }, + { "BRDCS", 0x08, 0x08 }, + { "BRDDAT3", 0x08, 0x08 }, + { "BRDSTB", 0x10, 0x10 }, + { "BRDDAT4", 0x10, 0x10 }, + { "BRDDAT5", 0x20, 0x20 }, + { "BRDDAT6", 0x40, 0x40 }, + { "BRDDAT7", 0x80, 0x80 } +}; + +int +ahc_brdctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(BRDCTL_parse_table, 13, "BRDCTL", + 0x1d, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SEECTL_parse_table[] = { + { "SEEDI", 0x01, 0x01 }, + { "SEEDO", 0x02, 0x02 }, + { "SEECK", 0x04, 0x04 }, + { "SEECS", 0x08, 0x08 }, + { "SEERDY", 0x10, 0x10 }, + { "SEEMS", 0x20, 0x20 }, + { "EXTARBREQ", 0x40, 0x40 }, + { "EXTARBACK", 0x80, 0x80 } +}; + +int +ahc_seectl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SEECTL_parse_table, 8, "SEECTL", + 0x1e, regvalue, cur_col, wrap)); +} + static const ahc_reg_parse_entry_t SBLKCTL_parse_table[] = { { "XCVR", 0x01, 0x01 }, { "SELWIDE", 0x02, 0x02 }, @@ -215,6 +458,68 @@ ahc_sblkctl_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x1f, regvalue, cur_col, wrap)); } +int +ahc_busy_targets_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "BUSY_TARGETS", + 0x20, regvalue, cur_col, wrap)); +} + +int +ahc_ultra_enb_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "ULTRA_ENB", + 0x30, regvalue, cur_col, wrap)); +} + +int +ahc_disc_dsb_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "DISC_DSB", + 0x32, regvalue, cur_col, wrap)); +} + +int +ahc_mwi_residual_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "MWI_RESIDUAL", + 0x38, regvalue, cur_col, wrap)); +} + +int +ahc_next_queued_scb_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "NEXT_QUEUED_SCB", + 0x39, regvalue, cur_col, wrap)); +} + +int +ahc_msg_out_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "MSG_OUT", + 0x3a, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t DMAPARAMS_parse_table[] = { + { "FIFORESET", 0x01, 0x01 }, + { "FIFOFLUSH", 0x02, 0x02 }, + { "DIRECTION", 0x04, 0x04 }, + { "HDMAEN", 0x08, 0x08 }, + { "HDMAENACK", 0x08, 0x08 }, + { "SDMAEN", 0x10, 0x10 }, + { "SDMAENACK", 0x10, 0x10 }, + { "SCSIEN", 0x20, 0x20 }, + { "WIDEODD", 0x40, 0x40 }, + { "PRELOADEN", 0x80, 0x80 } +}; + +int +ahc_dmaparams_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(DMAPARAMS_parse_table, 10, "DMAPARAMS", + 0x3b, regvalue, cur_col, wrap)); +} + static const ahc_reg_parse_entry_t SEQ_FLAGS_parse_table[] = { { "NO_DISCONNECT", 0x01, 0x01 }, { "SPHASE_PENDING", 0x02, 0x02 }, @@ -234,6 +539,20 @@ ahc_seq_flags_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x3c, regvalue, cur_col, wrap)); } +int +ahc_saved_scsiid_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SAVED_SCSIID", + 0x3d, regvalue, cur_col, wrap)); +} + +int +ahc_saved_lun_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SAVED_LUN", + 0x3e, regvalue, cur_col, wrap)); +} + static const ahc_reg_parse_entry_t LASTPHASE_parse_table[] = { { "MSGI", 0x20, 0x20 }, { "IOI", 0x40, 0x40 }, @@ -255,134 +574,735 @@ ahc_lastphase_print(u_int regvalue, u_int *cur_col, u_int wrap) 0x3f, regvalue, cur_col, wrap)); } -static const ahc_reg_parse_entry_t SEQCTL_parse_table[] = { - { "LOADRAM", 0x01, 0x01 }, - { "SEQRESET", 0x02, 0x02 }, - { "STEP", 0x04, 0x04 }, - { "BRKADRINTEN", 0x08, 0x08 }, - { "FASTMODE", 0x10, 0x10 }, - { "FAILDIS", 0x20, 0x20 }, - { "PAUSEDIS", 0x40, 0x40 }, - { "PERRORDIS", 0x80, 0x80 } -}; - int -ahc_seqctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahc_waiting_scbh_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahc_print_register(SEQCTL_parse_table, 8, "SEQCTL", - 0x60, regvalue, cur_col, wrap)); + return (ahc_print_register(NULL, 0, "WAITING_SCBH", + 0x40, regvalue, cur_col, wrap)); } int -ahc_sram_base_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahc_disconnected_scbh_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahc_print_register(NULL, 0, "SRAM_BASE", - 0x70, regvalue, cur_col, wrap)); + return (ahc_print_register(NULL, 0, "DISCONNECTED_SCBH", + 0x41, regvalue, cur_col, wrap)); } -static const ahc_reg_parse_entry_t ERROR_parse_table[] = { - { "ILLHADDR", 0x01, 0x01 }, - { "ILLSADDR", 0x02, 0x02 }, - { "ILLOPCODE", 0x04, 0x04 }, - { "SQPARERR", 0x08, 0x08 }, - { "DPARERR", 0x10, 0x10 }, - { "MPARERR", 0x20, 0x20 }, - { "PCIERRSTAT", 0x40, 0x40 }, - { "CIOPARERR", 0x80, 0x80 } -}; - int -ahc_error_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahc_free_scbh_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahc_print_register(ERROR_parse_table, 8, "ERROR", - 0x92, regvalue, cur_col, wrap)); + return (ahc_print_register(NULL, 0, "FREE_SCBH", + 0x42, regvalue, cur_col, wrap)); } -static const ahc_reg_parse_entry_t DFCNTRL_parse_table[] = { - { "FIFORESET", 0x01, 0x01 }, - { "FIFOFLUSH", 0x02, 0x02 }, - { "DIRECTION", 0x04, 0x04 }, - { "HDMAEN", 0x08, 0x08 }, - { "HDMAENACK", 0x08, 0x08 }, - { "SDMAEN", 0x10, 0x10 }, - { "SDMAENACK", 0x10, 0x10 }, - { "SCSIEN", 0x20, 0x20 }, - { "WIDEODD", 0x40, 0x40 }, - { "PRELOADEN", 0x80, 0x80 } -}; - int -ahc_dfcntrl_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahc_hscb_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahc_print_register(DFCNTRL_parse_table, 10, "DFCNTRL", - 0x93, regvalue, cur_col, wrap)); + return (ahc_print_register(NULL, 0, "HSCB_ADDR", + 0x44, regvalue, cur_col, wrap)); } -static const ahc_reg_parse_entry_t DFSTATUS_parse_table[] = { - { "FIFOEMP", 0x01, 0x01 }, - { "FIFOFULL", 0x02, 0x02 }, - { "DFTHRESH", 0x04, 0x04 }, - { "HDONE", 0x08, 0x08 }, - { "MREQPEND", 0x10, 0x10 }, - { "FIFOQWDEMP", 0x20, 0x20 }, - { "DFCACHETH", 0x40, 0x40 }, - { "PRELOAD_AVAIL", 0x80, 0x80 } -}; - int -ahc_dfstatus_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahc_shared_data_addr_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahc_print_register(DFSTATUS_parse_table, 8, "DFSTATUS", - 0x94, regvalue, cur_col, wrap)); + return (ahc_print_register(NULL, 0, "SHARED_DATA_ADDR", + 0x48, regvalue, cur_col, wrap)); } -static const ahc_reg_parse_entry_t SCSIPHASE_parse_table[] = { - { "DATA_OUT_PHASE", 0x01, 0x01 }, - { "DATA_IN_PHASE", 0x02, 0x02 }, - { "MSG_OUT_PHASE", 0x04, 0x04 }, - { "MSG_IN_PHASE", 0x08, 0x08 }, - { "COMMAND_PHASE", 0x10, 0x10 }, - { "STATUS_PHASE", 0x20, 0x20 }, - { "DATA_PHASE_MASK", 0x03, 0x03 } -}; +int +ahc_kernel_qinpos_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "KERNEL_QINPOS", + 0x4c, regvalue, cur_col, wrap)); +} int -ahc_scsiphase_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahc_qinpos_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahc_print_register(SCSIPHASE_parse_table, 7, "SCSIPHASE", - 0x9e, regvalue, cur_col, wrap)); + return (ahc_print_register(NULL, 0, "QINPOS", + 0x4d, regvalue, cur_col, wrap)); } int -ahc_scb_base_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahc_qoutpos_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahc_print_register(NULL, 0, "SCB_BASE", - 0xa0, regvalue, cur_col, wrap)); + return (ahc_print_register(NULL, 0, "QOUTPOS", + 0x4e, regvalue, cur_col, wrap)); } -static const ahc_reg_parse_entry_t SCB_CONTROL_parse_table[] = { - { "DISCONNECTED", 0x04, 0x04 }, - { "ULTRAENB", 0x08, 0x08 }, - { "MK_MESSAGE", 0x10, 0x10 }, - { "TAG_ENB", 0x20, 0x20 }, - { "DISCENB", 0x40, 0x40 }, - { "TARGET_SCB", 0x80, 0x80 }, - { "STATUS_RCVD", 0x80, 0x80 }, - { "SCB_TAG_TYPE", 0x03, 0x03 } -}; +int +ahc_kernel_tqinpos_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "KERNEL_TQINPOS", + 0x4f, regvalue, cur_col, wrap)); +} int -ahc_scb_control_print(u_int regvalue, u_int *cur_col, u_int wrap) +ahc_tqinpos_print(u_int regvalue, u_int *cur_col, u_int wrap) { - return (ahc_print_register(SCB_CONTROL_parse_table, 8, "SCB_CONTROL", - 0xb8, regvalue, cur_col, wrap)); + return (ahc_print_register(NULL, 0, "TQINPOS", + 0x50, regvalue, cur_col, wrap)); } -static const ahc_reg_parse_entry_t SCB_SCSIID_parse_table[] = { - { "TWIN_CHNLB", 0x80, 0x80 }, - { "OID", 0x0f, 0x0f }, - { "TWIN_TID", 0x70, 0x70 }, - { "TID", 0xf0, 0xf0 } +static const ahc_reg_parse_entry_t ARG_1_parse_table[] = { + { "CONT_TARG_SESSION", 0x02, 0x02 }, + { "CONT_MSG_LOOP", 0x04, 0x04 }, + { "EXIT_MSG_LOOP", 0x08, 0x08 }, + { "MSGOUT_PHASEMIS", 0x10, 0x10 }, + { "SEND_REJ", 0x20, 0x20 }, + { "SEND_SENSE", 0x40, 0x40 }, + { "SEND_MSG", 0x80, 0x80 } +}; + +int +ahc_arg_1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(ARG_1_parse_table, 7, "ARG_1", + 0x51, regvalue, cur_col, wrap)); +} + +int +ahc_arg_2_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "ARG_2", + 0x52, regvalue, cur_col, wrap)); +} + +int +ahc_last_msg_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "LAST_MSG", + 0x53, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SCSISEQ_TEMPLATE_parse_table[] = { + { "ENAUTOATNP", 0x02, 0x02 }, + { "ENAUTOATNI", 0x04, 0x04 }, + { "ENAUTOATNO", 0x08, 0x08 }, + { "ENRSELI", 0x10, 0x10 }, + { "ENSELI", 0x20, 0x20 }, + { "ENSELO", 0x40, 0x40 } +}; + +int +ahc_scsiseq_template_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SCSISEQ_TEMPLATE_parse_table, 6, "SCSISEQ_TEMPLATE", + 0x54, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t HA_274_BIOSGLOBAL_parse_table[] = { + { "HA_274_EXTENDED_TRANS",0x01, 0x01 } +}; + +int +ahc_ha_274_biosglobal_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(HA_274_BIOSGLOBAL_parse_table, 1, "HA_274_BIOSGLOBAL", + 0x56, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SEQ_FLAGS2_parse_table[] = { + { "SCB_DMA", 0x01, 0x01 }, + { "TARGET_MSG_PENDING", 0x02, 0x02 } +}; + +int +ahc_seq_flags2_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SEQ_FLAGS2_parse_table, 2, "SEQ_FLAGS2", + 0x57, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SCSICONF_parse_table[] = { + { "ENSPCHK", 0x20, 0x20 }, + { "RESET_SCSI", 0x40, 0x40 }, + { "TERM_ENB", 0x80, 0x80 }, + { "HSCSIID", 0x07, 0x07 }, + { "HWSCSIID", 0x0f, 0x0f } +}; + +int +ahc_scsiconf_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SCSICONF_parse_table, 5, "SCSICONF", + 0x5a, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t INTDEF_parse_table[] = { + { "EDGE_TRIG", 0x80, 0x80 }, + { "VECTOR", 0x0f, 0x0f } +}; + +int +ahc_intdef_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(INTDEF_parse_table, 2, "INTDEF", + 0x5c, regvalue, cur_col, wrap)); +} + +int +ahc_hostconf_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "HOSTCONF", + 0x5d, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t HA_274_BIOSCTRL_parse_table[] = { + { "CHANNEL_B_PRIMARY", 0x08, 0x08 }, + { "BIOSMODE", 0x30, 0x30 }, + { "BIOSDISABLED", 0x30, 0x30 } +}; + +int +ahc_ha_274_biosctrl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(HA_274_BIOSCTRL_parse_table, 3, "HA_274_BIOSCTRL", + 0x5f, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SEQCTL_parse_table[] = { + { "LOADRAM", 0x01, 0x01 }, + { "SEQRESET", 0x02, 0x02 }, + { "STEP", 0x04, 0x04 }, + { "BRKADRINTEN", 0x08, 0x08 }, + { "FASTMODE", 0x10, 0x10 }, + { "FAILDIS", 0x20, 0x20 }, + { "PAUSEDIS", 0x40, 0x40 }, + { "PERRORDIS", 0x80, 0x80 } +}; + +int +ahc_seqctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SEQCTL_parse_table, 8, "SEQCTL", + 0x60, regvalue, cur_col, wrap)); +} + +int +ahc_seqram_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SEQRAM", + 0x61, regvalue, cur_col, wrap)); +} + +int +ahc_seqaddr0_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SEQADDR0", + 0x62, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SEQADDR1_parse_table[] = { + { "SEQADDR1_MASK", 0x01, 0x01 } +}; + +int +ahc_seqaddr1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SEQADDR1_parse_table, 1, "SEQADDR1", + 0x63, regvalue, cur_col, wrap)); +} + +int +ahc_accum_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "ACCUM", + 0x64, regvalue, cur_col, wrap)); +} + +int +ahc_sindex_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SINDEX", + 0x65, regvalue, cur_col, wrap)); +} + +int +ahc_dindex_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "DINDEX", + 0x66, regvalue, cur_col, wrap)); +} + +int +ahc_allones_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "ALLONES", + 0x69, regvalue, cur_col, wrap)); +} + +int +ahc_allzeros_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "ALLZEROS", + 0x6a, regvalue, cur_col, wrap)); +} + +int +ahc_none_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "NONE", + 0x6a, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t FLAGS_parse_table[] = { + { "CARRY", 0x01, 0x01 }, + { "ZERO", 0x02, 0x02 } +}; + +int +ahc_flags_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(FLAGS_parse_table, 2, "FLAGS", + 0x6b, regvalue, cur_col, wrap)); +} + +int +ahc_sindir_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SINDIR", + 0x6c, regvalue, cur_col, wrap)); +} + +int +ahc_dindir_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "DINDIR", + 0x6d, regvalue, cur_col, wrap)); +} + +int +ahc_stack_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "STACK", + 0x6f, regvalue, cur_col, wrap)); +} + +int +ahc_targ_offset_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "TARG_OFFSET", + 0x70, regvalue, cur_col, wrap)); +} + +int +ahc_sram_base_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SRAM_BASE", + 0x70, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t DSCOMMAND0_parse_table[] = { + { "CIOPARCKEN", 0x01, 0x01 }, + { "USCBSIZE32", 0x02, 0x02 }, + { "RAMPS", 0x04, 0x04 }, + { "INTSCBRAMSEL", 0x08, 0x08 }, + { "EXTREQLCK", 0x10, 0x10 }, + { "MPARCKEN", 0x20, 0x20 }, + { "DPARCKEN", 0x40, 0x40 }, + { "CACHETHEN", 0x80, 0x80 } +}; + +int +ahc_dscommand0_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(DSCOMMAND0_parse_table, 8, "DSCOMMAND0", + 0x84, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t BUSTIME_parse_table[] = { + { "BON", 0x0f, 0x0f }, + { "BOFF", 0xf0, 0xf0 } +}; + +int +ahc_bustime_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(BUSTIME_parse_table, 2, "BUSTIME", + 0x85, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t DSCOMMAND1_parse_table[] = { + { "HADDLDSEL0", 0x01, 0x01 }, + { "HADDLDSEL1", 0x02, 0x02 }, + { "DSLATT", 0xfc, 0xfc } +}; + +int +ahc_dscommand1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(DSCOMMAND1_parse_table, 3, "DSCOMMAND1", + 0x85, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t BUSSPD_parse_table[] = { + { "STBON", 0x07, 0x07 }, + { "STBOFF", 0x38, 0x38 }, + { "DFTHRSH_75", 0x80, 0x80 }, + { "DFTHRSH", 0xc0, 0xc0 }, + { "DFTHRSH_100", 0xc0, 0xc0 } +}; + +int +ahc_busspd_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(BUSSPD_parse_table, 5, "BUSSPD", + 0x86, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t HS_MAILBOX_parse_table[] = { + { "SEQ_MAILBOX", 0x0f, 0x0f }, + { "HOST_TQINPOS", 0x80, 0x80 }, + { "HOST_MAILBOX", 0xf0, 0xf0 } +}; + +int +ahc_hs_mailbox_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(HS_MAILBOX_parse_table, 3, "HS_MAILBOX", + 0x86, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t DSPCISTATUS_parse_table[] = { + { "DFTHRSH_100", 0xc0, 0xc0 } +}; + +int +ahc_dspcistatus_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(DSPCISTATUS_parse_table, 1, "DSPCISTATUS", + 0x86, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t HCNTRL_parse_table[] = { + { "CHIPRST", 0x01, 0x01 }, + { "CHIPRSTACK", 0x01, 0x01 }, + { "INTEN", 0x02, 0x02 }, + { "PAUSE", 0x04, 0x04 }, + { "IRQMS", 0x08, 0x08 }, + { "SWINT", 0x10, 0x10 }, + { "POWRDN", 0x40, 0x40 } +}; + +int +ahc_hcntrl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(HCNTRL_parse_table, 7, "HCNTRL", + 0x87, regvalue, cur_col, wrap)); +} + +int +ahc_haddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "HADDR", + 0x88, regvalue, cur_col, wrap)); +} + +int +ahc_hcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "HCNT", + 0x8c, regvalue, cur_col, wrap)); +} + +int +ahc_scbptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCBPTR", + 0x90, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t INTSTAT_parse_table[] = { + { "SEQINT", 0x01, 0x01 }, + { "CMDCMPLT", 0x02, 0x02 }, + { "SCSIINT", 0x04, 0x04 }, + { "BRKADRINT", 0x08, 0x08 }, + { "BAD_PHASE", 0x01, 0x01 }, + { "INT_PEND", 0x0f, 0x0f }, + { "SEND_REJECT", 0x11, 0x11 }, + { "PROTO_VIOLATION", 0x21, 0x21 }, + { "NO_MATCH", 0x31, 0x31 }, + { "IGN_WIDE_RES", 0x41, 0x41 }, + { "PDATA_REINIT", 0x51, 0x51 }, + { "HOST_MSG_LOOP", 0x61, 0x61 }, + { "BAD_STATUS", 0x71, 0x71 }, + { "PERR_DETECTED", 0x81, 0x81 }, + { "DATA_OVERRUN", 0x91, 0x91 }, + { "MKMSG_FAILED", 0xa1, 0xa1 }, + { "MISSED_BUSFREE", 0xb1, 0xb1 }, + { "SCB_MISMATCH", 0xc1, 0xc1 }, + { "NO_FREE_SCB", 0xd1, 0xd1 }, + { "OUT_OF_RANGE", 0xe1, 0xe1 }, + { "SEQINT_MASK", 0xf1, 0xf1 } +}; + +int +ahc_intstat_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(INTSTAT_parse_table, 21, "INTSTAT", + 0x91, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t CLRINT_parse_table[] = { + { "CLRSEQINT", 0x01, 0x01 }, + { "CLRCMDINT", 0x02, 0x02 }, + { "CLRSCSIINT", 0x04, 0x04 }, + { "CLRBRKADRINT", 0x08, 0x08 }, + { "CLRPARERR", 0x10, 0x10 } +}; + +int +ahc_clrint_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(CLRINT_parse_table, 5, "CLRINT", + 0x92, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t ERROR_parse_table[] = { + { "ILLHADDR", 0x01, 0x01 }, + { "ILLSADDR", 0x02, 0x02 }, + { "ILLOPCODE", 0x04, 0x04 }, + { "SQPARERR", 0x08, 0x08 }, + { "DPARERR", 0x10, 0x10 }, + { "MPARERR", 0x20, 0x20 }, + { "PCIERRSTAT", 0x40, 0x40 }, + { "CIOPARERR", 0x80, 0x80 } +}; + +int +ahc_error_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(ERROR_parse_table, 8, "ERROR", + 0x92, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t DFCNTRL_parse_table[] = { + { "FIFORESET", 0x01, 0x01 }, + { "FIFOFLUSH", 0x02, 0x02 }, + { "DIRECTION", 0x04, 0x04 }, + { "HDMAEN", 0x08, 0x08 }, + { "HDMAENACK", 0x08, 0x08 }, + { "SDMAEN", 0x10, 0x10 }, + { "SDMAENACK", 0x10, 0x10 }, + { "SCSIEN", 0x20, 0x20 }, + { "WIDEODD", 0x40, 0x40 }, + { "PRELOADEN", 0x80, 0x80 } +}; + +int +ahc_dfcntrl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(DFCNTRL_parse_table, 10, "DFCNTRL", + 0x93, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t DFSTATUS_parse_table[] = { + { "FIFOEMP", 0x01, 0x01 }, + { "FIFOFULL", 0x02, 0x02 }, + { "DFTHRESH", 0x04, 0x04 }, + { "HDONE", 0x08, 0x08 }, + { "MREQPEND", 0x10, 0x10 }, + { "FIFOQWDEMP", 0x20, 0x20 }, + { "DFCACHETH", 0x40, 0x40 }, + { "PRELOAD_AVAIL", 0x80, 0x80 } +}; + +int +ahc_dfstatus_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(DFSTATUS_parse_table, 8, "DFSTATUS", + 0x94, regvalue, cur_col, wrap)); +} + +int +ahc_dfwaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "DFWADDR", + 0x95, regvalue, cur_col, wrap)); +} + +int +ahc_dfdat_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "DFDAT", + 0x99, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SCBCNT_parse_table[] = { + { "SCBAUTO", 0x80, 0x80 }, + { "SCBCNT_MASK", 0x1f, 0x1f } +}; + +int +ahc_scbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SCBCNT_parse_table, 2, "SCBCNT", + 0x9a, regvalue, cur_col, wrap)); +} + +int +ahc_qinfifo_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "QINFIFO", + 0x9b, regvalue, cur_col, wrap)); +} + +int +ahc_qoutfifo_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "QOUTFIFO", + 0x9d, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t CRCCONTROL1_parse_table[] = { + { "TARGCRCCNTEN", 0x04, 0x04 }, + { "TARGCRCENDEN", 0x08, 0x08 }, + { "CRCREQCHKEN", 0x10, 0x10 }, + { "CRCENDCHKEN", 0x20, 0x20 }, + { "CRCVALCHKEN", 0x40, 0x40 }, + { "CRCONSEEN", 0x80, 0x80 } +}; + +int +ahc_crccontrol1_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(CRCCONTROL1_parse_table, 6, "CRCCONTROL1", + 0x9d, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SCSIPHASE_parse_table[] = { + { "DATA_OUT_PHASE", 0x01, 0x01 }, + { "DATA_IN_PHASE", 0x02, 0x02 }, + { "MSG_OUT_PHASE", 0x04, 0x04 }, + { "MSG_IN_PHASE", 0x08, 0x08 }, + { "COMMAND_PHASE", 0x10, 0x10 }, + { "STATUS_PHASE", 0x20, 0x20 }, + { "DATA_PHASE_MASK", 0x03, 0x03 } +}; + +int +ahc_scsiphase_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SCSIPHASE_parse_table, 7, "SCSIPHASE", + 0x9e, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SFUNCT_parse_table[] = { + { "ALT_MODE", 0x80, 0x80 } +}; + +int +ahc_sfunct_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SFUNCT_parse_table, 1, "SFUNCT", + 0x9f, regvalue, cur_col, wrap)); +} + +int +ahc_scb_base_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_BASE", + 0xa0, regvalue, cur_col, wrap)); +} + +int +ahc_scb_cdb_ptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_CDB_PTR", + 0xa0, regvalue, cur_col, wrap)); +} + +int +ahc_scb_residual_sgptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_RESIDUAL_SGPTR", + 0xa4, regvalue, cur_col, wrap)); +} + +int +ahc_scb_scsi_status_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_SCSI_STATUS", + 0xa8, regvalue, cur_col, wrap)); +} + +int +ahc_scb_target_phases_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_TARGET_PHASES", + 0xa9, regvalue, cur_col, wrap)); +} + +int +ahc_scb_target_data_dir_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_TARGET_DATA_DIR", + 0xaa, regvalue, cur_col, wrap)); +} + +int +ahc_scb_target_itag_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_TARGET_ITAG", + 0xab, regvalue, cur_col, wrap)); +} + +int +ahc_scb_dataptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_DATAPTR", + 0xac, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SCB_DATACNT_parse_table[] = { + { "SG_LAST_SEG", 0x80, 0x80 }, + { "SG_HIGH_ADDR_BITS", 0x7f, 0x7f } +}; + +int +ahc_scb_datacnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SCB_DATACNT_parse_table, 2, "SCB_DATACNT", + 0xb0, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SCB_SGPTR_parse_table[] = { + { "SG_LIST_NULL", 0x01, 0x01 }, + { "SG_FULL_RESID", 0x02, 0x02 }, + { "SG_RESID_VALID", 0x04, 0x04 } +}; + +int +ahc_scb_sgptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SCB_SGPTR_parse_table, 3, "SCB_SGPTR", + 0xb4, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SCB_CONTROL_parse_table[] = { + { "DISCONNECTED", 0x04, 0x04 }, + { "ULTRAENB", 0x08, 0x08 }, + { "MK_MESSAGE", 0x10, 0x10 }, + { "TAG_ENB", 0x20, 0x20 }, + { "DISCENB", 0x40, 0x40 }, + { "TARGET_SCB", 0x80, 0x80 }, + { "STATUS_RCVD", 0x80, 0x80 }, + { "SCB_TAG_TYPE", 0x03, 0x03 } +}; + +int +ahc_scb_control_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SCB_CONTROL_parse_table, 8, "SCB_CONTROL", + 0xb8, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SCB_SCSIID_parse_table[] = { + { "TWIN_CHNLB", 0x80, 0x80 }, + { "OID", 0x0f, 0x0f }, + { "TWIN_TID", 0x70, 0x70 }, + { "TID", 0xf0, 0xf0 } }; int @@ -411,3 +1331,248 @@ ahc_scb_tag_print(u_int regvalue, u_int *cur_col, u_int wrap) 0xbb, regvalue, cur_col, wrap)); } +int +ahc_scb_cdb_len_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_CDB_LEN", + 0xbc, regvalue, cur_col, wrap)); +} + +int +ahc_scb_scsirate_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_SCSIRATE", + 0xbd, regvalue, cur_col, wrap)); +} + +int +ahc_scb_scsioffset_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_SCSIOFFSET", + 0xbe, regvalue, cur_col, wrap)); +} + +int +ahc_scb_next_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_NEXT", + 0xbf, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SEECTL_2840_parse_table[] = { + { "DO_2840", 0x01, 0x01 }, + { "CK_2840", 0x02, 0x02 }, + { "CS_2840", 0x04, 0x04 } +}; + +int +ahc_seectl_2840_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SEECTL_2840_parse_table, 3, "SEECTL_2840", + 0xc0, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t STATUS_2840_parse_table[] = { + { "DI_2840", 0x01, 0x01 }, + { "EEPROM_TF", 0x80, 0x80 }, + { "ADSEL", 0x1e, 0x1e }, + { "BIOS_SEL", 0x60, 0x60 } +}; + +int +ahc_status_2840_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(STATUS_2840_parse_table, 4, "STATUS_2840", + 0xc1, regvalue, cur_col, wrap)); +} + +int +ahc_scb_64_btt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCB_64_BTT", + 0xd0, regvalue, cur_col, wrap)); +} + +int +ahc_cchaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "CCHADDR", + 0xe0, regvalue, cur_col, wrap)); +} + +int +ahc_cchcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "CCHCNT", + 0xe8, regvalue, cur_col, wrap)); +} + +int +ahc_ccsgram_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "CCSGRAM", + 0xe9, regvalue, cur_col, wrap)); +} + +int +ahc_ccsgaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "CCSGADDR", + 0xea, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t CCSGCTL_parse_table[] = { + { "CCSGRESET", 0x01, 0x01 }, + { "SG_FETCH_NEEDED", 0x02, 0x02 }, + { "CCSGEN", 0x08, 0x08 }, + { "CCSGDONE", 0x80, 0x80 } +}; + +int +ahc_ccsgctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(CCSGCTL_parse_table, 4, "CCSGCTL", + 0xeb, regvalue, cur_col, wrap)); +} + +int +ahc_ccscbram_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "CCSCBRAM", + 0xec, regvalue, cur_col, wrap)); +} + +int +ahc_ccscbaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "CCSCBADDR", + 0xed, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t CCSCBCTL_parse_table[] = { + { "CCSCBRESET", 0x01, 0x01 }, + { "CCSCBDIR", 0x04, 0x04 }, + { "CCSCBEN", 0x08, 0x08 }, + { "CCARREN", 0x10, 0x10 }, + { "ARRDONE", 0x40, 0x40 }, + { "CCSCBDONE", 0x80, 0x80 } +}; + +int +ahc_ccscbctl_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(CCSCBCTL_parse_table, 6, "CCSCBCTL", + 0xee, regvalue, cur_col, wrap)); +} + +int +ahc_ccscbcnt_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "CCSCBCNT", + 0xef, regvalue, cur_col, wrap)); +} + +int +ahc_scbbaddr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SCBBADDR", + 0xf0, regvalue, cur_col, wrap)); +} + +int +ahc_ccscbptr_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "CCSCBPTR", + 0xf1, regvalue, cur_col, wrap)); +} + +int +ahc_hnscb_qoff_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "HNSCB_QOFF", + 0xf4, regvalue, cur_col, wrap)); +} + +int +ahc_snscb_qoff_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SNSCB_QOFF", + 0xf6, regvalue, cur_col, wrap)); +} + +int +ahc_sdscb_qoff_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(NULL, 0, "SDSCB_QOFF", + 0xf8, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t QOFF_CTLSTA_parse_table[] = { + { "SDSCB_ROLLOVER", 0x10, 0x10 }, + { "SNSCB_ROLLOVER", 0x20, 0x20 }, + { "SCB_AVAIL", 0x40, 0x40 }, + { "SCB_QSIZE_256", 0x06, 0x06 }, + { "SCB_QSIZE", 0x07, 0x07 } +}; + +int +ahc_qoff_ctlsta_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(QOFF_CTLSTA_parse_table, 5, "QOFF_CTLSTA", + 0xfa, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t DFF_THRSH_parse_table[] = { + { "RD_DFTHRSH_MIN", 0x00, 0x00 }, + { "WR_DFTHRSH_MIN", 0x00, 0x00 }, + { "RD_DFTHRSH_25", 0x01, 0x01 }, + { "RD_DFTHRSH_50", 0x02, 0x02 }, + { "RD_DFTHRSH_63", 0x03, 0x03 }, + { "RD_DFTHRSH_75", 0x04, 0x04 }, + { "RD_DFTHRSH_85", 0x05, 0x05 }, + { "RD_DFTHRSH_90", 0x06, 0x06 }, + { "RD_DFTHRSH", 0x07, 0x07 }, + { "RD_DFTHRSH_MAX", 0x07, 0x07 }, + { "WR_DFTHRSH_25", 0x10, 0x10 }, + { "WR_DFTHRSH_50", 0x20, 0x20 }, + { "WR_DFTHRSH_63", 0x30, 0x30 }, + { "WR_DFTHRSH_75", 0x40, 0x40 }, + { "WR_DFTHRSH_85", 0x50, 0x50 }, + { "WR_DFTHRSH_90", 0x60, 0x60 }, + { "WR_DFTHRSH", 0x70, 0x70 }, + { "WR_DFTHRSH_MAX", 0x70, 0x70 } +}; + +int +ahc_dff_thrsh_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(DFF_THRSH_parse_table, 18, "DFF_THRSH", + 0xfb, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SG_CACHE_SHADOW_parse_table[] = { + { "LAST_SEG_DONE", 0x01, 0x01 }, + { "LAST_SEG", 0x02, 0x02 }, + { "SG_ADDR_MASK", 0xf8, 0xf8 } +}; + +int +ahc_sg_cache_shadow_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SG_CACHE_SHADOW_parse_table, 3, "SG_CACHE_SHADOW", + 0xfc, regvalue, cur_col, wrap)); +} + +static const ahc_reg_parse_entry_t SG_CACHE_PRE_parse_table[] = { + { "LAST_SEG_DONE", 0x01, 0x01 }, + { "LAST_SEG", 0x02, 0x02 }, + { "SG_ADDR_MASK", 0xf8, 0xf8 } +}; + +int +ahc_sg_cache_pre_print(u_int regvalue, u_int *cur_col, u_int wrap) +{ + return (ahc_print_register(SG_CACHE_PRE_parse_table, 3, "SG_CACHE_PRE", + 0xfc, regvalue, cur_col, wrap)); +} + diff --git a/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y b/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y index e4064433842e..81be6a261cc8 100644 --- a/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y +++ b/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_gram.y @@ -147,8 +147,6 @@ void yyerror(const char *string); %token T_ACCESS_MODE -%token T_DONT_GENERATE_DEBUG_CODE - %token T_MODES %token T_DEFINE @@ -359,7 +357,6 @@ reg_attribute: | size | count | access_mode -| dont_generate_debug_code | modes | field_defn | enum_defn @@ -413,13 +410,6 @@ access_mode: } ; -dont_generate_debug_code: - T_DONT_GENERATE_DEBUG_CODE - { - cur_symbol->dont_generate_debug_code = 1; - } -; - modes: T_MODES mode_list { diff --git a/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l b/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l index 93c8667cd704..2c7f02daf88d 100644 --- a/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l +++ b/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_scan.l @@ -164,7 +164,6 @@ download { return T_DOWNLOAD; } address { return T_ADDRESS; } count { return T_COUNT; } access_mode { return T_ACCESS_MODE; } -dont_generate_debug_code { return T_DONT_GENERATE_DEBUG_CODE; } modes { return T_MODES; } RW|RO|WO { if (strcmp(yytext, "RW") == 0) diff --git a/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c b/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c index 078ed600f47a..fcd357872b43 100644 --- a/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c +++ b/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.c @@ -539,9 +539,6 @@ symtable_dump(FILE *ofile, FILE *dfile) aic_print_include(dfile, stock_include_file); SLIST_FOREACH(curnode, ®isters, links) { - if (curnode->symbol->dont_generate_debug_code) - continue; - switch(curnode->symbol->type) { case REGISTER: case SCBLOC: diff --git a/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h b/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h index 2ba73ae7c777..05190c1a2fb7 100644 --- a/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h +++ b/trunk/drivers/scsi/aic7xxx/aicasm/aicasm_symbol.h @@ -137,8 +137,7 @@ typedef struct symbol { struct label_info *linfo; struct cond_info *condinfo; struct macro_info *macroinfo; - } info; - int dont_generate_debug_code; + }info; } symbol_t; typedef struct symbol_ref { diff --git a/trunk/drivers/scsi/device_handler/scsi_dh_rdac.c b/trunk/drivers/scsi/device_handler/scsi_dh_rdac.c index 3d50cabca7ee..a43c3ed4df28 100644 --- a/trunk/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/trunk/drivers/scsi/device_handler/scsi_dh_rdac.c @@ -401,9 +401,6 @@ static int check_ownership(struct scsi_device *sdev, struct rdac_dh_data *h) } } - if (h->lun_state == RDAC_LUN_UNOWNED) - h->state = RDAC_STATE_PASSIVE; - return err; } diff --git a/trunk/drivers/scsi/ipr.c b/trunk/drivers/scsi/ipr.c index ded854a6dd35..098739deb02e 100644 --- a/trunk/drivers/scsi/ipr.c +++ b/trunk/drivers/scsi/ipr.c @@ -2456,14 +2456,20 @@ static ssize_t ipr_read_trace(struct kobject *kobj, struct Scsi_Host *shost = class_to_shost(dev); struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *)shost->hostdata; unsigned long lock_flags = 0; - ssize_t ret; + int size = IPR_TRACE_SIZE; + char *src = (char *)ioa_cfg->trace; + + if (off > size) + return 0; + if (off + count > size) { + size -= off; + count = size; + } spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); - ret = memory_read_from_buffer(buf, count, &off, ioa_cfg->trace, - IPR_TRACE_SIZE); + memcpy(buf, &src[off], count); spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); - - return ret; + return count; } static struct bin_attribute ipr_trace_attr = { diff --git a/trunk/drivers/scsi/scsi_lib.c b/trunk/drivers/scsi/scsi_lib.c index f5d3b96890dc..e5a9526d2037 100644 --- a/trunk/drivers/scsi/scsi_lib.c +++ b/trunk/drivers/scsi/scsi_lib.c @@ -529,14 +529,6 @@ static void scsi_single_lun_run(struct scsi_device *current_sdev) spin_unlock_irqrestore(shost->host_lock, flags); } -static inline int scsi_device_is_busy(struct scsi_device *sdev) -{ - if (sdev->device_busy >= sdev->queue_depth || sdev->device_blocked) - return 1; - - return 0; -} - static inline int scsi_target_is_busy(struct scsi_target *starget) { return ((starget->can_queue > 0 && @@ -544,15 +536,6 @@ static inline int scsi_target_is_busy(struct scsi_target *starget) starget->target_blocked); } -static inline int scsi_host_is_busy(struct Scsi_Host *shost) -{ - if ((shost->can_queue > 0 && shost->host_busy >= shost->can_queue) || - shost->host_blocked || shost->host_self_blocked) - return 1; - - return 0; -} - /* * Function: scsi_run_queue() * @@ -575,7 +558,11 @@ static void scsi_run_queue(struct request_queue *q) scsi_single_lun_run(sdev); spin_lock_irqsave(shost->host_lock, flags); - while (!list_empty(&shost->starved_list) && !scsi_host_is_busy(shost)) { + while (!list_empty(&shost->starved_list) && + !shost->host_blocked && !shost->host_self_blocked && + !((shost->can_queue > 0) && + (shost->host_busy >= shost->can_queue))) { + int flagset; /* @@ -1361,6 +1348,8 @@ int scsi_prep_fn(struct request_queue *q, struct request *req) static inline int scsi_dev_queue_ready(struct request_queue *q, struct scsi_device *sdev) { + if (sdev->device_busy >= sdev->queue_depth) + return 0; if (sdev->device_busy == 0 && sdev->device_blocked) { /* * unblock after device_blocked iterates to zero @@ -1374,7 +1363,7 @@ static inline int scsi_dev_queue_ready(struct request_queue *q, return 0; } } - if (scsi_device_is_busy(sdev)) + if (sdev->device_blocked) return 0; return 1; @@ -1451,7 +1440,8 @@ static inline int scsi_host_queue_ready(struct request_queue *q, return 0; } } - if (scsi_host_is_busy(shost)) { + if ((shost->can_queue > 0 && shost->host_busy >= shost->can_queue) || + shost->host_blocked || shost->host_self_blocked) { if (list_empty(&sdev->starved_entry)) list_add_tail(&sdev->starved_entry, &shost->starved_list); return 0; @@ -1464,37 +1454,6 @@ static inline int scsi_host_queue_ready(struct request_queue *q, return 1; } -/* - * Busy state exporting function for request stacking drivers. - * - * For efficiency, no lock is taken to check the busy state of - * shost/starget/sdev, since the returned value is not guaranteed and - * may be changed after request stacking drivers call the function, - * regardless of taking lock or not. - * - * When scsi can't dispatch I/Os anymore and needs to kill I/Os - * (e.g. !sdev), scsi needs to return 'not busy'. - * Otherwise, request stacking drivers may hold requests forever. - */ -static int scsi_lld_busy(struct request_queue *q) -{ - struct scsi_device *sdev = q->queuedata; - struct Scsi_Host *shost; - struct scsi_target *starget; - - if (!sdev) - return 0; - - shost = sdev->host; - starget = scsi_target(sdev); - - if (scsi_host_in_recovery(shost) || scsi_host_is_busy(shost) || - scsi_target_is_busy(starget) || scsi_device_is_busy(sdev)) - return 1; - - return 0; -} - /* * Kill a request for a dead device */ @@ -1798,7 +1757,6 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev) blk_queue_prep_rq(q, scsi_prep_fn); blk_queue_softirq_done(q, scsi_softirq_done); blk_queue_rq_timed_out(q, scsi_times_out); - blk_queue_lld_busy(q, scsi_lld_busy); return q; } @@ -2147,21 +2105,22 @@ scsi_test_unit_ready(struct scsi_device *sdev, int timeout, int retries, do { result = scsi_execute_req(sdev, cmd, DMA_NONE, NULL, 0, sshdr, timeout, retries); - if (sdev->removable && scsi_sense_valid(sshdr) && - sshdr->sense_key == UNIT_ATTENTION) - sdev->changed = 1; - } while (scsi_sense_valid(sshdr) && - sshdr->sense_key == UNIT_ATTENTION && --retries); + } while ((driver_byte(result) & DRIVER_SENSE) && + sshdr && sshdr->sense_key == UNIT_ATTENTION && + --retries); if (!sshdr) /* could not allocate sense buffer, so can't process it */ return result; - if (sdev->removable && scsi_sense_valid(sshdr) && - (sshdr->sense_key == UNIT_ATTENTION || - sshdr->sense_key == NOT_READY)) { - sdev->changed = 1; - result = 0; + if ((driver_byte(result) & DRIVER_SENSE) && sdev->removable) { + + if ((scsi_sense_valid(sshdr)) && + ((sshdr->sense_key == UNIT_ATTENTION) || + (sshdr->sense_key == NOT_READY))) { + sdev->changed = 1; + result = 0; + } } if (!sshdr_external) kfree(sshdr); diff --git a/trunk/drivers/scsi/scsi_netlink.c b/trunk/drivers/scsi/scsi_netlink.c index 723fdecd91bd..b37e133de805 100644 --- a/trunk/drivers/scsi/scsi_netlink.c +++ b/trunk/drivers/scsi/scsi_netlink.c @@ -205,13 +205,16 @@ static struct notifier_block scsi_netlink_notifier = { }; -/* +/** * GENERIC SCSI transport receive and event handlers - */ + **/ /** - * scsi_generic_msg_handler - receive message handler for GENERIC transport messages + * scsi_generic_msg_handler - receive message handler for GENERIC transport + * messages + * * @skb: socket receive buffer + * **/ static int scsi_generic_msg_handler(struct sk_buff *skb) diff --git a/trunk/drivers/scsi/sd.c b/trunk/drivers/scsi/sd.c index c9e1242eaf25..43f34c73df12 100644 --- a/trunk/drivers/scsi/sd.c +++ b/trunk/drivers/scsi/sd.c @@ -1049,6 +1049,7 @@ static int sd_done(struct scsi_cmnd *SCpnt) good_bytes = sd_completed_bytes(SCpnt); break; case RECOVERED_ERROR: + case NO_SENSE: /* Inform the user, but make sure that it's not treated * as a hard error. */ @@ -1057,15 +1058,6 @@ static int sd_done(struct scsi_cmnd *SCpnt) memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); good_bytes = scsi_bufflen(SCpnt); break; - case NO_SENSE: - /* This indicates a false check condition, so ignore it. An - * unknown amount of data was transferred so treat it as an - * error. - */ - scsi_print_sense("sd", SCpnt); - SCpnt->result = 0; - memset(SCpnt->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); - break; case ABORTED_COMMAND: if (sshdr.asc == 0x10) { /* DIF: Disk detected corruption */ scsi_print_result(SCpnt); @@ -1079,6 +1071,15 @@ static int sd_done(struct scsi_cmnd *SCpnt) scsi_print_sense("sd", SCpnt); good_bytes = sd_completed_bytes(SCpnt); } + if (!scsi_device_protection(SCpnt->device) && + SCpnt->device->use_10_for_rw && + (SCpnt->cmnd[0] == READ_10 || + SCpnt->cmnd[0] == WRITE_10)) + SCpnt->device->use_10_for_rw = 0; + if (SCpnt->device->use_10_for_ms && + (SCpnt->cmnd[0] == MODE_SENSE_10 || + SCpnt->cmnd[0] == MODE_SELECT_10)) + SCpnt->device->use_10_for_ms = 0; break; default: break; @@ -1431,7 +1432,7 @@ sd_read_capacity(struct scsi_disk *sdkp, unsigned char *buffer) { char cap_str_2[10], cap_str_10[10]; - u64 sz = (u64)sdkp->capacity << ilog2(sector_size); + u64 sz = sdkp->capacity << ffz(~sector_size); string_get_size(sz, STRING_UNITS_2, cap_str_2, sizeof(cap_str_2)); diff --git a/trunk/drivers/scsi/sun3x_esp.c b/trunk/drivers/scsi/sun3x_esp.c index 34a99620e5bd..7514b3a0390e 100644 --- a/trunk/drivers/scsi/sun3x_esp.c +++ b/trunk/drivers/scsi/sun3x_esp.c @@ -213,7 +213,7 @@ static int __devinit esp_sun3x_probe(struct platform_device *dev) esp->ops = &sun3x_esp_ops; res = platform_get_resource(dev, IORESOURCE_MEM, 0); - if (!res || !res->start) + if (!res && !res->start) goto fail_unlink; esp->regs = ioremap_nocache(res->start, 0x20); @@ -221,7 +221,7 @@ static int __devinit esp_sun3x_probe(struct platform_device *dev) goto fail_unmap_regs; res = platform_get_resource(dev, IORESOURCE_MEM, 1); - if (!res || !res->start) + if (!res && !res->start) goto fail_unmap_regs; esp->dma_regs = ioremap_nocache(res->start, 0x10); diff --git a/trunk/drivers/staging/Kconfig b/trunk/drivers/staging/Kconfig index c4eff44c9f27..e1654f59eb70 100644 --- a/trunk/drivers/staging/Kconfig +++ b/trunk/drivers/staging/Kconfig @@ -43,8 +43,6 @@ source "drivers/staging/echo/Kconfig" source "drivers/staging/at76_usb/Kconfig" -source "drivers/staging/pcc-acpi/Kconfig" - source "drivers/staging/poch/Kconfig" endif # STAGING diff --git a/trunk/drivers/staging/Makefile b/trunk/drivers/staging/Makefile index 7cb8701d96d4..71c4d53760b8 100644 --- a/trunk/drivers/staging/Makefile +++ b/trunk/drivers/staging/Makefile @@ -13,5 +13,4 @@ obj-$(CONFIG_W35UND) += winbond/ obj-$(CONFIG_PRISM2_USB) += wlan-ng/ obj-$(CONFIG_ECHO) += echo/ obj-$(CONFIG_USB_ATMEL) += at76_usb/ -obj-$(CONFIG_PCC_ACPI) += pcc-acpi/ obj-$(CONFIG_POCH) += poch/ diff --git a/trunk/drivers/staging/pcc-acpi/Kconfig b/trunk/drivers/staging/pcc-acpi/Kconfig deleted file mode 100644 index 6720d4086baf..000000000000 --- a/trunk/drivers/staging/pcc-acpi/Kconfig +++ /dev/null @@ -1,11 +0,0 @@ -config PCC_ACPI - tristate "Panasonic ACPI Hotkey support" - depends on ACPI - default n - ---help--- - This driver provides support for Panasonic hotkeys through the - ACPI interface. This works for the Panasonic R1 (N variant), - R2, R3, T2, W2, and Y2 laptops. - - To compile this driver as a module, choose M here. The module - will be called pcc-acpi. diff --git a/trunk/drivers/staging/pcc-acpi/Makefile b/trunk/drivers/staging/pcc-acpi/Makefile deleted file mode 100644 index f93b29edf61e..000000000000 --- a/trunk/drivers/staging/pcc-acpi/Makefile +++ /dev/null @@ -1 +0,0 @@ -obj-$(CONFIG_PCC_ACPI) += pcc-acpi.o diff --git a/trunk/drivers/staging/pcc-acpi/TODO b/trunk/drivers/staging/pcc-acpi/TODO deleted file mode 100644 index fab240982286..000000000000 --- a/trunk/drivers/staging/pcc-acpi/TODO +++ /dev/null @@ -1,7 +0,0 @@ -TODO: - - Lindent fixes - - checkpatch.pl fixes - - verify that the acpi interface is correct - - remove /proc dependancy if needed (not sure yet.) - -Please send any patches for this driver to Greg Kroah-Hartman diff --git a/trunk/drivers/staging/pcc-acpi/pcc-acpi.c b/trunk/drivers/staging/pcc-acpi/pcc-acpi.c deleted file mode 100644 index 3b34a3e4885a..000000000000 --- a/trunk/drivers/staging/pcc-acpi/pcc-acpi.c +++ /dev/null @@ -1,1111 +0,0 @@ -/* - * Panasonic HotKey and lcd brightness control Extra driver - * (C) 2004 Hiroshi Miura - * (C) 2004 NTT DATA Intellilink Co. http://www.intellilink.co.jp/ - * (C) YOKOTA Hiroshi - * (C) 2004 David Bronaugh - * - * derived from toshiba_acpi.c, Copyright (C) 2002-2004 John Belmonte - * - * 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 - * publicshed 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 - * - *--------------------------------------------------------------------------- - * - * ChangeLog: - * - * Nov.04, 2006 Hiroshi Miura - * -v0.9 remove warning about section reference. - * remove acpi_os_free - * add /proc/acpi/pcc/brightness interface to - * allow HAL to access. - * merge dbronaugh's enhancement - * Aug.17, 2004 David Bronaugh (dbronaugh) - * - Added screen brightness setting interface - * Thanks to the FreeBSD crew - * (acpi_panasonic.c authors) - * for the ideas I needed to accomplish it - * - * May.29, 2006 Hiroshi Miura - * -v0.8.4 follow to change keyinput structure - * thanks Fabian Yamaguchi , - * Jacob Bower and - * Hiroshi Yokota for providing solutions. - * - * Oct.02, 2004 Hiroshi Miura - * -v0.8.2 merge code of YOKOTA Hiroshi - * . - * Add sticky key mode interface. - * Refactoring acpi_pcc_generete_keyinput(). - * - * Sep.15, 2004 Hiroshi Miura - * -v0.8 Generate key input event on input subsystem. - * This is based on yet another driver - * written by Ryuta Nakanishi. - * - * Sep.10, 2004 Hiroshi Miura - * -v0.7 Change proc interface functions using seq_file - * facility as same as other ACPI drivers. - * - * Aug.28, 2004 Hiroshi Miura - * -v0.6.4 Fix a silly error with status checking - * - * Aug.25, 2004 Hiroshi Miura - * -v0.6.3 replace read_acpi_int by standard - * function acpi_evaluate_integer - * some clean up and make smart copyright notice. - * fix return value of pcc_acpi_get_key() - * fix checking return value of acpi_bus_register_driver() - * - * Aug.22, 2004 David Bronaugh - * -v0.6.2 Add check on ACPI data (num_sifr) - * Coding style cleanups, better error messages/handling - * Fixed an off-by-one error in memory allocation - * - * Aug.21, 2004 David Bronaugh - * -v0.6.1 Fix a silly error with status checking - * - * Aug.20, 2004 David Bronaugh - * - v0.6 Correct brightness controls to reflect reality - * based on information gleaned by Hiroshi Miura - * and discussions with Hiroshi Miura - * - * Aug.10, 2004 Hiroshi Miura - * - v0.5 support LCD brightness control - * based on the disclosed information by MEI. - * - * Jul.25, 2004 Hiroshi Miura - * - v0.4 first post version - * add function to retrive SIFR - * - * Jul.24, 2004 Hiroshi Miura - * - v0.3 get proper status of hotkey - * - * Jul.22, 2004 Hiroshi Miura - * - v0.2 add HotKey handler - * - * Jul.17, 2004 Hiroshi Miura - * - v0.1 start from toshiba_acpi driver written by John Belmonte - * - */ - -#define ACPI_PCC_VERSION "0.9+hy" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -/************************************************************************* - * "seq" file template definition. - */ -/* "seq" initializer */ -#define SEQ_OPEN_FS(_open_func_name_, _show_func_name_) \ -static int _open_func_name_(struct inode *inode, struct file *file) \ -{ \ - return single_open(file, _show_func_name_, PDE(inode)->data); \ -} - -/*------------------------------------------------------------------------- - * "seq" fops template for read-only files. - */ -#define SEQ_FILEOPS_R(_open_func_name_) \ -{ \ - .open = _open_func_name_, \ - .read = seq_read, \ - .llseek = seq_lseek, \ - .release = single_release, \ -} - -/*------------------------------------------------------------------------ - * "seq" fops template for read-write files. - */ -#define SEQ_FILEOPS_RW(_open_func_name_, _write_func_name_) \ -{ \ - .open = _open_func_name_ , \ - .read = seq_read, \ - .write = _write_func_name_, \ - .llseek = seq_lseek, \ - .release = single_release, \ -} - -/* - * "seq" file template definition ended. - *************************************************************************** - */ -#ifndef ACPI_HOTKEY_COMPONENT -#define ACPI_HOTKEY_COMPONENT 0x10000000 -#endif - -#define _COMPONENT ACPI_HOTKEY_COMPONENT -ACPI_MODULE_NAME("pcc_acpi"); - -MODULE_AUTHOR("Hiroshi Miura, Hiroshi Yokota"); -MODULE_DESCRIPTION("ACPI HotKey driver for Panasonic Let's Note laptops"); -MODULE_LICENSE("GPL"); - -#define LOGPREFIX "pcc_acpi: " - -/**************************************************** - * Define ACPI PATHs - ****************************************************/ -/* Lets note hotkeys */ -#define METHOD_HKEY_QUERY "HINF" -#define METHOD_HKEY_SQTY "SQTY" -#define METHOD_HKEY_SINF "SINF" -#define METHOD_HKEY_SSET "SSET" -#define HKEY_NOTIFY 0x80 - -/* for brightness control */ -#define LCD_MAX_BRIGHTNESS 255 -/* This may be magical -- beware */ -#define LCD_BRIGHTNESS_INCREMENT 17 -/* Registers of SINF */ -#define SINF_LCD_BRIGHTNESS 4 - -/******************************************************************* - * - * definitions for /proc/ interface - * - *******************************************************************/ -#define ACPI_PCC_DRIVER_NAME "pcc_acpi" -#define ACPI_PCC_DEVICE_NAME "PCCExtra" -#define ACPI_PCC_CLASS "pcc" -#define PROC_PCC ACPI_PCC_CLASS - -#define ACPI_PCC_INPUT_PHYS "panasonic/hkey0" - -/* This is transitional definition */ -#ifndef KEY_BATT -# define KEY_BATT 227 -#endif - -#define PROC_STR_MAX_LEN 8 - -#define BUS_PCC_HOTKEY BUS_I8042 /*0x1a*/ /* FIXME: BUS_I8042? */ - -/* Fn+F4/F5 confricts with Shift+F1/F2 */ -/* This hack avoids key number confrict */ -#define PCC_KEYINPUT_MODE (0) - -/* LCD_TYPEs: 0 = Normal, 1 = Semi-transparent - ENV_STATEs: Normal temp=0x01, High temp=0x81, N/A=0x00 -*/ -enum SINF_BITS { SINF_NUM_BATTERIES = 0, - SINF_LCD_TYPE, - SINF_AC_MAX_BRIGHT, - SINF_AC_MIN_BRIGHT, - SINF_AC_CUR_BRIGHT, - /* 4 = R1 only handle SINF_AC_CUR_BRIGHT - * as SINF_CUR_BRIGHT and don't know AC state */ - SINF_DC_MAX_BRIGHT, - SINF_DC_MIN_BRIGHT, - SINF_DC_CUR_BRIGHT, - SINF_MUTE, - SINF_RESERVED, - SINF_ENV_STATE, /* 10 */ - SINF_STICKY_KEY = 0x80, -}; - -static struct acpi_device_id pcc_device_ids[] = { - {"MAT0012", 0}, - {"MAT0013", 0}, - {"MAT0018", 0}, - {"MAT0019", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, pcc_device_ids); - - -static int __devinit acpi_pcc_hotkey_add(struct acpi_device *device); -static int __devexit acpi_pcc_hotkey_remove(struct acpi_device *device, - int type); -static int acpi_pcc_hotkey_resume(struct acpi_device *device); - - -static struct acpi_driver acpi_pcc_driver = { - .name = ACPI_PCC_DRIVER_NAME, - .class = ACPI_PCC_CLASS, - .ids = pcc_device_ids, - .ops = { - .add = acpi_pcc_hotkey_add, - .remove = __devexit_p(acpi_pcc_hotkey_remove), -#ifdef CONFIG_PM - /*.suspend = acpi_pcc_hotkey_suspend,*/ - .resume = acpi_pcc_hotkey_resume, -#endif - }, -}; - -struct acpi_hotkey { - acpi_handle handle; - struct acpi_device *device; - struct proc_dir_entry *proc_dir_entry; - unsigned long num_sifr; - unsigned long status; - struct input_dev *input_dev; - int sticky_mode; -}; - -struct pcc_keyinput { - struct acpi_hotkey *hotkey; - int key_mode; -}; - -/* ************************************************************************* - Hotkey driver core - ************************************************************************* */ -/* ------------------------------------------------------------------------- - method access functions - ------------------------------------------------------------------------- */ -static int acpi_pcc_write_sset(struct acpi_hotkey *hotkey, int func, int val) -{ - union acpi_object in_objs[] = { - { .integer.type = ACPI_TYPE_INTEGER, - .integer.value = func, }, - { .integer.type = ACPI_TYPE_INTEGER, - .integer.value = val, }, - }; - struct acpi_object_list params = { - .count = ARRAY_SIZE(in_objs), - .pointer = in_objs, - }; - acpi_status status; - - ACPI_FUNCTION_TRACE("acpi_pcc_write_sset"); - - status = acpi_evaluate_object(hotkey->handle, METHOD_HKEY_SSET, - ¶ms, NULL); - - return_VALUE(status == AE_OK ? AE_OK : AE_ERROR); -} - -static inline int acpi_pcc_get_sqty(struct acpi_device *device) -{ - unsigned long s; - acpi_status status; - - ACPI_FUNCTION_TRACE("acpi_pcc_get_sqty"); - - status = acpi_evaluate_integer(device->handle, METHOD_HKEY_SQTY, - NULL, &s); - if (ACPI_SUCCESS(status)) { - return_VALUE(s); - } else { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "evaluation error HKEY.SQTY\n")); - return_VALUE(-EINVAL); - } -} - -static int acpi_pcc_retrieve_biosdata(struct acpi_hotkey *hotkey, u32 *sinf) -{ - acpi_status status; - struct acpi_buffer buffer = {ACPI_ALLOCATE_BUFFER, NULL}; - union acpi_object *hkey = NULL; - int i; - - ACPI_FUNCTION_TRACE("acpi_pcc_retrieve_biosdata"); - - status = acpi_evaluate_object(hotkey->handle, METHOD_HKEY_SINF, 0, - &buffer); - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "evaluation error HKEY.SINF\n")); - status = AE_ERROR; - return_VALUE(status); - } - - hkey = buffer.pointer; - if (!hkey || (hkey->type != ACPI_TYPE_PACKAGE)) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid HKEY.SINF\n")); - goto free_buffer; - } - - if (hotkey->num_sifr < hkey->package.count) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "SQTY reports bad SINF length\n")); - status = AE_ERROR; - goto free_buffer; - } - - for (i = 0; i < hkey->package.count; i++) { - union acpi_object *element = &(hkey->package.elements[i]); - if (likely(element->type == ACPI_TYPE_INTEGER)) { - sinf[i] = element->integer.value; - } else { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Invalid HKEY.SINF data\n")); - status = AE_ERROR; - break; - } - } - sinf[hkey->package.count] = -1; - - free_buffer: - kfree(buffer.pointer); - return_VALUE(status == AE_OK ? AE_OK : AE_ERROR); -} - -static int acpi_pcc_read_sinf_field(struct seq_file *seq, int field) -{ - struct acpi_hotkey *hotkey = (struct acpi_hotkey *) seq->private; - u32 sinf[hotkey->num_sifr + 1]; - - ACPI_FUNCTION_TRACE("acpi_pcc_read_sinf_field"); - - if (ACPI_SUCCESS(acpi_pcc_retrieve_biosdata(hotkey, sinf))) - seq_printf(seq, "%u\n", sinf[field]); - else - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Couldn't retrieve BIOS data\n")); - - return_VALUE(AE_OK); -} - -/* ------------------------------------------------------------------------- - user interface functions - ------------------------------------------------------------------------- */ -/* read methods */ -/* Sinf read methods */ -#define PCC_SINF_READ_F(_name_, FUNC) \ -static int _name_(struct seq_file *seq, void *offset) \ -{ \ - return_VALUE(ACPI_SUCCESS(acpi_pcc_read_sinf_field(seq, \ - (FUNC))) \ - ? 0 : -EINVAL); \ -} - -PCC_SINF_READ_F(acpi_pcc_numbatteries_show, SINF_NUM_BATTERIES); -PCC_SINF_READ_F(acpi_pcc_lcdtype_show, SINF_LCD_TYPE); -PCC_SINF_READ_F(acpi_pcc_ac_brightness_max_show, SINF_AC_MAX_BRIGHT); -PCC_SINF_READ_F(acpi_pcc_ac_brightness_min_show, SINF_AC_MIN_BRIGHT); -PCC_SINF_READ_F(acpi_pcc_ac_brightness_show, SINF_AC_CUR_BRIGHT); -PCC_SINF_READ_F(acpi_pcc_dc_brightness_max_show, SINF_DC_MAX_BRIGHT); -PCC_SINF_READ_F(acpi_pcc_dc_brightness_min_show, SINF_DC_MIN_BRIGHT); -PCC_SINF_READ_F(acpi_pcc_dc_brightness_show, SINF_DC_CUR_BRIGHT); -PCC_SINF_READ_F(acpi_pcc_brightness_show, SINF_AC_CUR_BRIGHT); -PCC_SINF_READ_F(acpi_pcc_mute_show, SINF_MUTE); - -static int acpi_pcc_sticky_key_show(struct seq_file *seq, void *offset) -{ - struct acpi_hotkey *hotkey = seq->private; - - ACPI_FUNCTION_TRACE("acpi_pcc_sticky_key_show"); - - if (!hotkey || !hotkey->device) - return_VALUE(-EINVAL); - - seq_printf(seq, "%d\n", hotkey->sticky_mode); - - return_VALUE(0); -} - -static int acpi_pcc_keyinput_show(struct seq_file *seq, void *offset) -{ - struct acpi_hotkey *hotkey = seq->private; - struct input_dev *hotk_input_dev = hotkey->input_dev; - struct pcc_keyinput *keyinput = input_get_drvdata(hotk_input_dev); - - ACPI_FUNCTION_TRACE("acpi_pcc_keyinput_show"); - - seq_printf(seq, "%d\n", keyinput->key_mode); - - return_VALUE(0); -} - -static int acpi_pcc_version_show(struct seq_file *seq, void *offset) -{ - struct acpi_hotkey *hotkey = seq->private; - - ACPI_FUNCTION_TRACE("acpi_pcc_version_show"); - - if (!hotkey || !hotkey->device) - return_VALUE(-EINVAL); - - seq_printf(seq, "%s version %s\n", ACPI_PCC_DRIVER_NAME, - ACPI_PCC_VERSION); - seq_printf(seq, "%li functions\n", hotkey->num_sifr); - - return_VALUE(0); -} - -/* write methods */ -static ssize_t acpi_pcc_write_single_flag(struct file *file, - const char __user *buffer, - size_t count, - int sinf_func) -{ - struct seq_file *seq = file->private_data; - struct acpi_hotkey *hotkey = seq->private; - char write_string[PROC_STR_MAX_LEN]; - u32 val; - - ACPI_FUNCTION_TRACE("acpi_pcc_write_single_flag"); - - if (!hotkey || (count > sizeof(write_string) - 1)) - return_VALUE(-EINVAL); - - if (copy_from_user(write_string, buffer, count)) - return_VALUE(-EFAULT); - - write_string[count] = '\0'; - - if ((sscanf(write_string, "%3i", &val) == 1) && - (val == 0 || val == 1)) - acpi_pcc_write_sset(hotkey, sinf_func, val); - - return_VALUE(count); -} - -static unsigned long acpi_pcc_write_brightness(struct file *file, - const char __user *buffer, - size_t count, - int min_index, int max_index, - int cur_index) -{ - struct seq_file *seq = (struct seq_file *)file->private_data; - struct acpi_hotkey *hotkey = (struct acpi_hotkey *)seq->private; - char write_string[PROC_STR_MAX_LEN]; - u32 bright; - u32 sinf[hotkey->num_sifr + 1]; - - ACPI_FUNCTION_TRACE("acpi_pcc_write_brightness"); - - if (!hotkey || (count > sizeof(write_string) - 1)) - return_VALUE(-EINVAL); - - if (copy_from_user(write_string, buffer, count)) - return_VALUE(-EFAULT); - - write_string[count] = '\0'; - - if (ACPI_FAILURE(acpi_pcc_retrieve_biosdata(hotkey, sinf))) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Couldn't retrieve BIOS data\n")); - goto end; - } - - if ((sscanf(write_string, "%4i", &bright) == 1) && - (bright >= sinf[min_index]) && - (bright <= sinf[max_index])) - acpi_pcc_write_sset(hotkey, cur_index, bright); - -end: - return_VALUE(count); -} - -static ssize_t acpi_pcc_write_ac_brightness(struct file *file, - const char __user *buffer, - size_t count, loff_t *ppos) -{ - return_VALUE(acpi_pcc_write_brightness(file, buffer, count, - SINF_AC_MIN_BRIGHT, - SINF_AC_MAX_BRIGHT, - SINF_AC_CUR_BRIGHT)); -} - -static ssize_t acpi_pcc_write_dc_brightness(struct file *file, - const char __user *buffer, - size_t count, loff_t *ppos) -{ - return_VALUE(acpi_pcc_write_brightness(file, buffer, count, - SINF_DC_MIN_BRIGHT, - SINF_DC_MAX_BRIGHT, - SINF_DC_CUR_BRIGHT)); -} - -static ssize_t acpi_pcc_write_no_brightness(struct file *file, - const char __user *buffer, - size_t count, loff_t *ppos) -{ - return acpi_pcc_write_brightness(file, buffer, count, - SINF_AC_MIN_BRIGHT, - SINF_AC_MAX_BRIGHT, - SINF_AC_CUR_BRIGHT); -} - -static ssize_t acpi_pcc_write_mute(struct file *file, - const char __user *buffer, - size_t count, loff_t *ppos) -{ - return_VALUE(acpi_pcc_write_single_flag(file, buffer, count, - SINF_MUTE)); -} - -static ssize_t acpi_pcc_write_sticky_key(struct file *file, - const char __user *buffer, - size_t count, loff_t *ppos) -{ - struct seq_file *seq = (struct seq_file *)file->private_data; - struct acpi_hotkey *hotkey = (struct acpi_hotkey *)seq->private; - char write_string[PROC_STR_MAX_LEN]; - int mode; - - ACPI_FUNCTION_TRACE("acpi_pcc_write_sticky_key"); - - if (!hotkey || (count > sizeof(write_string) - 1)) - return_VALUE(-EINVAL); - - if (copy_from_user(write_string, buffer, count)) - return_VALUE(-EFAULT); - - write_string[count] = '\0'; - - if ((sscanf(write_string, "%3i", &mode) == 1) && - (mode == 0 || mode == 1)) { - acpi_pcc_write_sset(hotkey, SINF_STICKY_KEY, mode); - hotkey->sticky_mode = mode; - } - - return_VALUE(count); -} - -static ssize_t acpi_pcc_write_keyinput(struct file *file, - const char __user *buffer, - size_t count, loff_t *ppos) -{ - struct seq_file *seq = (struct seq_file *)file->private_data; - struct acpi_hotkey *hotkey = (struct acpi_hotkey *)seq->private; - struct pcc_keyinput *keyinput; - char write_string[PROC_STR_MAX_LEN]; - int key_mode; - - ACPI_FUNCTION_TRACE("acpi_pcc_write_keyinput"); - - if (!hotkey || (count > (sizeof(write_string) - 1))) - return_VALUE(-EINVAL); - - if (copy_from_user(write_string, buffer, count)) - return_VALUE(-EFAULT); - - write_string[count] = '\0'; - - if ((sscanf(write_string, "%4i", &key_mode) == 1) && - (key_mode == 0 || key_mode == 1)) { - keyinput = input_get_drvdata(hotkey->input_dev); - keyinput->key_mode = key_mode; - } - - return_VALUE(count); -} - -/* ------------------------------------------------------------------------- - hotkey driver - ------------------------------------------------------------------------- */ -static void acpi_pcc_generete_keyinput(struct acpi_hotkey *hotkey) -{ - struct input_dev *hotk_input_dev = hotkey->input_dev; - struct pcc_keyinput *keyinput = input_get_drvdata(hotk_input_dev); - int hinf = hotkey->status; - int key_code, hkey_num; - const int key_map[] = { - /* 0 */ -1, - /* 1 */ KEY_BRIGHTNESSDOWN, - /* 2 */ KEY_BRIGHTNESSUP, - /* 3 */ -1, /* vga/lcd switch event is not occur on - hotkey driver. */ - /* 4 */ KEY_MUTE, - /* 5 */ KEY_VOLUMEDOWN, - /* 6 */ KEY_VOLUMEUP, - /* 7 */ KEY_SLEEP, - /* 8 */ -1, /* Change CPU boost: do nothing */ - /* 9 */ KEY_BATT, - /* 10 */ KEY_SUSPEND, - }; - - ACPI_FUNCTION_TRACE("acpi_pcc_generete_keyinput"); - - if (keyinput->key_mode == 0) - return_VOID; - - hkey_num = hinf & 0xf; - - if ((0 > hkey_num) || - (hkey_num > ARRAY_SIZE(key_map))) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "hotkey number out of range: %d\n", - hkey_num)); - return_VOID; - } - - key_code = key_map[hkey_num]; - - if (key_code != -1) { - int pushed = (hinf & 0x80) ? TRUE : FALSE; - - input_report_key(hotk_input_dev, key_code, pushed); - input_sync(hotk_input_dev); - } -} - -static int acpi_pcc_hotkey_get_key(struct acpi_hotkey *hotkey) -{ - unsigned long result; - acpi_status status = AE_OK; - - ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_get_key"); - - status = acpi_evaluate_integer(hotkey->handle, METHOD_HKEY_QUERY, - NULL, &result); - if (likely(ACPI_SUCCESS(status))) - hotkey->status = result; - else - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "error getting hotkey status\n")); - - return_VALUE(status == AE_OK); -} - -void acpi_pcc_hotkey_notify(acpi_handle handle, u32 event, void *data) -{ - struct acpi_hotkey *hotkey = (struct acpi_hotkey *) data; - - ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_notify"); - - switch (event) { - case HKEY_NOTIFY: - if (acpi_pcc_hotkey_get_key(hotkey)) { - /* generate event like '"pcc HKEY 00000080 00000084"' - * when Fn+F4 pressed */ - acpi_bus_generate_proc_event(hotkey->device, event, - hotkey->status); - } - acpi_pcc_generete_keyinput(hotkey); - break; - default: - /* nothing to do */ - break; - } - return_VOID; -} - -/* ************************************************************************* - FS Interface (/proc) - ************************************************************************* */ -/* oepn proc file fs*/ -SEQ_OPEN_FS(acpi_pcc_dc_brightness_open_fs, acpi_pcc_dc_brightness_show); -SEQ_OPEN_FS(acpi_pcc_numbatteries_open_fs, acpi_pcc_numbatteries_show); -SEQ_OPEN_FS(acpi_pcc_lcdtype_open_fs, acpi_pcc_lcdtype_show); -SEQ_OPEN_FS(acpi_pcc_ac_brightness_max_open_fs, - acpi_pcc_ac_brightness_max_show); -SEQ_OPEN_FS(acpi_pcc_ac_brightness_min_open_fs, - acpi_pcc_ac_brightness_min_show); -SEQ_OPEN_FS(acpi_pcc_ac_brightness_open_fs, acpi_pcc_ac_brightness_show); -SEQ_OPEN_FS(acpi_pcc_dc_brightness_max_open_fs, - acpi_pcc_dc_brightness_max_show); -SEQ_OPEN_FS(acpi_pcc_dc_brightness_min_open_fs, - acpi_pcc_dc_brightness_min_show); -SEQ_OPEN_FS(acpi_pcc_brightness_open_fs, acpi_pcc_brightness_show); -SEQ_OPEN_FS(acpi_pcc_mute_open_fs, acpi_pcc_mute_show); -SEQ_OPEN_FS(acpi_pcc_version_open_fs, acpi_pcc_version_show); -SEQ_OPEN_FS(acpi_pcc_keyinput_open_fs, acpi_pcc_keyinput_show); -SEQ_OPEN_FS(acpi_pcc_sticky_key_open_fs, acpi_pcc_sticky_key_show); - -static struct file_operations acpi_pcc_numbatteries_fops = - SEQ_FILEOPS_R(acpi_pcc_numbatteries_open_fs); -static struct file_operations acpi_pcc_lcdtype_fops = - SEQ_FILEOPS_R(acpi_pcc_lcdtype_open_fs); -static struct file_operations acpi_pcc_mute_fops = - SEQ_FILEOPS_RW(acpi_pcc_mute_open_fs, acpi_pcc_write_mute); -static struct file_operations acpi_pcc_ac_brightness_fops = - SEQ_FILEOPS_RW(acpi_pcc_ac_brightness_open_fs, - acpi_pcc_write_ac_brightness); -static struct file_operations acpi_pcc_ac_brightness_max_fops = - SEQ_FILEOPS_R(acpi_pcc_ac_brightness_max_open_fs); -static struct file_operations acpi_pcc_ac_brightness_min_fops = - SEQ_FILEOPS_R(acpi_pcc_ac_brightness_min_open_fs); -static struct file_operations acpi_pcc_dc_brightness_fops = - SEQ_FILEOPS_RW(acpi_pcc_dc_brightness_open_fs, - acpi_pcc_write_dc_brightness); -static struct file_operations acpi_pcc_dc_brightness_max_fops = - SEQ_FILEOPS_R(acpi_pcc_dc_brightness_max_open_fs); -static struct file_operations acpi_pcc_dc_brightness_min_fops = - SEQ_FILEOPS_R(acpi_pcc_dc_brightness_min_open_fs); -static struct file_operations acpi_pcc_brightness_fops = - SEQ_FILEOPS_RW(acpi_pcc_brightness_open_fs, - acpi_pcc_write_no_brightness); -static struct file_operations acpi_pcc_sticky_key_fops = - SEQ_FILEOPS_RW(acpi_pcc_sticky_key_open_fs, acpi_pcc_write_sticky_key); -static struct file_operations acpi_pcc_keyinput_fops = - SEQ_FILEOPS_RW(acpi_pcc_keyinput_open_fs, acpi_pcc_write_keyinput); -static struct file_operations acpi_pcc_version_fops = - SEQ_FILEOPS_R(acpi_pcc_version_open_fs); - -struct proc_item { - const char *name; - struct file_operations *fops; - mode_t flag; -}; - -/* Note: These functions map *exactly* to the SINF/SSET functions */ -struct proc_item acpi_pcc_proc_items_sifr[] = { - { "num_batteries", &acpi_pcc_numbatteries_fops, S_IRUGO }, - { "lcd_type", &acpi_pcc_lcdtype_fops, S_IRUGO }, - { "ac_brightness_max", &acpi_pcc_ac_brightness_max_fops, S_IRUGO }, - { "ac_brightness_min", &acpi_pcc_ac_brightness_min_fops, S_IRUGO }, - { "ac_brightness", &acpi_pcc_ac_brightness_fops, - S_IFREG | S_IRUGO | S_IWUSR }, - { "dc_brightness_max", &acpi_pcc_dc_brightness_max_fops, S_IRUGO }, - { "dc_brightness_min", &acpi_pcc_dc_brightness_min_fops, S_IRUGO }, - { "dc_brightness", &acpi_pcc_dc_brightness_fops, - S_IFREG | S_IRUGO | S_IWUSR }, - { "brightness", &acpi_pcc_brightness_fops, S_IFREG | S_IRUGO | S_IWUSR}, - { "mute", &acpi_pcc_mute_fops, S_IFREG | S_IRUGO | S_IWUSR }, - { NULL, NULL, 0 }, -}; - -struct proc_item acpi_pcc_proc_items[] = { - { "sticky_key", &acpi_pcc_sticky_key_fops, S_IFREG | S_IRUGO | S_IWUSR}, - { "keyinput", &acpi_pcc_keyinput_fops, S_IFREG | S_IRUGO | S_IWUSR }, - { "version", &acpi_pcc_version_fops, S_IRUGO }, - { NULL, NULL, 0 }, -}; - -static int __devinit acpi_pcc_add_device(struct acpi_device *device, - struct proc_item *proc_items, - int num) -{ - struct acpi_hotkey *hotkey = acpi_driver_data(device); - struct proc_dir_entry *proc; - struct proc_item *item; - int i; - - for (item = proc_items, i = 0; item->name && i < num; ++item, ++i) { - proc = create_proc_entry(item->name, item->flag, - hotkey->proc_dir_entry); - if (likely(proc)) { - proc->proc_fops = item->fops; - proc->data = hotkey; - proc->owner = THIS_MODULE; - } else { - while (i-- > 0) { - item--; - remove_proc_entry(item->name, - hotkey->proc_dir_entry); - } - return_VALUE(-ENODEV); - } - } - return_VALUE(0); -} - -static int __devinit acpi_pcc_proc_init(struct acpi_device *device) -{ - struct proc_dir_entry *acpi_pcc_dir; - struct acpi_hotkey *hotkey = acpi_driver_data(device); - acpi_status status; - - ACPI_FUNCTION_TRACE("acpi_pcc_proc_init"); - - acpi_pcc_dir = proc_mkdir(PROC_PCC, acpi_root_dir); - - if (unlikely(!acpi_pcc_dir)) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Couldn't create dir in /proc\n")); - return_VALUE(-ENODEV); - } - - acpi_pcc_dir->owner = THIS_MODULE; - hotkey->proc_dir_entry = acpi_pcc_dir; - - status = acpi_pcc_add_device(device, acpi_pcc_proc_items_sifr, - hotkey->num_sifr); - status |= acpi_pcc_add_device(device, acpi_pcc_proc_items, - ARRAY_SIZE(acpi_pcc_proc_items)); - if (unlikely(status)) { - remove_proc_entry(PROC_PCC, acpi_root_dir); - hotkey->proc_dir_entry = NULL; - return_VALUE(-ENODEV); - } - - return_VALUE(status); -} - -static void __devexit acpi_pcc_remove_device(struct acpi_device *device, - struct proc_item *proc_items, - int num) -{ - struct acpi_hotkey *hotkey = acpi_driver_data(device); - struct proc_item *item; - int i; - - for (item = proc_items, i = 0; - item->name != NULL && i < num; - ++item, ++i) { - remove_proc_entry(item->name, hotkey->proc_dir_entry); - } - - return_VOID; -} - -/* ************************************************************************* - Power Management - ************************************************************************* */ -#ifdef CONFIG_PM -static int acpi_pcc_hotkey_resume(struct acpi_device *device) -{ - struct acpi_hotkey *hotkey = acpi_driver_data(device); - acpi_status status = AE_OK; - - ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_resume"); - - if (device == NULL || hotkey == NULL) - return_VALUE(-EINVAL); - - if (hotkey->num_sifr != 0) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Sticky mode restore: %d\n", - hotkey->sticky_mode)); - - status = acpi_pcc_write_sset(hotkey, SINF_STICKY_KEY, - hotkey->sticky_mode); - } - if (status != AE_OK) - return_VALUE(-EINVAL); - - return_VALUE(0); -} -#endif - -/* ************************************************************************* - Module init/remove - ************************************************************************* */ -/* ------------------------------------------------------------------------- - input - ------------------------------------------------------------------------- */ -static int __devinit acpi_pcc_init_input(struct acpi_hotkey *hotkey) -{ - struct input_dev *hotk_input_dev; - struct pcc_keyinput *pcc_keyinput; - int error; - - ACPI_FUNCTION_TRACE("acpi_pcc_init_input"); - - hotk_input_dev = input_allocate_device(); - if (hotk_input_dev == NULL) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Couldn't allocate input device for hotkey")); - goto err_input; - } - - pcc_keyinput = kcalloc(1, sizeof(struct pcc_keyinput), GFP_KERNEL); - - if (pcc_keyinput == NULL) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Couldn't allocate mem for private data")); - goto err_pcc; - } - - hotk_input_dev->evbit[0] = BIT(EV_KEY); - - set_bit(KEY_BRIGHTNESSDOWN, hotk_input_dev->keybit); - set_bit(KEY_BRIGHTNESSUP, hotk_input_dev->keybit); - set_bit(KEY_MUTE, hotk_input_dev->keybit); - set_bit(KEY_VOLUMEDOWN, hotk_input_dev->keybit); - set_bit(KEY_VOLUMEUP, hotk_input_dev->keybit); - set_bit(KEY_SLEEP, hotk_input_dev->keybit); - set_bit(KEY_BATT, hotk_input_dev->keybit); - set_bit(KEY_SUSPEND, hotk_input_dev->keybit); - - hotk_input_dev->name = ACPI_PCC_DRIVER_NAME; - hotk_input_dev->phys = ACPI_PCC_INPUT_PHYS; - hotk_input_dev->id.bustype = BUS_PCC_HOTKEY; - hotk_input_dev->id.vendor = 0x0001; - hotk_input_dev->id.product = 0x0001; - hotk_input_dev->id.version = 0x0100; - - pcc_keyinput->key_mode = PCC_KEYINPUT_MODE; - pcc_keyinput->hotkey = hotkey; - - input_set_drvdata(hotk_input_dev, pcc_keyinput); - - hotkey->input_dev = hotk_input_dev; - - error = input_register_device(hotk_input_dev); - - if (error) - goto err_pcc; - - return_VALUE(0); - - err_pcc: - input_unregister_device(hotk_input_dev); - err_input: - return_VALUE(-ENOMEM); -} - -static void __devexit acpi_pcc_remove_input(struct acpi_hotkey *hotkey) -{ - struct input_dev *hotk_input_dev; - struct pcc_keyinput *pcc_keyinput; - - ACPI_FUNCTION_TRACE("acpi_pcc_remove_input"); - - if (hotkey == NULL) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Can't free memory")); - return_VOID; - } - - hotk_input_dev = hotkey->input_dev; - pcc_keyinput = input_get_drvdata(hotk_input_dev); - - input_unregister_device(hotk_input_dev); - - kfree(pcc_keyinput); -} - -/* ------------------------------------------------------------------------- - ACPI - ------------------------------------------------------------------------- */ -static int __devinit acpi_pcc_hotkey_add(struct acpi_device *device) -{ - acpi_status status = AE_OK; - struct acpi_hotkey *hotkey = NULL; - int sifr_status, num_sifr, result; - - ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_add"); - - if (device == NULL) - return_VALUE(-EINVAL); - - sifr_status = acpi_pcc_get_sqty(device); - - if (sifr_status > 255) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "num_sifr too large")); - return_VALUE(-ENODEV); - } - - if (sifr_status < 0) { - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "not support SQTY")); - num_sifr = 0; - } else { - num_sifr = sifr_status; - } - - hotkey = kcalloc(1, sizeof(struct acpi_hotkey), GFP_KERNEL); - if (hotkey == NULL) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Couldn't allocate mem for hotkey")); - return_VALUE(-ENOMEM); - } - - hotkey->device = device; - hotkey->handle = device->handle; - hotkey->num_sifr = num_sifr; - device->driver_data = hotkey; - strcpy(acpi_device_name(device), ACPI_PCC_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_PCC_CLASS); - - status = acpi_install_notify_handler(hotkey->handle, - ACPI_DEVICE_NOTIFY, - acpi_pcc_hotkey_notify, - hotkey); - - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Error installing notify handler\n")); - kfree(hotkey); - return_VALUE(-ENODEV); - } - - result = acpi_pcc_init_input(hotkey); - if (result != 0) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Error installing keyinput handler\n")); - kfree(hotkey); - return_VALUE(result); - } - - return_VALUE(acpi_pcc_proc_init(device)); -} - -static int __devexit acpi_pcc_hotkey_remove(struct acpi_device *device, - int type) -{ - acpi_status status = AE_OK; - struct acpi_hotkey *hotkey = acpi_driver_data(device); - - ACPI_FUNCTION_TRACE("acpi_pcc_hotkey_remove"); - - if (!device || !hotkey) - return_VALUE(-EINVAL); - - if (hotkey->proc_dir_entry) { - acpi_pcc_remove_device(device, acpi_pcc_proc_items_sifr, - hotkey->num_sifr); - acpi_pcc_remove_device(device, acpi_pcc_proc_items, - ARRAY_SIZE(acpi_pcc_proc_items)); - remove_proc_entry(PROC_PCC, acpi_root_dir); - } - - status = acpi_remove_notify_handler(hotkey->handle, - ACPI_DEVICE_NOTIFY, acpi_pcc_hotkey_notify); - - if (ACPI_FAILURE(status)) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Error removing notify handler\n")); - } - - acpi_pcc_remove_input(hotkey); - kfree(hotkey); - return_VALUE(status == AE_OK); -} - -/* ********************************************************************* - Module entry point - ********************************************************************* */ -static int __init acpi_pcc_init(void) -{ - int result; - - ACPI_FUNCTION_TRACE("acpi_pcc_init"); - - printk(KERN_INFO LOGPREFIX "loading...\n"); - - if (acpi_disabled) { - printk(KERN_INFO LOGPREFIX "ACPI disabled.\n"); - return_VALUE(-ENODEV); - } - - result = acpi_bus_register_driver(&acpi_pcc_driver); - if (result < 0) { - ACPI_DEBUG_PRINT((ACPI_DB_ERROR, - "Error registering hotkey driver\n")); - return_VALUE(-ENODEV); - } - - return_VALUE(result); -} - -static void __exit acpi_pcc_exit(void) -{ - ACPI_FUNCTION_TRACE("acpi_pcc_exit"); - - printk(KERN_INFO LOGPREFIX "unloading...\n"); - - acpi_bus_unregister_driver(&acpi_pcc_driver); - - return_VOID; -} - -module_init(acpi_pcc_init); -module_exit(acpi_pcc_exit); diff --git a/trunk/fs/ext4/namei.c b/trunk/fs/ext4/namei.c index 63adcb792988..5b93a7d94d42 100644 --- a/trunk/fs/ext4/namei.c +++ b/trunk/fs/ext4/namei.c @@ -1061,6 +1061,7 @@ static struct dentry *ext4_lookup(struct inode *dir, struct dentry *dentry, stru struct dentry *ext4_get_parent(struct dentry *child) { unsigned long ino; + struct dentry *parent; struct inode *inode; static const struct qstr dotdot = { .name = "..", diff --git a/trunk/fs/filesystems.c b/trunk/fs/filesystems.c index d0e20ced62dd..f37f87262837 100644 --- a/trunk/fs/filesystems.c +++ b/trunk/fs/filesystems.c @@ -8,8 +8,6 @@ #include #include -#include -#include #include #include #include @@ -216,43 +214,6 @@ int get_filesystem_list(char * buf) return len; } -#ifdef CONFIG_PROC_FS -static int filesystems_proc_show(struct seq_file *m, void *v) -{ - struct file_system_type * tmp; - - read_lock(&file_systems_lock); - tmp = file_systems; - while (tmp) { - seq_printf(m, "%s\t%s\n", - (tmp->fs_flags & FS_REQUIRES_DEV) ? "" : "nodev", - tmp->name); - tmp = tmp->next; - } - read_unlock(&file_systems_lock); - return 0; -} - -static int filesystems_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, filesystems_proc_show, NULL); -} - -static const struct file_operations filesystems_proc_fops = { - .open = filesystems_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int __init proc_filesystems_init(void) -{ - proc_create("filesystems", 0, NULL, &filesystems_proc_fops); - return 0; -} -module_init(proc_filesystems_init); -#endif - struct file_system_type *get_fs_type(const char *name) { struct file_system_type *fs; diff --git a/trunk/fs/locks.c b/trunk/fs/locks.c index 09062e3ff104..20457486d6b2 100644 --- a/trunk/fs/locks.c +++ b/trunk/fs/locks.c @@ -2079,7 +2079,6 @@ int vfs_cancel_lock(struct file *filp, struct file_lock *fl) EXPORT_SYMBOL_GPL(vfs_cancel_lock); #ifdef CONFIG_PROC_FS -#include #include static void lock_get_status(struct seq_file *f, struct file_lock *fl, @@ -2185,31 +2184,12 @@ static void locks_stop(struct seq_file *f, void *v) unlock_kernel(); } -static const struct seq_operations locks_seq_operations = { +struct seq_operations locks_seq_operations = { .start = locks_start, .next = locks_next, .stop = locks_stop, .show = locks_show, }; - -static int locks_open(struct inode *inode, struct file *filp) -{ - return seq_open(filp, &locks_seq_operations); -} - -static const struct file_operations proc_locks_operations = { - .open = locks_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - -static int __init proc_locks_init(void) -{ - proc_create("locks", 0, NULL, &proc_locks_operations); - return 0; -} -module_init(proc_locks_init); #endif /** diff --git a/trunk/fs/proc/Makefile b/trunk/fs/proc/Makefile index 63d965193b22..ebaba0213546 100644 --- a/trunk/fs/proc/Makefile +++ b/trunk/fs/proc/Makefile @@ -8,20 +8,11 @@ proc-y := nommu.o task_nommu.o proc-$(CONFIG_MMU) := mmu.o task_mmu.o proc-y += inode.o root.o base.o generic.o array.o \ - proc_tty.o -proc-y += cmdline.o -proc-y += cpuinfo.o -proc-y += devices.o -proc-y += interrupts.o -proc-y += loadavg.o -proc-y += meminfo.o -proc-y += stat.o -proc-y += uptime.o -proc-y += version.o + proc_tty.o proc_misc.o + proc-$(CONFIG_PROC_SYSCTL) += proc_sysctl.o proc-$(CONFIG_NET) += proc_net.o proc-$(CONFIG_PROC_KCORE) += kcore.o proc-$(CONFIG_PROC_VMCORE) += vmcore.o proc-$(CONFIG_PROC_DEVICETREE) += proc_devtree.o proc-$(CONFIG_PRINTK) += kmsg.o -proc-$(CONFIG_PROC_PAGE_MONITOR) += page.o diff --git a/trunk/fs/proc/cmdline.c b/trunk/fs/proc/cmdline.c deleted file mode 100644 index 82676e3fcd1d..000000000000 --- a/trunk/fs/proc/cmdline.c +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include -#include - -static int cmdline_proc_show(struct seq_file *m, void *v) -{ - seq_printf(m, "%s\n", saved_command_line); - return 0; -} - -static int cmdline_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, cmdline_proc_show, NULL); -} - -static const struct file_operations cmdline_proc_fops = { - .open = cmdline_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int __init proc_cmdline_init(void) -{ - proc_create("cmdline", 0, NULL, &cmdline_proc_fops); - return 0; -} -module_init(proc_cmdline_init); diff --git a/trunk/fs/proc/cpuinfo.c b/trunk/fs/proc/cpuinfo.c deleted file mode 100644 index 5a1e539a234b..000000000000 --- a/trunk/fs/proc/cpuinfo.c +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include -#include -#include - -extern const struct seq_operations cpuinfo_op; -static int cpuinfo_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &cpuinfo_op); -} - -static const struct file_operations proc_cpuinfo_operations = { - .open = cpuinfo_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - -static int __init proc_cpuinfo_init(void) -{ - proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations); - return 0; -} -module_init(proc_cpuinfo_init); diff --git a/trunk/fs/proc/devices.c b/trunk/fs/proc/devices.c deleted file mode 100644 index 59ee7da959c9..000000000000 --- a/trunk/fs/proc/devices.c +++ /dev/null @@ -1,70 +0,0 @@ -#include -#include -#include -#include - -static int devinfo_show(struct seq_file *f, void *v) -{ - int i = *(loff_t *) v; - - if (i < CHRDEV_MAJOR_HASH_SIZE) { - if (i == 0) - seq_printf(f, "Character devices:\n"); - chrdev_show(f, i); - } -#ifdef CONFIG_BLOCK - else { - i -= CHRDEV_MAJOR_HASH_SIZE; - if (i == 0) - seq_printf(f, "\nBlock devices:\n"); - blkdev_show(f, i); - } -#endif - return 0; -} - -static void *devinfo_start(struct seq_file *f, loff_t *pos) -{ - if (*pos < (BLKDEV_MAJOR_HASH_SIZE + CHRDEV_MAJOR_HASH_SIZE)) - return pos; - return NULL; -} - -static void *devinfo_next(struct seq_file *f, void *v, loff_t *pos) -{ - (*pos)++; - if (*pos >= (BLKDEV_MAJOR_HASH_SIZE + CHRDEV_MAJOR_HASH_SIZE)) - return NULL; - return pos; -} - -static void devinfo_stop(struct seq_file *f, void *v) -{ - /* Nothing to do */ -} - -static const struct seq_operations devinfo_ops = { - .start = devinfo_start, - .next = devinfo_next, - .stop = devinfo_stop, - .show = devinfo_show -}; - -static int devinfo_open(struct inode *inode, struct file *filp) -{ - return seq_open(filp, &devinfo_ops); -} - -static const struct file_operations proc_devinfo_operations = { - .open = devinfo_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - -static int __init proc_devices_init(void) -{ - proc_create("devices", 0, NULL, &proc_devinfo_operations); - return 0; -} -module_init(proc_devices_init); diff --git a/trunk/fs/proc/generic.c b/trunk/fs/proc/generic.c index 60a359b35582..7821589a17d5 100644 --- a/trunk/fs/proc/generic.c +++ b/trunk/fs/proc/generic.c @@ -547,8 +547,9 @@ static int proc_register(struct proc_dir_entry * dir, struct proc_dir_entry * dp for (tmp = dir->subdir; tmp; tmp = tmp->next) if (strcmp(tmp->name, dp->name) == 0) { - WARN(1, KERN_WARNING "proc_dir_entry '%s/%s' already registered\n", + printk(KERN_WARNING "proc_dir_entry '%s/%s' already registered\n", dir->name, dp->name); + dump_stack(); break; } diff --git a/trunk/fs/proc/inode.c b/trunk/fs/proc/inode.c index 2543fd00c658..c6b4fa7e3b49 100644 --- a/trunk/fs/proc/inode.c +++ b/trunk/fs/proc/inode.c @@ -106,13 +106,14 @@ static void init_once(void *foo) inode_init_once(&ei->vfs_inode); } -void __init proc_init_inodecache(void) +int __init proc_init_inodecache(void) { proc_inode_cachep = kmem_cache_create("proc_inode_cache", sizeof(struct proc_inode), 0, (SLAB_RECLAIM_ACCOUNT| SLAB_MEM_SPREAD|SLAB_PANIC), init_once); + return 0; } static const struct super_operations proc_sops = { diff --git a/trunk/fs/proc/internal.h b/trunk/fs/proc/internal.h index 3e8aeb8b61ce..3bfb7b8747b3 100644 --- a/trunk/fs/proc/internal.h +++ b/trunk/fs/proc/internal.h @@ -61,11 +61,12 @@ extern const struct file_operations proc_smaps_operations; extern const struct file_operations proc_clear_refs_operations; extern const struct file_operations proc_pagemap_operations; extern const struct file_operations proc_net_operations; +extern const struct file_operations proc_kmsg_operations; extern const struct inode_operations proc_net_inode_operations; void free_proc_entry(struct proc_dir_entry *de); -void proc_init_inodecache(void); +int proc_init_inodecache(void); static inline struct pid *proc_pid(struct inode *inode) { diff --git a/trunk/fs/proc/interrupts.c b/trunk/fs/proc/interrupts.c deleted file mode 100644 index 05029c0e2f24..000000000000 --- a/trunk/fs/proc/interrupts.c +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include -#include -#include -#include -#include - -/* - * /proc/interrupts - */ -static void *int_seq_start(struct seq_file *f, loff_t *pos) -{ - return (*pos <= nr_irqs) ? pos : NULL; -} - -static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) -{ - (*pos)++; - if (*pos > nr_irqs) - return NULL; - return pos; -} - -static void int_seq_stop(struct seq_file *f, void *v) -{ - /* Nothing to do */ -} - -static const struct seq_operations int_seq_ops = { - .start = int_seq_start, - .next = int_seq_next, - .stop = int_seq_stop, - .show = show_interrupts -}; - -static int interrupts_open(struct inode *inode, struct file *filp) -{ - return seq_open(filp, &int_seq_ops); -} - -static const struct file_operations proc_interrupts_operations = { - .open = interrupts_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - -static int __init proc_interrupts_init(void) -{ - proc_create("interrupts", 0, NULL, &proc_interrupts_operations); - return 0; -} -module_init(proc_interrupts_init); diff --git a/trunk/fs/proc/kcore.c b/trunk/fs/proc/kcore.c index 59b43a068872..c2370c76fb71 100644 --- a/trunk/fs/proc/kcore.c +++ b/trunk/fs/proc/kcore.c @@ -27,8 +27,6 @@ #define ELF_CORE_EFLAGS 0 #endif -static struct proc_dir_entry *proc_root_kcore; - static int open_kcore(struct inode * inode, struct file * filp) { return capable(CAP_SYS_RAWIO) ? 0 : -EPERM; @@ -36,7 +34,7 @@ static int open_kcore(struct inode * inode, struct file * filp) static ssize_t read_kcore(struct file *, char __user *, size_t, loff_t *); -static const struct file_operations proc_kcore_operations = { +const struct file_operations proc_kcore_operations = { .read = read_kcore, .open = open_kcore, }; @@ -401,13 +399,3 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) return acc; } - -static int __init proc_kcore_init(void) -{ - proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, &proc_kcore_operations); - if (proc_root_kcore) - proc_root_kcore->size = - (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE; - return 0; -} -module_init(proc_kcore_init); diff --git a/trunk/fs/proc/kmsg.c b/trunk/fs/proc/kmsg.c index 7ca78346d3f0..9fd5df3f40ce 100644 --- a/trunk/fs/proc/kmsg.c +++ b/trunk/fs/proc/kmsg.c @@ -10,12 +10,13 @@ #include #include #include -#include #include #include #include +#include "internal.h" + extern wait_queue_head_t log_wait; extern int do_syslog(int type, char __user *bug, int count); @@ -48,16 +49,9 @@ static unsigned int kmsg_poll(struct file *file, poll_table *wait) } -static const struct file_operations proc_kmsg_operations = { +const struct file_operations proc_kmsg_operations = { .read = kmsg_read, .poll = kmsg_poll, .open = kmsg_open, .release = kmsg_release, }; - -static int __init proc_kmsg_init(void) -{ - proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations); - return 0; -} -module_init(proc_kmsg_init); diff --git a/trunk/fs/proc/loadavg.c b/trunk/fs/proc/loadavg.c deleted file mode 100644 index 9bca39cf99ee..000000000000 --- a/trunk/fs/proc/loadavg.c +++ /dev/null @@ -1,51 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include - -#define LOAD_INT(x) ((x) >> FSHIFT) -#define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100) - -static int loadavg_proc_show(struct seq_file *m, void *v) -{ - int a, b, c; - unsigned long seq; - - do { - seq = read_seqbegin(&xtime_lock); - a = avenrun[0] + (FIXED_1/200); - b = avenrun[1] + (FIXED_1/200); - c = avenrun[2] + (FIXED_1/200); - } while (read_seqretry(&xtime_lock, seq)); - - seq_printf(m, "%d.%02d %d.%02d %d.%02d %ld/%d %d\n", - LOAD_INT(a), LOAD_FRAC(a), - LOAD_INT(b), LOAD_FRAC(b), - LOAD_INT(c), LOAD_FRAC(c), - nr_running(), nr_threads, - task_active_pid_ns(current)->last_pid); - return 0; -} - -static int loadavg_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, loadavg_proc_show, NULL); -} - -static const struct file_operations loadavg_proc_fops = { - .open = loadavg_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int __init proc_loadavg_init(void) -{ - proc_create("loadavg", 0, NULL, &loadavg_proc_fops); - return 0; -} -module_init(proc_loadavg_init); diff --git a/trunk/fs/proc/meminfo.c b/trunk/fs/proc/meminfo.c deleted file mode 100644 index b1675c4e66da..000000000000 --- a/trunk/fs/proc/meminfo.c +++ /dev/null @@ -1,168 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "internal.h" - -void __attribute__((weak)) arch_report_meminfo(struct seq_file *m) -{ -} - -static int meminfo_proc_show(struct seq_file *m, void *v) -{ - struct sysinfo i; - unsigned long committed; - unsigned long allowed; - struct vmalloc_info vmi; - long cached; - unsigned long pages[NR_LRU_LISTS]; - int lru; - -/* - * display in kilobytes. - */ -#define K(x) ((x) << (PAGE_SHIFT - 10)) - si_meminfo(&i); - si_swapinfo(&i); - committed = atomic_long_read(&vm_committed_space); - allowed = ((totalram_pages - hugetlb_total_pages()) - * sysctl_overcommit_ratio / 100) + total_swap_pages; - - cached = global_page_state(NR_FILE_PAGES) - - total_swapcache_pages - i.bufferram; - if (cached < 0) - cached = 0; - - get_vmalloc_info(&vmi); - - for (lru = LRU_BASE; lru < NR_LRU_LISTS; lru++) - pages[lru] = global_page_state(NR_LRU_BASE + lru); - - /* - * Tagged format, for easy grepping and expansion. - */ - seq_printf(m, - "MemTotal: %8lu kB\n" - "MemFree: %8lu kB\n" - "Buffers: %8lu kB\n" - "Cached: %8lu kB\n" - "SwapCached: %8lu kB\n" - "Active: %8lu kB\n" - "Inactive: %8lu kB\n" - "Active(anon): %8lu kB\n" - "Inactive(anon): %8lu kB\n" - "Active(file): %8lu kB\n" - "Inactive(file): %8lu kB\n" -#ifdef CONFIG_UNEVICTABLE_LRU - "Unevictable: %8lu kB\n" - "Mlocked: %8lu kB\n" -#endif -#ifdef CONFIG_HIGHMEM - "HighTotal: %8lu kB\n" - "HighFree: %8lu kB\n" - "LowTotal: %8lu kB\n" - "LowFree: %8lu kB\n" -#endif - "SwapTotal: %8lu kB\n" - "SwapFree: %8lu kB\n" - "Dirty: %8lu kB\n" - "Writeback: %8lu kB\n" - "AnonPages: %8lu kB\n" - "Mapped: %8lu kB\n" - "Slab: %8lu kB\n" - "SReclaimable: %8lu kB\n" - "SUnreclaim: %8lu kB\n" - "PageTables: %8lu kB\n" -#ifdef CONFIG_QUICKLIST - "Quicklists: %8lu kB\n" -#endif - "NFS_Unstable: %8lu kB\n" - "Bounce: %8lu kB\n" - "WritebackTmp: %8lu kB\n" - "CommitLimit: %8lu kB\n" - "Committed_AS: %8lu kB\n" - "VmallocTotal: %8lu kB\n" - "VmallocUsed: %8lu kB\n" - "VmallocChunk: %8lu kB\n", - K(i.totalram), - K(i.freeram), - K(i.bufferram), - K(cached), - K(total_swapcache_pages), - K(pages[LRU_ACTIVE_ANON] + pages[LRU_ACTIVE_FILE]), - K(pages[LRU_INACTIVE_ANON] + pages[LRU_INACTIVE_FILE]), - K(pages[LRU_ACTIVE_ANON]), - K(pages[LRU_INACTIVE_ANON]), - K(pages[LRU_ACTIVE_FILE]), - K(pages[LRU_INACTIVE_FILE]), -#ifdef CONFIG_UNEVICTABLE_LRU - K(pages[LRU_UNEVICTABLE]), - K(global_page_state(NR_MLOCK)), -#endif -#ifdef CONFIG_HIGHMEM - K(i.totalhigh), - K(i.freehigh), - K(i.totalram-i.totalhigh), - K(i.freeram-i.freehigh), -#endif - K(i.totalswap), - K(i.freeswap), - K(global_page_state(NR_FILE_DIRTY)), - K(global_page_state(NR_WRITEBACK)), - K(global_page_state(NR_ANON_PAGES)), - K(global_page_state(NR_FILE_MAPPED)), - K(global_page_state(NR_SLAB_RECLAIMABLE) + - global_page_state(NR_SLAB_UNRECLAIMABLE)), - K(global_page_state(NR_SLAB_RECLAIMABLE)), - K(global_page_state(NR_SLAB_UNRECLAIMABLE)), - K(global_page_state(NR_PAGETABLE)), -#ifdef CONFIG_QUICKLIST - K(quicklist_total_size()), -#endif - K(global_page_state(NR_UNSTABLE_NFS)), - K(global_page_state(NR_BOUNCE)), - K(global_page_state(NR_WRITEBACK_TEMP)), - K(allowed), - K(committed), - (unsigned long)VMALLOC_TOTAL >> 10, - vmi.used >> 10, - vmi.largest_chunk >> 10 - ); - - hugetlb_report_meminfo(m); - - arch_report_meminfo(m); - - return 0; -#undef K -} - -static int meminfo_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, meminfo_proc_show, NULL); -} - -static const struct file_operations meminfo_proc_fops = { - .open = meminfo_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int __init proc_meminfo_init(void) -{ - proc_create("meminfo", 0, NULL, &meminfo_proc_fops); - return 0; -} -module_init(proc_meminfo_init); diff --git a/trunk/fs/proc/page.c b/trunk/fs/proc/page.c deleted file mode 100644 index 767d95a6d1b1..000000000000 --- a/trunk/fs/proc/page.c +++ /dev/null @@ -1,147 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "internal.h" - -#define KPMSIZE sizeof(u64) -#define KPMMASK (KPMSIZE - 1) -/* /proc/kpagecount - an array exposing page counts - * - * Each entry is a u64 representing the corresponding - * physical page count. - */ -static ssize_t kpagecount_read(struct file *file, char __user *buf, - size_t count, loff_t *ppos) -{ - u64 __user *out = (u64 __user *)buf; - struct page *ppage; - unsigned long src = *ppos; - unsigned long pfn; - ssize_t ret = 0; - u64 pcount; - - pfn = src / KPMSIZE; - count = min_t(size_t, count, (max_pfn * KPMSIZE) - src); - if (src & KPMMASK || count & KPMMASK) - return -EINVAL; - - while (count > 0) { - ppage = NULL; - if (pfn_valid(pfn)) - ppage = pfn_to_page(pfn); - pfn++; - if (!ppage) - pcount = 0; - else - pcount = page_mapcount(ppage); - - if (put_user(pcount, out++)) { - ret = -EFAULT; - break; - } - - count -= KPMSIZE; - } - - *ppos += (char __user *)out - buf; - if (!ret) - ret = (char __user *)out - buf; - return ret; -} - -static const struct file_operations proc_kpagecount_operations = { - .llseek = mem_lseek, - .read = kpagecount_read, -}; - -/* /proc/kpageflags - an array exposing page flags - * - * Each entry is a u64 representing the corresponding - * physical page flags. - */ - -/* These macros are used to decouple internal flags from exported ones */ - -#define KPF_LOCKED 0 -#define KPF_ERROR 1 -#define KPF_REFERENCED 2 -#define KPF_UPTODATE 3 -#define KPF_DIRTY 4 -#define KPF_LRU 5 -#define KPF_ACTIVE 6 -#define KPF_SLAB 7 -#define KPF_WRITEBACK 8 -#define KPF_RECLAIM 9 -#define KPF_BUDDY 10 - -#define kpf_copy_bit(flags, srcpos, dstpos) (((flags >> srcpos) & 1) << dstpos) - -static ssize_t kpageflags_read(struct file *file, char __user *buf, - size_t count, loff_t *ppos) -{ - u64 __user *out = (u64 __user *)buf; - struct page *ppage; - unsigned long src = *ppos; - unsigned long pfn; - ssize_t ret = 0; - u64 kflags, uflags; - - pfn = src / KPMSIZE; - count = min_t(unsigned long, count, (max_pfn * KPMSIZE) - src); - if (src & KPMMASK || count & KPMMASK) - return -EINVAL; - - while (count > 0) { - ppage = NULL; - if (pfn_valid(pfn)) - ppage = pfn_to_page(pfn); - pfn++; - if (!ppage) - kflags = 0; - else - kflags = ppage->flags; - - uflags = kpf_copy_bit(KPF_LOCKED, PG_locked, kflags) | - kpf_copy_bit(kflags, KPF_ERROR, PG_error) | - kpf_copy_bit(kflags, KPF_REFERENCED, PG_referenced) | - kpf_copy_bit(kflags, KPF_UPTODATE, PG_uptodate) | - kpf_copy_bit(kflags, KPF_DIRTY, PG_dirty) | - kpf_copy_bit(kflags, KPF_LRU, PG_lru) | - kpf_copy_bit(kflags, KPF_ACTIVE, PG_active) | - kpf_copy_bit(kflags, KPF_SLAB, PG_slab) | - kpf_copy_bit(kflags, KPF_WRITEBACK, PG_writeback) | - kpf_copy_bit(kflags, KPF_RECLAIM, PG_reclaim) | - kpf_copy_bit(kflags, KPF_BUDDY, PG_buddy); - - if (put_user(uflags, out++)) { - ret = -EFAULT; - break; - } - - count -= KPMSIZE; - } - - *ppos += (char __user *)out - buf; - if (!ret) - ret = (char __user *)out - buf; - return ret; -} - -static const struct file_operations proc_kpageflags_operations = { - .llseek = mem_lseek, - .read = kpageflags_read, -}; - -static int __init proc_page_init(void) -{ - proc_create("kpagecount", S_IRUSR, NULL, &proc_kpagecount_operations); - proc_create("kpageflags", S_IRUSR, NULL, &proc_kpageflags_operations); - return 0; -} -module_init(proc_page_init); diff --git a/trunk/fs/proc/proc_devtree.c b/trunk/fs/proc/proc_devtree.c index d777789b7a89..eca471bc8512 100644 --- a/trunk/fs/proc/proc_devtree.c +++ b/trunk/fs/proc/proc_devtree.c @@ -4,7 +4,6 @@ * Copyright 1997 Paul Mackerras */ #include -#include #include #include #include @@ -215,7 +214,7 @@ void proc_device_tree_add_node(struct device_node *np, /* * Called on initialization to set up the /proc/device-tree subtree */ -void __init proc_device_tree_init(void) +void proc_device_tree_init(void) { struct device_node *root; if ( !have_of ) diff --git a/trunk/fs/proc/proc_misc.c b/trunk/fs/proc/proc_misc.c new file mode 100644 index 000000000000..7ea52c79b2da --- /dev/null +++ b/trunk/fs/proc/proc_misc.c @@ -0,0 +1,933 @@ +/* + * linux/fs/proc/proc_misc.c + * + * linux/fs/proc/array.c + * Copyright (C) 1992 by Linus Torvalds + * based on ideas by Darren Senn + * + * This used to be the part of array.c. See the rest of history and credits + * there. I took this into a separate file and switched the thing to generic + * proc_file_inode_operations, leaving in array.c only per-process stuff. + * Inumbers allocation made dynamic (via create_proc_entry()). AV, May 1999. + * + * Changes: + * Fulton Green : Encapsulated position metric calculations. + * + */ + +#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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "internal.h" + +#define LOAD_INT(x) ((x) >> FSHIFT) +#define LOAD_FRAC(x) LOAD_INT(((x) & (FIXED_1-1)) * 100) +/* + * Warning: stuff below (imported functions) assumes that its output will fit + * into one page. For some of those functions it may be wrong. Moreover, we + * have a way to deal with that gracefully. Right now I used straightforward + * wrappers, but this needs further analysis wrt potential overflows. + */ +extern int get_hardware_list(char *); +extern int get_stram_list(char *); +extern int get_exec_domain_list(char *); + +static int proc_calc_metrics(char *page, char **start, off_t off, + int count, int *eof, int len) +{ + if (len <= off+count) *eof = 1; + *start = page + off; + len -= off; + if (len>count) len = count; + if (len<0) len = 0; + return len; +} + +static int loadavg_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int a, b, c; + int len; + unsigned long seq; + + do { + seq = read_seqbegin(&xtime_lock); + a = avenrun[0] + (FIXED_1/200); + b = avenrun[1] + (FIXED_1/200); + c = avenrun[2] + (FIXED_1/200); + } while (read_seqretry(&xtime_lock, seq)); + + len = sprintf(page,"%d.%02d %d.%02d %d.%02d %ld/%d %d\n", + LOAD_INT(a), LOAD_FRAC(a), + LOAD_INT(b), LOAD_FRAC(b), + LOAD_INT(c), LOAD_FRAC(c), + nr_running(), nr_threads, + task_active_pid_ns(current)->last_pid); + return proc_calc_metrics(page, start, off, count, eof, len); +} + +static int uptime_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct timespec uptime; + struct timespec idle; + int len; + cputime_t idletime = cputime_add(init_task.utime, init_task.stime); + + do_posix_clock_monotonic_gettime(&uptime); + monotonic_to_bootbased(&uptime); + cputime_to_timespec(idletime, &idle); + len = sprintf(page,"%lu.%02lu %lu.%02lu\n", + (unsigned long) uptime.tv_sec, + (uptime.tv_nsec / (NSEC_PER_SEC / 100)), + (unsigned long) idle.tv_sec, + (idle.tv_nsec / (NSEC_PER_SEC / 100))); + + return proc_calc_metrics(page, start, off, count, eof, len); +} + +int __attribute__((weak)) arch_report_meminfo(char *page) +{ + return 0; +} + +static int meminfo_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct sysinfo i; + int len; + unsigned long committed; + unsigned long allowed; + struct vmalloc_info vmi; + long cached; + unsigned long pages[NR_LRU_LISTS]; + int lru; + +/* + * display in kilobytes. + */ +#define K(x) ((x) << (PAGE_SHIFT - 10)) + si_meminfo(&i); + si_swapinfo(&i); + committed = atomic_long_read(&vm_committed_space); + allowed = ((totalram_pages - hugetlb_total_pages()) + * sysctl_overcommit_ratio / 100) + total_swap_pages; + + cached = global_page_state(NR_FILE_PAGES) - + total_swapcache_pages - i.bufferram; + if (cached < 0) + cached = 0; + + get_vmalloc_info(&vmi); + + for (lru = LRU_BASE; lru < NR_LRU_LISTS; lru++) + pages[lru] = global_page_state(NR_LRU_BASE + lru); + + /* + * Tagged format, for easy grepping and expansion. + */ + len = sprintf(page, + "MemTotal: %8lu kB\n" + "MemFree: %8lu kB\n" + "Buffers: %8lu kB\n" + "Cached: %8lu kB\n" + "SwapCached: %8lu kB\n" + "Active: %8lu kB\n" + "Inactive: %8lu kB\n" + "Active(anon): %8lu kB\n" + "Inactive(anon): %8lu kB\n" + "Active(file): %8lu kB\n" + "Inactive(file): %8lu kB\n" +#ifdef CONFIG_UNEVICTABLE_LRU + "Unevictable: %8lu kB\n" + "Mlocked: %8lu kB\n" +#endif +#ifdef CONFIG_HIGHMEM + "HighTotal: %8lu kB\n" + "HighFree: %8lu kB\n" + "LowTotal: %8lu kB\n" + "LowFree: %8lu kB\n" +#endif + "SwapTotal: %8lu kB\n" + "SwapFree: %8lu kB\n" + "Dirty: %8lu kB\n" + "Writeback: %8lu kB\n" + "AnonPages: %8lu kB\n" + "Mapped: %8lu kB\n" + "Slab: %8lu kB\n" + "SReclaimable: %8lu kB\n" + "SUnreclaim: %8lu kB\n" + "PageTables: %8lu kB\n" +#ifdef CONFIG_QUICKLIST + "Quicklists: %8lu kB\n" +#endif + "NFS_Unstable: %8lu kB\n" + "Bounce: %8lu kB\n" + "WritebackTmp: %8lu kB\n" + "CommitLimit: %8lu kB\n" + "Committed_AS: %8lu kB\n" + "VmallocTotal: %8lu kB\n" + "VmallocUsed: %8lu kB\n" + "VmallocChunk: %8lu kB\n", + K(i.totalram), + K(i.freeram), + K(i.bufferram), + K(cached), + K(total_swapcache_pages), + K(pages[LRU_ACTIVE_ANON] + pages[LRU_ACTIVE_FILE]), + K(pages[LRU_INACTIVE_ANON] + pages[LRU_INACTIVE_FILE]), + K(pages[LRU_ACTIVE_ANON]), + K(pages[LRU_INACTIVE_ANON]), + K(pages[LRU_ACTIVE_FILE]), + K(pages[LRU_INACTIVE_FILE]), +#ifdef CONFIG_UNEVICTABLE_LRU + K(pages[LRU_UNEVICTABLE]), + K(global_page_state(NR_MLOCK)), +#endif +#ifdef CONFIG_HIGHMEM + K(i.totalhigh), + K(i.freehigh), + K(i.totalram-i.totalhigh), + K(i.freeram-i.freehigh), +#endif + K(i.totalswap), + K(i.freeswap), + K(global_page_state(NR_FILE_DIRTY)), + K(global_page_state(NR_WRITEBACK)), + K(global_page_state(NR_ANON_PAGES)), + K(global_page_state(NR_FILE_MAPPED)), + K(global_page_state(NR_SLAB_RECLAIMABLE) + + global_page_state(NR_SLAB_UNRECLAIMABLE)), + K(global_page_state(NR_SLAB_RECLAIMABLE)), + K(global_page_state(NR_SLAB_UNRECLAIMABLE)), + K(global_page_state(NR_PAGETABLE)), +#ifdef CONFIG_QUICKLIST + K(quicklist_total_size()), +#endif + K(global_page_state(NR_UNSTABLE_NFS)), + K(global_page_state(NR_BOUNCE)), + K(global_page_state(NR_WRITEBACK_TEMP)), + K(allowed), + K(committed), + (unsigned long)VMALLOC_TOTAL >> 10, + vmi.used >> 10, + vmi.largest_chunk >> 10 + ); + + len += hugetlb_report_meminfo(page + len); + + len += arch_report_meminfo(page + len); + + return proc_calc_metrics(page, start, off, count, eof, len); +#undef K +} + +static int fragmentation_open(struct inode *inode, struct file *file) +{ + (void)inode; + return seq_open(file, &fragmentation_op); +} + +static const struct file_operations fragmentation_file_operations = { + .open = fragmentation_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +static int pagetypeinfo_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &pagetypeinfo_op); +} + +static const struct file_operations pagetypeinfo_file_ops = { + .open = pagetypeinfo_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +static int zoneinfo_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &zoneinfo_op); +} + +static const struct file_operations proc_zoneinfo_file_operations = { + .open = zoneinfo_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +static int version_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len; + + len = snprintf(page, PAGE_SIZE, linux_proc_banner, + utsname()->sysname, + utsname()->release, + utsname()->version); + return proc_calc_metrics(page, start, off, count, eof, len); +} + +extern const struct seq_operations cpuinfo_op; +static int cpuinfo_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &cpuinfo_op); +} + +static const struct file_operations proc_cpuinfo_operations = { + .open = cpuinfo_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +static int devinfo_show(struct seq_file *f, void *v) +{ + int i = *(loff_t *) v; + + if (i < CHRDEV_MAJOR_HASH_SIZE) { + if (i == 0) + seq_printf(f, "Character devices:\n"); + chrdev_show(f, i); + } +#ifdef CONFIG_BLOCK + else { + i -= CHRDEV_MAJOR_HASH_SIZE; + if (i == 0) + seq_printf(f, "\nBlock devices:\n"); + blkdev_show(f, i); + } +#endif + return 0; +} + +static void *devinfo_start(struct seq_file *f, loff_t *pos) +{ + if (*pos < (BLKDEV_MAJOR_HASH_SIZE + CHRDEV_MAJOR_HASH_SIZE)) + return pos; + return NULL; +} + +static void *devinfo_next(struct seq_file *f, void *v, loff_t *pos) +{ + (*pos)++; + if (*pos >= (BLKDEV_MAJOR_HASH_SIZE + CHRDEV_MAJOR_HASH_SIZE)) + return NULL; + return pos; +} + +static void devinfo_stop(struct seq_file *f, void *v) +{ + /* Nothing to do */ +} + +static const struct seq_operations devinfo_ops = { + .start = devinfo_start, + .next = devinfo_next, + .stop = devinfo_stop, + .show = devinfo_show +}; + +static int devinfo_open(struct inode *inode, struct file *filp) +{ + return seq_open(filp, &devinfo_ops); +} + +static const struct file_operations proc_devinfo_operations = { + .open = devinfo_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +static int vmstat_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &vmstat_op); +} +static const struct file_operations proc_vmstat_file_operations = { + .open = vmstat_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +#ifdef CONFIG_PROC_HARDWARE +static int hardware_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len = get_hardware_list(page); + return proc_calc_metrics(page, start, off, count, eof, len); +} +#endif + +#ifdef CONFIG_STRAM_PROC +static int stram_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len = get_stram_list(page); + return proc_calc_metrics(page, start, off, count, eof, len); +} +#endif + +#ifdef CONFIG_BLOCK +static int partitions_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &partitions_op); +} +static const struct file_operations proc_partitions_operations = { + .open = partitions_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +static int diskstats_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &diskstats_op); +} +static const struct file_operations proc_diskstats_operations = { + .open = diskstats_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; +#endif + +#ifdef CONFIG_MODULES +extern const struct seq_operations modules_op; +static int modules_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &modules_op); +} +static const struct file_operations proc_modules_operations = { + .open = modules_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; +#endif + +#ifdef CONFIG_SLABINFO +static int slabinfo_open(struct inode *inode, struct file *file) +{ + return seq_open(file, &slabinfo_op); +} +static const struct file_operations proc_slabinfo_operations = { + .open = slabinfo_open, + .read = seq_read, + .write = slabinfo_write, + .llseek = seq_lseek, + .release = seq_release, +}; + +#ifdef CONFIG_DEBUG_SLAB_LEAK +extern const struct seq_operations slabstats_op; +static int slabstats_open(struct inode *inode, struct file *file) +{ + unsigned long *n = kzalloc(PAGE_SIZE, GFP_KERNEL); + int ret = -ENOMEM; + if (n) { + ret = seq_open(file, &slabstats_op); + if (!ret) { + struct seq_file *m = file->private_data; + *n = PAGE_SIZE / (2 * sizeof(unsigned long)); + m->private = n; + n = NULL; + } + kfree(n); + } + return ret; +} + +static const struct file_operations proc_slabstats_operations = { + .open = slabstats_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release_private, +}; +#endif +#endif + +#ifdef CONFIG_MMU +static int vmalloc_open(struct inode *inode, struct file *file) +{ + unsigned int *ptr = NULL; + int ret; + + if (NUMA_BUILD) + ptr = kmalloc(nr_node_ids * sizeof(unsigned int), GFP_KERNEL); + ret = seq_open(file, &vmalloc_op); + if (!ret) { + struct seq_file *m = file->private_data; + m->private = ptr; + } else + kfree(ptr); + return ret; +} + +static const struct file_operations proc_vmalloc_operations = { + .open = vmalloc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release_private, +}; +#endif + +#ifndef arch_irq_stat_cpu +#define arch_irq_stat_cpu(cpu) 0 +#endif +#ifndef arch_irq_stat +#define arch_irq_stat() 0 +#endif + +static int show_stat(struct seq_file *p, void *v) +{ + int i, j; + unsigned long jif; + cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; + cputime64_t guest; + u64 sum = 0; + struct timespec boottime; + unsigned int per_irq_sum; + + user = nice = system = idle = iowait = + irq = softirq = steal = cputime64_zero; + guest = cputime64_zero; + getboottime(&boottime); + jif = boottime.tv_sec; + + for_each_possible_cpu(i) { + user = cputime64_add(user, kstat_cpu(i).cpustat.user); + nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice); + system = cputime64_add(system, kstat_cpu(i).cpustat.system); + idle = cputime64_add(idle, kstat_cpu(i).cpustat.idle); + iowait = cputime64_add(iowait, kstat_cpu(i).cpustat.iowait); + irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq); + softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); + steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); + guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); + + for_each_irq_nr(j) + sum += kstat_irqs_cpu(j, i); + + sum += arch_irq_stat_cpu(i); + } + sum += arch_irq_stat(); + + seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", + (unsigned long long)cputime64_to_clock_t(user), + (unsigned long long)cputime64_to_clock_t(nice), + (unsigned long long)cputime64_to_clock_t(system), + (unsigned long long)cputime64_to_clock_t(idle), + (unsigned long long)cputime64_to_clock_t(iowait), + (unsigned long long)cputime64_to_clock_t(irq), + (unsigned long long)cputime64_to_clock_t(softirq), + (unsigned long long)cputime64_to_clock_t(steal), + (unsigned long long)cputime64_to_clock_t(guest)); + for_each_online_cpu(i) { + + /* Copy values here to work around gcc-2.95.3, gcc-2.96 */ + user = kstat_cpu(i).cpustat.user; + nice = kstat_cpu(i).cpustat.nice; + system = kstat_cpu(i).cpustat.system; + idle = kstat_cpu(i).cpustat.idle; + iowait = kstat_cpu(i).cpustat.iowait; + irq = kstat_cpu(i).cpustat.irq; + softirq = kstat_cpu(i).cpustat.softirq; + steal = kstat_cpu(i).cpustat.steal; + guest = kstat_cpu(i).cpustat.guest; + seq_printf(p, + "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", + i, + (unsigned long long)cputime64_to_clock_t(user), + (unsigned long long)cputime64_to_clock_t(nice), + (unsigned long long)cputime64_to_clock_t(system), + (unsigned long long)cputime64_to_clock_t(idle), + (unsigned long long)cputime64_to_clock_t(iowait), + (unsigned long long)cputime64_to_clock_t(irq), + (unsigned long long)cputime64_to_clock_t(softirq), + (unsigned long long)cputime64_to_clock_t(steal), + (unsigned long long)cputime64_to_clock_t(guest)); + } + seq_printf(p, "intr %llu", (unsigned long long)sum); + + /* sum again ? it could be updated? */ + for_each_irq_nr(j) { + per_irq_sum = 0; + + for_each_possible_cpu(i) + per_irq_sum += kstat_irqs_cpu(j, i); + + seq_printf(p, " %u", per_irq_sum); + } + + seq_printf(p, + "\nctxt %llu\n" + "btime %lu\n" + "processes %lu\n" + "procs_running %lu\n" + "procs_blocked %lu\n", + nr_context_switches(), + (unsigned long)jif, + total_forks, + nr_running(), + nr_iowait()); + + return 0; +} + +static int stat_open(struct inode *inode, struct file *file) +{ + unsigned size = 4096 * (1 + num_possible_cpus() / 32); + char *buf; + struct seq_file *m; + int res; + + /* don't ask for more than the kmalloc() max size, currently 128 KB */ + if (size > 128 * 1024) + size = 128 * 1024; + buf = kmalloc(size, GFP_KERNEL); + if (!buf) + return -ENOMEM; + + res = single_open(file, show_stat, NULL); + if (!res) { + m = file->private_data; + m->buf = buf; + m->size = size; + } else + kfree(buf); + return res; +} +static const struct file_operations proc_stat_operations = { + .open = stat_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +/* + * /proc/interrupts + */ +static void *int_seq_start(struct seq_file *f, loff_t *pos) +{ + return (*pos <= nr_irqs) ? pos : NULL; +} + + +static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) +{ + (*pos)++; + return (*pos <= nr_irqs) ? pos : NULL; +} + +static void int_seq_stop(struct seq_file *f, void *v) +{ + /* Nothing to do */ +} + +static const struct seq_operations int_seq_ops = { + .start = int_seq_start, + .next = int_seq_next, + .stop = int_seq_stop, + .show = show_interrupts +}; + +static int interrupts_open(struct inode *inode, struct file *filp) +{ + return seq_open(filp, &int_seq_ops); +} + +static const struct file_operations proc_interrupts_operations = { + .open = interrupts_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; + +static int filesystems_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len = get_filesystem_list(page); + return proc_calc_metrics(page, start, off, count, eof, len); +} + +static int cmdline_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len; + + len = sprintf(page, "%s\n", saved_command_line); + return proc_calc_metrics(page, start, off, count, eof, len); +} + +#ifdef CONFIG_FILE_LOCKING +static int locks_open(struct inode *inode, struct file *filp) +{ + return seq_open(filp, &locks_seq_operations); +} + +static const struct file_operations proc_locks_operations = { + .open = locks_open, + .read = seq_read, + .llseek = seq_lseek, + .release = seq_release, +}; +#endif /* CONFIG_FILE_LOCKING */ + +static int execdomains_read_proc(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + int len = get_exec_domain_list(page); + return proc_calc_metrics(page, start, off, count, eof, len); +} + +#ifdef CONFIG_PROC_PAGE_MONITOR +#define KPMSIZE sizeof(u64) +#define KPMMASK (KPMSIZE - 1) +/* /proc/kpagecount - an array exposing page counts + * + * Each entry is a u64 representing the corresponding + * physical page count. + */ +static ssize_t kpagecount_read(struct file *file, char __user *buf, + size_t count, loff_t *ppos) +{ + u64 __user *out = (u64 __user *)buf; + struct page *ppage; + unsigned long src = *ppos; + unsigned long pfn; + ssize_t ret = 0; + u64 pcount; + + pfn = src / KPMSIZE; + count = min_t(size_t, count, (max_pfn * KPMSIZE) - src); + if (src & KPMMASK || count & KPMMASK) + return -EINVAL; + + while (count > 0) { + ppage = NULL; + if (pfn_valid(pfn)) + ppage = pfn_to_page(pfn); + pfn++; + if (!ppage) + pcount = 0; + else + pcount = page_mapcount(ppage); + + if (put_user(pcount, out++)) { + ret = -EFAULT; + break; + } + + count -= KPMSIZE; + } + + *ppos += (char __user *)out - buf; + if (!ret) + ret = (char __user *)out - buf; + return ret; +} + +static struct file_operations proc_kpagecount_operations = { + .llseek = mem_lseek, + .read = kpagecount_read, +}; + +/* /proc/kpageflags - an array exposing page flags + * + * Each entry is a u64 representing the corresponding + * physical page flags. + */ + +/* These macros are used to decouple internal flags from exported ones */ + +#define KPF_LOCKED 0 +#define KPF_ERROR 1 +#define KPF_REFERENCED 2 +#define KPF_UPTODATE 3 +#define KPF_DIRTY 4 +#define KPF_LRU 5 +#define KPF_ACTIVE 6 +#define KPF_SLAB 7 +#define KPF_WRITEBACK 8 +#define KPF_RECLAIM 9 +#define KPF_BUDDY 10 + +#define kpf_copy_bit(flags, srcpos, dstpos) (((flags >> srcpos) & 1) << dstpos) + +static ssize_t kpageflags_read(struct file *file, char __user *buf, + size_t count, loff_t *ppos) +{ + u64 __user *out = (u64 __user *)buf; + struct page *ppage; + unsigned long src = *ppos; + unsigned long pfn; + ssize_t ret = 0; + u64 kflags, uflags; + + pfn = src / KPMSIZE; + count = min_t(unsigned long, count, (max_pfn * KPMSIZE) - src); + if (src & KPMMASK || count & KPMMASK) + return -EINVAL; + + while (count > 0) { + ppage = NULL; + if (pfn_valid(pfn)) + ppage = pfn_to_page(pfn); + pfn++; + if (!ppage) + kflags = 0; + else + kflags = ppage->flags; + + uflags = kpf_copy_bit(KPF_LOCKED, PG_locked, kflags) | + kpf_copy_bit(kflags, KPF_ERROR, PG_error) | + kpf_copy_bit(kflags, KPF_REFERENCED, PG_referenced) | + kpf_copy_bit(kflags, KPF_UPTODATE, PG_uptodate) | + kpf_copy_bit(kflags, KPF_DIRTY, PG_dirty) | + kpf_copy_bit(kflags, KPF_LRU, PG_lru) | + kpf_copy_bit(kflags, KPF_ACTIVE, PG_active) | + kpf_copy_bit(kflags, KPF_SLAB, PG_slab) | + kpf_copy_bit(kflags, KPF_WRITEBACK, PG_writeback) | + kpf_copy_bit(kflags, KPF_RECLAIM, PG_reclaim) | + kpf_copy_bit(kflags, KPF_BUDDY, PG_buddy); + + if (put_user(uflags, out++)) { + ret = -EFAULT; + break; + } + + count -= KPMSIZE; + } + + *ppos += (char __user *)out - buf; + if (!ret) + ret = (char __user *)out - buf; + return ret; +} + +static struct file_operations proc_kpageflags_operations = { + .llseek = mem_lseek, + .read = kpageflags_read, +}; +#endif /* CONFIG_PROC_PAGE_MONITOR */ + +struct proc_dir_entry *proc_root_kcore; + +void __init proc_misc_init(void) +{ + static struct { + char *name; + int (*read_proc)(char*,char**,off_t,int,int*,void*); + } *p, simple_ones[] = { + {"loadavg", loadavg_read_proc}, + {"uptime", uptime_read_proc}, + {"meminfo", meminfo_read_proc}, + {"version", version_read_proc}, +#ifdef CONFIG_PROC_HARDWARE + {"hardware", hardware_read_proc}, +#endif +#ifdef CONFIG_STRAM_PROC + {"stram", stram_read_proc}, +#endif + {"filesystems", filesystems_read_proc}, + {"cmdline", cmdline_read_proc}, + {"execdomains", execdomains_read_proc}, + {NULL,} + }; + for (p = simple_ones; p->name; p++) + create_proc_read_entry(p->name, 0, NULL, p->read_proc, NULL); + + proc_symlink("mounts", NULL, "self/mounts"); + + /* And now for trickier ones */ +#ifdef CONFIG_PRINTK + proc_create("kmsg", S_IRUSR, NULL, &proc_kmsg_operations); +#endif +#ifdef CONFIG_FILE_LOCKING + proc_create("locks", 0, NULL, &proc_locks_operations); +#endif + proc_create("devices", 0, NULL, &proc_devinfo_operations); + proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations); +#ifdef CONFIG_BLOCK + proc_create("partitions", 0, NULL, &proc_partitions_operations); +#endif + proc_create("stat", 0, NULL, &proc_stat_operations); + proc_create("interrupts", 0, NULL, &proc_interrupts_operations); +#ifdef CONFIG_SLABINFO + proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations); +#ifdef CONFIG_DEBUG_SLAB_LEAK + proc_create("slab_allocators", 0, NULL, &proc_slabstats_operations); +#endif +#endif +#ifdef CONFIG_MMU + proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations); +#endif + proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations); + proc_create("pagetypeinfo", S_IRUGO, NULL, &pagetypeinfo_file_ops); + proc_create("vmstat", S_IRUGO, NULL, &proc_vmstat_file_operations); + proc_create("zoneinfo", S_IRUGO, NULL, &proc_zoneinfo_file_operations); +#ifdef CONFIG_BLOCK + proc_create("diskstats", 0, NULL, &proc_diskstats_operations); +#endif +#ifdef CONFIG_MODULES + proc_create("modules", 0, NULL, &proc_modules_operations); +#endif +#ifdef CONFIG_SCHEDSTATS + proc_create("schedstat", 0, NULL, &proc_schedstat_operations); +#endif +#ifdef CONFIG_PROC_KCORE + proc_root_kcore = proc_create("kcore", S_IRUSR, NULL, &proc_kcore_operations); + if (proc_root_kcore) + proc_root_kcore->size = + (size_t)high_memory - PAGE_OFFSET + PAGE_SIZE; +#endif +#ifdef CONFIG_PROC_PAGE_MONITOR + proc_create("kpagecount", S_IRUSR, NULL, &proc_kpagecount_operations); + proc_create("kpageflags", S_IRUSR, NULL, &proc_kpageflags_operations); +#endif +#ifdef CONFIG_PROC_VMCORE + proc_vmcore = proc_create("vmcore", S_IRUSR, NULL, &proc_vmcore_operations); +#endif +} diff --git a/trunk/fs/proc/proc_sysctl.c b/trunk/fs/proc/proc_sysctl.c index 94fcfff6863a..7b997754a25e 100644 --- a/trunk/fs/proc/proc_sysctl.c +++ b/trunk/fs/proc/proc_sysctl.c @@ -1,7 +1,7 @@ /* * /proc/sys support */ -#include + #include #include #include @@ -402,7 +402,7 @@ static struct dentry_operations proc_sys_dentry_operations = { .d_compare = proc_sys_compare, }; -int __init proc_sys_init(void) +int proc_sys_init(void) { struct proc_dir_entry *proc_sys_root; diff --git a/trunk/fs/proc/root.c b/trunk/fs/proc/root.c index 7761602af9de..95117538a4f6 100644 --- a/trunk/fs/proc/root.c +++ b/trunk/fs/proc/root.c @@ -104,9 +104,9 @@ static struct file_system_type proc_fs_type = { void __init proc_root_init(void) { - int err; - - proc_init_inodecache(); + int err = proc_init_inodecache(); + if (err) + return; err = register_filesystem(&proc_fs_type); if (err) return; @@ -117,7 +117,7 @@ void __init proc_root_init(void) return; } - proc_symlink("mounts", NULL, "self/mounts"); + proc_misc_init(); proc_net_init(); diff --git a/trunk/fs/proc/stat.c b/trunk/fs/proc/stat.c deleted file mode 100644 index 81904f07679d..000000000000 --- a/trunk/fs/proc/stat.c +++ /dev/null @@ -1,153 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef arch_irq_stat_cpu -#define arch_irq_stat_cpu(cpu) 0 -#endif -#ifndef arch_irq_stat -#define arch_irq_stat() 0 -#endif - -static int show_stat(struct seq_file *p, void *v) -{ - int i, j; - unsigned long jif; - cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; - cputime64_t guest; - u64 sum = 0; - struct timespec boottime; - unsigned int per_irq_sum; - - user = nice = system = idle = iowait = - irq = softirq = steal = cputime64_zero; - guest = cputime64_zero; - getboottime(&boottime); - jif = boottime.tv_sec; - - for_each_possible_cpu(i) { - user = cputime64_add(user, kstat_cpu(i).cpustat.user); - nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice); - system = cputime64_add(system, kstat_cpu(i).cpustat.system); - idle = cputime64_add(idle, kstat_cpu(i).cpustat.idle); - iowait = cputime64_add(iowait, kstat_cpu(i).cpustat.iowait); - irq = cputime64_add(irq, kstat_cpu(i).cpustat.irq); - softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); - steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); - guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); - - for_each_irq_nr(j) - sum += kstat_irqs_cpu(j, i); - - sum += arch_irq_stat_cpu(i); - } - sum += arch_irq_stat(); - - seq_printf(p, "cpu %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", - (unsigned long long)cputime64_to_clock_t(user), - (unsigned long long)cputime64_to_clock_t(nice), - (unsigned long long)cputime64_to_clock_t(system), - (unsigned long long)cputime64_to_clock_t(idle), - (unsigned long long)cputime64_to_clock_t(iowait), - (unsigned long long)cputime64_to_clock_t(irq), - (unsigned long long)cputime64_to_clock_t(softirq), - (unsigned long long)cputime64_to_clock_t(steal), - (unsigned long long)cputime64_to_clock_t(guest)); - for_each_online_cpu(i) { - - /* Copy values here to work around gcc-2.95.3, gcc-2.96 */ - user = kstat_cpu(i).cpustat.user; - nice = kstat_cpu(i).cpustat.nice; - system = kstat_cpu(i).cpustat.system; - idle = kstat_cpu(i).cpustat.idle; - iowait = kstat_cpu(i).cpustat.iowait; - irq = kstat_cpu(i).cpustat.irq; - softirq = kstat_cpu(i).cpustat.softirq; - steal = kstat_cpu(i).cpustat.steal; - guest = kstat_cpu(i).cpustat.guest; - seq_printf(p, - "cpu%d %llu %llu %llu %llu %llu %llu %llu %llu %llu\n", - i, - (unsigned long long)cputime64_to_clock_t(user), - (unsigned long long)cputime64_to_clock_t(nice), - (unsigned long long)cputime64_to_clock_t(system), - (unsigned long long)cputime64_to_clock_t(idle), - (unsigned long long)cputime64_to_clock_t(iowait), - (unsigned long long)cputime64_to_clock_t(irq), - (unsigned long long)cputime64_to_clock_t(softirq), - (unsigned long long)cputime64_to_clock_t(steal), - (unsigned long long)cputime64_to_clock_t(guest)); - } - seq_printf(p, "intr %llu", (unsigned long long)sum); - - /* sum again ? it could be updated? */ - for_each_irq_nr(j) { - per_irq_sum = 0; - - for_each_possible_cpu(i) - per_irq_sum += kstat_irqs_cpu(j, i); - - seq_printf(p, " %u", per_irq_sum); - } - - seq_printf(p, - "\nctxt %llu\n" - "btime %lu\n" - "processes %lu\n" - "procs_running %lu\n" - "procs_blocked %lu\n", - nr_context_switches(), - (unsigned long)jif, - total_forks, - nr_running(), - nr_iowait()); - - return 0; -} - -static int stat_open(struct inode *inode, struct file *file) -{ - unsigned size = 4096 * (1 + num_possible_cpus() / 32); - char *buf; - struct seq_file *m; - int res; - - /* don't ask for more than the kmalloc() max size, currently 128 KB */ - if (size > 128 * 1024) - size = 128 * 1024; - buf = kmalloc(size, GFP_KERNEL); - if (!buf) - return -ENOMEM; - - res = single_open(file, show_stat, NULL); - if (!res) { - m = file->private_data; - m->buf = buf; - m->size = size; - } else - kfree(buf); - return res; -} - -static const struct file_operations proc_stat_operations = { - .open = stat_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int __init proc_stat_init(void) -{ - proc_create("stat", 0, NULL, &proc_stat_operations); - return 0; -} -module_init(proc_stat_init); diff --git a/trunk/fs/proc/task_mmu.c b/trunk/fs/proc/task_mmu.c index b770c095e45c..4806830ea2a1 100644 --- a/trunk/fs/proc/task_mmu.c +++ b/trunk/fs/proc/task_mmu.c @@ -198,8 +198,11 @@ static int do_maps_open(struct inode *inode, struct file *file, return ret; } -static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma) +static int show_map(struct seq_file *m, void *v) { + struct proc_maps_private *priv = m->private; + struct task_struct *task = priv->task; + struct vm_area_struct *vma = v; struct mm_struct *mm = vma->vm_mm; struct file *file = vma->vm_file; int flags = vma->vm_flags; @@ -251,15 +254,6 @@ static void show_map_vma(struct seq_file *m, struct vm_area_struct *vma) } } seq_putc(m, '\n'); -} - -static int show_map(struct seq_file *m, void *v) -{ - struct vm_area_struct *vma = v; - struct proc_maps_private *priv = m->private; - struct task_struct *task = priv->task; - - show_map_vma(m, vma); if (m->count < m->size) /* vma is copied successfully */ m->version = (vma != get_gate_vma(task))? vma->vm_start: 0; @@ -370,10 +364,9 @@ static int smaps_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, static int show_smap(struct seq_file *m, void *v) { - struct proc_maps_private *priv = m->private; - struct task_struct *task = priv->task; struct vm_area_struct *vma = v; struct mem_size_stats mss; + int ret; struct mm_walk smaps_walk = { .pmd_entry = smaps_pte_range, .mm = vma->vm_mm, @@ -385,7 +378,9 @@ static int show_smap(struct seq_file *m, void *v) if (vma->vm_mm && !is_vm_hugetlb_page(vma)) walk_page_range(vma->vm_start, vma->vm_end, &smaps_walk); - show_map_vma(m, vma); + ret = show_map(m, v); + if (ret) + return ret; seq_printf(m, "Size: %8lu kB\n" @@ -407,9 +402,7 @@ static int show_smap(struct seq_file *m, void *v) mss.referenced >> 10, mss.swap >> 10); - if (m->count < m->size) /* vma is copied successfully */ - m->version = (vma != get_gate_vma(task)) ? vma->vm_start : 0; - return 0; + return ret; } static const struct seq_operations proc_pid_smaps_op = { diff --git a/trunk/fs/proc/uptime.c b/trunk/fs/proc/uptime.c deleted file mode 100644 index 0c10a0b3f146..000000000000 --- a/trunk/fs/proc/uptime.c +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include - -static int uptime_proc_show(struct seq_file *m, void *v) -{ - struct timespec uptime; - struct timespec idle; - cputime_t idletime = cputime_add(init_task.utime, init_task.stime); - - do_posix_clock_monotonic_gettime(&uptime); - monotonic_to_bootbased(&uptime); - cputime_to_timespec(idletime, &idle); - seq_printf(m, "%lu.%02lu %lu.%02lu\n", - (unsigned long) uptime.tv_sec, - (uptime.tv_nsec / (NSEC_PER_SEC / 100)), - (unsigned long) idle.tv_sec, - (idle.tv_nsec / (NSEC_PER_SEC / 100))); - return 0; -} - -static int uptime_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, uptime_proc_show, NULL); -} - -static const struct file_operations uptime_proc_fops = { - .open = uptime_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int __init proc_uptime_init(void) -{ - proc_create("uptime", 0, NULL, &uptime_proc_fops); - return 0; -} -module_init(proc_uptime_init); diff --git a/trunk/fs/proc/version.c b/trunk/fs/proc/version.c deleted file mode 100644 index 76817a60678c..000000000000 --- a/trunk/fs/proc/version.c +++ /dev/null @@ -1,34 +0,0 @@ -#include -#include -#include -#include -#include -#include - -static int version_proc_show(struct seq_file *m, void *v) -{ - seq_printf(m, linux_proc_banner, - utsname()->sysname, - utsname()->release, - utsname()->version); - return 0; -} - -static int version_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, version_proc_show, NULL); -} - -static const struct file_operations version_proc_fops = { - .open = version_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int __init proc_version_init(void) -{ - proc_create("version", 0, NULL, &version_proc_fops); - return 0; -} -module_init(proc_version_init); diff --git a/trunk/fs/proc/vmcore.c b/trunk/fs/proc/vmcore.c index 03ec59504906..cd9ca67f841b 100644 --- a/trunk/fs/proc/vmcore.c +++ b/trunk/fs/proc/vmcore.c @@ -32,7 +32,7 @@ static size_t elfcorebuf_sz; /* Total size of vmcore file. */ static u64 vmcore_size; -static struct proc_dir_entry *proc_vmcore = NULL; +struct proc_dir_entry *proc_vmcore = NULL; /* Reads a page from the oldmem device from given offset. */ static ssize_t read_from_oldmem(char *buf, size_t count, @@ -162,7 +162,7 @@ static ssize_t read_vmcore(struct file *file, char __user *buffer, return acc; } -static const struct file_operations proc_vmcore_operations = { +const struct file_operations proc_vmcore_operations = { .read = read_vmcore, }; @@ -652,7 +652,7 @@ static int __init vmcore_init(void) return rc; } - proc_vmcore = proc_create("vmcore", S_IRUSR, NULL, &proc_vmcore_operations); + /* Initialize /proc/vmcore size if proc is already up. */ if (proc_vmcore) proc_vmcore->size = vmcore_size; return 0; diff --git a/trunk/include/asm-m68k/machdep.h b/trunk/include/asm-m68k/machdep.h index 5637dcef314e..26d2b91209c5 100644 --- a/trunk/include/asm-m68k/machdep.h +++ b/trunk/include/asm-m68k/machdep.h @@ -14,7 +14,7 @@ extern void (*mach_sched_init) (irq_handler_t handler); /* machine dependent irq functions */ extern void (*mach_init_IRQ) (void); extern void (*mach_get_model) (char *model); -extern void (*mach_get_hardware_list) (struct seq_file *m); +extern int (*mach_get_hardware_list) (char *buffer); /* machine dependent timer functions */ extern unsigned long (*mach_gettimeoffset)(void); extern int (*mach_hwclk)(int, struct rtc_time*); diff --git a/trunk/include/linux/crash_dump.h b/trunk/include/linux/crash_dump.h index 2dac064d8359..0acf3b737e2e 100644 --- a/trunk/include/linux/crash_dump.h +++ b/trunk/include/linux/crash_dump.h @@ -14,6 +14,8 @@ extern unsigned long long elfcorehdr_addr; extern ssize_t copy_oldmem_page(unsigned long, char *, size_t, unsigned long, int); +extern const struct file_operations proc_vmcore_operations; +extern struct proc_dir_entry *proc_vmcore; /* Architecture code defines this if there are other possible ELF * machine types, e.g. on bi-arch capable hardware. */ diff --git a/trunk/include/linux/fs.h b/trunk/include/linux/fs.h index 5b248d61430c..43659ae52e4d 100644 --- a/trunk/include/linux/fs.h +++ b/trunk/include/linux/fs.h @@ -1042,6 +1042,7 @@ extern int vfs_setlease(struct file *, long, struct file_lock **); extern int lease_modify(struct file_lock **, int); extern int lock_may_read(struct inode *, loff_t start, unsigned long count); extern int lock_may_write(struct inode *, loff_t start, unsigned long count); +extern struct seq_operations locks_seq_operations; #else /* !CONFIG_FILE_LOCKING */ #define fcntl_getlk(a, b) ({ -EINVAL; }) #define fcntl_setlk(a, b, c, d) ({ -EACCES; }) diff --git a/trunk/include/linux/genhd.h b/trunk/include/linux/genhd.h index e439e6aed832..206cdf96c3a7 100644 --- a/trunk/include/linux/genhd.h +++ b/trunk/include/linux/genhd.h @@ -25,6 +25,9 @@ extern struct device_type part_type; extern struct kobject *block_depr; extern struct class block_class; +extern const struct seq_operations partitions_op; +extern const struct seq_operations diskstats_op; + enum { /* These three have identical behaviour; use the second one if DOS FDISK gets confused about extended/logical partitions starting past cylinder 1023. */ diff --git a/trunk/include/linux/hugetlb.h b/trunk/include/linux/hugetlb.h index e1c8afc002c0..32e0ef0f6e1f 100644 --- a/trunk/include/linux/hugetlb.h +++ b/trunk/include/linux/hugetlb.h @@ -27,7 +27,7 @@ void unmap_hugepage_range(struct vm_area_struct *, void __unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long, struct page *); int hugetlb_prefault(struct address_space *, struct vm_area_struct *); -void hugetlb_report_meminfo(struct seq_file *); +int hugetlb_report_meminfo(char *); int hugetlb_report_node_meminfo(int, char *); unsigned long hugetlb_total_pages(void); int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, @@ -79,9 +79,7 @@ static inline unsigned long hugetlb_total_pages(void) #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) #define unmap_hugepage_range(vma, start, end, page) BUG() -static inline void hugetlb_report_meminfo(struct seq_file *m) -{ -} +#define hugetlb_report_meminfo(buf) 0 #define hugetlb_report_node_meminfo(n, buf) 0 #define follow_huge_pmd(mm, addr, pmd, write) NULL #define follow_huge_pud(mm, addr, pud, write) NULL diff --git a/trunk/include/linux/proc_fs.h b/trunk/include/linux/proc_fs.h index b8bdb96eff78..27d534f4470d 100644 --- a/trunk/include/linux/proc_fs.h +++ b/trunk/include/linux/proc_fs.h @@ -97,9 +97,12 @@ struct vmcore { #ifdef CONFIG_PROC_FS +extern struct proc_dir_entry *proc_root_kcore; + extern spinlock_t proc_subdir_lock; extern void proc_root_init(void); +extern void proc_misc_init(void); void proc_flush_task(struct task_struct *task); struct dentry *proc_pid_lookup(struct inode *dir, struct dentry * dentry, struct nameidata *); @@ -135,6 +138,8 @@ extern struct inode *proc_get_inode(struct super_block *, unsigned int, struct p extern int proc_readdir(struct file *, void *, filldir_t); extern struct dentry *proc_lookup(struct inode *, struct dentry *, struct nameidata *); +extern const struct file_operations proc_kcore_operations; + extern int pid_ns_prepare_proc(struct pid_namespace *ns); extern void pid_ns_release_proc(struct pid_namespace *ns); diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index 8478f334d732..5ca620573d47 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -680,6 +680,10 @@ struct sched_info { }; #endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ +#ifdef CONFIG_SCHEDSTATS +extern const struct file_operations proc_schedstat_operations; +#endif /* CONFIG_SCHEDSTATS */ + #ifdef CONFIG_TASK_DELAY_ACCT struct task_delay_info { spinlock_t lock; diff --git a/trunk/include/linux/slab.h b/trunk/include/linux/slab.h index ba965c84ae06..5ff9676c1e2c 100644 --- a/trunk/include/linux/slab.h +++ b/trunk/include/linux/slab.h @@ -288,4 +288,9 @@ static inline void *kzalloc_node(size_t size, gfp_t flags, int node) return kmalloc_node(size, flags | __GFP_ZERO, node); } +#ifdef CONFIG_SLABINFO +extern const struct seq_operations slabinfo_op; +ssize_t slabinfo_write(struct file *, const char __user *, size_t, loff_t *); +#endif + #endif /* _LINUX_SLAB_H */ diff --git a/trunk/include/linux/vmalloc.h b/trunk/include/linux/vmalloc.h index 307b88577eaa..4c28c4d564e2 100644 --- a/trunk/include/linux/vmalloc.h +++ b/trunk/include/linux/vmalloc.h @@ -103,4 +103,6 @@ extern void free_vm_area(struct vm_struct *area); extern rwlock_t vmlist_lock; extern struct vm_struct *vmlist; +extern const struct seq_operations vmalloc_op; + #endif /* _LINUX_VMALLOC_H */ diff --git a/trunk/include/linux/vmstat.h b/trunk/include/linux/vmstat.h index 524cd1b28ecb..9cd3ab0f554d 100644 --- a/trunk/include/linux/vmstat.h +++ b/trunk/include/linux/vmstat.h @@ -54,6 +54,10 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, NR_VM_EVENT_ITEMS }; +extern const struct seq_operations fragmentation_op; +extern const struct seq_operations pagetypeinfo_op; +extern const struct seq_operations zoneinfo_op; +extern const struct seq_operations vmstat_op; extern int sysctl_stat_interval; #ifdef CONFIG_VM_EVENT_COUNTERS diff --git a/trunk/kernel/exec_domain.c b/trunk/kernel/exec_domain.c index 0511716e9424..0d407e886735 100644 --- a/trunk/kernel/exec_domain.c +++ b/trunk/kernel/exec_domain.c @@ -12,9 +12,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -175,39 +173,20 @@ __set_personality(u_long personality) return 0; } -#ifdef CONFIG_PROC_FS -static int execdomains_proc_show(struct seq_file *m, void *v) +int +get_exec_domain_list(char *page) { struct exec_domain *ep; + int len = 0; read_lock(&exec_domains_lock); - for (ep = exec_domains; ep; ep = ep->next) - seq_printf(m, "%d-%d\t%-16s\t[%s]\n", + for (ep = exec_domains; ep && len < PAGE_SIZE - 80; ep = ep->next) + len += sprintf(page + len, "%d-%d\t%-16s\t[%s]\n", ep->pers_low, ep->pers_high, ep->name, module_name(ep->module)); read_unlock(&exec_domains_lock); - return 0; -} - -static int execdomains_proc_open(struct inode *inode, struct file *file) -{ - return single_open(file, execdomains_proc_show, NULL); -} - -static const struct file_operations execdomains_proc_fops = { - .open = execdomains_proc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int __init proc_execdomains_init(void) -{ - proc_create("execdomains", 0, NULL, &execdomains_proc_fops); - return 0; + return (len); } -module_init(proc_execdomains_init); -#endif asmlinkage long sys_personality(u_long personality) diff --git a/trunk/kernel/module.c b/trunk/kernel/module.c index 1f4cc00e0c20..c0f1826e2d9e 100644 --- a/trunk/kernel/module.c +++ b/trunk/kernel/module.c @@ -20,13 +20,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -2558,6 +2556,23 @@ unsigned long module_kallsyms_lookup_name(const char *name) } #endif /* CONFIG_KALLSYMS */ +/* Called by the /proc file system to return a list of modules. */ +static void *m_start(struct seq_file *m, loff_t *pos) +{ + mutex_lock(&module_mutex); + return seq_list_start(&modules, *pos); +} + +static void *m_next(struct seq_file *m, void *p, loff_t *pos) +{ + return seq_list_next(p, &modules, pos); +} + +static void m_stop(struct seq_file *m, void *p) +{ + mutex_unlock(&module_mutex); +} + static char *module_flags(struct module *mod, char *buf) { int bx = 0; @@ -2591,24 +2606,6 @@ static char *module_flags(struct module *mod, char *buf) return buf; } -#ifdef CONFIG_PROC_FS -/* Called by the /proc file system to return a list of modules. */ -static void *m_start(struct seq_file *m, loff_t *pos) -{ - mutex_lock(&module_mutex); - return seq_list_start(&modules, *pos); -} - -static void *m_next(struct seq_file *m, void *p, loff_t *pos) -{ - return seq_list_next(p, &modules, pos); -} - -static void m_stop(struct seq_file *m, void *p) -{ - mutex_unlock(&module_mutex); -} - static int m_show(struct seq_file *m, void *p) { struct module *mod = list_entry(p, struct module, list); @@ -2639,33 +2636,13 @@ static int m_show(struct seq_file *m, void *p) Where refcount is a number or -, and deps is a comma-separated list of depends or -. */ -static const struct seq_operations modules_op = { +const struct seq_operations modules_op = { .start = m_start, .next = m_next, .stop = m_stop, .show = m_show }; -static int modules_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &modules_op); -} - -static const struct file_operations proc_modules_operations = { - .open = modules_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - -static int __init proc_modules_init(void) -{ - proc_create("modules", 0, NULL, &proc_modules_operations); - return 0; -} -module_init(proc_modules_init); -#endif - /* Given an address, look for it in the module exception tables. */ const struct exception_table_entry *search_module_extables(unsigned long addr) { diff --git a/trunk/kernel/params.c b/trunk/kernel/params.c index a1e3025b19a9..b077f1b045d3 100644 --- a/trunk/kernel/params.c +++ b/trunk/kernel/params.c @@ -510,7 +510,6 @@ static __modinit int add_sysfs_param(struct module_kobject *mk, return err; } -#ifdef CONFIG_MODULES static void free_module_param_attrs(struct module_kobject *mk) { kfree(mk->mp->grp.attrs); @@ -518,6 +517,7 @@ static void free_module_param_attrs(struct module_kobject *mk) mk->mp = NULL; } +#ifdef CONFIG_MODULES /* * module_param_sysfs_setup - setup sysfs support for one module * @mod: module diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 6625c3c4b10d..1645c7211944 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -55,7 +55,6 @@ #include #include #include -#include #include #include #include diff --git a/trunk/kernel/sched_stats.h b/trunk/kernel/sched_stats.h index ee71bec1da66..2df9d297d292 100644 --- a/trunk/kernel/sched_stats.h +++ b/trunk/kernel/sched_stats.h @@ -90,20 +90,13 @@ static int schedstat_open(struct inode *inode, struct file *file) return res; } -static const struct file_operations proc_schedstat_operations = { +const struct file_operations proc_schedstat_operations = { .open = schedstat_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static int __init proc_schedstat_init(void) -{ - proc_create("schedstat", 0, NULL, &proc_schedstat_operations); - return 0; -} -module_init(proc_schedstat_init); - /* * Expects runqueue lock to be held for atomicity of update */ diff --git a/trunk/lib/string_helpers.c b/trunk/lib/string_helpers.c index ab431d4cc970..8347925030ff 100644 --- a/trunk/lib/string_helpers.c +++ b/trunk/lib/string_helpers.c @@ -23,7 +23,7 @@ int string_get_size(u64 size, const enum string_size_units units, char *buf, int len) { - const char *units_10[] = { "B", "kB", "MB", "GB", "TB", "PB", + const char *units_10[] = { "B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB", NULL}; const char *units_2[] = {"B", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB", "ZiB", "YiB", NULL }; @@ -31,7 +31,7 @@ int string_get_size(u64 size, const enum string_size_units units, [STRING_UNITS_10] = units_10, [STRING_UNITS_2] = units_2, }; - const unsigned int divisor[] = { + const int divisor[] = { [STRING_UNITS_10] = 1000, [STRING_UNITS_2] = 1024, }; @@ -40,27 +40,23 @@ int string_get_size(u64 size, const enum string_size_units units, char tmp[8]; tmp[0] = '\0'; - i = 0; - if (size >= divisor[units]) { - while (size >= divisor[units] && units_str[units][i]) { - remainder = do_div(size, divisor[units]); - i++; - } - sf_cap = size; - for (j = 0; sf_cap*10 < 1000; j++) - sf_cap *= 10; + for (i = 0; size > divisor[units] && units_str[units][i]; i++) + remainder = do_div(size, divisor[units]); - if (j) { - remainder *= 1000; - do_div(remainder, divisor[units]); - snprintf(tmp, sizeof(tmp), ".%03lld", - (unsigned long long)remainder); - tmp[j+1] = '\0'; - } + sf_cap = size; + for (j = 0; sf_cap*10 < 1000; j++) + sf_cap *= 10; + + if (j) { + remainder *= 1000; + do_div(remainder, divisor[units]); + snprintf(tmp, sizeof(tmp), ".%03lld", + (unsigned long long)remainder); + tmp[j+1] = '\0'; } - snprintf(buf, len, "%lld%s %s", (unsigned long long)size, + snprintf(buf, len, "%lld%s%s", (unsigned long long)size, tmp, units_str[units][i]); return 0; diff --git a/trunk/mm/hugetlb.c b/trunk/mm/hugetlb.c index 421aee99b84a..ce8cbb29860b 100644 --- a/trunk/mm/hugetlb.c +++ b/trunk/mm/hugetlb.c @@ -7,7 +7,6 @@ #include #include #include -#include #include #include #include @@ -1456,10 +1455,10 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write, #endif /* CONFIG_SYSCTL */ -void hugetlb_report_meminfo(struct seq_file *m) +int hugetlb_report_meminfo(char *buf) { struct hstate *h = &default_hstate; - seq_printf(m, + return sprintf(buf, "HugePages_Total: %5lu\n" "HugePages_Free: %5lu\n" "HugePages_Rsvd: %5lu\n" diff --git a/trunk/mm/slab.c b/trunk/mm/slab.c index 09187517f9dc..e76eee466886 100644 --- a/trunk/mm/slab.c +++ b/trunk/mm/slab.c @@ -95,7 +95,6 @@ #include #include #include -#include #include #include #include @@ -4259,7 +4258,7 @@ static int s_show(struct seq_file *m, void *p) * + further values on SMP and with statistics enabled */ -static const struct seq_operations slabinfo_op = { +const struct seq_operations slabinfo_op = { .start = s_start, .next = s_next, .stop = s_stop, @@ -4316,19 +4315,6 @@ ssize_t slabinfo_write(struct file *file, const char __user * buffer, return res; } -static int slabinfo_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &slabinfo_op); -} - -static const struct file_operations proc_slabinfo_operations = { - .open = slabinfo_open, - .read = seq_read, - .write = slabinfo_write, - .llseek = seq_lseek, - .release = seq_release, -}; - #ifdef CONFIG_DEBUG_SLAB_LEAK static void *leaks_start(struct seq_file *m, loff_t *pos) @@ -4457,47 +4443,13 @@ static int leaks_show(struct seq_file *m, void *p) return 0; } -static const struct seq_operations slabstats_op = { +const struct seq_operations slabstats_op = { .start = leaks_start, .next = s_next, .stop = s_stop, .show = leaks_show, }; - -static int slabstats_open(struct inode *inode, struct file *file) -{ - unsigned long *n = kzalloc(PAGE_SIZE, GFP_KERNEL); - int ret = -ENOMEM; - if (n) { - ret = seq_open(file, &slabstats_op); - if (!ret) { - struct seq_file *m = file->private_data; - *n = PAGE_SIZE / (2 * sizeof(unsigned long)); - m->private = n; - n = NULL; - } - kfree(n); - } - return ret; -} - -static const struct file_operations proc_slabstats_operations = { - .open = slabstats_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release_private, -}; -#endif - -static int __init slab_proc_init(void) -{ - proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations); -#ifdef CONFIG_DEBUG_SLAB_LEAK - proc_create("slab_allocators", 0, NULL, &proc_slabstats_operations); #endif - return 0; -} -module_init(slab_proc_init); #endif /** diff --git a/trunk/mm/slub.c b/trunk/mm/slub.c index 7ad489af9561..0c83e6afe7b2 100644 --- a/trunk/mm/slub.c +++ b/trunk/mm/slub.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -4418,6 +4417,14 @@ __initcall(slab_sysfs_init); * The /proc/slabinfo ABI */ #ifdef CONFIG_SLABINFO + +ssize_t slabinfo_write(struct file *file, const char __user *buffer, + size_t count, loff_t *ppos) +{ + return -EINVAL; +} + + static void print_slabinfo_header(struct seq_file *m) { seq_puts(m, "slabinfo - version: 2.1\n"); @@ -4485,29 +4492,11 @@ static int s_show(struct seq_file *m, void *p) return 0; } -static const struct seq_operations slabinfo_op = { +const struct seq_operations slabinfo_op = { .start = s_start, .next = s_next, .stop = s_stop, .show = s_show, }; -static int slabinfo_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &slabinfo_op); -} - -static const struct file_operations proc_slabinfo_operations = { - .open = slabinfo_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - -static int __init slab_proc_init(void) -{ - proc_create("slabinfo",S_IWUSR|S_IRUGO,NULL,&proc_slabinfo_operations); - return 0; -} -module_init(slab_proc_init); #endif /* CONFIG_SLABINFO */ diff --git a/trunk/mm/vmalloc.c b/trunk/mm/vmalloc.c index 036536945dd9..65ae576030da 100644 --- a/trunk/mm/vmalloc.c +++ b/trunk/mm/vmalloc.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -1719,41 +1718,11 @@ static int s_show(struct seq_file *m, void *p) return 0; } -static const struct seq_operations vmalloc_op = { +const struct seq_operations vmalloc_op = { .start = s_start, .next = s_next, .stop = s_stop, .show = s_show, }; - -static int vmalloc_open(struct inode *inode, struct file *file) -{ - unsigned int *ptr = NULL; - int ret; - - if (NUMA_BUILD) - ptr = kmalloc(nr_node_ids * sizeof(unsigned int), GFP_KERNEL); - ret = seq_open(file, &vmalloc_op); - if (!ret) { - struct seq_file *m = file->private_data; - m->private = ptr; - } else - kfree(ptr); - return ret; -} - -static const struct file_operations proc_vmalloc_operations = { - .open = vmalloc_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release_private, -}; - -static int __init proc_vmalloc_init(void) -{ - proc_create("vmallocinfo", S_IRUSR, NULL, &proc_vmalloc_operations); - return 0; -} -module_init(proc_vmalloc_init); #endif diff --git a/trunk/mm/vmstat.c b/trunk/mm/vmstat.c index c3ccfda23adc..9343227c5c60 100644 --- a/trunk/mm/vmstat.c +++ b/trunk/mm/vmstat.c @@ -8,7 +8,7 @@ * Copyright (C) 2006 Silicon Graphics, Inc., * Christoph Lameter */ -#include + #include #include #include @@ -384,7 +384,7 @@ void zone_statistics(struct zone *preferred_zone, struct zone *z) #endif #ifdef CONFIG_PROC_FS -#include + #include static char * const migratetype_names[MIGRATE_TYPES] = { @@ -581,44 +581,20 @@ static int pagetypeinfo_show(struct seq_file *m, void *arg) return 0; } -static const struct seq_operations fragmentation_op = { +const struct seq_operations fragmentation_op = { .start = frag_start, .next = frag_next, .stop = frag_stop, .show = frag_show, }; -static int fragmentation_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &fragmentation_op); -} - -static const struct file_operations fragmentation_file_operations = { - .open = fragmentation_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - -static const struct seq_operations pagetypeinfo_op = { +const struct seq_operations pagetypeinfo_op = { .start = frag_start, .next = frag_next, .stop = frag_stop, .show = pagetypeinfo_show, }; -static int pagetypeinfo_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &pagetypeinfo_op); -} - -static const struct file_operations pagetypeinfo_file_ops = { - .open = pagetypeinfo_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - #ifdef CONFIG_ZONE_DMA #define TEXT_FOR_DMA(xx) xx "_dma", #else @@ -795,7 +771,7 @@ static int zoneinfo_show(struct seq_file *m, void *arg) return 0; } -static const struct seq_operations zoneinfo_op = { +const struct seq_operations zoneinfo_op = { .start = frag_start, /* iterate over all zones. The same as in * fragmentation. */ .next = frag_next, @@ -803,18 +779,6 @@ static const struct seq_operations zoneinfo_op = { .show = zoneinfo_show, }; -static int zoneinfo_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &zoneinfo_op); -} - -static const struct file_operations proc_zoneinfo_file_operations = { - .open = zoneinfo_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; - static void *vmstat_start(struct seq_file *m, loff_t *pos) { unsigned long *v; @@ -870,24 +834,13 @@ static void vmstat_stop(struct seq_file *m, void *arg) m->private = NULL; } -static const struct seq_operations vmstat_op = { +const struct seq_operations vmstat_op = { .start = vmstat_start, .next = vmstat_next, .stop = vmstat_stop, .show = vmstat_show, }; -static int vmstat_open(struct inode *inode, struct file *file) -{ - return seq_open(file, &vmstat_op); -} - -static const struct file_operations proc_vmstat_file_operations = { - .open = vmstat_open, - .read = seq_read, - .llseek = seq_lseek, - .release = seq_release, -}; #endif /* CONFIG_PROC_FS */ #ifdef CONFIG_SMP @@ -945,11 +898,9 @@ static int __cpuinit vmstat_cpuup_callback(struct notifier_block *nfb, static struct notifier_block __cpuinitdata vmstat_notifier = { &vmstat_cpuup_callback, NULL, 0 }; -#endif static int __init setup_vmstat(void) { -#ifdef CONFIG_SMP int cpu; refresh_zone_stat_thresholds(); @@ -957,13 +908,7 @@ static int __init setup_vmstat(void) for_each_online_cpu(cpu) start_cpu_timer(cpu); -#endif -#ifdef CONFIG_PROC_FS - proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations); - proc_create("pagetypeinfo", S_IRUGO, NULL, &pagetypeinfo_file_ops); - proc_create("vmstat", S_IRUGO, NULL, &proc_vmstat_file_operations); - proc_create("zoneinfo", S_IRUGO, NULL, &proc_zoneinfo_file_operations); -#endif return 0; } module_init(setup_vmstat) +#endif