From 089a3660c94d7dadc3c41759e05d087b844db5cf Mon Sep 17 00:00:00 2001 From: Mattia Dongili Date: Mon, 16 Jul 2007 02:34:33 +0900 Subject: [PATCH] --- yaml --- r: 62534 b: refs/heads/master c: 044847e02d46c0a9430e19249fd68777bb1d3c98 h: refs/heads/master v: v3 --- [refs] | 2 +- .../feature-removal-schedule.txt | 21 +- trunk/MAINTAINERS | 6 +- trunk/arch/i386/kernel/acpi/boot.c | 8 + .../i386/kernel/cpu/cpufreq/acpi-cpufreq.c | 4 +- trunk/arch/sparc/kernel/entry.S | 14 +- trunk/arch/sparc/kernel/irq.c | 27 +- trunk/arch/sparc/kernel/irq.h | 68 -- trunk/arch/sparc/kernel/pcic.c | 1 - trunk/arch/sparc/kernel/smp.c | 2 - trunk/arch/sparc/kernel/sparc_ksyms.c | 2 + trunk/arch/sparc/kernel/sun4c_irq.c | 15 - trunk/arch/sparc/kernel/sun4d_irq.c | 6 +- trunk/arch/sparc/kernel/sun4d_smp.c | 1 - trunk/arch/sparc/kernel/sun4m_irq.c | 74 -- trunk/arch/sparc/kernel/sun4m_smp.c | 2 - trunk/arch/sparc/kernel/tick14.c | 6 +- trunk/arch/sparc/kernel/time.c | 2 - trunk/arch/sparc/mm/init.c | 3 - trunk/arch/sparc/mm/srmmu.c | 2 +- trunk/arch/sparc/mm/sun4c.c | 2 +- trunk/arch/sparc64/kernel/sparc64_ksyms.c | 1 - trunk/drivers/acpi/Kconfig | 21 +- trunk/drivers/acpi/battery.c | 673 ++++++------------ trunk/drivers/acpi/bay.c | 19 +- trunk/drivers/acpi/dock.c | 127 +--- trunk/drivers/acpi/ec.c | 247 +++---- trunk/drivers/acpi/events/evgpeblk.c | 4 - trunk/drivers/acpi/events/evrgnini.c | 1 - trunk/drivers/acpi/glue.c | 2 +- trunk/drivers/acpi/pci_link.c | 2 +- trunk/drivers/acpi/processor_idle.c | 20 +- trunk/drivers/acpi/sbs.c | 33 +- trunk/drivers/acpi/sleep/main.c | 5 + trunk/drivers/acpi/tables/tbfadt.c | 44 +- trunk/drivers/misc/sony-laptop.c | 14 + trunk/drivers/net/Kconfig | 1 - trunk/drivers/net/irda/Kconfig | 11 +- trunk/drivers/net/irda/Makefile | 1 - trunk/drivers/net/irda/ep7211-sir.c | 89 --- trunk/include/acpi/acmacros.h | 63 +- trunk/include/acpi/acoutput.h | 4 +- trunk/include/acpi/platform/acenv.h | 2 +- trunk/include/acpi/platform/aclinux.h | 3 - trunk/include/asm-sparc/irq.h | 168 ++++- trunk/include/asm-sparc/pgtable.h | 3 +- trunk/include/linux/irda.h | 1 - trunk/include/linux/netdevice.h | 2 +- trunk/net/core/dev.c | 4 +- trunk/net/core/sock.c | 3 +- trunk/net/ipv4/inetpeer.c | 4 +- trunk/net/ipv6/ip6_tunnel.c | 4 +- trunk/net/irda/irnetlink.c | 2 +- 53 files changed, 703 insertions(+), 1143 deletions(-) delete mode 100644 trunk/arch/sparc/kernel/irq.h delete mode 100644 trunk/drivers/net/irda/ep7211-sir.c diff --git a/[refs] b/[refs] index f95020237b30..01500e6a79f8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f79e3185dd0f8650022518d7624c876d8929061b +refs/heads/master: 044847e02d46c0a9430e19249fd68777bb1d3c98 diff --git a/trunk/Documentation/feature-removal-schedule.txt b/trunk/Documentation/feature-removal-schedule.txt index c175eedadb5f..a5cb7839a679 100644 --- a/trunk/Documentation/feature-removal-schedule.txt +++ b/trunk/Documentation/feature-removal-schedule.txt @@ -180,11 +180,24 @@ Who: Adrian Bunk --------------------------- +What: /sys/firmware/acpi/namespace +When: 2.6.21 +Why: The ACPI namespace is effectively the symbol list for + the BIOS. The device names are completely arbitrary + and have no place being exposed to user-space. + + For those interested in the BIOS ACPI namespace, + the BIOS can be extracted and disassembled with acpidump + and iasl as documented in the pmtools package here: + http://ftp.kernel.org/pub/linux/kernel/people/lenb/acpi/utils +Who: Len Brown + +--------------------------- + What: ACPI procfs interface -When: July 2008 -Why: ACPI sysfs conversion should be finished by January 2008. - ACPI procfs interface will be removed in July 2008 so that - there is enough time for the user space to catch up. +When: July 2007 +Why: After ACPI sysfs conversion, ACPI attributes will be duplicated + in sysfs and the ACPI procfs interface should be removed. Who: Zhang Rui --------------------------- diff --git a/trunk/MAINTAINERS b/trunk/MAINTAINERS index a9b9ef614ae7..773c732b4177 100644 --- a/trunk/MAINTAINERS +++ b/trunk/MAINTAINERS @@ -225,15 +225,15 @@ T: git kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git S: Supported ACPI BATTERY DRIVERS -P: Alexey Starikovskiy -M: astarikovskiy@suse.de +P: Vladimir P. Lebedev +M: vladimir.p.lebedev@intel.com L: linux-acpi@vger.kernel.org W: http://acpi.sourceforge.net/ S: Supported ACPI EC DRIVER P: Alexey Starikovskiy -M: astarikovskiy@suse.de +M: alexey.y.starikovskiy@linux.intel.com L: linux-acpi@vger.kernel.org W: http://acpi.sourceforge.net/ S: Supported diff --git a/trunk/arch/i386/kernel/acpi/boot.c b/trunk/arch/i386/kernel/acpi/boot.c index cacdd883bf2b..b87cedeaf59b 100644 --- a/trunk/arch/i386/kernel/acpi/boot.c +++ b/trunk/arch/i386/kernel/acpi/boot.c @@ -984,6 +984,14 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "PRIMERGY T850"), }, }, + { + .callback = force_acpi_ht, + .ident = "DELL GX240", + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Dell Computer Corporation"), + DMI_MATCH(DMI_BOARD_NAME, "OptiPlex GX240"), + }, + }, { .callback = force_acpi_ht, .ident = "HP VISUALIZE NT Workstation", diff --git a/trunk/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c b/trunk/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c index 6f846bee2103..18c8b67ea3a7 100644 --- a/trunk/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c +++ b/trunk/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c @@ -665,8 +665,8 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) data->max_freq = perf->states[0].core_frequency * 1000; /* table init */ for (i=0; istate_count; i++) { - if (i>0 && perf->states[i].core_frequency >= - data->freq_table[valid_states-1].frequency / 1000) + if (i>0 && perf->states[i].core_frequency == + perf->states[i-1].core_frequency) continue; data->freq_table[valid_states].index = i; diff --git a/trunk/arch/sparc/kernel/entry.S b/trunk/arch/sparc/kernel/entry.S index eac38388f5fd..831f540251f8 100644 --- a/trunk/arch/sparc/kernel/entry.S +++ b/trunk/arch/sparc/kernel/entry.S @@ -1749,8 +1749,8 @@ fpload: __ndelay: save %sp, -STACKFRAME_SZ, %sp mov %i0, %o0 - call .umul ! round multiplier up so large ns ok - mov 0x1ae, %o1 ! 2**32 / (1 000 000 000 / HZ) + call .umul + mov 0x1ad, %o1 ! 2**32 / (1 000 000 000 / HZ) call .umul mov %i1, %o1 ! udelay_val ba delay_continue @@ -1760,17 +1760,11 @@ __ndelay: __udelay: save %sp, -STACKFRAME_SZ, %sp mov %i0, %o0 - sethi %hi(0x10c7), %o1 ! round multiplier up so large us ok + sethi %hi(0x10c6), %o1 call .umul - or %o1, %lo(0x10c7), %o1 ! 2**32 / 1 000 000 + or %o1, %lo(0x10c6), %o1 ! 2**32 / 1 000 000 call .umul mov %i1, %o1 ! udelay_val - sethi %hi(0x028f4b62), %l0 ! Add in rounding constant * 2**32, - or %g0, %lo(0x028f4b62), %l0 - addcc %o0, %l0, %o0 ! 2**32 * 0.009 999 - bcs,a 3f - add %o1, 0x01, %o1 -3: call .umul mov HZ, %o0 ! >>32 earlier for wider range diff --git a/trunk/arch/sparc/kernel/irq.c b/trunk/arch/sparc/kernel/irq.c index 75b2240ad0f9..f257a67bcf93 100644 --- a/trunk/arch/sparc/kernel/irq.c +++ b/trunk/arch/sparc/kernel/irq.c @@ -47,8 +47,6 @@ #include #include -#include "irq.h" - #ifdef CONFIG_SMP #define SMP_NOP2 "nop; nop;\n\t" #define SMP_NOP3 "nop; nop; nop;\n\t" @@ -270,7 +268,7 @@ void free_irq(unsigned int irq, void *dev_id) kfree(action); if (!sparc_irq[cpu_irq].action) - __disable_irq(irq); + disable_irq(irq); out_unlock: spin_unlock_irqrestore(&irq_action_lock, flags); @@ -466,7 +464,7 @@ int request_fast_irq(unsigned int irq, sparc_irq[cpu_irq].action = action; - __enable_irq(irq); + enable_irq(irq); ret = 0; out_unlock: @@ -546,7 +544,7 @@ int request_irq(unsigned int irq, *actionp = action; - __enable_irq(irq); + enable_irq(irq); ret = 0; out_unlock: @@ -557,25 +555,6 @@ int request_irq(unsigned int irq, EXPORT_SYMBOL(request_irq); -void disable_irq_nosync(unsigned int irq) -{ - return __disable_irq(irq); -} -EXPORT_SYMBOL(disable_irq_nosync); - -void disable_irq(unsigned int irq) -{ - return __disable_irq(irq); -} -EXPORT_SYMBOL(disable_irq); - -void enable_irq(unsigned int irq) -{ - return __enable_irq(irq); -} - -EXPORT_SYMBOL(enable_irq); - /* We really don't need these at all on the Sparc. We only have * stubs here because they are exported to modules. */ diff --git a/trunk/arch/sparc/kernel/irq.h b/trunk/arch/sparc/kernel/irq.h deleted file mode 100644 index 32ef3ebd0a88..000000000000 --- a/trunk/arch/sparc/kernel/irq.h +++ /dev/null @@ -1,68 +0,0 @@ -#include - -/* Dave Redman (djhr@tadpole.co.uk) - * changed these to function pointers.. it saves cycles and will allow - * the irq dependencies to be split into different files at a later date - * sun4c_irq.c, sun4m_irq.c etc so we could reduce the kernel size. - * Jakub Jelinek (jj@sunsite.mff.cuni.cz) - * Changed these to btfixup entities... It saves cycles :) - */ - -BTFIXUPDEF_CALL(void, disable_irq, unsigned int) -BTFIXUPDEF_CALL(void, enable_irq, unsigned int) -BTFIXUPDEF_CALL(void, disable_pil_irq, unsigned int) -BTFIXUPDEF_CALL(void, enable_pil_irq, unsigned int) -BTFIXUPDEF_CALL(void, clear_clock_irq, void) -BTFIXUPDEF_CALL(void, clear_profile_irq, int) -BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int) - -static inline void __disable_irq(unsigned int irq) -{ - BTFIXUP_CALL(disable_irq)(irq); -} - -static inline void __enable_irq(unsigned int irq) -{ - BTFIXUP_CALL(enable_irq)(irq); -} - -static inline void disable_pil_irq(unsigned int irq) -{ - BTFIXUP_CALL(disable_pil_irq)(irq); -} - -static inline void enable_pil_irq(unsigned int irq) -{ - BTFIXUP_CALL(enable_pil_irq)(irq); -} - -static inline void clear_clock_irq(void) -{ - BTFIXUP_CALL(clear_clock_irq)(); -} - -static inline void clear_profile_irq(int irq) -{ - BTFIXUP_CALL(clear_profile_irq)(irq); -} - -static inline void load_profile_irq(int cpu, int limit) -{ - BTFIXUP_CALL(load_profile_irq)(cpu, limit); -} - -extern void (*sparc_init_timers)(irq_handler_t lvl10_irq); - -extern void claim_ticker14(irq_handler_t irq_handler, - int irq, - unsigned int timeout); - -#ifdef CONFIG_SMP -BTFIXUPDEF_CALL(void, set_cpu_int, int, int) -BTFIXUPDEF_CALL(void, clear_cpu_int, int, int) -BTFIXUPDEF_CALL(void, set_irq_udt, int) - -#define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level) -#define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level) -#define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) -#endif diff --git a/trunk/arch/sparc/kernel/pcic.c b/trunk/arch/sparc/kernel/pcic.c index f2eae457fc9a..791771196905 100644 --- a/trunk/arch/sparc/kernel/pcic.c +++ b/trunk/arch/sparc/kernel/pcic.c @@ -36,7 +36,6 @@ #include #include -#include "irq.h" /* * I studied different documents and many live PROMs both from 2.30 diff --git a/trunk/arch/sparc/kernel/smp.c b/trunk/arch/sparc/kernel/smp.c index 6724ab90f82b..4fea3ac7bff0 100644 --- a/trunk/arch/sparc/kernel/smp.c +++ b/trunk/arch/sparc/kernel/smp.c @@ -33,8 +33,6 @@ #include #include -#include "irq.h" - int smp_num_cpus = 1; volatile unsigned long cpu_callin_map[NR_CPUS] __initdata = {0,}; unsigned char boot_cpu_id = 0; diff --git a/trunk/arch/sparc/kernel/sparc_ksyms.c b/trunk/arch/sparc/kernel/sparc_ksyms.c index 55bac516dfe2..d8e008a04e2b 100644 --- a/trunk/arch/sparc/kernel/sparc_ksyms.c +++ b/trunk/arch/sparc/kernel/sparc_ksyms.c @@ -154,6 +154,8 @@ EXPORT_SYMBOL(BTFIXUP_CALL(___xchg32)); #else EXPORT_SYMBOL(BTFIXUP_CALL(__hard_smp_processor_id)); #endif +EXPORT_SYMBOL(BTFIXUP_CALL(enable_irq)); +EXPORT_SYMBOL(BTFIXUP_CALL(disable_irq)); EXPORT_SYMBOL(BTFIXUP_CALL(mmu_unlockarea)); EXPORT_SYMBOL(BTFIXUP_CALL(mmu_lockarea)); EXPORT_SYMBOL(BTFIXUP_CALL(mmu_get_scsi_sgl)); diff --git a/trunk/arch/sparc/kernel/sun4c_irq.c b/trunk/arch/sparc/kernel/sun4c_irq.c index c6ac9fc52563..009e891a4329 100644 --- a/trunk/arch/sparc/kernel/sun4c_irq.c +++ b/trunk/arch/sparc/kernel/sun4c_irq.c @@ -18,7 +18,6 @@ #include #include #include -#include "irq.h" #include #include @@ -41,20 +40,6 @@ static struct resource sun4c_timer_eb = { "sun4c_timer" }; static struct resource sun4c_intr_eb = { "sun4c_intr" }; #endif -/* - * Bit field defines for the interrupt registers on various - * Sparc machines. - */ - -/* The sun4c interrupt register. */ -#define SUN4C_INT_ENABLE 0x01 /* Allow interrupts. */ -#define SUN4C_INT_E14 0x80 /* Enable level 14 IRQ. */ -#define SUN4C_INT_E10 0x20 /* Enable level 10 IRQ. */ -#define SUN4C_INT_E8 0x10 /* Enable level 8 IRQ. */ -#define SUN4C_INT_E6 0x08 /* Enable level 6 IRQ. */ -#define SUN4C_INT_E4 0x04 /* Enable level 4 IRQ. */ -#define SUN4C_INT_E1 0x02 /* Enable level 1 IRQ. */ - /* Pointer to the interrupt enable byte * * Dave Redman (djhr@tadpole.co.uk) diff --git a/trunk/arch/sparc/kernel/sun4d_irq.c b/trunk/arch/sparc/kernel/sun4d_irq.c index e0efab2a6bef..396797e20c39 100644 --- a/trunk/arch/sparc/kernel/sun4d_irq.c +++ b/trunk/arch/sparc/kernel/sun4d_irq.c @@ -39,8 +39,6 @@ #include #include -#include "irq.h" - /* If you trust current SCSI layer to handle different SCSI IRQs, enable this. I don't trust it... -jj */ /* #define DISTRIBUTE_IRQS */ @@ -190,7 +188,7 @@ void sun4d_free_irq(unsigned int irq, void *dev_id) kfree(action); if (!(*actionp)) - __disable_irq(irq); + disable_irq(irq); out_unlock: spin_unlock_irqrestore(&irq_action_lock, flags); @@ -348,7 +346,7 @@ int sun4d_request_irq(unsigned int irq, else *actionp = action; - __enable_irq(irq); + enable_irq(irq); ret = 0; out_unlock: diff --git a/trunk/arch/sparc/kernel/sun4d_smp.c b/trunk/arch/sparc/kernel/sun4d_smp.c index 89a6de95070c..098c94f1a322 100644 --- a/trunk/arch/sparc/kernel/sun4d_smp.c +++ b/trunk/arch/sparc/kernel/sun4d_smp.c @@ -36,7 +36,6 @@ #include #include -#include "irq.h" #define IRQ_CROSS_CALL 15 extern ctxd_t *srmmu_ctx_table_phys; diff --git a/trunk/arch/sparc/kernel/sun4m_irq.c b/trunk/arch/sparc/kernel/sun4m_irq.c index b92d6d2d5b04..91a803ea88be 100644 --- a/trunk/arch/sparc/kernel/sun4m_irq.c +++ b/trunk/arch/sparc/kernel/sun4m_irq.c @@ -38,85 +38,11 @@ #include #include -#include "irq.h" - -/* On the sun4m, just like the timers, we have both per-cpu and master - * interrupt registers. - */ - -/* These registers are used for sending/receiving irqs from/to - * different cpu's. - */ -struct sun4m_intreg_percpu { - unsigned int tbt; /* Interrupts still pending for this cpu. */ - - /* These next two registers are WRITE-ONLY and are only - * "on bit" sensitive, "off bits" written have NO affect. - */ - unsigned int clear; /* Clear this cpus irqs here. */ - unsigned int set; /* Set this cpus irqs here. */ - unsigned char space[PAGE_SIZE - 12]; -}; - -/* - * djhr - * Actually the clear and set fields in this struct are misleading.. - * according to the SLAVIO manual (and the same applies for the SEC) - * the clear field clears bits in the mask which will ENABLE that IRQ - * the set field sets bits in the mask to DISABLE the IRQ. - * - * Also the undirected_xx address in the SLAVIO is defined as - * RESERVED and write only.. - * - * DAVEM_NOTE: The SLAVIO only specifies behavior on uniprocessor - * sun4m machines, for MP the layout makes more sense. - */ -struct sun4m_intregs { - struct sun4m_intreg_percpu cpu_intregs[SUN4M_NCPUS]; - unsigned int tbt; /* IRQ's that are still pending. */ - unsigned int irqs; /* Master IRQ bits. */ - - /* Again, like the above, two these registers are WRITE-ONLY. */ - unsigned int clear; /* Clear master IRQ's by setting bits here. */ - unsigned int set; /* Set master IRQ's by setting bits here. */ - - /* This register is both READ and WRITE. */ - unsigned int undirected_target; /* Which cpu gets undirected irqs. */ -}; - static unsigned long dummy; struct sun4m_intregs *sun4m_interrupts; unsigned long *irq_rcvreg = &dummy; -/* Dave Redman (djhr@tadpole.co.uk) - * The sun4m interrupt registers. - */ -#define SUN4M_INT_ENABLE 0x80000000 -#define SUN4M_INT_E14 0x00000080 -#define SUN4M_INT_E10 0x00080000 - -#define SUN4M_HARD_INT(x) (0x000000001 << (x)) -#define SUN4M_SOFT_INT(x) (0x000010000 << (x)) - -#define SUN4M_INT_MASKALL 0x80000000 /* mask all interrupts */ -#define SUN4M_INT_MODULE_ERR 0x40000000 /* module error */ -#define SUN4M_INT_M2S_WRITE 0x20000000 /* write buffer error */ -#define SUN4M_INT_ECC 0x10000000 /* ecc memory error */ -#define SUN4M_INT_FLOPPY 0x00400000 /* floppy disk */ -#define SUN4M_INT_MODULE 0x00200000 /* module interrupt */ -#define SUN4M_INT_VIDEO 0x00100000 /* onboard video */ -#define SUN4M_INT_REALTIME 0x00080000 /* system timer */ -#define SUN4M_INT_SCSI 0x00040000 /* onboard scsi */ -#define SUN4M_INT_AUDIO 0x00020000 /* audio/isdn */ -#define SUN4M_INT_ETHERNET 0x00010000 /* onboard ethernet */ -#define SUN4M_INT_SERIAL 0x00008000 /* serial ports */ -#define SUN4M_INT_KBDMS 0x00004000 /* keyboard/mouse */ -#define SUN4M_INT_SBUSBITS 0x00003F80 /* sbus int bits */ - -#define SUN4M_INT_SBUS(x) (1 << (x+7)) -#define SUN4M_INT_VME(x) (1 << (x)) - /* These tables only apply for interrupts greater than 15.. * * any intr value below 0x10 is considered to be a soft-int diff --git a/trunk/arch/sparc/kernel/sun4m_smp.c b/trunk/arch/sparc/kernel/sun4m_smp.c index 730eb5796f8e..63ed19bfd028 100644 --- a/trunk/arch/sparc/kernel/sun4m_smp.c +++ b/trunk/arch/sparc/kernel/sun4m_smp.c @@ -31,8 +31,6 @@ #include #include -#include "irq.h" - #define IRQ_RESCHEDULE 13 #define IRQ_STOP_CPU 14 #define IRQ_CROSS_CALL 15 diff --git a/trunk/arch/sparc/kernel/tick14.c b/trunk/arch/sparc/kernel/tick14.c index 707bfda86570..f1a7bd19e04f 100644 --- a/trunk/arch/sparc/kernel/tick14.c +++ b/trunk/arch/sparc/kernel/tick14.c @@ -25,8 +25,6 @@ #include #include -#include "irq.h" - extern unsigned long lvl14_save[5]; static unsigned long *linux_lvl14 = NULL; static unsigned long obp_lvl14[4]; @@ -64,7 +62,7 @@ void claim_ticker14(irq_handler_t handler, /* first we copy the obp handler instructions */ - __disable_irq(irq_nr); + disable_irq(irq_nr); if (!handler) return; @@ -81,6 +79,6 @@ void claim_ticker14(irq_handler_t handler, NULL)) { install_linux_ticker(); load_profile_irq(cpu, timeout); - __enable_irq(irq_nr); + enable_irq(irq_nr); } } diff --git a/trunk/arch/sparc/kernel/time.c b/trunk/arch/sparc/kernel/time.c index 6a2513321620..f2fdbb3664d3 100644 --- a/trunk/arch/sparc/kernel/time.c +++ b/trunk/arch/sparc/kernel/time.c @@ -44,8 +44,6 @@ #include #include -#include "irq.h" - DEFINE_SPINLOCK(rtc_lock); enum sparc_clock_type sp_clock_typ; DEFINE_SPINLOCK(mostek_lock); diff --git a/trunk/arch/sparc/mm/init.c b/trunk/arch/sparc/mm/init.c index a1bef07755a9..a532922e2e35 100644 --- a/trunk/arch/sparc/mm/init.c +++ b/trunk/arch/sparc/mm/init.c @@ -308,9 +308,6 @@ extern void sun4c_paging_init(void); extern void srmmu_paging_init(void); extern void device_scan(void); -pgprot_t PAGE_SHARED __read_mostly; -EXPORT_SYMBOL(PAGE_SHARED); - void __init paging_init(void) { switch(sparc_cpu_model) { diff --git a/trunk/arch/sparc/mm/srmmu.c b/trunk/arch/sparc/mm/srmmu.c index 17b485f2825c..ca26232da7ab 100644 --- a/trunk/arch/sparc/mm/srmmu.c +++ b/trunk/arch/sparc/mm/srmmu.c @@ -2154,7 +2154,7 @@ void __init ld_mmu_srmmu(void) BTFIXUPSET_SIMM13(ptrs_per_pgd, SRMMU_PTRS_PER_PGD); BTFIXUPSET_INT(page_none, pgprot_val(SRMMU_PAGE_NONE)); - PAGE_SHARED = pgprot_val(SRMMU_PAGE_SHARED); + BTFIXUPSET_INT(page_shared, pgprot_val(SRMMU_PAGE_SHARED)); BTFIXUPSET_INT(page_copy, pgprot_val(SRMMU_PAGE_COPY)); BTFIXUPSET_INT(page_readonly, pgprot_val(SRMMU_PAGE_RDONLY)); BTFIXUPSET_INT(page_kernel, pgprot_val(SRMMU_PAGE_KERNEL)); diff --git a/trunk/arch/sparc/mm/sun4c.c b/trunk/arch/sparc/mm/sun4c.c index a57a366e339a..bdd835fba02e 100644 --- a/trunk/arch/sparc/mm/sun4c.c +++ b/trunk/arch/sparc/mm/sun4c.c @@ -2155,7 +2155,7 @@ void __init ld_mmu_sun4c(void) BTFIXUPSET_SIMM13(user_ptrs_per_pgd, KERNBASE / SUN4C_PGDIR_SIZE); BTFIXUPSET_INT(page_none, pgprot_val(SUN4C_PAGE_NONE)); - PAGE_SHARED = pgprot_val(SUN4C_PAGE_SHARED); + BTFIXUPSET_INT(page_shared, pgprot_val(SUN4C_PAGE_SHARED)); BTFIXUPSET_INT(page_copy, pgprot_val(SUN4C_PAGE_COPY)); BTFIXUPSET_INT(page_readonly, pgprot_val(SUN4C_PAGE_READONLY)); BTFIXUPSET_INT(page_kernel, pgprot_val(SUN4C_PAGE_KERNEL)); diff --git a/trunk/arch/sparc64/kernel/sparc64_ksyms.c b/trunk/arch/sparc64/kernel/sparc64_ksyms.c index d270c2f0be0f..7d36531aa5b9 100644 --- a/trunk/arch/sparc64/kernel/sparc64_ksyms.c +++ b/trunk/arch/sparc64/kernel/sparc64_ksyms.c @@ -280,7 +280,6 @@ EXPORT_SYMBOL(sys_getgid); EXPORT_SYMBOL(svr4_getcontext); EXPORT_SYMBOL(svr4_setcontext); EXPORT_SYMBOL(compat_sys_ioctl); -EXPORT_SYMBOL(sys_ioctl); EXPORT_SYMBOL(sparc32_open); #endif diff --git a/trunk/drivers/acpi/Kconfig b/trunk/drivers/acpi/Kconfig index 501ed6ffa40f..139f41f033d8 100644 --- a/trunk/drivers/acpi/Kconfig +++ b/trunk/drivers/acpi/Kconfig @@ -2,12 +2,16 @@ # ACPI Configuration # -menuconfig ACPI - bool "ACPI Support (Advanced Configuration and Power Interface) Support" +menu "ACPI (Advanced Configuration and Power Interface) Support" depends on !X86_NUMAQ depends on !X86_VISWS depends on !IA64_HP_SIM depends on IA64 || X86 + depends on PM + +config ACPI + bool "ACPI Support" + depends on IA64 || X86 depends on PCI depends on PM select PNP @@ -45,6 +49,7 @@ if ACPI config ACPI_SLEEP bool "Sleep States" depends on X86 && (!SMP || SUSPEND_SMP) + depends on PM default y ---help--- This option adds support for ACPI suspend states. @@ -77,6 +82,7 @@ config ACPI_SLEEP_PROC_SLEEP config ACPI_PROCFS bool "Procfs interface (deprecated)" + depends on ACPI default y ---help--- The Procfs interface for ACPI is made optional for backward compatibility. @@ -274,14 +280,6 @@ config ACPI_DEBUG of verbosity. Saying Y enables these statements. This will increase your kernel size by around 50K. -config ACPI_DEBUG_FUNC_TRACE - bool "Additionally enable ACPI function tracing" - default n - depends on ACPI_DEBUG - help - ACPI Debug Statements slow down ACPI processing. Function trace - is about half of the penalty and is rarely useful. - config ACPI_EC bool default y @@ -332,6 +330,7 @@ config ACPI_CONTAINER config ACPI_HOTPLUG_MEMORY tristate "Memory Hotplug" + depends on ACPI depends on MEMORY_HOTPLUG default n help @@ -360,3 +359,5 @@ config ACPI_SBS to today's ACPI "Control Method" battery. endif # ACPI + +endmenu diff --git a/trunk/drivers/acpi/battery.c b/trunk/drivers/acpi/battery.c index cad932de383d..e64c76c8b726 100644 --- a/trunk/drivers/acpi/battery.c +++ b/trunk/drivers/acpi/battery.c @@ -43,30 +43,21 @@ #define ACPI_BATTERY_CLASS "battery" #define ACPI_BATTERY_HID "PNP0C0A" #define ACPI_BATTERY_DEVICE_NAME "Battery" +#define ACPI_BATTERY_FILE_INFO "info" +#define ACPI_BATTERY_FILE_STATUS "state" +#define ACPI_BATTERY_FILE_ALARM "alarm" #define ACPI_BATTERY_NOTIFY_STATUS 0x80 #define ACPI_BATTERY_NOTIFY_INFO 0x81 #define ACPI_BATTERY_UNITS_WATTS "mW" #define ACPI_BATTERY_UNITS_AMPS "mA" #define _COMPONENT ACPI_BATTERY_COMPONENT - -#define ACPI_BATTERY_UPDATE_TIME 0 - -#define ACPI_BATTERY_NONE_UPDATE 0 -#define ACPI_BATTERY_EASY_UPDATE 1 -#define ACPI_BATTERY_INIT_UPDATE 2 - ACPI_MODULE_NAME("battery"); MODULE_AUTHOR("Paul Diefenbaugh"); MODULE_DESCRIPTION("ACPI Battery Driver"); MODULE_LICENSE("GPL"); -static unsigned int update_time = ACPI_BATTERY_UPDATE_TIME; - -/* 0 - every time, > 0 - by update_time */ -module_param(update_time, uint, 0644); - extern struct proc_dir_entry *acpi_lock_battery_dir(void); extern void *acpi_unlock_battery_dir(struct proc_dir_entry *acpi_battery_dir); @@ -85,7 +76,7 @@ static struct acpi_driver acpi_battery_driver = { }, }; -struct acpi_battery_state { +struct acpi_battery_status { acpi_integer state; acpi_integer present_rate; acpi_integer remaining_capacity; @@ -108,111 +99,33 @@ struct acpi_battery_info { acpi_string oem_info; }; -enum acpi_battery_files{ - ACPI_BATTERY_INFO = 0, - ACPI_BATTERY_STATE, - ACPI_BATTERY_ALARM, - ACPI_BATTERY_NUMFILES, +struct acpi_battery_flags { + u8 present:1; /* Bay occupied? */ + u8 power_unit:1; /* 0=watts, 1=apms */ + u8 alarm:1; /* _BTP present? */ + u8 reserved:5; }; -struct acpi_battery_flags { - u8 battery_present_prev; - u8 alarm_present; - u8 init_update; - u8 update[ACPI_BATTERY_NUMFILES]; - u8 power_unit; +struct acpi_battery_trips { + unsigned long warning; + unsigned long low; }; struct acpi_battery { - struct mutex mutex; - struct acpi_device *device; + struct acpi_device * device; struct acpi_battery_flags flags; - struct acpi_buffer bif_data; - struct acpi_buffer bst_data; + struct acpi_battery_trips trips; unsigned long alarm; - unsigned long update_time[ACPI_BATTERY_NUMFILES]; + struct acpi_battery_info *info; }; -inline int acpi_battery_present(struct acpi_battery *battery) -{ - return battery->device->status.battery_present; -} -inline char *acpi_battery_power_units(struct acpi_battery *battery) -{ - if (battery->flags.power_unit) - return ACPI_BATTERY_UNITS_AMPS; - else - return ACPI_BATTERY_UNITS_WATTS; -} - -inline acpi_handle acpi_battery_handle(struct acpi_battery *battery) -{ - return battery->device->handle; -} - /* -------------------------------------------------------------------------- Battery Management -------------------------------------------------------------------------- */ -static void acpi_battery_check_result(struct acpi_battery *battery, int result) -{ - if (!battery) - return; - - if (result) { - battery->flags.init_update = 1; - } -} - -static int acpi_battery_extract_package(struct acpi_battery *battery, - union acpi_object *package, - struct acpi_buffer *format, - struct acpi_buffer *data, - char *package_name) -{ - acpi_status status = AE_OK; - struct acpi_buffer data_null = { 0, NULL }; - - status = acpi_extract_package(package, format, &data_null); - if (status != AE_BUFFER_OVERFLOW) { - ACPI_EXCEPTION((AE_INFO, status, "Extracting size %s", - package_name)); - return -ENODEV; - } - - if (data_null.length != data->length) { - kfree(data->pointer); - data->pointer = kzalloc(data_null.length, GFP_KERNEL); - if (!data->pointer) { - ACPI_EXCEPTION((AE_INFO, AE_NO_MEMORY, "kzalloc()")); - return -ENOMEM; - } - data->length = data_null.length; - } - - status = acpi_extract_package(package, format, data); - if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Extracting %s", - package_name)); - return -ENODEV; - } - - return 0; -} - -static int acpi_battery_get_status(struct acpi_battery *battery) -{ - int result = 0; - - result = acpi_bus_get_status(battery->device); - if (result) { - ACPI_EXCEPTION((AE_INFO, AE_ERROR, "Evaluating _STA")); - return -ENODEV; - } - return result; -} - -static int acpi_battery_get_info(struct acpi_battery *battery) +static int +acpi_battery_get_info(struct acpi_battery *battery, + struct acpi_battery_info **bif) { int result = 0; acpi_status status = 0; @@ -220,20 +133,16 @@ static int acpi_battery_get_info(struct acpi_battery *battery) struct acpi_buffer format = { sizeof(ACPI_BATTERY_FORMAT_BIF), ACPI_BATTERY_FORMAT_BIF }; + struct acpi_buffer data = { 0, NULL }; union acpi_object *package = NULL; - struct acpi_buffer *data = NULL; - struct acpi_battery_info *bif = NULL; - battery->update_time[ACPI_BATTERY_INFO] = get_seconds(); - if (!acpi_battery_present(battery)) - return 0; + if (!battery || !bif) + return -EINVAL; - /* Evaluate _BIF */ + /* Evalute _BIF */ - status = - acpi_evaluate_object(acpi_battery_handle(battery), "_BIF", NULL, - &buffer); + status = acpi_evaluate_object(battery->device->handle, "_BIF", NULL, &buffer); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BIF")); return -ENODEV; @@ -241,29 +150,41 @@ static int acpi_battery_get_info(struct acpi_battery *battery) package = buffer.pointer; - data = &battery->bif_data; - /* Extract Package Data */ - result = - acpi_battery_extract_package(battery, package, &format, data, - "_BIF"); - if (result) + status = acpi_extract_package(package, &format, &data); + if (status != AE_BUFFER_OVERFLOW) { + ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF")); + result = -ENODEV; goto end; + } - end: + data.pointer = kzalloc(data.length, GFP_KERNEL); + if (!data.pointer) { + result = -ENOMEM; + goto end; + } + + status = acpi_extract_package(package, &format, &data); + if (ACPI_FAILURE(status)) { + ACPI_EXCEPTION((AE_INFO, status, "Extracting _BIF")); + kfree(data.pointer); + result = -ENODEV; + goto end; + } + end: kfree(buffer.pointer); - if (!result) { - bif = data->pointer; - battery->flags.power_unit = bif->power_unit; - } + if (!result) + (*bif) = data.pointer; return result; } -static int acpi_battery_get_state(struct acpi_battery *battery) +static int +acpi_battery_get_status(struct acpi_battery *battery, + struct acpi_battery_status **bst) { int result = 0; acpi_status status = 0; @@ -271,19 +192,16 @@ static int acpi_battery_get_state(struct acpi_battery *battery) struct acpi_buffer format = { sizeof(ACPI_BATTERY_FORMAT_BST), ACPI_BATTERY_FORMAT_BST }; + struct acpi_buffer data = { 0, NULL }; union acpi_object *package = NULL; - struct acpi_buffer *data = NULL; - battery->update_time[ACPI_BATTERY_STATE] = get_seconds(); - if (!acpi_battery_present(battery)) - return 0; + if (!battery || !bst) + return -EINVAL; - /* Evaluate _BST */ + /* Evalute _BST */ - status = - acpi_evaluate_object(acpi_battery_handle(battery), "_BST", NULL, - &buffer); + status = acpi_evaluate_object(battery->device->handle, "_BST", NULL, &buffer); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, status, "Evaluating _BST")); return -ENODEV; @@ -291,49 +209,55 @@ static int acpi_battery_get_state(struct acpi_battery *battery) package = buffer.pointer; - data = &battery->bst_data; - /* Extract Package Data */ - result = - acpi_battery_extract_package(battery, package, &format, data, - "_BST"); - if (result) + status = acpi_extract_package(package, &format, &data); + if (status != AE_BUFFER_OVERFLOW) { + ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST")); + result = -ENODEV; + goto end; + } + + data.pointer = kzalloc(data.length, GFP_KERNEL); + if (!data.pointer) { + result = -ENOMEM; + goto end; + } + + status = acpi_extract_package(package, &format, &data); + if (ACPI_FAILURE(status)) { + ACPI_EXCEPTION((AE_INFO, status, "Extracting _BST")); + kfree(data.pointer); + result = -ENODEV; goto end; + } end: kfree(buffer.pointer); - return result; -} - -static int acpi_battery_get_alarm(struct acpi_battery *battery) -{ - battery->update_time[ACPI_BATTERY_ALARM] = get_seconds(); + if (!result) + (*bst) = data.pointer; - return 0; + return result; } -static int acpi_battery_set_alarm(struct acpi_battery *battery, - unsigned long alarm) +static int +acpi_battery_set_alarm(struct acpi_battery *battery, unsigned long alarm) { acpi_status status = 0; union acpi_object arg0 = { ACPI_TYPE_INTEGER }; struct acpi_object_list arg_list = { 1, &arg0 }; - battery->update_time[ACPI_BATTERY_ALARM] = get_seconds(); - if (!acpi_battery_present(battery)) - return -ENODEV; + if (!battery) + return -EINVAL; - if (!battery->flags.alarm_present) + if (!battery->flags.alarm) return -ENODEV; arg0.integer.value = alarm; - status = - acpi_evaluate_object(acpi_battery_handle(battery), "_BTP", - &arg_list, NULL); + status = acpi_evaluate_object(battery->device->handle, "_BTP", &arg_list, NULL); if (ACPI_FAILURE(status)) return -ENODEV; @@ -344,114 +268,65 @@ static int acpi_battery_set_alarm(struct acpi_battery *battery, return 0; } -static int acpi_battery_init_alarm(struct acpi_battery *battery) +static int acpi_battery_check(struct acpi_battery *battery) { int result = 0; acpi_status status = AE_OK; acpi_handle handle = NULL; - struct acpi_battery_info *bif = battery->bif_data.pointer; - unsigned long alarm = battery->alarm; - - /* See if alarms are supported, and if so, set default */ - - status = acpi_get_handle(acpi_battery_handle(battery), "_BTP", &handle); - if (ACPI_SUCCESS(status)) { - battery->flags.alarm_present = 1; - if (!alarm && bif) { - alarm = bif->design_capacity_warning; - } - result = acpi_battery_set_alarm(battery, alarm); - if (result) - goto end; - } else { - battery->flags.alarm_present = 0; - } + struct acpi_device *device = NULL; + struct acpi_battery_info *bif = NULL; - end: - return result; -} + if (!battery) + return -EINVAL; -static int acpi_battery_init_update(struct acpi_battery *battery) -{ - int result = 0; + device = battery->device; - result = acpi_battery_get_status(battery); + result = acpi_bus_get_status(device); if (result) return result; - battery->flags.battery_present_prev = acpi_battery_present(battery); + /* Insertion? */ - if (acpi_battery_present(battery)) { - result = acpi_battery_get_info(battery); - if (result) - return result; - result = acpi_battery_get_state(battery); - if (result) - return result; + if (!battery->flags.present && device->status.battery_present) { - acpi_battery_init_alarm(battery); - } + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Battery inserted\n")); - return result; -} + /* Evalute _BIF to get certain static information */ -static int acpi_battery_update(struct acpi_battery *battery, - int update, int *update_result_ptr) -{ - int result = 0; - int update_result = ACPI_BATTERY_NONE_UPDATE; + result = acpi_battery_get_info(battery, &bif); + if (result) + return result; - if (!acpi_battery_present(battery)) { - update = 1; - } + battery->flags.power_unit = bif->power_unit; + battery->trips.warning = bif->design_capacity_warning; + battery->trips.low = bif->design_capacity_low; + kfree(bif); - if (battery->flags.init_update) { - result = acpi_battery_init_update(battery); - if (result) - goto end; - update_result = ACPI_BATTERY_INIT_UPDATE; - } else if (update) { - result = acpi_battery_get_status(battery); - if (result) - goto end; - if ((!battery->flags.battery_present_prev & acpi_battery_present(battery)) - || (battery->flags.battery_present_prev & !acpi_battery_present(battery))) { - result = acpi_battery_init_update(battery); - if (result) - goto end; - update_result = ACPI_BATTERY_INIT_UPDATE; - } else { - update_result = ACPI_BATTERY_EASY_UPDATE; + /* See if alarms are supported, and if so, set default */ + + status = acpi_get_handle(battery->device->handle, "_BTP", &handle); + if (ACPI_SUCCESS(status)) { + battery->flags.alarm = 1; + acpi_battery_set_alarm(battery, battery->trips.warning); } } - end: + /* Removal? */ - battery->flags.init_update = (result != 0); + else if (battery->flags.present && !device->status.battery_present) { + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Battery removed\n")); + } - *update_result_ptr = update_result; + battery->flags.present = device->status.battery_present; return result; } -static void acpi_battery_notify_update(struct acpi_battery *battery) +static void acpi_battery_check_present(struct acpi_battery *battery) { - acpi_battery_get_status(battery); - - if (battery->flags.init_update) { - return; - } - - if ((!battery->flags.battery_present_prev & - acpi_battery_present(battery)) || - (battery->flags.battery_present_prev & - !acpi_battery_present(battery))) { - battery->flags.init_update = 1; - } else { - battery->flags.update[ACPI_BATTERY_INFO] = 1; - battery->flags.update[ACPI_BATTERY_STATE] = 1; - battery->flags.update[ACPI_BATTERY_ALARM] = 1; + if (!battery->flags.present) { + acpi_battery_check(battery); } } @@ -460,33 +335,37 @@ static void acpi_battery_notify_update(struct acpi_battery *battery) -------------------------------------------------------------------------- */ static struct proc_dir_entry *acpi_battery_dir; - -static int acpi_battery_print_info(struct seq_file *seq, int result) +static int acpi_battery_read_info(struct seq_file *seq, void *offset) { + int result = 0; struct acpi_battery *battery = seq->private; struct acpi_battery_info *bif = NULL; char *units = "?"; - if (result) + + if (!battery) goto end; - if (acpi_battery_present(battery)) + acpi_battery_check_present(battery); + + if (battery->flags.present) seq_printf(seq, "present: yes\n"); else { seq_printf(seq, "present: no\n"); goto end; } - bif = battery->bif_data.pointer; - if (!bif) { - ACPI_EXCEPTION((AE_INFO, AE_ERROR, "BIF buffer is NULL")); - result = -ENODEV; + /* Battery Info (_BIF) */ + + result = acpi_battery_get_info(battery, &bif); + if (result || !bif) { + seq_printf(seq, "ERROR: Unable to read battery information\n"); goto end; } - /* Battery Units */ - - units = acpi_battery_power_units(battery); + units = + bif-> + power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS; if (bif->design_capacity == ACPI_BATTERY_VALUE_UNKNOWN) seq_printf(seq, "design capacity: unknown\n"); @@ -517,6 +396,7 @@ static int acpi_battery_print_info(struct seq_file *seq, int result) else seq_printf(seq, "design voltage: %d mV\n", (u32) bif->design_voltage); + seq_printf(seq, "design capacity warning: %d %sh\n", (u32) bif->design_capacity_warning, units); seq_printf(seq, "design capacity low: %d %sh\n", @@ -531,39 +411,49 @@ static int acpi_battery_print_info(struct seq_file *seq, int result) seq_printf(seq, "OEM info: %s\n", bif->oem_info); end: + kfree(bif); - if (result) - seq_printf(seq, "ERROR: Unable to read battery info\n"); + return 0; +} - return result; +static int acpi_battery_info_open_fs(struct inode *inode, struct file *file) +{ + return single_open(file, acpi_battery_read_info, PDE(inode)->data); } -static int acpi_battery_print_state(struct seq_file *seq, int result) +static int acpi_battery_read_state(struct seq_file *seq, void *offset) { + int result = 0; struct acpi_battery *battery = seq->private; - struct acpi_battery_state *bst = NULL; + struct acpi_battery_status *bst = NULL; char *units = "?"; - if (result) + + if (!battery) goto end; - if (acpi_battery_present(battery)) + acpi_battery_check_present(battery); + + if (battery->flags.present) seq_printf(seq, "present: yes\n"); else { seq_printf(seq, "present: no\n"); goto end; } - bst = battery->bst_data.pointer; - if (!bst) { - ACPI_EXCEPTION((AE_INFO, AE_ERROR, "BST buffer is NULL")); - result = -ENODEV; - goto end; - } - /* Battery Units */ - units = acpi_battery_power_units(battery); + units = + battery->flags. + power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS; + + /* Battery Status (_BST) */ + + result = acpi_battery_get_status(battery, &bst); + if (result || !bst) { + seq_printf(seq, "ERROR: Unable to read battery status\n"); + goto end; + } if (!(bst->state & 0x04)) seq_printf(seq, "capacity state: ok\n"); @@ -600,43 +490,48 @@ static int acpi_battery_print_state(struct seq_file *seq, int result) (u32) bst->present_voltage); end: + kfree(bst); - if (result) { - seq_printf(seq, "ERROR: Unable to read battery state\n"); - } + return 0; +} - return result; +static int acpi_battery_state_open_fs(struct inode *inode, struct file *file) +{ + return single_open(file, acpi_battery_read_state, PDE(inode)->data); } -static int acpi_battery_print_alarm(struct seq_file *seq, int result) +static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) { struct acpi_battery *battery = seq->private; char *units = "?"; - if (result) + + if (!battery) goto end; - if (!acpi_battery_present(battery)) { + acpi_battery_check_present(battery); + + if (!battery->flags.present) { seq_printf(seq, "present: no\n"); goto end; } /* Battery Units */ - units = acpi_battery_power_units(battery); + units = + battery->flags. + power_unit ? ACPI_BATTERY_UNITS_AMPS : ACPI_BATTERY_UNITS_WATTS; + + /* Battery Alarm */ seq_printf(seq, "alarm: "); if (!battery->alarm) seq_printf(seq, "unsupported\n"); else - seq_printf(seq, "%lu %sh\n", battery->alarm, units); + seq_printf(seq, "%d %sh\n", (u32) battery->alarm, units); end: - - if (result) - seq_printf(seq, "ERROR: Unable to read battery alarm\n"); - - return result; + return 0; } static ssize_t @@ -648,113 +543,27 @@ acpi_battery_write_alarm(struct file *file, char alarm_string[12] = { '\0' }; struct seq_file *m = file->private_data; struct acpi_battery *battery = m->private; - int update_result = ACPI_BATTERY_NONE_UPDATE; + if (!battery || (count > sizeof(alarm_string) - 1)) return -EINVAL; - mutex_lock(&battery->mutex); + acpi_battery_check_present(battery); - result = acpi_battery_update(battery, 1, &update_result); - if (result) { - result = -ENODEV; - goto end; - } - - if (!acpi_battery_present(battery)) { - result = -ENODEV; - goto end; - } + if (!battery->flags.present) + return -ENODEV; - if (copy_from_user(alarm_string, buffer, count)) { - result = -EFAULT; - goto end; - } + if (copy_from_user(alarm_string, buffer, count)) + return -EFAULT; alarm_string[count] = '\0'; result = acpi_battery_set_alarm(battery, simple_strtoul(alarm_string, NULL, 0)); if (result) - goto end; - - end: - - acpi_battery_check_result(battery, result); - - if (!result) - result = count; - - mutex_unlock(&battery->mutex); - - return result; -} - -typedef int(*print_func)(struct seq_file *seq, int result); -typedef int(*get_func)(struct acpi_battery *battery); - -static struct acpi_read_mux { - print_func print; - get_func get; -} acpi_read_funcs[ACPI_BATTERY_NUMFILES] = { - {.get = acpi_battery_get_info, .print = acpi_battery_print_info}, - {.get = acpi_battery_get_state, .print = acpi_battery_print_state}, - {.get = acpi_battery_get_alarm, .print = acpi_battery_print_alarm}, -}; - -static int acpi_battery_read(int fid, struct seq_file *seq) -{ - struct acpi_battery *battery = seq->private; - int result = 0; - int update_result = ACPI_BATTERY_NONE_UPDATE; - int update = 0; - - mutex_lock(&battery->mutex); - - update = (get_seconds() - battery->update_time[fid] >= update_time); - update = (update | battery->flags.update[fid]); - - result = acpi_battery_update(battery, update, &update_result); - if (result) - goto end; - - if (update_result == ACPI_BATTERY_EASY_UPDATE) { - result = acpi_read_funcs[fid].get(battery); - if (result) - goto end; - } - - end: - result = acpi_read_funcs[fid].print(seq, result); - acpi_battery_check_result(battery, result); - battery->flags.update[fid] = result; - mutex_unlock(&battery->mutex); - return result; -} - -static int acpi_battery_read_info(struct seq_file *seq, void *offset) -{ - return acpi_battery_read(ACPI_BATTERY_INFO, seq); -} - -static int acpi_battery_read_state(struct seq_file *seq, void *offset) -{ - return acpi_battery_read(ACPI_BATTERY_STATE, seq); -} - -static int acpi_battery_read_alarm(struct seq_file *seq, void *offset) -{ - return acpi_battery_read(ACPI_BATTERY_ALARM, seq); -} - -static int acpi_battery_info_open_fs(struct inode *inode, struct file *file) -{ - return single_open(file, acpi_battery_read_info, PDE(inode)->data); -} + return result; -static int acpi_battery_state_open_fs(struct inode *inode, struct file *file) -{ - return single_open(file, acpi_battery_read_state, PDE(inode)->data); + return count; } static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file) @@ -762,51 +571,35 @@ static int acpi_battery_alarm_open_fs(struct inode *inode, struct file *file) return single_open(file, acpi_battery_read_alarm, PDE(inode)->data); } -static struct battery_file { - struct file_operations ops; - mode_t mode; - char *name; -} acpi_battery_file[] = { - { - .name = "info", - .mode = S_IRUGO, - .ops = { +static const struct file_operations acpi_battery_info_ops = { .open = acpi_battery_info_open_fs, .read = seq_read, .llseek = seq_lseek, .release = single_release, .owner = THIS_MODULE, - }, - }, - { - .name = "state", - .mode = S_IRUGO, - .ops = { +}; + +static const struct file_operations acpi_battery_state_ops = { .open = acpi_battery_state_open_fs, .read = seq_read, .llseek = seq_lseek, .release = single_release, .owner = THIS_MODULE, - }, - }, - { - .name = "alarm", - .mode = S_IFREG | S_IRUGO | S_IWUSR, - .ops = { +}; + +static const struct file_operations acpi_battery_alarm_ops = { .open = acpi_battery_alarm_open_fs, .read = seq_read, .write = acpi_battery_write_alarm, .llseek = seq_lseek, .release = single_release, .owner = THIS_MODULE, - }, - }, }; static int acpi_battery_add_fs(struct acpi_device *device) { struct proc_dir_entry *entry = NULL; - int i; + if (!acpi_device_dir(device)) { acpi_device_dir(device) = proc_mkdir(acpi_device_bid(device), @@ -816,16 +609,38 @@ static int acpi_battery_add_fs(struct acpi_device *device) acpi_device_dir(device)->owner = THIS_MODULE; } - for (i = 0; i < ACPI_BATTERY_NUMFILES; ++i) { - entry = create_proc_entry(acpi_battery_file[i].name, - acpi_battery_file[i].mode, acpi_device_dir(device)); - if (!entry) - return -ENODEV; - else { - entry->proc_fops = &acpi_battery_file[i].ops; - entry->data = acpi_driver_data(device); - entry->owner = THIS_MODULE; - } + /* 'info' [R] */ + entry = create_proc_entry(ACPI_BATTERY_FILE_INFO, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + return -ENODEV; + else { + entry->proc_fops = &acpi_battery_info_ops; + entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; + } + + /* 'status' [R] */ + entry = create_proc_entry(ACPI_BATTERY_FILE_STATUS, + S_IRUGO, acpi_device_dir(device)); + if (!entry) + return -ENODEV; + else { + entry->proc_fops = &acpi_battery_state_ops; + entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; + } + + /* 'alarm' [R/W] */ + entry = create_proc_entry(ACPI_BATTERY_FILE_ALARM, + S_IFREG | S_IRUGO | S_IWUSR, + acpi_device_dir(device)); + if (!entry) + return -ENODEV; + else { + entry->proc_fops = &acpi_battery_alarm_ops; + entry->data = acpi_driver_data(device); + entry->owner = THIS_MODULE; } return 0; @@ -833,12 +648,15 @@ static int acpi_battery_add_fs(struct acpi_device *device) static int acpi_battery_remove_fs(struct acpi_device *device) { - int i; + if (acpi_device_dir(device)) { - for (i = 0; i < ACPI_BATTERY_NUMFILES; ++i) { - remove_proc_entry(acpi_battery_file[i].name, + remove_proc_entry(ACPI_BATTERY_FILE_ALARM, acpi_device_dir(device)); - } + remove_proc_entry(ACPI_BATTERY_FILE_STATUS, + acpi_device_dir(device)); + remove_proc_entry(ACPI_BATTERY_FILE_INFO, + acpi_device_dir(device)); + remove_proc_entry(acpi_device_bid(device), acpi_battery_dir); acpi_device_dir(device) = NULL; } @@ -855,6 +673,7 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) struct acpi_battery *battery = data; struct acpi_device *device = NULL; + if (!battery) return; @@ -865,10 +684,8 @@ static void acpi_battery_notify(acpi_handle handle, u32 event, void *data) case ACPI_BATTERY_NOTIFY_INFO: case ACPI_NOTIFY_BUS_CHECK: case ACPI_NOTIFY_DEVICE_CHECK: - device = battery->device; - acpi_battery_notify_update(battery); - acpi_bus_generate_event(device, event, - acpi_battery_present(battery)); + acpi_battery_check(battery); + acpi_bus_generate_event(device, event, battery->flags.present); break; default: ACPI_DEBUG_PRINT((ACPI_DB_INFO, @@ -885,6 +702,7 @@ static int acpi_battery_add(struct acpi_device *device) acpi_status status = 0; struct acpi_battery *battery = NULL; + if (!device) return -EINVAL; @@ -892,21 +710,15 @@ static int acpi_battery_add(struct acpi_device *device) if (!battery) return -ENOMEM; - mutex_init(&battery->mutex); - - mutex_lock(&battery->mutex); - battery->device = device; strcpy(acpi_device_name(device), ACPI_BATTERY_DEVICE_NAME); strcpy(acpi_device_class(device), ACPI_BATTERY_CLASS); acpi_driver_data(device) = battery; - result = acpi_battery_get_status(battery); + result = acpi_battery_check(battery); if (result) goto end; - battery->flags.init_update = 1; - result = acpi_battery_add_fs(device); if (result) goto end; @@ -915,7 +727,6 @@ static int acpi_battery_add(struct acpi_device *device) ACPI_ALL_NOTIFY, acpi_battery_notify, battery); if (ACPI_FAILURE(status)) { - ACPI_EXCEPTION((AE_INFO, status, "Installing notify handler")); result = -ENODEV; goto end; } @@ -925,14 +736,11 @@ static int acpi_battery_add(struct acpi_device *device) device->status.battery_present ? "present" : "absent"); end: - if (result) { acpi_battery_remove_fs(device); kfree(battery); } - mutex_unlock(&battery->mutex); - return result; } @@ -941,27 +749,18 @@ static int acpi_battery_remove(struct acpi_device *device, int type) acpi_status status = 0; struct acpi_battery *battery = NULL; + if (!device || !acpi_driver_data(device)) return -EINVAL; battery = acpi_driver_data(device); - mutex_lock(&battery->mutex); - status = acpi_remove_notify_handler(device->handle, ACPI_ALL_NOTIFY, acpi_battery_notify); acpi_battery_remove_fs(device); - kfree(battery->bif_data.pointer); - - kfree(battery->bst_data.pointer); - - mutex_unlock(&battery->mutex); - - mutex_destroy(&battery->mutex); - kfree(battery); return 0; @@ -976,10 +775,7 @@ static int acpi_battery_resume(struct acpi_device *device) return -EINVAL; battery = device->driver_data; - - battery->flags.init_update = 1; - - return 0; + return acpi_battery_check(battery); } static int __init acpi_battery_init(void) @@ -1004,6 +800,7 @@ static int __init acpi_battery_init(void) static void __exit acpi_battery_exit(void) { + acpi_bus_unregister_driver(&acpi_battery_driver); acpi_unlock_battery_dir(acpi_battery_dir); diff --git a/trunk/drivers/acpi/bay.c b/trunk/drivers/acpi/bay.c index 56a5b3fffeb3..fb3f31b5e69f 100644 --- a/trunk/drivers/acpi/bay.c +++ b/trunk/drivers/acpi/bay.c @@ -288,11 +288,6 @@ static int bay_add(acpi_handle handle, int id) new_bay->pdev = pdev; platform_set_drvdata(pdev, new_bay); - /* - * we want the bay driver to be able to send uevents - */ - pdev->dev.uevent_suppress = 0; - if (acpi_bay_add_fs(new_bay)) { platform_device_unregister(new_bay->pdev); goto bay_add_err; @@ -333,12 +328,18 @@ static void bay_notify(acpi_handle handle, u32 event, void *data) { struct bay *bay_dev = (struct bay *)data; struct device *dev = &bay_dev->pdev->dev; - char event_string[12]; - char *envp[] = { event_string, NULL }; bay_dprintk(handle, "Bay event"); - sprintf(event_string, "BAY_EVENT=%d\n", event); - kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp); + + switch(event) { + case ACPI_NOTIFY_BUS_CHECK: + case ACPI_NOTIFY_DEVICE_CHECK: + case ACPI_NOTIFY_EJECT_REQUEST: + kobject_uevent(&dev->kobj, KOBJ_CHANGE); + break; + default: + printk(KERN_ERR PREFIX "Bay: unknown event %d\n", event); + } } static acpi_status diff --git a/trunk/drivers/acpi/dock.c b/trunk/drivers/acpi/dock.c index 6192c8be66df..4546bf873aea 100644 --- a/trunk/drivers/acpi/dock.c +++ b/trunk/drivers/acpi/dock.c @@ -40,15 +40,8 @@ MODULE_AUTHOR("Kristen Carlson Accardi"); MODULE_DESCRIPTION(ACPI_DOCK_DRIVER_DESCRIPTION); MODULE_LICENSE("GPL"); -static int immediate_undock = 1; -module_param(immediate_undock, bool, 0644); -MODULE_PARM_DESC(immediate_undock, "1 (default) will cause the driver to " - "undock immediately when the undock button is pressed, 0 will cause" - " the driver to wait for userspace to write the undock sysfs file " - " before undocking"); - static struct atomic_notifier_head dock_notifier_list; -static struct platform_device *dock_device; +static struct platform_device dock_device; static char dock_device_name[] = "dock"; struct dock_station { @@ -70,7 +63,6 @@ struct dock_dependent_device { }; #define DOCK_DOCKING 0x00000001 -#define DOCK_UNDOCKING 0x00000002 #define DOCK_EVENT 3 #define UNDOCK_EVENT 2 @@ -335,20 +327,12 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event) static void dock_event(struct dock_station *ds, u32 event, int num) { - struct device *dev = &dock_device->dev; - char event_string[7]; - char *envp[] = { event_string, NULL }; - - if (num == UNDOCK_EVENT) - sprintf(event_string, "UNDOCK"); - else - sprintf(event_string, "DOCK"); - + struct device *dev = &dock_device.dev; /* * Indicate that the status of the dock station has * changed. */ - kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp); + kobject_uevent(&dev->kobj, KOBJ_CHANGE); } /** @@ -396,11 +380,12 @@ static void handle_dock(struct dock_station *ds, int dock) union acpi_object arg; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_buffer name_buffer = { ACPI_ALLOCATE_BUFFER, NULL }; + union acpi_object *obj; acpi_get_name(ds->handle, ACPI_FULL_PATHNAME, &name_buffer); + obj = name_buffer.pointer; - printk(KERN_INFO PREFIX "%s - %s\n", - (char *)name_buffer.pointer, dock ? "docking" : "undocking"); + printk(KERN_INFO PREFIX "%s\n", dock ? "docking" : "undocking"); /* _DCK method has one argument */ arg_list.count = 1; @@ -409,8 +394,7 @@ static void handle_dock(struct dock_station *ds, int dock) arg.integer.value = dock; status = acpi_evaluate_object(ds->handle, "_DCK", &arg_list, &buffer); if (ACPI_FAILURE(status)) - printk(KERN_ERR PREFIX "%s - failed to execute _DCK\n", - (char *)name_buffer.pointer); + pr_debug("%s: failed to execute _DCK\n", obj->string.pointer); kfree(buffer.pointer); kfree(name_buffer.pointer); } @@ -436,16 +420,6 @@ static inline void complete_dock(struct dock_station *ds) ds->last_dock_time = jiffies; } -static inline void begin_undock(struct dock_station *ds) -{ - ds->flags |= DOCK_UNDOCKING; -} - -static inline void complete_undock(struct dock_station *ds) -{ - ds->flags &= ~(DOCK_UNDOCKING); -} - /** * dock_in_progress - see if we are in the middle of handling a dock event * @ds: the dock station @@ -576,7 +550,7 @@ static int handle_eject_request(struct dock_station *ds, u32 event) printk(KERN_ERR PREFIX "Unable to undock!\n"); return -EBUSY; } - complete_undock(ds); + return 0; } @@ -620,11 +594,7 @@ static void dock_notify(acpi_handle handle, u32 event, void *data) * to the driver who wish to hotplug. */ case ACPI_NOTIFY_EJECT_REQUEST: - begin_undock(ds); - if (immediate_undock) - handle_eject_request(ds, event); - else - dock_event(ds, event, UNDOCK_EVENT); + handle_eject_request(ds, event); break; default: printk(KERN_ERR PREFIX "Unknown dock event %d\n", event); @@ -682,17 +652,6 @@ static ssize_t show_docked(struct device *dev, } DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL); -/* - * show_flags - read method for flags file in sysfs - */ -static ssize_t show_flags(struct device *dev, - struct device_attribute *attr, char *buf) -{ - return snprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags); - -} -DEVICE_ATTR(flags, S_IRUGO, show_flags, NULL); - /* * write_undock - write method for "undock" file in sysfs */ @@ -716,15 +675,16 @@ static ssize_t show_dock_uid(struct device *dev, struct device_attribute *attr, char *buf) { unsigned long lbuf; - acpi_status status = acpi_evaluate_integer(dock_station->handle, - "_UID", NULL, &lbuf); - if (ACPI_FAILURE(status)) + acpi_status status = acpi_evaluate_integer(dock_station->handle, "_UID", NULL, &lbuf); + if(ACPI_FAILURE(status)) { return 0; - + } return snprintf(buf, PAGE_SIZE, "%lx\n", lbuf); } DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL); + + /** * dock_add - add a new dock station * @handle: the dock station handle @@ -751,53 +711,33 @@ static int dock_add(acpi_handle handle) ATOMIC_INIT_NOTIFIER_HEAD(&dock_notifier_list); /* initialize platform device stuff */ - dock_device = - platform_device_register_simple(dock_device_name, 0, NULL, 0); - if (IS_ERR(dock_device)) { - kfree(dock_station); - dock_station = NULL; - return PTR_ERR(dock_device); - } - - /* we want the dock device to send uevents */ - dock_device->dev.uevent_suppress = 0; - - ret = device_create_file(&dock_device->dev, &dev_attr_docked); + dock_device.name = dock_device_name; + ret = platform_device_register(&dock_device); if (ret) { - printk("Error %d adding sysfs file\n", ret); - platform_device_unregister(dock_device); + printk(KERN_ERR PREFIX "Error %d registering dock device\n", ret); kfree(dock_station); - dock_station = NULL; return ret; } - ret = device_create_file(&dock_device->dev, &dev_attr_undock); + ret = device_create_file(&dock_device.dev, &dev_attr_docked); if (ret) { printk("Error %d adding sysfs file\n", ret); - device_remove_file(&dock_device->dev, &dev_attr_docked); - platform_device_unregister(dock_device); + platform_device_unregister(&dock_device); kfree(dock_station); - dock_station = NULL; return ret; } - ret = device_create_file(&dock_device->dev, &dev_attr_uid); + ret = device_create_file(&dock_device.dev, &dev_attr_undock); if (ret) { printk("Error %d adding sysfs file\n", ret); - device_remove_file(&dock_device->dev, &dev_attr_docked); - device_remove_file(&dock_device->dev, &dev_attr_undock); - platform_device_unregister(dock_device); + device_remove_file(&dock_device.dev, &dev_attr_docked); + platform_device_unregister(&dock_device); kfree(dock_station); - dock_station = NULL; return ret; } - ret = device_create_file(&dock_device->dev, &dev_attr_flags); + ret = device_create_file(&dock_device.dev, &dev_attr_uid); if (ret) { printk("Error %d adding sysfs file\n", ret); - device_remove_file(&dock_device->dev, &dev_attr_docked); - device_remove_file(&dock_device->dev, &dev_attr_undock); - device_remove_file(&dock_device->dev, &dev_attr_uid); - platform_device_unregister(dock_device); + platform_device_unregister(&dock_device); kfree(dock_station); - dock_station = NULL; return ret; } @@ -810,7 +750,6 @@ static int dock_add(acpi_handle handle) dd = alloc_dock_dependent_device(handle); if (!dd) { kfree(dock_station); - dock_station = NULL; ret = -ENOMEM; goto dock_add_err_unregister; } @@ -834,13 +773,10 @@ static int dock_add(acpi_handle handle) dock_add_err: kfree(dd); dock_add_err_unregister: - device_remove_file(&dock_device->dev, &dev_attr_docked); - device_remove_file(&dock_device->dev, &dev_attr_undock); - device_remove_file(&dock_device->dev, &dev_attr_uid); - device_remove_file(&dock_device->dev, &dev_attr_flags); - platform_device_unregister(dock_device); + device_remove_file(&dock_device.dev, &dev_attr_docked); + device_remove_file(&dock_device.dev, &dev_attr_undock); + platform_device_unregister(&dock_device); kfree(dock_station); - dock_station = NULL; return ret; } @@ -868,15 +804,12 @@ static int dock_remove(void) printk(KERN_ERR "Error removing notify handler\n"); /* cleanup sysfs */ - device_remove_file(&dock_device->dev, &dev_attr_docked); - device_remove_file(&dock_device->dev, &dev_attr_undock); - device_remove_file(&dock_device->dev, &dev_attr_uid); - device_remove_file(&dock_device->dev, &dev_attr_flags); - platform_device_unregister(dock_device); + device_remove_file(&dock_device.dev, &dev_attr_docked); + device_remove_file(&dock_device.dev, &dev_attr_undock); + platform_device_unregister(&dock_device); /* free dock station memory */ kfree(dock_station); - dock_station = NULL; return 0; } diff --git a/trunk/drivers/acpi/ec.c b/trunk/drivers/acpi/ec.c index 10e851021eca..82f496c07675 100644 --- a/trunk/drivers/acpi/ec.c +++ b/trunk/drivers/acpi/ec.c @@ -34,26 +34,25 @@ #include #include #include -#include #include #include #include #include +#define _COMPONENT ACPI_EC_COMPONENT +ACPI_MODULE_NAME("ec"); +#define ACPI_EC_COMPONENT 0x00100000 #define ACPI_EC_CLASS "embedded_controller" #define ACPI_EC_HID "PNP0C09" #define ACPI_EC_DEVICE_NAME "Embedded Controller" #define ACPI_EC_FILE_INFO "info" - #undef PREFIX #define PREFIX "ACPI: EC: " - /* EC status register */ #define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */ #define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */ #define ACPI_EC_FLAG_BURST 0x10 /* burst mode */ #define ACPI_EC_FLAG_SCI 0x20 /* EC-SCI occurred */ - /* EC commands */ enum ec_command { ACPI_EC_COMMAND_READ = 0x80, @@ -62,7 +61,6 @@ enum ec_command { ACPI_EC_BURST_DISABLE = 0x83, ACPI_EC_COMMAND_QUERY = 0x84, }; - /* EC events */ enum ec_event { ACPI_EC_EVENT_OBF_1 = 1, /* Output buffer full */ @@ -96,16 +94,6 @@ static struct acpi_driver acpi_ec_driver = { /* If we find an EC via the ECDT, we need to keep a ptr to its context */ /* External interfaces use first EC only, so remember */ -typedef int (*acpi_ec_query_func) (void *data); - -struct acpi_ec_query_handler { - struct list_head node; - acpi_ec_query_func func; - acpi_handle handle; - void *data; - u8 query_bit; -}; - static struct acpi_ec { acpi_handle handle; unsigned long gpe; @@ -116,7 +104,6 @@ static struct acpi_ec { atomic_t query_pending; atomic_t event_count; wait_queue_head_t wait; - struct list_head list; } *boot_ec, *first_ec; /* -------------------------------------------------------------------------- @@ -258,7 +245,7 @@ static int acpi_ec_transaction(struct acpi_ec *ec, u8 command, status = acpi_ec_wait(ec, ACPI_EC_EVENT_IBF_0, 0, 0); if (status) { - printk(KERN_ERR PREFIX + printk(KERN_DEBUG PREFIX "input buffer is not empty, aborting transaction\n"); goto end; } @@ -407,67 +394,21 @@ static int acpi_ec_query(struct acpi_ec *ec, u8 * data) /* -------------------------------------------------------------------------- Event Management -------------------------------------------------------------------------- */ -int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit, - acpi_handle handle, acpi_ec_query_func func, - void *data) -{ - struct acpi_ec_query_handler *handler = - kzalloc(sizeof(struct acpi_ec_query_handler), GFP_KERNEL); - if (!handler) - return -ENOMEM; - - handler->query_bit = query_bit; - handler->handle = handle; - handler->func = func; - handler->data = data; - mutex_lock(&ec->lock); - list_add_tail(&handler->node, &ec->list); - mutex_unlock(&ec->lock); - return 0; -} - -EXPORT_SYMBOL_GPL(acpi_ec_add_query_handler); - -void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit) -{ - struct acpi_ec_query_handler *handler; - mutex_lock(&ec->lock); - list_for_each_entry(handler, &ec->list, node) { - if (query_bit == handler->query_bit) { - list_del(&handler->node); - kfree(handler); - break; - } - } - mutex_unlock(&ec->lock); -} - -EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler); static void acpi_ec_gpe_query(void *ec_cxt) { struct acpi_ec *ec = ec_cxt; u8 value = 0; - struct acpi_ec_query_handler *handler, copy; + char object_name[8]; if (!ec || acpi_ec_query(ec, &value)) return; - mutex_lock(&ec->lock); - list_for_each_entry(handler, &ec->list, node) { - if (value == handler->query_bit) { - /* have custom handler for this bit */ - memcpy(©, handler, sizeof(copy)); - mutex_unlock(&ec->lock); - if (copy.func) { - copy.func(copy.data); - } else if (copy.handle) { - acpi_evaluate_object(copy.handle, NULL, NULL, NULL); - } - return; - } - } - mutex_unlock(&ec->lock); - printk(KERN_ERR PREFIX "Handler for query 0x%x is not found!\n", value); + + snprintf(object_name, 8, "_Q%2.2X", value); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Evaluating %s", object_name)); + + acpi_evaluate_object(ec->handle, object_name, NULL, NULL); } static u32 acpi_ec_gpe_handler(void *data) @@ -486,7 +427,8 @@ static u32 acpi_ec_gpe_handler(void *data) if ((value & ACPI_EC_FLAG_SCI) && !atomic_read(&ec->query_pending)) { atomic_set(&ec->query_pending, 1); status = - acpi_os_execute(OSL_EC_BURST_HANDLER, acpi_ec_gpe_query, ec); + acpi_os_execute(OSL_EC_BURST_HANDLER, acpi_ec_gpe_query, + ec); } return status == AE_OK ? @@ -512,35 +454,57 @@ acpi_ec_space_setup(acpi_handle region_handle, } static acpi_status -acpi_ec_space_handler(u32 function, acpi_physical_address address, - u32 bits, acpi_integer *value, +acpi_ec_space_handler(u32 function, + acpi_physical_address address, + u32 bit_width, + acpi_integer * value, void *handler_context, void *region_context) { + int result = 0; struct acpi_ec *ec = handler_context; - int result = 0, i = 0; - u8 temp = 0; + u64 temp = *value; + acpi_integer f_v = 0; + int i = 0; if ((address > 0xFF) || !value || !handler_context) return AE_BAD_PARAMETER; - if (function != ACPI_READ && function != ACPI_WRITE) + if (bit_width != 8 && acpi_strict) { return AE_BAD_PARAMETER; + } - if (bits != 8 && acpi_strict) - return AE_BAD_PARAMETER; + next_byte: + switch (function) { + case ACPI_READ: + temp = 0; + result = acpi_ec_read(ec, (u8) address, (u8 *) & temp); + break; + case ACPI_WRITE: + result = acpi_ec_write(ec, (u8) address, (u8) temp); + break; + default: + result = -EINVAL; + goto out; + break; + } - while (bits - i > 0) { - if (function == ACPI_READ) { - result = acpi_ec_read(ec, address, &temp); - (*value) |= ((acpi_integer)temp) << i; - } else { - temp = 0xff & ((*value) >> i); - result = acpi_ec_write(ec, address, temp); - } - i += 8; - ++address; + bit_width -= 8; + if (bit_width) { + if (function == ACPI_READ) + f_v |= temp << 8 * i; + if (function == ACPI_WRITE) + temp >>= 8; + i++; + address++; + goto next_byte; } + if (function == ACPI_READ) { + f_v |= temp << 8 * i; + *value = f_v; + } + + out: switch (result) { case -EINVAL: return AE_BAD_PARAMETER; @@ -633,6 +597,9 @@ static int acpi_ec_remove_fs(struct acpi_device *device) static acpi_status ec_parse_io_ports(struct acpi_resource *resource, void *context); +static acpi_status +ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval); + static struct acpi_ec *make_acpi_ec(void) { struct acpi_ec *ec = kzalloc(sizeof(struct acpi_ec), GFP_KERNEL); @@ -643,52 +610,13 @@ static struct acpi_ec *make_acpi_ec(void) atomic_set(&ec->event_count, 1); mutex_init(&ec->lock); init_waitqueue_head(&ec->wait); - INIT_LIST_HEAD(&ec->list); return ec; } -static acpi_status -acpi_ec_register_query_methods(acpi_handle handle, u32 level, - void *context, void **return_value) -{ - struct acpi_namespace_node *node = handle; - struct acpi_ec *ec = context; - int value = 0; - if (sscanf(node->name.ascii, "_Q%x", &value) == 1) { - acpi_ec_add_query_handler(ec, value, handle, NULL, NULL); - } - return AE_OK; -} - -static int ec_parse_device(struct acpi_ec *ec, acpi_handle handle) -{ - if (ACPI_FAILURE(acpi_walk_resources(handle, METHOD_NAME__CRS, - ec_parse_io_ports, ec))) - return -EINVAL; - - /* Get GPE bit assignment (EC events). */ - /* TODO: Add support for _GPE returning a package */ - if (ACPI_FAILURE(acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe))) - return -EINVAL; - - /* Use the global lock for all EC transactions? */ - acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock); - - /* Find and register all query methods */ - acpi_walk_namespace(ACPI_TYPE_METHOD, handle, 1, - acpi_ec_register_query_methods, ec, NULL); - - ec->handle = handle; - - printk(KERN_INFO PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx", - ec->gpe, ec->command_addr, ec->data_addr); - - return 0; -} - static int acpi_ec_add(struct acpi_device *device) { + acpi_status status = AE_OK; struct acpi_ec *ec = NULL; if (!device) @@ -701,7 +629,8 @@ static int acpi_ec_add(struct acpi_device *device) if (!ec) return -ENOMEM; - if (ec_parse_device(ec, device->handle)) { + status = ec_parse_device(device->handle, 0, ec, NULL); + if (status != AE_CTRL_TERMINATE) { kfree(ec); return -EINVAL; } @@ -712,8 +641,6 @@ static int acpi_ec_add(struct acpi_device *device) /* We might have incorrect info for GL at boot time */ mutex_lock(&boot_ec->lock); boot_ec->global_lock = ec->global_lock; - /* Copy handlers from new ec into boot ec */ - list_splice(&ec->list, &boot_ec->list); mutex_unlock(&boot_ec->lock); kfree(ec); ec = boot_ec; @@ -724,24 +651,22 @@ static int acpi_ec_add(struct acpi_device *device) acpi_driver_data(device) = ec; acpi_ec_add_fs(device); + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "%s [%s] (gpe %d) interrupt mode.", + acpi_device_name(device), acpi_device_bid(device), + (u32) ec->gpe)); + return 0; } static int acpi_ec_remove(struct acpi_device *device, int type) { struct acpi_ec *ec; - struct acpi_ec_query_handler *handler; if (!device) return -EINVAL; ec = acpi_driver_data(device); - mutex_lock(&ec->lock); - list_for_each_entry(handler, &ec->list, node) { - list_del(&handler->node); - kfree(handler); - } - mutex_unlock(&ec->lock); acpi_ec_remove_fs(device); acpi_driver_data(device) = NULL; if (ec == first_ec) @@ -797,13 +722,15 @@ static int ec_install_handlers(struct acpi_ec *ec) return -ENODEV; } + /* EC is fully operational, allow queries */ + atomic_set(&ec->query_pending, 0); + return 0; } static int acpi_ec_start(struct acpi_device *device) { struct acpi_ec *ec; - int ret = 0; if (!device) return -EINVAL; @@ -813,14 +740,14 @@ static int acpi_ec_start(struct acpi_device *device) if (!ec) return -EINVAL; - /* Boot EC is already working */ - if (ec != boot_ec) - ret = ec_install_handlers(ec); + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "gpe=0x%02lx, ports=0x%2lx,0x%2lx", + ec->gpe, ec->command_addr, ec->data_addr)); - /* EC is fully operational, allow queries */ - atomic_set(&ec->query_pending, 0); + /* Boot EC is already working */ + if (ec == boot_ec) + return 0; - return ret; + return ec_install_handlers(ec); } static int acpi_ec_stop(struct acpi_device *device, int type) @@ -852,6 +779,34 @@ static int acpi_ec_stop(struct acpi_device *device, int type) return 0; } +static acpi_status +ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval) +{ + acpi_status status; + + struct acpi_ec *ec = context; + status = acpi_walk_resources(handle, METHOD_NAME__CRS, + ec_parse_io_ports, ec); + if (ACPI_FAILURE(status)) + return status; + + /* Get GPE bit assignment (EC events). */ + /* TODO: Add support for _GPE returning a package */ + status = acpi_evaluate_integer(handle, "_GPE", NULL, &ec->gpe); + if (ACPI_FAILURE(status)) + return status; + + /* Use the global lock for all EC transactions? */ + acpi_evaluate_integer(handle, "_GLK", NULL, &ec->global_lock); + + ec->handle = handle; + + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "GPE=0x%02lx, ports=0x%2lx, 0x%2lx", + ec->gpe, ec->command_addr, ec->data_addr)); + + return AE_CTRL_TERMINATE; +} + int __init acpi_ec_ecdt_probe(void) { int ret; @@ -870,7 +825,7 @@ int __init acpi_ec_ecdt_probe(void) if (ACPI_FAILURE(status)) goto error; - printk(KERN_INFO PREFIX "EC description table is found, configuring boot EC\n"); + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found ECDT")); boot_ec->command_addr = ecdt_ptr->control.address; boot_ec->data_addr = ecdt_ptr->data.address; diff --git a/trunk/drivers/acpi/events/evgpeblk.c b/trunk/drivers/acpi/events/evgpeblk.c index 361ebe6c4a6f..902c287b3a4f 100644 --- a/trunk/drivers/acpi/events/evgpeblk.c +++ b/trunk/drivers/acpi/events/evgpeblk.c @@ -586,10 +586,6 @@ acpi_ev_delete_gpe_xrupt(struct acpi_gpe_xrupt_info *gpe_xrupt) flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock); if (gpe_xrupt->previous) { gpe_xrupt->previous->next = gpe_xrupt->next; - } else { - /* No previous, update list head */ - - acpi_gbl_gpe_xrupt_list_head = gpe_xrupt->next; } if (gpe_xrupt->next) { diff --git a/trunk/drivers/acpi/events/evrgnini.c b/trunk/drivers/acpi/events/evrgnini.c index 23ee7bc4a705..400d90fca966 100644 --- a/trunk/drivers/acpi/events/evrgnini.c +++ b/trunk/drivers/acpi/events/evrgnini.c @@ -284,7 +284,6 @@ acpi_ev_pci_config_region_setup(acpi_handle handle, } if (!pci_device_node) { - ACPI_FREE(pci_id); return_ACPI_STATUS(AE_AML_OPERAND_TYPE); } diff --git a/trunk/drivers/acpi/glue.c b/trunk/drivers/acpi/glue.c index 4893e256e399..41427a41f620 100644 --- a/trunk/drivers/acpi/glue.c +++ b/trunk/drivers/acpi/glue.c @@ -16,7 +16,7 @@ #if ACPI_GLUE_DEBUG #define DBG(x...) printk(PREFIX x) #else -#define DBG(x...) do { } while(0) +#define DBG(x...) #endif static LIST_HEAD(bus_type_list); static DECLARE_RWSEM(bus_type_sem); diff --git a/trunk/drivers/acpi/pci_link.c b/trunk/drivers/acpi/pci_link.c index 3448edd61dc4..acc594771379 100644 --- a/trunk/drivers/acpi/pci_link.c +++ b/trunk/drivers/acpi/pci_link.c @@ -733,7 +733,7 @@ static int acpi_pci_link_add(struct acpi_device *device) /* query and set link->irq.active */ acpi_pci_link_get_current(link); - printk(KERN_INFO PREFIX "%s [%s] (IRQs", acpi_device_name(device), + printk(PREFIX "%s [%s] (IRQs", acpi_device_name(device), acpi_device_bid(device)); for (i = 0; i < link->irq.possible_count; i++) { if (link->irq.active == link->irq.possible[i]) { diff --git a/trunk/drivers/acpi/processor_idle.c b/trunk/drivers/acpi/processor_idle.c index a898991f77cb..bb5d23be4260 100644 --- a/trunk/drivers/acpi/processor_idle.c +++ b/trunk/drivers/acpi/processor_idle.c @@ -490,17 +490,7 @@ static void acpi_processor_idle(void) case ACPI_STATE_C3: - /* - * disable bus master - * bm_check implies we need ARB_DIS - * !bm_check implies we need cache flush - * bm_control implies whether we can do ARB_DIS - * - * That leaves a case where bm_check is set and bm_control is - * not set. In that case we cannot do much, we enter C3 - * without doing anything. - */ - if (pr->flags.bm_check && pr->flags.bm_control) { + if (pr->flags.bm_check) { if (atomic_inc_return(&c3_cpu_count) == num_online_cpus()) { /* @@ -509,7 +499,7 @@ static void acpi_processor_idle(void) */ acpi_set_register(ACPI_BITREG_ARB_DISABLE, 1); } - } else if (!pr->flags.bm_check) { + } else { /* SMP with no shared cache... Invalidate cache */ ACPI_FLUSH_CPU_CACHE(); } @@ -521,7 +511,7 @@ static void acpi_processor_idle(void) acpi_cstate_enter(cx); /* Get end time (ticks) */ t2 = inl(acpi_gbl_FADT.xpm_timer_block.address); - if (pr->flags.bm_check && pr->flags.bm_control) { + if (pr->flags.bm_check) { /* Enable bus master arbitration */ atomic_dec(&c3_cpu_count); acpi_set_register(ACPI_BITREG_ARB_DISABLE, 0); @@ -971,9 +961,9 @@ static void acpi_processor_power_verify_c3(struct acpi_processor *pr, if (pr->flags.bm_check) { /* bus mastering control is necessary */ if (!pr->flags.bm_control) { - /* In this case we enter C3 without bus mastering */ ACPI_DEBUG_PRINT((ACPI_DB_INFO, - "C3 support without bus mastering control\n")); + "C3 support requires bus mastering control\n")); + return; } } else { /* diff --git a/trunk/drivers/acpi/sbs.c b/trunk/drivers/acpi/sbs.c index 974d00ccfe84..c1bae106833c 100644 --- a/trunk/drivers/acpi/sbs.c +++ b/trunk/drivers/acpi/sbs.c @@ -127,7 +127,7 @@ static int acpi_sbs_resume(struct acpi_device *device); static struct acpi_driver acpi_sbs_driver = { .name = "sbs", .class = ACPI_SBS_CLASS, - .ids = "ACPI0001,ACPI0005", + .ids = ACPI_SBS_HID, .ops = { .add = acpi_sbs_add, .remove = acpi_sbs_remove, @@ -176,8 +176,10 @@ struct acpi_battery { }; struct acpi_sbs { + acpi_handle handle; int base; struct acpi_device *device; + struct acpi_ec_smbus *smbus; struct mutex mutex; int sbsm_present; int sbsm_batteries_supported; @@ -509,7 +511,7 @@ static int acpi_sbsm_get_info(struct acpi_sbs *sbs) "acpi_sbs_read_word() failed")); goto end; } - sbs->sbsm_present = 1; + sbs->sbsm_batteries_supported = battery_system_info & 0x000f; end: @@ -1628,12 +1630,13 @@ static int acpi_sbs_add(struct acpi_device *device) { struct acpi_sbs *sbs = NULL; int result = 0, remove_result = 0; + unsigned long sbs_obj; int id; acpi_status status = AE_OK; unsigned long val; status = - acpi_evaluate_integer(device->handle, "_EC", NULL, &val); + acpi_evaluate_integer(device->parent->handle, "_EC", NULL, &val); if (ACPI_FAILURE(status)) { ACPI_EXCEPTION((AE_INFO, AE_ERROR, "Error obtaining _EC")); return -EIO; @@ -1650,7 +1653,7 @@ static int acpi_sbs_add(struct acpi_device *device) sbs_mutex_lock(sbs); - sbs->base = 0xff & (val >> 8); + sbs->base = (val & 0xff00ull) >> 8; sbs->device = device; strcpy(acpi_device_name(device), ACPI_SBS_DEVICE_NAME); @@ -1662,10 +1665,24 @@ static int acpi_sbs_add(struct acpi_device *device) ACPI_EXCEPTION((AE_INFO, AE_ERROR, "acpi_ac_add() failed")); goto end; } + status = acpi_evaluate_integer(device->handle, "_SBS", NULL, &sbs_obj); + if (status) { + ACPI_EXCEPTION((AE_INFO, status, + "acpi_evaluate_integer() failed")); + result = -EIO; + goto end; + } + if (sbs_obj > 0) { + result = acpi_sbsm_get_info(sbs); + if (result) { + ACPI_EXCEPTION((AE_INFO, AE_ERROR, + "acpi_sbsm_get_info() failed")); + goto end; + } + sbs->sbsm_present = 1; + } - acpi_sbsm_get_info(sbs); - - if (!sbs->sbsm_present) { + if (sbs->sbsm_present == 0) { result = acpi_battery_add(sbs, 0); if (result) { ACPI_EXCEPTION((AE_INFO, AE_ERROR, @@ -1685,6 +1702,8 @@ static int acpi_sbs_add(struct acpi_device *device) } } + sbs->handle = device->handle; + init_timer(&sbs->update_timer); result = acpi_check_update_proc(sbs); if (result) diff --git a/trunk/drivers/acpi/sleep/main.c b/trunk/drivers/acpi/sleep/main.c index 3279e72a94f8..42127c0d612c 100644 --- a/trunk/drivers/acpi/sleep/main.c +++ b/trunk/drivers/acpi/sleep/main.c @@ -210,6 +210,11 @@ static void acpi_hibernation_finish(void) /* reset firmware waking vector */ acpi_set_firmware_waking_vector((acpi_physical_address) 0); + + if (init_8259A_after_S1) { + printk("Broken toshiba laptop -> kicking interrupts\n"); + init_8259A(0); + } } static int acpi_hibernation_pre_restore(void) diff --git a/trunk/drivers/acpi/tables/tbfadt.c b/trunk/drivers/acpi/tables/tbfadt.c index 002bb33003af..1285e91474fb 100644 --- a/trunk/drivers/acpi/tables/tbfadt.c +++ b/trunk/drivers/acpi/tables/tbfadt.c @@ -211,17 +211,14 @@ void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags) * DESCRIPTION: Get a local copy of the FADT and convert it to a common format. * Performs validation on some important FADT fields. * - * NOTE: We create a local copy of the FADT regardless of the version. - * ******************************************************************************/ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length) { /* - * Check if the FADT is larger than the largest table that we expect - * (the ACPI 2.0/3.0 version). If so, truncate the table, and issue - * a warning. + * Check if the FADT is larger than what we know about (ACPI 2.0 version). + * Truncate the table, but make some noise. */ if (length > sizeof(struct acpi_table_fadt)) { ACPI_WARNING((AE_INFO, @@ -230,12 +227,10 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length) sizeof(struct acpi_table_fadt))); } - /* Clear the entire local FADT */ + /* Copy the entire FADT locally. Zero first for tb_convert_fadt */ ACPI_MEMSET(&acpi_gbl_FADT, 0, sizeof(struct acpi_table_fadt)); - /* Copy the original FADT, up to sizeof (struct acpi_table_fadt) */ - ACPI_MEMCPY(&acpi_gbl_FADT, table, ACPI_MIN(length, sizeof(struct acpi_table_fadt))); @@ -256,7 +251,7 @@ void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length) * RETURN: None * * DESCRIPTION: Converts all versions of the FADT to a common internal format. - * Expand all 32-bit addresses to 64-bit. + * -> Expand all 32-bit addresses to 64-bit. * * NOTE: acpi_gbl_FADT must be of size (struct acpi_table_fadt), * and must contain a copy of the actual FADT. @@ -297,23 +292,8 @@ static void acpi_tb_convert_fadt(void) } /* - * For ACPI 1.0 FADTs (revision 1 or 2), ensure that reserved fields which - * should be zero are indeed zero. This will workaround BIOSs that - * inadvertently place values in these fields. - * - * The ACPI 1.0 reserved fields that will be zeroed are the bytes located at - * offset 45, 55, 95, and the word located at offset 109, 110. - */ - if (acpi_gbl_FADT.header.revision < 3) { - acpi_gbl_FADT.preferred_profile = 0; - acpi_gbl_FADT.pstate_control = 0; - acpi_gbl_FADT.cst_control = 0; - acpi_gbl_FADT.boot_flags = 0; - } - - /* - * Expand the ACPI 1.0 32-bit V1.0 addresses to the ACPI 2.0 64-bit "X" - * generic address structures as necessary. + * Expand the 32-bit V1.0 addresses to the 64-bit "X" generic address + * structures as necessary. */ for (i = 0; i < ACPI_FADT_INFO_ENTRIES; i++) { target = @@ -369,6 +349,18 @@ static void acpi_tb_convert_fadt(void) acpi_gbl_FADT.xpm1a_event_block.space_id; } + + /* + * For ACPI 1.0 FADTs, ensure that reserved fields (which should be zero) + * are indeed zero. This will workaround BIOSs that inadvertently placed + * values in these fields. + */ + if (acpi_gbl_FADT.header.revision < 3) { + acpi_gbl_FADT.preferred_profile = 0; + acpi_gbl_FADT.pstate_control = 0; + acpi_gbl_FADT.cst_control = 0; + acpi_gbl_FADT.boot_flags = 0; + } } /****************************************************************************** diff --git a/trunk/drivers/misc/sony-laptop.c b/trunk/drivers/misc/sony-laptop.c index 9623eaf4f89f..0f378fe44c1d 100644 --- a/trunk/drivers/misc/sony-laptop.c +++ b/trunk/drivers/misc/sony-laptop.c @@ -487,6 +487,14 @@ SNC_HANDLE_NAMES(audiopower_set, "AZPW"); SNC_HANDLE_NAMES(lanpower_get, "GLNP"); SNC_HANDLE_NAMES(lanpower_set, "LNPW"); +SNC_HANDLE_NAMES(lidstate_get, "GLID"); + +SNC_HANDLE_NAMES(indicatorlamp_get, "GILS"); +SNC_HANDLE_NAMES(indicatorlamp_set, "SILS"); + +SNC_HANDLE_NAMES(gainbass_get, "GMGB"); +SNC_HANDLE_NAMES(gainbass_set, "CMGB"); + SNC_HANDLE_NAMES(PID_get, "GPID"); SNC_HANDLE_NAMES(CTR_get, "GCTR"); @@ -507,6 +515,12 @@ static struct sony_nc_value sony_nc_values[] = { boolean_validate, 0), SNC_HANDLE(lanpower, snc_lanpower_get, snc_lanpower_set, boolean_validate, 1), + SNC_HANDLE(lidstate, snc_lidstate_get, NULL, + boolean_validate, 0), + SNC_HANDLE(indicatorlamp, snc_indicatorlamp_get, snc_indicatorlamp_set, + boolean_validate, 0), + SNC_HANDLE(gainbass, snc_gainbass_get, snc_gainbass_set, + boolean_validate, 0), /* unknown methods */ SNC_HANDLE(PID, snc_PID_get, NULL, NULL, 1), SNC_HANDLE(CTR, snc_CTR_get, snc_CTR_set, NULL, 1), diff --git a/trunk/drivers/net/Kconfig b/trunk/drivers/net/Kconfig index f8a602caabcb..3073f679584b 100644 --- a/trunk/drivers/net/Kconfig +++ b/trunk/drivers/net/Kconfig @@ -5,7 +5,6 @@ menuconfig NETDEVICES default y if UML - depends on NET bool "Network device support" ---help--- You can say N here if you don't intend to connect your Linux box to diff --git a/trunk/drivers/net/irda/Kconfig b/trunk/drivers/net/irda/Kconfig index 2098d0af8ff5..829da9a1d113 100644 --- a/trunk/drivers/net/irda/Kconfig +++ b/trunk/drivers/net/irda/Kconfig @@ -155,15 +155,6 @@ config KINGSUN_DONGLE To compile it as a module, choose M here: the module will be called kingsun-sir. -config EP7211_DONGLE - tristate "EP7211 I/R support" - depends on IRTTY_SIR && ARCH_EP7211 && IRDA && EXPERIMENTAL - help - Say Y here if you want to build support for the Cirrus logic - EP7211 chipset's infrared module. - - - comment "Old SIR device drivers" config IRPORT_SIR @@ -364,7 +355,7 @@ config WINBOND_FIR config TOSHIBA_FIR tristate "Toshiba Type-O IR Port" - depends on IRDA && PCI && !64BIT && VIRT_TO_BUS + depends on IRDA && PCI && !64BIT help Say Y here if you want to build support for the Toshiba Type-O IR and Donau oboe chipsets. These chipsets are used by the Toshiba diff --git a/trunk/drivers/net/irda/Makefile b/trunk/drivers/net/irda/Makefile index 2808ef5c7b79..233a2f923730 100644 --- a/trunk/drivers/net/irda/Makefile +++ b/trunk/drivers/net/irda/Makefile @@ -45,7 +45,6 @@ obj-$(CONFIG_MCP2120_DONGLE) += mcp2120-sir.o obj-$(CONFIG_ACT200L_DONGLE) += act200l-sir.o obj-$(CONFIG_MA600_DONGLE) += ma600-sir.o obj-$(CONFIG_TOIM3232_DONGLE) += toim3232-sir.o -obj-$(CONFIG_EP7211_DONGLE) += ep7211-sir.o obj-$(CONFIG_KINGSUN_DONGLE) += kingsun-sir.o # The SIR helper module diff --git a/trunk/drivers/net/irda/ep7211-sir.c b/trunk/drivers/net/irda/ep7211-sir.c deleted file mode 100644 index 831572429bb9..000000000000 --- a/trunk/drivers/net/irda/ep7211-sir.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * IR port driver for the Cirrus Logic EP7211 processor. - * - * Copyright 2001, Blue Mug Inc. All rights reserved. - * Copyright 2007, Samuel Ortiz - */ -#include -#include -#include -#include -#include - -#include -#include - -#include -#include - -#include "sir-dev.h" - -#define MIN_DELAY 25 /* 15 us, but wait a little more to be sure */ -#define MAX_DELAY 10000 /* 1 ms */ - -static int ep7211_open(struct sir_dev *dev); -static int ep7211_close(struct sir_dev *dev); -static int ep7211_change_speed(struct sir_dev *dev, unsigned speed); -static int ep7211_reset(struct sir_dev *dev); - -static struct dongle_driver ep7211 = { - .owner = THIS_MODULE, - .driver_name = "EP7211 IR driver", - .type = IRDA_EP7211_DONGLE, - .open = ep7211_open, - .close = ep7211_close, - .reset = ep7211_reset, - .set_speed = ep7211_change_speed, -}; - -static int __init ep7211_sir_init(void) -{ - return irda_register_dongle(&ep7211); -} - -static void __exit ep7211_sir_cleanup(void) -{ - irda_unregister_dongle(&ep7211); -} - -static int ep7211_open(struct sir_dev *dev) -{ - unsigned int syscon; - - /* Turn on the SIR encoder. */ - syscon = clps_readl(SYSCON1); - syscon |= SYSCON1_SIREN; - clps_writel(syscon, SYSCON1); - - return 0; -} - -static int ep7211_close(struct sir_dev *dev) -{ - unsigned int syscon; - - /* Turn off the SIR encoder. */ - syscon = clps_readl(SYSCON1); - syscon &= ~SYSCON1_SIREN; - clps_writel(syscon, SYSCON1); - - return 0; -} - -static int ep7211_change_speed(struct sir_dev *dev, unsigned speed) -{ - return 0; -} - -static int ep7211_reset(struct sir_dev *dev) -{ - return 0; -} - -MODULE_AUTHOR("Samuel Ortiz "); -MODULE_DESCRIPTION("EP7211 IR dongle driver"); -MODULE_LICENSE("GPL"); -MODULE_ALIAS("irda-dongle-13"); /* IRDA_EP7211_DONGLE */ - -module_init(ep7211_sir_init); -module_exit(ep7211_sir_cleanup); diff --git a/trunk/include/acpi/acmacros.h b/trunk/include/acpi/acmacros.h index 45662f6dbdb6..8948a6461834 100644 --- a/trunk/include/acpi/acmacros.h +++ b/trunk/include/acpi/acmacros.h @@ -486,8 +486,6 @@ #define ACPI_FUNCTION_NAME(name) #endif -#ifdef DEBUG_FUNC_TRACE - #define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ acpi_ut_trace(ACPI_DEBUG_PARAMETERS) #define ACPI_FUNCTION_TRACE_PTR(a,b) ACPI_FUNCTION_NAME(a) \ @@ -565,27 +563,6 @@ #endif /* ACPI_SIMPLE_RETURN_MACROS */ -#else /* !DEBUG_FUNC_TRACE */ - -#define ACPI_FUNCTION_TRACE(a) -#define ACPI_FUNCTION_TRACE_PTR(a,b) -#define ACPI_FUNCTION_TRACE_U32(a,b) -#define ACPI_FUNCTION_TRACE_STR(a,b) -#define ACPI_FUNCTION_EXIT -#define ACPI_FUNCTION_STATUS_EXIT(s) -#define ACPI_FUNCTION_VALUE_EXIT(s) -#define ACPI_FUNCTION_TRACE(a) -#define ACPI_FUNCTION_ENTRY() - -#define return_VOID return -#define return_ACPI_STATUS(s) return(s) -#define return_VALUE(s) return(s) -#define return_UINT8(s) return(s) -#define return_UINT32(s) return(s) -#define return_PTR(s) return(s) - -#endif /* DEBUG_FUNC_TRACE */ - /* Conditional execution */ #define ACPI_DEBUG_EXEC(a) a @@ -622,26 +599,26 @@ #define ACPI_DEBUG_EXEC(a) #define ACPI_NORMAL_EXEC(a) a; -#define ACPI_DEBUG_DEFINE(a) do { } while(0) -#define ACPI_DEBUG_ONLY_MEMBERS(a) do { } while(0) -#define ACPI_FUNCTION_NAME(a) do { } while(0) -#define ACPI_FUNCTION_TRACE(a) do { } while(0) -#define ACPI_FUNCTION_TRACE_PTR(a,b) do { } while(0) -#define ACPI_FUNCTION_TRACE_U32(a,b) do { } while(0) -#define ACPI_FUNCTION_TRACE_STR(a,b) do { } while(0) -#define ACPI_FUNCTION_EXIT do { } while(0) -#define ACPI_FUNCTION_STATUS_EXIT(s) do { } while(0) -#define ACPI_FUNCTION_VALUE_EXIT(s) do { } while(0) -#define ACPI_FUNCTION_ENTRY() do { } while(0) -#define ACPI_DUMP_STACK_ENTRY(a) do { } while(0) -#define ACPI_DUMP_OPERANDS(a,b,c,d,e) do { } while(0) -#define ACPI_DUMP_ENTRY(a,b) do { } while(0) -#define ACPI_DUMP_TABLES(a,b) do { } while(0) -#define ACPI_DUMP_PATHNAME(a,b,c,d) do { } while(0) -#define ACPI_DUMP_RESOURCE_LIST(a) do { } while(0) -#define ACPI_DUMP_BUFFER(a,b) do { } while(0) -#define ACPI_DEBUG_PRINT(pl) do { } while(0) -#define ACPI_DEBUG_PRINT_RAW(pl) do { } while(0) +#define ACPI_DEBUG_DEFINE(a) +#define ACPI_DEBUG_ONLY_MEMBERS(a) +#define ACPI_FUNCTION_NAME(a) +#define ACPI_FUNCTION_TRACE(a) +#define ACPI_FUNCTION_TRACE_PTR(a,b) +#define ACPI_FUNCTION_TRACE_U32(a,b) +#define ACPI_FUNCTION_TRACE_STR(a,b) +#define ACPI_FUNCTION_EXIT +#define ACPI_FUNCTION_STATUS_EXIT(s) +#define ACPI_FUNCTION_VALUE_EXIT(s) +#define ACPI_FUNCTION_ENTRY() +#define ACPI_DUMP_STACK_ENTRY(a) +#define ACPI_DUMP_OPERANDS(a,b,c,d,e) +#define ACPI_DUMP_ENTRY(a,b) +#define ACPI_DUMP_TABLES(a,b) +#define ACPI_DUMP_PATHNAME(a,b,c,d) +#define ACPI_DUMP_RESOURCE_LIST(a) +#define ACPI_DUMP_BUFFER(a,b) +#define ACPI_DEBUG_PRINT(pl) +#define ACPI_DEBUG_PRINT_RAW(pl) #define return_VOID return #define return_ACPI_STATUS(s) return(s) diff --git a/trunk/include/acpi/acoutput.h b/trunk/include/acpi/acoutput.h index c090a8b0bc99..7812267b577f 100644 --- a/trunk/include/acpi/acoutput.h +++ b/trunk/include/acpi/acoutput.h @@ -178,8 +178,8 @@ /* Defaults for debug_level, debug and normal */ -#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR) -#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR) +#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) +#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_WARN | ACPI_LV_ERROR | ACPI_LV_DEBUG_OBJECT) #define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) #endif /* __ACOUTPUT_H__ */ diff --git a/trunk/include/acpi/platform/acenv.h b/trunk/include/acpi/platform/acenv.h index c785485e62a6..dab2ec59a3b0 100644 --- a/trunk/include/acpi/platform/acenv.h +++ b/trunk/include/acpi/platform/acenv.h @@ -136,7 +136,7 @@ /*! [Begin] no source code translation */ -#if defined(_LINUX) || defined(__linux__) +#if defined(__linux__) #include "aclinux.h" #elif defined(_AED_EFI) diff --git a/trunk/include/acpi/platform/aclinux.h b/trunk/include/acpi/platform/aclinux.h index 6ed15a0978eb..a568717f98c6 100644 --- a/trunk/include/acpi/platform/aclinux.h +++ b/trunk/include/acpi/platform/aclinux.h @@ -91,10 +91,7 @@ #define ACPI_USE_NATIVE_DIVIDE #endif -#ifndef __cdecl #define __cdecl -#endif - #define ACPI_FLUSH_CPU_CACHE() #endif /* __KERNEL__ */ diff --git a/trunk/include/asm-sparc/irq.h b/trunk/include/asm-sparc/irq.h index afb88a5973f0..ff520ea97473 100644 --- a/trunk/include/asm-sparc/irq.h +++ b/trunk/include/asm-sparc/irq.h @@ -7,16 +7,178 @@ #ifndef _SPARC_IRQ_H #define _SPARC_IRQ_H +#include +#include /* For NR_CPUS */ #include +#include /* For SUN4M_NCPUS */ +#include + +#define __irq_ino(irq) irq +#define __irq_pil(irq) irq + #define NR_IRQS 16 #define irq_canonicalize(irq) (irq) -extern void disable_irq_nosync(unsigned int irq); -extern void disable_irq(unsigned int irq); -extern void enable_irq(unsigned int irq); +/* Dave Redman (djhr@tadpole.co.uk) + * changed these to function pointers.. it saves cycles and will allow + * the irq dependencies to be split into different files at a later date + * sun4c_irq.c, sun4m_irq.c etc so we could reduce the kernel size. + * Jakub Jelinek (jj@sunsite.mff.cuni.cz) + * Changed these to btfixup entities... It saves cycles :) + */ +BTFIXUPDEF_CALL(void, disable_irq, unsigned int) +BTFIXUPDEF_CALL(void, enable_irq, unsigned int) +BTFIXUPDEF_CALL(void, disable_pil_irq, unsigned int) +BTFIXUPDEF_CALL(void, enable_pil_irq, unsigned int) +BTFIXUPDEF_CALL(void, clear_clock_irq, void) +BTFIXUPDEF_CALL(void, clear_profile_irq, int) +BTFIXUPDEF_CALL(void, load_profile_irq, int, unsigned int) + +static inline void disable_irq_nosync(unsigned int irq) +{ + BTFIXUP_CALL(disable_irq)(irq); +} + +static inline void disable_irq(unsigned int irq) +{ + BTFIXUP_CALL(disable_irq)(irq); +} + +static inline void enable_irq(unsigned int irq) +{ + BTFIXUP_CALL(enable_irq)(irq); +} + +static inline void disable_pil_irq(unsigned int irq) +{ + BTFIXUP_CALL(disable_pil_irq)(irq); +} + +static inline void enable_pil_irq(unsigned int irq) +{ + BTFIXUP_CALL(enable_pil_irq)(irq); +} + +static inline void clear_clock_irq(void) +{ + BTFIXUP_CALL(clear_clock_irq)(); +} + +static inline void clear_profile_irq(int irq) +{ + BTFIXUP_CALL(clear_profile_irq)(irq); +} + +static inline void load_profile_irq(int cpu, int limit) +{ + BTFIXUP_CALL(load_profile_irq)(cpu, limit); +} + +extern void (*sparc_init_timers)(irq_handler_t lvl10_irq); +extern void claim_ticker14(irq_handler_t irq_handler, + int irq, + unsigned int timeout); + +#ifdef CONFIG_SMP +BTFIXUPDEF_CALL(void, set_cpu_int, int, int) +BTFIXUPDEF_CALL(void, clear_cpu_int, int, int) +BTFIXUPDEF_CALL(void, set_irq_udt, int) + +#define set_cpu_int(cpu,level) BTFIXUP_CALL(set_cpu_int)(cpu,level) +#define clear_cpu_int(cpu,level) BTFIXUP_CALL(clear_cpu_int)(cpu,level) +#define set_irq_udt(cpu) BTFIXUP_CALL(set_irq_udt)(cpu) +#endif extern int request_fast_irq(unsigned int irq, irq_handler_t handler, unsigned long flags, __const__ char *devname); +/* On the sun4m, just like the timers, we have both per-cpu and master + * interrupt registers. + */ + +/* These registers are used for sending/receiving irqs from/to + * different cpu's. + */ +struct sun4m_intreg_percpu { + unsigned int tbt; /* Interrupts still pending for this cpu. */ + + /* These next two registers are WRITE-ONLY and are only + * "on bit" sensitive, "off bits" written have NO affect. + */ + unsigned int clear; /* Clear this cpus irqs here. */ + unsigned int set; /* Set this cpus irqs here. */ + unsigned char space[PAGE_SIZE - 12]; +}; + +/* + * djhr + * Actually the clear and set fields in this struct are misleading.. + * according to the SLAVIO manual (and the same applies for the SEC) + * the clear field clears bits in the mask which will ENABLE that IRQ + * the set field sets bits in the mask to DISABLE the IRQ. + * + * Also the undirected_xx address in the SLAVIO is defined as + * RESERVED and write only.. + * + * DAVEM_NOTE: The SLAVIO only specifies behavior on uniprocessor + * sun4m machines, for MP the layout makes more sense. + */ +struct sun4m_intregs { + struct sun4m_intreg_percpu cpu_intregs[SUN4M_NCPUS]; + unsigned int tbt; /* IRQ's that are still pending. */ + unsigned int irqs; /* Master IRQ bits. */ + + /* Again, like the above, two these registers are WRITE-ONLY. */ + unsigned int clear; /* Clear master IRQ's by setting bits here. */ + unsigned int set; /* Set master IRQ's by setting bits here. */ + + /* This register is both READ and WRITE. */ + unsigned int undirected_target; /* Which cpu gets undirected irqs. */ +}; + +extern struct sun4m_intregs *sun4m_interrupts; + +/* + * Bit field defines for the interrupt registers on various + * Sparc machines. + */ + +/* The sun4c interrupt register. */ +#define SUN4C_INT_ENABLE 0x01 /* Allow interrupts. */ +#define SUN4C_INT_E14 0x80 /* Enable level 14 IRQ. */ +#define SUN4C_INT_E10 0x20 /* Enable level 10 IRQ. */ +#define SUN4C_INT_E8 0x10 /* Enable level 8 IRQ. */ +#define SUN4C_INT_E6 0x08 /* Enable level 6 IRQ. */ +#define SUN4C_INT_E4 0x04 /* Enable level 4 IRQ. */ +#define SUN4C_INT_E1 0x02 /* Enable level 1 IRQ. */ + +/* Dave Redman (djhr@tadpole.co.uk) + * The sun4m interrupt registers. + */ +#define SUN4M_INT_ENABLE 0x80000000 +#define SUN4M_INT_E14 0x00000080 +#define SUN4M_INT_E10 0x00080000 + +#define SUN4M_HARD_INT(x) (0x000000001 << (x)) +#define SUN4M_SOFT_INT(x) (0x000010000 << (x)) + +#define SUN4M_INT_MASKALL 0x80000000 /* mask all interrupts */ +#define SUN4M_INT_MODULE_ERR 0x40000000 /* module error */ +#define SUN4M_INT_M2S_WRITE 0x20000000 /* write buffer error */ +#define SUN4M_INT_ECC 0x10000000 /* ecc memory error */ +#define SUN4M_INT_FLOPPY 0x00400000 /* floppy disk */ +#define SUN4M_INT_MODULE 0x00200000 /* module interrupt */ +#define SUN4M_INT_VIDEO 0x00100000 /* onboard video */ +#define SUN4M_INT_REALTIME 0x00080000 /* system timer */ +#define SUN4M_INT_SCSI 0x00040000 /* onboard scsi */ +#define SUN4M_INT_AUDIO 0x00020000 /* audio/isdn */ +#define SUN4M_INT_ETHERNET 0x00010000 /* onboard ethernet */ +#define SUN4M_INT_SERIAL 0x00008000 /* serial ports */ +#define SUN4M_INT_KBDMS 0x00004000 /* keyboard/mouse */ +#define SUN4M_INT_SBUSBITS 0x00003F80 /* sbus int bits */ + +#define SUN4M_INT_SBUS(x) (1 << (x+7)) +#define SUN4M_INT_VME(x) (1 << (x)) + #endif diff --git a/trunk/include/asm-sparc/pgtable.h b/trunk/include/asm-sparc/pgtable.h index 2cc235b74d94..a55f4c3488b0 100644 --- a/trunk/include/asm-sparc/pgtable.h +++ b/trunk/include/asm-sparc/pgtable.h @@ -46,6 +46,7 @@ BTFIXUPDEF_SIMM13(user_ptrs_per_pgd) #define pgd_ERROR(e) __builtin_trap() BTFIXUPDEF_INT(page_none) +BTFIXUPDEF_INT(page_shared) BTFIXUPDEF_INT(page_copy) BTFIXUPDEF_INT(page_readonly) BTFIXUPDEF_INT(page_kernel) @@ -65,7 +66,7 @@ BTFIXUPDEF_INT(page_kernel) #define PTE_SIZE (PTRS_PER_PTE*4) #define PAGE_NONE __pgprot(BTFIXUP_INT(page_none)) -extern pgprot_t PAGE_SHARED; +#define PAGE_SHARED __pgprot(BTFIXUP_INT(page_shared)) #define PAGE_COPY __pgprot(BTFIXUP_INT(page_copy)) #define PAGE_READONLY __pgprot(BTFIXUP_INT(page_readonly)) diff --git a/trunk/include/linux/irda.h b/trunk/include/linux/irda.h index 28f88ecba344..8e3735714c1c 100644 --- a/trunk/include/linux/irda.h +++ b/trunk/include/linux/irda.h @@ -77,7 +77,6 @@ typedef enum { IRDA_ACT200L_DONGLE = 10, IRDA_MA600_DONGLE = 11, IRDA_TOIM3232_DONGLE = 12, - IRDA_EP7211_DONGLE = 13, } IRDA_DONGLE; /* Protocol types to be used for SOCK_DGRAM */ diff --git a/trunk/include/linux/netdevice.h b/trunk/include/linux/netdevice.h index 4a616d73cc25..9820ca1e45e2 100644 --- a/trunk/include/linux/netdevice.h +++ b/trunk/include/linux/netdevice.h @@ -575,7 +575,7 @@ struct net_device /* The TX queue control structures */ unsigned int egress_subqueue_count; - struct net_device_subqueue egress_subqueue[1]; + struct net_device_subqueue egress_subqueue[0]; }; #define to_net_dev(d) container_of(d, struct net_device, dev) diff --git a/trunk/net/core/dev.c b/trunk/net/core/dev.c index ee4035571c21..38212c3f9971 100644 --- a/trunk/net/core/dev.c +++ b/trunk/net/core/dev.c @@ -3624,7 +3624,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, /* ensure 32-byte alignment of both the device and private area */ alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST + - (sizeof(struct net_device_subqueue) * (queue_count - 1))) & + (sizeof(struct net_device_subqueue) * queue_count)) & ~NETDEV_ALIGN_CONST; alloc_size += sizeof_priv + NETDEV_ALIGN_CONST; @@ -3642,7 +3642,7 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, dev->priv = ((char *)dev + ((sizeof(struct net_device) + (sizeof(struct net_device_subqueue) * - (queue_count - 1)) + NETDEV_ALIGN_CONST) + queue_count) + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST)); } diff --git a/trunk/net/core/sock.c b/trunk/net/core/sock.c index cfed7d42c485..bd209c4477a9 100644 --- a/trunk/net/core/sock.c +++ b/trunk/net/core/sock.c @@ -182,8 +182,7 @@ static const char *af_family_clock_key_strings[AF_MAX+1] = { "clock-21" , "clock-AF_SNA" , "clock-AF_IRDA" , "clock-AF_PPPOX" , "clock-AF_WANPIPE" , "clock-AF_LLC" , "clock-27" , "clock-28" , "clock-29" , - "clock-AF_TIPC" , "clock-AF_BLUETOOTH", "clock-AF_IUCV" , - "clock-AF_RXRPC" , "clock-AF_MAX" + "clock-AF_TIPC" , "clock-AF_BLUETOOTH", "clock-AF_MAX" }; #endif diff --git a/trunk/net/ipv4/inetpeer.c b/trunk/net/ipv4/inetpeer.c index 771031dfbd0f..6cbce96a54ce 100644 --- a/trunk/net/ipv4/inetpeer.c +++ b/trunk/net/ipv4/inetpeer.c @@ -158,7 +158,7 @@ static void unlink_from_unused(struct inet_peer *p) #define lookup(_daddr,_stack) \ ({ \ struct inet_peer *u, **v; \ - if (_stack != NULL) { \ + if (_stack) { \ stackptr = _stack; \ *stackptr++ = &peer_root; \ } \ @@ -169,7 +169,7 @@ static void unlink_from_unused(struct inet_peer *p) v = &u->avl_left; \ else \ v = &u->avl_right; \ - if (_stack != NULL) \ + if (_stack) \ *stackptr++ = v; \ u = *v; \ } \ diff --git a/trunk/net/ipv6/ip6_tunnel.c b/trunk/net/ipv6/ip6_tunnel.c index df30976f6dfd..281aee42d3f0 100644 --- a/trunk/net/ipv6/ip6_tunnel.c +++ b/trunk/net/ipv6/ip6_tunnel.c @@ -962,8 +962,8 @@ ip4ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev) dsfield = ipv4_get_dsfield(iph); if ((t->parms.flags & IP6_TNL_F_USE_ORIG_TCLASS)) - fl.fl6_flowlabel |= htonl((__u32)iph->tos << IPV6_TCLASS_SHIFT) - & IPV6_TCLASS_MASK; + fl.fl6_flowlabel |= ntohl(((__u32)iph->tos << IPV6_TCLASS_SHIFT) + & IPV6_TCLASS_MASK); err = ip6_tnl_xmit2(skb, dev, dsfield, &fl, encap_limit, &mtu); if (err != 0) { diff --git a/trunk/net/irda/irnetlink.c b/trunk/net/irda/irnetlink.c index 694ea4d92fa8..db716580e1ae 100644 --- a/trunk/net/irda/irnetlink.c +++ b/trunk/net/irda/irnetlink.c @@ -1,7 +1,7 @@ /* * IrDA netlink layer, for stack configuration. * - * Copyright (c) 2007 Samuel Ortiz + * Copyright (c) 2007 Samuel Ortiz * * Partly based on the 802.11 nelink implementation * (see net/wireless/nl80211.c) which is: