Merge with master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
authorDavid Woodhouse <dwmw2@shinybook.infradead.org>
Wed, 27 Jul 2005 13:14:13 +0000 (14:14 +0100)
committerDavid Woodhouse <dwmw2@shinybook.infradead.org>
Wed, 27 Jul 2005 13:14:13 +0000 (14:14 +0100)
298 files changed:
Documentation/scsi/scsi_mid_low_api.txt
MAINTAINERS
arch/alpha/kernel/process.c
arch/arm/boot/compressed/head-shark.S
arch/arm/configs/bast_defconfig
arch/arm/configs/s3c2410_defconfig
arch/arm/kernel/process.c
arch/arm/kernel/smp.c
arch/arm/mach-integrator/platsmp.c
arch/arm/mach-s3c2410/Makefile
arch/arm/mach-s3c2410/clock.c
arch/arm/mach-s3c2410/dma.c
arch/arm/mach-s3c2410/irq.c
arch/arm/mach-s3c2410/irq.h [new file with mode: 0644]
arch/arm/mach-s3c2410/mach-bast.c
arch/arm/mach-s3c2410/s3c2440-clock.c [new file with mode: 0644]
arch/arm/mach-s3c2410/s3c2440-irq.c [new file with mode: 0644]
arch/arm/mm/mm-armv.c
arch/arm/nwfpe/fpa11.h
arch/arm/nwfpe/fpmodule.c
arch/arm/nwfpe/fpmodule.inl
arch/arm26/kernel/process.c
arch/cris/kernel/process.c
arch/h8300/kernel/process.c
arch/i386/kernel/apm.c
arch/i386/kernel/i387.c
arch/i386/kernel/process.c
arch/i386/kernel/reboot.c
arch/i386/kernel/setup.c
arch/i386/mach-visws/reboot.c
arch/i386/mach-voyager/voyager_basic.c
arch/ia64/kernel/process.c
arch/ia64/sn/kernel/xpc_main.c
arch/m32r/kernel/process.c
arch/m68k/kernel/process.c
arch/m68knommu/kernel/process.c
arch/mips/kernel/reset.c
arch/parisc/kernel/process.c
arch/ppc/kernel/setup.c
arch/ppc64/kernel/setup.c
arch/s390/kernel/setup.c
arch/sh/kernel/process.c
arch/sparc/kernel/process.c
arch/sparc64/kernel/entry.S
arch/sparc64/kernel/irq.c
arch/sparc64/kernel/power.c
arch/sparc64/kernel/process.c
arch/sparc64/kernel/smp.c
arch/sparc64/kernel/traps.c
arch/um/kernel/reboot.c
arch/v850/kernel/anna.c
arch/v850/kernel/as85ep1.c
arch/v850/kernel/fpga85e2c.c
arch/v850/kernel/rte_cb.c
arch/v850/kernel/sim.c
arch/v850/kernel/sim85e2.c
arch/x86_64/ia32/ia32entry.S
arch/x86_64/ia32/sys_ia32.c
arch/x86_64/kernel/reboot.c
crypto/cipher.c
crypto/internal.h
drivers/acpi/ec.c
drivers/acpi/sleep/poweroff.c
drivers/atm/ambassador.c
drivers/atm/firestream.c
drivers/atm/he.c
drivers/atm/idt77252.c
drivers/atm/zatm.c
drivers/atm/zatm.h
drivers/char/hangcheck-timer.c
drivers/char/sysrq.c
drivers/char/watchdog/eurotechwdt.c
drivers/char/watchdog/pcwd.c
drivers/char/watchdog/softdog.c
drivers/char/watchdog/wdt.c
drivers/char/watchdog/wdt_pci.c
drivers/fc4/fc.c
drivers/message/fusion/mptfc.c
drivers/message/fusion/mptscsih.c
drivers/message/fusion/mptscsih.h
drivers/message/fusion/mptspi.c
drivers/net/Kconfig
drivers/net/eql.c
drivers/net/pcmcia/smc91c92_cs.c
drivers/net/tg3.c
drivers/net/tg3.h
drivers/net/wan/sdla_fr.c
drivers/net/wan/sdla_ft1.c
drivers/net/wan/sdla_ppp.c
drivers/net/wan/sdla_x25.c
drivers/net/wan/wanpipe_multppp.c
drivers/pcmcia/sa1100_jornada720.c
drivers/sbus/char/Kconfig
drivers/sbus/char/aurora.c
drivers/sbus/char/bbc_envctrl.c
drivers/sbus/char/envctrl.c
drivers/sbus/char/vfc_i2c.c
drivers/scsi/aacraid/README
drivers/scsi/aacraid/TODO
drivers/scsi/aacraid/aachba.c
drivers/scsi/aacraid/aacraid.h
drivers/scsi/aacraid/commctrl.c
drivers/scsi/aacraid/linit.c
drivers/scsi/advansys.c
drivers/scsi/aic7xxx/aic7770.c
drivers/scsi/aic7xxx/aic7770_osm.c
drivers/scsi/aic7xxx/aic79xx_osm.c
drivers/scsi/aic7xxx/aic7xxx.h
drivers/scsi/aic7xxx/aic7xxx_core.c
drivers/scsi/aic7xxx/aic7xxx_osm.c
drivers/scsi/aic7xxx/aic7xxx_osm.h
drivers/scsi/aic7xxx/aic7xxx_osm_pci.c
drivers/scsi/aic7xxx/aic7xxx_pci.c
drivers/scsi/aic7xxx/aic7xxx_proc.c
drivers/scsi/aic7xxx_old.c
drivers/scsi/cpqfcTSinit.c
drivers/scsi/dpt_i2o.c
drivers/scsi/eata.c
drivers/scsi/eata_pio.c
drivers/scsi/fdomain.c
drivers/scsi/gdth.c
drivers/scsi/hosts.c
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/scsi/ibmvscsi/rpa_vscsi.c
drivers/scsi/ibmvscsi/srp.h
drivers/scsi/ips.h
drivers/scsi/libata-core.c
drivers/scsi/lpfc/Makefile
drivers/scsi/lpfc/lpfc.h
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/lpfc/lpfc_compat.h
drivers/scsi/lpfc/lpfc_crtn.h
drivers/scsi/lpfc/lpfc_ct.c
drivers/scsi/lpfc/lpfc_disc.h
drivers/scsi/lpfc/lpfc_els.c
drivers/scsi/lpfc/lpfc_hbadisc.c
drivers/scsi/lpfc/lpfc_hw.h
drivers/scsi/lpfc/lpfc_init.c
drivers/scsi/lpfc/lpfc_logmsg.h
drivers/scsi/lpfc/lpfc_mbox.c
drivers/scsi/lpfc/lpfc_mem.c
drivers/scsi/lpfc/lpfc_nportdisc.c
drivers/scsi/lpfc/lpfc_scsi.c
drivers/scsi/lpfc/lpfc_scsi.h
drivers/scsi/lpfc/lpfc_sli.c
drivers/scsi/lpfc/lpfc_sli.h
drivers/scsi/lpfc/lpfc_version.h
drivers/scsi/megaraid.c
drivers/scsi/megaraid.h
drivers/scsi/megaraid/megaraid_mbox.c
drivers/scsi/ncr53c8xx.c
drivers/scsi/nsp32.c
drivers/scsi/qla1280.c
drivers/scsi/qla2xxx/Kconfig
drivers/scsi/qla2xxx/Makefile
drivers/scsi/qla2xxx/ql2100.c
drivers/scsi/qla2xxx/ql2100_fw.c
drivers/scsi/qla2xxx/ql2200.c
drivers/scsi/qla2xxx/ql2200_fw.c
drivers/scsi/qla2xxx/ql2300.c
drivers/scsi/qla2xxx/ql2300_fw.c
drivers/scsi/qla2xxx/ql2322.c
drivers/scsi/qla2xxx/ql2322_fw.c
drivers/scsi/qla2xxx/ql6312.c
drivers/scsi/qla2xxx/ql6312_fw.c
drivers/scsi/qla2xxx/qla_attr.c
drivers/scsi/qla2xxx/qla_dbg.c
drivers/scsi/qla2xxx/qla_dbg.h
drivers/scsi/qla2xxx/qla_def.h
drivers/scsi/qla2xxx/qla_devtbl.h
drivers/scsi/qla2xxx/qla_fw.h [new file with mode: 0644]
drivers/scsi/qla2xxx/qla_gbl.h
drivers/scsi/qla2xxx/qla_gs.c
drivers/scsi/qla2xxx/qla_init.c
drivers/scsi/qla2xxx/qla_inline.h
drivers/scsi/qla2xxx/qla_iocb.c
drivers/scsi/qla2xxx/qla_isr.c
drivers/scsi/qla2xxx/qla_mbx.c
drivers/scsi/qla2xxx/qla_os.c
drivers/scsi/qla2xxx/qla_rscn.c
drivers/scsi/qla2xxx/qla_settings.h
drivers/scsi/qla2xxx/qla_sup.c
drivers/scsi/qla2xxx/qla_version.h
drivers/scsi/qlogicfc.c
drivers/scsi/qlogicisp.c
drivers/scsi/scsi.c
drivers/scsi/scsi_error.c
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_priv.h
drivers/scsi/scsi_scan.c
drivers/scsi/scsi_transport_spi.c
drivers/scsi/sd.c
drivers/scsi/u14-34f.c
drivers/serial/68328serial.c
drivers/serial/8250_pci.c
drivers/serial/Kconfig
drivers/serial/Makefile
drivers/serial/bast_sio.c [deleted file]
drivers/video/imxfb.c
drivers/video/imxfb.h
drivers/w1/w1_int.c
fs/inotify.c
include/asm-alpha/emergency-restart.h [new file with mode: 0644]
include/asm-arm/arch-imx/imxfb.h
include/asm-arm/arch-s3c2410/regs-iis.h
include/asm-arm/bitops.h
include/asm-arm/emergency-restart.h [new file with mode: 0644]
include/asm-arm/locks.h
include/asm-arm/spinlock.h
include/asm-arm/system.h
include/asm-arm26/emergency-restart.h [new file with mode: 0644]
include/asm-cris/emergency-restart.h [new file with mode: 0644]
include/asm-frv/emergency-restart.h [new file with mode: 0644]
include/asm-generic/emergency-restart.h [new file with mode: 0644]
include/asm-h8300/emergency-restart.h [new file with mode: 0644]
include/asm-i386/emergency-restart.h [new file with mode: 0644]
include/asm-i386/i387.h
include/asm-i386/ptrace.h
include/asm-ia64/emergency-restart.h [new file with mode: 0644]
include/asm-m32r/emergency-restart.h [new file with mode: 0644]
include/asm-m68k/emergency-restart.h [new file with mode: 0644]
include/asm-m68knommu/emergency-restart.h [new file with mode: 0644]
include/asm-mips/emergency-restart.h [new file with mode: 0644]
include/asm-parisc/emergency-restart.h [new file with mode: 0644]
include/asm-ppc/emergency-restart.h [new file with mode: 0644]
include/asm-ppc64/emergency-restart.h [new file with mode: 0644]
include/asm-s390/emergency-restart.h [new file with mode: 0644]
include/asm-sh/emergency-restart.h [new file with mode: 0644]
include/asm-sh64/emergency-restart.h [new file with mode: 0644]
include/asm-sparc/emergency-restart.h [new file with mode: 0644]
include/asm-sparc64/bitops.h
include/asm-sparc64/emergency-restart.h [new file with mode: 0644]
include/asm-sparc64/ptrace.h
include/asm-sparc64/rwsem.h
include/asm-sparc64/spitfire.h
include/asm-sparc64/system.h
include/asm-sparc64/thread_info.h
include/asm-sparc64/timer.h
include/asm-um/emergency-restart.h [new file with mode: 0644]
include/asm-v850/emergency-restart.h [new file with mode: 0644]
include/asm-x86_64/emergency-restart.h [new file with mode: 0644]
include/asm-x86_64/ia32_unistd.h
include/asm-x86_64/unistd.h
include/asm-xtensa/emergency-restart.h [new file with mode: 0644]
include/linux/netfilter_ipv4/ip_conntrack.h
include/linux/netfilter_ipv4/ip_conntrack_helper.h
include/linux/netlink.h
include/linux/pci_ids.h
include/linux/reboot.h
include/linux/skbuff.h
include/linux/tc_ematch/tc_em_meta.h
include/net/sctp/sctp.h
include/net/xfrm.h
include/scsi/scsi.h
include/scsi/scsi_cmnd.h
include/scsi/scsi_device.h
include/scsi/scsi_host.h
kernel/panic.c
kernel/power/disk.c
kernel/power/poweroff.c
kernel/sched.c
kernel/sys.c
net/Kconfig
net/atm/Kconfig
net/atm/svc.c
net/bridge/netfilter/Kconfig
net/core/Makefile
net/core/skbuff.c
net/ipv4/Kconfig
net/ipv4/af_inet.c
net/ipv4/fib_trie.c
net/ipv4/ipip.c
net/ipv4/netfilter/ip_conntrack_amanda.c
net/ipv4/netfilter/ip_conntrack_core.c
net/ipv4/netfilter/ip_conntrack_ftp.c
net/ipv4/netfilter/ip_conntrack_irc.c
net/ipv4/netfilter/ip_conntrack_standalone.c
net/ipv4/netfilter/ip_conntrack_tftp.c
net/ipv4/netfilter/ip_nat_amanda.c
net/ipv4/netfilter/ip_nat_ftp.c
net/ipv4/netfilter/ip_nat_irc.c
net/ipv4/netfilter/ip_nat_proto_icmp.c
net/ipv4/netfilter/ip_nat_proto_tcp.c
net/ipv4/netfilter/ip_nat_proto_udp.c
net/ipv4/netfilter/ip_nat_tftp.c
net/ipv4/xfrm4_tunnel.c
net/ipv6/Kconfig
net/ipv6/ip6_tunnel.c
net/ipv6/netfilter/ip6_queue.c
net/ipv6/netfilter/ip6t_LOG.c
net/netlink/af_netlink.c
net/sched/em_meta.c
net/sched/em_text.c
net/sched/sch_generic.c
net/sctp/input.c
net/sctp/ipv6.c
net/sctp/objcnt.c
net/xfrm/xfrm_user.c

index da176c95d0fb62618ff5c3684f5768a935f9dd0f..7536823c0cb1d392b30876eb1922dffd0a5b9b07 100644 (file)
@@ -388,7 +388,6 @@ Summary:
    scsi_remove_device - detach and remove a SCSI device
    scsi_remove_host - detach and remove all SCSI devices owned by host
    scsi_report_bus_reset - report scsi _bus_ reset observed
-   scsi_set_device - place device reference in host structure
    scsi_track_queue_full - track successive QUEUE_FULL events 
    scsi_unblock_requests - allow further commands to be queued to given host
    scsi_unregister - [calls scsi_host_put()]
@@ -740,20 +739,6 @@ int scsi_remove_host(struct Scsi_Host *shost)
 void scsi_report_bus_reset(struct Scsi_Host * shost, int channel)
 
 
-/**
- * scsi_set_device - place device reference in host structure
- * @shost: a pointer to a scsi host instance
- * @pdev: pointer to device instance to assign
- *
- *      Returns nothing
- *
- *      Might block: no
- *
- *      Defined in: include/scsi/scsi_host.h .
- **/
-void scsi_set_device(struct Scsi_Host * shost, struct device * dev)
-
-
 /**
  * scsi_track_queue_full - track successive QUEUE_FULL events on given
  *                      device to determine if and when there is a need
index aa257301d86b8bfef5fd2b48c8135addd647e817..6d187fb934f3a90c236387b1d4537b0caa99c5c9 100644 (file)
@@ -1419,13 +1419,20 @@ W:      http://www.penguinppc.org/
 L:     linuxppc-embedded@ozlabs.org
 S:     Maintained
 
-LINUX FOR POWERPC EMBEDDED PPC8XX AND BOOT CODE
+LINUX FOR POWERPC BOOT CODE
 P:     Tom Rini
 M:     trini@kernel.crashing.org
 W:     http://www.penguinppc.org/
 L:     linuxppc-embedded@ozlabs.org
 S:     Maintained
 
+LINUX FOR POWERPC EMBEDDED PPC8XX
+P:     Marcelo Tosatti
+M:     marcelo.tosatti@cyclades.com
+W:     http://www.penguinppc.org/
+L:     linuxppc-embedded@ozlabs.org
+S:     Maintained
+
 LINUX FOR POWERPC EMBEDDED PPC83XX AND PPC85XX
 P:     Kumar Gala
 M:     kumar.gala@freescale.com
index 4933f3ce58339c182897fe08d25f4e329083cae4..fa98dae3cd986dc323132a0ad2f0bd205ea7c9a4 100644 (file)
@@ -165,7 +165,6 @@ machine_restart(char *restart_cmd)
        common_shutdown(LINUX_REBOOT_CMD_RESTART, restart_cmd);
 }
 
-EXPORT_SYMBOL(machine_restart);
 
 void
 machine_halt(void)
@@ -173,7 +172,6 @@ machine_halt(void)
        common_shutdown(LINUX_REBOOT_CMD_HALT, NULL);
 }
 
-EXPORT_SYMBOL(machine_halt);
 
 void
 machine_power_off(void)
@@ -181,7 +179,6 @@ machine_power_off(void)
        common_shutdown(LINUX_REBOOT_CMD_POWER_OFF, NULL);
 }
 
-EXPORT_SYMBOL(machine_power_off);
 
 /* Used by sysrq-p, among others.  I don't believe r9-r15 are ever
    saved in the context it's used.  */
index 848f60e5429bc94072e9eb9c77eba186ffceedc5..089c560e07f13947ed68ab446edcc9de40c30604 100644 (file)
@@ -63,8 +63,8 @@ __beginning:  mov     r4, r0                          @ save the entry to the firmware
 
                mov     pc, r2
 
-__copy_target: .long   0x08508000
-__copy_end:    .long   0x08608000
+__copy_target: .long   0x08507FFC
+__copy_end:    .long   0x08607FFC
                
                .word   _start
                .word   __bss_start
@@ -73,9 +73,10 @@ __copy_end:  .long   0x08608000
 __temp_stack:  .space 128
 
 __mmu_off:
-               adr     r0, __ofw_data
+               adr     r0, __ofw_data                  @ read the 1. entry of the memory map
                ldr     r0, [r0, #4]
                orr     r0, r0, #0x00600000
+               sub     r0, r0, #4
        
                ldr     r1, __copy_end
                ldr     r3, __copy_target
@@ -89,20 +90,43 @@ __mmu_off:
  * from 0x08500000 to 0x08508000 if we have only 8MB
  */
 
+/* As we get more 2.6-kernels it gets more and more
+ * uncomfortable to be bound to kernel images of 1MB only.
+ * So we add a loop here, to be able to copy some more.
+ * Alexander Schulz 2005-07-17
+ */
+
+               mov     r4, #3                          @ How many megabytes to copy
+
+
+__MoveCode:    sub     r4, r4, #1
        
 __Copy:                ldr     r2, [r0], #-4
                str     r2, [r1], #-4
                teq     r1, r3
                bne     __Copy
+
+               /* The firmware maps us in blocks of 1 MB, the next block is
+                  _below_ the last one. So our decrementing source pointer
+                  ist right here, but the destination pointer must be increased
+                  by 2 MB */
+               add     r1, r1, #0x00200000
+               add     r3, r3, #0x00100000
+
+               teq     r4, #0
+               bne     __MoveCode
+
+
                /* and jump to it */
-               adr     r2, __go_on
-               adr     r0, __ofw_data
+               adr     r2, __go_on                     @ where we want to jump
+               adr     r0, __ofw_data                  @ read the 1. entry of the memory map
                ldr     r0, [r0, #4]
-               sub     r2, r2, r0
-               sub     r2, r2, #0x00500000
-               ldr     r0, __copy_target
+               sub     r2, r2, r0                      @ we are mapped add 0e50 now, sub that (-0e00)
+               sub     r2, r2, #0x00500000             @ -0050
+               ldr     r0, __copy_target               @ and add 0850 8000 instead
+               add     r0, r0, #4
                add     r2, r2, r0
-               mov     pc, r2
+               mov     pc, r2                          @ and jump there
 
 __go_on:
                adr     sp, __temp_stack
index 2d985e9611cdccec21e616d6d44b19d56b4b8f23..35e3a99bcbb688e0ab9a6c096c9421db4021ef8d 100644 (file)
@@ -561,7 +561,6 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
 #
 CONFIG_SERIAL_S3C2410=y
 CONFIG_SERIAL_S3C2410_CONSOLE=y
-CONFIG_SERIAL_BAST_SIO=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index 98b72ff388322dc2fc6766bdf6ba031eac3bd633..96a794d8de842d2476a6776ce0bc46c0afd5369e 100644 (file)
@@ -570,7 +570,6 @@ CONFIG_SERIAL_8250_SHARE_IRQ=y
 #
 CONFIG_SERIAL_S3C2410=y
 CONFIG_SERIAL_S3C2410_CONSOLE=y
-CONFIG_SERIAL_BAST_SIO=y
 CONFIG_SERIAL_CORE=y
 CONFIG_SERIAL_CORE_CONSOLE=y
 CONFIG_UNIX98_PTYS=y
index bbea636ff687a57feb1e2a5f240e5f0726485b7a..409db6d5ec9994b53a729f755435d3aa518e3aad 100644 (file)
@@ -131,7 +131,6 @@ void machine_halt(void)
 {
 }
 
-EXPORT_SYMBOL(machine_halt);
 
 void machine_power_off(void)
 {
@@ -139,7 +138,6 @@ void machine_power_off(void)
                pm_power_off();
 }
 
-EXPORT_SYMBOL(machine_power_off);
 
 void machine_restart(char * __unused)
 {
@@ -169,8 +167,6 @@ void machine_restart(char * __unused)
        while (1);
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void __show_regs(struct pt_regs *regs)
 {
        unsigned long flags = condition_codes(regs);
index 7ae45c3fc8341425585e0847cc33472a96ed5356..295e0a8379cfc9c95e080f063b815b968acf6a10 100644 (file)
@@ -78,7 +78,7 @@ struct smp_call_struct {
 static struct smp_call_struct * volatile smp_call_function_data;
 static DEFINE_SPINLOCK(smp_call_function_lock);
 
-int __init __cpu_up(unsigned int cpu)
+int __cpuinit __cpu_up(unsigned int cpu)
 {
        struct task_struct *idle;
        pgd_t *pgd;
@@ -159,7 +159,7 @@ int __init __cpu_up(unsigned int cpu)
  * This is the secondary CPU boot entry.  We're using this CPUs
  * idle thread stack, but a set of temporary page tables.
  */
-asmlinkage void __init secondary_start_kernel(void)
+asmlinkage void __cpuinit secondary_start_kernel(void)
 {
        struct mm_struct *mm = &init_mm;
        unsigned int cpu = smp_processor_id();
@@ -209,7 +209,7 @@ asmlinkage void __init secondary_start_kernel(void)
  * Called by both boot and secondaries to move global data into
  * per-processor storage.
  */
-void __init smp_store_cpu_info(unsigned int cpuid)
+void __cpuinit smp_store_cpu_info(unsigned int cpuid)
 {
        struct cpuinfo_arm *cpu_info = &per_cpu(cpu_data, cpuid);
 
index 2ba0257770982497fa2821952a14bb395fb0ffbc..aecf47ba033a753040646ec8779bd48767675261 100644 (file)
@@ -27,12 +27,12 @@ extern void integrator_secondary_startup(void);
  * control for which core is the next to come out of the secondary
  * boot "holding pen"
  */
-volatile int __initdata pen_release = -1;
-unsigned long __initdata phys_pen_release = 0;
+volatile int __cpuinitdata pen_release = -1;
+unsigned long __cpuinitdata phys_pen_release = 0;
 
 static DEFINE_SPINLOCK(boot_lock);
 
-void __init platform_secondary_init(unsigned int cpu)
+void __cpuinit platform_secondary_init(unsigned int cpu)
 {
        /*
         * the primary core may have used a "cross call" soft interrupt
@@ -61,7 +61,7 @@ void __init platform_secondary_init(unsigned int cpu)
        spin_unlock(&boot_lock);
 }
 
-int __init boot_secondary(unsigned int cpu, struct task_struct *idle)
+int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
        unsigned long timeout;
 
index f99b689e4392ec5c8d8ba7240a599fa83bb41c40..55ed7c7e57dabc091c9f6dd5c28f8bfa3ffd9b3b 100644 (file)
@@ -23,6 +23,8 @@ obj-$(CONFIG_PM_SIMTEC)          += pm-simtec.o
 # S3C2440 support
 
 obj-$(CONFIG_CPU_S3C2440)  += s3c2440.o s3c2440-dsc.o
+obj-$(CONFIG_CPU_S3C2440)  += s3c2440-irq.o
+obj-$(CONFIG_CPU_S3C2440)  += s3c2440-clock.o
 
 # machine specific support
 
index 8d986b8401c2474f3948bb3a4301c26a9784b7f1..9a66050e887d0e99db09d53d1ab91bda120f6353 100644 (file)
@@ -448,60 +448,3 @@ int __init s3c24xx_setup_clocks(unsigned long xtal,
 
        return 0;
 }
-
-/* S3C2440 extended clock support */
-
-#ifdef CONFIG_CPU_S3C2440
-
-static struct clk s3c2440_clk_upll = {
-       .name           = "upll",
-       .id             = -1,
-};
-
-static struct clk s3c2440_clk_cam = {
-       .name           = "camif",
-       .parent         = &clk_h,
-       .id             = -1,
-       .enable         = s3c24xx_clkcon_enable,
-       .ctrlbit        = S3C2440_CLKCON_CAMERA,
-};
-
-static struct clk s3c2440_clk_ac97 = {
-       .name           = "ac97",
-       .parent         = &clk_p,
-       .id             = -1,
-       .enable         = s3c24xx_clkcon_enable,
-       .ctrlbit        = S3C2440_CLKCON_CAMERA,
-};
-
-static int s3c2440_clk_add(struct sys_device *sysdev)
-{
-       unsigned long upllcon = __raw_readl(S3C2410_UPLLCON);
-
-       s3c2440_clk_upll.rate = s3c2410_get_pll(upllcon, clk_xtal.rate);
-
-       printk("S3C2440: Clock Support, UPLL %ld.%03ld MHz\n",
-              print_mhz(s3c2440_clk_upll.rate));
-
-       s3c24xx_register_clock(&s3c2440_clk_ac97);
-       s3c24xx_register_clock(&s3c2440_clk_cam);
-       s3c24xx_register_clock(&s3c2440_clk_upll);
-
-       clk_disable(&s3c2440_clk_ac97);
-       clk_disable(&s3c2440_clk_cam);
-
-       return 0;
-}
-
-static struct sysdev_driver s3c2440_clk_driver = {
-       .add    = s3c2440_clk_add,
-};
-
-static int s3c24xx_clk_driver(void)
-{
-       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver);
-}
-
-arch_initcall(s3c24xx_clk_driver);
-
-#endif /* CONFIG_CPU_S3C2440 */
index c7c28890d406c25356b2643400360cb661ee1586..65feaf20d23e842d1d46ba88ed674f4942558c7a 100644 (file)
@@ -436,7 +436,7 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id,
 
        buf = kmem_cache_alloc(dma_kmem, GFP_ATOMIC);
        if (buf == NULL) {
-               pr_debug("%s: out of memory (%d alloc)\n",
+               pr_debug("%s: out of memory (%ld alloc)\n",
                         __FUNCTION__, sizeof(*buf));
                return -ENOMEM;
        }
index cf9f46d88061819432925c4097673b8d458a9350..973a5fe6769c515d87c6f409b36223fdd93d05a6 100644 (file)
@@ -45,6 +45,9 @@
  *
  *   28-Jun-2005  Ben Dooks
  *               Mark IRQ_LCD valid
+ *
+ *   25-Jul-2005  Ben Dooks
+ *               Split the S3C2440 IRQ code to seperate file
 */
 
 #include <linux/init.h>
 
 #include "cpu.h"
 #include "pm.h"
-
-#define irqdbf(x...)
-#define irqdbf2(x...)
-
-#define EXTINT_OFF (IRQ_EINT4 - 4)
+#include "irq.h"
 
 /* wakeup irq control */
 
@@ -181,7 +180,7 @@ s3c_irq_unmask(unsigned int irqno)
        __raw_writel(mask, S3C2410_INTMSK);
 }
 
-static struct irqchip s3c_irq_level_chip = {
+struct irqchip s3c_irq_level_chip = {
        .ack       = s3c_irq_maskack,
        .mask      = s3c_irq_mask,
        .unmask    = s3c_irq_unmask,
@@ -370,84 +369,6 @@ static struct irqchip s3c_irq_eint0t4 = {
 #define INTMSK_UART2    (1UL << (IRQ_UART2 - IRQ_EINT0))
 #define INTMSK_ADCPARENT (1UL << (IRQ_ADCPARENT - IRQ_EINT0))
 
-static inline void
-s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
-               int subcheck)
-{
-       unsigned long mask;
-       unsigned long submask;
-
-       submask = __raw_readl(S3C2410_INTSUBMSK);
-       mask = __raw_readl(S3C2410_INTMSK);
-
-       submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
-
-       /* check to see if we need to mask the parent IRQ */
-
-       if ((submask  & subcheck) == subcheck) {
-               __raw_writel(mask | parentbit, S3C2410_INTMSK);
-       }
-
-       /* write back masks */
-       __raw_writel(submask, S3C2410_INTSUBMSK);
-
-}
-
-static inline void
-s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
-{
-       unsigned long mask;
-       unsigned long submask;
-
-       submask = __raw_readl(S3C2410_INTSUBMSK);
-       mask = __raw_readl(S3C2410_INTMSK);
-
-       submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
-       mask &= ~parentbit;
-
-       /* write back masks */
-       __raw_writel(submask, S3C2410_INTSUBMSK);
-       __raw_writel(mask, S3C2410_INTMSK);
-}
-
-
-static inline void
-s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group)
-{
-       unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
-
-       s3c_irqsub_mask(irqno, parentmask, group);
-
-       __raw_writel(bit, S3C2410_SUBSRCPND);
-
-       /* only ack parent if we've got all the irqs (seems we must
-        * ack, all and hope that the irq system retriggers ok when
-        * the interrupt goes off again)
-        */
-
-       if (1) {
-               __raw_writel(parentmask, S3C2410_SRCPND);
-               __raw_writel(parentmask, S3C2410_INTPND);
-       }
-}
-
-static inline void
-s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group)
-{
-       unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
-
-       __raw_writel(bit, S3C2410_SUBSRCPND);
-
-       /* only ack parent if we've got all the irqs (seems we must
-        * ack, all and hope that the irq system retriggers ok when
-        * the interrupt goes off again)
-        */
-
-       if (1) {
-               __raw_writel(parentmask, S3C2410_SRCPND);
-               __raw_writel(parentmask, S3C2410_INTPND);
-       }
-}
 
 /* UART0 */
 
@@ -794,174 +715,3 @@ void __init s3c24xx_init_irq(void)
 
        irqdbf("s3c2410: registered interrupt handlers\n");
 }
-
-/* s3c2440 irq code
-*/
-
-#ifdef CONFIG_CPU_S3C2440
-
-/* WDT/AC97 */
-
-static void s3c_irq_demux_wdtac97(unsigned int irq,
-                                 struct irqdesc *desc,
-                                 struct pt_regs *regs)
-{
-       unsigned int subsrc, submsk;
-       struct irqdesc *mydesc;
-
-       /* read the current pending interrupts, and the mask
-        * for what it is available */
-
-       subsrc = __raw_readl(S3C2410_SUBSRCPND);
-       submsk = __raw_readl(S3C2410_INTSUBMSK);
-
-       subsrc &= ~submsk;
-       subsrc >>= 13;
-       subsrc &= 3;
-
-       if (subsrc != 0) {
-               if (subsrc & 1) {
-                       mydesc = irq_desc + IRQ_S3C2440_WDT;
-                       mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
-               }
-               if (subsrc & 2) {
-                       mydesc = irq_desc + IRQ_S3C2440_AC97;
-                       mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
-               }
-       }
-}
-
-
-#define INTMSK_WDT      (1UL << (IRQ_WDT - IRQ_EINT0))
-
-static void
-s3c_irq_wdtac97_mask(unsigned int irqno)
-{
-       s3c_irqsub_mask(irqno, INTMSK_WDT, 3<<13);
-}
-
-static void
-s3c_irq_wdtac97_unmask(unsigned int irqno)
-{
-       s3c_irqsub_unmask(irqno, INTMSK_WDT);
-}
-
-static void
-s3c_irq_wdtac97_ack(unsigned int irqno)
-{
-       s3c_irqsub_maskack(irqno, INTMSK_WDT, 3<<13);
-}
-
-static struct irqchip s3c_irq_wdtac97 = {
-       .mask       = s3c_irq_wdtac97_mask,
-       .unmask     = s3c_irq_wdtac97_unmask,
-       .ack        = s3c_irq_wdtac97_ack,
-};
-
-/* camera irq */
-
-static void s3c_irq_demux_cam(unsigned int irq,
-                             struct irqdesc *desc,
-                             struct pt_regs *regs)
-{
-       unsigned int subsrc, submsk;
-       struct irqdesc *mydesc;
-
-       /* read the current pending interrupts, and the mask
-        * for what it is available */
-
-       subsrc = __raw_readl(S3C2410_SUBSRCPND);
-       submsk = __raw_readl(S3C2410_INTSUBMSK);
-
-       subsrc &= ~submsk;
-       subsrc >>= 11;
-       subsrc &= 3;
-
-       if (subsrc != 0) {
-               if (subsrc & 1) {
-                       mydesc = irq_desc + IRQ_S3C2440_CAM_C;
-                       mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
-               }
-               if (subsrc & 2) {
-                       mydesc = irq_desc + IRQ_S3C2440_CAM_P;
-                       mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
-               }
-       }
-}
-
-#define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0))
-
-static void
-s3c_irq_cam_mask(unsigned int irqno)
-{
-       s3c_irqsub_mask(irqno, INTMSK_CAM, 3<<11);
-}
-
-static void
-s3c_irq_cam_unmask(unsigned int irqno)
-{
-       s3c_irqsub_unmask(irqno, INTMSK_CAM);
-}
-
-static void
-s3c_irq_cam_ack(unsigned int irqno)
-{
-       s3c_irqsub_maskack(irqno, INTMSK_CAM, 3<<11);
-}
-
-static struct irqchip s3c_irq_cam = {
-       .mask       = s3c_irq_cam_mask,
-       .unmask     = s3c_irq_cam_unmask,
-       .ack        = s3c_irq_cam_ack,
-};
-
-static int s3c2440_irq_add(struct sys_device *sysdev)
-{
-       unsigned int irqno;
-
-       printk("S3C2440: IRQ Support\n");
-
-       set_irq_chip(IRQ_NFCON, &s3c_irq_level_chip);
-       set_irq_handler(IRQ_NFCON, do_level_IRQ);
-       set_irq_flags(IRQ_NFCON, IRQF_VALID);
-
-       /* add new chained handler for wdt, ac7 */
-
-       set_irq_chip(IRQ_WDT, &s3c_irq_level_chip);
-       set_irq_handler(IRQ_WDT, do_level_IRQ);
-       set_irq_chained_handler(IRQ_WDT, s3c_irq_demux_wdtac97);
-
-       for (irqno = IRQ_S3C2440_WDT; irqno <= IRQ_S3C2440_AC97; irqno++) {
-               set_irq_chip(irqno, &s3c_irq_wdtac97);
-               set_irq_handler(irqno, do_level_IRQ);
-               set_irq_flags(irqno, IRQF_VALID);
-       }
-
-       /* add chained handler for camera */
-
-       set_irq_chip(IRQ_CAM, &s3c_irq_level_chip);
-       set_irq_handler(IRQ_CAM, do_level_IRQ);
-       set_irq_chained_handler(IRQ_CAM, s3c_irq_demux_cam);
-
-       for (irqno = IRQ_S3C2440_CAM_C; irqno <= IRQ_S3C2440_CAM_P; irqno++) {
-               set_irq_chip(irqno, &s3c_irq_cam);
-               set_irq_handler(irqno, do_level_IRQ);
-               set_irq_flags(irqno, IRQF_VALID);
-       }
-
-       return 0;
-}
-
-static struct sysdev_driver s3c2440_irq_driver = {
-       .add    = s3c2440_irq_add,
-};
-
-static int s3c24xx_irq_driver(void)
-{
-       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver);
-}
-
-arch_initcall(s3c24xx_irq_driver);
-
-#endif /* CONFIG_CPU_S3C2440 */
-
diff --git a/arch/arm/mach-s3c2410/irq.h b/arch/arm/mach-s3c2410/irq.h
new file mode 100644 (file)
index 0000000..4abf0ca
--- /dev/null
@@ -0,0 +1,99 @@
+/* arch/arm/mach-s3c2410/irq.h
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * Header file for S3C24XX CPU IRQ support
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ *
+ * Modifications:
+*/
+
+#define irqdbf(x...)
+#define irqdbf2(x...)
+
+#define EXTINT_OFF (IRQ_EINT4 - 4)
+
+extern struct irqchip s3c_irq_level_chip;
+
+static inline void
+s3c_irqsub_mask(unsigned int irqno, unsigned int parentbit,
+               int subcheck)
+{
+       unsigned long mask;
+       unsigned long submask;
+
+       submask = __raw_readl(S3C2410_INTSUBMSK);
+       mask = __raw_readl(S3C2410_INTMSK);
+
+       submask |= (1UL << (irqno - IRQ_S3CUART_RX0));
+
+       /* check to see if we need to mask the parent IRQ */
+
+       if ((submask  & subcheck) == subcheck) {
+               __raw_writel(mask | parentbit, S3C2410_INTMSK);
+       }
+
+       /* write back masks */
+       __raw_writel(submask, S3C2410_INTSUBMSK);
+
+}
+
+static inline void
+s3c_irqsub_unmask(unsigned int irqno, unsigned int parentbit)
+{
+       unsigned long mask;
+       unsigned long submask;
+
+       submask = __raw_readl(S3C2410_INTSUBMSK);
+       mask = __raw_readl(S3C2410_INTMSK);
+
+       submask &= ~(1UL << (irqno - IRQ_S3CUART_RX0));
+       mask &= ~parentbit;
+
+       /* write back masks */
+       __raw_writel(submask, S3C2410_INTSUBMSK);
+       __raw_writel(mask, S3C2410_INTMSK);
+}
+
+
+static inline void
+s3c_irqsub_maskack(unsigned int irqno, unsigned int parentmask, unsigned int group)
+{
+       unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
+
+       s3c_irqsub_mask(irqno, parentmask, group);
+
+       __raw_writel(bit, S3C2410_SUBSRCPND);
+
+       /* only ack parent if we've got all the irqs (seems we must
+        * ack, all and hope that the irq system retriggers ok when
+        * the interrupt goes off again)
+        */
+
+       if (1) {
+               __raw_writel(parentmask, S3C2410_SRCPND);
+               __raw_writel(parentmask, S3C2410_INTPND);
+       }
+}
+
+static inline void
+s3c_irqsub_ack(unsigned int irqno, unsigned int parentmask, unsigned int group)
+{
+       unsigned int bit = 1UL << (irqno - IRQ_S3CUART_RX0);
+
+       __raw_writel(bit, S3C2410_SUBSRCPND);
+
+       /* only ack parent if we've got all the irqs (seems we must
+        * ack, all and hope that the irq system retriggers ok when
+        * the interrupt goes off again)
+        */
+
+       if (1) {
+               __raw_writel(parentmask, S3C2410_SRCPND);
+               __raw_writel(parentmask, S3C2410_INTPND);
+       }
+}
index ccb6bcefa46c5e265815d24f7f2afa00dfcff7c1..1e7f343822d0c5c111d5988bcb0eeeb4126ad7bc 100644 (file)
  *     14-Jan-2005 BJD  Add support for muitlple NAND devices
  *     03-Mar-2005 BJD  Ensured that bast-cpld.h is included
  *     10-Mar-2005 LCVR Changed S3C2410_VA to S3C24XX_VA
- *     14-Mar-2006 BJD  Updated for __iomem changes
- *     22-Jun-2006 BJD  Added DM9000 platform information
- *     28-Jun-2006 BJD  Moved pm functionality out to common code
+ *     14-Mar-2005 BJD  Updated for __iomem changes
+ *     22-Jun-2005 BJD  Added DM9000 platform information
+ *     28-Jun-2005 BJD  Moved pm functionality out to common code
+ *     17-Jul-2005 BJD  Changed to platform device for SuperIO 16550s
+ *     25-Jul-2005 BJD  Removed ASIX static mappings
 */
 
 #include <linux/kernel.h>
@@ -64,6 +66,8 @@
 #include <linux/mtd/nand_ecc.h>
 #include <linux/mtd/partitions.h>
 
+#include <linux/serial_8250.h>
+
 #include "clock.h"
 #include "devs.h"
 #include "cpu.h"
@@ -113,7 +117,6 @@ static struct map_desc bast_iodesc[] __initdata = {
   /* slow, byte */
   { VA_C2(BAST_VA_ISAIO),   PA_CS2(BAST_PA_ISAIO),    SZ_16M, MT_DEVICE },
   { VA_C2(BAST_VA_ISAMEM),  PA_CS2(BAST_PA_ISAMEM),   SZ_16M, MT_DEVICE },
-  { VA_C2(BAST_VA_ASIXNET), PA_CS3(BAST_PA_ASIXNET),  SZ_1M,  MT_DEVICE },
   { VA_C2(BAST_VA_SUPERIO), PA_CS2(BAST_PA_SUPERIO),  SZ_1M,  MT_DEVICE },
   { VA_C2(BAST_VA_IDEPRI),  PA_CS3(BAST_PA_IDEPRI),   SZ_1M,  MT_DEVICE },
   { VA_C2(BAST_VA_IDESEC),  PA_CS3(BAST_PA_IDESEC),   SZ_1M,  MT_DEVICE },
@@ -123,7 +126,6 @@ static struct map_desc bast_iodesc[] __initdata = {
   /* slow, word */
   { VA_C3(BAST_VA_ISAIO),   PA_CS3(BAST_PA_ISAIO),    SZ_16M, MT_DEVICE },
   { VA_C3(BAST_VA_ISAMEM),  PA_CS3(BAST_PA_ISAMEM),   SZ_16M, MT_DEVICE },
-  { VA_C3(BAST_VA_ASIXNET), PA_CS3(BAST_PA_ASIXNET),  SZ_1M,  MT_DEVICE },
   { VA_C3(BAST_VA_SUPERIO), PA_CS3(BAST_PA_SUPERIO),  SZ_1M,  MT_DEVICE },
   { VA_C3(BAST_VA_IDEPRI),  PA_CS3(BAST_PA_IDEPRI),   SZ_1M,  MT_DEVICE },
   { VA_C3(BAST_VA_IDESEC),  PA_CS3(BAST_PA_IDESEC),   SZ_1M,  MT_DEVICE },
@@ -133,7 +135,6 @@ static struct map_desc bast_iodesc[] __initdata = {
   /* fast, byte */
   { VA_C4(BAST_VA_ISAIO),   PA_CS4(BAST_PA_ISAIO),    SZ_16M, MT_DEVICE },
   { VA_C4(BAST_VA_ISAMEM),  PA_CS4(BAST_PA_ISAMEM),   SZ_16M, MT_DEVICE },
-  { VA_C4(BAST_VA_ASIXNET), PA_CS5(BAST_PA_ASIXNET),  SZ_1M,  MT_DEVICE },
   { VA_C4(BAST_VA_SUPERIO), PA_CS4(BAST_PA_SUPERIO),  SZ_1M,  MT_DEVICE },
   { VA_C4(BAST_VA_IDEPRI),  PA_CS5(BAST_PA_IDEPRI),   SZ_1M,  MT_DEVICE },
   { VA_C4(BAST_VA_IDESEC),  PA_CS5(BAST_PA_IDESEC),   SZ_1M,  MT_DEVICE },
@@ -143,7 +144,6 @@ static struct map_desc bast_iodesc[] __initdata = {
   /* fast, word */
   { VA_C5(BAST_VA_ISAIO),   PA_CS5(BAST_PA_ISAIO),    SZ_16M, MT_DEVICE },
   { VA_C5(BAST_VA_ISAMEM),  PA_CS5(BAST_PA_ISAMEM),   SZ_16M, MT_DEVICE },
-  { VA_C5(BAST_VA_ASIXNET), PA_CS5(BAST_PA_ASIXNET),  SZ_1M,  MT_DEVICE },
   { VA_C5(BAST_VA_SUPERIO), PA_CS5(BAST_PA_SUPERIO),  SZ_1M,  MT_DEVICE },
   { VA_C5(BAST_VA_IDEPRI),  PA_CS5(BAST_PA_IDEPRI),   SZ_1M,  MT_DEVICE },
   { VA_C5(BAST_VA_IDESEC),  PA_CS5(BAST_PA_IDESEC),   SZ_1M,  MT_DEVICE },
@@ -351,6 +351,39 @@ static struct platform_device bast_device_dm9k = {
        }
 };
 
+/* serial devices */
+
+#define SERIAL_BASE  (S3C2410_CS2 + BAST_PA_SUPERIO)
+#define SERIAL_FLAGS (UPF_BOOT_AUTOCONF | UPF_IOREMAP | UPF_SHARE_IRQ)
+#define SERIAL_CLK   (1843200)
+
+static struct plat_serial8250_port bast_sio_data[] = {
+       [0] = {
+               .mapbase        = SERIAL_BASE + 0x2f8,
+               .irq            = IRQ_PCSERIAL1,
+               .flags          = SERIAL_FLAGS,
+               .iotype         = UPIO_MEM,
+               .regshift       = 0,
+               .uartclk        = SERIAL_CLK,
+       },
+       [1] = {
+               .mapbase        = SERIAL_BASE + 0x3f8,
+               .irq            = IRQ_PCSERIAL2,
+               .flags          = SERIAL_FLAGS,
+               .iotype         = UPIO_MEM,
+               .regshift       = 0,
+               .uartclk        = SERIAL_CLK,
+       },
+       { }
+};
+
+static struct platform_device bast_sio = {
+       .name                   = "serial8250",
+       .id                     = 0,
+       .dev                    = {
+               .platform_data  = &bast_sio_data,
+       },
+};
 
 /* Standard BAST devices */
 
@@ -364,6 +397,7 @@ static struct platform_device *bast_devices[] __initdata = {
        &s3c_device_nand,
        &bast_device_nor,
        &bast_device_dm9k,
+       &bast_sio,
 };
 
 static struct clk *bast_clocks[] = {
diff --git a/arch/arm/mach-s3c2410/s3c2440-clock.c b/arch/arm/mach-s3c2410/s3c2440-clock.c
new file mode 100644 (file)
index 0000000..b018a1f
--- /dev/null
@@ -0,0 +1,116 @@
+/* linux/arch/arm/mach-s3c2410/s3c2440-clock.c
+ *
+ * Copyright (c) 2004-2005 Simtec Electronics
+ *     http://armlinux.simtec.co.uk/
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * S3C2440 Clock support
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*/
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/list.h>
+#include <linux/errno.h>
+#include <linux/err.h>
+#include <linux/device.h>
+#include <linux/sysdev.h>
+
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+
+#include <asm/hardware.h>
+#include <asm/atomic.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <asm/hardware/clock.h>
+#include <asm/arch/regs-clock.h>
+
+#include "clock.h"
+#include "cpu.h"
+
+/* S3C2440 extended clock support */
+
+static struct clk s3c2440_clk_upll = {
+       .name           = "upll",
+       .id             = -1,
+};
+
+static struct clk s3c2440_clk_cam = {
+       .name           = "camif",
+       .id             = -1,
+       .enable         = s3c24xx_clkcon_enable,
+       .ctrlbit        = S3C2440_CLKCON_CAMERA,
+};
+
+static struct clk s3c2440_clk_ac97 = {
+       .name           = "ac97",
+       .id             = -1,
+       .enable         = s3c24xx_clkcon_enable,
+       .ctrlbit        = S3C2440_CLKCON_CAMERA,
+};
+
+static int s3c2440_clk_add(struct sys_device *sysdev)
+{
+       unsigned long upllcon = __raw_readl(S3C2410_UPLLCON);
+       struct clk *clk_h;
+       struct clk *clk_p;
+       struct clk *clk_xtal;
+
+       clk_xtal = clk_get(NULL, "xtal");
+       if (IS_ERR(clk_xtal)) {
+               printk(KERN_ERR "S3C2440: Failed to get clk_xtal\n");
+               return -EINVAL;
+       }
+
+       s3c2440_clk_upll.rate = s3c2410_get_pll(upllcon, clk_xtal->rate);
+
+       printk("S3C2440: Clock Support, UPLL %ld.%03ld MHz\n",
+              print_mhz(s3c2440_clk_upll.rate));
+
+       clk_p = clk_get(NULL, "pclk");
+       clk_h = clk_get(NULL, "hclk");
+
+       if (IS_ERR(clk_p) || IS_ERR(clk_h)) {
+               printk(KERN_ERR "S3C2440: Failed to get parent clocks\n");
+               return -EINVAL;
+       }
+
+       s3c2440_clk_cam.parent = clk_h;
+       s3c2440_clk_ac97.parent = clk_p;
+
+       s3c24xx_register_clock(&s3c2440_clk_ac97);
+       s3c24xx_register_clock(&s3c2440_clk_cam);
+       s3c24xx_register_clock(&s3c2440_clk_upll);
+
+       clk_disable(&s3c2440_clk_ac97);
+       clk_disable(&s3c2440_clk_cam);
+
+       return 0;
+}
+
+static struct sysdev_driver s3c2440_clk_driver = {
+       .add    = s3c2440_clk_add,
+};
+
+static __init int s3c24xx_clk_driver(void)
+{
+       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_clk_driver);
+}
+
+arch_initcall(s3c24xx_clk_driver);
diff --git a/arch/arm/mach-s3c2410/s3c2440-irq.c b/arch/arm/mach-s3c2410/s3c2440-irq.c
new file mode 100644 (file)
index 0000000..7cb9912
--- /dev/null
@@ -0,0 +1,207 @@
+/* linux/arch/arm/mach-s3c2410/s3c2440-irq.c
+ *
+ * Copyright (c) 2003,2004 Simtec Electronics
+ *     Ben Dooks <ben@simtec.co.uk>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Changelog:
+ *     25-Jul-2005 BJD         Split from irq.c
+ *
+*/
+
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/interrupt.h>
+#include <linux/ioport.h>
+#include <linux/ptrace.h>
+#include <linux/sysdev.h>
+
+#include <asm/hardware.h>
+#include <asm/irq.h>
+#include <asm/io.h>
+
+#include <asm/mach/irq.h>
+
+#include <asm/arch/regs-irq.h>
+#include <asm/arch/regs-gpio.h>
+
+#include "cpu.h"
+#include "pm.h"
+#include "irq.h"
+
+/* WDT/AC97 */
+
+static void s3c_irq_demux_wdtac97(unsigned int irq,
+                                 struct irqdesc *desc,
+                                 struct pt_regs *regs)
+{
+       unsigned int subsrc, submsk;
+       struct irqdesc *mydesc;
+
+       /* read the current pending interrupts, and the mask
+        * for what it is available */
+
+       subsrc = __raw_readl(S3C2410_SUBSRCPND);
+       submsk = __raw_readl(S3C2410_INTSUBMSK);
+
+       subsrc &= ~submsk;
+       subsrc >>= 13;
+       subsrc &= 3;
+
+       if (subsrc != 0) {
+               if (subsrc & 1) {
+                       mydesc = irq_desc + IRQ_S3C2440_WDT;
+                       mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
+               }
+               if (subsrc & 2) {
+                       mydesc = irq_desc + IRQ_S3C2440_AC97;
+                       mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
+               }
+       }
+}
+
+
+#define INTMSK_WDT      (1UL << (IRQ_WDT - IRQ_EINT0))
+
+static void
+s3c_irq_wdtac97_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_WDT, 3<<13);
+}
+
+static void
+s3c_irq_wdtac97_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_WDT);
+}
+
+static void
+s3c_irq_wdtac97_ack(unsigned int irqno)
+{
+       s3c_irqsub_maskack(irqno, INTMSK_WDT, 3<<13);
+}
+
+static struct irqchip s3c_irq_wdtac97 = {
+       .mask       = s3c_irq_wdtac97_mask,
+       .unmask     = s3c_irq_wdtac97_unmask,
+       .ack        = s3c_irq_wdtac97_ack,
+};
+
+/* camera irq */
+
+static void s3c_irq_demux_cam(unsigned int irq,
+                             struct irqdesc *desc,
+                             struct pt_regs *regs)
+{
+       unsigned int subsrc, submsk;
+       struct irqdesc *mydesc;
+
+       /* read the current pending interrupts, and the mask
+        * for what it is available */
+
+       subsrc = __raw_readl(S3C2410_SUBSRCPND);
+       submsk = __raw_readl(S3C2410_INTSUBMSK);
+
+       subsrc &= ~submsk;
+       subsrc >>= 11;
+       subsrc &= 3;
+
+       if (subsrc != 0) {
+               if (subsrc & 1) {
+                       mydesc = irq_desc + IRQ_S3C2440_CAM_C;
+                       mydesc->handle( IRQ_S3C2440_WDT, mydesc, regs);
+               }
+               if (subsrc & 2) {
+                       mydesc = irq_desc + IRQ_S3C2440_CAM_P;
+                       mydesc->handle(IRQ_S3C2440_AC97, mydesc, regs);
+               }
+       }
+}
+
+#define INTMSK_CAM (1UL << (IRQ_CAM - IRQ_EINT0))
+
+static void
+s3c_irq_cam_mask(unsigned int irqno)
+{
+       s3c_irqsub_mask(irqno, INTMSK_CAM, 3<<11);
+}
+
+static void
+s3c_irq_cam_unmask(unsigned int irqno)
+{
+       s3c_irqsub_unmask(irqno, INTMSK_CAM);
+}
+
+static void
+s3c_irq_cam_ack(unsigned int irqno)
+{
+       s3c_irqsub_maskack(irqno, INTMSK_CAM, 3<<11);
+}
+
+static struct irqchip s3c_irq_cam = {
+       .mask       = s3c_irq_cam_mask,
+       .unmask     = s3c_irq_cam_unmask,
+       .ack        = s3c_irq_cam_ack,
+};
+
+static int s3c2440_irq_add(struct sys_device *sysdev)
+{
+       unsigned int irqno;
+
+       printk("S3C2440: IRQ Support\n");
+
+       set_irq_chip(IRQ_NFCON, &s3c_irq_level_chip);
+       set_irq_handler(IRQ_NFCON, do_level_IRQ);
+       set_irq_flags(IRQ_NFCON, IRQF_VALID);
+
+       /* add new chained handler for wdt, ac7 */
+
+       set_irq_chip(IRQ_WDT, &s3c_irq_level_chip);
+       set_irq_handler(IRQ_WDT, do_level_IRQ);
+       set_irq_chained_handler(IRQ_WDT, s3c_irq_demux_wdtac97);
+
+       for (irqno = IRQ_S3C2440_WDT; irqno <= IRQ_S3C2440_AC97; irqno++) {
+               set_irq_chip(irqno, &s3c_irq_wdtac97);
+               set_irq_handler(irqno, do_level_IRQ);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
+
+       /* add chained handler for camera */
+
+       set_irq_chip(IRQ_CAM, &s3c_irq_level_chip);
+       set_irq_handler(IRQ_CAM, do_level_IRQ);
+       set_irq_chained_handler(IRQ_CAM, s3c_irq_demux_cam);
+
+       for (irqno = IRQ_S3C2440_CAM_C; irqno <= IRQ_S3C2440_CAM_P; irqno++) {
+               set_irq_chip(irqno, &s3c_irq_cam);
+               set_irq_handler(irqno, do_level_IRQ);
+               set_irq_flags(irqno, IRQF_VALID);
+       }
+
+       return 0;
+}
+
+static struct sysdev_driver s3c2440_irq_driver = {
+       .add    = s3c2440_irq_add,
+};
+
+static int s3c24xx_irq_driver(void)
+{
+       return sysdev_driver_register(&s3c2440_sysclass, &s3c2440_irq_driver);
+}
+
+arch_initcall(s3c24xx_irq_driver);
+
index b19f00e99a21f43272a9acd7fa8093a1f5cd2f8a..e33fe4229d056e9ae098249ceb2b3b022cd87196 100644 (file)
@@ -425,6 +425,9 @@ static void __init build_mem_type_table(void)
                mem_types[MT_ROM].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
                mem_types[MT_MINICLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
                mem_types[MT_CACHECLEAN].prot_sect |= PMD_SECT_APX|PMD_SECT_AP_WRITE;
+
+               mem_types[MT_DEVICE].prot_pte |= L_PTE_BUFFERABLE;
+               mem_types[MT_DEVICE].prot_sect |= PMD_SECT_BUFFERED;
        }
 
        cp = &cache_policies[cachepolicy];
index 45cc65426a223a1b7f70fd1fb208bbf1065a40c0..e4a61aea534b4e840c02f969629d997a2465b339 100644 (file)
@@ -29,9 +29,7 @@
  * stack+task struct.  Use the same method as 'current' uses to
  * reach them.
  */
-register unsigned long *user_registers asm("sl");
-
-#define GET_USERREG() (user_registers)
+#define GET_USERREG() ((struct pt_regs *)(THREAD_START_SP + (unsigned long)current_thread_info()) - 1)
 
 #include <linux/config.h>
 #include <linux/thread_info.h>
index a8efcf34888ee7c17d2e8a4917c0b1724b3d1ab4..12885f31d34794dde98be059088669efbc250c89 100644 (file)
@@ -132,7 +132,7 @@ void float_raise(signed char flags)
        printk(KERN_DEBUG
               "NWFPE: %s[%d] takes exception %08x at %p from %08lx\n",
               current->comm, current->pid, flags,
-              __builtin_return_address(0), GET_USERREG()[15]);
+              __builtin_return_address(0), GET_USERREG()->ARM_pc);
 #endif
 
        /* Keep SoftFloat exception flags up to date.  */
index e5f59e9a302227a719444a1f97f2747147e0c7cc..2c39ad408f2283b28be3b34a972aec2f4fc6905f 100644 (file)
@@ -28,8 +28,8 @@ static inline unsigned long readRegister(const unsigned int nReg)
           for this in this routine.  LDF/STF instructions with Rn = PC
           depend on the PC being correct, as they use PC+8 in their
           address calculations. */
-       unsigned long *userRegisters = GET_USERREG();
-       unsigned int val = userRegisters[nReg];
+       struct pt_regs *regs = GET_USERREG();
+       unsigned int val = regs->uregs[nReg];
        if (REG_PC == nReg)
                val -= 4;
        return val;
@@ -38,8 +38,8 @@ static inline unsigned long readRegister(const unsigned int nReg)
 static inline void
 writeRegister(const unsigned int nReg, const unsigned long val)
 {
-       unsigned long *userRegisters = GET_USERREG();
-       userRegisters[nReg] = val;
+       struct pt_regs *regs = GET_USERREG();
+       regs->uregs[nReg] = val;
 }
 
 static inline unsigned long readCPSR(void)
@@ -63,12 +63,12 @@ static inline unsigned long readConditionCodes(void)
 
 static inline void writeConditionCodes(const unsigned long val)
 {
-       unsigned long *userRegisters = GET_USERREG();
+       struct pt_regs *regs = GET_USERREG();
        unsigned long rval;
        /*
         * Operate directly on userRegisters since
         * the CPSR may be the PC register itself.
         */
-       rval = userRegisters[REG_CPSR] & ~CC_MASK;
-       userRegisters[REG_CPSR] = rval | (val & CC_MASK);
+       rval = regs->ARM_cpsr & ~CC_MASK;
+       regs->ARM_cpsr = rval | (val & CC_MASK);
 }
index 46aea6ac194d5e015389c77ae941b0901bde29d0..9eb9964d32a7368c0b71c53015c75a7e58626f48 100644 (file)
@@ -103,9 +103,6 @@ void machine_power_off(void)
 {
 }
 
-EXPORT_SYMBOL(machine_halt);
-EXPORT_SYMBOL(machine_power_off);
-
 void machine_restart(char * __unused)
 {
        /*
@@ -136,8 +133,6 @@ void machine_restart(char * __unused)
        while (1);
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void show_regs(struct pt_regs * regs)
 {
        unsigned long flags;
index 9f7cad7c78498a706853cafa4491381dcdcc0697..a5ad2b6758530fc2fda8dae4510e90e3c098cb6f 100644 (file)
 #include <linux/user.h>
 #include <linux/elfcore.h>
 #include <linux/mqueue.h>
+#include <linux/reboot.h>
 
 //#define DEBUG
 
@@ -208,13 +209,11 @@ void cpu_idle (void)
 
 void hard_reset_now (void);
 
-void machine_restart(void)
+void machine_restart(char *cmd)
 {
        hard_reset_now();
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 /*
  * Similar to machine_power_off, but don't shut off power.  Add code
  * here to freeze the system for e.g. post-mortem debug purpose when
@@ -225,16 +224,12 @@ void machine_halt(void)
 {
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 /* If or when software power-off is implemented, add code here.  */
 
 void machine_power_off(void)
 {
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 /*
  * When a process does an "exec", machine state like FPU and debug
  * registers need to be reset.  This is a hook function for that.
index b5f83e9f04db63eb1013267b65f94a891432e375..27f1fce64ce465026ee90c0cffd2e25717843075 100644 (file)
@@ -90,8 +90,6 @@ void machine_restart(char * __unused)
        __asm__("jmp @@0"); 
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_halt(void)
 {
        local_irq_disable();
@@ -99,8 +97,6 @@ void machine_halt(void)
        for (;;);
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off(void)
 {
        local_irq_disable();
@@ -108,8 +104,6 @@ void machine_power_off(void)
        for (;;);
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 void show_regs(struct pt_regs * regs)
 {
        printk("\nPC: %08lx  Status: %02x",
index 064211d5f41b62a9d4c593e94aaa2e37862434a6..d7811c4e8b509b30fa5fd15f822d94ebddb0d82c 100644 (file)
@@ -911,14 +911,7 @@ static void apm_power_off(void)
                0xcd, 0x15              /* int   $0x15       */
        };
 
-       /*
-        * This may be called on an SMP machine.
-        */
-#ifdef CONFIG_SMP
        /* Some bioses don't like being called from CPU != 0 */
-       set_cpus_allowed(current, cpumask_of_cpu(0));
-       BUG_ON(smp_processor_id() != 0);
-#endif
        if (apm_info.realmode_power_off)
        {
                (void)apm_save_cpus();
index b817168d9c6210e4cfb55140b3543449c46dcfab..d75524758daf770811e029536f6730c8b5c0fa21 100644 (file)
@@ -82,17 +82,6 @@ void kernel_fpu_begin(void)
 }
 EXPORT_SYMBOL_GPL(kernel_fpu_begin);
 
-void restore_fpu( struct task_struct *tsk )
-{
-       if ( cpu_has_fxsr ) {
-               asm volatile( "fxrstor %0"
-                             : : "m" (tsk->thread.i387.fxsave) );
-       } else {
-               asm volatile( "frstor %0"
-                             : : "m" (tsk->thread.i387.fsave) );
-       }
-}
-
 /*
  * FPU tag word conversions.
  */
index ba243a4cc119fd35774bfc26e3fb3587bb31c741..d9492058aaf32c4821723967d3e158ef4de49616 100644 (file)
@@ -700,23 +700,27 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
 
        /*
         * Restore %fs and %gs if needed.
+        *
+        * Glibc normally makes %fs be zero, and %gs is one of
+        * the TLS segments.
         */
-       if (unlikely(prev->fs | prev->gs | next->fs | next->gs)) {
+       if (unlikely(prev->fs | next->fs))
                loadsegment(fs, next->fs);
+
+       if (prev->gs | next->gs)
                loadsegment(gs, next->gs);
-       }
 
        /*
         * Now maybe reload the debug registers
         */
        if (unlikely(next->debugreg[7])) {
-               set_debugreg(current->thread.debugreg[0], 0);
-               set_debugreg(current->thread.debugreg[1], 1);
-               set_debugreg(current->thread.debugreg[2], 2);
-               set_debugreg(current->thread.debugreg[3], 3);
+               set_debugreg(next->debugreg[0], 0);
+               set_debugreg(next->debugreg[1], 1);
+               set_debugreg(next->debugreg[2], 2);
+               set_debugreg(next->debugreg[3], 3);
                /* no 4 and 5 */
-               set_debugreg(current->thread.debugreg[6], 6);
-               set_debugreg(current->thread.debugreg[7], 7);
+               set_debugreg(next->debugreg[6], 6);
+               set_debugreg(next->debugreg[7], 7);
        }
 
        if (unlikely(prev->io_bitmap_ptr || next->io_bitmap_ptr))
index b3e584849961e79872a92b6518ab15c47071e797..c71fef31dc4797d891f10c5d8d257bbf11d73df7 100644 (file)
@@ -284,7 +284,7 @@ void machine_shutdown(void)
        reboot_cpu_id = 0;
 
        /* See if there has been given a command line override */
-       if ((reboot_cpu_id != -1) && (reboot_cpu < NR_CPUS) &&
+       if ((reboot_cpu != -1) && (reboot_cpu < NR_CPUS) &&
                cpu_isset(reboot_cpu, cpu_online_map)) {
                reboot_cpu_id = reboot_cpu;
        }
@@ -311,10 +311,8 @@ void machine_shutdown(void)
 #endif
 }
 
-void machine_restart(char * __unused)
+void machine_emergency_restart(void)
 {
-       machine_shutdown();
-
        if (!reboot_thru_bios) {
                if (efi_enabled) {
                        efi.reset_system(EFI_RESET_COLD, EFI_SUCCESS, 0, NULL);
@@ -337,23 +335,22 @@ void machine_restart(char * __unused)
        machine_real_restart(jump_to_bios, sizeof(jump_to_bios));
 }
 
-EXPORT_SYMBOL(machine_restart);
+void machine_restart(char * __unused)
+{
+       machine_shutdown();
+       machine_emergency_restart();
+}
 
 void machine_halt(void)
 {
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off(void)
 {
-       lapic_shutdown();
+       machine_shutdown();
 
-       if (efi_enabled)
-               efi.reset_system(EFI_RESET_SHUTDOWN, EFI_SUCCESS, 0, NULL);
        if (pm_power_off)
                pm_power_off();
 }
 
-EXPORT_SYMBOL(machine_power_off);
 
index 7306353c520ec6dc4c74a6cac328f8b5ba446d64..af4de58cab543362bb19d8e31c85006cd7c17e9d 100644 (file)
@@ -1414,7 +1414,7 @@ static struct nop {
    This runs before SMP is initialized to avoid SMP problems with
    self modifying code. This implies that assymetric systems where
    APs have less capabilities than the boot processor are not handled. 
-   In this case boot with "noreplacement". */ 
+   Tough. Make sure you disable such features by hand. */ 
 void apply_alternatives(void *start, void *end) 
 { 
        struct alt_instr *a; 
@@ -1442,24 +1442,12 @@ void apply_alternatives(void *start, void *end)
        }
 } 
 
-static int no_replacement __initdata = 0; 
 void __init alternative_instructions(void)
 {
        extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
-       if (no_replacement) 
-               return;
        apply_alternatives(__alt_instructions, __alt_instructions_end);
 }
 
-static int __init noreplacement_setup(char *s)
-{ 
-     no_replacement = 1; 
-     return 0; 
-} 
-
-__setup("noreplacement", noreplacement_setup); 
-
 static char * __init machine_specific_memory_setup(void);
 
 #ifdef CONFIG_MCA
index 95e4676594e1e0c05d9e181821533a016e3a28da..9e9296676f931dfc2831f40c127933d2f772badf 100644 (file)
@@ -22,8 +22,6 @@ void machine_restart(char * __unused)
        outb(PIIX4_RESET_VAL, PIIX4_RESET_PORT);
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_power_off(void)
 {
        unsigned short pm_status;
@@ -43,10 +41,7 @@ void machine_power_off(void)
        outl(PIIX_SPECIAL_STOP, 0xCFC);
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 void machine_halt(void)
 {
 }
 
-EXPORT_SYMBOL(machine_halt);
index 8680080a6a8916a713d267b6b772a835e1ed8d17..b3eda46e0fe9d4e1a02cfc8e90c9e29b7abd1e94 100644 (file)
@@ -278,8 +278,6 @@ machine_restart(char *cmd)
        }
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void
 mca_nmi_hook(void)
 {
@@ -315,12 +313,9 @@ machine_halt(void)
        machine_power_off();
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off(void)
 {
        if (pm_power_off)
                pm_power_off();
 }
 
-EXPORT_SYMBOL(machine_power_off);
index e484910246ad7998d3818b1e6b13a7df91de23de..66e8406098080343da5fa91e3f1b860d7e6ee5d7 100644 (file)
@@ -807,16 +807,12 @@ machine_restart (char *restart_cmd)
        (*efi.reset_system)(EFI_RESET_WARM, 0, 0, NULL);
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void
 machine_halt (void)
 {
        cpu_halt();
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void
 machine_power_off (void)
 {
@@ -825,4 +821,3 @@ machine_power_off (void)
        machine_halt();
 }
 
-EXPORT_SYMBOL(machine_power_off);
index d580adcad927a15e316097e0422746db9bca408e..bb1d5cf30440cb9bf01b501084dd3ec08e8326ce 100644 (file)
@@ -420,7 +420,7 @@ xpc_activating(void *__partid)
        partid_t partid = (u64) __partid;
        struct xpc_partition *part = &xpc_partitions[partid];
        unsigned long irq_flags;
-       struct sched_param param = { sched_priority: MAX_USER_RT_PRIO - 1 };
+       struct sched_param param = { sched_priority: MAX_RT_PRIO - 1 };
        int ret;
 
 
index b556c3cf6495c4eb8a05dc580f943fd5f52e2de0..ea13a8f4d8b05aadc691f010435b6fa6ef751a91 100644 (file)
@@ -115,8 +115,6 @@ void machine_restart(char *__unused)
                cpu_relax();
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_halt(void)
 {
        printk("Please push reset button!\n");
@@ -124,15 +122,11 @@ void machine_halt(void)
                cpu_relax();
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off(void)
 {
        /* M32R_FIXME */
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 static int __init idle_setup (char *str)
 {
        if (!strncmp(str, "poll", 4)) {
index 93b043e2a4359985b80ab1890135ccc1e57351dc..11b1b90ba6ba49d4dc193517921fd88a5fe84a9f 100644 (file)
@@ -113,8 +113,6 @@ void machine_restart(char * __unused)
        for (;;);
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_halt(void)
 {
        if (mach_halt)
@@ -122,8 +120,6 @@ void machine_halt(void)
        for (;;);
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off(void)
 {
        if (mach_power_off)
@@ -131,8 +127,6 @@ void machine_power_off(void)
        for (;;);
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 void show_regs(struct pt_regs * regs)
 {
        printk("\n");
index c4a33f265dc07e53577350d5366b3a936c8bc665..82e7ec8888064589dcf642e336f11d32e209dd0b 100644 (file)
@@ -80,8 +80,6 @@ void machine_restart(char * __unused)
        for (;;);
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_halt(void)
 {
        if (mach_halt)
@@ -89,8 +87,6 @@ void machine_halt(void)
        for (;;);
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off(void)
 {
        if (mach_power_off)
@@ -98,8 +94,6 @@ void machine_power_off(void)
        for (;;);
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 void show_regs(struct pt_regs * regs)
 {
        printk(KERN_NOTICE "\n");
index 7e0a9821931ad30d27c813db7d58a5f7778a7bab..ae2ba67b7ef61f1054f8f5f19f625d3f78b5f6ed 100644 (file)
@@ -26,18 +26,13 @@ void machine_restart(char *command)
        _machine_restart(command);
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_halt(void)
 {
        _machine_halt();
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off(void)
 {
        _machine_power_off();
 }
 
-EXPORT_SYMBOL(machine_power_off);
index 46e4a6881f11cca2d7dc77ae1e7b71b02b15241a..4fc04501d5e5d9c9752d7573b47775cfdc4cd539 100644 (file)
@@ -150,8 +150,6 @@ void machine_restart(char *cmd)
 
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_halt(void)
 {
        /*
@@ -160,8 +158,6 @@ void machine_halt(void)
        */
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 
 /*
  * This routine is called from sys_reboot to actually turn off the
@@ -187,8 +183,6 @@ void machine_power_off(void)
               KERN_EMERG "Please power this system off now.");
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 
 /*
  * Create a kernel thread
index c42f753269396ff297e02669004e3c126a921f26..929e5d1cc7fea145ecffdd2e6968b929dde1ebd6 100644 (file)
@@ -121,8 +121,6 @@ void machine_restart(char *cmd)
        ppc_md.restart(cmd);
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_power_off(void)
 {
 #ifdef CONFIG_NVRAM
@@ -131,8 +129,6 @@ void machine_power_off(void)
        ppc_md.power_off();
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 void machine_halt(void)
 {
 #ifdef CONFIG_NVRAM
@@ -141,8 +137,6 @@ void machine_halt(void)
        ppc_md.halt();
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void (*pm_power_off)(void) = machine_power_off;
 
 #ifdef CONFIG_TAU
index d1b33f0b26cb12261712d00b8e203cf9e7d24129..e80f10c89824c2874c8007d2d6914391a5a8bfbf 100644 (file)
@@ -694,7 +694,6 @@ void machine_restart(char *cmd)
        local_irq_disable();
        while (1) ;
 }
-EXPORT_SYMBOL(machine_restart);
 
 void machine_power_off(void)
 {
@@ -707,7 +706,6 @@ void machine_power_off(void)
        local_irq_disable();
        while (1) ;
 }
-EXPORT_SYMBOL(machine_power_off);
 
 void machine_halt(void)
 {
@@ -720,7 +718,6 @@ void machine_halt(void)
        local_irq_disable();
        while (1) ;
 }
-EXPORT_SYMBOL(machine_halt);
 
 static int ppc64_panic_event(struct notifier_block *this,
                              unsigned long event, void *ptr)
index b6d740ac0e6eedb8f0d1d7255b4d872463acc702..a12183989a79b8e461df14b380ecacaf950fe018 100644 (file)
@@ -299,24 +299,18 @@ void machine_restart(char *command)
        _machine_restart(command);
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_halt(void)
 {
        console_unblank();
        _machine_halt();
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off(void)
 {
        console_unblank();
        _machine_power_off();
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 static void __init
 add_memory_hole(unsigned long start, unsigned long end)
 {
index 3d024590c24e8f34c185ecd49a13b5ec547ba6ae..6dce9d0b81f8b8d53d4ac78378e4af0c5cbd82db 100644 (file)
@@ -80,8 +80,6 @@ void machine_restart(char * __unused)
                     "mov.l @%1, %0" : : "r" (0x10000000), "r" (0x80000001));
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_halt(void)
 {
 #if defined(CONFIG_SH_HS7751RVOIP)
@@ -96,8 +94,6 @@ void machine_halt(void)
                cpu_sleep();
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off(void)
 {
 #if defined(CONFIG_SH_HS7751RVOIP)
@@ -110,8 +106,6 @@ void machine_power_off(void)
 #endif
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 void show_regs(struct pt_regs * regs)
 {
        printk("\n");
index 2c216ffeea90b61535eae1cd37d07b7f9acdb479..29e72b57d4fd2cee97e6e9bc8b8ed63812c448f5 100644 (file)
@@ -158,8 +158,6 @@ void machine_halt(void)
        panic("Halt failed!");
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_restart(char * cmd)
 {
        char *p;
@@ -180,8 +178,6 @@ void machine_restart(char * cmd)
        panic("Reboot failed!");
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_power_off(void)
 {
 #ifdef CONFIG_SUN_AUXIO
@@ -191,8 +187,6 @@ void machine_power_off(void)
        machine_halt();
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 static DEFINE_SPINLOCK(sparc_backtrace_lock);
 
 void __show_backtrace(unsigned long fp)
index d781f10adc52eab8d8d57cf55f208650b0e9f185..88332f00094ac5d00ae9f0e2acdc0adbbdf595b5 100644 (file)
@@ -1600,11 +1600,11 @@ sys_clone:      flushw
                ba,pt           %xcc, sparc_do_fork
                 add            %sp, PTREGS_OFF, %o2
 ret_from_syscall:
-               /* Clear SPARC_FLAG_NEWCHILD, switch_to leaves thread.flags in
-                * %o7 for us.  Check performance counter stuff too.
+               /* Clear current_thread_info()->new_child, and
+                * check performance counter stuff too.
                 */
-               andn            %o7, _TIF_NEWCHILD, %l0
-               stx             %l0, [%g6 + TI_FLAGS]
+               stb             %g0, [%g6 + TI_NEW_CHILD]
+               ldx             [%g6 + TI_FLAGS], %l0
                call            schedule_tail
                 mov            %g7, %o0
                andcc           %l0, _TIF_PERFCTR, %g0
@@ -1720,12 +1720,11 @@ ret_sys_call:
        /* Check if force_successful_syscall_return()
         * was invoked.
         */
-       ldx             [%curptr + TI_FLAGS], %l0
-       andcc           %l0, _TIF_SYSCALL_SUCCESS, %g0
-       be,pt           %icc, 1f
-        andn           %l0, _TIF_SYSCALL_SUCCESS, %l0
+       ldub            [%curptr + TI_SYS_NOERROR], %l0
+       brz,pt          %l0, 1f
+        nop
        ba,pt           %xcc, 80f
-        stx            %l0, [%curptr + TI_FLAGS]
+        stb            %g0, [%curptr + TI_SYS_NOERROR]
 
 1:
        cmp             %o0, -ERESTART_RESTARTBLOCK
index daa2fb93052ca0b030051f84161be3f22242422e..c9b69167632a7b666ee829f1dec5c696a384e20b 100644 (file)
@@ -782,8 +782,14 @@ static void distribute_irqs(void)
 }
 #endif
 
+struct sun5_timer {
+       u64     count0;
+       u64     limit0;
+       u64     count1;
+       u64     limit1;
+};
 
-struct sun5_timer *prom_timers;
+static struct sun5_timer *prom_timers;
 static u64 prom_limit0, prom_limit1;
 
 static void map_prom_timers(void)
@@ -839,18 +845,6 @@ static void kill_prom_timer(void)
        : "g1", "g2");
 }
 
-void enable_prom_timer(void)
-{
-       if (!prom_timers)
-               return;
-
-       /* Set it to whatever was there before. */
-       prom_timers->limit1 = prom_limit1;
-       prom_timers->count1 = 0;
-       prom_timers->limit0 = prom_limit0;
-       prom_timers->count0 = 0;
-}
-
 void init_irqwork_curcpu(void)
 {
        register struct irq_work_struct *workp asm("o2");
index 533104c7907d970994d3363eaa79b2126e327d8c..946cee0257ea2dc34fe25350fc71910b235dfc7c 100644 (file)
@@ -69,8 +69,6 @@ void machine_power_off(void)
        machine_halt();
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 #ifdef CONFIG_PCI
 static int powerd(void *__unused)
 {
index a0cd2b2494d6cc5f111faeed82a42ab96ba99323..07424b075938b7651e53380cddcf712c42b324e0 100644 (file)
@@ -124,8 +124,6 @@ void machine_halt(void)
        panic("Halt failed!");
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_alt_power_off(void)
 {
        if (!serial_console && prom_palette)
@@ -154,8 +152,6 @@ void machine_restart(char * cmd)
        panic("Reboot failed!");
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 static void show_regwindow32(struct pt_regs *regs)
 {
        struct reg_window32 __user *rw;
@@ -621,8 +617,8 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp,
        memcpy(child_trap_frame, (((struct sparc_stackf *)regs)-1), (TRACEREG_SZ+STACKFRAME_SZ));
 
        t->flags = (t->flags & ~((0xffUL << TI_FLAG_CWP_SHIFT) | (0xffUL << TI_FLAG_CURRENT_DS_SHIFT))) |
-               _TIF_NEWCHILD |
                (((regs->tstate + 1) & TSTATE_CWP) << TI_FLAG_CWP_SHIFT);
+       t->new_child = 1;
        t->ksp = ((unsigned long) child_trap_frame) - STACK_BIAS;
        t->kregs = (struct pt_regs *)(child_trap_frame+sizeof(struct sparc_stackf));
        t->fpsaved[0] = 0;
index 7e8e2919e18677e67e5bc7f37c626190cd70a394..b9b42491e118b6e273f40889de677ffb5d98cc1f 100644 (file)
@@ -137,7 +137,7 @@ void __init smp_callin(void)
        /* Clear this or we will die instantly when we
         * schedule back to this idler...
         */
-       clear_thread_flag(TIF_NEWCHILD);
+       current_thread_info()->new_child = 0;
 
        /* Attach to the address space of init_task. */
        atomic_inc(&init_mm.mm_count);
index a9f4596d7c2bcd82419386d808b5f35d69d2a46a..100b0107c4be89b1484c8b370dd8898871cfe10f 100644 (file)
@@ -2125,6 +2125,8 @@ void __init trap_init(void)
            TI_PCR != offsetof(struct thread_info, pcr_reg) ||
            TI_CEE_STUFF != offsetof(struct thread_info, cee_stuff) ||
            TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) ||
+           TI_NEW_CHILD != offsetof(struct thread_info, new_child) ||
+           TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) ||
            TI_FPREGS != offsetof(struct thread_info, fpregs) ||
            (TI_FPREGS & (64 - 1)))
                thread_info_offsets_are_bolixed_dave();
index fcec51da1d3771abe84944ca1138853417df6bec..a637e885c5835cb7c78e31c6d40099f8473c448c 100644 (file)
@@ -49,23 +49,17 @@ void machine_restart(char * __unused)
        CHOOSE_MODE(reboot_tt(), reboot_skas());
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_power_off(void)
 {
         uml_cleanup();
        CHOOSE_MODE(halt_tt(), halt_skas());
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 void machine_halt(void)
 {
        machine_power_off();
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 /*
  * Overrides for Emacs so that we follow Linus's tabbing style.
  * Emacs will notice this stuff at the end of the file and automatically
index 6aaeab5e8a4047c209da9e6815410ce071cde1cc..d0502e14243707489d895fd73a1b225dc16d696c 100644 (file)
@@ -132,8 +132,6 @@ void machine_restart (char *__unused)
        asm ("jmp r0"); /* Jump to the reset vector.  */
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_halt (void)
 {
 #ifdef CONFIG_RESET_GUARD
@@ -145,15 +143,11 @@ void machine_halt (void)
                asm ("halt; nop; nop; nop; nop; nop");
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off (void)
 {
        machine_halt ();
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 /* Called before configuring an on-chip UART.  */
 void anna_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud)
 {
index 4059b1df11b57431c99d6e7b3f1ec0d273f7bb94..d78c5e4ea9bca4014e1d08dcd567634ac32f2d7b 100644 (file)
@@ -160,8 +160,6 @@ void machine_restart (char *__unused)
        asm ("jmp r0"); /* Jump to the reset vector.  */
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_halt (void)
 {
 #ifdef CONFIG_RESET_GUARD
@@ -173,15 +171,11 @@ void machine_halt (void)
                asm ("halt; nop; nop; nop; nop; nop");
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off (void)
 {
        machine_halt ();
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 /* Called before configuring an on-chip UART.  */
 void as85ep1_uart_pre_configure (unsigned chan, unsigned cflags, unsigned baud)
 {
index 4bac5149b3c25dd1ddd0fae88670f5acfca3c4df..d8094519ad85efac9a4a6ef9e51177362988c340 100644 (file)
@@ -121,22 +121,16 @@ void machine_halt (void)
        }
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_restart (char *__unused)
 {
        machine_halt ();
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_power_off (void)
 {
        machine_halt ();
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 \f
 /* Interrupts */
 
index 7ba397f77aca136c4c87f9ad66703e3f7568dfff..0c794b9e0f9b8c1187eed1d2b9e43a3f8f4e2066 100644 (file)
@@ -67,8 +67,6 @@ void machine_restart (char *__unused)
        asm ("jmp r0"); /* Jump to the reset vector.  */
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 /* This says `HALt.' in LEDese.  */
 static unsigned char halt_leds_msg[] = { 0x76, 0x77, 0x38, 0xF8 };
 
@@ -89,15 +87,11 @@ void machine_halt (void)
                asm ("halt; nop; nop; nop; nop; nop");
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off (void)
 {
        machine_halt ();
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 \f
 /* Animated LED display for timer tick.  */
 
index 4f31da96263277a6af51f58de67183cd4cb29ff2..e2cc5580fa2a1eb9191962261857388698dbbf06 100644 (file)
@@ -104,24 +104,18 @@ void machine_restart (char *__unused)
        V850_SIM_SYSCALL (exit, 0);
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_halt (void)
 {
        V850_SIM_SYSCALL (write, 1, "HALT\n", 5);
        V850_SIM_SYSCALL (exit, 0);
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off (void)
 {
        V850_SIM_SYSCALL (write, 1, "POWER OFF\n", 10);
        V850_SIM_SYSCALL (exit, 0);
 }
 
-EXPORT_SYMBOL(machine_power_off);
-
 \f
 /* Load data from a file called NAME into ram.  The address and length
    of the data image are returned in ADDR and LEN.  */
index 93a722b516bb1b2389fe37b35c7455970881d71b..9111613fb53a332dd1605f0921c64e4b529fdf76 100644 (file)
@@ -184,18 +184,13 @@ void machine_halt (void)
        for (;;) {}
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_restart (char *__unused)
 {
        machine_halt ();
 }
 
-EXPORT_SYMBOL(machine_restart);
-
 void machine_power_off (void)
 {
        machine_halt ();
 }
 
-EXPORT_SYMBOL(machine_power_off);
index cc935427d532355672d06034a644bcbc142e4342..c45d6a05b984f6d1e43e863e6da10b2b5f96d074 100644 (file)
@@ -591,11 +591,15 @@ ia32_sys_call_table:
        .quad compat_sys_mq_getsetattr
        .quad compat_sys_kexec_load     /* reserved for kexec */
        .quad compat_sys_waitid
-       .quad quiet_ni_syscall          /* sys_altroot */
+       .quad quiet_ni_syscall          /* 285: sys_altroot */
        .quad sys_add_key
        .quad sys_request_key
        .quad sys_keyctl
-       /* don't forget to change IA32_NR_syscalls */
+       .quad sys_ioprio_set
+       .quad sys_ioprio_get            /* 290 */
+       .quad sys_inotify_init
+       .quad sys_inotify_add_watch
+       .quad sys_inotify_rm_watch
 ia32_syscall_end:              
        .rept IA32_NR_syscalls-(ia32_syscall_end-ia32_sys_call_table)/8
                .quad ni_syscall
index 68a9ab06ee7c21cfe59c23b0910e6a3f7e151683..be996d1b691e19e0061391794706484f2dac18a4 100644 (file)
@@ -61,6 +61,7 @@
 #include <linux/ptrace.h>
 #include <linux/highuid.h>
 #include <linux/vmalloc.h>
+#include <linux/fsnotify.h>
 #include <asm/mman.h>
 #include <asm/types.h>
 #include <asm/uaccess.h>
@@ -984,8 +985,10 @@ asmlinkage long sys32_open(const char __user * filename, int flags, int mode)
                        if (IS_ERR(f)) {
                                put_unused_fd(fd); 
                                fd = error;
-                       } else
+                       } else {
+                               fsnotify_open(f->f_dentry);
                                fd_install(fd, f);
+                       }
                }
                putname(tmp);
        }
index 57e71dbdfd69952732a24fa8c4ac54a234e49d80..47f95687905fd22d417d54632a40b784d186ed82 100644 (file)
@@ -109,23 +109,10 @@ void machine_shutdown(void)
        local_irq_enable();
 }
 
-void machine_restart(char * __unused)
+void machine_emergency_restart(void)
 {
        int i;
 
-       printk("machine restart\n");
-
-       machine_shutdown();
-
-       if (!reboot_force) {
-               local_irq_disable();
-#ifndef CONFIG_SMP
-               disable_local_APIC();
-#endif
-               disable_IO_APIC();
-               local_irq_enable();
-       }
-       
        /* Tell the BIOS if we want cold or warm reboot */
        *((unsigned short *)__va(0x472)) = reboot_mode;
        
@@ -150,18 +137,26 @@ void machine_restart(char * __unused)
        }      
 }
 
-EXPORT_SYMBOL(machine_restart);
+void machine_restart(char * __unused)
+{
+       printk("machine restart\n");
+
+       if (!reboot_force) {
+               machine_shutdown();
+       }
+       machine_emergency_restart();
+}
 
 void machine_halt(void)
 {
 }
 
-EXPORT_SYMBOL(machine_halt);
-
 void machine_power_off(void)
 {
+       if (!reboot_force) {
+               machine_shutdown();
+       }
        if (pm_power_off)
                pm_power_off();
 }
 
-EXPORT_SYMBOL(machine_power_off);
index 1c92c6bb138bd2c74d50fcf595e0402a98436bdc..8da644364cb4225824575ec4813741b9d46d7041 100644 (file)
@@ -41,7 +41,7 @@ static unsigned int crypt_slow(const struct cipher_desc *desc,
                               struct scatter_walk *in,
                               struct scatter_walk *out, unsigned int bsize)
 {
-       unsigned int alignmask = crypto_tfm_alg_alignmask(desc->tfm);
+       unsigned long alignmask = crypto_tfm_alg_alignmask(desc->tfm);
        u8 buffer[bsize * 2 + alignmask];
        u8 *src = (u8 *)ALIGN((unsigned long)buffer, alignmask + 1);
        u8 *dst = src + bsize;
@@ -160,7 +160,7 @@ static int crypt_iv_unaligned(struct cipher_desc *desc,
                              unsigned int nbytes)
 {
        struct crypto_tfm *tfm = desc->tfm;
-       unsigned int alignmask = crypto_tfm_alg_alignmask(tfm);
+       unsigned long alignmask = crypto_tfm_alg_alignmask(tfm);
        u8 *iv = desc->info;
 
        if (unlikely(((unsigned long)iv & alignmask))) {
@@ -424,7 +424,7 @@ int crypto_init_cipher_ops(struct crypto_tfm *tfm)
        }
        
        if (ops->cit_mode == CRYPTO_TFM_MODE_CBC) {
-               unsigned int align;
+               unsigned long align;
                unsigned long addr;
                
                switch (crypto_tfm_alg_blocksize(tfm)) {
index 68612874b5fde627e571b67ce1533084055e6104..37515beafc8ce44ff501d15d617968248656b59f 100644 (file)
@@ -75,7 +75,7 @@ static inline unsigned int crypto_cipher_ctxsize(struct crypto_alg *alg,
        
        switch (flags & CRYPTO_TFM_MODE_MASK) {
        case CRYPTO_TFM_MODE_CBC:
-               len = ALIGN(len, alg->cra_alignmask + 1);
+               len = ALIGN(len, (unsigned long)alg->cra_alignmask + 1);
                len += alg->cra_blocksize;
                break;
        }
index 8e665f2e3138558e0c70b1a08efed48c3de0b39f..fca4140a50a949b07feb32d0b028cf9f033aa977 100644 (file)
@@ -170,22 +170,19 @@ acpi_ec_enter_burst_mode (
        status = acpi_ec_read_status(ec);
        if (status != -EINVAL &&
                !(status & ACPI_EC_FLAG_BURST)){
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO,"entering burst mode \n"));
                acpi_hw_low_level_write(8, ACPI_EC_BURST_ENABLE, &ec->command_addr);
                status = acpi_ec_wait(ec, ACPI_EC_EVENT_OBF);
                if (status){
                        acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR);
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR," status = %d\n", status));
                        return_VALUE(-EINVAL);
                }
                acpi_hw_low_level_read(8, &tmp, &ec->data_addr);
                acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR);
                if(tmp != 0x90 ) {/* Burst ACK byte*/
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,"Ack failed \n"));
                        return_VALUE(-EINVAL);
                }
-       } else
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO,"already be in burst mode \n"));
+       }
+
        atomic_set(&ec->leaving_burst , 0);
        return_VALUE(0);
 }
@@ -202,7 +199,6 @@ acpi_ec_leave_burst_mode (
        status = acpi_ec_read_status(ec);
        if (status != -EINVAL &&
                (status & ACPI_EC_FLAG_BURST)){
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO,"leaving burst mode\n"));
                acpi_hw_low_level_write(8, ACPI_EC_BURST_DISABLE, &ec->command_addr);
                status = acpi_ec_wait(ec, ACPI_EC_FLAG_IBF);
                if (status){
@@ -212,14 +208,7 @@ acpi_ec_leave_burst_mode (
                }
                acpi_enable_gpe(NULL, ec->gpe_bit, ACPI_NOT_ISR);
                status = acpi_ec_read_status(ec);
-               if (status != -EINVAL &&
-                       (status & ACPI_EC_FLAG_BURST)) {
-                       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,"------->status fail\n"));
-                       return_VALUE(-EINVAL);
-               }
-       }else
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO,"already be in Non-burst mode \n"));
-       ACPI_DEBUG_PRINT((ACPI_DB_INFO,"leaving burst mode\n"));
+       }
 
        return_VALUE(0);
 }
index 1fc86e6b5ab95969134f57513a92daef69ff0f7a..186b182c582522810c22fd44cecf88afd87c97f1 100644 (file)
@@ -19,8 +19,6 @@
 
 int acpi_sleep_prepare(u32 acpi_state)
 {
-       /* Flag to do not allow second time invocation for S5 state */
-       static int shutdown_prepared = 0;
 #ifdef CONFIG_ACPI_SLEEP
        /* do we have a wakeup address for S2 and S3? */
        /* Here, we support only S4BIOS, those we set the wakeup address */
@@ -38,28 +36,23 @@ int acpi_sleep_prepare(u32 acpi_state)
        acpi_enable_wakeup_device_prep(acpi_state);
 #endif
        if (acpi_state == ACPI_STATE_S5) {
-               /* Check if we were already called */
-               if (shutdown_prepared)
-                       return 0;
                acpi_wakeup_gpe_poweroff_prepare();
-               shutdown_prepared = 1;
        }
        acpi_enter_sleep_state_prep(acpi_state);
        return 0;
 }
 
+#ifdef CONFIG_PM
+
 void acpi_power_off(void)
 {
+       /* acpi_sleep_prepare(ACPI_STATE_S5) should have already been called */
        printk("%s called\n", __FUNCTION__);
-       acpi_sleep_prepare(ACPI_STATE_S5);
        local_irq_disable();
        /* Some SMP machines only can poweroff in boot CPU */
-       set_cpus_allowed(current, cpumask_of_cpu(0));
        acpi_enter_sleep_state(ACPI_STATE_S5);
 }
 
-#ifdef CONFIG_PM
-
 static int acpi_shutdown(struct sys_device *x)
 {
        return acpi_sleep_prepare(ACPI_STATE_S5);
@@ -75,8 +68,6 @@ static struct sys_device device_acpi = {
        .cls = &acpi_sysclass,
 };
 
-#endif
-
 static int acpi_poweroff_init(void)
 {
        if (!acpi_disabled) {
@@ -86,19 +77,18 @@ static int acpi_poweroff_init(void)
                status =
                    acpi_get_sleep_type_data(ACPI_STATE_S5, &type_a, &type_b);
                if (ACPI_SUCCESS(status)) {
-                       pm_power_off = acpi_power_off;
-#ifdef CONFIG_PM
-                       {
-                               int error;
-                               error = sysdev_class_register(&acpi_sysclass);
-                               if (!error)
-                                       error = sysdev_register(&device_acpi);
-                               return error;
-                       }
-#endif
+                       int error;
+                       error = sysdev_class_register(&acpi_sysclass);
+                       if (!error)
+                               error = sysdev_register(&device_acpi);
+                       if (!error)
+                               pm_power_off = acpi_power_off;
+                       return error;
                }
        }
        return 0;
 }
 
 late_initcall(acpi_poweroff_init);
+
+#endif /* CONFIG_PM */
index c46d9520c5a75f4ce5bbbc4be8eb9055832df76e..73c6b85299c12e1e34097b7723b039ef5fc522e3 100644 (file)
@@ -794,7 +794,9 @@ static void drain_rx_pools (amb_dev * dev) {
     drain_rx_pool (dev, pool);
 }
 
-static inline void fill_rx_pool (amb_dev * dev, unsigned char pool, int priority) {
+static inline void fill_rx_pool (amb_dev * dev, unsigned char pool,
+                                 unsigned int __nocast priority)
+{
   rx_in rx;
   amb_rxq * rxq;
   
index 101f0cc33d1037b5a734aa57d601ca9f7ae18d07..b078fa548ebf9954babc6d0442455af4ae4396d4 100644 (file)
@@ -1374,7 +1374,8 @@ static void reset_chip (struct fs_dev *dev)
        }
 }
 
-static void __devinit *aligned_kmalloc (int size, int flags, int alignment)
+static void __devinit *aligned_kmalloc (int size, unsigned int __nocast flags,
+                                       int alignment)
 {
        void  *t;
 
@@ -1464,7 +1465,8 @@ static inline int nr_buffers_in_freepool (struct fs_dev *dev, struct freepool *f
    does. I've seen "receive abort: no buffers" and things started
    working again after that...  -- REW */
 
-static void top_off_fp (struct fs_dev *dev, struct freepool *fp, int gfp_flags)
+static void top_off_fp (struct fs_dev *dev, struct freepool *fp,
+                       unsigned int __nocast gfp_flags)
 {
        struct FS_BPENTRY *qe, *ne;
        struct sk_buff *skb;
index df2c83fd5496015ac64025ea9762e90e80c5093f..28250c9b32d6cf9f28e48ce77a3b79444d773176 100644 (file)
@@ -57,7 +57,6 @@
 
 #include <linux/config.h>
 #include <linux/module.h>
-#include <linux/version.h>
 #include <linux/kernel.h>
 #include <linux/skbuff.h>
 #include <linux/pci.h>
index baaf1a3d2242ffa145d3a53a33877389e019a397..30b7e990ed0b19a4419b9cb51e967055830c3cba 100644 (file)
@@ -46,6 +46,7 @@ static char const rcsid[] =
 #include <linux/init.h>
 #include <linux/bitops.h>
 #include <linux/wait.h>
+#include <linux/jiffies.h>
 #include <asm/semaphore.h>
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -780,7 +781,7 @@ push_on_scq(struct idt77252_dev *card, struct vc_map *vc, struct sk_buff *skb)
        return 0;
 
 out:
-       if (jiffies - scq->trans_start > HZ) {
+       if (time_after(jiffies, scq->trans_start + HZ)) {
                printk("%s: Error pushing TBD for %d.%d\n",
                       card->name, vc->tx_vcc->vpi, vc->tx_vcc->vci);
 #ifdef CONFIG_ATM_IDT77252_DEBUG
index 8d5e65cb975528203ebb5b951044d9eaf73c91ad..a2b236a966e0599285698160e44a56161f94be5a 100644 (file)
@@ -16,9 +16,9 @@
 #include <linux/skbuff.h>
 #include <linux/netdevice.h>
 #include <linux/delay.h>
-#include <linux/ioport.h> /* for request_region */
 #include <linux/uio.h>
 #include <linux/init.h>
+#include <linux/dma-mapping.h>
 #include <linux/atm_zatm.h>
 #include <linux/capability.h>
 #include <linux/bitops.h>
@@ -1257,22 +1257,22 @@ static int __init zatm_init(struct atm_dev *dev)
 
 static int __init zatm_start(struct atm_dev *dev)
 {
-       struct zatm_dev *zatm_dev;
+       struct zatm_dev *zatm_dev = ZATM_DEV(dev);
+       struct pci_dev *pdev = zatm_dev->pci_dev;
        unsigned long curr;
        int pools,vccs,rx;
-       int error,i,ld;
+       int error, i, ld;
 
        DPRINTK("zatm_start\n");
-       zatm_dev = ZATM_DEV(dev);
        zatm_dev->rx_map = zatm_dev->tx_map = NULL;
-       for (i = 0; i < NR_MBX; i++)
-               zatm_dev->mbx_start[i] = 0;
-       if (request_irq(zatm_dev->irq,&zatm_int,SA_SHIRQ,DEV_LABEL,dev)) {
-               printk(KERN_ERR DEV_LABEL "(itf %d): IRQ%d is already in use\n",
-                   dev->number,zatm_dev->irq);
-               return -EAGAIN;
+       for (i = 0; i < NR_MBX; i++)
+               zatm_dev->mbx_start[i] = 0;
+       error = request_irq(zatm_dev->irq, zatm_int, SA_SHIRQ, DEV_LABEL, dev);
+       if (error < 0) {
+               printk(KERN_ERR DEV_LABEL "(itf %d): IRQ%d is already in use\n",
+                   dev->number,zatm_dev->irq);
+               goto done;
        }
-       request_region(zatm_dev->base,uPD98401_PORTS,DEV_LABEL);
        /* define memory regions */
        pools = NR_POOLS;
        if (NR_SHAPERS*SHAPER_SIZE > pools*POOL_SIZE)
@@ -1299,51 +1299,66 @@ static int __init zatm_start(struct atm_dev *dev)
            "%ld VCs\n",dev->number,NR_SHAPERS,pools,rx,
            (zatm_dev->mem-curr*4)/VC_SIZE);
        /* create mailboxes */
-       for (i = 0; i < NR_MBX; i++)
-               if (mbx_entries[i]) {
-                       unsigned long here;
-
-                       here = (unsigned long) kmalloc(2*MBX_SIZE(i),
-                           GFP_KERNEL);
-                       if (!here) {
-                               error = -ENOMEM;
-                               goto out;
-                       }
-                       if ((here^(here+MBX_SIZE(i))) & ~0xffffUL)/* paranoia */
-                               here = (here & ~0xffffUL)+0x10000;
-                       zatm_dev->mbx_start[i] = here;
-                       if ((here^virt_to_bus((void *) here)) & 0xffff) {
-                               printk(KERN_ERR DEV_LABEL "(itf %d): system "
-                                   "bus incompatible with driver\n",
-                                   dev->number);
-                               error = -ENODEV;
-                               goto out;
-                       }
-                       DPRINTK("mbx@0x%08lx-0x%08lx\n",here,here+MBX_SIZE(i));
-                       zatm_dev->mbx_end[i] = (here+MBX_SIZE(i)) & 0xffff;
-                       zout(virt_to_bus((void *) here) >> 16,MSH(i));
-                       zout(virt_to_bus((void *) here),MSL(i));
-                       zout((here+MBX_SIZE(i)) & 0xffff,MBA(i));
-                       zout(here & 0xffff,MTA(i));
-                       zout(here & 0xffff,MWA(i));
+       for (i = 0; i < NR_MBX; i++) {
+               void *mbx;
+               dma_addr_t mbx_dma;
+
+               if (!mbx_entries[i])
+                       continue;
+               mbx = pci_alloc_consistent(pdev, 2*MBX_SIZE(i), &mbx_dma);
+               if (!mbx) {
+                       error = -ENOMEM;
+                       goto out;
                }
+               /*
+                * Alignment provided by pci_alloc_consistent() isn't enough
+                * for this device.
+                */
+               if (((unsigned long)mbx ^ mbx_dma) & 0xffff) {
+                       printk(KERN_ERR DEV_LABEL "(itf %d): system "
+                              "bus incompatible with driver\n", dev->number);
+                       pci_free_consistent(pdev, 2*MBX_SIZE(i), mbx, mbx_dma);
+                       error = -ENODEV;
+                       goto out;
+               }
+               DPRINTK("mbx@0x%08lx-0x%08lx\n", mbx, mbx + MBX_SIZE(i));
+               zatm_dev->mbx_start[i] = (unsigned long)mbx;
+               zatm_dev->mbx_dma[i] = mbx_dma;
+               zatm_dev->mbx_end[i] = (zatm_dev->mbx_start[i] + MBX_SIZE(i)) &
+                                       0xffff;
+               zout(mbx_dma >> 16, MSH(i));
+               zout(mbx_dma, MSL(i));
+               zout(zatm_dev->mbx_end[i], MBA(i));
+               zout((unsigned long)mbx & 0xffff, MTA(i));
+               zout((unsigned long)mbx & 0xffff, MWA(i));
+       }
        error = start_tx(dev);
-       if (error) goto out;
+       if (error)
+               goto out;
        error = start_rx(dev);
-       if (error) goto out;
+       if (error)
+               goto out_tx;
        error = dev->phy->start(dev);
-       if (error) goto out;
+       if (error)
+               goto out_rx;
        zout(0xffffffff,IMR); /* enable interrupts */
        /* enable TX & RX */
        zout(zin(GMR) | uPD98401_GMR_SE | uPD98401_GMR_RE,GMR);
-       return 0;
-    out:
-       for (i = 0; i < NR_MBX; i++)
-               kfree(zatm_dev->mbx_start[i]);
+done:
+       return error;
+
+out_rx:
        kfree(zatm_dev->rx_map);
+out_tx:
        kfree(zatm_dev->tx_map);
+out:
+       while (i-- > 0) {
+               pci_free_consistent(pdev, 2*MBX_SIZE(i), 
+                                   (void *)zatm_dev->mbx_start[i],
+                                   zatm_dev->mbx_dma[i]);
+       }
        free_irq(zatm_dev->irq, dev);
-       return error;
+       goto done;
 }
 
 
index 34a0480f63d647d76d3ea217c473e2c5419436a2..416fe0fda60cede4b3ad969eda2151b15188a755 100644 (file)
@@ -73,6 +73,7 @@ struct zatm_dev {
        int chans;                      /* map size, must be 2^n */
        /*-------------------------------- mailboxes */
        unsigned long mbx_start[NR_MBX];/* start addresses */
+       dma_addr_t mbx_dma[NR_MBX];
        u16 mbx_end[NR_MBX];            /* end offset (in bytes) */
        /*-------------------------------- other pointers */
        u32 pool_base;                  /* Free buffer pool dsc (word addr) */
index 78e650fc5b411c076ce288b9926c22a1dcd239fb..81d811edf3c58ec478dd73cb239fd2714bb84f32 100644 (file)
@@ -173,7 +173,7 @@ static void hangcheck_fire(unsigned long data)
                }
                if (hangcheck_reboot) {
                        printk(KERN_CRIT "Hangcheck: hangcheck is restarting the machine.\n");
-                       machine_restart(NULL);
+                       emergency_restart();
                } else {
                        printk(KERN_CRIT "Hangcheck: hangcheck value past margin!\n");
                }
index 12d563c648f7377ce640bff741aa782c756c1051..feb25158c8ee99c6a00363da01b4ea69c63fe4eb 100644 (file)
@@ -115,7 +115,7 @@ static void sysrq_handle_reboot(int key, struct pt_regs *pt_regs,
                                struct tty_struct *tty) 
 {
        local_irq_enable();
-       machine_restart(NULL);
+       emergency_restart();
 }
 
 static struct sysrq_key_op sysrq_reboot_op = {
index d10e554a14d650ef27bf31a68641ab8e15cbfb0f..2a29a511df7fb1fd0296a4cdaf58137f9d550727 100644 (file)
@@ -167,7 +167,7 @@ static irqreturn_t eurwdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
        printk(KERN_CRIT "Would Reboot.\n");
 #else
        printk(KERN_CRIT "Initiating system reboot.\n");
-       machine_restart(NULL);
+       emergency_restart();
 #endif
        return IRQ_HANDLED;
 }
index 592dca1088662cad7cabaaaf7ef984caa5877951..6ebce3f2ef9c5fca0ef0b4cfab03b83da818efeb 100644 (file)
@@ -344,7 +344,7 @@ static int pcwd_get_status(int *status)
                        *status |= WDIOF_OVERHEAT;
                        if (temp_panic) {
                                printk (KERN_INFO PFX "Temperature overheat trip!\n");
-                               machine_power_off();
+                               kernel_power_off();
                        }
                }
        } else {
@@ -355,7 +355,7 @@ static int pcwd_get_status(int *status)
                        *status |= WDIOF_OVERHEAT;
                        if (temp_panic) {
                                printk (KERN_INFO PFX "Temperature overheat trip!\n");
-                               machine_power_off();
+                               kernel_power_off();
                        }
                }
        }
index 117903498a015c2a64641706e3edd77e32206691..98c7578740e2fd0e336cf52cfe927de077badb66 100644 (file)
@@ -97,7 +97,7 @@ static void watchdog_fire(unsigned long data)
        else
        {
                printk(KERN_CRIT PFX "Initiating system reboot.\n");
-               machine_restart(NULL);
+               emergency_restart();
                printk(KERN_CRIT PFX "Reboot didn't ?????\n");
        }
 }
index 5684aa37988611d4525824d5e6401ee70426a9f8..1210ca0c425b3b829c2b50ef9bd921d1a5965317 100644 (file)
@@ -266,7 +266,7 @@ static irqreturn_t wdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                printk(KERN_CRIT "Would Reboot.\n");
 #else
                printk(KERN_CRIT "Initiating system reboot.\n");
-               machine_restart(NULL);
+               emergency_restart();
 #endif
 #else
                printk(KERN_CRIT "Reset in 5ms.\n");
index 7651deda928c3cb9e02b8c7b6b43b082b07e4b4e..c80cb77b92fb0bc86261ba597489d6c6991dd145 100644 (file)
@@ -311,7 +311,7 @@ static irqreturn_t wdtpci_interrupt(int irq, void *dev_id, struct pt_regs *regs)
                printk(KERN_CRIT PFX "Would Reboot.\n");
 #else
                printk(KERN_CRIT PFX "Initiating system reboot.\n");
-               machine_restart(NULL);
+               emergency_restart(NULL);
 #endif
 #else
                printk(KERN_CRIT PFX "Reset in 5ms.\n");
index e3c95882353341bb103a3d9164bd12d2e3fb2d58..5d961f5e0ca0011121063d07734dbdbcff495a4d 100644 (file)
@@ -365,6 +365,7 @@ void fcp_register(fc_channel *fc, u8 type, int unregister)
                        kfree (fc->scsi_bitmap);
                        kfree (fc->cmd_slots);
                        FCND(("Unregistering\n"));
+#if 0
                        if (fc->rst_pkt) {
                                if (fc->rst_pkt->eh_state == SCSI_STATE_UNUSED)
                                        kfree(fc->rst_pkt);
@@ -373,6 +374,7 @@ void fcp_register(fc_channel *fc, u8 type, int unregister)
                                        printk("FC: Reset in progress. Now?!");
                                }
                        }
+#endif
                        FCND(("Unregistered\n"));
                }
        } else
@@ -915,6 +917,7 @@ int fcp_scsi_abort(Scsi_Cmnd *SCpnt)
        }
 }
 
+#if 0
 void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)
 {
        fc_channel *fc = FC_SCMND(SCpnt);
@@ -922,11 +925,13 @@ void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)
        fc->rst_pkt->eh_state = SCSI_STATE_FINISHED;
        up(fc->rst_pkt->device->host->eh_action);
 }
+#endif
 
 #define FCP_RESET_TIMEOUT (2*HZ)
 
 int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
 {
+#if 0 /* broken junk, but if davem wants to compile this driver, let him.. */
        unsigned long flags;
        fcp_cmd *cmd;
        fcp_cmnd *fcmd;
@@ -1000,6 +1005,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
        }
        fc->rst_pkt->eh_state = SCSI_STATE_UNUSED;
        return SUCCESS;
+#endif
 }
 
 static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
index 353deb25e3978bb300865be18affdbb455545e4a..13771abea13f28f075bab7e338f787221bcbc9fd 100644 (file)
@@ -83,19 +83,6 @@ static int   mptfcDoneCtx = -1;
 static int     mptfcTaskCtx = -1;
 static int     mptfcInternalCtx = -1; /* Used only for internal commands */
 
-static struct device_attribute mptfc_queue_depth_attr = {
-       .attr = {
-               .name =         "queue_depth",
-               .mode =         S_IWUSR,
-       },
-       .store = mptscsih_store_queue_depth,
-};
-
-static struct device_attribute *mptfc_dev_attrs[] = {
-       &mptfc_queue_depth_attr,
-       NULL,
-};
-
 static struct scsi_host_template mptfc_driver_template = {
        .proc_name                      = "mptfc",
        .proc_info                      = mptscsih_proc_info,
@@ -105,6 +92,7 @@ static struct scsi_host_template mptfc_driver_template = {
        .slave_alloc                    = mptscsih_slave_alloc,
        .slave_configure                = mptscsih_slave_configure,
        .slave_destroy                  = mptscsih_slave_destroy,
+       .change_queue_depth             = mptscsih_change_queue_depth,
        .eh_abort_handler               = mptscsih_abort,
        .eh_device_reset_handler        = mptscsih_dev_reset,
        .eh_bus_reset_handler           = mptscsih_bus_reset,
@@ -116,7 +104,6 @@ static struct scsi_host_template mptfc_driver_template = {
        .max_sectors                    = 8192,
        .cmd_per_lun                    = 7,
        .use_clustering                 = ENABLE_CLUSTERING,
-       .sdev_attrs                     = mptfc_dev_attrs,
 };
 
 /****************************************************************************
@@ -267,10 +254,6 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                sh->sg_tablesize = numSGE;
        }
 
-       /* Set the pci device pointer in Scsi_Host structure.
-        */
-       scsi_set_device(sh, &ioc->pcidev->dev);
-
        spin_unlock_irqrestore(&ioc->FreeQlock, flags);
 
        hd = (MPT_SCSI_HOST *) sh->hostdata;
index 4f973a49be4c125e8634dcd29db4ec5649ecc520..b9d4f78725b456e073ec0bf8e4573ea7e4259edb 100644 (file)
@@ -2234,13 +2234,27 @@ mptscsih_slave_destroy(struct scsi_device *device)
        }
 }
 
-static void
-mptscsih_set_queue_depth(struct scsi_device *device, MPT_SCSI_HOST *hd,
-       VirtDevice *pTarget, int qdepth)
+/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
+/*
+ *     mptscsih_change_queue_depth - This function will set a devices queue depth
+ *     @sdev: per scsi_device pointer
+ *     @qdepth: requested queue depth
+ *
+ *     Adding support for new 'change_queue_depth' api.
+*/
+int
+mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth)
 {
+       MPT_SCSI_HOST   *hd = (MPT_SCSI_HOST *)sdev->host->hostdata;
+       VirtDevice *pTarget;
        int     max_depth;
        int     tagged;
 
+       if (hd == NULL)
+               return 0;
+       if (!(pTarget = hd->Targets[sdev->id]))
+               return 0;
+
        if (hd->ioc->bus_type == SCSI) {
                if (pTarget->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY) {
                        if (!(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES))
@@ -2264,10 +2278,10 @@ mptscsih_set_queue_depth(struct scsi_device *device, MPT_SCSI_HOST *hd,
        else
                tagged = MSG_SIMPLE_TAG;
 
-       scsi_adjust_queue_depth(device, tagged, qdepth);
+       scsi_adjust_queue_depth(sdev, tagged, qdepth);
+       return sdev->queue_depth;
 }
 
-
 /*
  *     OS entry point to adjust the queue_depths on a per-device basis.
  *     Called once per device the bus scan. Use it to force the queue_depth
@@ -2317,7 +2331,7 @@ mptscsih_slave_configure(struct scsi_device *device)
 
        mptscsih_initTarget(hd, device->channel, device->id, device->lun,
                device->inquiry, device->inquiry_len );
-       mptscsih_set_queue_depth(device, hd, pTarget, MPT_SCSI_CMD_PER_DEV_HIGH);
+       mptscsih_change_queue_depth(device, MPT_SCSI_CMD_PER_DEV_HIGH);
 
        dsprintk((MYIOC_s_INFO_FMT
                "Queue depth=%d, tflags=%x\n",
@@ -2337,25 +2351,6 @@ slave_configure_exit:
        return 0;
 }
 
-ssize_t
-mptscsih_store_queue_depth(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
-{
-       int                      depth;
-       struct scsi_device      *sdev = to_scsi_device(dev);
-       MPT_SCSI_HOST           *hd = (MPT_SCSI_HOST *) sdev->host->hostdata;
-       VirtDevice              *pTarget;
-
-       depth = simple_strtoul(buf, NULL, 0);
-       if (depth == 0)
-               return -EINVAL;
-       pTarget = hd->Targets[sdev->id];
-       if (pTarget == NULL)
-               return -EINVAL;
-       mptscsih_set_queue_depth(sdev, (MPT_SCSI_HOST *) sdev->host->hostdata,
-               pTarget, depth);
-       return count;
-}
-
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /*
  *  Private routines...
@@ -5586,7 +5581,7 @@ EXPORT_SYMBOL(mptscsih_taskmgmt_complete);
 EXPORT_SYMBOL(mptscsih_scandv_complete);
 EXPORT_SYMBOL(mptscsih_event_process);
 EXPORT_SYMBOL(mptscsih_ioc_reset);
-EXPORT_SYMBOL(mptscsih_store_queue_depth);
+EXPORT_SYMBOL(mptscsih_change_queue_depth);
 EXPORT_SYMBOL(mptscsih_timer_expired);
 
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
index debb8ac5954571a683e26e7e77023b8ec382665d..51c0255ac16ec23b9f5634c7f0fec1e3862caebd 100644 (file)
@@ -103,5 +103,5 @@ extern int mptscsih_taskmgmt_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_F
 extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r);
 extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply);
 extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset);
-extern ssize_t mptscsih_store_queue_depth(struct device *dev, struct device_attribute *attr, const char *buf, size_t count);
+extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth);
 extern void mptscsih_timer_expired(unsigned long data);
index e0c0ee5bc9662386e73c79af9ceded98d9623a72..dfa8806b1e13d618875242352ab8ee32de0781b3 100644 (file)
@@ -102,19 +102,6 @@ static int mptspiDoneCtx = -1;
 static int     mptspiTaskCtx = -1;
 static int     mptspiInternalCtx = -1; /* Used only for internal commands */
 
-static struct device_attribute mptspi_queue_depth_attr = {
-       .attr = {
-               .name =         "queue_depth",
-               .mode =         S_IWUSR,
-       },
-       .store = mptscsih_store_queue_depth,
-};
-
-static struct device_attribute *mptspi_dev_attrs[] = {
-       &mptspi_queue_depth_attr,
-       NULL,
-};
-
 static struct scsi_host_template mptspi_driver_template = {
        .proc_name                      = "mptspi",
        .proc_info                      = mptscsih_proc_info,
@@ -124,6 +111,7 @@ static struct scsi_host_template mptspi_driver_template = {
        .slave_alloc                    = mptscsih_slave_alloc,
        .slave_configure                = mptscsih_slave_configure,
        .slave_destroy                  = mptscsih_slave_destroy,
+       .change_queue_depth             = mptscsih_change_queue_depth,
        .eh_abort_handler               = mptscsih_abort,
        .eh_device_reset_handler        = mptscsih_dev_reset,
        .eh_bus_reset_handler           = mptscsih_bus_reset,
@@ -135,7 +123,6 @@ static struct scsi_host_template mptspi_driver_template = {
        .max_sectors                    = 8192,
        .cmd_per_lun                    = 7,
        .use_clustering                 = ENABLE_CLUSTERING,
-       .sdev_attrs                     = mptspi_dev_attrs,
 };
 
 
@@ -287,10 +274,6 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id)
                sh->sg_tablesize = numSGE;
        }
 
-       /* Set the pci device pointer in Scsi_Host structure.
-        */
-       scsi_set_device(sh, &ioc->pcidev->dev);
-
        spin_unlock_irqrestore(&ioc->FreeQlock, flags);
 
        hd = (MPT_SCSI_HOST *) sh->hostdata;
index 9a07ff7a7777dc6edabca5079a7d120591ab6a13..534b598866b37258af82d83f053c9fe8c494adfa 100644 (file)
@@ -2544,9 +2544,25 @@ config SHAPER
 
 config NETCONSOLE
        tristate "Network console logging support (EXPERIMENTAL)"
-       depends on NETDEVICES && EXPERIMENTAL
+       depends on NETDEVICES && INET && EXPERIMENTAL
        ---help---
        If you want to log kernel messages over the network, enable this.
        See <file:Documentation/networking/netconsole.txt> for details.
 
+config NETPOLL
+       def_bool NETCONSOLE
+
+config NETPOLL_RX
+       bool "Netpoll support for trapping incoming packets"
+       default n
+       depends on NETPOLL
+
+config NETPOLL_TRAP
+       bool "Netpoll traffic trapping"
+       default n
+       depends on NETPOLL
+
+config NET_POLL_CONTROLLER
+       def_bool NETPOLL
+
 endmenu
index dd686582037255154654da59790134e532d81a91..aa1569182fd62e86ae01a8f5cf7049d504cc6480 100644 (file)
@@ -132,7 +132,7 @@ static struct net_device_stats *eql_get_stats(struct net_device *dev);
 #define eql_is_slave(dev)      ((dev->flags & IFF_SLAVE) == IFF_SLAVE)
 #define eql_is_master(dev)     ((dev->flags & IFF_MASTER) == IFF_MASTER)
 
-static void eql_kill_one_slave(slave_t *slave);
+static void eql_kill_one_slave(slave_queue_t *queue, slave_t *slave);
 
 static void eql_timer(unsigned long param)
 {
@@ -149,7 +149,7 @@ static void eql_timer(unsigned long param)
                        if (slave->bytes_queued < 0)
                                slave->bytes_queued = 0;
                } else {
-                       eql_kill_one_slave(slave);
+                       eql_kill_one_slave(&eql->queue, slave);
                }
 
        }
@@ -214,9 +214,10 @@ static int eql_open(struct net_device *dev)
        return 0;
 }
 
-static void eql_kill_one_slave(slave_t *slave)
+static void eql_kill_one_slave(slave_queue_t *queue, slave_t *slave)
 {
        list_del(&slave->list);
+       queue->num_slaves--;
        slave->dev->flags &= ~IFF_SLAVE;
        dev_put(slave->dev);
        kfree(slave);
@@ -232,8 +233,7 @@ static void eql_kill_slave_queue(slave_queue_t *queue)
        list_for_each_safe(this, tmp, head) {
                slave_t *s = list_entry(this, slave_t, list);
 
-               eql_kill_one_slave(s);
-               queue->num_slaves--;
+               eql_kill_one_slave(queue, s);
        }
 
        spin_unlock_bh(&queue->lock);
@@ -318,7 +318,7 @@ static slave_t *__eql_schedule_slaves(slave_queue_t *queue)
                        }
                } else {
                        /* We found a dead slave, kill it. */
-                       eql_kill_one_slave(slave);
+                       eql_kill_one_slave(queue, slave);
                }
        }
        return best_slave;
@@ -393,7 +393,7 @@ static int __eql_insert_slave(slave_queue_t *queue, slave_t *slave)
 
                duplicate_slave = __eql_find_slave_dev(queue, slave->dev);
                if (duplicate_slave != 0)
-                       eql_kill_one_slave(duplicate_slave);
+                       eql_kill_one_slave(queue, duplicate_slave);
 
                list_add(&slave->list, &queue->all_slaves);
                queue->num_slaves++;
@@ -471,7 +471,7 @@ static int eql_emancipate(struct net_device *master_dev, slaving_request_t __use
                                                              slave_dev);
 
                        if (slave) {
-                               eql_kill_one_slave(slave);
+                               eql_kill_one_slave(&eql->queue, slave);
                                ret = 0;
                        }
                }
index fbc2f58ff6887a869299492345e4afc5afeb6261..0d8bb4cccbb76e876a2903ad0fa3d2330905041d 100644 (file)
@@ -41,6 +41,7 @@
 #include <linux/ioport.h>
 #include <linux/ethtool.h>
 #include <linux/mii.h>
+#include <linux/jiffies.h>
 
 #include <pcmcia/cs_types.h>
 #include <pcmcia/cs.h>
@@ -2092,7 +2093,7 @@ static void media_check(u_long arg)
     }
 
     /* Ignore collisions unless we've had no rx's recently */
-    if (jiffies - dev->last_rx > HZ) {
+    if (time_after(jiffies, dev->last_rx + HZ)) {
        if (smc->tx_err || (smc->media_status & EPH_16COL))
            media |= EPH_16COL;
     }
index 54640686e9830259619e5e524316c6103fbfc092..201a550f0bcc3193a5b4481a67c580ae73145b17 100644 (file)
@@ -66,8 +66,8 @@
 
 #define DRV_MODULE_NAME                "tg3"
 #define PFX DRV_MODULE_NAME    ": "
-#define DRV_MODULE_VERSION     "3.33"
-#define DRV_MODULE_RELDATE     "July 5, 2005"
+#define DRV_MODULE_VERSION     "3.34"
+#define DRV_MODULE_RELDATE     "July 25, 2005"
 
 #define TG3_DEF_MAC_MODE       0
 #define TG3_DEF_RX_MODE                0
@@ -90,7 +90,7 @@
 /* hardware minimum and maximum for a single frame's data payload */
 #define TG3_MIN_MTU                    60
 #define TG3_MAX_MTU(tp)        \
-       (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ? 9000 : 1500)
+       ((tp->tg3_flags2 & TG3_FLG2_JUMBO_CAPABLE) ? 9000 : 1500)
 
 /* These numbers seem to be hard coded in the NIC firmware somehow.
  * You can't change the ring sizes, but you can change where you place
@@ -221,6 +221,10 @@ static struct pci_device_id tg3_pci_tbl[] = {
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
        { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5753F,
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+       { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5780,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
+       { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5780S,
+         PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
        { PCI_VENDOR_ID_BROADCOM, PCI_DEVICE_ID_TIGON3_5781,
          PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
        { PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX,
@@ -508,6 +512,9 @@ static void tg3_switch_clocks(struct tg3 *tp)
        u32 clock_ctrl = tr32(TG3PCI_CLOCK_CTRL);
        u32 orig_clock_ctrl;
 
+       if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780)
+               return;
+
        orig_clock_ctrl = clock_ctrl;
        clock_ctrl &= (CLOCK_CTRL_FORCE_CLKRUN |
                       CLOCK_CTRL_CLKRUN_OENABLE |
@@ -907,7 +914,7 @@ out:
        if ((tp->phy_id & PHY_ID_MASK) == PHY_ID_BCM5401) {
                /* Cannot do read-modify-write on 5401 */
                tg3_writephy(tp, MII_TG3_AUX_CTRL, 0x4c20);
-       } else if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
+       } else if (tp->tg3_flags2 & TG3_FLG2_JUMBO_CAPABLE) {
                u32 phy_reg;
 
                /* Set bit 14 with read-modify-write to preserve other bits */
@@ -919,7 +926,7 @@ out:
        /* Set phy register 0x10 bit 0 to high fifo elasticity to support
         * jumbo frames transmission.
         */
-       if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
+       if (tp->tg3_flags2 & TG3_FLG2_JUMBO_CAPABLE) {
                u32 phy_reg;
 
                if (!tg3_readphy(tp, MII_TG3_EXT_CTRL, &phy_reg))
@@ -1093,7 +1100,7 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
                tp->link_config.orig_autoneg = tp->link_config.autoneg;
        }
 
-       if (!(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)) {
+       if (!(tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)) {
                tp->link_config.speed = SPEED_10;
                tp->link_config.duplex = DUPLEX_HALF;
                tp->link_config.autoneg = AUTONEG_ENABLE;
@@ -1145,6 +1152,8 @@ static int tg3_set_power_state(struct tg3 *tp, int state)
                     CLOCK_CTRL_ALTCLK |
                     CLOCK_CTRL_PWRDOWN_PLL133);
                udelay(40);
+       } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780) {
+               /* do nothing */
        } else if (!((tp->tg3_flags2 & TG3_FLG2_5750_PLUS) &&
                     (tp->tg3_flags & TG3_FLAG_ENABLE_ASF))) {
                u32 newbits1, newbits2;
@@ -1238,6 +1247,25 @@ static void tg3_setup_flow_control(struct tg3 *tp, u32 local_adv, u32 remote_adv
        u32 old_tx_mode = tp->tx_mode;
 
        if (tp->tg3_flags & TG3_FLAG_PAUSE_AUTONEG) {
+
+               /* Convert 1000BaseX flow control bits to 1000BaseT
+                * bits before resolving flow control.
+                */
+               if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES) {
+                       local_adv &= ~(ADVERTISE_PAUSE_CAP |
+                                      ADVERTISE_PAUSE_ASYM);
+                       remote_adv &= ~(LPA_PAUSE_CAP | LPA_PAUSE_ASYM);
+
+                       if (local_adv & ADVERTISE_1000XPAUSE)
+                               local_adv |= ADVERTISE_PAUSE_CAP;
+                       if (local_adv & ADVERTISE_1000XPSE_ASYM)
+                               local_adv |= ADVERTISE_PAUSE_ASYM;
+                       if (remote_adv & LPA_1000XPAUSE)
+                               remote_adv |= LPA_PAUSE_CAP;
+                       if (remote_adv & LPA_1000XPAUSE_ASYM)
+                               remote_adv |= LPA_PAUSE_ASYM;
+               }
+
                if (local_adv & ADVERTISE_PAUSE_CAP) {
                        if (local_adv & ADVERTISE_PAUSE_ASYM) {
                                if (remote_adv & LPA_PAUSE_CAP)
@@ -2498,12 +2526,226 @@ static int tg3_setup_fiber_phy(struct tg3 *tp, int force_reset)
        return 0;
 }
 
+static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
+{
+       int current_link_up, err = 0;
+       u32 bmsr, bmcr;
+       u16 current_speed;
+       u8 current_duplex;
+
+       tp->mac_mode |= MAC_MODE_PORT_MODE_GMII;
+       tw32_f(MAC_MODE, tp->mac_mode);
+       udelay(40);
+
+       tw32(MAC_EVENT, 0);
+
+       tw32_f(MAC_STATUS,
+            (MAC_STATUS_SYNC_CHANGED |
+             MAC_STATUS_CFG_CHANGED |
+             MAC_STATUS_MI_COMPLETION |
+             MAC_STATUS_LNKSTATE_CHANGED));
+       udelay(40);
+
+       if (force_reset)
+               tg3_phy_reset(tp);
+
+       current_link_up = 0;
+       current_speed = SPEED_INVALID;
+       current_duplex = DUPLEX_INVALID;
+
+       err |= tg3_readphy(tp, MII_BMSR, &bmsr);
+       err |= tg3_readphy(tp, MII_BMSR, &bmsr);
+
+       err |= tg3_readphy(tp, MII_BMCR, &bmcr);
+
+       if ((tp->link_config.autoneg == AUTONEG_ENABLE) && !force_reset &&
+           (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT)) {
+               /* do nothing, just check for link up at the end */
+       } else if (tp->link_config.autoneg == AUTONEG_ENABLE) {
+               u32 adv, new_adv;
+
+               err |= tg3_readphy(tp, MII_ADVERTISE, &adv);
+               new_adv = adv & ~(ADVERTISE_1000XFULL | ADVERTISE_1000XHALF |
+                                 ADVERTISE_1000XPAUSE |
+                                 ADVERTISE_1000XPSE_ASYM |
+                                 ADVERTISE_SLCT);
+
+               /* Always advertise symmetric PAUSE just like copper */
+               new_adv |= ADVERTISE_1000XPAUSE;
+
+               if (tp->link_config.advertising & ADVERTISED_1000baseT_Half)
+                       new_adv |= ADVERTISE_1000XHALF;
+               if (tp->link_config.advertising & ADVERTISED_1000baseT_Full)
+                       new_adv |= ADVERTISE_1000XFULL;
+
+               if ((new_adv != adv) || !(bmcr & BMCR_ANENABLE)) {
+                       tg3_writephy(tp, MII_ADVERTISE, new_adv);
+                       bmcr |= BMCR_ANENABLE | BMCR_ANRESTART;
+                       tg3_writephy(tp, MII_BMCR, bmcr);
+
+                       tw32_f(MAC_EVENT, MAC_EVENT_LNKSTATE_CHANGED);
+                       tp->tg3_flags2 |= TG3_FLG2_PHY_JUST_INITTED;
+                       tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT;
+
+                       return err;
+               }
+       } else {
+               u32 new_bmcr;
+
+               bmcr &= ~BMCR_SPEED1000;
+               new_bmcr = bmcr & ~(BMCR_ANENABLE | BMCR_FULLDPLX);
+
+               if (tp->link_config.duplex == DUPLEX_FULL)
+                       new_bmcr |= BMCR_FULLDPLX;
+
+               if (new_bmcr != bmcr) {
+                       /* BMCR_SPEED1000 is a reserved bit that needs
+                        * to be set on write.
+                        */
+                       new_bmcr |= BMCR_SPEED1000;
+
+                       /* Force a linkdown */
+                       if (netif_carrier_ok(tp->dev)) {
+                               u32 adv;
+
+                               err |= tg3_readphy(tp, MII_ADVERTISE, &adv);
+                               adv &= ~(ADVERTISE_1000XFULL |
+                                        ADVERTISE_1000XHALF |
+                                        ADVERTISE_SLCT);
+                               tg3_writephy(tp, MII_ADVERTISE, adv);
+                               tg3_writephy(tp, MII_BMCR, bmcr |
+                                                          BMCR_ANRESTART |
+                                                          BMCR_ANENABLE);
+                               udelay(10);
+                               netif_carrier_off(tp->dev);
+                       }
+                       tg3_writephy(tp, MII_BMCR, new_bmcr);
+                       bmcr = new_bmcr;
+                       err |= tg3_readphy(tp, MII_BMSR, &bmsr);
+                       err |= tg3_readphy(tp, MII_BMSR, &bmsr);
+                       tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT;
+               }
+       }
+
+       if (bmsr & BMSR_LSTATUS) {
+               current_speed = SPEED_1000;
+               current_link_up = 1;
+               if (bmcr & BMCR_FULLDPLX)
+                       current_duplex = DUPLEX_FULL;
+               else
+                       current_duplex = DUPLEX_HALF;
+
+               if (bmcr & BMCR_ANENABLE) {
+                       u32 local_adv, remote_adv, common;
+
+                       err |= tg3_readphy(tp, MII_ADVERTISE, &local_adv);
+                       err |= tg3_readphy(tp, MII_LPA, &remote_adv);
+                       common = local_adv & remote_adv;
+                       if (common & (ADVERTISE_1000XHALF |
+                                     ADVERTISE_1000XFULL)) {
+                               if (common & ADVERTISE_1000XFULL)
+                                       current_duplex = DUPLEX_FULL;
+                               else
+                                       current_duplex = DUPLEX_HALF;
+
+                               tg3_setup_flow_control(tp, local_adv,
+                                                      remote_adv);
+                       }
+                       else
+                               current_link_up = 0;
+               }
+       }
+
+       tp->mac_mode &= ~MAC_MODE_HALF_DUPLEX;
+       if (tp->link_config.active_duplex == DUPLEX_HALF)
+               tp->mac_mode |= MAC_MODE_HALF_DUPLEX;
+
+       tw32_f(MAC_MODE, tp->mac_mode);
+       udelay(40);
+
+       tw32_f(MAC_EVENT, MAC_EVENT_LNKSTATE_CHANGED);
+
+       tp->link_config.active_speed = current_speed;
+       tp->link_config.active_duplex = current_duplex;
+
+       if (current_link_up != netif_carrier_ok(tp->dev)) {
+               if (current_link_up)
+                       netif_carrier_on(tp->dev);
+               else {
+                       netif_carrier_off(tp->dev);
+                       tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT;
+               }
+               tg3_link_report(tp);
+       }
+       return err;
+}
+
+static void tg3_serdes_parallel_detect(struct tg3 *tp)
+{
+       if (tp->tg3_flags2 & TG3_FLG2_PHY_JUST_INITTED) {
+               /* Give autoneg time to complete. */
+               tp->tg3_flags2 &= ~TG3_FLG2_PHY_JUST_INITTED;
+               return;
+       }
+       if (!netif_carrier_ok(tp->dev) &&
+           (tp->link_config.autoneg == AUTONEG_ENABLE)) {
+               u32 bmcr;
+
+               tg3_readphy(tp, MII_BMCR, &bmcr);
+               if (bmcr & BMCR_ANENABLE) {
+                       u32 phy1, phy2;
+
+                       /* Select shadow register 0x1f */
+                       tg3_writephy(tp, 0x1c, 0x7c00);
+                       tg3_readphy(tp, 0x1c, &phy1);
+
+                       /* Select expansion interrupt status register */
+                       tg3_writephy(tp, 0x17, 0x0f01);
+                       tg3_readphy(tp, 0x15, &phy2);
+                       tg3_readphy(tp, 0x15, &phy2);
+
+                       if ((phy1 & 0x10) && !(phy2 & 0x20)) {
+                               /* We have signal detect and not receiving
+                                * config code words, link is up by parallel
+                                * detection.
+                                */
+
+                               bmcr &= ~BMCR_ANENABLE;
+                               bmcr |= BMCR_SPEED1000 | BMCR_FULLDPLX;
+                               tg3_writephy(tp, MII_BMCR, bmcr);
+                               tp->tg3_flags2 |= TG3_FLG2_PARALLEL_DETECT;
+                       }
+               }
+       }
+       else if (netif_carrier_ok(tp->dev) &&
+                (tp->link_config.autoneg == AUTONEG_ENABLE) &&
+                (tp->tg3_flags2 & TG3_FLG2_PARALLEL_DETECT)) {
+               u32 phy2;
+
+               /* Select expansion interrupt status register */
+               tg3_writephy(tp, 0x17, 0x0f01);
+               tg3_readphy(tp, 0x15, &phy2);
+               if (phy2 & 0x20) {
+                       u32 bmcr;
+
+                       /* Config code words received, turn on autoneg. */
+                       tg3_readphy(tp, MII_BMCR, &bmcr);
+                       tg3_writephy(tp, MII_BMCR, bmcr | BMCR_ANENABLE);
+
+                       tp->tg3_flags2 &= ~TG3_FLG2_PARALLEL_DETECT;
+
+               }
+       }
+}
+
 static int tg3_setup_phy(struct tg3 *tp, int force_reset)
 {
        int err;
 
        if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) {
                err = tg3_setup_fiber_phy(tp, force_reset);
+       } else if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES) {
+               err = tg3_setup_fiber_mii_phy(tp, force_reset);
        } else {
                err = tg3_setup_copper_phy(tp, force_reset);
        }
@@ -2612,7 +2854,7 @@ static int tg3_alloc_rx_skb(struct tg3 *tp, u32 opaque_key,
                map = &tp->rx_std_buffers[dest_idx];
                if (src_idx >= 0)
                        src_map = &tp->rx_std_buffers[src_idx];
-               skb_size = RX_PKT_BUF_SZ;
+               skb_size = tp->rx_pkt_buf_sz;
                break;
 
        case RXD_OPAQUE_RING_JUMBO:
@@ -3434,10 +3676,18 @@ static inline void tg3_set_mtu(struct net_device *dev, struct tg3 *tp,
 {
        dev->mtu = new_mtu;
 
-       if (new_mtu > ETH_DATA_LEN)
-               tp->tg3_flags |= TG3_FLAG_JUMBO_ENABLE;
-       else
-               tp->tg3_flags &= ~TG3_FLAG_JUMBO_ENABLE;
+       if (new_mtu > ETH_DATA_LEN) {
+               if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780) {
+                       tp->tg3_flags2 &= ~TG3_FLG2_TSO_CAPABLE;
+                       ethtool_op_set_tso(dev, 0);
+               }
+               else
+                       tp->tg3_flags |= TG3_FLAG_JUMBO_RING_ENABLE;
+       } else {
+               if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780)
+                       tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE;
+               tp->tg3_flags &= ~TG3_FLAG_JUMBO_RING_ENABLE;
+       }
 }
 
 static int tg3_change_mtu(struct net_device *dev, int new_mtu)
@@ -3491,7 +3741,7 @@ static void tg3_free_rings(struct tg3 *tp)
                        continue;
                pci_unmap_single(tp->pdev,
                                 pci_unmap_addr(rxp, mapping),
-                                RX_PKT_BUF_SZ - tp->rx_offset,
+                                tp->rx_pkt_buf_sz - tp->rx_offset,
                                 PCI_DMA_FROMDEVICE);
                dev_kfree_skb_any(rxp->skb);
                rxp->skb = NULL;
@@ -3564,6 +3814,11 @@ static void tg3_init_rings(struct tg3 *tp)
        memset(tp->rx_rcb, 0, TG3_RX_RCB_RING_BYTES(tp));
        memset(tp->tx_ring, 0, TG3_TX_RING_BYTES);
 
+       tp->rx_pkt_buf_sz = RX_PKT_BUF_SZ;
+       if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780) &&
+           (tp->dev->mtu > ETH_DATA_LEN))
+               tp->rx_pkt_buf_sz = RX_JUMBO_PKT_BUF_SZ;
+
        /* Initialize invariants of the rings, we only set this
         * stuff once.  This works because the card does not
         * write into the rx buffer posting rings.
@@ -3572,14 +3827,14 @@ static void tg3_init_rings(struct tg3 *tp)
                struct tg3_rx_buffer_desc *rxd;
 
                rxd = &tp->rx_std[i];
-               rxd->idx_len = (RX_PKT_BUF_SZ - tp->rx_offset - 64)
+               rxd->idx_len = (tp->rx_pkt_buf_sz - tp->rx_offset - 64)
                        << RXD_LEN_SHIFT;
                rxd->type_flags = (RXD_FLAG_END << RXD_FLAGS_SHIFT);
                rxd->opaque = (RXD_OPAQUE_RING_STD |
                               (i << RXD_OPAQUE_INDEX_SHIFT));
        }
 
-       if (tp->tg3_flags & TG3_FLAG_JUMBO_ENABLE) {
+       if (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) {
                for (i = 0; i < TG3_RX_JUMBO_RING_SIZE; i++) {
                        struct tg3_rx_buffer_desc *rxd;
 
@@ -3600,7 +3855,7 @@ static void tg3_init_rings(struct tg3 *tp)
                        break;
        }
 
-       if (tp->tg3_flags & TG3_FLAG_JUMBO_ENABLE) {
+       if (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) {
                for (i = 0; i < tp->rx_jumbo_pending; i++) {
                        if (tg3_alloc_rx_skb(tp, RXD_OPAQUE_RING_JUMBO,
                                             -1, i) < 0)
@@ -4056,7 +4311,30 @@ static int tg3_chip_reset(struct tg3 *tp)
        val &= ~PCIX_CAPS_RELAXED_ORDERING;
        pci_write_config_dword(tp->pdev, TG3PCI_X_CAPS, val);
 
-       tw32(MEMARB_MODE, MEMARB_MODE_ENABLE);
+       if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780) {
+               u32 val;
+
+               /* Chip reset on 5780 will reset MSI enable bit,
+                * so need to restore it.
+                */
+               if (tp->tg3_flags2 & TG3_FLG2_USING_MSI) {
+                       u16 ctrl;
+
+                       pci_read_config_word(tp->pdev,
+                                            tp->msi_cap + PCI_MSI_FLAGS,
+                                            &ctrl);
+                       pci_write_config_word(tp->pdev,
+                                             tp->msi_cap + PCI_MSI_FLAGS,
+                                             ctrl | PCI_MSI_FLAGS_ENABLE);
+                       val = tr32(MSGINT_MODE);
+                       tw32(MSGINT_MODE, val | MSGINT_MODE_ENABLE);
+               }
+
+               val = tr32(MEMARB_MODE);
+               tw32(MEMARB_MODE, val | MEMARB_MODE_ENABLE);
+
+       } else
+               tw32(MEMARB_MODE, MEMARB_MODE_ENABLE);
 
        if (tp->pci_chip_rev_id == CHIPREV_ID_5750_A3) {
                tg3_stop_fw(tp);
@@ -4082,6 +4360,9 @@ static int tg3_chip_reset(struct tg3 *tp)
        if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) {
                tp->mac_mode = MAC_MODE_PORT_MODE_TBI;
                tw32_f(MAC_MODE, tp->mac_mode);
+       } else if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES) {
+               tp->mac_mode = MAC_MODE_PORT_MODE_GMII;
+               tw32_f(MAC_MODE, tp->mac_mode);
        } else
                tw32_f(MAC_MODE, 0);
        udelay(40);
@@ -5245,7 +5526,7 @@ static int tg3_reset_hw(struct tg3 *tp)
        }
 #endif
 
-       if (!(tp->tg3_flags & TG3_FLAG_JUMBO_ENABLE)) {
+       if (tp->dev->mtu <= ETH_DATA_LEN) {
                tw32(BUFMGR_MB_RDMA_LOW_WATER,
                     tp->bufmgr_config.mbuf_read_dma_low_water);
                tw32(BUFMGR_MB_MACRX_LOW_WATER,
@@ -5320,7 +5601,7 @@ static int tg3_reset_hw(struct tg3 *tp)
                /* Setup replenish threshold. */
                tw32(RCVBDI_JUMBO_THRESH, tp->rx_jumbo_pending / 8);
 
-               if (tp->tg3_flags & TG3_FLAG_JUMBO_ENABLE) {
+               if (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) {
                        tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_HIGH,
                             ((u64) tp->rx_jumbo_mapping >> 32));
                        tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW,
@@ -5381,7 +5662,7 @@ static int tg3_reset_hw(struct tg3 *tp)
        tw32_rx_mbox(MAILBOX_RCV_STD_PROD_IDX + TG3_64BIT_REG_LOW,
                     tp->rx_std_ptr);
 
-       tp->rx_jumbo_ptr = (tp->tg3_flags & TG3_FLAG_JUMBO_ENABLE) ?
+       tp->rx_jumbo_ptr = (tp->tg3_flags & TG3_FLAG_JUMBO_RING_ENABLE) ?
                                                tp->rx_jumbo_pending : 0;
        tw32_rx_mbox(MAILBOX_RCV_JUMBO_PROD_IDX + TG3_64BIT_REG_LOW,
                     tp->rx_jumbo_ptr);
@@ -5683,7 +5964,8 @@ static int tg3_reset_hw(struct tg3 *tp)
        tw32(MAC_RCV_RULE_1,  0x86000004 & RCV_RULE_DISABLE_MASK);
        tw32(MAC_RCV_VALUE_1, 0xffffffff & RCV_RULE_DISABLE_MASK);
 
-       if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS)
+       if ((tp->tg3_flags2 & TG3_FLG2_5705_PLUS) &&
+           (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5780))
                limit = 8;
        else
                limit = 16;
@@ -5865,7 +6147,8 @@ static void tg3_timer(unsigned long __opaque)
                                udelay(40);
                                tg3_setup_phy(tp, 0);
                        }
-               }
+               } else if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)
+                       tg3_serdes_parallel_detect(tp);
 
                tp->timer_counter = tp->timer_multiplier;
        }
@@ -8569,8 +8852,12 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
                        eeprom_phy_id = 0;
 
                tp->phy_id = eeprom_phy_id;
-               if (eeprom_phy_serdes)
-                       tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES;
+               if (eeprom_phy_serdes) {
+                       if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780)
+                               tp->tg3_flags2 |= TG3_FLG2_MII_SERDES;
+                       else
+                               tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES;
+               }
 
                if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS)
                        led_cfg = cfg2 & (NIC_SRAM_DATA_CFG_LED_MODE_MASK |
@@ -8705,7 +8992,7 @@ static int __devinit tg3_phy_probe(struct tg3 *tp)
                }
        }
 
-       if (!(tp->tg3_flags2 & TG3_FLG2_PHY_SERDES) &&
+       if (!(tp->tg3_flags2 & TG3_FLG2_ANY_SERDES) &&
            !(tp->tg3_flags & TG3_FLAG_ENABLE_ASF)) {
                u32 bmsr, adv_reg, tg3_ctrl;
 
@@ -8758,7 +9045,7 @@ skip_phy_reset:
                err = tg3_init_5401phy_dsp(tp);
        }
 
-       if (tp->tg3_flags2 & TG3_FLG2_PHY_SERDES)
+       if (tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)
                tp->link_config.advertising =
                        (ADVERTISED_1000baseT_Half |
                         ADVERTISED_1000baseT_Full |
@@ -8928,6 +9215,10 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
        if (tp->pci_chip_rev_id == CHIPREV_ID_5752_A0_HW)
                tp->pci_chip_rev_id = CHIPREV_ID_5752_A0;
 
+       /* Find msi capability. */
+       if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780)
+               tp->msi_cap = pci_find_capability(tp->pdev, PCI_CAP_ID_MSI);
+
        /* Initialize misc host control in PCI block. */
        tp->misc_host_ctrl |= (misc_ctrl_reg &
                               MISC_HOST_CTRL_CHIPREV);
@@ -8943,7 +9234,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
        tp->pci_bist         = (cacheline_sz_reg >> 24) & 0xff;
 
        if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5750 ||
-           GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752)
+           GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5752 ||
+           GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780)
                tp->tg3_flags2 |= TG3_FLG2_5750_PLUS;
 
        if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) ||
@@ -8953,6 +9245,11 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
        if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS)
                tp->tg3_flags2 |= TG3_FLG2_HW_TSO;
 
+       if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5705 &&
+           GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5750 &&
+           GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5752)
+               tp->tg3_flags2 |= TG3_FLG2_JUMBO_CAPABLE;
+
        if (pci_find_capability(tp->pdev, PCI_CAP_ID_EXP) != 0)
                tp->tg3_flags2 |= TG3_FLG2_PCI_EXPRESS;
 
@@ -9079,8 +9376,9 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
        /* Derive initial jumbo mode from MTU assigned in
         * ether_setup() via the alloc_etherdev() call
         */
-       if (tp->dev->mtu > ETH_DATA_LEN)
-               tp->tg3_flags |= TG3_FLAG_JUMBO_ENABLE;
+       if (tp->dev->mtu > ETH_DATA_LEN &&
+           GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5780)
+               tp->tg3_flags |= TG3_FLAG_JUMBO_RING_ENABLE;
 
        /* Determine WakeOnLan speed to use. */
        if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700 ||
@@ -9096,7 +9394,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
        if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5700) ||
            ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5705) &&
             (tp->pci_chip_rev_id != CHIPREV_ID_5705_A0) &&
-            (tp->pci_chip_rev_id != CHIPREV_ID_5705_A1)))
+            (tp->pci_chip_rev_id != CHIPREV_ID_5705_A1)) ||
+           (tp->tg3_flags2 & TG3_FLG2_ANY_SERDES))
                tp->tg3_flags2 |= TG3_FLG2_NO_ETH_WIRE_SPEED;
 
        if (GET_CHIP_REV(tp->pci_chip_rev_id) == CHIPREV_5703_AX ||
@@ -9305,8 +9604,9 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
 #endif
 
        mac_offset = 0x7c;
-       if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 &&
-           !(tp->tg3_flags & TG3_FLG2_SUN_570X)) {
+       if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5704 &&
+            !(tp->tg3_flags & TG3_FLG2_SUN_570X)) ||
+           GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780) {
                if (tr32(TG3PCI_DUAL_MAC_CTRL) & DUAL_MAC_CTRL_ID)
                        mac_offset = 0xcc;
                if (tg3_nvram_lock(tp))
@@ -9620,6 +9920,9 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
 
                        /* Set bit 23 to enable PCIX hw bug fix */
                        tp->dma_rwctrl |= 0x009f0000;
+               } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5780) {
+                       /* 5780 always in PCIX mode */
+                       tp->dma_rwctrl |= 0x00144000;
                } else {
                        tp->dma_rwctrl |= 0x001b000f;
                }
@@ -9773,19 +10076,35 @@ static void __devinit tg3_init_link_config(struct tg3 *tp)
 
 static void __devinit tg3_init_bufmgr_config(struct tg3 *tp)
 {
-       tp->bufmgr_config.mbuf_read_dma_low_water =
-               DEFAULT_MB_RDMA_LOW_WATER;
-       tp->bufmgr_config.mbuf_mac_rx_low_water =
-               DEFAULT_MB_MACRX_LOW_WATER;
-       tp->bufmgr_config.mbuf_high_water =
-               DEFAULT_MB_HIGH_WATER;
+       if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) {
+               tp->bufmgr_config.mbuf_read_dma_low_water =
+                       DEFAULT_MB_RDMA_LOW_WATER_5705;
+               tp->bufmgr_config.mbuf_mac_rx_low_water =
+                       DEFAULT_MB_MACRX_LOW_WATER_5705;
+               tp->bufmgr_config.mbuf_high_water =
+                       DEFAULT_MB_HIGH_WATER_5705;
+
+               tp->bufmgr_config.mbuf_read_dma_low_water_jumbo =
+                       DEFAULT_MB_RDMA_LOW_WATER_JUMBO_5780;
+               tp->bufmgr_config.mbuf_mac_rx_low_water_jumbo =
+                       DEFAULT_MB_MACRX_LOW_WATER_JUMBO_5780;
+               tp->bufmgr_config.mbuf_high_water_jumbo =
+                       DEFAULT_MB_HIGH_WATER_JUMBO_5780;
+       } else {
+               tp->bufmgr_config.mbuf_read_dma_low_water =
+                       DEFAULT_MB_RDMA_LOW_WATER;
+               tp->bufmgr_config.mbuf_mac_rx_low_water =
+                       DEFAULT_MB_MACRX_LOW_WATER;
+               tp->bufmgr_config.mbuf_high_water =
+                       DEFAULT_MB_HIGH_WATER;
 
-       tp->bufmgr_config.mbuf_read_dma_low_water_jumbo =
-               DEFAULT_MB_RDMA_LOW_WATER_JUMBO;
-       tp->bufmgr_config.mbuf_mac_rx_low_water_jumbo =
-               DEFAULT_MB_MACRX_LOW_WATER_JUMBO;
-       tp->bufmgr_config.mbuf_high_water_jumbo =
-               DEFAULT_MB_HIGH_WATER_JUMBO;
+               tp->bufmgr_config.mbuf_read_dma_low_water_jumbo =
+                       DEFAULT_MB_RDMA_LOW_WATER_JUMBO;
+               tp->bufmgr_config.mbuf_mac_rx_low_water_jumbo =
+                       DEFAULT_MB_MACRX_LOW_WATER_JUMBO;
+               tp->bufmgr_config.mbuf_high_water_jumbo =
+                       DEFAULT_MB_HIGH_WATER_JUMBO;
+       }
 
        tp->bufmgr_config.dma_low_water = DEFAULT_DMA_LOW_WATER;
        tp->bufmgr_config.dma_high_water = DEFAULT_DMA_HIGH_WATER;
@@ -9803,6 +10122,7 @@ static char * __devinit tg3_phy_string(struct tg3 *tp)
        case PHY_ID_BCM5705:    return "5705";
        case PHY_ID_BCM5750:    return "5750";
        case PHY_ID_BCM5752:    return "5752";
+       case PHY_ID_BCM5780:    return "5780";
        case PHY_ID_BCM8002:    return "8002/serdes";
        case 0:                 return "serdes";
        default:                return "unknown";
@@ -9998,8 +10318,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 
        tg3_init_link_config(tp);
 
-       tg3_init_bufmgr_config(tp);
-
        tp->rx_pending = TG3_DEF_RX_RING_PENDING;
        tp->rx_jumbo_pending = TG3_DEF_RX_JUMBO_RING_PENDING;
        tp->tx_pending = TG3_DEF_TX_RING_PENDING;
@@ -10028,14 +10346,7 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
                goto err_out_iounmap;
        }
 
-       if (tp->tg3_flags2 & TG3_FLG2_5705_PLUS) {
-               tp->bufmgr_config.mbuf_read_dma_low_water =
-                       DEFAULT_MB_RDMA_LOW_WATER_5705;
-               tp->bufmgr_config.mbuf_mac_rx_low_water =
-                       DEFAULT_MB_MACRX_LOW_WATER_5705;
-               tp->bufmgr_config.mbuf_high_water =
-                       DEFAULT_MB_HIGH_WATER_5705;
-       }
+       tg3_init_bufmgr_config(tp);
 
 #if TG3_TSO_SUPPORT != 0
        if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
index 70ad450733e6933b119958fcbb84ca606116065d..5c4433c147fa46ed891af4b425ea41078a1ffeeb 100644 (file)
 #define   ASIC_REV_5705                         0x03
 #define   ASIC_REV_5750                         0x04
 #define   ASIC_REV_5752                         0x06
+#define   ASIC_REV_5780                         0x08
 #define  GET_CHIP_REV(CHIP_REV_ID)     ((CHIP_REV_ID) >> 8)
 #define   CHIPREV_5700_AX               0x70
 #define   CHIPREV_5700_BX               0x71
 #define  DEFAULT_MB_RDMA_LOW_WATER      0x00000050
 #define  DEFAULT_MB_RDMA_LOW_WATER_5705         0x00000000
 #define  DEFAULT_MB_RDMA_LOW_WATER_JUMBO 0x00000130
+#define  DEFAULT_MB_RDMA_LOW_WATER_JUMBO_5780 0x00000000
 #define BUFMGR_MB_MACRX_LOW_WATER      0x00004414
 #define  DEFAULT_MB_MACRX_LOW_WATER      0x00000020
 #define  DEFAULT_MB_MACRX_LOW_WATER_5705  0x00000010
 #define  DEFAULT_MB_MACRX_LOW_WATER_JUMBO 0x00000098
+#define  DEFAULT_MB_MACRX_LOW_WATER_JUMBO_5780 0x0000004b
 #define BUFMGR_MB_HIGH_WATER           0x00004418
 #define  DEFAULT_MB_HIGH_WATER          0x00000060
 #define  DEFAULT_MB_HIGH_WATER_5705     0x00000060
 #define  DEFAULT_MB_HIGH_WATER_JUMBO    0x0000017c
+#define  DEFAULT_MB_HIGH_WATER_JUMBO_5780 0x00000096
 #define BUFMGR_RX_MB_ALLOC_REQ         0x0000441c
 #define  BUFMGR_MB_ALLOC_BIT            0x10000000
 #define BUFMGR_RX_MB_ALLOC_RESP                0x00004420
@@ -2087,6 +2091,8 @@ struct tg3 {
        struct tg3_rx_buffer_desc       *rx_rcb;
        dma_addr_t                      rx_rcb_mapping;
 
+       u32                             rx_pkt_buf_sz;
+
        /* begin "everything else" cacheline(s) section */
        struct net_device_stats         net_stats;
        struct net_device_stats         net_stats_prev;
@@ -2124,7 +2130,7 @@ struct tg3 {
 #define TG3_FLAG_NO_TX_PSEUDO_CSUM     0x00100000
 #define TG3_FLAG_NO_RX_PSEUDO_CSUM     0x00200000
 #define TG3_FLAG_SERDES_WOL_CAP                0x00400000
-#define TG3_FLAG_JUMBO_ENABLE          0x00800000
+#define TG3_FLAG_JUMBO_RING_ENABLE     0x00800000
 #define TG3_FLAG_10_100_ONLY           0x01000000
 #define TG3_FLAG_PAUSE_AUTONEG         0x02000000
 #define TG3_FLAG_BROKEN_CHECKSUMS      0x10000000
@@ -2154,6 +2160,11 @@ struct tg3 {
 #define TG3_FLG2_5750_PLUS             0x00080000
 #define TG3_FLG2_PROTECTED_NVRAM       0x00100000
 #define TG3_FLG2_USING_MSI             0x00200000
+#define TG3_FLG2_JUMBO_CAPABLE         0x00400000
+#define TG3_FLG2_MII_SERDES            0x00800000
+#define TG3_FLG2_ANY_SERDES            (TG3_FLG2_PHY_SERDES |  \
+                                       TG3_FLG2_MII_SERDES)
+#define TG3_FLG2_PARALLEL_DETECT       0x01000000
 
        u32                             split_mode_max_reqs;
 #define SPLIT_MODE_5704_MAX_REQ                3
@@ -2187,6 +2198,7 @@ struct tg3 {
        u8                              pci_bist;
 
        int                             pm_cap;
+       int                             msi_cap;
 
        /* PHY info */
        u32                             phy_id;
@@ -2200,6 +2212,7 @@ struct tg3 {
 #define PHY_ID_BCM5705                 0x600081a0
 #define PHY_ID_BCM5750                 0x60008180
 #define PHY_ID_BCM5752                 0x60008100
+#define PHY_ID_BCM5780                 0x60008350
 #define PHY_ID_BCM8002                 0x60010140
 #define PHY_ID_INVALID                 0xffffffff
 #define PHY_ID_REV_MASK                        0x0000000f
index 2efccb0554c0245a953e92a25aac62026a4f92be..c5f5e62aab8b8c31814fea2fa900799db0c061c3 100644 (file)
 #include <asm/io.h>            /* for inb(), outb(), etc. */
 #include <linux/time.h>                /* for do_gettimeofday */       
 #include <linux/in.h>          /* sockaddr_in */
+#include <linux/jiffies.h>     /* time_after() macro */
 #include <asm/errno.h>
 
 #include <linux/ip.h>
@@ -773,7 +774,7 @@ static int update(struct wan_device* wandev)
                for(;;) {
                if(card->u.f.update_comms_stats == 0)
                        break;
-                if ((jiffies - timeout) > (1 * HZ)){
+                if (time_after(jiffies, timeout + 1 * HZ)){
                        card->u.f.update_comms_stats = 0;
                        return -EAGAIN;
                }
@@ -4799,7 +4800,7 @@ static void trigger_unconfig_fr(struct net_device *dev)
 {
        fr_channel_t *chan = dev->priv;
        volatile sdla_t *card = chan->card;
-       u32 timeout;
+       unsigned long timeout;
        fr508_flags_t* flags = card->flags;
        int reset_critical=0;
        
@@ -4821,7 +4822,7 @@ static void trigger_unconfig_fr(struct net_device *dev)
                if(!(card->u.f.timer_int_enabled & TMR_INT_ENABLED_UNCONFIG))
                        break;
 
-               if ((jiffies - timeout) > (1 * HZ)){
+               if (time_after(jiffies, timeout + 1 * HZ)){
                        card->u.f.timer_int_enabled &= ~TMR_INT_ENABLED_UNCONFIG;
                        printk(KERN_INFO "%s: Failed to delete DLCI %i\n",
                                card->devname,chan->dlci);
index 5e3124856eb048780aa40f3066610c533d88b8f3..9d6528a50f7bf3c4f816f52c4ee4435e8e4f7b9a 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/wanrouter.h>   /* WAN router definitions */
 #include <linux/wanpipe.h>     /* WANPIPE common user API definitions */
 #include <linux/if_arp.h>      /* ARPHRD_* defines */
+#include <linux/jiffies.h>     /* time_after() macro */
 
 #include <linux/inetdevice.h>
 #include <asm/uaccess.h>
@@ -164,7 +165,7 @@ int wpft1_init (sdla_t* card, wandev_conf_t* conf)
 
                timeout = jiffies;
                while (mb->return_code != 'I')  /* Wait 1s for board to initialize */
-                       if ((jiffies - timeout) > 1*HZ) break;
+                       if (time_after(jiffies, timeout + 1*HZ)) break;
 
                if (mb->return_code != 'I') {
                        printk(KERN_INFO
index 1761cb68ab48eb89d98ee148344a70e4dd9419e1..a4b489cccbbf5d70d03535fe3863504767e95551 100644 (file)
 #include <linux/if_arp.h>      /* ARPHRD_* defines */
 #include <asm/byteorder.h>     /* htons(), etc. */
 #include <linux/in.h>          /* sockaddr_in */
+#include <linux/jiffies.h>     /* time_after() macro */
 
 
 #include <asm/uaccess.h>
@@ -482,7 +483,7 @@ static int update(struct wan_device *wandev)
                if(ppp_priv_area->update_comms_stats == 0){
                        break;
                }
-                if ((jiffies - timeout) > (1 * HZ)){
+                if (time_after(jiffies, timeout + 1 * HZ)){
                        ppp_priv_area->update_comms_stats = 0;
                        ppp_priv_area->timer_int_enabled &=
                                ~TMR_INT_ENABLED_UPDATE; 
index 3a93d2fd4fbf7a13241f6ea4e4b5053d806d61fc..8a95d61a2f8ff0fa3b980990c13f2f32be00dd25 100644 (file)
@@ -91,6 +91,7 @@
 #include <linux/wanrouter.h>   /* WAN router definitions */
 #include <linux/wanpipe.h>     /* WANPIPE common user API definitions */
 #include <linux/workqueue.h>
+#include <linux/jiffies.h>     /* time_after() macro */
 #include <asm/byteorder.h>     /* htons(), etc. */
 #include <asm/atomic.h>
 #include <linux/delay.h>       /* Experimental delay */
@@ -867,7 +868,7 @@ static int update(struct wan_device* wandev)
                if (!(card->u.x.timer_int_enabled & TMR_INT_ENABLED_UPDATE)){   
                        break;
                }
-               if ((jiffies-timeout) > 1*HZ){
+               if (time_after(jiffies, timeout + 1*HZ)){
                        card->u.x.timer_int_enabled &= ~TMR_INT_ENABLED_UPDATE;
                        return -EAGAIN;
                }
index 6aa6987d96cbf9aab2894b18ac03b14c063eef19..812a1183c502bfa7de160e3a55ebee74b0301d5a 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/wanrouter.h>   /* WAN router definitions */
 #include <linux/wanpipe.h>     /* WANPIPE common user API definitions */
 #include <linux/if_arp.h>      /* ARPHRD_* defines */
+#include <linux/jiffies.h>     /* time_after() macro */
 
 #include <linux/in.h>          /* sockaddr_in */
 #include <linux/inet.h>        
@@ -270,9 +271,9 @@ int wsppp_init (sdla_t* card, wandev_conf_t* conf)
                ready to accept commands.  We expect this to be completed in less
                than 1 second. */
 
-               timeout = jiffies;
+               timeout = jiffies + 1 * HZ;
                while (mb->return_code != 'I')  /* Wait 1s for board to initialize */
-                       if ((jiffies - timeout) > 1*HZ) break;
+                       if (time_after(jiffies, timeout)) break;
 
                if (mb->return_code != 'I') {
                        printk(KERN_INFO
@@ -493,11 +494,11 @@ static int update(struct wan_device* wandev)
        chdlc_priv_area->timer_int_enabled = TMR_INT_ENABLED_UPDATE;
   
        /* wait a maximum of 1 second for the statistics to be updated */ 
-        timeout = jiffies;
+        timeout = jiffies + 1 * HZ;
         for(;;) {
                if(chdlc_priv_area->update_comms_stats == 0)
                        break;
-                if ((jiffies - timeout) > (1 * HZ)){
+                if (time_after(jiffies, timeout)){
                        chdlc_priv_area->update_comms_stats = 0;
                        chdlc_priv_area->timer_int_enabled &=
                                ~TMR_INT_ENABLED_UPDATE; 
index 0a387106acb0ebd3bb4c835e54dfac7d89bac1b9..7a87298bae993f0cadc5676a377f4ae2b65851c9 100644 (file)
@@ -30,20 +30,9 @@ static int jornada720_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
    */
   GRER |= 0x00000002;
   /* Set GPIO_A<3:1> to be outputs for PCMCIA/CF power controller: */
-  PA_DDR = 0;
-  PA_DWR = 0;
-  PA_SDR = 0;
-  PA_SSR = 0;
-
-  PB_DDR = 0;
-  PB_DWR = 0x01;
-  PB_SDR = 0;
-  PB_SSR = 0;
-
-  PC_DDR = 0x88;
-  PC_DWR = 0x20;
-  PC_SDR = 0;
-  PC_SSR = 0;
+  sa1111_set_io_dir(SA1111_DEV(skt->dev), GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0, 0);
+  sa1111_set_io(SA1111_DEV(skt->dev), GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0);
+  sa1111_set_sleep_io(SA1111_DEV(skt->dev), GPIO_A0|GPIO_A1|GPIO_A2|GPIO_A3, 0);
 
   return sa1111_pcmcia_hw_init(skt);
 }
@@ -95,7 +84,7 @@ printk("%s(): config socket %d vcc %d vpp %d\n", __FUNCTION__,
     unsigned long flags;
 
     local_irq_save(flags);
-    PA_DWR = (PA_DWR & ~pa_dwr_mask) | pa_dwr_set;
+    sa1111_set_io(SA1111_DEV(skt->dev), pa_dwr_mask, pa_dwr_set);
     local_irq_restore(flags);
   }
 
index 90d8ef1f0bccd8a3cabaf41f5e4e166f0ed48fe7..a41778a490d600e9de43829e927430c9ea849f7b 100644 (file)
@@ -71,20 +71,6 @@ config SUN_JSFLASH
 
 # XXX Why don't we do "source drivers/char/Config.in" somewhere?
 # no shit
-config APM_RTC_IS_GMT
-       bool
-       depends on EXPERIMENTAL && SPARC32 && PCI
-       default y
-       help
-         Say Y here if your RTC (Real Time Clock a.k.a. hardware clock)
-         stores the time in GMT (Greenwich Mean Time). Say N if your RTC
-         stores localtime.
-
-         It is in fact recommended to store GMT in your RTC, because then you
-         don't have to worry about daylight savings time changes. The only
-         reason not to use GMT in your RTC is if you also run a broken OS
-         that doesn't understand GMT.
-
 config RTC
        tristate "PC-style Real Time Clock Support"
        depends on PCI && EXPERIMENTAL && SPARC32
index 650d5e924f4714c1d0c00f4777c1fad58559c645..d96cc47de5668e203cbb49a4d77c85c2d72c1485 100644 (file)
@@ -1515,8 +1515,7 @@ static void aurora_close(struct tty_struct * tty, struct file * filp)
                 */
                timeout = jiffies+HZ;
                while(port->SRER & SRER_TXEMPTY)  {
-                       current->state = TASK_INTERRUPTIBLE;
-                       schedule_timeout(port->timeout);
+                       msleep_interruptible(jiffies_to_msecs(port->timeout));
                        if (time_after(jiffies, timeout))
                                break;
                }
@@ -1533,8 +1532,7 @@ static void aurora_close(struct tty_struct * tty, struct file * filp)
        port->tty = 0;
        if (port->blocked_open) {
                if (port->close_delay) {
-                       current->state = TASK_INTERRUPTIBLE;
-                       schedule_timeout(port->close_delay);
+                       msleep_interruptible(jiffies_to_msecs(port->close_delay));
                }
                wake_up_interruptible(&port->open_wait);
        }
index d5259f7fee6d056957a1d0bfa366f374dff28045..b8a2c7353b0a5f3f8d0b7e755fbbcd23430f7336 100644 (file)
@@ -4,13 +4,14 @@
  * Copyright (C) 2001 David S. Miller (davem@redhat.com)
  */
 
+#define __KERNEL_SYSCALLS__
+
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <asm/oplib.h>
 #include <asm/ebus.h>
-#define __KERNEL_SYSCALLS__
 static int errno;
 #include <asm/unistd.h>
 
index f6ed35b24f43167e689d836b2b3081421aecd84a..9a8c572554f5e6e9d630058656b21300e9bec779 100644 (file)
@@ -19,6 +19,8 @@
  *              Daniele Bellucci <bellucda@tiscali.it>
  */
 
+#define __KERNEL_SYSCALLS__
+
 #include <linux/config.h>
 #include <linux/module.h>
 #include <linux/sched.h>
@@ -35,7 +37,6 @@
 #include <asm/uaccess.h>
 #include <asm/envctrl.h>
 
-#define __KERNEL_SYSCALLS__
 static int errno;
 #include <asm/unistd.h>
 
@@ -1007,7 +1008,7 @@ static int kenvctrld(void *__unused)
                return -ENODEV;
        }
 
-       poll_interval = 5 * HZ; /* TODO env_mon_interval */
+       poll_interval = 5000; /* TODO env_mon_interval */
 
        daemonize("kenvctrld");
        allow_signal(SIGKILL);
@@ -1016,10 +1017,7 @@ static int kenvctrld(void *__unused)
 
        printk(KERN_INFO "envctrl: %s starting...\n", current->comm);
        for (;;) {
-               current->state = TASK_INTERRUPTIBLE;
-               schedule_timeout(poll_interval);
-
-               if(signal_pending(current))
+               if(msleep_interruptible(poll_interval))
                        break;
 
                for (whichcpu = 0; whichcpu < ENVCTRL_MAX_CPU; ++whichcpu) {
index 95e3cebf792cf8775a1437b884c4bfdf5808e063..1faf1e75f71fa34b80c3d3f2e601b9a86d54841e 100644 (file)
@@ -88,14 +88,16 @@ void vfc_i2c_delay_wakeup(struct vfc_dev *dev)
 
 void vfc_i2c_delay_no_busy(struct vfc_dev *dev, unsigned long usecs) 
 {
+       DEFINE_WAIT(wait);
        init_timer(&dev->poll_timer);
-       dev->poll_timer.expires = jiffies + 
-               ((unsigned long)usecs*(HZ))/1000000;
+       dev->poll_timer.expires = jiffies + usecs_to_jiffies(usecs);
        dev->poll_timer.data=(unsigned long)dev;
        dev->poll_timer.function=(void *)(unsigned long)vfc_i2c_delay_wakeup;
        add_timer(&dev->poll_timer);
-       sleep_on(&dev->poll_wait);
+       prepare_to_wait(&dev->poll_wait, &wait, TASK_UNINTERRUPTIBLE);
+       schedule();
        del_timer(&dev->poll_timer);
+       finish_wait(&dev->poll_wait, &wait);
 }
 
 void inline vfc_i2c_delay(struct vfc_dev *dev) 
index fdb0f45f7336cf96cb01c106800ff90b15a31aaf..4fa524687bc51c6bd48cb5fe582748d022da6094 100644 (file)
@@ -13,6 +13,7 @@ Supported Cards/Chipsets
        Adaptec 2020S
        Adaptec 2025S
        Adaptec 2120S
+       Adaptec 2130S
        Adaptec 2200S
        Adaptec 2230S
        Adaptec 2240S
@@ -35,6 +36,13 @@ Supported Cards/Chipsets
        HP NetRAID-4M
        Legend S220
        Legend S230
+       IBM ServeRAID 8i
+       ICP 9014R0
+       ICP 9024R0
+       ICP 9047MA
+       ICP 9087MA
+       ICP 9085LI
+       ICP 5085AU
 
 People
 -------------------------
index 25856a21d982c401cb23c5ed8b3f88c5bb8df340..2f148b4617dc96f842395a2ea22badd7b659c928 100644 (file)
@@ -1,6 +1,4 @@
 o      Testing
 o      More testing
-o      Feature request: display the firmware/bios/etc revisions in the
-       /proc info
 o      Drop irq_mask, basically unused
 o      I/O size increase
index f02c99641467394a8f266c662eca1ae8603b1460..ccdf440021fbe23c8997fc48f4e4928857b906a3 100644 (file)
@@ -276,7 +276,6 @@ int aac_get_containers(struct aac_dev *dev)
 
        if (maximum_num_containers < MAXIMUM_NUM_CONTAINERS)
                maximum_num_containers = MAXIMUM_NUM_CONTAINERS;
-
        fsa_dev_ptr = (struct fsa_dev_info *) kmalloc(
          sizeof(*fsa_dev_ptr) * maximum_num_containers, GFP_KERNEL);
        if (!fsa_dev_ptr) {
@@ -527,6 +526,11 @@ static char *container_types[] = {
         "V-MIRRORS",          
         "PSEUDO R4",          
        "RAID50",
+       "RAID5D",
+       "RAID5D0",
+       "RAID1E",
+       "RAID6",
+       "RAID60",
         "Unknown"
 };
 
@@ -610,7 +614,9 @@ int aac_get_adapter_info(struct aac_dev* dev)
        struct fib* fibptr;
        int rcode;
        u32 tmp;
-       struct aac_adapter_info * info;
+       struct aac_adapter_info *info;
+       struct aac_bus_info *command;
+       struct aac_bus_info_response *bus_info;
 
        if (!(fibptr = fib_alloc(dev)))
                return -ENOMEM;
@@ -655,6 +661,36 @@ int aac_get_adapter_info(struct aac_dev* dev)
                        memcpy(&dev->supplement_adapter_info, info, sizeof(*info));
        }
 
+
+       /* 
+        * GetBusInfo 
+        */
+
+       fib_init(fibptr);
+
+       bus_info = (struct aac_bus_info_response *) fib_data(fibptr);
+
+       memset(bus_info, 0, sizeof(*bus_info));
+
+       command = (struct aac_bus_info *)bus_info;
+
+       command->Command = cpu_to_le32(VM_Ioctl);
+       command->ObjType = cpu_to_le32(FT_DRIVE);
+       command->MethodId = cpu_to_le32(1);
+       command->CtlCmd = cpu_to_le32(GetBusInfo);
+
+       rcode = fib_send(ContainerCommand,
+                        fibptr,
+                        sizeof (*bus_info),
+                        FsaNormal,
+                        1, 1,
+                        NULL, NULL);
+
+       if (rcode >= 0 && le32_to_cpu(bus_info->Status) == ST_OK) {
+               dev->maximum_num_physicals = le32_to_cpu(bus_info->TargetsPerBus);
+               dev->maximum_num_channels = le32_to_cpu(bus_info->BusCount);
+       }
+
        tmp = le32_to_cpu(dev->adapter_info.kernelrev);
        printk(KERN_INFO "%s%d: kernel %d.%d-%d[%d] %.*s\n", 
                        dev->name, 
@@ -1818,7 +1854,9 @@ static int aac_send_srb_fib(struct scsi_cmnd* scsicmd)
        u32 flag;
        u32 timeout;
 
-       if( scsicmd->device->id > 15 || scsicmd->device->lun > 7) {
+       dev = (struct aac_dev *)scsicmd->device->host->hostdata;
+       if (scsicmd->device->id >= dev->maximum_num_physicals || 
+                       scsicmd->device->lun > 7) {
                scsicmd->result = DID_NO_CONNECT << 16;
                scsicmd->scsi_done(scsicmd);
                return 0;
index 42484417cef7d9b1d89beead3a9fcd21b24abdee..3a11a536c0dab39e351f8db5e969f1e6c72220c8 100644 (file)
@@ -845,6 +845,28 @@ struct aac_supplement_adapter_info
 #define AAC_SIS_VERSION_V3     3
 #define AAC_SIS_SLOT_UNKNOWN   0xFF
 
+#define GetBusInfo 0x00000009
+struct aac_bus_info {
+       __le32  Command;        /* VM_Ioctl */
+       __le32  ObjType;        /* FT_DRIVE */
+       __le32  MethodId;       /* 1 = SCSI Layer */
+       __le32  ObjectId;       /* Handle */
+       __le32  CtlCmd;         /* GetBusInfo */
+};
+
+struct aac_bus_info_response {
+       __le32  Status;         /* ST_OK */
+       __le32  ObjType;
+       __le32  MethodId;       /* unused */
+       __le32  ObjectId;       /* unused */
+       __le32  CtlCmd;         /* unused */
+       __le32  ProbeComplete;
+       __le32  BusCount;
+       __le32  TargetsPerBus;
+       u8      InitiatorBusId[10];
+       u8      BusValid[10];
+};
+
 /*
  * Battery platforms
  */
@@ -934,6 +956,8 @@ struct aac_dev
 
        struct Scsi_Host        *scsi_host_ptr;
        int                     maximum_num_containers;
+       int                     maximum_num_physicals;
+       int                     maximum_num_channels;
        struct fsa_dev_info     *fsa_dev;
        pid_t                   thread_pid;
        int                     cardtype;
index 390cd67c57c03fdbbc5bfe77177bbe6d85a8d1ff..85387099aab238db175a7b53a238a819f597ba3e 100644 (file)
@@ -517,7 +517,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void __user * arg)
        }
        if (dev->dac_support == 1) {
                struct user_sgmap64* upsg = (struct user_sgmap64*)&user_srbcmd->sg;
-               struct sgmap64* psg = (struct sgmap64*)&user_srbcmd->sg;
+               struct sgmap64* psg = (struct sgmap64*)&srbcmd->sg;
                struct user_sgmap* usg;
                byte_count = 0;
 
index f7e9c89c491548ce40080d0c355f4b0f98492602..c1a4f978fcbad1156f9badd33af44f122e2bf5ed 100644 (file)
@@ -102,32 +102,43 @@ static struct pci_device_id aac_pci_tbl[] = {
        { 0x9005, 0x0286, 0x9005, 0x029b, 0, 0, 22 }, /* AAR-2820SA (Intruder) */
        { 0x9005, 0x0286, 0x9005, 0x029c, 0, 0, 23 }, /* AAR-2620SA (Intruder) */
        { 0x9005, 0x0286, 0x9005, 0x029d, 0, 0, 24 }, /* AAR-2420SA (Intruder) */
-       { 0x9005, 0x0286, 0x9005, 0x0800, 0, 0, 25 }, /* Callisto Jupiter Platform */
-       { 0x9005, 0x0285, 0x9005, 0x028e, 0, 0, 26 }, /* ASR-2020SA SATA PCI-X ZCR (Skyhawk) */
-       { 0x9005, 0x0285, 0x9005, 0x028f, 0, 0, 27 }, /* ASR-2025SA SATA SO-DIMM PCI-X ZCR (Terminator) */
-       { 0x9005, 0x0285, 0x9005, 0x0290, 0, 0, 28 }, /* AAR-2410SA PCI SATA 4ch (Jaguar II) */
-       { 0x9005, 0x0285, 0x1028, 0x0291, 0, 0, 29 }, /* CERC SATA RAID 2 PCI SATA 6ch (DellCorsair) */
-       { 0x9005, 0x0285, 0x9005, 0x0292, 0, 0, 30 }, /* AAR-2810SA PCI SATA 8ch (Corsair-8) */
-       { 0x9005, 0x0285, 0x9005, 0x0293, 0, 0, 31 }, /* AAR-21610SA PCI SATA 16ch (Corsair-16) */
-       { 0x9005, 0x0285, 0x9005, 0x0294, 0, 0, 32 }, /* ESD SO-DIMM PCI-X SATA ZCR (Prowler) */
-       { 0x9005, 0x0285, 0x103C, 0x3227, 0, 0, 33 }, /* AAR-2610SA PCI SATA 6ch */
-       { 0x9005, 0x0285, 0x9005, 0x0296, 0, 0, 34 }, /* ASR-2240S (SabreExpress) */
-       { 0x9005, 0x0285, 0x9005, 0x0297, 0, 0, 35 }, /* ASR-4005SAS */
-       { 0x9005, 0x0285, 0x1014, 0x02F2, 0, 0, 36 }, /* IBM 8i (AvonPark) */
-       { 0x9005, 0x0285, 0x9005, 0x0298, 0, 0, 37 }, /* ASR-4000SAS (BlackBird) */
-       { 0x9005, 0x0285, 0x9005, 0x0299, 0, 0, 38 }, /* ASR-4800SAS (Marauder-X) */
-       { 0x9005, 0x0285, 0x9005, 0x029A, 0, 0, 39 }, /* ASR-4805SAS (Marauder-E) */
-
-       { 0x9005, 0x0285, 0x1028, 0x0287, 0, 0, 40 }, /* Perc 320/DC*/
-       { 0x1011, 0x0046, 0x9005, 0x0365, 0, 0, 41 }, /* Adaptec 5400S (Mustang)*/
-       { 0x1011, 0x0046, 0x9005, 0x0364, 0, 0, 42 }, /* Adaptec 5400S (Mustang)*/
-       { 0x1011, 0x0046, 0x9005, 0x1364, 0, 0, 43 }, /* Dell PERC2/QC */
-       { 0x1011, 0x0046, 0x103c, 0x10c2, 0, 0, 44 }, /* HP NetRAID-4M */
-
-       { 0x9005, 0x0285, 0x1028, PCI_ANY_ID, 0, 0, 45 }, /* Dell Catchall */
-       { 0x9005, 0x0285, 0x17aa, PCI_ANY_ID, 0, 0, 46 }, /* Legend Catchall */
-       { 0x9005, 0x0285, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 47 }, /* Adaptec Catch All */
-       { 0x9005, 0x0286, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 48 }, /* Adaptec Rocket Catch All */
+       { 0x9005, 0x0286, 0x9005, 0x029e, 0, 0, 25 }, /* ICP9024R0 (Lancer) */
+       { 0x9005, 0x0286, 0x9005, 0x029f, 0, 0, 26 }, /* ICP9014R0 (Lancer) */
+       { 0x9005, 0x0286, 0x9005, 0x02a0, 0, 0, 27 }, /* ICP9047MA (Lancer) */
+       { 0x9005, 0x0286, 0x9005, 0x02a1, 0, 0, 28 }, /* ICP9087MA (Lancer) */
+       { 0x9005, 0x0286, 0x9005, 0x02a3, 0, 0, 29 }, /* ICP5085AU (Hurricane) */
+       { 0x9005, 0x0285, 0x9005, 0x02a4, 0, 0, 30 }, /* ICP9085LI (Marauder-X) */
+       { 0x9005, 0x0285, 0x9005, 0x02a5, 0, 0, 31 }, /* ICP5085BR (Marauder-E) */
+       { 0x9005, 0x0287, 0x9005, 0x0800, 0, 0, 32 }, /* Themisto Jupiter Platform */
+       { 0x9005, 0x0200, 0x9005, 0x0200, 0, 0, 32 }, /* Themisto Jupiter Platform */
+       { 0x9005, 0x0286, 0x9005, 0x0800, 0, 0, 33 }, /* Callisto Jupiter Platform */
+       { 0x9005, 0x0285, 0x9005, 0x028e, 0, 0, 34 }, /* ASR-2020SA SATA PCI-X ZCR (Skyhawk) */
+       { 0x9005, 0x0285, 0x9005, 0x028f, 0, 0, 35 }, /* ASR-2025SA SATA SO-DIMM PCI-X ZCR (Terminator) */
+       { 0x9005, 0x0285, 0x9005, 0x0290, 0, 0, 36 }, /* AAR-2410SA PCI SATA 4ch (Jaguar II) */
+       { 0x9005, 0x0285, 0x1028, 0x0291, 0, 0, 37 }, /* CERC SATA RAID 2 PCI SATA 6ch (DellCorsair) */
+       { 0x9005, 0x0285, 0x9005, 0x0292, 0, 0, 38 }, /* AAR-2810SA PCI SATA 8ch (Corsair-8) */
+       { 0x9005, 0x0285, 0x9005, 0x0293, 0, 0, 39 }, /* AAR-21610SA PCI SATA 16ch (Corsair-16) */
+       { 0x9005, 0x0285, 0x9005, 0x0294, 0, 0, 40 }, /* ESD SO-DIMM PCI-X SATA ZCR (Prowler) */
+       { 0x9005, 0x0285, 0x103C, 0x3227, 0, 0, 41 }, /* AAR-2610SA PCI SATA 6ch */
+       { 0x9005, 0x0285, 0x9005, 0x0296, 0, 0, 42 }, /* ASR-2240S (SabreExpress) */
+       { 0x9005, 0x0285, 0x9005, 0x0297, 0, 0, 43 }, /* ASR-4005SAS */
+       { 0x9005, 0x0285, 0x1014, 0x02F2, 0, 0, 44 }, /* IBM 8i (AvonPark) */
+       { 0x9005, 0x0285, 0x1014, 0x0312, 0, 0, 44 }, /* IBM 8i (AvonPark Lite) */
+       { 0x9005, 0x0285, 0x9005, 0x0298, 0, 0, 45 }, /* ASR-4000SAS (BlackBird) */
+       { 0x9005, 0x0285, 0x9005, 0x0299, 0, 0, 46 }, /* ASR-4800SAS (Marauder-X) */
+       { 0x9005, 0x0285, 0x9005, 0x029a, 0, 0, 47 }, /* ASR-4805SAS (Marauder-E) */
+       { 0x9005, 0x0286, 0x9005, 0x02a2, 0, 0, 48 }, /* ASR-4810SAS (Hurricane */
+
+       { 0x9005, 0x0285, 0x1028, 0x0287, 0, 0, 49 }, /* Perc 320/DC*/
+       { 0x1011, 0x0046, 0x9005, 0x0365, 0, 0, 50 }, /* Adaptec 5400S (Mustang)*/
+       { 0x1011, 0x0046, 0x9005, 0x0364, 0, 0, 51 }, /* Adaptec 5400S (Mustang)*/
+       { 0x1011, 0x0046, 0x9005, 0x1364, 0, 0, 52 }, /* Dell PERC2/QC */
+       { 0x1011, 0x0046, 0x103c, 0x10c2, 0, 0, 53 }, /* HP NetRAID-4M */
+
+       { 0x9005, 0x0285, 0x1028, PCI_ANY_ID, 0, 0, 54 }, /* Dell Catchall */
+       { 0x9005, 0x0285, 0x17aa, PCI_ANY_ID, 0, 0, 55 }, /* Legend Catchall */
+       { 0x9005, 0x0285, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 56 }, /* Adaptec Catch All */
+       { 0x9005, 0x0286, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 57 }, /* Adaptec Rocket Catch All */
        { 0,}
 };
 MODULE_DEVICE_TABLE(pci, aac_pci_tbl);
@@ -164,6 +175,14 @@ static struct aac_driver_ident aac_drivers[] = {
        { aac_rkt_init, "aacraid",  "ADAPTEC ", "AAR-2820SA      ", 1 }, /* AAR-2820SA (Intruder) */
        { aac_rkt_init, "aacraid",  "ADAPTEC ", "AAR-2620SA      ", 1 }, /* AAR-2620SA (Intruder) */
        { aac_rkt_init, "aacraid",  "ADAPTEC ", "AAR-2420SA      ", 1 }, /* AAR-2420SA (Intruder) */
+       { aac_rkt_init, "aacraid",  "ICP     ", "ICP9024R0       ", 2 }, /* ICP9024R0 (Lancer) */
+       { aac_rkt_init, "aacraid",  "ICP     ", "ICP9014R0       ", 1 }, /* ICP9014R0 (Lancer) */
+       { aac_rkt_init, "aacraid",  "ICP     ", "ICP9047MA       ", 1 }, /* ICP9047MA (Lancer) */
+       { aac_rkt_init, "aacraid",  "ICP     ", "ICP9087MA       ", 1 }, /* ICP9087MA (Lancer) */
+       { aac_rkt_init, "aacraid",  "ICP     ", "ICP5085AU       ", 1 }, /* ICP5085AU (Hurricane) */
+       { aac_rkt_init, "aacraid",  "ICP     ", "ICP9085LI       ", 1 }, /* ICP9085LI (Marauder-X) */
+       { aac_rkt_init, "aacraid",  "ICP     ", "ICP5085BR       ", 1 }, /* ICP5085BR (Marauder-E) */
+       { NULL        , "aacraid",  "ADAPTEC ", "Themisto        ", 0, AAC_QUIRK_SLAVE }, /* Jupiter Platform */
        { aac_rkt_init, "aacraid",  "ADAPTEC ", "Callisto        ", 2, AAC_QUIRK_MASTER }, /* Jupiter Platform */
        { aac_rx_init, "aacraid",  "ADAPTEC ", "ASR-2020SA       ", 1 }, /* ASR-2020SA SATA PCI-X ZCR (Skyhawk) */
        { aac_rx_init, "aacraid",  "ADAPTEC ", "ASR-2025SA       ", 1 }, /* ASR-2025SA SATA SO-DIMM PCI-X ZCR (Terminator) */
@@ -175,10 +194,11 @@ static struct aac_driver_ident aac_drivers[] = {
        { aac_rx_init, "aacraid",  "ADAPTEC ", "AAR-2610SA      ", 1 }, /* SATA 6Ch (Bearcat) */
        { aac_rx_init, "aacraid",  "ADAPTEC ", "ASR-2240S       ", 1 }, /* ASR-2240S (SabreExpress) */
        { aac_rx_init, "aacraid",  "ADAPTEC ", "ASR-4005SAS     ", 1 }, /* ASR-4005SAS */
-       { aac_rx_init, "aacraid",  "IBM     ", "ServeRAID 8i    ", 1 }, /* IBM 8i (AvonPark) */
+       { aac_rx_init, "ServeRAID","IBM     ", "ServeRAID 8i    ", 1 }, /* IBM 8i (AvonPark) */
        { aac_rx_init, "aacraid",  "ADAPTEC ", "ASR-4000SAS     ", 1 }, /* ASR-4000SAS (BlackBird & AvonPark) */
        { aac_rx_init, "aacraid",  "ADAPTEC ", "ASR-4800SAS     ", 1 }, /* ASR-4800SAS (Marauder-X) */
        { aac_rx_init, "aacraid",  "ADAPTEC ", "ASR-4805SAS     ", 1 }, /* ASR-4805SAS (Marauder-E) */
+       { aac_rx_init, "aacraid",  "ADAPTEC ", "ASR-4810SAS     ", 1 }, /* ASR-4810SAS (Hurricane) */
 
        { aac_rx_init, "percraid", "DELL    ", "PERC 320/DC     ", 2, AAC_QUIRK_31BIT | AAC_QUIRK_34SG }, /* Perc 320/DC*/
        { aac_sa_init, "aacraid",  "ADAPTEC ", "Adaptec 5400S   ", 4, AAC_QUIRK_34SG }, /* Adaptec 5400S (Mustang)*/
@@ -681,7 +701,7 @@ static struct scsi_host_template aac_driver_template = {
        .slave_configure                = aac_slave_configure,
        .eh_host_reset_handler          = aac_eh_reset,
        .can_queue                      = AAC_NUM_IO_FIB,       
-       .this_id                        = 16,
+       .this_id                        = MAXIMUM_NUM_CONTAINERS,
        .sg_tablesize                   = 16,
        .max_sectors                    = 128,
 #if (AAC_NUM_IO_FIB > 256)
@@ -760,6 +780,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
                if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL))
                        goto out_free_fibs;
 
+       aac->maximum_num_channels = aac_drivers[index].channels;
        aac_get_adapter_info(aac);
 
        /*
@@ -786,7 +807,7 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
         * physical channels are address by their actual physical number+1
         */
        if (aac->nondasd_support == 1)
-               shost->max_channel = aac_drivers[index].channels+1;
+               shost->max_channel = aac->maximum_num_channels + 1;
        else
                shost->max_channel = 1;
 
@@ -795,6 +816,8 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
        list_add(&aac->entry, insert);
 
        shost->max_id = aac->maximum_num_containers;
+       if (shost->max_id < aac->maximum_num_physicals)
+               shost->max_id = aac->maximum_num_physicals;
        if (shost->max_id < MAXIMUM_NUM_CONTAINERS)
                shost->max_id = MAXIMUM_NUM_CONTAINERS;
        else
index 04cb5c405a2db94a232f7621c2e09f1f5599cd14..0fb93363eb2236ba53f701972d317a23b334e97b 100644 (file)
@@ -4556,8 +4556,6 @@ advansys_detect(struct scsi_host_template *tpnt)
                 continue;
             }
 
-           scsi_set_device(shp, dev);
-
             /* Save a pointer to the Scsi_Host of each board found. */
             asc_host[asc_board_count++] = shp;
 
@@ -9194,8 +9192,8 @@ asc_prt_scsi_cmnd(struct scsi_cmnd *s)
         s->sc_data_direction, s->resid);
 
     printk(
-" use_sg %u, sglist_len %u, abort_reason 0x%x\n",
-        s->use_sg, s->sglist_len, s->abort_reason);
+" use_sg %u, sglist_len %u\n",
+        s->use_sg, s->sglist_len);
 
     printk(
 " serial_number 0x%x, retries %d, allowed %d\n",
index 92703bb35982224cc48252edf1969db29b4d79cd..00f3bd1e181e7bba9514583f4b2e45b8ab752a03 100644 (file)
@@ -254,19 +254,12 @@ aic7770_config(struct ahc_softc *ahc, struct aic7770_identity *entry, u_int io)
        if (error != 0)
                return (error);
 
-       ahc_list_lock(&l);
-       /*
-        * Link this softc in with all other ahc instances.
-        */
-       ahc_softc_insert(ahc);
+       ahc->init_level++;
 
        /*
         * Enable the board's BUS drivers
         */
        ahc_outb(ahc, BCTL, ENABLE);
-
-       ahc_list_unlock(&l);
-
        return (0);
 }
 
index d4ed5e9f830a29d8ec72bd442f2fe710552ef309..70c5fb59c9ea4c07c4ec6fa04eacaeb6028907a4 100644 (file)
@@ -102,8 +102,7 @@ aic7770_probe(struct device *dev)
 
        dev_set_drvdata(dev, ahc);
 
-       if (aic7xxx_detect_complete)
-               error = ahc_linux_register_host(ahc, &aic7xxx_driver_template);
+       error = ahc_linux_register_host(ahc, &aic7xxx_driver_template);
        return (error);
 }
 
index 5f526dd0aaa1e1b2b8450109e9962ea6ead776da..6466a184a1416b0e80261ab37c7776351964304b 100644 (file)
@@ -1553,7 +1553,7 @@ ahd_linux_dev_reset(Scsi_Cmnd *cmd)
        ahd_queue_scb(ahd, scb);
 
        scb->platform_data->flags |= AHD_SCB_UP_EH_SEM;
-       spin_unlock_irq(&ahd->platform_data->spin_lock);
+       ahd_unlock(ahd, &s);
        init_timer(&timer);
        timer.data = (u_long)scb;
        timer.expires = jiffies + (5 * HZ);
@@ -1567,7 +1567,7 @@ ahd_linux_dev_reset(Scsi_Cmnd *cmd)
                printf("Timer Expired\n");
                retval = FAILED;
        }
-       spin_lock_irq(&ahd->platform_data->spin_lock);
+       ahd_lock(ahd, &s);
        ahd_schedule_runq(ahd);
        ahd_linux_run_complete_queue(ahd);
        ahd_unlock(ahd, &s);
index 0948d50ae75c5661353de44e560390b957ec930d..088cbc23743d56070c47e0e8c828b690bd83c2a0 100644 (file)
@@ -1023,9 +1023,6 @@ struct ahc_softc {
        struct cs                *critical_sections;
        u_int                     num_critical_sections;
 
-       /* Links for chaining softcs */
-       TAILQ_ENTRY(ahc_softc)    links;
-
        /* Channel Names ('A', 'B', etc.) */
        char                      channel;
        char                      channel_b;
@@ -1110,9 +1107,6 @@ struct ahc_softc {
        uint16_t                  user_tagenable;/* Tagged Queuing allowed */
 };
 
-TAILQ_HEAD(ahc_softc_tailq, ahc_softc);
-extern struct ahc_softc_tailq ahc_tailq;
-
 /************************ Active Device Information ***************************/
 typedef enum {
        ROLE_UNKNOWN,
@@ -1198,7 +1192,6 @@ void                       ahc_intr_enable(struct ahc_softc *ahc, int enable);
 void                    ahc_pause_and_flushwork(struct ahc_softc *ahc);
 int                     ahc_suspend(struct ahc_softc *ahc); 
 int                     ahc_resume(struct ahc_softc *ahc);
-void                    ahc_softc_insert(struct ahc_softc *);
 void                    ahc_set_unit(struct ahc_softc *, int);
 void                    ahc_set_name(struct ahc_softc *, char *);
 void                    ahc_alloc_scbs(struct ahc_softc *ahc);
index 8a2bb6f8d77b003396b4ac3721d24c9fa0717723..7bc01e41bcce79a070348e5ab1138db5154384ef 100644 (file)
@@ -52,9 +52,6 @@
 #include <dev/aic7xxx/aicasm/aicasm_insformat.h>
 #endif
 
-/****************************** Softc Data ************************************/
-struct ahc_softc_tailq ahc_tailq = TAILQ_HEAD_INITIALIZER(ahc_tailq);
-
 /***************************** Lookup Tables **********************************/
 char *ahc_chip_names[] =
 {
@@ -3878,62 +3875,6 @@ ahc_softc_init(struct ahc_softc *ahc)
        return (0);
 }
 
-void
-ahc_softc_insert(struct ahc_softc *ahc)
-{
-       struct ahc_softc *list_ahc;
-
-#if AHC_PCI_CONFIG > 0
-       /*
-        * Second Function PCI devices need to inherit some
-        * settings from function 0.
-        */
-       if ((ahc->chip & AHC_BUS_MASK) == AHC_PCI
-        && (ahc->features & AHC_MULTI_FUNC) != 0) {
-               TAILQ_FOREACH(list_ahc, &ahc_tailq, links) {
-                       ahc_dev_softc_t list_pci;
-                       ahc_dev_softc_t pci;
-
-                       list_pci = list_ahc->dev_softc;
-                       pci = ahc->dev_softc;
-                       if (ahc_get_pci_slot(list_pci) == ahc_get_pci_slot(pci)
-                        && ahc_get_pci_bus(list_pci) == ahc_get_pci_bus(pci)) {
-                               struct ahc_softc *master;
-                               struct ahc_softc *slave;
-
-                               if (ahc_get_pci_function(list_pci) == 0) {
-                                       master = list_ahc;
-                                       slave = ahc;
-                               } else {
-                                       master = ahc;
-                                       slave = list_ahc;
-                               }
-                               slave->flags &= ~AHC_BIOS_ENABLED; 
-                               slave->flags |=
-                                   master->flags & AHC_BIOS_ENABLED;
-                               slave->flags &= ~AHC_PRIMARY_CHANNEL; 
-                               slave->flags |=
-                                   master->flags & AHC_PRIMARY_CHANNEL;
-                               break;
-                       }
-               }
-       }
-#endif
-
-       /*
-        * Insertion sort into our list of softcs.
-        */
-       list_ahc = TAILQ_FIRST(&ahc_tailq);
-       while (list_ahc != NULL
-           && ahc_softc_comp(ahc, list_ahc) <= 0)
-               list_ahc = TAILQ_NEXT(list_ahc, links);
-       if (list_ahc != NULL)
-               TAILQ_INSERT_BEFORE(list_ahc, ahc, links);
-       else
-               TAILQ_INSERT_TAIL(&ahc_tailq, ahc, links);
-       ahc->init_level++;
-}
-
 void
 ahc_set_unit(struct ahc_softc *ahc, int unit)
 {
index b89094db14c1774bddda35ccdbac8eaaf20fe148..116d0f51ca2cae984bc50d09c0d13931f6cbcebf 100644 (file)
@@ -136,10 +136,6 @@ static struct scsi_transport_template *ahc_linux_transport_template = NULL;
 #include <linux/blkdev.h>              /* For block_size() */
 #include <linux/delay.h>       /* For ssleep/msleep */
 
-/*
- * Lock protecting manipulation of the ahc softc list.
- */
-spinlock_t ahc_list_spinlock;
 
 /*
  * Set this to the delay in seconds after SCSI bus reset.
@@ -291,25 +287,6 @@ ahc_print_path(struct ahc_softc *ahc, struct scb *scb)
  */
 static uint32_t aic7xxx_no_reset;
 
-/*
- * Certain PCI motherboards will scan PCI devices from highest to lowest,
- * others scan from lowest to highest, and they tend to do all kinds of
- * strange things when they come into contact with PCI bridge chips.  The
- * net result of all this is that the PCI card that is actually used to boot
- * the machine is very hard to detect.  Most motherboards go from lowest
- * PCI slot number to highest, and the first SCSI controller found is the
- * one you boot from.  The only exceptions to this are when a controller
- * has its BIOS disabled.  So, we by default sort all of our SCSI controllers
- * from lowest PCI slot number to highest PCI slot number.  We also force
- * all controllers with their BIOS disabled to the end of the list.  This
- * works on *almost* all computers.  Where it doesn't work, we have this
- * option.  Setting this option to non-0 will reverse the order of the sort
- * to highest first, then lowest, but will still leave cards with their BIOS
- * disabled at the very end.  That should fix everyone up unless there are
- * really strange cirumstances.
- */
-static uint32_t aic7xxx_reverse_scan;
-
 /*
  * Should we force EXTENDED translation on a controller.
  *     0 == Use whatever is in the SEEPROM or default to off
@@ -337,13 +314,6 @@ static uint32_t aic7xxx_pci_parity = ~0;
  */
 uint32_t aic7xxx_allow_memio = ~0;
 
-/*
- * aic7xxx_detect() has been run, so register all device arrivals
- * immediately with the system rather than deferring to the sorted
- * attachment performed by aic7xxx_detect().
- */
-int aic7xxx_detect_complete;
-
 /*
  * So that we can set how long each device is given as a selection timeout.
  * The table of values goes like this:
@@ -423,7 +393,9 @@ static int ahc_linux_run_command(struct ahc_softc*,
 static void ahc_linux_setup_tag_info_global(char *p);
 static aic_option_callback_t ahc_linux_setup_tag_info;
 static int  aic7xxx_setup(char *s);
-static int  ahc_linux_next_unit(void);
+
+static int ahc_linux_unit;
+
 
 /********************************* Inlines ************************************/
 static __inline void ahc_linux_unmap_scb(struct ahc_softc*, struct scb*);
@@ -475,48 +447,6 @@ ahc_linux_map_seg(struct ahc_softc *ahc, struct scb *scb,
        return (consumed);
 }
 
-/*
- * Try to detect an Adaptec 7XXX controller.
- */
-static int
-ahc_linux_detect(struct scsi_host_template *template)
-{
-       struct  ahc_softc *ahc;
-       int     found = 0;
-
-       /*
-        * If we've been passed any parameters, process them now.
-        */
-       if (aic7xxx)
-               aic7xxx_setup(aic7xxx);
-
-       template->proc_name = "aic7xxx";
-
-       /*
-        * Initialize our softc list lock prior to
-        * probing for any adapters.
-        */
-       ahc_list_lockinit();
-
-       found = ahc_linux_pci_init();
-       if (!ahc_linux_eisa_init())
-               found++;
-       
-       /*
-        * Register with the SCSI layer all
-        * controllers we've found.
-        */
-       TAILQ_FOREACH(ahc, &ahc_tailq, links) {
-
-               if (ahc_linux_register_host(ahc, template) == 0)
-                       found++;
-       }
-
-       aic7xxx_detect_complete++;
-
-       return (found);
-}
-
 /*
  * Return a string describing the driver.
  */
@@ -848,6 +778,7 @@ ahc_linux_bus_reset(struct scsi_cmnd *cmd)
 struct scsi_host_template aic7xxx_driver_template = {
        .module                 = THIS_MODULE,
        .name                   = "aic7xxx",
+       .proc_name              = "aic7xxx",
        .proc_info              = ahc_linux_proc_info,
        .info                   = ahc_linux_info,
        .queuecommand           = ahc_linux_queue,
@@ -959,99 +890,6 @@ ahc_dmamap_unload(struct ahc_softc *ahc, bus_dma_tag_t dmat, bus_dmamap_t map)
        return (0);
 }
 
-/********************* Platform Dependent Functions ***************************/
-/*
- * Compare "left hand" softc with "right hand" softc, returning:
- * < 0 - lahc has a lower priority than rahc
- *   0 - Softcs are equal
- * > 0 - lahc has a higher priority than rahc
- */
-int
-ahc_softc_comp(struct ahc_softc *lahc, struct ahc_softc *rahc)
-{
-       int     value;
-       int     rvalue;
-       int     lvalue;
-
-       /*
-        * Under Linux, cards are ordered as follows:
-        *      1) VLB/EISA BIOS enabled devices sorted by BIOS address.
-        *      2) PCI devices with BIOS enabled sorted by bus/slot/func.
-        *      3) All remaining VLB/EISA devices sorted by ioport.
-        *      4) All remaining PCI devices sorted by bus/slot/func.
-        */
-       value = (lahc->flags & AHC_BIOS_ENABLED)
-             - (rahc->flags & AHC_BIOS_ENABLED);
-       if (value != 0)
-               /* Controllers with BIOS enabled have a *higher* priority */
-               return (value);
-
-       /*
-        * Same BIOS setting, now sort based on bus type.
-        * EISA and VL controllers sort together.  EISA/VL
-        * have higher priority than PCI.
-        */
-       rvalue = (rahc->chip & AHC_BUS_MASK);
-       if (rvalue == AHC_VL)
-               rvalue = AHC_EISA;
-       lvalue = (lahc->chip & AHC_BUS_MASK);
-       if (lvalue == AHC_VL)
-               lvalue = AHC_EISA;
-       value = rvalue - lvalue;
-       if (value != 0)
-               return (value);
-
-       /* Still equal.  Sort by BIOS address, ioport, or bus/slot/func. */
-       switch (rvalue) {
-#ifdef CONFIG_PCI
-       case AHC_PCI:
-       {
-               char primary_channel;
-
-               if (aic7xxx_reverse_scan != 0)
-                       value = ahc_get_pci_bus(lahc->dev_softc)
-                             - ahc_get_pci_bus(rahc->dev_softc);
-               else
-                       value = ahc_get_pci_bus(rahc->dev_softc)
-                             - ahc_get_pci_bus(lahc->dev_softc);
-               if (value != 0)
-                       break;
-               if (aic7xxx_reverse_scan != 0)
-                       value = ahc_get_pci_slot(lahc->dev_softc)
-                             - ahc_get_pci_slot(rahc->dev_softc);
-               else
-                       value = ahc_get_pci_slot(rahc->dev_softc)
-                             - ahc_get_pci_slot(lahc->dev_softc);
-               if (value != 0)
-                       break;
-               /*
-                * On multi-function devices, the user can choose
-                * to have function 1 probed before function 0.
-                * Give whichever channel is the primary channel
-                * the highest priority.
-                */
-               primary_channel = (lahc->flags & AHC_PRIMARY_CHANNEL) + 'A';
-               value = -1;
-               if (lahc->channel == primary_channel)
-                       value = 1;
-               break;
-       }
-#endif
-       case AHC_EISA:
-               if ((rahc->flags & AHC_BIOS_ENABLED) != 0) {
-                       value = rahc->platform_data->bios_address
-                             - lahc->platform_data->bios_address; 
-               } else {
-                       value = rahc->bsh.ioport
-                             - lahc->bsh.ioport; 
-               }
-               break;
-       default:
-               panic("ahc_softc_sort: invalid bus type");
-       }
-       return (value);
-}
-
 static void
 ahc_linux_setup_tag_info_global(char *p)
 {
@@ -1103,7 +941,6 @@ aic7xxx_setup(char *s)
 #ifdef AHC_DEBUG
                { "debug", &ahc_debug },
 #endif
-               { "reverse_scan", &aic7xxx_reverse_scan },
                { "periodic_otag", &aic7xxx_periodic_otag },
                { "pci_parity", &aic7xxx_pci_parity },
                { "seltime", &aic7xxx_seltime },
@@ -1178,7 +1015,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa
        host->max_lun = AHC_NUM_LUNS;
        host->max_channel = (ahc->features & AHC_TWIN) ? 1 : 0;
        host->sg_tablesize = AHC_NSEG;
-       ahc_set_unit(ahc, ahc_linux_next_unit());
+       ahc_set_unit(ahc, ahc_linux_unit++);
        sprintf(buf, "scsi%d", host->host_no);
        new_name = malloc(strlen(buf) + 1, M_DEVBUF, M_NOWAIT);
        if (new_name != NULL) {
@@ -1206,29 +1043,6 @@ ahc_linux_get_memsize(void)
        return ((uint64_t)si.totalram << PAGE_SHIFT);
 }
 
-/*
- * Find the smallest available unit number to use
- * for a new device.  We don't just use a static
- * count to handle the "repeated hot-(un)plug"
- * scenario.
- */
-static int
-ahc_linux_next_unit(void)
-{
-       struct ahc_softc *ahc;
-       int unit;
-
-       unit = 0;
-retry:
-       TAILQ_FOREACH(ahc, &ahc_tailq, links) {
-               if (ahc->unit == unit) {
-                       unit++;
-                       goto retry;
-               }
-       }
-       return (unit);
-}
-
 /*
  * Place the SCSI bus into a known state by either resetting it,
  * or forcing transfer negotiations on the next command to any
@@ -2633,6 +2447,11 @@ static void ahc_linux_set_dt(struct scsi_target *starget, int dt)
        ahc_unlock(ahc, &flags);
 }
 
+#if 0
+/* FIXME: This code claims to support IU and QAS.  However, the actual
+ * sequencer code and aic7xxx_core have no support for these parameters and
+ * will get into a bad state if they're negotiated.  Do not enable this
+ * unless you know what you're doing */
 static void ahc_linux_set_qas(struct scsi_target *starget, int qas)
 {
        struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
@@ -2688,6 +2507,7 @@ static void ahc_linux_set_iu(struct scsi_target *starget, int iu)
                         ppr_options, AHC_TRANS_GOAL, FALSE);
        ahc_unlock(ahc, &flags);
 }
+#endif
 
 static struct spi_function_template ahc_linux_transport_functions = {
        .set_offset     = ahc_linux_set_offset,
@@ -2698,10 +2518,12 @@ static struct spi_function_template ahc_linux_transport_functions = {
        .show_width     = 1,
        .set_dt         = ahc_linux_set_dt,
        .show_dt        = 1,
+#if 0
        .set_iu         = ahc_linux_set_iu,
        .show_iu        = 1,
        .set_qas        = ahc_linux_set_qas,
        .show_qas       = 1,
+#endif
 };
 
 
@@ -2709,18 +2531,25 @@ static struct spi_function_template ahc_linux_transport_functions = {
 static int __init
 ahc_linux_init(void)
 {
-       ahc_linux_transport_template = spi_attach_transport(&ahc_linux_transport_functions);
+       /*
+        * If we've been passed any parameters, process them now.
+        */
+       if (aic7xxx)
+               aic7xxx_setup(aic7xxx);
+
+       ahc_linux_transport_template =
+               spi_attach_transport(&ahc_linux_transport_functions);
        if (!ahc_linux_transport_template)
                return -ENODEV;
+
        scsi_transport_reserve_target(ahc_linux_transport_template,
                                      sizeof(struct ahc_linux_target));
        scsi_transport_reserve_device(ahc_linux_transport_template,
                                      sizeof(struct ahc_linux_device));
-       if (ahc_linux_detect(&aic7xxx_driver_template))
-               return 0;
-       spi_release_transport(ahc_linux_transport_template);
-       ahc_linux_exit();
-       return -ENODEV;
+
+       ahc_linux_pci_init();
+       ahc_linux_eisa_init();
+       return 0;
 }
 
 static void
index 8ffe2d3e1d95420198f6e80c4ba8e03e2bd6b13b..0e47ac21754954132612b8c3d2bd41a840b21a46 100644 (file)
@@ -132,7 +132,6 @@ typedef struct scsi_cmnd      *ahc_io_ctx_t;
 /************************* Configuration Data *********************************/
 extern u_int aic7xxx_no_probe;
 extern u_int aic7xxx_allow_memio;
-extern int aic7xxx_detect_complete;
 extern struct scsi_host_template aic7xxx_driver_template;
 
 /***************************** Bus Space/DMA **********************************/
@@ -510,15 +509,6 @@ void       ahc_format_transinfo(struct info_str *info,
 
 /******************************** Locking *************************************/
 /* Lock protecting internal data structures */
-static __inline void ahc_lockinit(struct ahc_softc *);
-static __inline void ahc_lock(struct ahc_softc *, unsigned long *flags);
-static __inline void ahc_unlock(struct ahc_softc *, unsigned long *flags);
-
-/* Lock held during ahc_list manipulation and ahc softc frees */
-extern spinlock_t ahc_list_spinlock;
-static __inline void ahc_list_lockinit(void);
-static __inline void ahc_list_lock(unsigned long *flags);
-static __inline void ahc_list_unlock(unsigned long *flags);
 
 static __inline void
 ahc_lockinit(struct ahc_softc *ahc)
@@ -538,24 +528,6 @@ ahc_unlock(struct ahc_softc *ahc, unsigned long *flags)
        spin_unlock_irqrestore(&ahc->platform_data->spin_lock, *flags);
 }
 
-static __inline void
-ahc_list_lockinit(void)
-{
-       spin_lock_init(&ahc_list_spinlock);
-}
-
-static __inline void
-ahc_list_lock(unsigned long *flags)
-{
-       spin_lock_irqsave(&ahc_list_spinlock, *flags);
-}
-
-static __inline void
-ahc_list_unlock(unsigned long *flags)
-{
-       spin_unlock_irqrestore(&ahc_list_spinlock, *flags);
-}
-
 /******************************* PCI Definitions ******************************/
 /*
  * PCIM_xxx: mask to locate subfield in register
@@ -892,7 +864,6 @@ int ahc_platform_abort_scbs(struct ahc_softc *ahc, int target,
 irqreturn_t
        ahc_linux_isr(int irq, void *dev_id, struct pt_regs * regs);
 void   ahc_platform_flushwork(struct ahc_softc *ahc);
-int    ahc_softc_comp(struct ahc_softc *, struct ahc_softc *);
 void   ahc_done(struct ahc_softc*, struct scb*);
 void   ahc_send_async(struct ahc_softc *, char channel,
                       u_int target, u_int lun, ac_code, void *);
index 89d737ee551a71c978f9670fdd58a096c9f0c6ae..9d318ce2c993189412982d5dea1ffea994fe5ccc 100644 (file)
@@ -143,10 +143,6 @@ ahc_linux_pci_dev_remove(struct pci_dev *pdev)
        struct ahc_softc *ahc = pci_get_drvdata(pdev);
        u_long s;
 
-       ahc_list_lock(&s);
-       TAILQ_REMOVE(&ahc_tailq, ahc, links);
-       ahc_list_unlock(&s);
-
        ahc_lock(ahc, &s);
        ahc_intr_enable(ahc, FALSE);
        ahc_unlock(ahc, &s);
@@ -208,8 +204,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
                return (-error);
        }
        pci_set_drvdata(pdev, ahc);
-       if (aic7xxx_detect_complete)
-               ahc_linux_register_host(ahc, &aic7xxx_driver_template);
+       ahc_linux_register_host(ahc, &aic7xxx_driver_template);
        return (0);
 }
 
index 7ddcc97fb243f7f8dad248c998a02971d2206b57..b3b2e2237eb39dc9d930b6633ea7b9d5790c4bfb 100644 (file)
@@ -704,7 +704,6 @@ ahc_find_pci_device(ahc_dev_softc_t pci)
 int
 ahc_pci_config(struct ahc_softc *ahc, struct ahc_pci_identity *entry)
 {
-       u_long   l;
        u_int    command;
        u_int    our_id;
        u_int    sxfrctl1;
@@ -964,12 +963,7 @@ ahc_pci_config(struct ahc_softc *ahc, struct ahc_pci_identity *entry)
        if (error != 0)
                return (error);
 
-       ahc_list_lock(&l);
-       /*
-        * Link this softc in with all other ahc instances.
-        */
-       ahc_softc_insert(ahc);
-       ahc_list_unlock(&l);
+       ahc->init_level++;
        return (0);
 }
 
index ab4469d83fb1d95fee4f5e06fa87dcfa39491f12..3802c91f0b07489a2dc3b04a01e9963880abaed8 100644 (file)
@@ -155,9 +155,9 @@ ahc_dump_target_state(struct ahc_softc *ahc, struct info_str *info,
        copy_info(info, "\tUser: ");
        ahc_format_transinfo(info, &tinfo->user);
        starget = ahc->platform_data->starget[target_offset];
-       targ = scsi_transport_target_data(starget);
-       if (targ == NULL)
+       if (!starget)
                return;
+       targ = scsi_transport_target_data(starget);
 
        copy_info(info, "\tGoal: ");
        ahc_format_transinfo(info, &tinfo->goal);
index fac091e7093c2e490d789704eaa9afdf6cf583ba..52b72d7794f51aeadc11df93a1a53aed02f1b478 100644 (file)
@@ -8448,7 +8448,6 @@ aic7xxx_alloc(Scsi_Host_Template *sht, struct aic7xxx_host *temp)
     }
     p->host_no = host->host_no;
   }
-  scsi_set_device(host, &p->pdev->dev);
   return (p);
 }
 
index 5674ada6d5c249ca58fb1d39ffba9355171d1b18..d72be0ce89c84534911026dce7879659045bd619 100644 (file)
@@ -336,7 +336,6 @@ int cpqfcTS_detect(Scsi_Host_Template *ScsiHostTemplate)
       DEBUG_PCI(printk("  PciDev->baseaddress[3]= %lx\n", 
                                PciDev->resource[3].start));
 
-      scsi_set_device(HostAdapter, &PciDev->dev);
       HostAdapter->irq = PciDev->irq;  // copy for Scsi layers
       
       // HP Tachlite uses two (255-byte) ranges of Port I/O (lower & upper),
index bbe346bd3cb8f476e8f012abd7e5e6f7a3e2f41f..e2370529c63293595e894603c3bdd7aab2dce1b1 100644 (file)
@@ -382,7 +382,6 @@ static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *))
 {
        adpt_hba* pHba = NULL;
        struct adpt_device* pDev = NULL;        /* dpt per device information */
-       ulong timeout = jiffies + (TMOUT_SCSI*HZ);
 
        cmd->scsi_done = done;
        /*
@@ -418,11 +417,6 @@ static int adpt_queue(struct scsi_cmnd * cmd, void (*done) (struct scsi_cmnd *))
                return 1;
        }
 
-       if(cmd->eh_state != SCSI_STATE_QUEUED){
-               // If we are not doing error recovery
-               mod_timer(&cmd->eh_timeout, timeout);
-       }
-
        // TODO if the cmd->device if offline then I may need to issue a bus rescan
        // followed by a get_lct to see if the device is there anymore
        if((pDev = (struct adpt_device*) (cmd->device->hostdata)) == NULL) {
index 1bb8727eea3e5a2a2a7984bc7922451127c93426..c10e45b94b6269bd8d70bfdecf6519ffe4fff9c1 100644 (file)
@@ -1899,16 +1899,6 @@ static int eata2x_eh_abort(struct scsi_cmnd *SCarg)
                        printk("%s: abort, mbox %d, interrupt pending.\n",
                               ha->board_name, i);
 
-               if (SCarg->eh_state == SCSI_STATE_TIMEOUT) {
-                       unmap_dma(i, ha);
-                       SCarg->host_scribble = NULL;
-                       ha->cp_stat[i] = FREE;
-                       printk
-                           ("%s, abort, mbox %d, eh_state timeout, pid %ld.\n",
-                            ha->board_name, i, SCarg->pid);
-                       return SUCCESS;
-               }
-
                return FAILED;
        }